From 98881cfed01699a42f0fc962dcb617421ed38a05 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 19 Jun 2024 09:40:13 -0400 Subject: [PATCH] use keyword for Camera tag --- DeviceAdapters/ABS/ABSCamera.cpp | 6 +- .../AlliedVisionCamera/AlliedVisionCamera.cpp | 2 +- DeviceAdapters/AmScope/AmScope.cpp | 2 +- DeviceAdapters/Andor/Andor.cpp | 2 +- DeviceAdapters/Aravis/AravisCamera.cpp | 2 +- DeviceAdapters/Atik/Atik.cpp | 2 +- DeviceAdapters/Basler/BaslerPylonCamera.cpp | 2 +- .../BaumerOptronic/BaumerOptronic.cpp | 2 +- DeviceAdapters/DahengGalaxy/ClassGalaxy.cpp | 216 +++++++++--------- DeviceAdapters/DemoCamera/DemoCamera.cpp | 2 +- .../Fli/FirstLightImagingCameras.cpp | 2 +- DeviceAdapters/Hikrobot/HikrobotCamera.cpp | 106 ++++----- DeviceAdapters/IDSPeak/IDSPeak.cpp | 2 +- DeviceAdapters/IDS_uEye/IDS_uEye.cpp | 2 +- DeviceAdapters/IIDC/MMIIDCCamera.cpp | 2 +- .../MatrixVision/mvIMPACT_Acquire_Device.cpp | 2 +- .../Mightex_C_Cam/Mightex_USBCamera.cpp | 2 +- .../OpenCVgrabber/OpenCVgrabber.cpp | 2 +- DeviceAdapters/PICAM/PICAMUniversal.cpp | 2 +- DeviceAdapters/PVCAM/PVCAMUniversal.cpp | 2 +- DeviceAdapters/PlayerOne/POACamera.cpp | 2 +- DeviceAdapters/PyDevice/PyCamera.cpp | 2 +- DeviceAdapters/QSI/QSICameraAdapter.cpp | 2 +- DeviceAdapters/RaptorEPIX/RaptorEPIX.cpp | 4 +- .../SequenceTester/SequenceTester.cpp | 2 +- DeviceAdapters/SigmaKoki/Camera.cpp | 2 +- DeviceAdapters/Spinnaker/SpinnakerCamera.cpp | 2 +- DeviceAdapters/TISCam/TIScamera.cpp | 4 +- DeviceAdapters/TUCam/MMTUCam.cpp | 2 +- .../ThorlabsUSBCamera/ThorlabsUSBCamera.cpp | 2 +- DeviceAdapters/UniversalMMHubUsb/ummhUsb.cpp | 2 +- DeviceAdapters/ZWO/MyASICam2.cpp | 166 +++++++------- MMCore/CircularBuffer.cpp | 2 +- MMCore/CoreCallback.cpp | 2 +- MMDevice/DeviceBase.h | 2 +- MMDevice/MMDeviceConstants.h | 1 + 36 files changed, 281 insertions(+), 280 deletions(-) diff --git a/DeviceAdapters/ABS/ABSCamera.cpp b/DeviceAdapters/ABS/ABSCamera.cpp index e95d618ac..f299f52f1 100644 --- a/DeviceAdapters/ABS/ABSCamera.cpp +++ b/DeviceAdapters/ABS/ABSCamera.cpp @@ -704,7 +704,7 @@ int CABSCamera::Initialize() temperatureIndex_ = 0; pAct = new CPropertyAction (this, &CABSCamera::OnTemperature); - nRet = CreateProperty(MM::g_Keyword_CCDTemperature, "20.0 °C", MM::String, true, pAct); + nRet = CreateProperty(MM::g_Keyword_CCDTemperature, "20.0 �C", MM::String, true, pAct); assert(nRet == DEVICE_OK); } } @@ -1258,7 +1258,7 @@ int CABSCamera::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString( imageCounter_ )); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString( (long) GetImageWidth())); @@ -2956,7 +2956,7 @@ int CABSCamera::OnTemperature(MM::PropertyBase* pProp, MM::ActionType eAct) if ( IsNoError( rc ) ) { string temperature; - str::sprintf( temperature, "%3.2f °C \0\0", sTR.wSensorValue / temperatureUnit_ ); + str::sprintf( temperature, "%3.2f �C \0\0", sTR.wSensorValue / temperatureUnit_ ); pProp->Set( temperature.c_str() ); } return convertApiErrorCode( rc, __FUNCTION__ ); diff --git a/DeviceAdapters/AlliedVisionCamera/AlliedVisionCamera.cpp b/DeviceAdapters/AlliedVisionCamera/AlliedVisionCamera.cpp index fbc80e37c..d33914664 100644 --- a/DeviceAdapters/AlliedVisionCamera/AlliedVisionCamera.cpp +++ b/DeviceAdapters/AlliedVisionCamera/AlliedVisionCamera.cpp @@ -1384,7 +1384,7 @@ void AlliedVisionCamera::insertFrame(VmbFrame_t *frame) // TODO implement metadata Metadata md; - md.put("Camera", m_cameraName); + md.put(MM::g_Keyword_Metadata_CameraLabel, m_cameraName); VmbUint8_t *buffer = reinterpret_cast(frame->buffer); err = GetCoreCallback()->InsertImage(this, buffer, GetImageWidth(), GetImageHeight(), m_currentPixelFormat.getBytesPerPixel(), diff --git a/DeviceAdapters/AmScope/AmScope.cpp b/DeviceAdapters/AmScope/AmScope.cpp index cecaf886d..77a043190 100644 --- a/DeviceAdapters/AmScope/AmScope.cpp +++ b/DeviceAdapters/AmScope/AmScope.cpp @@ -769,7 +769,7 @@ int AmScope::InsertImage() MMThreadGuard g(imgPixelsLock_); // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString( imageCounter_ )); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString( (long) roiX_)); diff --git a/DeviceAdapters/Andor/Andor.cpp b/DeviceAdapters/Andor/Andor.cpp index c2dd44805..ef4cbbe2b 100644 --- a/DeviceAdapters/Andor/Andor.cpp +++ b/DeviceAdapters/Andor/Andor.cpp @@ -5780,7 +5780,7 @@ unsigned int AndorCamera::PopulateROIDropdownFVB() // remove first .put deprecated and check if any changes. Perhaps take 5seq MDA first using current build, then rebuild and check difference // Check both MM Metadata, and .text file generated by stack images. // add SRRF - may need better timings, perhaps a new m_var_ but can decide during impl. - //md.put("Camera", label); + //md.put(MM::g_Keyword_Metadata_CameraLabel, label); //md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timestamp - startTime_).getMsec())); //md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString(imageCounter_)); //md.put(MM::g_Keyword_Binning, binSize_); diff --git a/DeviceAdapters/Aravis/AravisCamera.cpp b/DeviceAdapters/Aravis/AravisCamera.cpp index 63ca2ec0d..7c740b3d3 100644 --- a/DeviceAdapters/Aravis/AravisCamera.cpp +++ b/DeviceAdapters/Aravis/AravisCamera.cpp @@ -168,7 +168,7 @@ void AravisCamera::AcquisitionCallback(ArvStreamCallbackType type, ArvBuffer *cb ArvBufferUpdate(cb_arv_buffer); // Image metadata. - md.put("Camera", ""); + md.put(MM::g_Keyword_Metadata_CameraLabel, ""); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString((long)img_buffer_width)); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString((long)img_buffer_height)); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString(counter)); diff --git a/DeviceAdapters/Atik/Atik.cpp b/DeviceAdapters/Atik/Atik.cpp index d5444c358..5165f8385 100644 --- a/DeviceAdapters/Atik/Atik.cpp +++ b/DeviceAdapters/Atik/Atik.cpp @@ -880,7 +880,7 @@ int Atik::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", "Atik SDK Camera"); + md.put(MM::g_Keyword_Metadata_CameraLabel, "Atik SDK Camera"); string serialised = md.Serialize(); diff --git a/DeviceAdapters/Basler/BaslerPylonCamera.cpp b/DeviceAdapters/Basler/BaslerPylonCamera.cpp index 3e98fe9ba..c6403320e 100644 --- a/DeviceAdapters/Basler/BaslerPylonCamera.cpp +++ b/DeviceAdapters/Basler/BaslerPylonCamera.cpp @@ -2127,7 +2127,7 @@ void CircularBufferInserter::OnImageGrabbed(CInstantCamera& /* camera */, const // Important: meta data about the image are generated here: Metadata md; - md.put("Camera", ""); + md.put(MM::g_Keyword_Metadata_CameraLabel, ""); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString((long)ptrGrabResult->GetWidth())); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString((long)ptrGrabResult->GetHeight())); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString((long)ptrGrabResult->GetImageNumber())); diff --git a/DeviceAdapters/BaumerOptronic/BaumerOptronic.cpp b/DeviceAdapters/BaumerOptronic/BaumerOptronic.cpp index 40cb85a65..6fc0276e4 100644 --- a/DeviceAdapters/BaumerOptronic/BaumerOptronic.cpp +++ b/DeviceAdapters/BaumerOptronic/BaumerOptronic.cpp @@ -2273,7 +2273,7 @@ int CBaumerOptronic::SendImageToCore() char label[MM::MaxStrLength]; this->GetLabel(label); Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); int err = WaitForImageAndCopyToBuffer(); if (err != DEVICE_OK) diff --git a/DeviceAdapters/DahengGalaxy/ClassGalaxy.cpp b/DeviceAdapters/DahengGalaxy/ClassGalaxy.cpp index 0c4dc32f9..7b522e971 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λͼ��RGB } 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; - //Ã÷È·Ïà»úµÄ²Éͼ¸ñʽ + //��ȷ����IJ�ͼ��ʽ 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();//ԭ����buffersize 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; - //Ã÷È·Ïà»úµÄ²Éͼ¸ñʽ + //��ȷ����IJ�ͼ��ʽ 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 { - //´úÂ뱨´í + //���뱨�� - //ÉèÖÃÐÂÖµ + //������ֵ 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(); - //Ã÷È·Ïà»úµÄ²Éͼ¸ñʽ + //��ȷ����IJ�ͼ��ʽ emValidBits = GetBestValudBit(objImageDataPointer->GetPixelFormat()); if (emValidBits!= GX_BIT_0_7) { @@ -1698,15 +1698,15 @@ void ClassGalaxy::RG8ToRGB24Packed(void* destbuffer,CImageDataPointer& objImageD try { GX_VALID_BIT_LIST emValidBits = GX_BIT_0_7; - //Ã÷È·Ïà»úµÄ²Éͼ¸ñʽ + //��ȷ����IJ�ͼ��ʽ 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; - //Ã÷È·Ïà»úµÄ²Éͼ¸ñʽ + //��ȷ����IJ�ͼ��ʽ 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) @@ -1859,7 +1859,7 @@ void CircularBufferInserter::DoOnImageCaptured(CImageDataPointer& objImageDataPo //dev_->AddToLog("OnImageGrabbed"); // Important: meta data about the image are generated here: Metadata md; - md.put("Camera", ""); + md.put(MM::g_Keyword_Metadata_CameraLabel, ""); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString((long)objImageDataPointer->GetWidth())); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString((long)objImageDataPointer->GetHeight())); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString((long)objImageDataPointer->GetFrameID())); @@ -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λRGB 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Í·--------------------------- + //---------------------------��ʼ��bitmapÍ·--------------------------- 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); //�����ļ�ͷ��СtrueΪ��ɫ,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 + //��const char*ת��ΪLPCTSTR 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); //�����ļ�ͷ��СtrueΪ��ɫ,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 + //��const char*ת��ΪLPCTSTR 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(); // д���ļ��ij��� + DWORD dwBytesRead = 0; // �ļ���ȡ�ij��� BYTE* pbuffer = (BYTE*)objCImageDataPointer->GetBuffer(); const char* strEn = strFilePath.c_str(); - //½«const char*ת»¯ÎªLPCTSTR + //��const char*ת��ΪLPCTSTR 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/DemoCamera/DemoCamera.cpp b/DeviceAdapters/DemoCamera/DemoCamera.cpp index c0444e2e0..cde5082f7 100644 --- a/DeviceAdapters/DemoCamera/DemoCamera.cpp +++ b/DeviceAdapters/DemoCamera/DemoCamera.cpp @@ -1092,7 +1092,7 @@ int CDemoCamera::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString( (long) roiX_)); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString( (long) roiY_)); diff --git a/DeviceAdapters/Fli/FirstLightImagingCameras.cpp b/DeviceAdapters/Fli/FirstLightImagingCameras.cpp index b85ab904c..48ad3912d 100644 --- a/DeviceAdapters/Fli/FirstLightImagingCameras.cpp +++ b/DeviceAdapters/Fli/FirstLightImagingCameras.cpp @@ -217,7 +217,7 @@ void FirstLightImagingCameras::imageReceived(const uint8_t* image) Metadata md; char label[MM::MaxStrLength]; GetLabel(label); - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString((long)w)); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString((long)h)); diff --git a/DeviceAdapters/Hikrobot/HikrobotCamera.cpp b/DeviceAdapters/Hikrobot/HikrobotCamera.cpp index 58fa28e79..279b081a9 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 ���� ��������ԭ�ò£¬µï¿½ï¿½ï¿½ ת����RGB32�쳣�������� #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); //Ôö¼Ó˵Ã÷£º ´Ë´¦ÊDzå¼þµÄÃû×Ö£¬¾ßÌåÏà»úÐòÁкÅÊÇÐèÒª £¨GetProperty("SerialNumber", serialNumber);£© ÖÐÑ¡ÔñµÄ¡£ £¨baslerÒ²ÊÇͬÑùµÄÂß¼­£© + CDeviceUtils::CopyLimitedString(name, g_HikrobotCameraDeviceName); //����˵���� �˴��Dz�������֣�����������к�����Ҫ ��GetProperty("SerialNumber", serialNumber);�� ��ѡ��ġ� ��baslerҲ��ͬ�����߼��� } /** @@ -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"); //�ο�basler���Ȱ�off����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"); // �������������ڵ㣬�����ߵ������֧��; �ο�basler��֧��basler������off�ڵ� 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��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 */ MvWriteLog(__FILE__, __LINE__, m_chDevID, "SnapImage Begin"); @@ -891,8 +891,8 @@ int HikrobotCamera::SnapImage() do { - //´Ë´¦ÔÝʱÉ趨1s, ÈôÏà»úÖ¡ÂʹýµÍ£¬Ôò¿ÉÄÜÒì³££¬ÐèÒªµ÷Õû; - // ³¬Ê±Ê±¼ä²»ÄÜÌ«³¤£¬ÈÝÒ×µ¼Ö½ӿڿ¨ËÀÒì³£; + //�˴���ʱ�趨1s, �����֡�ʹ��ͣ�������쳣����Ҫ����; + // ��ʱʱ�䲻��̫�������׵��½ӿڿ����쳣; 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; - //Èç¹ûÊDzÊÉ«Ôòת³ÉRGB8 + //����Dz�ɫ��ת��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 + //����Ǻڰ���ת����Mono8 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ͳһת����mon8,��������ת��ΪRGBA32 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ͳһת����mon8,��������ת��ΪRGBA32 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�������ٴ�start; ImageJ �н�ͼ��ȡ������ͬʱʹ�� [��ͼ�󣬿���start���ܻᱨ��] } 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) { @@ -1541,7 +1541,7 @@ void HikrobotCamera::ImageRecvThreadProc() //!fix , md must assign something Metadata md; - md.put("Camera", ""); + md.put(MM::g_Keyword_Metadata_CameraLabel, ""); nRet = GetCoreCallback()->InsertImage(this, (const unsigned char*)stConvertParam.pDstBuffer, stOutFrame.stFrameInfo.nWidth, @@ -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/IDSPeak/IDSPeak.cpp b/DeviceAdapters/IDSPeak/IDSPeak.cpp index 310ade461..89c6dad8d 100644 --- a/DeviceAdapters/IDSPeak/IDSPeak.cpp +++ b/DeviceAdapters/IDSPeak/IDSPeak.cpp @@ -1178,7 +1178,7 @@ int CIDSPeak::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString((long)roiX_)); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString((long)roiY_)); diff --git a/DeviceAdapters/IDS_uEye/IDS_uEye.cpp b/DeviceAdapters/IDS_uEye/IDS_uEye.cpp index 750d239c2..d88cda6b8 100644 --- a/DeviceAdapters/IDS_uEye/IDS_uEye.cpp +++ b/DeviceAdapters/IDS_uEye/IDS_uEye.cpp @@ -1311,7 +1311,7 @@ int CIDS_uEye::InsertImage() */ // Add our own metadata - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString(imageCounter_)); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString( (long) roiX_)); diff --git a/DeviceAdapters/IIDC/MMIIDCCamera.cpp b/DeviceAdapters/IIDC/MMIIDCCamera.cpp index abd4a9444..c9eafc165 100644 --- a/DeviceAdapters/IIDC/MMIIDCCamera.cpp +++ b/DeviceAdapters/IIDC/MMIIDCCamera.cpp @@ -2071,7 +2071,7 @@ MMIIDCCamera::ProcessedSequenceCallback(const void* pixels, char label[MM::MaxStrLength]; GetLabel(label); - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); #ifndef _WIN32 // The Windows CMU backend does not provide a valid timestamp (the field diff --git a/DeviceAdapters/MatrixVision/mvIMPACT_Acquire_Device.cpp b/DeviceAdapters/MatrixVision/mvIMPACT_Acquire_Device.cpp index b5d2a488e..9150fd222 100644 --- a/DeviceAdapters/MatrixVision/mvIMPACT_Acquire_Device.cpp +++ b/DeviceAdapters/MatrixVision/mvIMPACT_Acquire_Device.cpp @@ -967,7 +967,7 @@ int mvIMPACT_Acquire_Device::InsertImage( void ) Metadata md; char label[MM::MaxStrLength]; GetLabel( label ); - md.put( "Camera", label ); + md.put(MM::g_Keyword_Metadata_CameraLabel, label ); MM::MMTime timeStamp = readoutStartTime_; md.put( MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString( ( timeStamp - sequenceStartTime_ ).getMsec() ) ); md.put( MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString( static_cast( pCurrentRequest_->infoFrameID.read() ) ) ); diff --git a/DeviceAdapters/Mightex_C_Cam/Mightex_USBCamera.cpp b/DeviceAdapters/Mightex_C_Cam/Mightex_USBCamera.cpp index 852ea683f..6e47d7168 100755 --- a/DeviceAdapters/Mightex_C_Cam/Mightex_USBCamera.cpp +++ b/DeviceAdapters/Mightex_C_Cam/Mightex_USBCamera.cpp @@ -1553,7 +1553,7 @@ int CMightex_BUF_USBCCDCamera::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString( (long) roiX_)); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString( (long) roiY_)); diff --git a/DeviceAdapters/OpenCVgrabber/OpenCVgrabber.cpp b/DeviceAdapters/OpenCVgrabber/OpenCVgrabber.cpp index 42d027286..acdaf1299 100644 --- a/DeviceAdapters/OpenCVgrabber/OpenCVgrabber.cpp +++ b/DeviceAdapters/OpenCVgrabber/OpenCVgrabber.cpp @@ -809,7 +809,7 @@ int COpenCVgrabber::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString(imageCounter_)); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString( (long) roiX_)); diff --git a/DeviceAdapters/PICAM/PICAMUniversal.cpp b/DeviceAdapters/PICAM/PICAMUniversal.cpp index eacade6f8..f2d0489d1 100644 --- a/DeviceAdapters/PICAM/PICAMUniversal.cpp +++ b/DeviceAdapters/PICAM/PICAMUniversal.cpp @@ -2525,7 +2525,7 @@ int Universal::BuildMetadata( Metadata& md ) MM::MMTime timestamp = GetCurrentMMTime(); md.Clear(); - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); #ifdef PICAM_FRAME_INFO_SUPPORTED md.PutImageTag("PICAM-FrameNr", pFrameInfo_->FrameNr); diff --git a/DeviceAdapters/PVCAM/PVCAMUniversal.cpp b/DeviceAdapters/PVCAM/PVCAMUniversal.cpp index 87a2ced4e..a87a7a9b3 100644 --- a/DeviceAdapters/PVCAM/PVCAMUniversal.cpp +++ b/DeviceAdapters/PVCAM/PVCAMUniversal.cpp @@ -4205,7 +4205,7 @@ int Universal::ProcessNotification( const NotificationEntry& entry ) { // Build the metadata Metadata md; - md.PutImageTag("Camera", deviceLabel_); + md.PutImageTag(MM::g_Keyword_Metadata_CameraLabel, deviceLabel_); md.PutImageTag("TimeStampMsec", CDeviceUtils::ConvertToString(frameNfo.TimeStampMsec())); #ifdef PVCAM_FRAME_INFO_SUPPORTED diff --git a/DeviceAdapters/PlayerOne/POACamera.cpp b/DeviceAdapters/PlayerOne/POACamera.cpp index 1ffe8ec4f..91894d391 100644 --- a/DeviceAdapters/PlayerOne/POACamera.cpp +++ b/DeviceAdapters/PlayerOne/POACamera.cpp @@ -1371,7 +1371,7 @@ int POACamera::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString((long)roiX_)); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString((long)roiY_)); diff --git a/DeviceAdapters/PyDevice/PyCamera.cpp b/DeviceAdapters/PyDevice/PyCamera.cpp index 9df8c0a0a..776eb74f8 100644 --- a/DeviceAdapters/PyDevice/PyCamera.cpp +++ b/DeviceAdapters/PyDevice/PyCamera.cpp @@ -232,7 +232,7 @@ int CPyCamera::InsertImage() char label[MM::MaxStrLength]; this->GetLabel(label); Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); auto buffer = GetImageBuffer(); if (!buffer) return DEVICE_ERR; diff --git a/DeviceAdapters/QSI/QSICameraAdapter.cpp b/DeviceAdapters/QSI/QSICameraAdapter.cpp index c52873ff5..0ac9ff97b 100644 --- a/DeviceAdapters/QSI/QSICameraAdapter.cpp +++ b/DeviceAdapters/QSI/QSICameraAdapter.cpp @@ -480,7 +480,7 @@ int QSICameraAdapter::InsertImage() // Assemble metadata this->GetLabel( label ); - metadata.put( "Camera", label ); + metadata.put(MM::g_Keyword_Metadata_CameraLabel, label ); pSerializedMetadata = metadata.Serialize().c_str(); diff --git a/DeviceAdapters/RaptorEPIX/RaptorEPIX.cpp b/DeviceAdapters/RaptorEPIX/RaptorEPIX.cpp index 267d57358..4b019f6b1 100644 --- a/DeviceAdapters/RaptorEPIX/RaptorEPIX.cpp +++ b/DeviceAdapters/RaptorEPIX/RaptorEPIX.cpp @@ -2524,7 +2524,7 @@ int CRaptorEPIX::Initialize() case PIXCI_D32: osModel << "PIXCI(R) D32 Imaging Board"; break ; case PIXCI_D2X: osModel << "PIXCI(R) D2X Imaging Board"; break ; case PIXCI_D3X: osModel << "PIXCI(R) D3X Imaging Board"; break ; - case PIXCI_D3XE: osModel << "PIXCI® D3XE Frame Grabber"; break ; + case PIXCI_D3XE: osModel << "PIXCI� D3XE Frame Grabber"; break ; case PIXCI_E1: osModel << "PIXCI(R) E1 Imaging Board"; break ; case PIXCI_E1DB: osModel << "PIXCI(R) E1DB Imaging Board"; break ; case PIXCI_E4: osModel << "PIXCI(R) E4 Imaging Board"; break ; @@ -5885,7 +5885,7 @@ int CRaptorEPIX::InsertImage() md.PutTag(mst.GetName(), mst.GetDevice(), mst.GetValue()); } */ - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); //md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString(fieldCount_)); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString(imageCounter_)); diff --git a/DeviceAdapters/SequenceTester/SequenceTester.cpp b/DeviceAdapters/SequenceTester/SequenceTester.cpp index 2cc35b4cf..87d638318 100644 --- a/DeviceAdapters/SequenceTester/SequenceTester.cpp +++ b/DeviceAdapters/SequenceTester/SequenceTester.cpp @@ -531,7 +531,7 @@ TesterCamera::SendSequence(bool finite, long count, bool stopOnOverflow) char label[MM::MaxStrLength]; GetLabel(label); Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); std::string serializedMD(md.Serialize()); const unsigned char* bytes = 0; diff --git a/DeviceAdapters/SigmaKoki/Camera.cpp b/DeviceAdapters/SigmaKoki/Camera.cpp index fb2013c3c..8f485a75c 100644 --- a/DeviceAdapters/SigmaKoki/Camera.cpp +++ b/DeviceAdapters/SigmaKoki/Camera.cpp @@ -953,7 +953,7 @@ int Camera::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString(imageCounter_)); diff --git a/DeviceAdapters/Spinnaker/SpinnakerCamera.cpp b/DeviceAdapters/Spinnaker/SpinnakerCamera.cpp index 1386a89c2..2cae743bf 100644 --- a/DeviceAdapters/Spinnaker/SpinnakerCamera.cpp +++ b/DeviceAdapters/Spinnaker/SpinnakerCamera.cpp @@ -1608,7 +1608,7 @@ int SpinnakerCamera::MoveImageToCircularBuffer() this->GetLabel(label); Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - m_aqThread->GetStartTime()).getMsec())); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString((long)m_cam->Width.GetValue())); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString((long)m_cam->Height.GetValue())); diff --git a/DeviceAdapters/TISCam/TIScamera.cpp b/DeviceAdapters/TISCam/TIScamera.cpp index 3d98e22ac..e420b0439 100644 --- a/DeviceAdapters/TISCam/TIScamera.cpp +++ b/DeviceAdapters/TISCam/TIScamera.cpp @@ -45,7 +45,7 @@ You may extract these files from TIS development environment "IC Imaging Control IMPORTANT: Use build 3.3.0.1796 or later System: -Use the VC runtime installations from Microsoft™. +Use the VC runtime installations from Microsoft�. The files VC100*.* shall be reachable from the path specifier. */ @@ -2161,7 +2161,7 @@ int CTIScamera::PushImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString(imageCounter_)); md.put(MM::g_Keyword_Binning, binSize_); diff --git a/DeviceAdapters/TUCam/MMTUCam.cpp b/DeviceAdapters/TUCam/MMTUCam.cpp index 403834f64..f2fa6dcad 100755 --- a/DeviceAdapters/TUCam/MMTUCam.cpp +++ b/DeviceAdapters/TUCam/MMTUCam.cpp @@ -2850,7 +2850,7 @@ int CMMTUCam::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString( (long) roiX_)); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString( (long) roiY_)); diff --git a/DeviceAdapters/ThorlabsUSBCamera/ThorlabsUSBCamera.cpp b/DeviceAdapters/ThorlabsUSBCamera/ThorlabsUSBCamera.cpp index 879a7604c..6e64abd4f 100644 --- a/DeviceAdapters/ThorlabsUSBCamera/ThorlabsUSBCamera.cpp +++ b/DeviceAdapters/ThorlabsUSBCamera/ThorlabsUSBCamera.cpp @@ -612,7 +612,7 @@ int ThorlabsUSBCam::InsertImage() Metadata md; char label[MM::MaxStrLength]; this->GetLabel(label); - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((GetCurrentMMTime() - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ImageNumber, CDeviceUtils::ConvertToString(imageCounter_)); diff --git a/DeviceAdapters/UniversalMMHubUsb/ummhUsb.cpp b/DeviceAdapters/UniversalMMHubUsb/ummhUsb.cpp index d9b983ed6..d69ae4f6c 100644 --- a/DeviceAdapters/UniversalMMHubUsb/ummhUsb.cpp +++ b/DeviceAdapters/UniversalMMHubUsb/ummhUsb.cpp @@ -3744,7 +3744,7 @@ int UmmhCamera::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); md.put(MM::g_Keyword_Elapsed_Time_ms, CDeviceUtils::ConvertToString((timeStamp - sequenceStartTime_).getMsec())); md.put(MM::g_Keyword_Metadata_ROI_X, CDeviceUtils::ConvertToString( (long) roiX_)); md.put(MM::g_Keyword_Metadata_ROI_Y, CDeviceUtils::ConvertToString( (long) roiY_)); diff --git a/DeviceAdapters/ZWO/MyASICam2.cpp b/DeviceAdapters/ZWO/MyASICam2.cpp index 50b1c077e..46f8e7667 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");//������device list�� #else - RegisterDevice(g_CameraName, MM::CameraDevice, "ZWO ASI camera");//³öÏÖÔÚdevice listÀï + RegisterDevice(g_CameraName, MM::CameraDevice, "ZWO ASI camera");//������device 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]);//Ĭ�ϴò¿ªµï¿½Ò»ï¿½ï¿½camera //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ʱ��ֵ�������bin2��ͼ���ϵ�, ��ASISetStartPos���������bin1�� { if (xSize == 0 && ySize == 0) ; else { /*20160107 - ÉèÖÃROIÊÇÒÔÏÔʾͼƬΪ²ÎÕÕµÄ,³ÌÐò´«½øÀ´µÄÆðʼµã(x, y)ÊÇÓÃÒÑÏÔʾͼƬµÄÆðʼµã(µ÷ÓÃGetROI()µÃµ½)¼ÓÉÏÊó±êÑ¡ÔñµÄÆ«ÒÆ£¬ - ³ß´çºÍÆðʼµã¶¼ÒÔImgBin/iSetBinËõ·Å, iSetBinÊÇÒªÉèÖõÄbinÖµ - Èç¹ûÓз­×ª, ÔòÒª»»Ëã»ØÕý³£µÄÆðµã×ø±ê + ����ROI������ʾͼƬΪ���յ�,���ò´«½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ê¼ï¿½ï¿½(x, y)��������ʾͼƬ����ʼ��(����GetROI()�õ�)�������ѡ���ƫ�ƣ� + �ߴ����ʼ�㶼��ImgBin/iSetBin����, iSetBin��Ҫ���õ�binÖµ + ����з�ת, ��Ҫ������������������ */ 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��㣬����ROI��ľ�����㣬�õ�ROI��ROI����� { /* 20160107 - µÃµ½ÏÔʾͼÏñµÄROIÐÅÏ¢ - Èç¹ûÓз­×ª, Òª»»Ëã³É·´·½Ïò±ßµÄ×ø±ê, ·½±ã³ÌÐòÏà¼ÓµÃµ½ÐÂROI,ÔÙ»»Ëã»ØÕý³£·½ÏòµÄ×ø±ê*/ + �õ���ʾͼ���ROI��Ϣ + ����з�ת, Ҫ����ɷ�����ߵ�����, ���������ӵõ���ROI,�ٻ�����������������*/ 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; } @@ -1147,7 +1147,7 @@ int CMyASICam::InsertImage() // Important: metadata about the image are generated here: Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); char buf[MM::MaxStrLength]; GetProperty(MM::g_Keyword_Binning, buf); @@ -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������bin����ֹͣ�����´������Բ�ֹͣʱ�������� 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);//�����¼���startx ��starty������ѡ����ͬ�����Ҫ�������� } 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��state { 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/MMCore/CircularBuffer.cpp b/MMCore/CircularBuffer.cpp index 933142e9b..e23ea89b3 100644 --- a/MMCore/CircularBuffer.cpp +++ b/MMCore/CircularBuffer.cpp @@ -256,7 +256,7 @@ bool CircularBuffer::InsertMultiChannel(const unsigned char* pixArray, unsigned md = *pMd; } - std::string cameraName = md.GetSingleTag("Camera").GetValue(); + std::string cameraName = md.GetSingleTag(MM::g_Keyword_Metadata_CameraLabel).GetValue(); if (imageNumbers_.end() == imageNumbers_.find(cameraName)) { imageNumbers_[cameraName] = 0; diff --git a/MMCore/CoreCallback.cpp b/MMCore/CoreCallback.cpp index 7cd1b0e5c..572f9a0ce 100644 --- a/MMCore/CoreCallback.cpp +++ b/MMCore/CoreCallback.cpp @@ -223,7 +223,7 @@ CoreCallback::AddCameraMetadata(const MM::Device* caller, const Metadata* pMd) core_->deviceManager_->GetDevice(caller)); std::string label = camera->GetLabel(); - newMD.put("Camera", label); + newMD.put(MM::g_Keyword_Metadata_CameraLabel, label); std::string serializedMD; try diff --git a/MMDevice/DeviceBase.h b/MMDevice/DeviceBase.h index fc3d80c68..883b7e34b 100644 --- a/MMDevice/DeviceBase.h +++ b/MMDevice/DeviceBase.h @@ -1542,7 +1542,7 @@ class CCameraBase : public CDeviceBase char label[MM::MaxStrLength]; this->GetLabel(label); Metadata md; - md.put("Camera", label); + md.put(MM::g_Keyword_Metadata_CameraLabel, label); int ret = GetCoreCallback()->InsertImage(this, GetImageBuffer(), GetImageWidth(), GetImageHeight(), GetImageBytesPerPixel(), md.Serialize().c_str()); diff --git a/MMDevice/MMDeviceConstants.h b/MMDevice/MMDeviceConstants.h index 956b05474..62aa53ce6 100644 --- a/MMDevice/MMDeviceConstants.h +++ b/MMDevice/MMDeviceConstants.h @@ -143,6 +143,7 @@ namespace MM { // image annotations + const char* const g_Keyword_Metadata_CameraLabel = "Camera"; const char* const g_Keyword_Meatdata_Exposure = "Exposure-ms"; const char* const g_Keyword_Metadata_Score = "Score"; const char* const g_Keyword_Metadata_ImageNumber = "ImageNumber";