const std::string ConnBoshMultStat::getHTTPField( const std::string& field ) { std::string::size_type fp = ci_find( m_bufferHeader, "\r\n" + field + ": " ); if( fp == std::string::npos ) return EmptyString; fp += field.length() + 4; const std::string::size_type fp2 = m_bufferHeader.find( "\r\n", fp ); if( fp2 == std::string::npos ) return EmptyString; return m_bufferHeader.substr( fp, fp2 - fp ); }
int PIGCSControllerDLL::LoadDLL(const std::string& dllName) { printf("PIGCSControllerDLL::LoadDLL(%s)\n",dllName.c_str()); if (ci_find(dllName, "C843_GCS_DLL") != std::string::npos) { dllPrefix_ = "C843_"; gcs2_ = false; } else if (ci_find(dllName, "PI_Mercury_GCS") != std::string::npos) { printf("found Mercury\n"); dllPrefix_ = "Mercury_"; gcs2_ = false; } else if (ci_find(dllName, "E7XX_GCS_DLL") != std::string::npos) { dllPrefix_ = "E7XX_"; gcs2_ = false; umToDefaultUnit_ = 1.0; needResetStages_ = true; onlyIDSTAGEvalid_ = true; } else if (ci_find(dllName, "E816_DLL") != std::string::npos) { dllPrefix_ = "E816_"; umToDefaultUnit_ = 1.0; } #ifdef WIN32 module_ = LoadLibrary(dllName.c_str()); #else module_ = dlopen(dllName.c_str(), RTLD_LAZY); #endif if (module_ == NULL) { printf("load module failed\n"); return DEVICE_INVALID_PROPERTY_VALUE; } ConnectRS232_ = (FP_ConnectRS232)LoadDLLFunc("ConnectRS232"); Connect_ = (FP_Connect)LoadDLLFunc("Connect"); IsConnected_ = (FP_IsConnected)LoadDLLFunc("IsConnected"); CloseConnection_ = (FP_CloseConnection)LoadDLLFunc("CloseConnection"); EnumerateUSB_ = (FP_EnumerateUSB)LoadDLLFunc("EnumerateUSB"); ConnectUSB_ = (FP_ConnectUSB)LoadDLLFunc("ConnectUSB"); GetError_ = (FP_GetError)LoadDLLFunc("GetError"); qIDN_ = (FP_qIDN)LoadDLLFunc("qIDN"); qVER_ = (FP_qVER)LoadDLLFunc("qVER"); INI_ = (FP_INI)LoadDLLFunc("INI"); CST_ = (FP_CST)LoadDLLFunc("CST"); qCST_ = (FP_qCST)LoadDLLFunc("qCST"); qFRF_ = (FP_qFRF)LoadDLLFunc("qFRF"); FRF_ = (FP_FRF)LoadDLLFunc("FRF"); FPL_ = (FP_FPL)LoadDLLFunc("FPL"); FNL_ = (FP_FNL)LoadDLLFunc("FNL"); //IsReferenceOK_ = (FP_IsReferenceOK)LoadDLLFunc("IsReferenceOK"); IsReferencing_ = (FP_IsReferencing)LoadDLLFunc("IsReferencing"); IsControllerReady_ = (FP_IsControllerReady)LoadDLLFunc("IsControllerReady"); IsMoving_ = (FP_IsMoving)LoadDLLFunc("IsMoving"); REF_ = (FP_REF)LoadDLLFunc("REF"); MPL_ = (FP_MPL)LoadDLLFunc("MPL"); MNL_ = (FP_MNL)LoadDLLFunc("MNL"); qPOS_ = (FP_qPOS)LoadDLLFunc("qPOS"); MOV_ = (FP_MOV)LoadDLLFunc("MOV"); STP_ = (FP_STP)LoadDLLFunc("STP"); SVO_ = (FP_SVO)LoadDLLFunc("SVO"); qSVO_ = (FP_qSVO)LoadDLLFunc("qSVO"); JON_ = (FP_JON)LoadDLLFunc("JON"); qJON_ = (FP_qJON)LoadDLLFunc("qJON"); qVEL_ = (FP_qVEL)LoadDLLFunc("qVEL"); VEL_ = (FP_VEL)LoadDLLFunc("VEL"); qTPC_ = (FP_qTPC)LoadDLLFunc("qTPC"); return DEVICE_OK; }