|
@@ -24,6 +24,9 @@ namespace XdCxRhDW.App.EditForms
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
this.layoutControl1.UseDefault();
|
|
|
+ txtFreqUp.UseDoubleClickToSelectAll();
|
|
|
+ txtFreqDown.UseDoubleClickToSelectAll();
|
|
|
+ txtSnr.UseDoubleClickToSelectAll();
|
|
|
this.Text = "添加信号";
|
|
|
info = new SigInfo();
|
|
|
this.StartPosition = FormStartPosition.CenterParent;
|
|
@@ -43,21 +46,12 @@ namespace XdCxRhDW.App.EditForms
|
|
|
this.txtFreqUp.EditValue = info.FreqUp;
|
|
|
this.txtFreqDown.EditValue = info.FreqDown;
|
|
|
this.txtSnr.EditValue = info.Snr;
|
|
|
- //List<EnumSigCheckType> deWay = new List<EnumSigCheckType>();
|
|
|
- //if (info.SigType.HasFlag(EnumSigCheckType.DAMA))
|
|
|
- //{
|
|
|
- // deWay.Add(EnumSigCheckType.DAMA);
|
|
|
- //}
|
|
|
- //if (info.SigType.HasFlag(EnumSigCheckType.IBS))
|
|
|
- //{
|
|
|
- // deWay.Add(EnumSigCheckType.IBS);
|
|
|
- //}
|
|
|
- //if (info.SigType.HasFlag(EnumSigCheckType.Ky5758))
|
|
|
- //{
|
|
|
- // deWay.Add(EnumSigCheckType.Ky5758);
|
|
|
- //}
|
|
|
- //this.txtSigType.EditValue = string.Join(",", deWay);
|
|
|
- //this.txtSigType.EditValue = info.SigType.ToString();
|
|
|
+ var arr = Enum.GetValues(typeof(EnumSigCheckType));
|
|
|
+ foreach (EnumSigCheckType item in arr)
|
|
|
+ {
|
|
|
+ if (info.SigType.HasFlag(item))
|
|
|
+ txtSigType.Items[item].CheckState = CheckState.Checked;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -70,28 +64,28 @@ namespace XdCxRhDW.App.EditForms
|
|
|
try
|
|
|
{
|
|
|
dxErrorProvider.ClearErrors();
|
|
|
- if (txtFreqUp.EditValue == null)
|
|
|
+ if (!double.TryParse(txtFreqUp.Text, out double freqUp))
|
|
|
{
|
|
|
- dxErrorProvider.SetError(txtFreqUp, "请输入上行频点");
|
|
|
+ dxErrorProvider.SetError(txtFreqUp, "上行频点格式错误");
|
|
|
return;
|
|
|
}
|
|
|
- if (txtFreqDown.EditValue == null)
|
|
|
+ if (!double.TryParse(txtFreqDown.Text, out double freqDown))
|
|
|
{
|
|
|
- dxErrorProvider.SetError(txtFreqDown, "请输入下行频点");
|
|
|
+ dxErrorProvider.SetError(txtFreqUp, "下行频点格式错误");
|
|
|
return;
|
|
|
}
|
|
|
if (!txtSigType.Items.Any(p => p.CheckState == CheckState.Checked))
|
|
|
{
|
|
|
- dxErrorProvider.SetError(txtSigType, "请选择信号类型");
|
|
|
+ DxHelper.MsgBoxHelper.ShowError("请选择信号类型");
|
|
|
return;
|
|
|
}
|
|
|
- if (txtSnr.EditValue == null)
|
|
|
+ if (!double.TryParse(txtSnr.Text, out double snr))
|
|
|
{
|
|
|
- dxErrorProvider.SetError(txtSnr, "请输入门限");
|
|
|
+ dxErrorProvider.SetError(txtFreqUp, "门限格式错误");
|
|
|
return;
|
|
|
}
|
|
|
- info.FreqUp = Convert.ToDouble(txtFreqUp.EditValue);
|
|
|
- info.FreqDown = Convert.ToDouble(txtFreqDown.EditValue);
|
|
|
+ info.FreqUp = freqUp;
|
|
|
+ info.FreqDown = freqDown;
|
|
|
info.Snr = Convert.ToDouble(txtSnr.EditValue);
|
|
|
var res = txtSigType.Items.Where(p => p.CheckState == CheckState.Checked).Select(t => (EnumSigCheckType)t.Value).ToList();
|
|
|
EnumSigCheckType sigType = res.First();
|