Skip to content

Commit

Permalink
Set Commands Return Output
Browse files Browse the repository at this point in the history
Set commands now return a command once finished to enable asynchronous and synchronous execution.
  • Loading branch information
BiologyTools committed Aug 2, 2023
1 parent 3c90dce commit 2a4d637
Showing 1 changed file with 48 additions and 12 deletions.
60 changes: 48 additions & 12 deletions Microscope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,65 @@ public static void Run(Command c)
switch (c.type)
{
case Command.Type.SetStage:
Microscope.Stage.SetPosition(c.doubles[0], c.doubles[1]);break;
{
Microscope.Stage.SetPosition(c.doubles[0], c.doubles[1]);
Output(c.type, c); break;
}
case Command.Type.SetFocus:
Microscope.Focus.SetFocus(c.doubles[0]); break;
{
Microscope.Focus.SetFocus(c.doubles[0]);
Output(c.type, c); break;
}
case Command.Type.SetObjective:
Microscope.Objectives.SetPosition((int)c.doubles[0]); break;
{
Microscope.Objectives.SetPosition((int)c.doubles[0]);
Output(c.type, c); break;
}
case Command.Type.SetFilterWheel:
Microscope.FilterWheel.SetPosition((int)c.doubles[0]); break;
{
Microscope.FilterWheel.SetPosition((int)c.doubles[0]);
Output(c.type, c); break;
}
case Command.Type.SetHXP:
Microscope.HXP.SetPosition(c.doubles[0]); break;
{
Microscope.HXP.SetPosition(c.doubles[0]);
Output(c.type, c); break;
}
case Command.Type.SetRLHalogen:
Microscope.RLHalogen.SetPosition(c.doubles[0]); break;
{
Microscope.RLHalogen.SetPosition(c.doubles[0]);
Output(c.type, c); break;
}
case Command.Type.SetTLHalogen:
Microscope.TLHalogen.SetPosition(c.doubles[0]); break;
{
Microscope.TLHalogen.SetPosition(c.doubles[0]);
Output(c.type, c); break;
}
case Command.Type.SetHXPShutter:
Microscope.HXPShutter.SetPosition((int)c.doubles[0]); break;
{
Microscope.HXPShutter.SetPosition((int)c.doubles[0]);
Output(c.type, c); break;
}
case Command.Type.SetRLShutter:
Microscope.RLShutter.SetPosition((int)c.doubles[0]); break;
{
Microscope.RLShutter.SetPosition((int)c.doubles[0]);
Output(c.type, c); break;
}
case Command.Type.SetTLShutter:
Microscope.TLShutter.SetPosition((int)c.doubles[0]); break;
{
Microscope.TLShutter.SetPosition((int)c.doubles[0]);
Output(c.type, c); break;
}
case Command.Type.SetStageSWLimit:
Microscope.Stage.SetSWLimit(c.doubles[0], c.doubles[1], c.doubles[2], c.doubles[3]); break;
{
Microscope.Stage.SetSWLimit(c.doubles[0], c.doubles[1], c.doubles[2], c.doubles[3]);
Output(c.type, c); break;
}
case Command.Type.SetCalibration:
Microscope.CalibrateXYZ((Microscope.Calibration)c.doubles[0]); break;
{
Microscope.CalibrateXYZ((Microscope.Calibration)c.doubles[0]);
Output(c.type, c); break;
}
case Command.Type.GetStage:
Output(c.type, Microscope.Stage.GetPosition(true)); break;
case Command.Type.GetFocus:
Expand Down

0 comments on commit 2a4d637

Please sign in to comment.