/// <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; }
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(); } }
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); } }