Ejemplo n.º 1
0
        public PowertrainDataStreamECU200(PowertrainECU200 ecu)
            : base(ecu.Database, ecu.Channel, ecu.Format)
        {
            model = ecu.Model;

            switch (model)
            {
                case PowertrainModel.DCJ_16A:
                case PowertrainModel.DCJ_16C:
                case PowertrainModel.DCJ_10:
                    if (!QueryLiveData("DCJ Mikuni ECU200"))
                    {
                        throw new DiagException("Cannot find live datas");
                    }

                    foreach (var item in LiveDataItems)
                    {
                        item.FormattedCommand = Format.Pack(item.Command);
                        item.IsEnabled = true;
                    }
                    break;
                case PowertrainModel.QM200GY_F:
                case PowertrainModel.QM200_3D:
                case PowertrainModel.QM200J_3L:
                    if (!QueryLiveData("QingQi Mikuni ECU200"))
                    {
                        throw new DiagException("Cannot find live datas");
                    }

                    foreach (var item in LiveDataItems)
                    {
                        item.FormattedCommand = Format.Pack(item.Command);
                        item.IsEnabled = true;
                    }
                    LiveDataItems["TS"].IsEnabled = false;
                    LiveDataItems["ERF"].IsEnabled = false;
                    LiveDataItems["IS"].IsEnabled = false;
                    break;

                default:
                    throw new DiagException("Unsupport model!");
            }

            ReadInterval = Timer.FromMilliseconds(10);
        }
Ejemplo n.º 2
0
        public PowertrainTroubleCodeECU200(PowertrainECU200 ecu)
            : base(ecu.Database, ecu.Channel, ecu.Format)
        {
            syntheticFailure = Format.Pack(Database.QueryCommand("Synthetic Failure", "Mikuni ECU200"));

            failureCmds = new Dictionary<int, byte[]>();
            failureCalcs = new Dictionary<int, Func<byte[], int, int, string>>();

            failureCmds.Add(1, Format.Pack(Database.QueryCommand("Manifold Pressure Failure", "Mikuni ECU200")));
            failureCalcs.Add(1, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "0040", "0080");
            });

            failureCmds.Add(2, Format.Pack(Database.QueryCommand("O2 Sensor Failure", "Mikuni ECU200")));
            failureCalcs.Add(2, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "0140", "0180");
            });

            failureCmds.Add(3, Format.Pack(Database.QueryCommand("TPS Sensor Failure", "Mikuni ECU200")));
            failureCalcs.Add(3, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "0240", "0280");
            });

            failureCmds.Add(4, Format.Pack(Database.QueryCommand("Sensor Source Failure", "Mikuni ECU200")));
            failureCalcs.Add(4, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "0340", "0380");
            });

            failureCmds.Add(5, Format.Pack(Database.QueryCommand("Battery Voltage Failure", "Mikuni ECU200")));
            failureCalcs.Add(5, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "0540", "0580");
            });

            failureCmds.Add(6, Format.Pack(Database.QueryCommand("Engine Temperature Sensor Failure", "Mikuni ECU200")));
            failureCalcs.Add(6, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "0640", "0680");
            });

            failureCmds.Add(7, Format.Pack(Database.QueryCommand("Manifold Temperature Failure", "Mikuni ECU200")));
            failureCalcs.Add(7, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "0740", "0780");
            });

            failureCmds.Add(8, Format.Pack(Database.QueryCommand("Tilt Sensor Failure", "Mikuni ECU200")));
            failureCalcs.Add(8, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "0840", "0880");
            });

            failureCmds.Add(9, Format.Pack(Database.QueryCommand("DCP Failure", "Mikuni ECU200")));
            failureCalcs.Add(9, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "2040", "2080");
            });

            failureCmds.Add(10, Format.Pack(Database.QueryCommand("Ignition Coil Failure", "Mikuni ECU200")));
            failureCalcs.Add(10, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "2140", "2180");
            });

            failureCmds.Add(11, Format.Pack(Database.QueryCommand("O2 Heater Failure", "Mikuni ECU200")));
            failureCalcs.Add(11, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "2240", "2280");
            });

            failureCmds.Add(11, Format.Pack(Database.QueryCommand("EEPROM Failure", "Mikuni ECU200")));
            failureCalcs.Add(11, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "4040", "4080");
            });

            failureCmds.Add(11, Format.Pack(Database.QueryCommand("Air Valve Failure", "Mikuni ECU200")));
            failureCalcs.Add(11, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "2340", "2380");
            });

            failureCmds.Add(11, Format.Pack(Database.QueryCommand("SAV Failure", "Mikuni ECU200")));
            failureCalcs.Add(11, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "2440", "2480");
            });

            failureCmds.Add(11, Format.Pack(Database.QueryCommand("CPS Failure", "Mikuni ECU200")));
            failureCalcs.Add(11, (buff, offset, length) =>
            {
                return CalcTroubleCode(buff, offset, length, "0940", "0980");
            });

            failureHistoryPointer = Format.Pack(Database.QueryCommand("Failure History Pointer", "Mikuni ECU200"));

            failureHistoryBuffer = new Dictionary<int, byte[]>();
            for (int i = 0; i < 16; i++)
            {
                failureHistoryBuffer.Add(i,
                    Format.Pack(
                        Database.QueryCommand(
                            "Failure History Buffer" + Convert.ToInt32(i), "Mikuni ECU200")
                    )
                );
            }

            failureHistoryClear = Format.Pack(Database.QueryCommand("Failure History Clear", "Mikuni ECU200"));

            model = ecu.Model;
            switch (model)
            {
                case PowertrainModel.DCJ_16A:
                case PowertrainModel.DCJ_16C:
                case PowertrainModel.DCJ_10:
                    sys = "DCJ Mikuni ECU200";
                    break;
                case PowertrainModel.QM200GY_F:
                case PowertrainModel.QM200_3D:
                case PowertrainModel.QM200J_3L:
                    sys = "QingQi Mikuni ECU200";
                    break;
                default:
                    break;
            }

            rData = new byte[100];
        }