public void ProcessDiagnosisDetails(Models.Feedback.DiagnosisDetails model) { if (IsReadly) { ShowDiagnosisDetails(model); } }
public byte[] Execute(SerialPortsUtils.Agents.Models.CustomActionContext context) { var temp = GetInjectTimeTime(context); var temp2 = GetECUTime(context); Models.Feedback.DiagnosisDetails model = new Models.Feedback.DiagnosisDetails(); model.InjectTimes = temp; model.ECUWorkTime = temp2; model.InjectOnOffs = GetInjectOnOff(context); SetECUErrors(context, model); var data = context.IO.SendAndRead(InstructionSet.GetInjectOnOff).PacketData(1).ToArray(); var b1 = new Models.Feedback.Bank <bool[]>() { Name = "Bank1" }; b1.Data = ValueConvert.InjectOnOffFrom(data[0]); //var b2 = new Models.Feedback.Bank<bool[]>() { Name = "Bank2" }; //b2.Data = ValueConvert.InjectOnOffFrom(data[1]); model.InjectOnOffs = new Models.Feedback.Bank <bool[]>[] { b1 }; //, b2 model.OnOffRaw = data.Take(2).ToArray(); //返回前面两个元素 OnOffRaw是InjectOnOffs标记集合 context.Job.Content.Context = model; return(null); }
public void ProcessDiagnosisDetails(Models.Feedback.DiagnosisDetails model) { }
private void SetECUErrors(SerialPortsUtils.Agents.Models.CustomActionContext context, Models.Feedback.DiagnosisDetails model) { var data = context.IO.SendAndRead(InstructionSet.GetECUErrorState).PacketData(1).ToArray(); model.ECUErrorStates = data[0] | data[1] << 8 | data[2] << 16; model.ECUErrorStates_Store = 0; }
//private void ShowDiagnosisDetails(Models.Feedback.DiagnosisDetails model) //{ // if (!IsReadly) return; // int bank = Services.Device.DeviceInfo.HardInof.ECUExtension ? ddlBank.SelectedIndex : 0; // labGasTime.Text = String.Format("{0}:{1}", (model.ECUWorkTime.Gas.Days * 24 + model.ECUWorkTime.Gas.Hours).ToString(), // model.ECUWorkTime.Gas.Minutes >= 10 ? model.ECUWorkTime.Gas.Minutes.ToString() : "0" + model.ECUWorkTime.Gas.Minutes.ToString()); // labRedTime.Text = String.Format("{0}:{1}", (model.ECUWorkTime.Red.Days * 24 + model.ECUWorkTime.Red.Hours).ToString(), // model.ECUWorkTime.Red.Minutes >= 10 ? model.ECUWorkTime.Red.Minutes.ToString() : "0" + model.ECUWorkTime.Red.Minutes.ToString()); // var temp = model.InjectOnOffs[ddlBank.SelectedIndex].Data;//喷轨测试状态 // var enable = model.InjectTimes[ddlBank.SelectedIndex].Gas.Any(m => m > 0);//有喷油时间就为真 // for (int i = 0; i < Services.Stroe.ECUSetting.Cylinders; i++) // { // GasDiaLines[i].RightLabel = model.InjectTimes[bank].Gas[i].ToString("N02"); // GasDiaLines[i].ON = temp[i]&&enable; // PertrolDiaLInes[i].RightLabel = model.InjectTimes[bank].Pertrol[i].ToString("N02"); // PertrolDiaLInes[i].ON = model.InjectTimes[bank].Pertrol[i] > 0; // } // if(Raw==null) // { // lock (SyncRoot)//LDC // { // Raw = model.OnOffRaw; // OnOffSet = model.InjectOnOffs; // } // } // else // { // lock (SyncRoot)//LDC // { // if (Raw[0] != model.OnOffRaw[0]) // { // Raw = model.OnOffRaw; // OnOffSet = model.InjectOnOffs; // } // } // } // if(this.ECUErrors!=model.ECUErrorStates||this.ECUErrors_Store!=model.ECUErrorStates_Store) // { // this.ECUErrors = model.ECUErrorStates; // this.ECUErrors_Store = model.ECUErrorStates_Store; // SetErrorStateText(); // } // cbAutoDiagnosis.Checked = Services.Stroe.ECUSetting.AutoDiagnosis; //} private void ShowDiagnosisDetails(Models.Feedback.DiagnosisDetails model) { if (!IsReadly) { return; } int a = 0; int b = 0; int bank = 0;//ddlBank.SelectedIndex Services.Device.DeviceInfo.HardInof.ECUExtension ? 1 : labGasTime.Text = String.Format("{0}:{1}", (model.ECUWorkTime.Gas.Days * 24 + model.ECUWorkTime.Gas.Hours).ToString(), model.ECUWorkTime.Gas.Minutes >= 10 ? model.ECUWorkTime.Gas.Minutes.ToString() : "0" + model.ECUWorkTime.Gas.Minutes.ToString()); labRedTime.Text = String.Format("{0}:{1}", (model.ECUWorkTime.Red.Days * 24 + model.ECUWorkTime.Red.Hours).ToString(), model.ECUWorkTime.Red.Minutes >= 10 ? model.ECUWorkTime.Red.Minutes.ToString() : "0" + model.ECUWorkTime.Red.Minutes.ToString()); var temp = model.InjectOnOffs[0].Data; //喷轨测试状态 var enable = model.InjectTimes[0].Gas.Any(m => m > 0); //有喷油时间就为真 switch (Services.Stroe.ECUSetting.Cylinders) { case 2: a = 2; b = 0; break; case 3: a = 3; b = 0; break; case 4: a = 4; b = 0; break; case 5: a = 3; b = 2; break; case 6: a = 3; b = 3; break; case 8: a = 4; b = 4; break; } for (int i = 0; i < a; i++) { GasDiaLines[i].RightLabel = model.InjectTimes[bank].Gas[i].ToString("N02"); GasDiaLines[i].ON = temp[i] && enable; // GasDiaLines[i].MyEnable = enable;//LDC删除 PertrolDiaLInes[i].RightLabel = model.InjectTimes[bank].Pertrol[i].ToString("N02"); PertrolDiaLInes[i].ON = model.InjectTimes[bank].Pertrol[i] > 0; } for (int i = 4; i < 4 + b; i++) { GasDiaLines[i].RightLabel = model.InjectTimes[bank].Gas[i].ToString("N02"); GasDiaLines[i].ON = temp[i] && enable; // GasDiaLines[i].MyEnable = enable;//LDC删除 PertrolDiaLInes[i].RightLabel = model.InjectTimes[bank].Pertrol[i].ToString("N02"); PertrolDiaLInes[i].ON = model.InjectTimes[bank].Pertrol[i] > 0; } if (Raw == null) { lock (SyncRoot)//LDC { Raw = model.OnOffRaw; OnOffSet = model.InjectOnOffs; } } else { lock (SyncRoot)//LDC { //if(Raw[0]!=model.OnOffRaw[0]||Raw[1]!=model.OnOffRaw[1]) if (Raw[0] != model.OnOffRaw[0]) { Raw = model.OnOffRaw; OnOffSet = model.InjectOnOffs; } } } if (this.ECUErrors != model.ECUErrorStates || this.ECUErrors_Store != model.ECUErrorStates_Store) { this.ECUErrors = model.ECUErrorStates; this.ECUErrors_Store = model.ECUErrorStates_Store; SetErrorStateText(); } //if (model.OBDErrors != null) // if (this.OBDErrorsCount != model.OBDErrors.Count()) // { // this.OBDErrorsCount = model.OBDErrors.Count(); // this.Invoke(new UIHelper.UIINvkoeParam1<ParmWarper<Models.Feedback.OBDError[]>>(SetOBDErrorsList), new ParmWarper<Models.Feedback.OBDError[]>(model.OBDErrors)); // } cbAutoDiagnosis.Checked = Services.Stroe.ECUSetting.AutoDiagnosis; }