public void CalculaApresentacao()
 {
     if (confNeg.ConfIsMetrico())
     {
         VelocidadeApre       = Velocidade == 0 ? "0.00" : Velocidade.ToString();
         VelocidadeMaximaApre = VelocidadeMaxima == 0 ? "0.00" : VelocidadeMaxima.ToString();
         VelocidadeMediaApre  = VelocidadeMedia == 0 ? "0.00": VelocidadeMedia.ToString();
         DistanciaApre        = Distancia == 0 ? "0.00 km" : Distancia.ToString() + " km";
         RitimoApre           = CalculaRitimo(confNeg.ConfIsMetrico());
         AltitudeMaximaApre   = AltitudeMaxima.ToString() + " m";
         AltitudeVariacaoApre = AltitudeVariacao.ToString() + " m";
         CaloriasApre         = Calorias.ToString() + " Kcal";
     }
     else
     {
         VelocidadeApre       = Velocidade == 0 ? "0.00" : (Velocidade / 1.6).ToString("0.00");
         VelocidadeMaximaApre = VelocidadeMaxima == 0 ? "0.00" : (VelocidadeMaxima / 1.6).ToString("0.00");
         VelocidadeMediaApre  = VelocidadeMedia == 0 ? "0.00" : (VelocidadeMedia / 1.6).ToString("0.00");
         DistanciaApre        = Distancia == 0 ? "0.00 mi" : (Distancia / 1.6).ToString("0.00") + " mi";
         RitimoApre           = CalculaRitimo(confNeg.ConfIsMetrico());
         AltitudeMaximaApre   = (AltitudeMaxima / 0.3048).ToString("0.00") + " p";
         AltitudeVariacaoApre = (AltitudeVariacao / 0.3048).ToString("0.00") + " p";
         CaloriasApre         = Calorias.ToString() + " Kcal";
     }
 }
Beispiel #2
0
        protected override Dictionary <string, string> GetFilterValues()
        {
            var coche = Mobile ?? ddlMovil.SelectedValue;

            var mobile = DAOFactory.CocheDAO.FindById(Convert.ToInt32(coche));

            return(new Dictionary <string, string>
            {
                { "PARENTI01", mobile.Empresa != null ? mobile.Empresa.RazonSocial : "" },
                { "PARENTI02", mobile.Linea != null ? mobile.Linea.Descripcion : "" },
                { "PARENTI17", mobile.TipoCoche.Descripcion },
                { "INTERNO", mobile.Interno },
                { "PATENTE", mobile.Patente },
                { "MARCA", (mobile.Marca != null) ? mobile.Marca.Descripcion : string.Empty },
                { "PARENTI08", (mobile.Dispositivo != null) ? mobile.Dispositivo.Codigo : string.Empty },
                { "DISTANCE", npDistance.Number.ToString("#0") },
                { "DETENCION", npStopped.Number.ToString("#0") },
                { "DESDE", dpDesde.SelectedDate.ToString() },
                { "HASTA", dpHasta.SelectedDate.ToString() },
                { "", "" },
                { "TOTALES", "" },
                { "TIEMPO_MOV", TiempoMovimiento.ToString() },
                { "EVENTOS_MOV", EventosMovimiento.ToString() },
                { "TIEMPO_DET", TiempoDetenido.ToString() },
                { "EVENTOS_DET", EventosDetenido.ToString() },
                { "DISTANCIA_RECORRIDA", Distancia.ToString("0.00") },
                { "VELOCIDAD_AVERAGE", VelocidadPromedio.ToString("0.00") }
            });
        }
Beispiel #3
0
        public override string ToString()
        {
            StringBuilder printViagem = new StringBuilder();

            printViagem.AppendLine($"CÓDIGO DA VIAGEM: {CodigoViagem}");
            printViagem.AppendLine($"DISTÂNCIA: {Distancia.ToString("F2", CultureInfo.InvariantCulture)} KM - DATA: {Data.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture)}");
            printViagem.AppendLine($"STATUS VIAGEM: {(DistanciaVariada <= 0 ? "CONCLUIDA" : "PENDENTE")} - PREVISÃO DO TEMPO: {Clima}");
            return(printViagem.ToString());
        }
Beispiel #4
0
    static void Main(string[] args)
    {
        double Km, Litros, Distancia;

        Km        = double.Parse(Console.ReadLine());
        Litros    = double.Parse(Console.ReadLine());
        Distancia = Km / Litros;

        Console.Write("{0} km/l\n", Distancia.ToString("0.000"));
    }
Beispiel #5
0
        static void Main(string[] args)
        {
            double x1, x2, y1, y2, Distancia;

            String[] vet1 = Console.ReadLine().Split(' ');
            x1 = double.Parse(vet1[0]);
            y1 = double.Parse(vet1[1]);
            String[] vet2 = Console.ReadLine().Split(' ');
            x2 = double.Parse(vet2[0]);
            y2 = double.Parse(vet2[1]);

            Distancia = Math.Sqrt(Math.Pow((x2 - x1), 2.0) + Math.Pow((y2 - y1), 2.0));

            Console.WriteLine(Distancia.ToString("F4"));
        }