예제 #1
0
        /// <summary>
        /// Initialisiert die Roboter-Konsole mit den dazugehörigen LED's und Schalter.
        /// </summary>
        public RobotConsole(RunMode runMode)
        {
            if (!Constants.IsWinCE) runMode = RunMode.Virtual;

            if (runMode == RunMode.Virtual)
            {
                digitalIn = new DigitalInSim();
                digitalOut = new DigitalOutSim();

            }
            else
            {
              //  digitalIn = new DigitalInHW(Constants.IOConsoleSWITCH);
                digitalIn = new DigitalInHW(Constants.IOConsoleSWITCH);
                digitalOut = new DigitalOutHW(Constants.IOConsoleLED);
            }

            this.leds = new Led[4];
            for (int i = 0; i < this.leds.Length; i++)
            {
                leds[i] = new Led(digitalOut,(Leds)i);
            }

            this.blinkingLeds = new BlinkingLed[4];
            for (int i = 0; i < this.blinkingLeds.Length; i++)
            {
                blinkingLeds[i] = new BlinkingLed(digitalOut, (BlinkingLeds)i);
            }

            this.switches = new Switch[4];
            for (int i = 0; i < this.switches.Length; i++)
            {
                switches[i] = new Switch(digitalIn, (Switches)i);
            }
        }
예제 #2
0
파일: RobotConsole.cs 프로젝트: maesi/prgsy
        /// <summary>
        /// Initialisiert die Roboter-Konsole mit den dazugehörigen LED's und Schalter.
        /// </summary>
        public RobotConsole(RunMode aRunMode)
        {
            if (aRunMode == RunMode.Virtual)
            {
                digitalIn = new DigitalInSim();
                digitalOut = new DigitalOutSim();
            }
            else
            {
                digitalIn = new DigitalInHW(Constants.IOConsoleSWITCH);
                digitalOut = new DigitalOutHW(Constants.IOConsoleLED);
            }

            this.leds = new Led[4];
            for (int i = 0; i < this.leds.Length; i++)
            {
                leds[i] = new Led((Leds)i, digitalOut);
                if (i % 2 == 0)
                {
                    leds[i].LedEnabled = false;
                }
            }

            this.switches = new Switch[4];
            for (int i = 0; i < this.switches.Length; i++)
            {
                switches[i] = new Switch((Switches)i, digitalIn);
                switches[i].SwitchStateChanged += new EventHandler<SwitchEventArgs>(RobotConsole_SwitchStateChanged);
            }
        }
예제 #3
0
        /// <summary>
        /// Initialisiert die Roboter-Konsole mit den dazugehörigen LED's und Schalter.
        /// </summary>
        ///
        /// <param name="runMode">Der gewünschte RunMode (Simulation oder Roboter)</param>
        public RobotConsole()
        {
            digitalIn  = new DigitalIn(Constants.IOConsoleSWITCH);
            digitalOut = new DigitalOut(Constants.IOConsoleLED);

            this.leds = new Led[4];
            for (int i = 0; i < this.leds.Length; i++)
            {
                leds[i] = new Led(digitalOut, (Leds)i);
            }

            this.switches = new Switch[4];
            for (int i = 0; i < this.switches.Length; i++)
            {
                switches[i] = new Switch(digitalIn, (Switches)i);
            }
        }
예제 #4
0
        /// <summary>
        /// Initialisiert die Roboter-Konsole mit den dazugehörigen LED's und Schalter.
        /// </summary>
        /// 
        /// <param name="runMode">Der gewünschte RunMode (Simulation oder Roboter)</param>
        public RobotConsole()
        {
            digitalIn = new DigitalIn(Constants.IOConsoleSWITCH);
            digitalOut = new DigitalOut(Constants.IOConsoleLED);

            this.leds = new Led[4];
            for (int i = 0; i < this.leds.Length; i++)
            {
                leds[i] = new Led(digitalOut, (Leds)i);
            }

            this.switches = new Switch[4];
            for (int i = 0; i < this.switches.Length; i++)
            {
                switches[i] = new Switch(digitalIn, (Switches)i);
            }
        }