diff --git a/BPASmart.ConfigurationSoftware/BPASmart.ConfigurationSoftware.csproj b/BPASmart.ConfigurationSoftware/BPASmart.ConfigurationSoftware.csproj
index 190af161..f442881c 100644
--- a/BPASmart.ConfigurationSoftware/BPASmart.ConfigurationSoftware.csproj
+++ b/BPASmart.ConfigurationSoftware/BPASmart.ConfigurationSoftware.csproj
@@ -20,7 +20,7 @@
-
+
diff --git a/BPASmart.PageLoad/BPASmart.PageLoad.csproj b/BPASmart.PageLoad/BPASmart.PageLoad.csproj
index 729ab884..53196873 100644
--- a/BPASmart.PageLoad/BPASmart.PageLoad.csproj
+++ b/BPASmart.PageLoad/BPASmart.PageLoad.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/BPASmart.Server/BPASmart.Server.csproj b/BPASmart.Server/BPASmart.Server.csproj
index ce7c3363..c47c5a34 100644
--- a/BPASmart.Server/BPASmart.Server.csproj
+++ b/BPASmart.Server/BPASmart.Server.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/BPASmart.VariableManager/BPASmart.VariableManager.csproj b/BPASmart.VariableManager/BPASmart.VariableManager.csproj
index c633d45b..caac5a94 100644
--- a/BPASmart.VariableManager/BPASmart.VariableManager.csproj
+++ b/BPASmart.VariableManager/BPASmart.VariableManager.csproj
@@ -30,7 +30,7 @@
-
+
diff --git a/BPASmartClient.Business/BPASmartClient.Business.csproj b/BPASmartClient.Business/BPASmartClient.Business.csproj
index 25dfbd1c..0d77ddd4 100644
--- a/BPASmartClient.Business/BPASmartClient.Business.csproj
+++ b/BPASmartClient.Business/BPASmartClient.Business.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
index 609d0a2a..86047719 100644
--- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
+++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
@@ -409,7 +409,7 @@
-
+
diff --git a/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs b/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
index f0688f09..4e15c59e 100644
--- a/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
@@ -81,7 +81,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
catch (Exception)
{
- // throw;
+ // throw;
}
}
}
@@ -109,34 +109,40 @@ namespace BPASmartClient.CustomResource.Pages.Model
public bool ShowDialog(string info, DialogType dialogType = DialogType.Information)
{
- PromptView PV = new PromptView();
- PV.TextBlockInfo = info;
- switch (dialogType)
+ bool result = false;
+ Application.Current.Dispatcher.Invoke(() =>
{
- case DialogType.Warning:
- PV.TextBlockIcon = "";
- PV.TextBlockForeground = Brushes.Yellow;
- PV.infoType.Text = "警告:";
- //PV.Cancel.Visibility = Visibility.Collapsed;
- break;
- case DialogType.Error:
- PV.TextBlockIcon = "";
- PV.TextBlockForeground = Brushes.Red;
- PV.infoType.Text = "错误:";
- //PV.Cancel.Visibility = Visibility.Collapsed;
- break;
- case DialogType.Information:
- PV.TextBlockIcon = "";
- PV.TextBlockForeground = Brushes.DeepSkyBlue;
- PV.infoType.Text = "提示:";
- //PV.Cancel.Visibility = Visibility.Visible;
- break;
- default:
- break;
- }
- PV.infoType.Foreground = PV.TextBlockForeground;
- var res = PV.ShowDialog();
- return res == null ? false : (bool)res;
+ PromptView PV = new PromptView();
+ PV.TextBlockInfo = info;
+ switch (dialogType)
+ {
+ case DialogType.Warning:
+ PV.TextBlockIcon = "";
+ PV.TextBlockForeground = Brushes.Yellow;
+ PV.infoType.Text = "警告:";
+ //PV.Cancel.Visibility = Visibility.Collapsed;
+ break;
+ case DialogType.Error:
+ PV.TextBlockIcon = "";
+ PV.TextBlockForeground = Brushes.Red;
+ PV.infoType.Text = "错误:";
+ //PV.Cancel.Visibility = Visibility.Collapsed;
+ break;
+ case DialogType.Information:
+ PV.TextBlockIcon = "";
+ PV.TextBlockForeground = Brushes.DeepSkyBlue;
+ PV.infoType.Text = "提示:";
+ //PV.Cancel.Visibility = Visibility.Visible;
+ break;
+ default:
+ break;
+ }
+ PV.infoType.Foreground = PV.TextBlockForeground;
+
+ var res = PV.ShowDialog();
+ result = res == null ? false : (bool)res;
+ });
+ return result;
}
}
diff --git a/BPASmartClient.DosingSystemSingle/BPASmartClient.DosingSystemSingle.csproj b/BPASmartClient.DosingSystemSingle/BPASmartClient.DosingSystemSingle.csproj
index 46d83b78..472a4704 100644
--- a/BPASmartClient.DosingSystemSingle/BPASmartClient.DosingSystemSingle.csproj
+++ b/BPASmartClient.DosingSystemSingle/BPASmartClient.DosingSystemSingle.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/BPASmartClient.SmallBatchingSystem/BPASmartClient.SmallBatchingSystem.csproj b/BPASmartClient.SmallBatchingSystem/BPASmartClient.SmallBatchingSystem.csproj
index 00d07de3..3a434956 100644
--- a/BPASmartClient.SmallBatchingSystem/BPASmartClient.SmallBatchingSystem.csproj
+++ b/BPASmartClient.SmallBatchingSystem/BPASmartClient.SmallBatchingSystem.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/BPASmartClient.Update/App.xaml b/BPASmartClient.Update/App.xaml
new file mode 100644
index 00000000..ef55777f
--- /dev/null
+++ b/BPASmartClient.Update/App.xaml
@@ -0,0 +1,8 @@
+
+
+
diff --git a/BPASmartClient.Update/App.xaml.cs b/BPASmartClient.Update/App.xaml.cs
new file mode 100644
index 00000000..d59b4ae7
--- /dev/null
+++ b/BPASmartClient.Update/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace BPASmartClient.Update
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/BPASmartClient.Update/AssemblyInfo.cs b/BPASmartClient.Update/AssemblyInfo.cs
new file mode 100644
index 00000000..8b5504ec
--- /dev/null
+++ b/BPASmartClient.Update/AssemblyInfo.cs
@@ -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)
+)]
diff --git a/BPASmartClient.Update/BPASmartClient.Update.csproj b/BPASmartClient.Update/BPASmartClient.Update.csproj
new file mode 100644
index 00000000..01761f98
--- /dev/null
+++ b/BPASmartClient.Update/BPASmartClient.Update.csproj
@@ -0,0 +1,14 @@
+
+
+
+ WinExe
+ net6.0-windows
+ enable
+ true
+
+
+
+
+
+
+
diff --git a/BPASmartClient.Update/MainViewsModel.cs b/BPASmartClient.Update/MainViewsModel.cs
new file mode 100644
index 00000000..a4c464ce
--- /dev/null
+++ b/BPASmartClient.Update/MainViewsModel.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using BPA.Helper;
+using BPASmartClient.Update.Model;
+
+namespace BPASmartClient.Update
+{
+ public class MainViewsModel : NotifyBase
+ {
+ public MainViewsModel()
+ {
+
+ }
+ public UpdateModel um { get { return _mum; } set { _mum = value; OnPropertyChanged(); } }
+ private UpdateModel _mum = new UpdateModel();
+
+ }
+}
diff --git a/BPASmartClient.Update/MainWindow.xaml b/BPASmartClient.Update/MainWindow.xaml
new file mode 100644
index 00000000..004b2e85
--- /dev/null
+++ b/BPASmartClient.Update/MainWindow.xaml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.Update/MainWindow.xaml.cs b/BPASmartClient.Update/MainWindow.xaml.cs
new file mode 100644
index 00000000..cece6f13
--- /dev/null
+++ b/BPASmartClient.Update/MainWindow.xaml.cs
@@ -0,0 +1,85 @@
+using BPA.Helper;
+using BPASmartClient.Update.Model;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading;
+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 BPASmartClient.Update
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ this.grProgressbar.Visibility = Visibility.Collapsed;
+ }
+
+ private void cancel_Click(object sender, RoutedEventArgs e)
+ {
+ this.Close();
+ }
+
+ private async void ok_Click(object sender, RoutedEventArgs e)
+ {
+ this.cancel.Visibility = Visibility.Collapsed;
+ this.grProgressbar.Visibility = Visibility.Visible;
+ await Task.Run(() =>
+ {
+ App.Current.Dispatcher.Invoke(() =>
+ {
+ this.progressbar.Value = 25;
+ this.tb.Text = "当前更新进度:1/4";
+ });
+ Thread.Sleep(2000);
+
+ App.Current.Dispatcher.Invoke(() =>
+ {
+ this.progressbar.Value = 50;
+ this.tb.Text = "当前更新进度:2/4";
+ });
+ Thread.Sleep(1500);
+
+ App.Current.Dispatcher.Invoke(() =>
+ {
+ this.progressbar.Value = 75;
+ this.tb.Text = "当前更新进度:3/4";
+ });
+ Thread.Sleep(3000);
+
+ App.Current.Dispatcher.Invoke(() =>
+ {
+ this.progressbar.Value = 100;
+ this.tb.Text = "当前更新进度:4/4";
+ });
+ Thread.Sleep(1500);
+
+ App.Current.Dispatcher.Invoke(() =>
+ {
+ this.progressbar.Value = 100;
+ this.tb.Text = "当前更新进度:更新完成";
+ });
+ Thread.Sleep(1500);
+ });
+ string directory = AppDomain.CurrentDomain.BaseDirectory;
+ Process.Start($"{directory}BPASmartClient.DosingSystem.exe");
+ Json.Save();
+ this.Close();
+ }
+ }
+}
diff --git a/BPASmartClient.Update/Models/UpdateModel.cs b/BPASmartClient.Update/Models/UpdateModel.cs
new file mode 100644
index 00000000..a97ddfad
--- /dev/null
+++ b/BPASmartClient.Update/Models/UpdateModel.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using BPA.Helper;
+
+namespace BPASmartClient.Update.Model
+{
+ public class UpdateModel : NotifyBase
+ {
+ ///
+ /// 软件名称
+ ///
+ public string Name { get { return _mName; } set { _mName = value; OnPropertyChanged(); } }
+ private string _mName = "味魔方管理系统软件[简称:味魔方] ";
+
+
+ ///
+ /// 软件当前版本号
+ ///
+ public string Version { get { return _mVersion; } set { _mVersion = value; OnPropertyChanged(); } }
+ private string _mVersion = "V1.0.1";
+
+
+ ///
+ /// 软件升级版本号
+ ///
+ public string UpgradeVersion { get { return _mUpgradeVersion; } set { _mUpgradeVersion = value; OnPropertyChanged(); } }
+ private string _mUpgradeVersion = "V1.0.2";
+
+
+ ///
+ /// 软件更新说明
+ ///
+ public string UpdateDescription { get { return _mUpdateDescription; } set { _mUpdateDescription = value; OnPropertyChanged(); } }
+ private string _mUpdateDescription = "下列 Bug 问题已修复:\n1、当在某些语言环境中保存文档后重新打开时,Canvas的缩放级别与文件保存时不同。\n2、删除样本数据后执行“另存为”时,有时无法使用串行打印机打印。\n3、如果显示放大率设置为100%以外的值,有时仅部分显示最小化、最大化和关闭按钮。\n4、其他小Bug。";
+
+
+ }
+}
diff --git a/BPASmartClient/App.config b/BPASmartClient/App.config
index 9c45fe12..618157de 100644
--- a/BPASmartClient/App.config
+++ b/BPASmartClient/App.config
@@ -7,9 +7,9 @@
-
+
-
+
diff --git a/ComputerTestDemo/ComputerTestDemo.csproj b/ComputerTestDemo/ComputerTestDemo.csproj
index 0a23019a..392136ef 100644
--- a/ComputerTestDemo/ComputerTestDemo.csproj
+++ b/ComputerTestDemo/ComputerTestDemo.csproj
@@ -10,7 +10,7 @@
-
+
diff --git a/DosingSystem/App.xaml.cs b/DosingSystem/App.xaml.cs
index 49e8932b..284a1be0 100644
--- a/DosingSystem/App.xaml.cs
+++ b/DosingSystem/App.xaml.cs
@@ -13,6 +13,10 @@ using BPASmartClient.CustomResource.Pages.View;
using BPASmartClient.CustomResource.Pages.ViewModel;
using BPASmartClient.DosingSystem.View;
using BPA.Helper;
+using BPASmartClient.DosingSystem.Model;
+using System.Diagnostics;
+using System.IO;
+using BPASmartClient.Update.Model;
namespace BPASmartClient.DosingSystem
{
@@ -40,11 +44,32 @@ namespace BPASmartClient.DosingSystem
DataInit();
DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化
MainView mv = new MainView();
- mv.TitleName = "味魔方管理系统软件[简称:味魔方] 1.0.1";
+ mv.TitleName = $"味魔方管理系统软件[简称:味魔方] V1.0.1";
LoginView lv = new LoginView();
var res = lv.ShowDialog();
if (res != null && res == true)
{
+ #region 更新测试
+ //string directory = $"{AppDomain.CurrentDomain.BaseDirectory}AccessFile\\JSON\\UpdateModel.json";
+ //if (File.Exists(directory))
+ // mv.TitleName = $"味魔方管理系统软件[简称:味魔方] {Json.Data.UpgradeVersion}";
+ //else
+ //{
+ // mv.TitleName = $"味魔方管理系统软件[简称:味魔方] V1.0.1";
+ // Task.Run(() =>
+ // {
+ // Thread.Sleep(3000);
+ // var tt = MessageNotify.GetInstance.ShowDialog("检测到新版本,请问是否现在更新?", DialogType.Information);
+ // if (tt)
+ // {
+ // string directory = AppDomain.CurrentDomain.BaseDirectory;
+ // Process.Start($"{directory}BPASmartClient.Update.exe");
+ // App.Current.Dispatcher.Invoke(() => { mv.Close(); });
+ // }
+ // });
+ //}
+ #endregion
+
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.ShowUserLog("用户登录");
mv.Show();
}
diff --git a/DosingSystem/BPASmartClient.DosingSystem.csproj b/DosingSystem/BPASmartClient.DosingSystem.csproj
index 9616088a..897021d5 100644
--- a/DosingSystem/BPASmartClient.DosingSystem.csproj
+++ b/DosingSystem/BPASmartClient.DosingSystem.csproj
@@ -21,7 +21,7 @@
-
+
@@ -30,6 +30,7 @@
+
diff --git a/DosingSystem/Model/DeviceInquire.cs b/DosingSystem/Model/DeviceInquire.cs
index d674e6c9..8b6902e7 100644
--- a/DosingSystem/Model/DeviceInquire.cs
+++ b/DosingSystem/Model/DeviceInquire.cs
@@ -87,14 +87,13 @@ namespace BPASmartClient.DosingSystem
private void TestData()
{
- //aa(1, "盐");
- //aa(2, "郫县豆瓣");
- //aa(3, "芥菜");
- //aa(4, "调味剂");
- //aa(5, "香料");
- //aa(6, "鸡精");
- //aa(7, "味精");
-
+ aa(1, "盐");
+ aa(2, "郫县豆瓣");
+ aa(3, "芥菜");
+ aa(4, "调味剂");
+ aa(5, "香料");
+ aa(6, "鸡精");
+ aa(7, "味精");
for (int i = 0; i < 8; i++)
{
DeviceLists.TryAdd($"192.168.1.{i + 1}", new DeviceStatus() { DeviceName = $"测试设备{i + 1}" });
@@ -144,7 +143,7 @@ namespace BPASmartClient.DosingSystem
{
if (!string.IsNullOrEmpty(Json.Data.BaseParModel.NetworkSegAddress)) IPSegment = Json.Data.BaseParModel.NetworkSegAddress;
else Json.Data.BaseParModel.NetworkSegAddress = IPSegment;
- //TestData();
+ TestData();
IpAddressLines();
SiemensDevice.GetInstance.Connect(Json.Data.BaseParModel.DeviceAddress);
DeviceDataInit();
diff --git a/DosingSystem/View/DeviceMaterialParView.xaml b/DosingSystem/View/DeviceMaterialParView.xaml
index 0a20bd8d..0d8cdd3a 100644
--- a/DosingSystem/View/DeviceMaterialParView.xaml
+++ b/DosingSystem/View/DeviceMaterialParView.xaml
@@ -62,8 +62,7 @@