C# Class SympatheticHardwareControl.Controller

This is the interface to the sympathetic specific hardware. Flow chart (under normal conditions): UI -> controller -> hardware. Basically, that's it. Exceptions: -controller can set values displayed on UI (only meant for special cases, like startup or re-loading a saved parameter set) -Some public functions allow the HC to be controlled remotely (see below). HardwareState: There are 3 states which the controller can be in: OFF, LOCAL and REMOTE. OFF just means the HC is idle. The state is set to LOCAL when this program is actively upating the state of the hardware. It does this by reading off what's on the UI, finding any discrepancies between the current state of the hardware and the values on the UI and by updating the hardware accordingly. After finishing with the update, it resets the state to OFF. When the state is set to REMOTE, the UI is disactivated. The hardware controller saves all the parameter values upon switching from LOCAL to REMOTE, then does nothing. When switching back, it reinstates the hardware state to what it was before it switched to REMOTE. Use this when you want to control the hardware from somewhere else (e.g. MOTMaster). Remoting functions (SetValue): Having said that, you'll notice that there are also public functions for modifying parameter values without putting the HC in REMOTE. I wrote it like this because you want to be able to do two different things: -Have the hardware controller take a back seat and let something else control the hardware for a while (e.g. MOTMaster) This is when you should use the REMOTE state. -You still want the HC to keep track of the hardware (hence remaining in LOCAL), but you want to send commands to it remotely (say from a console) instead of from the UI. This is when you would use the SetValue functions. The Hardware Report: The Hardware report is a way of passing a dictionary (gauges, temperature measurements, error signals) to another program (MotMaster, say). MOTMaster can then save the dictionary along with the data. I hope this will help towards answering questions like: "what was the source chamber pressure when we took this data?". At the moment, the hardware state is also included in the report.
Inheritance: System.MarshalByRefObject, CameraControllable, ExperimentReportable, TranslationStageControllable
Afficher le fichier Open project: ColdMatter/EDMSuite Class Usage Examples

Méthodes publiques

Свойство Type Description
HCState SHCUIControlState
ImageController IMAQ.CameraController
LaserLockErrorThreshold double
c1pStopLock object
c2pStopLock object
leStopLock object

Méthodes publiques

Méthode Description
ApplyRecordedStateToHardware ( ) : void
CameraSnapshot ( ) : void
CameraStream ( ) : void
ControllerStopping ( ) : void
FinishRemoteCameraControl ( ) : void
GetExperimentReport ( ) : Object>.Dictionary
GrabMultipleImages ( string cameraAttributesPath, int numberOfShots ) : ].byte[][
GrabSingleImage ( string cameraAttributesPath ) : ].byte[
InitializeLifetimeService ( ) : Object
IsReadyForAcquisition ( ) : bool
LoadParametersWithDialog ( ) : void
OpenNewHardwareMonitorWindow ( ) : void
PrepareRemoteCameraControl ( ) : void
ReadAnalogInput ( string channel ) : double
ReadAnalogInput ( string channelName, bool useCalibration ) : double
ReadAnalogInput ( string channel, double sampleRate, int numOfSamples, bool useCalibration ) : double
ReadChannel1Pressure ( ) : double
ReadChannel2Pressure ( ) : double
ReadLaserErrorSignal ( ) : double
SaveImage ( string path ) : void
SaveImageWithDialog ( ) : void
SaveParametersWithDialog ( ) : void
SetAnalogOutput ( string channel, double voltage ) : void
SetAnalogOutput ( string channelName, double voltage, bool useCalibration ) : void
SetDigitalLine ( string name, bool value ) : void
SetValue ( string channel, bool value ) : void
SetValue ( string channel, double value ) : void

These SetValue functions are for giving commands to the hc from another program, while keeping the hc in control of hardware. Use this if you want the HC to keep control, but you want to control the HC from some other program

SetValue ( string channel, double value, bool useCalibration ) : void
Start ( ) : void
StartCameraControl ( ) : void
StartChamber1PressureMonitor ( ) : void
StartChamber2PressureMonitor ( ) : void
StartMonitoringLaserErrorSignal ( ) : void
StartRemoteControl ( ) : void

This is used when you want another program to take control of some/all of the hardware. The hc then just saves the last hardware state, then prevents you from making any changes to the UI. Use this if your other program wants direct control of hardware.

StopCameraStream ( ) : void
StopChamber1PressureMonitor ( ) : void
StopChamber2PressureMonitor ( ) : void
StopMonitoringLaserErrorSignal ( ) : void
StopRemoteControl ( ) : void
TSAutoTriggerDisable ( ) : void
TSAutoTriggerEnable ( ) : void
TSCheckStatus ( ) : void
TSClear ( ) : void
TSConnect ( ) : void
TSDisconnect ( ) : void
TSGo ( ) : void
TSHome ( ) : void
TSInitialize ( double acceleration, double deceleration, double distance, double velocity ) : void
TSListAll ( ) : void
TSOff ( ) : void
TSOn ( ) : void
TSRead ( ) : void
TSRestart ( ) : void
TSReturn ( ) : void
UpdateHardware ( ) : void

Private Methods

Méthode Description
ControllerLoaded ( ) : void
CreateAnalogInputTask ( string channel ) : void
CreateAnalogInputTask ( string channel, double lowRange, double highRange ) : void
CreateAnalogOutputTask ( string channel ) : void
CreateDigitalTask ( String name ) : void
StoreParameters ( String dataStoreFilePath ) : void
applyAnalogs ( hardwareState state ) : void
applyDigitals ( hardwareState state ) : void
applyToHardware ( hardwareState state ) : void
chamber1PressureMonitorLoop ( ) : void
chamber2PressureMonitorLoop ( ) : void
getDiscrepancies ( hardwareState oldState, hardwareState newState ) : hardwareState
getLaserThresholdFromUI ( ) : double
isLaserLocked ( double threshold, double error ) : bool
leMonitorLoop ( ) : void
loadParameters ( String dataStoreFilePath ) : hardwareState
readUIAnalogs ( double>.Dictionary keys ) : double>.Dictionary
readUIDigitals ( bool>.Dictionary keys ) : bool>.Dictionary
readValuesOnUI ( ) : hardwareState
setUIAnalogs ( hardwareState state ) : void
setUIDigitals ( hardwareState state ) : void
setValuesDisplayedOnUI ( hardwareState state ) : void
updateStateRecord ( hardwareState changes ) : void

Method Details

ApplyRecordedStateToHardware() public méthode

public ApplyRecordedStateToHardware ( ) : void
Résultat void

CameraSnapshot() public méthode

public CameraSnapshot ( ) : void
Résultat void

CameraStream() public méthode

public CameraStream ( ) : void
Résultat void

ControllerStopping() public méthode

public ControllerStopping ( ) : void
Résultat void

FinishRemoteCameraControl() public méthode

public FinishRemoteCameraControl ( ) : void
Résultat void

GetExperimentReport() public méthode

public GetExperimentReport ( ) : Object>.Dictionary
Résultat Object>.Dictionary

GrabMultipleImages() public méthode

public GrabMultipleImages ( string cameraAttributesPath, int numberOfShots ) : ].byte[][
cameraAttributesPath string
numberOfShots int
Résultat ].byte[][

GrabSingleImage() public méthode

public GrabSingleImage ( string cameraAttributesPath ) : ].byte[
cameraAttributesPath string
Résultat ].byte[

InitializeLifetimeService() public méthode

public InitializeLifetimeService ( ) : Object
Résultat Object

IsReadyForAcquisition() public méthode

public IsReadyForAcquisition ( ) : bool
Résultat bool

LoadParametersWithDialog() public méthode

public LoadParametersWithDialog ( ) : void
Résultat void

OpenNewHardwareMonitorWindow() public méthode

public OpenNewHardwareMonitorWindow ( ) : void
Résultat void

PrepareRemoteCameraControl() public méthode

public PrepareRemoteCameraControl ( ) : void
Résultat void

ReadAnalogInput() public méthode

public ReadAnalogInput ( string channel ) : double
channel string
Résultat double

ReadAnalogInput() public méthode

public ReadAnalogInput ( string channelName, bool useCalibration ) : double
channelName string
useCalibration bool
Résultat double

ReadAnalogInput() public méthode

public ReadAnalogInput ( string channel, double sampleRate, int numOfSamples, bool useCalibration ) : double
channel string
sampleRate double
numOfSamples int
useCalibration bool
Résultat double

ReadChannel1Pressure() public méthode

public ReadChannel1Pressure ( ) : double
Résultat double

ReadChannel2Pressure() public méthode

public ReadChannel2Pressure ( ) : double
Résultat double

ReadLaserErrorSignal() public méthode

public ReadLaserErrorSignal ( ) : double
Résultat double

SaveImage() public méthode

public SaveImage ( string path ) : void
path string
Résultat void

SaveImageWithDialog() public méthode

public SaveImageWithDialog ( ) : void
Résultat void

SaveParametersWithDialog() public méthode

public SaveParametersWithDialog ( ) : void
Résultat void

SetAnalogOutput() public méthode

public SetAnalogOutput ( string channel, double voltage ) : void
channel string
voltage double
Résultat void

SetAnalogOutput() public méthode

public SetAnalogOutput ( string channelName, double voltage, bool useCalibration ) : void
channelName string
voltage double
useCalibration bool
Résultat void

SetDigitalLine() public méthode

public SetDigitalLine ( string name, bool value ) : void
name string
value bool
Résultat void

SetValue() public méthode

public SetValue ( string channel, bool value ) : void
channel string
value bool
Résultat void

SetValue() public méthode

These SetValue functions are for giving commands to the hc from another program, while keeping the hc in control of hardware. Use this if you want the HC to keep control, but you want to control the HC from some other program
public SetValue ( string channel, double value ) : void
channel string
value double
Résultat void

SetValue() public méthode

public SetValue ( string channel, double value, bool useCalibration ) : void
channel string
value double
useCalibration bool
Résultat void

Start() public méthode

public Start ( ) : void
Résultat void

StartCameraControl() public méthode

public StartCameraControl ( ) : void
Résultat void

StartChamber1PressureMonitor() public méthode

public StartChamber1PressureMonitor ( ) : void
Résultat void

StartChamber2PressureMonitor() public méthode

public StartChamber2PressureMonitor ( ) : void
Résultat void

StartMonitoringLaserErrorSignal() public méthode

public StartMonitoringLaserErrorSignal ( ) : void
Résultat void

StartRemoteControl() public méthode

This is used when you want another program to take control of some/all of the hardware. The hc then just saves the last hardware state, then prevents you from making any changes to the UI. Use this if your other program wants direct control of hardware.
public StartRemoteControl ( ) : void
Résultat void

StopCameraStream() public méthode

public StopCameraStream ( ) : void
Résultat void

StopChamber1PressureMonitor() public méthode

public StopChamber1PressureMonitor ( ) : void
Résultat void

StopChamber2PressureMonitor() public méthode

public StopChamber2PressureMonitor ( ) : void
Résultat void

StopMonitoringLaserErrorSignal() public méthode

public StopMonitoringLaserErrorSignal ( ) : void
Résultat void

StopRemoteControl() public méthode

public StopRemoteControl ( ) : void
Résultat void

TSAutoTriggerDisable() public méthode

public TSAutoTriggerDisable ( ) : void
Résultat void

TSAutoTriggerEnable() public méthode

public TSAutoTriggerEnable ( ) : void
Résultat void

TSCheckStatus() public méthode

public TSCheckStatus ( ) : void
Résultat void

TSClear() public méthode

public TSClear ( ) : void
Résultat void

TSConnect() public méthode

public TSConnect ( ) : void
Résultat void

TSDisconnect() public méthode

public TSDisconnect ( ) : void
Résultat void

TSGo() public méthode

public TSGo ( ) : void
Résultat void

TSHome() public méthode

public TSHome ( ) : void
Résultat void

TSInitialize() public méthode

public TSInitialize ( double acceleration, double deceleration, double distance, double velocity ) : void
acceleration double
deceleration double
distance double
velocity double
Résultat void

TSListAll() public méthode

public TSListAll ( ) : void
Résultat void

TSOff() public méthode

public TSOff ( ) : void
Résultat void

TSOn() public méthode

public TSOn ( ) : void
Résultat void

TSRead() public méthode

public TSRead ( ) : void
Résultat void

TSRestart() public méthode

public TSRestart ( ) : void
Résultat void

TSReturn() public méthode

public TSReturn ( ) : void
Résultat void

UpdateHardware() public méthode

public UpdateHardware ( ) : void
Résultat void

Property Details

HCState public_oe property

public SHCUIControlState HCState
Résultat SHCUIControlState

ImageController public_oe property

public CameraController,IMAQ ImageController
Résultat IMAQ.CameraController

LaserLockErrorThreshold public_oe property

public double LaserLockErrorThreshold
Résultat double

c1pStopLock public_oe property

public object c1pStopLock
Résultat object

c2pStopLock public_oe property

public object c2pStopLock
Résultat object

leStopLock public_oe property

public object leStopLock
Résultat object