예제 #1
0
        public PowertrainDataStreamECU300(PowertrainECU300 ecu)
            : base(ecu.Database, ecu.Channel, ecu.Format)
        {
            model = ecu.Model;

            switch (model)
            {
                case PowertrainModel.QM48QT_8:
                    if (!QueryLiveData("QingQi Mikuni ECU300"))
                    {
                        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;
                    break;
                default:
                    throw new DiagException("Unsupport model");
            }

            ReadInterval = Timer.FromMilliseconds(10);
        }
예제 #2
0
        public static void CheckEngineStop(PowertrainECU300 ecu)
        {
            try
            {
                var item = ecu.DataStream.LiveDataItems["ERF"];
                byte[] buff = item.EcuResponseBuff.Buff;
                byte[] cmd = item.FormattedCommand;
                ecu.Channel.SendAndRecv(cmd, 0, cmd.Length, buff);

                if (!CheckIfPositive(buff, cmd))
                {
                    throw new DiagException(ecu.Database.QueryText("Checking Engine Status Fail", "Mikuni"));
                }

                if (item.EcuResponseBuff[1] == 1)
                {
                    throw new DiagException(ecu.Database.QueryText("Function Fail Because ERF", "Mikuni"));
                }
            }
            catch (ChannelException e)
            {
                throw new DiagException(e.Message);
            }
        }
예제 #3
0
        public PowertrainTroubleCodeECU300(PowertrainECU300 ecu)
            : base(ecu.Database, ecu.Channel, ecu.Format)
        {
            syntheticFailure = Format.Pack(Database.QueryCommand("Synthetic Failure", "Mikuni ECU300"));

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

            byte[] cmd = Database.QueryCommand("O2 Sensor Failure", "Mikuni ECU300");
            failureCmds.Add(1, Format.Pack(cmd));
            failureCalcs.Add(1, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "0140", "0180");
            });

            cmd = Database.QueryCommand("TPS Value Failure", "Mikuni ECU300");
            failureCmds.Add(2, Format.Pack(cmd));
            failureCalcs.Add(2, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "0240", "0280");
            });

            cmd = Database.QueryCommand("Sensor Source Failure", "Mikuni ECU300");
            failureCmds.Add(3, Format.Pack(cmd));
            failureCalcs.Add(3, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "0340", "0380");
            });

            cmd = Database.QueryCommand("Battery Voltage Failure", "Mikuni ECU300");
            failureCmds.Add(4, Format.Pack(cmd));
            failureCalcs.Add(4, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "0540", "0580");
            });

            cmd = Database.QueryCommand("Engine Temperature Sensor Failure", "Mikuni ECU300");
            failureCmds.Add(5, Format.Pack(cmd));
            failureCalcs.Add(5, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "0640", "0680");
            });

            cmd = Database.QueryCommand("Tilt Sensor Failure", "Mikuni ECU300");
            failureCmds.Add(6, Format.Pack(cmd));
            failureCalcs.Add(6, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "0880", "0880");
            });

            cmd = Database.QueryCommand("Injector Failure", "Mikuni ECU300");
            failureCmds.Add(7, Format.Pack(cmd));
            failureCalcs.Add(7, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "2040", "2080");
            });

            cmd = Database.QueryCommand("Ignition Coil Failure", "Mikuni ECU300");
            failureCmds.Add(8, Format.Pack(cmd));
            failureCalcs.Add(8, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "2140", "2180");
            });

            cmd = Database.QueryCommand("DSV Failure", "Mikuni ECU300");
            failureCmds.Add(9, Format.Pack(cmd));
            failureCalcs.Add(9, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "2840", "2880");
            });

            cmd = Database.QueryCommand("PDP Failure", "Mikuni ECU300");
            failureCmds.Add(10, Format.Pack(cmd));
            failureCalcs.Add(10, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "2740", "2780");
            });

            cmd = Database.QueryCommand("EEPROM Failure", "Mikuni ECU300");
            failureCmds.Add(11, Format.Pack(cmd));
            failureCalcs.Add(11, (recv, offset, count) =>
            {
                return CalcTroubleCode(recv, offset, count, "4040", "4080");
            });

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

            failureHistoryBuffer = new Dictionary<int, byte[]>();
            for (int i = 1; i < 17; i++)
            {
                cmd = Database.QueryCommand("Failure History Buffer" + Convert.ToString(i), "Mikuni ECU300");
                failureHistoryBuffer.Add(i, Format.Pack(cmd));
            }

            failureHistoryClear1 = Format.Pack(Database.QueryCommand("Failure History Clear1", "Mikuni ECU300"));

            failureHistoryClear2 = Format.Pack(Database.QueryCommand("Failure History Clear2", "Mikuni ECU300"));

            failureHistoryClear3 = Format.Pack(Database.QueryCommand("Failure History Clear3", "Mikuni ECU300"));

            this.ecu = ecu;
            this.model = ecu.Model;

            switch (model)
            {
                case PowertrainModel.QM48QT_8:
                    sys = "QingQi Mikuni ECU300";
                    break;
                default:
                    break;
            }

            rData = new byte[128];
        }