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.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 371 of file Microscope.cs.

Constructor & Destructor Documentation

◆ Objectives()

BioImager.Objectives.Objectives ( int  count)

Definition at line 375 of file Microscope.cs.

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

Member Function Documentation

◆ GetObjective()

Objective BioImager.Objectives.GetObjective ( )

Definition at line 530 of file Microscope.cs.

531 {
532 return List[(short)GetPosition()];
533 }

◆ GetPosition()

int BioImager.Objectives.GetPosition ( )

Definition at line 460 of file Microscope.cs.

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

◆ 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 437 of file Microscope.cs.

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

References BioImager.Imager.PerformFunction().

Member Data Documentation

◆ List

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

Definition at line 373 of file Microscope.cs.

◆ moveWait

int BioImager.Objectives.moveWait = 1000

Definition at line 412 of file Microscope.cs.

Property Documentation

◆ Index

int BioImager.Objectives.Index
getset

Definition at line 419 of file Microscope.cs.

420 {
421 get
422 {
423 return GetPosition();
424 }
425 set
426 {
427 SetPosition(value);
428 }
429 }
void SetPosition(int index)
Definition: Microscope.cs:437

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