Skip to content

Commit

Permalink
ASIStage: fix Magnifier device, register in InitializeModuleData
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon committed Dec 16, 2024
1 parent ef8ac74 commit 88a23b4
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion DeviceAdapters/ASIStage/ASICRIF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "ASICRIF.h"

CRIF::CRIF() :
ASIBase(this, ""), // LX-4000 Prefix Unknown
ASIBase(this, ""),
justCalibrated_(false),
axis_("Z"),
stepSizeUm_(0.1),
Expand Down
2 changes: 1 addition & 1 deletion DeviceAdapters/ASIStage/ASILED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "ASILED.h"

LED::LED() :
ASIBase(this, ""), // LX-4000 Prefix Unknown
ASIBase(this, ""),
open_(false),
intensity_(20),
name_("LED"),
Expand Down
4 changes: 2 additions & 2 deletions DeviceAdapters/ASIStage/ASIMagnifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Magnifier::Magnifier() :
ASIBase(this, ""),
axis_("M"), // normally the zoom axis is the M axis.
axis_("M"), // normally the zoom axis is the M axis
answerTimeoutMs_(1000)
{
InitializeDefaultErrorMessages();
Expand All @@ -30,7 +30,7 @@ Magnifier::Magnifier() :
// Axis
pAct = new CPropertyAction(this, &Magnifier::OnAxis);
CreateProperty("Axis", "M", MM::String, false, pAct, true);
// AddAllowedValue("Axis", "(LETTER)");
AddAllowedValue("Axis", "M");
}

Magnifier::~Magnifier()
Expand Down
39 changes: 20 additions & 19 deletions DeviceAdapters/ASIStage/ASIStage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,63 +19,64 @@

MODULE_API void InitializeModuleData()
{
RegisterDevice(g_ZStageDeviceName, MM::StageDevice, "Add-on Z-stage");
RegisterDevice(g_ZStageDeviceName, MM::StageDevice, "Z Stage");
RegisterDevice(g_XYStageDeviceName, MM::XYStageDevice, "XY Stage");
RegisterDevice(g_CRIFDeviceName, MM::AutoFocusDevice, "CRIF");
RegisterDevice(g_CRISPDeviceName, MM::AutoFocusDevice, "CRISP");
RegisterDevice(g_AZ100TurretName, MM::StateDevice, "AZ100 Turret");
RegisterDevice(g_StateDeviceName, MM::StateDevice, "State Device");
RegisterDevice(g_MagnifierDeviceName, MM::MagnifierDevice, "Magnifier");
RegisterDevice(g_LEDDeviceName, MM::ShutterDevice, "LED");
RegisterDevice(g_TIRFDeviceName, MM::GenericDevice, "TIRF");
}

MODULE_API MM::Device* CreateDevice(const char* deviceName)
{
std::string device = deviceName;
if (deviceName == 0)
if (deviceName == nullptr)
{
return 0;
return nullptr;
}
if (deviceName == g_ZStageDeviceName)

const std::string name = deviceName;

if (name == g_ZStageDeviceName)
{
return new ZStage();
}
else if (deviceName == g_XYStageDeviceName)
else if (name == g_XYStageDeviceName)
{
return new XYStage();
}
else if (deviceName == g_CRIFDeviceName)
else if (name == g_CRIFDeviceName)
{
return new CRIF();
}
else if (deviceName == g_CRISPDeviceName)
else if (name == g_CRISPDeviceName)
{
return new CRISP();
}
else if (deviceName == g_AZ100TurretName)
else if (name == g_AZ100TurretName)
{
return new AZ100Turret();
}
else if (deviceName == g_StateDeviceName)
else if (name == g_StateDeviceName)
{
return new StateDevice();
}
else if (deviceName == g_LEDDeviceName)
{
return new LED();
}
else if (deviceName == g_MagnifierDeviceName)
else if (name == g_MagnifierDeviceName)
{
return new Magnifier();
}
else if (deviceName == g_TIRFDeviceName)
else if (name == g_LEDDeviceName)
{
return new TIRF();
return new LED();
}
else
else if (name == g_TIRFDeviceName)
{
return 0;
return new TIRF();
}

return nullptr;
}

MODULE_API void DeleteDevice(MM::Device* pDevice)
Expand Down
2 changes: 1 addition & 1 deletion DeviceAdapters/ASIStage/ASIStateDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "ASIStateDevice.h"

StateDevice::StateDevice() :
ASIBase(this, ""), // LX-4000 Prefix Unknown
ASIBase(this, ""),
numPos_(4),
axis_("F"),
position_(0),
Expand Down
2 changes: 1 addition & 1 deletion DeviceAdapters/ASIStage/ASITIRF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

TIRF::TIRF() :
ASIBase(this, ""),
axis_("F"),//normaly the TIRF axis is the F axis.
axis_("F"), // normally the TIRF axis is the F axis
answerTimeoutMs_(1000),
scaleFactor_(1),
unitFactor_(10000)
Expand Down
2 changes: 1 addition & 1 deletion DeviceAdapters/ASIStage/ASITurret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "ASITurret.h"

AZ100Turret::AZ100Turret() :
ASIBase(this, ""), // LX-4000 Prefix Unknown
ASIBase(this, ""),
numPos_(4),
position_(0)
{
Expand Down
2 changes: 1 addition & 1 deletion DeviceAdapters/ASIStage/ASIXYStage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "ASIXYStage.h"

XYStage::XYStage() :
ASIBase(this, "2H"),
ASIBase(this, "2H"), // LX-4000 prefix
stepSizeXUm_(0.0),
stepSizeYUm_(0.0),
maxSpeed_(7.5),
Expand Down
2 changes: 1 addition & 1 deletion DeviceAdapters/ASIStage/ASIZStage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "ASIZStage.h"

ZStage::ZStage() :
ASIBase(this, "1H"),
ASIBase(this, "1H"), // LX-4000 prefix
axis_("Z"),
axisNr_(4),
stepSizeUm_(0.1),
Expand Down

0 comments on commit 88a23b4

Please sign in to comment.