private void DoubleSidePrintForm_Load(object sender, EventArgs e) { SBiSideSetting sideSetting = new SBiSideSetting(); CoreInterface.GetSBiSideSetting(ref sideSetting); UpdateDoubleSideAdjustSetting(sideSetting); }
private void UpdateDoubleSideAdjustSetting(SBiSideSetting sideSetting) { numLeftUp.Value = new decimal(UIPreference.ToDisplayLength(_mCurrentUnit, sideSetting.fLeftTotalAdjust)); numRightUp.Value = new decimal(UIPreference.ToDisplayLength(_mCurrentUnit, sideSetting.fRightTotalAdjust)); numLr.Value = new decimal(UIPreference.ToDisplayLength(_mCurrentUnit, sideSetting.fxTotalAdjust)); numFb.Value = new decimal(UIPreference.ToDisplayLength(_mCurrentUnit, sideSetting.fyTotalAdjust)); //numAdjustStep.Value = new decimal(UIPreference.ToDisplayLength(_mCurrentUnit,sideSetting.fStepAdjust)); should control by UI tony not test }
void _adjustTimer_Tick(object sender, EventArgs e) { SBiSideSetting sideSetting = new SBiSideSetting(); CoreInterface.GetSBiSideSetting(ref sideSetting); UpdateDoubleSideAdjustSetting(sideSetting); if (sideSetting.IsEmpty) { _adjustTimer.Stop(); } //this.numAdjustStep.Value = new decimal(UIPreference.ToInchLength(UILengthUnit.Millimeter, 5)); }
private void btnApply_Click(object sender, EventArgs e) { AllParam allParam = _printerChange.GetAllParam(); if (_useNewFunction) { SBiSideSetting sideSetting = new SBiSideSetting(); sideSetting.fLeftTotalAdjust = UIPreference.ToInchLength(_mCurrentUnit, (float)numLeftUp.Value); sideSetting.fRightTotalAdjust = UIPreference.ToInchLength(_mCurrentUnit, (float)numRightUp.Value); sideSetting.fxTotalAdjust = UIPreference.ToInchLength(_mCurrentUnit, (float)numLr.Value); //sideSetting.fyTotalAdjust = UIPreference.ToInchLength(_mCurrentUnit, (float)numFb.Value); sideSetting.fStepAdjust = UIPreference.ToInchLength(_mCurrentUnit, (float)numAdjustStep.Value); float fXRightHeadToCurosr = UIPreference.ToInchLength(_mCurrentUnit, (float)numCursorPosX.Value); // 表示最右喷头到光标安装位置的X 偏差 float fYRightHeadToCurosr = UIPreference.ToInchLength(_mCurrentUnit, (float)numCursorPosY.Value); // 表示最右喷头到光标安装位置的Y 偏差 // 此处不可省略,且必须在SetCurPosSBideSetting之前设置,否则x原点变更会被覆盖 this.OnGetPrinterSetting(ref allParam.PrinterSetting); CoreInterface.SetPrinterSetting(ref allParam.PrinterSetting); CoreInterface.SetCurPosSBideSetting(ref sideSetting, fXRightHeadToCurosr, fYRightHeadToCurosr); this.Close(); } else { SBiSideSetting sideSetting = new SBiSideSetting(); sideSetting.fLeftTotalAdjust = UIPreference.ToInchLength(_mCurrentUnit, (float)numLeftUp.Value); sideSetting.fRightTotalAdjust = UIPreference.ToInchLength(_mCurrentUnit, (float)numRightUp.Value); sideSetting.fxTotalAdjust = UIPreference.ToInchLength(_mCurrentUnit, (float)numLr.Value); sideSetting.fyTotalAdjust = UIPreference.ToInchLength(_mCurrentUnit, (float)numFb.Value); sideSetting.fStepAdjust = UIPreference.ToInchLength(_mCurrentUnit, (float)numAdjustStep.Value); CoreInterface.SetSBiSideSetting(ref sideSetting); this._adjustTimer.Start(); } this.OnGetExtendedSettings(ref allParam.ExtendedSettings); }
private void HandleProtocol(string protocol, int i) { try { lock (this.tbandMonitor) { CLockQueue mLinesQueue = this.m_iPrinterChange.GetLockQueue(); if (mLinesQueue != null) { string[] temp = protocol.Split(new char[] { ';' }); DatatypeEnum dataType = (DatatypeEnum)byte.Parse(temp[1]); switch (dataType) { case DatatypeEnum.Print: { int reversePrint = int.Parse(temp[3]); TcpipCmdPara linearray = new TcpipCmdPara(); linearray.CmdType = (int)dataType; linearray.PrtPath = temp[2]; linearray.ReversePrint = reversePrint == 1; mLinesQueue.PutInQueue(linearray); if ((PubFunc.GetUserPermission() == (int)UserPermission.SupperUser)) { LogWriter.WriteLog(new string[] { protocol + " " + mLinesQueue.GetCount() }, true); } bandCount++; Debug.WriteLine(string.Format("line num ={0}", bandCount)); break; } case DatatypeEnum.DoubleSideCari: { SBiSideSetting sideSetting = new SBiSideSetting(); CoreInterface.GetSBiSideSetting(ref sideSetting); float LeftXDeta = 0; float LeftYDeta = 0; float RightXDeta = 0; float RightYDeta = 0; float.TryParse(temp[3], out LeftXDeta); float.TryParse(temp[4], out LeftYDeta); float.TryParse(temp[5], out RightXDeta); float.TryParse(temp[6], out RightYDeta); sideSetting.fLeftTotalAdjust = LeftYDeta; sideSetting.fRightTotalAdjust = RightYDeta; sideSetting.fxTotalAdjust = LeftXDeta; //sideSetting.fyTotalAdjust = RightXDeta; sideSetting.fStepAdjust = m_iPrinterChange.GetAllParam().ExtendedSettings.StepAdjust; CoreInterface.SetSBiSideSetting(ref sideSetting); break; } case DatatypeEnum.PauseCmd: { PrinterOperate po = PrinterOperate.UpdateByPrinterStatus(curStatus); if (po.CanPause) { CoreInterface.Printer_Pause(); } break; } case DatatypeEnum.ResumeCmd: { PrinterOperate po = PrinterOperate.UpdateByPrinterStatus(curStatus); if (po.CanResume) { CoreInterface.Printer_Resume(); } break; } case DatatypeEnum.Error: { break; } default: Debug.Assert(false, string.Format("未知的协议数据类型({0},temp[0])")); break; } if (PubFunc.IsFactoryUser()) { LogWriter.WriteLog(new string[] { protocol + " " + mLinesQueue.GetCount() }, true); } } else { if ((PubFunc.GetUserPermission() == (int)UserPermission.SupperUser)) { LogWriter.WriteLog(new string[] { protocol + " " + "mLinesQueue=null" }, true); } } this.tbandMonitor.Reset(); } } catch (Exception ex) { Debug.WriteLine(ex.Message); if (worker != null) { worker.ReportProgress(0, ex.Message); } MessageBox.Show(ex.Message + ex.StackTrace); this.Connected = false; } }