本文整理汇总了C++中IString::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ IString::Get方法的具体用法?C++ IString::Get怎么用?C++ IString::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IString
的用法示例。
在下文中一共展示了IString::Get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void CAndorSDK3Camera::PerformReleaseVersionCheck()
{
//Release 2 / 2.1 checks
try
{
IString * firmwareVersion = cameraDevice->GetString(L"FirmwareVersion");
if (firmwareVersion && firmwareVersion->IsImplemented())
{
wstring ws = firmwareVersion->Get();
if (ws == g_RELEASE_2_0_FIRMWARE_VERSION)
{
LogMessage("Warning: Release 2.0 Camera firmware detected! Please upgrade your camera to Release 3");
}
else if (ws == g_RELEASE_2_1_FIRMWARE_VERSION)
{
LogMessage("Warning: Release 2.1 Camera firmware detected! Please upgrade your camera to Release 3");
}
}
cameraDevice->Release(firmwareVersion);
}
catch (NotImplementedException & e)
{
LogMessage(e.what());
}
}
示例2: deviceManager
/**
* CAndorSDK3Camera constructor.
* Setup default all variables and create device properties required to exist
* before intialization. In this case, no such properties were required. All
* properties will be created in the Initialize() method.
*
* As a general guideline Micro-Manager devices do not access hardware in the
* the constructor. We should do as little as possible in the constructor and
* perform most of the initialization in the Initialize() method.
*/
CAndorSDK3Camera::CAndorSDK3Camera()
: CCameraBase<CAndorSDK3Camera> (),
deviceManager(NULL),
cameraDevice(NULL),
bufferControl(NULL),
startAcquisitionCommand(NULL),
sendSoftwareTrigger(NULL),
initialized_(false),
b_cameraPresent_(false),
number_of_devices_(0),
deviceInUseIndex_(0),
sequenceStartTime_(0),
fpgaTSclockFrequency_(0),
timeStamp_(0),
defaultExposureTime_(0.0f),
pDemoResourceLock_(0),
image_buffers_(NULL),
numImgBuffersAllocated_(0),
currentSeqExposure_(0),
keep_trying_(false),
stopOnOverflow_(false)
{
// call the base class method to set-up default error codes/messages
InitializeDefaultErrorMessages();
//Add in some others not currently in base impl, will show in CoreLog/Msgbox on error
SetErrorText(DEVICE_BUFFER_OVERFLOW, " Circular Buffer Overflow code from MMCore");
SetErrorText(DEVICE_OUT_OF_MEMORY, " Allocation Failure - out of memory");
SetErrorText(DEVICE_SNAP_IMAGE_FAILED, " Snap Image Failure");
#ifdef TESTRESOURCELOCKING
pDemoResourceLock_ = new MMThreadLock();
#endif
thd_ = new MySequenceThread(this);
// Create an atcore++ device manager
deviceManager = new TDeviceManager;
// Open a system device
IDevice * systemDevice = deviceManager->OpenSystemDevice();
IInteger * deviceCount = systemDevice->GetInteger(L"DeviceCount");
SetNumberOfDevicesPresent(static_cast<int>(deviceCount->Get()));
systemDevice->Release(deviceCount);
IString * swVersion = systemDevice->GetString(L"SoftwareVersion");
currentSoftwareVersion_ = swVersion->Get();
systemDevice->Release(swVersion);
deviceManager->CloseDevice(systemDevice);
}
示例3: TAndorFloatValueMapper
/**
* Intializes the hardware.
* Required by the MM::Device API.
* Typically we access and initialize hardware at this point.
* Device properties are typically created here as well, except
* the ones we need to use for defining initialization parameters.
* Such pre-initialization properties are created in the constructor.
* (This device does not have any pre-initialization properties)
*/
int CAndorSDK3Camera::Initialize()
{
if (initialized_)
return DEVICE_OK;
if (0 == GetNumberOfDevicesPresent())
{
initialized_ = false;
return DEVICE_NOT_CONNECTED;
}
PerformReleaseVersionCheck();
// set property list
// -----------------
// Name
int nRet = CreateProperty(MM::g_Keyword_Name, g_CameraName, MM::String, true);
if (DEVICE_OK != nRet)
return nRet;
// CameraName
nRet = CreateProperty(MM::g_Keyword_CameraName, g_CameraDeviceName, MM::String, true);
assert(nRet == DEVICE_OK);
// Description
nRet = CreateProperty(MM::g_Keyword_Description, g_CameraDeviceDescription, MM::String, true);
if (DEVICE_OK != nRet)
return nRet;
// CameraID
IString * cameraSerialNumber = cameraDevice->GetString(L"SerialNumber");
std::wstring temp_ws = cameraSerialNumber->Get();
char * p_cameraSerialNumber = new char[temp_ws.size() + 1];
memset(p_cameraSerialNumber, '\0', temp_ws.size() + 1);
wcstombs(p_cameraSerialNumber, temp_ws.c_str(), temp_ws.size());
cameraDevice->Release(cameraSerialNumber);
nRet = CreateProperty(MM::g_Keyword_CameraID, p_cameraSerialNumber, MM::String, true);
assert(nRet == DEVICE_OK);
delete [] p_cameraSerialNumber;
// Properties
binning_property = new TEnumProperty(MM::g_Keyword_Binning, cameraDevice->GetEnum(L"AOIBinning"),
this, thd_, snapShotController_, false, false);
AddAllowedValue(MM::g_Keyword_Binning, g_CameraDefaultBinning);
SetProperty(MM::g_Keyword_Binning, g_CameraDefaultBinning);
preAmpGain_property = new TEnumProperty(TAndorSDK3Strings::GAIN_TEXT,
cameraDevice->GetEnum(L"SimplePreAmpGainControl"),
this, thd_, snapShotController_, false, true);
electronicShutteringMode_property = new TEnumProperty(TAndorSDK3Strings::ELECTRONIC_SHUTTERING_MODE,
cameraDevice->GetEnum(L"ElectronicShutteringMode"), this,
thd_, snapShotController_, false, false);
temperatureControl_proptery = new TEnumProperty(TAndorSDK3Strings::TEMPERATURE_CONTROL,
cameraDevice->GetEnum(L"TemperatureControl"), this, thd_,
snapShotController_, false, false);
pixelReadoutRate_property = new TEnumProperty(TAndorSDK3Strings::PIXEL_READOUT_RATE,
cameraDevice->GetEnum(L"PixelReadoutRateMapper"),
this, thd_, snapShotController_, false, false);
pixelEncoding_property = new TEnumProperty(TAndorSDK3Strings::PIXEL_ENCODING,
cameraDevice->GetEnum(L"PixelEncoding"), this, thd_,
snapShotController_, true, false);
accumulationLength_property = new TIntegerProperty(TAndorSDK3Strings::ACCUMULATE_COUNT,
cameraDevice->GetInteger(L"AccumulateCount"), this, thd_,
snapShotController_, false, false);
temperatureStatus_property = new TEnumProperty(TAndorSDK3Strings::TEMPERATURE_STATUS,
cameraDevice->GetEnum(L"TemperatureStatus"), this, thd_,
snapShotController_, true, false);
fanSpeed_property = new TEnumProperty(TAndorSDK3Strings::FAN_SPEED, cameraDevice->GetEnum(L"FanSpeed"), this,
thd_, snapShotController_, false, false);
spuriousNoiseFilter_property = new TBooleanProperty(TAndorSDK3Strings::SPURIOUS_NOISE_FILTER,
cameraDevice->GetBool(L"SpuriousNoiseFilter"), this, thd_,
snapShotController_, false);
sensorCooling_property = new TBooleanProperty(TAndorSDK3Strings::SENSOR_COOLING,
cameraDevice->GetBool(L"SensorCooling"), this, thd_, snapShotController_, false);
overlap_property = new TBooleanProperty(TAndorSDK3Strings::OVERLAP, cameraDevice->GetBool(L"Overlap"),
this, thd_, snapShotController_, false);
triggerMode_Enum = cameraDevice->GetEnum(L"TriggerMode");
triggerMode_remapper = new TTriggerRemapper(snapShotController_, triggerMode_Enum);
std::map<std::wstring, std::wstring> triggerMode_map;
//.........这里部分代码省略.........
示例4: deviceManager
/**
* CAndorSDK3Camera constructor.
* Setup default all variables and create device properties required to exist
* before intialization. In this case, no such properties were required. All
* properties will be created in the Initialize() method.
*
* As a general guideline Micro-Manager devices do not access hardware in the
* the constructor. We should do as little as possible in the constructor and
* perform most of the initialization in the Initialize() method.
*/
CAndorSDK3Camera::CAndorSDK3Camera()
: CCameraBase<CAndorSDK3Camera> (),
deviceManager(NULL),
systemDevice(NULL),
cameraDevice(NULL),
cycleMode(NULL),
bufferControl(NULL),
startAcquisitionCommand(NULL),
stopAcquisitionCommand(NULL),
sendSoftwareTrigger(NULL),
frameCount(NULL),
frameRate(NULL),
initialized_(false),
b_cameraPresent_(false),
number_of_devices_(0),
sequenceStartTime_(0),
fpgaTSclockFrequency_(0),
timeStamp_(0),
pDemoResourceLock_(0),
image_buffers_(NULL),
d_frameRate_(0),
keep_trying_(false),
roiX_(0),
roiY_(0)
{
// call the base class method to set-up default error codes/messages
InitializeDefaultErrorMessages();
readoutStartTime_ = GetCurrentMMTime();
#ifdef TESTRESOURCELOCKING
pDemoResourceLock_ = new MMThreadLock();
#endif
thd_ = new MySequenceThread(this);
// Create an atcore++ device manager
deviceManager = new TDeviceManager;
// Open a system device
systemDevice = deviceManager->OpenSystemDevice();
IInteger * deviceCount = systemDevice->GetInteger(L"DeviceCount");
SetNumberOfDevicesPresent(static_cast<int>(deviceCount->Get()));
systemDevice->Release(deviceCount);
if (GetNumberOfDevicesPresent() > 0)
{
for (int i = 0; i < GetNumberOfDevicesPresent(); i++)
{
cameraDevice = deviceManager->OpenDevice(i);
IString * cameraFamilyString = cameraDevice->GetString(L"CameraFamily");
std::wstring temp_ws = cameraFamilyString->Get();
cameraDevice->Release(cameraFamilyString);
if (temp_ws.compare(L"Andor sCMOS") == 0)
{
b_cameraPresent_ = true;
break;
}
else
{
deviceManager->CloseDevice(cameraDevice);
}
}
}
if (GetCameraPresent())
{
bufferControl = cameraDevice->GetBufferControl();
startAcquisitionCommand = cameraDevice->GetCommand(L"AcquisitionStart");
stopAcquisitionCommand = cameraDevice->GetCommand(L"AcquisitionStop");
cycleMode = cameraDevice->GetEnum(L"CycleMode");
sendSoftwareTrigger = cameraDevice->GetCommand(L"SoftwareTrigger");
frameCount = cameraDevice->GetInteger(L"FrameCount");
frameRate = cameraDevice->GetFloat(L"FrameRate");
snapShotController_ = new SnapShotControl(cameraDevice);
}
}
示例5: cameraSerialCheck
/**
* Intializes the hardware.
* Required by the MM::Device API.
* Typically we access and initialize hardware at this point.
* Device properties are typically created here as well, except
* the ones we need to use for defining initialization parameters.
* Such pre-initialization properties are created in the constructor.
* (This device does not have any pre-initialization properties)
*/
int CAndorSDK3Camera::Initialize()
{
if (initialized_)
return DEVICE_OK;
if (0 == GetNumberOfDevicesPresent())
{
initialized_ = false;
return DEVICE_NOT_CONNECTED;
}
for (int i = 0; i < GetNumberOfDevicesPresent(); i++)
{
if (!DEVICE_IN_USE[i])
{
try
{
cameraDevice = deviceManager->OpenDevice(i);
}
catch (exception & e)
{
LogMessage(e.what());
continue;
}
IString * cameraFamilyString = cameraDevice->GetString(L"CameraFamily");
std::wstring temp_ws = cameraFamilyString->Get();
cameraDevice->Release(cameraFamilyString);
if (temp_ws.compare(L"Andor sCMOS") == 0)
{
b_cameraPresent_ = true;
DEVICE_IN_USE[i] = true;
deviceInUseIndex_ = i;
break;
}
else
{
deviceManager->CloseDevice(cameraDevice);
}
}
}
if (cameraDevice == NULL)
{
return DEVICE_NOT_CONNECTED;
}
// Description
int ret = CreateProperty(MM::g_Keyword_Description, g_CameraDeviceDescription, MM::String, true);
assert(DEVICE_OK == ret);
//Camera Firmware
wstring temp_ws = PerformReleaseVersionCheck();
char * p_cameraInfoString = new char[MAX_CHARS_INFO_STRING];
memset(p_cameraInfoString, 0, MAX_CHARS_INFO_STRING);
wcstombs(p_cameraInfoString, temp_ws.c_str(), temp_ws.size());
ret = CreateProperty(g_Keyword_FirmwareVersion, p_cameraInfoString, MM::String, true);
assert(DEVICE_OK == ret);
if (GetCameraPresent())
{
bufferControl = cameraDevice->GetBufferControl();
startAcquisitionCommand = cameraDevice->GetCommand(L"AcquisitionStart");
sendSoftwareTrigger = cameraDevice->GetCommand(L"SoftwareTrigger");
#ifdef linux
AT_InitialiseUtilityLibrary();
#endif
}
else
{
return DEVICE_NOT_YET_IMPLEMENTED;
}
// CameraID(Serial))
IString * cameraSerialNumber = cameraDevice->GetString(L"SerialNumber");
temp_ws = cameraSerialNumber->Get();
memset(p_cameraInfoString, 0, MAX_CHARS_INFO_STRING);
wcstombs(p_cameraInfoString, temp_ws.c_str(), temp_ws.size());
cameraDevice->Release(cameraSerialNumber);
ret = CreateProperty(MM::g_Keyword_CameraID, p_cameraInfoString, MM::String, true);
assert(DEVICE_OK == ret);
wstring cameraSerialCheck(temp_ws);
// Camera Model
IString * cameraModel = cameraDevice->GetString(L"CameraModel");
temp_ws = cameraModel->Get();
memset(p_cameraInfoString, 0, MAX_CHARS_INFO_STRING);
wcstombs(p_cameraInfoString, temp_ws.c_str(), temp_ws.size());
cameraDevice->Release(cameraModel);
ret = CreateProperty(g_Keyword_CameraModel, p_cameraInfoString, MM::String, true);
assert(DEVICE_OK == ret);
wstring cameraModelCheck(temp_ws);
//.........这里部分代码省略.........
示例6: TAndorFloatValueMapper
/**
* Intializes the hardware.
* Required by the MM::Device API.
* Typically we access and initialize hardware at this point.
* Device properties are typically created here as well, except
* the ones we need to use for defining initialization parameters.
* Such pre-initialization properties are created in the constructor.
* (This device does not have any pre-initialization properties)
*/
int CAndorSDK3Camera::Initialize()
{
if (initialized_)
return DEVICE_OK;
if (0 == GetNumberOfDevicesPresent())
{
initialized_ = false;
return DEVICE_NOT_CONNECTED;
}
PerformReleaseVersionCheck();
// set property list
// -----------------
// Name
int nRet = CreateProperty(MM::g_Keyword_Name, g_CameraName, MM::String, true);
if (DEVICE_OK != nRet)
return nRet;
// CameraName
nRet = CreateProperty(MM::g_Keyword_CameraName, g_CameraDeviceName, MM::String, true);
assert(nRet == DEVICE_OK);
// Description
nRet = CreateProperty(MM::g_Keyword_Description, g_CameraDeviceDescription, MM::String, true);
if (DEVICE_OK != nRet)
return nRet;
// CameraID
IString * cameraSerialNumber = cameraDevice->GetString(L"SerialNumber");
std::wstring temp_ws = cameraSerialNumber->Get();
char * p_cameraSerialNumber = new char[temp_ws.size() + 1];
memset(p_cameraSerialNumber, 0, temp_ws.size() + 1);
wcstombs(p_cameraSerialNumber, temp_ws.c_str(), temp_ws.size());
cameraDevice->Release(cameraSerialNumber);
nRet = CreateProperty(MM::g_Keyword_CameraID, p_cameraSerialNumber, MM::String, true);
assert(nRet == DEVICE_OK);
delete [] p_cameraSerialNumber;
temp_ws.erase(4);
bool b_zyla = false;
if (0 == temp_ws.compare(L"VSC-") )
{
b_zyla = true;
}
// Properties
binning_property = new TEnumProperty(MM::g_Keyword_Binning, cameraDevice->GetEnum(L"AOIBinning"),
this, thd_, snapShotController_, false, false);
AddAllowedValue(MM::g_Keyword_Binning, g_CameraDefaultBinning);
SetProperty(MM::g_Keyword_Binning, g_CameraDefaultBinning);
preAmpGain_property = new TEnumProperty(TAndorSDK3Strings::GAIN_TEXT,
cameraDevice->GetEnum(L"SimplePreAmpGainControl"),
this, thd_, snapShotController_, false, true);
electronicShutteringMode_property = new TEnumProperty(TAndorSDK3Strings::ELECTRONIC_SHUTTERING_MODE,
cameraDevice->GetEnum(L"ElectronicShutteringMode"), this,
thd_, snapShotController_, false, false);
temperatureControl_proptery = new TEnumProperty(TAndorSDK3Strings::TEMPERATURE_CONTROL,
cameraDevice->GetEnum(L"TemperatureControl"), this, thd_,
snapShotController_, b_zyla ? true : false, false);
pixelReadoutRate_property = new TEnumProperty(TAndorSDK3Strings::PIXEL_READOUT_RATE,
cameraDevice->GetEnum(L"PixelReadoutRateMapper"),
this, thd_, snapShotController_, false, false);
pixelEncoding_property = new TEnumProperty(TAndorSDK3Strings::PIXEL_ENCODING,
cameraDevice->GetEnum(L"PixelEncoding"), this, thd_,
snapShotController_, true, false);
accumulationLength_property = new TIntegerProperty(TAndorSDK3Strings::ACCUMULATE_COUNT,
cameraDevice->GetInteger(L"AccumulateCount"), this, thd_,
snapShotController_, false, false);
temperatureStatus_property = new TEnumProperty(TAndorSDK3Strings::TEMPERATURE_STATUS,
cameraDevice->GetEnum(L"TemperatureStatus"), this, thd_,
snapShotController_, true, false);
fanSpeed_property = new TEnumProperty(TAndorSDK3Strings::FAN_SPEED, cameraDevice->GetEnum(L"FanSpeed"), this,
thd_, snapShotController_, false, false);
spuriousNoiseFilter_property = new TBooleanProperty(TAndorSDK3Strings::SPURIOUS_NOISE_FILTER,
cameraDevice->GetBool(L"SpuriousNoiseFilter"), this, thd_,
snapShotController_, false);
sensorCooling_property = new TBooleanProperty(TAndorSDK3Strings::SENSOR_COOLING,
cameraDevice->GetBool(L"SensorCooling"), this, thd_, snapShotController_, false);
//.........这里部分代码省略.........
示例7: deviceManager
/**
* CAndorSDK3Camera constructor.
* Setup default all variables and create device properties required to exist
* before intialization. In this case, no such properties were required. All
* properties will be created in the Initialize() method.
*
* As a general guideline Micro-Manager devices do not access hardware in the
* the constructor. We should do as little as possible in the constructor and
* perform most of the initialization in the Initialize() method.
*/
CAndorSDK3Camera::CAndorSDK3Camera()
: CCameraBase<CAndorSDK3Camera> (),
deviceManager(NULL),
systemDevice(NULL),
cameraDevice(NULL),
cycleMode(NULL),
bufferControl(NULL),
startAcquisitionCommand(NULL),
stopAcquisitionCommand(NULL),
sendSoftwareTrigger(NULL),
frameCount(NULL),
frameRate(NULL),
initialized_(false),
b_cameraPresent_(false),
number_of_devices_(0),
sequenceStartTime_(0),
fpgaTSclockFrequency_(0),
timeStamp_(0),
pDemoResourceLock_(0),
image_buffers_(NULL),
numImgBuffersAllocated_(0),
d_frameRate_(0),
currentSeqExposure_(0),
keep_trying_(false),
b_eventsSupported_(false),
roiX_(0),
roiY_(0)
{
// call the base class method to set-up default error codes/messages
InitializeDefaultErrorMessages();
//Add in some others not currently in base impl, will show in CoreLog/Msgbox on error
SetErrorText(DEVICE_BUFFER_OVERFLOW, " Circular Buffer Overflow code from MMCore");
SetErrorText(DEVICE_OUT_OF_MEMORY, " Allocation Failure - out of memory");
SetErrorText(DEVICE_SNAP_IMAGE_FAILED, " Snap Image Failure");
readoutStartTime_ = GetCurrentMMTime();
#ifdef TESTRESOURCELOCKING
pDemoResourceLock_ = new MMThreadLock();
#endif
thd_ = new MySequenceThread(this);
// Create an atcore++ device manager
deviceManager = new TDeviceManager;
// Open a system device
systemDevice = deviceManager->OpenSystemDevice();
IInteger * deviceCount = systemDevice->GetInteger(L"DeviceCount");
SetNumberOfDevicesPresent(static_cast<int>(deviceCount->Get()));
systemDevice->Release(deviceCount);
if (GetNumberOfDevicesPresent() > 0)
{
for (int i = 0; i < GetNumberOfDevicesPresent(); i++)
{
cameraDevice = deviceManager->OpenDevice(i);
IString * cameraFamilyString = cameraDevice->GetString(L"CameraFamily");
std::wstring temp_ws = cameraFamilyString->Get();
cameraDevice->Release(cameraFamilyString);
if (temp_ws.compare(L"Andor sCMOS") == 0)
{
b_cameraPresent_ = true;
break;
}
else
{
deviceManager->CloseDevice(cameraDevice);
}
}
}
if (GetCameraPresent())
{
bufferControl = cameraDevice->GetBufferControl();
startAcquisitionCommand = cameraDevice->GetCommand(L"AcquisitionStart");
stopAcquisitionCommand = cameraDevice->GetCommand(L"AcquisitionStop");
cycleMode = cameraDevice->GetEnum(L"CycleMode");
sendSoftwareTrigger = cameraDevice->GetCommand(L"SoftwareTrigger");
frameCount = cameraDevice->GetInteger(L"FrameCount");
frameRate = cameraDevice->GetFloat(L"FrameRate");
snapShotController_ = new SnapShotControl(cameraDevice);
}
}