示例#1
0
        public void ClearLights()
        {
            SideControl    L = _sws.LeftInput;
            SideControl    R = _sws.RightInput;
            ConsoleControl C = _sws.ConsoleInput;

            lock (L)
            {
                L.LEDs.Clear();
            }
            lock (R)
            {
                R.LEDs.Clear();
            }
            lock (C)
            {
                C.LEDs.Clear();
            }

            RgbLedControl.clearLED(L.rgbLed.EightControlLED);
            RgbLedControl.clearLED(L.rgbLed.MatrixControlLED);
            RgbLedControl.clearLED(L.rgbLed.MatrixGuideLED);
            RgbLedControl.clearLED(L.rgbLed.MatrixLED);
            RgbLedControl.clearLED(L.rgbLed.TargetControlLED);
            RgbLedControl.clearLED(L.rgbLed.ThrottleLED);

            RgbLedControl.clearLED(R.rgbLed.EightControlLED);
            RgbLedControl.clearLED(R.rgbLed.MatrixControlLED);
            RgbLedControl.clearLED(R.rgbLed.MatrixGuideLED);
            RgbLedControl.clearLED(R.rgbLed.MatrixLED);
            RgbLedControl.clearLED(R.rgbLed.TargetControlLED);
            RgbLedControl.clearLED(R.rgbLed.ThrottleLED);

            RgbLedControl.clearLED(C.rgbLed.CenterToggleLeftLED);
            RgbLedControl.clearLED(C.rgbLed.CenterToggleRightLED);

            RgbLedControl.clearLED(C.rgbLed.PowerFarLeftLED);
            RgbLedControl.clearLED(C.rgbLed.PowerFarRightLED);
            RgbLedControl.clearLED(C.rgbLed.PowerNearLeftLED);
            RgbLedControl.clearLED(C.rgbLed.PowerNearRightLED);
            RgbLedControl.clearLED(C.rgbLed.RotLeftLED);
            RgbLedControl.clearLED(C.rgbLed.RotRightLED);
            RgbLedControl.clearLED(C.rgbLed.TopLeftToggleLED);
            RgbLedControl.clearLED(C.rgbLed.TopRightToggleLED);
        }
示例#2
0
        void SetPanelLeds()
        {
            SideControl    L = _sws.LeftInput;
            SideControl    R = _sws.RightInput;
            ConsoleControl C = _sws.ConsoleInput;
            Starship       S = _sws.PCShip;

            C.LEDs.SetOn(ListOf_ConsoleOutputs.FlightStickLED);

            //Panel Control Toggle
            if (C.Buttons.IsDown(ListOf_ConsoleInputs.TopLeftToggle1))
            {
                C.rgbLed.TopLeftToggleLED[0] = 1;
            }
            else
            {
                C.rgbLed.TopLeftToggleLED[1] = 1;
            }
            if (C.Buttons.IsDown(ListOf_ConsoleInputs.TopLeftToggle2))
            {
                C.rgbLed.TopLeftToggleLED[2] = 1;
            }
            else
            {
                C.rgbLed.TopLeftToggleLED[3] = 1;
            }

            if (C.Buttons.IsDown(ListOf_ConsoleInputs.TopRightToggle1))
            {
                C.rgbLed.TopRightToggleLED[0] = 1;
            }
            else
            {
                C.rgbLed.TopRightToggleLED[1] = 1;
            }
            if (C.Buttons.IsDown(ListOf_ConsoleInputs.TopRightToggle2))
            {
                C.rgbLed.TopRightToggleLED[2] = 1;
            }
            else
            {
                C.rgbLed.TopRightToggleLED[3] = 1;
            }

            RgbLedControl.clearLED(C.rgbLed.PowerFarLeftLED, 5);
            RgbLedControl.clearLED(C.rgbLed.PowerNearLeftLED, 5);
            RgbLedControl.clearLED(C.rgbLed.PowerFarRightLED, 5);
            RgbLedControl.clearLED(C.rgbLed.PowerNearRightLED, 5);

            for (int i = 0; i < S.reactorControl.powerRouting.CM; i++)
            {
                C.rgbLed.PowerFarLeftLED[i] = 1;
            }
            for (int i = 0; i < S.reactorControl.powerRouting.Tact; i++)
            {
                C.rgbLed.PowerNearLeftLED[i] = 1;
            }
            for (int i = 0; i < S.reactorControl.powerRouting.Prop; i++)
            {
                C.rgbLed.PowerNearRightLED[i] = 1;
            }
            for (int i = 0; i < S.reactorControl.powerRouting.Aux; i++)
            {
                C.rgbLed.PowerFarRightLED[i] = 1;
            }


            //Set Led on and off Color
            C.rgbLed.ColorIndex[0] = Color.FromArgb(C.AnalogInput(0), C.AnalogInput(1), C.AnalogInput(2));
            C.rgbLed.ColorIndex[1] = Color.FromArgb(0, 0, 0);

            L.rgbLed.ColorIndex[0] = Color.FromArgb(C.AnalogInput(0), C.AnalogInput(1), C.AnalogInput(2));
            L.rgbLed.ColorIndex[1] = Color.FromArgb(0, 0, 0);

            R.rgbLed.ColorIndex[0] = Color.FromArgb(C.AnalogInput(0), C.AnalogInput(1), C.AnalogInput(2));
            R.rgbLed.ColorIndex[1] = Color.FromArgb(0, 0, 0);

            //Set Engine Speed
            for (int i = 0; i < _sws.PCShip.EngineSpeed / 30; i++)
            {
                if (i < 5)
                {
                    L.rgbLed.ThrottleLED[i] = 1;
                    R.rgbLed.ThrottleLED[i] = 1;
                }
            }
            SetAlerts(S.LeftControlInterface, L);
            SetAlerts(S.RightControlInterface, R);
            SetAlerts(S.CenterControlInterface, null, C);
        }