diff --git a/DeviceAdapters/ASITiger/ASIBase.h b/DeviceAdapters/ASITiger/ASIBase.h index 24c04fa84..ef336c2cf 100644 --- a/DeviceAdapters/ASITiger/ASIBase.h +++ b/DeviceAdapters/ASITiger/ASIBase.h @@ -22,8 +22,8 @@ // BASED ON: ASIStage.h // -#ifndef _ASIBase_H_ -#define _ASIBase_H_ +#ifndef ASIBASE_H +#define ASIBASE_H #include "MMDevice.h" #include "DeviceBase.h" @@ -125,4 +125,4 @@ class ASIBase : public TDeviceBase<UConcreteDevice> } }; -#endif // _ASIBase_H_ +#endif // ASIBASE_H diff --git a/DeviceAdapters/ASITiger/ASICRISP.h b/DeviceAdapters/ASITiger/ASICRISP.h index 3c57d17db..711fbfcb7 100644 --- a/DeviceAdapters/ASITiger/ASICRISP.h +++ b/DeviceAdapters/ASITiger/ASICRISP.h @@ -22,8 +22,8 @@ // BASED ON: ASIStage.h and others // -#ifndef _ASICRISP_H_ -#define _ASICRISP_H_ +#ifndef ASICRISP_H +#define ASICRISP_H #include "ASIPeripheralBase.h" #include "MMDevice.h" @@ -85,4 +85,4 @@ class CCRISP : public ASIPeripheralBase<CAutoFocusBase, CCRISP> int ForceSetFocusState(string focusState); }; -#endif // end _ASICRISP_H_ +#endif // ASICRISP_H diff --git a/DeviceAdapters/ASITiger/ASIClocked.h b/DeviceAdapters/ASITiger/ASIClocked.h index f40e913ae..909a484a0 100644 --- a/DeviceAdapters/ASITiger/ASIClocked.h +++ b/DeviceAdapters/ASITiger/ASIClocked.h @@ -22,15 +22,13 @@ // BASED ON: ASIStage.h and others // -#ifndef _ASIClocked_H_ -#define _ASIClocked_H_ +#ifndef ASICLOCKED_H +#define ASICLOCKED_H #include "ASIPeripheralBase.h" #include "MMDevice.h" #include "DeviceBase.h" -using namespace std; - class CClocked : public ASIPeripheralBase<CStateDeviceBase, CClocked> { public: @@ -93,4 +91,4 @@ class CPortSwitch : public CClocked int Initialize(); }; -#endif //_ASIClocked_H_ +#endif // ASICLOCKED_H diff --git a/DeviceAdapters/ASITiger/ASIDac.cpp b/DeviceAdapters/ASITiger/ASIDac.cpp index d6ffa1d0e..90e2b1b44 100644 --- a/DeviceAdapters/ASITiger/ASIDac.cpp +++ b/DeviceAdapters/ASITiger/ASIDac.cpp @@ -79,7 +79,7 @@ int CDAC::Initialize() // ASI's unit multiplier is how many units per volt, so divide by 1 here to get units per volt, divide by 1000 to get units in millivolts // except for GetSignal() and SetSignal() which deals in Volts, we will make all properties units millivolt command.str(""); - command << "UM " << axisLetter_ << "? "; + command << "UM " << axisLetter_ << "?"; RETURN_ON_MM_ERROR(hub_->QueryCommandVerify(command.str(), ":")); RETURN_ON_MM_ERROR(hub_->ParseAnswerAfterEquals(tmp)); unitMult_ = tmp / 1000; @@ -350,7 +350,7 @@ int CDAC::GetGateOpen(bool &open) { ostringstream command; long tmp; command.str(""); - command << "MC " << axisLetter_ << "? "; + command << "MC " << axisLetter_ << "?"; open = false;//incase of error we return that gate is closed // "MC <Axis>?" replies look like ":A 1" @@ -367,7 +367,7 @@ int CDAC::GetMaxVolts(double &volts) ostringstream command; command.str(""); - command << "SU " << axisLetter_ << "? "; + command << "SU " << axisLetter_ << "?"; RETURN_ON_MM_ERROR(hub_->QueryCommandVerify(command.str(), ":A")); RETURN_ON_MM_ERROR(hub_->ParseAnswerAfterEquals(volts)); return DEVICE_OK; @@ -378,7 +378,7 @@ int CDAC::GetMinVolts(double &volts) ostringstream command; command.str(""); - command << "SL " << axisLetter_ << "? "; + command << "SL " << axisLetter_ << "?"; RETURN_ON_MM_ERROR(hub_->QueryCommandVerify(command.str(), ":A")); RETURN_ON_MM_ERROR(hub_->ParseAnswerAfterEquals(volts)); return DEVICE_OK; diff --git a/DeviceAdapters/ASITiger/ASIDac.h b/DeviceAdapters/ASITiger/ASIDac.h index 1312f3e1d..5cbbc0031 100644 --- a/DeviceAdapters/ASITiger/ASIDac.h +++ b/DeviceAdapters/ASITiger/ASIDac.h @@ -22,14 +22,13 @@ // BASED ON: ASIStage.h and others // -#ifndef _ASIDAC_H_ -#define _ASIDAC_H_ +#ifndef ASIDAC_H +#define ASIDAC_H #include "ASIPeripheralBase.h" #include "MMDevice.h" #include "DeviceBase.h" - class CDAC : public ASIPeripheralBase<CSignalIOBase, CDAC> { public: @@ -95,7 +94,7 @@ class CDAC : public ASIPeripheralBase<CSignalIOBase, CDAC> private: double unitMult_; - string axisLetter_; + std::string axisLetter_; double maxvolts_; double minvolts_; bool ring_buffer_supported_; @@ -108,11 +107,6 @@ class CDAC : public ASIPeripheralBase<CSignalIOBase, CDAC> int GetMinVolts(double &volts); int SetSignalmv(double millivolts); int GetSignalmv(double& millivolts); - - - }; - - -#endif//_ASIDAC_H_ \ No newline at end of file +#endif // ASIDAC_H diff --git a/DeviceAdapters/ASITiger/ASIDacXYStage.h b/DeviceAdapters/ASITiger/ASIDacXYStage.h index 109ea86f5..a539f05bf 100644 --- a/DeviceAdapters/ASITiger/ASIDacXYStage.h +++ b/DeviceAdapters/ASITiger/ASIDacXYStage.h @@ -22,8 +22,8 @@ // BASED ON: ASIStage.cpp and others // -#ifndef _ASIDACXYStage_H_ -#define _ASIDACXYStage_H_ +#ifndef ASIDACXYSTAGE_H +#define ASIDACXYSTAGE_H #include "ASIPeripheralBase.h" #include "MMDevice.h" @@ -172,4 +172,4 @@ class CDACXYStage : public ASIPeripheralBase<CXYStageBase, CDACXYStage> int GetMinVolts(double& volts, std::string axisLetter); }; -#endif // _ASIDACXYStage_H_ +#endif // ASIDACXYSTAGE_H diff --git a/DeviceAdapters/ASITiger/ASIFWheel.h b/DeviceAdapters/ASITiger/ASIFWheel.h index c19fc2f88..5d01b29fe 100644 --- a/DeviceAdapters/ASITiger/ASIFWheel.h +++ b/DeviceAdapters/ASITiger/ASIFWheel.h @@ -22,15 +22,13 @@ // BASED ON: ASIStage.h and others // -#ifndef _ASIFWheel_H_ -#define _ASIFWheel_H_ +#ifndef ASIFWHEEL_H +#define ASIFWHEEL_H #include "ASIPeripheralBase.h" #include "MMDevice.h" #include "DeviceBase.h" -using namespace std; - class CFWheel : public ASIPeripheralBase<CStateDeviceBase, CFWheel> { public: @@ -62,12 +60,12 @@ class CFWheel : public ASIPeripheralBase<CStateDeviceBase, CFWheel> unsigned int numPositions_; unsigned int curPosition_; bool spinning_; - string wheelNumber_; - static string selectedWheel_; // which wheel is currently selected, shared among all instances of this class + std::string wheelNumber_; + static std::string selectedWheel_; // which wheel is currently selected, shared among all instances of this class int SelectWheelOverride(); int SelectWheel(); void ForcePropertyRefresh(); }; -#endif //_ASIFWheel_H_ +#endif // ASIFWHEEL_H diff --git a/DeviceAdapters/ASITiger/ASIHub.h b/DeviceAdapters/ASITiger/ASIHub.h index 40b755096..88b655a4f 100644 --- a/DeviceAdapters/ASITiger/ASIHub.h +++ b/DeviceAdapters/ASITiger/ASIHub.h @@ -22,8 +22,8 @@ // BASED ON: ASIStage.h // -#ifndef _ASIHub_H_ -#define _ASIHub_H_ +#ifndef ASIHUB_H +#define ASIHUB_H #include "ASIBase.h" #include "MMDevice.h" @@ -31,8 +31,6 @@ #include "DeviceThreads.h" #include <string> -using namespace std; - //////////////////////////////////////////////////////////////// // *********** generic ASI comm class ************************* // implements a "hub" device with communication abilities @@ -56,44 +54,44 @@ class ASIHub : public ASIBase<HubBase, ASIHub> int QueryCommandUnterminatedResponse(const char *command, const long timeoutMs, unsigned long reply_length); int QueryCommandUnterminatedResponse(const char *command, const long timeoutMs) { return QueryCommandUnterminatedResponse(command, timeoutMs,1); } - int QueryCommandUnterminatedResponse(const string command, const long timeoutMs) + int QueryCommandUnterminatedResponse(const std::string command, const long timeoutMs) { return QueryCommandUnterminatedResponse(command.c_str(), timeoutMs,1); } - int QueryCommandUnterminatedResponse(const string command, const long timeoutMs, unsigned long reply_length) + int QueryCommandUnterminatedResponse(const std::string command, const long timeoutMs, unsigned long reply_length) { return QueryCommandUnterminatedResponse(command.c_str(), timeoutMs, reply_length); } int QueryCommandLongReply(const char *command, const char *replyTerminator); // all variants call this int QueryCommandLongReply(const char *command) { return QueryCommandLongReply(command, g_SerialTerminatorMultiLine); } - int QueryCommandLongReply(const string &command) { return QueryCommandLongReply(command.c_str(), g_SerialTerminatorMultiLine); } + int QueryCommandLongReply(const std::string &command) { return QueryCommandLongReply(command.c_str(), g_SerialTerminatorMultiLine); } // QueryCommand gets the response (optional 2nd parameter is the response's termination string) (optional 3rd parameter is delay between sending and reading response) int QueryCommand(const char *command, const char *replyTerminator, const long delayMs); // all variants call this int QueryCommand(const char *command) { return QueryCommand(command, g_SerialTerminatorDefault, (long)0); } - int QueryCommand(const string &command) { return QueryCommand(command.c_str(), g_SerialTerminatorDefault, (long)0); } - int QueryCommand(const string &command, const string &replyTerminator) { return QueryCommand(command.c_str(), replyTerminator.c_str(), (long)0); } + int QueryCommand(const std::string &command) { return QueryCommand(command.c_str(), g_SerialTerminatorDefault, (long)0); } + int QueryCommand(const std::string &command, const std::string &replyTerminator) { return QueryCommand(command.c_str(), replyTerminator.c_str(), (long)0); } int QueryCommand(const char *command, const long delayMs) { return QueryCommand(command, g_SerialTerminatorDefault, delayMs); } - int QueryCommand(const string &command, const long delayMs) { return QueryCommand(command.c_str(), g_SerialTerminatorDefault, delayMs); } - int QueryCommand(const string &command, const string &replyTerminator, const long delayMs) { return QueryCommand(command.c_str(), replyTerminator.c_str(), delayMs); } + int QueryCommand(const std::string &command, const long delayMs) { return QueryCommand(command.c_str(), g_SerialTerminatorDefault, delayMs); } + int QueryCommand(const std::string &command, const std::string &replyTerminator, const long delayMs) { return QueryCommand(command.c_str(), replyTerminator.c_str(), delayMs); } // QueryCommandVerify gets the response and makes sure the first characters match expectedReplyPrefix int QueryCommandVerify(const char *command, const char *expectedReplyPrefix, const char *replyTerminator, const long delayMs); // all variants call this int QueryCommandVerify(const char *command, const char *expectedReplyPrefix) { return QueryCommandVerify(command, expectedReplyPrefix, g_SerialTerminatorDefault, (long)0); } - int QueryCommandVerify(const string &command, const string &expectedReplyPrefix) + int QueryCommandVerify(const std::string &command, const std::string &expectedReplyPrefix) { return QueryCommandVerify(command.c_str(), expectedReplyPrefix.c_str(), g_SerialTerminatorDefault, (long)0); } - int QueryCommandVerify(const string &command, const string &expectedReplyPrefix, const string &replyTerminator) + int QueryCommandVerify(const std::string &command, const std::string &expectedReplyPrefix, const std::string &replyTerminator) { return QueryCommandVerify(command.c_str(), expectedReplyPrefix.c_str(), replyTerminator.c_str(), (long)0); } int QueryCommandVerify(const char *command, const char *expectedReplyPrefix, const long delayMs) { return QueryCommandVerify(command, expectedReplyPrefix, g_SerialTerminatorDefault, delayMs); } - int QueryCommandVerify(const string &command, const string &expectedReplyPrefix, const long delayMs) + int QueryCommandVerify(const std::string &command, const std::string &expectedReplyPrefix, const long delayMs) { return QueryCommandVerify(command.c_str(), expectedReplyPrefix.c_str(), g_SerialTerminatorDefault, delayMs); } - int QueryCommandVerify(const string &command, const string &expectedReplyPrefix, const string &replyTerminator, const long delayMs) + int QueryCommandVerify(const std::string &command, const std::string &expectedReplyPrefix, const std::string &replyTerminator, const long delayMs) { return QueryCommandVerify(command.c_str(), expectedReplyPrefix.c_str(), replyTerminator.c_str(), delayMs); } // accessing serial commands and answers string LastSerialAnswer() const { return serialAnswer_; } // use with caution!; crashes to access something that doesn't exist! string LastSerialCommand() const { return serialCommand_; } char LastSerialAnswerChar() const { return serialAnswer_.back(); } - void SetLastSerialAnswer(string s) { serialAnswer_ = s; } // used to parse subsets of full answer for commands like PZINFO using "Split" functions + void SetLastSerialAnswer(std::string s) { serialAnswer_ = s; } // used to parse subsets of full answer for commands like PZINFO using "Split" functions // Interpreting serial response int ParseAnswerAfterEquals(double &val); // finds next number after equals sign and returns as float @@ -114,30 +112,30 @@ class ASIHub : public ASIBase<HubBase, ASIHub> int GetAnswerCharAtPosition(unsigned int pos, char &val); // returns the character at specified position, a safer version of LastSerialAnswer().at(pos) int GetAnswerCharAtPosition3(char &val); // returns the character at position 3, a safer version of LastSerialAnswer().at(3) - vector<string> SplitAnswerOnDelim(string delim) const; // splits answer on arbitrary delimeter list (any of included characters will split) - vector<string> SplitAnswerOnCR() const { return SplitAnswerOnDelim("\r"); } - vector<string> SplitAnswerOnSpace() const { return SplitAnswerOnDelim(" "); } + std::vector<std::string> SplitAnswerOnDelim(std::string delim) const; // splits answer on arbitrary delimeter list (any of included characters will split) + std::vector<std::string> SplitAnswerOnCR() const { return SplitAnswerOnDelim("\r"); } + std::vector<std::string> SplitAnswerOnSpace() const { return SplitAnswerOnDelim(" "); } // function to grab all the build info from BU X command - int GetBuildInfo(const string addressLetter, build_info_type &build); + int GetBuildInfo(const std::string addressLetter, build_info_type &build); // look to see if particular define is present - bool IsDefinePresent(const build_info_type build, const string defineToLookFor); + bool IsDefinePresent(const build_info_type build, const std::string defineToLookFor); // get define string from substring (e.g. the RING BUFFER define has the # of positions) - string GetDefineString(const build_info_type build, const string substringToLookFor); + std::string GetDefineString(const build_info_type build, const std::string substringToLookFor); - void RegisterPeripheral(const string deviceLabel, const string addressChar) { + void RegisterPeripheral(const std::string deviceLabel, const std::string addressChar) { deviceMap_[deviceLabel] = addressChar; // add device to lookup table } - void UnRegisterPeripheral(const string deviceLabel) { + void UnRegisterPeripheral(const std::string deviceLabel) { deviceMap_.erase(deviceLabel); // remove device from lookup table } bool UpdatingSharedProperties() { return updatingSharedProperties_; } - int UpdateSharedProperties(string addressChar, string propName, string value); + int UpdateSharedProperties(std::string addressChar, std::string propName, std::string value); // action/property handlers int OnPort (MM::PropertyBase* pProp, MM::ActionType eAct); @@ -149,29 +147,28 @@ class ASIHub : public ASIBase<HubBase, ASIHub> int OnSerialCommandOnlySendChanged(MM::PropertyBase* pProp, MM::ActionType eAct); protected: - string port_; // port to use for communication + std::string port_; // port to use for communication private: int ParseErrorReply() const; - static string EscapeControlCharacters(const string v); - static string UnescapeControlCharacters(const string v0 ); - static vector<char> ConvertStringVector2CharVector(const vector<string> v); - static vector<int> ConvertStringVector2IntVector(const vector<string> v); - - string serialAnswer_; // the last answer received from any communication with the controller - string manualSerialAnswer_; // last answer received when the SerialCommand property was used - string serialCommand_; // the last command sent, or can be set for calling commands without args - string serialTerminator_; // only used when parsing command sent via OnSerialCommand action handler + static std::string EscapeControlCharacters(const std::string v); + static std::string UnescapeControlCharacters(const std::string v0); + static std::vector<char> ConvertStringVector2CharVector(const std::vector<std::string> v); + static std::vector<int> ConvertStringVector2IntVector(const std::vector<std::string> v); + + std::string serialAnswer_; // the last answer received from any communication with the controller + std::string manualSerialAnswer_; // last answer received when the SerialCommand property was used + std::string serialCommand_; // the last command sent, or can be set for calling commands without args + std::string serialTerminator_; // only used when parsing command sent via OnSerialCommand action handler long serialRepeatDuration_; // for how long total time the command is repeatedly sent long serialRepeatPeriod_; // how often in ms the command is sent bool serialOnlySendChanged_; // if true the serial command is only sent when it has changed MMThreadLock threadLock_; // used to lock thread during serial transaction bool updatingSharedProperties_; - map<string, string> deviceMap_; // to implement properties shared between devices - // key is the device name, value is the Tiger address (normally a single character, see note about addressChar_ in ASIPeripheralBase) - + std::map<std::string, std::string> deviceMap_; // to implement properties shared between devices + // key is the device name, value is the Tiger address (normally a single character, see note about addressChar_ in ASIPeripheralBase }; -#endif //_ASIHub_H_ +#endif // ASIHUB_H diff --git a/DeviceAdapters/ASITiger/ASILED.h b/DeviceAdapters/ASITiger/ASILED.h index 1a0c99572..aeeddf899 100644 --- a/DeviceAdapters/ASITiger/ASILED.h +++ b/DeviceAdapters/ASITiger/ASILED.h @@ -22,8 +22,8 @@ // BASED ON: ASIStage.h and others // -#ifndef _ASILED_H_ -#define _ASILED_H_ +#ifndef ASILED_H +#define ASILED_H #include "ASIPeripheralBase.h" #include "MMDevice.h" @@ -36,18 +36,15 @@ class CLED : public ASIPeripheralBase<CShutterBase, CLED> ~CLED() { } // Device API - // ---------- int Initialize(); bool Busy() { return false; } // Shutter API - // ----------- int SetOpen(bool open = true); int GetOpen(bool& open); int Fire(double /*deltaT*/) { return DEVICE_UNSUPPORTED_COMMAND; } // action interface - // ---------------- int OnSaveCardSettings (MM::PropertyBase* pProp, MM::ActionType eAct); int OnRefreshProperties (MM::PropertyBase* pProp, MM::ActionType eAct); int OnIntensity (MM::PropertyBase* pProp, MM::ActionType eAct); @@ -63,4 +60,4 @@ class CLED : public ASIPeripheralBase<CShutterBase, CLED> int UpdateOpenIntensity(); }; -#endif //_ASILED_H_ +#endif // ASILED_H diff --git a/DeviceAdapters/ASITiger/ASILens.cpp b/DeviceAdapters/ASITiger/ASILens.cpp index 364abb82c..690bb1fab 100644 --- a/DeviceAdapters/ASITiger/ASILens.cpp +++ b/DeviceAdapters/ASITiger/ASILens.cpp @@ -71,7 +71,7 @@ int CLens::Initialize() ostringstream command; command.str(""); double tmp; - command << "UM " << axisLetter_ << "? "; + command << "UM " << axisLetter_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); unitMult_ = tmp/1000; @@ -388,13 +388,13 @@ int CLens::GetLimits(double& min, double& max) { // ASI limits are always returned in terms of mm, independent of unit multiplier ostringstream command; command.str(""); - command << "SL " << axisLetter_ << "? "; + command << "SL " << axisLetter_ << "?"; double tmp; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":A") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); min = tmp*1000; command.str(""); - command << "SU " << axisLetter_ << "? "; + command << "SU " << axisLetter_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":A") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); max = tmp*1000; @@ -970,7 +970,6 @@ int CLens::OnWheelMirror(MM::PropertyBase* pProp, MM::ActionType eAct) int CLens::OnAxisPolarity(MM::PropertyBase* pProp, MM::ActionType eAct) { - ostringstream command; command.str(""); if (eAct == MM::BeforeGet) { // do nothing diff --git a/DeviceAdapters/ASITiger/ASILens.h b/DeviceAdapters/ASITiger/ASILens.h index 87f44d460..f2a8faec1 100644 --- a/DeviceAdapters/ASITiger/ASILens.h +++ b/DeviceAdapters/ASITiger/ASILens.h @@ -24,8 +24,8 @@ // BASED ON: ASIStage.h and others // -#ifndef _ASILens_H_ -#define _ASILens_H_ +#ifndef ASILENS_H +#define ASILENS_H #include "ASIPeripheralBase.h" #include "MMDevice.h" @@ -38,12 +38,10 @@ class CLens : public ASIPeripheralBase<CStageBase, CLens> ~CLens() { } // Device API - // ---------- int Initialize(); bool Busy(); // Lens API - // ----------- int Stop(); int Home(); @@ -71,7 +69,6 @@ class CLens : public ASIPeripheralBase<CStageBase, CLens> int SendStageSequence(); // action interface - // ---------------- int OnSaveCardSettings (MM::PropertyBase* pProp, MM::ActionType eAct); int OnRefreshProperties (MM::PropertyBase* pProp, MM::ActionType eAct); int OnLowerLim (MM::PropertyBase* pProp, MM::ActionType eAct); @@ -104,7 +101,7 @@ class CLens : public ASIPeripheralBase<CStageBase, CLens> int OnRBTrigger (MM::PropertyBase* pProp, MM::ActionType eAct); int OnRBRunning (MM::PropertyBase* pProp, MM::ActionType eAct); int OnUseSequence (MM::PropertyBase* pProp, MM::ActionType eAct); - //Others + // others int OnVector (MM::PropertyBase* pProp, MM::ActionType eAct); int OnTTLin (MM::PropertyBase* pProp, MM::ActionType eAct); int OnTTLout (MM::PropertyBase* pProp, MM::ActionType eAct); @@ -112,7 +109,7 @@ class CLens : public ASIPeripheralBase<CStageBase, CLens> private: double unitMult_; double stepSizeUm_; - string axisLetter_; + std::string axisLetter_; bool ring_buffer_supported_; long ring_buffer_capacity_; bool ttl_trigger_supported_; @@ -123,4 +120,4 @@ class CLens : public ASIPeripheralBase<CStageBase, CLens> int OnSaveJoystickSettings(); }; -#endif //_ASIPiezo_H_ +#endif // ASILENS_H diff --git a/DeviceAdapters/ASITiger/ASIPLogic.cpp b/DeviceAdapters/ASITiger/ASIPLogic.cpp index d8d761a49..47fc05ac8 100644 --- a/DeviceAdapters/ASITiger/ASIPLogic.cpp +++ b/DeviceAdapters/ASITiger/ASIPLogic.cpp @@ -239,6 +239,9 @@ int CPLogic::Initialize() AddAllowedValue(g_SetCardPresetPropertyName, g_PresetCode58, 58); AddAllowedValue(g_SetCardPresetPropertyName, g_PresetCode59, 59); } + if (FirmwareVersionAtLeast(3.51)) { + AddAllowedValue(g_SetCardPresetPropertyName, g_PresetCode60, 60); + } UpdateProperty(g_SetCardPresetPropertyName); @@ -290,6 +293,9 @@ int CPLogic::Initialize() AddAllowedValue(g_EditCellTypePropertyName, g_CellTypeCode16, 16); AddAllowedValue(g_EditCellTypePropertyName, g_CellTypeCode17, 17); } + if (FirmwareVersionAtLeast(3.51)) { + AddAllowedValue(g_EditCellTypePropertyName, g_CellTypeCode18, 18); + } AddAllowedValue(g_EditCellTypePropertyName, g_IOTypeCode0, 100); AddAllowedValue(g_EditCellTypePropertyName, g_IOTypeCode1, 101); AddAllowedValue(g_EditCellTypePropertyName, g_IOTypeCode2, 102); @@ -1009,6 +1015,7 @@ int CPLogic::OnCellType(MM::PropertyBase* pProp, MM::ActionType eAct, long index case 15:success = pProp->Set(g_CellTypeCode15); break; case 16:success = pProp->Set(g_CellTypeCode16); break; case 17:success = pProp->Set(g_CellTypeCode17); break; + case 18:success = pProp->Set(g_CellTypeCode18); break; default: break; } } diff --git a/DeviceAdapters/ASITiger/ASIPeripheralBase.h b/DeviceAdapters/ASITiger/ASIPeripheralBase.h index 784686c05..5f9b9957d 100644 --- a/DeviceAdapters/ASITiger/ASIPeripheralBase.h +++ b/DeviceAdapters/ASITiger/ASIPeripheralBase.h @@ -22,8 +22,8 @@ // BASED ON: ASIStage.h // -#ifndef _ASIPeripheralBase_H_ -#define _ASIPeripheralBase_H_ +#ifndef ASIPERIPHERALBASE_H +#define ASIPERIPHERALBASE_H #include "ASITiger.h" #include "ASIBase.h" @@ -63,7 +63,7 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> // NB: can be called even if the device was never fully initialized char deviceLabel[MM::MaxStrLength]; this->GetLabel(deviceLabel); - string str(deviceLabel); + std::string str(deviceLabel); if (hub_) { hub_->UnRegisterPeripheral(str); } @@ -74,7 +74,7 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> // Note that initialize_ is set by the concrete child class. int PeripheralInitialize(bool skipFirmware = false) { - ostringstream command; command.str(""); + std::ostringstream command; command.str(""); // get the hub information MM::Hub* genericHub = this->GetParentHub(); @@ -116,7 +116,7 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> // register peripheral with the hub, get label in c-string and convert to c++ string char deviceLabel[MM::MaxStrLength]; this->GetLabel(deviceLabel); - string str(deviceLabel); + std::string str(deviceLabel); hub_->RegisterPeripheral(str, addressChar_); // I can't seem to define action handlers here that will apply to derived classes @@ -137,23 +137,23 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> protected: ASIHub *hub_; // pointer to hub object used for serial communication - string addressString_; // address within hub, in hex format, should be two characters (e.g. '31') - string addressChar_; // address within hub, in single character (allowed to be extended ASCII so use string to store) + std::string addressString_; // address within hub, in hex format, should be two characters (e.g. '31') + std::string addressChar_; // address within hub, in single character (allowed to be extended ASCII so use string to store) bool refreshProps_; // true when property values should be read anew from controller each time bool refreshOverride_; // true when device wants to manually force refreshes temporarily // related to creating "extended" names containing address and axis letters static bool IsExtendedName(const char* name) { - vector<string> vName; + std::vector<std::string> vName; CDeviceUtils::Tokenize(name, vName, ":"); return (vName.size() > 2); } // returns single-character string - static string GetAxisLetterFromExtName(const char* name, int position = 0) + static std::string GetAxisLetterFromExtName(const char* name, int position = 0) { - vector<string> vName; + std::vector<std::string> vName; CDeviceUtils::Tokenize(name, vName, ":"); if (vName.size() > 1) return (vName[1].substr(position,1)); @@ -161,9 +161,9 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> return g_EmptyAxisLetterStr; } - static string GetHexAddrFromExtName(const char* name) + static std::string GetHexAddrFromExtName(const char* name) { - vector<string> vName; + std::vector<std::string> vName; CDeviceUtils::Tokenize(name, vName, ":"); if (vName.size() > 2) return (vName[2]); @@ -173,7 +173,7 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> static int GetChannelFromExtName(const char* name) { - vector<string> vName; + std::vector<std::string> vName; CDeviceUtils::Tokenize(name, vName, ":"); if (vName.size() > 3) return atoi(vName[3].c_str()); @@ -201,13 +201,13 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> // does the dirty work of converting a two-character hex (e.g. F5) into the single character // only works for valid TG-1000 addresses // see ConvertToTigerRawAddress comments for more details - static string ConvertTwoCharStringToHexChar(const string &s) + static std::string ConvertTwoCharStringToHexChar(const string &s) { if (s.size() != 2) return g_EmptyCardAddressCode; unsigned int code; - stringstream ss; + std::stringstream ss; ss << hex << s; ss >> code; if ((code >= 0x31 && code <= 0x39) || (code >= 0x81 && code <= 0xF5)) @@ -215,7 +215,7 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> ss.str(""); ss.clear(); // clears hex flag ss << (char) code; - string s2; + std::string s2; ss >> s2; return s2; } @@ -223,7 +223,7 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> return g_EmptyCardAddressCode; } - static string ConvertToTigerRawAddress(const string &s) + static std::string ConvertToTigerRawAddress(const std::string &s) { // Tiger addresses are 0x31 to 0x39 and then 0x81 to 0xF5 (i.e. '1' to '9' and then extended ASCII) // these addresses are prepended (in extended ASCII char) to serial commands that are addressed @@ -236,7 +236,7 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> if ((s.size() == 0) || (s.size() % 2)) return g_EmptyCardAddressCode; - string s2 = ""; + std::string s2 = ""; for(std::string::size_type iii = 0; iii < s.size()/2; ++iii) { // operate on chunks of two characters @@ -248,4 +248,4 @@ class ASIPeripheralBase : public ASIBase<TDeviceBase, UConcreteDevice> }; -#endif // _ASIPeripheralBase_H_ +#endif // ASIPERIPHERALBASE_H diff --git a/DeviceAdapters/ASITiger/ASIPiezo.cpp b/DeviceAdapters/ASITiger/ASIPiezo.cpp index e62a6298d..a282d619d 100644 --- a/DeviceAdapters/ASITiger/ASIPiezo.cpp +++ b/DeviceAdapters/ASITiger/ASIPiezo.cpp @@ -74,7 +74,7 @@ int CPiezo::Initialize() ostringstream command; command.str(""); double tmp; - command << "UM " << axisLetter_ << "? "; + command << "UM " << axisLetter_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); unitMult_ = tmp/1000; @@ -473,13 +473,13 @@ int CPiezo::GetLimits(double& min, double& max) { // ASI limits are always returned in terms of mm, independent of unit multiplier ostringstream command; command.str(""); - command << "SL " << axisLetter_ << "? "; + command << "SL " << axisLetter_ << "?"; double tmp; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":A") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); min = tmp*1000; command.str(""); - command << "SU " << axisLetter_ << "? "; + command << "SU " << axisLetter_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":A") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); max = tmp*1000; @@ -1059,7 +1059,6 @@ int CPiezo::OnWheelMirror(MM::PropertyBase* pProp, MM::ActionType eAct) int CPiezo::OnAxisPolarity(MM::PropertyBase* pProp, MM::ActionType eAct) { - ostringstream command; command.str(""); if (eAct == MM::BeforeGet) { // do nothing diff --git a/DeviceAdapters/ASITiger/ASIPiezo.h b/DeviceAdapters/ASITiger/ASIPiezo.h index d1d9e14eb..0ee4cdb74 100644 --- a/DeviceAdapters/ASITiger/ASIPiezo.h +++ b/DeviceAdapters/ASITiger/ASIPiezo.h @@ -22,8 +22,8 @@ // BASED ON: ASIStage.h and others // -#ifndef _ASIPiezo_H_ -#define _ASIPiezo_H_ +#ifndef ASIPIEZO_H +#define ASIPIEZO_H #include "ASIPeripheralBase.h" #include "MMDevice.h" @@ -119,7 +119,7 @@ class CPiezo : public ASIPeripheralBase<CStageBase, CPiezo> private: double unitMult_; double stepSizeUm_; - string axisLetter_; + std::string axisLetter_; bool ring_buffer_supported_; long ring_buffer_capacity_; bool ttl_trigger_supported_; @@ -131,4 +131,4 @@ class CPiezo : public ASIPeripheralBase<CStageBase, CPiezo> int OnSaveJoystickSettings(); }; -#endif //_ASIPiezo_H_ +#endif // ASIPIEZO_H diff --git a/DeviceAdapters/ASITiger/ASIPmt.cpp b/DeviceAdapters/ASITiger/ASIPmt.cpp index da64c7e8e..aa765d10f 100644 --- a/DeviceAdapters/ASITiger/ASIPmt.cpp +++ b/DeviceAdapters/ASITiger/ASIPmt.cpp @@ -58,6 +58,9 @@ CPMT::CPMT(const char* name) : //Pick AxisChar to use. switch(channel_) { + case 1: + channelAxisChar_='X'; + break; case 2: channelAxisChar_='Y'; break; @@ -73,7 +76,6 @@ CPMT::CPMT(const char* name) : case 6: channelAxisChar_='R'; break; - case 1: default: channelAxisChar_='X'; break; @@ -148,7 +150,7 @@ int CPMT::SetGateOpen(bool open) { ostringstream command; command.str(""); if (open) - command << addressChar_ << "LOCK " << channelAxisChar_ ; + command << addressChar_ << "LK " << channelAxisChar_ ; else { // can't do opposite the reset @@ -162,7 +164,7 @@ int CPMT::GetGateOpen(bool& open) { unsigned int val; ostringstream command; command.str(""); - command << addressChar_ << "LOCK " << channelAxisChar_ << "?" ; + command << addressChar_ << "LK " << channelAxisChar_ << "?" ; // reply is 0 or 1 , 0 is overloaded , 1 is enabled RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(), ":A") ); RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterPosition2(val) ); @@ -175,7 +177,7 @@ int CPMT::GetSignal(double& volts) { unsigned int val; ostringstream command; command.str(""); - command << addressChar_ << "RDADC " << channelAxisChar_ << "?" ; + command << addressChar_ << "RA " << channelAxisChar_ << "?" ; // reply is 0 or 1 , 0 is overloaded , 1 is enabled RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(), ":A") ); RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterPosition2(val) ); @@ -254,7 +256,7 @@ int CPMT::OnOverloadReset(MM::PropertyBase* pProp, MM::ActionType eAct) else if (tmpstr.compare(g_PMTOverloadDone) == 0) return DEVICE_OK; else if (tmpstr.compare(g_OnState) == 0) - command << addressChar_ << "LOCK " << channelAxisChar_ ; + command << addressChar_ << "LK " << channelAxisChar_ ; RETURN_ON_MM_ERROR( hub_->QueryCommandVerify(command.str(), ":A", (long)200) ); // note 200ms delay added pProp->Set(g_PMTOverloadDone); } @@ -326,7 +328,7 @@ int CPMT::OnPMTSignal(MM::PropertyBase* pProp, MM::ActionType eAct) if (eAct == MM::BeforeGet || eAct == MM::AfterSet) { // always read - command << addressChar_ << "RDADC " << channelAxisChar_ << "?" ; + command << addressChar_ << "RA " << channelAxisChar_ << "?" ; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(), ":A") ); RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterPosition2(val) ); if (!pProp->Set((long)val)) @@ -342,7 +344,7 @@ int CPMT::OnPMTOverload(MM::PropertyBase* pProp, MM::ActionType eAct) if (eAct == MM::BeforeGet || eAct == MM::AfterSet) { // always read - command << addressChar_ << "LOCK " << channelAxisChar_ << "?" ; + command << addressChar_ << "LK " << channelAxisChar_ << "?" ; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(), ":A") ); RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterPosition2(val) ); if(val) diff --git a/DeviceAdapters/ASITiger/ASIPmt.h b/DeviceAdapters/ASITiger/ASIPmt.h index 59b68d9ba..140dabf51 100644 --- a/DeviceAdapters/ASITiger/ASIPmt.h +++ b/DeviceAdapters/ASITiger/ASIPmt.h @@ -22,14 +22,13 @@ // BASED ON: ASIStage.h and others // -#ifndef _ASIPMT_H_ -#define _ASIPMT_H_ +#ifndef ASIPMT_H +#define ASIPMT_H #include "ASIPeripheralBase.h" #include "MMDevice.h" #include "DeviceBase.h" - class CPMT : public ASIPeripheralBase<CSignalIOBase, CPMT> { public: @@ -63,11 +62,11 @@ class CPMT : public ASIPeripheralBase<CSignalIOBase, CPMT> private: int channel_; char channelAxisChar_; - string axisLetter_; + std::string axisLetter_; int gain_; int avg_length_; int UpdateGain(); int UpdateAvg(); }; -#endif //_ASIPMT_H_ +#endif // ASIPMT_H diff --git a/DeviceAdapters/ASITiger/ASIScanner.cpp b/DeviceAdapters/ASITiger/ASIScanner.cpp index 300c35ae9..36ea9d514 100644 --- a/DeviceAdapters/ASITiger/ASIScanner.cpp +++ b/DeviceAdapters/ASITiger/ASIScanner.cpp @@ -98,19 +98,19 @@ int CScanner::Initialize() // read the unit multiplier for X and Y axes // ASI's unit multiplier is how many units per degree rotation for the micromirror card ostringstream command; - command.str(""); command << "UM " << axisLetterX_ << "? "; + command.str(""); command << "UM " << axisLetterX_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":") ); RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterEquals(unitMultX_) ); - command.str(""); command << "UM " << axisLetterY_ << "? "; + command.str(""); command << "UM " << axisLetterY_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":") ); RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterEquals(unitMultY_) ); // read the home position (used for beam shuttering) - command.str(""); command << "HM " << axisLetterX_ << "? "; + command.str(""); command << "HM " << axisLetterX_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":") ); RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterEquals(shutterX_) ); // already in units of degrees - command.str(""); command << "HM " << axisLetterY_ << "? "; + command.str(""); command << "HM " << axisLetterY_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":") ); RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterEquals(shutterY_) ); // already in units of degrees @@ -2748,8 +2748,6 @@ int CScanner::OnWheelMirror(MM::PropertyBase* pProp, MM::ActionType eAct) int CScanner::OnAxisPolarityX(MM::PropertyBase* pProp, MM::ActionType eAct) { - ostringstream command; command.str(""); - ostringstream response; response.str(""); if (eAct == MM::BeforeGet) { // do nothing @@ -2768,8 +2766,6 @@ int CScanner::OnAxisPolarityX(MM::PropertyBase* pProp, MM::ActionType eAct) int CScanner::OnAxisPolarityY(MM::PropertyBase* pProp, MM::ActionType eAct) { - ostringstream command; command.str(""); - ostringstream response; response.str(""); if (eAct == MM::BeforeGet) { // do nothing diff --git a/DeviceAdapters/ASITiger/ASIScanner.h b/DeviceAdapters/ASITiger/ASIScanner.h index 1e1ce7db8..7ccb35bb3 100644 --- a/DeviceAdapters/ASITiger/ASIScanner.h +++ b/DeviceAdapters/ASITiger/ASIScanner.h @@ -22,8 +22,8 @@ // BASED ON: MicroPoint.h and others // -#ifndef _ASIScanner_H_ -#define _ASIScanner_H_ +#ifndef ASISCANNER_H +#define ASISCANNER_H #include "ASIPeripheralBase.h" #include "MMDevice.h" @@ -36,12 +36,10 @@ class CScanner : public ASIPeripheralBase<CGalvoBase, CScanner> ~CScanner() { } // Device API - // ---------- int Initialize(); bool Busy(); // Galvo API - // ----------- int SetPosition(double x, double y); int GetPosition(double& x, double& y); double GetXRange() { return (upperLimitX_ - lowerLimitX_); } // this is only positive limit, on power-up limits are +/- this value @@ -65,7 +63,6 @@ class CScanner : public ASIPeripheralBase<CGalvoBase, CScanner> void UpdateIlluminationState(); // action interface - // ---------------- int OnSaveCardSettings (MM::PropertyBase* pProp, MM::ActionType eAct); int OnRefreshProperties (MM::PropertyBase* pProp, MM::ActionType eAct); int OnLowerLimX (MM::PropertyBase* pProp, MM::ActionType eAct); @@ -151,15 +148,13 @@ class CScanner : public ASIPeripheralBase<CGalvoBase, CScanner> int OnFastCirclesAsymmetry(MM::PropertyBase* pProp, MM::ActionType eAct); int OnFastCirclesState (MM::PropertyBase* pProp, MM::ActionType eAct); // vector properties - int OnVectorGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnVectorGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnVectorX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnVectorGeneric(pProp, eAct, axisLetterX_); } int OnVectorY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnVectorGeneric(pProp, eAct, axisLetterY_); } - - private: - string axisLetterX_; - string axisLetterY_; + std::string axisLetterX_; + std::string axisLetterY_; double unitMultX_; // units per degree double unitMultY_; // units per degree double upperLimitX_; // positive limit only (on power-up things are symmetric about 0) @@ -188,7 +183,7 @@ class CScanner : public ASIPeripheralBase<CGalvoBase, CScanner> saStateType saStateY_; // for polygons - vector< pair<double,double> > polygons_; + std::vector<std::pair<double,double> > polygons_; long polygonRepetitions_; bool ring_buffer_supported_; @@ -204,4 +199,4 @@ class CScanner : public ASIPeripheralBase<CGalvoBase, CScanner> int OnSaveJoystickSettings(); }; -#endif //_ASIScanner_H_ +#endif // ASISCANNER_H diff --git a/DeviceAdapters/ASITiger/ASITiger.h b/DeviceAdapters/ASITiger/ASITiger.h index c466a8519..2fcce1d32 100644 --- a/DeviceAdapters/ASITiger/ASITiger.h +++ b/DeviceAdapters/ASITiger/ASITiger.h @@ -24,8 +24,8 @@ // BASED ON: ASIStage.h, ASIFW1000.h, Arduino.h, and DemoCamera.h // -#ifndef _ASITiger_H_ -#define _ASITiger_H_ +#ifndef ASITIGER_H +#define ASITIGER_H #include <string> #include <vector> @@ -155,10 +155,10 @@ const char* const g_SerialTerminatorFW = "\n\r"; const char* const g_SerialTerminatorLine = "\r"; const char* const g_SerialTerminatorOverall = "\n"; const char* const g_SerialTerminatorMultiLine = "\r"; -const string g_EmptyAxisLetterStr = " "; // single char but like convenience of strings -const string g_EmptyCardAddressCode = " "; // ascii 0x31 for '1' through ascii 0x39 for '9', then 0x81 upward (extended ascii) -const string g_EmptyCardAddressStr = "00"; // hex representation of the address, eg 31..39, 81 upward -const string g_EmptyCardAddressChar = ""; // Tiger address character (stored as string) +const std::string g_EmptyAxisLetterStr = " "; // single char but like convenience of strings +const std::string g_EmptyCardAddressCode = " "; // ascii 0x31 for '1' through ascii 0x39 for '9', then 0x81 upward (extended ascii) +const std::string g_EmptyCardAddressStr = "00"; // hex representation of the address, eg 31..39, 81 upward +const std::string g_EmptyCardAddressChar = ""; // Tiger address character (stored as string) const char g_NameInfoDelimiter = ':'; // general device property names @@ -480,6 +480,7 @@ const char* const g_CellTypeCode14 = "14 - one shot (NRT)"; const char* const g_CellTypeCode15 = "15 - delay (NRT)"; const char* const g_CellTypeCode16 = "16 - one shot OR2 (NRT)"; const char* const g_CellTypeCode17 = "17 - delay OR2 (NRT)"; +const char* const g_CellTypeCode18 = "18 - D flop (sync/async)"; const char* const g_IOTypeCode0 = "0 - input"; const char* const g_IOTypeCode1 = "1 - output (open-drain)"; const char* const g_IOTypeCode2 = "2 - output (push-pull)"; @@ -550,6 +551,7 @@ const char* const g_PresetCode56 = "56 - BNC2/5 enabled of 7"; const char* const g_PresetCode57 = "57 - BNC3/6 enabled of 7"; const char* const g_PresetCode58 = "58 - BNC1/5 enabled of 7"; const char* const g_PresetCode59 = "59 - BNC2/6 enabled of 7"; +const char* const g_PresetCode60 = "60 - mod3 counter"; const char* const g_PLogicModeNone = "None"; const char* const g_PLogicModediSPIMShutter = "diSPIM Shutter"; const char* const g_PLogicMode4ChShutter = "Four-channel shutter"; @@ -778,18 +780,17 @@ const char* const g_DACMicronsPerMvYPropertyName = "MicronsPerMillivoltY"; // pr struct build_info_type { - string buildname; + std::string buildname; unsigned char numAxes; - vector<char> vAxesLetter; - vector<char> vAxesType; - vector<string> vAxesAddr; // string to handle unprintable characters - vector<string> vAxesAddrHex; // string for simplicity, logically it should be int though - vector<int> vAxesProps; - vector<string> defines; + std::vector<char> vAxesLetter; + std::vector<char> vAxesType; + std::vector<std::string> vAxesAddr; // string to handle unprintable characters + std::vector<std::string> vAxesAddrHex; // string for simplicity, logically it should be int though + std::vector<int> vAxesProps; + std::vector<std::string> defines; }; // define names const char* const g_Define_SINGLEAXIS_FUNCTION = "SINGLEAXIS_FUNCTION"; - -#endif //_ASITiger_H_ +#endif // ASITIGER_H diff --git a/DeviceAdapters/ASITiger/ASITigerComm.h b/DeviceAdapters/ASITiger/ASITigerComm.h index 779ea73ff..264d98d89 100644 --- a/DeviceAdapters/ASITiger/ASITigerComm.h +++ b/DeviceAdapters/ASITiger/ASITigerComm.h @@ -22,8 +22,8 @@ // BASED ON: ASIStage.h, ASIFW1000.h, Arduino.h, and DemoCamera.h // -#ifndef _ASITigerComm_H_ -#define _ASITigerComm_H_ +#ifndef ASITIGERCOMM_H +#define ASITIGERCOMM_H #include "ASIHub.h" #include "MMDevice.h" @@ -63,6 +63,4 @@ class CTigerCommHub : public ASIHub int TalkToTiger(); }; - - -#endif //_ASITigerComm_H_ +#endif // ASITIGERCOMM_H diff --git a/DeviceAdapters/ASITiger/ASIXYStage.cpp b/DeviceAdapters/ASITiger/ASIXYStage.cpp index 37d53360c..5b3375e98 100644 --- a/DeviceAdapters/ASITiger/ASIXYStage.cpp +++ b/DeviceAdapters/ASITiger/ASIXYStage.cpp @@ -81,12 +81,12 @@ int CXYStage::Initialize() ostringstream command; command.str(""); double tmp; - command << "UM " << axisLetterX_ << "? "; + command << "UM " << axisLetterX_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); unitMultX_ = tmp/1000; command.str(""); - command << "UM " << axisLetterY_ << "? "; + command << "UM " << axisLetterY_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); unitMultY_ = tmp/1000; @@ -563,23 +563,23 @@ int CXYStage::GetStepLimits(long& xMin, long& xMax, long& yMin, long& yMax) { // limits are always represented in terms of mm, independent of unit multiplier ostringstream command; command.str(""); - command << "SL " << axisLetterX_ << "? "; + command << "SL " << axisLetterX_ << "?"; double tmp; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":A") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); xMin = (long) (tmp*1000/stepSizeXUm_); command.str(""); - command << "SU " << axisLetterX_ << "? "; + command << "SU " << axisLetterX_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":A") ); RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterEquals(tmp) ); xMax = (long) (tmp*1000/stepSizeXUm_); command.str(""); - command << "SL " << axisLetterY_ << "? "; + command << "SL " << axisLetterY_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":A") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); yMin = (long) (tmp*1000/stepSizeYUm_); command.str(""); - command << "SU " << axisLetterY_ << "? "; + command << "SU " << axisLetterY_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":A") ); RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterEquals(tmp) ); yMax = (long) (tmp*1000/stepSizeYUm_); @@ -1751,8 +1751,6 @@ int CXYStage::OnNrExtraMoveReps(MM::PropertyBase* pProp, MM::ActionType eAct) int CXYStage::OnAxisPolarityX(MM::PropertyBase* pProp, MM::ActionType eAct) { - ostringstream command; command.str(""); - ostringstream response; response.str(""); if (eAct == MM::BeforeGet) { // do nothing @@ -1771,8 +1769,6 @@ int CXYStage::OnAxisPolarityX(MM::PropertyBase* pProp, MM::ActionType eAct) int CXYStage::OnAxisPolarityY(MM::PropertyBase* pProp, MM::ActionType eAct) { - ostringstream command; command.str(""); - ostringstream response; response.str(""); if (eAct == MM::BeforeGet) { // do nothing diff --git a/DeviceAdapters/ASITiger/ASIXYStage.h b/DeviceAdapters/ASITiger/ASIXYStage.h index 8cfa35aee..c851d0084 100644 --- a/DeviceAdapters/ASITiger/ASIXYStage.h +++ b/DeviceAdapters/ASITiger/ASIXYStage.h @@ -22,8 +22,8 @@ // BASED ON: ASIStage.h and others // -#ifndef _ASIXYStage_H_ -#define _ASIXYStage_H_ +#ifndef ASIXYSTAGE_H +#define ASIXYSTAGE_H #include "ASIPeripheralBase.h" #include "MMDevice.h" @@ -85,30 +85,30 @@ class CXYStage : public ASIPeripheralBase<CXYStageBase, CXYStage> int OnRefreshProperties (MM::PropertyBase* pProp, MM::ActionType eAct); int OnWaitTime (MM::PropertyBase* pProp, MM::ActionType eAct); int OnNrExtraMoveReps (MM::PropertyBase* pProp, MM::ActionType eAct); - int OnSpeedGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnSpeedGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnSpeedXMicronsPerSec (MM::PropertyBase* pProp, MM::ActionType eAct); int OnSpeedYMicronsPerSec (MM::PropertyBase* pProp, MM::ActionType eAct); int OnSpeedX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnSpeedGeneric(pProp, eAct, axisLetterX_); } int OnSpeedY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnSpeedGeneric(pProp, eAct, axisLetterY_); } - int OnBacklashGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnBacklashGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnBacklashX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnBacklashGeneric(pProp, eAct, axisLetterX_); } int OnBacklashY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnBacklashGeneric(pProp, eAct, axisLetterY_); } - int OnDriftErrorGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnDriftErrorGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnDriftErrorX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnDriftErrorGeneric(pProp, eAct, axisLetterX_); } int OnDriftErrorY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnDriftErrorGeneric(pProp, eAct, axisLetterY_); } - int OnFinishErrorGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnFinishErrorGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnFinishErrorX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnFinishErrorGeneric(pProp, eAct, axisLetterX_); } int OnFinishErrorY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnFinishErrorGeneric(pProp, eAct, axisLetterY_); } - int OnAccelerationGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnAccelerationGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnAccelerationX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnAccelerationGeneric(pProp, eAct, axisLetterX_); } int OnAccelerationY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnAccelerationGeneric(pProp, eAct, axisLetterY_); } - int OnLowerLimGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnLowerLimGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnLowerLimX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnLowerLimGeneric(pProp, eAct, axisLetterX_); } int OnLowerLimY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnLowerLimGeneric(pProp, eAct, axisLetterY_); } - int OnUpperLimGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnUpperLimGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnUpperLimX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnUpperLimGeneric(pProp, eAct, axisLetterX_); } int OnUpperLimY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnUpperLimGeneric(pProp, eAct, axisLetterY_); } - int OnMaintainStateGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnMaintainStateGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnMaintainStateX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnMaintainStateGeneric(pProp, eAct, axisLetterX_); } int OnMaintainStateY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnMaintainStateGeneric(pProp, eAct, axisLetterY_); } int OnAdvancedProperties (MM::PropertyBase* pProp, MM::ActionType eAct); @@ -121,7 +121,7 @@ class CXYStage : public ASIPeripheralBase<CXYStageBase, CXYStage> int OnAAlign (MM::PropertyBase* pProp, MM::ActionType eAct); int OnAZeroX (MM::PropertyBase* pProp, MM::ActionType eAct); int OnAZeroY (MM::PropertyBase* pProp, MM::ActionType eAct); - int OnMotorControlGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnMotorControlGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnMotorControlX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnMotorControlGeneric(pProp, eAct, axisLetterX_); } int OnMotorControlY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnMotorControlGeneric(pProp, eAct, axisLetterY_); } int OnJoystickFastSpeed (MM::PropertyBase* pProp, MM::ActionType eAct); @@ -153,7 +153,7 @@ class CXYStage : public ASIPeripheralBase<CXYStageBase, CXYStage> int OnRBRunning (MM::PropertyBase* pProp, MM::ActionType eAct); int OnUseSequence (MM::PropertyBase* pProp, MM::ActionType eAct); // vector properties (API only half-defined so far, would prefer to use API in long run) - int OnVectorGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, string axisLetter); + int OnVectorGeneric (MM::PropertyBase* pProp, MM::ActionType eAct, std::string axisLetter); int OnVectorX (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnVectorGeneric(pProp, eAct, axisLetterX_); } int OnVectorY (MM::PropertyBase* pProp, MM::ActionType eAct) { return OnVectorGeneric(pProp, eAct, axisLetterY_); } @@ -163,8 +163,8 @@ class CXYStage : public ASIPeripheralBase<CXYStageBase, CXYStage> double unitMultY_; double stepSizeXUm_; double stepSizeYUm_; - string axisLetterX_; - string axisLetterY_; + std::string axisLetterX_; + std::string axisLetterY_; bool advancedPropsEnabled_; bool speedTruth_; double lastSpeedX_; @@ -181,4 +181,4 @@ class CXYStage : public ASIPeripheralBase<CXYStageBase, CXYStage> int getMinMaxSpeed(string axisLetter, double& minSpeed, double& maxSpeed); }; -#endif //_ASIXYStage_H_ +#endif // ASIXYSTAGE_H diff --git a/DeviceAdapters/ASITiger/ASIZStage.cpp b/DeviceAdapters/ASITiger/ASIZStage.cpp index 952308240..2396ee6a1 100644 --- a/DeviceAdapters/ASITiger/ASIZStage.cpp +++ b/DeviceAdapters/ASITiger/ASIZStage.cpp @@ -74,7 +74,7 @@ int CZStage::Initialize() ostringstream command; command.str(""); double tmp; - command << "UM " << axisLetter_ << "? "; + command << "UM " << axisLetter_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); unitMult_ = tmp/1000; @@ -455,13 +455,13 @@ int CZStage::GetLimits(double& min, double& max) { // ASI limits are always reported in terms of mm, independent of unit multiplier ostringstream command; command.str(""); - command << "SL " << axisLetter_ << "? "; + command << "SL " << axisLetter_ << "?"; double tmp; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":A") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); min = tmp*1000; command.str(""); - command << "SU " << axisLetter_ << "? "; + command << "SU " << axisLetter_ << "?"; RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(),":A") ); RETURN_ON_MM_ERROR( hub_->ParseAnswerAfterEquals(tmp) ); max = tmp*1000; @@ -1526,8 +1526,6 @@ int CZStage::OnWheelMirror(MM::PropertyBase* pProp, MM::ActionType eAct) int CZStage::OnAxisPolarity(MM::PropertyBase* pProp, MM::ActionType eAct) { - ostringstream command; command.str(""); - ostringstream response; response.str(""); if (eAct == MM::BeforeGet) { // do nothing diff --git a/DeviceAdapters/ASITiger/ASIZStage.h b/DeviceAdapters/ASITiger/ASIZStage.h index 7ec9b0b0f..88fe64d55 100644 --- a/DeviceAdapters/ASITiger/ASIZStage.h +++ b/DeviceAdapters/ASITiger/ASIZStage.h @@ -22,8 +22,8 @@ // BASED ON: ASIStage.h and others // -#ifndef _ASIZStage_H_ -#define _ASIZStage_H_ +#ifndef ASIZSTAGE_H +#define ASIZSTAGE_H #include "ASIPeripheralBase.h" #include "MMDevice.h" @@ -36,12 +36,10 @@ class CZStage : public ASIPeripheralBase<CStageBase, CZStage> ~CZStage() { } // Device API - // ---------- int Initialize(); bool Busy(); // ZStage API - // ----------- int Stop(); int Home(); @@ -69,7 +67,6 @@ class CZStage : public ASIPeripheralBase<CStageBase, CZStage> int SendStageSequence(); // action interface - // ---------------- int OnSaveCardSettings (MM::PropertyBase* pProp, MM::ActionType eAct); int OnRefreshProperties (MM::PropertyBase* pProp, MM::ActionType eAct); int OnWaitTime (MM::PropertyBase* pProp, MM::ActionType eAct); @@ -127,7 +124,7 @@ class CZStage : public ASIPeripheralBase<CStageBase, CZStage> private: double unitMult_; double stepSizeUm_; - string axisLetter_; + std::string axisLetter_; bool advancedPropsEnabled_; bool speedTruth_; double lastSpeed_; @@ -143,4 +140,4 @@ class CZStage : public ASIPeripheralBase<CStageBase, CZStage> int OnSaveJoystickSettings(); }; -#endif //_ASIZStage_H_ +#endif // ASIZSTAGE_H