Exemplo n.º 1
0
        public void Count()
        {
            while (ShouldCount)
            {
                long beginTime = DateTime.Now.Ticks;
                try
                {
                    CurrentTime.Timer();
                    TimeLabel.Invoke(new Action(() => TimeLabel.Text = CurrentTime.ToString()));

                    Distance += (Speed / 3600);
                    DistanceLabel.Invoke(new Action(() => DistanceLabel.Text = $"{Distance:f2}"));

                    RPM = Speed * 2.8;
                    RpmLabel.Invoke(new Action(() => RpmLabel.Text = RPM.ToString()));

                    Pulse = 90 + (int)((Power / 6) * (Speed / 10));
                    PulseLabel.Invoke(new Action(() => PulseLabel.Text = Pulse.ToString()));


                    SpeedTrackbar.Invoke(new Action(() => SpeedTrackbar.Value = (int)Speed));
                    SpeedLabel.Invoke(new Action(() => SpeedLabel.Text        = Speed.ToString()));
                    PowerTrackbar.Invoke(new Action(() => PowerTrackbar.Value = (int)Power));
                    PowerLabel.Invoke(new Action(() => PowerLabel.Text        = Power.ToString()));
                }
                catch (Exception e)
                {
                }

                Wait1s(beginTime);
            }
        }
Exemplo n.º 2
0
        public void Count()
        {
            while (ShouldCount)
            {
                try
                {
                    CurrentTime.Timer();
                    TimeLabel.Invoke(new Action(() => TimeLabel.Text = CurrentTime.ToString()));

                    Distance += (Speed / 3600);
                    DistanceLabel.Invoke(new Action(() => DistanceLabel.Text = $"{Distance:f2}"));

                    RPM = Speed * 2.8;
                    RpmLabel.Invoke(new Action(() => RpmLabel.Text = RPM.ToString()));

                    Pulse = 90 + (int)((Power / 6) * (Speed / 20));
                    PulseLabel.Invoke(new Action(() => PulseLabel.Text = Pulse.ToString()));


                    SpeedTrackbar.Invoke(new Action(() => SpeedTrackbar.Value = (int)Speed));
                    SpeedLabel.Invoke(new Action(() => SpeedLabel.Text        = Speed.ToString()));
                    PowerTrackbar.Invoke(new Action(() => PowerTrackbar.Value = (int)Power));
                    PowerLabel.Invoke(new Action(() => PowerLabel.Text        = Power.ToString()));
                }
                catch (Exception e)
                {
                }

                Thread.Sleep(1000);
            }
        }
Exemplo n.º 3
0
        public virtual string GetDataRow()
        {
            return(String.Join(",", new[]
            {
                FullTimeMode?Time.ToString() : Time.TotalSeconds.ToString(CultureInfo.InvariantCulture),
                    TRT.ToString(),
                    RPM.ToString(),
                    RPM40.ToString(),
                    RPM_GBC_RT.ToString(),
                    UFRXX.ToString(),
                    SSM.ToString(),
                    TWAT.ToString(),
                    TAIR.ToString(),
                    ALF.ToString("0.#", CultureInfo.InvariantCulture),
                    AFR.ToString("0.#", CultureInfo.InvariantCulture),
                    LC1_ALF.ToString("0.###", CultureInfo.InvariantCulture),
                    LC1_AFR.ToString("0.#", CultureInfo.InvariantCulture),
                    COEFF.ToString("0.###", CultureInfo.InvariantCulture),
                    DGTC_RICH.ToString("0.###", CultureInfo.InvariantCulture),
                    DGTC_LEAN.ToString("0.###", CultureInfo.InvariantCulture),
                    UOZ.ToString("0.#", CultureInfo.InvariantCulture),
                    KUOZ1.ToString("0.#", CultureInfo.InvariantCulture),
                    KUOZ2.ToString("0.#", CultureInfo.InvariantCulture),
                    KUOZ3.ToString("0.#", CultureInfo.InvariantCulture),
                    KUOZ4.ToString("0.#", CultureInfo.InvariantCulture),
                    Faza.ToString(),
                    INJ.ToString("0.###", CultureInfo.InvariantCulture),
                    FUSE.ToString("0.#", CultureInfo.InvariantCulture),
                    AIR.ToString("0.#", CultureInfo.InvariantCulture),
                    GBC.ToString("0.##", CultureInfo.InvariantCulture),
                    SPD.ToString(),
                    ADCKNOCK.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCMAF.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCTWAT.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCTAIR.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCTPS.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCUBAT.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCLAM.ToString("0.###", CultureInfo.InvariantCulture),
                    ErrorCount.ToString(),
                    fSTOP ? "1" : "0",
                    fXX ? "1" : "0",
                    fXXPrev ? "1" : "0",
                    fXXFix ? "1" : "0",
                    fPOW ? "1" : "0",
                    fFUELOFF ? "1" : "0",
                    fDETZONE ? "1" : "0",
                    fDET ? "1" : "0",
                    fADS ? "1" : "0",
                    fLAMREG ? "1" : "0",
                    fLAM ? "1" : "0",
                    fLEARN ? "1" : "0",
                    fLAMRDY ? "1" : "0",
                    fLAMHEAT ? "1" : "0"
            }

                               ));
        }
Exemplo n.º 4
0
        public override Dictionary <string, string> GetAdditionalProperties()
        {
            Dictionary <string, string> additionalProperties = new Dictionary <string, string>();

            additionalProperties.Add("Capacity", Capacity.ToString());
            additionalProperties.Add("RPM", RPM.ToString());
            additionalProperties.Add("Form factor", FormFactor.ToString());

            return(additionalProperties);
        }
Exemplo n.º 5
0
        public virtual string GetValue(string name)
        {
            //var property = type.GetProperty(name);
            //return property == null ? String.Empty : Convert.ToSingle(property.GetValue(this, null)).ToString("0.##");

            var j7EsDiagData = this as J7esDiagData;

            switch (name)
            {
            case "RPM":
                return(RPM.ToString(CultureInfo.InvariantCulture));

            case "UOZ":
                return(UOZ.ToString("0.#", CultureInfo.InvariantCulture));

            case "DUOZ":
                return(j7EsDiagData != null?j7EsDiagData.DUOZ.ToString("0.#", CultureInfo.InvariantCulture) : "-");

            case "TRT":
                return(TRT.ToString(CultureInfo.InvariantCulture));

            case "TWAT":
                return(TWAT.ToString(CultureInfo.InvariantCulture));

            case "TAIR":
                return(TAIR.ToString(CultureInfo.InvariantCulture));

            case "ALF":
                return(ALF.ToString("0.##", CultureInfo.InvariantCulture));

            case "LC1_ALF":
                return(LC1_ALF.ToString("0.##", CultureInfo.InvariantCulture));

            case "COEFF":
                return(COEFF.ToString("0.###", CultureInfo.InvariantCulture));

            case "INJ":
                return(INJ.ToString("0.###", CultureInfo.InvariantCulture));

            case "FUSE":
                return(FUSE.ToString("0.#", CultureInfo.InvariantCulture));

            case "AIR":
                return(AIR.ToString("0", CultureInfo.InvariantCulture));

            case "GBC":
                return(GBC.ToString("0", CultureInfo.InvariantCulture));

            case "SPD":
                return(SPD.ToString(CultureInfo.InvariantCulture));

            case "Press":
                return(j7EsDiagData != null?j7EsDiagData.Press.ToString("0.##", CultureInfo.InvariantCulture) : "-");

            case "TARGET_BOOST":
                return(j7EsDiagData != null?j7EsDiagData.TARGET_BOOST.ToString("0.##", CultureInfo.InvariantCulture) : "-");

            case "WGDC":
                return(j7EsDiagData != null?j7EsDiagData.WGDC.ToString(CultureInfo.InvariantCulture) : "-");

            case "TURBO_DYNAMICS":
                return(j7EsDiagData != null?j7EsDiagData.TURBO_DYNAMICS.ToString(CultureInfo.InvariantCulture) : "-");

            case "UGB_RXX":
                return(j7EsDiagData != null?j7EsDiagData.UGB_RXX.ToString("0.##", CultureInfo.InvariantCulture) : "-");

            default:
                return(String.Empty);
            }
        }
Exemplo n.º 6
0
        public override string ExecuteReadOption(string Option)
        {
            switch (Option)
            {
            case ("MoveTo"):
                throw new InvalidOperationException("Executeable");

            case ("MoveRelativeTo"):
                throw new InvalidOperationException("Executeable");

            case ("MoveFor"):
                throw new InvalidOperationException("Executeable");

            case ("RunOn"):
                throw new InvalidOperationException("Executeable");

            case ("RunAt"):
                throw new InvalidOperationException("Executeable");

            case ("Stop"):
                throw new InvalidOperationException("Executeable");

            case ("Reset"):
                throw new InvalidOperationException("Executeable");

            case ("Address"):
                return(Address);

            case ("MaxSpeed"):
                return(Max_Speed.ToString());

            case ("Speed"):
                return(Speed.ToString());

            case ("Position"):
                return(Position.ToString());

            case ("Dutycycle"):
                return(Dutycycle.ToString());

            case ("RampUpSpeed"):
                return(RampUpSpeed.ToString());

            case ("RampDownSpeed"):
                return(RampDownSpeed.ToString());

            case ("Polarity"):
                return(TachoMotor_Polarity_To_String(Polarity));

            case ("RPM"):
                return(RPM.ToString());

            case ("DriverName"):
                return(DriverName);

            case ("LastCommand"):
                return(TachoMotor_Commands_To_String(LastCommand));

            case ("State"):
                return(TachoMotor_States_To_String(State));

            case ("StopAction"):
                return(TachoMotor_StopActions_To_String(StopAction));

            case ("Command"):
                throw new InvalidOperationException("WriteOnly");

            default:
                throw new ArgumentOutOfRangeException();
            }
        }