/**Read CaptureMethodAttrType form CaptureMethod.xml*/ public static void read() { StrCaptureMethod param; CaptureMethodXml captureMethodXml = SystemConfig.DeserializeFromXml <CaptureMethodXml>("DaqAttrTypeXml/CaptureMethod.xml"); if (captureMethodXml == null) { MessageShow.show("Get Capture method parameter from CaptureMethod.xml failed", "从CaptureMethod.xml获取接口地址失败"); return; } param = captureMethodXml.captureMethod.Param; DaqAttrType.captureMethod.AcquireMode = addAddress(param.AcquireMode, DaqAttrType.baseAddr); DaqAttrType.captureMethod.FrameCount = addAddress(param.FrameCount, DaqAttrType.baseAddr); DaqAttrType.captureMethod.LastValidBuffer = addAddress(param.LastValidBuffer, DaqAttrType.baseAddr); DaqAttrType.captureMethod.FrameWaitMsec = addAddress(param.FrameWaitMsec, DaqAttrType.baseAddr); DaqAttrType.captureMethod.NumBuffers = addAddress(param.NumBuffers, DaqAttrType.baseAddr); DaqAttrType.captureMethod.LostFrams = addAddress(param.LostFrams, DaqAttrType.baseAddr); DaqAttrType.captureMethod.LastActiveFrame = addAddress(param.LastActiveFrame, DaqAttrType.baseAddr); DaqAttrType.captureMethod.AcquireBufferNum = addAddress(param.AcquireBufferNum, DaqAttrType.baseAddr); DaqAttrType.captureMethod.AcquireBufferIndex = addAddress(param.AcquireBufferIndex, DaqAttrType.baseAddr); DaqAttrType.captureMethod.TransferBufferNum = addAddress(param.TransferBufferNum, DaqAttrType.baseAddr); DaqAttrType.captureMethod.TransferBufferIndex = addAddress(param.TransferBufferIndex, DaqAttrType.baseAddr); DaqAttrType.captureMethod.ActiveBuffer = addAddress(param.ActiveBuffer, DaqAttrType.baseAddr); DaqAttrType.captureMethod.LoadFileDownAddr = addAddress(param.LoadFileDownAddr, DaqAttrType.baseAddr); DaqAttrType.captureMethod.LoadFileRunAddr = addAddress(param.LoadFileRunAddr, DaqAttrType.baseAddr); }
/**Read MaterialVelocityAttrType form MaterialVelocity.xml*/ public static void read() { StrOutLine param; OutLineXml outLineXml = SystemConfig.DeserializeFromXml <OutLineXml>("DaqAttrTypeXml/OutLine.xml"); if (outLineXml == null) { MessageShow.show("Get outline parameter from OutLine.xml failed", "从OutLine.xml获取接口地址失败"); return; } param = outLineXml.outLine.Param; DaqAttrType.outLine.Line0Route = addAddress(param.Line0Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line1Route = addAddress(param.Line1Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line2Route = addAddress(param.Line2Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line3Route = addAddress(param.Line3Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line4Route = addAddress(param.Line4Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line5Route = addAddress(param.Line5Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line6Route = addAddress(param.Line6Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line7Route = addAddress(param.Line7Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line8Route = addAddress(param.Line8Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line9Route = addAddress(param.Line9Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line10Route = addAddress(param.Line10Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line11Route = addAddress(param.Line11Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line12Route = addAddress(param.Line12Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line13Route = addAddress(param.Line13Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line14Route = addAddress(param.Line14Route, DaqAttrType.baseAddr); DaqAttrType.outLine.Line15Route = addAddress(param.Line15Route, DaqAttrType.baseAddr); }
public void FormLoad() { string filename = "product"; string filepath = ""; filepath = SystemConfig.GlobalLoad(filename); if (filepath == "") { MessageBox.Show("产品信息配置失败", "警告"); return; } InitInterface(); //deserialize product = SystemConfig.DeserializeFromXml(filepath, product); ClassToUI(); mainform.Getgroove(product.groove); mainform.Getsampledefs(product.sample.defects); }
/**Read Gate parmameters from Gate.xml, then, set parameters to board*/ public static int load(uint ascanNum, uint ascanPort, string filePath) { //gate quatity int cnt = 0; int error_code = 0; GateType gateType; PGate param; string fileName = filePath + @"\Gate.xml"; PGateXml gateXml = SystemConfig.DeserializeFromXml <PGateXml>(fileName); if (gateXml == null) { return(error_code = -1); } cnt = gateXml.Gates.Count; for (int i = 0; i < cnt; i++) { param = gateXml.Gates[i].Param; gateType = (GateType)i; error_code = setGate(ascanNum, ascanPort, gateType, param); if (error_code != 0) { return(error_code); } } return(error_code); }
/**Read RecievertAttrType form Reciever.xml*/ public static void read() { StrReceiver param; ReceiverXml receiverXml = SystemConfig.DeserializeFromXml <ReceiverXml>("DaqAttrTypeXml/Receiver.xml"); if (receiverXml == null) { MessageShow.show("Get receiver parameter from Receiver.xml failed", "从Receiver.xml获取接口地址失败"); return; } param = receiverXml.receiver.Param; DaqAttrType.receiver.Active = addAddress(param.Active, DaqAttrType.baseAddr); DaqAttrType.receiver.AnalogHPF = addAddress(param.AnalogHPF, DaqAttrType.baseAddr); DaqAttrType.receiver.AnalogLPF = addAddress(param.AnalogLPF, DaqAttrType.baseAddr); DaqAttrType.receiver.DigitalHPF = addAddress(param.DigitalHPF, DaqAttrType.baseAddr); DaqAttrType.receiver.DigitalLPF = addAddress(param.DigitalLPF, DaqAttrType.baseAddr); DaqAttrType.receiver.ReceiverPATH = addAddress(param.ReceiverPATH, DaqAttrType.baseAddr); DaqAttrType.receiver.DampingActive = addAddress(param.DampingActive, DaqAttrType.baseAddr); DaqAttrType.receiver.DampingValue = addAddress(param.DampingValue, DaqAttrType.baseAddr); DaqAttrType.receiver.AnalogGain = addAddress(param.AnalogGain, DaqAttrType.baseAddr); DaqAttrType.receiver.Delay = addAddress(param.Delay, DaqAttrType.baseAddr); DaqAttrType.receiver.Intensity = addAddress(param.Intensity, DaqAttrType.baseAddr); }
/**Read GateAtrrType form Gate.xml*/ public static void read() { //gate quatity int cnt = 0; StrGate param; GateXml gateXml = SystemConfig.DeserializeFromXml <GateXml>("DaqAttrTypeXml/Gate.xml"); cnt = gateXml.Gates.Count; if (cnt != 4) { MessageShow.show("Gate quatity not equal 4, pls check Gate.xml!", "Gate.xml 中的门的数量不等于4,请检查"); return; } DaqAttrType.gate = new GateAttrType[gateXml.Gates.Count]; for (int i = 0; i < gateXml.Gates.Count; i++) { param = gateXml.Gates[i].Param; DaqAttrType.gate[i].Delay = addAddress(param.Delay, DaqAttrType.baseAddr); DaqAttrType.gate[i].Width = addAddress(param.Width, DaqAttrType.baseAddr); DaqAttrType.gate[i].Threshold = addAddress(param.Threshold, DaqAttrType.baseAddr); DaqAttrType.gate[i].IF = addAddress(param.IF, DaqAttrType.baseAddr); DaqAttrType.gate[i].TofMode = addAddress(param.TofMode, DaqAttrType.baseAddr); DaqAttrType.gate[i].DnsActive = addAddress(param.DnsActive, DaqAttrType.baseAddr); DaqAttrType.gate[i].DnsBw = addAddress(param.DnsBw, DaqAttrType.baseAddr); DaqAttrType.gate[i].DnsStart = addAddress(param.DnsStart, DaqAttrType.baseAddr); DaqAttrType.gate[i].DnsSetp = addAddress(param.DnsSetp, DaqAttrType.baseAddr); DaqAttrType.gate[i].AlarmLogic = addAddress(param.AlarmLogic, DaqAttrType.baseAddr); DaqAttrType.gate[i].ScActive = addAddress(param.ScActive, DaqAttrType.baseAddr); DaqAttrType.gate[i].ScCounter = addAddress(param.ScCounter, DaqAttrType.baseAddr); DaqAttrType.gate[i].DtsActive = addAddress(param.DtsActive, DaqAttrType.baseAddr); DaqAttrType.gate[i].DtsBand = addAddress(param.DtsBand, DaqAttrType.baseAddr); DaqAttrType.gate[i].DtsStart = addAddress(param.DtsStart, DaqAttrType.baseAddr); DaqAttrType.gate[i].DtsStep = addAddress(param.DtsStep, DaqAttrType.baseAddr); DaqAttrType.gate[i].TolMonitorActive = addAddress(param.TolMonitorActive, DaqAttrType.baseAddr); DaqAttrType.gate[i].TolMonitorMax = addAddress(param.TolMonitorMax, DaqAttrType.baseAddr); DaqAttrType.gate[i].TolMonitorMin = addAddress(param.TolMonitorMin, DaqAttrType.baseAddr); DaqAttrType.gate[i].TolMonitorSc = addAddress(param.TolMonitorSc, DaqAttrType.baseAddr); DaqAttrType.gate[i].AlarmActive = addAddress(param.AlarmActive, DaqAttrType.baseAddr); DaqAttrType.gate[i].AlarmMode = addAddress(param.AlarmMode, DaqAttrType.baseAddr); DaqAttrType.gate[i].AlarmSignalLength = addAddress(param.AlarmSignalLength, DaqAttrType.baseAddr); DaqAttrType.gate[i].AlarmTimeLength = addAddress(param.AlarmTimeLength, DaqAttrType.baseAddr); DaqAttrType.gate[i].AlarmActiveLevel = addAddress(param.AlarmActiveLevel, DaqAttrType.baseAddr); DaqAttrType.gate[i].MeasActive = addAddress(param.MeasActive, DaqAttrType.baseAddr); DaqAttrType.gate[i].MeasMode = addAddress(param.MeasMode, DaqAttrType.baseAddr); } }
/**Read BackEchoAttrType form BackEcho.xml*/ public static void read() { StrBackEcho param; BackEchoXml backEchoXml = SystemConfig.DeserializeFromXml <BackEchoXml>("DaqAttrTypeXml/BackEcho.xml"); if (backEchoXml == null) { MessageShow.show("Get Ascan video parameter from BackEcho.xml failed", "从BackEcho.xml获取接口地址失败"); return; } param = backEchoXml.backEcho.Param; DaqAttrType.backEcho.Active = addAddress(param.Active, DaqAttrType.baseAddr); }
private void btnOpenProductXml_Click(object sender, EventArgs e) { OpenFileDialog openDialog = new OpenFileDialog(); openDialog.Title = ""; openDialog.InitialDirectory = Application.StartupPath + "\\resources\\product"; openDialog.RestoreDirectory = false; if (openDialog.ShowDialog() == DialogResult.OK) { openPath = openDialog.FileName; InitInterface(); //deserialize product = SystemConfig.DeserializeFromXml(openPath, product); ClassToUI(); } }
/**Read PosTriggerAttrType form PosTrigger.xml*/ public static void read() { StrPosTrigger param; PosTriggerXml posTriggerXml = SystemConfig.DeserializeFromXml <PosTriggerXml>("DaqAttrTypeXml/PosTrigger.xml"); if (posTriggerXml == null) { MessageShow.show("Get pos trigger parameter from PosTrigger.xml failed", "从PosTrigger.xml获取接口地址失败"); return; } param = posTriggerXml.posTrigger.Param; DaqAttrType.posTrigger.PosTriggerSource = addAddress(param.PosTriggerSource, DaqAttrType.baseAddr); DaqAttrType.posTrigger.EncoderTriggerSource = addAddress(param.EncoderTriggerSource, DaqAttrType.baseAddr); }
/**Read MaterialVelocityAttrType form MaterialVelocity.xml*/ public static void read() { StrMeasurement param; MeasurementXml measurementXml = SystemConfig.DeserializeFromXml <MeasurementXml>("DaqAttrTypeXml/Measurement.xml"); if (measurementXml == null) { MessageShow.show("Get measurement parameter from Measurement.xml failed", "从Measurement.xml获取接口地址失败"); return; } param = measurementXml.measurement.Param; DaqAttrType.measurement.AlarmActive = addAddress(param.AlarmActive, DaqAttrType.baseAddr); DaqAttrType.measurement.AlarmDisp = addAddress(param.AlarmDisp, DaqAttrType.baseAddr); }
/**Read UnitAttrType form Tesout.xml*/ public static void read() { StrUnit param; UnitXml unitXml = SystemConfig.DeserializeFromXml <UnitXml>("DaqAttrTypeXml/Unit.xml"); if (unitXml == null) { MessageShow.show("Get unit parameter from Unit.xml failed", "从Unit.xml获取接口地址失败"); return; } param = unitXml.unit.Param; DaqAttrType.unit.Tof = addAddress(param.Tof, DaqAttrType.baseAddr); DaqAttrType.unit.Amp = addAddress(param.Amp, DaqAttrType.baseAddr); }
/**Read EnvelopDataAttrType form EnvelopData.xml*/ public static void read() { StrEnvelopData param; EnvelopDataXml envelopDataXml = SystemConfig.DeserializeFromXml <EnvelopDataXml>("DaqAttrTypeXml/EnvelopData.xml"); if (envelopDataXml == null) { MessageShow.show("Get Envelop data parameter from EnvelopData.xml failed", "从EnvelopData.xml获取接口地址失败"); return; } param = envelopDataXml.envelopData.Param; DaqAttrType.envelopData.UploadMode = addAddress(param.UploadMode, DaqAttrType.baseAddr); DaqAttrType.envelopData.UploadStamps = addAddress(param.UploadStamps, DaqAttrType.baseAddr); DaqAttrType.envelopData.UploadType = addAddress(param.UploadType, DaqAttrType.baseAddr); }
/**Read PluserModuleAttrType form PulserTransmit.xml*/ public static void read() { StrPluserModule param; PluserModuleXml pluserModuleXml = SystemConfig.DeserializeFromXml <PluserModuleXml>("DaqAttrTypeXml/PluserModule.xml"); if (pluserModuleXml == null) { MessageShow.show("Get pluser module parameter from PluserModule.xml failed", "从PluserModule.xml获取接口地址失败"); return; } param = pluserModuleXml.pluserModule.Param; DaqAttrType.pluserModule.Mode = addAddress(param.Mode, DaqAttrType.baseAddr); DaqAttrType.pluserModule.TimeBase = addAddress(param.TimeBase, DaqAttrType.baseAddr); DaqAttrType.pluserModule.RearmSource = addAddress(param.RearmSource, DaqAttrType.baseAddr); }
/**Read MaterialVelocityAttrType form MaterialVelocity.xml*/ public static void read() { StrMaterialVelocity param; MatVelocityXml matVelocityXml = SystemConfig.DeserializeFromXml <MatVelocityXml>("DaqAttrTypeXml/MaterialVelocity.xml"); if (matVelocityXml == null) { MessageShow.show("Get Ascan video parameter from MaterialVelocity.xml failed", "从MaterialVelocity.xml获取接口地址失败"); return; } param = matVelocityXml.matVelocity.Param; DaqAttrType.matVelocity.Longitudinal = addAddress(param.Longitudinal, DaqAttrType.baseAddr); DaqAttrType.matVelocity.Transverse = addAddress(param.Transverse, DaqAttrType.baseAddr); DaqAttrType.matVelocity.Velocity = addAddress(param.Velocity, DaqAttrType.baseAddr); }
/**Read TesoutAttrType form Tesout.xml*/ public static void read() { StrTesout param; TesoutXml tesoutXml = SystemConfig.DeserializeFromXml <TesoutXml>("DaqAttrTypeXml/Tesout.xml"); if (tesoutXml == null) { MessageShow.show("Get Tesout parameter from Tesout.xml failed", "从Tesout.xml获取接口地址失败"); return; } param = tesoutXml.tesout.Param; DaqAttrType.tesout.Active = addAddress(param.Active, DaqAttrType.baseAddr); DaqAttrType.tesout.Freq = addAddress(param.Freq, DaqAttrType.baseAddr); DaqAttrType.tesout.Mode = addAddress(param.Mode, DaqAttrType.baseAddr); }
/**Read AscanDataAttrType form PulserTransmit.xml*/ public static void read() { StrAscanData param; AscanDataXml ascanDataXml = SystemConfig.DeserializeFromXml <AscanDataXml>("DaqAttrTypeXml/AscanData.xml"); if (ascanDataXml == null) { MessageShow.show("Get Ascan data parameter from AscanData.xml failed", "从AscanData.xml获取接口地址失败"); return; } param = ascanDataXml.ascanData.Param; DaqAttrType.ascanData.UploadMode = addAddress(param.UploadMode, DaqAttrType.baseAddr); DaqAttrType.ascanData.UploadStamps = addAddress(param.UploadStamps, DaqAttrType.baseAddr); DaqAttrType.ascanData.UploadType = addAddress(param.UploadType, DaqAttrType.baseAddr); }
/**Read RealTimeDataAttrType form RealTimeData.xml*/ public static void read() { StrRealTimeData param; RealTimeDataXml realTimeDataXml = SystemConfig.DeserializeFromXml <RealTimeDataXml>("DaqAttrTypeXml/RealTimeData.xml"); if (realTimeDataXml == null) { MessageShow.show("Get real time data parameter from RealTimeData.xml failed", "从RealTimeData.xml获取接口地址失败"); return; } param = realTimeDataXml.realTimeData.Param; DaqAttrType.realTimeData.UploadMode = addAddress(param.UploadMode, DaqAttrType.baseAddr); DaqAttrType.realTimeData.UploadStamps = addAddress(param.UploadStamps, DaqAttrType.baseAddr); DaqAttrType.realTimeData.UploadType = addAddress(param.UploadType, DaqAttrType.baseAddr); }
/**Read StatusIndicatorAttrType form StatusIndicator.xml*/ public static void read() { StrStatusIndicator param; StatusIndicatorXml statusIndicatorXml = SystemConfig.DeserializeFromXml <StatusIndicatorXml>("DaqAttrTypeXml/StatusIndicator.xml"); if (statusIndicatorXml == null) { MessageShow.show("Get Status indicator parameter from StatusIndicator.xml failed", "从StatusIndicator.xml获取接口地址失败"); return; } param = statusIndicatorXml.statusIndicator.Param; DaqAttrType.statusIndicator.Machine = addAddress(param.Machine, DaqAttrType.baseAddr); DaqAttrType.statusIndicator.Errcode = addAddress(param.Errcode, DaqAttrType.baseAddr); DaqAttrType.statusIndicator.BeatHeart = addAddress(param.BeatHeart, DaqAttrType.baseAddr); DaqAttrType.statusIndicator.AcqInProgress = addAddress(param.AcqInProgress, DaqAttrType.baseAddr); }
/**Read PCIAttrType form PCI.xml*/ public static void read() { StrPCI param; PCIXml PCIXml = SystemConfig.DeserializeFromXml <PCIXml>("DaqAttrTypeXml/PCI.xml"); if (PCIXml == null) { MessageShow.show("Get PCI parameter from PCI.xml failed", "从PCI.xml获取接口地址失败"); return; } param = PCIXml.pci.Param; DaqAttrType.pci.SyncAcqDone = addAddress(param.SyncAcqDone, DaqAttrType.baseAddr); DaqAttrType.pci.PCISlotNumber = addAddress(param.PCISlotNumber, DaqAttrType.baseAddr); DaqAttrType.pci.PCIClassicNumber = addAddress(param.PCIClassicNumber, DaqAttrType.baseAddr); }
/**Read DACAttrType form DAC.xml*/ public static void read() { StrDAC param; DACXml dacXml = SystemConfig.DeserializeFromXml <DACXml>("DaqAttrTypeXml/DAC.xml"); if (dacXml == null) { MessageShow.show("Get DAC parameter from DAC.xml failed", "从DAC.xml获取接口地址失败"); return; } param = dacXml.dac.Param; DaqAttrType.dac.Active = addAddress(param.Active, DaqAttrType.baseAddr); DaqAttrType.dac.Point = addAddress(param.Point, DaqAttrType.baseAddr); DaqAttrType.dac.File = addAddress(param.File, DaqAttrType.baseAddr); DaqAttrType.dac.Mode = addAddress(param.Mode, DaqAttrType.baseAddr); }
private void cmbProductName_SelectedIndexChanged(object sender, EventArgs e) { if (cmbProductName.SelectedItem != null && isclick) { if (MessageBox.Show("是否载入参数", "确认", MessageBoxButtons.OKCancel) == DialogResult.OK) { string path = Application.StartupPath + "\\resources\\product\\" + cmbProductName.SelectedItem.ToString() + ".xml"; //clear TextBox GeneralFuc.ClearTextBox(this); maskedtxtDate.Text = "00000000"; defectGrid.Rows.Clear(); //deserialize product = SystemConfig.DeserializeFromXml(path, product); ClassToUI(); openPath = path; isclick = false; int a = cmbProductName.SelectedIndex; if (a < 0) { a = 0; } else { cmbProductName.Items[a] = product.name; } } else { isclick = false; int a = cmbProductName.SelectedIndex; if (a < 0) { a = 0; } else { cmbProductName.Items[a] = product.name; } } } }
/**Read LEDStatusAttrType form LEDStatus.xml*/ public static void read() { StrLEDStatus param; LEDStatusXml LEDStatusXml = SystemConfig.DeserializeFromXml <LEDStatusXml>("DaqAttrTypeXml/LEDStatus.xml"); if (LEDStatusXml == null) { MessageShow.show("Get LED status parameter from LEDStatus.xml failed", "从LEDStatus.xml获取接口地址失败"); return; } param = LEDStatusXml.LEDStatus.Param; DaqAttrType.ledStatus.Run = addAddress(param.Run, DaqAttrType.baseAddr); DaqAttrType.ledStatus.SysFail = addAddress(param.SysFail, DaqAttrType.baseAddr); DaqAttrType.ledStatus.Acess = addAddress(param.Acess, DaqAttrType.baseAddr); DaqAttrType.ledStatus.Fail = addAddress(param.Fail, DaqAttrType.baseAddr); }
private void btnOpenXml_Click(object sender, EventArgs e) { OpenFileDialog openDialog = new OpenFileDialog(); openDialog.Title = ""; openDialog.InitialDirectory = Application.StartupPath + "\\resources\\probe"; openDialog.RestoreDirectory = false; if (openDialog.ShowDialog() == DialogResult.OK) { openPath = openDialog.FileName; //InitInterface(); GeneralFuc.ClearTextBox(this); dataGridView1.Rows.Clear(); mstxtDate.Text = "00000000"; //deserialize probe = SystemConfig.DeserializeFromXml(openPath, probe); ClassToUI(); } }
/**Read PAAttrType form PA.xml*/ public static void read() { StrPA param; PAXml pAXml = SystemConfig.DeserializeFromXml <PAXml>("DaqAttrTypeXml/PA.xml"); if (pAXml == null) { MessageShow.show("Get Ascan video parameter from PA.xml failed", "从PA.xml获取接口地址失败"); return; } param = pAXml.pA.Param; DaqAttrType.pA.SeqScanRepeatMode = addAddress(param.SeqScanRepeatMode, DaqAttrType.baseAddr); DaqAttrType.pA.ScanMode = addAddress(param.ScanMode, DaqAttrType.baseAddr); DaqAttrType.pA.BeamFormerFile = addAddress(param.BeamFormerFile, DaqAttrType.baseAddr); DaqAttrType.pA.RealElementSize = addAddress(param.RealElementSize, DaqAttrType.baseAddr); DaqAttrType.pA.VirtualElementSize = addAddress(param.VirtualElementSize, DaqAttrType.baseAddr); DaqAttrType.pA.SeqPeriodTimes = addAddress(param.SeqPeriodTimes, DaqAttrType.baseAddr); }
/**Read GlobalCtrlAttrType form GlobalControl.xml*/ public static void read() { StrGlobalCtrl param; GlobalCtrlXml gloablCtrlXml = SystemConfig.DeserializeFromXml <GlobalCtrlXml>("DaqAttrTypeXml/GlobalControl.xml"); if (gloablCtrlXml == null) { MessageShow.show("Get Global control parameter from GlobalControl.xml failed", "从GlobalControl.xml获取接口地址失败"); return; } param = gloablCtrlXml.globalCtrl.Param; DaqAttrType.globalCtrl.TrigMode = addAddress(param.TrigMode, DaqAttrType.baseAddr); DaqAttrType.globalCtrl.RunMode = addAddress(param.RunMode, DaqAttrType.baseAddr); DaqAttrType.globalCtrl.PxistarTrigStartDelay = addAddress(param.PxistarTrigStartDelay, DaqAttrType.baseAddr); DaqAttrType.globalCtrl.PxistarTrigStopDelay = addAddress(param.PxistarTrigStopDelay, DaqAttrType.baseAddr); DaqAttrType.globalCtrl.SoftStart = addAddress(param.SoftStart, DaqAttrType.baseAddr); DaqAttrType.globalCtrl.SoftStop = addAddress(param.SoftStop, DaqAttrType.baseAddr); DaqAttrType.globalCtrl.SoftReset = addAddress(param.SoftReset, DaqAttrType.baseAddr); }
/**Read PowerAttrType form Power.xml*/ public static void read() { StrPower param; PowerXml powerXml = SystemConfig.DeserializeFromXml <PowerXml>("DaqAttrTypeXml/Power.xml"); if (powerXml == null) { MessageShow.show("Get power parameter from Power.xml failed", "从Power.xml获取接口地址失败"); return; } param = powerXml.power.Param; DaqAttrType.power.Hv = addAddress(param.Hv, DaqAttrType.baseAddr); DaqAttrType.power.Optocoupler = addAddress(param.Optocoupler, DaqAttrType.baseAddr); DaqAttrType.power.Opa = addAddress(param.Opa, DaqAttrType.baseAddr); DaqAttrType.power.Testout = addAddress(param.Testout, DaqAttrType.baseAddr); DaqAttrType.power.Power12vp = addAddress(param.Power12vp, DaqAttrType.baseAddr); DaqAttrType.power.Ethernet = addAddress(param.Ethernet, DaqAttrType.baseAddr); DaqAttrType.power.Serial = addAddress(param.Serial, DaqAttrType.baseAddr); }
/**Read PulserTransmitAttrType form PulserTransmit.xml*/ public static void read() { StrPulserTransmit param; PulserTransmitXml pulserTransmitXml = SystemConfig.DeserializeFromXml<PulserTransmitXml>("DaqAttrTypeXml/PulserTransmit.xml"); if (pulserTransmitXml == null) { MessageShow.show("Get pulser transmit parameter from PulserTransmit.xml failed", "从PulserTransmit.xml获取接口地址失败"); return; } param = pulserTransmitXml.pt.Param; DaqAttrType.pulserTranmit.Active = addAddress(param.Active, DaqAttrType.baseAddr); DaqAttrType.pulserTranmit.Delay = addAddress(param.Delay, DaqAttrType.baseAddr); DaqAttrType.pulserTranmit.Width = addAddress(param.Width, DaqAttrType.baseAddr); DaqAttrType.pulserTranmit.Intensity = addAddress(param.Intensity, DaqAttrType.baseAddr); DaqAttrType.pulserTranmit.DampingActive = addAddress(param.DampingActive, DaqAttrType.baseAddr); DaqAttrType.pulserTranmit.DampingValue = addAddress(param.DampingValue, DaqAttrType.baseAddr); DaqAttrType.pulserTranmit.RecieverMode = addAddress(param.RecieverMode, DaqAttrType.baseAddr); DaqAttrType.pulserTranmit.Prf = addAddress(param.Prf, DaqAttrType.baseAddr); }
public void FormLoad() { string filename = "probe"; string filepath = ""; filepath = SystemConfig.GlobalLoad(filename); if (filepath == "") { MessageBox.Show("探头信息配置失败", "警告"); return; } //InitInterface(); GeneralFuc.ClearTextBox(this); mstxtDate.Text = "00000000"; //deserialize probe = SystemConfig.DeserializeFromXml(filepath, probe); ClassToUI(); mainform.Getprobe(probe); }
/**Read DoubleGateAtrrType form DoubleGate.xml*/ public static void read() { //gate quatity int cnt = 0; StrDGate param; DGateXml gateXml = SystemConfig.DeserializeFromXml <DGateXml>("DaqAttrTypeXml/DoubleGate.xml"); cnt = gateXml.DGates.Count; if (cnt != 4) { MessageShow.show("Double gate quatity not equal 4, pls check DoubleGate.xml!", "DoubleGate.xml 中的门的数量不等于4,请检查"); return; } DaqAttrType.dGate = new DGateAttrType[cnt]; for (int i = 0; i < cnt; i++) { param = gateXml.DGates[i].Param; DaqAttrType.dGate[i].TolMonitorActive = addAddress(param.TolMonitorActive, DaqAttrType.baseAddr); DaqAttrType.dGate[i].TolMonitorMax = addAddress(param.TolMonitorMax, DaqAttrType.baseAddr); DaqAttrType.dGate[i].TolMonitorMin = addAddress(param.TolMonitorMin, DaqAttrType.baseAddr); DaqAttrType.dGate[i].TolMonitorSc = addAddress(param.TolMonitorSc, DaqAttrType.baseAddr); DaqAttrType.dGate[i].AlarmActive = addAddress(param.AlarmActive, DaqAttrType.baseAddr); DaqAttrType.dGate[i].AlarmMode = addAddress(param.AlarmMode, DaqAttrType.baseAddr); DaqAttrType.dGate[i].AlarmSignalLength = addAddress(param.AlarmSignalLength, DaqAttrType.baseAddr); DaqAttrType.dGate[i].AlarmTimeLength = addAddress(param.AlarmTimeLength, DaqAttrType.baseAddr); DaqAttrType.dGate[i].AlarmLevel = addAddress(param.AlarmLevel, DaqAttrType.baseAddr); DaqAttrType.dGate[i].MeasActive = addAddress(param.MeasActive, DaqAttrType.baseAddr); DaqAttrType.dGate[i].MeasMode = addAddress(param.MeasMode, DaqAttrType.baseAddr); } }
/**Read InterfaceAttrType form Interface.xml*/ public static void read() { StrInterface param; InterfaceXml interfaceXmlXml = SystemConfig.DeserializeFromXml <InterfaceXml>("DaqAttrTypeXml/Interface.xml"); if (interfaceXmlXml == null) { MessageShow.show("Get interface parameter from Interface.xml failed", "从Interface.xml获取接口地址失败"); return; } param = interfaceXmlXml.interfaceType.Param; DaqAttrType.interfaceType.InterfaceType = addAddress(param.InterfaceType, DaqAttrType.baseAddr); DaqAttrType.interfaceType.Hasram = addAddress(param.Hasram, DaqAttrType.baseAddr); DaqAttrType.interfaceType.Ramsize = addAddress(param.Ramsize, DaqAttrType.baseAddr); DaqAttrType.interfaceType.Channel = addAddress(param.Channel, DaqAttrType.baseAddr); DaqAttrType.interfaceType.NumRtsiLines = addAddress(param.NumRtsiLines, DaqAttrType.baseAddr); DaqAttrType.interfaceType.NumRtsiInUse = addAddress(param.NumRtsiInUse, DaqAttrType.baseAddr); DaqAttrType.interfaceType.ClockFreq = addAddress(param.ClockFreq, DaqAttrType.baseAddr); DaqAttrType.interfaceType.NumIsoInLines = addAddress(param.NumIsoInLines, DaqAttrType.baseAddr); DaqAttrType.interfaceType.NumIsoOutLines = addAddress(param.NumIsoOutLines, DaqAttrType.baseAddr); DaqAttrType.interfaceType.NumPostTriggerBuffers = addAddress(param.NumPostTriggerBuffers, DaqAttrType.baseAddr); DaqAttrType.interfaceType.ExtTrigLineFilter = addAddress(param.ExtTrigLineFilter, DaqAttrType.baseAddr); DaqAttrType.interfaceType.RrsilineFilter = addAddress(param.RrsilineFilter, DaqAttrType.baseAddr); DaqAttrType.interfaceType.NumPorts = addAddress(param.NumPorts, DaqAttrType.baseAddr); DaqAttrType.interfaceType.CurrentPortNum = addAddress(param.CurrentPortNum, DaqAttrType.baseAddr); DaqAttrType.interfaceType.EncoderPhaseAPolarity = addAddress(param.EncoderPhaseAPolarity, DaqAttrType.baseAddr); DaqAttrType.interfaceType.EncoderPhaseBPolarity = addAddress(param.EncoderPhaseBPolarity, DaqAttrType.baseAddr); DaqAttrType.interfaceType.EncoderPhaseZPolarity = addAddress(param.EncoderPhaseZPolarity, DaqAttrType.baseAddr); DaqAttrType.interfaceType.EncoderFilter = addAddress(param.EncoderFilter, DaqAttrType.baseAddr); DaqAttrType.interfaceType.EncoderDividerFactor = addAddress(param.EncoderDividerFactor, DaqAttrType.baseAddr); DaqAttrType.interfaceType.EncoderPosition = addAddress(param.EncoderPosition, DaqAttrType.baseAddr); DaqAttrType.interfaceType.Temperature = addAddress(param.Temperature, DaqAttrType.baseAddr); }