示例#1
0
        private void RefreshUiParameter()
        {
            NKTParam nktParam = new NKTParam();

            if (EpsonLCD.GetNktParam(ref nktParam))
            {
                numBeltSpeed.Value = nktParam.BeltSpeed;
                numFeedSpeed.Value = nktParam.FeedSpeed;
                numStepSpeed.Value = nktParam.StepSpeed;
                if (m_SPrinterProperty.fPulsePerInchY > 0)
                {
                    float offset = nktParam.DetectorOffset / m_SPrinterProperty.fPulsePerInchY;
                    numDetectorOffset.Value = (decimal)UIPreference.ToDisplayLength(m_CurrentUnit, offset);
                }
                else
                {
                    MessageBox.Show(string.Format("fPulsePerInchY==0,nktParam.DetectorOffset={0}.",
                                                  nktParam.DetectorOffset));
                }
            }
            else
            {
                MessageBox.Show("获取参数失败.");
            }
        }
示例#2
0
        private void buttonMotorSet_Click(object sender, EventArgs e)
        {
            if (numericUpDownDoubeYRatio.Value == 0)
            {
                MessageBox.Show("双轴偏差比例系数不能为0.");
                return;
            }
            GZClothMotionParam cc = new GZClothMotionParam
            {
                enable = (byte)(rollingMotorCheckBox.Checked == true ? 1 : 0),
                mode   = (byte)(comboBoxMotorMode.SelectedIndex + 1),
                speed  = (uint)numericUpDownMotorSpeed.Value
            };
            DOUBLE_YAXIS doubleYaxis = new DOUBLE_YAXIS();

            if (EpsonLCD.GetDoubleYAxis_Info(ref doubleYaxis))
            {
                doubleYaxis.DoubeYRatio = (float)numericUpDownDoubeYRatio.Value;
                MessageBox.Show(EpsonLCD.SetGZClothMotionParam(cc) && EpsonLCD.SetDoubleYAxis_Info(doubleYaxis)
                    ? "设置成功."
                    : "设置失败.");
            }
            else
            {
                MessageBox.Show("设置失败");
            }
        }
示例#3
0
        public void OnGetPrinterSetting(ref SPrinterSetting ss)
        {
            ss.sExtensionSetting.WorkPosList[0] =
                (int)(UIPreference.ToInchLength(m_CurrentUnit, Decimal.ToSingle(this.numPos1.Value)) *
                      _printerProperty.fPulsePerInchAxis4);
            ss.sExtensionSetting.WorkPosList[1] =
                (int)(UIPreference.ToInchLength(m_CurrentUnit, Decimal.ToSingle(this.numPos2.Value)) *
                      _printerProperty.fPulsePerInchAxis4);

            int enable = 0;

            if (cbxEnable1.Checked)
            {
                enable = enable | 1;
            }

            if (cbxEnable2.Checked)
            {
                enable = enable | (1 << 1);
            }

            ss.sExtensionSetting.WorkPosEnable = (byte)enable;

            EpsonLCD.SetWorkPosInfo(ss);

            LogWriter.WriteLog(
                new string[]
            {
                string.Format("[JianRui]WorkPos1:{0},JianRui]WorkPos2:{1}", ss.sExtensionSetting.WorkPosList[0],
                              ss.sExtensionSetting.WorkPosList[1])
            }, true);
        }
示例#4
0
        //刷新喷头参数列表
        private void UpdateHeadParameterPanel(TableLayoutPanel headParameterPanel)
        {
            List <ChannelInfo> channels = new List <ChannelInfo>();

            EpsonLCD.GetAllChannelsFromBoard_Y2(channelNum, NameList, ref channels);

            //int groupNum = channels.Count > 16 ? m_GroupNum : 1;
            int groupNum = GetHeadParameterGroupNum(channels.Count);
            int row      = 0;
            int doNum    = 0;
            int cidx     = 0;
            int colNum   = channels.Count / groupNum;

            do
            {
                row = doNum * 2 + 1;
                for (int i = 0; i < colNum; i++)
                {
                    cidx = i + doNum * colNum;
                    NumericUpDown Number = (NumericUpDown)headParameterPanel.GetControlFromPosition(i + 1, row);
                    int           value  = (int)((sbyte)channels[cidx].Value);
                    UIPreference.SetValueAndClampWithMinMax(Number, value);
                }
                doNum++;
            }while (doNum < groupNum);
        }
        private void buttonOk_Click(object sender, EventArgs e)
        {
            PrintHeadOrder order = new PrintHeadOrder(null);

            GetSetting(ref order);
            EpsonLCD.SetPrintHeadOrder(order);
        }
        public void OnGetPrinterSetting(ref SPrinterSetting ss)
        {
            if (bColorJet)
            {
                //ColorJet 通用参数
                _manualCleanParamData.nXStartPos = (uint)Math.Round((UIPreference.ToInchLength(m_CurrentUnit, (float)m_NumericUpDownXStartPos.Value)) *
                                                                    m_sPrinterProperty.fPulsePerInchX);
                _manualCleanParamData.bySwapHeaders = (byte)(m_ComboBoxHeaderNumPerTime.SelectedIndex + 1);
                _manualCleanParamData.nFlag         = BitConverter.ToUInt32(System.Text.Encoding.ASCII.GetBytes("CJCA"), 0);
                //ColorJet A+系统参数
                {
                    _manualCleanParamData.OriginOffset = (byte)(this.numericOriginOffset.Value);
                    _manualCleanParamData.ySpeedHz     = Decimal.ToUInt16(this.numericSpeed.Value);
                    _manualCleanParamData.yZeroDelay   = Decimal.ToUInt16(this.numericDelayTime.Value);
                    _manualCleanParamData.DisableFlag  = (byte)(checkBoxFunctionOn.Checked ? 0 : 1);
                }
                //_manualCleanParamData.cleanBeltOutTime = (uint) ((float)numCleanBeltTime.Value*1000f);

                this.m_ButtonStartClean.Enabled = bCanCleanFlg = true;
                if (EpsonLCD.SetManualCleanParam(_manualCleanParamData) == false)
                {
                    string info = ResString.GetEnumDisplayName(typeof(UIError), UIError.SetCleanParamFail);
                    MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.m_ButtonStartClean.Enabled = bCanCleanFlg = false;
                }
            }
        }
        public void OnPrinterSettingChange(SPrinterSetting ss, SPrinterProperty sp)
        {
            m_PrinterSetting = ss; //Printer Setting backup
            if (bColorJet)
            {
                if (EpsonLCD.GetManualCleanParam(ref _manualCleanParamData) == false)
                {
                    string info = ResString.GetEnumDisplayName(typeof(UIError), UIError.ManualCleanNotSupport);
                    MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //色序初始化
            panelColorMask.SuspendLayout();
            panelColorMask.Controls.Clear();
            if (bColorJet)
            {
                for (int n = 0; n < sp.nColorNum / Math.Abs(sp.nOneHeadDivider); n++)
                {
                    RadioButton colorBox = new RadioButton();
                    colorBox.Text      = string.Format("CH{0}", n + 1); //((ColorEnum_Short) sp.eColorOrder[n]).ToString();
                    colorBox.TextAlign = ContentAlignment.MiddleLeft;
                    colorBox.AutoSize  = true;
                    panelColorMask.Controls.Add(colorBox);
                }
            }
            else
            {
                for (int n = 0; n < sp.nColorNum; n++)
                {
                    CheckBox colorBox = new CheckBox();
                    colorBox.Text      = string.Format("CH{0}", n + 1); //((ColorEnum_Short) sp.eColorOrder[n]).ToString();
                    colorBox.TextAlign = ContentAlignment.MiddleLeft;
                    colorBox.AutoSize  = true;
                    panelColorMask.Controls.Add(colorBox);
                }
            }
            panelColorMask.ResumeLayout(false);

            if (bColorJet)
            {
                //ColorJet 通用参数
                UIPreference.SetValueAndClampWithMinMax(this.m_NumericUpDownXStartPos, m_CurrentUnit, _manualCleanParamData.nXStartPos / m_sPrinterProperty.fPulsePerInchX);
                m_ComboBoxHeaderNumPerTime.Items.Clear();//每次清洗喷头数初始化
                for (int n = 1; n <= sp.nHeadNumPerGroupY; n++)
                {
                    m_ComboBoxHeaderNumPerTime.Items.Add(n);
                }
                m_ComboBoxHeaderNumPerTime.SelectedIndex = 0;
                //ColorJet A+系统参数
                {
                    UIPreference.SetValueAndClampWithMinMax(this.numericOriginOffset, _manualCleanParamData.OriginOffset);
                    UIPreference.SetValueAndClampWithMinMax(this.numericSpeed, _manualCleanParamData.ySpeedHz);
                    UIPreference.SetValueAndClampWithMinMax(this.numericDelayTime, _manualCleanParamData.yZeroDelay);
                    checkBoxFunctionOn.Checked = _manualCleanParamData.DisableFlag == 0;
                }
                //UIPreference.SetValueAndClampWithMinMax(this.numCleanBeltTime, _manualCleanParamData.cleanBeltOutTime/1000f);
            }
        }
示例#8
0
        /// <summary>
        /// 波形映射表下发
        /// </summary>
        private void m_Button_WriteWaveMapping_Click(object sender, EventArgs e)
        {
            FileLog("Wave mapping Write");
            ControlsEnable(false);              //按钮无效化
            int Length = EpsonLCD.WriteWaveMappingData(ConstructWaveMapping());

            EpsonLCD.SetWaveMappingTotalLength(Length);
            MessageBox.Show(ResString.GetResString("Wave_Info_WaveMappingSengFinish"), "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            ControlsEnable(true);                       //按钮有效化
        }
 /// <summary>
 /// 设置清洗参数
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void m_ButtonSet_Click(object sender, EventArgs e)
 {
     this.m_ButtonStartClean.Enabled = bCanCleanFlg = true;
     OnGetPrinterSetting(ref m_PrinterSetting);
     if (EpsonLCD.SetManualCleanParam(_manualCleanParamData) == false)
     {
         string info = ResString.GetEnumDisplayName(typeof(UIError), UIError.SetCleanParamFail);
         MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.m_ButtonStartClean.Enabled = bCanCleanFlg = false;
     }
 }
示例#10
0
 /// <summary>
 /// 通道名称取得解析
 /// 通道名字最多19个字节 + 0位 共20字节通道序号(1开始)
 /// 例如
 /// index == 1 命令读取的第1个通道的名字,返回20个字节
 /// </summary>
 /// <param name="ChannelNameData"></param>
 /// <param name="nTotalSize"></param>
 /// <returns></returns>
 private bool GetChannelName()
 {
     FileLog("Get Channel Name");
     //读取通道名称
     m_Channel_Number = EpsonLCD.GetChannelNameTotalLength();
     //m_Channel_Number = 8;
     for (int nIndex = 1; nIndex <= m_Channel_Number; nIndex++)
     {
         ChannelNameList.Add(Encoding.Default.GetString(EpsonLCD.GetChannelNameData((ushort)nIndex)));
     }
     return(true);
 }
示例#11
0
        private void PrintHeadOrderTypeForm_Load(object sender, EventArgs e)
        {
            PrintHeadOrder headOrder = new PrintHeadOrder();

            if (EpsonLCD.GetPrintHeadOrder(ref headOrder))
            {
                for (int i = 0; i < headBoardPorts.Count; i++)
                {
                    headBoardPorts[i].OnSettingChanged(headOrder.Order, i);
                }
            }
        }
        /// <summary>
        /// 设置清洗颜色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void m_ButtonStartClean_Click(object sender, EventArgs e)
        {
            m_ButtonSet_Click(null, null);

            byte color = 0;//(byte) (m_ComboBoxColorIndex.SelectedIndex + 1);

            byte?level = null;

            color = 0xff;

            EpsonLCD.SetManualCleanCmd(color, level);
        }
 public void OnPrinterSettingChange(SPrinterSetting ss, SPrinterProperty sp)
 {
     m_PrinterSetting = ss;
     if (EpsonLCD.GetDocanTextileCleanParam(ref _docanTextileParam))
     {
         numericUpDown_xStartPos.Value       = _docanTextileParam.xStartPos;
         numericUpDown_zCLeanPos.Value       = _docanTextileParam.zCLeanPos;
         numericUpDown_PressInkTime.Value    = _docanTextileParam.PressInkTime;
         numericUpDown_ZSensorErrRange.Value = _docanTextileParam.ZSensorErrRange;
         numericUpDown_ZSensorCurVal.Value   = _docanTextileParam.ZSensorCurVal;
     }
 }
 private void button_trigger_Click(object sender, EventArgs e)
 {
     if (EpsonLCD.DOCANTEXTILE_SENSOR_INIT() == false)
     {
         string info = ResString.GetEnumDisplayName(typeof(UIError), UIError.TriggerFail);
         MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         string info = ResString.GetEnumDisplayName(typeof(UISuccess), UISuccess.TriggerSuccess);
         MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#15
0
        public void OnPrinterSettingChange(SPrinterSetting ss)
        {
            _printerSetting = ss;
            //if (SPrinterProperty.IsSurportCapping())
            {
                WetParam wetParam = new WetParam();
                if (EpsonLCD.GetWetParam(ref wetParam))
                {
                    // 回保湿位置
                    checkBoxEnableCappingPosX.Checked = (wetParam.PosMask & 1) != 0;
                    checkBoxEnableCappingPosY.Checked = (wetParam.PosMask & 2) != 0;
                    checkBoxEnableCappingPosZ.Checked = (wetParam.PosMask & 4) != 0;
                    checkBoxsalverPos.Checked         = (wetParam.PosMask & 8) != 0;
                    checkBoxEnableAutoCapping.Checked = wetParam.Enable != 0;
                    if (m_sPrinterProperty.fPulsePerInchX > 0)
                    {
                        UIPreference.SetValueAndClampWithMinMax(numCappingPosX, m_CurrentUnit,
                                                                wetParam.XPos / m_sPrinterProperty.fPulsePerInchX);
                    }
                    if (m_sPrinterProperty.fPulsePerInchY > 0)
                    {
                        UIPreference.SetValueAndClampWithMinMax(numCappingPosY, m_CurrentUnit,
                                                                wetParam.YPos / m_sPrinterProperty.fPulsePerInchY);
                    }
                    if (m_sPrinterProperty.fPulsePerInchZ > 0)
                    {
                        UIPreference.SetValueAndClampWithMinMax(numCappingPosZ, m_CurrentUnit,
                                                                wetParam.ZPos / m_sPrinterProperty.fPulsePerInchZ);
                    }
                    numCappingDelayTime.Value = (decimal)(wetParam.WaitTime / 1000f);

                    // 回默认位置
                    checkBoxXHomePos.Checked        = (wetParam.DefaultBackPosMask & 1) != 0;
                    checkBoxYHomePos.Checked        = (wetParam.DefaultBackPosMask & 2) != 0;
                    checkBoxEnableHomeDelay.Checked = wetParam.DefaultBackDelayEnable != 0;
                    if (m_sPrinterProperty.fPulsePerInchX > 0)
                    {
                        UIPreference.SetValueAndClampWithMinMax(numHomePosX, m_CurrentUnit,
                                                                wetParam.DefaultBackXPos / m_sPrinterProperty.fPulsePerInchX);
                    }
                    if (m_sPrinterProperty.fPulsePerInchY > 0)
                    {
                        UIPreference.SetValueAndClampWithMinMax(numHomePosY, m_CurrentUnit,
                                                                wetParam.DefaultBackYPos / m_sPrinterProperty.fPulsePerInchY);
                    }
                    numAutoHomeDelay.Value = (decimal)(wetParam.BackDefaultPosWaitTime / 1000f);
                    numSalverPos.Value     = wetParam.cover4Place;
                }
            }
            this.isDirty = false;
        }
示例#16
0
 private void button_set_Click(object sender, EventArgs e)
 {
     OnGetPrinterSetting(ref m_PrinterSetting);
     if (EpsonLCD.SetGmaCleanParam(_gmaCleanParam) == false)
     {
         string info = ResString.GetEnumDisplayName(typeof(UIError), UIError.SetCleanParamFail);
         MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         string info = ResString.GetEnumDisplayName(typeof(UISuccess), UISuccess.SetCleanParamSuccess);
         MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#17
0
        public void OnPrinterSettingChange(SPrinterSetting ss)
        {
            _ss = ss;
            GZClothMotionParam cc          = new GZClothMotionParam();
            DOUBLE_YAXIS       doubleYaxis = new DOUBLE_YAXIS();

            if (EpsonLCD.GetGZClothMotionParam(ref cc) && EpsonLCD.GetDoubleYAxis_Info(ref doubleYaxis))
            {
                rollingMotorCheckBox.Checked    = cc.enable != 0;
                comboBoxMotorMode.SelectedIndex = (cc.mode - 1);
                numericUpDownMotorSpeed.Value   = cc.speed;
                numericUpDownDoubeYRatio.Value  = (decimal)doubleYaxis.DoubeYRatio;
            }
        }
示例#18
0
        public void OnGetPrinterSetting(ref SPrinterSetting ss)
        {
            //if (SPrinterProperty.IsSurportCapping())
            {
                WetParam wetParam = new WetParam();
                wetParam.ActiveLen = 18;
                // 回保湿位置
                wetParam.PosMask = (byte)(checkBoxEnableCappingPosX.Checked ? 1 : 0); // xyz都启用
                if (checkBoxEnableCappingPosY.Checked)
                {
                    wetParam.PosMask |= (1 << 1);
                }
                if (checkBoxEnableCappingPosZ.Checked)
                {
                    wetParam.PosMask |= (1 << 2);
                }
                if (checkBoxsalverPos.Checked)
                {
                    wetParam.PosMask |= (1 << 3);
                }
                wetParam.Enable = (byte)(checkBoxEnableAutoCapping.Checked ? 1 : 0);
                wetParam.XPos   = (int)(UIPreference.ToInchLength(m_CurrentUnit, (float)numCappingPosX.Value) *
                                        m_sPrinterProperty.fPulsePerInchX);
                wetParam.YPos = (int)(UIPreference.ToInchLength(m_CurrentUnit, (float)numCappingPosY.Value) *
                                      m_sPrinterProperty.fPulsePerInchY);
                wetParam.ZPos = (int)(UIPreference.ToInchLength(m_CurrentUnit, (float)numCappingPosZ.Value) *
                                      m_sPrinterProperty.fPulsePerInchZ);
                wetParam.WaitTime = (uint)((float)numCappingDelayTime.Value * 1000f);

                //回缺省位置
                wetParam.DefaultBackPosMask = (byte)(checkBoxXHomePos.Checked ? 1 : 0); // xyz都启用
                if (checkBoxYHomePos.Checked)
                {
                    wetParam.DefaultBackPosMask |= (1 << 1);
                }
                wetParam.DefaultBackDelayEnable = (byte)(checkBoxEnableHomeDelay.Checked ? 1 : 0);
                wetParam.DefaultBackXPos        = (int)(UIPreference.ToInchLength(m_CurrentUnit, (float)numHomePosX.Value) *
                                                        m_sPrinterProperty.fPulsePerInchX);
                wetParam.DefaultBackYPos = (int)(UIPreference.ToInchLength(m_CurrentUnit, (float)numHomePosY.Value) *
                                                 m_sPrinterProperty.fPulsePerInchY);
                wetParam.BackDefaultPosWaitTime = (uint)((float)numAutoHomeDelay.Value * 1000f);
                wetParam.cover4Place            = (int)numSalverPos.Value;

                if (!EpsonLCD.SetWetParam(wetParam))
                {
                    MessageBox.Show("Set Capping parametas fail!");
                }
            }
        }
示例#19
0
        public void OnPrinterSettingChange(SPrinterSetting ss, SPrinterProperty sp)
        {
            m_PrinterSetting = ss; //Printer Setting backup
            if (bALLWIN)
            {
                EpsonLCD.GetALLWINCleanParam(ref _allwinData);
            }
            if (bColorJet)
            {
                if (EpsonLCD.GetManualCleanParam(ref _manualCleanParamData) == false)
                {
                    string info = ResString.GetEnumDisplayName(typeof(UIError), UIError.ManualCleanNotSupport);
                    MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //色序初始化
            panelColorMask.SuspendLayout();
            panelColorMask.Controls.Clear();
            for (int n = 0; n < sp.nColorNum; n++)
            {
                if (bColorJet)
                {
                    RadioButton colorBox = new RadioButton();
                    colorBox.Text      = string.Format("CH{0}", n + 1);//((ColorEnum_Short) sp.eColorOrder[n]).ToString();
                    colorBox.TextAlign = ContentAlignment.MiddleLeft;
                    colorBox.AutoSize  = true;
                    panelColorMask.Controls.Add(colorBox);
                }
                else
                {
                    CheckBox colorBox = new CheckBox();
                    colorBox.Text      = string.Format("CH{0}", n + 1);//((ColorEnum_Short) sp.eColorOrder[n]).ToString();
                    colorBox.TextAlign = ContentAlignment.MiddleLeft;
                    colorBox.AutoSize  = true;
                    panelColorMask.Controls.Add(colorBox);
                }
            }
            panelColorMask.ResumeLayout(false);

            if (bALLWIN)
            {
                UIPreference.SetValueAndClampWithMinMax(this.numericXAxisPos, _allwinData.xPos);
                UIPreference.SetValueAndClampWithMinMax(this.numericBladeYMobileDistance, _allwinData.yPos);
                UIPreference.SetValueAndClampWithMinMax(this.numericScrapPlatformZPos, _allwinData.zPos);
                UIPreference.SetValueAndClampWithMinMax(this.numericBladeCleanDuration, _allwinData.CleanPumpTime);
            }
        }
示例#20
0
 public void OnPrinterSettingChange(SPrinterSetting ss)
 {
     m_PrinterSetting = ss;
     if (EpsonLCD.GetHlcCleanParam(ref _hlcCleanParam))
     {
         UIPreference.SetValueAndClampWithMinMax(numXPressInkPos, m_CurrentUnit, _hlcCleanParam.XPressInkPos / _sp.fPulsePerInchX);
         UIPreference.SetValueAndClampWithMinMax(numYCleanPos, m_CurrentUnit, _hlcCleanParam.YCleanPos / _sp.fPulsePerInchY);
         UIPreference.SetValueAndClampWithMinMax(numZCleanPos, UILengthUnit.Inch, _hlcCleanParam.ZCleanPos);
         if (_sp.fPulsePerInchZ > 0)
         {
             UIPreference.SetValueAndClampWithMinMax(numZCleanPos, m_CurrentUnit, _hlcCleanParam.ZCleanPos / _sp.fPulsePerInchZ);
         }
         numYCleanSpeed.Value     = _hlcCleanParam.YCleanSpeed < numYCleanSpeed.Maximum ? _hlcCleanParam.YCleanSpeed : 0;
         numPressInkTime.Value    = _hlcCleanParam.PressInkTime < numPressInkTime.Maximum ? _hlcCleanParam.PressInkTime : 0;
         numRecoveryInkTime.Value = _hlcCleanParam.RecoveryInkTime < numRecoveryInkTime.Maximum ? _hlcCleanParam.RecoveryInkTime : 0;
     }
 }
示例#21
0
        private void buttonMotorGet_Click(object sender, EventArgs e)
        {
            GZClothMotionParam cc          = new GZClothMotionParam();
            DOUBLE_YAXIS       doubleYaxis = new DOUBLE_YAXIS();

            if (EpsonLCD.GetGZClothMotionParam(ref cc) && EpsonLCD.GetDoubleYAxis_Info(ref doubleYaxis))
            {
                rollingMotorCheckBox.Checked    = cc.enable != 0;
                comboBoxMotorMode.SelectedIndex = (cc.mode - 1);
                numericUpDownMotorSpeed.Value   = cc.speed;
                numericUpDownDoubeYRatio.Value  = (decimal)doubleYaxis.DoubeYRatio;
            }
            else
            {
                MessageBox.Show("读取失败.");
            }
        }
示例#22
0
        /// <summary>
        /// 设置清洗颜色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void m_ButtonStartClean_Click(object sender, EventArgs e)
        {
            byte color = 0;//(byte) (m_ComboBoxColorIndex.SelectedIndex + 1);

            for (int i = 0; i < panelColorMask.Controls.Count; i++)
            {
                if (bColorJet)
                {
                    if (panelColorMask.Controls[i] is RadioButton)
                    {
                        if (((RadioButton)panelColorMask.Controls[i]).Checked)
                        {
                            color = (byte)(i);
                        }
                    }
                }
                else
                {
                    if (panelColorMask.Controls[i] is CheckBox)
                    {
                        if (((CheckBox)panelColorMask.Controls[i]).Checked)
                        {
                            color |= (byte)(1 << i);
                        }
                    }
                }
            }
            byte?level = (byte)(comboBoxLevel.SelectedIndex + 1);

            if (level < 0)
            {
                level = 0;
            }
            if (bColorJet)
            {
                level = null;
            }

            if (checkBoxAll.Checked)
            {
                color = 0xff;
            }

            EpsonLCD.SetManualCleanCmd(color, level);
        }
示例#23
0
        private void button2_Click(object sender, EventArgs e)
        {
            NKTParam nktParam = new NKTParam();

            nktParam.Flag      = new char[] { 'N', 'K', 'T', '\0' };
            nktParam.BeltSpeed = (uint)numBeltSpeed.Value;
            nktParam.FeedSpeed = (uint)numFeedSpeed.Value;
            nktParam.StepSpeed = (uint)numStepSpeed.Value;
            float offset =
                (UIPreference.ToInchLength(m_CurrentUnit, (float)numDetectorOffset.Value) *
                 m_SPrinterProperty.fPulsePerInchY);

            nktParam.DetectorOffset = (uint)offset;
            if (!EpsonLCD.SetNktParam(nktParam))
            {
                MessageBox.Show("设置参数失败.");
            }
        }
示例#24
0
        private string GetBoardVersion()
        {
            SBoardInfo sBoardInfo = new SBoardInfo();

            if (CoreInterface.GetBoardInfo(0, ref sBoardInfo) != 0)
            {
                //FW Version Get
                string fwversion = string.Empty;
                int    nMaxNum   = (sBoardInfo.m_nPkgVersion & 0xFF00) >> 8;
                for (int nIndex = 1; nIndex <= nMaxNum; nIndex++)
                {
                    if (nIndex == 1)
                    {
                        byte[] bytefwversion = new byte[16];
                        if (EpsonLCD.GetFWVersionInfo(ref bytefwversion))
                        {
                            int name_term = 4;
                            while (bytefwversion[name_term] != 0)
                            {
                                name_term++;
                            }
                            fwversion = "FW version:" + (uint)BitConverter.ToInt32(bytefwversion, 0) + " " +
                                        System.Text.Encoding.ASCII.GetString(bytefwversion, 4, name_term - 4) + " " + "\n";
                        }
                    }
                }
                string mbversion   = "MB version:" + VersionToString(sBoardInfo.m_nBoradVersion) + " " + sBoardInfo.sProduceDateTime + " " + sBoardInfo.m_nBoardManufatureID.ToString("X4") + sBoardInfo.m_nBoardProductID.ToString("X4") + "\n";
                string mtversion   = "MT version:" + VersionToString(sBoardInfo.m_nMTBoradVersion) + " " + sBoardInfo.sMTProduceDateTime + " " + "\n";
                string hbversion   = "HB version:" + VersionToString(sBoardInfo.m_nHBBoardVersion) + " " + sBoardInfo.sReserveProduceDateTime + " " + "\n";
                string mapbversion = string.Empty;
                if (sBoardInfo.m_nMapBoardVersion != 0 && !string.IsNullOrEmpty(sBoardInfo.sMapBoardProduceDateTime))
                {
                    mapbversion = "Map version:" + VersionToString(sBoardInfo.m_nMapBoardVersion) + " " + sBoardInfo.sMapBoardProduceDateTime + " " + "\n";
                }

                string idversion = "MB ID :" + sBoardInfo.m_nBoardSerialNum.ToString() + " " + "\n";
                return(fwversion + mbversion + mtversion + hbversion + mapbversion + idversion);
            }
            else
            {
                return("");
            }
        }
示例#25
0
        /// <summary>
        /// 初始化界面列表
        /// </summary>
        public void InitUiList()
        {
            //头版类型取得
            GetHBType();

            //通道名字取得
            GetChannelName();
            try
            {
                //波形名字预读命令
                EpsonLCD.PrepareReadWaveName();
            }
            catch
            {
                MessageBox.Show(ResString.GetResString("Wave_ReadWaveNameFailed"), "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            FileLog("Prepare Read Wave Name");
        }
示例#26
0
 private void GetData()
 {
     try
     {
         HapondMotorParam_Auto data = new HapondMotorParam_Auto();
         if (EpsonLCD.GetMotionSetting(ref data))
         {
             comboBoxControlMode.SelectedIndex  = (int)data.sysMode;
             comboBoxMotorType.SelectedIndex    = (int)data.motorType;
             numericUpDownTorque.Value          = data.torValue;
             numericUpDownPrintHeadHeight.Value = data.headAdjustHei;
             numericUpDownLV.Value            = data.torSwitchStepVal;
             numericUpDownLT.Value            = data.torSwitchStepTime;
             numericUpDownTimeout.Value       = data.StepTimeOut;
             comboBoxSwitchType.SelectedIndex = (int)data.SwitchType;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#27
0
        private void SetData()
        {
            try
            {
                HapondMotorParam_Auto data = new HapondMotorParam_Auto();
                data.Flag              = new char[] { 'Y', 'T', 'O', 'Q' };
                data.sysMode           = (byte)(comboBoxControlMode.SelectedIndex);
                data.motorType         = (byte)(comboBoxMotorType.SelectedIndex);
                data.torValue          = (short)numericUpDownTorque.Value;
                data.headAdjustHei     = (uint)numericUpDownPrintHeadHeight.Value;
                data.torSwitchStepVal  = (short)numericUpDownLV.Value;
                data.torSwitchStepTime = (short)numericUpDownLT.Value;
                data.StepTimeOut       = (short)numericUpDownTimeout.Value;
                data.SwitchType        = (byte)(comboBoxSwitchType.SelectedIndex);

                EpsonLCD.SetMotionSetting(data);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public void OnGetPrinterSetting(ref SPrinterSetting ss)
        {
            if (bColorJet)
            {
                if (_isSsystem)
                {
                    _manualCleanParamData.nFlag = BitConverter.ToUInt32(System.Text.Encoding.ASCII.GetBytes("CJCS"), 0);
                }
                else
                {
                    _manualCleanParamData.nFlag = BitConverter.ToUInt32(System.Text.Encoding.ASCII.GetBytes("CJCA"), 0);
                }
                //ColorJet S系统参数
                {
                    _manualCleanParamData.autoWetWaitTime = (byte)(this.numericWetWaitTime.Value);
                    _manualCleanParamData.autoWetFlag     = (byte)(checkBoxWetFlag.Checked ? 1 : 0);
                }
                //ColorJet A+系统参数
                {
                    _manualCleanParamData.ySpeedHz    = Decimal.ToUInt16(this.numericSpeed.Value);
                    _manualCleanParamData.yZeroDelay  = Decimal.ToUInt16(this.numericDelayTime.Value);
                    _manualCleanParamData.DisableFlag = (byte)(checkBoxFunctionOn.Checked ? 0 : 1);
                }
                _manualCleanParamData.cleanBeltOutTime = (uint)numCleanBeltTime.Value;

                _manualCleanParamData.pressInkTime    = (uint)numericPressInkTime.Value;
                _manualCleanParamData.wiperCleanStart = (uint)numericWiperCleanStart.Value;

                this.m_ButtonStartClean.Enabled = bCanCleanFlg = true;

                if (EpsonLCD.SetManualCleanParam(_manualCleanParamData) == false)
                {
                    string info = ResString.GetEnumDisplayName(typeof(UIError), UIError.SetCleanParamFail);
                    MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.m_ButtonStartClean.Enabled = bCanCleanFlg = false;
                }
            }
        }
示例#29
0
        private int SetHeadParameter()
        {
            if (numericUpDown_Ratios != null)
            {
                List <byte> list = new List <byte>(this.numericUpDown_Ratios.Length);
                for (int i = 0; i < numericUpDown_Ratios.Length; i++)
                {
                    int n = (int)numericUpDown_Ratios[i].Value;
                    if (n < 0)
                    {
                        byte b = BitConverter.GetBytes(n)[0];
                        list.Add((byte)(b));
                    }
                    else
                    {
                        list.Add((byte)numericUpDown_Ratios[i].Value);
                    }
                }
                return(EpsonLCD.SetChannelParamValue_Y2(list.ToArray()));
            }

            return(0);
        }
示例#30
0
 public void OnPrinterSettingChange(SPrinterSetting ss)
 {
     m_PrinterSetting = ss;
     if (EpsonLCD.GetGmaCleanParam(ref _gmaCleanParam))
     {
         UIPreference.SetValueAndClampWithMinMax(numxStartPos, m_CurrentUnit,
                                                 _gmaCleanParam.XStartPos / _sp.fPulsePerInchX);
         UIPreference.SetValueAndClampWithMinMax(numxDistance, m_CurrentUnit,
                                                 _gmaCleanParam.XDistance / _sp.fPulsePerInchX);
         UIPreference.SetValueAndClampWithMinMax(numScraperPos, UILengthUnit.Inch, _gmaCleanParam.ScraperPos);
         if (_sp.fPulsePerInchZ > 0)
         {
             UIPreference.SetValueAndClampWithMinMax(num_zCLeanPos, m_CurrentUnit,
                                                     _gmaCleanParam.ZCleanPos / _sp.fPulsePerInchZ);
             UIPreference.SetValueAndClampWithMinMax(numZCarryCleanPos, m_CurrentUnit,
                                                     _gmaCleanParam.ZCarryCleanPos / _sp.fPulsePerInchZ);
         }
         numcleanRowNum.Value = _gmaCleanParam.CleanRowNum;
         numcleanTimes.Value  = _gmaCleanParam.CleanTime;
         UIPreference.SetValueAndClampWithMinMax(numYCarryCleanPos, m_CurrentUnit,
                                                 _gmaCleanParam.YCarryCleanPos / _sp.fPulsePerInchY);
     }
 }