|
@@ -45,6 +45,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
this.splitterItem1.Location = new Point(200, 0);
|
|
|
txtStartTime.UseDefault();
|
|
|
txtEndTime.UseDefault();
|
|
|
+ //txtFrequpMHz.Properties.Sorted = true;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -193,12 +194,35 @@ namespace XdCxRhDW.App.UserControl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ bool canQuery = true;
|
|
|
private void OnPosAdd(ModelPosRes posRes)
|
|
|
{
|
|
|
var currentTask = gridView1.GetFocusedRow() as TaskInfo;
|
|
|
if (currentTask.ID == posRes.TaskInfoID)
|
|
|
{
|
|
|
- if (txtFrequpMHz.EditValue != null && posRes.FreqUpHz != (long)(Convert.ToDouble(txtFrequpMHz.EditValue) * 1e6))
|
|
|
+ lock (this)
|
|
|
+ {
|
|
|
+ var items = txtFrequpMHz.Properties.Items.Where(p => p.Value != null).Select(t => Convert.ToInt64(t.Value)).ToList();
|
|
|
+ if (!items.Contains(posRes.FreqUpHz))
|
|
|
+ {
|
|
|
+ canQuery = false;
|
|
|
+ items.Add(posRes.FreqUpHz);
|
|
|
+ items.Sort();
|
|
|
+ var selectdItem = this.txtFrequpMHz.SelectedItem;
|
|
|
+ this.Invoke(new Action(() =>
|
|
|
+ {
|
|
|
+ this.txtFrequpMHz.Properties.Items.Clear();
|
|
|
+ this.txtFrequpMHz.Properties.Items.Add(new ImageComboBoxItem("全部", null));
|
|
|
+ foreach (var item in items)
|
|
|
+ {
|
|
|
+ this.txtFrequpMHz.Properties.Items.Add(new ImageComboBoxItem((item / 1e6).ToString("f3"), item));
|
|
|
+ }
|
|
|
+ this.txtFrequpMHz.SelectedItem = selectdItem;
|
|
|
+ }));
|
|
|
+ canQuery = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (txtFrequpMHz.EditValue != null && posRes.FreqUpHz != Convert.ToInt64(txtFrequpMHz.EditValue))
|
|
|
return;
|
|
|
if (posRes.PosLon == 999 && !btnIncludeInvalidate.Checked)
|
|
|
return;
|
|
@@ -209,27 +233,6 @@ namespace XdCxRhDW.App.UserControl
|
|
|
gridView2.RefreshData();
|
|
|
mapControl1.AddPosItem(posRes);
|
|
|
}));
|
|
|
-
|
|
|
-
|
|
|
- var txtFrequpItemFreq = new List<long>();
|
|
|
- txtFrequpItemFreq.AddRange(txtFrequpMHz.Properties.Items.Select(t => Convert.ToInt64(t.Value)));
|
|
|
- if (!txtFrequpItemFreq.Contains(posRes.FreqUpHz))
|
|
|
- {
|
|
|
- txtFrequpItemFreq.Add(posRes.FreqUpHz);
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- txtFrequpItemFreq.Sort();
|
|
|
- var itemsNew = txtFrequpItemFreq.Select(t => new ImageComboBoxItem((posRes.FreqUpHz / 1e6).ToString("f3"), posRes.FreqUpHz)).ToArray();
|
|
|
- this.Invoke(new Action(() =>
|
|
|
- {
|
|
|
- this.txtFrequpMHz.Properties.Items.Clear();
|
|
|
- this.txtFrequpMHz.Properties.Items.AddRange(itemsNew);
|
|
|
- }));
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
private async void GridView1_FocusedRowObjectChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs e)
|
|
@@ -250,17 +253,6 @@ namespace XdCxRhDW.App.UserControl
|
|
|
{
|
|
|
gridView2.Columns[nameof(ModelPosRes.CxResID)].Visible = false;
|
|
|
}
|
|
|
-
|
|
|
- //using (RHDWContext db = new RHDWContext())
|
|
|
- //{
|
|
|
- //this.txtFrequpMHz.Properties.Items.Clear();
|
|
|
- //this.txtFrequpMHz.Properties.Items.Add(new ImageComboBoxItem("全部", null));
|
|
|
- // var sigs = await db.TaskSigs.Where(w => w.TaskInfoID == tsk.ID).ToListAsync();
|
|
|
- //foreach (var item in sigs)
|
|
|
- //{
|
|
|
- // this.txtFrequpMHz.Properties.Items.Add(new ImageComboBoxItem((item.FreqUp / 1e6).ToString("f3"), item.FreqUp));
|
|
|
- //}
|
|
|
- // }
|
|
|
this.txtFrequpMHz.Properties.Items.Clear();
|
|
|
this.txtFrequpMHz.Properties.Items.Add(new ImageComboBoxItem("全部", null));
|
|
|
var sigs = new List<TaskFreqResDto>();
|
|
@@ -300,11 +292,11 @@ namespace XdCxRhDW.App.UserControl
|
|
|
var sat2 = db.SatInfos.Where(p => p.SatCode == tsk.Adja1Sat).FirstOrDefault();
|
|
|
var sat3 = db.SatInfos.Where(p => p.SatCode == tsk.Adja2Sat).FirstOrDefault();
|
|
|
if (sat1 != null && sat1.SatLon != null)
|
|
|
- mapControl1.DrawFixedImg("Sat", 0, sat1.SatLon.Value, DxHelper.SvgHelper.CreateSat(width: 16, height: 16), $"主星\r\n{sat1.Sat}");
|
|
|
+ mapControl1.DrawFixedImg("Sat", "Sat1", 0, sat1.SatLon.Value, DxHelper.SvgHelper.CreateSat(width: 16, height: 16), $"主星\r\n{sat1.Sat}");
|
|
|
if (sat2 != null && sat2.SatLon != null)
|
|
|
- mapControl1.DrawFixedImg("Sat", 0, sat2.SatLon.Value, DxHelper.SvgHelper.CreateSat(width: 16, height: 16), $"邻1星\r\n{sat2.Sat}");
|
|
|
+ mapControl1.DrawFixedImg("Sat", "Sat2", 0, sat2.SatLon.Value, DxHelper.SvgHelper.CreateSat(width: 16, height: 16), $"邻1星\r\n{sat2.Sat}");
|
|
|
if (sat3 != null && sat3.SatLon != null)
|
|
|
- mapControl1.DrawFixedImg("Sat", 0, sat3.SatLon.Value, DxHelper.SvgHelper.CreateSat(width: 16, height: 16), $"邻2星\r\n{sat3.Sat}");
|
|
|
+ mapControl1.DrawFixedImg("Sat", "Sat3", 0, sat3.SatLon.Value, DxHelper.SvgHelper.CreateSat(width: 16, height: 16), $"邻2星\r\n{sat3.Sat}");
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -344,14 +336,23 @@ namespace XdCxRhDW.App.UserControl
|
|
|
var station = db?.StationRes.Where(p => p.ID == posItem.StationResID).FirstOrDefault();
|
|
|
if (station != null)
|
|
|
{
|
|
|
- mapControl1.DrawFixedImg("Tx", station.SatTxLat, station.SatTxLon, DxHelper.SvgHelper.CreateAnt(width: 16, height: 16), $"[卫星接收天线]\r\n经度:{station.SatTxLon}°\r\n纬度:{station.SatTxLat}°");
|
|
|
+ if (mapControl1.ExistFixedImg($"SatTx_{station.SatTxLon}_{station.SatTxLat}", station.SatTxLat, station.SatTxLon))
|
|
|
+ mapControl1.DrawFixedImg("Tx", $"SatTx_{station.SatTxLon}_{station.SatTxLat}", station.SatTxLat, station.SatTxLon, DxHelper.SvgHelper.CreateAnt(width: 16, height: 16), $"[卫星接收天线]\r\n经度:{station.SatTxLon}°\r\n纬度:{station.SatTxLat}°");
|
|
|
if (station.CdbTxLon != null)
|
|
|
- mapControl1.DrawFixedImg("Tx", station.CdbTxLat.Value, station.CdbTxLon.Value, DxHelper.SvgHelper.CreateAnt(width: 16, height: 16), $"[超短接收天线]\r\n经度:{station.CdbTxLon.Value}°\r\n纬度:{station.CdbTxLat.Value}°");
|
|
|
+ {
|
|
|
+ if (mapControl1.ExistFixedImg($"SatTx_{station.CdbTxLon.Value}_{station.CdbTxLat.Value}", station.CdbTxLat.Value, station.CdbTxLon.Value))
|
|
|
+ mapControl1.DrawFixedImg("Tx", $"CdbTx_{station.CdbTxLon.Value}_{station.CdbTxLat.Value}", station.CdbTxLat.Value, station.CdbTxLon.Value, DxHelper.SvgHelper.CreateAnt(width: 16, height: 16), $"[超短接收天线]\r\n经度:{station.CdbTxLon.Value}°\r\n纬度:{station.CdbTxLat.Value}°");
|
|
|
+ }
|
|
|
if (station.RefLon != null)
|
|
|
- mapControl1.DrawFixedImg("Tx", station.RefLat.Value, station.RefLon.Value, DxHelper.SvgHelper.CreatePentagram(width: 16, height: 16), $"[参考站]\r\n经度:{station.RefLon.Value}°\r\n纬度:{station.RefLat.Value}°");
|
|
|
+ {
|
|
|
+ if (mapControl1.ExistFixedImg($"SatTx_{station.RefLon.Value}_{station.RefLat.Value}", station.RefLat.Value, station.RefLon.Value))
|
|
|
+ mapControl1.DrawFixedImg("Tx", $"RefTx_{station.RefLon.Value}_{station.RefLat.Value}", station.RefLat.Value, station.RefLon.Value, DxHelper.SvgHelper.CreatePentagram(width: 16, height: 16), $"[参考站]\r\n经度:{station.RefLon.Value}°\r\n纬度:{station.RefLat.Value}°");
|
|
|
+ }
|
|
|
if (station.CxLon != null)
|
|
|
- mapControl1.DrawFixedImg("Tx", station.CxLat.Value, station.CxLon.Value, DxHelper.SvgHelper.CreatePentagram(width: 16, height: 16), $"[测向站]\r\n经度:{station.CxLon.Value}°\r\n纬度:{station.CxLat.Value}°");
|
|
|
-
|
|
|
+ {
|
|
|
+ if (mapControl1.ExistFixedImg($"SatTx_{station.CxLon.Value}_{station.CxLat.Value}", station.CxLat.Value, station.CxLon.Value))
|
|
|
+ mapControl1.DrawFixedImg("Tx", $"CxTx_{station.CxLon.Value}_{station.CxLat.Value}", station.CxLat.Value, station.CxLon.Value, DxHelper.SvgHelper.CreatePentagram(width: 16, height: 16), $"[测向站]\r\n经度:{station.CxLon.Value}°\r\n纬度:{station.CxLat.Value}°");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -747,6 +748,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
|
|
|
private void txtFrequpMHz_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
{
|
|
|
+ if (!canQuery) return;
|
|
|
txtTimeCho_SelectedIndexChanged(null, null);
|
|
|
}
|
|
|
private async void txtTimeCho_SelectedIndexChanged(object sender, EventArgs e)
|