Esempio n. 1
0
        public int WaitMsForMU(int mu, bool isEDW = false)
        {
            //TODO make not just 600 dr
            var ms = (int)((double)mu / 600 * 60 * 1000) + 2500; //add extra 2.5 sec

            if (isEDW)
            {
                var angle = AccessoryHelper.GetEDWOptions(_session.MachineState.Accessory).Angle;
                switch (angle)
                {
                //These are custom factors to increase time, so we don't move on too quickly
                case ServiceModeTableOptions.EDWAngle._10: ms = (int)(ms * 1.40); break;

                case ServiceModeTableOptions.EDWAngle._15: ms = (int)(ms * 1.40); break;

                case ServiceModeTableOptions.EDWAngle._20: ms = (int)(ms * 1.30); break;

                case ServiceModeTableOptions.EDWAngle._25: ms = (int)(ms * 1.30); break;

                case ServiceModeTableOptions.EDWAngle._30: ms = (int)(ms * 1.30); break;

                case ServiceModeTableOptions.EDWAngle._45: ms = (int)(ms * 1.30); break;

                case ServiceModeTableOptions.EDWAngle._60: ms = (int)(ms * 1.30); break;
                }
            }
            return(ms);
        }
Esempio n. 2
0
        public void SetMachineState(MachineState ms)
        {
            var current         = ServiceModeSession.Instance.MachineState;
            var changingToFixed = !AccessoryHelper.IsEDW(ms.Accessory) && AccessoryHelper.IsEDW(_session.MachineState.Accessory); //Was EDW now is not

            if (machineStatesSet == 0 || changingToFixed)
            {
                BeamManager.SetFixed();
            }

            BeamManager.SetEnergy(ms.Energy);

            //Do mechanical operations first
            //Do Gantry Operations
            _session.MotionManager.SetGantryAutomatic(ms.CollimatorRot, ms.X1, ms.X2, ms.Y1, ms.Y2, ms.GantryRot);
            if (machineStatesSet == 0)
            {
                Thread.Sleep(5000);
            }

            //Do Couch Operations
            _session.MotionManager.SetCouchAutomatic(ms.CouchVert, ms.CouchLng, ms.CouchLat, ms.CouchRot);
            if (machineStatesSet == 0)
            {
                Thread.Sleep(5000);
            }

            if (AccessoryHelper.IsEDW(ms.Accessory))
            {
                var edwOptions = AccessoryHelper.GetEDWOptions(ms.Accessory);
                edwOptions.Y1 = ms.Y1;
                edwOptions.Y2 = ms.Y2;
                _session.MachineState.Accessory = ms.Accessory;
                BeamManager.SetEDW(edwOptions);
            }

            else if (AccessoryHelper.IsElectronCone(ms.Accessory))
            {
                var coneOption = AccessoryHelper.GetElectronCone(ms.Accessory);
                BeamManager.SetCone(coneOption);
                _session.MachineState.Accessory = ms.Accessory;
            }

            BeamManager.SetTime(ms.Time);
            BeamManager.SetMU(ms.MU);

            machineStatesSet++;
        }
Esempio n. 3
0
        public static void SetEDW(EDWOptions edwOptions)
        {
            SetUp();
            SM.Instance.Keyboard.Press("M");
            SM.Instance.ServiceConsoleState.Setup.Current = SetupOptions.MODE;
            SM.Instance.Keyboard.Press("E"); //EDW
            SM.Instance.ServiceConsoleState.Modes.Current = ModeOptions.EDW;
            SM.Instance.Keyboard.Press("N"); // New treatment

            var orientationOp = edwOptions.Orientation == EDWOrientation.Y1IN ? 1 : 2;

            SM.Instance.Keyboard.EnterNumber(orientationOp);
            SM.Instance.Keyboard.PressEnter();
            SM.Instance.Keyboard.EnterNumber(edwOptions.Y1);
            SM.Instance.Keyboard.PressEnter();
            SM.Instance.Keyboard.EnterNumber(edwOptions.Y2);
            SM.Instance.Keyboard.PressEnter();

            var angle = AccessoryHelper.GetEDWAngleNumber(edwOptions.Angle);

            SM.Instance.Keyboard.EnterNumber(angle);
            SM.Instance.Keyboard.PressEnter();
        }