Esempio n. 1
0
 private void btCancelarExceso_Click(object sender, EventArgs e)
 {
     EnExceso                 = false;
     InicioExceso             = null;
     btExceso.Enabled         = true;
     btTerminarExceso.Enabled = false;
     btCancelarExceso.Enabled = false;
 }
Esempio n. 2
0
        private void btExceso_Click(object sender, EventArgs e)
        {
            var pos = TestApp.Position.LastPosition;

            if (pos == null)
            {
                MessageBox.Show("El vehiculo tiene que reportar una posición primero");
                return;
            }

            EnExceso                 = true;
            InicioExceso             = pos;
            btExceso.Enabled         = false;
            btTerminarExceso.Enabled = true;
            btCancelarExceso.Enabled = true;
        }
Esempio n. 3
0
        public int ReportEvent(String eventName, Coche coche, LogPosicionVo lastPosition)
        {
            if (lastPosition == null)
            {
                return(-999);
            }

            var result = Client.LoginYInsertarEvento(
                Config.AssistCargo.AssistCargoWebServiceUser,
                Config.AssistCargo.AssistCargoWebServicePassword,
                coche.Patente,
                "-1",
                eventName,
                lastPosition.Latitud,
                lastPosition.Longitud,
                lastPosition.Altitud,
                lastPosition.Velocidad,
                lastPosition.FechaMensaje,
                lastPosition.FechaRecepcion);

            return(result);
        }
Esempio n. 4
0
        /// <summary>
        /// Process handler main tasks.
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        protected override HandleResults OnHandleMessage(TextEvent message)
        {
            var coche    = DaoFactory.CocheDAO.FindMobileByDevice(message.DeviceId);
            var posicion = new LogPosicionVo(new LogPosicion
            {
                Coche          = coche,
                Dispositivo    = coche.Dispositivo,
                Altitud        = message.GeoPoint.Height.Unpack(),
                Latitud        = message.GeoPoint.Lat,
                Longitud       = message.GeoPoint.Lon,
                Velocidad      = message.GeoPoint.Velocidad,
                FechaMensaje   = message.GeoPoint.Date,
                FechaRecepcion = DateTime.UtcNow
            });
            var eventName = message.Text;

            var service = new Service();
            var result  = service.ReportEvent(eventName, coche, posicion);

            STrace.Debug(typeof(Handler).FullName, coche.Dispositivo.Id, String.Format("AssistCargo Event: {0} -> {1}: {2}", coche.Patente, eventName, result));

            return(HandleResults.Success);
        }
Esempio n. 5
0
 /// <summary>
 /// Sets the current stopped event initial position.
 /// </summary>
 /// <param name="startPosition"></param>
 public virtual void StartStoppedEvent(LogPosicionVo startPosition)
 {
     this.Store("stopped", startPosition);
 }