protected override bool UserInit() { #region >>>>读取模块配置信息,初始化工序Enable信息 if (GetPresInfomation()) { ShowInfo("加载参数成功"); } else { ShowInfo("加载参数失败,请确认是否选择参数配方"); } #endregion #region >>>>初始化仪表信息 PLC = InstrumentMgr.Instance.FindInstrumentByName("PLC") as QSerisePlc; lds1 = InstrumentMgr.Instance.FindInstrumentByName("LDS[6]") as LDS; lds2 = InstrumentMgr.Instance.FindInstrumentByName("LDS[7]") as LDS; #endregion bool bRet = PLC != null && lds1 != null && lds2 != null && Prescription != null; bRet = true; //dddd if (!bRet) { ShowInfo("初始化失败"); } else { } return(bRet); }
private bool UnLock(int nIndex) { LDS lds = nIndex == 1 ? lds1 : lds2; lds.DeInit(); bool bRet = lds.LdsUnLock(out string error); lds.Init(); return(bRet); }
private bool AdjustPowerValue(int nIndex) { bool bRet = false; if (nIndex < 1 || nIndex > 2) { return(false); } LDS lds = nIndex == 1 ? lds1 : lds2; PowerMeter powerMeter = nIndex == 1 ? Pw1000USB_1 : Pw1000USB_2; powerValue = powerMeter.GetPowerValue(EnumUnit.mW); bool bIncrease = false; if (powerValue < Prescription.LDSPower[0]) { bIncrease = true; } if (powerValue > Prescription.LDSPower[1]) { bIncrease = false; } nAdjustCount[nIndex - 1] = 0; while (!cts.IsCancellationRequested) //直到功率满足要求 { powerValue = powerMeter.GetPowerValue(EnumUnit.mW); if (powerValue < Prescription.LDSPower[0]) { bIncrease = true; } if (powerValue > Prescription.LDSPower[1]) { bIncrease = false; } if (powerValue < Prescription.LDSPower[0] || powerValue > Prescription.LDSPower[1]) { lds.InCreasePower(bIncrease); lds.EnsureLaserPower(); Thread.Sleep(1000); //必须要大于1s ShowPower(EnumUnit.mW); } else { return(true); } if (nAdjustCount[nIndex - 1]++ > 30) { break; } } powerValue = powerMeter.GetPowerValue(EnumUnit.mW); return((powerValue > Prescription.LDSPower[0]) && (powerValue < Prescription.LDSPower[0])); //bRet = lds.CheckSetPowerStatusOK(); //查看是否烧录OK }
private bool GetBarcode(int nIndex, out string Barcode) { Barcode = "123456789012345678901"; return(true); LDS lds = nIndex == 1 ? lds1 : lds2; Barcode = Prescription.BarcodeSource == PrescriptionGridModel.BARCODESOURCE.SCANNER ? BarcodeScanner1.Getbarcode() : Fake_Barcode_Dt.Rows[nBarcodeInfFileIndex]["Barcode"].ToString(); return(Barcode.Length == Prescription.BarcodeLength); }
private bool SetLDSCalidData(int nIndex, int c1, int c2) { return(true); if (nIndex < 1 || nIndex > 2) { return(false); } LDS lds = nIndex == 1 ? lds1 : lds2; return(lds.SetDataToLDS(c1, c2)); }
private bool GetLaserIntensity(int nIndex, EnumTarget target, out int InstensityValue) { InstensityValue = 0; return(true); if (nIndex != 1 && nIndex != 2) { return(false); } LDS lds = nIndex == 1 ? lds1 : lds2; InstensityValue = lds.GetExposeValue(Prescription.CMosPointNumber); return(InstensityValue > 0);; }
protected override bool UserInit() { bool bRet = false; #region >>>>读取模块配置信息,初始化工序Enable信息 if (GetPresInfomation()) { ShowInfo("加载参数成功"); } else { ShowInfo("加载参数失败,请确认是否选择参数配方"); } #endregion #region >>>>初始化仪表信息 Pw1000USB_1 = InstrumentMgr.Instance.FindInstrumentByName("PowerMeter[0]") as PowerMeter; Pw1000USB_2 = InstrumentMgr.Instance.FindInstrumentByName("PowerMeter[1]") as PowerMeter; lds1 = InstrumentMgr.Instance.FindInstrumentByName("LDS[0]") as LDS; lds2 = InstrumentMgr.Instance.FindInstrumentByName("LDS[1]") as LDS; BarcodeScanner1 = InstrumentMgr.Instance.FindInstrumentByName("SR1000[0]") as Keyence_SR1000; BarcodeScanner2 = InstrumentMgr.Instance.FindInstrumentByName("SR1000[1]") as Keyence_SR1000; PLC = InstrumentMgr.Instance.FindInstrumentByName("PLC") as QSerisePlc; #endregion LogExcel Fake_Barcode_Excel = new LogExcel(FILE_FAKE_BARCODE_FILE); Fake_Barcode_Excel.ExcelToDataTable(ref Fake_Barcode_Dt, "Sheet1"); string str = Fake_Barcode_Dt.Rows[0]["Barcode"].ToString(); str = Fake_Barcode_Dt.Rows[1]["Barcode"].ToString(); bRet = true || Pw1000USB_1 != null && Pw1000USB_2 != null && lds1 != null && lds2 != null && BarcodeScanner1 != null && BarcodeScanner2 != null && PLC != null; if (!bRet) { ShowInfo("初始化失败"); } return(bRet); }
static unsafe void Main() { // // is LordPE Dumper Server active ? // if (!LDS.IsLDSUp()) { MessageBox.Show("Please lunch LordPE's Dumper Server first !", "LordPE Plugin", MessageBoxButtons.OK, MessageBoxIcon.Error); return; // ERR } // // show window // Application.Run(new Form1()); }
private bool GetCenterFocus(int nIndex, out int CenterValue) { CenterValue = 0; return(true); bool bRet = false; if (nIndex < 1 || nIndex > 2) { return(false); } LDS lds = nIndex == 1 ? lds1 : lds2; CenterValue = lds.GetFocusValue(Prescription.CMosPointNumber); bRet = CenterValue >= 0; return(bRet); }
public bool Str2LDS(string str) { LDS.LDS_LOG_ENTRY log; // LDS available ? if (!LDS.IsLDSUp()) { return(false); // ERR } // assign structure elements log.dwStructSize = 0; log.szStr = str.ToString(); log.dwStrSize = (uint)(str.Length + 1); log.bCatAtLast = 0; // 0 = false log.dwStructSize = (uint)Marshal.SizeOf(log); LDS.AddToLog(ref log); return(true); // OK }
public LDsTest() { lds = new LDS(hdCfg); }