From eb9d96d565875fcc9e7e33b7ac21e6e5bc91639c Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Wed, 19 Jun 2024 12:37:12 -0500 Subject: [PATCH] Convert GB 18030 to UTF-8 iconv -f GB18030 -t UTF-8 --- DeviceAdapters/DahengGalaxy/ClassGalaxy.cpp | 216 +++++++++--------- DeviceAdapters/DahengGalaxy/ClassGalaxy.h | 24 +- DeviceAdapters/Hikrobot/HikrobotCamera.cpp | 104 ++++----- DeviceAdapters/Hikrobot/HikrobotCamera.h | 18 +- DeviceAdapters/Hikrobot/MvCamera.cpp | 66 +++--- DeviceAdapters/Hikrobot/MvCamera.h | 68 +++--- .../Mightex_BLS/Mightex_BLSDriver_SDK.h | 2 +- DeviceAdapters/ZWO/MyASICam2.cpp | 164 ++++++------- DeviceAdapters/ZWO/MyASICam2.h | 10 +- DeviceAdapters/ZWO/SequenceThread.cpp | 2 +- 10 files changed, 337 insertions(+), 337 deletions(-) mode change 100755 => 100644 DeviceAdapters/Mightex_BLS/Mightex_BLSDriver_SDK.h diff --git a/DeviceAdapters/DahengGalaxy/ClassGalaxy.cpp b/DeviceAdapters/DahengGalaxy/ClassGalaxy.cpp index 0c4dc32f9..f6068fda8 100644 --- a/DeviceAdapters/DahengGalaxy/ClassGalaxy.cpp +++ b/DeviceAdapters/DahengGalaxy/ClassGalaxy.cpp @@ -28,7 +28,7 @@ MODULE_API MM::Device* CreateDevice(const char* deviceName) if (deviceName == 0) return 0; - // decide which device class to create based on the deviceName parameter 比较结果 + // decide which device class to create based on the deviceName parameter 姣旇緝缁撴灉 if (strcmp(deviceName, g_CameraDeviceName) == 0) { // create camera return new ClassGalaxy(); @@ -144,19 +144,19 @@ int ClassGalaxy::Initialize() vectorDeviceInfo.clear(); - //枚举设备 + //鏋氫妇璁惧 IGXFactory::GetInstance().UpdateDeviceList(1000, vectorDeviceInfo); - //判断枚举到的设备是否大于零,如果不是则弹框提示 + //鍒ゆ柇鏋氫妇鍒扮殑璁惧鏄惁澶т簬闆讹紝濡傛灉涓嶆槸鍒欏脊妗嗘彁绀 if (vectorDeviceInfo.size() <= 0) { return DEVICE_NOT_CONNECTED; } - //获取可执行程序的当前路径,默认开启第一个 + //鑾峰彇鍙墽琛岀▼搴忕殑褰撳墠璺緞,榛樿寮鍚涓涓 initialized_ = false; // This checks, among other things, that the camera is not already in use. // Without that check, the following CreateDevice() may crash on duplicate - // serial number. Unfortunately, this call is slow. 默认打开第一个设备 + // serial number. Unfortunately, this call is slow. 榛樿鎵撳紑绗竴涓澶 int index = 0; string serialNumberstr = vectorDeviceInfo[index].GetSN().c_str(); @@ -166,13 +166,13 @@ int ClassGalaxy::Initialize() if (strlen(serialNumber) == 0 || strcmp(serialNumber, "Undefined") == 0) return 0; SetProperty("SerialNumber", serialNumber); - //打开设备 + //鎵撳紑璁惧 m_objDevicePtr = IGXFactory::GetInstance().OpenDeviceBySN(vectorDeviceInfo[index].GetSN(), GX_ACCESS_MODE::GX_ACCESS_EXCLUSIVE); m_objFeatureControlPtr = m_objDevicePtr->GetRemoteFeatureControl(); //m_objFeatureControlPtr->GetEnumFeature("StreamBufferHandlingMode")->SetValue("NewestOnly"); - //判断设备流是否大于零,如果大于零则打开流 + //鍒ゆ柇璁惧娴佹槸鍚﹀ぇ浜庨浂锛屽鏋滃ぇ浜庨浂鍒欐墦寮娴 int nStreamCount = m_objDevicePtr->GetStreamCount(); //CPropertyAction* pAct; @@ -187,19 +187,19 @@ int ClassGalaxy::Initialize() } else { - throw exception("未发现设备流!"); + throw exception("鏈彂鐜拌澶囨祦!"); } GX_DEVICE_CLASS_LIST objDeviceClass = m_objDevicePtr->GetDeviceInfo().GetDeviceClass(); if (GX_DEVICE_CLASS_GEV == objDeviceClass) { - // 判断设备是否支持流通道数据包功能 + // 鍒ゆ柇璁惧鏄惁鏀寔娴侀氶亾鏁版嵁鍖呭姛鑳 if (true == m_objFeatureControlPtr->IsImplemented("GevSCPSPacketSize")) { - // 获取当前网络环境的最优包长值 + // 鑾峰彇褰撳墠缃戠粶鐜鐨勬渶浼樺寘闀垮 int nPacketSize = m_objStreamPtr->GetOptimalPacketSize(); - // 将最优包长值设置为当前设备的流通道包长值 + // 灏嗘渶浼樺寘闀垮艰缃负褰撳墠璁惧鐨勬祦閫氶亾鍖呴暱鍊 CIntFeaturePointer GevSCPD = m_objFeatureControlPtr->GetIntFeature("GevSCPSPacketSize"); m_objFeatureControlPtr->GetIntFeature("GevSCPSPacketSize")->SetValue(nPacketSize); m_objFeatureControlPtr->GetIntFeature("GevHeartbeatTimeout")->SetValue(300000); @@ -209,7 +209,7 @@ int ClassGalaxy::Initialize() SetPropertyLimits("InterPacketDelay", (double)GevSCPD->GetMin(), (double)GevSCPD->GetMax()); assert(ret == DEVICE_OK); } - //第二个参数为用户私有参数,用户可以在回调函数内部将其还原然使用,如果不需要则可传入 NULL 即可 + //绗簩涓弬鏁颁负鐢ㄦ埛绉佹湁鍙傛暟锛岀敤鎴峰彲浠ュ湪鍥炶皟鍑芥暟鍐呴儴灏嗗叾杩樺師鐒朵娇鐢紝濡傛灉涓嶉渶瑕佸垯鍙紶鍏 NULL 鍗冲彲 //hDeviceOffline = m_objDevicePtr->RegisterDeviceOfflineCallback(pDeviceOfflineEventHandler, this); } else if (GX_DEVICE_CLASS_U3V == objDeviceClass) @@ -226,7 +226,7 @@ int ClassGalaxy::Initialize() } } - //颜色判断 + //棰滆壊鍒ゆ柇 gxstring strValue = ""; if (m_objDevicePtr->GetRemoteFeatureControl()->IsImplemented("PixelColorFilter")) { @@ -243,7 +243,7 @@ int ClassGalaxy::Initialize() //AddToLog(msg.str()); msg << "using camera " << m_objFeatureControlPtr->GetStringFeature("DeviceUserID")->GetValue(); AddToLog(msg.str()); - // initialize the pylon image formatter. 判断相机图像输出格式-赵伟甫 + // initialize the pylon image formatter. 鍒ゆ柇鐩告満鍥惧儚杈撳嚭鏍煎紡-璧典紵鐢 // // Name int ret = CreateProperty(MM::g_Keyword_Name, g_CameraDeviceName, MM::String, true); @@ -262,12 +262,12 @@ int ClassGalaxy::Initialize() //Get information about camera (e.g. height, width, byte depth) //check if given Camera support event. //Register Camera events - //赵伟甫:注册相机事件,注册采集回调-未加 温度事件 + //璧典紵鐢細娉ㄥ唽鐩告満浜嬩欢锛屾敞鍐岄噰闆嗗洖璋-鏈姞 娓╁害浜嬩欢 CIntFeaturePointer width = m_objFeatureControlPtr->GetIntFeature("Width"); CIntFeaturePointer height = m_objFeatureControlPtr->GetIntFeature("Height"); - //总属性器 + //鎬诲睘鎬у櫒 if (1) { CPropertyAction* pAct = new CPropertyAction(this, &ClassGalaxy::OnWidth); @@ -290,7 +290,7 @@ int ClassGalaxy::Initialize() //end of Sensor size long bytes = (long)(height->GetValue() * width->GetValue() * 4); - //20221020赵伟甫 + //20221020璧典紵鐢 //Buffer4ContinuesShot = malloc(bytes); @@ -309,7 +309,7 @@ int ClassGalaxy::Initialize() vector pixelTypeValues; CEnumFeaturePointer PixelFormatList = m_objFeatureControlPtr->GetEnumFeature("PixelFormat"); gxstring_vector LisePixelFormat = PixelFormatList->GetEnumEntryList(); - //为了赋值用 + //涓轰簡璧嬪肩敤 for (size_t i = 0; i < LisePixelFormat.size(); i++) { string strValue(LisePixelFormat[i]); @@ -388,7 +388,7 @@ int ClassGalaxy::Initialize() } SetAllowedValues("TriggerSource", LSPVals); } - //20230217设置期望帧率使能 + //20230217璁剧疆鏈熸湜甯х巼浣胯兘 if (m_objDevicePtr->GetRemoteFeatureControl()->IsImplemented("AcquisitionFrameRateMode")) { CEnumFeaturePointer AdjFrameRateMode = m_objFeatureControlPtr->GetEnumFeature("AcquisitionFrameRateMode"); @@ -409,7 +409,7 @@ int ClassGalaxy::Initialize() CFloatFeaturePointer AdjFrameRate = m_objFeatureControlPtr->GetFloatFeature("AcquisitionFrameRate"); pAct = new CPropertyAction(this, &ClassGalaxy::OnAcquisitionFrameRate); ret = CreateProperty("AcquisitionFrameRate", CDeviceUtils::ConvertToString((float)0), MM::Float, false, pAct); - //当前采集帧率需重新计算 + //褰撳墠閲囬泦甯х巼闇閲嶆柊璁$畻 SetPropertyLimits("AcquisitionFrameRate", (double)AdjFrameRate->GetMin(), (double)AdjFrameRate->GetMax()); assert(ret == DEVICE_OK); } @@ -455,7 +455,7 @@ int ClassGalaxy::Initialize() assert(ret == DEVICE_OK); } - //增益 + //澧炵泭 m_objFeatureControlPtr->GetEnumFeature("GainSelector")->SetValue("AnalogAll"); m_objFeatureControlPtr->GetFloatFeature("Gain")->SetValue(0.0000); double d = m_objFeatureControlPtr->GetFloatFeature("Gain")->GetValue(); @@ -468,7 +468,7 @@ int ClassGalaxy::Initialize() SetPropertyLimits("Gain", (double)Gain->GetMin(), (double)Gain->GetMax()); assert(ret == DEVICE_OK); } - //20230220设置图像转换RGBA8 + //20230220璁剧疆鍥惧儚杞崲RGBA8 ret = UpdateStatus(); if (ret != DEVICE_OK) @@ -500,7 +500,7 @@ void ClassGalaxy::CoverToRGB(GX_PIXEL_FORMAT_ENTRY emDstFormat,void* DstBuffer, TestFormatConvertPtr->SetAlphaValue(255); uint64_t Size = TestFormatConvertPtr->GetBufferSizeForConversion(pObjSrcImageData); TestFormatConvertPtr->Convert(pObjSrcImageData, DstBuffer, Size, false); //modify by LXM in 20240305 - //注意都能显示16位图像RGB + //娉ㄦ剰閮借兘鏄剧ず16浣嶅浘鍍廟GB } catch (CGalaxyException& e) { @@ -524,7 +524,7 @@ int ClassGalaxy::CheckForBinningMode(CPropertyAction* pAct) vector LSPVals; gxstring_vector LiseBinningHorizontalMode = BinningHorizontalMode->GetEnumEntryList(); - //为了赋值用 + //涓轰簡璧嬪肩敤 for (size_t i = 0; i < LiseBinningHorizontalMode.size(); i++) { string strValue(LiseBinningHorizontalMode[i]); @@ -574,17 +574,17 @@ int ClassGalaxy::OnBinningMode(MM::PropertyBase* pProp, MM::ActionType eAct) } int ClassGalaxy::Shutdown() { - //关闭相机 + //鍏抽棴鐩告満 try { - //判断是否停止采集 + //鍒ゆ柇鏄惁鍋滄閲囬泦 if (m_objStreamFeatureControlPtr->GetBoolFeature("StreamIsGrabbing")->GetValue()) { - //发送停采命令 + //鍙戦佸仠閲囧懡浠 m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); - //注销采集回调函数 + //娉ㄩ攢閲囬泦鍥炶皟鍑芥暟 m_objStreamPtr->UnregisterCaptureCallback(); } @@ -595,10 +595,10 @@ int ClassGalaxy::Shutdown() } try { - //关闭流对象 + //鍏抽棴娴佸璞 m_objStreamPtr->Close(); - //关闭设备 + //鍏抽棴璁惧 m_objDevicePtr->Close(); } catch (CGalaxyException& e) @@ -625,7 +625,7 @@ int ClassGalaxy::SnapImage() // modify by LXM in 20240305 //if (m_bIsOpen) { - //AddToLog("---------------判断是否开采"); + //AddToLog("---------------鍒ゆ柇鏄惁寮閲"); m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); m_objStreamPtr->StopGrab(); //camera_->DeregisterImageEventHandler(ImageHandler_); @@ -640,13 +640,13 @@ int ClassGalaxy::SnapImage() //end modify int timeout_ms = 5000; - //开启流层采集 + //寮鍚祦灞傞噰闆 m_objStreamPtr->StartGrab(); - //发送开采命令 + //鍙戦佸紑閲囧懡浠 m_objFeatureControlPtr->GetCommandFeature("AcquisitionStart")->Execute(); m_bIsOpen = true;//modify by LXM m_objStreamPtr->FlushQueue(); - //可以使用采单帧来获取 + //鍙互浣跨敤閲囧崟甯ф潵鑾峰彇 CImageDataPointer ptrGrabResult = m_objStreamPtr->GetImage(timeout_ms); uint64_t length = ptrGrabResult->GetPayloadSize(); @@ -663,7 +663,7 @@ int ClassGalaxy::SnapImage() string a = e.what(); AddToLog(e.what()); m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); return DEVICE_ERR; } @@ -671,7 +671,7 @@ int ClassGalaxy::SnapImage() { AddToLog(e.what()); m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); return DEVICE_ERR; } @@ -690,9 +690,9 @@ void ClassGalaxy::CopyToImageBuffer(CImageDataPointer& objImageDataPointer) std::size_t found = pixelType_.find(subject); //pixelType_.assign(pixelFormat_gx); - //相机类型-明确相机的输出形式--待确认 + //鐩告満绫诲瀷-鏄庣‘鐩告満鐨勮緭鍑哄舰寮--寰呯‘璁 GX_VALID_BIT_LIST emValidBits = GX_BIT_0_7; - //明确相机的采图格式 + //鏄庣‘鐩告満鐨勯噰鍥炬牸寮 emValidBits = GetBestValudBit(objImageDataPointer->GetPixelFormat()); if (found != std::string::npos) @@ -707,10 +707,10 @@ void ClassGalaxy::CopyToImageBuffer(CImageDataPointer& objImageDataPointer) memcpy(imgBuffer_, buffer, GetImageBufferSize()); SetProperty(MM::g_Keyword_PixelType, g_PixelType_8bit); } - //20221025待定其他颜色格式 + //20221025寰呭畾鍏朵粬棰滆壊鏍煎紡 else if (pixelType_.compare("Mono16") == 0 || pixelType_.compare("Mono12") == 0 || pixelType_.compare("Mono10") == 0) { - //黑白8-16位 + //榛戠櫧8-16浣 //copy image buffer to a snap buffer allocated by device adapter void* buffer = objImageDataPointer->GetBuffer(); memcpy(imgBuffer_, buffer, GetImageBufferSize()); @@ -761,7 +761,7 @@ int ClassGalaxy::StartSequenceAcquisition(long /* numImages */, double /* interv //camera_->StartGrabbing(numImages, GrabStrategy_OneByOne, GrabLoop_ProvidedByInstantCamera); m_objFeatureControlPtr->GetCommandFeature("AcquisitionStart")->Execute(); - //开启流层采集 + //寮鍚祦灞傞噰闆 m_objStreamPtr->StartGrab(); int ret = GetCoreCallback()->PrepareForAcq(this); @@ -776,7 +776,7 @@ int ClassGalaxy::StartSequenceAcquisition(long /* numImages */, double /* interv string a = e.what(); AddToLog(e.what()); m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); return DEVICE_ERR; } @@ -784,7 +784,7 @@ int ClassGalaxy::StartSequenceAcquisition(long /* numImages */, double /* interv { AddToLog(e.what()); m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); return DEVICE_ERR; } @@ -797,7 +797,7 @@ int ClassGalaxy::StartSequenceAcquisition(double /* interval_ms */) { //modify by LXM in 20240306 //if (m_bIsOpen) { - //AddToLog("---------------判断是否开采"); + //AddToLog("---------------鍒ゆ柇鏄惁寮閲"); m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); m_objStreamPtr->StopGrab(); } @@ -813,7 +813,7 @@ int ClassGalaxy::StartSequenceAcquisition(double /* interval_ms */) { } //camera_->StartGrabbing(numImages, GrabStrategy_OneByOne, GrabLoop_ProvidedByInstantCamera); m_objFeatureControlPtr->GetCommandFeature("AcquisitionStart")->Execute(); - //开启流层采集 + //寮鍚祦灞傞噰闆 m_objStreamPtr->StartGrab(); AddToLog("StartSequenceAcquisition"); } @@ -822,7 +822,7 @@ int ClassGalaxy::StartSequenceAcquisition(double /* interval_ms */) { string a = e.what(); AddToLog(e.what()); m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); return DEVICE_ERR; } @@ -830,7 +830,7 @@ int ClassGalaxy::StartSequenceAcquisition(double /* interval_ms */) { { AddToLog(e.what()); m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); return DEVICE_ERR; } @@ -863,14 +863,14 @@ void ClassGalaxy::ResizeSnapBuffer() { free(imgBuffer_); GetImageSize(); - imageBufferSize_ = Width_ * Height_ * GetImageBytesPerPixel();//原先是buffersize + imageBufferSize_ = Width_ * Height_ * GetImageBytesPerPixel();//鍘熷厛鏄痓uffersize imgBuffer_ = malloc(imageBufferSize_); } bool ClassGalaxy::__IsPixelFormat8(GX_PIXEL_FORMAT_ENTRY emPixelFormatEntry) { bool bIsPixelFormat8 = false; - const unsigned PIXEL_FORMATE_BIT = 0x00FF0000; ///<用于与当前的数据格式进行与运算得到当前的数据位数 + const unsigned PIXEL_FORMATE_BIT = 0x00FF0000; ///<鐢ㄤ簬涓庡綋鍓嶇殑鏁版嵁鏍煎紡杩涜涓庤繍绠楀緱鍒板綋鍓嶇殑鏁版嵁浣嶆暟 unsigned uiPixelFormatEntry = (unsigned)emPixelFormatEntry; if ((uiPixelFormatEntry & PIXEL_FORMATE_BIT) == GX_PIXEL_8BIT) { @@ -886,9 +886,9 @@ unsigned char* ClassGalaxy::GetImageBufferFromCallBack(CImageDataPointer& objIma INT64 Width_ = m_objFeatureControlPtr->GetIntFeature("Width")->GetValue(); INT64 Height_ = m_objFeatureControlPtr->GetIntFeature("Height")->GetValue(); - //相机类型-明确相机的输出形式--待确认 + //鐩告満绫诲瀷-鏄庣‘鐩告満鐨勮緭鍑哄舰寮--寰呯‘璁 GX_VALID_BIT_LIST emValidBits = GX_BIT_0_7; - //明确相机的采图格式 + //鏄庣‘鐩告満鐨勯噰鍥炬牸寮 emValidBits = GetBestValudBit(objImageDataPointer->GetPixelFormat()); if (colorCamera_) @@ -906,22 +906,22 @@ unsigned char* ClassGalaxy::GetImageBufferFromCallBack(CImageDataPointer& objIma imgBuffer_2 = (BYTE*)objImageDataPointer->ConvertToRaw8(emValidBits); } - // 黑白相机需要翻转数据后显示 + // 榛戠櫧鐩告満闇瑕佺炕杞暟鎹悗鏄剧ず for (int i = 0; i < Height_; i++) { - //含义 + //鍚箟 memcpy(m_pImageBuffer + i * Width_, imgBuffer_2 + (Height_ - i - 1) * Width_, (size_t)Width_); return (unsigned char*)imgBuffer_; } } - //获取图像buffer + //鑾峰彇鍥惧儚buffer return (unsigned char*)imgBuffer_; } const unsigned char* ClassGalaxy::GetImageBuffer() { - //按照黑白显示 + //鎸夌収榛戠櫧鏄剧ず return (unsigned char*)imgBuffer_; } @@ -980,7 +980,7 @@ int ClassGalaxy::OnBinning(MM::PropertyBase* pProp, MM::ActionType eAct) if (Isgrabbing) { m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); } pProp->Get(binningFactor_); @@ -989,7 +989,7 @@ int ClassGalaxy::OnBinning(MM::PropertyBase* pProp, MM::ActionType eAct) BinningVertical->SetValue(val); if (Isgrabbing) { - //重开 + //閲嶅紑 m_objFeatureControlPtr->GetCommandFeature("AcquisitionStart")->Execute(); m_objStreamPtr->StartGrab(); @@ -1123,7 +1123,7 @@ int ClassGalaxy::OnHeight(MM::PropertyBase* pProp, MM::ActionType eAct) if (Isgrabbing) { m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); //camera_->StopGrabbing(); } @@ -1181,7 +1181,7 @@ int ClassGalaxy::OnPixelType(MM::PropertyBase* pProp, MM::ActionType eAct) if (m_objStreamFeatureControlPtr->GetBoolFeature("StreamIsGrabbing")->GetValue()) { m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); } //CEnumerationPtr pixelFormat(nodeMap_->GetNode("PixelFormat")); @@ -1192,9 +1192,9 @@ int ClassGalaxy::OnPixelType(MM::PropertyBase* pProp, MM::ActionType eAct) pProp->Get(pixelType_); try { - //代码报错 + //浠g爜鎶ラ敊 - //设置新值 + //璁剧疆鏂板 pixelFormat_->SetValue(pixelType_.c_str()); const char* subject("Bayer"); std::size_t found = pixelType_.find(subject); @@ -1262,7 +1262,7 @@ int ClassGalaxy::OnPixelType(MM::PropertyBase* pProp, MM::ActionType eAct) if (m_objStreamFeatureControlPtr->GetBoolFeature("StreamIsGrabbing")->GetValue()) { - //重开 + //閲嶅紑 m_objFeatureControlPtr->GetCommandFeature("AcquisitionStart")->Execute(); m_objStreamPtr->StartGrab(); } @@ -1413,7 +1413,7 @@ int ClassGalaxy::OnWidth(MM::PropertyBase* pProp, MM::ActionType eAct) if (m_objStreamFeatureControlPtr->GetBoolFeature("StreamIsGrabbing")->GetValue()) { m_objFeatureControlPtr->GetCommandFeature("AcquisitionStop")->Execute(); - //关闭流层采集 + //鍏抽棴娴佸眰閲囬泦 m_objStreamPtr->StopGrab(); //camera_->StopGrabbing(); } @@ -1641,7 +1641,7 @@ int ClassGalaxy::ClearROI() void ClassGalaxy::ReduceImageSize(int64_t Width, int64_t Height) { - //待定 + //寰呭畾 return ; } @@ -1666,7 +1666,7 @@ void ClassGalaxy::RGB24PackedToRGBA(void* destbuffer, void* srcbuffer, CImageDat unsigned int dstOffset = 0; GX_VALID_BIT_LIST emValidBits = GX_BIT_0_7; uint64_t Payloadsize=objImageDataPointer->GetPayloadSize(); - //明确相机的采图格式 + //鏄庣‘鐩告満鐨勯噰鍥炬牸寮 emValidBits = GetBestValudBit(objImageDataPointer->GetPixelFormat()); if (emValidBits!= GX_BIT_0_7) { @@ -1694,19 +1694,19 @@ void ClassGalaxy::RG8ToRGB24Packed(void* destbuffer,CImageDataPointer& objImageD return;*/ //end modify - //RG8转RGB24 + //RG8杞琑GB24 try { GX_VALID_BIT_LIST emValidBits = GX_BIT_0_7; - //明确相机的采图格式 + //鏄庣‘鐩告満鐨勯噰鍥炬牸寮 emValidBits = GetBestValudBit(objImageDataPointer->GetPixelFormat()); - //为了显示,需要都转成Raw8位 + //涓轰簡鏄剧ず锛岄渶瑕侀兘杞垚Raw8浣 if (emValidBits!= GX_BIT_0_7) { return; } - //RGB24Packed-大小乘以3 + //RGB24Packed-澶у皬涔樹互3 void* buffer = objImageDataPointer->ConvertToRGB24(emValidBits, GX_RAW2RGB_NEIGHBOUR, false); RGB24PackedToRGBA(destbuffer, buffer, objImageDataPointer); AddToLog("RG8ToRGB24Packed"); @@ -1740,7 +1740,7 @@ void ClassGalaxy::RG10ToRGB24Packed(void* pRGB24Bufdest, CImageDataPointer& objI { if (0) { - //转成RGB8*2,在转成RGBA8*2*4 + //杞垚RGB8*2锛屽湪杞垚RGBA8*2*4 size_t BufferSize = GetImageSizeLarge() * 3 * sizeof(unsigned short int); void* RGB16 = malloc(BufferSize); @@ -1761,7 +1761,7 @@ void ClassGalaxy::RG10ToRGB24Packed(void* pRGB24Bufdest, CImageDataPointer& objI GX_VALID_BIT_LIST emValidBits = GX_BIT_0_7; - //明确相机的采图格式 + //鏄庣‘鐩告満鐨勯噰鍥炬牸寮 emValidBits = GetBestValudBit(objImageDataPointer->GetPixelFormat()); BYTE* pRGB24Buf2 = (BYTE*)objImageDataPointer->ConvertToRGB24(emValidBits, GX_RAW2RGB_NEIGHBOUR, false); @@ -1820,7 +1820,7 @@ GX_VALID_BIT_LIST ClassGalaxy::GetBestValudBit(GX_PIXEL_FORMAT_ENTRY emPixelForm } case GX_PIXEL_FORMAT_MONO14: { - //暂时没有这样的数据格式待升级 + //鏆傛椂娌℃湁杩欐牱鐨勬暟鎹牸寮忓緟鍗囩骇 break; } case GX_PIXEL_FORMAT_MONO16: @@ -1829,7 +1829,7 @@ GX_VALID_BIT_LIST ClassGalaxy::GetBestValudBit(GX_PIXEL_FORMAT_ENTRY emPixelForm case GX_PIXEL_FORMAT_BAYER_GB16: case GX_PIXEL_FORMAT_BAYER_BG16: { - //暂时没有这样的数据格式待升级 + //鏆傛椂娌℃湁杩欐牱鐨勬暟鎹牸寮忓緟鍗囩骇 if (emPixelFormatEntry != GX_PIXEL_FORMAT_MONO16) { IsByerFormat = true; @@ -1847,10 +1847,10 @@ CircularBufferInserter::CircularBufferInserter(ClassGalaxy* dev) : {} //--------------------------------------------------------------------------------- /** - \brief 采集回调函数 - \param objImageDataPointer 图像处理参数 - \param pFrame 用户参数 - \return 无 + \brief 閲囬泦鍥炶皟鍑芥暟 + \param objImageDataPointer 鍥惧儚澶勭悊鍙傛暟 + \param pFrame 鐢ㄦ埛鍙傛暟 + \return 鏃 */ //---------------------------------------------------------------------------------- void CircularBufferInserter::DoOnImageCaptured(CImageDataPointer& objImageDataPointer, void* pUserParam) @@ -1867,11 +1867,11 @@ void CircularBufferInserter::DoOnImageCaptured(CImageDataPointer& objImageDataPo // Image grabbed successfully ? if (objImageDataPointer->GetStatus()== GX_FRAME_STATUS_SUCCESS) { - //查询图像格式 + //鏌ヨ鍥惧儚鏍煎紡 GX_PIXEL_FORMAT_ENTRY pixelFormat_gx = objImageDataPointer->GetPixelFormat(); dev_->ResizeSnapBuffer(); - //黑白 + //榛戠櫧 if (!dev_->colorCamera_) { //copy to intermediate buffer @@ -1885,7 +1885,7 @@ void CircularBufferInserter::DoOnImageCaptured(CImageDataPointer& objImageDataPo } else if (dev_->colorCamera_) { - //彩色,注意这里全部转成8位RGB + //褰╄壊锛屾敞鎰忚繖閲屽叏閮ㄨ浆鎴8浣峈GB if (dev_->__IsPixelFormat8(pixelFormat_gx)) { dev_->RG8ToRGB24Packed(dev_->imgBuffer_, objImageDataPointer); @@ -1905,7 +1905,7 @@ void CircularBufferInserter::DoOnImageCaptured(CImageDataPointer& objImageDataPo } else { - dev_->AddToLog("残帧"); + dev_->AddToLog("娈嬪抚"); } @@ -1932,7 +1932,7 @@ bool ClassGalaxy::__IsCompatible(BITMAPINFO* pBmpInfo, uint64_t nWidth, uint64_t void ClassGalaxy::__ColorPrepareForShowImg() { //-------------------------------------------------------------------- - //---------------------------初始化bitmap头--------------------------- + //---------------------------鍒濆鍖朾itmap澶--------------------------- m_pBmpInfo = (BITMAPINFO*)m_chBmpBuf; m_pBmpInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); m_pBmpInfo->bmiHeader.biWidth = (LONG)Width_; @@ -1972,7 +1972,7 @@ void ClassGalaxy::SaveBmp(CImageDataPointer& objCImageDataPointer, const std::st throw std::runtime_error("Argument is error"); } - //检查图像是否改变并更新Buffer + //妫鏌ュ浘鍍忔槸鍚︽敼鍙樺苟鏇存柊Buffer __UpdateBitmap(objCImageDataPointer); emValidBits = GetBestValudBit(objCImageDataPointer->GetPixelFormat()); @@ -1993,7 +1993,7 @@ void ClassGalaxy::SaveBmp(CImageDataPointer& objCImageDataPointer, const std::st { pBuffer = (BYTE*)objCImageDataPointer->ConvertToRaw8(emValidBits); } - // 黑白相机需要翻转数据后显示 + // 榛戠櫧鐩告満闇瑕佺炕杞暟鎹悗鏄剧ず for (unsigned int i = 0; i < Height_; i++) { memcpy(m_pImageBuffer + i * Width_, pBuffer + (Height_ - i - 1) * Width_, (size_t)Width_); @@ -2005,23 +2005,23 @@ void ClassGalaxy::SaveBmp(CImageDataPointer& objCImageDataPointer, const std::st BITMAPFILEHEADER stBfh = { 0 }; DWORD dwBytesRead = 0; - stBfh.bfType = (WORD)'M' << 8 | 'B'; //定义文件类型 + stBfh.bfType = (WORD)'M' << 8 | 'B'; //瀹氫箟鏂囦欢绫诲瀷 stBfh.bfOffBits = colorCamera_ ? sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) - : sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (256 * 4); //定义文件头大小true为彩色,false为黑白 - stBfh.bfSize = stBfh.bfOffBits + dwImageSize; //文件大小 + : sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (256 * 4); //瀹氫箟鏂囦欢澶村ぇ灏弔rue涓哄僵鑹,false涓洪粦鐧 + stBfh.bfSize = stBfh.bfOffBits + dwImageSize; //鏂囦欢澶у皬 DWORD dwBitmapInfoHeader = colorCamera_ ? sizeof(BITMAPINFOHEADER) - : sizeof(BITMAPINFOHEADER) + (256 * 4); //定义BitmapInfoHeader大小true为彩色,false为黑白 + : sizeof(BITMAPINFOHEADER) + (256 * 4); //瀹氫箟BitmapInfoHeader澶у皬true涓哄僵鑹,false涓洪粦鐧 const char* strEn = strFilePath.c_str(); - //将const char*转化为LPCTSTR + //灏哻onst char*杞寲涓篖PCTSTR size_t length = sizeof(TCHAR) * (strlen(strEn) + 1); LPTSTR tcBuffer = new TCHAR[length]; memset(tcBuffer, 0, length); MultiByteToWideChar(CP_ACP, 0, strEn, (int) strlen(strEn), tcBuffer, (int) length); LPCTSTR pDest = (LPCTSTR)tcBuffer; - //创建文件 + //鍒涘缓鏂囦欢 HANDLE hFile = ::CreateFile(pDest, GENERIC_WRITE, 0, @@ -2035,7 +2035,7 @@ void ClassGalaxy::SaveBmp(CImageDataPointer& objCImageDataPointer, const std::st throw std::runtime_error("Handle is invalid"); } ::WriteFile(hFile, &stBfh, sizeof(BITMAPFILEHEADER), &dwBytesRead, NULL); - ::WriteFile(hFile, m_pBmpInfo, dwBitmapInfoHeader, &dwBytesRead, NULL); //黑白和彩色自适应 + ::WriteFile(hFile, m_pBmpInfo, dwBitmapInfoHeader, &dwBytesRead, NULL); //榛戠櫧鍜屽僵鑹茶嚜閫傚簲 ::WriteFile(hFile, pBuffer, dwImageSize, &dwBytesRead, NULL); CloseHandle(hFile); } @@ -2049,7 +2049,7 @@ void ClassGalaxy::SaveBmp(CImageDataPointer& objCImageDataPointer,void* buffer,c throw std::runtime_error("Argument is error"); } - //检查图像是否改变并更新Buffer + //妫鏌ュ浘鍍忔槸鍚︽敼鍙樺苟鏇存柊Buffer __UpdateBitmap(objCImageDataPointer); emValidBits = GetBestValudBit(objCImageDataPointer->GetPixelFormat()); @@ -2070,7 +2070,7 @@ void ClassGalaxy::SaveBmp(CImageDataPointer& objCImageDataPointer,void* buffer,c { pBuffer = (BYTE*)objCImageDataPointer->ConvertToRaw8(emValidBits); } - // 黑白相机需要翻转数据后显示 + // 榛戠櫧鐩告満闇瑕佺炕杞暟鎹悗鏄剧ず for (unsigned int i = 0; i < Height_; i++) { memcpy(m_pImageBuffer + i * Width_, pBuffer + (Height_ - i - 1) * Width_, (size_t)Width_); @@ -2082,23 +2082,23 @@ void ClassGalaxy::SaveBmp(CImageDataPointer& objCImageDataPointer,void* buffer,c BITMAPFILEHEADER stBfh = { 0 }; DWORD dwBytesRead = 0; - stBfh.bfType = (WORD)'M' << 8 | 'B'; //定义文件类型 + stBfh.bfType = (WORD)'M' << 8 | 'B'; //瀹氫箟鏂囦欢绫诲瀷 stBfh.bfOffBits = colorCamera_ ? sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) - : sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (256 * 4); //定义文件头大小true为彩色,false为黑白 - stBfh.bfSize = stBfh.bfOffBits + dwImageSize; //文件大小 + : sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (256 * 4); //瀹氫箟鏂囦欢澶村ぇ灏弔rue涓哄僵鑹,false涓洪粦鐧 + stBfh.bfSize = stBfh.bfOffBits + dwImageSize; //鏂囦欢澶у皬 DWORD dwBitmapInfoHeader = colorCamera_ ? sizeof(BITMAPINFOHEADER) - : sizeof(BITMAPINFOHEADER) + (256 * 4); //定义BitmapInfoHeader大小true为彩色,false为黑白 + : sizeof(BITMAPINFOHEADER) + (256 * 4); //瀹氫箟BitmapInfoHeader澶у皬true涓哄僵鑹,false涓洪粦鐧 const char* strEn = strFilePath.c_str(); - //将const char*转化为LPCTSTR + //灏哻onst char*杞寲涓篖PCTSTR size_t length = sizeof(TCHAR) * (strlen(strEn) + 1); LPTSTR tcBuffer = new TCHAR[length]; memset(tcBuffer, 0, length); MultiByteToWideChar(CP_ACP, 0, strEn, (int) strlen(strEn), tcBuffer, (int) length); LPCTSTR pDest = (LPCTSTR)tcBuffer; - //创建文件 + //鍒涘缓鏂囦欢 HANDLE hFile = ::CreateFile(pDest, GENERIC_WRITE, 0, @@ -2112,7 +2112,7 @@ void ClassGalaxy::SaveBmp(CImageDataPointer& objCImageDataPointer,void* buffer,c throw std::runtime_error("Handle is invalid"); } ::WriteFile(hFile, &stBfh, sizeof(BITMAPFILEHEADER), &dwBytesRead, NULL); - ::WriteFile(hFile, m_pBmpInfo, dwBitmapInfoHeader, &dwBytesRead, NULL); //黑白和彩色自适应 + ::WriteFile(hFile, m_pBmpInfo, dwBitmapInfoHeader, &dwBytesRead, NULL); //榛戠櫧鍜屽僵鑹茶嚜閫傚簲 //::WriteFile(hFile, pBuffer, dwImageSize, &dwBytesRead, NULL); ::WriteFile(hFile, buffer, dwImageSize, &dwBytesRead, NULL); @@ -2126,23 +2126,23 @@ void ClassGalaxy::SaveRaw(CImageDataPointer& objCImageDataPointer, const std::st throw std::runtime_error("Argument is error"); } - //检查图像是否改变并更新Buffer + //妫鏌ュ浘鍍忔槸鍚︽敼鍙樺苟鏇存柊Buffer __UpdateBitmap(objCImageDataPointer); - DWORD dwImageSize = (DWORD)objCImageDataPointer->GetPayloadSize(); // 写入文件的长度 - DWORD dwBytesRead = 0; // 文件读取的长度 + DWORD dwImageSize = (DWORD)objCImageDataPointer->GetPayloadSize(); // 鍐欏叆鏂囦欢鐨勯暱搴 + DWORD dwBytesRead = 0; // 鏂囦欢璇诲彇鐨勯暱搴 BYTE* pbuffer = (BYTE*)objCImageDataPointer->GetBuffer(); const char* strEn = strFilePath.c_str(); - //将const char*转化为LPCTSTR + //灏哻onst char*杞寲涓篖PCTSTR size_t length = sizeof(TCHAR) * (strlen(strEn) + 1); LPTSTR tcBuffer = new TCHAR[length]; memset(tcBuffer, 0, length); MultiByteToWideChar(CP_ACP, 0, strEn, (int) strlen(strEn), tcBuffer, (int) length); LPCTSTR pDest = (LPCTSTR)tcBuffer; - // 创建文件 + // 鍒涘缓鏂囦欢 HANDLE hFile = ::CreateFile(pDest, GENERIC_WRITE, FILE_SHARE_READ, @@ -2151,11 +2151,11 @@ void ClassGalaxy::SaveRaw(CImageDataPointer& objCImageDataPointer, const std::st FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) // 创建失败则返回 + if (hFile == INVALID_HANDLE_VALUE) // 鍒涘缓澶辫触鍒欒繑鍥 { throw std::runtime_error("Handle is invalid"); } - else // 保存Raw图像 + else // 淇濆瓨Raw鍥惧儚 { ::WriteFile(hFile, pbuffer, dwImageSize, &dwBytesRead, NULL); CloseHandle(hFile); diff --git a/DeviceAdapters/DahengGalaxy/ClassGalaxy.h b/DeviceAdapters/DahengGalaxy/ClassGalaxy.h index 10510616c..d9e614883 100644 --- a/DeviceAdapters/DahengGalaxy/ClassGalaxy.h +++ b/DeviceAdapters/DahengGalaxy/ClassGalaxy.h @@ -10,7 +10,7 @@ //#include "DxImageProc.h" //--------------------------------------------------------------------------------- /** -\brief 用户继承采集事件处理类,回调函数,重点关注 类中有回调类,供采集图像 +\brief 鐢ㄦ埛缁ф壙閲囬泦浜嬩欢澶勭悊绫伙紝鍥炶皟鍑芥暟锛岄噸鐐瑰叧娉 绫讳腑鏈夊洖璋冪被锛屼緵閲囬泦鍥惧儚 */ //---------------------------------------------------------------------------------- #include @@ -37,7 +37,7 @@ class MODULE_API ClassGalaxy : public CCameraBase public: ClassGalaxy(); - //函数的意义-析构函数 delete时,启用; + //鍑芥暟鐨勬剰涔-鏋愭瀯鍑芥暟 delete鏃讹紝鍚敤; ~ClassGalaxy(void); // MMDevice API @@ -93,7 +93,7 @@ class MODULE_API ClassGalaxy : public CCameraBase //void UpdateTemperature(); /** - * Starts continuous acquisition. live模式,但是以下函数没有写也会开启live模式,开启该函数之后,软件会卡死,内部有函数 + * Starts continuous acquisition. live妯″紡锛屼絾鏄互涓嬪嚱鏁版病鏈夊啓涔熶細寮鍚痩ive妯″紡锛屽紑鍚鍑芥暟涔嬪悗锛岃蒋浠朵細鍗℃锛屽唴閮ㄦ湁鍑芥暟 */ int StartSequenceAcquisition(long numImages, double interval_ms, bool stopOnOverflow) final ; int StartSequenceAcquisition(double interval_ms) final; @@ -143,10 +143,10 @@ class MODULE_API ClassGalaxy : public CCameraBase int OnTriggerDelay(MM::PropertyBase* pProp, MM::ActionType eAct); int OnTriggerFilterRaisingEdge(MM::PropertyBase* pProp, MM::ActionType eAct); - //为了实现在采集类中使用 + //涓轰簡瀹炵幇鍦ㄩ噰闆嗙被涓娇鐢 bool colorCamera_; - CGXFeatureControlPointer m_objFeatureControlPtr; ///< 属性控制器 - //格式转换函数 + CGXFeatureControlPointer m_objFeatureControlPtr; ///< 灞炴ф帶鍒跺櫒 + //鏍煎紡杞崲鍑芥暟 void RG8ToRGB24Packed(void* destbuffer, CImageDataPointer& objImageDataPointer); void CoverRGB16ToRGBA16(unsigned short int* Desbuffer, unsigned short int* Srcbuffer); void RG10ToRGB24Packed(void* destbuffer, CImageDataPointer& objImageDataPointer); @@ -190,8 +190,8 @@ class MODULE_API ClassGalaxy : public CCameraBase std::string TriggerDelay_; std::string TriggerFilterRaisingEdge_; - BITMAPINFO* m_pBmpInfo; /// ImgBuffer img_; bool initialized_; - //图像转换 + //鍥惧儚杞崲 CGXImageFormatConvertPointer TestFormatConvertPtr; int64_t __GetStride(int64_t nWidth, bool bIsColor); @@ -210,9 +210,9 @@ class MODULE_API ClassGalaxy : public CCameraBase unsigned char* imgBuffer_2; unsigned char* m_pImageBuffer; - CGXDevicePointer m_objDevicePtr; ///< 设备句柄 - CGXStreamPointer m_objStreamPtr; ///< 设备流 - CGXFeatureControlPointer m_objStreamFeatureControlPtr; ///< 流层控制器对象 + CGXDevicePointer m_objDevicePtr; ///< 璁惧鍙ユ焺 + CGXStreamPointer m_objStreamPtr; ///< 璁惧娴 + CGXFeatureControlPointer m_objStreamFeatureControlPtr; ///< 娴佸眰鎺у埗鍣ㄥ璞 bool m_bIsOpen = false; diff --git a/DeviceAdapters/Hikrobot/HikrobotCamera.cpp b/DeviceAdapters/Hikrobot/HikrobotCamera.cpp index 58fa28e79..24fba34f9 100644 --- a/DeviceAdapters/Hikrobot/HikrobotCamera.cpp +++ b/DeviceAdapters/Hikrobot/HikrobotCamera.cpp @@ -25,21 +25,21 @@ static const char* g_PixelType_8bitBGR = "8bitBGR"; -#define MONO_COMPONENTS 1 //mono8 占用1个组件,每个通道是1个组件 -#define MONO_CONVERTED_DEPTH 8 // mono8占用8字节 -#define MONO_IMAGE_BYTES_PERPIXEL 1 // 使用mono8的字节数 +#define MONO_COMPONENTS 1 //mono8 鍗犵敤1涓粍浠讹紝姣忎釜閫氶亾鏄1涓粍浠 +#define MONO_CONVERTED_DEPTH 8 // mono8鍗犵敤8瀛楄妭 +#define MONO_IMAGE_BYTES_PERPIXEL 1 // 浣跨敤mono8鐨勫瓧鑺傛暟 #define MONO_CONVERTED_FORMAT PixelType_Gvsp_Mono8 -#define COLOR_COMPONENTS 4 //RGBA 占用4个组件,每个通道是1个组件 -#define COLOR_CONVERTED_DEPTH 32 //RGBA 的字节数量 -#define COLOR_IMAGE_BYTES_PERPIXEL 4 // 使用RGBA8的字节数 -#define COLOR_CONVERTED_FORMAT PixelType_Gvsp_RGBA8_Packed //32位, 可能底层 CircularBuffer::InsertMultiChannel 限制 或者其他原因,导致 转换成RGB32异常,待分析 +#define COLOR_COMPONENTS 4 //RGBA 鍗犵敤4涓粍浠讹紝姣忎釜閫氶亾鏄1涓粍浠 +#define COLOR_CONVERTED_DEPTH 32 //RGBA 鐨勫瓧鑺傛暟閲 +#define COLOR_IMAGE_BYTES_PERPIXEL 4 // 浣跨敤RGBA8鐨勫瓧鑺傛暟 +#define COLOR_CONVERTED_FORMAT PixelType_Gvsp_RGBA8_Packed //32浣嶏紝 鍙兘搴曞眰 CircularBuffer::InsertMultiChannel 闄愬埗 鎴栬呭叾浠栧師鍥狅紝瀵艰嚧 杞崲鎴怰GB32寮傚父锛屽緟鍒嗘瀽 #if 0 -/* 下面配置 pok */ -#define COLOR_COMPONENTS 3 //RGB 每个通道是1个组件 +/* 涓嬮潰閰嶇疆 pok */ +#define COLOR_COMPONENTS 3 //RGB 姣忎釜閫氶亾鏄1涓粍浠 #define COLOR_CONVERTED_DEPTH 24 #define COLOR_IMAGE_BYTES_PERPIXEL 3 #define COLOR_CONVERTED_FORMAT PixelType_Gvsp_RGB8_Packed @@ -201,7 +201,7 @@ int HikrobotCamera::EnumDevice() */ void HikrobotCamera::GetName(char* name) const { - CDeviceUtils::CopyLimitedString(name, g_HikrobotCameraDeviceName); //增加说明: 此处是插件的名字,具体相机序列号是需要 (GetProperty("SerialNumber", serialNumber);) 中选择的。 (basler也是同样的逻辑) + CDeviceUtils::CopyLimitedString(name, g_HikrobotCameraDeviceName); //澧炲姞璇存槑锛 姝ゅ鏄彃浠剁殑鍚嶅瓧锛屽叿浣撶浉鏈哄簭鍒楀彿鏄渶瑕 锛圙etProperty("SerialNumber", serialNumber);锛 涓夋嫨鐨勩 锛坆asler涔熸槸鍚屾牱鐨勯昏緫锛 } /** @@ -307,7 +307,7 @@ int HikrobotCamera::Initialize() string strBasiceLog = " [ "+ strModeName + " " + strSerialNumber + " ] "; SetLogBasicInfo(strBasiceLog); - sprintf_s(m_chDevID, sizeof(m_chDevID), " %s(%s) ", strModeName.c_str(), strSerialNumber.c_str()); //保存相机的序列号,型号信息 + sprintf_s(m_chDevID, sizeof(m_chDevID), " %s(%s) ", strModeName.c_str(), strSerialNumber.c_str()); //淇濆瓨鐩告満鐨勫簭鍒楀彿锛屽瀷鍙蜂俊鎭 //Sensor size @@ -390,7 +390,7 @@ int HikrobotCamera::Initialize() pAct = new CPropertyAction(this, &HikrobotCamera::OnTestPattern); ret = CreateProperty("TestPattern", "NA", MM::String, false, pAct); vector TestPatternVals; - TestPatternVals.push_back("Off"); //参考basler,先把off放入vector; 在循环中放入off,应该也OK; + TestPatternVals.push_back("Off"); //鍙傝僢asler锛屽厛鎶妎ff鏀惧叆vector锛 鍦ㄥ惊鐜腑鏀惧叆off锛屽簲璇ヤ篃OK锛 MVCC_ENUMENTRY Entry = { 0 }; for (unsigned int i = 0; i < stTestPattern.nSupportedNum; i++) @@ -524,7 +524,7 @@ int HikrobotCamera::Initialize() pAct = new CPropertyAction(this, &HikrobotCamera::OnSensorReadoutMode); ret = CreateProperty("SensorReadoutMode", "NA", MM::String, false, pAct); vector vals; - // vals.push_back("Off"); // 海康相机无这个节点,不会走到这个分支中; 参考basler分支,basler无添加off节点 + // vals.push_back("Off"); // 娴峰悍鐩告満鏃犺繖涓妭鐐癸紝涓嶄細璧板埌杩欎釜鍒嗘敮涓; 鍙傝僢asler鍒嗘敮锛宐asler鏃犳坊鍔爋ff鑺傜偣 MVCC_ENUMVALUE SensorReadoutMode = { 0 }; m_pCamera->GetEnumValue("SensorReadoutMode", &SensorReadoutMode); @@ -874,10 +874,10 @@ int HikrobotCamera::SnapImage() { /* - basler在snapimage中调用的是 virtual void StartGrabbing( size_t maxImages, EGrabStrategy strategy = GrabStrategy_OneByOne, EGrabLoop grabLoopType = GrabLoop_ProvidedByUser ); - 这个接口的描述是:”Extends the StartGrabbing(EStrategy, EGrabLoop) by a number of images to grab. If the passed count of images has been reached, StopGrabbing is called - automatically. The images are counted according to the grab strategy. Skipped images are not taken into account.“; 就是说获取图像个数满足后,后台会自动停止取流; - 海康SDK无此类接口,所以需要 start ,获取图像, stop + basler鍦╯napimage涓皟鐢ㄧ殑鏄 virtual void StartGrabbing( size_t maxImages, EGrabStrategy strategy = GrabStrategy_OneByOne, EGrabLoop grabLoopType = GrabLoop_ProvidedByUser ); + 杩欎釜鎺ュ彛鐨勬弿杩版槸锛氣滶xtends the StartGrabbing(EStrategy, EGrabLoop) by a number of images to grab. If the passed count of images has been reached, StopGrabbing is called + automatically. The images are counted according to the grab strategy. Skipped images are not taken into account.鈥滐紱 灏辨槸璇磋幏鍙栧浘鍍忎釜鏁版弧瓒冲悗锛屽悗鍙颁細鑷姩鍋滄鍙栨祦锛 + 娴峰悍SDK鏃犳绫绘帴鍙o紝鎵浠ラ渶瑕 start 锛岃幏鍙栧浘鍍忥紝 stop */ MvWriteLog(__FILE__, __LINE__, m_chDevID, "SnapImage Begin"); @@ -891,8 +891,8 @@ int HikrobotCamera::SnapImage() do { - //此处暂时设定1s, 若相机帧率过低,则可能异常,需要调整; - // 超时时间不能太长,容易导致接口卡死异常; + //姝ゅ鏆傛椂璁惧畾1s, 鑻ョ浉鏈哄抚鐜囪繃浣庯紝鍒欏彲鑳藉紓甯革紝闇瑕佽皟鏁; + // 瓒呮椂鏃堕棿涓嶈兘澶暱锛屽鏄撳鑷存帴鍙e崱姝诲紓甯; nRet = m_pCamera->GetImageBuffer(&stOutFrame, 1000); if (nRet == MV_OK) { @@ -905,7 +905,7 @@ int HikrobotCamera::SnapImage() break; } - ResizeSnapBuffer(); //分配内存空间 + ResizeSnapBuffer(); //鍒嗛厤鍐呭瓨绌洪棿 CopyToImageBuffer(&stOutFrame); nRet = m_pCamera->FreeImageBuffer(&stOutFrame); @@ -915,7 +915,7 @@ int HikrobotCamera::SnapImage() } - break; // 获取一张图像结束. + break; // 鑾峰彇涓寮犲浘鍍忕粨鏉. } while (0); m_pCamera->StopGrabbing(); @@ -979,17 +979,17 @@ void HikrobotCamera::CopyToImageBuffer(MV_FRAME_OUT* pstFrameOut) m_nConvertDataLen = nNeedSize; } - // ch:像素格式转换 | en:Convert pixel format + // ch:鍍忕礌鏍煎紡杞崲 | en:Convert pixel format MV_CC_PIXEL_CONVERT_PARAM stConvertParam = { 0 }; - stConvertParam.nWidth = pstFrameOut->stFrameInfo.nWidth; //ch:图像宽 | en:image width - stConvertParam.nHeight = pstFrameOut->stFrameInfo.nHeight; //ch:图像高 | en:image height - stConvertParam.pSrcData = pstFrameOut->pBufAddr; //ch:输入数据缓存 | en:input data buffer - stConvertParam.nSrcDataLen = pstFrameOut->stFrameInfo.nFrameLen; //ch:输入数据大小 | en:input data size - stConvertParam.enSrcPixelType = pstFrameOut->stFrameInfo.enPixelType; //ch:输入像素格式 | en:input pixel format - stConvertParam.enDstPixelType = enDstPixelType; //ch:输出像素格式 | en:output pixel format - stConvertParam.pDstBuffer = m_pConvertData; //ch:输出数据缓存 | en:output data buffer - stConvertParam.nDstBufferSize = nNeedSize; //ch:输出缓存大小 | en:output buffer size + stConvertParam.nWidth = pstFrameOut->stFrameInfo.nWidth; //ch:鍥惧儚瀹 | en:image width + stConvertParam.nHeight = pstFrameOut->stFrameInfo.nHeight; //ch:鍥惧儚楂 | en:image height + stConvertParam.pSrcData = pstFrameOut->pBufAddr; //ch:杈撳叆鏁版嵁缂撳瓨 | en:input data buffer + stConvertParam.nSrcDataLen = pstFrameOut->stFrameInfo.nFrameLen; //ch:杈撳叆鏁版嵁澶у皬 | en:input data size + stConvertParam.enSrcPixelType = pstFrameOut->stFrameInfo.enPixelType; //ch:杈撳叆鍍忕礌鏍煎紡 | en:input pixel format + stConvertParam.enDstPixelType = enDstPixelType; //ch:杈撳嚭鍍忕礌鏍煎紡 | en:output pixel format + stConvertParam.pDstBuffer = m_pConvertData; //ch:杈撳嚭鏁版嵁缂撳瓨 | en:output data buffer + stConvertParam.nDstBufferSize = nNeedSize; //ch:杈撳嚭缂撳瓨澶у皬 | en:output buffer size nRet = GetCamera()->ConvertPixelType(&stConvertParam); if (MV_OK != nRet) { @@ -1006,7 +1006,7 @@ unsigned HikrobotCamera::PixTypeProc(MvGvspPixelType enPixelType, unsigned int & { int nRet = MV_OK; - //如果是彩色则转成RGB8 + //濡傛灉鏄僵鑹插垯杞垚RGB8 if (IsColor(enPixelType)) { nChannelNum = COLOR_CONVERTED_DEPTH / 8; @@ -1017,7 +1017,7 @@ unsigned HikrobotCamera::PixTypeProc(MvGvspPixelType enPixelType, unsigned int & m_nbitDepth = COLOR_CONVERTED_DEPTH; } - //如果是黑白则转换成Mono8 + //濡傛灉鏄粦鐧藉垯杞崲鎴怣ono8 else if (IsMono(enPixelType)) { nChannelNum = 1; @@ -1072,7 +1072,7 @@ unsigned HikrobotCamera::GetImageBytesPerPixel() const std::size_t found = pixelType_.find(subject); unsigned int ret = 0; - //mono统一转换成mon8,其他类型转换为RGBA32 + //mono缁熶竴杞崲鎴恗on8,鍏朵粬绫诲瀷杞崲涓篟GBA32 if (pixelType_ == "Mono8" || pixelType_ == "Mono10" || pixelType_ == "Mono12" || pixelType_ == "Mono10Packed" || pixelType_ == "Mono12Packed" || pixelType_ == "Mono16") { ret = MONO_IMAGE_BYTES_PERPIXEL; @@ -1102,7 +1102,7 @@ unsigned int HikrobotCamera::GetBitDepth() const const char* subject("Bayer"); std::size_t found = pixelType_.find(subject); unsigned int ret = 0; - //mono统一转换成mon8,其他类型转换为RGBA32 + //mono缁熶竴杞崲鎴恗on8,鍏朵粬绫诲瀷杞崲涓篟GBA32 if (pixelType_ == "Mono8" || pixelType_ == "Mono10" || pixelType_ == "Mono12" || pixelType_ == "Mono10Packed" || pixelType_ == "Mono12Packed" || pixelType_ == "Mono16") { ret = MONO_CONVERTED_DEPTH; @@ -1421,7 +1421,7 @@ int HikrobotCamera::StartSequenceAcquisition(double /* interval_ms */) { if (m_bGrabbing) { MvWriteLog(__FILE__, __LINE__, m_chDevID, "StartSequenceAcquisition Begin, but Already Start."); - return DEVICE_NOT_SUPPORTED; //设备已经start,不能再次start; ImageJ 中截图和取流不能同时使用 [截图后,快速start可能会报错] + return DEVICE_NOT_SUPPORTED; //璁惧宸茬粡start锛屼笉鑳藉啀娆tart; ImageJ 涓埅鍥惧拰鍙栨祦涓嶈兘鍚屾椂浣跨敤 [鎴浘鍚庯紝蹇焥tart鍙兘浼氭姤閿橾 } MvWriteLog(__FILE__, __LINE__, m_chDevID, "StartSequenceAcquisition Begin"); @@ -1431,7 +1431,7 @@ int HikrobotCamera::StartSequenceAcquisition(double /* interval_ms */) { m_pCamera->StartGrabbing(); - m_bRecvRuning = true; //取流线程工作 + m_bRecvRuning = true; //鍙栨祦绾跨▼宸ヤ綔 unsigned int nThreadID = 0; if (NULL == m_hImageRecvThreadHandle) { @@ -1443,13 +1443,13 @@ int HikrobotCamera::StartSequenceAcquisition(double /* interval_ms */) { } } - m_bGrabbing = true; //取流状态 + m_bGrabbing = true; //鍙栨祦鐘舵 MvWriteLog(__FILE__, __LINE__, m_chDevID, "StartSequenceAcquisition End"); return DEVICE_OK; } -// 取流处理线程 +// 鍙栨祦澶勭悊绾跨▼ unsigned int __stdcall HikrobotCamera::ImageRecvThread(void* pUser) { if (NULL == pUser) @@ -1522,16 +1522,16 @@ void HikrobotCamera::ImageRecvThreadProc() } - // ch:像素格式转换 | en:Convert pixel format + // ch:鍍忕礌鏍煎紡杞崲 | en:Convert pixel format MV_CC_PIXEL_CONVERT_PARAM stConvertParam = { 0 }; - stConvertParam.nWidth = stOutFrame.stFrameInfo.nWidth; //ch:图像宽 | en:image width - stConvertParam.nHeight = stOutFrame.stFrameInfo.nHeight; //ch:图像高 | en:image height - stConvertParam.pSrcData = stOutFrame.pBufAddr; //ch:输入数据缓存 | en:input data buffer - stConvertParam.nSrcDataLen = stOutFrame.stFrameInfo.nFrameLen; //ch:输入数据大小 | en:input data size - stConvertParam.enSrcPixelType = stOutFrame.stFrameInfo.enPixelType; //ch:输入像素格式 | en:input pixel format - stConvertParam.enDstPixelType = enDstPixelType; //ch:输出像素格式 | en:output pixel format - stConvertParam.pDstBuffer = m_pConvertData; //ch:输出数据缓存 | en:output data buffer - stConvertParam.nDstBufferSize = m_nConvertDataLen; //ch:输出缓存大小 | en:output buffer size + stConvertParam.nWidth = stOutFrame.stFrameInfo.nWidth; //ch:鍥惧儚瀹 | en:image width + stConvertParam.nHeight = stOutFrame.stFrameInfo.nHeight; //ch:鍥惧儚楂 | en:image height + stConvertParam.pSrcData = stOutFrame.pBufAddr; //ch:杈撳叆鏁版嵁缂撳瓨 | en:input data buffer + stConvertParam.nSrcDataLen = stOutFrame.stFrameInfo.nFrameLen; //ch:杈撳叆鏁版嵁澶у皬 | en:input data size + stConvertParam.enSrcPixelType = stOutFrame.stFrameInfo.enPixelType; //ch:杈撳叆鍍忕礌鏍煎紡 | en:input pixel format + stConvertParam.enDstPixelType = enDstPixelType; //ch:杈撳嚭鍍忕礌鏍煎紡 | en:output pixel format + stConvertParam.pDstBuffer = m_pConvertData; //ch:杈撳嚭鏁版嵁缂撳瓨 | en:output data buffer + stConvertParam.nDstBufferSize = m_nConvertDataLen; //ch:杈撳嚭缂撳瓨澶у皬 | en:output buffer size nRet = GetCamera()->ConvertPixelType(&stConvertParam); if (MV_OK != nRet) { @@ -2010,7 +2010,7 @@ int HikrobotCamera::OnReverseX(MM::PropertyBase* pProp, MM::ActionType eAct) bool reverseX = false; m_pCamera->GetBoolValue("ReverseX", &reverseX); //reverseX->FromString(reverseX_.c_str()); - istringstream(reverseX_) >> boolalpha >> reverseX;//boolalpha>>必须要加 + istringstream(reverseX_) >> boolalpha >> reverseX;//boolalpha>>蹇呴』瑕佸姞 m_pCamera->SetBoolValue("ReverseX", &reverseX); } else if (eAct == MM::BeforeGet) { @@ -2033,7 +2033,7 @@ int HikrobotCamera::OnReverseY(MM::PropertyBase* pProp, MM::ActionType eAct) //reverseY->FromString(reverseY_.c_str()); bool ReverseY = false; m_pCamera->GetBoolValue("ReverseY", &ReverseY); - istringstream(reverseX_) >> boolalpha >> ReverseY;//boolalpha>>必须要加 + istringstream(reverseX_) >> boolalpha >> ReverseY;//boolalpha>>蹇呴』瑕佸姞 m_pCamera->SetBoolValue("ReverseX", &ReverseY); } else if (eAct == MM::BeforeGet) { @@ -2057,7 +2057,7 @@ int HikrobotCamera::OnAcqFramerateEnable(MM::PropertyBase* pProp, MM::ActionType bool setAcqFrm = false; m_pCamera->GetBoolValue("AcquisitionFrameRateEnable", &setAcqFrm); - istringstream(setAcqFrm_) >> boolalpha >> setAcqFrm;//boolalpha>>必须要加 + istringstream(setAcqFrm_) >> boolalpha >> setAcqFrm;//boolalpha>>蹇呴』瑕佸姞 m_pCamera->SetBoolValue("AcquisitionFrameRateEnable", &setAcqFrm); } @@ -2438,7 +2438,7 @@ void HikrobotCamera::ReduceImageSize(int64_t Width, int64_t Height) void HikrobotCamera::SetLogBasicInfo(std::string msg) { - // 记录型号,序列号; + // 璁板綍鍨嬪彿锛屽簭鍒楀彿; m_strBasiceLog = msg; } @@ -2446,7 +2446,7 @@ void HikrobotCamera::SetLogBasicInfo(std::string msg) void HikrobotCamera::AddToLog(std::string msg) const { - // 增加下型号,序列号; + // 澧炲姞涓嬪瀷鍙凤紝搴忓垪鍙; LogMessage(m_strBasiceLog + msg, false); } diff --git a/DeviceAdapters/Hikrobot/HikrobotCamera.h b/DeviceAdapters/Hikrobot/HikrobotCamera.h index 68c8940b2..162168e6e 100644 --- a/DeviceAdapters/Hikrobot/HikrobotCamera.h +++ b/DeviceAdapters/Hikrobot/HikrobotCamera.h @@ -103,8 +103,8 @@ class HikrobotCamera : public CCameraBase { int SetProperty(const char* name, const char* value); int CheckForBinningMode(CPropertyAction *pAct); - void AddToLog(std::string msg) const; //不推荐使用 - void MvWriteLog(char* file, int line, char* pDevID, const char* fmt, ...) const ; //推荐使用 + void AddToLog(std::string msg) const; //涓嶆帹鑽愪娇鐢 + void MvWriteLog(char* file, int line, char* pDevID, const char* fmt, ...) const ; //鎺ㄨ崘浣跨敤 void CopyToImageBuffer(MV_FRAME_OUT* pstFrameOut); @@ -187,16 +187,16 @@ class HikrobotCamera : public CCameraBase { unsigned PixTypeProc(MvGvspPixelType enPixelType, unsigned int& nChannelNum, MvGvspPixelType& enDstPixelType); private: - // 基础日志记录信息 + // 鍩虹鏃ュ織璁板綍淇℃伅 std::string m_strBasiceLog; - char m_chDevID[128];// 设备ID + char m_chDevID[128];// 璁惧ID MV_CC_DEVICE_INFO_LIST m_stDevList; CMvCamera * m_pCamera; - int m_nComponents; //组件个数(通道个数) - unsigned m_nbitDepth; //图像 占的字节个数 + int m_nComponents; //缁勪欢涓暟锛堥氶亾涓暟锛 + unsigned m_nbitDepth; //鍥惧儚 鍗犵殑瀛楄妭涓暟 unsigned maxWidth_, maxHeight_; int64_t DeviceLinkThroughputLimit_; @@ -230,10 +230,10 @@ class HikrobotCamera : public CCameraBase { bool m_bInitialized; void ResizeSnapBuffer(); - bool m_bGrabbing; //取流工作状态 + bool m_bGrabbing; //鍙栨祦宸ヤ綔鐘舵 - bool m_bRecvRuning; //取流线程状态 - HANDLE m_hImageRecvThreadHandle; //取流线程句柄 + bool m_bRecvRuning; //鍙栨祦绾跨▼鐘舵 + HANDLE m_hImageRecvThreadHandle; //鍙栨祦绾跨▼鍙ユ焺 }; diff --git a/DeviceAdapters/Hikrobot/MvCamera.cpp b/DeviceAdapters/Hikrobot/MvCamera.cpp index 18911464f..910894ac3 100644 --- a/DeviceAdapters/Hikrobot/MvCamera.cpp +++ b/DeviceAdapters/Hikrobot/MvCamera.cpp @@ -14,25 +14,25 @@ CMvCamera::~CMvCamera() } } -// ch:获取SDK版本号 | en:Get SDK Version +// ch:鑾峰彇SDK鐗堟湰鍙 | en:Get SDK Version int CMvCamera::GetSDKVersion() { return MV_CC_GetSDKVersion(); } -// ch:枚举设备 | en:Enumerate Device +// ch:鏋氫妇璁惧 | en:Enumerate Device int CMvCamera::EnumDevices(unsigned int nTLayerType, MV_CC_DEVICE_INFO_LIST* pstDevList) { return MV_CC_EnumDevices(nTLayerType, pstDevList); } -// ch:判断设备是否可达 | en:Is the device accessible +// ch:鍒ゆ柇璁惧鏄惁鍙揪 | en:Is the device accessible bool CMvCamera::IsDeviceAccessible(MV_CC_DEVICE_INFO* pstDevInfo, unsigned int nAccessMode) { return MV_CC_IsDeviceAccessible(pstDevInfo, nAccessMode); } -// ch:打开设备 | en:Open Device +// ch:鎵撳紑璁惧 | en:Open Device int CMvCamera::Open(MV_CC_DEVICE_INFO* pstDeviceInfo) { if (MV_NULL == pstDeviceInfo) @@ -61,7 +61,7 @@ int CMvCamera::Open(MV_CC_DEVICE_INFO* pstDeviceInfo) return nRet; } -// ch:关闭设备 | en:Close Device +// ch:鍏抽棴璁惧 | en:Close Device int CMvCamera::Close() { if (MV_NULL == m_hDevHandle) @@ -77,61 +77,61 @@ int CMvCamera::Close() return nRet; } -// ch:判断相机是否处于连接状态 | en:Is The Device Connected +// ch:鍒ゆ柇鐩告満鏄惁澶勪簬杩炴帴鐘舵 | en:Is The Device Connected bool CMvCamera::IsDeviceConnected() { return MV_CC_IsDeviceConnected(m_hDevHandle); } -// ch:注册图像数据回调 | en:Register Image Data CallBack +// ch:娉ㄥ唽鍥惧儚鏁版嵁鍥炶皟 | en:Register Image Data CallBack int CMvCamera::RegisterImageCallBack(void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser), void* pUser) { return MV_CC_RegisterImageCallBackEx(m_hDevHandle, cbOutput, pUser); } -// ch:开启抓图 | en:Start Grabbing +// ch:寮鍚姄鍥 | en:Start Grabbing int CMvCamera::StartGrabbing() { return MV_CC_StartGrabbing(m_hDevHandle); } -// ch:停止抓图 | en:Stop Grabbing +// ch:鍋滄鎶撳浘 | en:Stop Grabbing int CMvCamera::StopGrabbing() { return MV_CC_StopGrabbing(m_hDevHandle); } -// ch:主动获取一帧图像数据 | en:Get one frame initiatively +// ch:涓诲姩鑾峰彇涓甯у浘鍍忔暟鎹 | en:Get one frame initiatively int CMvCamera::GetImageBuffer(MV_FRAME_OUT* pFrame, int nMsec) { return MV_CC_GetImageBuffer(m_hDevHandle, pFrame, nMsec); } -// ch:释放图像缓存 | en:Free image buffer +// ch:閲婃斁鍥惧儚缂撳瓨 | en:Free image buffer int CMvCamera::FreeImageBuffer(MV_FRAME_OUT* pFrame) { return MV_CC_FreeImageBuffer(m_hDevHandle, pFrame); } -// ch:设置显示窗口句柄 | en:Set Display Window Handle +// ch:璁剧疆鏄剧ず绐楀彛鍙ユ焺 | en:Set Display Window Handle int CMvCamera::DisplayOneFrame(MV_DISPLAY_FRAME_INFO* pDisplayInfo) { return MV_CC_DisplayOneFrame(m_hDevHandle, pDisplayInfo); } -// ch:设置SDK内部图像缓存节点个数 | en:Set the number of the internal image cache nodes in SDK +// ch:璁剧疆SDK鍐呴儴鍥惧儚缂撳瓨鑺傜偣涓暟 | en:Set the number of the internal image cache nodes in SDK int CMvCamera::SetImageNodeNum(unsigned int nNum) { return MV_CC_SetImageNodeNum(m_hDevHandle, nNum); } -// ch:获取设备信息 | en:Get device information +// ch:鑾峰彇璁惧淇℃伅 | en:Get device information int CMvCamera::GetDeviceInfo(MV_CC_DEVICE_INFO* pstDevInfo) { return MV_CC_GetDeviceInfo(m_hDevHandle, pstDevInfo); } -// ch:获取GEV相机的统计信息 | en:Get detect info of GEV camera +// ch:鑾峰彇GEV鐩告満鐨勭粺璁′俊鎭 | en:Get detect info of GEV camera int CMvCamera::GetGevAllMatchInfo(MV_MATCH_INFO_NET_DETECT* pMatchInfoNetDetect) { if (MV_NULL == pMatchInfoNetDetect) @@ -156,7 +156,7 @@ int CMvCamera::GetGevAllMatchInfo(MV_MATCH_INFO_NET_DETECT* pMatchInfoNetDetect) return MV_CC_GetAllMatchInfo(m_hDevHandle, &struMatchInfo); } -// ch:获取U3V相机的统计信息 | en:Get detect info of U3V camera +// ch:鑾峰彇U3V鐩告満鐨勭粺璁′俊鎭 | en:Get detect info of U3V camera int CMvCamera::GetU3VAllMatchInfo(MV_MATCH_INFO_USB_DETECT* pMatchInfoUSBDetect) { if (MV_NULL == pMatchInfoUSBDetect) @@ -181,7 +181,7 @@ int CMvCamera::GetU3VAllMatchInfo(MV_MATCH_INFO_USB_DETECT* pMatchInfoUSBDetect) return MV_CC_GetAllMatchInfo(m_hDevHandle, &struMatchInfo); } -// ch:获取和设置Int型参数,如 Width和Height,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件 +// ch:鑾峰彇鍜岃缃甀nt鍨嬪弬鏁帮紝濡 Width鍜孒eight锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢 // en:Get Int type parameters, such as Width and Height, for details please refer to MvCameraNode.xlsx file under SDK installation directory int CMvCamera::GetIntValue(IN const char* strKey, OUT MVCC_INTVALUE_EX *pIntValue) { @@ -193,7 +193,7 @@ int CMvCamera::SetIntValue(IN const char* strKey, IN int64_t nValue) return MV_CC_SetIntValueEx(m_hDevHandle, strKey, nValue); } -// ch:获取和设置Enum型参数,如 PixelFormat,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件 +// ch:鑾峰彇鍜岃缃瓻num鍨嬪弬鏁帮紝濡 PixelFormat锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢 // en:Get Enum type parameters, such as PixelFormat, for details please refer to MvCameraNode.xlsx file under SDK installation directory int CMvCamera::GetEnumValue(IN const char* strKey, OUT MVCC_ENUMVALUE *pEnumValue) { @@ -215,7 +215,7 @@ int CMvCamera::GetEnumEntrySymbolic(IN const char* strKey, IN MVCC_ENUMENTRY* ps return MV_CC_GetEnumEntrySymbolic(m_hDevHandle, strKey, pstEnumEntry); } -// ch:获取和设置Float型参数,如 ExposureTime和Gain,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件 +// ch:鑾峰彇鍜岃缃瓼loat鍨嬪弬鏁帮紝濡 ExposureTime鍜孏ain锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢 // en:Get Float type parameters, such as ExposureTime and Gain, for details please refer to MvCameraNode.xlsx file under SDK installation directory int CMvCamera::GetFloatValue(IN const char* strKey, OUT MVCC_FLOATVALUE *pFloatValue) { @@ -227,7 +227,7 @@ int CMvCamera::SetFloatValue(IN const char* strKey, IN float fValue) return MV_CC_SetFloatValue(m_hDevHandle, strKey, fValue); } -// ch:获取和设置Bool型参数,如 ReverseX,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件 +// ch:鑾峰彇鍜岃缃瓸ool鍨嬪弬鏁帮紝濡 ReverseX锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢 // en:Get Bool type parameters, such as ReverseX, for details please refer to MvCameraNode.xlsx file under SDK installation directory int CMvCamera::GetBoolValue(IN const char* strKey, OUT bool *pbValue) { @@ -239,7 +239,7 @@ int CMvCamera::SetBoolValue(IN const char* strKey, IN bool bValue) return MV_CC_SetBoolValue(m_hDevHandle, strKey, bValue); } -// ch:获取和设置String型参数,如 DeviceUserID,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件UserSetSave +// ch:鑾峰彇鍜岃缃甋tring鍨嬪弬鏁帮紝濡 DeviceUserID锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢UserSetSave // en:Get String type parameters, such as DeviceUserID, for details please refer to MvCameraNode.xlsx file under SDK installation directory int CMvCamera::GetStringValue(IN const char* strKey, MVCC_STRINGVALUE *pStringValue) { @@ -251,14 +251,14 @@ int CMvCamera::SetStringValue(IN const char* strKey, IN const char* strValue) return MV_CC_SetStringValue(m_hDevHandle, strKey, strValue); } -// ch:执行一次Command型命令,如 UserSetSave,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件 +// ch:鎵ц涓娆ommand鍨嬪懡浠わ紝濡 UserSetSave锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢 // en:Execute Command once, such as UserSetSave, for details please refer to MvCameraNode.xlsx file under SDK installation directory int CMvCamera::CommandExecute(IN const char* strKey) { return MV_CC_SetCommandValue(m_hDevHandle, strKey); } -// ch:探测网络最佳包大小(只对GigE相机有效) | en:Detection network optimal package size(It only works for the GigE camera) +// ch:鎺㈡祴缃戠粶鏈浣冲寘澶у皬(鍙GigE鐩告満鏈夋晥) | en:Detection network optimal package size(It only works for the GigE camera) int CMvCamera::GetOptimalPacketSize(unsigned int* pOptimalPacketSize) { if (MV_NULL == pOptimalPacketSize) @@ -277,61 +277,61 @@ int CMvCamera::GetOptimalPacketSize(unsigned int* pOptimalPacketSize) return MV_OK; } -// ch:注册消息异常回调 | en:Register Message Exception CallBack +// ch:娉ㄥ唽娑堟伅寮傚父鍥炶皟 | en:Register Message Exception CallBack int CMvCamera::RegisterExceptionCallBack(void(__stdcall* cbException)(unsigned int nMsgType, void* pUser),void* pUser) { return MV_CC_RegisterExceptionCallBack(m_hDevHandle, cbException, pUser); } -// ch:注册单个事件回调 | en:Register Event CallBack +// ch:娉ㄥ唽鍗曚釜浜嬩欢鍥炶皟 | en:Register Event CallBack int CMvCamera::RegisterEventCallBack(const char* pEventName, void(__stdcall* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser), void* pUser) { return MV_CC_RegisterEventCallBackEx(m_hDevHandle, pEventName, cbEvent, pUser); } -// ch:强制IP | en:Force IP +// ch:寮哄埗IP | en:Force IP int CMvCamera::ForceIp(unsigned int nIP, unsigned int nSubNetMask, unsigned int nDefaultGateWay) { return MV_GIGE_ForceIpEx(m_hDevHandle, nIP, nSubNetMask, nDefaultGateWay); } -// ch:配置IP方式 | en:IP configuration method +// ch:閰嶇疆IP鏂瑰紡 | en:IP configuration method int CMvCamera::SetIpConfig(unsigned int nType) { return MV_GIGE_SetIpConfig(m_hDevHandle, nType); } -// ch:设置网络传输模式 | en:Set Net Transfer Mode +// ch:璁剧疆缃戠粶浼犺緭妯″紡 | en:Set Net Transfer Mode int CMvCamera::SetNetTransMode(unsigned int nType) { return MV_GIGE_SetNetTransMode(m_hDevHandle, nType); } -// ch:像素格式转换 | en:Pixel format conversion +// ch:鍍忕礌鏍煎紡杞崲 | en:Pixel format conversion int CMvCamera::ConvertPixelType(MV_CC_PIXEL_CONVERT_PARAM* pstCvtParam) { return MV_CC_ConvertPixelType(m_hDevHandle, pstCvtParam); } -// ch:保存图片 | en:save image +// ch:淇濆瓨鍥剧墖 | en:save image int CMvCamera::SaveImage(MV_SAVE_IMAGE_PARAM_EX* pstParam) { return MV_CC_SaveImageEx2(m_hDevHandle, pstParam); } -// ch:保存图片为文件 | en:Save the image as a file +// ch:淇濆瓨鍥剧墖涓烘枃浠 | en:Save the image as a file int CMvCamera::SaveImageToFile(MV_SAVE_IMG_TO_FILE_PARAM* pstSaveFileParam) { return MV_CC_SaveImageToFile(m_hDevHandle, pstSaveFileParam); } -// ch:绘制圆形辅助线 | en:Draw circle auxiliary line +// ch:缁樺埗鍦嗗舰杈呭姪绾 | en:Draw circle auxiliary line int CMvCamera::DrawCircle(MVCC_CIRCLE_INFO* pCircleInfo) { return MV_CC_DrawCircle(m_hDevHandle, pCircleInfo); } -// ch:绘制线形辅助线 | en:Draw lines auxiliary line +// ch:缁樺埗绾垮舰杈呭姪绾 | en:Draw lines auxiliary line int CMvCamera::DrawLines(MVCC_LINES_INFO* pLinesInfo) { return MV_CC_DrawLines(m_hDevHandle, pLinesInfo); diff --git a/DeviceAdapters/Hikrobot/MvCamera.h b/DeviceAdapters/Hikrobot/MvCamera.h index 4bb8f361e..cfeae9333 100644 --- a/DeviceAdapters/Hikrobot/MvCamera.h +++ b/DeviceAdapters/Hikrobot/MvCamera.h @@ -1,5 +1,5 @@ /************************************************************************/ -/* 以C++接口为基础,对常用函数进行二次封装,方便用户使用 */ +/* 浠++鎺ュ彛涓哄熀纭锛屽甯哥敤鍑芥暟杩涜浜屾灏佽锛屾柟渚跨敤鎴蜂娇鐢 */ /************************************************************************/ #ifndef _MV_CAMERA_H_ @@ -18,116 +18,116 @@ class CMvCamera CMvCamera(); ~CMvCamera(); - // ch:获取SDK版本号 | en:Get SDK Version + // ch:鑾峰彇SDK鐗堟湰鍙 | en:Get SDK Version static int GetSDKVersion(); - // ch:枚举设备 | en:Enumerate Device + // ch:鏋氫妇璁惧 | en:Enumerate Device static int EnumDevices(unsigned int nTLayerType, MV_CC_DEVICE_INFO_LIST* pstDevList); - // ch:判断设备是否可达 | en:Is the device accessible + // ch:鍒ゆ柇璁惧鏄惁鍙揪 | en:Is the device accessible static bool IsDeviceAccessible(MV_CC_DEVICE_INFO* pstDevInfo, unsigned int nAccessMode); - // ch:打开设备 | en:Open Device + // ch:鎵撳紑璁惧 | en:Open Device int Open(MV_CC_DEVICE_INFO* pstDeviceInfo); - // ch:关闭设备 | en:Close Device + // ch:鍏抽棴璁惧 | en:Close Device int Close(); - // ch:判断相机是否处于连接状态 | en:Is The Device Connected + // ch:鍒ゆ柇鐩告満鏄惁澶勪簬杩炴帴鐘舵 | en:Is The Device Connected bool IsDeviceConnected(); - // ch:注册图像数据回调 | en:Register Image Data CallBack + // ch:娉ㄥ唽鍥惧儚鏁版嵁鍥炶皟 | en:Register Image Data CallBack int RegisterImageCallBack(void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser), void* pUser); - // ch:开启抓图 | en:Start Grabbing + // ch:寮鍚姄鍥 | en:Start Grabbing int StartGrabbing(); - // ch:停止抓图 | en:Stop Grabbing + // ch:鍋滄鎶撳浘 | en:Stop Grabbing int StopGrabbing(); - // ch:主动获取一帧图像数据 | en:Get one frame initiatively + // ch:涓诲姩鑾峰彇涓甯у浘鍍忔暟鎹 | en:Get one frame initiatively int GetImageBuffer(MV_FRAME_OUT* pFrame, int nMsec); - // ch:释放图像缓存 | en:Free image buffer + // ch:閲婃斁鍥惧儚缂撳瓨 | en:Free image buffer int FreeImageBuffer(MV_FRAME_OUT* pFrame); - // ch:显示一帧图像 | en:Display one frame image + // ch:鏄剧ず涓甯у浘鍍 | en:Display one frame image int DisplayOneFrame(MV_DISPLAY_FRAME_INFO* pDisplayInfo); - // ch:设置SDK内部图像缓存节点个数 | en:Set the number of the internal image cache nodes in SDK + // ch:璁剧疆SDK鍐呴儴鍥惧儚缂撳瓨鑺傜偣涓暟 | en:Set the number of the internal image cache nodes in SDK int SetImageNodeNum(unsigned int nNum); - // ch:获取设备信息 | en:Get device information + // ch:鑾峰彇璁惧淇℃伅 | en:Get device information int GetDeviceInfo(MV_CC_DEVICE_INFO* pstDevInfo); - // ch:获取GEV相机的统计信息 | en:Get detect info of GEV camera + // ch:鑾峰彇GEV鐩告満鐨勭粺璁′俊鎭 | en:Get detect info of GEV camera int GetGevAllMatchInfo(MV_MATCH_INFO_NET_DETECT* pMatchInfoNetDetect); - // ch:获取U3V相机的统计信息 | en:Get detect info of U3V camera + // ch:鑾峰彇U3V鐩告満鐨勭粺璁′俊鎭 | en:Get detect info of U3V camera int GetU3VAllMatchInfo(MV_MATCH_INFO_USB_DETECT* pMatchInfoUSBDetect); - // ch:获取和设置Int型参数,如 Width和Height,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件 + // ch:鑾峰彇鍜岃缃甀nt鍨嬪弬鏁帮紝濡 Width鍜孒eight锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢 // en:Get Int type parameters, such as Width and Height, for details please refer to MvCameraNode.xlsx file under SDK installation directory int GetIntValue(IN const char* strKey, OUT MVCC_INTVALUE_EX *pIntValue); int SetIntValue(IN const char* strKey, IN int64_t nValue); - // ch:获取和设置Enum型参数,如 PixelFormat,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件 + // ch:鑾峰彇鍜岃缃瓻num鍨嬪弬鏁帮紝濡 PixelFormat锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢 // en:Get Enum type parameters, such as PixelFormat, for details please refer to MvCameraNode.xlsx file under SDK installation directory int GetEnumValue(IN const char* strKey, OUT MVCC_ENUMVALUE *pEnumValue); int SetEnumValue(IN const char* strKey, IN unsigned int nValue); int SetEnumValueByString(IN const char* strKey, IN const char* sValue); int GetEnumEntrySymbolic(IN const char* strKey, IN MVCC_ENUMENTRY* pstEnumEntry); - // ch:获取和设置Float型参数,如 ExposureTime和Gain,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件 + // ch:鑾峰彇鍜岃缃瓼loat鍨嬪弬鏁帮紝濡 ExposureTime鍜孏ain锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢 // en:Get Float type parameters, such as ExposureTime and Gain, for details please refer to MvCameraNode.xlsx file under SDK installation directory int GetFloatValue(IN const char* strKey, OUT MVCC_FLOATVALUE *pFloatValue); int SetFloatValue(IN const char* strKey, IN float fValue); - // ch:获取和设置Bool型参数,如 ReverseX,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件 + // ch:鑾峰彇鍜岃缃瓸ool鍨嬪弬鏁帮紝濡 ReverseX锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢 // en:Get Bool type parameters, such as ReverseX, for details please refer to MvCameraNode.xlsx file under SDK installation directory int GetBoolValue(IN const char* strKey, OUT bool *pbValue); int SetBoolValue(IN const char* strKey, IN bool bValue); - // ch:获取和设置String型参数,如 DeviceUserID,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件UserSetSave + // ch:鑾峰彇鍜岃缃甋tring鍨嬪弬鏁帮紝濡 DeviceUserID锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢UserSetSave // en:Get String type parameters, such as DeviceUserID, for details please refer to MvCameraNode.xlsx file under SDK installation directory int GetStringValue(IN const char* strKey, MVCC_STRINGVALUE *pStringValue); int SetStringValue(IN const char* strKey, IN const char * strValue); - // ch:执行一次Command型命令,如 UserSetSave,详细内容参考SDK安装目录下的 MvCameraNode.xlsx 文件 + // ch:鎵ц涓娆ommand鍨嬪懡浠わ紝濡 UserSetSave锛岃缁嗗唴瀹瑰弬鑰僑DK瀹夎鐩綍涓嬬殑 MvCameraNode.xlsx 鏂囦欢 // en:Execute Command once, such as UserSetSave, for details please refer to MvCameraNode.xlsx file under SDK installation directory int CommandExecute(IN const char* strKey); - // ch:探测网络最佳包大小(只对GigE相机有效) | en:Detection network optimal package size(It only works for the GigE camera) + // ch:鎺㈡祴缃戠粶鏈浣冲寘澶у皬(鍙GigE鐩告満鏈夋晥) | en:Detection network optimal package size(It only works for the GigE camera) int GetOptimalPacketSize(unsigned int* pOptimalPacketSize); - // ch:注册消息异常回调 | en:Register Message Exception CallBack + // ch:娉ㄥ唽娑堟伅寮傚父鍥炶皟 | en:Register Message Exception CallBack int RegisterExceptionCallBack(void(__stdcall* cbException)(unsigned int nMsgType, void* pUser), void* pUser); - // ch:注册单个事件回调 | en:Register Event CallBack + // ch:娉ㄥ唽鍗曚釜浜嬩欢鍥炶皟 | en:Register Event CallBack int RegisterEventCallBack(const char* pEventName, void(__stdcall* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser), void* pUser); - // ch:强制IP | en:Force IP + // ch:寮哄埗IP | en:Force IP int ForceIp(unsigned int nIP, unsigned int nSubNetMask, unsigned int nDefaultGateWay); - // ch:配置IP方式 | en:IP configuration method + // ch:閰嶇疆IP鏂瑰紡 | en:IP configuration method int SetIpConfig(unsigned int nType); - // ch:设置网络传输模式 | en:Set Net Transfer Mode + // ch:璁剧疆缃戠粶浼犺緭妯″紡 | en:Set Net Transfer Mode int SetNetTransMode(unsigned int nType); - // ch:像素格式转换 | en:Pixel format conversion + // ch:鍍忕礌鏍煎紡杞崲 | en:Pixel format conversion int ConvertPixelType(MV_CC_PIXEL_CONVERT_PARAM* pstCvtParam); - // ch:保存图片 | en:save image + // ch:淇濆瓨鍥剧墖 | en:save image int SaveImage(MV_SAVE_IMAGE_PARAM_EX* pstParam); - // ch:保存图片为文件 | en:Save the image as a file + // ch:淇濆瓨鍥剧墖涓烘枃浠 | en:Save the image as a file int SaveImageToFile(MV_SAVE_IMG_TO_FILE_PARAM* pstParam); - // ch:绘制圆形辅助线 | en:Draw circle auxiliary line + // ch:缁樺埗鍦嗗舰杈呭姪绾 | en:Draw circle auxiliary line int DrawCircle(MVCC_CIRCLE_INFO* pCircleInfo); - // ch:绘制线形辅助线 | en:Draw lines auxiliary line + // ch:缁樺埗绾垮舰杈呭姪绾 | en:Draw lines auxiliary line int DrawLines(MVCC_LINES_INFO* pLinesInfo); int SetGrabStrategy(MV_GRAB_STRATEGY enGrabStrategy); diff --git a/DeviceAdapters/Mightex_BLS/Mightex_BLSDriver_SDK.h b/DeviceAdapters/Mightex_BLS/Mightex_BLSDriver_SDK.h old mode 100755 new mode 100644 index 120ce032b..bf68adba9 --- a/DeviceAdapters/Mightex_BLS/Mightex_BLSDriver_SDK.h +++ b/DeviceAdapters/Mightex_BLS/Mightex_BLSDriver_SDK.h @@ -1,5 +1,5 @@ -#define MAX_PULSE_COUNT 21 // For SX Modules, it’s 3 instead of 128. +#define MAX_PULSE_COUNT 21 // For SX Modules, it鈥檚 3 instead of 128. #define MAX_PROFILE_ITEM 128 #define DISABLE_MODE 0 diff --git a/DeviceAdapters/ZWO/MyASICam2.cpp b/DeviceAdapters/ZWO/MyASICam2.cpp index 50b1c077e..d757cc532 100644 --- a/DeviceAdapters/ZWO/MyASICam2.cpp +++ b/DeviceAdapters/ZWO/MyASICam2.cpp @@ -93,9 +93,9 @@ inline static void OutputDbgPrint(const char* strOutPutString, ...) MODULE_API void InitializeModuleData() { #ifdef _VEROPTICS - RegisterDevice(g_CameraName, MM::CameraDevice, "Micro-manager Veroptics camera");//出现在device list里 + RegisterDevice(g_CameraName, MM::CameraDevice, "Micro-manager Veroptics camera");//鍑虹幇鍦╠evice list閲 #else - RegisterDevice(g_CameraName, MM::CameraDevice, "ZWO ASI camera");//出现在device list里 + RegisterDevice(g_CameraName, MM::CameraDevice, "ZWO ASI camera");//鍑虹幇鍦╠evice list閲 #endif RegisterDevice(g_StateDeviceName, MM::StateDevice, "ZWO EFW filter wheel"); } @@ -218,19 +218,19 @@ CMyASICam::CMyASICam() : { ASIGetCameraProperty(&ASICameraInfo, i); #ifdef _VEROPTICS - StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "ZWO", "Veroptics");//区分大小写 - StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "ASI", "VER");//区分大小写 - StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "mc", "C", false);//不区分大小写 - StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "mm", "M", false);//不区分大小写 + StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "ZWO", "Veroptics");//鍖哄垎澶у皬鍐 + StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "ASI", "VER");//鍖哄垎澶у皬鍐 + StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "mc", "C", false);//涓嶅尯鍒嗗ぇ灏忓啓 + StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "mm", "M", false);//涓嶅尯鍒嗗ぇ灏忓啓 #endif - strcpy(ConnectedCamName[i], ASICameraInfo.Name);//保存连接的摄像头名字 + strcpy(ConnectedCamName[i], ASICameraInfo.Name);//淇濆瓨杩炴帴鐨勬憚鍍忓ご鍚嶅瓧 CamIndexValues.push_back(ConnectedCamName[i]); } - CPropertyAction *pAct = new CPropertyAction (this, &CMyASICam::OnSelectCamIndex);//通过名字选择打开的序号 + CPropertyAction *pAct = new CPropertyAction (this, &CMyASICam::OnSelectCamIndex);//閫氳繃鍚嶅瓧閫夋嫨鎵撳紑鐨勫簭鍙 if(iConnectedCamNum > 0) { - strcpy(sz_ModelIndex, ConnectedCamName[0]);//默认打开第一个camera + strcpy(sz_ModelIndex, ConnectedCamName[0]);//榛樿鎵撳紑绗竴涓猚amera //iCamIndex = 0; ASIGetCameraProperty(&ASICameraInfo, 0); } @@ -244,7 +244,7 @@ CMyASICam::CMyASICam() : } // strcpy(sz_ModelIndex, "DropDown"); - ret = CreateProperty(g_DeviceIndex, sz_ModelIndex, MM::String, false, pAct, true); //选择摄像头序号 + ret = CreateProperty(g_DeviceIndex, sz_ModelIndex, MM::String, false, pAct, true); //閫夋嫨鎽勫儚澶村簭鍙 SetAllowedValues(g_DeviceIndex, CamIndexValues); assert(ret == DEVICE_OK); @@ -310,10 +310,10 @@ int CMyASICam::Initialize() // ASIGetCameraProperty(&ASICameraInfo, iCamIndex); #ifdef _VEROPTICS - StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "ZWO", "Veroptics");//区分大小写 - StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "ASI", "VER");//区分大小写 - StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "mc", "C", false);//不区分大小写 - StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "mm", "M", false);//不区分大小写 + StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "ZWO", "Veroptics");//鍖哄垎澶у皬鍐 + StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "ASI", "VER");//鍖哄垎澶у皬鍐 + StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "mc", "C", false);//涓嶅尯鍒嗗ぇ灏忓啓 + StrReplace(ASICameraInfo.Name, ASICameraInfo.Name, "mm", "M", false);//涓嶅尯鍒嗗ぇ灏忓啓 #endif char *sz_Name = ASICameraInfo.Name; int nRet = CreateStringProperty(MM::g_Keyword_CameraName, sz_Name, true); @@ -666,7 +666,7 @@ int CMyASICam::Shutdown() * (i.e., before readout). This behavior is needed for proper synchronization with the shutter. * Required by the MM::Camera API. */ -int CMyASICam::SnapImage()//曝光期间要阻塞 +int CMyASICam::SnapImage()//鏇濆厜鏈熼棿瑕侀樆濉 { // GenerateImage(); // ASIGetStartPos(iCamIndex, &iStartXImg, &iStartYImg); @@ -830,7 +830,7 @@ unsigned CMyASICam::GetImageHeight() const * Returns image buffer pixel depth in bytes. * Required by the MM::Camera API. */ -unsigned CMyASICam::GetImageBytesPerPixel() const //每个像素的字节数 +unsigned CMyASICam::GetImageBytesPerPixel() const //姣忎釜鍍忕礌鐨勫瓧鑺傛暟 { return iPixBytes; } @@ -841,7 +841,7 @@ unsigned CMyASICam::GetImageHeight() const * a guideline on how to interpret pixel values. * Required by the MM::Camera API. */ -unsigned CMyASICam::GetBitDepth() const//颜色的范围 8bit 或 16bit +unsigned CMyASICam::GetBitDepth() const//棰滆壊鐨勮寖鍥 8bit 鎴 16bit { if(ImgType == ASI_IMG_RAW16) { @@ -931,16 +931,16 @@ void CMyASICam::DeleteImgBuf() pRGB64 = 0; } } -int CMyASICam::SetROI(unsigned x, unsigned y, unsigned xSize, unsigned ySize)//bin2时的值是相对于bin2后图像上的, 而ASISetStartPos都是相对于bin1的 +int CMyASICam::SetROI(unsigned x, unsigned y, unsigned xSize, unsigned ySize)//bin2鏃剁殑鍊兼槸鐩稿浜巄in2鍚庡浘鍍忎笂鐨, 鑰孉SISetStartPos閮芥槸鐩稿浜巄in1鐨 { if (xSize == 0 && ySize == 0) ; else { /*20160107 - 设置ROI是以显示图片为参照的,程序传进来的起始点(x, y)是用已显示图片的起始点(调用GetROI()得到)加上鼠标选择的偏移, - 尺寸和起始点都以ImgBin/iSetBin缩放, iSetBin是要设置的bin值 - 如果有翻转, 则要换算回正常的起点坐标 + 璁剧疆ROI鏄互鏄剧ず鍥剧墖涓哄弬鐓х殑,绋嬪簭浼犺繘鏉ョ殑璧峰鐐(x, y)鏄敤宸叉樉绀哄浘鐗囩殑璧峰鐐(璋冪敤GetROI()寰楀埌)鍔犱笂榧犳爣閫夋嫨鐨勫亸绉伙紝 + 灏哄鍜岃捣濮嬬偣閮戒互ImgBin/iSetBin缂╂斁, iSetBin鏄璁剧疆鐨刡in鍊 + 濡傛灉鏈夌炕杞, 鍒欒鎹㈢畻鍥炴甯哥殑璧风偣鍧愭爣 */ switch(ImgFlip) { @@ -964,15 +964,15 @@ void CMyASICam::DeleteImgBuf() iSetHei = iSetHei/2*2; - iSetX = x*ImgBin/iSetBin;//bin改变后, startpos是相对于bin后的画面的,也要按照比例改变 + iSetX = x*ImgBin/iSetBin;//bin鏀瑰彉鍚, startpos鏄浉瀵逛簬bin鍚庣殑鐢婚潰鐨勶紝涔熻鎸夌収姣斾緥鏀瑰彉 iSetY = y*ImgBin/iSetBin; iSetX = iSetX/4*4; iSetY = iSetY/2*2; - if(ASISetROIFormat(ASICameraInfo.CameraID, iSetWid, iSetHei, iSetBin, ImgType) == ASI_SUCCESS)//如果设置成功 + if(ASISetROIFormat(ASICameraInfo.CameraID, iSetWid, iSetHei, iSetBin, ImgType) == ASI_SUCCESS)//濡傛灉璁剧疆鎴愬姛 { OutputDbgPrint("wid:%d hei:%d bin:%d\n", xSize, ySize, iBin); - DeleteImgBuf();//buff大小改变 + DeleteImgBuf();//buff澶у皬鏀瑰彉 ASISetStartPos(ASICameraInfo.CameraID, iSetX, iSetY); } ASIGetROIFormat(ASICameraInfo.CameraID, &iROIWidth, &iROIHeight, &iBin, &ImgType); @@ -984,11 +984,11 @@ void CMyASICam::DeleteImgBuf() * Returns the actual dimensions of the current ROI. * Required by the MM::Camera API. */ -int CMyASICam::GetROI(unsigned& x, unsigned& y, unsigned& xSize, unsigned& ySize)//程序调用这里得到当前ROI起点,加上ROI里的矩形起点,得到ROI再ROI的起点 +int CMyASICam::GetROI(unsigned& x, unsigned& y, unsigned& xSize, unsigned& ySize)//绋嬪簭璋冪敤杩欓噷寰楀埌褰撳墠ROI璧风偣锛屽姞涓奟OI閲岀殑鐭╁舰璧风偣锛屽緱鍒癛OI鍐峈OI鐨勮捣鐐 { /* 20160107 - 得到显示图像的ROI信息 - 如果有翻转, 要换算成反方向边的坐标, 方便程序相加得到新ROI,再换算回正常方向的坐标*/ + 寰楀埌鏄剧ず鍥惧儚鐨凴OI淇℃伅 + 濡傛灉鏈夌炕杞, 瑕佹崲绠楁垚鍙嶆柟鍚戣竟鐨勫潗鏍, 鏂逛究绋嬪簭鐩稿姞寰楀埌鏂癛OI,鍐嶆崲绠楀洖姝e父鏂瑰悜鐨勫潗鏍*/ x = ImgStartX; y = ImgStartY; @@ -1070,7 +1070,7 @@ int CMyASICam::GetBinning() const */ int CMyASICam::SetBinning(int binF) { - return SetProperty(MM::g_Keyword_Binning, CDeviceUtils::ConvertToString(binF));//就是onBinning(, afterSet) + return SetProperty(MM::g_Keyword_Binning, CDeviceUtils::ConvertToString(binF));//灏辨槸onBinning(, afterSet) } int CMyASICam::PrepareSequenceAcqusition() @@ -1108,7 +1108,7 @@ int CMyASICam::StartSequenceAcquisition(long numImages, double interval_ms, bool Status = capturing; OutputDbgPrint("StartSeqAcq\n"); - thd_->Start(numImages,interval_ms);//开始线程 + thd_->Start(numImages,interval_ms);//寮濮嬬嚎绋 return DEVICE_OK; } @@ -1159,7 +1159,7 @@ int CMyASICam::InsertImage() pI = GetImageBuffer(); int ret = 0; ret = GetCoreCallback()->InsertImage(this, pI, iROIWidth, iROIHeight, iPixBytes, md.Serialize().c_str()); - if (ret == DEVICE_BUFFER_OVERFLOW)//缓冲区满了要清空, 否则不能继续插入图像而卡住 + if (ret == DEVICE_BUFFER_OVERFLOW)//缂撳啿鍖烘弧浜嗚娓呯┖, 鍚﹀垯涓嶈兘缁х画鎻掑叆鍥惧儚鑰屽崱浣 { // do not stop on overflow - just reset the buffer GetCoreCallback()->ClearImageBuffer(this); @@ -1177,10 +1177,10 @@ int CMyASICam::StopSequenceAcquisition() { if (!thd_->IsStopped()) { - thd_->Stop();//停止线程 + thd_->Stop();//鍋滄绾跨▼ OutputDbgPrint("StopSeqAcq bf wait\n"); // if(!thd_->IsStopped()) - thd_->wait();//等待线程退出 + thd_->wait();//绛夊緟绾跨▼閫鍑 OutputDbgPrint("StopSeqAcq af wait\n"); } // if(Status == capturing) @@ -1220,21 +1220,21 @@ int CMyASICam::OnBinning(MM::PropertyBase* pProp, MM::ActionType eAct) char binF; binF = binSize; - if( !thd_->IsStopped() )//micro manager主面板里bin时会先由程序停止再设置,而在property里设置bin不会停止,导致错误,所以不停止时不能设置 + if( !thd_->IsStopped() )//micro manager涓婚潰鏉块噷bin鏃朵細鍏堢敱绋嬪簭鍋滄鍐嶈缃紝鑰屽湪property閲岃缃産in涓嶄細鍋滄锛屽鑷撮敊璇紝鎵浠ヤ笉鍋滄鏃朵笉鑳借缃 return DEVICE_CAMERA_BUSY_ACQUIRING; - /* bin后的 起始点和尺寸是 把设置值按照 old Bin/new Bin 缩放的*/ + /* bin鍚庣殑 璧峰鐐瑰拰灏哄鏄 鎶婅缃兼寜鐓 old Bin/new Bin 缂╂斁鐨*/ iSetWid = iSetWid*iSetBin/binF;// 2->1, *2 iSetHei = iSetHei*iSetBin/binF;//1->2. *0.5 iSetWid = iSetWid/8*8; iSetHei = iSetHei/2*2; - iSetX = iSetX*iSetBin/binF;//bin改变后, startpos是相对于bin后的画面的,也要按照比例改变 + iSetX = iSetX*iSetBin/binF;//bin鏀瑰彉鍚, startpos鏄浉瀵逛簬bin鍚庣殑鐢婚潰鐨勶紝涔熻鎸夌収姣斾緥鏀瑰彉 iSetY = iSetY*iSetBin/binF; if(ASISetROIFormat(ASICameraInfo.CameraID, iSetWid, iSetHei, binF, ImgType) == ASI_SUCCESS) { DeleteImgBuf(); - ASISetStartPos(ASICameraInfo.CameraID, iSetX, iSetY);//会重新计算startx 和starty,和所选区域不同,因此要重新设置 + ASISetStartPos(ASICameraInfo.CameraID, iSetX, iSetY);//浼氶噸鏂拌绠梥tartx 鍜宻tarty锛屽拰鎵閫夊尯鍩熶笉鍚岋紝鍥犳瑕侀噸鏂拌缃 } ASIGetROIFormat(ASICameraInfo.CameraID, &iROIWidth, &iROIHeight, &iBin, &ImgType); iSetBin = binF; @@ -1253,7 +1253,7 @@ int CMyASICam::OnBinning(MM::PropertyBase* pProp, MM::ActionType eAct) */ int CMyASICam::OnPixelType(MM::PropertyBase* pProp, MM::ActionType eAct) { - if (eAct == MM::AfterSet)//从控件得到选定的值 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫 { string val; pProp->Get(val); @@ -1295,7 +1295,7 @@ int CMyASICam::OnPixelType(MM::PropertyBase* pProp, MM::ActionType eAct) } - else if (eAct == MM::BeforeGet)//值给控件显示 + else if (eAct == MM::BeforeGet)//鍊肩粰鎺т欢鏄剧ず { ASIGetROIFormat(ASICameraInfo.CameraID, &iROIWidth, &iROIHeight, &iBin, &ImgType); @@ -1354,7 +1354,7 @@ int CMyASICam::OnGain(MM::PropertyBase* pProp, MM::ActionType eAct) int CMyASICam::OnSelectCamIndex(MM::PropertyBase* pProp, MM::ActionType eAct) { string str; - if (eAct == MM::AfterSet)//从控件得到选定的值 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫 { pProp->Get(str); for(int i = 0; i < iConnectedCamNum; i++) @@ -1368,7 +1368,7 @@ int CMyASICam::OnSelectCamIndex(MM::PropertyBase* pProp, MM::ActionType eAct) } } } - else if (eAct == MM::BeforeGet)//值给控件显示 + else if (eAct == MM::BeforeGet)//鍊肩粰鎺т欢鏄剧ず { pProp->Set(sz_ModelIndex); } @@ -1402,12 +1402,12 @@ int CMyASICam::OnBrightness(MM::PropertyBase* pProp,MM::ActionType eAct) { long lVal; ASI_BOOL bAuto; - if (eAct == MM::AfterSet)//从控件得到选定的值 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫 { pProp->Get(lVal); ASISetControlValue(ASICameraInfo.CameraID,ASI_BRIGHTNESS, lVal, ASI_FALSE); } - else if (eAct == MM::BeforeGet)//值给控件显示 + else if (eAct == MM::BeforeGet)//鍊肩粰鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID, ASI_BRIGHTNESS, &lVal, &bAuto); pProp->Set(lVal); @@ -1423,12 +1423,12 @@ int CMyASICam::OnUSBTraffic(MM::PropertyBase* pProp, MM::ActionType eAct) { long lVal; ASI_BOOL bAuto; - if (eAct == MM::AfterSet)//从控件得到选定的值 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫 { pProp->Get(lVal); ASISetControlValue(ASICameraInfo.CameraID,ASI_BANDWIDTHOVERLOAD, lVal, ASI_FALSE); } - else if (eAct == MM::BeforeGet)//值给控件显示 + else if (eAct == MM::BeforeGet)//鍊肩粰鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_BANDWIDTHOVERLOAD, &lVal, &bAuto); pProp->Set(lVal); @@ -1444,7 +1444,7 @@ int CMyASICam::OnUSB_Auto(MM::PropertyBase* pProp, MM::ActionType eAct) { long lVal; ASI_BOOL bAuto; - if (eAct == MM::AfterSet)//从控件得到选定的值 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫 { ASIGetControlValue(ASICameraInfo.CameraID,ASI_BANDWIDTHOVERLOAD, &lVal, &bAuto); string strVal; @@ -1453,7 +1453,7 @@ int CMyASICam::OnUSB_Auto(MM::PropertyBase* pProp, MM::ActionType eAct) ASISetControlValue(ASICameraInfo.CameraID,ASI_BANDWIDTHOVERLOAD, lVal, bAuto); // SetPropertyReadOnly(g_Keyword_USBTraffic, bAuto); } - else if (eAct == MM::BeforeGet)//值给控件显示 + else if (eAct == MM::BeforeGet)//鍊肩粰鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_BANDWIDTHOVERLOAD, &lVal, &bAuto); pProp->Set(bAuto==ASI_TRUE?g_Keyword_on:g_Keyword_off); @@ -1473,11 +1473,11 @@ int CMyASICam::OnCoolerOn(MM::PropertyBase* pProp, MM::ActionType eAct) { // ASIGetControlValue(iCamIndex, ASI_TARGET_TEMP, &lVal, &bAuto); string strVal; - pProp->Get(strVal);//从控件得到选定的值 + pProp->Get(strVal);//浠庢帶浠跺緱鍒伴夊畾鐨勫 lVal = !strVal.compare(g_Keyword_on); ASISetControlValue(ASICameraInfo.CameraID, ASI_COOLER_ON, lVal, ASI_FALSE); } - else if (eAct == MM::BeforeGet)//值给控件显示 + else if (eAct == MM::BeforeGet)//鍊肩粰鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID, ASI_COOLER_ON, &lVal, &bAuto); pProp->Set(lVal > 0?g_Keyword_on:g_Keyword_off); @@ -1495,11 +1495,11 @@ int CMyASICam::OnHeater(MM::PropertyBase* pProp, MM::ActionType eAct) { // ASIGetControlValue(iCamIndex, ASI_TARGET_TEMP, &lVal, &bAuto); string strVal; - pProp->Get(strVal);//从控件得到选定的值 + pProp->Get(strVal);//浠庢帶浠跺緱鍒伴夊畾鐨勫 lVal = !strVal.compare(g_Keyword_on); ASISetControlValue(ASICameraInfo.CameraID, ASI_ANTI_DEW_HEATER, lVal, ASI_FALSE); } - else if (eAct == MM::BeforeGet)//值给控件显示 + else if (eAct == MM::BeforeGet)//鍊肩粰鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID, ASI_ANTI_DEW_HEATER, &lVal, &bAuto); pProp->Set(lVal > 0?g_Keyword_on:g_Keyword_off); @@ -1516,10 +1516,10 @@ int CMyASICam::OnTargetTemp(MM::PropertyBase* pProp, MM::ActionType eAct) if (eAct == MM::AfterSet) { ASIGetControlValue(ASICameraInfo.CameraID,ASI_TARGET_TEMP, &lVal, &bAuto); - pProp->Get(lVal);//从控件得到选定的值->变量 + pProp->Get(lVal);//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 ASISetControlValue(ASICameraInfo.CameraID,ASI_TARGET_TEMP, lVal, bAuto); } - else if (eAct == MM::BeforeGet)//变量值->控件显示 + else if (eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_TARGET_TEMP, &lVal, &bAuto); pProp->Set(lVal); @@ -1535,10 +1535,10 @@ int CMyASICam::OnCoolerPowerPerc(MM::PropertyBase* pProp, MM::ActionType eAct) ASI_BOOL bAuto; if (eAct == MM::AfterSet) { - pProp->Get(lVal);//从控件得到选定的值->变量 + pProp->Get(lVal);//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 } - else if (eAct == MM::BeforeGet)//变量值->控件显示 + else if (eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_COOLER_POWER_PERC, &lVal, &bAuto); pProp->Set(lVal); @@ -1554,10 +1554,10 @@ int CMyASICam::OnWB_R(MM::PropertyBase* pProp, MM::ActionType eAct) ASI_BOOL bAuto; if (eAct == MM::AfterSet) { - pProp->Get(lVal);//从控件得到选定的值->变量 + pProp->Get(lVal);//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 ASISetControlValue(ASICameraInfo.CameraID,ASI_WB_R, lVal, ASI_FALSE); } - else if (eAct == MM::BeforeGet)//变量值->控件显示 + else if (eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_WB_R, &lVal, &bAuto); pProp->Set(lVal); @@ -1573,10 +1573,10 @@ int CMyASICam::OnWB_B(MM::PropertyBase* pProp, MM::ActionType eAct) ASI_BOOL bAuto; if (eAct == MM::AfterSet) { - pProp->Get(lVal);//从控件得到选定的值->变量 + pProp->Get(lVal);//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 ASISetControlValue(ASICameraInfo.CameraID,ASI_WB_B, lVal, ASI_FALSE); } - else if (eAct == MM::BeforeGet)//变量值->控件显示 + else if (eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_WB_B, &lVal, &bAuto); pProp->Set(lVal); @@ -1594,14 +1594,14 @@ int CMyASICam::OnAutoWB(MM::PropertyBase* pProp, MM::ActionType eAct) if (eAct == MM::AfterSet) { ASIGetControlValue(ASICameraInfo.CameraID,ASI_WB_B, &lVal, &bAuto); - pProp->Get(strVal);//从控件得到选定的值->变量 + pProp->Get(strVal);//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 bAuto = strVal.compare(g_Keyword_on)?ASI_FALSE:ASI_TRUE; ASISetControlValue(ASICameraInfo.CameraID,ASI_WB_B, lVal, bAuto); // SetPropertyReadOnly(g_Keyword_WB_R,bAuto ); // SetPropertyReadOnly(g_Keyword_WB_B,bAuto ); } - else if (eAct == MM::BeforeGet)//变量值->控件显示 + else if (eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_WB_B, &lVal, &bAuto); pProp->Set(bAuto?g_Keyword_on:g_Keyword_off); @@ -1617,13 +1617,13 @@ int CMyASICam::OnGamma(MM::PropertyBase* pProp, MM::ActionType eAct) { long lVal; ASI_BOOL bAuto; - if (eAct == MM::AfterSet)//从控件得到选定的值->变量 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 { pProp->Get(lVal); ASISetControlValue(ASICameraInfo.CameraID,ASI_GAMMA, lVal, ASI_FALSE); } - else if(eAct == MM::BeforeGet)//变量值->控件显示 + else if(eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_GAMMA, &lVal, &bAuto); pProp->Set(lVal); @@ -1637,7 +1637,7 @@ int CMyASICam::OnAutoExp(MM::PropertyBase* pProp, MM::ActionType eAct) { long lVal; ASI_BOOL bAuto; - if (eAct == MM::AfterSet)//从控件得到选定的值->变量 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 { ASIGetControlValue(ASICameraInfo.CameraID,ASI_EXPOSURE, &lVal, &bAuto); string strVal; @@ -1645,7 +1645,7 @@ int CMyASICam::OnAutoExp(MM::PropertyBase* pProp, MM::ActionType eAct) bAuto = strVal.compare(g_Keyword_on)?ASI_FALSE:ASI_TRUE; ASISetControlValue(ASICameraInfo.CameraID,ASI_EXPOSURE, lVal, bAuto); } - else if(eAct == MM::BeforeGet)//变量值->控件显示 + else if(eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_EXPOSURE, &lVal, &bAuto); pProp->Set(bAuto?g_Keyword_on:g_Keyword_off); @@ -1660,7 +1660,7 @@ int CMyASICam::OnAutoGain(MM::PropertyBase* pProp, MM::ActionType eAct) { long lVal; ASI_BOOL bAuto; - if (eAct == MM::AfterSet)//从控件得到选定的值->变量 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 { ASIGetControlValue(ASICameraInfo.CameraID,ASI_GAIN, &lVal, &bAuto); string strVal; @@ -1668,7 +1668,7 @@ int CMyASICam::OnAutoGain(MM::PropertyBase* pProp, MM::ActionType eAct) bAuto = strVal.compare(g_Keyword_on)?ASI_FALSE:ASI_TRUE; ASISetControlValue(ASICameraInfo.CameraID,ASI_GAIN, lVal, bAuto); } - else if(eAct == MM::BeforeGet)//变量值->控件显示 + else if(eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_GAIN, &lVal, &bAuto); pProp->Set(bAuto?g_Keyword_on:g_Keyword_off); @@ -1683,7 +1683,7 @@ int CMyASICam::OnFlip(MM::PropertyBase* pProp, MM::ActionType eAct) { long lVal; ASI_BOOL bAuto; - if (eAct == MM::AfterSet)//从控件得到选定的值->变量 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 { ASIGetControlValue(ASICameraInfo.CameraID, ASI_FLIP, &lVal, &bAuto); string strVal; @@ -1698,7 +1698,7 @@ int CMyASICam::OnFlip(MM::PropertyBase* pProp, MM::ActionType eAct) } } - else if(eAct == MM::BeforeGet)//变量值->控件显示 + else if(eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_FLIP, &lVal, &bAuto); pProp->Set(FlipArr[lVal]); @@ -1712,14 +1712,14 @@ int CMyASICam::OnHighSpeedMod(MM::PropertyBase* pProp, MM::ActionType eAct) { long lVal; ASI_BOOL bAuto; - if (eAct == MM::AfterSet)//从控件得到选定的值->变量 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 { string strVal; pProp->Get(strVal); lVal = strVal.compare(g_Keyword_on)?0:1; ASISetControlValue(ASICameraInfo.CameraID,ASI_HIGH_SPEED_MODE, lVal, ASI_FALSE); } - else if(eAct == MM::BeforeGet)//变量值->控件显示 + else if(eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_HIGH_SPEED_MODE, &lVal, &bAuto); pProp->Set(lVal?g_Keyword_on:g_Keyword_off); @@ -1733,14 +1733,14 @@ int CMyASICam::OnHardwareBin(MM::PropertyBase* pProp, MM::ActionType eAct) { long lVal; ASI_BOOL bAuto; - if (eAct == MM::AfterSet)//从控件得到选定的值->变量 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 { string strVal; pProp->Get(strVal); lVal = strVal.compare(g_Keyword_on)?0:1; ASISetControlValue(ASICameraInfo.CameraID,ASI_HARDWARE_BIN, lVal, ASI_FALSE); } - else if(eAct == MM::BeforeGet)//变量值->控件显示 + else if(eAct == MM::BeforeGet)//鍙橀噺鍊->鎺т欢鏄剧ず { ASIGetControlValue(ASICameraInfo.CameraID,ASI_HARDWARE_BIN, &lVal, &bAuto); pProp->Set(lVal?g_Keyword_on:g_Keyword_off); @@ -1850,14 +1850,14 @@ CMyEFW::CMyEFW() : for(int i = 0; i < iConnectedEFWNum; i++) { EFWGetID(i, &EFWInfo.ID); - sprintf(ConnectedEFWName[i], "EFW (ID %d)", EFWInfo.ID);//保存名字 + sprintf(ConnectedEFWName[i], "EFW (ID %d)", EFWInfo.ID);//淇濆瓨鍚嶅瓧 EFWIndexValues.push_back(ConnectedEFWName[i]); } - CPropertyAction *pAct = new CPropertyAction (this, &CMyEFW::OnSelectEFWIndex);//通过名字选择打开的序号 + CPropertyAction *pAct = new CPropertyAction (this, &CMyEFW::OnSelectEFWIndex);//閫氳繃鍚嶅瓧閫夋嫨鎵撳紑鐨勫簭鍙 if(iConnectedEFWNum > 0) { - strcpy(sz_ModelIndex, ConnectedEFWName[0]);//默认打开第一个 + strcpy(sz_ModelIndex, ConnectedEFWName[0]);//榛樿鎵撳紑绗竴涓 //iCamIndex = 0; EFWGetID(0, &EFWInfo.ID); } @@ -1866,7 +1866,7 @@ CMyEFW::CMyEFW() : strcpy(sz_ModelIndex,"no EFW connected"); } // strcpy(sz_ModelIndex, "DropDown"); - ret = CreateProperty(g_DeviceIndex, sz_ModelIndex, MM::String, false, pAct, true); //选择摄像头序号 + ret = CreateProperty(g_DeviceIndex, sz_ModelIndex, MM::String, false, pAct, true); //閫夋嫨鎽勫儚澶村簭鍙 SetAllowedValues(g_DeviceIndex, EFWIndexValues); assert(ret == DEVICE_OK); } @@ -1942,7 +1942,7 @@ int CMyEFW::Initialize() return DEVICE_OK; } -bool CMyEFW::Busy()//返回true时不刷新label和state +bool CMyEFW::Busy()//杩斿洖true鏃朵笉鍒锋柊label鍜宻tate { if(bPosWait)// { @@ -1983,9 +1983,9 @@ int CMyEFW::Shutdown() // Action handlers /////////////////////////////////////////////////////////////////////////////// -int CMyEFW::OnState(MM::PropertyBase* pProp, MM::ActionType eAct)//CStateDeviceBase::OnLabel 会调用这里 +int CMyEFW::OnState(MM::PropertyBase* pProp, MM::ActionType eAct)//CStateDeviceBase::OnLabel 浼氳皟鐢ㄨ繖閲 { - if (eAct == MM::BeforeGet)//值给控件显示 + if (eAct == MM::BeforeGet)//鍊肩粰鎺т欢鏄剧ず { int pos; EFWGetPosition(EFWInfo.ID, &pos); @@ -1998,7 +1998,7 @@ int CMyEFW::Shutdown() } // nothing to do, let the caller to use cached property } - else if (eAct == MM::AfterSet)//从控件得到选定的值->变量 + else if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫->鍙橀噺 { // Set timer for the Busy signal // changedTime_ = GetCurrentMMTime(); @@ -2024,7 +2024,7 @@ int CMyEFW::Shutdown() int CMyEFW::OnSelectEFWIndex(MM::PropertyBase* pProp, MM::ActionType eAct) { string str; - if (eAct == MM::AfterSet)//从控件得到选定的值 + if (eAct == MM::AfterSet)//浠庢帶浠跺緱鍒伴夊畾鐨勫 { pProp->Get(str); for(int i = 0; i < iConnectedEFWNum; i++) @@ -2038,7 +2038,7 @@ int CMyEFW::OnSelectEFWIndex(MM::PropertyBase* pProp, MM::ActionType eAct) } } } - else if (eAct == MM::BeforeGet)//值给控件显示 + else if (eAct == MM::BeforeGet)//鍊肩粰鎺т欢鏄剧ず { pProp->Set(sz_ModelIndex); } diff --git a/DeviceAdapters/ZWO/MyASICam2.h b/DeviceAdapters/ZWO/MyASICam2.h index b0b466df4..6710bf6b1 100644 --- a/DeviceAdapters/ZWO/MyASICam2.h +++ b/DeviceAdapters/ZWO/MyASICam2.h @@ -99,10 +99,10 @@ class CMyASICam:public CCameraBase unsigned long iBufSize; - int iPixBytes;//每个像素字节数 + int iPixBytes;//姣忎釜鍍忕礌瀛楄妭鏁 int iComponents; - int iROIWidth, iROIHeight, iBin;//sensor的坐标尺寸信息 - int iSetWid, iSetHei, iSetBin, iSetX, iSetY; //要设置的坐标尺寸信息 + int iROIWidth, iROIHeight, iBin;//sensor鐨勫潗鏍囧昂瀵镐俊鎭 + int iSetWid, iSetHei, iSetBin, iSetX, iSetY; //瑕佽缃殑鍧愭爣灏哄淇℃伅 ASI_IMG_TYPE ImgType; friend class SequenceThread; @@ -111,7 +111,7 @@ class CMyASICam:public CCameraBase ASI_CAMERA_INFO ASICameraInfo; int iCtrlNum; ASI_FLIP_STATUS ImgFlip; - int ImgStartX, ImgStartY, ImgBin, ImgWid, ImgHei;//所显示图像的坐标尺寸信息 + int ImgStartX, ImgStartY, ImgBin, ImgWid, ImgHei;//鎵鏄剧ず鍥惧儚鐨勫潗鏍囧昂瀵镐俊鎭 // int iCamIndex; @@ -190,4 +190,4 @@ class CMyEFW : public CStateDeviceBase bool bPosWait; // long position_; }; -//2.0.0.0->20170113:增加anti-dew和EFW \ No newline at end of file +//2.0.0.0->20170113:澧炲姞anti-dew鍜孍FW \ No newline at end of file diff --git a/DeviceAdapters/ZWO/SequenceThread.cpp b/DeviceAdapters/ZWO/SequenceThread.cpp index 37378f202..ecda11ab2 100644 --- a/DeviceAdapters/ZWO/SequenceThread.cpp +++ b/DeviceAdapters/ZWO/SequenceThread.cpp @@ -64,7 +64,7 @@ void SequenceThread::Start(long numImages, double intervalMs) imageCounter_=0; stop_ = false; OutputDbgPrint("bf act\n"); - activate();//开始线程 + activate();//寮濮嬬嚎绋 OutputDbgPrint("af act\n"); }