C# Класс 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.
Наследование: System.MarshalByRefObject, CameraControllable, ExperimentReportable, TranslationStageControllable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
HCState SHCUIControlState
ImageController IMAQ.CameraController
LaserLockErrorThreshold double
c1pStopLock object
c2pStopLock object
leStopLock object

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

ApplyRecordedStateToHardware() публичный Метод

public ApplyRecordedStateToHardware ( ) : void
Результат void

CameraSnapshot() публичный Метод

public CameraSnapshot ( ) : void
Результат void

CameraStream() публичный Метод

public CameraStream ( ) : void
Результат void

ControllerStopping() публичный Метод

public ControllerStopping ( ) : void
Результат void

FinishRemoteCameraControl() публичный Метод

public FinishRemoteCameraControl ( ) : void
Результат void

GetExperimentReport() публичный Метод

public GetExperimentReport ( ) : Object>.Dictionary
Результат Object>.Dictionary

GrabMultipleImages() публичный Метод

public GrabMultipleImages ( string cameraAttributesPath, int numberOfShots ) : ].byte[][
cameraAttributesPath string
numberOfShots int
Результат ].byte[][

GrabSingleImage() публичный Метод

public GrabSingleImage ( string cameraAttributesPath ) : ].byte[
cameraAttributesPath string
Результат ].byte[

InitializeLifetimeService() публичный Метод

public InitializeLifetimeService ( ) : Object
Результат Object

IsReadyForAcquisition() публичный Метод

public IsReadyForAcquisition ( ) : bool
Результат bool

LoadParametersWithDialog() публичный Метод

public LoadParametersWithDialog ( ) : void
Результат void

OpenNewHardwareMonitorWindow() публичный Метод

public OpenNewHardwareMonitorWindow ( ) : void
Результат void

PrepareRemoteCameraControl() публичный Метод

public PrepareRemoteCameraControl ( ) : void
Результат void

ReadAnalogInput() публичный Метод

public ReadAnalogInput ( string channel ) : double
channel string
Результат double

ReadAnalogInput() публичный Метод

public ReadAnalogInput ( string channelName, bool useCalibration ) : double
channelName string
useCalibration bool
Результат double

ReadAnalogInput() публичный Метод

public ReadAnalogInput ( string channel, double sampleRate, int numOfSamples, bool useCalibration ) : double
channel string
sampleRate double
numOfSamples int
useCalibration bool
Результат double

ReadChannel1Pressure() публичный Метод

public ReadChannel1Pressure ( ) : double
Результат double

ReadChannel2Pressure() публичный Метод

public ReadChannel2Pressure ( ) : double
Результат double

ReadLaserErrorSignal() публичный Метод

public ReadLaserErrorSignal ( ) : double
Результат double

SaveImage() публичный Метод

public SaveImage ( string path ) : void
path string
Результат void

SaveImageWithDialog() публичный Метод

public SaveImageWithDialog ( ) : void
Результат void

SaveParametersWithDialog() публичный Метод

public SaveParametersWithDialog ( ) : void
Результат void

SetAnalogOutput() публичный Метод

public SetAnalogOutput ( string channel, double voltage ) : void
channel string
voltage double
Результат void

SetAnalogOutput() публичный Метод

public SetAnalogOutput ( string channelName, double voltage, bool useCalibration ) : void
channelName string
voltage double
useCalibration bool
Результат void

SetDigitalLine() публичный Метод

public SetDigitalLine ( string name, bool value ) : void
name string
value bool
Результат void

SetValue() публичный Метод

public SetValue ( string channel, bool value ) : void
channel string
value bool
Результат void

SetValue() публичный Метод

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
Результат void

SetValue() публичный Метод

public SetValue ( string channel, double value, bool useCalibration ) : void
channel string
value double
useCalibration bool
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

StartCameraControl() публичный Метод

public StartCameraControl ( ) : void
Результат void

StartChamber1PressureMonitor() публичный Метод

public StartChamber1PressureMonitor ( ) : void
Результат void

StartChamber2PressureMonitor() публичный Метод

public StartChamber2PressureMonitor ( ) : void
Результат void

StartMonitoringLaserErrorSignal() публичный Метод

public StartMonitoringLaserErrorSignal ( ) : void
Результат void

StartRemoteControl() публичный Метод

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
Результат void

StopCameraStream() публичный Метод

public StopCameraStream ( ) : void
Результат void

StopChamber1PressureMonitor() публичный Метод

public StopChamber1PressureMonitor ( ) : void
Результат void

StopChamber2PressureMonitor() публичный Метод

public StopChamber2PressureMonitor ( ) : void
Результат void

StopMonitoringLaserErrorSignal() публичный Метод

public StopMonitoringLaserErrorSignal ( ) : void
Результат void

StopRemoteControl() публичный Метод

public StopRemoteControl ( ) : void
Результат void

TSAutoTriggerDisable() публичный Метод

public TSAutoTriggerDisable ( ) : void
Результат void

TSAutoTriggerEnable() публичный Метод

public TSAutoTriggerEnable ( ) : void
Результат void

TSCheckStatus() публичный Метод

public TSCheckStatus ( ) : void
Результат void

TSClear() публичный Метод

public TSClear ( ) : void
Результат void

TSConnect() публичный Метод

public TSConnect ( ) : void
Результат void

TSDisconnect() публичный Метод

public TSDisconnect ( ) : void
Результат void

TSGo() публичный Метод

public TSGo ( ) : void
Результат void

TSHome() публичный Метод

public TSHome ( ) : void
Результат void

TSInitialize() публичный Метод

public TSInitialize ( double acceleration, double deceleration, double distance, double velocity ) : void
acceleration double
deceleration double
distance double
velocity double
Результат void

TSListAll() публичный Метод

public TSListAll ( ) : void
Результат void

TSOff() публичный Метод

public TSOff ( ) : void
Результат void

TSOn() публичный Метод

public TSOn ( ) : void
Результат void

TSRead() публичный Метод

public TSRead ( ) : void
Результат void

TSRestart() публичный Метод

public TSRestart ( ) : void
Результат void

TSReturn() публичный Метод

public TSReturn ( ) : void
Результат void

UpdateHardware() публичный Метод

public UpdateHardware ( ) : void
Результат void

Описание свойств

HCState публичное свойство

public SHCUIControlState HCState
Результат SHCUIControlState

ImageController публичное свойство

public CameraController,IMAQ ImageController
Результат IMAQ.CameraController

LaserLockErrorThreshold публичное свойство

public double LaserLockErrorThreshold
Результат double

c1pStopLock публичное свойство

public object c1pStopLock
Результат object

c2pStopLock публичное свойство

public object c2pStopLock
Результат object

leStopLock публичное свойство

public object leStopLock
Результат object