예제 #1
0
 /// <summary>
 /// Sets the request parameters.
 /// </summary>
 public void SetReqParams(KPReqParams reqParams)
 {
     Timeout = reqParams.Timeout;
     Delay   = reqParams.Delay;
     Time    = reqParams.Time;
     Period  = reqParams.Period;
     CmdLine = reqParams.CmdLine;
 }
예제 #2
0
        private void btnResetReqParams_Click(object sender, EventArgs e)
        {
            // set the request parameters of the selected device by default
            if (GetSelectedItem(out ListViewItem item, out Settings.KP kp) &&
                GetDeviceView(kp, true, out KPView kpView))
            {
                KPReqParams reqParams = kpView.DefaultReqParams;
                numDeviceTimeout.SetValue(reqParams.Timeout);
                numDeviceDelay.SetValue(reqParams.Delay);
                dtpDeviceTime.SetTime(reqParams.Time);
                dtpDevicePeriod.SetTime(reqParams.Period);
                txtDeviceCmdLine.Text = reqParams.CmdLine;

                OnSettingsChanged();
            }
        }
예제 #3
0
 private void btnResetReqParams_Click(object sender, EventArgs e)
 {
     // set the request parameters of the selected device by default
     if (GetSelectedItem(out ListViewItem item, out Settings.KP kp))
     {
         if (Environment.TryGetKPView(kp, true, null, out KPView kpView, out string errMsg))
         {
             KPReqParams reqParams = kpView.DefaultReqParams;
             numDeviceTimeout.SetValue(reqParams.Timeout);
             numDeviceDelay.SetValue(reqParams.Delay);
             dtpDeviceTime.SetTime(reqParams.Time);
             dtpDevicePeriod.SetTime(reqParams.Period);
             txtDeviceCmdLine.Text = reqParams.CmdLine;
             OnSettingsChanged();
         }
         else
         {
             ScadaUiUtils.ShowError(errMsg);
         }
     }