1修改实时波时测试问题;

2修改配置页面路径问题;
master
mzhifa 2 years ago
parent b3180885ad
commit ef3cd15ddc

@ -5,6 +5,7 @@ using Prism.Events;
using Prism.Mvvm; using Prism.Mvvm;
using Prism.Regions; using Prism.Regions;
using Prism.Services.Dialogs; using Prism.Services.Dialogs;
using StartServerWPF.Models;
using StartServerWPF.Modules.Main.Models; using StartServerWPF.Modules.Main.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -20,13 +21,14 @@ namespace StartServerWPF.Modules.Main.ViewModels
public class LogManagementViewModel : BindableBase public class LogManagementViewModel : BindableBase
{ {
IEventAggregator _ea; IEventAggregator _ea;
private readonly SystemConfigModel _systemConfig;
private readonly IDialogService _dialogService; private readonly IDialogService _dialogService;
private readonly MainViewModel _mainViewModel; private readonly MainViewModel _mainViewModel;
public LogManagementViewModel( public LogManagementViewModel(SystemConfigModel systemConfig, IEventAggregator ea, IDialogService dialogService, MainViewModel mainViewModel)
IEventAggregator ea, IDialogService dialogService, MainViewModel mainViewModel)
{ {
this._systemConfig = systemConfig;
this._dialogService = dialogService; this._dialogService = dialogService;
this._mainViewModel = mainViewModel; this._mainViewModel = mainViewModel;
} }
@ -59,7 +61,7 @@ namespace StartServerWPF.Modules.Main.ViewModels
{ {
SelectIndexLogType = "全部"; SelectIndexLogType = "全部";
DataList = new List<LogMessageModel>(); DataList = new List<LogMessageModel>();
string fileName = _mainViewModel._systemConfig.vpnInfo.SystemLogPath+ "SerLog_" + EndTime.ToString("yyyyMMdd") + ".txt"; string fileName = _systemConfig.vpnInfo.SystemLogPath+ "SerLog_" + EndTime.ToString("yyyyMMdd") + ".txt";
if (!File.Exists(fileName)) if (!File.Exists(fileName))
return; return;
Task.Run(() => Task.Run(() =>

@ -493,7 +493,7 @@ namespace StartServerWPF.Modules.Main.ViewModels
public VPNHelper vpn; public VPNHelper vpn;
public bool vpnStatus = false; public bool vpnStatus = false;
public SystemConfigModel _systemConfig; private SystemConfigModel _systemConfig;
private DispatcherTimer timer1= new DispatcherTimer(); private DispatcherTimer timer1= new DispatcherTimer();
private readonly IDialogService _dialogService; private readonly IDialogService _dialogService;
@ -537,8 +537,11 @@ namespace StartServerWPF.Modules.Main.ViewModels
process.StartInfo.CreateNoWindow = true; process.StartInfo.CreateNoWindow = true;
//* Set your output and error (asynchronous) handlers //* Set your output and error (asynchronous) handlers
if (!proInfo.ProName.Contains("gw.apms"))
{
process.OutputDataReceived += new DataReceivedEventHandler(OutputHandler); process.OutputDataReceived += new DataReceivedEventHandler(OutputHandler);
process.ErrorDataReceived += new DataReceivedEventHandler(OutputHandler); process.ErrorDataReceived += new DataReceivedEventHandler(OutputHandler);
}
//* Start process and handlers //* Start process and handlers
bool res= process.Start(); bool res= process.Start();
process.BeginOutputReadLine(); process.BeginOutputReadLine();
@ -559,19 +562,20 @@ namespace StartServerWPF.Modules.Main.ViewModels
if (outLine.Data.Contains("ProcessSlice:")) if (outLine.Data.Contains("ProcessSlice:"))
{ {
var pro = sendingProcess as Process; var pro = sendingProcess as Process;
if (pro != null) if (pro != null&& pro.MainModule.ModuleName.Contains(_systemConfig.proTools.ProName))
{ {
Application.Current.Dispatcher.BeginInvoke(() => Application.Current.Dispatcher.InvokeAsync(() =>
{ {
if (pro.MainModule.ModuleName.Contains(_systemConfig.proApms.ProName)) //if (pro.MainModule.ModuleName.Contains(_systemConfig.proApms.ProName))
{ //{
AddItems(ApmsProcessSliceSource, new ProcessingInformationModel { ProcessMes = outLine.Data, MonitorTime = DateTime.Now.ToString() }); // AddItems(ApmsProcessSliceSource, new ProcessingInformationModel { ProcessMes = outLine.Data, MonitorTime = DateTime.Now.ToString() });
} //}
else if (pro.MainModule.ModuleName.Contains(_systemConfig.proTools.ProName)) //else
if (pro.MainModule.ModuleName.Contains(_systemConfig.proTools.ProName))
{ {
AddItems(ToolsProcessSliceSource, new ProcessingInformationModel { ProcessMes = outLine.Data, MonitorTime = DateTime.Now.ToString() }); AddItems(ToolsProcessSliceSource, new ProcessingInformationModel { ProcessMes = outLine.Data, MonitorTime = DateTime.Now.ToString() });
} }
}); }, DispatcherPriority.ApplicationIdle);
} }
} }
else if (outLine.Data.Contains("ML ")) else if (outLine.Data.Contains("ML "))

@ -21,7 +21,7 @@ namespace StartServerWPF.Modules.Main.ViewModels
{ {
public SetParamViewModel(MainViewModel mainViewModel,SystemConfigModel configModel) public SetParamViewModel(MainViewModel mainViewModel,SystemConfigModel configModel)
{ {
_systemConfig = mainViewModel._systemConfig; _systemConfig = configModel;
MainModel = _systemConfig.vpnInfo; MainModel = _systemConfig.vpnInfo;
MoniTime = mainViewModel.MoniStartTime; MoniTime = mainViewModel.MoniStartTime;
@ -179,17 +179,18 @@ namespace StartServerWPF.Modules.Main.ViewModels
fbd.ShowNewFolderButton = true; fbd.ShowNewFolderButton = true;
if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{ {
string path= fbd.SelectedPath.Replace("\\", "/");
if (para == "systemSavepath") if (para == "systemSavepath")
{ {
MainModel.DataSavePath = fbd.SelectedPath; MainModel.DataSavePath = path;
} }
else if(para == "apmssavepath") else if(para == "apmssavepath")
{ {
AModel.savepath = fbd.SelectedPath; AModel.savepath = path;
} }
else if(para == "toolssavepath") else if(para == "toolssavepath")
{ {
ToolsModel.savepath = fbd.SelectedPath; ToolsModel.savepath = path;
} }
} }
@ -242,8 +243,8 @@ namespace StartServerWPF.Modules.Main.ViewModels
int index= _systemConfig.proTools.ProParams.IndexOf("-savepath"); int index= _systemConfig.proTools.ProParams.IndexOf("-savepath");
// int index = _systemConfig.proTools.ProParams.IndexOf("-delay"); // int index = _systemConfig.proTools.ProParams.IndexOf("-delay");
string st= _systemConfig.proTools.ProParams.Substring(0, index); string str= _systemConfig.proTools.ProParams.Substring(0, index)+ "-savepath";
_systemConfig.proTools.ProParams = $"{_systemConfig.proTools.ProParams.Substring(0, index)}{ToolsModel.savepath} -delay {DelayTime * 60}"; _systemConfig.proTools.ProParams = $"{str} {ToolsModel.savepath} -delay {DelayTime * 60}";
JsonParser.WriteSystemConfigFile(JsonParser.systemConfigPath, _systemConfig); JsonParser.WriteSystemConfigFile(JsonParser.systemConfigPath, _systemConfig);

@ -51,12 +51,12 @@
<DockPanel VerticalAlignment="Center"> <DockPanel VerticalAlignment="Center">
<TextBlock Text="ttime2d:" Width="65" VerticalAlignment="Center"/> <TextBlock Text="ttime2d:" Width="65" VerticalAlignment="Center"/>
<Button Content="..." DockPanel.Dock="Right" Command="{Binding SelectFileCommand}" CommandParameter="apmsttime2d" Background="#FF0ABEFF"/> <Button Content="..." DockPanel.Dock="Right" Command="{Binding SelectFileCommand}" CommandParameter="apmsttime2d" Background="#FF0ABEFF"/>
<TextBox DockPanel.Dock="Left" Text="{Binding AModel.ttime[0].ttime2d}"/> <TextBox DockPanel.Dock="Left" Text="{Binding AModel.ttime[0].ttime2d}" IsReadOnly="True"/>
</DockPanel> </DockPanel>
<DockPanel VerticalAlignment="Center"> <DockPanel VerticalAlignment="Center">
<TextBlock Text="savepath:" Width="65" VerticalAlignment="Center"/> <TextBlock Text="savepath:" Width="65" VerticalAlignment="Center"/>
<Button Content="..." DockPanel.Dock="Right" Command="{Binding FilePathSaveCommand}" CommandParameter="apmssavepath" Background="#FF0ABEFF"/> <Button Content="..." DockPanel.Dock="Right" Command="{Binding FilePathSaveCommand}" CommandParameter="apmssavepath" Background="#FF0ABEFF"/>
<TextBox DockPanel.Dock="Left" Text="{Binding AModel.savepath}"/> <TextBox DockPanel.Dock="Left" Text="{Binding AModel.savepath}" IsReadOnly="True"/>
</DockPanel> </DockPanel>
<DockPanel VerticalAlignment="Center" > <DockPanel VerticalAlignment="Center" >
<TextBlock Text="微信通知:" Width="65" VerticalAlignment="Center"/> <TextBlock Text="微信通知:" Width="65" VerticalAlignment="Center"/>
@ -145,12 +145,12 @@
<DockPanel VerticalAlignment="Center"> <DockPanel VerticalAlignment="Center">
<TextBlock Text="ttime2d:" Width="65" VerticalAlignment="Center"/> <TextBlock Text="ttime2d:" Width="65" VerticalAlignment="Center"/>
<Button Content="..." DockPanel.Dock="Right" Command="{Binding SelectFileCommand}" CommandParameter="toolsttime2d" Background="#FF0ABEFF"/> <Button Content="..." DockPanel.Dock="Right" Command="{Binding SelectFileCommand}" CommandParameter="toolsttime2d" Background="#FF0ABEFF"/>
<TextBox DockPanel.Dock="Left" Text="{Binding ToolsModel.ttime[0].ttime2d}"/> <TextBox DockPanel.Dock="Left" Text="{Binding ToolsModel.ttime[0].ttime2d}" IsReadOnly="True"/>
</DockPanel> </DockPanel>
<DockPanel VerticalAlignment="Center"> <DockPanel VerticalAlignment="Center">
<TextBlock Text="savepath:" Width="65" VerticalAlignment="Center"/> <TextBlock Text="savepath:" Width="65" VerticalAlignment="Center"/>
<Button Content="..." DockPanel.Dock="Right" Command="{Binding FilePathSaveCommand}" CommandParameter="toolssavepath" Background="#FF0ABEFF"/> <Button Content="..." DockPanel.Dock="Right" Command="{Binding FilePathSaveCommand}" CommandParameter="toolssavepath" Background="#FF0ABEFF"/>
<TextBox DockPanel.Dock="Left" Text="{Binding ToolsModel.savepath}"/> <TextBox DockPanel.Dock="Left" Text="{Binding ToolsModel.savepath}" IsReadOnly="True"/>
</DockPanel> </DockPanel>
<DockPanel VerticalAlignment="Center" > <DockPanel VerticalAlignment="Center" >
<TextBlock Text="微信通知:" Width="65" VerticalAlignment="Center"/> <TextBlock Text="微信通知:" Width="65" VerticalAlignment="Center"/>

@ -53,26 +53,24 @@ namespace StartServerWPF.Modules.MseedChart
public ConcurrentQueue<ChartSamples> DataOrders { get; set; } = new ConcurrentQueue<ChartSamples>(); public ConcurrentQueue<ChartSamples> DataOrders { get; set; } = new ConcurrentQueue<ChartSamples>();
public void AddChartSam(Int64 freque,ChartSamples samples) public void AddChartSam(double freque,ChartSamples samples)
{ {
if (DataOrders.Count != 0) if (DataOrders.Count != 0)
{ {
ChartSamples chartLast = DataOrders.Last(); ChartSamples chartLast = DataOrders.Last();
var ts = samples.StartTime.Subtract(chartLast.StartTime).Duration(); var ts = samples.StartTime.Subtract(chartLast.StartTime).Duration();
// 时间差等于上一次收到数据 // 时间差等于上一次收到数据
double count = ts.TotalMilliseconds - chartLast.DataArray.Length; if (ts.TotalSeconds > 1)
if (count > 1)
{ {
System.Diagnostics.Debug.WriteLine($"填充均值数据总数:{count}********{samples.StartTime}, {chartLast.StartTime}时间差:{ts.TotalSeconds}秒, 频率:{freque}"); System.Diagnostics.Debug.WriteLine($"填充均值数据总数:{ts.TotalSeconds * freque}********{samples.StartTime}, {chartLast.StartTime}时间差:{ts.TotalSeconds}秒, 频率:{freque}");
var temp = DataOrders.Last(); var temp = DataOrders.Last();
var Average = temp.DataArray.Average(); var Average = temp.DataArray.Average();
DataOrders.Enqueue(new ChartSamples DataOrders.Enqueue(new ChartSamples
{ {
StartTime = samples.StartTime, StartTime = samples.StartTime,
DataArray = Enumerable.Repeat(Average, (int)ts.TotalMilliseconds).ToArray() DataArray = Enumerable.Repeat(Average, (int)(ts.TotalSeconds*freque)).ToArray()
}); });
} }
} }
DataOrders.Enqueue(samples); DataOrders.Enqueue(samples);

@ -69,7 +69,7 @@ namespace StartServerWPF.Modules.MseedChart.ViewModels
Dispatcher _dispatcher; Dispatcher _dispatcher;
public int CurPoints; public int CurPoints;
int _channelCount = 0; int _channelCount = 0;
int _samplingFrequency = 1000; // 采样频率 (Hz). int _samplingFrequency = 500; // 采样频率 (Hz).
WavesModel _wavesModel; WavesModel _wavesModel;
private int _lChartCount = 1; private int _lChartCount = 1;
public ConcurrentQueue<StationModel> smList=new ConcurrentQueue<StationModel>(); public ConcurrentQueue<StationModel> smList=new ConcurrentQueue<StationModel>();
@ -302,14 +302,6 @@ namespace StartServerWPF.Modules.MseedChart.ViewModels
YasixZENVisible(".E", SHEChannel); YasixZENVisible(".E", SHEChannel);
YasixZENVisible(".N", SHNChannel); YasixZENVisible(".N", SHNChannel);
_lChartAll.EndUpdate(); _lChartAll.EndUpdate();
//if (index * 30 < 800)
//{
// ChartHeight = 800;
//}
//else
//{
// ChartHeight = index * 50;
//}
} }
} }
@ -503,15 +495,15 @@ namespace StartServerWPF.Modules.MseedChart.ViewModels
IsEnableStartRealtime = false; IsEnableStartRealtime = false;
IsEnableStopRealtime = true; IsEnableStopRealtime = true;
_data = new double[smList.Count * 3][]; _data = new double[smList.Count * 3][];
beginTime = DateTime.Now.AddSeconds(-0.5); beginTime = DateTime.Now.AddSeconds(-30.5);
currentTime = beginTime; currentTime = beginTime;
if (AxisValueType.DateTime == LChartALL.ViewXY.XAxes[0].ValueType) if (AxisValueType.DateTime == LChartALL.ViewXY.XAxes[0].ValueType)
{ {
DateTime MaxDateTime = currentTime.AddSeconds(_samplingFrequency == 1000 ? 30 : 60); DateTime MaxDateTime = currentTime.AddSeconds(30);
LChartALL.ViewXY.XAxes[0].SetRange(LChartALL.ViewXY.XAxes[0].DateTimeToAxisValue(currentTime), LChartALL.ViewXY.XAxes[0].DateTimeToAxisValue(MaxDateTime)); LChartALL.ViewXY.XAxes[0].SetRange(LChartALL.ViewXY.XAxes[0].DateTimeToAxisValue(currentTime), LChartALL.ViewXY.XAxes[0].DateTimeToAxisValue(MaxDateTime));
} }
LChartALL.ViewXY.DropOldSeriesData = true; LChartALL.ViewXY.DropOldSeriesData = true;
//Set real-time monitoring automatic old data destruction
_pointsAppended = LChartALL.ViewXY.XAxes[0].Minimum; _pointsAppended = LChartALL.ViewXY.XAxes[0].Minimum;
_lChartAll.ViewXY.XAxes[0].ScrollPosition = _pointsAppended; _lChartAll.ViewXY.XAxes[0].ScrollPosition = _pointsAppended;
@ -573,8 +565,8 @@ namespace StartServerWPF.Modules.MseedChart.ViewModels
string[] sid = asciiData.sid.Substring(5).Split('_'); string[] sid = asciiData.sid.Substring(5).Split('_');
string name = $"{sid[0]}.{sid[1]}.{sid[2]}.{sid[3]}{sid[4]}{sid[5]}"; string name = $"{sid[0]}.{sid[1]}.{sid[2]}.{sid[3]}{sid[4]}{sid[5]}";
var ts = DateTime.Now.Subtract(startTime); var ts = DateTime.Now.Subtract(startTime);
//System.Diagnostics.Debug.WriteLine($"台站号:{name},总数:{asciiData.samprate},{asciiData.datasize},{asciiData.samplecnt}, {asciiData.numsamples},当前时间:{DateTime.Now.ToString("o")},接时间:{startTime.ToString("o")}********时间差:{ts.TotalSeconds}秒"); System.Diagnostics.Debug.WriteLine($"台站号:{name},总数:{asciiData.samprate},{asciiData.datasize},{asciiData.samplecnt}, {asciiData.numsamples},当前时间:{DateTime.Now.ToString("o")},接时间:{startTime.ToString("o")}********时间差:{ts.TotalSeconds}秒");
if ( ts.TotalSeconds > 10) if ( ts.TotalSeconds > 20)
{ {
return; return;
} }
@ -612,7 +604,7 @@ namespace StartServerWPF.Modules.MseedChart.ViewModels
while (true) while (true)
{ {
var flag = subNameList[name].DataOrders.TryPeek(out ChartSamples dataOrder); var flag = subNameList[name].DataOrders.TryPeek(out ChartSamples dataOrder);
if (flag && DateTime.Now.Subtract(dataOrder.StartTime).TotalSeconds > 35) if (flag && DateTime.Now.Subtract(dataOrder.StartTime).TotalSeconds > 60)
{ {
//删除过期数据 //删除过期数据
subNameList[name].DataOrders.TryDequeue(out ChartSamples chart); subNameList[name].DataOrders.TryDequeue(out ChartSamples chart);
@ -722,11 +714,8 @@ namespace StartServerWPF.Modules.MseedChart.ViewModels
//设置X轴的开始时间 //设置X轴的开始时间
v.XAxes[0].AutoFormatLabels = false; v.XAxes[0].AutoFormatLabels = false;
v.XAxes[0].LabelsTimeFormat = "HH:mm:ss.f"; v.XAxes[0].LabelsTimeFormat = "HH:mm:ss.f";
// v.XAxes[0].DateOriginYear = beginTime.Year; // DateTime MaxDateTime = beginTime.AddSeconds(30);
// v.XAxes[0].DateOriginDay = beginTime.Day; //v.XAxes[0].SetRange(v.XAxes[0].DateTimeToAxisValue(beginTime), v.XAxes[0].DateTimeToAxisValue(MaxDateTime));
// v.XAxes[0].DateOriginMonth = beginTime.Month;
DateTime MaxDateTime = beginTime.AddSeconds(_samplingFrequency == 1000? 30 : 60);
v.XAxes[0].SetRange(v.XAxes[0].DateTimeToAxisValue(beginTime), v.XAxes[0].DateTimeToAxisValue(MaxDateTime));
} }
double firstSampleTimeStamp = v.XAxes[0].DateTimeToAxisValue(beginTime); double firstSampleTimeStamp = v.XAxes[0].DateTimeToAxisValue(beginTime);
@ -774,7 +763,7 @@ namespace StartServerWPF.Modules.MseedChart.ViewModels
series.SampleFormat = SampleFormat.DoubleFloat; series.SampleFormat = SampleFormat.DoubleFloat;
string subName = string.Empty; string subName = string.Empty;
string name = axisY.Title.Text.Substring(0,4); string name = axisY.Title.Text.Substring(0,3);
if (seriesIndex % 3 == 0) if (seriesIndex % 3 == 0)
{ {
subName = $"{workarea.StationConfig.Network}.{name}.{workarea.StationConfig.Location}." + subName = $"{workarea.StationConfig.Network}.{name}.{workarea.StationConfig.Location}." +
@ -935,25 +924,20 @@ namespace StartServerWPF.Modules.MseedChart.ViewModels
; foreach (var item in subNameList) ; foreach (var item in subNameList)
{ {
List<double> temDou = new List<double>(); List<double> temDou = new List<double>();
var tem = item.Value.DataOrders.Where(d => d.StartTime > currentTime.AddSeconds(-30)); var tem = item.Value.DataOrders.Where(d => d.StartTime > currentTime.AddSeconds(-30) && d.StartTime < currentTime.AddSeconds(0.5));
if (tem.Any()) if (tem.Any())
{ {
item.Value.FirstSampleTime = tem.ElementAt(0).StartTime; //设置数据的开始时间 item.Value.FirstSampleTime = tem.ElementAt(0).StartTime; //设置数据的开始时间
tem.ToList().ForEach(d => temDou.AddRange(d.DataArray)); tem.ToList().ForEach(d => temDou.AddRange(d.DataArray));
var time = (currentTime - tem.Last().StartTime).Duration();
if (time.TotalSeconds > 2 && time.TotalSeconds < 30)
{
//中途未收数据填充均值
temDou.AddRange(Enumerable.Repeat(temDou.Average(), (int)time.TotalMilliseconds));
}
_data[item.Value.Index] = temDou.ToArray(); _data[item.Value.Index] = temDou.ToArray();
} }
else else
{ {
//没有收到数据的通道填充0 //没有收到数据的通道填充0
var duration = (DateTime.Now - beginTime).Duration(); var duration = (currentTime - beginTime.AddSeconds(-1)).Duration();
item.Value.FirstSampleTime = duration.TotalSeconds > 30 ? currentTime.AddSeconds(-29) : beginTime; item.Value.FirstSampleTime = duration.TotalSeconds > 30 ? currentTime.AddSeconds(-29) : beginTime;
int feed = duration.TotalSeconds > 30 ? 30 * 1000 : (int)duration.TotalMilliseconds; int feed = duration.TotalSeconds > 30 ? 30 * _samplingFrequency : (int)duration.TotalSeconds* _samplingFrequency;
_data[item.Value.Index] = new double[feed]; _data[item.Value.Index] = new double[feed];
} }
} }
@ -988,8 +972,7 @@ namespace StartServerWPF.Modules.MseedChart.ViewModels
var d = _lChartAll.ViewXY.XAxes[0].DateTimeToAxisValue(item.Value.FirstSampleTime); var d = _lChartAll.ViewXY.XAxes[0].DateTimeToAxisValue(item.Value.FirstSampleTime);
_lChartAll.ViewXY.SampleDataSeries[index].FirstSampleTimeStamp = d;// _lChartAll.ViewXY.XAxes[0].Minimum;// item.Value.FirstSampleTimeStamp; _lChartAll.ViewXY.SampleDataSeries[index].FirstSampleTimeStamp = d;// _lChartAll.ViewXY.XAxes[0].Minimum;// item.Value.FirstSampleTimeStamp;
} }
//Append data to series Parallel.For(0, _channelCount, (seriesIndex) =>
System.Threading.Tasks.Parallel.For(0, _channelCount, (seriesIndex) =>
{ {
double[] thisSeriesData = _data[seriesIndex]; double[] thisSeriesData = _data[seriesIndex];
@ -1004,137 +987,12 @@ namespace StartServerWPF.Modules.MseedChart.ViewModels
}); });
_pointsAppended += 1; _pointsAppended += 1;
//Set X axis real-time scrolling position
double lastX = _pointsAppended * XInterval; double lastX = _pointsAppended * XInterval;
_lChartAll.ViewXY.XAxes[0].ScrollPosition = lastX; _lChartAll.ViewXY.XAxes[0].ScrollPosition = lastX;
_lChartAll.EndUpdate(); _lChartAll.EndUpdate();
} }
//Append data point per round count
private int _appendCountPerRound=30000;
//X axis length
private double _xLen;
//Generate this many rounds of data
private const int PreGenerateDataForRoundCount = 10;
//X data point step
private const double XInterval = 1; private const double XInterval = 1;
//Data feeding round
private int _iRound = 0;
//Y axis minimum
private const double YMin = 0;
//Y axis maximum
private const double YMax = 100;
private double[][] CreateInputData(int seriesCount, int appendCountPerRound)
{
//Create input data for all series.
double[][] data = new double[seriesCount][];
// System.Threading.Tasks.Parallel.For(0, seriesCount, (seriesIndex) =>
for (int seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++)
{
int dataPointCount = PreGenerateDataForRoundCount * appendCountPerRound;
double[] seriesData = new double[dataPointCount];
float seriesIndexPlus1 = seriesIndex + 1;
Random rand = new Random((int)DateTime.Now.Ticks / (seriesIndex + 1));
double y = 50;
for (int i = 0; i < dataPointCount; i++)
{
y = y - 0.05 + rand.NextDouble() / 10.0;
if (y > YMax)
{
y = YMax;
}
if (y < YMin)
{
y = YMin;
}
seriesData[i] = (float)y;
}
data[seriesIndex] = seriesData;
}//);
return data;
}
private void PrefillChartWithData()
{
/* test
_lChartAll.BeginUpdate();
_data = CreateInputData(smList.Count * 3, _appendCountPerRound);
LChartALL.ViewXY.DropOldSeriesData = true;
_pointsAppended = LChartALL.ViewXY.XAxes[0].Minimum;
time.Elapsed -= CompositionTarget_Rendering;
time.Elapsed += CompositionTarget_Rendering;
LChartALL.ViewXY.XAxes[0].ScrollMode = XAxisScrollMode.Scrolling;
LChartALL.ViewXY.AxisLayout.AutoShrinkSegmentsGap = true;
_lChartAll.EndUpdate();
time.Start();*/
//Set data almost till the end,
//so it will reach end and start scrolling quite soon.
//How many rounds to prefill in the series
int roundsToPrefill = 50;// (int)(0.9 * _xLen) / _appendCountPerRound;
//How many points to prefill in the series
int pointCount = roundsToPrefill * _appendCountPerRound;
System.Threading.Tasks.Parallel.For(0, _channelCount, (seriesIndex) =>
{
double[] thisSeriesData = _data[seriesIndex];
for (int round = 0; round < roundsToPrefill; round++)
{
float[] dataArray = new float[_appendCountPerRound];
Array.Copy(thisSeriesData, (round % PreGenerateDataForRoundCount) * _appendCountPerRound, dataArray, 0, _appendCountPerRound);
_lChartAll.ViewXY.SampleDataBlockSeries[seriesIndex].AddSamples(dataArray, false);
}
});
_pointsAppended += pointCount;
_iRound += roundsToPrefill;
//Set X axis real-time scrolling position
double lastX = _pointsAppended * XInterval;
_lChartAll.ViewXY.XAxes[0].ScrollPosition = lastX;
}
private void FeedDataTest(/*string chartTitleText*/)
{
if (_lChartAll != null)
{
_lChartAll.BeginUpdate();
foreach (var item in _lChartAll.ViewXY.SampleDataSeries)
{
item.Clear();
item.FirstSampleTimeStamp = _lChartAll.ViewXY.XAxes[0].Minimum;
}
//Append data to series
System.Threading.Tasks.Parallel.For(0, _channelCount, (seriesIndex) =>
{
double[] thisSeriesData = _data[seriesIndex];
double[] dataToAppendNow = new double[_appendCountPerRound];
Array.Copy(thisSeriesData, (_iRound % PreGenerateDataForRoundCount) * _appendCountPerRound, dataToAppendNow, 0, _appendCountPerRound);
_lChartAll.ViewXY.YAxes[seriesIndex].SetRange(dataToAppendNow.Min(), dataToAppendNow.Max());
_lChartAll.ViewXY.SampleDataSeries[seriesIndex].AddSamples(dataToAppendNow, false);
System.Diagnostics.Debug.WriteLine("***********index:{0}, pointCount:{1}", seriesIndex,
_lChartAll.ViewXY.SampleDataSeries[seriesIndex].PointCount);
});
_pointsAppended += 1;//;_appendCountPerRound;
//Set X axis real-time scrolling position
double lastX = _pointsAppended * XInterval;
_lChartAll.ViewXY.XAxes[0].ScrollPosition = lastX;
_lChartAll.EndUpdate();
_iRound++;
}
}
private DateTime GetTime() private DateTime GetTime()
{ {

@ -52,7 +52,7 @@
"ProName": "gw.tools", "ProName": "gw.tools",
"ProTitle": "后处理", "ProTitle": "后处理",
"ProPath": "serverprogram\\tools\\", "ProPath": "serverprogram\\tools\\",
"ProParams": "-cfg apms.json -savepath e:\\yuwuN3102mseed -delay 600", "ProParams": "-cfg apms.json -savepath I:\\yuwuN3102mseed -delay 600",
"JsonPath": "apms.json", "JsonPath": "apms.json",
"Pid": 0, "Pid": 0,
"OperationStr": "open", "OperationStr": "open",

@ -2,6 +2,7 @@
using Prism.Ioc; using Prism.Ioc;
using Prism.Mvvm; using Prism.Mvvm;
using StartServerWPF.Assets; using StartServerWPF.Assets;
using StartServerWPF.Models;
using StartServerWPF.Modules.Main.Models; using StartServerWPF.Modules.Main.Models;
using StartServerWPF.Modules.Main.ViewModels; using StartServerWPF.Modules.Main.ViewModels;
using System; using System;
@ -32,7 +33,7 @@ namespace StartServerWPF.ViewModels
State = "程序退出", State = "程序退出",
OriginTime = DateTime.Now, OriginTime = DateTime.Now,
}; };
LogHelper.WriteSerLog(main._systemConfig.vpnInfo.SystemLogPath, log.ToString()); LogHelper.WriteSerLog(_containerProvider.Resolve<SystemConfigModel>().vpnInfo.SystemLogPath, log.ToString());
main.OneKeyStop(); main.OneKeyStop();
Application.Current.Shutdown(); Application.Current.Shutdown();

@ -1,6 +1,6 @@
{ {
"StationConfig": { "StationConfig": {
"Network": "YA", "Network": "HA",
"Location": "06", "Location": "06",
"Channels": [ "SHZ", "SHN", "SHE" ], "Channels": [ "SHZ", "SHN", "SHE" ],
"StationCoordCsvPath": "N3102_staion_20230403.csv" "StationCoordCsvPath": "N3102_staion_20230403.csv"

@ -8,3 +8,18 @@ HA,N07,38397699.97,4030514.93,1091.6,3.20E+09,2023-03-12T00:00:00.000,2023-12-21
HA,N08,38398079.1,4030542.79,1019,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 HA,N08,38398079.1,4030542.79,1019,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N09,38396697.57,4030703.24,1053,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 HA,N09,38396697.57,4030703.24,1053,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N10,38397284.87,4029883.38,1028,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 HA,N10,38397284.87,4029883.38,1028,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N11,38397556.54,4030474.46,1092,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N12,38397781.42,4030319.64,1089.2,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N13,38397278.9,4030358.92,1050,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N14,38396943.47,4030453.01,1055,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N15,38396715.18,4030230.58,1030,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N16,38397420.7,4030035.82,1033,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N17,38397876.31,4030039.78,1133.3,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N18,38398199.8,4030163.99,1031,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N19,38397094.27,4030709.07,1076,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N20,38397529.8,4029760.44,1057.9,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N22,38398196.3,4029830.94,1056.3,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N23,38398363.7,4030000.55,1066.7,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N24,38397820.92,4029713.54,1056.5,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N26,38397120.98,4029641.15,1006,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N27,38397672.11,4031001.47,1068.1,3.20E+09,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000

1 net sta x2000 y2000 z2000 sens begin stop
8 HA N08 38398079.1 4030542.79 1019 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
9 HA N09 38396697.57 4030703.24 1053 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
10 HA N10 38397284.87 4029883.38 1028 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
11 HA N11 38397556.54 4030474.46 1092 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
12 HA N12 38397781.42 4030319.64 1089.2 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
13 HA N13 38397278.9 4030358.92 1050 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
14 HA N14 38396943.47 4030453.01 1055 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
15 HA N15 38396715.18 4030230.58 1030 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
16 HA N16 38397420.7 4030035.82 1033 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
17 HA N17 38397876.31 4030039.78 1133.3 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
18 HA N18 38398199.8 4030163.99 1031 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
19 HA N19 38397094.27 4030709.07 1076 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
20 HA N20 38397529.8 4029760.44 1057.9 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
21 HA N22 38398196.3 4029830.94 1056.3 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
22 HA N23 38398363.7 4030000.55 1066.7 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
23 HA N24 38397820.92 4029713.54 1056.5 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
24 HA N26 38397120.98 4029641.15 1006 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000
25 HA N27 38397672.11 4031001.47 1068.1 3.20E+09 2023-03-12T00:00:00.000 2023-12-21T23:59:59.000

@ -3,16 +3,16 @@
"ttime":[{"station":"ttime","ttime2d":"ttime_gw20210427.tab"}], "ttime":[{"station":"ttime","ttime2d":"ttime_gw20210427.tab"}],
"Main.log_level":"DEBUG", "Main.log_level":"DEBUG",
"Main.slice_seconds": 20 , "Main.slice_seconds": 30 ,
"Main.overlap_seconds": 5 , "Main.overlap_seconds": 10 ,
"Main.is_mag":"YES", "Main.is_mag":"YES",
"Main.is_write_slice":"NO", "Main.is_write_slice":"NO",
"Main.lon":38398463.49, "Main.lon":38398463.49,
"Main.lat":4031112.103, "Main.lat":4031112.103,
"Main.height":1102.63, "Main.height":1102.63,
"Main.savepath":"I://YuwuN3102Mseed//", "Main.savepath":"i://YuwuN3102mseed//",
"Main.push2wx":"NO", "Main.push2wx":"NO",
"Main.push_url":"https://www.txgy.xyz/api/index/push", "Main.push_url":"http://www.txgy.cloud/api/index/push",
"Main.push_mag":-1.0, "Main.push_mag":-1.0,
"Main.message_id":1, "Main.message_id":1,
"Main.company_id":1, "Main.company_id":1,
@ -22,7 +22,7 @@
"RServer.host":"127.0.0.1", "RServer.host":"127.0.0.1",
"channels":[ "channels":[
{"network":"HA","station":"N02,N05,N06,N08,N09,N10,N11,N12,N13,N14,N15,N16,N19,N20,N22,N23,N24,N25,N26","location":"06","channels":"SHZ:SHN:SHE"} {"network":"HA","station":"N02,N03,N04,N05,N06,N07,N08,N09,N10,N11,N12,N13,N14,N15,N16,N17,N18,N19,N20,N21,N22,N23,N25,N26,N27","location":"06","channels":"SHZ:SHN:SHE"}
], ],
@ -38,4 +38,5 @@
"Locate.minstep":10, "Locate.minstep":10,
"Locate.method":"", "Locate.method":"",
"Locate.clusted_otime":0.5 "Locate.clusted_otime":0.5
} }

@ -0,0 +1 @@
start /min gw.apms.exe -cfg apms.json >out.txt

@ -1,8 +1,8 @@
{ {
"savepath" : "I:\\yuwuN3102mseed\\", "savepath" : "I:/DATA",
"log_level":"DEBUG", "log_level":"DEBUG",
"send2server":"YES", "send2server":"YES",
"pack_time":12, "pack_time":12,
"stamseed":"2,5,6,8,9,10,11,12,13,14,15,16,19,20,22,23,24,25,26", "stamseed":"2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,26,27",
"dirstruct": "NDHH" "dirstruct": "NDHH"
} }

Loading…
Cancel
Save