BioImager  4.9.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
BioImager.Objectives Class Reference

Classes

class  Objective
 

Public Member Functions

 Objectives (int count)
 
void SetPosition (int index)
 
int GetPosition ()
 
Objective GetObjective ()
 

Public Attributes

List< ObjectiveList = new List<Objective>()
 
int moveWait = 1000
 

Properties

int Index [get, set]
 

Detailed Description

Definition at line 372 of file Microscope.cs.

Constructor & Destructor Documentation

◆ Objectives()

BioImager.Objectives.Objectives ( int count)

Definition at line 376 of file Microscope.cs.

377 {
378 for (int i = 0; i < count; i++)
379 {
380 List.Add(new Objective(i));
381 }
382 }

Member Function Documentation

◆ GetObjective()

Objective BioImager.Objectives.GetObjective ( )

Definition at line 531 of file Microscope.cs.

532 {
533 int p = 0;
534 try
535 {
536 p = (short)GetPosition();
537 return List[p];
538 }
539 catch (Exception e)
540 {
541 Console.WriteLine(e.ToString());
542 }
543 return new Objective();
544 }

◆ GetPosition()

int BioImager.Objectives.GetPosition ( )

Definition at line 461 of file Microscope.cs.

462 {
463 if (Properties.Settings.Default.LibPath.Contains("MTB"))
464 {
465 BioImager.MicroscopeConsole.Command com = BioImager.MicroscopeConsole.RunCommand
467 return (int)com.doubles[0];
468 }
469 else if (Properties.Settings.Default.LibPath.Contains("Prio"))
470 {
471 return Microscope.sdk.GetNosePiece();
472 }
473 else if(Properties.Settings.Default.PycroManager)
474 {
475 return MicroManager.Objectives.GetPosition();
476 }
477 else if(!Properties.Settings.Default.PMicroscope && Automation.Properties.ContainsKey("GetO1"))
478 {
479 if (Function.Functions.ContainsKey("GetO7"))
480 {
481 bool b;
482 //We check each objective button state to determine which objective we currently are in.
483 b = (bool)Automation.GetProperty("Get01");
484 if (b)
485 return 0;
486 b = (bool)Automation.GetProperty("Get02");
487 if (b)
488 return 1;
489 b = (bool)Automation.GetProperty("Get03");
490 if (b)
491 return 2;
492 b = (bool)Automation.GetProperty("Get04");
493 if (b)
494 return 3;
495 b = (bool)Automation.GetProperty("Get05");
496 if (b)
497 return 4;
498 b = (bool)Automation.GetProperty("Get06");
499 if (b)
500 return 5;
501 b = (bool)Automation.GetProperty("Get07");
502 if (b)
503 return 6;
504 }
505 else
506 {
507 bool b;
508 //We check each objective button state to determine which objective we currently are in.
509 b = (bool)Automation.GetProperty("Get01");
510 if (b)
511 return 0;
512 b = (bool)Automation.GetProperty("Get02");
513 if (b)
514 return 1;
515 b = (bool)Automation.GetProperty("Get03");
516 if (b)
517 return 2;
518 b = (bool)Automation.GetProperty("Get04");
519 if (b)
520 return 3;
521 b = (bool)Automation.GetProperty("Get05");
522 if (b)
523 return 4;
524 b = (bool)Automation.GetProperty("Get06");
525 if (b)
526 return 5;
527 }
528 }
529 return 0;
530 }

◆ SetPosition()

void BioImager.Objectives.SetPosition ( int index)

The function is called with an integer argument, and it sets the microscope objective to that integer

Parameters
indexthe index of the objective to be set
Returns
The return value is a boolean.

Definition at line 438 of file Microscope.cs.

439 {
440 if (Recorder.recordMicroscope)
441 Recorder.AddLine("Microscope.Objectives.SetObjective(" + index + ");");
442 this.index = index;
443 if (!Properties.Settings.Default.LibPath.Contains("MTB") && !Properties.Settings.Default.LibPath.Contains("Prio") && Function.Functions.ContainsKey("SetO" + index))
444 {
445 Function f = Function.Functions["SetO" + index];
446 App.imager.PerformFunction(f);
447 return;
448 }
449 else if(Properties.Settings.Default.LibPath.Contains("MTB"))
450 {
451 BioImager.MicroscopeConsole.RunCommand(
452 new BioImager.MicroscopeConsole.Command(BioImager.MicroscopeConsole.Command.Type.SetObjective, new double[] { index }));
453 this.index = index;
454 }
455 else if(Properties.Settings.Default.PycroManager)
456 {
457 MicroManager.Objectives.SetPosition(index);
458 }
459 }

Member Data Documentation

◆ List

List<Objective> BioImager.Objectives.List = new List<Objective>()

Definition at line 374 of file Microscope.cs.

◆ moveWait

int BioImager.Objectives.moveWait = 1000

Definition at line 413 of file Microscope.cs.

Property Documentation

◆ Index

int BioImager.Objectives.Index
getset

Definition at line 420 of file Microscope.cs.

421 {
422 get
423 {
424 return GetPosition();
425 }
426 set
427 {
428 SetPosition(value);
429 }
430 }
void SetPosition(int index)

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