コード例 #1
0
ファイル: MainXtraForm.cs プロジェクト: damoOnly/WAD
        private void simpleButton13_Click(object sender, EventArgs e)
        {
            WaitDialogForm wdf = new WaitDialogForm("命令执行中,请稍候......");

            try
            {
                Gloab.AllData.WeatherList         = NormalInstruction.WriteWeatherCount((short)spinEdit2.Value, Gloab.AllData.Address, Gloab.Config, CommandCallback);
                Gloab.AllData.Normal.WeatherCount = (short)Gloab.AllData.WeatherList.Count;
                Gloab.AllData.NormalList          = Gloab.AllData.Normal.ConvertToNormalList();
                SetWeatherToControl();
                SetNormalToControl();

                gridControl4.RefreshDataSource();
                SetDebugStr("写入气象个数成功");
            }
            catch (CommandException ex)
            {
                SetDebugStr("写入气象个数失败");
                XtraMessageBox.Show(ex.Message);
            }
            catch (Exception exp)
            {
                SetDebugStr("写入气象个数失败");
                log.Error(exp);
            }
            finally
            {
                wdf.Close();
            }
        }
コード例 #2
0
ファイル: UserControlNormal.cs プロジェクト: damoOnly/WAD
        private void simpleButton15_Click(object sender, EventArgs e)
        {
            WaitDialogForm wdf = new WaitDialogForm("命令执行中,请稍候......");

            try
            {
                GetNormalFromControl();
                NormalInstruction.WriteNormal(normalParam, Gloab.AllData.Address, CommandCallback);
                Gloab.AllData.NormalList = Gloab.AllData.Normal.ConvertToNormalList();
                if (ChangeNormalEvent != null)
                {
                    ChangeNormalEvent(null, null);
                }
                Callback("写入通用参数成功");
            }
            catch (CommandException ex)
            {
                Callback("写入通用参数失败");
                XtraMessageBox.Show(ex.Message);
            }
            catch (Exception exp)
            {
                Callback("写入通用参数失败");
                log.Error(exp);
            }
            finally
            {
                wdf.Close();
            }
        }
コード例 #3
0
ファイル: MainXtraForm.cs プロジェクト: damoOnly/WAD
        private void simpleButton12_Click(object sender, EventArgs e)
        {
            WaitDialogForm wdf = new WaitDialogForm("命令执行中,请稍候......");

            try
            {
                short count = (short)spinEdit1.Value;
                Gloab.AllData.GasList         = NormalInstruction.WriteGasCount(count, Gloab.AllData.Address, Gloab.Config, CommandCallback);
                Gloab.AllData.Normal.GasCount = count;
                Gloab.AllData.NormalList      = Gloab.AllData.Normal.ConvertToNormalList();
                SetGasToControl();
                SetNormalToControl();
                SetDebugStr("写入气体个数成功");
            }
            catch (CommandException ex)
            {
                SetDebugStr("写入气体个数失败");
                XtraMessageBox.Show(ex.Message);
            }
            catch (Exception exp)
            {
                SetDebugStr("写入气体个数失败");
                log.Error(exp);
            }
            finally
            {
                wdf.Close();
            }
        }