示例#1
0
        private void Initialize()
        {
            List <Conversion> conversions = new List <Conversion>();

            conversions.Add(Conversion.GetInstance("Lambda", "(x / 3.75 + 68) / 100", "0.00"));
            conversions.Add(Conversion.GetInstance("Gasoline AFR", "(x / 2.55 + 100) / 10", "0.00"));

            Parameter parameter = new PlxParameter(
                this,
                new PlxSensorId(PlxSensorType.WidebandAfr, 0),
                "PlxMfdWB1",
                "PLX Wideband O2",
                conversions.AsReadOnly());

            this.AddParameter(parameter);
            conversions.Clear();

            conversions = new List <Conversion>();
            conversions.Add(Conversion.GetInstance("C", "x", "0.00"));
            conversions.Add(Conversion.GetInstance("F", "x / .555 + 32", "0.00"));

            parameter = new PlxParameter(
                this,
                new PlxSensorId(PlxSensorType.ExhaustGasTemperature, 0),
                "PlxMfdEGT1",
                "PLX Exhaust Gas Temperature",
                conversions.AsReadOnly());

            this.AddParameter(parameter);
            conversions.Clear();
        }
示例#2
0
        /// <summary>
        /// Add columns for external sensors.
        /// </summary>
        private void StoreExternalSensorValues()
        {
            PlxSensors plxSensors = ExternalSensors.GetInstance().PlxSensors;

            if (plxSensors == null)
            {
                return;
            }

            foreach (LogColumn column in this.logEventArgs.Row.Columns)
            {
                PlxParameter parameter = column.Parameter as PlxParameter;
                if (parameter != null)
                {
                    PlxSensorId id       = (PlxSensorId)parameter.SensorId;
                    double      rawValue = plxSensors.GetValue(id, PlxSensorUnits.Raw);
                    InternalLogProfile.ConvertAndStoreValue(column.Parameter, rawValue, column.Conversion, column);
                }
            }
        }