public ScanBase(Program program, WicoControl wicoControl)
 {
     _program     = program;
     _wicoControl = wicoControl;
     _program.AddLoadHandler(LoadHandler);
     _program.AddSaveHandler(SaveHandler);
 }
Beispiel #2
0
            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);
            }
Beispiel #3
0
            public WicoElapsedTime(Program program, WicoControl wicoControl)
            {
                _program     = program;
                _wicoControl = wicoControl;

                _bDebug = _program._CustomDataIni.Get(wicoETString, "Debug").ToBoolean(_bDebug);
                _program._CustomDataIni.Set(wicoETString, "Debug", _bDebug);
            }
        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 Asteroids(Program program, WicoControl wicoControl, WicoIGC wicoIGC, Displays displays)
            {
                _program     = program;
                _wicoControl = wicoControl;
                _wicoIGC     = wicoIGC;
                _displays    = displays;

                _program.AddLoadHandler(LoadHandler);
                _program.AddSaveHandler(SaveHandler);
                _wicoIGC.AddPublicHandler(sAsteroidTag, BroadcastHandler);

                _displays.AddSurfaceHandler("ASTEROIDS", SurfaceHandler);
            }
Beispiel #6
0
            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);
                }
            }
Beispiel #7
0
        void ModuleControlInit()
        {
//            _wicoControl = new WicoUpdateModesShared(this);
            _wicoControl = new WicoControl(this);
        }
Beispiel #8
0
 public WicoElapsedTime(Program program, WicoControl wicoControl)
 {
     _program     = program;
     _wicoControl = wicoControl;
 }
Beispiel #9
0
 void ModuleControlInit()
 {
     // create the appropriate control system for this module
     _wicoControl = new WicoControl(this);
 }
Beispiel #10
0
        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!");
            }
        }
Beispiel #11
0
        void ModuleControlInit()
        {
            _wicoControl = new WicoControl(this);
//            _wicoControl.SetDebug(true);
        }