|
@@ -20,9 +20,6 @@ namespace DW5S.App.EditForms
|
|
|
{
|
|
|
public partial class FixedStationEditor : DevExpress.XtraEditors.XtraForm
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public FixedStationViewModel info;
|
|
|
private List<FixedStationViewModel> infos;
|
|
|
public FixedStationEditor()
|
|
@@ -48,14 +45,15 @@ namespace DW5S.App.EditForms
|
|
|
infos.AddRange(res.To<List<FixedStationViewModel>>());
|
|
|
var repsSig = unitOfWork.Of<SigInfo>();
|
|
|
var sigs = await repsSig.GetAllAsync();
|
|
|
- this.txtFreqUp.UseDefault().SetData(sigs.To<List<SigViewModel>>(), displayField: nameof(SigViewModel.FreqUpDis)).UseDoubleClickToSelectAll();
|
|
|
+ var sigsData = sigs.To<List<SigViewModel>>();
|
|
|
+ this.txtFreqUp.UseDefault().SetData(sigsData, displayField: nameof(SigViewModel.FreqUpDis)).UseDoubleClickToSelectAll();
|
|
|
if (this.Text == "固定站编辑" && info != null)
|
|
|
{
|
|
|
this.txtName.Text = info.StationName;
|
|
|
this.txtLon.Text = info.Lon.ToString();
|
|
|
this.txtLat.Text = info.Lat.ToString();
|
|
|
this.txtValue.Text = info.Value.ToString();
|
|
|
- this.txtFreqUp.EditValue = sigs.FirstOrDefault(p => p.FreqUp == info.FreqUpHz);
|
|
|
+ this.txtFreqUp.EditValue = sigsData.FirstOrDefault(p => p.FreqUp == info.FreqUpHz);
|
|
|
this.txtEnable.Checked = info.Enable;
|
|
|
}
|
|
|
}
|
|
@@ -76,7 +74,7 @@ namespace DW5S.App.EditForms
|
|
|
DxHelper.MsgBoxHelper.ShowError($"已经存在名称为[{name}]的固定站!");
|
|
|
return;
|
|
|
}
|
|
|
- var freqUpHz = (txtFreqUp.EditValue as SigInfo).FreqUp;
|
|
|
+ var freqUpHz = (txtFreqUp.EditValue as SigViewModel).FreqUp;
|
|
|
if (infos.Any(i => i.Id != info.Id && i.FreqUpHz == freqUpHz))
|
|
|
{
|
|
|
DxHelper.MsgBoxHelper.ShowError($"已经存在上行频点为[{freqUpHz / 1e6:f3}MHz]的固定站!");
|