diff --git a/InSituLaboratory.Assets/Fonts/SourceHanSansCN-Bold.ttf b/InSituLaboratory.Assets/Fonts/SourceHanSansCN-Bold.ttf new file mode 100644 index 0000000..2c193be Binary files /dev/null and b/InSituLaboratory.Assets/Fonts/SourceHanSansCN-Bold.ttf differ diff --git a/InSituLaboratory.Assets/Fonts/SourceHanSansCN-Regular.ttf b/InSituLaboratory.Assets/Fonts/SourceHanSansCN-Regular.ttf new file mode 100644 index 0000000..012a5e9 Binary files /dev/null and b/InSituLaboratory.Assets/Fonts/SourceHanSansCN-Regular.ttf differ diff --git a/InSituLaboratory.Assets/Images/background1.jpg b/InSituLaboratory.Assets/Images/background1.jpg new file mode 100644 index 0000000..72813a3 Binary files /dev/null and b/InSituLaboratory.Assets/Images/background1.jpg differ diff --git a/InSituLaboratory.Assets/Images/chang.png b/InSituLaboratory.Assets/Images/chang.png new file mode 100644 index 0000000..7f84a09 Binary files /dev/null and b/InSituLaboratory.Assets/Images/chang.png differ diff --git a/InSituLaboratory.Assets/Images/主腔体当前工作设备.png b/InSituLaboratory.Assets/Images/主腔体当前工作设备.png new file mode 100644 index 0000000..71486ce Binary files /dev/null and b/InSituLaboratory.Assets/Images/主腔体当前工作设备.png differ diff --git a/InSituLaboratory.Assets/Images/主腔体当前工作设备字.png b/InSituLaboratory.Assets/Images/主腔体当前工作设备字.png new file mode 100644 index 0000000..64d5a03 Binary files /dev/null and b/InSituLaboratory.Assets/Images/主腔体当前工作设备字.png differ diff --git a/InSituLaboratory.Assets/Images/主腔体当前故障设备.png b/InSituLaboratory.Assets/Images/主腔体当前故障设备.png new file mode 100644 index 0000000..8b6e1f6 Binary files /dev/null and b/InSituLaboratory.Assets/Images/主腔体当前故障设备.png differ diff --git a/InSituLaboratory.Assets/Images/主腔体当前故障设备字.png b/InSituLaboratory.Assets/Images/主腔体当前故障设备字.png new file mode 100644 index 0000000..a146a44 Binary files /dev/null and b/InSituLaboratory.Assets/Images/主腔体当前故障设备字.png differ diff --git a/InSituLaboratory.Assets/Images/主腔体状态.png b/InSituLaboratory.Assets/Images/主腔体状态.png new file mode 100644 index 0000000..7af0d34 Binary files /dev/null and b/InSituLaboratory.Assets/Images/主腔体状态.png differ diff --git a/InSituLaboratory.Assets/Images/主腔体状态字.png b/InSituLaboratory.Assets/Images/主腔体状态字.png new file mode 100644 index 0000000..18184de Binary files /dev/null and b/InSituLaboratory.Assets/Images/主腔体状态字.png differ diff --git a/InSituLaboratory.Assets/Images/化学生物实验室.png b/InSituLaboratory.Assets/Images/化学生物实验室.png new file mode 100644 index 0000000..2b5b7c5 Binary files /dev/null and b/InSituLaboratory.Assets/Images/化学生物实验室.png differ diff --git a/InSituLaboratory.Assets/Images/横线1.png b/InSituLaboratory.Assets/Images/横线1.png new file mode 100644 index 0000000..b58959d Binary files /dev/null and b/InSituLaboratory.Assets/Images/横线1.png differ diff --git a/InSituLaboratory.Assets/Images/横线2.png b/InSituLaboratory.Assets/Images/横线2.png new file mode 100644 index 0000000..88a3040 Binary files /dev/null and b/InSituLaboratory.Assets/Images/横线2.png differ diff --git a/InSituLaboratory.Assets/Images/组6.jpg b/InSituLaboratory.Assets/Images/组6.jpg new file mode 100644 index 0000000..6cd404e Binary files /dev/null and b/InSituLaboratory.Assets/Images/组6.jpg differ diff --git a/InSituLaboratory.Assets/InSituLaboratory.Assets.csproj b/InSituLaboratory.Assets/InSituLaboratory.Assets.csproj index fcf2c03..27a6da6 100644 --- a/InSituLaboratory.Assets/InSituLaboratory.Assets.csproj +++ b/InSituLaboratory.Assets/InSituLaboratory.Assets.csproj @@ -10,11 +10,15 @@ + + + + @@ -26,13 +30,29 @@ + + + + + + + + + + Always + + Always + + + Always + Always @@ -43,6 +63,9 @@ Always + + Always + @@ -70,9 +93,42 @@ Always + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + Always + + Always + + + Always + diff --git a/InSituLaboratory/App.xaml b/InSituLaboratory/App.xaml index 48b38f8..0303316 100644 --- a/InSituLaboratory/App.xaml +++ b/InSituLaboratory/App.xaml @@ -20,6 +20,8 @@ /InSituLaboratory.Assets;component/Fonts/iconfont.ttf#zx_icons /InSituLaboratory.Assets;component/Fonts/iconfont1.ttf#iconfont /InSituLaboratory.Assets;component/Fonts/#方正楷体简体 + /InSituLaboratory.Assets;component/Fonts/#SourceHanSansCN-Bold + /InSituLaboratory.Assets;component/Fonts/#SourceHanSansCN-Regular diff --git a/InSituLaboratory/App.xaml.cs b/InSituLaboratory/App.xaml.cs index e3382ba..45f9367 100644 --- a/InSituLaboratory/App.xaml.cs +++ b/InSituLaboratory/App.xaml.cs @@ -32,7 +32,8 @@ namespace InSituLaboratory { base.InitializeShell(shell); - Container.Resolve().RegisterViewWithRegion("MainRegion", "DashboardView"); + //Container.Resolve().RegisterViewWithRegion("MainRegion", "DashboardView"); + Container.Resolve().RegisterViewWithRegion("MainRegion", "DashboardNewView"); } protected override void RegisterTypes(IContainerRegistry containerRegistry) @@ -62,6 +63,7 @@ namespace InSituLaboratory containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); diff --git a/InSituLaboratory/ViewModels/Pages/DashboardNewViewModel.cs b/InSituLaboratory/ViewModels/Pages/DashboardNewViewModel.cs new file mode 100644 index 0000000..9ef9673 --- /dev/null +++ b/InSituLaboratory/ViewModels/Pages/DashboardNewViewModel.cs @@ -0,0 +1,120 @@ +using InSituLaboratory.Entities; +using InSituLaboratory.IService; +using InSituLaboratory.Models; +using Prism.Commands; +using Prism.Regions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace InSituLaboratory.ViewModels.Pages +{ + public class DashboardNewViewModel : ViewModelBase + { + public SysStatusModel SysStatusModel { get; set; } = new SysStatusModel(); + + public CurrentEquipmentModel CurrentWorkEquipment { get; set; } = new CurrentEquipmentModel();//当前工作设备 + public CurrentEquipmentModel currentFaultyEquipment { get; set; } = new CurrentEquipmentModel();//当前故障设备 + public DelegateCommand ReadCommand { get; set; } + + ISysStatusService _sysStatusService; + public DashboardNewViewModel(IRegionManager regionManager, ISysStatusService isysStatusService) : base(regionManager) + { + PageTitle = "数据中心"; + IsCanClose = false; + _sysStatusService = isysStatusService; + + ReadCommand = new DelegateCommand(DoRead); + + this.Refresh(); + } + + public override void Refresh() + { + var sysStatuslist = _sysStatusService.GetSysStauts().ToList(); + var CurrentWorklist = _sysStatusService.GetCurrentWorkEquipment().ToList(); + var currentFaultylist = _sysStatusService.GetCurrentFaultyEquipment().ToList(); + if (sysStatuslist.Count() != 0) + { + var data = _sysStatusService.GetSysStauts().FirstOrDefault(); + SysStatusModel.PackagingTime = data.PackagingTime; + SysStatusModel.SamplingTime = data.SamplingTime; + SysStatusModel.Voltage48 = data.Voltage48; + SysStatusModel.Current48 = data.Current48; + SysStatusModel.BaseStation48VLeakageCS = data.BaseStation48VLeakageCS; + SysStatusModel.Batterz48VLeakageCS = data.Batterz48VLeakageCS; + SysStatusModel.ICLLeakageCS = data.ICLLeakageCS; + SysStatusModel.IComputerLeakageCS = data.IComputerLeakageCS; + SysStatusModel.TemperatureStaus1 = data.TemperatureStaus1; + SysStatusModel.TemperatureStaus2 = data.TemperatureStaus2; + SysStatusModel.HumidityStaus1 = data.HumidityStaus1; + SysStatusModel.HumidityStaus2 = data.HumidityStaus2; + SysStatusModel.LeakageStaus1 = data.LeakageStaus1; + SysStatusModel.LeakageStaus2 = data.LeakageStaus2; + SysStatusModel.InternalPressure1 = data.InternalPressure1; + SysStatusModel.InternalPressure2 = data.InternalPressure2; + SysStatusModel.TimeSeriesGroupNumber = data.TimeSeriesGroupNumber; + SysStatusModel.GroupNumberStatus = data.GroupNumberStatus; + } + + if (CurrentWorklist.Count() != 0) + { + var data = _sysStatusService.GetCurrentWorkEquipment().First(); + CurrentWorkEquipment.Chromatograph_MEMS = data.Chromatograph_MEMS; + CurrentWorkEquipment.MassSpectrometer_MEMS = data.MassSpectrometer_MEMS; + CurrentWorkEquipment.ColorMassSpectrometer = data.ColorMassSpectrometer; + CurrentWorkEquipment.CH4Analyzer = data.CH4Analyzer; + CurrentWorkEquipment.CO2Analyzer = data.CO2Analyzer; + CurrentWorkEquipment.ParticleAnalyzer = data.ParticleAnalyzer; + CurrentWorkEquipment.Sequencer = data.Sequencer; + } + + if (currentFaultylist.Count() != 0) + { + var data = _sysStatusService.GetCurrentFaultyEquipment().First(); + currentFaultyEquipment.Chromatograph_MEMS = data.Chromatograph_MEMS; + currentFaultyEquipment.MassSpectrometer_MEMS = data.MassSpectrometer_MEMS; + currentFaultyEquipment.ColorMassSpectrometer = data.ColorMassSpectrometer; + currentFaultyEquipment.CH4Analyzer = data.CH4Analyzer; + currentFaultyEquipment.CO2Analyzer = data.CO2Analyzer; + currentFaultyEquipment.ParticleAnalyzer = data.ParticleAnalyzer; + currentFaultyEquipment.Sequencer = data.Sequencer; + } + } + + /// + /// 读取文本文档 + /// + /// + public void DoRead(object o) + { + string? info = null; + string? txtContent = null; + OpenFileDialog openFileDialog = new OpenFileDialog(); + openFileDialog.Title = "选择文件"; + openFileDialog.Multiselect = false;//选择多个文件 + openFileDialog.RestoreDirectory = true;//跟踪上次打开的文件的目录 + //openFileDialog.Filter = "所有文件(*.*)|*"; + openFileDialog.Filter = "Text files(*.txt) | *.txt"; + openFileDialog.CheckFileExists = true; + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + info = openFileDialog.FileName; + } + if (!string.IsNullOrEmpty(info)) + { + //逐行读取文件,返回数组 + txtContent = tools.ReadTXT_StreamReader(info); + + + } + + + + } + } +} diff --git a/InSituLaboratory/Views/LoginView.xaml b/InSituLaboratory/Views/LoginView.xaml index d046dec..f16a70a 100644 --- a/InSituLaboratory/Views/LoginView.xaml +++ b/InSituLaboratory/Views/LoginView.xaml @@ -7,7 +7,7 @@ xmlns:b="clr-namespace:InSituLaboratory.Base" xmlns:c="clr-namespace:InSituLaboratory.Controls;assembly=InSituLaboratory.Controls" mc:Ignorable="d" - FontFamily="{StaticResource DigitalDisplay}" + FontFamily="{StaticResource SourceHanSansCN-Regular}" Height="380" Width="680"> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -257,194 +262,190 @@ - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - + + + + + + + + - - + + + + + + + + - -