示例#1
0
文件: KeyView.cs 项目: slagusev/Krea
        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);
            }
        }
示例#2
0
文件: KeyView.cs 项目: slagusev/Krea
        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);
            }
        }
示例#3
0
文件: KeyView.cs 项目: nadar71/Krea
        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);
            }
        }
示例#4
0
文件: KeyView.cs 项目: nadar71/Krea
        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);
            }
        }
示例#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);
                }

            }
        }
示例#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;
        }
示例#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;
        }
示例#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;
        }