Beispiel #1
0
 /// <summary> Constructor. </summary>
 /// <param name="owner">         The owner. </param>
 /// <param name="device">        The device. </param>
 /// <param name="motorCount">    Number of motors. </param>
 /// <param name="rotary">        true to rotary. </param>
 /// <param name="continuousJog"> true to continuous jog. </param>
 /// <param name="allowCleaning">      True if this object can clean. </param>
 public ELLStageViewModel(ELLDevicesViewModel owner, ELLDevice device, int motorCount, bool rotary, bool continuousJog, bool allowCleaning)
     : base(owner, rotary ? "Rotary Stage" : "Linear Stage", device, motorCount)
 {
     _allowCleaning   = allowCleaning;
     ELLDeviceStage   = device;
     UseHomeDirection = rotary;
     if (rotary)
     {
         AllowContinuousJog = continuousJog;
         IsContinuousJog    = false;
         HomeDirections     = new Dictionary <ELLBaseDevice.DeviceDirection, string>
         {
             { ELLBaseDevice.DeviceDirection.Clockwise, "Clockwise" },
             { ELLBaseDevice.DeviceDirection.AntiClockwise, "Anticlockwise" }
         };
         HomeDirection = ELLBaseDevice.DeviceDirection.AntiClockwise;
         Units         = "deg";
     }
     else
     {
         AllowContinuousJog = false;
         IsContinuousJog    = false;
         HomeDirections     = new Dictionary <ELLBaseDevice.DeviceDirection, string>
         {
             { ELLBaseDevice.DeviceDirection.Linear, "Linear" },
         };
         HomeDirection = ELLBaseDevice.DeviceDirection.Linear;
         Units         = Device.DeviceInfo.Units;
     }
     TargetAbsoluteMove             = 0;
     TargetRelativeMove             = 0.1m;
     ELLDeviceStage.CleaningUpdate += (sender, b) => IsCleaning = b;
 }
 /// <summary> Constructor. </summary>
 /// <param name="owner">	 The owner. </param>
 /// <param name="ellDevices"> The Elliptec device. </param>
 public ELLSequenceViewModel(ELLDevicesViewModel owner, ELLDevices ellDevices)
 {
     _owner      = owner;
     _ellDevices = ellDevices;
     _sequence   = new ELLSequenceXML();
     Items       = new ObservableCollection <ELLSequenceItemViewModel>();
 }
Beispiel #3
0
 /// <summary> Constructor. </summary>
 /// <param name="owner">   The owner. </param>
 /// <param name="device">  The device. </param>
 /// <param name="motorID"> Identifier for the motor. </param>
 public ELLMotorViewModel(ELLDevicesViewModel owner, ELLBaseDevice device, char motorID)
 {
     _owner     = owner;
     _ellDevice = device;
     _motorID   = motorID;
     MotorName  = "Motor " + motorID;
 }
 /// <summary>   Constructor. </summary>
 /// <param name="paddleDevice"> The paddle device. </param>
 /// <param name="paddleID">     Identifier for the paddle. </param>
 public ELLPaddleViewModel(ELLDevicesViewModel owner, ELLPaddlePolariser paddleDevice, ELLPaddlePolariser.PaddleIDs paddleID)
 {
     _owner         = owner;
     _paddleDevice  = paddleDevice;
     _paddleID      = paddleID;
     Title          = $"Paddle{_paddleID}";
     TargetPosition = 180;
     Displacement   = 5;
     MoveTime       = 10;
 }
 protected ELLDeviceBaseViewModel(ELLDevicesViewModel owner, string deviceName, ELLBaseDevice device, int motorCount)
 {
     Owner           = owner;
     _device         = device;
     _deviceName     = deviceName;
     _fullDeviceName = string.Format("{0}:{1}", deviceName, _device.Address);
     for (int i = 0; i < motorCount; i++)
     {
         Motors.Add(new ELLMotorViewModel(owner, device, (char)('1' + i)));
     }
     _units      = _device.DeviceInfo.Units;
     Description = _device.DeviceInfo.Description();
 }
 /// <summary>	Constructor. </summary>
 /// <param name="owner">			The owner. </param>
 /// <param name="device">			The device. </param>
 public ELLPaddlePolariserViewModel(ELLDevicesViewModel owner, ELLPaddlePolariser device)
     : base(owner, "Paddle", device, 3)
 {
     ELLPaddleStage = device;
     Units          = "deg";
     _paddlesTable  = new Dictionary <ELLPaddlePolariser.PaddleIDs, ELLPaddleViewModel>()
     {
         { ELLPaddlePolariser.PaddleIDs.Paddle1, new ELLPaddleViewModel(owner, device, ELLPaddlePolariser.PaddleIDs.Paddle1) },
         { ELLPaddlePolariser.PaddleIDs.Paddle2, new ELLPaddleViewModel(owner, device, ELLPaddlePolariser.PaddleIDs.Paddle2) },
         { ELLPaddlePolariser.PaddleIDs.Paddle3, new ELLPaddleViewModel(owner, device, ELLPaddlePolariser.PaddleIDs.Paddle3) },
     };
     Paddles           = _paddlesTable.Values.ToList();
     TargetHomeOffset  = 90;
     TargetJogStepSize = 30;
 }
Beispiel #7
0
 /// <summary>   Constructor. </summary>
 /// <param name="owner">        The owner. </param>
 /// <param name="device">       The device. </param>
 /// <param name="positions">    The positions. </param>
 public ELLShutterViewModel(ELLDevicesViewModel owner, ELLDevice device, int positions)
     : base(owner, "Shutter", device, 1)
 {
     ELLDeviceShutter = device;
     _positions       = positions;
     if (ShowPositions)
     {
         List <ButtonRelayCommandViewModel> buttons = new List <ButtonRelayCommandViewModel>();
         for (int i = 0; i < _positions; i++)
         {
             int i1 = i;
             buttons.Add(new ButtonRelayCommandViewModel(() => { MoveToPosition(i1); }, $"Position {i}"));
         }
         Buttons = buttons;
     }
 }
 /// <summary> Constructor. </summary>
 /// <param name="owner">   The owner. </param>
 /// <param name="device">  The device. </param>
 public ELLActuatorViewModel(ELLDevicesViewModel owner, ELLDevice device)
     : base(owner, "Actuator", device, 1)
 {
 }