BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
BioImager.Automation Class Reference

Classes

class  Action
 
class  AutomationHelpers
 
class  Recording
 

Static Public Member Functions

static void StartRecording ()
 It starts recording. More...
 
static void StopRecording ()
 It stops the recording and adds it to the list of recordings. More...
 
static void StartPropertyRecording (string name)
 

‍Start recording the properties of the current object

More...
 
static void StopPropertyRecording ()
 Stop recording the property and add it to the list of properties. More...
 
static object GetProperty (string prop)
 
static void SetProperty (string prop, string val)
 
static void AddProperty (Recording rec)
 
static void RunRecording (string prop)
 

Static Public Attributes

static InputSimulator input
 
static Dictionary< string, RecordingRecordings = new Dictionary<string, Recording>()
 
static Dictionary< string, RecordingProperties = new Dictionary<string, Recording>()
 
static UIA3Automation automation = new UIA3Automation()
 
static Recording rec = new Recording()
 
static string recname
 

Properties

static bool IsRecording [get]
 
static AutomationElement Element [get]
 

Detailed Description

Definition at line 11 of file Automation.cs.

Constructor & Destructor Documentation

◆ Automation()

BioImager.Automation.Automation ( )

Definition at line 387 of file Automation.cs.

388 {
389 m_GlobalHook = Hook.GlobalEvents();
390 m_GlobalHook.MouseDownExt += GlobalHookMouseDownExt;
391 m_GlobalHook.MouseUpExt += GlobalHookMouseUpExt;
392 m_GlobalHook.MouseMoveExt += GlobalHookMouseMoveExt;
393 m_GlobalHook.KeyPress += GlobalHookKeyPress;
394 m_GlobalHook.KeyUp += GlobalHookKeyUp;
395 m_GlobalHook.KeyDown += GlobalHookKeyDown;
396 m_GlobalHook.MouseWheel += GlobalHookMouseWheel;
397 input = new InputSimulator();
398 }

Member Function Documentation

◆ AddProperty()

static void BioImager.Automation.AddProperty ( Recording  rec)
static

If the dictionary contains the key, then update the value. Otherwise, add the key and value to the dictionary

Parameters
Recording

Definition at line 469 of file Automation.cs.

470 {
471 if (Properties.ContainsKey(rec.Name))
472 Properties[rec.Name] = rec;
473 else
474 Properties.Add(rec.Name, rec);
475 }

◆ GetProperty()

static object BioImager.Automation.GetProperty ( string  prop)
static

It takes a string as an argument, and returns an object

Parameters
propThe name of the property to get.
Returns
The value of the property.

Definition at line 450 of file Automation.cs.

451 {
452 Recorder.AddLine("Automation.GetProperty(" + '"' + prop + '"' + ");");
453 return Properties[prop].Get();
454 }

Referenced by BioImager.Focus.GetFocus().

◆ RunRecording()

static void BioImager.Automation.RunRecording ( string  prop)
static

Runs a recording from the Properties collection

Parameters
propThe name of the recording you want to run.

Definition at line 479 of file Automation.cs.

480 {
481 Recording rec = (Recording)Properties[prop];
482 rec.Run();
483 Recorder.AddLine("Automation.RunRecording(" + '"' + prop + '"' + ");");
484 }

◆ SetProperty()

static void BioImager.Automation.SetProperty ( string  prop,
string  val 
)
static

It takes a property name and a value, and sets the property to the value

Parameters
propThe name of the property you want to set.
valThe value to set the property to.

Definition at line 459 of file Automation.cs.

460 {
461 Recording rec = (Recording)Properties[prop];
462 rec.Set(val);
463 Recorder.AddLine("Automation.SetProperty(" + '"' + prop + '"' + "," + '"' + val + '"' + ");");
464 }

Referenced by BioImager.Focus.SetFocus().

◆ StartPropertyRecording()

static void BioImager.Automation.StartPropertyRecording ( string  name)
static

‍Start recording the properties of the current object

Definition at line 432 of file Automation.cs.

433 {
434 recording = true;
435 recname = name;
436 rec = new Recording();
437 rec.Name = recname;
438 }

◆ StartRecording()

static void BioImager.Automation.StartRecording ( )
static

It starts recording.

Definition at line 418 of file Automation.cs.

419 {
420 recording = true;
421 rec = new Recording();
422 }

◆ StopPropertyRecording()

static void BioImager.Automation.StopPropertyRecording ( )
static

Stop recording the property and add it to the list of properties.

Definition at line 440 of file Automation.cs.

441 {
442 recording = false;
443 Properties.Add(rec.Name,rec);
444 }

◆ StopRecording()

static void BioImager.Automation.StopRecording ( )
static

It stops the recording and adds it to the list of recordings.

Definition at line 424 of file Automation.cs.

425 {
426 recording=false;
427 rec.Name = recname;
428 Recordings.Add(rec.Name,rec);
429 }

Member Data Documentation

◆ automation

UIA3Automation BioImager.Automation.automation = new UIA3Automation()
static

Definition at line 16 of file Automation.cs.

◆ input

InputSimulator BioImager.Automation.input
static

Definition at line 13 of file Automation.cs.

◆ Properties

Dictionary<string, Recording> BioImager.Automation.Properties = new Dictionary<string, Recording>()
static

Definition at line 15 of file Automation.cs.

◆ rec

Recording BioImager.Automation.rec = new Recording()
static

Definition at line 385 of file Automation.cs.

◆ recname

string BioImager.Automation.recname
static

Definition at line 430 of file Automation.cs.

◆ Recordings

Dictionary<string, Recording> BioImager.Automation.Recordings = new Dictionary<string, Recording>()
static

Definition at line 14 of file Automation.cs.

Property Documentation

◆ Element

AutomationElement BioImager.Automation.Element
staticget

Definition at line 402 of file Automation.cs.

403 {
404 get
405 {
406 try
407 {
408 return automation.FromPoint(new Point(Cursor.Position.X, Cursor.Position.Y));
409 }
410 catch (Exception)
411 {
412
413 }
414 return null;
415 }
416 }

◆ IsRecording

bool BioImager.Automation.IsRecording
staticget

Definition at line 377 of file Automation.cs.

378 {
379 get { return recording; }
380 }

The documentation for this class was generated from the following file: