Browse Source

旅游学院程序添加

master
pry 1 year ago
parent
commit
b88868d099
7 changed files with 438 additions and 8 deletions
  1. +42
    -0
      BPASmartClient.TourismCollege/App.xaml
  2. +297
    -0
      BPASmartClient.TourismCollege/App.xaml.cs
  3. +10
    -0
      BPASmartClient.TourismCollege/AssemblyInfo.cs
  4. +24
    -0
      BPASmartClient.TourismCollege/BPASmartClient.TourismCollege.csproj
  5. +21
    -0
      BPASmartClient.TourismCollege/GlobalUsing.cs
  6. +21
    -8
      BPASmartClient.Update/MainWindow.xaml
  7. +23
    -0
      SmartClient.sln

+ 42
- 0
BPASmartClient.TourismCollege/App.xaml View File

@@ -0,0 +1,42 @@
<Application
x:Class="BPASmartClient.TourismCollege.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource"
xmlns:local="clr-namespace:BPASmartClient.TourismCollege">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecCheckBox.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecTitleBarButton.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecComboBox.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecIcoButtonStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecToggleButton.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/BeveledRadioButtonStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/DatePickeerDictionary.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecButtonStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/TextBoxStyle.xaml" />

<ResourceDictionary>
<con:ColorConverter x:Key="ColorConverter" />
<con:TextConverter x:Key="TextConverter" />
<con:VisibleTypeConverter x:Key="VisibleTypeConverter" />
<con:StatusConverter x:Key="StatusConverter" />
<con:StringToIconConverter x:Key="StringToIconConverter" />
<con:BoolToVisibilityConvert x:Key="BoolToVisibilityConvert" />
<con:CountIsVisiableConvert x:Key="CountIsVisiableConvert" />
<con:BoolToFillColorConverter x:Key="BoolToFillColorConverter" />
<con:RecipeStatusConvert x:Key="RecipeStatusConvert" />
</ResourceDictionary>

<ResourceDictionary>
<ImageBrush x:Key="hbl" ImageSource="/BPASmartClient.CustomResource;component/Image/HBL.png" />
<ImageBrush x:Key="dbxt" ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" />
</ResourceDictionary>

</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

+ 297
- 0
BPASmartClient.TourismCollege/App.xaml.cs View File

@@ -0,0 +1,297 @@
using BPASmartClient.CustomResource.Pages.ViewModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;

namespace BPASmartClient.TourismCollege
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public static Window MainWindow;

protected override void OnStartup(StartupEventArgs e)
{
bool createNew;
MessageLog.GetInstance.NotifyShow = new Action<string>(o =>
{
DebugLogViewModel.MessageModels.Add(new MessageModel()
{
LogInfo = o,
Forground = System.Windows.Media.Brushes.DeepSkyBlue
});
});
MessageLog.GetInstance.NotifyShowEx = new Action<string>(o =>
{
DebugLogViewModel.MessageModels.Add(new MessageModel()
{
LogInfo = o,
Forground = System.Windows.Media.Brushes.Red
});
});
new EventWaitHandle(false, EventResetMode.AutoReset, "BPASmartClient.TourismCollege", out createNew);
if (!createNew)
{
MessageBox.Show("程序已启动");
App.Current.Shutdown();
Environment.Exit(0);
}
base.OnStartup(e);
SystemHelper.GetInstance.CreateDesktopShortcut();
MenuInit();
DataInit();
MainView mv = new MainView();
mv.TitleName = $"智能炒锅控制系统";
LoginView lv = new LoginView();
var res = lv.ShowDialog();
if (res != null && res == true)
{
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.ShowUserLog("用户登录");
mv.Show();
}
else
mv.Close();
MainWindow = mv;
}

protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.LogSave();
ThreadManage.GetInstance().Dispose();
}

private void MenuInit()
{
NfcServer.GetInstance.Init();

#region 配方管理菜单
ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>();
RecipeManage.Add(new SubMenumodel()
{
SubMenuName = "配方管理",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.RecipeSettingsView"
});

RecipeManage.Add(new SubMenumodel()
{
SubMenuName = "配方下发",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.RecipeControlView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe683;",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
MainMenuName = "配方管理",
Alias = "Recipe Management",
subMenumodels = RecipeManage,
});
#endregion

#region 参数设置
ObservableCollection<SubMenumodel> ParSet = new ObservableCollection<SubMenumodel>();
ParSet.Add(new SubMenumodel()
{
SubMenuName = "原料参数设置",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.DeviceMaterialParView"
});

ParSet.Add(new SubMenumodel()
{
SubMenuName = "设备参数设置",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.CommParSetView"
});

//ParSet.Add(new SubMenumodel()
//{
// SubMenuName = "出料口管理设置",
// SubMenuPermission = new Permission[] { Permission.管理员 },
// AssemblyName = "BPASmartClient.DosingSystem",
// ToggleWindowPath = "View.OutletManagementView"
//});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe62d;",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
MainMenuName = "参数设置",
Alias = "Parameter Set",
subMenumodels = ParSet,
});
#endregion

#region 手动控制
ObservableCollection<SubMenumodel> ManualControl = new ObservableCollection<SubMenumodel>();
ManualControl.Add(new SubMenumodel()
{
SubMenuName = "气缸手动控制",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.ManualControlView"
});

ManualControl.Add(new SubMenumodel()
{
SubMenuName = "输送带手动控制",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.ConveyerBeltManualView"
});

ManualControl.Add(new SubMenumodel()
{
SubMenuName = "配料输送带控制",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.TempManageControlView"
});

//ManualControl.Add(new SubMenumodel()
//{
// SubMenuName = "料仓控制",
// SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
// AssemblyName = "BPASmartClient.DosingSystem",
// ToggleWindowPath = "View.StockControlView"
//});
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe622;",
MainMenuName = "手动控制",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
Alias = "Parameter Set",
subMenumodels = ManualControl,
});
#endregion

#region 消息日志
ObservableCollection<SubMenumodel> InfoLog = new ObservableCollection<SubMenumodel>();
InfoLog.Add(new SubMenumodel()
{
SubMenuName = "操作日志",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.UserLogView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "运行日志",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.RunLogView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "报警记录",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.AlarmView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "调试日志",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.DebugLogView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe668;",
MainMenuName = "消息日志",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
Alias = "Message Log",
subMenumodels = InfoLog,
});
#endregion

#region 硬件设备监控
ObservableCollection<SubMenumodel> DeviceMonitor = new ObservableCollection<SubMenumodel>();
DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "原料设备列表",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.DeviceListView"
});

DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "设备状态",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.HardwareStatusView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe603;",
MainMenuName = "设备监控",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
Alias = "Device Monitor",
subMenumodels = DeviceMonitor,
});
#endregion

#region 用户管理
ObservableCollection<SubMenumodel> UserManager = new ObservableCollection<SubMenumodel>();
UserManager.Add(new SubMenumodel()
{
SubMenuName = "用户登录",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.SubPagLoginView"
});

UserManager.Add(new SubMenumodel()
{
SubMenuName = "密码修改",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.PasswordChangeView"
});
UserManager.Add(new SubMenumodel()
{
SubMenuName = "用户管理",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.UserManagerView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe66d;",
MainMenuName = "用户管理",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
Alias = "User Management",
subMenumodels = UserManager,
});
#endregion
}

private void DataInit()
{

}

}
}

+ 10
- 0
BPASmartClient.TourismCollege/AssemblyInfo.cs 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)
)]

+ 24
- 0
BPASmartClient.TourismCollege/BPASmartClient.TourismCollege.csproj View File

@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Views\" />
<Folder Include="ViewModels\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BPA.Communication" Version="1.0.106" />
<PackageReference Include="BPA.Helper" Version="1.0.63" />
</ItemGroup>

</Project>

+ 21
- 0
BPASmartClient.TourismCollege/GlobalUsing.cs View File

@@ -0,0 +1,21 @@
global using System;
global using System.Collections.Generic;
global using System.Collections.ObjectModel;
global using System.Configuration;
global using System.Data;
global using System.Linq;
global using System.Threading;
global using System.Threading.Tasks;
global using System.Windows;
global using System.Diagnostics;
global using System.IO;
global using System.Drawing;
global using System.Windows.Media;
global using BPA.Helper;
global using BPA.Communication;
global using BPASmartClient.CustomResource.Pages.Enums;
global using BPASmartClient.CustomResource.Pages.Model;
global using BPASmartClient.CustomResource.Pages.View;
global using BPASmartClient.CustomResource.Pages.ViewModel;



+ 21
- 8
BPASmartClient.Update/MainWindow.xaml View File

@@ -19,7 +19,7 @@
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition />
<RowDefinition Height="80"/>
<RowDefinition Height="80" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>

@@ -30,13 +30,26 @@
Text="{Binding um.UpdateDescription}"
TextWrapping="Wrap" />

<Grid Name="grProgressbar" Margin="0 0 0 20" Grid.Row="3">
<Grid
Name="grProgressbar"
Grid.Row="3"
Margin="0,0,0,20">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Name="tb" Text="当前更新进度:1/4" VerticalAlignment="Bottom"/>
<ProgressBar Name="progressbar" Grid.Row="1" Height="15" VerticalAlignment="Center" Minimum="0" Maximum="100" Value="10"/>
<TextBlock
Name="tb"
VerticalAlignment="Bottom"
Text="当前更新进度:1/4" />
<ProgressBar
Name="progressbar"
Grid.Row="1"
Height="15"
VerticalAlignment="Center"
Maximum="100"
Minimum="0"
Value="10" />
</Grid>

<Grid Grid.Row="4">
@@ -49,17 +62,17 @@
Grid.Column="0"
Width="100"
Background="DeepSkyBlue"
Click="cancel_Click"
BorderThickness="0"
Click="cancel_Click"
Content="取消更新"
Foreground="#272727" />
<Button
Name="ok"
Grid.Column="1"
Width="100"
Click="ok_Click"
Background="DeepSkyBlue"
BorderThickness="0"
Click="ok_Click"
Content="开始更新"
Foreground="#272727" />
</Grid>


+ 23
- 0
SmartClient.sln View File

@@ -218,6 +218,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkMV1", "B
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.FoodStationTest", "BPASmartClient.FoodStationTest\BPASmartClient.FoodStationTest.csproj", "{82D5C479-7C38-41D6-8B42-24D4EC32D94F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.TourismCollege", "BPASmartClient.TourismCollege\BPASmartClient.TourismCollege.csproj", "{BD44A67C-4069-4FBC-BDF2-895F286266A6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -2052,6 +2054,26 @@ Global
{82D5C479-7C38-41D6-8B42-24D4EC32D94F}.Release|x64.Build.0 = Release|Any CPU
{82D5C479-7C38-41D6-8B42-24D4EC32D94F}.Release|x86.ActiveCfg = Release|Any CPU
{82D5C479-7C38-41D6-8B42-24D4EC32D94F}.Release|x86.Build.0 = Release|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Debug|ARM.ActiveCfg = Debug|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Debug|ARM.Build.0 = Debug|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Debug|ARM64.Build.0 = Debug|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Debug|x64.ActiveCfg = Debug|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Debug|x64.Build.0 = Debug|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Debug|x86.ActiveCfg = Debug|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Debug|x86.Build.0 = Debug|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Release|Any CPU.Build.0 = Release|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Release|ARM.ActiveCfg = Release|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Release|ARM.Build.0 = Release|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Release|ARM64.ActiveCfg = Release|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Release|ARM64.Build.0 = Release|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Release|x64.ActiveCfg = Release|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Release|x64.Build.0 = Release|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Release|x86.ActiveCfg = Release|Any CPU
{BD44A67C-4069-4FBC-BDF2-895F286266A6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -2153,6 +2175,7 @@ Global
{CB3E9835-2FF2-4A76-A0EE-0819EEC8CAE7} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{2D2200CF-7A66-40EA-998A-F0CE9BC2B3BB} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{82D5C479-7C38-41D6-8B42-24D4EC32D94F} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{BD44A67C-4069-4FBC-BDF2-895F286266A6} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}


Loading…
Cancel
Save