Example #1
0
 public TrackForm(OBDInterface obd2)
 {
     TrackForm.thisForm = this;
     m_obdInterface = obd2;
     timeslip = new Timeslip();
     timeslip.Vehicle = m_obdInterface.GetActiveProfile().Name;
     InitializeComponent();
     CheckConnection();
 }
Example #2
0
 public TrackForm(OBDInterface obd2)
 {
     TrackForm.thisForm = this;
     m_obdInterface     = obd2;
     timeslip           = new Timeslip();
     timeslip.Vehicle   = m_obdInterface.GetActiveProfile().Name;
     InitializeComponent();
     CheckConnection();
 }
Example #3
0
        private new void Capture(object state)
        {
            m_arrRpmValues = new ArrayList();
            m_arrKphValues = new ArrayList();
            bool flag = false;

            if (m_bCapture)
            {
                do
                {
                    OBDParameterValue obdParameterValue1 = m_obdInterface.getValue("SAE.RPM", true);
                    if (!obdParameterValue1.ErrorDetected)
                    {
                        DatedValue datedValue1 = new DatedValue(obdParameterValue1.DoubleValue);
                        DateTime   now1        = DateTime.Now;
                        datedValue1.Date = now1;
                        Decimal num1 = numFromRPM.Value;
                        Decimal num2 = new Decimal();
                        num2 = new Decimal(datedValue1.Value);
                        if (num2 >= num1)
                        {
                            Decimal num3 = numToRPM.Value;
                            Decimal num4 = new Decimal();
                            num4 = new Decimal(datedValue1.Value);
                            if (num4 <= num3)
                            {
                                m_arrRpmValues.Add((object)datedValue1);
                                OBDParameterValue obdParameterValue2 = m_obdInterface.getValue("SAE.VSS", false);

                                if (!obdParameterValue2.ErrorDetected)
                                {
                                    float      num5        = m_obdInterface.GetActiveProfile().SpeedCalibrationFactor;
                                    DatedValue datedValue2 = new DatedValue(obdParameterValue2.DoubleValue * (double)num5);
                                    DateTime   now2        = DateTime.Now;
                                    datedValue2.Date = now2;
                                    m_arrKphValues.Add((object)datedValue2);
                                }
                                flag = true;
                                goto label_9;
                            }
                        }
                        if (flag)
                        {
                            m_bCapture = false;
                        }
                    }
                    label_9 :;
                }while (m_bCapture);
            }
            Calculate();
            btnOpen.Enabled = true;
        }
Example #4
0
        private new void Capture(object state)
        {
            m_arrKphValues = new ArrayList();
            if (m_bCapture)
            {
                do
                {
                    OBDParameterValue obdParameterValue = m_obdInterface.getValue("SAE.VSS", false);

                    if (!obdParameterValue.ErrorDetected && obdParameterValue.DoubleValue > 0.0)
                    {
                        if (m_arrKphValues.Count == 0)
                        {
                            TrackForm.thisForm.BeginInvoke((Delegate)TrackForm.CallStartTimer);
                        }
                        float num = m_obdInterface.GetActiveProfile().SpeedCalibrationFactor;
                        m_arrKphValues.Add((object)new DatedValue(obdParameterValue.DoubleValue * (double)num));
                        TrackForm.thisForm.CalculateTimeslip();
                    }
                }while (m_bCapture);
            }
            TrackForm.thisForm.BeginInvoke((Delegate)TrackForm.CallStopTimer);
            btnOpen.Enabled = true;
        }
Example #5
0
        public DynoForm(OBDInterface obd2)
        {
            m_obdInterface = obd2;
            m_profile      = obd2.GetActiveProfile();

            InitializeComponent();

            Data             = new DataList();
            m_bCapture       = false;
            m_dtDynoTime     = DateTime.Now;
            btnStart.Enabled = false;
            btnReset.Enabled = false;
            printDocument1.DefaultPageSettings = new PageSettings()
            {
                Margins   = new Margins(100, 100, 100, 100),
                Landscape = true
            };
            pageSetupDialog1.Document = printDocument1;
        }
Example #6
0
        public DynoForm(OBDInterface obd2)
        {
            m_obdInterface = obd2;
            m_profile = obd2.GetActiveProfile();

            InitializeComponent();

            Data = new DataList();
            m_bCapture = false;
            m_dtDynoTime = DateTime.Now;
            btnStart.Enabled = false;
            btnReset.Enabled = false;
            printDocument1.DefaultPageSettings = new PageSettings()
            {
                Margins = new Margins(100, 100, 100, 100),
                Landscape = true
            };
            pageSetupDialog1.Document = printDocument1;
        }
Example #7
0
        public MainForm()
        {
            InitializeComponent();
            m_obdInterface = new OBDInterface();
            m_obdInterface.OnConnect += new OBDInterface.__Delegate_OnConnect(On_OBD2_Connect);
            m_obdInterface.OnDisconnect += new OBDInterface.__Delegate_OnDisconnect(On_OBD2_Disconnect);
            if (m_obdInterface.GetActiveProfile() != null)
                panelVehicle.Text = m_obdInterface.GetActiveProfile().ToString();

            if (m_obdInterface.GetCommSettings() != null)
            {
                if (m_obdInterface.GetCommSettings().AutoDetect)
                    panelComPort.Text = "Auto-Detect";
                else
                    panelComPort.Text = "COM" + m_obdInterface.GetCommSettings().ComPort.ToString();
            }
            SetDescriptiveToolTips();
            m_formStart = new CommForm(m_obdInterface);
            m_formMonitorTests = new TestForm(m_obdInterface);
            m_formDTC = new DTCForm(m_obdInterface);
            m_formFreezeFrames = new FreezeFramesForm(m_obdInterface);
            m_formOxygenSensors = new OxygenSensorsForm(m_obdInterface);
            m_formSensorGrid = new SensorMonitorForm(m_obdInterface);
            m_formSensorChart = new ScopeForm(m_obdInterface);
            m_formTrack = new TrackForm(m_obdInterface);
            m_formDyno = new DynoForm(m_obdInterface);
            m_formFuelEconomy = new FuelEconomyForm(m_obdInterface);
            m_formTerminal = new TerminalForm(m_obdInterface);
            m_formReport = new ReportGeneratorForm(m_obdInterface);
            m_formCommLog = new CommLogForm();
            toolBarButtonStart.Pushed = true;
            SetActiveForm(m_formStart);
        }