Esempio n. 1
0
        private void menuKeyBt_MouseUp(object sender, MouseEventArgs e)
        {
            string keyName   = "menu";
            string phase     = "up";
            string eventName = "key";

            RemoteEvent keyEvent  = new RemoteEvent(eventName, keyName, phase);
            string      eventJSON = keyEvent.serialize();

            if (eventJSON != null)
            {
                this.controllerParent.sendEvent(eventJSON);
            }
        }
Esempio n. 2
0
        private void searchKeyBt_MouseDown(object sender, MouseEventArgs e)
        {
            string keyName   = "search";
            string phase     = "down";
            string eventName = "key";

            RemoteEvent keyEvent  = new RemoteEvent(eventName, keyName, phase);
            string      eventJSON = keyEvent.serialize();

            if (eventJSON != null)
            {
                this.controllerParent.sendEvent(eventJSON);
            }
        }
Esempio n. 3
0
        private void volumeUpKeyBt_MouseUp(object sender, MouseEventArgs e)
        {
            string keyName = "volumeUp";
            string phase = "up";
            string eventName = "key";

            RemoteEvent keyEvent = new RemoteEvent(eventName, keyName, phase);
            string eventJSON = keyEvent.serialize();
            if (eventJSON != null)
            {
                this.controllerParent.sendEvent(eventJSON);
            }
        }
Esempio n. 4
0
        private void searchKeyBt_MouseDown(object sender, MouseEventArgs e)
        {
            string keyName = "search";
            string phase = "down";
            string eventName = "key";

            RemoteEvent keyEvent = new RemoteEvent(eventName, keyName, phase);
            string eventJSON = keyEvent.serialize();
            if (eventJSON != null)
            {
                this.controllerParent.sendEvent(eventJSON);
            }
        }
Esempio n. 5
0
        private void gpsTimer_Tick(object sender, EventArgs e)
        {
            if (this.googleMapControl1.currentRoute != null)
            {
                currentGPSMarkerIndex = currentGPSMarkerIndex + 1;

                if (currentGPSMarkerIndex < this.googleMapControl1.currentRoute.Points.Count)
                {
                    this.googleMapControl1.currentMarkerRoute.Position = this.googleMapControl1.currentRoute.Points[currentGPSMarkerIndex];
                    this.googleMapControl1.currentMarkerRoute.IsVisible = true;

                    double altitude = 1;
                    double longitude = this.googleMapControl1.currentMarkerRoute.Position.Lng;
                    double latitude =this.googleMapControl1.currentMarkerRoute.Position.Lat;
                    double accuracy = 1;
                    double speed = -1;
                    this.latitudeTxtBx.Text = latitude.ToString();
                    this.longitudeTxtBx.Text = longitude.ToString();
                    this.accuracyTxtBx.Text = accuracy.ToString();
                    this.altitudeTxtBx.Text = altitude.ToString();

                    if( this.googleMapControl1.currentRoute.Points.Count>1)
                    {
                        if(currentGPSMarkerIndex>=0 && currentGPSMarkerIndex<this.googleMapControl1.currentRoute.Points.Count-1)
                        {
                            PointLatLng p1 = this.googleMapControl1.currentRoute.Points[currentGPSMarkerIndex];
                            PointLatLng p2 = this.googleMapControl1.currentRoute.Points[currentGPSMarkerIndex +1];
                            double distance = this.googleMapControl1.getDistance(p1, p2);
                            speed = ((distance*1000) / ((double)gpsTimer.Interval/1000));
                            this.speedTxtBx.Text = speed.ToString();
                        }

                    }

                    TimeSpan span = DateTime.Now - origine;
                    int nbSecondes = (int)span.TotalSeconds;
                    this.timeTxtBx.Text = nbSecondes.ToString();

                    RemoteEvent eventGPS = new RemoteEvent("location", altitude, longitude, latitude, accuracy, 0, speed, nbSecondes);
                    string eventStr = eventGPS.serialize();
                    this.sendEvent(eventStr);

                    this.googleMapControl1.updateMarkers();
                }
                else
                {
                    stopRouteBt_Click(null, null);
                }

            }
        }
Esempio n. 6
0
        public void sendGyroscopeEvent()
        {
            float XRotationValue = (float)this.gyroscopeXAxisTrackBar.Value / (float)1000;
            float YRotationValue = (float)this.gyroscopeYAxisTrackBar.Value / (float)1000;
            float ZRotationValue = (float)this.gyroscopeZAxisTrackBar.Value / (float)1000;

            RemoteEvent eventJson = new RemoteEvent("gyroscope", XRotationValue, YRotationValue, ZRotationValue);

            string serializedJson = eventJson.serialize();
            if (serializedJson != null)
            {
                this.sendEvent(serializedJson);
            }

            serializedJson = null;
        }
Esempio n. 7
0
        public void sendCompassEvent()
        {
            float geographicCompass = this.geographicCompassView.getLastValue();
            float magneticCompass = this.magneticCompassView.getLastValue();

            RemoteEvent eventJson = new RemoteEvent("heading", geographicCompass, magneticCompass);

            string serializedJson = eventJson.serialize();
            if (serializedJson != null)
            {
                this.sendEvent(serializedJson);
            }

            serializedJson = null;
        }
Esempio n. 8
0
        public void sendAccelerometerEvent()
        {
            float accelerometerXGravityValue = (float)this.acceleromterXTrackBar.Value / (float)1000;
            float accelerometerYGravityValue = (float)this.acceleromterYTrackBar.Value / (float)1000;
            float accelerometerZGravityValue = (float)this.acceleromterZTrackBar.Value / (float)1000;

            float accelerometerXInstantValue = (float)this.accelerometerXInstantTrackBar.Value / (float)1000;
            float accelerometerYInstantValue = (float)this.accelerometerYInstantTrackBar.Value / (float)1000;
            float accelerometerZInstantValue = (float)this.accelerometerZInstantTrackBar.Value / (float)1000;

            RemoteEvent eventJson = new RemoteEvent("accelerometer", accelerometerXGravityValue, accelerometerYGravityValue, accelerometerZGravityValue,
                accelerometerXInstantValue, accelerometerYInstantValue, accelerometerZInstantValue, this.accelerometerIsShake);

            string serializedJson = eventJson.serialize();
            if (serializedJson != null)
            {
                this.sendEvent(serializedJson);
            }

            serializedJson = null;
        }