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);
         }
     }
 }
Beispiel #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();
 }
Beispiel #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();
 }
Beispiel #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();
        }
Beispiel #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();
 }
Beispiel #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();
 }
Beispiel #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;
        }
Beispiel #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;
            }
        }
Beispiel #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);
     }
 }
Beispiel #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();
 }
Beispiel #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();
 }
Beispiel #12
0
        public override void GameResponseStatus(int type, ISFSObject response)
        {
            var gdata = App.GetGameData <BjlGameData>();

            switch (type)
            {
            case RequestType.BeginBet:
                Reset();
                if (App.GameKey.Equals("bjlb"))
                {
                    BankerCtrl.SetApplyBankerBtnActive(true);
                }
                gdata.BeginBet = true;
                ((ProgressCtrl02)ProgressCtrl).PlayClock(response.ContainsKey("cd") ? response.GetInt("cd") : 12, RequestType.BeginBet, SetStopBet);
                //重新设置注的层
                if (gdata.CurrentBanker != null)
                {
                    var curBanekr = gdata.CurrentBanker;
                    curBanekr.TotalCount++;
                    curBanekr.UpdateView();
                    //限制自己为庄家时下注
                    if (gdata.BankSeat < 0)
                    {
                        var bankerInfo = new BjlUserInfo
                        {
                            NickM        = "系统庄",
                            Seat         = -1,
                            CoinA        = long.MaxValue,
                            TotalCount   = 0,
                            WinTotalCoin = 0
                        };
                        gdata.CurrentBanker.Info = bankerInfo;
                        curBanekr.UpdateView();
                    }

                    BankerCtrl.RefreshBanker();

                    if (gdata.SelfSeat != gdata.BankSeat)
                    {
                        BetCtrl.ShowChip();
                    }
                    else
                    {
                        YxMessageBox.Show(new YxMessageBoxData {
                            Msg = "您是本局的庄家!", Delayed = 2
                        });
                    }
                }
                else
                {
                    BetCtrl.ShowChip();
                }

                if (response.ContainsKey("bankRound"))
                {
                    BankerTime.SetBankerTime(response.GetInt("bankRound"));
                }
                else
                {
                    BankerTime.HideBankerTime();
                }
                WaitWin.Hide();
                Facade.Instance <MusicManager>().Play("BeginBet");
                break;

            case RequestType.EndBet:
                base.GameResponseStatus(type, response);

                ProgressCtrl.StopClock(RequestType.EndBet);
                Facade.Instance <MusicManager>().Play("StopBet");

                if (App.GameKey.Equals("bjlb"))
                {
                    BankerCtrl.SetApplyBankerBtnActive(false);
                }
                break;

            case RequestType.Result:
                gdata.SetGameStatus(YxEGameStatus.Normal);
                gdata.IsGaming = false;
                var hisData = gdata.TrendConfig.HistoryData;
                int count   = hisData.Count;
                if (count > 0)
                {
                    int winIndex = GetMenIndex(hisData[count - 1]);
                    var bpg      = response.GetIntArray("bpg");
                    ResultBet(winIndex, bpg);
                    StartCoroutine(ResultMoveChip(winIndex, bpg));
                }


                ProgressCtrl.StopClock(RequestType.Result);
                UserListCtrl.RefreshBanker(response);
                RefreshSelf(response);
                TableResultInfo.ShowTableResultInfo(response);
                CardsCtrl02.SetCardCtrlActive(false);
                break;

            case RequestType.GiveCards:

                if (response.ContainsKey("cd"))
                {
                    ((ProgressCtrl02)ProgressCtrl).PlayClock(response.ContainsKey("cd") ? response.GetInt("cd") : 12, RequestType.GiveCards);
                }
                else
                {
                    ProgressCtrl.Hide();
                }

                CardsCtrl02.BeginGiveCards(response);
                ShowNumCtrl.GroupRefreshNum(response);
                WaitWin.Hide();

                break;

            default:
                base.GameResponseStatus(type, response);
                break;
            }
        }
Beispiel #13
0
        public override void GameResponseStatus(int type, ISFSObject response)
        {
            var gdata = App.GetGameData <BtwGameData>();

            switch ((BtwSkin02RequestType)type)
            {
            case BtwSkin02RequestType.XiaZhu:
                YxDebug.Log("-----------------下注--------------");
                WaitWin.Hide();
                BetCtrl.Bet(response);
                ShowNumCtrl.RefreshNum(response);
                break;

            case BtwSkin02RequestType.ZhuangChange:
                YxDebug.Log("-----------------获取上庄列表--------------");
                WaitWin.Hide();
                UserListCtrl.RefreshBanker(response);
                ProgressCtrl.SetNum(response);
                BetCtrl.ShowChip();
                break;

            case BtwSkin02RequestType.Start:
                YxDebug.Log("-----------------开始下注--------------");
                WaitWin.Hide();
                gdata.BeginBet = true;
                CardsCtrl.ReSetPonits();
                CardsCtrl.gameObject.SetActive(false);
                ShowNumCtrl.Reset();
                ReSetGame();
                BetCtrl.ShowChip();
                ProgressCtrl.ReSetCountdown(18);
                ProgressCtrl.BeginCountdown();
                ApplyCtrl.RefreshBanker();
                TimeBet.gameObject.SetActive(true);
                if (gdata.BankerPlayer.Info.Seat != -1)
                {
                    gdata.BankerPlayer.AddBankerTime();
                }
                Facade.Instance <MusicManager>().Play("beginbet");
                YxMessageTip.Show("开始下注");
                break;

            case BtwSkin02RequestType.Stop:
                YxDebug.Log("-----------------停止下注--------------");
                gdata.BeginBet = false;
                BetCtrl.HideChip();
                ProgressCtrl.EndCountdown();
                TimeBet.gameObject.SetActive(false);
                Facade.Instance <MusicManager>().Play("stopbet");
                WaitWin.Hide();
                break;

            case BtwSkin02RequestType.RollResult:
                YxDebug.Log("-----------------发牌--------------");
                CardsCtrl.BeginGiveCards(response);
                CardsCtrl.gameObject.SetActive(true);
                WaitWin.Hide();
                break;

            case BtwSkin02RequestType.GameResult:
                YxDebug.Log("-----------------结算--------------");
                WaitWin.Hide();
                gdata.SetGameStatus(YxEGameStatus.Normal);
                CardsCtrl.ReceiveResult(response);
                ResultBet(CardsCtrl.Bpg, ShowNumCtrl.ZBet);
                StartCoroutine(ResultMoveChip());
                if (ResultWin != null)
                {
                    StartCoroutine(ShowResultView(response));
                }
                RefreshSelf(response);
                ProgressCtrl.SetNumOnResult(response);
                break;

            case BtwSkin02RequestType.GroupBet:
                YxDebug.Log("-----------------流式下注--------------");
                BetCtrl.GroupBet(response);
                ProgressCtrl.GroupRefreshNum(response);
                ShowNumCtrl.GroupRefreshNum(response);
                break;

            default:
                YxDebug.Log("-*-*-Wrong RequestType : " + type);
                break;
            }
        }