public ScansMode(Program program, WicoControl wicoControl, WicoBlockMaster wicoBlockMaster, WicoIGC igc, Cameras cameras, Asteroids asteroids ) : base(program, wicoControl) { _program = program; _wicoControl = wicoControl; _wicoBlockMaster = wicoBlockMaster; _wicoIGC = igc; _cameras = cameras; _asteroids = asteroids; _program.moduleName += " Scans"; _program.moduleList += "\nScans V4.1"; // _program._CustomDataIni.Get(sNavSection, "NAVEmulateOld").ToBoolean(NAVEmulateOld); // _program._CustomDataIni.Set(sNavSection, "NAVEmulateOld", NAVEmulateOld); _program.AddUpdateHandler(UpdateHandler); _program.AddTriggerHandler(ProcessTrigger); _program.AddLoadHandler(LoadHandler); _program.AddSaveHandler(SaveHandler); _wicoControl.AddModeInitHandler(ModeInitHandler); _wicoControl.AddControlChangeHandler(ModeChangeHandler); _wicoBlockMaster.AddLocalBlockChangedHandler(LocalGridChangedHandler); _wicoIGC.AddPublicHandler(NavCommon.WICOB_NAVADDTARGET, BroadcastHandler); _wicoIGC.AddPublicHandler(NavCommon.WICOB_NAVRESET, BroadcastHandler); _wicoIGC.AddPublicHandler(NavCommon.WICOB_NAVSTART, BroadcastHandler); }
public WicoThrusters(Program program, WicoBlockMaster wicoBlockMaster) { _program = program; _wicoBlockMaster = wicoBlockMaster; ThrustersInit(); }
public BaseConnectors(Program program, WicoBlockMaster wbm, WicoIGC wicoIGC, WicoElapsedTime wicoElapsedTime) { _program = program; _wicoBlockMaster = wbm; _wicoIGC = wicoIGC; _wicoElapsedTime = wicoElapsedTime; _program.moduleName += " Base Connectors"; _program.moduleList += "\nBase Connectors V4.0"; _program.AddUpdateHandler(UpdateHandler); _program.AddTriggerHandler(ProcessTrigger); _program.AddLoadHandler(LoadHandler); _program.AddSaveHandler(SaveHandler); _program.AddPostInitHandler(PostInitHandler); // _program.AddResetMotionHandler(ResetMotionHandler); _wicoBlockMaster.AddLocalBlockChangedHandler(LocalGridChangedHandler); _wicoBlockMaster.AddLocalBlockHandler(BlockParseHandler); // _program._CustomDataIni.Get(sBaseSection, "BaseTransmitWait").ToDouble(dBaseTransmitWait); // _program._CustomDataIni.Set(sBaseSection, "BaseTransmitWait", dBaseTransmitWait); _wicoIGC.AddPublicHandler("BASE?", BroadcastHandler); _wicoIGC.AddPublicHandler("CON?", BroadcastHandler); _wicoIGC.AddPublicHandler("COND?", BroadcastHandler); // wicoControl.AddModeInitHandler(ModeInitHandler); // wicoControl.AddControlChangeHandler(ModeChangeHandler); _wicoElapsedTime.AddTimer(_BaseTransmit, 55, BaseTransmitTimerHandler); _wicoElapsedTime.StartTimer(_BaseTransmit); }
public WicoGyros(Program program, WicoBlockMaster wbm) { _program = program; _wicoBlockMaster = wbm; GyrosInit(); }
public Sensors(Program program, WicoBlockMaster wicoBlockMaster) { _program = program; _wicoBlockMaster = wicoBlockMaster; _wicoBlockMaster.AddLocalBlockHandler(BlockParseHandler); _wicoBlockMaster.AddLocalBlockChangedHandler(LocalGridChangedHandler); _program.AddPostInitHandler(PostInitHandler()); }
public Timers(Program program, WicoBlockMaster wbm) { thisProgram = program; wicoBlockMaster = wbm; wicoBlockMaster.AddLocalBlockHandler(BlockParseHandler); wicoBlockMaster.AddLocalBlockChangedHandler(LocalGridChangedHandler); }
public Drills(Program program, WicoBlockMaster wicoBlockMaster) { thisProgram = program; WicoBlockMaster = wicoBlockMaster; WicoBlockMaster.AddLocalBlockHandler(BlockParseHandler); WicoBlockMaster.AddLocalBlockChangedHandler(LocalGridChangedHandler); thisProgram.AddPostInitHandler(PostInitHandler); }
public Program() { MyIniParseResult result; if (!_CustomDataIni.TryParse(Me.CustomData, out result)) { Me.CustomData = ""; _CustomDataIni.Clear(); Echo(result.ToString()); //throw new Exception(result.ToString()); } if (!_SaveIni.TryParse(Storage, out result)) { Storage = ""; _SaveIni.Clear(); Echo(result.ToString()); // throw new Exception(result.ToString()); } wicoIGC = new WicoIGC(this); // Must be first as some use it in constructor wicoBlockMaster = new WicoBlockMaster(this); // must be before any other block-oriented modules wicoControl = new WicoControl(this); ModuleProgramInit(); Runtime.UpdateFrequency |= UpdateFrequency.Once; // cause ourselves to run again to continue initialization // Local PB Surface Init if (Me.SurfaceCount > 1) { mesurface0 = Me.GetSurface(0); mesurface0.ContentType = VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE; mesurface0.WriteText(OurName + sVersion + moduleList); mesurface0.FontSize = 2; mesurface0.Alignment = VRage.Game.GUI.TextPanel.TextAlignment.CENTER; } if (Me.SurfaceCount > 2) { mesurface1 = Me.GetSurface(1); mesurface1.ContentType = VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE; mesurface1.WriteText("Version: " + sVersion); mesurface1.Alignment = VRage.Game.GUI.TextPanel.TextAlignment.CENTER; mesurface1.TextPadding = 0.25f; mesurface1.FontSize = 3.5f; } if (!Me.CustomName.Contains(moduleName)) { Me.CustomName = "PB" + moduleName; } if (!Me.Enabled) { Echo("I am turned OFF!"); } }
public GasTanks(Program program, WicoBlockMaster wicoBlockMaster) { _program = program; wbm = wicoBlockMaster; wbm.AddLocalBlockHandler(BlockParseHandler); wbm.AddLocalBlockChangedHandler(LocalGridChangedHandler); tankspcthigh = _program._CustomDataIni.Get(_tanksSection, "tankspcthigh").ToInt32(tankspcthigh); _program._CustomDataIni.Set(_tanksSection, "tankspcthigh", tankspcthigh); tankspctlow = _program._CustomDataIni.Get(_tanksSection, "tankspctlow").ToInt32(tankspctlow); _program._CustomDataIni.Set(_tanksSection, "tankspctlow", tankspctlow); }
public CargoCheck(Program program, WicoBlockMaster wbm) { _program = program; _wicoBlockMaster = wbm; _wicoBlockMaster.AddLocalBlockHandler(BlockParseHandler); _wicoBlockMaster.AddLocalBlockChangedHandler(LocalGridChangedHandler); _program.AddLoadHandler(LoadHandler); _program.AddSaveHandler(SaveHandler); cargopctmin = _program._CustomDataIni.Get(sCargoSection, "cargopctmin").ToInt32(cargopctmin); _program._CustomDataIni.Set(sCargoSection, "cargopctmin", cargopctmin); }
public Displays(Program program, WicoBlockMaster wicoBlockMaster, WicoElapsedTime wicoElapsedTime) { _program = program; _wicoBlockMaster = wicoBlockMaster; _wicoElapsedTime = wicoElapsedTime; _wicoBlockMaster.AddLocalBlockHandler(BlockParseHandler); _wicoBlockMaster.AddLocalBlockChangedHandler(LocalGridChangedHandler); _program.AddPostInitHandler(PostInitHandler()); _wicoElapsedTime.AddTimer(DisplayCheckTimer, DisplayInterval, ElapsedTimerHandler); _wicoElapsedTime.StartTimer(DisplayCheckTimer); }
public PowerProduction(Program program, WicoBlockMaster wbm) { _program = program; _wicoBlockMaster = wbm; _wicoBlockMaster.AddLocalBlockHandler(BlockParseHandler); _wicoBlockMaster.AddLocalBlockChangedHandler(LocalGridChangedHandler); _program.AddLoadHandler(LoadHandler); _program.AddSaveHandler(SaveHandler); batterypcthigh = _program._CustomDataIni.Get(sPowerSection, "batterypcthigh").ToInt32(batterypcthigh); _program._CustomDataIni.Set(sPowerSection, "batterypcthigh", batterypcthigh); batterypctlow = _program._CustomDataIni.Get(sPowerSection, "batterypctlow").ToInt32(batterypctlow); _program._CustomDataIni.Set(sPowerSection, "batterypctlow", batterypctlow); }
public Ores(Program program, WicoBlockMaster wbm, WicoControl wicoControl, WicoIGC wicoIGC, Asteroids asteroids, Displays displays) : base(program, wbm, null) { _program = program; _wicoBlockMaster = wbm; _wicoControl = wicoControl; _wicoIGC = wicoIGC; _asteroids = asteroids; _displays = displays; _program.AddLoadHandler(LoadHandler); _program.AddSaveHandler(SaveHandler); _wicoIGC.AddPublicHandler(sOreTag, BroadcastHandler); if (_displays != null) { _displays.AddSurfaceHandler("ORELOCS", SurfaceHandler); } }
public CargoCheck(Program program, WicoBlockMaster wbm, Displays displays) { _program = program; _wicoBlockMaster = wbm; _displays = displays; _wicoBlockMaster.AddLocalBlockHandler(BlockParseHandler); _wicoBlockMaster.AddLocalBlockChangedHandler(LocalGridChangedHandler); _program.AddLoadHandler(LoadHandler); _program.AddSaveHandler(SaveHandler); cargopctmin = _program._CustomDataIni.Get(sCargoSection, "cargopctmin").ToInt32(cargopctmin); _program._CustomDataIni.Set(sCargoSection, "cargopctmin", cargopctmin); cargohighwater = _program._CustomDataIni.Get(sCargoSection, "cargohighwater").ToInt32(cargohighwater); _program._CustomDataIni.Set(sCargoSection, "cargohighwater", cargohighwater); if (_displays != null) { _displays.AddSurfaceHandler("CARGOCHECK", SurfaceHandler); } }
public Program() { if (Me.TerminalRunArgument == "--clear") { Me.CustomData = ""; Storage = ""; } MyIniParseResult result; if (!_CustomDataIni.TryParse(Me.CustomData, out result)) { Me.CustomData = ""; _CustomDataIni.Clear(); Echo(result.ToString()); } if (!_SaveIni.TryParse(Storage, out result)) { Storage = ""; _SaveIni.Clear(); Echo(result.ToString()); } long meentityid = 0; _SaveIni.Get(OurName + sVersion, "MEENITYID").TryGetInt64(out meentityid); if (meentityid != Me.EntityId) { // what's in storage was not created by this blueprint; clear it out. ErrorLog("New instance:Resetting Storage"); Storage = ""; _SaveIni.Clear(); } _SaveIni.Set(OurName + sVersion, "MEENITYID", Me.EntityId); wicoIGC = new WicoIGC(this); // Must be first as some use it in constructor wicoBlockMaster = new WicoBlockMaster(this); // must be before any other block-oriented modules ModuleControlInit(); wicoElapsedTime = new WicoElapsedTime(this, _wicoControl); ModuleProgramInit(); Runtime.UpdateFrequency |= UpdateFrequency.Once; // cause ourselves to run again to continue initialization // Local PB Surface Init if (Me.SurfaceCount > 1) { mesurface0 = Me.GetSurface(0); mesurface0.ContentType = VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE; mesurface0.WriteText(OurName + sVersion + moduleList); mesurface0.FontSize = 2; mesurface0.Alignment = VRage.Game.GUI.TextPanel.TextAlignment.CENTER; } if (Me.SurfaceCount > 2) { mesurface1 = Me.GetSurface(1); mesurface1.ContentType = VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE; mesurface1.WriteText("Version: " + sVersion); mesurface1.Alignment = VRage.Game.GUI.TextPanel.TextAlignment.CENTER; mesurface1.TextPadding = 0.25f; mesurface1.FontSize = 3.5f; } if (!Me.CustomName.Contains(moduleName)) { Me.CustomName = "PB" + moduleName; } if (!Me.Enabled) { Echo("I am turned OFF!"); } }
public Program() { MyIniParseResult result; if (!_CustomDataIni.TryParse(Me.CustomData, out result)) { Me.CustomData = ""; _CustomDataIni.Clear(); Echo(result.ToString()); //throw new Exception(result.ToString()); } if (!_SaveIni.TryParse(Storage, out result)) { Storage = ""; _SaveIni.Clear(); Echo(result.ToString()); // throw new Exception(result.ToString()); } wicoIGC = new WicoIGC(this); // Must be first as some use it in constructor wicoBlockMaster = new WicoBlockMaster(this); // must be before any other block-oriented modules wicoControl = new WicoControl(this); // wicoTravelMovement = new TravelMovement(this); wicoThrusters = new WicoThrusters(this); wicoGyros = new WicoGyros(this, null); wicoGasTanks = new GasTanks(this); wicoGasGens = new GasGens(this); wicoConnectors = new Connectors(this); wicoLandingGears = new LandingGears(this); wicoCameras = new Cameras(this); wicoParachutes = new Parachutes(this); wicoNavRotors = new NavRotors(this); wicoAntennas = new Antennas(this); wicoSensors = new Sensors(this, wicoBlockMaster.GetMainController()); wicoWheels = new Wheels(this); wicoOrbitalLaunch = new OrbitalModes(this); // wicoNavigation = new Navigation(this, wicoBlockMaster.GetMainController()); Runtime.UpdateFrequency |= UpdateFrequency.Once; // cause ourselves to run again to continue initialization // Local PB Surface Init mesurface0 = Me.GetSurface(0); mesurface1 = Me.GetSurface(1); mesurface0.ContentType = VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE; mesurface0.WriteText("Wicorel Modular"); mesurface0.FontSize = 2; mesurface0.Alignment = VRage.Game.GUI.TextPanel.TextAlignment.CENTER; mesurface1.ContentType = VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE; mesurface1.WriteText("Version: 1"); mesurface1.Alignment = VRage.Game.GUI.TextPanel.TextAlignment.CENTER; mesurface1.TextPadding = 0.25f; mesurface1.FontSize = 3.5f; if (!Me.Enabled) { Echo("I am turned OFF!"); } }