Beispiel #1
0
            public TP(ushort id, SubP p) : base(id, p)
            {
                OS.GTS.GetBlocksOfType(Controllers, x => x.CanControlShip);
                RotorSusp  = OS.GTS.GetBlockWithName("Suspension Rotor") as IMyMotorStator;
                HingeNeck  = OS.GTS.GetBlockWithName("Neck Hinge") as IMyMotorAdvancedStator;
                RotorSolar = OS.GTS.GetBlockWithName("Solar Rotor") as IMyMotorStator;
                HingeSolar = OS.GTS.GetBlockWithName("Solar Hinge") as IMyMotorAdvancedStator;
                OS.GTS.GetBlocksOfType(HingesSolar, x => x.CustomName.StartsWith("Solar Hinge") && x.CustomName != "Solar Hinge");
                OS.GTS.GetBlocksOfType(Hinges, x => x.CustomName.StartsWith("Suspension"));
                OS.GTS.GetBlocksOfType(Wheels);
                SetCmd("tsp", new Cmd(CmdTurnSolar, "Turn solar panels"));

                if (Controllers.Count == 0 || RotorSusp == null || HingeNeck == null)
                {
                    Terminate("Dalnoboy blocks not found.");
                }
                else
                {
                    if (HingeSolar == null || RotorSolar == null)
                    {
                        Solar = false;
                    }
                    AddAct(ref GC, GetController, 20);
                    AddAct(ref MA, Control, 5, 1);
                }
            }
Beispiel #2
0
            public TP(ushort id, SubP p) : base(id, p)
            {
                loopturn       = false;
                NormWhAng      = 35; Tangle = 0;
                switchingsusp  = false;
                SuspensionMode = SuspensionModes.sport; DriveMode = DriveModes.full;
                FirstStr       = ""; SecondStr = "";
                Wheels         = new List <IMyMotorSuspension>();

                if (
                    (DriverLCD = OS.GTS.GetBlockWithName("Screen Driver") as IMyTextPanel) == null ||
                    (WheelLF = OS.GTS.GetBlockWithName("Wheel Suspension 3x3 LF") as IMyMotorSuspension) == null ||
                    (WheelRF = OS.GTS.GetBlockWithName("Wheel Suspension 3x3 RF") as IMyMotorSuspension) == null ||
                    (WheelLB = OS.GTS.GetBlockWithName("Wheel Suspension 3x3 LB") as IMyMotorSuspension) == null ||
                    (WheelRB = OS.GTS.GetBlockWithName("Wheel Suspension 3x3 RB") as IMyMotorSuspension) == null ||
                    (RemoteDriver = OS.GTS.GetBlockWithName("Control car") as IMyRemoteControl) == null ||
                    (RotorRull = OS.GTS.GetBlockWithName("Rotor rull") as IMyMotorStator) == null
                    )
                {
                    Terminate("Kontur blocks not found.");
                    return;
                }
                Wheels = new List <IMyMotorSuspension>()
                {
                    WheelLF, WheelRF, WheelLB, WheelRB
                };

                string saved = DriverLCD.GetText();

                if (string.IsNullOrEmpty(saved))
                {
                    if (saved.Contains("front"))
                    {
                        DriveMode = DriveModes.front;
                    }
                    else if (saved.Contains("rear"))
                    {
                        DriveMode = DriveModes.rear;
                    }
                    if (saved.Contains("off-road"))
                    {
                        SuspensionMode = SuspensionModes.offroad;
                    }
                    if (saved.Contains("looper"))
                    {
                        loopturn = true;
                    }
                }

                ChangeFirst();

                AddAct(ref MA, Main, 1);

                SetCmd(new Dictionary <string, Cmd>
                {
                    { "sdm", new Cmd(CmdSDM, "Switch drive mode Full/Front/Rear.") },
                    { "ssm", new Cmd(CmdSSM, "Switch suspension mode Sport/Off road.") },
                    { "sl", new Cmd(CmdSL, "Switch loopturn mode.") }
                });
            }
Beispiel #3
0
 public TP(ushort id, SubP p) : base(id, p)
 {
     AddAct(ref GB, GetBlocks, 600, 30);
     SetCmd(new Dictionary <string, Cmd>
     {
         { "int", new Cmd(CmdINT, "Get or set ignore name tag.", "/int - View current ignore name tag;\n/int <string> - Set new ignore name tag.") },
         { "bc", new Cmd(CmdBC, "Get or set breaking constant.", "/bc - View current breaking constant;\n/bc <float> - Set new breaking constant.") },
         { "dboc", new Cmd(CmdDBOC, "Get or set detection blocks over connectors.", "/dboc - View current detection blocks over connectors;\n/dboc <bool> - Set new detection blocks over connectors") }
     });
 }
Beispiel #4
0
 public TP(ushort id, SubP p) : base(id, p)
 {
     if ((LCD = OS.P.GridTerminalSystem.GetBlockWithName("LCD Timer") as IMyTextPanel) == null)
     {
         Terminate("\"LCD Timer\" not found.");
         return;
     }
     SetCmd(new Dictionary <string, Cmd>
     {
         { "ss", new Cmd(CmdSS, "Start/stop timer.") }
     });
 }
Beispiel #5
0
            CAct Act = new CAct(); // Show current tick on text panel

            public TP(ushort id, SubP p) : base(id, p)
            {
                if ((LCD = OS.P.GridTerminalSystem.GetBlockWithName("LCD") as IMyTextPanel) == null)
                {
                    Terminate("\"LCD\" not found.");
                    return;
                }
                AddAct(ref Act, Show, 20);
                SetCmd(new Dictionary <string, Cmd>
                {
                    { "pause", new Cmd(CmdPause, "Pause show current tick.") },
                    { "play", new Cmd(CmdPlay, "Continue show current tick.") },
                });
            }
Beispiel #6
0
 /// <summary>Used by NELBRUS in start to run new subprogram.</summary>
 public SdSubP(ushort id, SubP p) : this(id, p.Name, p.V, p.Description)
 {
 }
Beispiel #7
0
 public TP(ushort id, SubP p) : base(id, p)
 {
     AddAct(ref BSA, BuildSolarArrays, 600);
     AddAct(ref MA, Main, 120, 60 * 3);
 }