public Program() { soundBlock = (IMySoundBlock)GridTerminalSystem.GetBlockWithName(nameSoundBlock); lightBlocks = new List <IMyInteriorLight> { (IMyInteriorLight)GridTerminalSystem.GetBlockWithName(nameLightBlocks[0]), (IMyInteriorLight)GridTerminalSystem.GetBlockWithName(nameLightBlocks[1]) }; lcdPanel = (IMyTextPanel)GridTerminalSystem.GetBlockWithName(nameLCDPanel); bigBadAlertLight = new AlertLight(lightBlocks[0], Color.Yellow, true); biggerBadderAlertLight = new AlertLight(lightBlocks[1]); bigBadAlertSound = new AlertSound(soundBlock); bigBadAlertMessage = new AlertText(lcdPanel, warningMessage, 2f, Color.Blue, Color.Yellow); biggerBadderAlertMessage = new AlertText(lcdPanel, warningMessage2, 3f, Color.Cyan, Color.Red); bigBadAlert = new Alert(new List <AlertObject> { bigBadAlertLight, bigBadAlertMessage, bigBadAlertSound }); biggerBadderAlert = new Alert(new List <AlertObject> { biggerBadderAlertLight, bigBadAlertLight, biggerBadderAlertMessage, bigBadAlertSound }); alertSystemManager = new AlertSystemManager <int>(new Dictionary <int, Alert> { { 0, bigBadAlert }, { 1, biggerBadderAlert } }); }
/// <summary> /// PressurizedAreaController constructor. /// </summary> /// <param name="listExteriorDoors">Doors to non-pressurized area.</param> /// <param name="listInteriorDoors">Doors to pressurized area.</param> /// <param name="listVentsToO2Tanks">Vents to oxygen storage tanks.</param> /// <param name="listVentsToO2Gens">Vents to oxygen generators.</param> /// <param name="o2TanksManager">Oxygen tank manager.</param> /// <param name="alertSystemManager">Alert system manager.</param> public PressurizedAreaController(Area area, Dictionary <AlertStatus, Alert> alertDictionary = null, StatusReport statusReport = null) { this.area = area; if (alertDictionary != null) { alertSystemManager = new AlertSystemManager <AlertStatus>(alertDictionary); } SetStatusReport(statusReport); Pressurize(); }
/// <summary> /// PressurizedAreaController constructor. /// </summary> /// <param name="listExteriorDoors">Doors to non-pressurized area.</param> /// <param name="listInteriorDoors">Doors to pressurized area.</param> /// <param name="listVentsToO2Tanks">Vents to oxygen storage tanks.</param> /// <param name="listVentsToO2Gens">Vents to oxygen generators.</param> /// <param name="o2TanksManager">Oxygen tank manager.</param> /// <param name="alertSystemManager">Alert system manager.</param> public PressurizedAreaController( List <IMyDoor> listExteriorDoors, List <IMyDoor> listInteriorDoors, List <IMyAirVent> listVentsToO2Tanks, List <IMyAirVent> listVentsToO2Gens, GasTanksManager o2TanksManager = null, Dictionary <AlertStatus, Alert> alertDictionary = null, StatusReport statusReport = null) { this.listExteriorDoors = listExteriorDoors; this.listInteriorDoors = listInteriorDoors; this.listVentsToO2Tanks = listVentsToO2Tanks; this.listVentsToO2Gens = listVentsToO2Gens; this.o2TanksManager = o2TanksManager; if (alertDictionary != null) { alertSystemManager = new AlertSystemManager <AlertStatus>(alertDictionary); } SetStatusReport(statusReport); Pressurize(); }
public Program() { blockListManager = new BlockListManager(GridTerminalSystem); blockListManager.AppendBlocksWithNames(exteriorDoorNames, exteriorDoorList); blockListManager.AppendBlocksFromGroupsWithNames(hangerDoorGroupNames, exteriorDoorList); blockListManager.AppendBlocksWithNames(interiorDoorNames, interiorDoorList); blockListManager.AppendBlocksWithNames(airVentToO2GenNames, airVentToO2GenList); blockListManager.AppendBlocksWithNames(airVentToO2TankNames, airVentToO2TankList); blockListManager.AppendBlocksWithNames(O2TankNames, o2TankList); gasTanksManager = new GasTanksManager(o2TankList); gasTanksManager.SetStatusReport(statusReport); alertSystemManager = new AlertSystemManager(); hangerPressureController = new PressurizedAreaController(exteriorDoorList, interiorDoorList, airVentToO2TankList, airVentToO2GenList, gasTanksManager, alertSystemManager, statusReport); Runtime.UpdateFrequency = UpdateFrequency.Update100; }