基本框架搭建完成;

实时数据展示页面和日志记录页面部分完成;
This commit is contained in:
XuMin 2024-08-22 13:55:37 +08:00
commit 0c0f9f371a
324 changed files with 24203 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,225 @@
{
"Version": 1,
"WorkspaceRootPath": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\viewmodels\\logrecordviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\viewmodels\\logrecordviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\views\\logrecordview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\views\\logrecordview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\app.config||{FA3CD31E-987B-443A-9B81-186104E8DAC1}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\app.config||{FA3CD31E-987B-443A-9B81-186104E8DAC1}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\common\\csvdownload.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\common\\csvdownload.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\models\\shorebasestationstatedatamodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\models\\shorebasestationstatedatamodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\viewmodels\\mainviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\viewmodels\\mainviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\viewmodels\\alarmrecordviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\viewmodels\\alarmrecordviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\app.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\app.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\views\\realtimedataview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\views\\realtimedataview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\models\\junctionboxenvironmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\models\\junctionboxenvironmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|f:\\code\\fjeq\\20240801_fjeq_upperpc\\fujianearthquake\\fujianearthquake\\viewmodels\\realtimedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{BC950963-02DC-4704-A532-8D46CE8933E5}|FujianEarthquake\\FujianEarthquake.csproj|solutionrelative:fujianearthquake\\viewmodels\\realtimedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 163,
"SelectedChildIndex": 7,
"Children": [
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "App.config",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\App.config",
"RelativeDocumentMoniker": "FujianEarthquake\\App.config",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\App.config",
"RelativeToolTip": "FujianEarthquake\\App.config",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAQAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000601|",
"WhenOpened": "2024-07-30T08:37:35.106Z",
"IsPinned": true,
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "CSVDownload.cs",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\Common\\CSVDownload.cs",
"RelativeDocumentMoniker": "FujianEarthquake\\Common\\CSVDownload.cs",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\Common\\CSVDownload.cs",
"RelativeToolTip": "FujianEarthquake\\Common\\CSVDownload.cs",
"ViewState": "AQIAAB8AAAAAAAAAAAAQwHsAAAASAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-08-22T02:52:28.362Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "MainWindow.xaml",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\MainWindow.xaml",
"RelativeDocumentMoniker": "FujianEarthquake\\MainWindow.xaml",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\MainWindow.xaml",
"RelativeToolTip": "FujianEarthquake\\MainWindow.xaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2024-08-22T00:51:43.018Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 8,
"Title": "App.xaml",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\App.xaml",
"RelativeDocumentMoniker": "FujianEarthquake\\App.xaml",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\App.xaml",
"RelativeToolTip": "FujianEarthquake\\App.xaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2024-08-22T00:51:15.265Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "LogRecordView.xaml",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\Views\\LogRecordView.xaml",
"RelativeDocumentMoniker": "FujianEarthquake\\Views\\LogRecordView.xaml",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\Views\\LogRecordView.xaml",
"RelativeToolTip": "FujianEarthquake\\Views\\LogRecordView.xaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2024-08-22T00:45:32.052Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 7,
"Title": "AlarmRecordViewModel.cs",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\ViewModels\\AlarmRecordViewModel.cs",
"RelativeDocumentMoniker": "FujianEarthquake\\ViewModels\\AlarmRecordViewModel.cs",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\ViewModels\\AlarmRecordViewModel.cs",
"RelativeToolTip": "FujianEarthquake\\ViewModels\\AlarmRecordViewModel.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAA8AAAAFAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-07-30T08:15:25.234Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "LogRecordViewModel.cs",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\ViewModels\\LogRecordViewModel.cs",
"RelativeDocumentMoniker": "FujianEarthquake\\ViewModels\\LogRecordViewModel.cs",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\ViewModels\\LogRecordViewModel.cs",
"RelativeToolTip": "FujianEarthquake\\ViewModels\\LogRecordViewModel.cs",
"ViewState": "AQIAANAAAAAAAAAAAAAmwPEAAAAJAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-07-30T08:14:39.106Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "ShoreBaseStationStateDataModel.cs",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\Models\\ShoreBaseStationStateDataModel.cs",
"RelativeDocumentMoniker": "FujianEarthquake\\Models\\ShoreBaseStationStateDataModel.cs",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\Models\\ShoreBaseStationStateDataModel.cs",
"RelativeToolTip": "FujianEarthquake\\Models\\ShoreBaseStationStateDataModel.cs",
"ViewState": "AQIAABkAAAAAAAAAAAAQwBcAAAAeAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-07-30T01:38:07.375Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 10,
"Title": "JunctionBoxEnvironModel.cs",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\Models\\JunctionBoxEnvironModel.cs",
"RelativeDocumentMoniker": "FujianEarthquake\\Models\\JunctionBoxEnvironModel.cs",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\Models\\JunctionBoxEnvironModel.cs",
"RelativeToolTip": "FujianEarthquake\\Models\\JunctionBoxEnvironModel.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAADAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-07-30T00:57:05.061Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 9,
"Title": "RealTimeDataView.xaml",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\Views\\RealTimeDataView.xaml",
"RelativeDocumentMoniker": "FujianEarthquake\\Views\\RealTimeDataView.xaml",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\Views\\RealTimeDataView.xaml",
"RelativeToolTip": "FujianEarthquake\\Views\\RealTimeDataView.xaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2024-07-30T00:30:47.27Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 11,
"Title": "RealTimeDataViewModel.cs",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\ViewModels\\RealTimeDataViewModel.cs",
"RelativeDocumentMoniker": "FujianEarthquake\\ViewModels\\RealTimeDataViewModel.cs",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\ViewModels\\RealTimeDataViewModel.cs",
"RelativeToolTip": "FujianEarthquake\\ViewModels\\RealTimeDataViewModel.cs",
"ViewState": "AQIAADUBAAAAAAAAAAAowHoBAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-07-30T00:23:05.266Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 6,
"Title": "MainViewModel.cs",
"DocumentMoniker": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\ViewModels\\MainViewModel.cs",
"RelativeDocumentMoniker": "FujianEarthquake\\ViewModels\\MainViewModel.cs",
"ToolTip": "F:\\Code\\FJEQ\\20240801_FJEQ_upperpc\\FujianEarthquake\\FujianEarthquake\\ViewModels\\MainViewModel.cs",
"RelativeToolTip": "FujianEarthquake\\ViewModels\\MainViewModel.cs",
"ViewState": "AQIAAF4AAAAAAAAAAAAwwGsAAABHAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-07-29T02:48:21.6Z",
"EditorCaption": ""
}
]
}
]
}
]
}

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35027.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FujianEarthquake", "FujianEarthquake\FujianEarthquake.csproj", "{BC950963-02DC-4704-A532-8D46CE8933E5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BC950963-02DC-4704-A532-8D46CE8933E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC950963-02DC-4704-A532-8D46CE8933E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC950963-02DC-4704-A532-8D46CE8933E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC950963-02DC-4704-A532-8D46CE8933E5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F862342A-C548-4103-9912-3CE4031CBCB4}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!--数据库连接信息-->
<connectionStrings>
<add name="db" connectionString="server=127.0.0.1;port=3306;user=root;password=zttZTT123!;database=fjeq;Allow User Variables=True;" />
<add name="db_Sever" connectionString="server=110.42.244.149;port=3306;user=root;password=rootme;database=fjeq;Allow User Variables=True;" />
<add name="db_download" connectionString="Password=zttZTT123!;User ID=root;Data Source=fjeq;Persist Security Info=True"/>
</connectionStrings>
<appSettings>
<!--文件下载-->
<add key="LogRecordFolder" value="F:\\Code\\FJEQ\\Test\\"/>
<add key="AlarmRecordFolder" value="F:\\Code\\FJEQ\\Test\\"/>
</appSettings>
</configuration>

View File

@ -0,0 +1,110 @@
<Application x:Class="FujianEarthquake.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FujianEarthquake"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />
<!--<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />-->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.DatePicker.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TimePicker.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RadioButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ListBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.DataGrid.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml" />
<!--<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.LightBlue.xaml" />-->
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDark.xaml"/>
<!--<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/BaseDark.xaml"/>-->
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
<!--<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>-->
<!--<ResourceDictionary Source="/FujianEarthquake;component/ImageDictionary.xaml"/>-->
</ResourceDictionary.MergedDictionaries>
<!--字体-->
<FontFamily x:Key="DigitalDisplay">
pack://application:,,,/FujianEarthquake;component/Assets/Fonts/#方正楷体简体</FontFamily>
<FontFamily x:Key="Iconfont">
pack://application:,,,/FujianEarthquake;component/Assets/Fonts/#iconfont</FontFamily>
<!--控制按钮样式-->
<Style x:Key="ControlButtonStyle" TargetType="Button">
<Setter Property="Width" Value="40"/>
<Setter Property="Background" Value="#11FFFFFF"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontFamily" Value="{StaticResource DigitalDisplay}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid Background="{TemplateBinding Background}">
<Border Name="root">
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="root" Property="Background" Value="#33FFFFFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--基础按钮样式-->
<Style x:Key="ButtonStyle" TargetType="Button">
<Style.Triggers>
<!--设置鼠标经过时的背景色变化-->
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<Border x:Name="border" CornerRadius="8"/>
<ContentPresenter x:Name="contentPresenter" Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}" RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FF32658F" TargetName="border"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
<!--设置按钮被禁用时的背景色变化-->
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<Border x:Name="border" CornerRadius="8" BorderThickness="1" BorderBrush="White"/>
<ContentPresenter x:Name="contentPresenter" Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}" RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="Transparent" TargetName="border"/>
<Setter Property="Opacity" Value="0.4"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@ -0,0 +1,14 @@
using System.Configuration;
using System.Data;
using System.Windows;
namespace FujianEarthquake
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

View File

@ -0,0 +1,10 @@
using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,29 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="WindowControlButtonStyle" TargetType="Button">
<Setter Property="Width" Value="40"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="Transparent" Name="back" CornerRadius="0,10,0,10">
<TextBlock Text="{Binding Content,RelativeSource={RelativeSource AncestorType=Button,Mode=FindAncestor}}"
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="../Fonts/#iconfont"/>
</Border>
<!--触发事件-->
<ControlTemplate.Triggers>
<!--鼠标移上去显示变化效果-->
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="back" Property="Background" Value="#22FFFFFF"/>
</Trigger>
<!--鼠标点击时颜色加深-->
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="back" Property="Background" Value="#44FFFFFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@ -0,0 +1,127 @@
using FujianEarthquake.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace FujianEarthquake.Common
{
public class CSVDownload
{
/// <summary>
/// Create target file
/// </summary>
/// <param name="folder">folder</param>
/// <param name="fileName">folder name</param>
/// <param name="fileExtension">file extension</param>
/// <returns>file path</returns>
public static string CreateFile(string folder, string fileName, string fileExtension)
{
FileStream fs = null;
string filePath = folder + fileName + "." + fileExtension;
try
{
if (!Directory.Exists(folder))
{
Directory.CreateDirectory(folder);
}
fs = File.Create(filePath);
}
catch (Exception ex)
{ }
finally
{
if (fs != null)
{
fs.Dispose();
}
}
return filePath;
}
#region LogRecord
/// <summary>
/// 获取类的属性集合以便生成CSV文件的所有Column标题
/// </summary>
/// <returns></returns>
public static PropertyInfo[] GetLogRecordPropertyInfoArray()
{
PropertyInfo[] props = null;
try
{
Type type = typeof(LogRecordModel);
object obj = Activator.CreateInstance(type);
props = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
}
catch (Exception ex)
{ }
return props;
}
/// <summary>
/// Save the List data to CSV file
/// </summary>
/// <param name="BaseStationList">data source</param>
/// <param name="filePath">file path</param>
/// <returns>success flag</returns>
public static bool SaveLogRecordDataToCSVFile(ObservableCollection<LogRecordModel> LogRecordList, string filePath)
{
bool successFlag = true;
StringBuilder strColumn = new StringBuilder();
StringBuilder strValue = new StringBuilder();
StreamWriter sw = null;
PropertyInfo[] props = GetLogRecordPropertyInfoArray();
try
{
sw = new StreamWriter(filePath);
for (int i = 0; i < props.Length; i++)
{
strColumn.Append(props[i].Name);
strColumn.Append(",");
}
strColumn.Remove(strColumn.Length - 1, 1);
sw.WriteLine(strColumn); //write the column name
for (int i = 0; i < LogRecordList.Count; i++)
{
strValue.Remove(0, strValue.Length); //clear the temp row value
strValue.Append(LogRecordList[i].Index);
strValue.Append(",");
strValue.Append(LogRecordList[i].RecordTime);
strValue.Append(",");
strValue.Append(LogRecordList[i].Device_Name);
strValue.Append(",");
strValue.Append(LogRecordList[i].Operation_Type);
strValue.Append(",");
strValue.Append(LogRecordList[i].Record);
sw.WriteLine(strValue); //write the row value
}
}
catch (Exception ex)
{
successFlag = false;
}
finally
{
if (sw != null)
{
sw.Dispose();
}
}
return successFlag;
}
#endregion
}
}

View File

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace FujianEarthquake.Common
{
public class CommandBase : ICommand
{
public event EventHandler CanExecuteChanged;
public bool CanExecute(object parameter)
{
return DoCanExcute?.Invoke(parameter) == true;
}
public void Execute(object parameter)
{
DoExcute?.Invoke(parameter);
}
public Action<object> DoExcute { set; get; }
public Func<object, bool> DoCanExcute { set; get; }
public void RaiseCanExecuteChanged()
{
CanExecuteChanged?.Invoke(this, new EventArgs());
}
}
}

View File

@ -0,0 +1,44 @@
using GalaSoft.MvvmLight;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace FujianEarthquake.Common
{
public class NotifyBase : ObservableObject, INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
//[CallerMemberName]string propName = "" 设置一个默认值 提高容错性
public void DoNotify([CallerMemberName] string propName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
}
/// <summary>
/// Sets property if it does not equal existing value. Notifies listeners if change occurs.
/// </summary>
/// <typeparam name="T">Type of property.</typeparam>
/// <param name="member">The property's backing field.</param>
/// <param name="value">The new value.</param>
/// <param name="propertyName">Name of the property used to notify listeners. This
/// value is optional and can be provided automatically when invoked from compilers
/// that support <see cref="CallerMemberNameAttribute"/>.</param>
protected virtual bool SetProperty<T>(ref T member, T value, [CallerMemberName] string? propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(member, value))
{
return false;
}
member = value;
DoNotify(propertyName);
return true;
}
}
}

View File

@ -0,0 +1,658 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace FujianEarthquake.Common
{
public static class Tools
{
/// <summary>
/// IP地址是否ping通
/// </summary>
/// <param name="strIP">IP地址例如“10.8.2.1”</param>
/// <returns></returns>
public static bool PingIp(string strIP)
{
bool bRet = false;
try
{
Ping pingSend = new Ping();
PingReply reply = pingSend.Send(strIP, 1000);
if (reply.Status == IPStatus.Success)
bRet = true;
}
catch (Exception)
{
bRet = false;
}
return bRet;
}
/// <summary>
/// 添加日志
/// </summary>
/// <param name="logstring"></param>
public static void AddLog(string logstring)
{
AddLgoToTXT("解析数据.txt", System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + @"数据记录\" + System.DateTime.Now.ToString("yyyy_MM_dd") + @"\", logstring);
}
/// <summary>
/// 文件自动保存
/// </summary>
/// <param name="_file_name">文件名称</param>
/// <param name="path">保存路径</param>
/// <param name="logstring">文件内容</param>
public static void AddLgoToTXT(string _file_name, string path, string logstring)
{
//检查是否存在该路径
if (!System.IO.Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
path = path + _file_name;
//检查该路径下是否存在该文件
if (!System.IO.File.Exists(path))
{
FileStream stream = null;
try
{
stream = System.IO.File.Create(path);
stream.Close();
stream.Dispose();
}
catch (Exception ex)
{
}
finally
{
if (stream != null)
{
stream.Close();
stream.Dispose();
}
}
}
if (!Txt_Used.ContainsKey(path))
{
Txt_Used.Add(path, true);
}
else
{
if (Txt_Used[path])
{
return;
}
else
{
Txt_Used[path] = true;
}
}
FileStream fs = null;
try
{
//[1]创建文件流 文件路径 和枚举类型的文件操作类型
fs = new FileStream(path, FileMode.Append);
//[2]创建写入器
StreamWriter sw = new StreamWriter(fs);
//[3]以流的方式写入数据
sw.Write(logstring);
//[4]关闭写入器
sw.Close();
//[5]关闭文件流
fs.Close();
Txt_Used[path] = false;
}
catch (Exception ex)
{
}
finally
{
if (fs != null)
{
fs.Close();
fs.Dispose();
}
}
}
static Dictionary<string, bool> Txt_Used = new Dictionary<string, bool>();
/// <summary>
/// 读取本地TXT文件
/// </summary>
/// <param name="_file_name"></param>
/// <param name="path"></param>
/// <returns></returns>
public static string ReadFromTXT(string _file_name, string path)
{
//检查是否存在该路径
if (!System.IO.Directory.Exists(path))
return "所选时间段没有系统日志";
path = path + _file_name;
//检查该路径下是否存在该文件
if (!System.IO.File.Exists(path))
return "所选时间段没有系统日志";
//如果文件占用就
if (FileIsInUse(new FileInfo(path)))
return "";
//[1]创建文件流
FileStream fs = new FileStream(path, FileMode.Open);
//【2】创建读取器
//Encoding.Default 读取未知文件是使用default格式
//StreamReader sr = new StreamReader(fs,Encoding.Default);
StreamReader sr = new StreamReader(fs);
//【3】以流的方式读取数据
string txt = sr.ReadToEnd();
//[4]关闭读取器
sr.Close();
//【5】关闭文件流
fs.Close();
return txt;
}
/// <summary>
/// 判断文件是否被占用
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
static bool FileIsInUse(FileInfo file)
{
FileStream stream = null;
try
{
stream = file.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.None);
}
catch (IOException)
{
//如果文件被占用,即
//1.文件正在被另一个线程处理
//2.或者正在被另一个线程处理
//3.或者文件不存在
return true;
}
finally
{
if (stream != null)
stream.Close();
}
return false;
}
#region CRC校验
private static readonly byte[] aucCRCHi = {
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40
};
private static readonly byte[] aucCRCLo = {
0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06, 0x07, 0xC7,
0x05, 0xC5, 0xC4, 0x04, 0xCC, 0x0C, 0x0D, 0xCD, 0x0F, 0xCF, 0xCE, 0x0E,
0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09, 0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9,
0x1B, 0xDB, 0xDA, 0x1A, 0x1E, 0xDE, 0xDF, 0x1F, 0xDD, 0x1D, 0x1C, 0xDC,
0x14, 0xD4, 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, 0x12, 0x13, 0xD3,
0x11, 0xD1, 0xD0, 0x10, 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3, 0xF2, 0x32,
0x36, 0xF6, 0xF7, 0x37, 0xF5, 0x35, 0x34, 0xF4, 0x3C, 0xFC, 0xFD, 0x3D,
0xFF, 0x3F, 0x3E, 0xFE, 0xFA, 0x3A, 0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38,
0x28, 0xE8, 0xE9, 0x29, 0xEB, 0x2B, 0x2A, 0xEA, 0xEE, 0x2E, 0x2F, 0xEF,
0x2D, 0xED, 0xEC, 0x2C, 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26,
0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, 0xA0, 0x60, 0x61, 0xA1,
0x63, 0xA3, 0xA2, 0x62, 0x66, 0xA6, 0xA7, 0x67, 0xA5, 0x65, 0x64, 0xA4,
0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F, 0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB,
0x69, 0xA9, 0xA8, 0x68, 0x78, 0xB8, 0xB9, 0x79, 0xBB, 0x7B, 0x7A, 0xBA,
0xBE, 0x7E, 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, 0xB4, 0x74, 0x75, 0xB5,
0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, 0x70, 0xB0,
0x50, 0x90, 0x91, 0x51, 0x93, 0x53, 0x52, 0x92, 0x96, 0x56, 0x57, 0x97,
0x55, 0x95, 0x94, 0x54, 0x9C, 0x5C, 0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E,
0x5A, 0x9A, 0x9B, 0x5B, 0x99, 0x59, 0x58, 0x98, 0x88, 0x48, 0x49, 0x89,
0x4B, 0x8B, 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C,
0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83,
0x41, 0x81, 0x80, 0x40
};
public static byte[] Crc16(byte[] pucFrame, int usLen)
{
int i = 0;
byte crcHi = 0xFF;
byte crcLo = 0xFF;
UInt16 iIndex = 0x0000;
while (usLen-- > 0)
{
iIndex = (UInt16)(crcLo ^ pucFrame[i++]);
crcLo = (byte)(crcHi ^ aucCRCHi[iIndex]);
crcHi = aucCRCLo[iIndex];
}
return new byte[] { crcLo, crcHi };
}
/// <summary>
/// CRC校验参数data为byte数组
/// </summary>
/// <param name="data">校验数据,字节数组</param>
/// <returns>字节1是高8位字节0是低8位</returns>
public static byte[] CRCCalc(byte[] data)
{
//crc计算赋初始值
int crc = 0xffff;
for (int i = 0; i < data.Length; i++)
{
crc = crc ^ data[i];
for (int j = 0; j < 8; j++)
{
int temp;
temp = crc & 1;
crc = crc >> 1;
crc = crc & 0x7fff;
if (temp == 1)
{
crc = crc ^ 0xa001;
}
crc = crc & 0xffff;
}
}
//CRC寄存器的高低位进行互换
byte[] crc16 = new byte[2];
crc16[0] = (byte)((crc >> 8) & 0xff);
crc16[1] = (byte)(crc & 0xff);
return crc16;
}
/// <summary>
/// CRC校验参数data为byte数组
/// </summary>
/// <param name="data">校验数据,字节数组</param>
/// <returns>字节0是高8位字节1是低8位</returns>
public static byte[] CRCCalcRev(byte[] data)
{
//crc计算赋初始值
int crc = 0xffff;
for (int i = 0; i < data.Length; i++)
{
crc = crc ^ data[i];
for (int j = 0; j < 8; j++)
{
int temp;
temp = crc & 1;
crc = crc >> 1;
crc = crc & 0x7fff;
if (temp == 1)
{
crc = crc ^ 0xa001;
}
crc = crc & 0xffff;
}
}
//CRC寄存器的高低位进行互换
byte[] crc16 = new byte[2];
crc16[1] = (byte)((crc >> 8) & 0xff);
crc16[0] = (byte)(crc & 0xff);
return crc16;
}
#endregion
#region CRC16-8005
private static readonly ushort[] _table = new ushort[256]
{
0,32773,32783,10,32795,30,20,32785,32819,54,60,32825,40,32813,32807,34,
32867,102,108,32873,120,32893,32887,114,80,32853,32863,90,32843,78,68,32833,
32963,198,204,32969,216,32989,32983,210,240,33013,33023,250,33003,238,228,32993,
160,32933,32943,170,32955,190,180,32945,32915,150,156,32921,136,32909,32903,130,
33155,390,396,33161,408,33181,33175,402,432,33205,33215,442,33195,430,420,33185,
480,33253,33263,490,33275,510,500,33265,33235,470,476,33241,456,33229,33223,450,
320,33093,33103,330,33115,350,340,33105,33139,374,380,33145,360,33133,33127,354,
33059,294,300,33065,312,33085,33079,306,272,33045,33055,282,33035,270,260,33025,
33539,774,780,33545,792,33565,33559,786,816,33589,33599,826,33579,814,804,33569,
864,33637,33647,874,33659,894,884,33649,33619,854,860,33625,840,33613,33607,834,
960,33733,33743,970,33755,990,980,33745,33779,1014,1020,33785,1000,33773,33767,994,
33699,934,940,33705,952,33725,33719,946,912,33685,33695,922,33675,910,900,33665,
640,33413,33423,650,33435,670,660,33425,33459,694,700,33465,680,33453,33447,674,
33507,742,748,33513,760,33533,33527,754,720,33493,33503,730,33483,718,708,33473,
33347,582,588,33353,600,33373,33367,594,624,33397,33407,634,33387,622,612,33377,
544,33317,33327,554,33339,574,564,33329,33299,534,540,33305,520,33293,33287,514
};
/// <summary>
/// C#CRC16 8005
/// </summary>
/// <param name="buffer"></param>
/// <returns></returns>
public static byte[] ComputeChecksum(byte[] buffer)
{
ushort crc = 0;
for (int i = 0; i < buffer.Length; ++i)
{
crc = (ushort)((crc << 8) ^ _table[(crc >> 8) ^ buffer[i]]);
}
return new byte[]
{
(byte)(crc >> 8), // High byte
(byte)crc // Low byte
};
}
#endregion
#region 16ASCII
/// <summary>
/// 16进制转字符串ASCII
/// </summary>
/// <param name="hs"></param>
/// <param name="encode"></param>
/// <returns></returns>
public static string HexStringToString(string hs, Encoding encode)
{
StringBuilder strTemp = new StringBuilder();
byte[] b = new byte[hs.Length / 2];
for (int i = 0; i < hs.Length / 2; i++)
{
strTemp.Clear();
strTemp.Append(hs.Substring(i * 2, 2));
b[i] = Convert.ToByte(strTemp.ToString(), 16);
}
return encode.GetString(b);
}
#endregion
#region 162
/// <summary>
/// //16转2方法
/// </summary>
/// <param name="hexString"></param>
/// <returns></returns>
public static string HexString2BinString(string hexString)
{
try
{
string result = string.Empty;
foreach (char c in hexString)
{
int v = Convert.ToInt32(c.ToString(), 16);
int v2 = int.Parse(Convert.ToString(v, 2));
// 去掉格式串中的空格即可去掉每个4位二进制数之间的空格
result += string.Format("{0:d4} ", v2);
}
return result;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
throw;
}
}
#endregion
#region 16byte数组
// 将十六进制字符串转换为字节数组
public static byte[] HexStringToByteArray(string hexString)
{
if (!IsHexStringValid(hexString))
{
throw new ArgumentException("无效的十六进制字符串!", nameof(hexString));
}
return Enumerable.Range(0, hexString.Length / 2).Select(x => Convert.ToByte(hexString.Substring(x * 2, 2), 16)).ToArray();
}
// 验证十六进制字符串格式是否正确
private static bool IsHexStringValid(string hexString)
{
Regex regex = new Regex(@"^[A-Fa-f\d]+$");
return regex.Match(hexString).Success && hexString.Length % 2 == 0;
}
#endregion
#region
public static byte CheckSum(byte[] buffer)
{
byte sum = 0;
foreach (byte b in buffer)
{
sum += b;
}
return sum;
}
#endregion
#region
private static Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
/// <summary>
/// 获取配置文件
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string GetAppSetting(string key)
{
if (ConfigurationManager.AppSettings.AllKeys.Contains(key))
{
string value = config.AppSettings.Settings[key].Value;
return value;
}
else
{
return null;
}
}
/// <summary>
/// 更新配置文件信息
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
public static void UpdateAppSettings(string key, string value)
{
if (GetAppSetting(key) == value) //如果写入的配置文件和之前一致 就不写入了
return;
if (ConfigurationManager.AppSettings.AllKeys.Contains(key))
{
config.AppSettings.Settings[key].Value = value;
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");//刷新数据
}
else
{
Console.WriteLine("当前节点不存在!");
}
}
#endregion
#region
/// <summary>
/// 设置线程工作的空间
/// </summary>
/// <param name="process">线程</param>
/// <param name="minSize">最小空间</param>
/// <param name="maxSize">最大空间</param>
/// <returns></returns>
[System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize", ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Ansi, SetLastError = true)]
private static extern int SetProcessWorkingSetSize(IntPtr process, int minimumWorkingSetSize, int maximumWorkingSetSize);
public static void ClearMemory(object o)
{
GC.Collect();
GC.SuppressFinalize(o);
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
}
}
#endregion
public static float ConvertStringToTwoDecimalPlaces(string value)
{
try
{
return float.Parse(value, CultureInfo.CreateSpecificCulture("en-US"));
}
catch
{
// 处理转换失败的情况例如value不是有效的两位小数字符串
return 0.0f;
}
}
/// <summary>
/// 获取当前设备的所有端口号
/// </summary>
/// <returns></returns>
public static string[] GetSerialPort()
{
string[] ports = null;
ports = System.IO.Ports.SerialPort.GetPortNames();
return ports;
}
/// <summary>
/// 比较两个byte数组是否相等
/// </summary>
/// <param name="array1"></param>
/// <param name="array2"></param>
/// <returns></returns>
public static bool CompareByte(byte[] array1, byte[] array2)
{
if (array1 == null || array2 == null)
return false;
return array1.SequenceEqual(array2);
}
#region byte数组特定位置是否为1
public static bool IsBitSet(byte[] bytes, int position)
{
int arrayIndex = position / 8; // 计算byte数组的索引
int bitIndex = position % 8; // 计算位的索引0-7
// 确保索引没有超出数组范围
if (arrayIndex >= bytes.Length)
throw new IndexOutOfRangeException("Position is out of range of the byte array.");
byte b = bytes[arrayIndex];
// 使用位运算检查位是否为1
bool isSet = (b & (1 << bitIndex)) != 0;
return isSet;
}
#endregion
#region
public static byte[] ConvertHexToBinary(byte[] hexArray)
{
byte[] binaryArray = new byte[hexArray.Length * 8];
for (int i = 0; i < hexArray.Length; i++)
{
string binaryString = Convert.ToString(hexArray[i], 2);
// 补充到8位以确保每个byte都是8位
binaryString = binaryString.PadLeft(8, '0');
// 将二进制字符串转换为byte数组
for (int j = 0; j < 8; j++)
{
binaryArray[i * 8 + j] = Convert.ToByte(binaryString[j] - '0');
}
}
return binaryArray;
}
#endregion
#region IntToByte[4]
/// <summary>
/// int转化为byte[4]
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static byte[] IntToBytes(int value)
{
byte[] src = new byte[4];
src[0] = (byte)((value >> 24) & 0xFF);
src[1] = (byte)((value >> 16) & 0xFF);
src[2] = (byte)((value >> 8) & 0xFF);//高8位
src[3] = (byte)(value & 0xFF);//低位
return src;
}
#endregion
#region byte数组按长度在前面补0
/// <summary>
/// byte数组按长度在前面补0
/// </summary>
/// <param name="array"></param>
/// <param name="targetLength"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentOutOfRangeException"></exception>
public static byte[] PadArrayWithZeros(byte[] array, int targetLength)
{
if (array == null)
throw new ArgumentNullException(nameof(array));
if (targetLength <= 0)
throw new ArgumentOutOfRangeException(nameof(targetLength), "Target length must be a positive integer.");
if (targetLength <= array.Length)
return array; // No need to pad
byte[] paddedArray = new byte[targetLength];
Array.Copy(array, 0, paddedArray, targetLength - array.Length, array.Length);
return paddedArray;
}
#endregion
}
}

View File

@ -0,0 +1,32 @@
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FujianEarthquake.DataAccess
{
//封装事务中的每个操作类,包括命令名称,类型,参数
public class CmdInfo
{
public string CommandText;//sql或存储过程名称
public MySqlParameter[] Parameters;//参数列表
public int CmdType;//是存储过程还是T-SQL语句
public CmdInfo()
{ }
public CmdInfo(string comText, int cmdType)
{
this.CommandText = comText;
this.CmdType = cmdType;
}
public CmdInfo(string commandText, MySqlParameter[] parameters, int cmdType)
{
CommandText = commandText;
Parameters = parameters;
CmdType = cmdType;
}
}
}

View File

@ -0,0 +1,316 @@
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FujianEarthquake.DataAccess
{
public class DBHelper
{
//连接钥匙
private static readonly string ConnStr = ConfigurationManager.ConnectionStrings["db"].ConnectionString;
private static readonly string ConnStr_Server = ConfigurationManager.ConnectionStrings["db_Sever"].ConnectionString;
MySqlConnection conn = null;
/// <summary>
/// 增删改
/// </summary>
/// <param name="sql">增删改</param>
/// <param name="cmdType">1代表是查询过程 2 是代表存储过程</param>
/// <param name="paras"></param>
/// <returns></returns>
public static int ExecuteNonQuery(string sql, int cmdType, params MySqlParameter[] paras)
{
int count = 0;
using (MySqlConnection conn = new MySqlConnection(ConnStr))
{
MySqlCommand cmd = BuildCommand(conn, sql, cmdType, null, paras);
count = cmd.ExecuteNonQuery();
cmd.Parameters.Clear(); //清空数组集合
conn.Close();
}
////向服务器发送数据
//if (tools.TcpClientCheck(ConnStr_Server.Split(';')[0].Split('=')[1], 3306))
//{
// using (MySqlConnection conn = new MySqlConnection(ConnStr_Server))
// {
// MySqlCommand cmd = BuildCommand(conn, sql, cmdType, null, paras);
// count = cmd.ExecuteNonQuery();
// cmd.Parameters.Clear(); //清空数组集合
// conn.Close();
// }
//}
return count;
}
/// <summary>
/// 查询一个值
/// </summary>
/// <param name="sql"></param>
/// <param name="cmdType"></param>
/// <param name="paras"></param>
/// <returns></returns>
public static object ExecuteScalar(string sql, int cmdType, params MySqlParameter[] paras)
{
object o = 0;
using (MySqlConnection conn = new MySqlConnection(ConnStr))
{
MySqlCommand cmd = BuildCommand(conn, sql, cmdType, null, paras);
o = cmd.ExecuteScalar();
cmd.Parameters.Clear();
conn.Close();
}
return o;
}
/// <summary>
/// 查询多行值
/// </summary>
/// <param name="sql"></param>
/// <param name="cmdType"></param>
/// <param name="paras"></param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public static MySqlDataReader ExecuteReader(string sql, int cmdType, params MySqlParameter[] paras)
{
MySqlDataReader dr = null;
MySqlConnection conn = new MySqlConnection(ConnStr);
MySqlCommand cmd = BuildCommand(conn, sql, cmdType, null, paras);
try
{
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
cmd.Parameters.Clear();
}
catch (MySqlException ex)
{
conn.Close();
throw new Exception("执行查询异常", ex);
}
return dr;
}
/// <summary>
/// 填充DataSet
/// </summary>
/// <param name="sql"></param>
/// <param name="cmdType"></param>
/// <param name="paras"></param>
/// <returns></returns>
public static DataSet GetDataSet(string sql, int cmdType, MySqlParameter[] paras)
{
DataSet ds = new DataSet();
using (MySqlConnection conn = new MySqlConnection(ConnStr))
{
MySqlCommand cmd = BuildCommand(conn, sql, cmdType, null, paras);
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
//conn.Open();
da.Fill(ds);
conn.Close();
}
return ds;
}
/// <summary>
/// 填充DataTable 一个结果集
/// </summary>
/// <param name="sql"></param>
/// <param name="cmdType"></param>
/// <param name="paras"></param>
/// <returns></returns>
public static DataTable GetDataTable(string sql, int cmdType, MySqlParameter[] paras)
{
DataTable dt = new DataTable();
using (MySqlConnection conn = new MySqlConnection(ConnStr))
{
MySqlCommand cmd = BuildCommand(conn, sql, cmdType, null, paras);
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
//conn.Open();
da.Fill(dt);
conn.Close();
}
return dt;
}
/// <summary>
/// 事务 一系列的sql语句 针对增删该查
/// </summary>
/// <param name="listSQL"></param>
/// <returns></returns>
public static bool ExecuteTrans(List<string> listSQL)
{
using (MySqlConnection conn = new MySqlConnection(ConnStr))
{
conn.Open();
MySqlTransaction trans = conn.BeginTransaction();
//MySqlCommand cmd = conn.CreateCommand();
//cmd.Transaction = trans;
MySqlCommand cmd = BuildCommand(conn, "", 1, trans);
try
{
for (int i = 0; i < listSQL.Count; i++)
{
cmd.CommandText = listSQL[i];
cmd.ExecuteNonQuery();
}
trans.Commit();
return true;
}
catch (MySqlException ex)
{
trans.Rollback();//回滚
throw new Exception("执行事务出现异常", ex);
}
finally
{
trans.Dispose();
cmd.Dispose();
conn.Close();
}
}
}
/// <summary>
/// 执行事务 每个操作分装到cmdInfo中
/// </summary>
/// <param name="listCmd"></param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public static bool ExecuteTrans(List<CmdInfo> listCmd)
{
using (MySqlConnection conn = new MySqlConnection(ConnStr))
{
conn.Open();
MySqlTransaction trans = conn.BeginTransaction();
//MySqlCommand cmd = conn.CreateCommand();
//cmd.Transaction = trans;
MySqlCommand cmd = BuildCommand(conn, "", 1, trans);
try
{
for (int i = 0; i < listCmd.Count; i++)
{
cmd.CommandText = listCmd[i].CommandText;
if (listCmd.Count == 2)
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Clear(); //很重要
if (cmd.Parameters != null && cmd.Parameters.Count > 0)
cmd.Parameters.AddRange(listCmd[i].Parameters);
cmd.ExecuteNonQuery();
cmd.Parameters.Clear(); //很重要
}
trans.Commit();
return true;
}
catch (MySqlException ex)
{
trans.Rollback();//回滚
throw new Exception("执行事务出现异常", ex);
}
finally
{
trans.Dispose();
cmd.Dispose();
conn.Close();
}
}
}
/// <summary>
/// 构造SqlCommand
/// </summary>
/// <param name="conn"></param>
/// <param name="sql"></param>
/// <param name="cmdType"></param>
/// <param name="trans"></param>
/// <param name="paras"></param>
/// <returns></returns>
private static MySqlCommand BuildCommand(MySqlConnection conn, string sql, int cmdType, MySqlTransaction trans, params MySqlParameter[] paras)
{
MySqlCommand cmd = new MySqlCommand(sql, conn);
if (cmdType == 2)
cmd.CommandType = CommandType.StoredProcedure; //代表是存储过程
if (paras != null && paras.Length > 0)
cmd.Parameters.AddRange(paras);
if (conn.State == ConnectionState.Closed)
conn.Open();
if (trans != null)
cmd.Transaction = trans;
return cmd;
}
/// <summary>
/// 对数据库插入数据
/// </summary>
/// <param name="tablename">表名</param>
/// <param name="stationId">站点ID</param>
/// <param name="RecordTime">数据记录时间</param>
/// <param name="key">需要插入的值的名称</param>
/// <param name="value">值</param>
public static void InsertData(string tablename, int stationId, DateTime RecordTime, string key, object value)
{
//首先判断数据库中是否有这一条数据
string sql = string.Format("select id from {0} where RecordTime = '{1}' && StationID = {2}", tablename, RecordTime, stationId);
if (ExecuteScalar(sql, 1) == null)
{
string valuechange = typeof(string).Equals(value.GetType()) ? "'{5}'" : "{5}";
sql = string.Format("insert into {0}(StationID,RecordTime,DataTime,{1}) VALUES({2},'{3}','{4}'," + valuechange + ");", tablename, key, stationId, RecordTime, System.DateTime.Now, value.ToString());
}
else
{
//如果数据不同才更新
if (ExecuteScalar(string.Format("select {0} from {1} where id = {2}", key, tablename, Convert.ToInt32(ExecuteScalar(sql, 1))), 1) != value)
{
string valuechange = typeof(string).Equals(value.GetType()) ? "'{2}'" : "{2}";
sql = string.Format("update {0} set {1}=" + valuechange + " where RecordTime='{3}' && StationID = {4};", tablename, key, value.ToString(), RecordTime, stationId);
}
}
ExecuteNonQuery(sql, 1);
}
//public static void InsertAlarmInfo(AlarmRecordModel alarmInfo)
//{
////首先判断数据库中是否有这一条数据
//string sql = string.Format("select id from alarminfo where ParaName = '{0}';", alarmInfo.ParaName);
//if (ExecuteScalar(sql, 1) == null) //如果没有那就新增一条信息
//{
// sql = string.Format("insert into alarminfo(StationID,RecordTime,DataTime,ParaName,ParaState,IsHandled) VALUES({0},'{1}','{2}','{3}','{4}',{5})", alarmInfo.StationID, alarmInfo.RecordTime, alarmInfo.DataTime, alarmInfo.ParaName, alarmInfo.ParaState, 0);
//}
//else //如果有那就更新这条信息
//{
// sql = string.Format("update alarminfo set ParaState='{0}',IsHandled={1},RecordTime='{2}',DataTime='{3}' where ParaName = '{4}'", alarmInfo.ParaState, alarmInfo.IsHandled, alarmInfo.RecordTime, alarmInfo.DataTime, alarmInfo.ParaName);
//}
//ExecuteNonQuery(sql, 1);
//sql = string.Format("insert into alarm_info(StationID,RecordTime,DataTime,ParaName,ParaState,IsHandled) VALUES({0},'{1}','{2}','{3}','{4}',{5})", alarmInfo.StationID, alarmInfo.RecordTime, alarmInfo.DataTime, alarmInfo.ParaName, alarmInfo.ParaState, 0);
//ExecuteNonQuery(sql, 1);
//}
//public static void InsertSwitchInfo(SwitchInfoModel switchInfo)
//{
// //首先判断数据库中是否有这一条数据
// string sql = string.Format("select id from switch_info where SwitchName = '{0}';", switchInfo.SwitchName);
// if (ExecuteScalar(sql, 1) == null) //如果没有那就新增一条信息
// {
// sql = string.Format("insert into switch_info(StationID,RecordTime,DataTime,SwitchName,SwitchState) VALUES({0},'{1}','{2}','{3}','{4}')", switchInfo.StationID, switchInfo.RecordTime, switchInfo.DataTime, switchInfo.SwitchName, switchInfo.SwitchState);
// }
// else //如果有那就更新这条信息
// {
// sql = string.Format("update switch_info set SwitchState='{0}',RecordTime='{1}',DataTime='{2}' where SwitchName = '{3}'", switchInfo.SwitchState, switchInfo.RecordTime, switchInfo.DataTime, switchInfo.SwitchName);
// }
// ExecuteNonQuery(sql, 1);
// sql = string.Format("insert into switch_info_his(StationID,RecordTime,DataTime,SwitchName,SwitchState) VALUES({0},'{1}','{2}','{3}','{4}')", switchInfo.StationID, switchInfo.RecordTime, switchInfo.DataTime, switchInfo.SwitchName, switchInfo.SwitchState);
// ExecuteNonQuery(sql, 1);
//}
}
}

View File

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<Folder Include="Assets\Fonts\" />
<Folder Include="Assets\Images\" />
<Folder Include="Assets\Styles\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,193 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<None Remove="Assets\Fonts\digital_display.ttf" />
<None Remove="Assets\Fonts\iconfont.ttf" />
<None Remove="Assets\Fonts\方正楷体简体.ttf" />
<None Remove="Assets\Images\AlarmCycle.png" />
<None Remove="Assets\Images\AlarmTri.png" />
<None Remove="Assets\Images\AlarmWhite.png" />
<None Remove="Assets\Images\AskData.png" />
<None Remove="Assets\Images\Check.png" />
<None Remove="Assets\Images\Close.png" />
<None Remove="Assets\Images\Close1.png" />
<None Remove="Assets\Images\ConnectState.png" />
<None Remove="Assets\Images\CycleGray.png" />
<None Remove="Assets\Images\CycleGreen.png" />
<None Remove="Assets\Images\CycleOrange.png" />
<None Remove="Assets\Images\CycleRed.png" />
<None Remove="Assets\Images\CycleYellow.png" />
<None Remove="Assets\Images\Delete.png" />
<None Remove="Assets\Images\DeviceOff.png" />
<None Remove="Assets\Images\DeviceOn.png" />
<None Remove="Assets\Images\DisLink.png" />
<None Remove="Assets\Images\Download.png" />
<None Remove="Assets\Images\Ensure.png" />
<None Remove="Assets\Images\Left.png" />
<None Remove="Assets\Images\Left2.png" />
<None Remove="Assets\Images\Link.png" />
<None Remove="Assets\Images\Max.png" />
<None Remove="Assets\Images\Min.png" />
<None Remove="Assets\Images\NoDevice.png" />
<None Remove="Assets\Images\Open.png" />
<None Remove="Assets\Images\Refresh.png" />
<None Remove="Assets\Images\Reset.png" />
<None Remove="Assets\Images\ReturnHigh.png" />
<None Remove="Assets\Images\Right.png" />
<None Remove="Assets\Images\Right2.png" />
<None Remove="Assets\Images\Robot.png" />
<None Remove="Assets\Images\Set.png" />
<None Remove="Assets\Images\Start.png" />
<None Remove="Assets\Images\Stop.png" />
<None Remove="Assets\Images\Trademark.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Base\" />
<Folder Include="Controls\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="3DTools" Version="1.0.0" />
<PackageReference Include="HandyControl" Version="3.5.0" />
<PackageReference Include="HandyControls" Version="3.5.0" />
<PackageReference Include="LiveCharts" Version="0.9.7" />
<PackageReference Include="LiveCharts.Wpf" Version="0.9.7" />
<PackageReference Include="MaterialDesignColors" Version="3.1.0" />
<PackageReference Include="MaterialDesignThemes" Version="5.1.0" />
<PackageReference Include="MvvmLightLibs" Version="5.4.1.1" />
<PackageReference Include="MySql.Data" Version="9.0.0" />
<PackageReference Include="Oracle.ManagedDataAccess" Version="23.5.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="System.IO.Ports" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\Fonts\digital_display.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Fonts\iconfont.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Fonts\方正楷体简体.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\AlarmCycle.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\AlarmTri.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\AlarmWhite.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\AskData.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Check.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Close.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Close1.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\ConnectState.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\CycleGray.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\CycleGreen.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\CycleOrange.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\CycleRed.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\CycleYellow.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Delete.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\DeviceOff.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\DeviceOn.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\DisLink.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Download.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Ensure.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Left.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Left2.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Link.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Max.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Min.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\NoDevice.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Open.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Refresh.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Reset.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\ReturnHigh.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Right.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Right2.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Robot.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Set.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Start.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Stop.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Trademark.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
</Project>

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<ItemGroup>
<Compile Update="Views\AlarmRecordView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\BaseStationModelView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\JunctionBoxEnvironDataView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\JunctionBoxStatusDataView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\LogRecordView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\RealTimeDataView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\ShoreBaseStationStatusDataView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\SystemControlView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\UserControls\TextDialog.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Update="App.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Assets\Styles\DefaultStyle.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="MainWindow.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\AlarmRecordView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\BaseStationModelView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\JunctionBoxEnvironDataView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\JunctionBoxStatusDataView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\LogRecordView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\RealTimeDataView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\ShoreBaseStationStatusDataView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\SystemControlView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\UserControls\TextDialog.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
</Project>

View File

@ -0,0 +1,305 @@
<Window x:Class="FujianEarthquake.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:FujianEarthquake"
mc:Ignorable="d"
Title="海洋地震综合观测系统" Height="900" Width="1600"
Background="Transparent"
ResizeMode="CanMinimize"
FontFamily="{StaticResource DigitalDisplay}"
FontSize="12"
WindowStartupLocation="CenterScreen">
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="-1" />
</WindowChrome.WindowChrome>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<!--复选框按钮样式-->
<Style x:Key="NavButtonStyle" TargetType="RadioButton">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Border Name="back" Background="Transparent" CornerRadius="8">
<ContentControl Margin="20,4" HorizontalAlignment="Center"
VerticalAlignment="Center" Content="{TemplateBinding Content}"
FontSize="18"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="back" Property="Background" Value="#1AFFFFFF"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="back" Property="Background" Value="#44FFFFFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="StationChangeStyle" TargetType="RadioButton">
<Setter Property="Width" Value="80"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Foreground" Value="#888"/>
<Setter Property="Background" Value="#DDD"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Border Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="Orange"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="DataGridStyle" TargetType="{x:Type DataGrid}">
<Setter Property="AutoGenerateColumns" Value="False"/>
<Setter Property="CanUserAddRows" Value="False"/>
<Setter Property="CanUserDeleteRows" Value="False"/>
<Setter Property="CanUserReorderColumns" Value="False"/>
<Setter Property="CanUserResizeColumns" Value="True"/>
<Setter Property="CanUserResizeRows" Value="False"/>
<Setter Property="CanUserSortColumns" Value="True"/>
<Setter Property="GridLinesVisibility" Value="All"/>
<Setter Property="HeadersVisibility" Value="All"/>
<Setter Property="IsReadOnly" Value="True"/>
<Setter Property="MinRowHeight" Value="40"/>
<Setter Property="Background" Value="#FF285173"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<Style x:Key="ColumnHeaderStyle" TargetType="DataGridColumnHeader">
<Setter Property="Height" Value="30" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Background" Value="#FF285173" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
<!--<converters:ConnectConvert x:Key="ConnectConvert" />
<converters:ConnectConvert1 x:Key="ConnectConvert1" />
<converters:ConnectConvert4 x:Key="ConnectConvert4" />-->
</ResourceDictionary>
</Window.Resources>
<Grid>
<!--背景颜色-->
<Grid.Background>
<RadialGradientBrush>
<!--<GradientStop Offset="0" Color="#FF285173" />
<GradientStop Offset="0.3" Color="#FF244967" />-->
<GradientStop Offset="1" Color="#FF14273A" />
</RadialGradientBrush>
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="45"/>
<RowDefinition Height="38"/>
<RowDefinition Height="45"/>
<RowDefinition/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<!--标题栏部分-->
<Border BorderBrush="#FF285173" BorderThickness="0,0,0,1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="45"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="Assets/Images/Trademark.png"/>
<TextBlock Grid.Column="1" Text="福建海洋地震综合观测系统" FontSize="24" HorizontalAlignment="Center"
VerticalAlignment="Center" Foreground="White" Margin="10,0,0,0"/>
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="13"/>
</Grid.RowDefinitions>
<!--鼠标左键按下拖动事件-->
<Border Height="132" VerticalAlignment="Top" CornerRadius="10,10,0,0"
MouseLeftButtonDown="Border_MouseLeftButtonDown"/>
<!--控制按钮-->
<Border Width="200" HorizontalAlignment="Right" Background="Transparent"
WindowChrome.IsHitTestVisibleInChrome="True">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button Click="MinButton_Click" Background="Transparent" Style="{StaticResource ControlButtonStyle}">
<Button.Content>
<Image Source="Assets/Images/Min.png"/>
</Button.Content>
</Button>
<!--<Button Click="MaxButton_Click" Background="Transparent" Style="{StaticResource ControlButtonStyle}">
<Button.Content>
<Image Source="Assets/Images/Max.png"/>
</Button.Content>
</Button>-->
<Button Click="Button_Click" Background="DarkRed" Style="{StaticResource ControlButtonStyle}">
<Button.Content>
<Image Source="Assets/Images/Close.png"/>
</Button.Content>
</Button>
</StackPanel>
</Border>
<Border Grid.Row="1" BorderBrush="#5518AABD" BorderThickness="0,1,0,0"/>
<Border Grid.Row="1" Margin="0,3,0,2">
<Border.Background>
<VisualBrush TileMode="Tile" Viewport="0,0,7,7" ViewportUnits="Absolute">
<VisualBrush.Visual>
<Grid Width="20" Height="20">
<Line Stroke="Gray" StrokeThickness="1" X1="0" X2="10" Y1="10" Y2="0"/>
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</Border.Background>
</Border>
</Grid>
</Grid>
</Border>
<!--连接状态连接信息-->
<StackPanel Grid.Row="1" Margin="40,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"
Orientation="Horizontal">
<Image Source="Assets/Images/Robot.png" Height="28"/>
<TextBlock Margin="10,0" VerticalAlignment="Center" FontSize="14" Text="连接状态信息"
Foreground="#99FFFFFF"/>
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="海底基站通信①:"
FontSize="14"/>
<!--<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding serverModel1.IsOpened, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding serverModel1.IsOpened, Converter={StaticResource ResourceKey=ConnectConvert1}}"/>-->
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="海底基站通信②:"
FontSize="14"/>
<!--<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding serverModel2.IsOpened, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding serverModel2.IsOpened, Converter={StaticResource ResourceKey=ConnectConvert1}}"/>-->
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="海底基站通信③:"
FontSize="14"/>
<!--<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding clientModel1.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding clientModel1.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert4}}"/>-->
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="一体式节点通信:"
FontSize="14"/>
<!--<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding clientModel2.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding clientModel2.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert4}}"/>-->
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="多接口节点通信:"
FontSize="14"/>
<!--<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding clientModel2.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding clientModel2.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert4}}"/>-->
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="岸基站通信①:"
FontSize="14"/>
<!--<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding clientModel2.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding clientModel2.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert4}}"/>-->
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="岸基站通信②:"
FontSize="14"/>
<!--<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding clientModel2.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding clientModel2.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert4}}"/>-->
</StackPanel>
<!--时间日期状态信息-->
<StackPanel Grid.Row="1" Margin="30,0" HorizontalAlignment="Right" VerticalAlignment="Center"
Orientation="Horizontal">
<TextBlock x:Name="DataTime" VerticalAlignment="Center" FontFamily="../Assets/Fonts/#Digital Display"
FontSize="22" Foreground="White"/>
<StackPanel Margin="15,0,0,0" TextBlock.FontSize="12" TextBlock.Foreground="White">
<TextBlock x:Name="Date" HorizontalAlignment="Center" VerticalAlignment="Top"/>
<TextBlock x:Name="Week" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
</StackPanel>
</StackPanel>
<!--菜单栏部分-->
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="650"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Margin="20,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"
Orientation="Horizontal">
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="1" Content="海底基站 1#"
IsChecked="True" Style="{StaticResource StationChangeStyle}" Width="120"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="2" Content="海底基站 2#"
Style="{StaticResource StationChangeStyle}" Width="120"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="3" Content="海底基站 3#"
Style="{StaticResource StationChangeStyle}" Width="120"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="4" Content="水池 一体式"
Style="{StaticResource StationChangeStyle}" Width="120"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="5" Content="水池 多接口"
Style="{StaticResource StationChangeStyle}" Width="120"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="20,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"
Orientation="Horizontal">
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="RealTimeDataView"
Content="实时数据" IsChecked="True" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="JunctionBoxEnvironDataView"
Content="接驳盒环境" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="JunctionBoxStatusDataView"
Content="接驳盒状态" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="ShoreBaseStationStatusDataView"
Content="岸基站状态" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="SystemControlView"
Content="系统控制" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="LogRecordView"
Content="日志记录" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="AlarmRecordView"
Content="告警记录" Style="{DynamicResource NavButtonStyle}"/>
</StackPanel>
</Grid>
<!--内容部分-->
<ContentControl Grid.Row="3" Content="{Binding PageContent}"/>
<!--底部装饰-->
<Border Grid.Row="4" BorderBrush="#5518AABD" BorderThickness="0,1,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Border Margin="0,5">
<Border.Background>
<VisualBrush TileMode="Tile" Viewport="0,0,7,7" ViewportUnits="Absolute">
<VisualBrush.Visual>
<Grid Width="20" Height="20">
<Line Stroke="Gray" StrokeThickness="1" X1="0" X2="10" Y1="10" Y2="0"/>
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</Border.Background>
</Border>
</Grid>
</Border>
</Grid>
</Window>

View File

@ -0,0 +1,120 @@
using FujianEarthquake.ViewModels;
using System.Text;
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;
using System.Windows.Threading;
namespace FujianEarthquake
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
static public MainViewModel mainViewModel { set; get; } = new MainViewModel();
private DispatcherTimer ShowTimer;
public MainWindow()
{
InitializeComponent();
this.DataContext = mainViewModel;
this.MaxHeight = SystemParameters.PrimaryScreenHeight;//防止最大化时系统任务栏被遮盖
//添加timer
ShowTimer = new System.Windows.Threading.DispatcherTimer();
ShowTimer.Tick += new EventHandler(ShowTime);
ShowTimer.Interval = new TimeSpan(0, 0, 0, 1, 0);
ShowTimer.Start();
}
/// <summary>
/// 时间、日期显示
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void ShowTime(object sender, EventArgs e)
{
this.DataTime.Text = "";
this.Date.Text = "";
this.Week.Text = "";
//获得年月日
this.DataTime.Text += " " + DateTime.Now.ToString("HH:mm:ss"); //yyyy年MM月dd日
this.Date.Text += " " + DateTime.Now.ToString("yyyy-MM-dd");
this.Week.Text += System.DateTime.Today.ToString("dddd", new System.Globalization.CultureInfo("zh-CN"));
}
/// <summary>
/// 主窗体关闭
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click(object sender, RoutedEventArgs e)
{
//主窗体关闭之前调用通信断开
//if (mainViewModel.clientModel1 != null && mainViewModel.clientModel1.IsConnected)
// mainViewModel.clientModel1.DisConnect();
//if (mainViewModel.clientModel2 != null && mainViewModel.clientModel2.IsConnected)
// mainViewModel.clientModel2.DisConnect();
//if (mainViewModel.serverModel1 != null && mainViewModel.serverModel1.IsOpened)
// mainViewModel.serverModel1.DoStop();
//if (mainViewModel.serverModel2 != null && mainViewModel.serverModel2.IsOpened)
// mainViewModel.serverModel2.DoStop();
this.Close();
}
/// <summary>
/// 左键点击顶栏拖动窗体
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
this.DragMove();
//双击最大化
//switch (e.ClickCount)
//{
// case 2:
// {
// WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
// break;
// }
//}
}
/// <summary>
/// 最小化按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MinButton_Click(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
}
/// <summary>
/// 最大化按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MaxButton_Click(object sender, RoutedEventArgs e)
{
this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
}
}
}

View File

@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace FujianEarthquake.Models
{
public class AlarmRecordModel : ParameterModel
{
public int Index { get; set; }
public DateTime DataTime { get; set; }
private string paraName;
/// <summary>
/// 故障参数名称
/// </summary>
public string ParaName
{
get { return paraName; }
set { paraName = value; }
}
private int paraNum;
/// <summary>
/// 故障发生次数
/// </summary>
public int ParaNum
{
get { return paraNum; }
set { paraNum = value; }
}
private string paraContent;
/// <summary>
/// 故障事件全称
/// </summary>
public string ParaContent
{
get { return paraContent; }
set { paraContent = value; }
}
private string isHandled;
/// <summary>
/// 故障事件是否处理 0未处理 1已处理 2处理中
/// </summary>
public string IsHandled
{
get { return isHandled; }
set { isHandled = value; }
}
public string ProcessingMethod { get; set; }
public ImageSource UrgencyLevel { get; set; }
}
}

View File

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FujianEarthquake.Models
{
public class BaseStationGestureModel : ParameterModel
{
private float rollAngle;
/// <summary>
/// 横滚角
/// </summary>
public float RollAngle
{
get { return rollAngle; }
set { rollAngle = value; this.DoNotify(); }
}
private float pitchAngle;
/// <summary>
/// 俯仰角
/// </summary>
public float PitchAngle
{
get { return pitchAngle; }
set { pitchAngle = value; this.DoNotify(); }
}
private float headingAngle;
/// <summary>
/// 航向角
/// </summary>
public float HeadingAngle
{
get { return headingAngle; }
set { headingAngle = value; this.DoNotify(); }
}
private float pY_HG;
/// <summary>
/// 横滚角偏移度数
/// </summary>
public float PY_HG
{
get { return pY_HG; }
set { pY_HG = value; this.DoNotify(); }
}
private float pY_FY;
/// <summary>
/// 俯仰角度偏移度数
/// </summary>
public float PY_FY
{
get { return pY_FY; }
set { pY_FY = value; this.DoNotify(); }
}
private float pY_PH;
/// <summary>
/// 航向角偏移度数
/// </summary>
public float PY_PH
{
get { return pY_PH; }
set { pY_PH = value; this.DoNotify(); }
}
}
}

View File

@ -0,0 +1,21 @@
using FujianEarthquake.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FujianEarthquake.Models.HelpModels
{
public class KeypaiValueModel : NotifyBase
{
public string Header { get; set; }
private string _value;
public string Value
{
get { return _value; }
set { SetProperty(ref _value, value); }
}
}
}

View File

@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace FujianEarthquake.Models
{
public class JunctionBoxEnvironModel : ParameterModel
{
private float temperature;
/// <summary>
/// 接驳盒温度
/// </summary>
public float Temperature
{
get { return temperature; }
set { temperature = value; }
}
private float humidity;
/// <summary>
/// 接驳盒湿度
/// </summary>
public float Humidity
{
get { return humidity; }
set { humidity = value; }
}
private ImageSource leakage;
/// <summary>
/// 接驳盒漏水
/// </summary>
public ImageSource Leakage
{
get { return leakage; }
set { leakage = value; }
}
//private ImageSource hatch_State;
///// <summary>
///// 舱门状态
///// </summary>
//public ImageSource Hatch_State
//{
// get { return hatch_State; }
// set { hatch_State = value; }
//}
private float attitudeX;
/// <summary>
/// 接驳盒姿态x轴
/// </summary>
public float AttitudeX
{
get { return attitudeX; }
set { attitudeX = value; this.DoNotify(); }
}
private float attitudeY;
/// <summary>
/// 接驳盒姿态y轴
/// </summary>
public float AttitudeY
{
get { return attitudeY; }
set { attitudeY = value; this.DoNotify(); }
}
private float attitudeZ;
/// <summary>
/// 接驳盒姿态z轴
/// </summary>
public float AttitudeZ
{
get { return attitudeZ; }
set { attitudeZ = value; this.DoNotify(); }
}
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FujianEarthquake.Models
{
public class LogRecordModel
{
public int Index { get; set; }
public DateTime RecordTime { get; set; }
public string Device_Name { get; set; }
public string Operation_Type { get; set; }
public string Record { get; set; }
}
}

View File

@ -0,0 +1,58 @@
using FujianEarthquake.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FujianEarthquake.Models
{
public class ParameterModel : NotifyBase
{
private int stationId;
/// <summary>
/// 站点ID
/// </summary>
public int StationID
{
get { return stationId; }
set { stationId = value; }
}
private int index;
/// <summary>
/// ID
/// </summary>
public int Index
{
get { return index; }
set { index = value; }
}
private DateTime recordTime;
/// <summary>
/// 数据记录时间
/// </summary>
public DateTime RecordTime
{
get { return recordTime; }
set { recordTime = value; }
}
private DateTime dataTime;
/// <summary>
/// 数据上报时间
/// </summary>
public DateTime DataTime
{
get { return dataTime; }
set { dataTime = value; }
}
}
}

View File

@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace FujianEarthquake.Models
{
public class ShoreBaseStationStateDataModel : ParameterModel
{
private float out_Vol;
/// <summary>
/// 输出电压
/// </summary>
public float Out_Vol
{
get { return out_Vol; }
set { out_Vol = value; }
}
private float out_Cur;
/// <summary>
/// 输出电流
/// </summary>
public float Out_Cur
{
get { return out_Cur; }
set { out_Cur = value; }
}
private float rated_Vol;
/// <summary>
/// 额定电压/电压设置值
/// </summary>
public float Rated_Vol
{
get { return rated_Vol; }
set { rated_Vol = value; }
}
private float rated_Cur;
/// <summary>
/// 额定电流/电流设置值
/// </summary>
public float Rated_Cur
{
get { return rated_Cur; }
set { rated_Cur = value; }
}
private float pro_Vol;
/// <summary>
/// 输出过压保护值
/// </summary>
public float Pro_Vol
{
get { return pro_Vol; }
set { pro_Vol = value; }
}
private float pro_Cur;
/// <summary>
/// 输出过流保护值
/// </summary>
public float Pro_Cur
{
get { return pro_Cur; }
set { pro_Cur = value; }
}
private ImageSource relayStatus;
/// <summary>
/// 继电器状态
/// </summary>
public ImageSource RelayStatus
{
get { return relayStatus; }
set { relayStatus = value; }
}
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FujianEarthquake.ViewModels
{
public class AlarmRecordViewModel
{
public AlarmRecordViewModel(int id)
{
}
}
}

View File

@ -0,0 +1,21 @@
using FujianEarthquake.Common;
using FujianEarthquake.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FujianEarthquake.ViewModels
{
public class BaseStationModelViewModel : NotifyBase
{
private BaseStationGestureModel baseStationGesture = new BaseStationGestureModel();
public BaseStationGestureModel BaseStationGesture
{
get { return baseStationGesture; }
set { baseStationGesture = value; this.DoNotify(); }
}
}
}

View File

@ -0,0 +1,23 @@
using FujianEarthquake.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FujianEarthquake.ViewModels
{
public class DialogViewModel : NotifyBase
{
private string content;
public string Content
{
get { return content; }
set
{
content = value;
this.DoNotify();
}
}
}
}

View File

@ -0,0 +1,466 @@
using FujianEarthquake.Common;
using FujianEarthquake.DataAccess;
using FujianEarthquake.Models;
using FujianEarthquake.Views.UserControls;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows;
using System.Windows.Threading;
namespace FujianEarthquake.ViewModels
{
public class LogRecordViewModel : NotifyBase
{
#region Search Data
private DateTime _startDateTime;
public DateTime StartDateTime
{
get { return _startDateTime; }
set { Set(ref _startDateTime, value); }
}
private DateTime _endDateTime;
public DateTime EndDateTime
{
get { return _endDateTime; }
set { Set(ref _endDateTime, value); }
}
int PageIndex = 0;
private int recordCount;
public int RecordCount
{
get { return recordCount; }
set { recordCount = value; this.DoNotify(); }
}
private int totalPage;
public int TotalPage
{
get { return totalPage; }
set { totalPage = value; this.DoNotify(); }
}
private string logMsg;
public string LogMsg
{
get { return logMsg; }
set { logMsg = value; this.DoNotify(); }
}
#endregion
private ObservableCollection<LogRecordModel> logRecordList = new ObservableCollection<LogRecordModel>();
public ObservableCollection<LogRecordModel> LogRecordList
{
get { return logRecordList; }
set { logRecordList = value; this.DoNotify(); }
}
private ObservableCollection<LogRecordModel> totalLogRecordList = new ObservableCollection<LogRecordModel>();
public ObservableCollection<LogRecordModel> TotalLogRecordList
{
get { return totalLogRecordList; }
set { totalLogRecordList = value; this.DoNotify(); }
}
#region Data Filtering
public static DialogViewModel vm;
private bool _isChecked;
public bool IsChecked
{
get { return _isChecked; }
set
{
_isChecked = value;
this.DoNotify();
if (IsChecked)
{
if (string.IsNullOrEmpty(EndDateTime.ToString()) || string.IsNullOrEmpty(StartDateTime.ToString()))
{
IsChecked = false;
return;
}
if (EndDateTime < StartDateTime)
{
HandyControl.Controls.Dialog.Show(new TextDialog("起始时间大于结束时间,\n请重新输入"));
IsChecked = false;
//this.EndDateTime = DateTime.Now;
//this.StartDateTime = DateTime.Now.AddDays(-1);
return;
}
timeSearch = " and DataTime BETWEEN '" + StartDateTime + "' and '" + EndDateTime + "' ";
}
else
{
timeSearch = "";
}
//设置当前页为1
PageIndex = 1;
TotalLogRecordList.Clear();
LogRecordList.Clear();
string sqlName = "";
string deviceName = "";
if (station_id==1|| station_id==2|| station_id==3)
{
sqlName = "underjuncbox_log_record";
deviceName = "海底地震监测站";
}
else if(station_id==4)
{
sqlName = "intejunctionbox_log_record";
deviceName = "一体式地震监测站点";
}
else
{
sqlName = "seisverfyplatform_log_record";
deviceName = "地震校验平台";
}
string sql = String.Format("select * from {0} where StationID = {1} {2} ORDER by id desc limit 100", sqlName, station_id, timeSearch);
MySqlDataReader dataReader = DBHelper.ExecuteReader(sql, 1);
int index = 1;
while (dataReader.Read())
{
LogRecordModel logRecord = new LogRecordModel();
logRecord.Index = index++;
logRecord.RecordTime = Convert.ToDateTime(dataReader["RecordTime"]);
logRecord.Device_Name = dataReader["Device_Name"].ToString();
logRecord.Operation_Type = dataReader["Operation_Type"].ToString();
logRecord.Record = dataReader["Record"].ToString();
TotalLogRecordList.Add(logRecord);
}
dataReader.Dispose();
RecordCount = index - 1;
if (RecordCount <= 10)
{
TotalPage = 1;
LogRecordList = TotalLogRecordList;
}
else
{
TotalPage = (int)Math.Ceiling((double)RecordCount / 10);
for (int i = 0; i < 10; i++)
{
LogRecordList.Add(TotalLogRecordList[i]);
}
}
LogMsg = string.Format("共计{0}页,当前第{1}页", TotalPage, PageIndex);
string record = "查询日志记录历史记录,查询时间范围为:" + StartDateTime + "至" + EndDateTime + ",共查询到" + RecordCount + "条历史记录";
sql = $"insert into {sqlName}(StationID,RecordTime,Device_Name,Operation_Type,Record) values('{station_id}','{DateTime.Now}','{deviceName},'日志查询','{record}');";
DBHelper.ExecuteNonQuery(sql, 1);
}
}
#endregion
#region CommandBase Define
public CommandBase ForwordLogCommand { get; set; } //读取日志信息
public CommandBase NextLogCommand { get; set; } //读取日志信息
public CommandBase RefreshDataCommand { get; set; }
public CommandBase DownloadDataCommand { get; set; }
#endregion
int station_id = 1;
string timeSearch = "";
public DispatcherTimer timerDownloadDataMsgHidden = new DispatcherTimer();
public LogRecordViewModel(int id)
{
// 默认查询1天内的日志
this.EndDateTime = DateTime.Now;
this.StartDateTime = DateTime.Now.AddDays(-1);
PageIndex = 1;
station_id = id;
vm = new DialogViewModel
{
Content = ""
};
#region Command Set
this.ForwordLogCommand = new CommandBase();
this.ForwordLogCommand.DoExcute = new Action<object>(ForwordLog);
this.ForwordLogCommand.DoCanExcute = new Func<object, bool>((o) => true);
this.NextLogCommand = new CommandBase();
this.NextLogCommand.DoExcute = new Action<object>(NextLog);
this.NextLogCommand.DoCanExcute = new Func<object, bool>((o) => true);
this.RefreshDataCommand = new CommandBase();
this.RefreshDataCommand.DoExcute = new Action<object>(RefreshData);
this.RefreshDataCommand.DoCanExcute = new Func<object, bool>((o) => true);
this.DownloadDataCommand = new CommandBase();
this.DownloadDataCommand.DoExcute = new Action<object>(DownloadData);
this.DownloadDataCommand.DoCanExcute = new Func<object, bool>((o) => true);
#endregion
timerDownloadDataMsgHidden.Interval = TimeSpan.FromSeconds(2);
timerDownloadDataMsgHidden.Tick += TimerDownloadDataMsgHidden_Tick;
}
#region RefreshData
public void RefreshData(object o)
{
if (IsChecked)
{
timeSearch = " and DataTime BETWEEN '" + StartDateTime + "' and '" + EndDateTime + "' ";
}
else
{
timeSearch = "";
}
//设置当前页为1
PageIndex = 1;
TotalLogRecordList.Clear();
LogRecordList.Clear();
string sqlName = "";
string deviceName = "";
if (station_id == 1 || station_id == 2 || station_id == 3)
{
sqlName = "underjuncbox_log_record";
deviceName = "海底地震监测站";
}
else if (station_id == 4)
{
sqlName = "intejunctionbox_log_record";
deviceName = "一体式地震监测站点";
}
else
{
sqlName = "seisverfyplatform_log_record";
deviceName = "地震校验平台";
}
string sql = String.Format("select * from {0} where StationID = {1} {2} ORDER by id desc limit 100", sqlName, station_id, timeSearch);
MySqlDataReader dataReader = DBHelper.ExecuteReader(sql, 1);
int index = 1;
while (dataReader.Read())
{
LogRecordModel logRecord = new LogRecordModel();
logRecord.Index = index++;
logRecord.RecordTime = Convert.ToDateTime(dataReader["RecordTime"]);
logRecord.Device_Name = dataReader["Device_Name"].ToString();
logRecord.Operation_Type = dataReader["Operation_Type"].ToString();
logRecord.Record = dataReader["Record"].ToString();
TotalLogRecordList.Add(logRecord);
}
dataReader.Dispose();
RecordCount = index - 1;
if (RecordCount <= 10)
{
TotalPage = 1;
LogRecordList = TotalLogRecordList;
}
else
{
TotalPage = (int)Math.Ceiling((double)RecordCount / 10);
for (int i = 0; i < 10; i++)
{
LogRecordList.Add(TotalLogRecordList[i]);
}
}
LogMsg = string.Format("共计{0}页,当前第{1}页", TotalPage, PageIndex);
string record = "查询日志记录历史记录,查询时间范围为:" + StartDateTime + "至" + EndDateTime + ",共查询到" + RecordCount + "条历史记录";
sql = $"insert into {sqlName}(StationID,RecordTime,Device_Name,Operation_Type,Record) values('{station_id}','{DateTime.Now}','{deviceName},'日志查询','{record}');";
DBHelper.ExecuteNonQuery(sql, 1);
}
#endregion
#region DownloadData
private void TimerDownloadDataMsgHidden_Tick(object sender, EventArgs e)
{
DownloadDataMsgVisibility = Visibility.Hidden;
// 停止定时器
(sender as DispatcherTimer).Stop();
}
private string downloadDataMsg;
public string DownloadDataMsg
{
get { return downloadDataMsg; }
set { downloadDataMsg = value; this.DoNotify(); }
}
private Brush downloadDataMsgForeground;
public Brush DownloadDataMsgForeground
{
get { return downloadDataMsgForeground; }
set { downloadDataMsgForeground = value; this.DoNotify(); }
}
private bool downloadDataBtnIsEnabled = true;
public bool DownloadDataBtnIsEnabled
{
get { return downloadDataBtnIsEnabled; }
set { downloadDataBtnIsEnabled = value; this.DoNotify(); }
}
private Visibility downloadDataMsgVisibility = Visibility.Visible;
public Visibility DownloadDataMsgVisibility
{
get { return downloadDataMsgVisibility; }
set { downloadDataMsgVisibility = value; this.DoNotify(); }
}
public void DownloadData(object o)
{
DownloadDataBtnIsEnabled = false;
string baseStationFolder = Tools.GetAppSetting("LogRecordFolder");
string savePath = "";
string deviceName = "";
string sqlName = "";
if (station_id == 1 || station_id == 2 || station_id == 3)
{
savePath = CSVDownload.CreateFile(baseStationFolder, "UnderJuncboxLogRecord_" + DateTime.Now.ToString("yyyyMMddhhMMss"), "csv");
deviceName = "海底地震监测站";
sqlName = "underjuncbox_log_record";
}
else if (station_id == 4)
{
savePath = CSVDownload.CreateFile(baseStationFolder, "InteJunctionboxLogRecord_" + DateTime.Now.ToString("yyyyMMddhhMMss"), "csv");
deviceName = "一体式地震监测站点";
sqlName = "intejunctionbox_log_record";
}
else
{
savePath = CSVDownload.CreateFile(baseStationFolder, "SeisVerfyPlatformLogRecord_" + DateTime.Now.ToString("yyyyMMddhhMMss"), "csv");
deviceName = "地震校验平台";
sqlName = "seisverfyplatform_log_record";
}
bool result = CSVDownload.SaveLogRecordDataToCSVFile(TotalLogRecordList, savePath);
if (result)
{
DownloadDataMsg = "下载数据成功!";
DownloadDataMsgVisibility = Visibility.Visible;
DownloadDataMsgForeground = new SolidColorBrush(Colors.Green);
}
else
{
DownloadDataMsg = "下载数据失败!";
DownloadDataMsgVisibility = Visibility.Visible;
DownloadDataMsgForeground = new SolidColorBrush(Colors.Red);
}
timerDownloadDataMsgHidden.Start();
DownloadDataBtnIsEnabled = true;
string record = "下载日志记录," + DownloadDataMsg;
string sql = $"insert into {sqlName}(StationID,RecordTime,Device_Name,Operation_Type,Record) values('{station_id}','{DateTime.Now}','{deviceName}','数据下载','{record}');";
DBHelper.ExecuteNonQuery(sql, 1);
}
#endregion
#region Page Switching
public void ForwordLog(object o)
{
if (PageIndex == 1)
return;
try
{
PageIndex -= 1;
LogRecordList.Clear();
for (int i = 0; i < 10; i++)
{
LogRecordList.Add(TotalLogRecordList[i + (PageIndex - 1) * 10]);
}
LogMsg = string.Format("共计{0}页,当前第{1}页", TotalPage, PageIndex);
}
catch
{
LogRecordList.Clear();
TotalLogRecordList.Clear();
}
}
public void NextLog(object o)
{
if (PageIndex == TotalPage)
return;
try
{
PageIndex += 1;
LogRecordList.Clear();
for (int i = 0; i < (PageIndex == TotalPage ? (RecordCount - (PageIndex - 1) * 10) : 10); i++)
{
LogRecordList.Add(TotalLogRecordList[i + (PageIndex - 1) * 10]);
}
LogMsg = string.Format("共计{0}页,当前第{1}页", TotalPage, PageIndex);
}
catch
{
LogRecordList.Clear();
TotalLogRecordList.Clear();
}
}
#endregion
}
}

View File

@ -0,0 +1,238 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows;
using FujianEarthquake.Common;
namespace FujianEarthquake.ViewModels
{
public class MainViewModel : NotifyBase
{
#region ViewModel Define
public static RealTimeDataViewModel realTimeDataViewModel1 = new RealTimeDataViewModel(1);
public static RealTimeDataViewModel realTimeDataViewModel2 = new RealTimeDataViewModel(2);
public static RealTimeDataViewModel realTimeDataViewModel3 = new RealTimeDataViewModel(3);
public static RealTimeDataViewModel realTimeDataViewModel4 = new RealTimeDataViewModel(4);
public static RealTimeDataViewModel realTimeDataViewModel5 = new RealTimeDataViewModel(5);
public static AlarmRecordViewModel alarmRecordViewModel1 = new AlarmRecordViewModel(1);
public static AlarmRecordViewModel alarmRecordViewModel2 = new AlarmRecordViewModel(2);
public static AlarmRecordViewModel alarmRecordViewModel3 = new AlarmRecordViewModel(3);
public static AlarmRecordViewModel alarmRecordViewModel4 = new AlarmRecordViewModel(4);
public static AlarmRecordViewModel alarmRecordViewModel5 = new AlarmRecordViewModel(5);
public static LogRecordViewModel logRecordViewModel1 = new LogRecordViewModel(1);
public static LogRecordViewModel logRecordViewModel2 = new LogRecordViewModel(2);
public static LogRecordViewModel logRecordViewModel3 = new LogRecordViewModel(3);
public static LogRecordViewModel logRecordViewModel4 = new LogRecordViewModel(4);
public static LogRecordViewModel logRecordViewModel5 = new LogRecordViewModel(5);
#endregion
#region Something Define
public int station_id { get; set; } = 1;
string Title_Name = ""; //设置当前显示的标题
private FrameworkElement _pageContent;
public FrameworkElement PageContent
{
get { return _pageContent; }
set { _pageContent = value; this.DoNotify(); }
}
#endregion
#region CommandBase Define
public CommandBase NavChangedCommand { get; set; }
public CommandBase Switch { set; get; }
#endregion
public MainViewModel()
{
#region Command Define
this.NavChangedCommand = new CommandBase();
this.NavChangedCommand.DoExcute = new Action<object>(DoNavChanged);
this.NavChangedCommand.DoCanExcute = new Func<object, bool>((o) => true);
//this.Switch = new CommandBase();
//this.Switch.DoExcute = new Action<object>(Btn_Switch);
//this.Switch.DoCanExcute = new Func<object, bool>((o) => true);
#endregion
//默认打开第一个界面
DoNavChanged("RealTimeDataView");
}
#region Page Switching
public void DoNavChanged(object obj)
{
if (obj.ToString() == "1" || obj.ToString() == "2" || obj.ToString() == "3" || obj.ToString() == "4" || obj.ToString() == "5") //说明是站点切换按钮
{
if (station_id == Convert.ToInt32(obj)) //如果切换的界面和之前一样 那就不切换
return;
station_id = Convert.ToInt32(obj);
}
else if (obj.ToString() == "")
{
}
else
{
if (Title_Name == obj.ToString())
return;
Title_Name = obj.ToString();
}
//切换页面之前清理一下内存
Tools.ClearMemory(this);
Type type = Type.GetType("FujianEarthquake.Views." + Title_Name);
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes);
FrameworkElement page = (FrameworkElement)cti.Invoke(null);
if (station_id == 1)
{
switch (Title_Name)
{
case "RealTimeDataView":
page.DataContext = realTimeDataViewModel1;
break;
//case "SystemEnvironDataView":
// systemEnvironDataViewModel1.RefreshFile(obj);
// page.DataContext = systemEnvironDataViewModel1;
// break;
//case "SystemMonitorDataView":
// page.DataContext = systemMonitorDataViewModel1;
// break;
//case "BoosterStationStateDataView":
// page.DataContext = boosterStationStateDataViewModel1;
// break;
//case "SeismometerStateDataView":
// MainViewModel.seismometerStateDataViewModel1.MainSeisIsChecked = true;
// page.DataContext = seismometerStateDataViewModel1;
// break;
//case "SeismometerParameterView":
// MainViewModel.seismometerParameterViewModel1.BackupSeisIsChecked = false;
// page.DataContext = seismometerParameterViewModel1;
// break;
//case "SystemControlView":
// MainSeisIsChecked = true;
// baseStationStateModel1.JunBox_Elect = (ImageSource)Application.Current.FindResource("NoDevice");
// ElectPowerOpenBtnIsEnabled = false;
// ElectPowerCloseBtnIsEnabled = false;
// BSSM = baseStationStateModel1;
// break;
case "LogRecordView":
page.DataContext = logRecordViewModel1;
break;
case "AlarmRecordView":
page.DataContext = alarmRecordViewModel1;
break;
default:
break;
}
}
else if (station_id == 2)
{
switch (Title_Name)
{
case "RealTimeDataView":
page.DataContext = realTimeDataViewModel2;
break;
//case "SystemEnvironDataView":
// page.DataContext = systemEnvironDataViewModel2;
// break;
//case "SystemMonitorDataView":
// page.DataContext = systemMonitorDataViewModel2;
// break;
//case "BoosterStationStateDataView":
// page.DataContext = boosterStationStateDataViewModel2;
// break;
//case "SeismometerStateDataView":
// MainViewModel.seismometerStateDataViewModel2.MainSeisIsChecked = true;
// page.DataContext = seismometerStateDataViewModel2;
// break;
//case "SeismometerParameterView":
// MainViewModel.seismometerParameterViewModel1.BackupSeisIsChecked = false;
// page.DataContext = seismometerParameterViewModel2;
// break;
//case "SystemControlView":
// MainSeisIsChecked = true;
// ElectPowerOpenBtnIsEnabled = true;
// ElectPowerCloseBtnIsEnabled = true;
// BSSM = baseStationStateModel2;
// break;
case "LogRecordView":
page.DataContext = logRecordViewModel2;
break;
case "AlarmRecordView":
page.DataContext = alarmRecordViewModel2;
break;
default:
break;
}
}
else if (station_id == 3)
{
switch (Title_Name)
{
case "RealTimeDataView":
page.DataContext = realTimeDataViewModel3;
break;
case "LogRecordView":
page.DataContext = logRecordViewModel3;
break;
case "AlarmRecordView":
page.DataContext = alarmRecordViewModel3;
break;
default:
break;
}
}
else if (station_id == 4)
{
switch (Title_Name)
{
case "RealTimeDataView":
page.DataContext = realTimeDataViewModel4;
break;
case "LogRecordView":
page.DataContext = logRecordViewModel4;
break;
case "AlarmRecordView":
page.DataContext = alarmRecordViewModel4;
break;
default:
break;
}
}
else if (station_id == 5)
{
switch (Title_Name)
{
case "RealTimeDataView":
page.DataContext = realTimeDataViewModel5;
break;
case "LogRecordView":
page.DataContext = logRecordViewModel5;
break;
case "AlarmRecordView":
page.DataContext = alarmRecordViewModel5;
break;
default:
break;
}
}
this.PageContent = page;
}
#endregion
}
}

View File

@ -0,0 +1,378 @@
using FujianEarthquake.Common;
using FujianEarthquake.Models;
using FujianEarthquake.DataAccess;
using FujianEarthquake.Models.HelpModels;
using FujianEarthquake.Views;
using HandyControl.Tools;
using LiveCharts;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace FujianEarthquake.ViewModels
{
public class RealTimeDataViewModel : NotifyBase
{
public JunctionBoxEnvironModel junctionBoxEnvironModel { get; set; }=new JunctionBoxEnvironModel();
public ShoreBaseStationStateDataModel shoreBaseStationStateModel { get;set; }=new ShoreBaseStationStateDataModel();
public BaseStationModelView baseStationModelView { get; set; } = new BaseStationModelView();
private BaseStationGestureModel baseStationGesture = new BaseStationGestureModel();
public BaseStationGestureModel BaseStationGesture
{
get { return baseStationGesture; }
set
{
baseStationGesture = value;
this.DoNotify();
//DoFresh();
}
}
#region SeriesCollection
public SeriesCollection seriesCollectionConboxTem;
public SeriesCollection SeriesCollectionConboxTem
{
get { return seriesCollectionConboxTem; }
set
{
seriesCollectionConboxTem = value;
this.DoNotify();
}
}
public SeriesCollection seriesCollectionConboxHum;
public SeriesCollection SeriesCollectionConboxHum
{
get { return seriesCollectionConboxHum; }
set
{
seriesCollectionConboxHum = value;
this.DoNotify();
}
}
//public SeriesCollection seriesCollectionMainSeis;
//public SeriesCollection SeriesCollectionMainSeis
//{
// get { return seriesCollectionMainSeis; }
// set
// {
// seriesCollectionMainSeis = value;
// this.DoNotify();
// }
//}
//public SeriesCollection seriesCollectionBackupSeis;
//public SeriesCollection SeriesCollectionBackupSeis
//{
// get { return seriesCollectionBackupSeis; }
// set
// {
// seriesCollectionBackupSeis = value;
// this.DoNotify();
// }
//}
public SeriesCollection seriesCollectionShoreBaseStationVol;
public SeriesCollection SeriesCollectionShoreBaseStationVol
{
get { return seriesCollectionShoreBaseStationVol; }
set
{
seriesCollectionShoreBaseStationVol = value;
this.DoNotify();
}
}
public SeriesCollection seriesCollectionShoreBaseStationCur;
public SeriesCollection SeriesCollectionShoreBaseStationCur
{
get { return seriesCollectionShoreBaseStationCur; }
set
{
seriesCollectionShoreBaseStationCur = value;
this.DoNotify();
}
}
#endregion
#region Formatter
private Func<double, string> _xFormatter;
public Func<double, string> XFormatter
{
get { return _xFormatter; }
set
{
_xFormatter = value;
this.DoNotify();
}
}
private Func<double, string> _yFormatterVol;
public Func<double, string> YFormatterVol
{
get { return _yFormatterVol; }
set
{
_yFormatterVol = value;
this.DoNotify();
}
}
private Func<double, string> _yFormatterCur;
public Func<double, string> YFormatterCur
{
get { return _yFormatterCur; }
set
{
_yFormatterCur = value;
this.DoNotify();
}
}
private Func<double, string> _yFormatterTem;
public Func<double, string> YFormatterTem
{
get { return _yFormatterTem; }
set
{
_yFormatterTem = value;
this.DoNotify();
}
}
private Func<double, string> _yFormatterHum;
public Func<double, string> YFormatterHum
{
get { return _yFormatterHum; }
set
{
_yFormatterHum = value;
this.DoNotify();
}
}
#endregion
#region RecordTime
public DateTime dataTimeConboxTem;
public DateTime DataTimeConboxTem
{
get { return dataTimeConboxTem; }
set
{
dataTimeConboxTem = value;
this.DoNotify();
}
}
public DateTime dataTimeConboxHum;
public DateTime DataTimeConboxHum
{
get { return dataTimeConboxHum; }
set
{
dataTimeConboxHum = value;
this.DoNotify();
}
}
//public DateTime dataTimeMainSeis;
//public DateTime DataTimeMainSeis
//{
// get { return dataTimeMainSeis; }
// set
// {
// dataTimeMainSeis = value;
// this.DoNotify();
// }
//}
//public DateTime dataTimeBackupSeis;
//public DateTime DataTimeBackupSeis
//{
// get { return dataTimeBackupSeis; }
// set
// {
// dataTimeBackupSeis = value;
// this.DoNotify();
// }
//}
public DateTime dataTimeShoreBaseStationVol;
public DateTime DataTimeShoreBaseStationVol
{
get { return dataTimeShoreBaseStationVol; }
set
{
dataTimeShoreBaseStationVol = value;
this.DoNotify();
}
}
public DateTime dataTimeShoreBaseStationCur;
public DateTime DataTimeShoreBaseStationCur
{
get { return dataTimeShoreBaseStationCur; }
set
{
dataTimeShoreBaseStationCur = value;
this.DoNotify();
}
}
#endregion
#region AngleBackground
public Brush angleBackgroundX;
public Brush AngleBackgroundX
{
get { return angleBackgroundX; }
set
{
angleBackgroundX = value;
this.DoNotify();
}
}
public Brush angleBackgroundY;
public Brush AngleBackgroundY
{
get { return angleBackgroundY; }
set
{
angleBackgroundY = value;
this.DoNotify();
}
}
public Brush angleBackgroundZ;
public Brush AngleBackgroundZ
{
get { return angleBackgroundZ; }
set
{
angleBackgroundZ = value;
this.DoNotify();
}
}
#endregion
private ImageSource leakageImage;
public ImageSource LeakageImage
{
get { return leakageImage; }
set { leakageImage = value; }
}
/// <summary>
/// 环境状态列表数据
/// </summary>
private List<KeypaiValueModel> _baseStationStatus = new List<KeypaiValueModel>
{
new KeypaiValueModel { Header = "主地震仪电压(V) / 电流(A)" },
new KeypaiValueModel { Header = "海底基站温度(℃)" },
new KeypaiValueModel { Header = "岸基站输出电压(V)" },
new KeypaiValueModel { Header = "备地震仪电压(V) / 电流(A)" },
new KeypaiValueModel { Header = "海底基站湿度(%)" },
new KeypaiValueModel { Header = "岸基站输出电流(A)" },
//new KeypaiValueModel { Header = "基站姿态X轴(°)" },
//new KeypaiValueModel { Header = "基站姿态Y轴(°)" },
//new KeypaiValueModel { Header = "基站姿态Z轴(°)" },
//new KeypaiValueModel { Header = "基站漏水状态" },
};
public List<KeypaiValueModel> BaseStationStatus
{
get { return _baseStationStatus; }
set { _baseStationStatus = value; this.DoNotify(); }
}
/// <summary>
/// 告警信息
/// </summary>
private List<AlarmRecordModel> alarmList = new List<AlarmRecordModel>();
public List<AlarmRecordModel> AlarmList
{
get { return alarmList; }
set { alarmList = value; this.DoNotify(); }
}
public CommandBase ResetAngleCommand { get; set; }
int station_id = 1;
public RealTimeDataView realTimeDataView = new RealTimeDataView();
public BaseStationModelViewModel baseStationModelViewModel { get; set; } = new BaseStationModelViewModel();
public RealTimeDataViewModel(int id)
{
//DoFresh();
station_id = id;
this.ResetAngleCommand = new CommandBase();
this.ResetAngleCommand.DoExcute = new Action<object>(ResetAngle);
this.ResetAngleCommand.DoCanExcute = new Func<object, bool>((o) => true);
}
public void ResetAngle(object o)
{
string sql = String.Format("select * from juncbox_env where StationID = {0} ORDER by id desc limit 1", station_id);
MySqlDataReader dataReader = DBHelper.ExecuteReader(sql, 1);
while (dataReader.Read())
{
BaseStationGesture.RollAngle = Convert.ToSingle(string.IsNullOrEmpty(dataReader["AttitudeX"].ToString()) ? "0.00" : dataReader["AttitudeX"].ToString());
BaseStationGesture.PitchAngle = Convert.ToSingle(string.IsNullOrEmpty(dataReader["AttitudeY"].ToString()) ? "0.00" : dataReader["AttitudeY"].ToString());
BaseStationGesture.HeadingAngle = Convert.ToSingle(string.IsNullOrEmpty(dataReader["AttitudeZ"].ToString()) ? "0.00" : dataReader["AttitudeZ"].ToString());
}
dataReader.Dispose();
baseStationModelViewModel.BaseStationGesture.RollAngle = BaseStationGesture.RollAngle;
baseStationModelViewModel.BaseStationGesture.PitchAngle = BaseStationGesture.PitchAngle;
baseStationModelViewModel.BaseStationGesture.HeadingAngle = BaseStationGesture.HeadingAngle;
//baseStationModelView.angleX.Content = BaseStationGesture.RollAngle;
//baseStationModelView.angleY.Content = BaseStationGesture.PitchAngle;
//baseStationModelView.angleZ.Content = BaseStationGesture.HeadingAngle;
}
}
}

View File

@ -0,0 +1,14 @@
<Page x:Class="FujianEarthquake.Views.AlarmRecordView"
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:local="clr-namespace:FujianEarthquake.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="AlarmRecordView">
<Grid>
</Grid>
</Page>

View File

@ -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 FujianEarthquake.Views
{
/// <summary>
/// AlarmRecordView.xaml 的交互逻辑
/// </summary>
public partial class AlarmRecordView : Page
{
public AlarmRecordView()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,12 @@
<UserControl x:Class="FujianEarthquake.Views.BaseStationModelView"
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:local="clr-namespace:FujianEarthquake.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>

View File

@ -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 FujianEarthquake.Views
{
/// <summary>
/// BaseStationModelView.xaml 的交互逻辑
/// </summary>
public partial class BaseStationModelView : UserControl
{
public BaseStationModelView()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,12 @@
<UserControl x:Class="FujianEarthquake.Views.JunctionBoxEnvironDataView"
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:local="clr-namespace:FujianEarthquake.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>

View File

@ -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 FujianEarthquake.Views
{
/// <summary>
/// JunctionBoxEnvironDataView.xaml 的交互逻辑
/// </summary>
public partial class JunctionBoxEnvironDataView : UserControl
{
public JunctionBoxEnvironDataView()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,12 @@
<UserControl x:Class="FujianEarthquake.Views.JunctionBoxStatusDataView"
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:local="clr-namespace:FujianEarthquake.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>

View File

@ -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 FujianEarthquake.Views
{
/// <summary>
/// JunctionBoxStatusDataView.xaml 的交互逻辑
/// </summary>
public partial class JunctionBoxStatusDataView : UserControl
{
public JunctionBoxStatusDataView()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,294 @@
<UserControl x:Class="FujianEarthquake.Views.LogRecordView"
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:local="clr-namespace:FujianEarthquake.Views"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:core="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
FontFamily="{StaticResource DigitalDisplay}"
Name="LogRecordPage"
Background="Transparent"
d:DesignHeight="850" d:DesignWidth="1550">
<UserControl.Resources>
<Style TargetType="GroupBox">
<Setter Property="Margin" Value="10,5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GroupBox">
<Grid>
<!--左上角-->
<Polyline HorizontalAlignment="Left" VerticalAlignment="Top"
Points="0 30,0 10,10 0,30 0" Stroke="#9918AABD" StrokeThickness="1"/>
<!--左上角点-->
<Ellipse Width="4" Height="4" VerticalAlignment="Top" HorizontalAlignment="Left"
Fill="#9918AABD" Margin="24,-2,0,0"/>
<Ellipse Width="4" Height="4" VerticalAlignment="Top" HorizontalAlignment="Left"
Fill="#9918AABD" Margin="-2,24,0,0"/>
<!--右上角-->
<Path Data="M0 0, 3 3, 30 3, 33 0, 68 0, 73 7,78 7, 78 10M8 0, 25 0"
Stroke="#5518AABD" VerticalAlignment="Top" HorizontalAlignment="Right"/>
<!--左下角-->
<Polyline Points="0,0 0,15 10,15" Stroke="#5518AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Left"/>
<!--右下角-->
<Polyline Points="10,0 0,10" Stroke="#5518AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Right"/>
<!--右下角图表-->
<Polyline Points="0,7 7 7 7 0" Fill="#9918AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Right"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,1,0,0" VerticalAlignment="Top"
Margin="30,-0.5,78,0"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,0,1,0" HorizontalAlignment="Right"
Margin="0,10"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,1,0,0" VerticalAlignment="Bottom"
Margin="10,0"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,0,1,0" HorizontalAlignment="Left"
Margin="-0.5,15"/>
<!--箭头-->
<Path Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#9918AABD" VerticalAlignment="Top"
HorizontalAlignment="Left" Margin="10,13"/>
<Path Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#5518AABD" VerticalAlignment="Top"
HorizontalAlignment="Left" Margin="16,13"/>
<!--字体-->
<TextBlock Text="{TemplateBinding Header}" Foreground="#18AABD"
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="25,12"/>
<!-- 占位对象 -->
<ContentPresenter />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
<Grid>
<Border x:Name="columnHeaderBorder" BorderThickness="0,0,0,1"
BorderBrush="#EEE"
Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
TextBlock.TextAlignment="Center"
TextBlock.FontSize="18"
TextBlock.Foreground="White"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ToolTip">
<Setter Property="Foreground" Value="White"/>
<!-- 设置ToolTip字体颜色为白色 -->
<Setter Property="FontSize" Value="13"/>
<!-- 设置ToolTip字体大小为14 -->
<!--<Setter Property="FontWeight" Value="Bold"/>-->
<!-- 设置ToolTip字体为粗体 -->
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
<!-- 设置ToolTip背景颜色为浅灰色 -->
<Setter Property="FontFamily" Value="{StaticResource DigitalDisplay}"/>
<!-- 设置ToolTip字体为方正楷体简体 -->
<Setter Property="TextOptions.TextFormattingMode" Value="Ideal"/>
<!-- 设置ToolTip中文本的格式化模式 -->
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/>
<!-- 设置ToolTip中文本的渲染模式 -->
<Setter Property="ToolTipService.ShowDuration" Value="10000"/>
<!--设置ToolTip中数据的显示时间-->
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.15*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<GroupBox Header="日志记录查询条件">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.2*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2.5*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left"
Orientation="Horizontal" Margin="40,0,0,0">
<CheckBox Content="时间筛选:" Foreground="White" FontSize="18" Name="TimeCheckBox"
VerticalAlignment="Center" IsChecked="{Binding IsChecked}"/>
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True"
hc:InfoElement.TitleWidth="80" hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource DateTimePickerPlus}" hc:InfoElement.Title="起始时间:"
Foreground="White" CaretBrush="White"
FontSize="14" Width="260" Margin="10,0,0,0" Background="Transparent"
BorderBrush="White" SelectedDateTime="{Binding StartDateTime}"/>
<TextBlock Text="-" Foreground="White" HorizontalAlignment="Center"
VerticalAlignment="Center" Margin="10,0,0,0"/>
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True"
hc:InfoElement.TitleWidth="80" hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource DateTimePickerPlus}" hc:InfoElement.Title="结束时间:"
Foreground="White" CaretBrush="White"
FontSize="14" Width="260" Margin="10,0,0,0" Background="Transparent"
BorderBrush="White" SelectedDateTime="{Binding EndDateTime}"/>
</StackPanel>
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right"
Orientation="Horizontal" Margin="0,0,40,0">
</StackPanel>
</Grid>
</Grid>
</GroupBox>
</Grid>
<Grid Grid.Row="1">
<GroupBox Header="日志记录展示">
<hc:TransitioningContentControl>
<Grid Margin="10,35,10,10">
<Grid.RowDefinitions>
<RowDefinition Height="12*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<DataGrid x:Name="LogRecordDataGrid" ItemsSource="{Binding LogRecordList}"
AutoGenerateColumns="False"
CanUserAddRows="False" CanUserDeleteRows="False" Background="Transparent"
CanUserReorderColumns="False" CanUserResizeColumns="False"
CanUserResizeRows="False" CanUserSortColumns="False" BorderThickness="0" Grid.RowSpan="2">
<DataGrid.Resources>
<Style TargetType="DataGridCell" x:Key="DataGridCellCenter">
<Setter Property="Background" Value="#FF14273A"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#A0A0A0"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<Border x:Name="border" BorderBrush="#A0A0A0" BorderThickness="0,0,0,1"
Background="{TemplateBinding Background}" >
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Index}" Width="150" Header="编号"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTextColumn Binding="{Binding RecordTime, StringFormat='yyyy/MM/dd HH:mm:ss'}" Width="200" Header="记录时间"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTextColumn Binding="{Binding Device_Name}" Width="300" Header="设备名称"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTextColumn Binding="{Binding Operation_Type}" Width="200" Header="操作类型"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTemplateColumn Header="记录内容" Width="*" CellStyle="{StaticResource DataGridCellCenter}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Record}" HorizontalAlignment="Left" ToolTipService.ToolTip="{Binding Record}">
<TextBlock.Resources>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="14"/>
</Style>
</TextBlock.Resources>
</TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center"
HorizontalAlignment="Right" Margin="0,0,10,0">
<TextBlock VerticalAlignment="Center" FontSize="17" Foreground="White"
Margin="0,0,20,0" Text="{Binding LogMsg}"/>
<Button Content="上一页" FontSize="16" Command="{Binding ForwordLogCommand}"
Background="Transparent" BorderBrush="White" Style="{StaticResource ButtonStyle}"
Foreground="White" Width="85" Height="35">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
</Button>
<Button Content="下一页" FontSize="16" Margin="20,0,20,0"
Command="{Binding NextLogCommand}"
Background="Transparent" BorderBrush="White" Style="{StaticResource ButtonStyle}"
Foreground="White" Width="85" Height="35">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1" Margin="20,0,0,0"
HorizontalAlignment="Left" VerticalAlignment="Center">
<StackPanel Orientation="Vertical">
<TextBlock Name="RefreshDataMsg" Text=""
Foreground="Green" FontSize="12" HorizontalAlignment="Left"
VerticalAlignment="Bottom" Margin="15,0,0,0"
Visibility="Visible"/>
<Button Name="RefreshDataBtn" HorizontalAlignment="Left" VerticalAlignment="Center" Height="34"
BorderThickness="0" Command="{Binding RefreshDataCommand}" Width="34"
Style="{StaticResource ButtonStyle}" Background="Transparent">
<Button.Content>
<Image Source="/Assets/Images/Refresh.png" Height="27"
HorizontalAlignment="Left" VerticalAlignment="Center" />
</Button.Content>
<Button.ToolTip>
<ToolTip Content="刷新数据"/>
</Button.ToolTip>
</Button>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="20,0,0,0">
<TextBlock Name="DownloadDataMsg" Text="{Binding DownloadDataMsg}"
Foreground="{Binding DownloadDataMsgForeground}" FontSize="12" HorizontalAlignment="Left"
VerticalAlignment="Bottom" Margin="15,0,0,0"
Visibility="{Binding DownloadDataMsgVisibility}"/>
<Button Name="DownloadDataBtn" HorizontalAlignment="Left" VerticalAlignment="Center" Height="34"
BorderThickness="0" Command="{Binding DownloadDataCommand}" Width="34"
Style="{StaticResource ButtonStyle}" Background="Transparent"
IsEnabled="{Binding DownloadDataBtnIsEnabled}">
<Button.Content>
<Image Source="/Assets/Images/Download.png" Height="28"
HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Button.Content>
<Button.ToolTip>
<ToolTip Content="下载数据"/>
</Button.ToolTip>
</Button>
</StackPanel>
</StackPanel>
</Grid>
</hc:TransitioningContentControl>
</GroupBox>
</Grid>
</Grid>
</UserControl>

View File

@ -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 FujianEarthquake.Views
{
/// <summary>
/// LogRecordView.xaml 的交互逻辑
/// </summary>
public partial class LogRecordView : UserControl
{
public LogRecordView()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,234 @@
<UserControl x:Class="FujianEarthquake.Views.RealTimeDataView"
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:local="clr-namespace:FujianEarthquake.Views"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:viewmodels="clr-namespace:FujianEarthquake.ViewModels"
xmlns:converters="clr-namespace:FujianEarthquake.Common"
d:DataContext="{d:DesignInstance Type=viewmodels:RealTimeDataViewModel}"
mc:Ignorable="d"
FontFamily="{StaticResource DigitalDisplay}"
d:DesignHeight="850" d:DesignWidth="1550" Name="RealTimeData">
<UserControl.Resources>
<ResourceDictionary>
<Style TargetType="GroupBox">
<Setter Property="Margin" Value="10,5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GroupBox">
<Grid>
<!--左上角-->
<Polyline Points="0 30,0 10,10 0,30 0" Stroke="#9918AABD" StrokeThickness="1"
VerticalAlignment="Top" HorizontalAlignment="Left"/>
<!--左上角点-->
<Ellipse Width="4" Height="4" VerticalAlignment="Top" HorizontalAlignment="Left"
Fill="#9918AABD" Margin="24,-2,0,0"/>
<Ellipse Width="4" Height="4" VerticalAlignment="Top" HorizontalAlignment="Left"
Fill="#9918AABD" Margin="-2,24,0,0"/>
<!--右上角-->
<Path Data="M0 0, 3 3, 30 3, 33 0, 68 0, 73 7,78 7, 78 10M8 0, 25 0"
Stroke="#5518AABD" VerticalAlignment="Top" HorizontalAlignment="Right"/>
<!--左下角-->
<Polyline Points="0,0 0,15 10,15" Stroke="#5518AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Left"/>
<!--右下角-->
<Polyline Points="10,0 0,10" Stroke="#5518AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Right"/>
<!--右下角图表-->
<Polyline Points="0,7 7 7 7 0" Fill="#9918AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Right"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,1,0,0" VerticalAlignment="Top"
Margin="30,-0.5,78,0"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,0,1,0" HorizontalAlignment="Right"
Margin="0,10"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,1,0,0" VerticalAlignment="Bottom"
Margin="10,0"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,0,1,0" HorizontalAlignment="Left"
Margin="-0.5,15"/>
<!--箭头-->
<Path Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#9918AABD" VerticalAlignment="Top"
HorizontalAlignment="Left" Margin="10,13"/>
<Path Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#5518AABD" VerticalAlignment="Top"
HorizontalAlignment="Left" Margin="16,13"/>
<!--字体-->
<TextBlock Text="{TemplateBinding Header}" Foreground="#18AABD"
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="25,12"/>
<!--占位对象-->
<ContentPresenter/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ToolTip">
<Setter Property="Foreground" Value="White"/>
<!-- 设置ToolTip字体颜色为白色 -->
<Setter Property="FontSize" Value="13"/>
<!-- 设置ToolTip字体大小为14 -->
<!--<Setter Property="FontWeight" Value="Bold"/>-->
<!-- 设置ToolTip字体为粗体 -->
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
<!-- 设置ToolTip背景颜色为浅灰色 -->
<Setter Property="FontFamily" Value="{StaticResource DigitalDisplay}"/>
<!-- 设置ToolTip字体为方正楷体简体 -->
<Setter Property="TextOptions.TextFormattingMode" Value="Ideal"/>
<!-- 设置ToolTip中文本的格式化模式 -->
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/>
<!-- 设置ToolTip中文本的渲染模式 -->
<Setter Property="ToolTipService.ShowDuration" Value="10000"/>
<!--设置ToolTip中数据的显示时间-->
</Style>
<!--<converters:VisibilityConverter x:Key="VisibilityConverter" />
<converters:AspectRatioConverter x:Key="AspectRatioConverter" />-->
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!--第一列-->
<UniformGrid Columns="1" Margin="10,0">
<GroupBox Header="接驳盒状态信息">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="2.2*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<ItemsControl Grid.Row="1" ItemsSource="{Binding JunctionBoxStatus}" VerticalAlignment="Center">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="3"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"
Margin="0,5">
<TextBlock Text="{Binding Value,StringFormat={}{0:F2}}"
HorizontalAlignment="Center" FontSize="16"
Foreground="#FF2BEDF1" Margin="0,10"/>
<TextBlock Text="{Binding Header}" Foreground="#AAFFFFFF"
FontSize="12"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<StackPanel Grid.Row="2" Orientation="Horizontal">
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Left" Orientation="Vertical"
Margin="38,5">
<Image Source="{Binding LeakageImage}" Margin="0,0,0,10" Width="18"/>
<TextBlock Text="接驳盒漏水情况" Foreground="#AAFFFFFF"
FontSize="12"/>
</StackPanel>
</StackPanel>
<!--右上角图例 采集时间-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Top"
HorizontalAlignment="Right" Margin="10">
<Border Width="6" Height="6" Background="#552BEDF1" Margin="5,0"/>
<TextBlock Text="{Binding DataTimeConboxTem,StringFormat=yyyy/MM/dd HH:mm:ss}"
FontSize="11" Foreground="#44FFFFFF"/>
</StackPanel>
</Grid>
</GroupBox>
<!--折线图-->
<GroupBox Header="接驳盒温度(℃)">
<Grid>
<lvc:CartesianChart Margin="20,25,0,10"
Series="{Binding SeriesCollectionConboxTem}"
DisableAnimations="True" Zoom="X">
<!--提示-->
<lvc:CartesianChart.DataTooltip>
<lvc:DefaultTooltip BulletSize="20" SelectionMode="SharedXValues" IsEnabled="False"/>
</lvc:CartesianChart.DataTooltip>
<!--X轴-->
<lvc:CartesianChart.AxisX>
<lvc:Axis LabelFormatter="{Binding XFormatter}">
<lvc:Axis.Separator>
<lvc:Separator StrokeThickness="0"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<!--Y轴-->
<lvc:CartesianChart.AxisY>
<lvc:Axis ShowLabels="True" LabelFormatter="{Binding YFormatterTem}">
<lvc:Axis.Separator>
<lvc:Separator Stroke="#11FFFFFF"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
<!--右上角图例 采集时间-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Top"
HorizontalAlignment="Right" Margin="10">
<Border Width="6" Height="6" Background="#552BEDF1" Margin="5,0"/>
<TextBlock Text="{Binding DataTimeConboxTem,StringFormat=yyyy/MM/dd HH:mm:ss}"
FontSize="11" Foreground="#44FFFFFF"/>
</StackPanel>
</Grid>
</GroupBox>
<!--海底基站湿度折线图-->
<GroupBox Header="接驳盒湿度(%" Grid.Row="1">
<Grid>
<lvc:CartesianChart Margin="20,25,0,10"
Series="{Binding SeriesCollectionConboxHum}"
DisableAnimations="True" Zoom="X">
<!--提示-->
<lvc:CartesianChart.DataTooltip>
<lvc:DefaultTooltip BulletSize="20" SelectionMode="SharedXValues" IsEnabled="False"/>
</lvc:CartesianChart.DataTooltip>
<!--X轴-->
<lvc:CartesianChart.AxisX>
<lvc:Axis LabelFormatter="{Binding XFormatter}">
<lvc:Axis.Separator>
<lvc:Separator StrokeThickness="0"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<!--Y轴-->
<lvc:CartesianChart.AxisY>
<lvc:Axis ShowLabels="True" LabelFormatter="{Binding YFormatterHum}">
<lvc:Axis.Separator>
<lvc:Separator Stroke="#11FFFFFF"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
<!--右上角图例 采集时间-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Top"
HorizontalAlignment="Right" Margin="10">
<Border Width="6" Height="6" Background="#552BEDF1" Margin="5,0"/>
<TextBlock Text="{Binding DataTimeConboxHum,StringFormat=yyyy/MM/dd HH:mm:ss}"
FontSize="11" Foreground="#44FFFFFF"/>
</StackPanel>
</Grid>
</GroupBox>
</UniformGrid>
</Grid>
</UserControl>

View File

@ -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 FujianEarthquake.Views
{
/// <summary>
/// RealTimeDataView.xaml 的交互逻辑
/// </summary>
public partial class RealTimeDataView : UserControl
{
public RealTimeDataView()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,14 @@
<Page x:Class="FujianEarthquake.Views.ShoreBaseStationStatusDataView"
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:local="clr-namespace:FujianEarthquake.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="ShoreBaseStationStatusDataView">
<Grid>
</Grid>
</Page>

View File

@ -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 FujianEarthquake.Views
{
/// <summary>
/// ShoreBaseStationStatusDataView.xaml 的交互逻辑
/// </summary>
public partial class ShoreBaseStationStatusDataView : Page
{
public ShoreBaseStationStatusDataView()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,14 @@
<Page x:Class="FujianEarthquake.Views.SystemControlView"
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:local="clr-namespace:FujianEarthquake.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="SystemControlView">
<Grid>
</Grid>
</Page>

View File

@ -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 FujianEarthquake.Views
{
/// <summary>
/// SystemControlView.xaml 的交互逻辑
/// </summary>
public partial class SystemControlView : Page
{
public SystemControlView()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,21 @@
<UserControl x:Class="FujianEarthquake.Views.UserControls.TextDialog"
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:local="clr-namespace:FujianEarthquake.Views.UserControls"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
Background="{DynamicResource RegionBrush}"
FontFamily="{StaticResource DigitalDisplay}"
Height="250"
Width="400">
<hc:SimplePanel>
<TextBlock Name="textBlock" Style="{StaticResource TextBlockLargeBold}"
Text="Please Wait..." TextWrapping="Wrap" Margin="0,0,0,20"
Foreground="White"/>
<Button Width="100" Height="40" Background="#2614273A" Foreground="White"
Content="OK" HorizontalAlignment="Center" VerticalAlignment="Bottom"
Margin="0,0,0,20" Command="hc:ControlCommands.Close"/>
</hc:SimplePanel>
</UserControl>

View File

@ -0,0 +1,30 @@
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 FujianEarthquake.Views.UserControls
{
/// <summary>
/// TextDialog.xaml 的交互逻辑
/// </summary>
public partial class TextDialog : UserControl
{
public TextDialog(string info = "Please Wait...")
{
InitializeComponent();
textBlock.Text = info;
}
}
}

Some files were not shown because too many files have changed in this diff Show More