C# Class MOTMaster.Controller

Here's MOTMaster's controller. Gets a MOTMasterScript (a script contaning a series of commands like "addEdge" for both digital and analog) from user (either remotely or via UI), compiles it, builds a pattern and sends it to hardware.
Inheritance: System.MarshalByRefObject
Show file Open project: ColdMatter/EDMSuite Class Usage Examples

Public Properties

Property Type Description
status RunningState

Public Methods

Method Description
GetExperimentReport ( ) : Object>.Dictionary

This is the mechanism for saving experimental parameters which MM doesn't control, but that the hardware controller can monitor (e.g. oven temperature, vacuum chamber pressure etc).

GrabImage ( int numberOfFrames ) : void
InitializeLifetimeService ( ) : Object
Run ( ) : void
Run ( Object>.Dictionary dict ) : void
RunReplica ( ) : void

This section is meant to be for the situation when you want to re-run exactly the same pattern you ran sometime in the past. armReplicaRun prompts you for a zip file which contains the run you want to replicate. It unzipps the file into a folder of the same name, picks out the dictionary and the script. These then get loaded in the usual way through Run(). disposeReplicaRun does some clean up after the experiment is finished.

RunStart ( ) : void
SaveToggle ( System value ) : void
ScriptLookupAndDisplay ( ) : void
SetBatchNumber ( Int32 number ) : void
SetDictionaryPath ( String path ) : void
SetReplicaRunBool ( System value ) : void
SetScriptPath ( String path ) : void
StartApplication ( ) : void

Private Methods

Method Description
armReplicaRun ( ) : void
armTranslationStageForTimedMotion ( MOTMasterScript script ) : void
buildPattern ( MOTMasterSequence sequence, int patternLength ) : void
checkDataArrived ( ) : void
clearDigitalPattern ( MOTMasterSequence sequence ) : void
compileFromFile ( string scriptPath ) : CompilerResults

/// - Once the user has selected a particular implementation of MOTMasterScript, MOTMaster will compile it. Note: the dll is currently stored in a temp folder somewhere. Its pathToPattern can be found in the CompilerResults.PathToAssembly). This newly formed dll contain methods named GetDigitalPattern and GetAnalogPattern. - These are called by the script's "GetSequence". GetSequence always returns a "MOTMasterSequence", which comprises a PatternBuilder32 and an AnalogPatternBuilder.

disarmAndReturnTranslationStage ( ) : void
displayScripts ( string s ) : void
disposeReplicaRun ( ) : void
finishCameraControl ( ) : void
getSequenceFromScript ( MOTMasterScript script ) : MOTMasterSequence
grabImage ( ) : void
initializeHardware ( MOTMasterSequence sequence ) : void
loadScriptFromDLL ( CompilerResults results ) : MOTMasterScript
prepareCameraControl ( ) : void
prepareScript ( string pathToPattern, Object>.Dictionary dict ) : MOTMasterScript
releaseHardware ( ) : void
releaseHardwareAndClearDigitalPattern ( MOTMasterSequence sequence ) : void
run ( MOTMasterSequence sequence ) : void
runPattern ( MOTMasterSequence sequence ) : void
save ( MOTMasterScript script, string pathToPattern, Object>.Dictionary report ) : void
save ( MOTMasterScript script, string pathToPattern, byte imageData, Object>.Dictionary report ) : void
scriptLookup ( ) : string[]
waitUntilCameraAquisitionIsDone ( ) : bool
waitUntilCameraIsReadyForAcquisition ( ) : bool

Method Details

GetExperimentReport() public method

This is the mechanism for saving experimental parameters which MM doesn't control, but that the hardware controller can monitor (e.g. oven temperature, vacuum chamber pressure etc).
public GetExperimentReport ( ) : Object>.Dictionary
return Object>.Dictionary

GrabImage() public method

public GrabImage ( int numberOfFrames ) : void
numberOfFrames int
return void

InitializeLifetimeService() public method

public InitializeLifetimeService ( ) : Object
return Object

Run() public method

public Run ( ) : void
return void

Run() public method

public Run ( Object>.Dictionary dict ) : void
dict Object>.Dictionary
return void

RunReplica() public method

This section is meant to be for the situation when you want to re-run exactly the same pattern you ran sometime in the past. armReplicaRun prompts you for a zip file which contains the run you want to replicate. It unzipps the file into a folder of the same name, picks out the dictionary and the script. These then get loaded in the usual way through Run(). disposeReplicaRun does some clean up after the experiment is finished.
public RunReplica ( ) : void
return void

RunStart() public method

public RunStart ( ) : void
return void

SaveToggle() public method

public SaveToggle ( System value ) : void
value System
return void

ScriptLookupAndDisplay() public method

public ScriptLookupAndDisplay ( ) : void
return void

SetBatchNumber() public method

public SetBatchNumber ( Int32 number ) : void
number System.Int32
return void

SetDictionaryPath() public method

public SetDictionaryPath ( String path ) : void
path String
return void

SetReplicaRunBool() public method

public SetReplicaRunBool ( System value ) : void
value System
return void

SetScriptPath() public method

public SetScriptPath ( String path ) : void
path String
return void

StartApplication() public method

public StartApplication ( ) : void
return void

Property Details

status public property

public RunningState status
return RunningState