Compare commits

..

No commits in common. 'main' and 'master' have entirely different histories.
main ... master

63
.gitattributes vendored

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

377
.gitignore vendored

@ -1,26 +1,363 @@
# ---> Windows ## Ignore Visual Studio temporary files, build results, and
# Windows thumbnail cache files ## files generated by popular Visual Studio add-ons.
Thumbs.db ##
Thumbs.db:encryptable ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
ehthumbs.db
ehthumbs_vista.db
# Dump file # User-specific files
*.stackdump *.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# Folder config file # User-specific files (MonoDevelop/Xamarin Studio)
[Dd]esktop.ini *.userprefs
# Recycle Bin used on file shares # Mono auto generated files
$RECYCLE.BIN/ mono_crash.*
# Windows Installer files # Build results
*.cab [Dd]ebug/
*.msi [Dd]ebugPublic/
*.msix [Rr]elease/
*.msm [Rr]eleases/
*.msp x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Windows shortcuts # Visual Studio 2015/2017 cache/options directory
*.lnk .vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

@ -1,3 +1 @@
# Txgy.MSeedHelper # mseedChart
CSharpMiniSeed格式解析

@ -0,0 +1 @@
FreeformPointLineSeries 可以从前一个点向任意方向绘制线点。

@ -0,0 +1,10 @@
using System;
namespace mseedChart.Core
{
public static class RegionNames
{
public const string ContentRegion = "ContentRegion";
}
}

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,25 @@
using mseedChart.Core;
using mseedChart.Main.ViewModels;
using mseedChart.Main.Views;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
namespace mseedChart.Main
{
public class MainModule : IModule
{
public void OnInitialized(IContainerProvider containerProvider)
{
var regionManager = containerProvider.Resolve<IRegionManager>();
regionManager.RegisterViewWithRegion(RegionNames.ContentRegion, typeof(ViewA));
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.Register<ViewA>();
containerRegistry.RegisterSingleton<ChartPlotViewModel>();
}
}
}

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mseedChart.Main.Models
{
public class LineDatas
{
private string lable;
public string Lable
{
get { return lable; }
set { lable = value; }
}
private string color;
public string Color
{
get { return color; }
set { color = value; }
}
private double smoothTension;
public double SmoothTension
{
get { return smoothTension; }
set { smoothTension = value; }
}
private double[] xData;
public double[] XData
{
get { return xData; }
set { xData = value; }
}
private double[] yData;
public double[] YData
{
get { return yData; }
set { yData = value; }
}
}
}

@ -0,0 +1,49 @@
using mseedChart.Main.Models;
using Prism.Regions;
using ScottPlot;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Input;
using System.Windows.Shapes;
namespace mseedChart.Main.ViewModels
{
public class ChartPlotViewModel
{
public Action<List<LineDatas>> InializeChartPlotChange;
public Action<List<double[]>> PlotLineDataChanged;
public ChartPlotViewModel()
{
}
public void PlotDataDemo()
{
// 生成 10天数据
int pointCount = 10000;
double[] days = new double[pointCount];
DateTime day1 = new DateTime(1890, 09, 24);
for (int i = 0; i < days.Length; i++)
days[i] = day1.AddDays(i).ToOADate();
List<LineDatas> lines = new List<LineDatas>();
Random random = new Random(10);
for (int i = 0; i < 3; i++)
{
lines.Add(new LineDatas
{
Lable = "line" + i,
SmoothTension = 1.0f,
YData = DataGen.RandomWalk(random, pointCount, 100),
XData = days
}); ;
}
InializeChartPlotChange?.Invoke(lines);
}
}
}

@ -0,0 +1,95 @@
using mseedChart.Main.Models;
using mseedChart.Main.Views;
using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
namespace mseedChart.Main.ViewModels
{
public class ViewAViewModel : BindableBase
{
public ViewAViewModel(ChartPlotViewModel chartPlotViewModel)
{
this._chartPlotViewModel = chartPlotViewModel;
Message = "View A from your Prism Module";
Timer time = new Timer(1000);
time.Elapsed += Time_Elapsed;
time.Start();
}
private string _message;
private ChartPlotViewModel _chartPlotViewModel;
private BlockingCollection<List<double[]>> queueDatas = new BlockingCollection<List<double[]>>(100);
public string Message
{
get { return _message; }
set { SetProperty(ref _message, value); }
}
public DelegateCommand<object> LoadedCommand => new(Loaded);
List<LineDatas> lines = new List<LineDatas>();
private void Loaded(object obj)
{
var chart = obj as ChartPlotView;
_chartPlotViewModel = chart.DataContext as ChartPlotViewModel;
DirectoryInfo root = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + "data");
FileInfo[] files = root.GetFiles();
List<string> SHE = new List<string>();
int step = 500;
for (int i = 0; i < 24; i++)
{
foreach (var file in files)
{
SHE = File.ReadAllLines(file.FullName).ToList();
//第一个非数据移除掉
SHE.RemoveAt(0);
var data = SHE.Select(x => Convert.ToDouble(x)+step*i);
lines.Add(new LineDatas
{
Lable = "line" + file.Name,
YData = data.ToArray(),
// XData = DateTime.Now.ToOADate()
});
}
}
_chartPlotViewModel.InializeChartPlotChange?.Invoke(lines);
Task.Run(() =>
{
while (true)
{
var data = lines.Select(x => x.YData).ToList();
for (int i = 0; i < 4; i++)
{
List<double[]> values = new List<double[]>();
foreach (var item in data)
{
var SH= item.Skip(i * 500).Take(500).ToArray();
values.Add(SH);
}
queueDatas.Add(values);
}
Debug.WriteLine("start:{0}",DateTime.Now);
System.Threading.Thread.Sleep(100);
}
});
}
private void Time_Elapsed(object sender, ElapsedEventArgs e)
{
_chartPlotViewModel.PlotLineDataChanged?.Invoke(queueDatas.Take());
}
}
}

@ -0,0 +1,15 @@
<UserControl x:Class="mseedChart.Main.Views.ChartPlotView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<WpfPlot x:Name="plt"></WpfPlot>
<CheckBox x:Name="AutoAxisCbox" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" IsChecked="True">轴自适应</CheckBox>
</Grid>
</UserControl>

@ -0,0 +1,207 @@
using ScottPlot.Plottable;
using ScottPlot;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Drawing;
using System.Reflection;
using System.Windows.Threading;
using Microsoft.Win32;
using System.Windows.Media.Imaging;
using mseedChart.Main.Models;
using mseedChart.Main.ViewModels;
using System.Security;
namespace mseedChart.Main.Views
{
/// <summary>
/// ChartPlot.xaml 的交互逻辑
/// </summary>
public partial class ChartPlotView : UserControl
{
public DispatcherTimer _renderTimer = new DispatcherTimer();
//非定时更新需停止定时器
List<SignalPlot> scatterPlots = new List<SignalPlot>();
//每天生成的最大点数*1天
const int MaxPointCount = 30_000;
int nextDataIndex = 1;
WpfPlot pl;
public ChartPlotView()
{
InitializeComponent();
//去掉右键菜单
plt.RightClicked-=plt.DefaultRightClickEvent;
// plt.RightClicked+= RightClickEvent;
var model = this.DataContext as ChartPlotViewModel;
model.InializeChartPlotChange = InializeChartPlotDates;
model.PlotLineDataChanged = PlotLineLiveData;
plt.Plot.Palette = new ScottPlot.Palettes.ColorblindFriendly();
// plt.Configuration.LockVerticalAxis = true;
List<string> lineLabels;
lineLabels = new List<string>();
for (int i = 0; i < 72; i++)
{
lineLabels.Add(i.ToString());
}
foreach (var item in lineLabels)
{
double[] data = new double[MaxPointCount];
var line = plt.Plot.AddSignal(data);
line.Label = item;
// line.Smooth = true;
// line.SmoothTension = 0.6f;
scatterPlots.Add(line);
}
plt.Refresh();
plt.Plot.XAxis.Color(Color.Black);
plt.Plot.Legend(enable: false);
// plt.Plot.Legend( false,location: Alignment.MiddleLeft);
//X轴显示格式
// plt.Plot.XAxis.TickLabelFormat("yyyy-MM-dd HH:mm:ss", dateTimeFormat: true);
_renderTimer.Interval = TimeSpan.FromMilliseconds(1000);
_renderTimer.Tick += Render;
_renderTimer.Start();
}
void Render(object sender, EventArgs e)
{
if (AutoAxisCbox.IsChecked == true)
{
plt.Plot.AxisAuto();
}
plt.Refresh();
}
int index = 1;
void PlotLineLiveData(List<double[]> runData)
{
int number = runData[0].Length;
for (int i = 0; i < scatterPlots.Count; i++) //数组平移
{
// Array.Copy(scatterPlots[i].Xs, 1, scatterPlots[i].Xs, 0, scatterPlots[i].Xs.Length - 1);
Array.Copy(scatterPlots[i].Ys, number, scatterPlots[i].Ys, 0, scatterPlots[i].Ys.Length - number);
Array.Copy(runData[i], 0, scatterPlots[i].Ys, scatterPlots[i].Ys.Length - number, number);
}
}
void InializeChartPlotDates(List<LineDatas> lineDatas)
{
nextDataIndex = lineDatas[0].YData.Length;
for (int i = 0; i < scatterPlots.Count; i++)
{
if (nextDataIndex <= MaxPointCount)
{
//内存拷贝
Array.Copy(lineDatas[i].YData, scatterPlots[i].Ys, nextDataIndex);
scatterPlots[i].MaxRenderIndex = nextDataIndex-1;
}
else
{
// scatterPlots[i].OffsetX = lineDatas[0].XData[nextDataIndex - MaxPointCount]; // Set start date
// Array.Copy(lineDatas[i].XData, nextDataIndex - MaxPointCount, scatterPlots[i].Xs, 0, MaxPointCount);
Array.Copy(lineDatas[i].YData, nextDataIndex - MaxPointCount, scatterPlots[i].Ys, 0, MaxPointCount);
scatterPlots[i].MaxRenderIndex = MaxPointCount-1;
}
}
nextDataIndex = nextDataIndex < MaxPointCount ? nextDataIndex: MaxPointCount; //最大不能超过 MaxPointCount
// plt.Plot.AxisAuto();
// plt.Refresh();
}
private void OnMouseMove(object sender, MouseEventArgs e)
{
int pixelX = (int)e.MouseDevice.GetPosition(plt).X;
int pixelY = (int)e.MouseDevice.GetPosition(plt).Y;
(double coordinateX, double coordinateY) = plt.GetMouseCoordinates();
plt.Refresh();
}
private void wpfPlot1_MouseEnter(object sender, MouseEventArgs e)
{
// MouseTrackLabel.Content = "Mouse ENTERED the plot";
// Crosshair.IsVisible = true;
}
private void wpfPlot1_MouseLeave(object sender, MouseEventArgs e)
{
//MouseTrackLabel.Content = "Mouse LEFT the plot";
//XPixelLabel.Content = "--";
//YPixelLabel.Content = "--";
//XCoordinateLabel.Content = "--";
//YCoordinateLabel.Content = "--";
// Crosshair.IsVisible = false;
// plt.Refresh();
}
public void RightClickEvent(object sender, EventArgs e)
{
var cm = new ContextMenu();
MenuItem SaveImageMenuItem = new() { Header = "保存图片" };
SaveImageMenuItem.Click += RightClickMenu_SaveImage_Click;
cm.Items.Add(SaveImageMenuItem);
MenuItem CopyImageMenuItem = new() { Header = "复制图片" };
CopyImageMenuItem.Click += RightClickMenu_Copy_Click;
cm.Items.Add(CopyImageMenuItem);
MenuItem AutoAxisMenuItem = new() { Header = "自适应数据" };
AutoAxisMenuItem.Click += RightClickMenu_AutoAxis_Click;
cm.Items.Add(AutoAxisMenuItem);
cm.IsOpen = true;
}
#region 右键菜单
private void RightClickMenu_Copy_Click(object sender, EventArgs e) => System.Windows.Clipboard.SetImage(BmpImageFromBmp(plt.Plot.Render()));
// private void RightClickMenu_Help_Click(object sender, EventArgs e) => new WPF.HelpWindow().Show();
// private void RightClickMenu_OpenInNewWindow_Click(object sender, EventArgs e) => new WpfPlotViewer(plt.Plot).Show();
private void RightClickMenu_AutoAxis_Click(object sender, EventArgs e) { plt.Plot.AxisAuto(); plt.Refresh(); }
private void RightClickMenu_SaveImage_Click(object sender, EventArgs e)
{
var sfd = new SaveFileDialog
{
FileName = "ScottPlot.png",
Filter = "PNG Files (*.png)|*.png;*.png" +
"|JPG Files (*.jpg, *.jpeg)|*.jpg;*.jpeg" +
"|BMP Files (*.bmp)|*.bmp;*.bmp" +
"|All files (*.*)|*.*"
};
if (sfd.ShowDialog() is true)
plt.Plot.SaveFig(sfd.FileName);
}
private static BitmapImage BmpImageFromBmp(System.Drawing.Bitmap bmp)
{
using var memory = new System.IO.MemoryStream();
bmp.Save(memory, System.Drawing.Imaging.ImageFormat.Png);
memory.Position = 0;
var bitmapImage = new BitmapImage();
bitmapImage.BeginInit();
bitmapImage.StreamSource = memory;
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
bitmapImage.EndInit();
bitmapImage.Freeze();
return bitmapImage;
}
#endregion
}
}

@ -0,0 +1,26 @@
<UserControl x:Class="mseedChart.Main.Views.ViewA"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:mseedChart.Main.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
d:DesignHeight="300" d:DesignWidth="300"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True">
<StackPanel>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding Path=LoadedCommand}" CommandParameter="{Binding ElementName=chartPlot}" />
</i:EventTrigger>
<i:EventTrigger EventName="Unloaded">
<i:InvokeCommandAction Command="{Binding Path=UnloadedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<TextBlock Text="{Binding Message}"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<local:ChartPlotView x:Name="chartPlot" Height="1300"/>
</StackPanel>
</UserControl>

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace mseedChart.Main.Views
{
/// <summary>
/// Interaction logic for ViewA.xaml
/// </summary>
public partial class ViewA : UserControl
{
public ViewA()
{
InitializeComponent();
}
}
}

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
<PackageReference Include="Prism.Wpf" Version="8.0.0.1909" />
<PackageReference Include="ScottPlot.WPF" Version="4.1.58" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\mseedChart.Core\mseedChart.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Arction.Wpf.Charting.LightningChart">
<HintPath>C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\Toolbox\Wpf\Arction.Wpf.Charting.LightningChart.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

@ -0,0 +1,25 @@
using mseedChart.Core;
using mseedChart.MainModule.ViewModels;
using mseedChart.MainModule.Views;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
namespace mseedChart.MainModule
{
public class MainModule : IModule
{
public void OnInitialized(IContainerProvider containerProvider)
{
var regionManager = containerProvider.Resolve<IRegionManager>();
regionManager.RegisterViewWithRegion(RegionNames.ContentRegion, typeof(ChartPlotView));
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.Register<ChartPlotView>();
containerRegistry.RegisterSingleton<ChartPlotViewModel>();
}
}
}

@ -0,0 +1,74 @@
#region 程序集 Txgy.Microseismic.BaseLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// E:\mingzf\txgy\Txgy.EWS\Client\output\Txgy.Microseismic.BaseLib.dll
// Decompiled with ICSharpCode.Decompiler 7.1.0.6543
#endregion
namespace mseedChart.MainModule.Models
{
public class CoordBase
{
private double _x = 0.0;
private double _y = 0.0;
private double _z = 0.0;
private double _md = 0.0;
public double X
{
get
{
return _x;
}
set
{
_x = value;
}
}
public double Y
{
get
{
return _y;
}
set
{
_y = value;
}
}
public double Z
{
get
{
return _z;
}
set
{
_z = value;
}
}
public double MD
{
get
{
return _md;
}
set
{
_md = value;
}
}
}
public enum FocalMechanismType
{
strikeSlip,
dipSlip,
tensile,
unknown
}
}

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mseedChart.MainModule.Models
{
public class LineDatas
{
private string lable;
public string Lable
{
get { return lable; }
set { lable = value; }
}
private string color;
public string Color
{
get { return color; }
set { color = value; }
}
private double smoothTension;
public double SmoothTension
{
get { return smoothTension; }
set { smoothTension = value; }
}
private double[] xData;
public double[] XData
{
get { return xData; }
set { xData = value; }
}
private double[] yData;
public double[] YData
{
get { return yData; }
set { yData = value; }
}
}
}

@ -0,0 +1,125 @@
#region 程序集 Txgy.Microseismic.BaseLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// E:\mingzf\txgy\Txgy.EWS\Client\output\Txgy.Microseismic.BaseLib.dll
// Decompiled with ICSharpCode.Decompiler 7.1.0.6543
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace mseedChart.MainModule.Models
{
public class MmEvent : CoordBase
{
private DateTime _eventTime;
private double _ml;
private double _rms;
public string EventTimeStr { get; set; }
public DateTime EventTime
{
get
{
return _eventTime;
}
set
{
_eventTime = value;
}
}
public double ML
{
get
{
return _ml;
}
set
{
_ml = value;
}
}
public double RMS
{
get
{
return _rms;
}
set
{
_rms = value;
}
}
private Dictionary<string, int> _phases;
public Dictionary<string, int> Phases
{
get
{
return _phases;
}
set
{
_phases = value;
}
}
public double DominantFreq { get; set; }
public string JsonFile { get; set; }
public string AsciiFile { get; set; }
public static float SetAmp(List<float> amps)
{
amps.Sort();
return amps[amps.Count / 2];
}
}
public class StationEventJson
{
public DateTime otime { get;set;}
public double lon { get; set; }
public double lat { get; set; }
public double depth { get; set; }
public double ml { get; set; }
public double rms { get; set; }
public List<phases> phases { get; set; }
public List<amps> amps { get; set; }
}
public class phases
{
public string id { get; set; }
public string name { get; set; }
public DateTime atime { get; set; }
public double resi { get; set; }
public double first_motion_direct { get; set; }
public double fmd_semi_period { get; set; }
public double deltaKm { get; set; }
public double disKm { get; set; }
public double model_time { get; set; }
public double weight { get; set; }
public double prob { get; set; }
}
public class amps
{
public string id { get; set; }
public string name { get; set; }
public DateTime atime { get; set; }
public string mag_type { get; set; }
public double mag_value { get; set; }
public double amp { get; set;
}
}
}

@ -0,0 +1,36 @@
using Prism.Commands;
using Prism.Common;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace mseedChart.MainModule.Models
{
public class StationAxis : BindableBase
{
public string Name { get; set; }
private bool _isChecked=true;
public bool IsChecked
{
get
{
return _isChecked;
}
set
{
_isChecked = value;
SetProperty(ref _isChecked, value);
}
}
public DelegateCommand<object> SelectCommand { set; get; }
}
}

@ -0,0 +1,52 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mseedChart.MainModule.Models
{
public class StationModel
{
public StationModel()
{
Dzne.Add("dz", dz);
Dzne.Add("dn", dn);
Dzne.Add("de", de);
}
public double E;
public double N;
public double Z;
public double ELon;
public double NLat;
public int PointCount { get; set; }
public int SamplingFrequency { get; set; }
public DateTime BeginTime;
public bool IsVisible = true;
public Dictionary<string, List<double>> Dzne { get; } = new Dictionary<string, List<double>>();
public List<double> dz { get; } = new List<double>();
public List<double> dn { get; } = new List<double>();
public List<double> de { get; } = new List<double>();
public string Name { get; set; }
public string FilePath { get; set; }
public double Sens { get; set; }
}
}

@ -0,0 +1,265 @@
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.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace mseedChart.MainModule.Models
{
public class WavesModel
{
public List<AxisY> CreateYAxisChart(List<StationModel> stationModels, LightningChart curChart)
{
List<AxisY> axisYList = new List<AxisY>();
foreach (var item in stationModels)
{
int distancetoX= -(int)curChart.ActualWidth + 80;
AxisY axisY = new AxisY(curChart.ViewXY);
//添加Z分量波形
if (item.dz.Count > 0)
{
axisY.SetRange(item.dz.Min(), item.dz.Max());
}
axisY.Title.Text = string.Format("Ch{0}.Z", item.Name);
axisY.Title.DistanceToAxis = distancetoX;
axisYList.Add(axisY);
//添加N分量波形
axisY = new AxisY(curChart.ViewXY);
if (item.dn.Count > 0)
{
axisY.SetRange(item.dn.Min(), item.dn.Max());
}
axisY.Title.Text = string.Format("Ch{0}.N", item.Name);
axisY.Title.DistanceToAxis = distancetoX;
axisYList.Add(axisY);
//添加E分量波形
axisY = new AxisY(curChart.ViewXY);
if (item.de.Count > 0)
{
axisY.SetRange(item.de.Min(), item.de.Max());
}
axisY.Title.Text = string.Format("Ch{0}.E", item.Name);
axisY.Title.DistanceToAxis = distancetoX;
axisYList.Add(axisY);
}
return axisYList;
}
public List<AxisY> CreateAxisYEventTime(StationEventJson stationEventJson, ViewXY chartV, List<StationModel> stationModels)
{
for (int i = 0; i < stationEventJson.phases.Count; i++)
{
phases ph= stationEventJson.phases[i];
var index= stationModels.FindIndex(a =>ph.id.Contains(a.Name));
if(index == -1)
{
continue;
}
int assignYAxisIndex = index * 3;
LineCollection lineCollection = new LineCollection()
{
AssignXAxisIndex = 0,
AssignYAxisIndex = assignYAxisIndex,
Tag=ph.id, //用于排序otime,只需要排更SHZ通道
Lines = new SegmentLine[] { new SegmentLine(chartV.XAxes[0].DateTimeToAxisValue(ph.atime), chartV.YAxes[assignYAxisIndex].Minimum, chartV.XAxes[0].DateTimeToAxisValue(ph.atime), chartV.YAxes[assignYAxisIndex].Maximum) },
ShowInLegendBox = false
};
lineCollection.LineStyle.Color = System.Windows.Media.Colors.Red;
lineCollection.Title.Text = chartV.YAxes[assignYAxisIndex].Title.Text + ph.atime.ToString();
lineCollection.Title.Visible = true;
lineCollection.Title.Font.Size = 10;
lineCollection.Title.Shadow.DropColor = System.Windows.Media.Colors.Transparent;
//lineCollection.Title.Shadow.ContrastColor = System.Windows.Media.Colors.Transparent;
lineCollection.Title.AutoPlacement = false;
lineCollection.Title.HorizontalAlign = AlignmentHorizontal.Left;
var b = chartV.XAxes[0].ValueToCoordD(chartV.XAxes[0].DateTimeToAxisValue(ph.atime))-80;
lineCollection.Title.Offset.SetValues((int)b, 3);
lineCollection.Title.Color = System.Windows.Media.Colors.Red;
chartV.LineCollections.Add(lineCollection);
}
for (int i = 0; i < stationEventJson.amps.Count; i++)
{
amps am = stationEventJson.amps[i];
var index = stationModels.FindIndex(a => am.id.Contains(a.Name));
if (index == -1)
{
continue;
}
int assignYAxisIndex = index * 3;
assignYAxisIndex = am.id.Contains("SHN") ? assignYAxisIndex + 1 : assignYAxisIndex + 2;
LineCollection lineCollection = new LineCollection()
{
AssignXAxisIndex = 0,
AssignYAxisIndex = assignYAxisIndex,
Lines = new SegmentLine[] { new SegmentLine(chartV.XAxes[0].DateTimeToAxisValue(am.atime), chartV.YAxes[assignYAxisIndex].Minimum, chartV.XAxes[0].DateTimeToAxisValue(am.atime), chartV.YAxes[assignYAxisIndex].Maximum) },
ShowInLegendBox = false
};
lineCollection.LineStyle.Color = System.Windows.Media.Colors.Red;
lineCollection.Title.Text = chartV.YAxes[assignYAxisIndex].Title.Text+ " "+ am.atime.ToString("HH:mm:ss.fff");
lineCollection.Title.Visible = true;
lineCollection.Title.Font.Size = 10;
lineCollection.Title.Shadow.DropColor = System.Windows.Media.Colors.Transparent;
// lineCollection.Title.Shadow.ContrastColor = System.Windows.Media.Colors.Transparent;
lineCollection.Title.AutoPlacement = false;
lineCollection.Title.HorizontalAlign = AlignmentHorizontal.Left;
var b= chartV.XAxes[0].ValueToCoordD(chartV.XAxes[0].DateTimeToAxisValue(am.atime))-80;
lineCollection.Title.Offset.SetValues((int)b,3);
lineCollection.Title.Color = System.Windows.Media.Colors.Red;
chartV.LineCollections.Add(lineCollection);
}
return new List<AxisY>();
}
public ConcurrentQueue<StationModel> ReadMseedFile(string dataFilePath, string asciiSavePath, bool isMultFile = false)
{
if (!Directory.Exists(Path.GetDirectoryName(dataFilePath)))
{
Directory.CreateDirectory(Path.GetDirectoryName(dataFilePath));
}
if (!Directory.Exists(Path.GetDirectoryName(asciiSavePath)))
{
Directory.CreateDirectory(Path.GetDirectoryName(asciiSavePath));
}
ConcurrentQueue<StationModel> smList = new ConcurrentQueue<StationModel>();
Stopwatch sw = Stopwatch.StartNew();
if (isMultFile)
{
var filePath = new DirectoryInfo(Path.GetDirectoryName(dataFilePath));
FileInfo[] files = filePath.GetFiles();
var mseedFiles = files.Where(i => i.Extension == ".mseed");
var asciiFiles = new DirectoryInfo(Path.GetDirectoryName(asciiSavePath));
var asciifile = asciiFiles.GetFiles();
if (asciifile.Count() == 0)
{
// 并行运算
Parallel.ForEach(mseedFiles, (item) =>
{
MSeed2Asc(item.FullName, Path.Combine(Path.GetDirectoryName(asciiSavePath), Path.GetFileNameWithoutExtension(item.Name)));
});
}
// 并行运算
Parallel.ForEach(asciiFiles.GetFiles(), (item) =>
{
var list = UpdateWavesFromTxt(item.FullName);
list.ForEach(i => smList.Enqueue(i));
});
}
else
{
if (!File.Exists(asciiSavePath))
{
MSeed2Asc(dataFilePath, asciiSavePath);
}
var list = UpdateWavesFromTxt(asciiSavePath);
list.ForEach(i => smList.Enqueue(i));
}
sw.Stop();
Debug.WriteLine("MSeed2Asc解压时间" + sw.Elapsed.TotalSeconds);
return smList;
}
public List<StationModel> UpdateWavesFromTxt(string fn)
{
string allStr;
List<StationModel> temSM = new List<StationModel>();
using (StreamReader streamReader = new StreamReader(fn))
{
allStr = streamReader.ReadToEnd();
}
if (allStr.Length > 0)
{
string[] strLines = allStr.Trim().Split(new char[] { '\n' });
// List<string> strList = strLines.ToList();
// int cnt = strList.Count;
// string[] snStr = strLines[0].Trim().Split(',');
// string tmpName = snStr[0].Substring(14, 3);
StationModel station = new StationModel();
// station.Name = tmpName;
int channelFlag = 0;
for (int i = 0; i < strLines.Length; i++)
{
string row = strLines[i].Trim();
if (strLines[i].Contains("HA"))
{
string[] rowStr = strLines[i].Split(',');
string chnStr1 = rowStr[0].Substring(21, 3);
string stationName = rowStr[0].Substring(14, 3);
if (!temSM.Any(name => name.Name == stationName))
{
station = new StationModel();
station.Name = stationName;
station.BeginTime = Convert.ToDateTime(rowStr[3]).AddHours(8);
station.PointCount = int.Parse(rowStr[1].Trim().Split(' ')[0]);
station.SamplingFrequency = int.Parse(rowStr[2].Trim().Split(' ')[0]);
temSM.Add(station);
}
channelFlag = (chnStr1 == "SHZ") ? 0 : (chnStr1 == "SHN") ? 1 : 2;
}
else
{
switch (channelFlag)
{
case 0://Z
station.dz.Add(double.Parse(row));
break;
case 1://N
station.dn.Add(double.Parse(row));
break;
case 2://E
station.de.Add(double.Parse(row));
break;
}
}
}
// temSM.Add(station);
temSM.Reverse();
}
return temSM;
}
public void MSeed2Asc(string filePath, string savePath)
{
using (Process compiler = new Process())
{
compiler.StartInfo.FileName = "mseed2ascii.exe";
compiler.StartInfo.Arguments = filePath + " -o " + savePath;
compiler.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
compiler.StartInfo.CreateNoWindow = true;
compiler.Start();
compiler.WaitForExit();
}
}
public StationEventJson ReadChartJsonFile(string jsonFile)
{
if (File.Exists(jsonFile))
{
var str = File.ReadAllText(jsonFile);
var st = JsonConvert.DeserializeObject<StationEventJson[]>(str);
StationEventJson jsonST = st[0];
return jsonST;
}
return null;
}
}
}

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("mseedChart.MainModule")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("mseedChart.MainModule")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace mseedChart.MainModule.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("mseedChart.MainModule.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace mseedChart.MainModule.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

@ -0,0 +1,27 @@
using mseedChart.MainModule.Models;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
namespace mseedChart.Core
{
public static class RegionNames
{
public const string ContentRegion = "ContentRegion";
public static string MseedFilePath = @"H:\EwsCache\Mseed"; //AppDomain.CurrentDomain.BaseDirectory + "EwsCache\\Mseed";
public static string TxtFilePath = @"H:\EwsCache\Txt";//;AppDomain.CurrentDomain.BaseDirectory + "EwsCache\\Txt";
public static string DataTypeString = "A";
public static Dictionary<string, StationModel> StationDic { get; set; }
}
}

@ -0,0 +1,690 @@
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;
using mseedChart.MainModule.Models;
using Prism.Commands;
using Prism.Events;
using Prism.Mvvm;
using SharpDX.Direct2D1;
using SharpDX.DirectWrite;
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
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;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
using System.Xml.Linq;
namespace mseedChart.MainModule.ViewModels
{
public class ChartPlotViewModel : BindableBase
{
public ChartPlotViewModel()
{
_dispatcher = Application.Current.Dispatcher;
_wavesModel = new WavesModel();
(Application.Current.MainWindow as System.Windows.Window).Closing += ApplicationClosingDispose;
CreateChart();
}
#region 字段
Dispatcher _dispatcher;
public int CurPoints;
int _channelCount = 0;
int _samplingFrequency = 500; // 采样频率 (Hz).
WavesModel _wavesModel;
private int _lChartCount = 1;
public ConcurrentQueue<StationModel> smList;
public List<AxisY> _chartAxisY=new List<AxisY>();
#endregion
#region 属性
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>
public int LChartCount
{
get { return _lChartCount; }
set { _lChartCount = value; }
}
private LightningChart _lChartAll;
/// <summary>
/// 所有波形
/// </summary>
public LightningChart LChartALL
{
get { return _lChartAll; }
set { _lChartAll = value; }
}
private FrameworkElement childContent;
public FrameworkElement ChildContent
{
get { return childContent; }
set { childContent = value; }
}
private Grid gridChart;
public Grid GridChart
{
get { return gridChart; }
set { gridChart = value; }
}
private StationEventJson _currentEventTime;
public StationEventJson CurrentEventTime
{
get { return _currentEventTime; }
set { _currentEventTime = value; }
}
private List<StationAxis> _stationsName;
public List<StationAxis> StationsName
{
get { return _stationsName; }
set {
SetProperty(ref _stationsName, value);
}
}
private string _currentTime;
public string CurrentTime
{
get { return _currentTime; }
set {
SetProperty(ref _currentTime, value);
}
}
#endregion
#region 事件
public DelegateCommand LoadedCommand => new DelegateCommand(Loaded);
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);
public DelegateCommand<object> RealTimeDataCommand => new DelegateCommand<object>(RealTimeData);
private void Loaded()
{
}
private void AxesYVisible(object isCheck)
{
if (_lChartAll != null)
{
bool yAxesVisible = ((bool)isCheck == true);
_lChartAll.BeginUpdate();
foreach (AxisY yAxis in _lChartAll.ViewXY.YAxes)
{
yAxis.Visible = yAxesVisible;
}
_lChartAll.EndUpdate();
}
}
private void FileSelector()
{
OpenFileDialog openFileDialog = new OpenFileDialog
{
RestoreDirectory = true,
Filter = ".mseed|*.mseed|.json|*.json|.txt|*.txt",
};
if (openFileDialog.ShowDialog() == true)
{
string asciiSavePath = openFileDialog.FileName.Replace("Mseed", "Txt");
asciiSavePath = Path.ChangeExtension(asciiSavePath, ".txt");
string JsonPath = Path.ChangeExtension(openFileDialog.FileName, "Json");
Stopwatch st = new Stopwatch();
st.Start();
//读取.json文件
CurrentEventTime = _wavesModel.ReadChartJsonFile(JsonPath);
//读取.mseed文件
smList = _wavesModel.ReadMseedFile(openFileDialog.FileName, asciiSavePath, IsMultFiles);
_channelCount = smList.Count * 3;
CurrentTime = smList.First().BeginTime.ToShortDateString();
StationsName = smList.Select(a => new StationAxis{Name= a.Name,IsChecked=true,SelectCommand =new DelegateCommand<object>(StationsNameVisible)}).ToList();
StartChart();
st.Stop();
Debug.WriteLine("统计时间StartChart************{0}", st.Elapsed);
FeedDatasToChart();
}
}
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); ;
}
int number = v.YAxes.Count / (_chartAxisY.Count / 3);
foreach (var item in lines.Reverse())
{
int index = item.AssignYAxisIndex;
for (int i = 0; i < number; i++)
{
if (index == -1) continue; //隐藏轴不需要处理
AxisY axisY = v.YAxes[index + i];
v.YAxes.RemoveAt(index + i);
v.YAxes.Insert(i, axisY);
}
}
LChartALL.EndUpdate();
}
}
private void YasixZENVisible(object cBox)
{
var checkBox= cBox as CheckBox;
if (_lChartAll != null)
{
_lChartAll.BeginUpdate();
bool yAxesVisible = (checkBox.IsChecked == false);
ViewXY v = _lChartAll.ViewXY;
string content = checkBox.Content.ToString();
string conStr = (content == "SHZ") ? ".Z" : (content == "SHN") ? ".N" : ".E";
for (int i = 0; i <_chartAxisY.Count; i++)
{
AxisY axisY = _chartAxisY[i];
if (axisY.Title.Text.Contains(conStr))
{
if (yAxesVisible)
{
v.YAxes.Remove(axisY);
}
else
{
string str = axisY.Title.Text.Replace(conStr, "");
int yIndex = 0;
if (content == "SHZ")
{
yIndex = v.YAxes.FindIndex(y => y.Title.Text.Contains(str));
}
else if (content == "SHE")
{
yIndex = v.YAxes.FindLastIndex(y => y.Title.Text.Contains(str));
if (yIndex != -1) yIndex += 1;
}
else
{
yIndex = v.YAxes.FindIndex(y => y.Title.Text.Contains(str));
if (yIndex != -1)
{
if (v.YAxes[yIndex].Title.Text.Contains(".Z"))
{
yIndex = yIndex + 1;
}
}
}
//如果没有查到,直接添加到前面,如果为容器最大索引,只能添加到后面
if (yIndex == -1 || (yIndex == v.YAxes.Count))
{
yIndex = v.YAxes.Count;
v.YAxes.Add(axisY);
}
else
{
v.YAxes.Insert(yIndex, axisY);
}
int sampleIndex = v.SampleDataSeries.FindIndex(y => y.Title.Text == _chartAxisY[i].Title.Text);
v.SampleDataSeries[sampleIndex].AssignYAxisIndex = yIndex;
int lineIndex = v.LineCollections.FindIndex(a => a.Title.Text.Contains(_chartAxisY[i].Title.Text));
if (lineIndex != -1)
{
v.LineCollections[lineIndex].AssignYAxisIndex = yIndex;
}
}
}
}
_lChartAll.EndUpdate();
}
}
private void IntervalSure()
{
if (_lChartAll != null)
{
_lChartAll.BeginUpdate();
if (XaisInterval >= 2)
{
_lChartAll.ViewXY.XAxes[0].MajorDivCount = XaisInterval;
}
_lChartAll.EndUpdate();
}
}
private void StationsNameVisible(object obj)
{
var station = obj as StationAxis;
if (_lChartAll != null)
{
_lChartAll.BeginUpdate();
bool yAxesVisible = (station.IsChecked == false);
ViewXY v = _lChartAll.ViewXY;
var yAxisList= _chartAxisY.Where(y => y.Title.Text.Contains(station.Name));
foreach (var item in yAxisList)
{
if (yAxesVisible)
{
v.YAxes.Remove(item);
}
else
{
v.YAxes.Add(item);
//SampleDataSeries查找数据对应的Y轴索引, 重新分配到对应的轴
int sampleIndex = v.SampleDataSeries.FindIndex(s => s.Title.Text == item.Title.Text);
v.SampleDataSeries[sampleIndex].AssignYAxisIndex = v.YAxes.Count()-1;
//LineCollections查找数据对应的Y轴索引, 重新分配到对应的轴
int lineIndex = v.LineCollections.FindIndex(s => s.Title.Text.Contains(item.Title.Text));
if (lineIndex != -1)
{
v.LineCollections[lineIndex].AssignYAxisIndex = v.YAxes.Count() - 1;
}
}
}
_lChartAll.EndUpdate();
}
}
private void RealTimeData(object isCheck)
{
if (_lChartAll != null)
{
bool yAxesVisible = ((bool)isCheck == true);
_lChartAll.BeginUpdate();
if (yAxesVisible)
{
//Set real-time monitoring automatic old data destruction
LChartALL.ViewXY.DropOldSeriesData = true;
_pointsAppended = LChartALL.ViewXY.XAxes[0].Minimum;
CompositionTarget.Rendering -= CompositionTarget_Rendering;
CompositionTarget.Rendering += CompositionTarget_Rendering;
LChartALL.ViewXY.XAxes[0].ScrollMode = XAxisScrollMode.Scrolling;
}
else
{
LChartALL.ViewXY.XAxes[0].ScrollMode = XAxisScrollMode.None;
CompositionTarget.Rendering -= CompositionTarget_Rendering;
}
_lChartAll.EndUpdate();
}
}
#endregion
private void CreateChart()
{
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.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 = false;
LChartALL.ViewXY.AxisLayout.AutoAdjustMargins = false;
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].MajorGrid.Pattern = LinePattern.Solid;
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;
XaisInterval = 5;
//图表背景颜色
LChartALL.ViewXY.GraphBackground.Color = Colors.White;
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";
GridChart.Children.Add(LChartALL);
this.ChildContent = GridChart;
}
private void StartChart()
{
DisposeAllAndClear(_chartAxisY);
ViewXY v = LChartALL.ViewXY;
LChartALL.SizeChanged -= LChartALL_SizeChanged;
LChartALL.SizeChanged += LChartALL_SizeChanged;
DisposeAllAndClear(v.YAxes);
DisposeAllAndClear(v.SampleDataSeries);
DisposeAllAndClear(v.LineCollections);
v.Margins=new Thickness(80, 30, 50, 60);
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.LegendBoxes[0].Shadow.Color = Colors.Transparent;
v.LegendBoxes[0].BorderColor = Colors.Transparent;
v.AutoSpaceLegendBoxes = true;
v.AxisLayout.SegmentsGap = 3;
v.LegendBoxes[0].Shadow.Visible = false;
StationModel stationModel = smList.First();
var beginTime= stationModel.BeginTime;
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 = beginTime.Year;
v.XAxes[0].DateOriginDay = beginTime.Day;
v.XAxes[0].DateOriginMonth = beginTime.Month;
DateTime MaxDateTime = beginTime.AddSeconds(_samplingFrequency == 500 ? 30 : 60);
v.XAxes[0].SetRange(v.XAxes[0].DateTimeToAxisValue(beginTime), v.XAxes[0].DateTimeToAxisValue(MaxDateTime));
}
double firstSampleTimeStamp = v.XAxes[0].DateTimeToAxisValue(beginTime);
int count = stationModel.Dzne.Count;
int number= smList.Count*3;
for (int i = 0; i < number; i++)
{
int seriesIndex = i;
AxisY axisY = v.YAxes[seriesIndex];
axisY.LabelsColor = Colors.Black;
axisY.Title.Shadow.DropColor = Colors.Transparent;
// axisY.Title.Shadow.ContrastColor = Colors.Transparent;
axisY.Title.AllowDragging = false;
axisY.AllowAutoYFit = false;
axisY.Units.Visible = false;
axisY.LabelsFont.Size = 10;
axisY.Title.Angle = 0;
axisY.MinorGrid.Visible = false;
axisY.AutoDivSpacing = false;
axisY.MajorDivCount = 2;
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.PanningEnabled = false;
axisY.AllowScrolling = false;
axisY.AllowScaling = false;
SampleDataSeries series = new SampleDataSeries(v, v.XAxes[0], axisY);
series.ShowInLegendBox = false;
series.FirstSampleTimeStamp = firstSampleTimeStamp;
series.SamplingFrequency = _samplingFrequency;
series.Title.Text = axisY.Title.Text;
series.SampleFormat = SampleFormat.DoubleFloat;
if (seriesIndex % 3 == 0)
{
series.LineStyle.Color = System.Windows.Media.Colors.DeepSkyBlue;
}
else if (seriesIndex % 3 == 1)
{
series.LineStyle.Color = System.Windows.Media.Colors.OrangeRed;
}
else if (seriesIndex % 3 == 2)
{
series.LineStyle.Color = System.Windows.Media.Colors.ForestGreen;
}
series.LineStyle.Width = 0.2;
series.ScrollModePointsKeepLevel = 1;
//series.ScrollingStabilizing = true;
v.SampleDataSeries.Add(series);
_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()
{
_data = new double[smList.Count * 3][];
try
{
for (int channelIndex = 0; channelIndex < smList.Count; channelIndex++)
{
_data[channelIndex * 3] = smList.ElementAt(channelIndex).dz.ToArray();
_data[channelIndex * 3 + 1] = smList.ElementAt(channelIndex).dn.ToArray();
_data[channelIndex * 3 + 2] = smList.ElementAt(channelIndex).de.ToArray();
}
// Invoke FeedNewDataToChart.
_dispatcher.Invoke(() =>
{
LChartALL.BeginUpdate();
_wavesModel.CreateAxisYEventTime(CurrentEventTime, LChartALL.ViewXY, smList.ToList());
for (int channelIndex = 0; channelIndex < _channelCount; channelIndex++)
{
LChartALL.ViewXY.SampleDataSeries[channelIndex].AddSamples(_data[channelIndex], true);
}
LChartALL.EndUpdate();
});
}
catch (Exception ex)
{
throw ex;
}
}
private void ApplicationClosingDispose(object sender, CancelEventArgs e)
{
if (LChartALL != null)
{
LChartALL.Dispose();
LChartALL = null;
}
}
private void DisposeAllAndClear<T>(List<T> list) where T : IDisposable
{
if (list == null)
{
return;
}
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;
}
}
#region 实时数据
private void CompositionTarget_Rendering(object sender, EventArgs e)
{
RenderNextFrame();
}
private void RenderNextFrame()
{
if (_lChartAll == null)
{
return;
}
_dispatcher.Invoke(() =>
{
FeedData(/*chartTitleText*/);
});
}
int _iRound = 0;
double _pointsAppended = 0;
double[][] _data;
int PreGenerateDataForRoundCount = 6;
private void FeedData(/*string chartTitleText*/)
{
if (_lChartAll != null)
{
_lChartAll.BeginUpdate();
//Append data to series
System.Threading.Tasks.Parallel.For(0, _channelCount, (seriesIndex) =>
{
double[] thisSeriesData = _data[seriesIndex];
double[] dataToAppendNow = new double[_samplingFrequency];
Array.Copy(thisSeriesData, (_iRound % PreGenerateDataForRoundCount) * _samplingFrequency, dataToAppendNow, 0, _samplingFrequency);
_lChartAll.ViewXY.SampleDataSeries[seriesIndex].AddSamples(dataToAppendNow, false);
System.Diagnostics.Debug.WriteLine("***********index:{0}, pointCount:{1},time:{2}", seriesIndex,
_lChartAll.ViewXY.SampleDataSeries[seriesIndex].PointCount, DateTime.Now);
});
_pointsAppended += 1;
//Set X axis real-time scrolling position
double lastX = _pointsAppended;
_lChartAll.ViewXY.XAxes[0].ScrollPosition = lastX;
//Update sweep bands
if (_lChartAll.ViewXY.XAxes[0].ScrollMode == XAxisScrollMode.Sweeping)
{
//Dark band of old page fading away
double pageLen = _lChartAll.ViewXY.XAxes[0].Maximum - _lChartAll.ViewXY.XAxes[0].Minimum;
double sweepGapWidth = pageLen / 20.0;
_lChartAll.ViewXY.Bands[0].SetValues(lastX - pageLen, lastX - pageLen + sweepGapWidth);
if (_lChartAll.ViewXY.Bands[0].Visible == false)
{
_lChartAll.ViewXY.Bands[0].Visible = true;
}
//Bright new page band
_lChartAll.ViewXY.Bands[1].SetValues(lastX - sweepGapWidth / 6, lastX);
if (_lChartAll.ViewXY.Bands[1].Visible == false)
{
_lChartAll.ViewXY.Bands[1].Visible = true;
}
}
else
{
//Hide sweeping bands if not in sweeping mode
//if (_lChartAll.ViewXY.Bands[0].Visible == true)
//{
// _lChartAll.ViewXY.Bands[0].Visible = false;
//}
//if (_lChartAll.ViewXY.Bands[1].Visible == true)
//{
// _lChartAll.ViewXY.Bands[1].Visible = false;
//}
}
_lChartAll.EndUpdate();
_iRound++;
}
}
#endregion
}
}

@ -0,0 +1,54 @@
<UserControl x:Class="mseedChart.MainModule.Views.ChartPlotView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:mseedChart.MainModule.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
d:DesignHeight="450" d:DesignWidth="800"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="10000*"/>
</Grid.RowDefinitions>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding Path=LoadedCommand}"/>
</i:EventTrigger>
<i:EventTrigger EventName="Unloaded">
<i:InvokeCommandAction Command="{Binding Path=UnloadedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<TextBlock Text="{Binding Message}"
HorizontalAlignment="Center"
VerticalAlignment="Top" Margin="0,162,0,0" Grid.Row="1" />
<StackPanel Orientation="Horizontal">
<CheckBox Command="{Binding AxesYVisibleCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self},Path=IsChecked}" Content="Y轴显示" VerticalContentAlignment="Center" IsChecked="True" FontSize="15" Foreground="Black" Margin="5,0,5,0" FontWeight="Bold" />
<ComboBox ItemsSource="{Binding StationsName}" SelectedIndex="{Binding SelectStationYaxisIndex}">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding IsChecked}" Command="{Binding SelectCommand}" CommandParameter="{Binding }" />
<TextBlock Text="{Binding Name}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<CheckBox Command="{Binding OtimeSortCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self},Path=IsChecked}" Content="时间排序" VerticalContentAlignment="Center" FontSize="15" Foreground="Black" Margin="5,0,5,0" FontWeight="Bold"></CheckBox>
<CheckBox Command="{Binding YasixZENVisibleCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}" IsChecked="True" Content="SHZ" VerticalContentAlignment="Center" FontSize="15" Foreground="Black" Margin="5,0,5,0" FontWeight="Bold"></CheckBox>
<CheckBox Command="{Binding YasixZENVisibleCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}" IsChecked="True" Content="SHN" VerticalContentAlignment="Center" FontSize="15" Foreground="Black" Margin="5,0,5,0" FontWeight="Bold"></CheckBox>
<CheckBox Command="{Binding YasixZENVisibleCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}" IsChecked="True" Content="SHE" VerticalContentAlignment="Center" FontSize="15" Foreground="Black" Margin="5,0,5,0" FontWeight="Bold"></CheckBox>
<TextBlock VerticalAlignment="Center">X轴间隔:</TextBlock>
<TextBox Text="{Binding XaisInterval}" Width="80" VerticalAlignment="Center"></TextBox>
<Button Grid.Column="1" Grid.Row="1" Command="{Binding IntervalSureCommand}" Margin="10,0,10,0" Background="#FF66B1FF" HorizontalAlignment="Right" Height="20" Width="30">OK</Button>
<CheckBox IsChecked="{Binding IsMultFiles}" Content="MultFiles" VerticalContentAlignment="Center" FontSize="15" Foreground="Black" FontWeight="Bold" DockPanel.Dock="Right"></CheckBox>
<Button Grid.Column="1" Grid.Row="1" Command="{Binding FileSelectorCommand}" Margin="5,0,20,0" Background="#FF66B1FF" HorizontalAlignment="Right" Width="60" Height="20">打开</Button>
<CheckBox Command="{Binding RealTimeDataCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self},Path=IsChecked}" Content="实时" VerticalContentAlignment="Center" FontSize="15" Foreground="Black" FontWeight="Bold" DockPanel.Dock="Right"></CheckBox>
</StackPanel>
<ContentControl x:Name="contentControl" Content="{Binding ChildContent}" Grid.Row="1"/>
<TextBlock Text="{Binding CurrentTime}" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="0,0,0,46"></TextBlock>
</Grid>
</UserControl>

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace mseedChart.MainModule.Views
{
/// <summary>
/// Interaction logic for ViewA.xaml
/// </summary>
public partial class ChartPlotView : UserControl
{
public ChartPlotView()
{
InitializeComponent();
}
}
}

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DryIoc" publicKeyToken="dfbf2bd50fcf7768" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.7.7.0" newVersion="4.7.7.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6B5392C6-3D2D-4890-A0BF-F5F9F84CD867}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>mseedChart.MainModule</RootNamespace>
<AssemblyName>mseedChart.MainModule</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Arction.DirectX, Version=10.4.1.4001, Culture=neutral, PublicKeyToken=6484d7bb14b95dd3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.DirectX.dll</HintPath>
</Reference>
<Reference Include="Arction.DirectXFiles, Version=10.4.1.4001, Culture=neutral, PublicKeyToken=6484d7bb14b95dd3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.DirectXFiles.dll</HintPath>
</Reference>
<Reference Include="Arction.DirectXInit, Version=10.4.1.4001, Culture=neutral, PublicKeyToken=6484d7bb14b95dd3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.DirectXInit.dll</HintPath>
</Reference>
<Reference Include="Arction.Licensing, Version=2.3.1.1, Culture=neutral, PublicKeyToken=6484d7bb14b95dd3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LicenseManager\Arction.Licensing.dll</HintPath>
</Reference>
<Reference Include="Arction.RenderingDefinitions, Version=10.4.1.4001, Culture=neutral, PublicKeyToken=6484d7bb14b95dd3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.RenderingDefinitions.dll</HintPath>
</Reference>
<Reference Include="Arction.RenderingEngine, Version=10.4.1.4001, Culture=neutral, PublicKeyToken=6484d7bb14b95dd3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.RenderingEngine.dll</HintPath>
</Reference>
<Reference Include="Arction.RenderingEngine11, Version=10.4.1.4001, Culture=neutral, PublicKeyToken=6484d7bb14b95dd3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.RenderingEngine11.dll</HintPath>
</Reference>
<Reference Include="Arction.RenderingEngine9, Version=10.4.1.4001, Culture=neutral, PublicKeyToken=6484d7bb14b95dd3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.RenderingEngine9.dll</HintPath>
</Reference>
<Reference Include="Arction.Wpf.Charting.LightningChart, Version=10.4.1.4001, Culture=neutral, PublicKeyToken=6484d7bb14b95dd3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\LibNET4\Arction.Wpf.Charting.LightningChart.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.39\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Prism, Version=8.0.0.1909, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
<HintPath>..\packages\Prism.Core.8.0.0.1909\lib\net47\Prism.dll</HintPath>
</Reference>
<Reference Include="Prism.Wpf, Version=8.0.0.1909, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
<HintPath>..\packages\Prism.Wpf.8.0.0.1909\lib\net47\Prism.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainModule.cs" />
<Compile Include="Models\CoordBase.cs" />
<Compile Include="Models\LineDatas.cs" />
<Compile Include="Models\MmEvent.cs" />
<Compile Include="Models\StationModel.cs" />
<Compile Include="Models\StationAxis.cs" />
<Compile Include="Models\WavesModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="RegionNames.cs" />
<Compile Include="ViewModels\ChartPlotViewModel.cs" />
<Compile Include="Views\ChartPlotView.xaml.cs">
<DependentUpon>ChartPlotView.xaml</DependentUpon>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Page Include="Views\ChartPlotView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net47" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net47" />
<package id="Prism.Core" version="8.0.0.1909" targetFramework="net47" />
<package id="Prism.Wpf" version="8.0.0.1909" targetFramework="net47" />
</packages>

@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32922.545
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mseedChart", "mseedChart\mseedChart.csproj", "{7A0008BD-0B8D-41AE-AB09-36DCDA7FAF93}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mseedChart.Core", "mseedChart.Core\mseedChart.Core.csproj", "{4A973AC0-90A5-4652-8F8F-AB6DCA59D906}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mseedChart.MainModule", "mseedChart.MainModule\mseedChart.MainModule.csproj", "{6B5392C6-3D2D-4890-A0BF-F5F9F84CD867}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7A0008BD-0B8D-41AE-AB09-36DCDA7FAF93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A0008BD-0B8D-41AE-AB09-36DCDA7FAF93}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A0008BD-0B8D-41AE-AB09-36DCDA7FAF93}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A0008BD-0B8D-41AE-AB09-36DCDA7FAF93}.Release|Any CPU.Build.0 = Release|Any CPU
{4A973AC0-90A5-4652-8F8F-AB6DCA59D906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A973AC0-90A5-4652-8F8F-AB6DCA59D906}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A973AC0-90A5-4652-8F8F-AB6DCA59D906}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A973AC0-90A5-4652-8F8F-AB6DCA59D906}.Release|Any CPU.Build.0 = Release|Any CPU
{6B5392C6-3D2D-4890-A0BF-F5F9F84CD867}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B5392C6-3D2D-4890-A0BF-F5F9F84CD867}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B5392C6-3D2D-4890-A0BF-F5F9F84CD867}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B5392C6-3D2D-4890-A0BF-F5F9F84CD867}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {617DC9D3-CA13-450B-9B17-161EA112D4F4}
EndGlobalSection
EndGlobal

@ -0,0 +1,9 @@
<prism:PrismApplication x:Class="mseedChart.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:mseedChart"
xmlns:prism="http://prismlibrary.com/" >
<Application.Resources>
</Application.Resources>
</prism:PrismApplication>

@ -0,0 +1,26 @@
using mseedChart.Views;
using Prism.Ioc;
using Prism.Modularity;
using System.Windows;
namespace mseedChart
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App
{
protected override Window CreateShell()
{
return Container.Resolve<MainWindow>();
}
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
}
protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
{
moduleCatalog.AddModule<mseedChart.MainModule.MainModule>();
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,19 @@
using Prism.Mvvm;
namespace mseedChart.ViewModels
{
public class MainWindowViewModel : BindableBase
{
private string _title = "Prism Application";
public string Title
{
get { return _title; }
set { SetProperty(ref _title, value); }
}
public MainWindowViewModel()
{
}
}
}

@ -0,0 +1,11 @@
<Window x:Class="mseedChart.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"
Title="{Binding Title}" Height="550" Width="825"
xmlns:core="clr-namespace:mseedChart.Core;assembly=mseedChart.Core">
<Grid>
<ContentControl prism:RegionManager.RegionName= "{x:Static core:RegionNames.ContentRegion}"/>
</Grid>
</Window>

@ -0,0 +1,15 @@
using System.Windows;
namespace mseedChart.Views
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Prism.Core" Version="8.0.0.1909" />
<PackageReference Include="Prism.DryIoc" Version="8.0.0.1909" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\mseedChart.Core\mseedChart.Core.csproj" />
<ProjectReference Include="..\mseedChart.MainModule\mseedChart.MainModule.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="EwsCache\Txt\20230329\HA.20230329T061222.01A.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="EwsCache\Txt\20230329\HA.20230329T063242.01A.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="EwsCache\Txt\20230329\HA.20230329T064121.01A.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

Binary file not shown.
Loading…
Cancel
Save