From c397e1bd08a39eee25220e29d82ea90a73d5ad0b Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Wed, 19 Jun 2024 12:33:47 -0500 Subject: [PATCH 1/8] Convert CP-1252 to UTF-8 iconv -f CP1252 -t UTF-8 Many of these files are pure iso-8859-1 (latin1), but CP-1252 is a superset of latin1. Some files contain CP-1252-only symbols. --- DeviceAdapters/ABS/ABSCamera.cpp | 4 +- DeviceAdapters/ABS/abscommontools.cpp | 2 +- DeviceAdapters/ABS/dllmain.cpp | 2 +- DeviceAdapters/ABS/include/camusb_api_ext.h | 6 +-- .../ABS/include/common_constants_exp.h | 2 +- .../ABS/include/common_structs_exp.h | 36 ++++++------- DeviceAdapters/CARVII/license.txt | 8 +-- DeviceAdapters/Cobolt/Cobolt.h | 4 +- .../CoboltOfficial/CoboltOfficial.cpp | 2 +- DeviceAdapters/Corvus/Corvus.cpp | 8 +-- DeviceAdapters/ETL/myETL.cpp | 4 +- DeviceAdapters/ETL/myETL.h | 2 +- DeviceAdapters/HydraLMT200/ITKHydra.h | 2 +- DeviceAdapters/MP285/MP285XYStage.cpp | 6 +-- DeviceAdapters/MT20/tinystr.cpp | 2 +- DeviceAdapters/Marzhauser-LStep/LStep.cpp | 32 ++++++------ DeviceAdapters/Marzhauser/Marzhauser.cpp | 52 +++++++++---------- .../Omicron/OmicronDeviceDriver.cpp | 2 +- .../OxxiusCombiner/CoherentObis.cpp | 2 +- .../lib/pco_generic/sc2_SDKStructures.h | 10 ++-- DeviceAdapters/PeCon2000/PeCon2000.cpp | 10 ++-- .../Piezosystem_dDrive/devicelist.cpp | 2 +- DeviceAdapters/RaptorEPIX/RaptorEPIX.cpp | 2 +- DeviceAdapters/Skyra/Skyra.h | 4 +- DeviceAdapters/TISCam/TIScamera.cpp | 2 +- DeviceAdapters/ThorlabsDCxxxx/DC2200.cpp | 2 +- DeviceAdapters/ThorlabsDCxxxx/DC2XXX.cpp | 2 +- DeviceAdapters/ThorlabsDCxxxx/DC3100.cpp | 2 +- DeviceAdapters/ThorlabsDCxxxx/DC4100.cpp | 2 +- .../ThorlabsDCxxxx/DCxxxx_Plugin.cpp | 2 +- DeviceAdapters/Thorlabs_ELL14/ELL14.cpp | 2 +- DeviceAdapters/Thorlabs_ELL14/ELL14.h | 4 +- DeviceAdapters/TwainCamera/CommonTWAIN.cpp | 2 +- DeviceAdapters/XCiteLed/XLed.cpp | 6 +-- DeviceAdapters/XCiteXT600/XT600.cpp | 6 +-- DeviceAdapters/XLightV3/XLight_MM.cpp | 6 +-- DeviceAdapters/Ximea/XIMEACamera.h | 2 +- DeviceAdapters/ZeissCAN/ZeissCAN.cpp | 2 +- 38 files changed, 124 insertions(+), 124 deletions(-) mode change 100755 => 100644 DeviceAdapters/MT20/tinystr.cpp mode change 100755 => 100644 DeviceAdapters/Piezosystem_dDrive/devicelist.cpp diff --git a/DeviceAdapters/ABS/ABSCamera.cpp b/DeviceAdapters/ABS/ABSCamera.cpp index e95d618ac..1d81af752 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); } } @@ -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/ABS/abscommontools.cpp b/DeviceAdapters/ABS/abscommontools.cpp index 82be422de..5ec0ecc15 100644 --- a/DeviceAdapters/ABS/abscommontools.cpp +++ b/DeviceAdapters/ABS/abscommontools.cpp @@ -260,7 +260,7 @@ bool ABSTools::GetOsVersion(OSVERSIONINFOEX &sOSVerEx) if ( false == bOsVersionInfoEx ) { - // OSVersionEx - Struct wird nicht untersttzt! + // OSVersionEx - Struct wird nicht unterstützt! // lese die default Struct... sOSVerEx.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); if (!GetVersionEx ( (OSVERSIONINFO *) &sOSVerEx) ) diff --git a/DeviceAdapters/ABS/dllmain.cpp b/DeviceAdapters/ABS/dllmain.cpp index c3a1e12e4..e7f95d70b 100644 --- a/DeviceAdapters/ABS/dllmain.cpp +++ b/DeviceAdapters/ABS/dllmain.cpp @@ -1,4 +1,4 @@ -// dllmain.cpp : Definiert den Einstiegspunkt fr die DLL-Anwendung. +// dllmain.cpp : Definiert den Einstiegspunkt für die DLL-Anwendung. #include "MMDevice.h" #include "ModuleInterface.h" diff --git a/DeviceAdapters/ABS/include/camusb_api_ext.h b/DeviceAdapters/ABS/include/camusb_api_ext.h index e5d629f5d..2f5517b55 100644 --- a/DeviceAdapters/ABS/include/camusb_api_ext.h +++ b/DeviceAdapters/ABS/include/camusb_api_ext.h @@ -147,7 +147,7 @@ USBAPI BOOL CCONV CamUSB_GetCameraResolutionInfo ( S_RESOLUTION_INFO* pResInfo, * * Valid from the next image on. * - * \param pdwExposure_us Exposure / Integration time value in s (us). + * \param pdwExposure_us Exposure / Integration time value in µs (us). * \param nDevNr Camera index number, that identifies the * camera device which should be used with this * function @@ -176,7 +176,7 @@ USBAPI BOOL CCONV CamUSB_GetCameraResolutionInfo ( S_RESOLUTION_INFO* pResInfo, // nExposure contains now actual exposure time } - nExposure = 20000; // 20000s = 20ms + nExposure = 20000; // 20000µs = 20ms if (CamUSB_SetExposureTime( &nExposure ) != TRUE) { // error see CamUSB_GetLastError @@ -197,7 +197,7 @@ USBAPI BOOL CCONV CamUSB_SetExposureTime( LPDWORD pdwExposure_us, // CamUSB_GetExposureTime //! \brief returns the active Exposure Time. //! -//! \param pdwExposure_us Exposure / Integration time value in s (us). +//! \param pdwExposure_us Exposure / Integration time value in µs (us). //! \param nDevNr Camera index number, that identifies the //! camera device which should be used with this //! function diff --git a/DeviceAdapters/ABS/include/common_constants_exp.h b/DeviceAdapters/ABS/include/common_constants_exp.h index 2307008bf..51ed700cb 100644 --- a/DeviceAdapters/ABS/include/common_constants_exp.h +++ b/DeviceAdapters/ABS/include/common_constants_exp.h @@ -135,7 +135,7 @@ #define ST_FPA640x512 0x0010 //!< InGaAs-Sensor 640x512(ShortWave-IR VGA) #define ST_FPA320x256 0x0011 //!< InGaAs-Sensor 320x256(ShortWave-IR QVGA) #define ST_FPA320x256_K 0x0012 //!< InGaAs-Sensor 320x256TEC (ShortWave-IR QVGA) -#define ST_FPA320x256_K22 0x0013 //!< InGaAs-Sensor 320x256TEC-2,2m (ShortWave-IR QVGA) +#define ST_FPA320x256_K22 0x0013 //!< InGaAs-Sensor 320x256TEC-2,2µm (ShortWave-IR QVGA) #define ST_VIIMAGIC_9221M 0x0014 //!< viimagic 9221 (Full-HD, Mono) #define ST_VIIMAGIC_9221C 0x4014 //!< viimagic 9221 (Full-HD, Color) diff --git a/DeviceAdapters/ABS/include/common_structs_exp.h b/DeviceAdapters/ABS/include/common_structs_exp.h index 0bcd1acac..8046cec6e 100644 --- a/DeviceAdapters/ABS/include/common_structs_exp.h +++ b/DeviceAdapters/ABS/include/common_structs_exp.h @@ -476,7 +476,7 @@ typedef struct { //! \brief Camera Exposure Data\n //! Returned in "pData" by #CamUSB_GetFunctionCaps => functionID => #FUNC_EXPOSURE \n -//! The exposure unit is in micro seconds (s). +//! The exposure unit is in micro seconds (µs). typedef struct { u32 dwCountRanges; //!< count exposure ranges @@ -493,7 +493,7 @@ typedef struct //! => functionID => #FUNC_EXPOSURE typedef struct { - u32 dwExposure_us; //!< exposure time in s + u32 dwExposure_us; //!< exposure time in µs } STRUCT_PACKED S_EXPOSURE_PARAMS, S_EXPOSURE_RETVALS; @@ -695,7 +695,7 @@ typedef struct u16 wPortType; //!< port type setting (e.g. #PORT_TYPE_OUTPUT) u16 wPortFeatures; //!< port features setting (e.g. #PORT_FEATURE_POL_ACTHIGH) u16 wPortState; //!< port state setting (e.g. #PORT_STATE_SET) - u32 dwDelay; //!< port delay setting (s) + u32 dwDelay; //!< port delay setting (µs) } STRUCT_PACKED S_IO_PORT_PARAMS, S_IO_PORT_RETVALS; @@ -983,9 +983,9 @@ typedef struct u08 bHysterese; //!< (ignored) 0 => use internal default; use 1..100% u08 bSpeed; //!< (ignored) 0 => use internal default; use 1..100% of max speed u16 wOptions; //!< see #AEXP_OPTION_BRIGHNESSOFFSET - u32 dwMinExposure; //!< min. allowed exposure value for exposure control in s (0 => default value) + u32 dwMinExposure; //!< min. allowed exposure value for exposure control in µs (0 => default value) - //! \brief max. allowed exposure value for exposure control in s (0 => default value)\n + //! \brief max. allowed exposure value for exposure control in µs (0 => default value)\n //! if value != 0 the current framerate settings may be affected, if you switch AutoExposure == off //! it is recommended to read out the currently used framerate\n u32 dwMaxExposure; @@ -1081,7 +1081,7 @@ typedef struct i32 dwOffset_y; //!< ROI vertical (y) offset u08 bBitShift; //!< bitshift setting u08 bTempSensorIndex; //!< index of sensor to get (see #S_TEMPERATURE_CAPS::dwSensors) - i16 wTemperature; //!< temperature sensor value in 1/100C + i16 wTemperature; //!< temperature sensor value in 1/100°C f32 fGain; //!< green or global gain value (during capture) u32 dwReserved[9]; //!< reserved @@ -1147,9 +1147,9 @@ typedef struct //! returned by #CamUSB_GetFunctionCaps => functionID => #FUNC_HUE_SATURATION typedef struct { - i16 wHueMin; //!< minimum value (-180 default) - i16 wHueMax; //!< maximum value (+180 default) - i16 wHueStep; //!< modify at count of dwStep (1 default) + i16 wHueMin; //!< minimum value (-180° default) + i16 wHueMax; //!< maximum value (+180° default) + i16 wHueStep; //!< modify at count of dwStep (1° default) i16 wSatMin; //!< minimum value (-100 default) i16 wSatMax; //!< maximum value (+100 default) i16 wSatStep; //!< modify at count of dwStep (1 default) @@ -1256,7 +1256,7 @@ typedef struct { u32 dwTriggerOptions; //!< bitfield of available trigger options, see #TRIG_OPTION_NONE u32 dwMaxCycleTime_ms; //!< max. trigger cycle time (in ms), used for timed CCD clear - u32 dwMaxMinPulseWidth_us;//!< max. value for minimum trigger pulse width settings (in s) + u32 dwMaxMinPulseWidth_us;//!< max. value for minimum trigger pulse width settings (in µs) u32 dwReserved[5]; //!< reserved } STRUCT_PACKED S_TRIGGER_OPTION_CAPS; @@ -1269,7 +1269,7 @@ typedef struct { u32 dwTriggerOptions; //!< bitfield of used trigger options, see #TRIG_OPTION_NONE u32 dwCycleTime_ms; //!< trigger cycle time (in ms), used for timed CCD clear - u32 dwMinPulseWidth_us; //!< minimum trigger pulse width settings (in s) + u32 dwMinPulseWidth_us; //!< minimum trigger pulse width settings (in µs) u32 dwReserved[5]; //!< reserved } STRUCT_PACKED S_TRIGGER_OPTION_PARAMS, S_TRIGGER_OPTION_RETVALS; @@ -1627,7 +1627,7 @@ typedef struct typedef struct { u64 qwFunctionMask; - u32 dwExposure_us; //!< exposure time in s + u32 dwExposure_us; //!< exposure time in µs u16 wGainChannel; //!< gain channel to set, more than one channel possible (e.g.#GAIN_RED | #GAIN_BLUE) u08 bReserved[2]; //!< reserved u32 dwGain[MAX_GAIN_CHANNELS_ONCE]; //!< gain values @@ -1839,7 +1839,7 @@ typedef struct u08 bCoolingLevelStep; //!< cooling level step size in percent, e.g. 1 corresponds 1% and 100 => 100% (only for #CM_TEC_AUTOMATIC) i16 wTargetTempMin; //!< minimum supported target temperature value for automatic cooling i16 wTargetTempMax; //!< maximum supported target temperature value for automatic cooling - u16 wTargetTempStep; //!< possible temperature step size (e.g. 10 corresponds 1.0C and 5 => 0.5C and -124 = -12.4C) + u16 wTargetTempStep; //!< possible temperature step size (e.g. 10 corresponds 1.0°C and 5 => 0.5°C and -124 = -12.4°C) u16 wMinPeltierVoltage; //!< obsolate don't use (minimum peltier voltage e.g. 600 mean 0.6 V) u16 wMaxPeltierVoltage; //!< obsolate don't use (maximum peltier voltage 9400 mean 9.4 V) @@ -1847,9 +1847,9 @@ typedef struct u08 bFanLevelMin; //!< minimum supported Fan level in percent (only for #CM_FAN_MANUAL) u08 bFanLevelMax; //!< maximum supported Fan level in percent (only for #CM_FAN_MANUAL) u08 bFanLevelStep; //!< Fan level step size in percent, e.g. 1 means 1% and 100 => 100% (only for #CM_FAN_MANUAL) - i16 wFanThreshTempMin; //!< minimum supported threshold temperature in 0.1C, e.g. 10 => 1.0C (only for #CM_FAN_AUTOMATIC) - i16 wFanThreshTempMax; //!< maximum supported threshold temperature in 0.1C (only for #CM_FAN_AUTOMATIC) - i16 wFanThreshTempStep; //!< minimum supported threshold temperature in 0.1C(only for #CM_FAN_AUTOMATIC) + i16 wFanThreshTempMin; //!< minimum supported threshold temperature in 0.1°C, e.g. 10 => 1.0°C (only for #CM_FAN_AUTOMATIC) + i16 wFanThreshTempMax; //!< maximum supported threshold temperature in 0.1°C (only for #CM_FAN_AUTOMATIC) + i16 wFanThreshTempStep; //!< minimum supported threshold temperature in 0.1°C(only for #CM_FAN_AUTOMATIC) u08 bReserved[40]; //!< reserved } STRUCT_PACKED S_COOLING_CAPS; @@ -1861,14 +1861,14 @@ typedef struct { u08 bCoolingMode; //!< #CM_TEC_OFF, #CM_TEC_AUTOMATIC or #CM_TEC_MANUAL u08 bReserved1[3]; //!< reserved - i16 wTargetTemp; //!< in 1/10 C (10 => 1.0C) only used with cooling mode #CM_TEC_AUTOMATIC + i16 wTargetTemp; //!< in 1/10 °C (10 => 1.0°C) only used with cooling mode #CM_TEC_AUTOMATIC u08 bReserved2[2]; //!< reserved u08 bCoolingLevel; //!< in percent (%) (15 => 15 %) only used with cooling mode #CM_TEC_MANUAL u08 bReserved3[3]; //!< reserved u08 bFanMode; //!< current Fan mode (#CM_FAN_OFF, #CM_FAN_AUTOMATIC or #CM_FAN_MANUAL), must be #CM_FAN_AUTOMATIC if #CM_TEC_AUTOMATIC is active) u08 bReserved4[3]; //!< reserved - i16 wFanThreshTemp; //!< current threshold temperature in 0.1C (only used with fan mode #CM_FAN_AUTOMATIC) + i16 wFanThreshTemp; //!< current threshold temperature in 0.1°C (only used with fan mode #CM_FAN_AUTOMATIC) u08 bReserved5[2]; //!< reserved u08 bFanLevel; //!< current Fan level in percent (only used with fan mode #CM_FAN_MANUAL) u08 bReserved[43]; //!< reserved diff --git a/DeviceAdapters/CARVII/license.txt b/DeviceAdapters/CARVII/license.txt index 69098da00..3a30f6d87 100644 --- a/DeviceAdapters/CARVII/license.txt +++ b/DeviceAdapters/CARVII/license.txt @@ -1,17 +1,17 @@ -Copyright (c) 2011, Childrens Hospital Los Angeles +Copyright (c) 2011, Children’s Hospital Los Angeles All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, this +•Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, +•Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of Childrens Hospital Los Angeles nor the names of its +•Neither the name of Children’s Hospital Los Angeles nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/DeviceAdapters/Cobolt/Cobolt.h b/DeviceAdapters/Cobolt/Cobolt.h index 4de297f75..07dfb176c 100644 --- a/DeviceAdapters/Cobolt/Cobolt.h +++ b/DeviceAdapters/Cobolt/Cobolt.h @@ -56,9 +56,9 @@ // Strings // -const char * g_DeviceVendorName = "HBNER Photonics"; +const char * g_DeviceVendorName = "HÜBNER Photonics"; const char * g_DeviceCoboltName = "Cobolt"; -const char * g_DeviceCoboltDescription = "Cobolt Controller by Karl Bellv with contribution from Alexis Maizel"; +const char * g_DeviceCoboltDescription = "Cobolt Controller by Karl Bellvé with contribution from Alexis Maizel"; const char * g_SendTerm = "\r"; diff --git a/DeviceAdapters/CoboltOfficial/CoboltOfficial.cpp b/DeviceAdapters/CoboltOfficial/CoboltOfficial.cpp index 367903d53..54835d91a 100644 --- a/DeviceAdapters/CoboltOfficial/CoboltOfficial.cpp +++ b/DeviceAdapters/CoboltOfficial/CoboltOfficial.cpp @@ -41,7 +41,7 @@ using namespace cobolt; const char * g_DeviceName = "Cobolt Laser"; const char * g_DeviceDescription = "Official device adapter for Cobolt lasers."; -const char * g_DeviceVendorName = "Cobolt - a HBNER Group company"; +const char * g_DeviceVendorName = "Cobolt - a HÜBNER Group company"; const char* const g_Property_Port_None = "None"; diff --git a/DeviceAdapters/Corvus/Corvus.cpp b/DeviceAdapters/Corvus/Corvus.cpp index 4068cac23..6d225a7a1 100644 --- a/DeviceAdapters/Corvus/Corvus.cpp +++ b/DeviceAdapters/Corvus/Corvus.cpp @@ -7,7 +7,7 @@ // XY Stage // Z Stage // -// AUTHOR: Johan Henriksson, mahogny@areta.org, derived from Mrzhauser adapter +// AUTHOR: Johan Henriksson, mahogny@areta.org, derived from Märzhauser adapter // COPYRIGHT: Johan Henriksson, 2010 // LICENSE: This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -345,7 +345,7 @@ int XYStage::Initialize() return ret; SetPropertyLimits("Speed [mm/s]", 0.001, 100.0); // mm/s - // Accel (Acceleration (in m/s) + // Accel (Acceleration (in m/s²) // ----- pAct = new CPropertyAction (this, &XYStage::OnAccel); // TODO: get current Acceleration from the controller @@ -406,7 +406,7 @@ bool XYStage::Busy() /** - * Returns current position in m. + * Returns current position in µm. */ int XYStage::GetPositionUm(double& x, double& y) { @@ -439,7 +439,7 @@ int ret; /** - * Sets position in m + * Sets position in µm */ int XYStage::SetPositionUm(double x, double y) { diff --git a/DeviceAdapters/ETL/myETL.cpp b/DeviceAdapters/ETL/myETL.cpp index e68208a73..944db6ea7 100644 --- a/DeviceAdapters/ETL/myETL.cpp +++ b/DeviceAdapters/ETL/myETL.cpp @@ -238,7 +238,7 @@ void myETL::DecToHexa(int n, char* output) char hexaDeciNum[100]; // counter for hexadecimal number array - uint32_t num = n; // format trs important pour les valeurs ngatives + uint32_t num = n; // format très important pour les valeurs négatives int i = 0; while (num != 0) { @@ -265,7 +265,7 @@ void myETL::DecToHexa(int n, char* output) int k = 0; - // on s'attend un hexa en 2 octets + // on s'attend à un hexa en 2 octets if (i < 4) { output[0] = '0'; diff --git a/DeviceAdapters/ETL/myETL.h b/DeviceAdapters/ETL/myETL.h index 2c8c5aeb7..c6be8b650 100644 --- a/DeviceAdapters/ETL/myETL.h +++ b/DeviceAdapters/ETL/myETL.h @@ -33,7 +33,7 @@ class myETL : public CGenericBase unsigned char* CreateAndSendCurrentCommand(double current); /*int ClearPort(void); - int CheckDeviceStatus(void); // vient de LSTEP, ne correspond pas ETL + int CheckDeviceStatus(void); // vient de LSTEP, ne correspond pas à ETL int SendCommand(const char* command) const; int QueryCommand(const char* command, std::string& answer) const;*/ diff --git a/DeviceAdapters/HydraLMT200/ITKHydra.h b/DeviceAdapters/HydraLMT200/ITKHydra.h index 1370303ae..022e66277 100644 --- a/DeviceAdapters/HydraLMT200/ITKHydra.h +++ b/DeviceAdapters/HydraLMT200/ITKHydra.h @@ -6,7 +6,7 @@ // DESCRIPTION: ITK Hydra Controller Driver // XY Stage // -// AUTHOR: Steven Fletcher, derived from Corvus adapter written by Johan Henriksson, mahogny@areta.org, derived from Mrzhauser adapter +// AUTHOR: Steven Fletcher, derived from Corvus adapter written by Johan Henriksson, mahogny@areta.org, derived from Märzhauser adapter // COPYRIGHT: Steven Fletcher 2017 // LICENSE: This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff --git a/DeviceAdapters/MP285/MP285XYStage.cpp b/DeviceAdapters/MP285/MP285XYStage.cpp index faf5901f2..964a1b886 100644 --- a/DeviceAdapters/MP285/MP285XYStage.cpp +++ b/DeviceAdapters/MP285/MP285XYStage.cpp @@ -258,7 +258,7 @@ int XYStage::SetMotionMode(long lMotionMode) } // -// Returns current X-Y position in m. +// Returns current X-Y position in µm. // int XYStage::GetPositionUm(double& dXPosUm, double& dYPosUm) { @@ -317,7 +317,7 @@ int XYStage::GetPositionUm(double& dXPosUm, double& dYPosUm) } // -// Move x-y stage to a relative distance from current position in m +// Move x-y stage to a relative distance from current position in µm // int XYStage::SetRelativePositionUm(double dXPosUm, double dYPosUm) { @@ -368,7 +368,7 @@ int XYStage::SetRelativePositionUm(double dXPosUm, double dYPosUm) } // -// Move 2 x-y position in m +// Move 2 x-y position in µm // int XYStage::SetPositionUm(double dXPosUm, double dYPosUm) { diff --git a/DeviceAdapters/MT20/tinystr.cpp b/DeviceAdapters/MT20/tinystr.cpp old mode 100755 new mode 100644 index 41ab27661..eddcaa861 --- a/DeviceAdapters/MT20/tinystr.cpp +++ b/DeviceAdapters/MT20/tinystr.cpp @@ -24,7 +24,7 @@ distribution. */ /* - * THIS FILE WAS ALTERED BY Tyge Lvset, 7. April 2005. + * THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005. */ diff --git a/DeviceAdapters/Marzhauser-LStep/LStep.cpp b/DeviceAdapters/Marzhauser-LStep/LStep.cpp index c7fd4ed0a..8b2e692ad 100644 --- a/DeviceAdapters/Marzhauser-LStep/LStep.cpp +++ b/DeviceAdapters/Marzhauser-LStep/LStep.cpp @@ -192,7 +192,7 @@ XYStage::XYStage() : speedX_(20.0), //[mm/s] speedY_(20.0), //[mm/s] - accelX_(0.2), //[m/s] + accelX_(0.2), //[m/s²] accelY_(0.2), originX_(0), originY_(0), @@ -316,12 +316,12 @@ int XYStage::Initialize() SetPropertyLimits("SpeedY [mm/s]", 0.01, 20*pitch); // mm/s //****************************************************************************************************************************************** - // Accel (Acceleration (in m/s) + // Accel (Acceleration (in m/s²) // ----- pAct = new CPropertyAction (this, &XYStage::OnAccelX); - ret = QueryCommand("?accel x", resp); //Lstep : 0,01 to 20,00 m/s + ret = QueryCommand("?accel x", resp); //Lstep : 0,01 to 20,00 m/s² if (ret != DEVICE_OK) return DEVICE_UNSUPPORTED_COMMAND; ret = CreateProperty("Acceleration X [m/s^2]", resp.c_str(), MM::Float, false, pAct); @@ -378,12 +378,12 @@ bool XYStage::Busy() /** - * Returns current position in m. + * Returns current position in µm. */ int XYStage::GetPositionUm(double& x, double& y) { int ret; - // switch to m + // switch to µm ret = SendCommand("!dim 1 1"); if (ret != DEVICE_OK) return ret; @@ -404,7 +404,7 @@ int ret; /** - * Sets position in m + * Sets position in µm */ int XYStage::SetPositionUm(double x, double y) { @@ -412,7 +412,7 @@ int XYStage::SetPositionUm(double x, double y) os << "XYStage::SetPositionUm() " << x << " " << y; this->LogMessage(os.str().c_str()); - // switch to m + // switch to µm int ret = SendCommand("!dim 1 1"); if (ret != DEVICE_OK) return ret; @@ -438,7 +438,7 @@ int XYStage::SetPositionUm(double x, double y) /** - * Sets relative position in m + * Sets relative position in µm */ int XYStage::SetRelativePositionUm(double dx, double dy) { @@ -446,7 +446,7 @@ int XYStage::SetRelativePositionUm(double dx, double dy) os << "XYStage::SetPositionUm() " << dx << " " << dy; this->LogMessage(os.str().c_str()); - // switch to m + // switch to µm int ret = SendCommand("!dim 1 1"); if (ret != DEVICE_OK) return ret; @@ -693,7 +693,7 @@ int XYStage::GetLimitsUm(double& xMin, double& xMax, double& yMin, double& yMax) { if (!range_measured_) return DEVICE_UNKNOWN_POSITION; - // switch to m + // switch to µm int ret = SendCommand("!dim 1 1"); if (ret != DEVICE_OK) return ret; @@ -1094,7 +1094,7 @@ ZStage::ZStage() : range_measured_(false), stepSizeUm_(0.1), speedZ_(20.0), //[mm/s] - accelZ_(0.2), //[m/s] + accelZ_(0.2), //[m/s²] originZ_(0), pitchZ_(1) @@ -1183,7 +1183,7 @@ int ZStage::Initialize() SetPropertyLimits("SpeedZ [mm/s]", 0.001, 20*pitchZ_); // mm/s - // Accel (Acceleration (in m/s) + // Accel (Acceleration (in m/s²) // ----- ret = QueryCommand("?accel z", resp); if (ret != DEVICE_OK) return DEVICE_UNSUPPORTED_COMMAND; @@ -1241,7 +1241,7 @@ int ZStage::SetPositionUm(double pos) os << "ZStage::SetPositionUm() " << pos; this->LogMessage(os.str().c_str()); - // switch to m + // switch to µm int ret = SendCommand("!dim z 1"); if (ret != DEVICE_OK) return ret; @@ -1271,7 +1271,7 @@ int ZStage::SetPositionUm(double pos) int ZStage::SetRelativePositionUm(double d) { - // switch to m + // switch to µm int ret = SendCommand("!dim z 1"); if (ret != DEVICE_OK) return ret; @@ -1300,7 +1300,7 @@ int ZStage::SetRelativePositionUm(double d) int ZStage::GetPositionUm(double& pos) { int ret; - // switch to m + // switch to µm ret = SendCommand("!dim z 1"); if (ret != DEVICE_OK) return ret; @@ -1463,7 +1463,7 @@ int ZStage::GetLimits(double& min, double& max) { if (!range_measured_) return DEVICE_UNKNOWN_POSITION; - // switch to m + // switch to µm int ret = SendCommand("!dim z 1"); if (ret != DEVICE_OK) return ret; diff --git a/DeviceAdapters/Marzhauser/Marzhauser.cpp b/DeviceAdapters/Marzhauser/Marzhauser.cpp index c6d4eb8ea..9d2868ceb 100644 --- a/DeviceAdapters/Marzhauser/Marzhauser.cpp +++ b/DeviceAdapters/Marzhauser/Marzhauser.cpp @@ -217,7 +217,7 @@ XYStage::XYStage() : stepSizeYUm_(0.0012), speedX_(20.0), //[mm/s] speedY_(20.0), //[mm/s] - accelX_(0.2), //[m/s] + accelX_(0.2), //[m/s²] accelY_(0.2), originX_(0), originY_(0) @@ -338,7 +338,7 @@ int XYStage::Initialize() SetPropertyLimits("SpeedY [mm/s]", 0.001, 100.0); // mm/s - // Accel (Acceleration (in m/s) + // Accel (Acceleration (in m/s²) // ----- pAct = new CPropertyAction (this, &XYStage::OnAccelX); @@ -359,7 +359,7 @@ int XYStage::Initialize() SetPropertyLimits("Acceleration Y [m/s^2]", 0.01, 2.0); - // Backlash (in m) + // Backlash (in µm) ret = QueryCommand("?backlash x", resp); if (ret == DEVICE_OK) { @@ -416,12 +416,12 @@ bool XYStage::Busy() /** - * Returns current position in m. + * Returns current position in µm. */ int XYStage::GetPositionUm(double& x, double& y) { int ret; - // switch to m + // switch to µm ret = SendCommand("!dim 1 1"); if (ret != DEVICE_OK) return ret; @@ -442,7 +442,7 @@ int ret; /** - * Sets position in m + * Sets position in µm */ int XYStage::SetPositionUm(double x, double y) { @@ -450,7 +450,7 @@ int XYStage::SetPositionUm(double x, double y) os << "XYStage::SetPositionUm() " << x << " " << y; this->LogMessage(os.str().c_str()); - // switch to m + // switch to µm int ret = SendCommand("!dim 1 1"); if (ret != DEVICE_OK) return ret; @@ -476,7 +476,7 @@ int XYStage::SetPositionUm(double x, double y) /** - * Sets relative position in m + * Sets relative position in µm */ int XYStage::SetRelativePositionUm(double dx, double dy) { @@ -484,7 +484,7 @@ int XYStage::SetRelativePositionUm(double dx, double dy) os << "XYStage::SetPositionUm() " << dx << " " << dy; this->LogMessage(os.str().c_str()); - // switch to m + // switch to µm int ret = SendCommand("!dim 1 1"); if (ret != DEVICE_OK) return ret; @@ -729,7 +729,7 @@ int XYStage::GetLimitsUm(double& xMin, double& xMax, double& yMin, double& yMax) { if (!range_measured_) return DEVICE_UNKNOWN_POSITION; - // switch to m + // switch to µm int ret = SendCommand("!dim 1 1"); if (ret != DEVICE_OK) return ret; @@ -1214,7 +1214,7 @@ ZStage::ZStage() : range_measured_(false), stepSizeUm_(0.1), speedZ_(20.0), //[mm/s] - accelZ_(0.2), //[m/s] + accelZ_(0.2), //[m/s²] originZ_(0), sequenceable_(false), nrEvents_(1024) @@ -1310,7 +1310,7 @@ int ZStage::Initialize() SetPropertyLimits("SpeedZ [mm/s]", 0.001, 100.0); // mm/s - // Accel (Acceleration (in m/s) + // Accel (Acceleration (in m/s²) // ----- ret = QueryCommand("?accel z", resp); if (ret != DEVICE_OK) return DEVICE_UNSUPPORTED_COMMAND; @@ -1320,7 +1320,7 @@ int ZStage::Initialize() if (ret != DEVICE_OK) return ret; SetPropertyLimits("Acceleration Z [m/s^2]", 0.01, 2.0); - // Backlash (in m) + // Backlash (in µm) // get current Backlash from the controller ret = QueryCommand("?backlash z", resp); if (ret == DEVICE_OK) @@ -1391,7 +1391,7 @@ int ZStage::SetPositionUm(double pos) os << "ZStage::SetPositionUm() " << pos; this->LogMessage(os.str().c_str()); - // switch to m + // switch to µm int ret = SendCommand("!dim z 1"); if (ret != DEVICE_OK) return ret; @@ -1421,7 +1421,7 @@ int ZStage::SetPositionUm(double pos) int ZStage::SetRelativePositionUm(double d) { - // switch to m + // switch to µm int ret = SendCommand("!dim z 1"); if (ret != DEVICE_OK) return ret; @@ -1450,7 +1450,7 @@ int ZStage::SetRelativePositionUm(double d) int ZStage::GetPositionUm(double& pos) { int ret; - // switch to m + // switch to µm ret = SendCommand("!dim z 1"); if (ret != DEVICE_OK) return ret; @@ -1613,7 +1613,7 @@ int ZStage::GetLimits(double& min, double& max) { if (!range_measured_) return DEVICE_UNKNOWN_POSITION; - // switch to m + // switch to µm int ret = SendCommand("!dim z 1"); if (ret != DEVICE_OK) return ret; @@ -1753,7 +1753,7 @@ int ZStage::SendStageSequence() is2 >> err; if (err != 0) return DEVICE_SERIAL_INVALID_RESPONSE; - // switch to m + // switch to µm ret = SendCommand("!dim z 1"); if (ret != DEVICE_OK) return ret; @@ -2048,7 +2048,7 @@ AStage::AStage() : TangoBase(this), range_measured_(false), speed_(20.0), //[mm/s] - accel_(0.2), //[m/s] + accel_(0.2), //[m/s²] origin_(0), stepSizeUm_(0.1) { @@ -2132,7 +2132,7 @@ int AStage::Initialize() SetPropertyLimits("SpeedA [mm/s]", 0.001, 100.0); // mm/s - // Accel (Acceleration (in m/s) + // Accel (Acceleration (in m/s²) // ----- ret = QueryCommand("?accel a", resp); if (ret != DEVICE_OK) return DEVICE_UNSUPPORTED_COMMAND; @@ -2142,7 +2142,7 @@ int AStage::Initialize() if (ret != DEVICE_OK) return ret; SetPropertyLimits("Acceleration A [m/s^2]", 0.01, 2.0); - // Backlash (in m) + // Backlash (in µm) // get current Backlash from the controller ret = QueryCommand("?backlash a", resp); if (ret == DEVICE_OK) @@ -2200,7 +2200,7 @@ int AStage::SetPositionUm(double pos) os << "AStage::SetPositionUm() " << pos; this->LogMessage(os.str().c_str()); - // switch to m + // switch to µm int ret = SendCommand("!dim a 1"); if (ret != DEVICE_OK) return ret; @@ -2230,7 +2230,7 @@ int AStage::SetPositionUm(double pos) int AStage::SetRelativePositionUm(double d) { - // switch to m + // switch to µm int ret = SendCommand("!dim a 1"); if (ret != DEVICE_OK) return ret; @@ -2261,7 +2261,7 @@ int AStage::SetRelativePositionUm(double d) int AStage::GetPositionUm(double& pos) { int ret; - // switch to m + // switch to µm ret = SendCommand("!dim a 1"); if (ret != DEVICE_OK) return ret; @@ -2428,7 +2428,7 @@ int AStage::GetLimits(double& min, double& max) { if (!range_measured_) return DEVICE_UNKNOWN_POSITION; - // switch to m + // switch to µm int ret = SendCommand("!dim a 1"); if (ret != DEVICE_OK) return ret; @@ -2998,7 +2998,7 @@ int LED100::Initialize() // Fire // create property Fire if Tango command flash is possible with this version ostringstream cmd; - cmd << "!flash -0.01"; //example 10s pulse + cmd << "!flash -0.01"; //example 10µs pulse ret = SendCommand(cmd.str().c_str()); if (ret !=DEVICE_OK) return ret; diff --git a/DeviceAdapters/Omicron/OmicronDeviceDriver.cpp b/DeviceAdapters/Omicron/OmicronDeviceDriver.cpp index e192d3154..4e70eea57 100644 --- a/DeviceAdapters/Omicron/OmicronDeviceDriver.cpp +++ b/DeviceAdapters/Omicron/OmicronDeviceDriver.cpp @@ -13,7 +13,7 @@ const char* OMIDLLname = "OmicronxXDevices64.dll"; #else const char* OMIDLLname = "OmicronxXDevices.dll"; #endif -//[DllImport(msvcrt.dll, CallingConvention = CallingConvention.Cdecl)] +//[DllImport(“msvcrt.dll”, CallingConvention = CallingConvention.Cdecl)] TxXGetDLLVersion ExXGetDLLVersion = NULL; diff --git a/DeviceAdapters/OxxiusCombiner/CoherentObis.cpp b/DeviceAdapters/OxxiusCombiner/CoherentObis.cpp index c17e358fb..464f01ddf 100644 --- a/DeviceAdapters/OxxiusCombiner/CoherentObis.cpp +++ b/DeviceAdapters/OxxiusCombiner/CoherentObis.cpp @@ -324,7 +324,7 @@ int CoherentObis::OnOperatingMode(MM::PropertyBase* pProp, MM::ActionType eAct) std::ostringstream Info; /////DEBUG - Info << "DEBUG OPERATING MODE: " << rep << "avec la commande encoye suivante: " << command; + Info << "DEBUG OPERATING MODE: " << rep << "avec la commande encoyée suivante: " << command; GetCoreCallback()->LogMessage(this, Info.str().c_str(), false); } diff --git a/DeviceAdapters/PCO_Generic/lib/pco_generic/sc2_SDKStructures.h b/DeviceAdapters/PCO_Generic/lib/pco_generic/sc2_SDKStructures.h index 8e7c4aa5d..086d4c5ee 100644 --- a/DeviceAdapters/PCO_Generic/lib/pco_generic/sc2_SDKStructures.h +++ b/DeviceAdapters/PCO_Generic/lib/pco_generic/sc2_SDKStructures.h @@ -411,7 +411,7 @@ typedef struct #define NUM_SIGNAL_NAMES 4 typedef struct { - WORD wSize; // Sizeof this (for future enhancements) + WORD wSize; // Sizeof ‘this’ (for future enhancements) WORD ZZwAlignDummy1; char strSignalName[NUM_SIGNAL_NAMES][25];// Name of signal 104 // Specifies NUM_SIGNAL_NAMES functionalities (1-4) @@ -446,7 +446,7 @@ typedef struct typedef struct { - WORD wSize; // Sizeof this (for future enhancements) + WORD wSize; // Sizeof ‘this’ (for future enhancements) WORD wNumOfSignals; // Parameter to fetch the num. of descr. from the camera PCO_Single_Signal_Desc strSingeSignalDesc[NUM_MAX_SIGNALS];// Array of singel signal descriptors // 4004 DWORD dwDummy[524]; // reserved for future use. // 6100 @@ -522,8 +522,8 @@ typedef struct typedef struct { WORD wSize; // Sizeof this struct - WORD wTimeBaseDelay; // Timebase delay 0:ns, 1:s, 2:ms - WORD wTimeBaseExposure; // Timebase expos 0:ns, 1:s, 2:ms + WORD wTimeBaseDelay; // Timebase delay 0:ns, 1:µs, 2:ms + WORD wTimeBaseExposure; // Timebase expos 0:ns, 1:µs, 2:ms WORD wCMOSParameter; // Line Time mode: 0: off 1: on // 8 DWORD dwCMOSDelayLines; // See next line DWORD dwCMOSExposureLines; // Delay and Exposure lines for lightsheet // 16 @@ -551,7 +551,7 @@ typedef struct WORD wModulationMode; // Mode for modulation (0 = modulation off, 1 = modulation on) // 1070 WORD wCameraSynchMode; // Camera synchronization mode (0 = off, 1 = master, 2 = slave) DWORD dwPeriodicalTime; // Periodical time (unit depending on timebase) for modulation // 1076 - WORD wTimeBasePeriodical; // timebase for periodical time for modulation 0 -> ns, 1 -> s, 2 -> ms + WORD wTimeBasePeriodical; // timebase for periodical time for modulation 0 -> ns, 1 -> µs, 2 -> ms WORD ZZwDummy3; DWORD dwNumberOfExposures; // Number of exposures during modulation // 1084 LONG lMonitorOffset; // Monitor offset value in ns // 1088 diff --git a/DeviceAdapters/PeCon2000/PeCon2000.cpp b/DeviceAdapters/PeCon2000/PeCon2000.cpp index 771b77e23..9d1fd90ec 100644 --- a/DeviceAdapters/PeCon2000/PeCon2000.cpp +++ b/DeviceAdapters/PeCon2000/PeCon2000.cpp @@ -7,7 +7,7 @@ // // AUTHOR: Christian Sachs // -// COPYRIGHT: Forschungszentrum Jlich +// COPYRIGHT: Forschungszentrum Jülich // LICENSE: BSD (2-clause/FreeBSD license) // THANKS: Dr. Oliver Merk (of PeCon GmbH) for Support and Testing @@ -163,7 +163,7 @@ CPeCon2000Device::CPeCon2000Device(string name) : ready(false), name(name), retr ADD_MAP(ChannelStatusMapper, PdlChannelStatusOk, "OK. No channel error"); ADD_MAP(ChannelStatusMapper, PdlChannelStatusNoSensor, "NO SENSOR. No valid sensor signal detected"); - ADD_MAP(ChannelStatusMapper, PdlChannelStatusOvertemp, "OVERTEMP. Actual Temperature > Max Setpoint + 5C"); + ADD_MAP(ChannelStatusMapper, PdlChannelStatusOvertemp, "OVERTEMP. Actual Temperature > Max Setpoint + 5°C"); ADD_MAP(ChannelStatusMapper, PdlChannelStatusOvercurrent, "OVERCURRENT. Actual Current > 4A"); ADD_MAP(ChannelStatusMapper, PdlChannelStatusSumOvercurrent, "SUM OVERCURRENT. Current CH1 + CH2 > 4.2A"); ADD_MAP(ChannelStatusMapper, PdlChannelStatusIdDetectError, "ID DETECT ERROR. ID number mismatch after 5x ID request over serial interface (3 identical ID's could not be found in the received 5 ID's) Auto-Detect will be repeated after a wait time, until 3 identical ID's are received."); @@ -173,15 +173,15 @@ CPeCon2000Device::CPeCon2000Device(string name) : ready(false), name(name), retr ADD_MAP(ChannelStatusMapper, PdlChannelStatusMBTempTooHi, "MB TEMP TOO HI. Mainboard temperature on connected component is too high"); ADD_MAP(ChannelStatusMapper, PdlChannelStatusChangeFilter, "CHANGE FILTER. Filters on/in connected component needs replacement"); - ADD_MAP(ChannelStatusMapper, PdlChannelStatusHeatingSensor, "HEATING SENSOR. CO2: The sensor temperature is not +/- 5C of the calibration temperature. If 60 min. after device start/reset the sensor status bit is still active, the channel status changes to \"FALSE SENS TEMP\", because the sensor heater normally heats up the sensor within 20-30 min. (CO2-Sensor 2000: Status Bit 6 is set) O2: The sensor heating voltage is slowly increased and has not reached yet final value."); + ADD_MAP(ChannelStatusMapper, PdlChannelStatusHeatingSensor, "HEATING SENSOR. CO2: The sensor temperature is not +/- 5°C of the calibration temperature. If 60 min. after device start/reset the sensor status bit is still active, the channel status changes to \"FALSE SENS TEMP\", because the sensor heater normally heats up the sensor within 20-30 min. (CO2-Sensor 2000: Status Bit 6 is set) O2: The sensor heating voltage is slowly increased and has not reached yet final value."); ADD_MAP(ChannelStatusMapper, PdlChannelStatusWaitForSensor, "WAIT FOR SENSOR. CO2: The sensor is not ready yet to give a value (CO2-Sensor 2000: Status Bit 0 is set)"); ADD_MAP(ChannelStatusMapper, PdlChannelStatusAutoCompensate, "AUTO COMPENSATE. CO2: The lamp intensity of the CO2-Sensor 2000 is automatically adjusted to give a specified CO2-concentration (e.g. 100,00% with pure CO2) (CO2-Sensor 2000: Status Bit 1 is set)"); - ADD_MAP(ChannelStatusMapper, PdlChannelStatusFalseSensTemp, "FALSE SENS TEMP. CO2: The sensor temperature is not +/- 6C of the calibration temperature after it was once inside the +/- 5C tolerance band. Or the sensor status bit was still set 60min. after device start/reset. (CO2-Sensor 2000: Status Bit 6 is set)"); + ADD_MAP(ChannelStatusMapper, PdlChannelStatusFalseSensTemp, "FALSE SENS TEMP. CO2: The sensor temperature is not +/- 6°C of the calibration temperature after it was once inside the +/- 5°C tolerance band. Or the sensor status bit was still set 60min. after device start/reset. (CO2-Sensor 2000: Status Bit 6 is set)"); ADD_MAP(ChannelStatusMapper, PdlChannelStatusLampOverLimit, "LAMP OVER LIMIT. CO2: The lamp PWM limit of the connected sensor has been exceeded (<=450 / >=950). (CO2-Sensor 2000: Status Bit 2 is set)"); ADD_MAP(ChannelStatusMapper, PdlChannelStatusNearADLimit, "NEAR AD LIMIT. CO2: One of the internal data points for CO2 measurement is near (or above) the limit of the AD converter. CO2-concentratrion of this time cycle is therefore invalid. (CO2-Sensor 2000: Status Bit 3 is set)"); ADD_MAP(ChannelStatusMapper, PdlChannelStatusFalseCalibVal, "FALSE CALIB VAL. CO2: The calibration values of the connected CO2-sensor 2000 head are invalid (10%/100% value=0) -> Factory recalibration with 0/10/100% (CO2-Sensor 2000: Status Bit 5 is set)"); ADD_MAP(ChannelStatusMapper, PdlChannelStatusNegativeValue, "NEGATIVE VALUE. CO2: The internal raw value is negative because of inverted detector signal. (CO2-Sensor 2000: Status Bit 4 is set)"); - ADD_MAP(ChannelStatusMapper, PdlChannelStatusHeatingVErr, "HEATING V ERR. O2: The heating voltage feedback control algorithm has reached the upper/lower DA voltage output limit, while not have reached the set heating voltage read back by AD-measurement."); + ADD_MAP(ChannelStatusMapper, PdlChannelStatusHeatingVErr, "HEATING V ERR. O2: The heating voltage feedback control algorithm has reached the upper/lower DA voltage output limit, while not have reached the set heating voltage read back by AD-measure­ment."); ADD_MAP(ChannelStatusMapper, PdlChannelStatusReferenceGas, "REFERENCE GAS. CO2: The sensor chamber is flooded with CO2 reference gas. O2: The sensor chamber is flooded with N2 reference gas."); ADD_MAP(ChannelStatusMapper, PdlChannelStatusAmbientAir, "AMBIENT AIR. CO2: The sensor chamber is flooded with ambient air. O2: The sensor chamber is flooded with ambient air."); ADD_MAP(ChannelStatusMapper, PdlChannelStatusAdjOtherSens, "ADJ OTHER SENS. CO2: The O2 sensor is automatically adjusted. O2: The CO2 sensor is automatically aging compensated (Auto Compensate). This error is set to each sensor, that is within the same volume as the other sensor, whose value is currently corrected/calibrated."); diff --git a/DeviceAdapters/Piezosystem_dDrive/devicelist.cpp b/DeviceAdapters/Piezosystem_dDrive/devicelist.cpp old mode 100755 new mode 100644 index 7ea1aa65f..980fe9a75 --- a/DeviceAdapters/Piezosystem_dDrive/devicelist.cpp +++ b/DeviceAdapters/Piezosystem_dDrive/devicelist.cpp @@ -20,7 +20,7 @@ bool devicelist::isStage(std::string name){ name == "NANOX400" || name == "NANOX400SG" || name == "NANOX400CAP" || name == "NANOSX400" || name == "NANOSX400CAP" || name == "NANOSX400CAPDIG" || name == "NANOSX800" || name == "NANOSX800CAP" || name == "NANOSX800CAPDIG" || - name == "NANOX240SG45" || name == "NANOX240SG45"|| + name == "NANOX240SG45" || name == "NANOX240SG45°"|| */ //X positionierer diff --git a/DeviceAdapters/RaptorEPIX/RaptorEPIX.cpp b/DeviceAdapters/RaptorEPIX/RaptorEPIX.cpp index 267d57358..48466c94a 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 ; diff --git a/DeviceAdapters/Skyra/Skyra.h b/DeviceAdapters/Skyra/Skyra.h index f796c1978..bef78eb8d 100644 --- a/DeviceAdapters/Skyra/Skyra.h +++ b/DeviceAdapters/Skyra/Skyra.h @@ -78,9 +78,9 @@ // Strings // -const char * g_DeviceVendorName = "HBNER Photonics"; +const char * g_DeviceVendorName = "HÜBNER Photonics"; const char * g_DeviceSkyraName = "Skyra"; -const char * g_DeviceSkyraDescription = "Skyra/Cobolt Controller by Karl Bellv"; +const char * g_DeviceSkyraDescription = "Skyra/Cobolt Controller by Karl Bellvé"; const char * g_SendTerm = "\r"; diff --git a/DeviceAdapters/TISCam/TIScamera.cpp b/DeviceAdapters/TISCam/TIScamera.cpp index 3d98e22ac..b38d9cf2d 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. */ diff --git a/DeviceAdapters/ThorlabsDCxxxx/DC2200.cpp b/DeviceAdapters/ThorlabsDCxxxx/DC2200.cpp index 46eabb179..b1157e0c9 100644 --- a/DeviceAdapters/ThorlabsDCxxxx/DC2200.cpp +++ b/DeviceAdapters/ThorlabsDCxxxx/DC2200.cpp @@ -701,7 +701,7 @@ bool DC2200::dynErrlist_add(int err, std::string descr) dynError->descr = descr; m_dynErrlist.push_back(dynError); - // publish the new error to Manager + // publish the new error to µManager SetErrorText((int)(dynError->err), descr.c_str()); return true; diff --git a/DeviceAdapters/ThorlabsDCxxxx/DC2XXX.cpp b/DeviceAdapters/ThorlabsDCxxxx/DC2XXX.cpp index 6257c02f8..220013fc5 100644 --- a/DeviceAdapters/ThorlabsDCxxxx/DC2XXX.cpp +++ b/DeviceAdapters/ThorlabsDCxxxx/DC2XXX.cpp @@ -751,7 +751,7 @@ bool DC2xxx::dynErrlist_add(int err, std::string descr) dynError->descr = descr; m_dynErrlist.push_back(dynError); - // publish the new error to Manager + // publish the new error to µManager SetErrorText((int)(dynError->err), descr.c_str()); return true; diff --git a/DeviceAdapters/ThorlabsDCxxxx/DC3100.cpp b/DeviceAdapters/ThorlabsDCxxxx/DC3100.cpp index 5e2931d13..785e39479 100644 --- a/DeviceAdapters/ThorlabsDCxxxx/DC3100.cpp +++ b/DeviceAdapters/ThorlabsDCxxxx/DC3100.cpp @@ -707,7 +707,7 @@ bool DC3100::dynErrlist_add(int err, std::string descr) dynError->descr = descr; m_dynErrlist.push_back(dynError); - // publish the new error to Manager + // publish the new error to µManager SetErrorText((int)(dynError->err), descr.c_str()); return true; diff --git a/DeviceAdapters/ThorlabsDCxxxx/DC4100.cpp b/DeviceAdapters/ThorlabsDCxxxx/DC4100.cpp index 9493b9b62..0e85414de 100644 --- a/DeviceAdapters/ThorlabsDCxxxx/DC4100.cpp +++ b/DeviceAdapters/ThorlabsDCxxxx/DC4100.cpp @@ -384,7 +384,7 @@ bool DC4100::dynErrlist_add(int err, std::string descr) dynError->descr = descr; m_dynErrlist.push_back(dynError); - // publish the new error to Manager + // publish the new error to µManager SetErrorText((int)(dynError->err), descr.c_str()); return true; diff --git a/DeviceAdapters/ThorlabsDCxxxx/DCxxxx_Plugin.cpp b/DeviceAdapters/ThorlabsDCxxxx/DCxxxx_Plugin.cpp index 7e7cbc66c..c253ef94f 100644 --- a/DeviceAdapters/ThorlabsDCxxxx/DCxxxx_Plugin.cpp +++ b/DeviceAdapters/ThorlabsDCxxxx/DCxxxx_Plugin.cpp @@ -46,7 +46,7 @@ const char* g_DeviceDC2xxxName = "Thorlabs DC2010/DC2100"; // /////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------- - Initialize module data. It publishes the DCxxxx series names to Manager. + Initialize module data. It publishes the DCxxxx series names to µManager. ---------------------------------------------------------------------------*/ MODULE_API void InitializeModuleData() { diff --git a/DeviceAdapters/Thorlabs_ELL14/ELL14.cpp b/DeviceAdapters/Thorlabs_ELL14/ELL14.cpp index d105b98f4..74b59e7fe 100644 --- a/DeviceAdapters/Thorlabs_ELL14/ELL14.cpp +++ b/DeviceAdapters/Thorlabs_ELL14/ELL14.cpp @@ -7,7 +7,7 @@ //// https://www.thorlabs.de/newgrouppage9.cfm?objectgroup_ID=12829 //// //// AUTHOR: Manon Paillat, 2022 -//// developped under the supervision of Florian Strhl +//// developped under the supervision of Florian Ströhl //// Contact: florian.strohl@uit.no // diff --git a/DeviceAdapters/Thorlabs_ELL14/ELL14.h b/DeviceAdapters/Thorlabs_ELL14/ELL14.h index 5c6f9a7b4..24aa2d4f5 100644 --- a/DeviceAdapters/Thorlabs_ELL14/ELL14.h +++ b/DeviceAdapters/Thorlabs_ELL14/ELL14.h @@ -7,7 +7,7 @@ //// https://www.thorlabs.de/newgrouppage9.cfm?objectgroup_ID=12829 //// //// AUTHOR: Manon Paillat, 2022 -//// developped under the supervision of Florian Strhl +//// developped under the supervision of Florian Ströhl //// Contact: florian.strohl@uit.no // @@ -102,7 +102,7 @@ class ELL14 : public CGenericBase< ELL14> double pulsesPerRev_; double maxReplyTimeMs_; - double pos_; // in + double pos_; // in ° double offset_; // " double jogStep_; // " double relativeMove_; // " diff --git a/DeviceAdapters/TwainCamera/CommonTWAIN.cpp b/DeviceAdapters/TwainCamera/CommonTWAIN.cpp index 590db35b4..92e614686 100644 --- a/DeviceAdapters/TwainCamera/CommonTWAIN.cpp +++ b/DeviceAdapters/TwainCamera/CommonTWAIN.cpp @@ -1,5 +1,5 @@ /*************************************************************************** -* Copyright 2007 TWAIN Working Group: +* Copyright © 2007 TWAIN Working Group: * Adobe Systems Incorporated, AnyDoc Software Inc., Eastman Kodak Company, * Fujitsu Computer Products of America, JFL Peripheral Solutions Inc., * Ricoh Corporation, and Xerox Corporation. diff --git a/DeviceAdapters/XCiteLed/XLed.cpp b/DeviceAdapters/XCiteLed/XLed.cpp index 2b09bfbd0..d3a3363dd 100644 --- a/DeviceAdapters/XCiteLed/XLed.cpp +++ b/DeviceAdapters/XCiteLed/XLed.cpp @@ -403,9 +403,9 @@ XLed::XLed() XLed::m_sXLedStr[XLed::XL_TriggerDelayTimeLabel] = "L.16 Trigger Delay Time (0-65535)"; // 47: Led device trigger delay time label XLed::m_sXLedStr[XLed::XL_PWMUnitsLabel] = "L.17 IPG Units (0:uS/1:mS/2:S)"; // 48: Led device PWM units label XLed::m_sXLedStr[XLed::XL_LedTempLabel] = "L.18 Current Temperature (Deg.C)"; // 49: Led device temperature label - XLed::m_sXLedStr[XLed::XL_LedMaxTempLabel] = "L.19 Max Allowed Temperature (Deg.C)"; // 50: Led device max allowed temperature label [C] - XLed::m_sXLedStr[XLed::XL_LedMinTempLabel] = "L.20 Min Allowed Temperature (Deg.C)"; // 51: Led device min allowed temperature label [C] - XLed::m_sXLedStr[XLed::XL_LedTempHystLabel] = "L.21 Temperature Hysteresis (Deg.C)"; // 52: Led device temperature hysteresis label [C] + XLed::m_sXLedStr[XLed::XL_LedMaxTempLabel] = "L.19 Max Allowed Temperature (Deg.C)"; // 50: Led device max allowed temperature label [°C] + XLed::m_sXLedStr[XLed::XL_LedMinTempLabel] = "L.20 Min Allowed Temperature (Deg.C)"; // 51: Led device min allowed temperature label [°C] + XLed::m_sXLedStr[XLed::XL_LedTempHystLabel] = "L.21 Temperature Hysteresis (Deg.C)"; // 52: Led device temperature hysteresis label [°C] XLed::m_sXLedStr[XLed::XL_Reserved] = "Reserved"; // 53: Led device software version label } diff --git a/DeviceAdapters/XCiteXT600/XT600.cpp b/DeviceAdapters/XCiteXT600/XT600.cpp index 9823e6b43..3b9000ed1 100644 --- a/DeviceAdapters/XCiteXT600/XT600.cpp +++ b/DeviceAdapters/XCiteXT600/XT600.cpp @@ -233,9 +233,9 @@ XLed::XLed() //XLed::m_sXLedStr[XLed::XL_TriggerDelayTimeLabel] = "L.16 Trigger Delay Time (0-65535)"; // 47: Led device trigger delay time label //XLed::m_sXLedStr[XLed::XL_PWMUnitsLabel] = "L.17 IPG Units (0:uS/1:mS/2:S)"; // 48: Led device PWM units label XLed::m_sXLedStr[XLed::XL_LedTempLabel] = "L.09 Current Temperature (Deg.C)"; // 49: Led device temperature label - XLed::m_sXLedStr[XLed::XL_LedMaxTempLabel] = "L.10 Max Allowed Temperature (Deg.C)"; // 42: Led device max allowed temperature label [C] - XLed::m_sXLedStr[XLed::XL_LedMinTempLabel] = "L.11 Min Allowed Temperature (Deg.C)"; // 43: Led device min allowed temperature label [C] - XLed::m_sXLedStr[XLed::XL_LedTempHystLabel] = "L.12 Temperature Hysteresis (Deg.C)"; // 44: Led device temperature hysteresis label [C] + XLed::m_sXLedStr[XLed::XL_LedMaxTempLabel] = "L.10 Max Allowed Temperature (Deg.C)"; // 42: Led device max allowed temperature label [°C] + XLed::m_sXLedStr[XLed::XL_LedMinTempLabel] = "L.11 Min Allowed Temperature (Deg.C)"; // 43: Led device min allowed temperature label [°C] + XLed::m_sXLedStr[XLed::XL_LedTempHystLabel] = "L.12 Temperature Hysteresis (Deg.C)"; // 44: Led device temperature hysteresis label [°C] XLed::m_sXLedStr[XLed::XL_LedTriggerSequenceLabel] = "L.13 Trigger Sequence"; // 13: TTL Trigger sequence XLed::m_sXLedStr[XLed::XL_LedOnOffStateLabel] = "L.14 On/Off State (1=On 0=Off)"; // 40: Led device ON/OFF state label XLed::m_sXLedStr[XLed::XL_LedIntensityLabel] = "L.15 Intensity (0.0 or ";//5.0 - 100.0)%"; // 41: Led device intensity label diff --git a/DeviceAdapters/XLightV3/XLight_MM.cpp b/DeviceAdapters/XLightV3/XLight_MM.cpp index 006c20d7e..30c3fdc34 100644 --- a/DeviceAdapters/XLightV3/XLight_MM.cpp +++ b/DeviceAdapters/XLightV3/XLight_MM.cpp @@ -369,7 +369,7 @@ std::string XLightHub::BuilCommand (TCmdType eCmdType, TDeviceInfo* pDeviceInfo // ---------------------------------------------------------------------------------------------- int XLightHub::ParseAnswer(std::string pCmd, std::string pAnsw, TCmdType eCmdType , TDeviceInfo* pDeviceInfo){ - // creo il comando che stato inviato + // creo il comando che è stato inviato std::string StrCmdBase=BuilCommandBase(eCmdType, pDeviceInfo); std::string StrAnsw= pAnsw; std::string StrCmd= pCmd; @@ -379,7 +379,7 @@ int XLightHub::ParseAnswer(std::string pCmd, std::string pAnsw, TCmdType eCmdTyp if (StrAnsw.find(StrCmdBase)!=0){ return ERR_COMMAND_EXECUTION_ERROR; } - // se arrivo qui il comando presente nella risposta, quindi estraggo quello che rimane + // se arrivo qui il comando è presente nella risposta, quindi estraggo quello che rimane StrAnsw=StrAnsw.substr(StrCmdBase.length()); try { @@ -568,7 +568,7 @@ int XLightHub::IsOnline(TDevicelType DeviceType){ if (ret!=DEVICE_OK) return ret; - // se un device con base 1 riduco il tutto + // se è un device con base 1 riduco il tutto if (DeviceType>=EMISSION_FT && DeviceType<=EXCITATION_FT){ if (RetValue==0){ InitialPositions[DeviceType-1]=1; diff --git a/DeviceAdapters/Ximea/XIMEACamera.h b/DeviceAdapters/Ximea/XIMEACamera.h index 80fc4c141..bd4c76bd3 100644 --- a/DeviceAdapters/Ximea/XIMEACamera.h +++ b/DeviceAdapters/Ximea/XIMEACamera.h @@ -6,7 +6,7 @@ // DESCRIPTION: XIMEA camera module. // // AUTHOR: Marian Zajko, -// COPYRIGHT: Marian Zajko and XIMEA GmbH, Mnster, 2011 +// COPYRIGHT: Marian Zajko and XIMEA GmbH, Münster, 2011 // // LICENSE: This file is distributed under the BSD license. // License text is included with the source distribution. diff --git a/DeviceAdapters/ZeissCAN/ZeissCAN.cpp b/DeviceAdapters/ZeissCAN/ZeissCAN.cpp index d37419365..c323e7d19 100644 --- a/DeviceAdapters/ZeissCAN/ZeissCAN.cpp +++ b/DeviceAdapters/ZeissCAN/ZeissCAN.cpp @@ -613,7 +613,7 @@ MM::DeviceDetectionStatus ZeissScope::DetectDevice(void) { *its = (char)tolower(*its); } - // ensure weve been provided with a valid serial port device name + // ensure we’ve been provided with a valid serial port device name if( 0< transformed.length() && 0 != transformed.compare("undefined") && 0 != transformed.compare("unknown") ) { // the port property seems correct, so give it a try From eb9d96d565875fcc9e7e33b7ac21e6e5bc91639c Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Wed, 19 Jun 2024 12:37:12 -0500 Subject: [PATCH 2/8] 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位图像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) { @@ -1694,19 +1694,19 @@ void ClassGalaxy::RG8ToRGB24Packed(void* destbuffer,CImageDataPointer& objImageD return;*/ //end modify - //RG8תRGB24 + //RG8转RGB24 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) @@ -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(); // дļij - DWORD dwBytesRead = 0; // ļȡij + DWORD dwImageSize = (DWORD)objCImageDataPointer->GetPayloadSize(); // 写入文件的长度 + DWORD dwBytesRead = 0; // 文件读取的长度 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/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模式,但是以下函数没有写也会开启live模式,开启该函数之后,软件会卡死,内部有函数 */ 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 限制 或者其他原因,导致 转换成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); //增加说明: 此处是插件的名字,具体相机序列号是需要 (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Ȱoffvector ѭз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֧basleroffڵ + // vals.push_back("Off"); // 海康相机无这个节点,不会走到这个分支中; 参考basler分支,basler无添加off节点 MVCC_ENUMVALUE SensorReadoutMode = { 0 }; m_pCamera->GetEnumValue("SensorReadoutMode", &SensorReadoutMode); @@ -874,10 +874,10 @@ int HikrobotCamera::SnapImage() { /* - baslersnapimageеõ 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 + //如果是彩色则转成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) { @@ -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Ͳ WidthHeightϸݲοSDKװĿ¼µ MvCameraNode.xlsx ļ +// ch:获取和设置Int型参数,如 Width和Height,详细内容参考SDK安装目录下的 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:获取和设置Enum型参数,如 PixelFormat,详细内容参考SDK安装目录下的 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Ͳ ExposureTimeGainϸݲοSDKװĿ¼µ MvCameraNode.xlsx ļ +// ch:获取和设置Float型参数,如 ExposureTime和Gain,详细内容参考SDK安装目录下的 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:获取和设置Bool型参数,如 ReverseX,详细内容参考SDK安装目录下的 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:获取和设置String型参数,如 DeviceUserID,详细内容参考SDK安装目录下的 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:执行一次Command型命令,如 UserSetSave,详细内容参考SDK安装目录下的 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++ӿΪԳúжηװûʹ */ +/* 以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Ͳ WidthHeightϸݲοSDKװĿ¼µ MvCameraNode.xlsx ļ + // ch:获取和设置Int型参数,如 Width和Height,详细内容参考SDK安装目录下的 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:获取和设置Enum型参数,如 PixelFormat,详细内容参考SDK安装目录下的 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Ͳ ExposureTimeGainϸݲοSDKװĿ¼µ MvCameraNode.xlsx ļ + // ch:获取和设置Float型参数,如 ExposureTime和Gain,详细内容参考SDK安装目录下的 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:获取和设置Bool型参数,如 ReverseX,详细内容参考SDK安装目录下的 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:获取和设置String型参数,如 DeviceUserID,详细内容参考SDK安装目录下的 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:执行一次Command型命令,如 UserSetSave,详细内容参考SDK安装目录下的 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, its 3 instead of 128. +#define MAX_PULSE_COUNT 21 // For SX Modules, it’s 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");//出现在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ͼϵ, ASISetStartPosbin1 +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ı, startposbinĻģҲҪձı + 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ľ㣬õROIROI +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; } @@ -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 managerbinʱɳֹͣãpropertybinֹͣ´Բֹͣʱ + 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ı, startposbinĻģҲҪձı + 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ʱˢlabelstate +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/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-dewEFW \ No newline at end of file +//2.0.0.0->20170113:增加anti-dew和EFW \ 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"); } From dd29d76e1ed8bf6e82d40ea68afdb7676b27a468 Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Wed, 19 Jun 2024 12:38:40 -0500 Subject: [PATCH 3/8] Convert Shift-JIS to UTF-8 Used `nkf -w`. (iconv -f Shift-JIS -t UTF-8 introduces spurious changes to ASCII `~` and `\`) --- DeviceAdapters/SigmaKoki/XYStage.cpp | 2 +- DeviceAdapters/SigmaKoki/XYStage.h | 2 +- DeviceAdapters/SigmaKoki/ZStage.cpp | 2 +- DeviceAdapters/SigmaKoki/ZStage.h | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DeviceAdapters/SigmaKoki/XYStage.cpp b/DeviceAdapters/SigmaKoki/XYStage.cpp index 5601c49fe..49f064ed1 100644 --- a/DeviceAdapters/SigmaKoki/XYStage.cpp +++ b/DeviceAdapters/SigmaKoki/XYStage.cpp @@ -490,7 +490,7 @@ int XYStage::SetDivision(int channel, int division) if (ret != DEVICE_OK) return ret; - // Send command c the division number + // Send command … the division number if (model_ == SHRC3) // hit mode SHRC controller { if (channel == 1) { ret = SendCheckRecievedOK("S:" + to_string(division) + ",,"); } diff --git a/DeviceAdapters/SigmaKoki/XYStage.h b/DeviceAdapters/SigmaKoki/XYStage.h index a25e3dd2c..7fdd87ee0 100644 --- a/DeviceAdapters/SigmaKoki/XYStage.h +++ b/DeviceAdapters/SigmaKoki/XYStage.h @@ -75,7 +75,7 @@ class XYStage : public CXYStageBase, public SigmaBase void CreateDivisionPropXY(); void CreateFullStepPropXY(); - void AddAllowedDivisionPropXY(const char* div); // Added 5122022 t.abed + void AddAllowedDivisionPropXY(const char* div); // Added 5月12日2022 t.abed int SetDeviceModel(); // change from [ SetDeviceModel(XYStageModel& model)] no needed int SetDivision(int channel, int division); int SetSpeedXY(int vxy); diff --git a/DeviceAdapters/SigmaKoki/ZStage.cpp b/DeviceAdapters/SigmaKoki/ZStage.cpp index 36be97756..119bd650b 100644 --- a/DeviceAdapters/SigmaKoki/ZStage.cpp +++ b/DeviceAdapters/SigmaKoki/ZStage.cpp @@ -717,7 +717,7 @@ void ZStage::CreateDivisionProp() { // Clear all allowed value declared before.-------------------------------------------------------------------------------------------- ClearAllowedValues(g_ZStageDivision); - AddAllowedDivisionPropXY(g_ZStageDivision); // Added 9122022 t.abed + AddAllowedDivisionPropXY(g_ZStageDivision); // Added 9月12日2022 t.abed } /// diff --git a/DeviceAdapters/SigmaKoki/ZStage.h b/DeviceAdapters/SigmaKoki/ZStage.h index 544763649..6b976469b 100644 --- a/DeviceAdapters/SigmaKoki/ZStage.h +++ b/DeviceAdapters/SigmaKoki/ZStage.h @@ -66,19 +66,19 @@ class ZStage : public CStageBase, public SigmaBase int SetDeviceModel(); // change from [ SetDeviceModel(XYStageModel& model)] no needed void CreateDivisionProp(); - void AddAllowedDivisionPropXY(const char* div); // Added 5122022 t.abed + void AddAllowedDivisionPropXY(const char* div); // Added 5月12日2022 t.abed void CreateChanelProp(); int SetDivision(int division); int SetSpeed(int val); - int UpdatePositionZ(); // Added 472022@@@t.abed - int DriveCommadProcessZ(double position);// Added 472022 t.abed + int UpdatePositionZ(); // Added 4月7日2022   t.abed + int DriveCommadProcessZ(double position);// Added 4月7日2022 t.abed long GetSlowSpeedPulse(long pls); ZStageModel model_; std::string controlMode_; std::string channel_; int speed_; - double stepsZ_; // Z stage current position Added 472022 t.abed + double stepsZ_; // Z stage current position Added 4月7日2022 t.abed double fullstepSizeZum_; double stepSizeZum_; std::string divisionZ_; From 264666a5cc477415266e8ca49c1efc667d1dc637 Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Wed, 19 Jun 2024 12:40:38 -0500 Subject: [PATCH 4/8] Convert UTF-16 to UTF-8 iconv -f UTF-16 -t UTF-8 --- DeviceAdapters/TwoPhoton/BFTest.cpp | Bin 11028 -> 5521 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/DeviceAdapters/TwoPhoton/BFTest.cpp b/DeviceAdapters/TwoPhoton/BFTest.cpp index f210c03c6de6ccf5411a3c0a9427824f28d768e7..0a99b44cb162e18be55d618c7200e60b5e9cf137 100644 GIT binary patch literal 5521 zcmeHL&2rnw5kA{heus{>yhXwkLD7;eugz3tDLGa}$||-tIe1m95ik%Y1_A5<5an#` zTjT-q7`f-Z&y=rw20x^nR3)bzLYE9+Fw@=B{q@&9_{!u_*2J3jzJ0q?Yi-pu-Fx!* zt8Vz>;zZw>NH2@Ls#RWB@_sPmO;yLHn5MrTj;&Rl?hGYaq3WHn*jOFy4n{@(Kpu2t z=0;XSO{^1>Yq~r;rRURw!-J#a`IE=)pUG>w(pByDG8#X5{L_=iMAYt%BDEgXw$bC) zGS2g@u4%z9rf0dSjmpel^r(HG(1_pvYC$Kbe>_{BuD<&nghC>Ic+uFLFAye!O=LC`}*S+N1sACCJqZj;atsIudVEbfLL z@qjpy?c;|?=e33j>{z!(kQJqP5D{T8bSNac^%bcE3*7^9;ZEC1Wn_z{#->{2q$*43 zPGybeh3{4u>VCCUCGtnFDozxPUVM+#jZ!+X20|z?S+{&yG#Qdglgg>X7RcEVAY#m`^NrZa*- z+)%7)Aii|#8qnMKr+=V*cVWN77B;)bLQ}y2=g|2}>=DnXLa~H^LB`H=A>%-ZxP^;y^kZXO zp3^(;{KV=X8=Xg=r%vQm+PFBdr1$Dh=Mv84`wz4>*1|V6I})CS?tA>tw@33sD$C4+ zYs(i5lCayVn6~dkK*}an0BOZLh$$~NFv0C>iWIS6MeGa7Rg3kGA4`EgK#G_luaGUu zW02ZG5h3A*=(vD0IuKcNo7Pkrv=A<|o+MP&+0@3n$bpAer1*A|8bFi%;y_O=HPYzS zY|Q)kggxX_(LbNkvP&^XrGxqG2QGw&2eJ%Y#^#9M#=FMq_|^e%Xt2}qd`c%8Xk2r^ z*)GTVp1J(|9o=r_;qFRrP`4uxja!HynL0&cR3(=h_?s2ESU3`v?H=t4>?;Aek~0xp zV$-dT&|BL+iyW)LNeJy7HdH)R^MZi^P&*U=)!TFEMlq7OraG+Jf`t{He>SPM>?En0 zj2>qhBX~ONeqzVVDZSUF20X#SWkmYPB&M37q%8*W-7k5{(>eZn2X6?NdD;T`>ifp~^fhK*ytpy`Z#nREv6WYkvqZ>ttB z=F=JXC0t;lVh!RmRqq_Q01S^pVI8i#7;ybatVU-i*EfqnwQ)nwo`HHF{e(a0?dmz) zJ(vl<%5pFz&vM++LIP7?ajn@Wrwi;jB$x4PtZ=_DIAFtA#7^Hr3uNbX7NGwQ4~}s+ zW^p@u0&dU!YX}X4c`MC zjIAiuXcDABk`l;nH_7P1$~Rj$8+)7n}AEt+aT%2d;Ayul)EXO5|bX&7pKG`s# zV8%#dwtny-gfpj-*lcGc=_ zVCE>SRK%XsxFR8Y1?p7exIr@-p@5euSQ6(X*%;=)F~B7E3HK=KfMs|{KH)0q2|4WH zp=+bwp^N8!SGoW>xu8GM_azDhQ?Ky1XYVeHzi1~Ev-cdgfVW^N+c=>sZon?Z#!I8a zIdjO;pLEXTjI_(43ql(h&Jpf*6XBtRn9(FRJ@VVN(nc(h0~5!qC_7sffiq)>tH~A? z`Pk{Pgi3MlDYxsXLA=gjc*Mo6^#xl52>zcv|JT`bK%A(4?Ge6X$!k#X5FYf5Mj+Sm zXyi`Y<54#iupG`DgQ{D?@H_@zgu$^;pJOP&$lJ5?(}0o^P!q(II$u?zuaj~@ds$OY z>-%~Sx0}5I7-i~jZk3!9kzqn_yJUk_V#qO$qL^ZO!&)X=&_Di8AwDGV)ul1tEj+6I zNv=Pnc?ny6#~4-nm%n0_7$L$o^nNK6i1! z>gfn5@xEjxVw>Flp2mo++{&n{Z6BRT|ILd*;ROjMAmC~IL;mmAaS0S3?S8{@U$NFe b4$3%xjpOeJUxRzmzCn|pKKxh-T>kt|UF@q& literal 11028 zcmeI2+iq0Z5r&sESB{i-=n&1w9F5Ikn1DyhctSvd3>lo{f*@pk0D`eS-58Ugd5b(i z9y3=-{%`$VuC;gXZX-={hg$9Ky?d=X*I!j@`#=BwWqDN&%68c=$7QGNmQguZzA1Oh zM%gNFbUoJRmGV+|e_no8hE_i;56ib&`A(F!^|?_FMR8KzYUhFePMZD0H15>ZJKBF( z*M2>R*Bwc;C5kW4ShXi@4(m!JpHB^rV@bR%nu}L%SDnt553P5^{Z)D1P_))qcTc|@ z=yOyamHXv4`n;xftL3`hH_ENDRyAjRyjlNN>o&Cu>aAav%lW$QL;X9_s?m(^M$!&X zE^F^tKHk-y+s*o*j~(E%uD5qwk%R}5_pRPrRj0pe4LrO1_q1cV+L8Ugs1&}HZhzAL z4ShZ<-<97@CAEzHYmUd-d7yp1GG%o4nq&Po5&swZ+?8cVvg@&|_*nOlrYrAns}A4P z6?^(VK3&(BdY0~icD<4HpzghsLF&J+>z-HY-)Uuc$JuM`j`;_0e zlo@2fiB|8(YA;1)Mb~NLkN`O{Oi^^aNK<@yNzYk^EosPf5O0gm%vHuHIoT>wY&f^nE zL$!E0li5Ub8!c^wa-V2U{vhp^V!#~RUtAa7RY@jVv#*t7*$srSr!xMmKS;V?G2&hQ zM#T$`_oU53-F>f5>gbWEP=9uHO{}`2Sh|PG1Xo@38>zz?YlS5tKVH?y?Q`F#vSE2D z6`YB_k?z9Fu@Tact*m&gUyKiLbal5SwUphYQ6cQ$G5GlkcF-SITm)DhJ#I7SC(d?dnomATRByv4DU#p0GMKTdfR5jlL zjdz7rcnQsuqH*#>GLEaykqzI!llMWi*U~wD3(l7syV3bkmN?`Wn>DtaCmG{Hk`G)LqUH6Xk+OHC%6!YUEkYuIF zmhfs?4Zo!nmgPiJ5%VA^`q>9W`+?*>(I@;oRD*=K*ba&aA&No4L;TqCLT z%-(Qq+0xz?2SHFUH&><N7Hg7VwjPT+I`KW_72P(_@3S=G-~sr?S#{EH_nt0tK{4i zeP27}P&*gvu~IWPZQIu~Ixa@dSblj z;wt#cSzz?PZT~|C5?9E3w#@>Asd=-nvMLIfXG>{!(`SbIZn$I9AN zcd&x$pR{gOT0@!KmDl>Wwj08o=)&5#qQ}~hY|*t2p~A&RqLv5qEt-J@&}>nl<>B)L zPH2s;&uiz@)nF(}=`8wlKK)C^OjMb$T*Mt6mE)-^M@k=*J-4OBp)@=fudDXr``gkJ zDPn>_k2ms~`$#4us(qVnR1KoQJv`st=OkWrrEzDoESk~V`phn`@2DfnoM>m8+s&?v z<>K^QY-xHfv?M8b&CchJ?qQma*W?}(yJ=+|m_4&FRce+yMdH5I%e`Yup|u-lz2?#W z#rCVGkr5iTcsneIYbSDCP#?tkH(fF_Aor+Ymadhik9wAOXtyOrwzV1Ah>$?i^(n4$ z_POYUXju2w4)eYv!?hV1TC^Xw51t9l9O+?`#gfkR(e)V_hBCf8!#G|R%i66>L)^QT z!5%keWZ^F73E;$AW$Ut@G5w`x?&m@&DERYp{dP{XW=8*|f$X_7SU&QmjvCR-04>t>K4%)(Zn>ye4bkI)P&#f>&-+?{PFCR z+D(5-9|ZozyiRY#q{*c09wYl$CNiE0c!B}nsDhlo`%KJMgLm@Bs_@EeifJPB%nC%$ zoc&q+9z6$kj-IY>2T#ywgq>Y`6VwEHubh0A2oJ-BunoK^VUxLkd3+unLYj7mnY&m(uVFX z>O=9XPXnRo?2eP2@C3Hac#FO&?+jsnpKo+su13@WG|UVPYY%mL$QU(a9$sCNzviRz z(21RAiU-=od=MTcSGyBFl`G}M!j6$P-}-S8HZlr+>ODc@vEp^8v!F(N>OJRo4cO;X z?}-&=J5Dfp4Yc!Ayhv7=FTitqvbrB=Y`Q- z+!%V2?3_TmTY7sk@AgoMvv<{FJkX5Avw=NfmQgJ+hMLHe@rk7UqOJgA&&e8eC|C4; zuQ#1HcTe<&JM@zWlH}E|)pc!EtF#pqt=zqx)!Fz|VqPE9c2S$PFX{*0m_zeHu6P46W<0ZoIU#==1TyKR!c_w3n~pyH@`B*@}EXg#Mtle)_;E z)~u%Udame|hbmG$smZ5=t)_Hl)GeNf(?8NNaNRu@%^j&h#9-bbBEHhzex;n$j*4ge zt!3!V%!N~Bo@TV&r~exzcx2>`6|pJJ|N3Ocl5{a5xjhv!4C6?<=JK31`QKbIQ4MuN z#*Wrbo`uQ8uv2pLZ_d-an``H568YR#6Of{v$+x*fh`=QCRF7-|EqKD>8H~zyl|I6&h@?YYws9692 From b7da0df9403cf6494951c59a8052ee9ad52a5137 Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Wed, 19 Jun 2024 12:48:53 -0500 Subject: [PATCH 5/8] Convert possible CP-1253 to UTF-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file already contained ASCII '?' characters, suggesting a previous encoding conversion had already lost some characters. (This seems to have happened before the file was first committed (2012) to this repository or its predecessors.) The character in question here is 8-bit F8, which in CP-1252 (or latin1) would be 'ø'. Maybe that is what it was, but in CP-1253 (iso-8859-7, Latin/Greek) it is 'ψ', which seems more likely here. In any case, we are not losing any information by this conversion. --- DeviceAdapters/TwoPhoton/TwoPhoton.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DeviceAdapters/TwoPhoton/TwoPhoton.cpp b/DeviceAdapters/TwoPhoton/TwoPhoton.cpp index 15a046bbd..62df9a22e 100644 --- a/DeviceAdapters/TwoPhoton/TwoPhoton.cpp +++ b/DeviceAdapters/TwoPhoton/TwoPhoton.cpp @@ -1194,8 +1194,8 @@ void BitFlowCamera::GetCosineWarpLUT(vector &new_pixel, int image_width, in /* Again this code can be replaced by simpler code - The correction factor = /sin where = pixel number (from the correct center pixel) * ? - ? = 2?/freq*127. The corretion factor is calculated for each pixel and applied to the pixel + The correction factor = ψ /sin ψ where ψ = pixel number (from the correct center pixel) * ?ψ + ?ψ = 2?/freq*127. The corretion factor is calculated for each pixel and applied to the pixel */ /*9 Loop to shift pixels to new image LUT*/ From 32f4db98717a936995571b5ed44bcb7476bac9e6 Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Wed, 19 Jun 2024 14:03:10 -0500 Subject: [PATCH 6/8] CI: Enforce UTF-8 for .cpp/.h/.txt files --- .github/workflows/ci-misc.yml | 14 ++++++++++++++ tools/check-utf8.sh | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/ci-misc.yml create mode 100755 tools/check-utf8.sh diff --git a/.github/workflows/ci-misc.yml b/.github/workflows/ci-misc.yml new file mode 100644 index 000000000..1a5d7741b --- /dev/null +++ b/.github/workflows/ci-misc.yml @@ -0,0 +1,14 @@ +name: Misc checks + +on: + pull_request: + push: + branches: + - main + +jobs: + check-utf8-encoding: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: ./tools/check-utf8.sh diff --git a/tools/check-utf8.sh b/tools/check-utf8.sh new file mode 100755 index 000000000..e6253057f --- /dev/null +++ b/tools/check-utf8.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +invalid_found=0 + +# We would like to redirect iconv output to /dev/null, but the macOS version of +# iconv has problems with this ("iconv: iconv(): Inappropriate ioctl for +# device", sporadically for particular inputs). So use a regular file instead. +tmpfile=/tmp/check-utf8-temp +trap "rm -f $tmpfile" EXIT + +for file in $(git ls-files | grep -E '\.(cpp|h|txt)$'); do + if ! iconv -f UTF-8 "$file" >$tmpfile; then + echo "Not valid UTF-8: $file" >&2 + invalid_found=1 + fi +done + +[ $invalid_found = 0 ] && echo "All checked files are valid UTF-8" >&2 + +exit $invalid_found From c244f60a90a0617cc665a2c4f37b2548bf9f488b Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Wed, 19 Jun 2024 16:12:24 -0500 Subject: [PATCH 7/8] Use /utf-8 with MSVC build /utf-8 is equivalent to /source-charset:utf-8 /execution-charset:utf-8. Now that all source files (except for included third-party headers outside of this repository) are in UTF-8, we must set source-charset to utf-8, because otherwise the default (on our build machines) is CP-1252. (The compiler does not auto-detect UTF-8 source files unless they have a UTF-8 BOM, which we do not use.) The execution charset determines how (non-wide) string literals are encoded in the executable binary. UTF-8 is usully appropriate for our string constants (such as property names and values), because JNI and SWIG assume UTF-8 and C/C++ library functions work with UTF-8. Our only examples of non-ASCII characters in string literals (at least among the files recently converted to UTF-8) are 8-bit characters from iso-8859-1 (latin1) (there are one or two exceptions that are insignificant). These, if exposed to the CMMCore API (to Java or Python) were presumably working just because UTF-8 is a superset of iso-8859-1 (but not of CP-1252) -- they were stored in the binary as CP-1252 but treated by SWIG-generated code as UTF-8. (Use of non-ASCII characters in property names and other such strings is still not a very good idea, but we don't want to change names that will invalidate configuration files.) As far as I can tell, the conversion of source code to UTF-8 and the introduction of /utf-8 do not interact with the project Character Set setting (Unicode or Multi-byte), which only control whether the Win32 API functions default to the "A" or "W" version. Incidentally, use of /utf-8 also helps to prepare for the switch to Meson, which adds /utf-8 by default. --- buildscripts/VisualStudio/MMCommon.props | 1 + 1 file changed, 1 insertion(+) diff --git a/buildscripts/VisualStudio/MMCommon.props b/buildscripts/VisualStudio/MMCommon.props index 8c42b9a2a..84d81f9b3 100644 --- a/buildscripts/VisualStudio/MMCommon.props +++ b/buildscripts/VisualStudio/MMCommon.props @@ -27,6 +27,7 @@ Sync _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true + /utf-8 %(AdditionalOptions) true From 057499fdffbbe947f98170a2bbce60f1eb5f5aa8 Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Wed, 19 Jun 2024 17:02:41 -0500 Subject: [PATCH 8/8] Disable MSVC warning C4828 "The file contains a character starting at offset 0x____ that is illegal in the current source character set (____)." These are caused by included third-party headers that are not UTF-8. Hopefully their use of non-UTF-8 characters is limited to comments. --- buildscripts/VisualStudio/MMCommon.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildscripts/VisualStudio/MMCommon.props b/buildscripts/VisualStudio/MMCommon.props index 84d81f9b3..8cdc0883d 100644 --- a/buildscripts/VisualStudio/MMCommon.props +++ b/buildscripts/VisualStudio/MMCommon.props @@ -23,7 +23,7 @@ Level4 - 4127;4290;%(DisableSpecificWarnings) + 4127;4290;4828;%(DisableSpecificWarnings) Sync _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true