public RealCarCommunicator(ICar parent)
        {
            ICar = parent;

            extentionCardCommunicator = new USB4702();
            servoDriver = new ServoDriver();
            angleAndSpeedMeter = new RS232Controller(this);

            //TODO: make thread for every initialization //its actually done for angleAndSpeedMeter
            extentionCardCommunicator.Initialize();
            servoDriver.Initialize();
            angleAndSpeedMeter.Initialize();

            SpeedMeasuringTimer.Interval = SPEED_MEASURING_TIMER_INTERVAL_IN_MS;
            SpeedMeasuringTimer.Tick += new EventHandler(SpeedMeasuringTimer_Tick);
            SpeedMeasuringTimer.Start();
        }
示例#2
0
        public RealCarCommunicator(ICar parent)
        {
            ICar = parent;

            servoDriver = new ServoDriver();
            deviceManager.RegisterDevice(servoDriver);

            //angleAndSpeedMeter = new SafeRS232Controller(this, new SafeRS232Communicator("COM4"));
            //deviceManager.RegisterDevice(angleAndSpeedMeter);

            angleAndSpeedMeter = new CarController_old.RS232Controller(this);
            deviceManager.RegisterDevice(angleAndSpeedMeter);

            extentionCardCommunicator = new USB4702();
            deviceManager.RegisterDevice(extentionCardCommunicator);

            speedometer = new Speedometer(extentionCardCommunicator);
            deviceManager.RegisterDevice(speedometer);

            gearboxController = new GearboxController(extentionCardCommunicator, this);
            deviceManager.RegisterDevice(gearboxController);

            speedometer.evSpeedInfoReceived += speedometer_evSpeedInfoReceived;
        }
示例#3
0
 public GearboxController(USB4702 _extentionCardCommunicator, RealCarCommunicator comunicator)
 {
     extentionCardCommunicator = _extentionCardCommunicator;
     realCarCommunicator       = comunicator;
 }
示例#4
0
        public Speedometer(USB4702 extentionCard)
        {
            extentionCardCommunicator = extentionCard;

            SpeedMeasuringThread = new Thread(new ThreadStart(ConstantSpeedMeasuring));
        }
示例#5
0
 public GearboxController(USB4702 _extentionCardCommunicator, RealCarCommunicator comunicator)
 {
     extentionCardCommunicator = _extentionCardCommunicator;
     realCarCommunicator = comunicator;
 }