public Form1() { InitializeComponent(); this.robot = new Robot(); this.drive = robot.Drive; this.commonRunParameters1.SpeedChanged += CommonRunParameters1_SpeedChanged; this.commonRunParameters1.AccelerationChanged += CommonRunParameters1_AccelerationChanged; this.drive.Power = true; this.driveView1.Drive = drive; this.runLine1.Drive = drive; this.runArc1.Drive = drive; this.runTurn1.Drive = drive; this.radarView1.Radar = robot.radar; this.robotConsole = new RobotConsole(); consoleView1.RobotConsole = this.robotConsole; robotConsole[Switches.Switch1].SwitchStateChanged += switchStateChanged; robotConsole[Switches.Switch2].SwitchStateChanged += switchStateChanged; robotConsole[Switches.Switch3].SwitchStateChanged += switchStateChanged; robotConsole[Switches.Switch4].SwitchStateChanged += switchStateChanged; CommonRunParameters1_AccelerationChanged(null, EventArgs.Empty); CommonRunParameters1_SpeedChanged(null, EventArgs.Empty); }
public Form1() { InitializeComponent(); robotConsole = new RobotConsole(); consoleView.RobotConosle = robotConsole; (robotConsole[Switches.Switch1]).SwitchStateChanged += (o, e) => (robotConsole[Leds.Led1]).LedEnabled = (robotConsole[Switches.Switch1]).SwitchEnabled; (robotConsole[Switches.Switch2]).SwitchStateChanged += (o, e) => (robotConsole[Leds.Led2]).LedEnabled = (robotConsole[Switches.Switch2]).SwitchEnabled; (robotConsole[Switches.Switch3]).SwitchStateChanged += (o, e) => (robotConsole[Leds.Led3]).LedEnabled = (robotConsole[Switches.Switch3]).SwitchEnabled; (robotConsole[Switches.Switch4]).SwitchStateChanged += (o, e) => (robotConsole[Leds.Led4]).LedEnabled = (robotConsole[Switches.Switch4]).SwitchEnabled; }
public Form1() { InitializeComponent(); rc = new RobotConsole(); console.Console = rc; rc[Switches.Switch1].SwitchStateChanged += (s, e) => { rc[Leds.Led1].LedEnabled = rc[Switches.Switch1].SwitchEnabled; }; rc[Switches.Switch2].SwitchStateChanged += (s, e) => { rc[Leds.Led2].LedEnabled = rc[Switches.Switch2].SwitchEnabled; }; rc[Switches.Switch3].SwitchStateChanged += (s, e) => { rc[Leds.Led3].LedEnabled = rc[Switches.Switch3].SwitchEnabled; }; rc[Switches.Switch4].SwitchStateChanged += (s, e) => { rc[Leds.Led4].LedEnabled = rc[Switches.Switch4].SwitchEnabled; }; }
public Form1() { InitializeComponent(); _robotConsole = new RobotConsole(); _robotConsole[Switches.Switch1].SwitchStateChanged += SwitchStateChanged; _robotConsole[Switches.Switch2].SwitchStateChanged += SwitchStateChanged; _robotConsole[Switches.Switch3].SwitchStateChanged += SwitchStateChanged; _robotConsole[Switches.Switch4].SwitchStateChanged += SwitchStateChanged; consoleView1.RobotConsole = _robotConsole; }
public Form1() { InitializeComponent(); rc = new RobotConsole(); consoleView1.RobotConsole = rc; consoleView2.RobotConsole = rc; rc[Switches.Switch1].SwitchStateChanged += SwitchStateChanged; rc[Switches.Switch2].SwitchStateChanged += SwitchStateChanged; rc[Switches.Switch3].SwitchStateChanged += SwitchStateChanged; rc[Switches.Switch4].SwitchStateChanged += SwitchStateChanged; }
public Form1() { InitializeComponent(); this.robotConsole = new RobotConsole(); consoleView1.RobotConsole = this.robotConsole; robotConsole[Switches.Switch1].SwitchStateChanged += switchStateChanged; robotConsole[Switches.Switch2].SwitchStateChanged += switchStateChanged; robotConsole[Switches.Switch3].SwitchStateChanged += switchStateChanged; robotConsole[Switches.Switch4].SwitchStateChanged += switchStateChanged; }
public Form1() { InitializeComponent(); rc = new RobotConsole(); //neue RobotConsole erstellen consoleView1.RobotConsole = rc; //Robot Console der consoleView zuweisen über RobotConsole Property //Abonnieren der Switch Changed Events über die RobotConsole rc[Switches.Switch1].SwitchStateChanged += Switch1StateChanged; rc[Switches.Switch2].SwitchStateChanged += Switch2StateChanged; rc[Switches.Switch3].SwitchStateChanged += Switch3StateChanged; rc[Switches.Switch4].SwitchStateChanged += Switch4StateChanged; }
public Form1() { InitializeComponent(); rc = new RobotConsole(); consoleView1.RobotConsole = rc; for (int j = 0; j <= 3; j++) { (rc[Switches.Switch1]).SwitchStateChanged += (o, e) => (rc[Leds.Led1]).LedEnabled = (rc[Switches.Switch1]).SwitchEnabled; (rc[Switches.Switch2]).SwitchStateChanged += (o, e) => (rc[Leds.Led2]).LedEnabled = (rc[Switches.Switch2]).SwitchEnabled; (rc[Switches.Switch3]).SwitchStateChanged += (o, e) => (rc[Leds.Led3]).LedEnabled = (rc[Switches.Switch3]).SwitchEnabled; (rc[Switches.Switch4]).SwitchStateChanged += (o, e) => (rc[Leds.Led4]).LedEnabled = (rc[Switches.Switch4]).SwitchEnabled; } }