|
|
@ -187,6 +187,8 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
string asciiSavePath = openFileDialog.FileName.Replace("Mseed", "Txt");
|
|
|
|
string asciiSavePath = openFileDialog.FileName.Replace("Mseed", "Txt");
|
|
|
|
asciiSavePath = Path.ChangeExtension(asciiSavePath, ".txt");
|
|
|
|
asciiSavePath = Path.ChangeExtension(asciiSavePath, ".txt");
|
|
|
|
string JsonPath = Path.ChangeExtension(openFileDialog.FileName, "Json");
|
|
|
|
string JsonPath = Path.ChangeExtension(openFileDialog.FileName, "Json");
|
|
|
|
|
|
|
|
Stopwatch st = new Stopwatch();
|
|
|
|
|
|
|
|
st.Start();
|
|
|
|
//读取.json文件
|
|
|
|
//读取.json文件
|
|
|
|
CurrentEventTime = _wavesModel.ReadChartJsonFile(JsonPath);
|
|
|
|
CurrentEventTime = _wavesModel.ReadChartJsonFile(JsonPath);
|
|
|
|
//读取.mseed文件
|
|
|
|
//读取.mseed文件
|
|
|
@ -195,6 +197,8 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
CurrentTime = smList.First().BeginTime.ToShortDateString();
|
|
|
|
CurrentTime = smList.First().BeginTime.ToShortDateString();
|
|
|
|
StationsName = smList.Select(a => new StationAxis{Name= a.Name,IsChecked=true,SelectCommand =new DelegateCommand<object>(StationsNameVisible)}).ToList();
|
|
|
|
StationsName = smList.Select(a => new StationAxis{Name= a.Name,IsChecked=true,SelectCommand =new DelegateCommand<object>(StationsNameVisible)}).ToList();
|
|
|
|
StartChart();
|
|
|
|
StartChart();
|
|
|
|
|
|
|
|
st.Stop();
|
|
|
|
|
|
|
|
Debug.WriteLine("统计时间StartChart************:{0}", st.Elapsed);
|
|
|
|
FeedDatasToChart();
|
|
|
|
FeedDatasToChart();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -429,9 +433,12 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DisposeAllAndClear(_chartAxisY);
|
|
|
|
DisposeAllAndClear(_chartAxisY);
|
|
|
|
ViewXY v = LChartALL.ViewXY;
|
|
|
|
ViewXY v = LChartALL.ViewXY;
|
|
|
|
|
|
|
|
LChartALL.SizeChanged -= LChartALL_SizeChanged;
|
|
|
|
|
|
|
|
LChartALL.SizeChanged += LChartALL_SizeChanged;
|
|
|
|
DisposeAllAndClear(v.YAxes);
|
|
|
|
DisposeAllAndClear(v.YAxes);
|
|
|
|
DisposeAllAndClear(v.SampleDataSeries);
|
|
|
|
DisposeAllAndClear(v.SampleDataSeries);
|
|
|
|
DisposeAllAndClear(v.LineCollections);
|
|
|
|
DisposeAllAndClear(v.LineCollections);
|
|
|
|
|
|
|
|
v.Margins=new Thickness(80, 30, 50, 60);
|
|
|
|
|
|
|
|
|
|
|
|
v.YAxes.AddRange(_wavesModel.CreateYAxisChart(smList.ToList(), LChartALL));
|
|
|
|
v.YAxes.AddRange(_wavesModel.CreateYAxisChart(smList.ToList(), LChartALL));
|
|
|
|
v.LegendBoxes[0].Position = LegendBoxPositionXY.RightCenter;
|
|
|
|
v.LegendBoxes[0].Position = LegendBoxPositionXY.RightCenter;
|
|
|
@ -460,31 +467,26 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
double firstSampleTimeStamp = v.XAxes[0].DateTimeToAxisValue(beginTime);
|
|
|
|
double firstSampleTimeStamp = v.XAxes[0].DateTimeToAxisValue(beginTime);
|
|
|
|
|
|
|
|
|
|
|
|
int count = stationModel.Dzne.Count;
|
|
|
|
int count = stationModel.Dzne.Count;
|
|
|
|
int number= smList.Count;
|
|
|
|
int number= smList.Count*3;
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < number; i++)
|
|
|
|
for (int i = 0; i < number; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (int k = 0; k <count; k++)
|
|
|
|
int seriesIndex = i;
|
|
|
|
{
|
|
|
|
|
|
|
|
int seriesIndex = i * 3 + k;
|
|
|
|
|
|
|
|
AxisY axisY = v.YAxes[seriesIndex];
|
|
|
|
AxisY axisY = v.YAxes[seriesIndex];
|
|
|
|
axisY.LabelsColor = Colors.Black;
|
|
|
|
axisY.LabelsColor = Colors.Black;
|
|
|
|
axisY.Title.Shadow.DropColor = Colors.Transparent;
|
|
|
|
axisY.Title.Shadow.DropColor = Colors.Transparent;
|
|
|
|
axisY.Title.Shadow.ContrastColor = Colors.Transparent;
|
|
|
|
// axisY.Title.Shadow.ContrastColor = Colors.Transparent;
|
|
|
|
|
|
|
|
axisY.Title.AllowDragging = false;
|
|
|
|
axisY.AllowAutoYFit = false;
|
|
|
|
axisY.AllowAutoYFit = false;
|
|
|
|
axisY.Units.Visible = false;
|
|
|
|
axisY.Units.Visible = false;
|
|
|
|
axisY.LabelsAngle = 0;
|
|
|
|
axisY.LabelsFont.Size = 10;
|
|
|
|
axisY.LabelsFont.Size = 8;
|
|
|
|
|
|
|
|
axisY.Title.Angle = 0;
|
|
|
|
axisY.Title.Angle = 0;
|
|
|
|
// axisY.MajorGrid.Visible = true;
|
|
|
|
|
|
|
|
axisY.MinorGrid.Visible = false;
|
|
|
|
axisY.MinorGrid.Visible = false;
|
|
|
|
axisY.MajorGrid.Pattern = LinePattern.Solid;
|
|
|
|
|
|
|
|
axisY.AutoDivSpacing = false;
|
|
|
|
axisY.AutoDivSpacing = false;
|
|
|
|
|
|
|
|
|
|
|
|
axisY.MajorDivCount = 2;
|
|
|
|
axisY.MajorDivCount = 2;
|
|
|
|
axisY.MajorDivTickStyle.Visible = true;
|
|
|
|
|
|
|
|
axisY.MinorDivTickStyle.Visible = false;
|
|
|
|
axisY.MinorDivTickStyle.Visible = false;
|
|
|
|
axisY.MajorDivTickStyle.Alignment = seriesIndex % 2 == 0 ? Alignment.Near : Alignment.Far;
|
|
|
|
axisY.MajorDivTickStyle.Alignment = seriesIndex % 2 == 0 ? Alignment.Near : Alignment.Far;
|
|
|
|
axisY.MajorDivTickStyle.LineLength = 6;
|
|
|
|
// axisY.MajorDivTickStyle.LineLength = 6;
|
|
|
|
axisY.MajorDivTickStyle.Color = Colors.Black;
|
|
|
|
axisY.MajorDivTickStyle.Color = Colors.Black;
|
|
|
|
axisY.Title.Color = Colors.Black;
|
|
|
|
axisY.Title.Color = Colors.Black;
|
|
|
|
axisY.Title.Font = new WpfFont("Segoe UI", 10, false, false);
|
|
|
|
axisY.Title.Font = new WpfFont("Segoe UI", 10, false, false);
|
|
|
@ -493,32 +495,44 @@ namespace mseedChart.MainModule.ViewModels
|
|
|
|
axisY.AllowScaling = false;
|
|
|
|
axisY.AllowScaling = false;
|
|
|
|
|
|
|
|
|
|
|
|
SampleDataSeries series = new SampleDataSeries(v, v.XAxes[0], axisY);
|
|
|
|
SampleDataSeries series = new SampleDataSeries(v, v.XAxes[0], axisY);
|
|
|
|
series.ShowInLegendBox = true;
|
|
|
|
series.ShowInLegendBox = false;
|
|
|
|
series.FirstSampleTimeStamp = firstSampleTimeStamp;
|
|
|
|
series.FirstSampleTimeStamp = firstSampleTimeStamp;
|
|
|
|
series.SamplingFrequency = _samplingFrequency;
|
|
|
|
series.SamplingFrequency = _samplingFrequency;
|
|
|
|
series.Title.Text = axisY.Title.Text;
|
|
|
|
series.Title.Text = axisY.Title.Text;
|
|
|
|
series.SampleFormat = SampleFormat.DoubleFloat;
|
|
|
|
series.SampleFormat = SampleFormat.DoubleFloat;
|
|
|
|
if (k % 3 == 0)
|
|
|
|
if (seriesIndex % 3 == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
series.LineStyle.Color = System.Windows.Media.Colors.Blue;
|
|
|
|
series.LineStyle.Color = System.Windows.Media.Colors.DeepSkyBlue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (k % 3 == 1)
|
|
|
|
else if (seriesIndex % 3 == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
series.LineStyle.Color = System.Windows.Media.Colors.Red;
|
|
|
|
series.LineStyle.Color = System.Windows.Media.Colors.OrangeRed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (k % 3 == 2)
|
|
|
|
else if (seriesIndex % 3 == 2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
series.LineStyle.Color = System.Windows.Media.Colors.Green;
|
|
|
|
series.LineStyle.Color = System.Windows.Media.Colors.ForestGreen;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
series.LineStyle.Width = 0.5;
|
|
|
|
series.LineStyle.Width = 0.2;
|
|
|
|
series.LineStyle.AntiAliasing = LineAntialias.None;
|
|
|
|
|
|
|
|
series.ScrollModePointsKeepLevel = 1;
|
|
|
|
series.ScrollModePointsKeepLevel = 1;
|
|
|
|
series.ScrollingStabilizing = true;
|
|
|
|
//series.ScrollingStabilizing = true;
|
|
|
|
series.AllowUserInteraction = false;
|
|
|
|
|
|
|
|
v.SampleDataSeries.Add(series);
|
|
|
|
v.SampleDataSeries.Add(series);
|
|
|
|
_chartAxisY.Add(axisY);
|
|
|
|
_chartAxisY.Add(axisY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void LChartALL_SizeChanged(object sender, SizeChangedEventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item in LChartALL.ViewXY.YAxes)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//更新标题坐标
|
|
|
|
|
|
|
|
item.Title.DistanceToAxis = -(int)e.NewSize.Width+80;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach (var item in LChartALL.ViewXY.LineCollections)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double b = LChartALL.ViewXY.XAxes[0].ValueToCoordD(item.Lines[0].AX)-80;
|
|
|
|
|
|
|
|
item.Title.Offset.SetValues((int)b, 3);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void FeedDatasToChart()
|
|
|
|
private void FeedDatasToChart()
|
|
|
|