|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
using Arction.Wpf.Charting;
|
|
|
|
|
using Arction.Wpf.Charting.Axes;
|
|
|
|
|
using Arction.Wpf.Charting.SeriesXY;
|
|
|
|
|
using Arction.Wpf.Charting.Views.ViewXY;
|
|
|
|
|
using Microsoft.Win32;
|
|
|
|
|
using mseedChart.Core;
|
|
|
|
@ -9,6 +10,7 @@ using Prism.Events;
|
|
|
|
|
using Prism.Mvvm;
|
|
|
|
|
using SharpDX.DirectWrite;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Concurrent;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
@ -17,6 +19,9 @@ using System.ComponentModel.Design.Serialization;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Net.Http.Headers;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
@ -38,9 +43,9 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
CreateChart();
|
|
|
|
|
(Application.Current.MainWindow as System.Windows.Window).Closing += ApplicationClosingDispose;
|
|
|
|
|
|
|
|
|
|
string fileName = "2023-03-28T04:53:46.199584";
|
|
|
|
|
string fileName = "2023-03-28T05:14:59.108464";
|
|
|
|
|
// fileName = "2023-03-24T04:53:46.199584";
|
|
|
|
|
bool multFlies = true;
|
|
|
|
|
bool multFlies = false;
|
|
|
|
|
string eventTimeStr = fileName;
|
|
|
|
|
string datePath = eventTimeStr.Substring(0, 4) + eventTimeStr.Substring(5, 2) + eventTimeStr.Substring(8, 2);
|
|
|
|
|
string dataFilePath = RegionNames.MseedFilePath + "\\" + datePath + "\\";
|
|
|
|
@ -52,9 +57,13 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
string asciiSavePath = RegionNames.TxtFilePath + "\\" + datePath + "\\";
|
|
|
|
|
if (!multFlies)
|
|
|
|
|
{
|
|
|
|
|
_wavesModel.mseedJsonResolve(dataFilePath + dataFileName + jsonStr);
|
|
|
|
|
CurrentEventTime = _wavesModel.mseedJsonResolve(dataFilePath + dataFileName + jsonStr);
|
|
|
|
|
}
|
|
|
|
|
ShowWave(dataFilePath + dataFileName + mseedStr, asciiSavePath + dataFileName + ".txt" , multFlies);
|
|
|
|
|
|
|
|
|
|
YaxisItems.Add("SHZ");
|
|
|
|
|
YaxisItems.Add("SHN");
|
|
|
|
|
YaxisItems.Add("SHE");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 字段
|
|
|
|
@ -63,14 +72,52 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
|
|
|
|
|
int _channelCount = 0;
|
|
|
|
|
double _samplingFrequency = 500; // 采样频率 (Hz).
|
|
|
|
|
double _previousX = 0;
|
|
|
|
|
|
|
|
|
|
WavesModel _wavesModel;
|
|
|
|
|
private int _lChartCount = 1;
|
|
|
|
|
public ConcurrentQueue<StationModel> smList;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 属性
|
|
|
|
|
|
|
|
|
|
private List<string> _yaxisItems=new List<string>();
|
|
|
|
|
|
|
|
|
|
public List<string> YaxisItems
|
|
|
|
|
{
|
|
|
|
|
get { return _yaxisItems; }
|
|
|
|
|
set { _yaxisItems = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int _selectIndex=1;
|
|
|
|
|
|
|
|
|
|
public int SelectIndex
|
|
|
|
|
{
|
|
|
|
|
get { return _selectIndex; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
SetProperty(ref _selectIndex, value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool _isMultFiles;
|
|
|
|
|
|
|
|
|
|
public bool IsMultFiles
|
|
|
|
|
{
|
|
|
|
|
get { return _isMultFiles; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
SetProperty(ref _isMultFiles, value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private int _xaisInterval;
|
|
|
|
|
|
|
|
|
|
public int XaisInterval
|
|
|
|
|
{
|
|
|
|
|
get { return _xaisInterval; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
SetProperty(ref _xaisInterval, value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 波形控件数量
|
|
|
|
|
/// </summary>
|
|
|
|
@ -103,12 +150,12 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
get { return gridChart; }
|
|
|
|
|
set { gridChart = value; }
|
|
|
|
|
}
|
|
|
|
|
private MmEvent _eventTime;
|
|
|
|
|
private StationEventJson _currentEventTime;
|
|
|
|
|
|
|
|
|
|
public MmEvent EventTime
|
|
|
|
|
public StationEventJson CurrentEventTime
|
|
|
|
|
{
|
|
|
|
|
get { return _eventTime; }
|
|
|
|
|
set { _eventTime = value; }
|
|
|
|
|
get { return _currentEventTime; }
|
|
|
|
|
set { _currentEventTime = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -119,6 +166,9 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
#region 事件
|
|
|
|
|
public DelegateCommand<object> AxesYVisibleCommand => new DelegateCommand<object>(AxesYVisible);
|
|
|
|
|
public DelegateCommand FileSelectorCommand => new DelegateCommand(FileSelector);
|
|
|
|
|
public DelegateCommand<object> OtimeSortCommand => new DelegateCommand<object>(OtimeSort);
|
|
|
|
|
public DelegateCommand<object> YasixZENVisibleCommand => new DelegateCommand<object>(YasixZENVisible);
|
|
|
|
|
public DelegateCommand IntervalSureCommand => new DelegateCommand(IntervalSure);
|
|
|
|
|
|
|
|
|
|
private void AxesYVisible(object isCheck)
|
|
|
|
|
{
|
|
|
|
@ -165,13 +215,109 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
OpenFileDialog openFileDialog = new OpenFileDialog
|
|
|
|
|
{
|
|
|
|
|
RestoreDirectory = true,
|
|
|
|
|
Filter = ".json|*.json|.mseed|*.mseed|.txt|*.txt",
|
|
|
|
|
Filter = ".mseed|*.mseed|.json|*.json|.txt|*.txt",
|
|
|
|
|
};
|
|
|
|
|
if (openFileDialog.ShowDialog() == true)
|
|
|
|
|
{
|
|
|
|
|
//ShowWave(openFileDialog.FileName);
|
|
|
|
|
string asciiSavePath = openFileDialog.FileName;
|
|
|
|
|
asciiSavePath = asciiSavePath.Replace("Mseed","Txt");
|
|
|
|
|
asciiSavePath= Path.ChangeExtension(asciiSavePath, ".txt");
|
|
|
|
|
|
|
|
|
|
ShowWave(openFileDialog.FileName, asciiSavePath, IsMultFiles);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void OtimeSort(object isCheck)
|
|
|
|
|
{
|
|
|
|
|
if (_lChartAll != null)
|
|
|
|
|
{
|
|
|
|
|
LChartALL.BeginUpdate();
|
|
|
|
|
bool yAxesVisible = ((bool)isCheck == true);
|
|
|
|
|
ViewXY v= _lChartAll.ViewXY;
|
|
|
|
|
IOrderedEnumerable<LineCollection> lines;
|
|
|
|
|
if (yAxesVisible)
|
|
|
|
|
{
|
|
|
|
|
lines = v.LineCollections.Where(a => a.Tag != null && a.Tag.ToString().Contains("SHZ")).OrderBy(a => a.Lines[0].AX);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lines = v.LineCollections.Where(a => a.Tag != null && a.Tag.ToString().Contains("SHZ")).OrderByDescending(b => b.Lines[0].AX); ;
|
|
|
|
|
}
|
|
|
|
|
foreach (var item in lines)
|
|
|
|
|
{
|
|
|
|
|
var a= item.Tag.ToString().Contains("SHZ");
|
|
|
|
|
}
|
|
|
|
|
foreach (var item in lines.Reverse())
|
|
|
|
|
{
|
|
|
|
|
int index = item.AssignYAxisIndex;
|
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
|
|
|
{
|
|
|
|
|
AxisY axisY = v.YAxes[index + i];
|
|
|
|
|
v.YAxes.RemoveAt(index + i);
|
|
|
|
|
v.YAxes.Insert(i, axisY);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
LChartALL.EndUpdate();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void YasixZENVisible(object isCheck)
|
|
|
|
|
{
|
|
|
|
|
if (_lChartAll != null)
|
|
|
|
|
{
|
|
|
|
|
_lChartAll.BeginUpdate();
|
|
|
|
|
bool yAxesVisible = ((bool)isCheck == true);
|
|
|
|
|
ViewXY v = _lChartAll.ViewXY;
|
|
|
|
|
List<bool> indexs = new List<bool>();
|
|
|
|
|
switch (SelectIndex)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
indexs = v.YAxes.Select(a => a.Title.Text.Contains(".Z")).ToList();
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
indexs = v.YAxes.Select(a => a.Title.Text.Contains(".N")).ToList();
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
indexs = v.YAxes.Select(a => a.Title.Text.Contains(".E")).ToList();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < indexs.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
if (indexs[i] == true)
|
|
|
|
|
{
|
|
|
|
|
AxisY axisY = v.YAxes[i];
|
|
|
|
|
axisY.Visible = !yAxesVisible;
|
|
|
|
|
v.SampleDataSeries[i].Visible = !yAxesVisible;
|
|
|
|
|
int index = v.LineCollections.FindIndex(a => a.AssignYAxisIndex == i);
|
|
|
|
|
if (index != -1)
|
|
|
|
|
{
|
|
|
|
|
v.LineCollections[index].Visible = !yAxesVisible;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_lChartAll.EndUpdate();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void IntervalSure()
|
|
|
|
|
{
|
|
|
|
|
if (_lChartAll != null)
|
|
|
|
|
{
|
|
|
|
|
_lChartAll.BeginUpdate();
|
|
|
|
|
|
|
|
|
|
if (XaisInterval >= 2)
|
|
|
|
|
{
|
|
|
|
|
_lChartAll.ViewXY.XAxes[0].MajorDivCount = XaisInterval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_lChartAll.EndUpdate();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
public List<StationModel> UpdateWavesFromTxt(string fn)
|
|
|
|
|
{
|
|
|
|
@ -191,9 +337,6 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
CurPoints = int.Parse(snStr[1].Trim().Split(' ')[0]);
|
|
|
|
|
StationModel station = new StationModel();
|
|
|
|
|
station.Name = tmpName;
|
|
|
|
|
station.dz = new List<double>();
|
|
|
|
|
station.dn = new List<double>();
|
|
|
|
|
station.de = new List<double>();
|
|
|
|
|
|
|
|
|
|
int channelFlag = 0;
|
|
|
|
|
|
|
|
|
@ -209,6 +352,9 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
{
|
|
|
|
|
station = new StationModel();
|
|
|
|
|
station.Name = stationName;
|
|
|
|
|
station.BeginTime =Convert.ToDateTime(rowStr[3]);
|
|
|
|
|
station.PointCount = int.Parse(rowStr[1].Trim().Split(' ')[0]);
|
|
|
|
|
station.SamplingFrequency = int.Parse(rowStr[2].Trim().Split(' ')[0]);
|
|
|
|
|
temSM.Add(station);
|
|
|
|
|
}
|
|
|
|
|
if (chnStr1 == "SHZ")
|
|
|
|
@ -271,7 +417,6 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
LChartALL.ChartRenderOptions.LineAAType2D = LineAntiAliasingType.QLAA;
|
|
|
|
|
|
|
|
|
|
LChartALL.Title.Text = "事件波形";
|
|
|
|
|
// LChartALL.Title.Color = Colors.Red;
|
|
|
|
|
LChartALL.Title.Font = new WpfFont("等线", 20);
|
|
|
|
|
|
|
|
|
|
//轴属性和布局
|
|
|
|
@ -286,28 +431,22 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
LChartALL.ViewXY.ZoomPanOptions.DevicePrimaryButtonAction = UserInteractiveDeviceButtonAction.None;
|
|
|
|
|
LChartALL.ViewXY.ZoomPanOptions.DeviceSecondaryButtonAction = UserInteractiveDeviceButtonAction.None;
|
|
|
|
|
LChartALL.ViewXY.ZoomPanOptions.WheelZooming = WheelZooming.Off;
|
|
|
|
|
|
|
|
|
|
// 反锯齿系数。值0和1都不会应用反锯齿
|
|
|
|
|
LChartALL.ChartRenderOptions.AntiAliasLevel = 0;
|
|
|
|
|
//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.DateTime;
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].AutoFormatLabels = false;
|
|
|
|
|
// LChartALL.ViewXY.XAxes[0].LabelsNumberFormat = "N0";
|
|
|
|
|
// LChartALL.ViewXY.XAxes[0].MajorGrid.Pattern = LinePattern.Solid;
|
|
|
|
|
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].MinorGrid.Visible = false;
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].MajorGrid.Pattern = LinePattern.Solid;
|
|
|
|
|
|
|
|
|
|
//LChartALL.ViewXY.XAxes[0].MinimumDateTime=DateTime.Now;
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].AutoDivSpacing = false;
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].MinorDivTickStyle.Visible = true;
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].ValueType = AxisValueType.DateTime;
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].KeepDivCountOnRangeChange = true;
|
|
|
|
|
//LChartALL.ViewXY.XAxes[0].MajorDiv =6;
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].LabelsColor = Colors.Black;
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].AutoDivSpacing = false;
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].MajorDivCount = 5;
|
|
|
|
|
LChartALL.ViewXY.XAxes[0].LabelsTimeFormat = "HH:mm.ss.ffff";
|
|
|
|
|
XaisInterval = 5;
|
|
|
|
|
|
|
|
|
|
//图表背景颜色
|
|
|
|
|
LChartALL.ViewXY.GraphBackground.Color = Colors.White;
|
|
|
|
|
//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);
|
|
|
|
@ -333,7 +472,6 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
{
|
|
|
|
|
var filePath = new DirectoryInfo(Path.GetDirectoryName(dataFilePath));
|
|
|
|
|
FileInfo[] files = filePath.GetFiles();
|
|
|
|
|
//var dic = file.GetDirectories();
|
|
|
|
|
var mseedFiles = files.Where(i => i.Extension == ".mseed");
|
|
|
|
|
|
|
|
|
|
var asciiFiles = new DirectoryInfo(Path.GetDirectoryName(asciiSavePath));
|
|
|
|
@ -344,7 +482,7 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
Stopwatch sw = Stopwatch.StartNew();
|
|
|
|
|
Parallel.ForEach(mseedFiles, (item) =>
|
|
|
|
|
{
|
|
|
|
|
MSeed2Asc(item.FullName, asciiSavePath + Path.GetFileNameWithoutExtension(item.Name));
|
|
|
|
|
MSeed2Asc(item.FullName, Path.Combine(Path.GetDirectoryName(asciiSavePath), Path.GetFileNameWithoutExtension(item.Name)));
|
|
|
|
|
});
|
|
|
|
|
sw.Stop();
|
|
|
|
|
Debug.WriteLine("MSeed2Asc解压时间:" +sw.Elapsed.TotalSeconds);
|
|
|
|
@ -374,19 +512,44 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
|
|
|
|
|
private void UpdateChart()
|
|
|
|
|
{
|
|
|
|
|
ViewXY v= LChartALL.ViewXY;
|
|
|
|
|
DisposeAllAndClear(v.YAxes);
|
|
|
|
|
DisposeAllAndClear(v.SampleDataSeries);
|
|
|
|
|
DisposeAllAndClear(v.LineCollections);
|
|
|
|
|
|
|
|
|
|
DisposeAllAndClear(LChartALL.ViewXY.YAxes);
|
|
|
|
|
DisposeAllAndClear(LChartALL.ViewXY.SampleDataSeries);
|
|
|
|
|
v.YAxes.AddRange(_wavesModel.CreateYAxisChart(smList.ToList(), LChartALL));
|
|
|
|
|
v.LegendBoxes[0].Position = LegendBoxPositionXY.RightCenter;
|
|
|
|
|
v.LegendBoxes[0].Offset.SetValues(-10, 180);
|
|
|
|
|
v.LegendBoxes[0].Layout = LegendBoxLayout.Vertical;
|
|
|
|
|
v.LegendBoxes[0].Visible = false;
|
|
|
|
|
v.AutoSpaceLegendBoxes = true;
|
|
|
|
|
v.AxisLayout.SegmentsGap = 3;
|
|
|
|
|
v.LegendBoxes[0].Shadow.Visible =false;
|
|
|
|
|
|
|
|
|
|
LChartALL.ViewXY.YAxes.AddRange(_wavesModel.CreateYAxisChart(smList.ToList(), LChartALL));
|
|
|
|
|
int seriesIndex = 0;
|
|
|
|
|
foreach (var axisY in LChartALL.ViewXY.YAxes)
|
|
|
|
|
StationModel stationModel = smList.ElementAt(0);
|
|
|
|
|
if (AxisValueType.DateTime == v.XAxes[0].ValueType)
|
|
|
|
|
{
|
|
|
|
|
//设置X轴的开始时间
|
|
|
|
|
v.XAxes[0].AutoFormatLabels = false;
|
|
|
|
|
v.XAxes[0].LabelsTimeFormat = "HH:mm:ss.ff";
|
|
|
|
|
v.XAxes[0].DateOriginYear = CurrentEventTime.otime.Year;
|
|
|
|
|
v.XAxes[0].DateOriginDay = CurrentEventTime.otime.Day;
|
|
|
|
|
v.XAxes[0].DateOriginMonth = CurrentEventTime.otime.Month;
|
|
|
|
|
|
|
|
|
|
DateTime MaxDateTime = CurrentEventTime.otime.AddSeconds(_samplingFrequency == 500 ? 30 : 60);
|
|
|
|
|
v.XAxes[0].SetRange(v.XAxes[0].DateTimeToAxisValue(CurrentEventTime.otime), v.XAxes[0].DateTimeToAxisValue(MaxDateTime));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double firstSampleTimeStamp = v.XAxes[0].DateTimeToAxisValue(CurrentEventTime.otime);
|
|
|
|
|
for (int i = 0; i < smList.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
for (int k = 0; k < smList.ElementAt(i).Dzne.Count; k++)
|
|
|
|
|
{
|
|
|
|
|
int seriesIndex = i * 3 + k;
|
|
|
|
|
AxisY axisY= v.YAxes[seriesIndex];
|
|
|
|
|
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;
|
|
|
|
@ -395,11 +558,9 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
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;
|
|
|
|
@ -408,27 +569,36 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
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++;
|
|
|
|
|
SampleDataSeries series = new SampleDataSeries(v, v.XAxes[0], axisY);
|
|
|
|
|
series.ShowInLegendBox = true;
|
|
|
|
|
series.FirstSampleTimeStamp = firstSampleTimeStamp;
|
|
|
|
|
series.SamplingFrequency = _samplingFrequency;
|
|
|
|
|
series.Title.Text = axisY.Title.Text;
|
|
|
|
|
series.SampleFormat = SampleFormat.DoubleFloat;
|
|
|
|
|
if (k % 3 == 0)
|
|
|
|
|
{
|
|
|
|
|
series.LineStyle.Color = System.Windows.Media.Colors.Blue;
|
|
|
|
|
}
|
|
|
|
|
else if (k % 3 == 1)
|
|
|
|
|
{
|
|
|
|
|
series.LineStyle.Color = System.Windows.Media.Colors.Red;
|
|
|
|
|
}
|
|
|
|
|
else if (k % 3 == 2)
|
|
|
|
|
{
|
|
|
|
|
series.LineStyle.Color = System.Windows.Media.Colors.Green;
|
|
|
|
|
}
|
|
|
|
|
series.LineStyle.Width =0.5;
|
|
|
|
|
series.LineStyle.AntiAliasing = LineAntialias.None;
|
|
|
|
|
series.ScrollModePointsKeepLevel = 1;
|
|
|
|
|
series.ScrollingStabilizing = true;
|
|
|
|
|
series.AllowUserInteraction = false;
|
|
|
|
|
v.SampleDataSeries.Add(series);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
LChartALL.ViewXY.SampleDataSeries.AddRange(
|
|
|
|
|
_wavesModel.GetSampleDataSeriesPingPu(smList.ToList(), LChartALL, LChartALL.ViewXY.XAxes[0],
|
|
|
|
|
LChartALL.ViewXY.YAxes, _samplingFrequency));
|
|
|
|
|
}
|
|
|
|
|
private void UpdateChartData()
|
|
|
|
|
{
|
|
|
|
@ -494,15 +664,11 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
|
private void FeedNewDataToChar(double[][] data)
|
|
|
|
|
{
|
|
|
|
|
LChartALL.BeginUpdate();
|
|
|
|
|
|
|
|
|
|
_wavesModel.CreateAxisYEventTime(EventTime, LChartALL.ViewXY);
|
|
|
|
|
_wavesModel.CreateAxisYEventTime(CurrentEventTime, LChartALL.ViewXY, smList.ToList());
|
|
|
|
|
for (int channelIndex = 0; channelIndex < _channelCount; channelIndex++)
|
|
|
|
|
{
|
|
|
|
|
LChartALL.ViewXY.SampleDataSeries[channelIndex].AddSamples(data[channelIndex], true);
|
|
|
|
|
}
|
|
|
|
|
// _previousX = (double)_samplesOutput / _samplingFrequency;
|
|
|
|
|
|
|
|
|
|
// LChartALL.ViewXY.XAxes[0].ScrollPosition = _previousX;
|
|
|
|
|
LChartALL.EndUpdate();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|