/// <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); } }
/// <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); } }
/// <summary> /// Initialisiert die gewünschte LED und verknüpft sie mit einem digitalOut-Objekt. /// </summary> /// <param name="digitalOut"></param> /// <param name="led"></param> public Led(DigitalOut digitalOut, Leds led) { this.digitalOut = digitalOut; this.led = led; this.oldState = false; this.digitalOut.DigitalOutputChanged += new EventHandler(DigitalOutputChanged); }
/// <summary> /// Initialisiert die gewünschte LED und verknüpft sie mit einem digitalOut-Objekt. /// </summary> /// <param name="digitalOut"></param> /// <param name="led"></param> public Led(Leds led, DigitalOut aDigitalOut) { this.led = led; this.digitalOut = aDigitalOut; this.digitalOut.DigitalOutChanged += new EventHandler(digitalOutChanged); this.oldState = false; }
/// <summary> /// Initialise a new LEDPin /// </summary> /// <param name="digitalOut">Used digitalOut object</param> /// <param name="ledPin">the LEDPin to control</param> public Led(DigitalOut digitalOut, LEDPin ledPin) { this.digitalOut = digitalOut; this.ledPin = ledPin; this.oldState = false; this.digitalOut.DigitalOutputChanged += DigitalOutputChanged; }
/// <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); } }
/// <summary> /// Initialisiert die gewünschte LED und verknüpft sie mit einem digitalOut-Objekt. /// </summary> /// <param name="digitalOut"></param> /// <param name="led"></param> public Led(DigitalOut digitalOut, Leds led) { this.digitalOut = digitalOut; this.led = led; this.digitalOut.DigitalOutChanged += new EventHandler(digitalOut_DigitalOutChanged); }