Ejemplo n.º 1
0
        public PowertrainECU300(VehicleDB db, ICommbox box, PowertrainModel model)
            : base(db, box)
        {
            switch (model)
            {
                case PowertrainModel.QM48QT_8:
                    Parameter.KLineParity = KLineParity.None;
                    Parameter.KLineBaudRate = 19200;
                    Channel = ChannelFactory.Create(Parameter, box, ProtocolType.MikuniECU300);
                    Format = new MikuniECU300Format(Parameter);
                    break;
                default:
                    throw new DiagException("Unsupport model!");
            }
            startConnection = Format.Pack(Database.QueryCommand("Start Connection", "Mikuni ECU300"));
            tpsIdleLearningValueSetting = Format.Pack(Database.QueryCommand("TPS Idle Learning Value Setting", "Mikuni ECU300"));
            longTermLearningValueReset = Format.Pack(Database.QueryCommand("02 Feed Back Long Term Learning Value Reset", "Mikuni ECU300"));
            dsvISCLearningValueSetting = Format.Pack(Database.QueryCommand("DSV ISC Learning Value Reset", "Mikuni ECU300"));
            readEcuVersion = Format.Pack(Database.QueryCommand("ECU Version Information", "Mikuni ECU300"));

            this.model = model;
            rData = new byte[128];

            DataStream = new PowertrainDataStreamECU300(this);
        }
Ejemplo n.º 2
0
 public void OpenVehicleDB()
 {
   try
   {
     _db = new VehicleDB();
     _db.Open(System.Environment.CurrentDirectory, "test");
   }
   catch (DatabaseException ex)
   {
     Assert.Fail(ex.Message);
   }
 }
Ejemplo n.º 3
0
 public AbstractECU(VehicleDB db, ICommbox box)
 {
     troubleCode = null;
     dataStream = null;
     freezeFrame = null;
     activeTest = null;
     this.db = db;
     this.box = box;
     param = new Parameter();
     format = null;
     chn = null;
 }
Ejemplo n.º 4
0
        public PowertrainECU200(VehicleDB db, ICommbox box, PowertrainModel model)
            : base(db, box)
        {
            switch (model)
            {
                case PowertrainModel.DCJ_16A:
                case PowertrainModel.DCJ_16C:
                case PowertrainModel.DCJ_10:
                    Parameter.KLineParity = KLineParity.None;
                    Parameter.KLineBaudRate = 19200;
                    Channel = ChannelFactory.Create(Parameter, box, ProtocolType.MikuniECU200);
                    Format = new MikuniECU200Format(Parameter);
                    break;
                case PowertrainModel.QM200GY_F:
                case PowertrainModel.QM200_3D:
                case PowertrainModel.QM200J_3L:
                    Parameter.KLineParity = KLineParity.Even;
                    Parameter.KLineBaudRate = 19200;
                    Channel = ChannelFactory.Create(Parameter, box, ProtocolType.MikuniECU300);
                    Format = new MikuniECU200Format(Parameter);
                    break;
                default:
                    throw new DiagException("Unsupport model!");
            }
            this.model = model;
            if (Channel == null)
                throw new DiagException("Cannot create channel!!!");

            readECUVersion1 = Format.Pack(Database.QueryCommand("Read ECU Version 1", "Mikuni ECU200"));
            readECUVersion2 = Format.Pack(Database.QueryCommand("Read ECU Version 2", "Mikuni ECU200"));
            engineRevolutions = Format.Pack(Database.QueryCommand("Engine Revolutions", "Mikuni ECU200"));
            tpsIdleAdjustments = Format.Pack(Database.QueryCommand("TPS Idle Adjustment", "Mikuni ECU200"));
            longTermLearnValueZoneInitialization = Format.Pack(Database.QueryCommand("Long Term Learn Value Zone Initialization", "Mikuni ECU200"));
            longTermLearnValueZones = new Dictionary<int, byte[]>();
            for (int i = 1; i < 11; i++)
            {
                longTermLearnValueZones.Add(i,
                    Format.Pack(
                        Database.QueryCommand(
                            "Long Term Learn Value Zone_" + Convert.ToString(i), "Mikuni ECU200")
                    )
                );
            }
            iscLearnValueInitialization = Format.Pack(Database.QueryCommand("ISC Learn Value Initialization", "Mikuni ECU200"));
            rData = new byte[100];

            DataStream = new PowertrainDataStreamECU200(this);
            TroubleCode = new PowertrainTroubleCodeECU200(this);
        }
Ejemplo n.º 5
0
 public DataStreamFunction(VehicleDB db, IChannel chn, IFormat format)
     : base(db, chn, format)
 {
     stopRead = true;
     stopCalc = true;
     readExp = false;
     lds = null;
     readInterval = Timer.FromMilliseconds(10);
     calcInterval = Timer.FromMilliseconds(1);
     readMutex = new Mutex();
     calcMutex = new Mutex();
     taskFactory = new TaskFactory();
     tasks = null;
     readBuff = new byte[128];
     historyBuff = new Dictionary<string, byte[]>();
     BeginRead = null;
     EndRead = null;
     BeginCalc = null;
     EndCalc = null;
 }
Ejemplo n.º 6
0
 public TroubleCodeFunction(VehicleDB db, IChannel chn, IFormat format)
     : base(db, chn, format)
 {
 }
Ejemplo n.º 7
0
 public AbstractFunction(VehicleDB db, IChannel chn, IFormat format)
 {
     this.db = db;
     this.chn = chn;
     this.format = format;
 }
Ejemplo n.º 8
0
 public ActiveTestFunction(VehicleDB db, IChannel chn, IFormat format)
     : base(db, chn, format)
 {
     actMap = new Dictionary<int, Action<ActiveState>>();
     state = ActiveState.Stop;
 }