Ejemplo n.º 1
0
        private void simpleButton17_Click(object sender, EventArgs e)
        {
            WaitDialogForm wdf = new WaitDialogForm("命令执行中,请稍候......");

            try
            {
                Gloab.AllData.WeatherList         = WeatherInstruction.ReadWeather(Gloab.AllData.Address, Gloab.Config, CommandCallback);
                Gloab.AllData.Normal.WeatherCount = (short)Gloab.AllData.WeatherList.Count;
                SetWeatherToControl();
                SetDebugStr("读取气象参数成功");
            }
            catch (CommandException ex)
            {
                SetDebugStr("读取气象参数失败");
                XtraMessageBox.Show(ex.Message);
            }
            catch (Exception exp)
            {
                SetDebugStr("读取气象参数失败");
                log.Error(exp);
            }
            finally
            {
                wdf.Close();
            }
        }
Ejemplo n.º 2
0
        private void simpleButton18_Click(object sender, EventArgs e)
        {
            WaitDialogForm wdf = new WaitDialogForm("命令执行中,请稍候......");

            try
            {
                WeatherInstruction.WriteWeather(Gloab.AllData.WeatherList, Gloab.AllData.Address, CommandCallback);
                SetDebugStr("写入气象参数成功");
            }
            catch (CommandException ex)
            {
                SetDebugStr("写入气象参数失败");
                XtraMessageBox.Show(ex.Message);
            }
            catch (Exception exp)
            {
                SetDebugStr("写入气象参数失败");
                log.Error(exp);
            }
            finally
            {
                wdf.Close();
            }
        }