添加项目文件。

master
gekoukate 2 years ago
parent fbe63a45d7
commit 2cf718323a

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" />
</startup>
</configuration>

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

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace WpfApp1
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
}
}

@ -0,0 +1,12 @@
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
</Grid>
</Window>

@ -0,0 +1,28 @@
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 WpfApp1
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("WpfApp1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WpfApp1")]
[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 WpfApp1.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("WpfApp1.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 WpfApp1.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,102 @@
<?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>{92B5468F-C7FF-4295-A8D1-BE9B117C2287}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>WpfApp1</RootNamespace>
<AssemblyName>WpfApp1</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>
<ItemGroup>
<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\Toolbox\Wpf\Arction.Wpf.Charting.LightningChart.dll</HintPath>
</Reference>
<Reference Include="System" />
<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>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<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>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -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,32 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mseedChart.MainModule.Models
{
public class ChannelModel
{
public string Name { get; set; }
public double[] datas { get; set; }
public void ReadDataFromTxt(string fn, int channelIndex)
{
datas = new double[30000];
string allline;
using (StreamReader streamReader = new StreamReader(fn))
{
allline = streamReader.ReadToEnd();
}
string[] strs = allline.Split(new char[] { '\n' });
for (int i = 0; i < datas.Length; i++)
{
datas[i] = double.Parse(strs[channelIndex * 30001 + i + 1]);
}
}
}
}

@ -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,355 @@
#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 bool isShow;
public int MoniID = 0;
public int LayerID = 0;
public int EventID = 0;
private int _second;
private int _milliSecond;
private DateTime _eventTime;
private double _horiError;
private double _vertError;
private double _cnt;
private double _ml;
private double _rms;
private Dictionary<string, int> _phases;
public float[] standData;
public float[][] nearData;
public float minTimeDiff = 0f;
public bool Falcone = false;
public float errorCircularRadius = 0f;
public float errorH = 0f;
public int isShowed = 1;
public float Hlen = 0f;
public float Llen = 0f;
public float VF = 0f;
public List<int> SN = new List<int>();
public List<int> PM = new List<int>();
public List<int> GCS = new List<int>();
public int WorkAreaID { get; set; } = 0;
public bool IsShow
{
get
{
return isShow;
}
set
{
isShow = value;
}
}
public int Second
{
get
{
return _second;
}
set
{
_second = value;
}
}
public int Millisecond
{
get
{
return _milliSecond;
}
set
{
_milliSecond = value;
}
}
public string EventTimeStr { get; set; }
public DateTime EventTime
{
get
{
return _eventTime;
}
set
{
_eventTime = value;
}
}
public double HoriError
{
get
{
return _horiError;
}
set
{
_horiError = value;
}
}
public double VertError
{
get
{
return _vertError;
}
set
{
_vertError = value;
}
}
public double Cnt
{
get
{
return _cnt;
}
set
{
_cnt = value;
}
}
public double ML
{
get
{
return _ml;
}
set
{
_ml = value;
}
}
public double RMS
{
get
{
return _rms;
}
set
{
_rms = value;
}
}
public Dictionary<string, int> Phases
{
get
{
return _phases;
}
set
{
_phases = value;
}
}
public double Stress { get; set; }
public double Energy { get; set; }
public int LocSta { get; set; }
public int MLSta { get; set; }
public string EventTpye { get; set; }
public int SourceChara { get; set; }
public double Direction { get; set; }
public double StressDrop { get; set; }
public double DominantFreq { get; set; }
public double MW { get; set; }
public double Amplitude { get; set; }
public double Semiperiod { get; set; }
public double Coda { get; set; }
public string JsonFile { get; set; }
public string MseedFile { get; set; }
public string AsciiFile { get; set; }
public float Amp { get; set; }
public FocalMechanismType FocalType { get; set; }
public static void SavePos(string fn, List<MmEvent> mMEvents)
{
StreamWriter streamWriter = new StreamWriter(fn);
try
{
if (mMEvents != null && mMEvents.Count > 0)
{
streamWriter.WriteLine(mMEvents.Count.ToString());
List<MmEvent> list = (from o in mMEvents
orderby o.Second, o.Millisecond
select o).ToList();
for (int i = 0; i < list.Count; i++)
{
MmEvent mmEvent = list[i];
streamWriter.WriteLine(Math.Round(mmEvent.X, 1) + "\t" + Math.Round(mmEvent.Y, 1) + "\t" + Math.Round(mmEvent.Z, 1) + "\t" + mmEvent.Second + "." + mmEvent.Millisecond);
}
}
}
catch (Exception)
{
throw;
}
finally
{
streamWriter.Close();
}
}
public static void SaveNewPin(string fn, int layerIndex, List<MmEvent> mMEvents)
{
StreamWriter streamWriter = new StreamWriter(fn);
int num = layerIndex;
int num2 = layerIndex;
try
{
List<MmEvent> list = (from o in mMEvents
orderby o.Second, o.Millisecond
select o).ToList();
for (int i = 0; i < list.Count; i++)
{
MmEvent mmEvent = list[i];
string pMStr = GetPMStr(mmEvent);
streamWriter.WriteLine(Math.Round(mmEvent.X, 1) + "\t" + Math.Round(mmEvent.Y, 1) + "\t" + Math.Round(mmEvent.Z, 1) + "\t" + mmEvent.Second + "." + mmEvent.Millisecond + "\t" + num + "\t" + num2 + "\t" + mmEvent.errorCircularRadius + "\t" + mmEvent.errorH + "\t" + 0 + "\t" + mmEvent.ML + pMStr);
}
streamWriter.Close();
}
catch (Exception)
{
throw;
}
finally
{
streamWriter.Close();
}
}
public static void SaveOldPin(string fn, int layer, List<MmEvent> mMEvents)
{
StreamWriter streamWriter = new StreamWriter(fn);
try
{
List<MmEvent> list = (from o in mMEvents
orderby o.Second, o.Millisecond
select o).ToList();
for (int i = 0; i < list.Count; i++)
{
MmEvent mmEvent = list[i];
string pMStr = GetPMStr(mmEvent);
streamWriter.WriteLine(layer + "\t" + Math.Round(mmEvent.X, 0) + "\t" + Math.Round(mmEvent.Y, 0) + "\t" + Math.Round(mmEvent.Z, 0) + "\t" + mmEvent.Second + "." + mmEvent.Millisecond + "\t" + mmEvent.ML + "\t" + mmEvent.errorCircularRadius + "\t" + mmEvent.errorH + "\t" + mmEvent.minTimeDiff + pMStr);
}
streamWriter.Close();
}
catch (Exception)
{
throw;
}
finally
{
streamWriter.Close();
}
}
public static string GetPMStr(MmEvent p)
{
string text = "\t";
int[] mpIndex = new int[p.SN.Count];
for (int j = 0; j < mpIndex.Length; j++)
{
mpIndex[j] = p.SN[j];
}
for (int k = 0; k < mpIndex.Length - 1; k++)
{
for (int l = 0; l < mpIndex.Length - 1 - k; l++)
{
if (mpIndex[l] > mpIndex[l + 1])
{
int num = mpIndex[l];
mpIndex[l] = mpIndex[l + 1];
mpIndex[l + 1] = num;
}
}
}
int i;
for (i = 0; i < p.PM.Count; i++)
{
int index = p.SN.FindIndex((int s) => s == mpIndex[i]);
text = ((p.PM.Count - 1 != i) ? (text + p.SN[index] + ":" + p.PM[index] + "\t") : (text + p.SN[index] + ":" + p.PM[index]));
}
return text;
}
public void SetEnergy()
{
Energy = Math.Round(63000.0 * Math.Pow(10.0, 1.47 * ML), 2);
}
public static float SetAmp(List<float> amps)
{
amps.Sort();
return amps[amps.Count / 2];
}
}
}

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mseedChart.MainModule.Models
{
public class ShareProperty
{
public ShareProperty(int id, string name)
{
this.ID = id;
this.Name = name;
}
public int ID { get; set; }
public string Name { get; set; }
}
}

@ -0,0 +1,46 @@
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 double E;
public double N;
public double Z;
public double ELon;
public double NLat;
public DateTime BeginUseTime;
public DateTime StopUseTime;
public bool IsVisible = true;
public List<double> dz = new List<double>();
public List<double> dn = new List<double>();
public List<double> de = new List<double>();
public ConcurrentQueue<double> cz = new ConcurrentQueue<double>();
public ConcurrentQueue<double> ce = new ConcurrentQueue<double>();
public ConcurrentQueue<double> cn = new ConcurrentQueue<double>();
public string Name { get; set; }
public string FilePath { get; set; }
public double Sens { get; set; }
}
}

@ -0,0 +1,212 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace mseedChart.MainModule.Models
{
public class StationWorkModel
{
public static object _lock = new object();
public int Sampling { get; set; }
public int StationCnt { get; set; }
/// <summary>
/// 任务总数
/// </summary>
public int TaskCnt { get; set; }
public string[] files { get; set; }
public List<StationModel> Stations { get; set; }
/// <summary>
/// 单文件长度(个)
/// </summary>
public int SingleFileLength = 30000;
public void InitWork()
{
Stations = new List<StationModel>();
TaskCnt = StationCnt = files.Length;
for (int i = 0; i < StationCnt; i++)
{
string fn = Path.GetFileNameWithoutExtension(files[i]).Substring(3, 3);
StationModel sm = new StationModel();
sm.Name = fn;
sm.FilePath = files[i];
Stations.Add(sm);
}
}
public void StartWriter()
{
Task[] tasks = new Task[TaskCnt];
for (int i = 0; i < TaskCnt; i++)
{
int num = i;
//Func<bool> func = (s, ri) =>
// Writer(ri);
//func.b
Func<StationModel, ChannelModel> func = WriteChannelZ;
AsyncCallback asyncCallback = ar =>
{
ChannelModel cm = func.EndInvoke(ar);
//Stopwatch stopWatch = new Stopwatch();
//stopWatch.Start();//开始或继续测量某个时间间隔的运行时间
lock (_lock)
{
for (int k = 0; k < SingleFileLength; k++)
{
int nk = k;
Stations[num].cz.Enqueue(cm.datas[nk]);
}
}
//stopWatch.Stop();//停止测量某个时间间隔的运行时间。
//TimeSpan ts = stopWatch.Elapsed;
//Console.WriteLine("读取耗时:{0}ms",ts.TotalMilliseconds);
};
func.BeginInvoke(Stations[num], asyncCallback, null);
//ChannelModel cm = func.EndInvoke(func.BeginInvoke(Stations[i],null,null));
//AsyncCallback asyncCallback = ar =>
//{
// ChannelModel cm = (ChannelModel)ar.AsyncState;
// if (cm != null)
// {
// Stopwatch stopWatch = new Stopwatch();
// stopWatch.Start();//开始或继续测量某个时间间隔的运行时间
// lock (_lock)
// {
// for (int k = 0; k < SingleFileLength; k++)
// {
// Stations[i].cz.Enqueue(cm.datas[k]);
// }
// }
// stopWatch.Stop();//停止测量某个时间间隔的运行时间。
// TimeSpan ts = stopWatch.Elapsed;
// Console.WriteLine(ts.TotalMilliseconds);
// }
//};
//func.BeginInvoke(Stations[i], asyncCallback, null);
//tasks[num] = Task.Run(() =>
//{ Writer(Stations[num]); });
//Action
}
// Task.WaitAll(tasks);
//Thread.Sleep(100);
}
public void StartReader()
{
//Task[] tasks2 = new Task[TaskCnt];
//for (int i = 0; i < TaskCnt; i++)
//{
// int num = i;
// tasks2[num] = Task.Run(() =>
// { Reader(Stations[num]); });
//}
}
public ChannelModel WriteChannelZ(StationModel sm)
{
ChannelModel cm = new ChannelModel();
cm.Name = sm.Name;
cm.datas = new double[SingleFileLength];
string al = new StreamReader(sm.FilePath).ReadToEnd();
string[] als = al.Split(new char[] { '\n' });
for (int k = 0; k < SingleFileLength; k++)
{
int num = k;
double value = (double.TryParse(als[num + 1], out double zz) ? zz : 0);
if (value < 30000)
{
cm.datas[num] = 32400;
continue;
}
//Console.WriteLine(value);
cm.datas[k] = (value);
}
return cm;
}
public void Writer(StationModel sm)
{
//while (true)
List<double> data = new List<double>();
//{
if (sm.cz.IsEmpty)
{
//Stopwatch stopWatch = new Stopwatch();
//stopWatch.Start();//开始或继续测量某个时间间隔的运行时间
string al = new StreamReader(sm.FilePath).ReadToEnd();
string[] als = al.Split(new char[] { '\n' });
lock (_lock)
{
for (int k = 0; k < SingleFileLength; k++)
{
int num = k;
int value = (int)(int.TryParse(als[num + 1], out int zz) ? zz : sm.cz.Average());
if (value < 30000)
Console.WriteLine(value);
sm.cz.Enqueue(value);
}
for (int k = 0; k < SingleFileLength; k++)
{
int num = k;
int value = (int)(int.TryParse(als[num + 30003], out int ee) ? ee : sm.ce.Average());
sm.ce.Enqueue(value);
}
for (int k = 0; k < SingleFileLength; k++)
{
int num = k;
int value = (int)(int.TryParse(als[num + 60004], out int nn) ? nn : sm.cn.Average());
sm.cn.Enqueue(value);
}
//Stopwatch stopWatch = new Stopwatch();
//stopWatch.Start();//开始或继续测量某个时间间隔的运行时间
//data.AddRange(sm.cz.ToList());
//stopWatch.Stop();//停止测量某个时间间隔的运行时间。
//TimeSpan ts = stopWatch.Elapsed;
//Console.WriteLine(ts.TotalMilliseconds);
// Get the elapsed time as a TimeSpan value.
//TimeSpan ts = stopWatch.Elapsed; //获取当前实例测量得出的总运行时间。
//Console.WriteLine($"{dp.station}.{dp.channel}\t生产出:{dp.cz.Count}\t耗时:{ts.TotalMilliseconds}");
//Console.WriteLine($"{dp.station}.{dp.channel}\t生产出:{dp.ce.Count}\t耗时:{ts.TotalMilliseconds}");
//Console.WriteLine($"{dp.station}.{dp.channel}\t生产出:{dp.cn.Count}\t耗时:{ts.TotalMilliseconds}");
}
}
Thread.Sleep(1);
//}
}
public double[] Reader(StationModel sm, int cnt)
{
double[] js = new double[cnt];
//while (true)
//{
//int ri = 0;
List<int> cz = new List<int>();
List<int> ce = new List<int>();
List<int> cn = new List<int>();
lock (_lock)
{
for (int i = 0; i < js.Length; i++)
{
int index = i;
sm.cz.TryDequeue(out js[index]);
}
}
return js;
}
}
}

@ -0,0 +1,445 @@
using Arction.Wpf.ChartingMVVM.Axes;
using Arction.Wpf.ChartingMVVM.SeriesXY;
using Arction.Wpf.ChartingMVVM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
namespace mseedChart.MainModule.Models
{
public class WavesModel
{
// Constants
double YMin = 30000; // Minimal y-value.
double YMax = 35000; // Maximal y-value.
public AxisX GetAxisX(int XMax)
{
AxisX axisX = new AxisX();
axisX.ScrollPosition = 0;
axisX.ScrollMode = XAxisScrollMode.Stepping;
axisX.Maximum = XMax;
axisX.SweepingGap = 1;
//axisX.AxisColor = Colors.Blue;
//axisX.LabelsColor = Colors.Black;
//axisX.GridStripColor = Colors.Black;
//axisX.
axisX.Title.Visible = false;
return axisX;
}
public List<AxisY> CreateYAxisPingPu(List<StationModel> stationModels, LightningChart curChart)
{
List<AxisY> axisYList = new List<AxisY>();
foreach (var item in stationModels)
{
AxisY axisYZ = new AxisY(curChart.ViewXY);
//添加Z分量波形
if (item.dz.Count > 0)
{
axisYZ.SetRange(item.dz.Min(), item.dz.Max());
}
axisYZ.AllowAutoYFit = false;
axisYZ.Title.Font = new WpfFont("Segoe UI", 10, false, false);
axisYZ.Title.Text = string.Format("Ch{0}.Z", item.Name);
axisYZ.Title.Angle = 0;
//axisYZ.Title.Color = Colors.Black;
//axisYZ.Title.
axisYZ.Units.Visible = false;
axisYList.Add(axisYZ);
//添加N分量波形
AxisY axisYN = new AxisY(curChart.ViewXY);
if (item.dn.Count > 0)
{
axisYN.SetRange(item.dn.Min(), item.dn.Max());
}
axisYN.Title.Font = new WpfFont("Segoe UI", 10, false, false);
axisYN.Title.Text = string.Format("Ch{0}.N", item.Name);
axisYN.Title.Angle = 0;
//axisYN.Title.Color = Colors.Black;
axisYN.Units.Visible = false;
axisYList.Add(axisYN);
//添加E分量波形
AxisY axisYE = new AxisY(curChart.ViewXY);
if (item.de.Count > 0)
{
axisYE.SetRange(item.de.Min(), item.de.Max());
}
axisYE.Title.Font = new WpfFont("Segoe UI", 10, false, false);
axisYE.Title.Text = string.Format("Ch{0}.E", item.Name);
axisYE.Title.Angle = 0;
//axisYE.Title.Color = Colors.Black;
axisYE.Units.Visible = false;
axisYList.Add(axisYE);
}
return axisYList;
}
public List<SampleDataSeries> GetSampleDataSeriesPingPu(List<StationModel> stationModels, LightningChart curChart, AxisX xAxes, AxisYCollection axisY, double samplingFrequency)
{
List<SampleDataSeries> sampleList = new List<SampleDataSeries>();
for (int i = 0; i < stationModels.Count; i++)
{
//Bug在波形数据少于台站数量时出现错误
if (i < axisY.Count)
{
}
//Z
SampleDataSeries seriesZ = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3]);
seriesZ.SampleFormat = SampleFormat.DoubleFloat;
//series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
seriesZ.LineStyle.Color = System.Windows.Media.Colors.Blue;
seriesZ.SamplingFrequency = samplingFrequency;
seriesZ.FirstSampleTimeStamp = 1.0 / samplingFrequency;
seriesZ.LineStyle.Width = 1;
seriesZ.LineStyle.AntiAliasing = LineAntialias.None;
seriesZ.ScrollModePointsKeepLevel = 1;
seriesZ.ScrollingStabilizing = true;
seriesZ.AllowUserInteraction = false;
//Set custom colored palette
System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(seriesZ.LineStyle.Color, System.Windows.Media.Colors.Gray, 50);
System.Windows.Media.Color colorCenter = seriesZ.LineStyle.Color;
seriesZ.ValueRangePalette.Steps.Clear(); //Remove existing palette steps
seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, -100));
seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorCenter, 0));
seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, 100));
sampleList.Add(seriesZ);
//E
SampleDataSeries seriesE = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3 + 1]);
seriesE.SampleFormat = SampleFormat.DoubleFloat;
//series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
seriesE.LineStyle.Color = System.Windows.Media.Colors.Red;
seriesE.SamplingFrequency = samplingFrequency;
seriesE.FirstSampleTimeStamp = 1.0 / samplingFrequency;
seriesE.LineStyle.Width = 1;
seriesE.LineStyle.AntiAliasing = LineAntialias.None;
seriesE.ScrollModePointsKeepLevel = 1;
seriesE.ScrollingStabilizing = true;
seriesE.AllowUserInteraction = false;
//Set custom colored palette
//System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50);
//System.Windows.Media.Color colorCenter = series.LineStyle.Color;
//seriesE.ValueRangePalette.Steps.Clear(); //Remove existing palette steps
//seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorEdge, -100));
//seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorCenter, 0));
//seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorEdge, 100));
sampleList.Add(seriesE);
//N
SampleDataSeries seriesN = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3 + 2]);
seriesN.SampleFormat = SampleFormat.DoubleFloat;
//series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
seriesN.LineStyle.Color = System.Windows.Media.Colors.Green;
seriesN.SamplingFrequency = samplingFrequency;
seriesN.FirstSampleTimeStamp = 1.0 / samplingFrequency;
seriesN.LineStyle.Width = 1;
seriesN.LineStyle.AntiAliasing = LineAntialias.None;
seriesN.ScrollModePointsKeepLevel = 1;
seriesN.ScrollingStabilizing = true;
seriesN.AllowUserInteraction = false;
//Set custom colored palette
//System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50);
//System.Windows.Media.Color colorCenter = series.LineStyle.Color;
//seriesN.ValueRangePalette.Steps.Clear(); //Remove existing palette steps
//seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorEdge, -100));
//seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorCenter, 0));
//seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorEdge, 100));
sampleList.Add(seriesN);
}
return sampleList;
}
public List<AxisY> CreateYAxisPingPu(Dictionary<string, StationModel> sms, LightningChart curChart)
//public List<AxisY> CreateYAxisPingPu(int StationCount, LightningChart curChart)
{
List<AxisY> axisYList = new List<AxisY>();
foreach (var item in sms.Keys)
{
//add Z
AxisY axisYZ = new AxisY(curChart.ViewXY);
axisYZ.SetRange(YMin, YMax);
axisYZ.AllowAutoYFit = false;
axisYZ.Title.Font = new WpfFont("Segoe UI", 10, false, false);
axisYZ.Title.Text = string.Format("Ch{0}.Z", item);
axisYZ.Title.Angle = 0;
//axisYZ.Title.
axisYZ.Units.Visible = false;
axisYList.Add(axisYZ);
//add E
AxisY axisYE = new AxisY(curChart.ViewXY);
axisYE.SetRange(YMin, YMax);
axisYE.Title.Font = new WpfFont("Segoe UI", 10, false, false);
axisYE.Title.Text = string.Format("Ch{0}.E", item);
axisYE.Title.Angle = 0;
axisYE.Units.Visible = false;
axisYList.Add(axisYE);
//add N
AxisY axisYN = new AxisY(curChart.ViewXY);
axisYN.SetRange(YMin, YMax);
axisYN.Title.Font = new WpfFont("Segoe UI", 10, false, false);
axisYN.Title.Text = string.Format("Ch{0}.N", item);
axisYN.Title.Angle = 0;
axisYN.Units.Visible = false;
axisYList.Add(axisYN);
}
//for (int i = 0; i < sms.Count; i++)
//{
//}
return axisYList;
}
public List<SampleDataSeries> GetSampleDataSeriesPingPu(Dictionary<string, StationModel> sms, LightningChart curChart, AxisX xAxes, AxisYCollection axisY, double samplingFrequency)
{
List<SampleDataSeries> sampleList = new List<SampleDataSeries>();
for (int i = 0; i < sms.Count; i++)
{
//Z
SampleDataSeries seriesZ = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3]);
seriesZ.SampleFormat = SampleFormat.DoubleFloat;
//series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
seriesZ.LineStyle.Color = System.Windows.Media.Colors.Blue;
seriesZ.SamplingFrequency = samplingFrequency;
seriesZ.FirstSampleTimeStamp = 1.0 / samplingFrequency;
seriesZ.LineStyle.Width = 1;
seriesZ.LineStyle.AntiAliasing = LineAntialias.None;
seriesZ.ScrollModePointsKeepLevel = 1;
seriesZ.ScrollingStabilizing = true;
seriesZ.AllowUserInteraction = false;
//Set custom colored palette
System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(seriesZ.LineStyle.Color, System.Windows.Media.Colors.Black, 50);
System.Windows.Media.Color colorCenter = seriesZ.LineStyle.Color;
seriesZ.ValueRangePalette.Steps.Clear(); //Remove existing palette steps
seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, -100));
seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorCenter, 0));
seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, 100));
sampleList.Add(seriesZ);
//E
SampleDataSeries seriesE = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3 + 1]);
seriesE.SampleFormat = SampleFormat.DoubleFloat;
//series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
seriesE.LineStyle.Color = System.Windows.Media.Colors.Red;
seriesE.SamplingFrequency = samplingFrequency;
seriesE.FirstSampleTimeStamp = 1.0 / samplingFrequency;
seriesE.LineStyle.Width = 1;
seriesE.LineStyle.AntiAliasing = LineAntialias.None;
seriesE.ScrollModePointsKeepLevel = 1;
seriesE.ScrollingStabilizing = true;
seriesE.AllowUserInteraction = false;
//Set custom colored palette
//System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50);
//System.Windows.Media.Color colorCenter = series.LineStyle.Color;
seriesE.ValueRangePalette.Steps.Clear(); //Remove existing palette steps
seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorEdge, -100));
seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorCenter, 0));
seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorEdge, 100));
sampleList.Add(seriesE);
//N
SampleDataSeries seriesN = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i * 3 + 2]);
seriesN.SampleFormat = SampleFormat.DoubleFloat;
//series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
seriesN.LineStyle.Color = System.Windows.Media.Colors.Green;
seriesN.SamplingFrequency = samplingFrequency;
seriesN.FirstSampleTimeStamp = 1.0 / samplingFrequency;
seriesN.LineStyle.Width = 1;
seriesN.LineStyle.AntiAliasing = LineAntialias.None;
seriesN.ScrollModePointsKeepLevel = 1;
seriesN.ScrollingStabilizing = true;
seriesN.AllowUserInteraction = false;
//Set custom colored palette
//System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50);
//System.Windows.Media.Color colorCenter = series.LineStyle.Color;
seriesN.ValueRangePalette.Steps.Clear(); //Remove existing palette steps
seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorEdge, -100));
seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorCenter, 0));
seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorEdge, 100));
sampleList.Add(seriesN);
}
return sampleList;
}
public List<SampleDataSeries> GetSampleDataSeriesDieJia(List<StationModel> sms, LightningChart curChart, AxisX xAxes, AxisYCollection axisY, double samplingFrequency)
{
List<SampleDataSeries> sampleList = new List<SampleDataSeries>();
for (int i = 0; i < sms.Count; i++)
{
//Z
SampleDataSeries seriesZ = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i]);
seriesZ.SampleFormat = SampleFormat.DoubleFloat;
//series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
seriesZ.LineStyle.Color = System.Windows.Media.Colors.Blue;
seriesZ.SamplingFrequency = samplingFrequency;
seriesZ.FirstSampleTimeStamp = 1.0 / samplingFrequency;
seriesZ.LineStyle.Width = 1;
seriesZ.LineStyle.AntiAliasing = LineAntialias.None;
seriesZ.ScrollModePointsKeepLevel = 1;
seriesZ.ScrollingStabilizing = true;
seriesZ.AllowUserInteraction = false;
//Set custom colored palette
System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(seriesZ.LineStyle.Color, System.Windows.Media.Colors.Black, 50);
System.Windows.Media.Color colorCenter = seriesZ.LineStyle.Color;
seriesZ.ValueRangePalette.Steps.Clear(); //Remove existing palette steps
seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, -100));
seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorCenter, 0));
seriesZ.ValueRangePalette.Steps.Add(new PaletteStep(seriesZ.ValueRangePalette, colorEdge, 100));
sampleList.Add(seriesZ);
//E
SampleDataSeries seriesE = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i]);
seriesE.SampleFormat = SampleFormat.DoubleFloat;
//series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
seriesE.LineStyle.Color = System.Windows.Media.Colors.Red;
seriesE.SamplingFrequency = samplingFrequency;
seriesE.FirstSampleTimeStamp = 1.0 / samplingFrequency;
seriesE.LineStyle.Width = 1;
seriesE.LineStyle.AntiAliasing = LineAntialias.None;
seriesE.ScrollModePointsKeepLevel = 1;
seriesE.ScrollingStabilizing = true;
seriesE.AllowUserInteraction = false;
//Set custom colored palette
//System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50);
//System.Windows.Media.Color colorCenter = series.LineStyle.Color;
seriesE.ValueRangePalette.Steps.Clear(); //Remove existing palette steps
seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorEdge, -100));
seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorCenter, 0));
seriesE.ValueRangePalette.Steps.Add(new PaletteStep(seriesE.ValueRangePalette, colorEdge, 100));
sampleList.Add(seriesE);
//N
SampleDataSeries seriesN = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i]);
seriesN.SampleFormat = SampleFormat.DoubleFloat;
//series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
seriesN.LineStyle.Color = System.Windows.Media.Colors.Green;
seriesN.SamplingFrequency = samplingFrequency;
seriesN.FirstSampleTimeStamp = 1.0 / samplingFrequency;
seriesN.LineStyle.Width = 1;
seriesN.LineStyle.AntiAliasing = LineAntialias.None;
seriesN.ScrollModePointsKeepLevel = 1;
seriesN.ScrollingStabilizing = true;
seriesN.AllowUserInteraction = false;
//Set custom colored palette
//System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50);
//System.Windows.Media.Color colorCenter = series.LineStyle.Color;
seriesN.ValueRangePalette.Steps.Clear(); //Remove existing palette steps
seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorEdge, -100));
seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorCenter, 0));
seriesN.ValueRangePalette.Steps.Add(new PaletteStep(seriesN.ValueRangePalette, colorEdge, 100));
sampleList.Add(seriesN);
}
return sampleList;
}
public List<AxisY> CreateYAxis(int channelCount, LightningChart curChart)
{
List<AxisY> axisYList = new List<AxisY>();
for (int i = 0; i < channelCount; i++)
{
AxisY axisY = new AxisY(curChart.ViewXY);
//AxisY axisY = new AxisY();
axisY.SetRange(YMin, YMax);
axisY.Title.Font = new WpfFont("Segoe UI", 10, false, false);
axisY.Title.Text = string.Format("Ch {0}", i + 1);
axisY.Title.Angle = 0;
axisY.Units.Visible = false;
axisYList.Add(axisY);
}
return axisYList;
}
public List<SampleDataSeries> GetSampleDataSeries(int channelCount, LightningChart curChart, AxisX xAxes, AxisYCollection axisY, double samplingFrequency)
{
List<SampleDataSeries> sampleList = new List<SampleDataSeries>();
for (int i = 0; i < channelCount; i++)
{
SampleDataSeries series = new SampleDataSeries(curChart.ViewXY, xAxes, axisY[i]);
series.SampleFormat = SampleFormat.DoubleFloat;
//series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
series.LineStyle.Color = DefaultColors.SeriesForBlackBackgroundWpf[i % DefaultColors.SeriesForBlackBackgroundWpf.Length];
series.SamplingFrequency = samplingFrequency;
series.FirstSampleTimeStamp = 1.0 / samplingFrequency;
series.LineStyle.Width = 1;
series.LineStyle.AntiAliasing = LineAntialias.None;
series.ScrollModePointsKeepLevel = 1;
series.ScrollingStabilizing = true;
series.AllowUserInteraction = false;
//Set custom colored palette
System.Windows.Media.Color colorEdge = ChartTools.CalcGradient(series.LineStyle.Color, System.Windows.Media.Colors.Black, 50);
System.Windows.Media.Color colorCenter = series.LineStyle.Color;
series.ValueRangePalette.Steps.Clear(); //Remove existing palette steps
series.ValueRangePalette.Steps.Add(new PaletteStep(series.ValueRangePalette, colorEdge, -100));
series.ValueRangePalette.Steps.Add(new PaletteStep(series.ValueRangePalette, colorCenter, 0));
series.ValueRangePalette.Steps.Add(new PaletteStep(series.ValueRangePalette, colorEdge, 100));
sampleList.Add(series);
}
return sampleList;
}
}
}

@ -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,51 @@
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="D:\\EwsCache\\Mseed";
public static string TxtFilePath = "D:\\EwsCache\\Txt";
public static string DataTypeString = "A";
public static Dictionary<string, StationModel> StationDic { get; set; }
public static Dictionary<string, StationModel> CreateStationFromCSV(string fn)
{
Dictionary<string, StationModel> stations = new Dictionary<string, StationModel>();
var datas= File.ReadLines(fn);
foreach (var item in datas)
{
if (item.Contains("net")) continue;
string[] row = item.Split(',');
StationModel model = new StationModel();
model.Name = row[1].ToString();
model.E = double.Parse(row[2].ToString());
model.N = double.Parse(row[3].ToString());
model.Z = double.Parse(row[4].ToString());
model.Sens = double.Parse(row[5].ToString());
model.BeginUseTime = DateTime.Parse(row[6].ToString());
model.StopUseTime = DateTime.Parse(row[7].ToString());
stations.Add(model.Name, model);
}
return stations;
}
}
}

@ -0,0 +1,652 @@
using Arction.Wpf.ChartingMVVM;
using Arction.Wpf.ChartingMVVM.Axes;
using Arction.Wpf.ChartingMVVM.Views.ViewXY;
using mseedChart.Core;
using mseedChart.MainModule.Models;
using Prism.Events;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
namespace mseedChart.MainModule.ViewModels
{
public class ChartPlotViewModel : BindableBase
{
#region variable
Dispatcher _dispatcher;
/// <summary>
/// Delegate for data generation.
/// </summary>
/// <summary>
/// 当前采样数
/// </summary>
public int CurPoints;
private readonly IEventAggregator _ea;
private int _selectResult = 0;
public int SelectResult
{
get { return _selectResult; }
set
{
SetProperty(ref _selectResult, value);
}
}
int _channelCount = 60; // Channel count.
double _samplingFrequency = 500; // Sampling frequency (Hz).
double _xLength = 10; // X axis length.
double _previousX = 0; // Latest X value on axis.
long _now; // Latest time stamp.
long _startTicks; // Controls timing.
long _samplesOutput; // Generated samples quantity.
// Constants
const double YMin = 30000; // Minimal y-value.
const double YMax = 33000; // Maximal y-value.
WavesModel _wavesModel;
#endregion
/// <summary>
/// Thread.
/// </summary>
private delegate void ChartUpdateFromThreadHandler(double[][] samples);
private ChartUpdateFromThreadHandler _chartUpdate;
private Random _rand = new Random((int)DateTime.Now.Ticks);
#region "属性"
private int _lChartCount = 1;
/// <summary>
/// 波形控件数量
/// </summary>
public int LChartCount
{
get { return _lChartCount; }
set { _lChartCount = value; }
}
public List<ShareProperty> WaveComList { get; set; }
private ShareProperty _wavesCombination;
/// <summary>
/// 波形组合
/// </summary>
public ShareProperty WavesCombination
{
get { return _wavesCombination; }
set
{
_wavesCombination = value;
SetWavesCombination();
}
}
private DataSourcesEnum _dataSources;
/// <summary>
/// 数据来源
/// </summary>
public DataSourcesEnum DataSources
{
get { return _dataSources; }
set { _dataSources = value; }
}
private DataTypeEnum _wavesType;
/// <summary>
/// 波形类型
/// </summary>
public DataTypeEnum WavesType
{
get { return _wavesType; }
set { _wavesType = value; }
}
private DisplayModeEnum _displayMode;
/// <summary>
/// 显示模式
/// </summary>
public DisplayModeEnum DisplayMode
{
get { return _displayMode; }
set { _displayMode = value; }
}
private ScollModeEnum _scollMode;
/// <summary>
/// 滚动方式
/// </summary>
public ScollModeEnum ScollMode
{
get { return _scollMode; }
set { _scollMode = value; }
}
private DateTime _startTime;
/// <summary>
/// 开始时间
/// </summary>
public DateTime StartTime
{
get { return _startTime; }
set { _startTime = value; }
}
private DateTime _endTime;
/// <summary>
/// 开始时间
/// </summary>
public DateTime EndTime
{
get { return _endTime; }
set { _endTime = value; }
}
private int _sampling = 500;
/// <summary>
/// 采样频率
/// </summary>
public int Sampling
{
get { return _sampling; }
set { _sampling = value; }
}
/// <summary>
/// 延时(min)
/// </summary>
public int DelayMin { get; set; } = 10;
/// <summary>
/// 文件数据位置
/// </summary>
public string FileDataPath { get; set; } = @"D:\TaySystemPath\Downloads";
private string _cachePath;
private int _cacheSize;
/// <summary>
/// 缓存大小
/// </summary>
public int CacheSize
{
get { return _cacheSize; }
set { _cacheSize = value; }
}
private ObservableCollection<int> _stationList;
/// <summary>
/// 台站列表
/// </summary>
public ObservableCollection<int> StationList
{
get { return _stationList; }
set { _stationList = value; }
}
private LightningChart _lChartAll;
/// <summary>
/// 所有波形
/// </summary>
public LightningChart LChartALL
{
get { return _lChartAll; }
set { _lChartAll = value; }
}
private LightningChart _lChartZ;
/// <summary>
/// Z通道波形
/// </summary>
public LightningChart LChartZ
{
get { return _lChartZ; }
set { _lChartZ = value; }
}
private LightningChart _lChartE;
/// <summary>
/// E通道波形
/// </summary>
public LightningChart LChartE
{
get { return _lChartE; }
set { _lChartE = value; }
}
private LightningChart _lChartN;
/// <summary>
/// N通道波形
/// </summary>
public LightningChart LChartN
{
get { return _lChartN; }
set { _lChartN = 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; }
}
public List<StationModel> smList;
#endregion
public ChartPlotViewModel()
{
_dispatcher = Application.Current.Dispatcher;
SelectResult = 10;
var wcList = (WavesCombinationEnum[])Enum.GetValues(typeof(WavesCombinationEnum));
WaveComList = wcList.Select(value => new ShareProperty((int)value, value.ToString())).ToList();
WavesCombination = WaveComList.SingleOrDefault(wc => wc.ID == 0);
_chartUpdate = new ChartUpdateFromThreadHandler(FeedNewDataToChartPingPu);
_wavesModel = new WavesModel();
LChartALL.ViewXY.XAxes = new AxisXCollection();
LChartALL.ViewXY.XAxes.Add(_wavesModel.GetAxisX(10));
InitData();
(Application.Current.MainWindow as System.Windows.Window).Closing += ApplicationClosingDispose;
ShowWave();
}
private void ShowWave(string obj= "2023-03-29T06:41:21.348")
{
string EventTimeStr = obj;
string datePath = EventTimeStr.Substring(0, 4) + EventTimeStr.Substring(5, 2) + EventTimeStr.Substring(8, 2);
string dataFilePath = RegionNames.MseedFilePath + "\\" + datePath + "\\";
string dataFileName = "HA." + EventTimeStr.Substring(0, 4) + EventTimeStr.Substring(5, 2)
+ EventTimeStr.Substring(8, 2) + EventTimeStr.Substring(10, 3)
+ EventTimeStr.Substring(14, 2) + EventTimeStr.Substring(17, 2) + ".01" + RegionNames.DataTypeString;
string mseedStr = ".mseed";
string asciiSavePath = RegionNames.TxtFilePath + "\\" + datePath + "\\" + dataFileName + ".txt";
if (!Directory.Exists(dataFilePath))
{
Directory.CreateDirectory(dataFilePath);
}
if (!Directory.Exists(Path.GetDirectoryName(asciiSavePath)))
{
Directory.CreateDirectory(Path.GetDirectoryName(asciiSavePath));
}
if (!File.Exists(dataFilePath + dataFileName + mseedStr))
{
//TaskData taskData = new TaskData();
//taskData.EventTimeStr = EventTimeStr;
//taskData.Tasks = new Task(() =>
//{
// int res = new DownloadWavedata().Download(EventTimeStr, dataFilePath, dataFileName + mseedStr, GlobalConfig.UseWaveDataTable);
// if (res > -1)
// {
// MSeed2Asc(dataFilePath + dataFileName + mseedStr, asciiSavePath);
// }
// //Console.WriteLine(taskData.IsComplete);
//});
//taskData.CallBack = (string res) =>
//{
// _dispatcher.Invoke(() =>
// {
// UpdateWavesFromTxt(asciiSavePath);
// _channelCount = smList.Count * 3;
// UpdateChart();
// UpdateChartData();
// });
//};
//TaskQueue.Instance.AddTaskAndRuning(taskData);
}
else
{
if (!File.Exists(asciiSavePath))
{
MSeed2Asc(dataFilePath + dataFileName + mseedStr, asciiSavePath);
}
_dispatcher.Invoke(() =>
{
UpdateWavesFromTxt(asciiSavePath);
_channelCount = smList.Count * 3;
UpdateChart();
UpdateChartData();
});
}
}
private void UpdateChart()
{
//线程问题
LChartALL.ViewXY.YAxes = new AxisYCollection();
LChartALL.ViewXY.YAxes.Clear();
LChartALL.ViewXY.YAxes.AddRange(_wavesModel.CreateYAxisPingPu(smList, LChartALL));
for (int i = 0; i < LChartALL.ViewXY.YAxes.Count; i++)
{
LChartALL.ViewXY.YAxes[i].LabelsColor = Colors.Black;
LChartALL.ViewXY.YAxes[i].AxisColor = Colors.Black;
LChartALL.ViewXY.YAxes[i].GridStripColor = Colors.Black;
LChartALL.ViewXY.YAxes[i].Title.Color = Colors.Black;
LChartALL.ViewXY.YAxes[i].Title.Shadow.DropColor = Colors.Transparent;
LChartALL.ViewXY.YAxes[i].Title.Shadow.ContrastColor = Colors.Transparent;
}
LChartALL.ViewXY.XAxes = new AxisXCollection();
LChartALL.ViewXY.XAxes.Add(_wavesModel.GetAxisX(CurPoints / Sampling));
LChartALL.ViewXY.XAxes[0].LabelsColor = Colors.Black;
LChartALL.ViewXY.SampleDataSeries = new SampleDataSeriesCollection();
LChartALL.ViewXY.SampleDataSeries.AddRange(
_wavesModel.GetSampleDataSeriesPingPu(smList, LChartALL, LChartALL.ViewXY.XAxes[0],
LChartALL.ViewXY.YAxes, _samplingFrequency));
}
private void UpdateChartData()
{
double[][] multiChannelData = new double[smList.Count * 3][];
try
{
for (int channelIndex = 0; channelIndex < smList.Count; channelIndex++)
{
multiChannelData[channelIndex * 3] = smList[channelIndex].dz.ToArray();
multiChannelData[channelIndex * 3 + 1] = smList[channelIndex].dn.ToArray();
multiChannelData[channelIndex * 3 + 2] = smList[channelIndex].de.ToArray();
}
// Invoke FeedNewDataToChart.
_dispatcher.Invoke(_chartUpdate, System.Windows.Threading.DispatcherPriority.ContextIdle,
multiChannelData as object);
}
catch (Exception ex)
{
throw ex;
}
}
public void UpdateWavesFromTxt(string fn)
{
string allStr;
smList = 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;
int num = 0;
string[] snStr = strLines[0].Trim().Split(',');
string tmpName = snStr[0].Substring(14, 3);
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;
for (int i = 1; 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);
if (chnStr1 == "SHZ")
{
smList.Add(station);
station = new StationModel();
station.Name = rowStr[0].Substring(14, 3);
channelFlag = 0;//Z
}
else if (chnStr1 == "SHN")
{
channelFlag = 1;//N
}
else
{
channelFlag = 2;//E
}
}
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;
}
}
}
smList.Add(station);
smList.Reverse();
}
}
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.Start();
compiler.WaitForExit();
}
}
private void ApplicationClosingDispose(object sender, CancelEventArgs e)
{
if (LChartALL != null)
{
LChartALL.Dispose();
LChartALL = null;
}
}
public void Dispose()
{
gridChart.Children.Clear();
if (LChartALL != null)
{
LChartALL.Dispose();
LChartALL = null;
}
}
public void SetWavesCombination()
{
switch (WavesCombination.Name)
{
case "平铺":
LChartCount = 1;
CreateGridChartPingPu();
break;
case "叠加":
LChartCount = 1;
CreateGridChartDieJia();
break;
case "分类":
LChartCount = 3;
CreateGridChartFenLei();
break;
}
}
public void CreateGridChartPingPu()
{
if (LChartALL != null)
{
LChartALL = null;
}
LChartALL = new LightningChart();
LChartALL.Title.Text = "事件波形";
LChartALL.Title.Color = Colors.Black;
LChartALL.Title.Shadow.DropColor = Colors.Transparent;
LChartALL.Title.Shadow.ContrastColor = Colors.Transparent;
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.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);
GridChart = new Grid();
GridChart.ColumnDefinitions.Add(new ColumnDefinition());
GridChart.Name = "chartGrid";
GridChart.Children.Add(LChartALL);
this.ChildContent = GridChart;
}
public void CreateGridChartDieJia()
{
if (LChartALL != null)
{
LChartALL = null;
}
LChartALL = new LightningChart();
LChartALL.Title.Text = "叠加";
GridChart = new Grid();
GridChart.ColumnDefinitions.Add(new ColumnDefinition());
GridChart.Name = "chartGrid";
GridChart.Children.Add(LChartALL);
this.ChildContent = GridChart;
}
public void CreateGridChartFenLei()
{
LChartZ = new LightningChart();
LChartALL.Title.Text = "Z";
LChartZ.SetValue(Grid.ColumnProperty, 0);
LChartE = new LightningChart();
LChartALL.Title.Text = "E";
LChartE.SetValue(Grid.ColumnProperty, 1);
LChartN = new LightningChart();
LChartALL.Title.Text = "N";
LChartN.SetValue(Grid.ColumnProperty, 2);
GridChart = new Grid();
GridChart.ColumnDefinitions.Add(new ColumnDefinition());
GridChart.ColumnDefinitions.Add(new ColumnDefinition());
GridChart.ColumnDefinitions.Add(new ColumnDefinition());
GridChart.Name = "chartGrid";
GridChart.Children.Add(LChartZ);
GridChart.Children.Add(LChartE);
GridChart.Children.Add(LChartN);
this.ChildContent = GridChart;
}
private void InitData()
{
LChartALL.ViewXY.YAxes = new AxisYCollection();
LChartALL.ViewXY.YAxes.Clear();
RegionNames.StationDic= RegionNames.CreateStationFromCSV(AppDomain.CurrentDomain.BaseDirectory + @"resources/N3102_staion_20230312.txt");
LChartALL.ViewXY.YAxes.AddRange(_wavesModel.CreateYAxisPingPu(RegionNames.StationDic, LChartALL));
for (int i = 0; i < LChartALL.ViewXY.YAxes.Count; i++)
{
LChartALL.ViewXY.YAxes[i].LabelsColor = Colors.Black;
LChartALL.ViewXY.YAxes[i].AxisColor = Colors.Black;
LChartALL.ViewXY.YAxes[i].GridStripColor = Colors.Black;
LChartALL.ViewXY.YAxes[i].Title.Color = Colors.Black;
LChartALL.ViewXY.YAxes[i].Title.Shadow.DropColor = Colors.Transparent;
LChartALL.ViewXY.YAxes[i].Title.Shadow.ContrastColor = Colors.Transparent;
LChartALL.ViewXY.YAxes[i].Title.Font = new WpfFont("Calibri", 12);
}
LChartALL.ViewXY.XAxes = new AxisXCollection();
LChartALL.ViewXY.XAxes.Add(_wavesModel.GetAxisX(CurPoints / Sampling));
LChartALL.ViewXY.XAxes[0].LabelsColor = Colors.Black;
LChartALL.ViewXY.SampleDataSeries = new SampleDataSeriesCollection();
LChartALL.ViewXY.SampleDataSeries.AddRange(
_wavesModel.GetSampleDataSeriesPingPu(RegionNames.StationDic, LChartALL, LChartALL.ViewXY.XAxes[0],
LChartALL.ViewXY.YAxes, _samplingFrequency));
//string mseedPath = FileDataPath + "\\" + StartTime.Year.ToString("D2");
//Console.WriteLine(mseedPath);
//Start();
}
private void FeedNewDataToChartPingPu(double[][] data)
{
LChartALL.BeginUpdate();
for (int channelIndex = 0; channelIndex < _channelCount; channelIndex++)
{
LChartALL.ViewXY.SampleDataSeries[channelIndex].AddSamples(data[channelIndex], true);
//LChartALL.ViewXY.YAxes[channelIndex].Minimum = data[channelIndex].Min();
//LChartALL.ViewXY.YAxes[channelIndex].Maximum = data[channelIndex].Max();
}
_previousX = (double)_samplesOutput / _samplingFrequency;
LChartALL.ViewXY.XAxes[0].ScrollPosition = _previousX;
LChartALL.EndUpdate();
}
}
/// <summary>
/// 波形组合
/// </summary>
public enum WavesCombinationEnum
{
= 0,
,
}
/// <summary>
/// 波形类型
/// </summary>
public enum DataTypeEnum
{
= 0,
}
/// <summary>
/// 数据来源
/// </summary>
public enum DataSourcesEnum
{
= 0,
}
/// <summary>
/// 显示模式
/// </summary>
public enum DisplayModeEnum
{
= 0,
}
public enum ScollModeEnum
{
Scrolling = 0,
Stepping
}
}

@ -0,0 +1,18 @@
<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>
<TextBlock Text="{Binding Message}"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<ContentControl x:Name="contentControl" Content="{Binding ChildContent}" />
</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,134 @@
<?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.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.WinForms.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.WinForms.Charting.LightningChart.dll</HintPath>
</Reference>
<Reference Include="Arction.Wpf.ChartingMVVM.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.ChartingMVVM.LightningChart.dll</HintPath>
</Reference>
<Reference Include="DryIoc, Version=4.7.7.0, Culture=neutral, PublicKeyToken=dfbf2bd50fcf7768, processorArchitecture=MSIL">
<HintPath>..\packages\DryIoc.dll.4.7.7\lib\net45\DryIoc.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="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.DryIoc.Wpf, Version=8.0.0.1909, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
<HintPath>..\packages\Prism.DryIoc.8.0.0.1909\lib\net47\Prism.DryIoc.Wpf.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\ChannelModel.cs" />
<Compile Include="Models\CoordBase.cs" />
<Compile Include="Models\LineDatas.cs" />
<Compile Include="Models\MmEvent.cs" />
<Compile Include="Models\ShareProperty.cs" />
<Compile Include="Models\StationModel.cs" />
<Compile Include="Models\StationWorkModel.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,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net47" />
</packages>

@ -0,0 +1,49 @@

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.Main", "mseedChart.Main\mseedChart.Main.csproj", "{3F7895B1-A41A-4245-B54E-FE65440E070B}"
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}") = "WpfApp1", "WpfApp1\WpfApp1.csproj", "{92B5468F-C7FF-4295-A8D1-BE9B117C2287}"
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
{3F7895B1-A41A-4245-B54E-FE65440E070B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F7895B1-A41A-4245-B54E-FE65440E070B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F7895B1-A41A-4245-B54E-FE65440E070B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F7895B1-A41A-4245-B54E-FE65440E070B}.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
{92B5468F-C7FF-4295-A8D1-BE9B117C2287}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{92B5468F-C7FF-4295-A8D1-BE9B117C2287}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92B5468F-C7FF-4295-A8D1-BE9B117C2287}.Release|Any CPU.ActiveCfg = Release|Any CPU
{92B5468F-C7FF-4295-A8D1-BE9B117C2287}.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>();
}
}
}

@ -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="350" Width="525"
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,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<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="resources\N3102_staion_20230312.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

@ -0,0 +1,25 @@
net,sta,x2000,y2000,z2000,sens,begin,stop
HA,N02,38397345.33,4030593.53,1074,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N03,38397862.83,4030967.95,1057.7,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N04,38396851.28,4030947.41,1054,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N05,38397197.82,4031016.84,1071,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N06,38397507.28,4030786.06,1094.7,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N07,38397699.97,4030514.93,1091.6,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N08,38398102.95,4030707.82,1047.6,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N09,38396697.57,4030703.24,1053,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N10,38397284.87,4029883.38,1028,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N11,38397556.54,4030474.46,1092,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N12,38397781.42,4030319.64,1089.2,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N13,38397278.9,4030358.92,1050,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N14,38396943.47,4030453.01,1055,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N15,38396715.18,4030230.58,1030,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N16,38397420.7,4030035.82,1033,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N17,38397876.31,4030039.78,1133.3,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N18,38398199.8,4030163.99,1031,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N19,38397094.27,4030709.07,1076,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N20,38397529.8,4029760.44,1057.9,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N22,38398196.3,4029830.94,1056.3,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N23,38398363.7,4030000.55,1066.7,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N24,38397820.92,4029713.54,1056.5,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N26,38397120.98,4029641.15,1006,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
HA,N27,38397672.11,4031001.47,1068.1,1600000000,2023-03-12T00:00:00.000,2023-12-21T23:59:59.000
Loading…
Cancel
Save