From 385c645823df71f288e5b96e08a76f47b8fa0768 Mon Sep 17 00:00:00 2001 From: mzhifa Date: Tue, 4 Apr 2023 00:18:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE=E8=AF=BB?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mseedChart.MainModule/Models/ChannelModel.cs | 32 - mseedChart.MainModule/Models/ShareProperty.cs | 19 - mseedChart.MainModule/Models/StationModel.cs | 6 + .../Models/StationWorkModel.cs | 212 ------ mseedChart.MainModule/Models/WavesModel.cs | 482 +++++------- mseedChart.MainModule/RegionNames.cs | 4 +- .../ViewModels/ChartPlotViewModel.cs | 688 +++++++----------- .../Views/ChartPlotView.xaml | 13 +- .../mseedChart.MainModule.csproj | 34 +- mseedChart.MainModule/packages.config | 1 + mseedChart/mseedChart.csproj | 4 +- .../resources/N3102_staion_20230312.txt | 25 - 12 files changed, 472 insertions(+), 1048 deletions(-) delete mode 100644 mseedChart.MainModule/Models/ChannelModel.cs delete mode 100644 mseedChart.MainModule/Models/ShareProperty.cs delete mode 100644 mseedChart.MainModule/Models/StationWorkModel.cs delete mode 100644 mseedChart/resources/N3102_staion_20230312.txt diff --git a/mseedChart.MainModule/Models/ChannelModel.cs b/mseedChart.MainModule/Models/ChannelModel.cs deleted file mode 100644 index 933ac8b..0000000 --- a/mseedChart.MainModule/Models/ChannelModel.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace mseedChart.MainModule.Models -{ - public class ChannelModel - { - public string Name { get; set; } - - public double[] datas { get; set; } - - public void ReadDataFromTxt(string fn, int channelIndex) - { - datas = new double[30000]; - string allline; - - using (StreamReader streamReader = new StreamReader(fn)) - { - allline = streamReader.ReadToEnd(); - } - string[] strs = allline.Split(new char[] { '\n' }); - for (int i = 0; i < datas.Length; i++) - { - datas[i] = double.Parse(strs[channelIndex * 30001 + i + 1]); - } - } - } -} diff --git a/mseedChart.MainModule/Models/ShareProperty.cs b/mseedChart.MainModule/Models/ShareProperty.cs deleted file mode 100644 index e539431..0000000 --- a/mseedChart.MainModule/Models/ShareProperty.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace mseedChart.MainModule.Models -{ - public class ShareProperty - { - public ShareProperty(int id, string name) - { - this.ID = id; - this.Name = name; - } - public int ID { get; set; } - public string Name { get; set; } - } -} diff --git a/mseedChart.MainModule/Models/StationModel.cs b/mseedChart.MainModule/Models/StationModel.cs index bcd74d4..61c3e55 100644 --- a/mseedChart.MainModule/Models/StationModel.cs +++ b/mseedChart.MainModule/Models/StationModel.cs @@ -9,6 +9,11 @@ namespace mseedChart.MainModule.Models { public class StationModel { + + public StationModel() + { + + } public double E; public double N; @@ -25,6 +30,7 @@ namespace mseedChart.MainModule.Models public bool IsVisible = true; + public Dictionary> dzne = new Dictionary>(); public List dz = new List(); public List dn = new List(); diff --git a/mseedChart.MainModule/Models/StationWorkModel.cs b/mseedChart.MainModule/Models/StationWorkModel.cs deleted file mode 100644 index f09e590..0000000 --- a/mseedChart.MainModule/Models/StationWorkModel.cs +++ /dev/null @@ -1,212 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - - -namespace mseedChart.MainModule.Models -{ - public class StationWorkModel - { - public static object _lock = new object(); - - public int Sampling { get; set; } - public int StationCnt { get; set; } - /// - /// 任务总数 - /// - public int TaskCnt { get; set; } - - public string[] files { get; set; } - public List Stations { get; set; } - /// - /// 单文件长度(个) - /// - public int SingleFileLength = 30000; - - - public void InitWork() - { - Stations = new List(); - TaskCnt = StationCnt = files.Length; - for (int i = 0; i < StationCnt; i++) - { - string fn = Path.GetFileNameWithoutExtension(files[i]).Substring(3, 3); - StationModel sm = new StationModel(); - sm.Name = fn; - sm.FilePath = files[i]; - Stations.Add(sm); - } - } - public void StartWriter() - { - Task[] tasks = new Task[TaskCnt]; - for (int i = 0; i < TaskCnt; i++) - { - int num = i; - //Func func = (s, ri) => - // Writer(ri); - //func.b - Func func = WriteChannelZ; - AsyncCallback asyncCallback = ar => - { - ChannelModel cm = func.EndInvoke(ar); - //Stopwatch stopWatch = new Stopwatch(); - //stopWatch.Start();//开始或继续测量某个时间间隔的运行时间 - lock (_lock) - { - for (int k = 0; k < SingleFileLength; k++) - { - int nk = k; - Stations[num].cz.Enqueue(cm.datas[nk]); - } - } - //stopWatch.Stop();//停止测量某个时间间隔的运行时间。 - //TimeSpan ts = stopWatch.Elapsed; - //Console.WriteLine("读取耗时:{0}ms",ts.TotalMilliseconds); - }; - func.BeginInvoke(Stations[num], asyncCallback, null); - //ChannelModel cm = func.EndInvoke(func.BeginInvoke(Stations[i],null,null)); - - //AsyncCallback asyncCallback = ar => - //{ - // ChannelModel cm = (ChannelModel)ar.AsyncState; - // if (cm != null) - // { - // Stopwatch stopWatch = new Stopwatch(); - // stopWatch.Start();//开始或继续测量某个时间间隔的运行时间 - // lock (_lock) - // { - // for (int k = 0; k < SingleFileLength; k++) - // { - // Stations[i].cz.Enqueue(cm.datas[k]); - // } - // } - // stopWatch.Stop();//停止测量某个时间间隔的运行时间。 - // TimeSpan ts = stopWatch.Elapsed; - // Console.WriteLine(ts.TotalMilliseconds); - // } - //}; - //func.BeginInvoke(Stations[i], asyncCallback, null); - - - //tasks[num] = Task.Run(() => - //{ Writer(Stations[num]); }); - - //Action - - } - // Task.WaitAll(tasks); - //Thread.Sleep(100); - - } - - public void StartReader() - { - //Task[] tasks2 = new Task[TaskCnt]; - //for (int i = 0; i < TaskCnt; i++) - //{ - // int num = i; - // tasks2[num] = Task.Run(() => - // { Reader(Stations[num]); }); - //} - } - public ChannelModel WriteChannelZ(StationModel sm) - { - ChannelModel cm = new ChannelModel(); - cm.Name = sm.Name; - cm.datas = new double[SingleFileLength]; - string al = new StreamReader(sm.FilePath).ReadToEnd(); - string[] als = al.Split(new char[] { '\n' }); - for (int k = 0; k < SingleFileLength; k++) - { - int num = k; - double value = (double.TryParse(als[num + 1], out double zz) ? zz : 0); - if (value < 30000) - { - cm.datas[num] = 32400; - continue; - } - - //Console.WriteLine(value); - cm.datas[k] = (value); - - } - return cm; - } - public void Writer(StationModel sm) - { - //while (true) - List data = new List(); - //{ - if (sm.cz.IsEmpty) - { - //Stopwatch stopWatch = new Stopwatch(); - //stopWatch.Start();//开始或继续测量某个时间间隔的运行时间 - string al = new StreamReader(sm.FilePath).ReadToEnd(); - string[] als = al.Split(new char[] { '\n' }); - - lock (_lock) - { - for (int k = 0; k < SingleFileLength; k++) - { - int num = k; - int value = (int)(int.TryParse(als[num + 1], out int zz) ? zz : sm.cz.Average()); - if (value < 30000) - Console.WriteLine(value); - sm.cz.Enqueue(value); - } - for (int k = 0; k < SingleFileLength; k++) - { - int num = k; - int value = (int)(int.TryParse(als[num + 30003], out int ee) ? ee : sm.ce.Average()); - sm.ce.Enqueue(value); - } - for (int k = 0; k < SingleFileLength; k++) - { - int num = k; - int value = (int)(int.TryParse(als[num + 60004], out int nn) ? nn : sm.cn.Average()); - sm.cn.Enqueue(value); - } - //Stopwatch stopWatch = new Stopwatch(); - //stopWatch.Start();//开始或继续测量某个时间间隔的运行时间 - //data.AddRange(sm.cz.ToList()); - //stopWatch.Stop();//停止测量某个时间间隔的运行时间。 - //TimeSpan ts = stopWatch.Elapsed; - //Console.WriteLine(ts.TotalMilliseconds); - // Get the elapsed time as a TimeSpan value. - //TimeSpan ts = stopWatch.Elapsed; //获取当前实例测量得出的总运行时间。 - //Console.WriteLine($"{dp.station}.{dp.channel}\t生产出:{dp.cz.Count}\t耗时:{ts.TotalMilliseconds}"); - //Console.WriteLine($"{dp.station}.{dp.channel}\t生产出:{dp.ce.Count}\t耗时:{ts.TotalMilliseconds}"); - //Console.WriteLine($"{dp.station}.{dp.channel}\t生产出:{dp.cn.Count}\t耗时:{ts.TotalMilliseconds}"); - } - } - Thread.Sleep(1); - //} - } - - public double[] Reader(StationModel sm, int cnt) - { - double[] js = new double[cnt]; - - //while (true) - //{ - //int ri = 0; - List cz = new List(); - List ce = new List(); - List cn = new List(); - lock (_lock) - { - for (int i = 0; i < js.Length; i++) - { - int index = i; - sm.cz.TryDequeue(out js[index]); - } - } - return js; - } - } -} diff --git a/mseedChart.MainModule/Models/WavesModel.cs b/mseedChart.MainModule/Models/WavesModel.cs index aa3d0ab..42f7ea4 100644 --- a/mseedChart.MainModule/Models/WavesModel.cs +++ b/mseedChart.MainModule/Models/WavesModel.cs @@ -1,40 +1,23 @@ -using Arction.Wpf.ChartingMVVM.Axes; -using Arction.Wpf.ChartingMVVM.SeriesXY; -using Arction.Wpf.ChartingMVVM; +using Arction.Wpf.Charting; +using Arction.Wpf.Charting.Axes; +using Arction.Wpf.Charting.SeriesXY; +using Arction.Wpf.Charting.Views.ViewXY; +using mseedChart.Core; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; +using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media; namespace mseedChart.MainModule.Models { public class WavesModel { - // Constants - double YMin = 30000; // Minimal y-value. - double YMax = 35000; // Maximal y-value. - public AxisX GetAxisX(int XMax) + public List CreateYAxisChart(List stationModels, LightningChart curChart) { - AxisX axisX = new AxisX(); - axisX.ScrollPosition = 0; - axisX.ScrollMode = XAxisScrollMode.Stepping; - axisX.Maximum = XMax; - axisX.SweepingGap = 1; - //axisX.AxisColor = Colors.Blue; - //axisX.LabelsColor = Colors.Black; - //axisX.GridStripColor = Colors.Black; - //axisX. - axisX.Title.Visible = false; - return axisX; - } - public List CreateYAxisPingPu(List stationModels, LightningChart curChart) - { - List axisYList = new List(); - + List axisYList = new List(); foreach (var item in stationModels) { AxisY axisYZ = new AxisY(curChart.ViewXY); @@ -43,13 +26,7 @@ namespace mseedChart.MainModule.Models { axisYZ.SetRange(item.dz.Min(), item.dz.Max()); } - axisYZ.AllowAutoYFit = false; - axisYZ.Title.Font = new WpfFont("Segoe UI", 10, false, false); axisYZ.Title.Text = string.Format("Ch{0}.Z", item.Name); - axisYZ.Title.Angle = 0; - //axisYZ.Title.Color = Colors.Black; - //axisYZ.Title. - axisYZ.Units.Visible = false; axisYList.Add(axisYZ); //添加N分量波形 @@ -58,36 +35,26 @@ namespace mseedChart.MainModule.Models { axisYN.SetRange(item.dn.Min(), item.dn.Max()); } - axisYN.Title.Font = new WpfFont("Segoe UI", 10, false, false); axisYN.Title.Text = string.Format("Ch{0}.N", item.Name); - axisYN.Title.Angle = 0; - //axisYN.Title.Color = Colors.Black; - axisYN.Units.Visible = false; axisYList.Add(axisYN); //添加E分量波形 AxisY axisYE = new AxisY(curChart.ViewXY); if (item.de.Count > 0) - { - - axisYE.SetRange(item.de.Min(), item.de.Max()); - - } - axisYE.Title.Font = new WpfFont("Segoe UI", 10, false, false); + { + axisYE.SetRange(item.de.Min(), item.de.Max()); + } axisYE.Title.Text = string.Format("Ch{0}.E", item.Name); - axisYE.Title.Angle = 0; - //axisYE.Title.Color = Colors.Black; - axisYE.Units.Visible = false; axisYList.Add(axisYE); - } + } return axisYList; } - public List GetSampleDataSeriesPingPu(List stationModels, LightningChart curChart, AxisX xAxes, AxisYCollection axisY, double samplingFrequency) + public List GetSampleDataSeriesPingPu(List stationModels, LightningChart curChart, AxisX xAxes, List axisY, double samplingFrequency) { List sampleList = new List(); - for (int i = 0; i < stationModels.Count; i++) + for (int i = 0; i < stationModels.Count; i++) { //Bug,在波形数据少于台站数量时,出现错误 if (i < axisY.Count) @@ -96,6 +63,8 @@ namespace mseedChart.MainModule.Models } //Z SampleDataSeries seriesZ = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3]); + seriesZ.ShowInLegendBox = true; + seriesZ.Title.Text = axisY[i * 3].Title.Text; seriesZ.SampleFormat = SampleFormat.DoubleFloat; //series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; @@ -113,15 +82,17 @@ namespace mseedChart.MainModule.Models System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(seriesZ.LineStyle.Color, System.Windows.Media.Colors.Gray, 50); System.Windows.Media.Color colorCenter = seriesZ.LineStyle.Color; - seriesZ.ValueRangePalette.Steps.Clear(); //Remove existing palette steps - seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, -100)); - seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorCenter, 0)); - seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, 100)); + //seriesZ.ValueRangePalette.Steps.Clear(); //Remove existing palette steps + //seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, -100)); + //seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorCenter, 0)); + //seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, 100)); sampleList.Add(seriesZ); //E SampleDataSeries seriesE = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3 + 1]); + seriesE.ShowInLegendBox = true; + seriesE.Title.Text = axisY[i * 3+1].Title.Text; seriesE.SampleFormat = SampleFormat.DoubleFloat; //series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; @@ -148,6 +119,8 @@ namespace mseedChart.MainModule.Models //N SampleDataSeries seriesN = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3 + 2]); + seriesN.ShowInLegendBox = true; + seriesN.Title.Text = axisY[i * 3 + 2].Title.Text; seriesN.SampleFormat = SampleFormat.DoubleFloat; //series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; @@ -175,271 +148,166 @@ namespace mseedChart.MainModule.Models return sampleList; } - public List CreateYAxisPingPu(Dictionary sms, LightningChart curChart) - //public List CreateYAxisPingPu(int StationCount, LightningChart curChart) - { - List axisYList = new List(); - - foreach (var item in sms.Keys) - { - //add Z - AxisY axisYZ = new AxisY(curChart.ViewXY); - axisYZ.SetRange(YMin, YMax); - axisYZ.AllowAutoYFit = false; - axisYZ.Title.Font = new WpfFont("Segoe UI", 10, false, false); - axisYZ.Title.Text = string.Format("Ch{0}.Z", item); - axisYZ.Title.Angle = 0; - //axisYZ.Title. - axisYZ.Units.Visible = false; - axisYList.Add(axisYZ); - - //add E - AxisY axisYE = new AxisY(curChart.ViewXY); - - axisYE.SetRange(YMin, YMax); - axisYE.Title.Font = new WpfFont("Segoe UI", 10, false, false); - axisYE.Title.Text = string.Format("Ch{0}.E", item); - axisYE.Title.Angle = 0; - axisYE.Units.Visible = false; - axisYList.Add(axisYE); - - //add N - AxisY axisYN = new AxisY(curChart.ViewXY); - - axisYN.SetRange(YMin, YMax); - axisYN.Title.Font = new WpfFont("Segoe UI", 10, false, false); - axisYN.Title.Text = string.Format("Ch{0}.N", item); - axisYN.Title.Angle = 0; - axisYN.Units.Visible = false; - axisYList.Add(axisYN); - } - //for (int i = 0; i < sms.Count; i++) - //{ - - //} - return axisYList; - } - public List GetSampleDataSeriesPingPu(Dictionary sms, LightningChart curChart, AxisX xAxes, AxisYCollection axisY, double samplingFrequency) + public List CreateAxisYEventTime(MmEvent mmEvent, ViewXY chartV) { - List sampleList = new List(); - - for (int i = 0; i < sms.Count; i++) + for (int i = 0; i< chartV.YAxes.Count; i++) { - //Z - SampleDataSeries seriesZ = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3]); - seriesZ.SampleFormat = SampleFormat.DoubleFloat; - //series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; - - seriesZ.LineStyle.Color = System.Windows.Media.Colors.Blue; - - seriesZ.SamplingFrequency = samplingFrequency; - seriesZ.FirstSampleTimeStamp = 1.0 / samplingFrequency; - seriesZ.LineStyle.Width = 1; - seriesZ.LineStyle.AntiAliasing = LineAntialias.None; - seriesZ.ScrollModePointsKeepLevel = 1; - seriesZ.ScrollingStabilizing = true; - seriesZ.AllowUserInteraction = false; - - //Set custom colored palette - System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(seriesZ.LineStyle.Color, System.Windows.Media.Colors.Black, 50); - System.Windows.Media.Color colorCenter = seriesZ.LineStyle.Color; - - seriesZ.ValueRangePalette.Steps.Clear(); //Remove existing palette steps - seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, -100)); - seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorCenter, 0)); - seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, 100)); - - sampleList.Add(seriesZ); - - //E - SampleDataSeries seriesE = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3 + 1]); - seriesE.SampleFormat = SampleFormat.DoubleFloat; - //series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; - - seriesE.LineStyle.Color = System.Windows.Media.Colors.Red; - - seriesE.SamplingFrequency = samplingFrequency; - seriesE.FirstSampleTimeStamp = 1.0 / samplingFrequency; - seriesE.LineStyle.Width = 1; - seriesE.LineStyle.AntiAliasing = LineAntialias.None; - seriesE.ScrollModePointsKeepLevel = 1; - seriesE.ScrollingStabilizing = true; - seriesE.AllowUserInteraction = false; - - //Set custom colored palette - //System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50); - //System.Windows.Media.Color colorCenter = series.LineStyle.Color; - - seriesE.ValueRangePalette.Steps.Clear(); //Remove existing palette steps - seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorEdge, -100)); - seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorCenter, 0)); - seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorEdge, 100)); - - sampleList.Add(seriesE); - - //N - SampleDataSeries seriesN = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3 + 2]); - seriesN.SampleFormat = SampleFormat.DoubleFloat; - //series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; - - seriesN.LineStyle.Color = System.Windows.Media.Colors.Green; - - seriesN.SamplingFrequency = samplingFrequency; - seriesN.FirstSampleTimeStamp = 1.0 / samplingFrequency; - seriesN.LineStyle.Width = 1; - seriesN.LineStyle.AntiAliasing = LineAntialias.None; - seriesN.ScrollModePointsKeepLevel = 1; - seriesN.ScrollingStabilizing = true; - seriesN.AllowUserInteraction = false; - - //Set custom colored palette - //System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50); - //System.Windows.Media.Color colorCenter = series.LineStyle.Color; - - seriesN.ValueRangePalette.Steps.Clear(); //Remove existing palette steps - seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorEdge, -100)); - seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorCenter, 0)); - seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorEdge, 100)); - - sampleList.Add(seriesN); - } - return sampleList; + // lineCollection.Lines[i] = new SegmentLine(1+i, chartV.YAxes[0].Minimum, 1+i, chartV.YAxes[0].Maximum); + LineCollection lineCollection = new LineCollection() + { + AssignXAxisIndex = 0, + AssignYAxisIndex = i, + Lines = new SegmentLine[] { new SegmentLine(0.5 * i, chartV.YAxes[i].Minimum, 0.5 * i, chartV.YAxes[i].Maximum) }, + ShowInLegendBox = false + }; + PointLineSeries pointLine = new PointLineSeries() + { + PointsVisible = true, + AssignXAxisIndex = 0, + AssignYAxisIndex = i, + ShowInLegendBox = false, + Points = new SeriesPoint[] { new SeriesPoint(0.5 * i, (chartV.YAxes[i].Minimum+ chartV.YAxes[i].Maximum)/2) }, + + }; + // var value= chartV.YAxes[i].ValueToCoord(chartV.YAxes[i].Minimum); + chartV.PointLineSeries.Add(pointLine); + lineCollection.LineStyle.Color= System.Windows.Media.Colors.Red; + chartV.LineCollections.Add(lineCollection); + } + return new List(); } - public List GetSampleDataSeriesDieJia(List sms, LightningChart curChart, AxisX xAxes, AxisYCollection axisY, double samplingFrequency) + public MmEvent Json2MmEvent(string jsonFile) { - List sampleList = new List(); - - for (int i = 0; i < sms.Count; i++) + using (StreamReader sr = System.IO.File.OpenText(jsonFile)) { - //Z - SampleDataSeries seriesZ = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i]); - seriesZ.SampleFormat = SampleFormat.DoubleFloat; - //series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; - - seriesZ.LineStyle.Color = System.Windows.Media.Colors.Blue; - - seriesZ.SamplingFrequency = samplingFrequency; - seriesZ.FirstSampleTimeStamp = 1.0 / samplingFrequency; - seriesZ.LineStyle.Width = 1; - seriesZ.LineStyle.AntiAliasing = LineAntialias.None; - seriesZ.ScrollModePointsKeepLevel = 1; - seriesZ.ScrollingStabilizing = true; - seriesZ.AllowUserInteraction = false; - - //Set custom colored palette - System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(seriesZ.LineStyle.Color, System.Windows.Media.Colors.Black, 50); - System.Windows.Media.Color colorCenter = seriesZ.LineStyle.Color; - - seriesZ.ValueRangePalette.Steps.Clear(); //Remove existing palette steps - seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, -100)); - seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorCenter, 0)); - seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, 100)); - - sampleList.Add(seriesZ); - - //E - SampleDataSeries seriesE = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i]); - seriesE.SampleFormat = SampleFormat.DoubleFloat; - //series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; - - seriesE.LineStyle.Color = System.Windows.Media.Colors.Red; - - seriesE.SamplingFrequency = samplingFrequency; - seriesE.FirstSampleTimeStamp = 1.0 / samplingFrequency; - seriesE.LineStyle.Width = 1; - seriesE.LineStyle.AntiAliasing = LineAntialias.None; - seriesE.ScrollModePointsKeepLevel = 1; - seriesE.ScrollingStabilizing = true; - seriesE.AllowUserInteraction = false; - - //Set custom colored palette - //System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50); - //System.Windows.Media.Color colorCenter = series.LineStyle.Color; - - seriesE.ValueRangePalette.Steps.Clear(); //Remove existing palette steps - seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorEdge, -100)); - seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorCenter, 0)); - seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorEdge, 100)); - - sampleList.Add(seriesE); - - //N - SampleDataSeries seriesN = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i]); - seriesN.SampleFormat = SampleFormat.DoubleFloat; - //series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; - - seriesN.LineStyle.Color = System.Windows.Media.Colors.Green; - - seriesN.SamplingFrequency = samplingFrequency; - seriesN.FirstSampleTimeStamp = 1.0 / samplingFrequency; - seriesN.LineStyle.Width = 1; - seriesN.LineStyle.AntiAliasing = LineAntialias.None; - seriesN.ScrollModePointsKeepLevel = 1; - seriesN.ScrollingStabilizing = true; - seriesN.AllowUserInteraction = false; - - //Set custom colored palette - //System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50); - //System.Windows.Media.Color colorCenter = series.LineStyle.Color; - - seriesN.ValueRangePalette.Steps.Clear(); //Remove existing palette steps - seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorEdge, -100)); - seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorCenter, 0)); - seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorEdge, 100)); - - sampleList.Add(seriesN); + MmEvent mmEvent = new MmEvent(); + mmEvent.JsonFile = jsonFile; + string filePath = System.IO.Path.GetDirectoryName(jsonFile); + string fileName = System.IO.Path.GetFileNameWithoutExtension(jsonFile).TrimEnd('B').TrimEnd('A'); + string ascName = filePath + "\\" + fileName + ".txt"; + mmEvent.AsciiFile = ascName; + JsonTextReader reader = new JsonTextReader(sr); + JArray jArray = (JArray)JToken.ReadFrom(reader); + //解析普通属性和数组混合的Json文件 + //数组0是普通属性集合 + JObject jobj = (JObject)jArray[0]; + string dateStr = jobj["otime"].ToString(); + mmEvent.EventTime = DateTime.Parse(dateStr); + mmEvent.EventTimeStr = dateStr; + mmEvent.X = double.Parse(jobj["lon"].ToString()); + mmEvent.Y = double.Parse(jobj["lat"].ToString()); + mmEvent.Z = double.Parse(jobj["depth"].ToString()); + mmEvent.ML = double.Parse(jobj["ml"].ToString()); + mmEvent.RMS = double.Parse(jobj["rms"].ToString()); + mmEvent.SetEnergy(); + mmEvent.DominantFreq = 15; + mmEvent.Phases = new Dictionary(); + List DominantFreqlist = new List(); + JArray phaseArr = JArray.FromObject(jobj["phases"]); + List DominantFreqList = new List(); + for (int i = 0; i < phaseArr.Count; i++) + { + if (phaseArr[i]["first_motion_direct"] != null) + { + mmEvent.Phases.Add(phaseArr[i]["id"].ToString().Substring(3, 3), + int.Parse(phaseArr[i]["first_motion_direct"].ToString())); + } + if (phaseArr[i]["fmd_semi_period"] != null) + { + DominantFreqlist.Add(double.Parse(phaseArr[i]["fmd_semi_period"].ToString())); + } + } + if (DominantFreqlist.Count > 0) + { + if (DominantFreqlist.Count > 3) + { + double min = DominantFreqlist.Min(); + double max = DominantFreqlist.Max(); + DominantFreqlist.Remove(min); + DominantFreqlist.Remove(max); + mmEvent.DominantFreq = DominantFreqlist.Sum() / (double)DominantFreqlist.Count; + } + else + { + mmEvent.DominantFreq = 0; + } + } + return mmEvent; } - return sampleList; + //return null; } - public List CreateYAxis(int channelCount, LightningChart curChart) + public MmEvent Json2MmEventWithPara(string jsonFile) { - List axisYList = new List(); - - for (int i = 0; i < channelCount; i++) + using (StreamReader sr = System.IO.File.OpenText(jsonFile)) { - AxisY axisY = new AxisY(curChart.ViewXY); - //AxisY axisY = new AxisY(); - axisY.SetRange(YMin, YMax); - axisY.Title.Font = new WpfFont("Segoe UI", 10, false, false); - axisY.Title.Text = string.Format("Ch {0}", i + 1); - axisY.Title.Angle = 0; - axisY.Units.Visible = false; - axisYList.Add(axisY); + MmEvent mmEvent = new MmEvent(); + mmEvent.JsonFile = jsonFile; + string filePath = System.IO.Path.GetDirectoryName(jsonFile); + string fileName = System.IO.Path.GetFileNameWithoutExtension(jsonFile).TrimEnd('B').TrimEnd('A'); + //fileName=fileName.TrimEnd('B'); + //fileName.TrimEnd('A'); + string ascName = filePath + "\\" + fileName + ".txt"; + mmEvent.AsciiFile = ascName; + JsonTextReader reader = new JsonTextReader(sr); + JArray jArray = (JArray)JToken.ReadFrom(reader); + //解析普通属性和数组混合的Json文件 + //数组0是普通属性集合 + JObject jobj = (JObject)jArray[0]; + string dateStr = jobj["otime"].ToString(); + //LocalSqLiteServerAccess localSqLiteServerAccess = new LocalSqLiteServerAccess(); + //int selectResult = localSqLiteServerAccess.SelectWithTime(dateStr); + int selectResult = 1; + if (selectResult < 1) + { + return null; + } + else + { + mmEvent.Phases = new Dictionary(); + List Semiperiodlist = new List(); + JArray phaseArr = JArray.FromObject(jobj["phases"]); + List DominantFreqList = new List(); + for (int i = 0; i < phaseArr.Count; i++) + { + if (phaseArr[i]["first_motion_direct"] != null) + { + mmEvent.Phases.Add(phaseArr[i]["id"].ToString().Substring(3, 3), + int.Parse(phaseArr[i]["first_motion_direct"].ToString())); + } + if (phaseArr[i]["fmd_semi_period"] != null) + { + Semiperiodlist.Add(double.Parse(phaseArr[i]["fmd_semi_period"].ToString())); + } + } + if (Semiperiodlist.Count > 0) + { + if (Semiperiodlist.Count > 3) + { + double min = Semiperiodlist.Min(); + double max = Semiperiodlist.Max(); + Semiperiodlist.Remove(min); + Semiperiodlist.Remove(max); + mmEvent.DominantFreq = Semiperiodlist.Sum() / (double)Semiperiodlist.Count; + } + else + { + mmEvent.DominantFreq = 0; + } + } + JArray ampsArr = JArray.FromObject(jobj["amps"]); + List ampsArrList = new List(); + for (int i = 0; i < ampsArr.Count; i++) + { + if (ampsArr[i]["amp"] != null) + { + ampsArrList.Add(float.Parse(ampsArr[i]["amp"].ToString())); + } + } + MmEvent.SetAmp(ampsArrList); + return mmEvent; + } } - return axisYList; } - public List GetSampleDataSeries(int channelCount, LightningChart curChart, AxisX xAxes, AxisYCollection axisY, double samplingFrequency) - { - List sampleList = new List(); - for (int i = 0; i < channelCount; i++) - { - SampleDataSeries series = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i]); - series.SampleFormat = SampleFormat.DoubleFloat; - //series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; - - series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length]; - - series.SamplingFrequency = samplingFrequency; - series.FirstSampleTimeStamp = 1.0 / samplingFrequency; - series.LineStyle.Width = 1; - series.LineStyle.AntiAliasing = LineAntialias.None; - series.ScrollModePointsKeepLevel = 1; - series.ScrollingStabilizing = true; - series.AllowUserInteraction = false; - - //Set custom colored palette - System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50); - System.Windows.Media.Color colorCenter = series.LineStyle.Color; - - series.ValueRangePalette.Steps.Clear(); //Remove existing palette steps - series.ValueRangePalette.Steps.Add(new PaletteStep(series.ValueRangePalette, colorEdge, -100)); - series.ValueRangePalette.Steps.Add(new PaletteStep(series.ValueRangePalette, colorCenter, 0)); - series.ValueRangePalette.Steps.Add(new PaletteStep(series.ValueRangePalette, colorEdge, 100)); - - sampleList.Add(series); - } - return sampleList; - } } } diff --git a/mseedChart.MainModule/RegionNames.cs b/mseedChart.MainModule/RegionNames.cs index ab5b00b..cc78187 100644 --- a/mseedChart.MainModule/RegionNames.cs +++ b/mseedChart.MainModule/RegionNames.cs @@ -11,10 +11,10 @@ namespace mseedChart.Core { public const string ContentRegion = "ContentRegion"; - public static string MseedFilePath= AppDomain.CurrentDomain.BaseDirectory + "EwsCache\\Mseed"; + public static string MseedFilePath = @"H:\EwsCache\Mseed"; //AppDomain.CurrentDomain.BaseDirectory + "EwsCache\\Mseed"; - public static string TxtFilePath = AppDomain.CurrentDomain.BaseDirectory + "EwsCache\\Txt"; + public static string TxtFilePath = @"H:\EwsCache\Txt";//;AppDomain.CurrentDomain.BaseDirectory + "EwsCache\\Txt"; public static string DataTypeString = "A"; diff --git a/mseedChart.MainModule/ViewModels/ChartPlotViewModel.cs b/mseedChart.MainModule/ViewModels/ChartPlotViewModel.cs index 7c7e0e0..61942b0 100644 --- a/mseedChart.MainModule/ViewModels/ChartPlotViewModel.cs +++ b/mseedChart.MainModule/ViewModels/ChartPlotViewModel.cs @@ -1,10 +1,13 @@ -using Arction.Wpf.ChartingMVVM; -using Arction.Wpf.ChartingMVVM.Axes; -using Arction.Wpf.ChartingMVVM.Views.ViewXY; +using Arction.Wpf.Charting; +using Arction.Wpf.Charting.Axes; +using Arction.Wpf.Charting.Views.ViewXY; +using Microsoft.Win32; using mseedChart.Core; using mseedChart.MainModule.Models; +using Prism.Commands; using Prism.Events; using Prism.Mvvm; +using SharpDX.DirectWrite; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -17,59 +20,47 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Media; +using System.Windows.Media.Imaging; using System.Windows.Threading; namespace mseedChart.MainModule.ViewModels { public class ChartPlotViewModel : BindableBase { - #region variable - Dispatcher _dispatcher; - /// - /// Delegate for data generation. - /// - /// - /// 当前采样数 - /// - public int CurPoints; - private readonly IEventAggregator _ea; - private int _selectResult = 0; - public int SelectResult + + public ChartPlotViewModel() { - get { return _selectResult; } + _dispatcher = Application.Current.Dispatcher; + _wavesModel = new WavesModel(); + CreateChart(); + (Application.Current.MainWindow as System.Windows.Window).Closing += ApplicationClosingDispose; - set - { - SetProperty(ref _selectResult, value); - } + string fileName = "2023-03-31T07:43:15.464036"; + ShowWave(null,obj:fileName); + string eventTimeStr = fileName; + string datePath = eventTimeStr.Substring(0, 4) + eventTimeStr.Substring(5, 2) + eventTimeStr.Substring(8, 2); + string dataFilePath = RegionNames.MseedFilePath + "\\" + datePath + "\\"; + string dataFileName = "HA." + eventTimeStr.Substring(0, 4) + eventTimeStr.Substring(5, 2) + + eventTimeStr.Substring(8, 2) + eventTimeStr.Substring(10, 3) + + eventTimeStr.Substring(14, 2) + eventTimeStr.Substring(17, 2) + ".01" + RegionNames.DataTypeString; + string jsonStr = ".json"; + _wavesModel.Json2MmEvent(dataFilePath+dataFileName+jsonStr); } - int _channelCount = 60; // Channel count. - double _samplingFrequency = 500; // Sampling frequency (Hz). - double _xLength = 10; // X axis length. - double _previousX = 0; // Latest X value on axis. - long _now; // Latest time stamp. - long _startTicks; // Controls timing. - long _samplesOutput; // Generated samples quantity. - - // Constants - const double YMin = 30000; // Minimal y-value. - const double YMax = 33000; // Maximal y-value. - - WavesModel _wavesModel; - #endregion - /// - /// Thread. - /// - private delegate void ChartUpdateFromThreadHandler(double[][] samples); - - - private ChartUpdateFromThreadHandler _chartUpdate; + #region 字段 + Dispatcher _dispatcher; + public int CurPoints; - private Random _rand = new Random((int)DateTime.Now.Ticks); + int _channelCount = 0; + double _samplingFrequency = 500; // 采样频率 (Hz). + double _previousX = 0; - #region "属性" + WavesModel _wavesModel; private int _lChartCount = 1; + public List smList; + #endregion + + #region 属性 /// /// 波形控件数量 /// @@ -78,117 +69,6 @@ namespace mseedChart.MainModule.ViewModels get { return _lChartCount; } set { _lChartCount = value; } } - public List WaveComList { get; set; } - private ShareProperty _wavesCombination; - /// - /// 波形组合 - /// - public ShareProperty WavesCombination - { - get { return _wavesCombination; } - set - { - _wavesCombination = value; - SetWavesCombination(); - } - } - private DataSourcesEnum _dataSources; - /// - /// 数据来源 - /// - public DataSourcesEnum DataSources - { - get { return _dataSources; } - set { _dataSources = value; } - } - - private DataTypeEnum _wavesType; - /// - /// 波形类型 - /// - public DataTypeEnum WavesType - { - get { return _wavesType; } - set { _wavesType = value; } - } - - private DisplayModeEnum _displayMode; - /// - /// 显示模式 - /// - public DisplayModeEnum DisplayMode - { - get { return _displayMode; } - set { _displayMode = value; } - } - - private ScollModeEnum _scollMode; - /// - /// 滚动方式 - /// - public ScollModeEnum ScollMode - { - get { return _scollMode; } - set { _scollMode = value; } - } - - private DateTime _startTime; - /// - /// 开始时间 - /// - public DateTime StartTime - { - get { return _startTime; } - set { _startTime = value; } - } - private DateTime _endTime; - /// - /// 开始时间 - /// - public DateTime EndTime - { - get { return _endTime; } - set { _endTime = value; } - } - - private int _sampling = 500; - /// - /// 采样频率 - /// - public int Sampling - { - get { return _sampling; } - set { _sampling = value; } - } - /// - /// 延时(min) - /// - public int DelayMin { get; set; } = 10; - /// - /// 文件数据位置 - /// - public string FileDataPath { get; set; } = @"D:\TaySystemPath\Downloads"; - private string _cachePath; - - private int _cacheSize; - /// - /// 缓存大小 - /// - public int CacheSize - { - get { return _cacheSize; } - set { _cacheSize = value; } - } - private ObservableCollection _stationList; - /// - /// 台站列表 - /// - public ObservableCollection StationList - { - get { return _stationList; } - set { _stationList = value; } - } - private LightningChart _lChartAll; /// /// 所有波形 @@ -198,33 +78,6 @@ namespace mseedChart.MainModule.ViewModels get { return _lChartAll; } set { _lChartAll = value; } } - private LightningChart _lChartZ; - /// - /// Z通道波形 - /// - public LightningChart LChartZ - { - get { return _lChartZ; } - set { _lChartZ = value; } - } - private LightningChart _lChartE; - /// - /// E通道波形 - /// - public LightningChart LChartE - { - get { return _lChartE; } - set { _lChartE = value; } - } - private LightningChart _lChartN; - /// - /// N通道波形 - /// - public LightningChart LChartN - { - get { return _lChartN; } - set { _lChartN = value; } - } private FrameworkElement childContent; public FrameworkElement ChildContent @@ -240,140 +93,76 @@ namespace mseedChart.MainModule.ViewModels get { return gridChart; } set { gridChart = value; } } + private MmEvent _eventTime; + public MmEvent EventTime + { + get { return _eventTime; } + set { _eventTime = value; } + } - public List smList; - #endregion - public ChartPlotViewModel() - { - _dispatcher = Application.Current.Dispatcher; - SelectResult = 10; - var wcList = (WavesCombinationEnum[])Enum.GetValues(typeof(WavesCombinationEnum)); - WaveComList = wcList.Select(value => new ShareProperty((int)value, value.ToString())).ToList(); - WavesCombination = WaveComList.SingleOrDefault(wc => wc.ID == 0); - - _chartUpdate = new ChartUpdateFromThreadHandler(FeedNewDataToChartPingPu); + #endregion - _wavesModel = new WavesModel(); - LChartALL.ViewXY.XAxes = new AxisXCollection(); - LChartALL.ViewXY.XAxes.Add(_wavesModel.GetAxisX(10)); - InitData(); - (Application.Current.MainWindow as System.Windows.Window).Closing += ApplicationClosingDispose; - ShowWave(); - } + #region 事件 + public DelegateCommand AxesYVisibleCommand => new DelegateCommand(AxesYVisible); + public DelegateCommand FileSelectorCommand => new DelegateCommand(FileSelector); - private void ShowWave(string obj= "2023-03-29T06:41:21.348") + private void AxesYVisible(object isCheck) { - string EventTimeStr = obj; - string datePath = EventTimeStr.Substring(0, 4) + EventTimeStr.Substring(5, 2) + EventTimeStr.Substring(8, 2); - string dataFilePath = RegionNames.MseedFilePath + "\\" + datePath + "\\"; - string dataFileName = "HA." + EventTimeStr.Substring(0, 4) + EventTimeStr.Substring(5, 2) - + EventTimeStr.Substring(8, 2) + EventTimeStr.Substring(10, 3) - + EventTimeStr.Substring(14, 2) + EventTimeStr.Substring(17, 2) + ".01" + RegionNames.DataTypeString; - string mseedStr = ".mseed"; - string asciiSavePath = RegionNames.TxtFilePath + "\\" + datePath + "\\" + dataFileName + ".txt"; - if (!Directory.Exists(dataFilePath)) - { - Directory.CreateDirectory(dataFilePath); - } - if (!Directory.Exists(Path.GetDirectoryName(asciiSavePath))) - { - Directory.CreateDirectory(Path.GetDirectoryName(asciiSavePath)); - } - //if (!File.Exists(dataFilePath + dataFileName + mseedStr)) + if (_lChartAll != null) { + bool yAxesVisible = ((bool)isCheck == true); + _lChartAll.BeginUpdate(); - //TaskData taskData = new TaskData(); - //taskData.EventTimeStr = EventTimeStr; - //taskData.Tasks = new Task(() => - //{ - // int res = new DownloadWavedata().Download(EventTimeStr, dataFilePath, dataFileName + mseedStr, GlobalConfig.UseWaveDataTable); - // if (res > -1) - // { - // MSeed2Asc(dataFilePath + dataFileName + mseedStr, asciiSavePath); - // } - // //Console.WriteLine(taskData.IsComplete); - //}); - //taskData.CallBack = (string res) => - //{ - // _dispatcher.Invoke(() => - // { - // UpdateWavesFromTxt(asciiSavePath); - // _channelCount = smList.Count * 3; - // UpdateChart(); - // UpdateChartData(); - // }); - //}; - //TaskQueue.Instance.AddTaskAndRuning(taskData); - } - // else - { - if (!File.Exists(asciiSavePath)) - { - MSeed2Asc(dataFilePath + dataFileName + mseedStr, asciiSavePath); - } - _dispatcher.Invoke(() => - { - UpdateWavesFromTxt(asciiSavePath); - _channelCount = smList.Count * 3; - UpdateChart(); - UpdateChartData(); - }); - } - + AxisY lastYAxis = _lChartAll.ViewXY.YAxes.Last(); + _lChartAll.ViewXY.AxisLayout.AutoAdjustMargins = false; - } + foreach (AxisY yAxis in _lChartAll.ViewXY.YAxes) + { + if (yAxis != lastYAxis) + { + yAxis.Visible = yAxesVisible; + } + else + { + yAxis.Visible = true; + yAxis.LabelsVisible = yAxesVisible; + //yAxis.MajorDivTickStyle.Visible = yAxesVisible; + //yAxis.MinorDivTickStyle.Visible = yAxesVisible; + yAxis.Title.Visible = yAxesVisible; + if (yAxesVisible) + { + yAxis.AxisThickness = 3; + } + else + { + yAxis.AxisThickness = 0; + } + // lastYAxis.MiniScale.Visible = !yAxesVisible; + } + } + _lChartAll.EndUpdate(); - private void UpdateChart() - { - //线程问题 - LChartALL.ViewXY.YAxes = new AxisYCollection(); - LChartALL.ViewXY.YAxes.Clear(); - LChartALL.ViewXY.YAxes.AddRange(_wavesModel.CreateYAxisPingPu(smList, LChartALL)); - for (int i = 0; i < LChartALL.ViewXY.YAxes.Count; i++) - { - LChartALL.ViewXY.YAxes[i].LabelsColor = Colors.Black; - LChartALL.ViewXY.YAxes[i].AxisColor = Colors.Black; - LChartALL.ViewXY.YAxes[i].GridStripColor = Colors.Black; - LChartALL.ViewXY.YAxes[i].Title.Color = Colors.Black; - LChartALL.ViewXY.YAxes[i].Title.Shadow.DropColor = Colors.Transparent; - LChartALL.ViewXY.YAxes[i].Title.Shadow.ContrastColor = Colors.Transparent; } - LChartALL.ViewXY.XAxes = new AxisXCollection(); - LChartALL.ViewXY.XAxes.Add(_wavesModel.GetAxisX(CurPoints / Sampling)); - LChartALL.ViewXY.XAxes[0].LabelsColor = Colors.Black; - - LChartALL.ViewXY.SampleDataSeries = new SampleDataSeriesCollection(); - LChartALL.ViewXY.SampleDataSeries.AddRange( - _wavesModel.GetSampleDataSeriesPingPu(smList, LChartALL, LChartALL.ViewXY.XAxes[0], - LChartALL.ViewXY.YAxes, _samplingFrequency)); } - private void UpdateChartData() + + private void FileSelector() { - double[][] multiChannelData = new double[smList.Count * 3][]; - try + OpenFileDialog openFileDialog = new OpenFileDialog { - for (int channelIndex = 0; channelIndex < smList.Count; channelIndex++) - { - multiChannelData[channelIndex * 3] = smList[channelIndex].dz.ToArray(); - multiChannelData[channelIndex * 3 + 1] = smList[channelIndex].dn.ToArray(); - multiChannelData[channelIndex * 3 + 2] = smList[channelIndex].de.ToArray(); - } - // Invoke FeedNewDataToChart. - _dispatcher.Invoke(_chartUpdate, System.Windows.Threading.DispatcherPriority.ContextIdle, - multiChannelData as object); - } - catch (Exception ex) + RestoreDirectory = true, + Filter = ".json|*.json|.mseed|*.mseed|.txt|*.txt", + }; + if (openFileDialog.ShowDialog() == true) { - throw ex; + ShowWave(openFileDialog.FileName); } - } - + #endregion public void UpdateWavesFromTxt(string fn) { string allStr; @@ -387,7 +176,6 @@ namespace mseedChart.MainModule.ViewModels string[] strLines = allStr.Trim().Split(new char[] { '\n' }); List strList = strLines.ToList(); int cnt = strList.Count; - int num = 0; string[] snStr = strLines[0].Trim().Split(','); string tmpName = snStr[0].Substring(14, 3); CurPoints = int.Parse(snStr[1].Trim().Split(' ')[0]); @@ -453,69 +241,50 @@ namespace mseedChart.MainModule.ViewModels compiler.WaitForExit(); } } - private void ApplicationClosingDispose(object sender, CancelEventArgs e) - { - if (LChartALL != null) - { - LChartALL.Dispose(); - LChartALL = null; - } - } - public void Dispose() + + private void CreateChart() { - gridChart.Children.Clear(); - if (LChartALL != null) { - LChartALL.Dispose(); LChartALL = null; } - } - public void SetWavesCombination() - { - switch (WavesCombination.Name) - { - case "平铺": - LChartCount = 1; - CreateGridChartPingPu(); - break; - case "叠加": - LChartCount = 1; - CreateGridChartDieJia(); - break; - case "分类": - LChartCount = 3; - CreateGridChartFenLei(); - break; - } - } - public void CreateGridChartPingPu() - { - if (LChartALL != null) - { - LChartALL = null; - } - LChartALL = new LightningChart(); + LChartALL.Title.Align = ChartTitleAlignment.TopCenter; + LChartALL.ChartRenderOptions.DeviceType = RendererDeviceType.AutoPreferD11; + LChartALL.ChartRenderOptions.LineAAType2D = LineAntiAliasingType.QLAA; + LChartALL.Title.Text = "事件波形"; - LChartALL.Title.Color = Colors.Black; - LChartALL.Title.Shadow.DropColor = Colors.Transparent; - LChartALL.Title.Shadow.ContrastColor = Colors.Transparent; + // LChartALL.Title.Color = Colors.Red; LChartALL.Title.Font = new WpfFont("等线", 20); + //轴属性和布局 LChartALL.ViewXY.AxisLayout.YAxesLayout = YAxesLayout.Stacked; - LChartALL.ViewXY.AxisLayout.SegmentsGap = 0; LChartALL.ViewXY.ZoomPanOptions.PanDirection = PanDirection.Horizontal; LChartALL.ViewXY.ZoomPanOptions.WheelZooming = WheelZooming.Horizontal; - - //背景颜色 + LChartALL.ViewXY.AxisLayout.YAxisAutoPlacement = YAxisAutoPlacement.AllLeft; + LChartALL.ViewXY.AxisLayout.YAxisTitleAutoPlacement = true; + LChartALL.ViewXY.AxisLayout.AutoAdjustMargins = false; + + LChartALL.ViewXY.ZoomPanOptions.DevicePrimaryButtonAction = UserInteractiveDeviceButtonAction.None; + LChartALL.ViewXY.ZoomPanOptions.DeviceSecondaryButtonAction = UserInteractiveDeviceButtonAction.None; + LChartALL.ViewXY.ZoomPanOptions.WheelZooming = WheelZooming.Off; + + //X轴设置 + LChartALL.ViewXY.XAxes[0].AllowScrolling = false; + LChartALL.ViewXY.XAxes[0].PanningEnabled = false; + LChartALL.ViewXY.XAxes[0].SweepingGap = 0; + // LChartALL.ViewXY.XAxes[0].ValueType = AxisValueType.Number; + LChartALL.ViewXY.XAxes[0].AutoFormatLabels = false; + // LChartALL.ViewXY.XAxes[0].LabelsNumberFormat = "N0"; + // LChartALL.ViewXY.XAxes[0].MajorGrid.Pattern = LinePattern.Solid; + + //图表背景颜色 LChartALL.ViewXY.GraphBackground.Color = Colors.White; - LChartALL.ViewXY.GraphBackground.GradientFill = GradientFill.Solid; + //LChartALL.ViewXY.GraphBackground.GradientFill = GradientFill.Solid; LChartALL.ViewXY.GraphBackground.GradientColor = Colors.White; LChartALL.ChartBackground.GradientFill = GradientFill.Solid; LChartALL.ChartBackground.Color = Color.FromArgb(0, 0, 0, 0); - GridChart = new Grid(); GridChart.ColumnDefinitions.Add(new ColumnDefinition()); GridChart.Name = "chartGrid"; @@ -523,130 +292,171 @@ namespace mseedChart.MainModule.ViewModels this.ChildContent = GridChart; } - public void CreateGridChartDieJia() + private void ShowWave(string filePath, string obj = "2023-03-29T06:41:21.348") { - if (LChartALL != null) + string EventTimeStr = obj; + string datePath = EventTimeStr.Substring(0, 4) + EventTimeStr.Substring(5, 2) + EventTimeStr.Substring(8, 2); + string dataFilePath = RegionNames.MseedFilePath + "\\" + datePath + "\\"; + string dataFileName = "HA." + EventTimeStr.Substring(0, 4) + EventTimeStr.Substring(5, 2) + + EventTimeStr.Substring(8, 2) + EventTimeStr.Substring(10, 3) + + EventTimeStr.Substring(14, 2) + EventTimeStr.Substring(17, 2) + ".01" + RegionNames.DataTypeString; + string mseedStr = ".mseed"; + string asciiSavePath = RegionNames.TxtFilePath + "\\" + datePath + "\\" + dataFileName + ".txt"; + if (filePath != null) asciiSavePath = filePath; + if (!Directory.Exists(dataFilePath)) { - LChartALL = null; + Directory.CreateDirectory(dataFilePath); + } + if (!Directory.Exists(Path.GetDirectoryName(asciiSavePath))) + { + Directory.CreateDirectory(Path.GetDirectoryName(asciiSavePath)); } - LChartALL = new LightningChart(); - LChartALL.Title.Text = "叠加"; - - GridChart = new Grid(); - GridChart.ColumnDefinitions.Add(new ColumnDefinition()); - GridChart.Name = "chartGrid"; - GridChart.Children.Add(LChartALL); - this.ChildContent = GridChart; + if (!File.Exists(asciiSavePath)) + { + MSeed2Asc(dataFilePath + dataFileName + mseedStr, asciiSavePath); + } + UpdateWavesFromTxt(asciiSavePath); + _channelCount = smList.Count * 3; + UpdateChart(); + UpdateChartData(); } - public void CreateGridChartFenLei() + + + private void UpdateChart() { - LChartZ = new LightningChart(); - LChartALL.Title.Text = "Z"; - LChartZ.SetValue(Grid.ColumnProperty, 0); + + DisposeAllAndClear(LChartALL.ViewXY.YAxes); + DisposeAllAndClear(LChartALL.ViewXY.SampleDataSeries); - LChartE = new LightningChart(); - LChartALL.Title.Text = "E"; - LChartE.SetValue(Grid.ColumnProperty, 1); + LChartALL.ViewXY.YAxes.AddRange(_wavesModel.CreateYAxisChart(smList, LChartALL)); + int seriesIndex = 0; + foreach (var axisY in LChartALL.ViewXY.YAxes) + { + axisY.LabelsColor = Colors.Black; + // axisY.AxisColor = Colors.Black; + axisY.Title.Shadow.DropColor = Colors.Transparent; + axisY.Title.Shadow.ContrastColor = Colors.Transparent; + + axisY.AllowAutoYFit = false; + axisY.Units.Visible = false; + axisY.LabelsAngle = 0; + axisY.LabelsFont.Size = 8; + axisY.Title.Angle = 0; + axisY.MajorGrid.Visible = true; + axisY.MinorGrid.Visible = false; + axisY.MajorGrid.Pattern = LinePattern.Solid; + + axisY.AutoDivSpacing = false; + // axisY.AutoDivSeparationPercent = 100; + axisY.Visible = true; + // axisY.MajorDiv = 1; + axisY.MajorDivCount = 2; + axisY.MajorDivTickStyle.Visible = true; + axisY.MinorDivTickStyle.Visible = false; + axisY.MajorDivTickStyle.Alignment = seriesIndex % 2 == 0 ? Alignment.Near : Alignment.Far; + axisY.MajorDivTickStyle.LineLength = 6; + axisY.MajorDivTickStyle.Color = Colors.Black; + axisY.Title.Color = Colors.Black; + axisY.Title.Font = new WpfFont("Segoe UI", 10, false, false); + // axisY.Title.HorizontalAlign = seriesIndex % 2 == 0 ? YAxisTitleAlignmentHorizontal.Left : YAxisTitleAlignmentHorizontal.Right; + axisY.PanningEnabled = false; + axisY.AllowScrolling = false; + axisY.AllowScaling = false; + + seriesIndex++; + } - LChartN = new LightningChart(); - LChartALL.Title.Text = "N"; - LChartN.SetValue(Grid.ColumnProperty, 2); + LChartALL.ViewXY.LegendBoxes[0].Position = LegendBoxPositionXY.RightCenter; + LChartALL.ViewXY.LegendBoxes[0].Offset.SetValues(-10, 180); + LChartALL.ViewXY.LegendBoxes[0].Layout = LegendBoxLayout.Vertical; + LChartALL.ViewXY.LegendBoxes[0].ShowIcons = false; + LChartALL.ViewXY.AutoSpaceLegendBoxes = true; + LChartALL.ViewXY.AxisLayout.SegmentsGap = 3; + LChartALL.ViewXY.LegendBoxes[0].Shadow.Visible =false; + LChartALL.ViewXY.XAxes[0].Maximum = CurPoints / _samplingFrequency; + LChartALL.ViewXY.XAxes[0].LabelsColor = Colors.Black; - GridChart = new Grid(); - GridChart.ColumnDefinitions.Add(new ColumnDefinition()); - GridChart.ColumnDefinitions.Add(new ColumnDefinition()); - GridChart.ColumnDefinitions.Add(new ColumnDefinition()); + LChartALL.ViewXY.SampleDataSeries.AddRange( + _wavesModel.GetSampleDataSeriesPingPu(smList, LChartALL, LChartALL.ViewXY.XAxes[0], + LChartALL.ViewXY.YAxes, _samplingFrequency)); + } + private void UpdateChartData() + { + double[][] multiChannelData = new double[smList.Count * 3][]; + try + { + for (int channelIndex = 0; channelIndex < smList.Count; channelIndex++) + { + multiChannelData[channelIndex * 3] = smList[channelIndex].dz.ToArray(); + multiChannelData[channelIndex * 3 + 1] = smList[channelIndex].dn.ToArray(); + multiChannelData[channelIndex * 3 + 2] = smList[channelIndex].de.ToArray(); + } + // Invoke FeedNewDataToChart. + _dispatcher.Invoke(() => + { + FeedNewDataToChar(multiChannelData); + }); + } + catch (Exception ex) + { + throw ex; + } + } - GridChart.Name = "chartGrid"; - GridChart.Children.Add(LChartZ); - GridChart.Children.Add(LChartE); - GridChart.Children.Add(LChartN); - this.ChildContent = GridChart; + private void ApplicationClosingDispose(object sender, CancelEventArgs e) + { + if (LChartALL != null) + { + LChartALL.Dispose(); + LChartALL = null; + } } - private void InitData() + + private void DisposeAllAndClear(List list) where T : IDisposable { - LChartALL.ViewXY.YAxes = new AxisYCollection(); - LChartALL.ViewXY.YAxes.Clear(); - RegionNames.StationDic= RegionNames.CreateStationFromCSV(AppDomain.CurrentDomain.BaseDirectory + @"resources/N3102_staion_20230312.txt"); - LChartALL.ViewXY.YAxes.AddRange(_wavesModel.CreateYAxisPingPu(RegionNames.StationDic, LChartALL)); - for (int i = 0; i < LChartALL.ViewXY.YAxes.Count; i++) + if (list == null) { - LChartALL.ViewXY.YAxes[i].LabelsColor = Colors.Black; - LChartALL.ViewXY.YAxes[i].AxisColor = Colors.Black; - LChartALL.ViewXY.YAxes[i].GridStripColor = Colors.Black; - LChartALL.ViewXY.YAxes[i].Title.Color = Colors.Black; - LChartALL.ViewXY.YAxes[i].Title.Shadow.DropColor = Colors.Transparent; - LChartALL.ViewXY.YAxes[i].Title.Shadow.ContrastColor = Colors.Transparent; - LChartALL.ViewXY.YAxes[i].Title.Font = new WpfFont("Calibri", 12); + return; } - LChartALL.ViewXY.XAxes = new AxisXCollection(); - LChartALL.ViewXY.XAxes.Add(_wavesModel.GetAxisX(CurPoints / Sampling)); - LChartALL.ViewXY.XAxes[0].LabelsColor = Colors.Black; - LChartALL.ViewXY.SampleDataSeries = new SampleDataSeriesCollection(); - LChartALL.ViewXY.SampleDataSeries.AddRange( - _wavesModel.GetSampleDataSeriesPingPu(RegionNames.StationDic, LChartALL, LChartALL.ViewXY.XAxes[0], - LChartALL.ViewXY.YAxes, _samplingFrequency)); - //string mseedPath = FileDataPath + "\\" + StartTime.Year.ToString("D2"); - //Console.WriteLine(mseedPath); - //Start(); + while (list.Count > 0) + { + int lastInd = list.Count - 1; + T item = list[lastInd]; // take item ref from list. + list.RemoveAt(lastInd); // remove item first + if (item != null) + { + (item as IDisposable).Dispose(); // then dispose it. + } + } + } + public void Dispose() + { + gridChart.Children.Clear(); + + if (LChartALL != null) + { + LChartALL.Dispose(); + LChartALL = null; + } } - private void FeedNewDataToChartPingPu(double[][] data) + + private void FeedNewDataToChar(double[][] data) { LChartALL.BeginUpdate(); + _wavesModel.CreateAxisYEventTime(EventTime, LChartALL.ViewXY); for (int channelIndex = 0; channelIndex < _channelCount; channelIndex++) { LChartALL.ViewXY.SampleDataSeries[channelIndex].AddSamples(data[channelIndex], true); - //LChartALL.ViewXY.YAxes[channelIndex].Minimum = data[channelIndex].Min(); - //LChartALL.ViewXY.YAxes[channelIndex].Maximum = data[channelIndex].Max(); } + // _previousX = (double)_samplesOutput / _samplingFrequency; - _previousX = (double)_samplesOutput / _samplingFrequency; - - LChartALL.ViewXY.XAxes[0].ScrollPosition = _previousX; + // LChartALL.ViewXY.XAxes[0].ScrollPosition = _previousX; LChartALL.EndUpdate(); } } - /// - /// 波形组合 - /// - public enum WavesCombinationEnum - { - 平铺 = 0, - 叠加, - 分类 - } - /// - /// 波形类型 - /// - public enum DataTypeEnum - { - 原始数据 = 0, - 事件数据 - } - /// - /// 数据来源 - /// - public enum DataSourcesEnum - { - 文件 = 0, - 数据库 - } - /// - /// 显示模式 - /// - public enum DisplayModeEnum - { - 自动 = 0, - 手动 - } - public enum ScollModeEnum - { - Scrolling = 0, - Stepping - } } diff --git a/mseedChart.MainModule/Views/ChartPlotView.xaml b/mseedChart.MainModule/Views/ChartPlotView.xaml index cf543ec..e0937dc 100644 --- a/mseedChart.MainModule/Views/ChartPlotView.xaml +++ b/mseedChart.MainModule/Views/ChartPlotView.xaml @@ -10,9 +10,18 @@ xmlns:prism="http://prismlibrary.com/" prism:ViewModelLocator.AutoWireViewModel="True"> + + + + - + VerticalAlignment="Top" Margin="0,162,0,0" Grid.Row="1" /> + + + + + + diff --git a/mseedChart.MainModule/mseedChart.MainModule.csproj b/mseedChart.MainModule/mseedChart.MainModule.csproj index 389797a..2e6e372 100644 --- a/mseedChart.MainModule/mseedChart.MainModule.csproj +++ b/mseedChart.MainModule/mseedChart.MainModule.csproj @@ -42,21 +42,44 @@ False C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.DirectX.dll + + False + C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.DirectXFiles.dll + + + False + C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.DirectXInit.dll + False C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LicenseManager\Arction.Licensing.dll - + + False + C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.RenderingDefinitions.dll + + False - C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.WinForms.Charting.LightningChart.dll + C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.RenderingEngine.dll - + False - C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.Wpf.ChartingMVVM.LightningChart.dll + C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.RenderingEngine11.dll + + + False + C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.RenderingEngine9.dll + + + False + C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.Wpf.Charting.LightningChart.dll ..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.39\lib\net45\Microsoft.Xaml.Behaviors.dll + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\packages\Prism.Core.8.0.0.1909\lib\net47\Prism.dll @@ -81,13 +104,10 @@ - - - Code diff --git a/mseedChart.MainModule/packages.config b/mseedChart.MainModule/packages.config index 9270256..fa9d665 100644 --- a/mseedChart.MainModule/packages.config +++ b/mseedChart.MainModule/packages.config @@ -1,6 +1,7 @@  + \ No newline at end of file diff --git a/mseedChart/mseedChart.csproj b/mseedChart/mseedChart.csproj index 746db18..9f36e7f 100644 --- a/mseedChart/mseedChart.csproj +++ b/mseedChart/mseedChart.csproj @@ -5,6 +5,7 @@ true + @@ -22,8 +23,5 @@ Always - - Always - \ No newline at end of file diff --git a/mseedChart/resources/N3102_staion_20230312.txt b/mseedChart/resources/N3102_staion_20230312.txt deleted file mode 100644 index 44e29f0..0000000 --- a/mseedChart/resources/N3102_staion_20230312.txt +++ /dev/null @@ -1,25 +0,0 @@ -net,sta,x2000,y2000,z2000,sens,begin,stop -HA,N02,38397345.33,4030593.53,1074,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N03,38397862.83,4030967.95,1057.7,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N04,38396851.28,4030947.41,1054,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N05,38397197.82,4031016.84,1071,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N06,38397507.28,4030786.06,1094.7,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N07,38397699.97,4030514.93,1091.6,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N08,38398102.95,4030707.82,1047.6,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N09,38396697.57,4030703.24,1053,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N10,38397284.87,4029883.38,1028,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N11,38397556.54,4030474.46,1092,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N12,38397781.42,4030319.64,1089.2,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N13,38397278.9,4030358.92,1050,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N14,38396943.47,4030453.01,1055,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N15,38396715.18,4030230.58,1030,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N16,38397420.7,4030035.82,1033,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N17,38397876.31,4030039.78,1133.3,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N18,38398199.8,4030163.99,1031,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N19,38397094.27,4030709.07,1076,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N20,38397529.8,4029760.44,1057.9,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N22,38398196.3,4029830.94,1056.3,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N23,38398363.7,4030000.55,1066.7,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N24,38397820.92,4029713.54,1056.5,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N26,38397120.98,4029641.15,1006,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 -HA,N27,38397672.11,4031001.47,1068.1,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000 \ No newline at end of file