Esempio n. 1
0
//        命令0x10(返回ECU实时状态数据):



        //11字节:氧传感器1电压;0~0xFF表示0~5V电压
//12字节:氧传感器2电压;0~0xFF表示0~5V电压
//13字节:当前液位传感器电压;0~0xFF表示0~5V电压

//15字节:电磁阀、点火钥匙状态;bit0:电磁阀状态, bit4:点火钥匙状态
//16字节:电瓶电压;



        //{//原代码
        //    var data = packet.PacketData(1).ToArray();
        //    Models.Feedback.RealTimeData model = new Models.Feedback.RealTimeData();
        //    model.PetrolsTime = ValueConvert.TwoBitTimeByusFrom(data[0], data[1]);
        //    model.GasesTime = ValueConvert.TwoBitTimeByusFrom(data[2], data[3]);
        //    model.RPM = ValueConvert.RealyDataRPMFrom(data[4], data[5]);
        //    model.TempRed =ValueConvert.SingleTempFrom(data[6]);
        //    model.TempGas =ValueConvert.SingleTempFrom(data[7]);
        //    model.MAPPress = ValueConvert.PressFrom(data[8]);
        //    model.GasPress = ValueConvert.PressFrom(data[9]);
        //    model.Lambda = ValueConvert.TwoBitKVFrom(data[10], data[11], data[12], data[13]);
        //    model.GasLevel = ValueConvert.TwoBitKVFrom(data[14], data[15])[0];
        //    model.LEDLight = ValueConvert.LEDLightFrom(data[16]);
        //    bool[] state = ValueConvert.SolenoidValveAndIgnitionStatusFrom(data[17]);
        //    model.SolenoidValveStatus = state[0];
        //    model.IgnitionStatus = state[1];
        //    model.RPMSource = ValueConvert.RPMSourceFrom(data[18]);
        //    return model;
        //}



        /// <summary>
        /// 从报文提取 自动标定信息
        /// </summary>
        /// <param name="packet">报文</param>
        /// <returns>自动标定信息</returns>
        public static Models.Feedback.AutoCalibrationDetails ToAutoCalibrationDetails(this byte[] packet)
        {
            return(ValueConvert.AutoCalibrationDetailsFrom(packet.PacketData(1).ToArray()));
        }