587 {
588 if(FuncType == FunctionType.Key && Script!="")
589 if(imagej)
590 {
591 FuncType = FunctionType.ImageJ;
592 }
593 else
594 FuncType = FunctionType.Script;
595 if (FuncType == Function.FunctionType.Script)
596 {
597 Scripting.RunString(script);
598 }
599 if (FuncType == Function.FunctionType.ImageJ)
600 {
601 ImageJ.RunOnImage(script, false, BioConsole.onTab, BioConsole.useBioformats, BioConsole.newTab);
602 }
603 if (FuncType == Function.FunctionType.Property)
604 {
605 if (Name.StartsWith("Get"))
606 {
607 Automation.Recording r = (Automation.Recording)Automation.Properties[System.IO.Path.GetFileNameWithoutExtension(File)];
608 return r.Get();
609 }
610 else if (Name.StartsWith("Set"))
611 {
612 Automation.Recording r = (Automation.Recording)Automation.Properties[System.IO.Path.GetFileNameWithoutExtension(File)];
613 r.Set(Value.ToString());
614 }
615
616 }
617 if (FuncType == Function.FunctionType.Key)
618 {
619 if (Modifier != VirtualKeyCode.NONAME)
620 {
621 input.Keyboard.ModifiedKeyStroke(Modifier, Key);
622 }
623 else
624 {
625 input.Keyboard.KeyPress(Key);
626 }
627 return null;
628 }
629 if (FuncType == Function.FunctionType.Recording)
630 {
631 Automation.Recording r = (Automation.Recording)Automation.Recordings[System.IO.Path.GetFileNameWithoutExtension(File)];
632 r.Run();
633 }
634 if (FuncType == Function.FunctionType.Objective)
635 {
636 App.imager.PerformFunction(this);
637 }
638 if (FuncType == Function.FunctionType.StoreCoordinate)
639 {
640 App.imager.PerformFunction(this);
641 }
642 if (FuncType == Function.FunctionType.NextCoordinate)
643 {
644 App.imager.PerformFunction(this);
645 }
646 if (FuncType == Function.FunctionType.PreviousCoordinate)
647 {
648 App.imager.PerformFunction(this);
649 }
650 if (FuncType == Function.FunctionType.NextSnapCoordinate)
651 {
652 App.imager.PerformFunction(this);
653 }
654 if (FuncType == Function.FunctionType.PreviousSnapCoordinate)
655 {
656 App.imager.PerformFunction(this);
657 }
658 if (FuncType == Function.FunctionType.StageUp)
659 {
660 Microscope.MoveUp(Value);
661 }
662 if (FuncType == Function.FunctionType.StageRight)
663 {
664 Microscope.MoveRight(Value);
665 }
666 if (FuncType == Function.FunctionType.StageDown)
667 {
668 Microscope.MoveDown(Value);
669 }
670 if (FuncType == Function.FunctionType.StageLeft)
671 {
672 Microscope.MoveLeft(Value);
673 }
674 if (FuncType == Function.FunctionType.FocusUp)
675 {
676 Microscope.SetFocus(Value);
677 }
678 if (FuncType == Function.FunctionType.FocusDown)
679 {
680 Microscope.SetFocus(-Value);
681 }
682 if (FuncType == Function.FunctionType.StageFieldUp)
683 {
684 Microscope.MoveFieldUp();
685 }
686 if (FuncType == Function.FunctionType.StageFieldRight)
687 {
688 Microscope.MoveFieldRight();
689 }
690 if (FuncType == Function.FunctionType.StageFieldDown)
691 {
692 Microscope.MoveFieldDown();
693 }
694 if (FuncType == Function.FunctionType.StageFieldLeft)
695 {
696 Microscope.MoveFieldLeft();
697 }
698 if (FuncType == Function.FunctionType.TakeImage)
699 {
700 Microscope.TakeImage();
701 }
702 if (FuncType == Function.FunctionType.TakeImageStack)
703 {
704 Microscope.TakeImageStack();
705 }
706 if (FuncType == Function.FunctionType.RL)
707 {
708 Microscope.RLShutter.SetPosition((int)Value);
709 }
710 if (FuncType == Function.FunctionType.TL)
711 {
712 Microscope.TLShutter.SetPosition((int)Value);
713 }
714 return null;
715 }