Пример #1
0
 private void btnTest_Click(object sender, EventArgs e)
 {
     if (PortName.SelectedItem == null || BaudRate.SelectedItem == null)
     {
         UMessageBox.Show("请选择串口号和波特率!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         WaitWin.Show(this, "正在测试,请稍后。。。。。。");
         CDMASMS.Close();
         CDMASMS.Set(PortName.SelectedItem.ToString(), Convert.ToInt32(BaudRate.SelectedItem.ToString()));
         if (CDMASMS.Open())
         {
             string TSX             = CDMASMS.SendAT("AT^MEID").Replace("\r\n", "").Replace("OK", "");
             string production_Name = CDMASMS.SendAT("AT+CGMM").Replace("\r\n", "").Replace("OK", "");
             if (TSX.Length == 14 && production_Name.IndexOf("MC323") != -1)
             {
                 WaitWin.Close();
                 UMessageBox.Show("测试通过,请保存后重启系统。", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 WaitWin.Close();
                 UMessageBox.Show("测试未通过,请重试!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
         }
         else
         {
             WaitWin.Close();
             UMessageBox.Show("测试未通过,请重试!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }
Пример #2
0
 private void btnMaintain_Click(object sender, EventArgs e)
 {
     WaitWin.Show(this, "正在打开,请稍后。。。。。。");
     panelMain.Controls.Clear();
     amc.Dock = DockStyle.Fill;
     panelMain.Controls.Add(amc);
     WaitWin.Close();
 }
Пример #3
0
 private void btnSystemSettings_Click(object sender, EventArgs e)
 {
     WaitWin.Show(this, "正在打开,请稍后。。。。。。");
     panelMain.Controls.Clear();
     ssc.Dock = DockStyle.Fill;
     panelMain.Controls.Add(ssc);
     WaitWin.Close();
 }
Пример #4
0
        private void btnMessagelog_Click(object sender, EventArgs e)
        {
            WaitWin.Show(this, "正在打开,请稍后。。。。。。");

            panelMain.Controls.Clear();
            lil.Dock = DockStyle.Fill;
            panelMain.Controls.Add(lil);
            WaitWin.Close();
        }
Пример #5
0
 private void btnPendingMsg_Click(object sender, EventArgs e)
 {
     WaitWin.Show(this, "正在打开,请稍后。。。。。。");
     panelMain.Controls.Clear();
     pmc.Dock = DockStyle.Fill;
     panelMain.Controls.Add(pmc);
     pmc.RefreshInfo();
     WaitWin.Close();
 }
Пример #6
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     this.Focus();
     WaitWin.Show(this, "正在关闭,请稍后。。。。。。");
     if (_isOpen == true)
     {
         Cef.Shutdown();
     }
     if (_isOpen != false)
     {
         CDMASMS.Close();
     }
     WaitWin.Close();
 }
Пример #7
0
        private void button8_Click(object sender, EventArgs e)
        {
            //this.Enabled = false;
            WaitWin.Show("等待中", this);

            string s = "";


            for (int i = 1; i <= 5; i++)
            {
                //WaitWin.Show("等待中,第 " + i + " 秒");

                WaitWin.setlabel("等待中,第 " + i + " 秒");

                Thread.Sleep(1000);
            }
            WaitWin.Close();
            //this.Enabled = true;
        }
Пример #8
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            switch (_isOpen)
            {
            case true:
                msc        = new MsgShowControl();
                ssc.isOpen = true;
                panelMain.Controls.Clear();
                msc.Dock = DockStyle.Fill;
                panelMain.Controls.Add(msc);
                break;

            case false:
                ssc.isOpen = false;
                WaitWin.Show(this, "正在打开,请稍后。。。。。。");

                btnMsgShow.Enabled    = false;
                btnPendingMsg.Enabled = false;
                btnMessagelog.Enabled = false;
                btnMaintain.Enabled   = false;

                panelMain.Controls.Clear();
                ssc.Dock = DockStyle.Fill;
                panelMain.Controls.Add(ssc);
                WaitWin.Close();
                break;

            case null:
                WaitWin.Show(this, "正在打开,请稍后。。。。。。");

                btnMsgShow.Enabled        = false;
                btnSystemSettings.Enabled = false;
                btnMessagelog.Enabled     = false;
                btnPendingMsg.Enabled     = false;
                btnMaintain.Enabled       = false;

                pmc.Enabled = false;
                WaitWin.Close();
                new ErrorForm("系统错误,请等待恢复!", false).Show(this);
                break;
            }
        }
Пример #9
0
 //报警信息处理
 private void btnAlarm_Click(object sender, EventArgs e)
 {
     int[] n = new int[dgvAlarm.Rows.Count + 1];
     for (int i = 0; i < dgvAlarm.Rows.Count; i++)
     {
         //判断该行的复选框是否存在
         if (dgvAlarm.Rows[i].Cells[0].Value != null)
         {
             //判断该复选框是否被选中
             if (Convert.ToBoolean(dgvAlarm.Rows[i].Cells[0].Value))
             {
                 n[0]++;
                 n[i + 1] = i;
             }
         }
     }
     if (n[0] == 0)
     {
         UMessageBox.Show("请选择数据!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     else
     {
         WaitWin.Show(this, "正在处理,请稍后。。。。。。");
         for (int i = 1; i < n.Length; i++)
         {
             time          = dgvAlarm.Rows[n[i]].Cells[1].Value.ToString();
             terminal_ID   = dgvAlarm.Rows[n[i]].Cells[2].Value.ToString();
             well_State_ID = int.Parse(dgvAlarm.Rows[n[i]].Cells[3].Value.ToString());
             place         = dgvAlarm.Rows[n[i]].Cells[5].Value.ToString();
             phone         = dgvAlarm.Rows[n[i]].Cells[7].Value.ToString();
             dgvAlarm.Rows.RemoveAt(n[i]);
             DisposeMsg(CSPNType.AlarmInfo);
             Thread.Sleep(1000);
         }
         WaitWin.Close();
         UMessageBox.Show("处理成功!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #10
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     LogHelper.WriteLog(e.ToString(), e.ExceptionObject as Exception);
     UMessageBox.Show("系统错误。", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
     WaitWin.Close();
 }
Пример #11
0
 static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
 {
     LogHelper.WriteLog(e.ToString(), e.Exception);
     UMessageBox.Show("系统错误。", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
     WaitWin.Close();
 }