Exemplo n.º 1
0
        // 配置对象转化
        private PandaParam ToPandaParam(ConfSonWebPandaPumpScadaDataService param)
        {
            return(new PandaParam()
            {
                appKey = param.AppKey,
                appSecret = param.AppSecret,
                getTokenUrl = param.GetTokenUrl,
                getDataUrl = param.GetDataUrl,
                useName = param.UseName,

                collectInterval = param.CollectInterval,
                saveInterVal = param.SaveInterVal
            });
        }
Exemplo n.º 2
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            ConfSonWebPandaPumpScadaDataService info = new ConfSonWebPandaPumpScadaDataService();

            if (string.IsNullOrWhiteSpace(txt_appKey.Text))
            {
                MessageBox.Show("appKey不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (string.IsNullOrWhiteSpace(txt_appSecret.Text))
            {
                MessageBox.Show("appSecret不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (string.IsNullOrWhiteSpace(txt_getTokenUrl.Text))
            {
                MessageBox.Show("TokenUrl不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (string.IsNullOrWhiteSpace(txt_getDataUrl.Text))
            {
                MessageBox.Show("DataUrl不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (string.IsNullOrWhiteSpace(txt_useName.Text))
            {
                MessageBox.Show("useName不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            info.AppKey                = txt_appKey.Text;
            info.AppSecret             = txt_appSecret.Text;
            info.GetTokenUrl           = txt_getTokenUrl.Text;
            info.GetDataUrl            = txt_getDataUrl.Text;
            info.UseName               = txt_useName.Text;
            info.SaveInterVal          = Convert.ToInt32(txt_saveInterVal.Value);
            info.CollectInterval       = Convert.ToInt32(txt_collectInterval.Value);
            info.CommandTimeoutSeconds = Convert.ToInt32(txt_commandTimeoutSeconds.Value);

            if (config.SubmitSonWebPandaPumpScadaData(info, out string errMsg))
            {
                MessageBox.Show("提交 WEB熊猫二供SCADA接入服务 配置信息成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
                evtSubmit("WEB熊猫二供SCADA接入服务", EnvConfigInfo.Status.success);
            }
            else
            {
                MessageBox.Show("提交 WEB熊猫二供SCADA接入服务 配置信息失败," + errMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                evtSubmit("WEB熊猫二供SCADA接入服务", EnvConfigInfo.Status.fail);
            }
        }
Exemplo n.º 3
0
 public WEBPandaPumpSCADAService(ConfSonWebPandaPumpScadaDataService pandaPumpScadaParam)
 {
     Config.pandaPumpScadaParam = pandaPumpScadaParam;
 }