Esempio n. 1
0
        private void imageLabel_Input_Click(object sender, EventArgs e)
        {
            double dv = 0;

            if (sender is ImageLabel)
            {
                ImageLabel lb = (ImageLabel)sender;

                KeypadForm f = KeypadForm.GetKeypadForm(lb.Text);
                if (f.ShowDialog() == DialogResult.OK)
                {
                    {
                        try
                        {
                            dv = Convert.ToDouble(f.KeyText);

                            lb.Text = dv.ToString("0.0");
                        }
                        catch (Exception)
                        {
                            //MessageBox.Show("输入非法!");
                            MessageBox.Show("输入非法!", "",
                                            MessageBoxButtons.YesNo,
                                            MessageBoxIcon.Hand,
                                            MessageBoxDefaultButton.Button1);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private void ilCurrentPage_Click(object sender, EventArgs e)
        {
            KeypadForm f = KeypadForm.GetKeypadForm(ilCurrentPage.Text);

            if (f.ShowDialog() == DialogResult.OK)
            {
                int index = 1;
                try
                {
                    index = Convert.ToInt32(f.KeyText);
                    if (index <= 0 || index > totalPages)
                    {
                        index     = totalPages > 0 ? 1 : 0;
                        pageIndex = 0;
                    }
                    else
                    {
                        pageIndex = index - 1;
                    }
                }
                catch
                {
                    index     = totalPages > 0 ? 1 : 0;
                    pageIndex = 0;
                }
                ilCurrentPage.Text = index.ToString();
            }
            DrawDefaultTable();
            DrawTableDatas(pageIndex);
            pbDataTable.Image = table;
        }
Esempio n. 3
0
        private void EnterpvPara_Cylinder()
        {


#if UNPASSWORD
            Create_pvPara_Cylinder();
            pvPara_Cylinder.DoEnter();
#else

            KeypadForm f = KeypadForm.GetKeypadForm("", KeypadMode.password);
            if (f.ShowDialog() == DialogResult.OK)
            {
                //设备参数
                if (f.KeyText == password_Para_Cylinder)
                {
                    MessageBox.Show("该页面参数影响设备工作性能,请确定完全后再进行更改。", "",
                         MessageBoxButtons.YesNo,
                         MessageBoxIcon.Hand,
                         MessageBoxDefaultButton.Button1);

                    Create_pvPara_Cylinder();
                    pvPara_Cylinder.DoEnter();
                }
            }
#endif
        }
Esempio n. 4
0
        private void imageLabel1_Click(object sender, EventArgs e)
        {
            KeypadForm f = KeypadForm.GetKeypadForm(imageLabel1.Text);

            if (f.ShowDialog() == DialogResult.OK)
            {
                imageLabel1.Text = f.KeyText;
            }
        }
Esempio n. 5
0
        private void textBox1_Click(object sender, EventArgs e)
        {
            //MessageBox.Show("textBox1_Click");
            KeypadForm f = KeypadForm.GetKeypadForm(textBox1.Text);

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                textBox1.Text = f.KeyText;
            }
        }
Esempio n. 6
0
        /*
                private void imageLabel_Setup_Click(object sender, EventArgs e)
                {
                   //Create_pvPara_Setup();
                    EnterpvSetup();
                }

                private void imageLabel_Para_Click(object sender, EventArgs e)
                {
                    //Create_pvPara();
                    EnterpvPara();
                }

                private void imageLabel_Senser_Click(object sender, EventArgs e)
                {
                    //Create_pvPara_Sensor();
                    EnterpvPara_Sensor();
                }
        */

        private void imageLabel_Diagnose_Click(object sender, EventArgs e)
        {
#if UNPASSWORD
            Create_pvDiagnose();
            pvDiagnose.DoEnter();
#else
            KeypadForm f = KeypadForm.GetKeypadForm("", KeypadMode.password);
            if (f.ShowDialog() == DialogResult.OK)
            {
                // 安装设定
                if (f.KeyText == password_Diagnose)
                {
                    Create_pvDiagnose();
                    pvDiagnose.DoEnter();
                }
            }
#endif
        }
Esempio n. 7
0
        private void EnterpvError()
        {
            if (pvError != null)
            {
#if UNPASSWORD
                pvError.DoEnter();
#else
                KeypadForm f = KeypadForm.GetKeypadForm("", KeypadMode.password);
                if (f.ShowDialog() == DialogResult.OK)
                {
                    // 故障界面
                    if (f.KeyText == password_PageError)
                    {
                        pvError.DoEnter();
                    }
                }
#endif
            }
        }
Esempio n. 8
0
        private void PumpSettingButton_Click(object sender, EventArgs e)
        {
            if (PumpSettingButton.Enabled)
            {
                double dv = (short)DataPool.CDataPool.GetDataPoolObject().GetRealValue(
                    selectedPumpIndex,
                    selectedCylinderIndex,
                    CmdDataType.cdtStartPressure_Pump);

                KeypadForm f = KeypadForm.GetKeypadForm(dv.ToString("0.0"));
                if (f.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        dv = Convert.ToDouble(f.KeyText);
                        if (dv >= 0 && dv <= 4000)
                        {
                            DataPool.CDataPool.GetDataPoolObject().SetRealValue(
                                selectedPumpIndex,
                                selectedCylinderIndex,
                                CmdDataType.cdtStartPressure_Pump,
                                dv);
                        }
                        else
                        {
                            //MessageBox.Show("输入非法!");
                            MessageBox.Show("输入非法!", "",
                                            MessageBoxButtons.YesNo,
                                            MessageBoxIcon.Hand,
                                            MessageBoxDefaultButton.Button1);
                        }
                    }
                    catch (Exception)
                    {
                        //MessageBox.Show("输入非法!");
                        MessageBox.Show("输入非法!", "",
                                        MessageBoxButtons.YesNo,
                                        MessageBoxIcon.Hand,
                                        MessageBoxDefaultButton.Button1);
                    }
                }
            }
        }
Esempio n. 9
0
        private void imageLabel_Input_total_Col_Click(object Sender, EventArgs e)
        {
            if (Sender == null || !(Sender is ImageLabel))
            {
                return;
            }
            ImageLabel lb = (ImageLabel)Sender;

            KeypadForm f = KeypadForm.GetKeypadForm(lb.Text, KeypadMode.Normal);

            if (f.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    int input = Convert.ToInt32(f.KeyText);

                    if (input >= 0)
                    {
                        lb.Text = input.ToString();
                        DataPool.CDataPool.GetDataPoolObject().View_SetupPosition_ColCount = input;
                        DataPool.CDataPool.GetDataPoolObject().SavetoFile();
                    }
                    else
                    {
                        //MessageBox.Show("输入数值越界!");
                        MessageBox.Show("输入数值越界!", "",
                                        MessageBoxButtons.YesNo,
                                        MessageBoxIcon.Exclamation,
                                        MessageBoxDefaultButton.Button1);
                    }
                }
                catch (Exception)
                {
                    //MessageBox.Show("非法输入!");
                    MessageBox.Show("输入非法!", "",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Hand,
                                    MessageBoxDefaultButton.Button1);
                }
            }
        }
Esempio n. 10
0
        private void ilStartHour_Click(object sender, EventArgs e)
        {
            KeypadForm f = KeypadForm.GetKeypadForm(ilStartHour.Text);

            if (f.ShowDialog() == DialogResult.OK)
            {
                int hour = 0;
                try
                {
                    hour = Convert.ToInt32(f.KeyText);
                    if (hour < 0 || hour >= 24)
                    {
                        hour = 0;
                    }
                }
                catch
                {
                    hour = 0;
                }
                ilStartHour.Text = hour.ToString();
            }
        }
Esempio n. 11
0
        private void ilStartMinute_Click(object sender, EventArgs e)
        {
            KeypadForm f = KeypadForm.GetKeypadForm(ilStartMinute.Text);

            if (f.ShowDialog() == DialogResult.OK)
            {
                int minute = 0;
                try
                {
                    minute = Convert.ToInt32(f.KeyText);
                    if (minute < 0 || minute >= 60)
                    {
                        minute = 0;
                    }
                }
                catch
                {
                    minute = 0;
                }
                ilStartMinute.Text = minute.ToString();
            }
        }
Esempio n. 12
0
        private void Label_Setting_Click(object sender, EventArgs e)
        {
#if UNPASSWORD
            //EnterpvSetup();
            OnPageViewChanged(null);
            imageLabel_ParaSet_Click(imageLabel_Setup, new EventArgs());

#else

            KeypadForm f = KeypadForm.GetKeypadForm("", KeypadMode.password);
            if (f.ShowDialog() == DialogResult.OK)
            {
                // 安装设定
                if (f.KeyText == password_Setting)
                {
                    //EnterpvSetup();
                    OnPageViewChanged(null);
                    imageLabel_ParaSet_Click(imageLabel_Setup, new EventArgs());
                }
            }
#endif
        }
Esempio n. 13
0
        private void ilPumpIndex_Click(object sender, EventArgs e)
        {
            KeypadForm f = KeypadForm.GetKeypadForm(ilPumpIndex.Text);

            if (f.ShowDialog() == DialogResult.OK)
            {
                int index = 1;
                try
                {
                    index = Convert.ToInt32(f.KeyText);
                    if (index <= 0 || index > pumpNumber)
                    {
                        index = 1;
                    }
                }
                catch
                {
                    index = 1;
                }
                pumpIndex        = index - 1;
                ilPumpIndex.Text = index.ToString();
                cylinder_Click(cylinderList[0], null);
            }
        }
Esempio n. 14
0
        private void OnClick(object Sender, EventArgs e)
        {
            KeypadForm f = KeypadForm.GetKeypadForm("0", KeypadMode.Normal);

            if (f.ShowDialog() == DialogResult.OK)
            {
                ((ImageLabel)Sender).Text = f.KeyText;

                if (Sender == il_Pressure_Pump || // 泵站压力 4
                    Sender == rb__PowerSupply ||
                    Sender == il_Voltage)         // 控制器电压 4
                {
                    IntDic[(Control)Sender]
                    [comboBox1.SelectedIndex] =
                        Convert.ToInt32(f.KeyText);
                }
                else if (Sender == il_idControl)
                {
                    CDataPool.GetDataPoolObject().out_id_controledPump =
                        Convert.ToByte(f.KeyText);
                }
                else if (Sender == il_idrongyu)
                {
                    CDataPool.GetDataPoolObject().out_id_redundantPump =
                        Convert.ToByte(f.KeyText);
                }
                else
                {
                    //in_Pressure_Pump_Real_3301_3304.Add(0);
                    //in_Voltage_Real_3301_3304.Add(0);
                    IntDic[(Control)Sender]
                    [comboBox1.SelectedIndex * 8 + comboBox2.SelectedIndex] =
                        Convert.ToInt32(f.KeyText);
                }
            }
        }
Esempio n. 15
0
        private void panel_Head_MouseUp(object sender, MouseEventArgs e)
        {
            DateTime MouseUpTime = DateTime.Now;

            TimeSpan ts = (TimeSpan)(MouseUpTime - MouseDownTime);

            if (ts.TotalMilliseconds >= mouselast)
            {
                KeypadForm f = KeypadForm.GetKeypadForm("", KeypadMode.password);
                if (f.ShowDialog() == DialogResult.OK)
                {
                    //退出程序,进入wince 
                    if (f.KeyText == password_EnterWinCE)
                    {
                        System.Diagnostics.Process.Start("explorer.exe", "");
                        //System.Diagnostics.Process.Start("\\NORFlash\\001\\COPY.bat", "");
                        Application.DoEvents();
                        Application.Exit();
                    }
                    else if (f.KeyText == password_Update) //软件升级
                    {
                        if (File.Exists("\\HardDisk\\AdvaMACSysUpdater.exe"))
                        {
                            System.Diagnostics.Process.Start("\\HardDisk\\AdvaMACSysUpdater.exe", "");

                            Application.DoEvents();
                            Application.Exit();
                        }
                        else
                            if (File.Exists("\\USB Hard Disk\\AdvaMACSysUpdater.exe"))
                            {
                                System.Diagnostics.Process.Start("\\USB Hard Disk\\AdvaMACSysUpdater.exe", "");

                                Application.DoEvents();
                                Application.Exit();
                            }

                    }
#if WindowsCE
#else
                    else if (f.KeyText == password_Test) //test
                    {
                        if (_VirtualSetForm == null)
                            _VirtualSetForm = new VirtualSetForm();

                        _VirtualSetForm.Show();
                    }
#endif
                    else if (f.KeyText == password_Reset) //系统数据复位
                    {
                        CDataPool.GetDataPoolObject().Reset();

                        if (WarnErrOper != null)
                            WarnErrOper.Reset();

                        if (historyOper != null)
                            historyOper.Reset();
                    }
                    else if (f.KeyText == password_Backup_History)//历史记录备份
                    {
                        FileCpyForm.GetFileCpyForm().StartCopy();
                    }
                }
            }
        }