private static void Tba_EnergyChange(string energyId, TbaPopup popup) { ui.Write($"Changing energy to {energyId}"); linac.StopBeam(); var current = linac.GetMachineStateCopy(); switch (energyId) { case "6 MV": current.Energy = Autodrive.Linacs.Energy._6X; break; case "15 MV": current.Energy = Autodrive.Linacs.Energy._15X; break; case "6 MeV": current.Energy = Autodrive.Linacs.Energy._6MeV; break; case "9 MeV": current.Energy = Autodrive.Linacs.Energy._9MeV; break; case "12 MeV": current.Energy = Autodrive.Linacs.Energy._12MeV; break; case "15 MeV": current.Energy = Autodrive.Linacs.Energy._15MeV; break; case "18 MeV": current.Energy = Autodrive.Linacs.Energy._18MeV; break; } linac.SetMachineState(current); popup.ResetEvent.Set(); //Allow to move on }
private static void Tba_PopupOpsCompleted(TbaPopup popup) { //Beam on linac.BeamOn(); //Close popup popup.PressOk(); //Resubscribe to popups tba.ListenForPopup(); }
private static void Tba_FieldSizeChange(double x, double y, TbaPopup popup) { ui.Write($"Changing field size to {x} x {y}"); linac.StopBeam(); var current = linac.GetMachineStateCopy(); current.X1 = current.X2 = x / 2; current.Y1 = current.Y2 = x / 2; linac.SetMachineState(current); popup.ResetEvent.Set(); //Allow to move on }
private static void Tba_ApplicatorChange(string applicatorId, TbaPopup popup) { //Alert User - Need human for this part Console.Beep(300, 1); linac.StopBeam(); ui.WritePrompt($"You must change the applicator to {applicatorId}"); ui.WritePrompt($"Press ENTER when complete"); while (Console.ReadKey().Key != ConsoleKey.Enter) { } var current = linac.GetMachineStateCopy(); current.Accessory = applicatorId; linac.SetMachineState(current); popup.ResetEvent.Set(); //Allow to move on }