protected void setGuiCurrentParkingSensor(proxibrick.ParkingSensorDataDssSerializable dir) { if (_mainWindow != null) { ccrwpf.Invoke invoke = new ccrwpf.Invoke( delegate() { _mainWindow.CurrentParkingSensor = new ParkingSensorData() { TimeStamp = dir.TimeStamp.Ticks, parkingSensorMetersLB = dir.parkingSensorMetersLB, parkingSensorMetersLF = dir.parkingSensorMetersLF, parkingSensorMetersRB = dir.parkingSensorMetersRB, parkingSensorMetersRF = dir.parkingSensorMetersRF }; } ); wpfServicePort.Post(invoke); Arbiter.Activate(TaskQueue, invoke.ResponsePort.Choice( s => { }, // delegate for success ex => { } //Tracer.Trace(ex) // delegate for failure )); } }
protected void setGuiCurrentProximity(proxibrick.ProximityDataDssSerializable dir) { if (_mainWindow != null) { ccrwpf.Invoke invoke = new ccrwpf.Invoke( delegate() { _mainWindow.CurrentProximity = new ProximityData() { TimeStamp = dir.TimeStamp.Ticks, mbbl = dir.mbbl, mbbr = dir.mbbr, mbl = dir.mbl, mbr = dir.mbr, mffl = dir.mffl, mffr = dir.mffr, mfl = dir.mfl, mfr = dir.mfr }; } ); wpfServicePort.Post(invoke); Arbiter.Activate(TaskQueue, invoke.ResponsePort.Choice( s => { }, // delegate for success ex => { } //Tracer.Trace(ex) // delegate for failure )); } }
protected void setGuiCurrentAttitude(libguiwpf.OrientationData attitudeData) { if (_mainWindow != null) { ccrwpf.Invoke invoke = new ccrwpf.Invoke(delegate() { _mainWindow.CurrentAttitude = attitudeData; } ); _wpfServicePort.Post(invoke); Arbiter.Activate(TaskQueue, invoke.ResponsePort.Choice( s => { }, // delegate for success ex => { } //Tracer.Error(ex) // delegate for failure )); } }
protected void setGuiCurrentAccelerometer(proxibrick.AccelerometerDataDssSerializable acc) { if (_mainWindow != null) { ccrwpf.Invoke invoke = new ccrwpf.Invoke(delegate() { _mainWindow.CurrentAccelerometer = new AccelerometerData() { TimeStamp = acc.TimeStamp.Ticks, accX = acc.accX, accY = acc.accY, accZ = acc.accZ }; } ); wpfServicePort.Post(invoke); Arbiter.Activate(TaskQueue, invoke.ResponsePort.Choice( s => { }, // delegate for success ex => { } //Tracer.Error(ex) // delegate for failure )); } }
protected void setGuiCurrentLaserData(LaserDataSerializable laserData) { if (_mainWindow != null) { ccrwpf.Invoke invoke = new ccrwpf.Invoke( delegate() { _mainWindow.CurrentLaserData = laserData; // update sonar sweep control //_mainWindow.setMapper(_mapperVicinity); // this is pretty much only calling Redraw on the map _mainWindow.RedrawMap(); } ); wpfServicePort.Post(invoke); Arbiter.Activate(TaskQueue, invoke.ResponsePort.Choice( s => { }, // delegate for success ex => { } //Tracer.Trace(ex) // delegate for failure )); } }
protected void setGuiCurrentDirection(DirectionData dir) { if (_mainWindow != null) { ccrwpf.Invoke invoke = new ccrwpf.Invoke(delegate() { _mainWindow.CurrentDirection = new DirectionData() { TimeStamp = dir.TimeStamp, heading = dir.heading, bearing = _currentGoalBearing }; } ); _wpfServicePort.Post(invoke); Arbiter.Activate(TaskQueue, invoke.ResponsePort.Choice( s => { }, // delegate for success ex => { } //Tracer.Error(ex) // delegate for failure )); } }
/// <summary> /// update GUI with current direction /// </summary> /// <param name="dir"></param> protected void setGuiCurrentDirection(proxibrick.DirectionDataDssSerializable dir) { if (_mainWindow != null) { ccrwpf.Invoke invoke = new ccrwpf.Invoke(delegate() { _mainWindow.CurrentDirection = new DirectionData() { TimeStamp = dir.TimeStamp.Ticks, heading = dir.heading, bearing = _mapperVicinity.robotDirection.bearing }; } ); wpfServicePort.Post(invoke); Arbiter.Activate(TaskQueue, invoke.ResponsePort.Choice( s => { }, // delegate for success ex => { } //Tracer.Error(ex) // delegate for failure )); } }
protected void setGuiCurrentTactics(RobotTacticsType tactics) { if (_mainWindow != null && tactics != lastGuiTactics) { lastGuiTactics = tactics; ccrwpf.Invoke invoke = new ccrwpf.Invoke(delegate() { _mainWindow.CurrentTactics = tactics; } ); wpfServicePort.Post(invoke); Arbiter.Activate(TaskQueue, invoke.ResponsePort.Choice( s => { }, // delegate for success ex => { } //Tracer.Error(ex) // delegate for failure )); } }