コード例 #1
0
ファイル: Switch.cs プロジェクト: maesi/prgsy
 /// <summary>
 /// Initialisiert den Schalter.
 /// </summary>
 /// <param name="swi">der abzubildende Schalter</param>
 public Switch(Switches swi, DigitalIn aDigitalIn)
 {
     this.swi = swi;
     this.digitalIn = aDigitalIn;
     this.digitalIn.DigitalInChanged += new EventHandler(digitalInChanged);
     this.oldState = false;
 }
コード例 #2
0
ファイル: RobotConsole.cs プロジェクト: michaelpantic/Robot
        /// <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);
            }
        }
コード例 #3
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);
            }
        }
コード例 #4
0
 /// <summary>
 /// Initialisiert den Schalter.
 /// </summary>
 /// <param name="digitalIn">das zu verwendende DigitalIn-Objekt</param>
 /// <param name="swi">der abzubildende Schalter</param>
 public Switch(DigitalIn digitalIn, Switches swi)
 {
     this.digitalIn = digitalIn;
     this.swi       = swi;
     this.oldState  = false;
     this.digitalIn.DigitalInChanged += new EventHandler(DigitalInChanged);
 }
コード例 #5
0
ファイル: Switch.cs プロジェクト: michaelpantic/Robot
 /// <summary>
 /// Initialisiert den Schalter.
 /// </summary>
 /// <param name="swi">der abzubildende Schalter</param>
 public Switch(DigitalIn digitalIn, Switches swi)
 {
     this.digitalIn = digitalIn;
     this.swi = swi;
     this.oldState = false;
     this.digitalIn.DigitalInChanged += new EventHandler(digitalIn_DigitalInChanged);
 }
コード例 #6
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);
            }
        }
コード例 #7
0
ファイル: RobotConsole.cs プロジェクト: CarloXIII/CSA_Robot
        /// <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);
            }
        }