diff --git a/BPASmartClient.AGV/Enums/AGVMove.cs b/BPASmartClient.AGV/Enums/AGVMove.cs
new file mode 100644
index 00000000..74a1b645
--- /dev/null
+++ b/BPASmartClient.AGV/Enums/AGVMove.cs
@@ -0,0 +1,25 @@
+namespace BPASmartClient.AGV.Enums
+{
+ ///
+ /// AGV移动任务枚举
+ ///
+ public enum AGVMove
+ {
+ ///
+ /// 任务完成
+ ///
+ DONE,
+ ///
+ /// 任务取消
+ ///
+ CANCEL,
+ ///
+ /// 任务异常取消
+ ///
+ ABNORMAL_CANCEL,
+ ///
+ /// 任务异常完成
+ ///
+ ABNORMAL_COMPLETED
+ }
+}
diff --git a/BPASmartClient.AGV/Enums/BinTask.cs b/BPASmartClient.AGV/Enums/BinTask.cs
new file mode 100644
index 00000000..77801b93
--- /dev/null
+++ b/BPASmartClient.AGV/Enums/BinTask.cs
@@ -0,0 +1,36 @@
+namespace BPASmartClient.AGV.Enums
+ ///
+ /// 纯料箱任务枚举
+ ///
+public enum BinTask
+{
+ ///
+ /// 开始移动(仅单插臂或单夹报,2.8.1后)
+ ///
+ MOVE_BEGIN,
+ ///
+ /// 到站
+ ///
+ ENTER_STATION,
+ ///
+ /// 任务完成
+ ///
+ DONE,
+ ///
+ /// 取料完成
+ ///
+ LOAD_COMPLETED,
+ ///
+ /// 放料完成
+ ///
+ UNLOAD_COMPLETED,
+ ///
+ /// 任务异常取消
+ ///
+ ABNORMAL_CANCEL,
+ ///
+ /// 任务异常完成
+ ///
+ ABNORMAL_COMPLETED,
+}
+}
diff --git a/BPASmartClient.AGV/Enums/CTC.cs b/BPASmartClient.AGV/Enums/CTC.cs
new file mode 100644
index 00000000..97f67a65
--- /dev/null
+++ b/BPASmartClient.AGV/Enums/CTC.cs
@@ -0,0 +1,32 @@
+namespace BPASmartClient.AGV.Enums
+ ///
+ /// 货位到货位/点到点辊筒料箱搬运任务枚举
+ ///
+public enum CTC
+{
+ ///
+ /// 正在上料
+ ///
+ ROLLER_LOAD_DOING,
+ ///
+ /// 上料完成
+ ///
+ ROLLER_LOAD_FINISH,
+ ///
+ /// 正在下料
+ ///
+ ROLLER_UNLOAD_DOING,
+ ///
+ /// 下料完成
+ ///
+ DONE,
+ ///
+ /// 任务异常取消
+ ///
+ ABNORMAL_CANCEL,
+ ///
+ /// 任务异常完成
+ ///
+ ABNORMAL_COMPLETED,
+}
+}
diff --git a/BPASmartClient.AGV/Enums/JobType.cs b/BPASmartClient.AGV/Enums/JobType.cs
new file mode 100644
index 00000000..186da4f3
--- /dev/null
+++ b/BPASmartClient.AGV/Enums/JobType.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.AGV.Enums
+{
+ public enum JobType
+ {
+ ///
+ /// 货位到货位搬运
+ ///
+ SLOT_ROLLER_MOVE,
+ ///
+ /// 点到点搬运
+ ///
+ POINT_ROLLER_MOVE
+ }
+}
diff --git a/BPASmartClient.AGV/Enums/QuickPickTask.cs b/BPASmartClient.AGV/Enums/QuickPickTask.cs
new file mode 100644
index 00000000..a7eace63
--- /dev/null
+++ b/BPASmartClient.AGV/Enums/QuickPickTask.cs
@@ -0,0 +1,29 @@
+namespace BPASmartClient.AGV.Enums
+{
+ ///
+ /// QuickPick任务枚举
+ ///
+ public enum QuickPickTask
+ {
+ ///
+ /// 到站
+ ///
+ ENTER_STATION,
+ ///
+ /// 任务完成
+ ///
+ DONE,
+ ///
+ /// 任务取消
+ ///
+ CANCEL,
+ ///
+ /// 离站
+ ///
+ LEAVE_STATION,
+ ///
+ /// 回滚(有其他任务,当前任务可不执行)
+ ///
+ ROLLBACK
+ }
+}
diff --git a/BPASmartClient.AGV/Enums/STC.cs b/BPASmartClient.AGV/Enums/STC.cs
new file mode 100644
index 00000000..a4d56a40
--- /dev/null
+++ b/BPASmartClient.AGV/Enums/STC.cs
@@ -0,0 +1,37 @@
+namespace BPASmartClient.AGV.Enums
+{
+ ///
+ /// 货架/货位/点到点货架搬运任务枚举
+ ///
+ public enum STC
+ {
+ ///
+ /// //顶升完成
+ ///
+ LIFT_UP_DONE,
+ ///
+ /// 开始移动
+ ///
+ MOVE_BEGIN,
+ ///
+ /// 放下完成
+ ///
+ PUT_DOWN_DONE,
+ ///
+ /// 任务完成
+ ///
+ DONE,
+ ///
+ /// 任务取消
+ ///
+ CANCEL,
+ ///
+ /// 任务异常取消
+ ///
+ ABNORMAL_CANCEL,
+ ///
+ /// 任务异常完成
+ ///
+ ABNORMAL_COMPLETED,
+ }
+}
diff --git a/BPASmartClient.AGV/Enums/SmallBelt.cs b/BPASmartClient.AGV/Enums/SmallBelt.cs
new file mode 100644
index 00000000..f7797dfe
--- /dev/null
+++ b/BPASmartClient.AGV/Enums/SmallBelt.cs
@@ -0,0 +1,13 @@
+namespace BPASmartClient.AGV.Enums
+{
+ ///
+ /// 小皮带任务枚举
+ ///
+ public enum SmallBelt
+ {
+ ///
+ /// 任务完成
+ ///
+ DONE
+ }
+}
diff --git a/BPASmartClient.AGV/Feedback/JobData.cs b/BPASmartClient.AGV/Feedback/JobData.cs
new file mode 100644
index 00000000..a11637ef
--- /dev/null
+++ b/BPASmartClient.AGV/Feedback/JobData.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.AGV.Feedback
+{
+ public class JobData
+ {
+ public string agvCode { get; set; }
+
+ public string containerCode { get; set; }
+
+ public string startPointCode { get; set; }
+
+ public string startSlotCode { get; set; }
+ public string targetPointCode { get; set; }
+ public string targetSlotCode { get; set; }
+
+ public bool loadInteractive { get; set; }
+ }
+}
diff --git a/BPASmartClient.AGV/Feedback/event.cs b/BPASmartClient.AGV/Feedback/event.cs
new file mode 100644
index 00000000..b4d7cbc6
--- /dev/null
+++ b/BPASmartClient.AGV/Feedback/event.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.AGV.Feedback
+{
+ public class @event
+ {
+ public string robotJobId { get; set; }
+
+ public int warehouseId { get; set; }
+
+ public string jobId { get; set; }
+
+ public string state { get; set; }
+ public string jobType { get; set; }
+
+ public JobData jobData { get; set; } = new JobData();
+ }
+}
diff --git a/ClassLibrary1/ClassLibrary1.csproj b/BPASmartClient.AgvApi/BPASmartClient.AgvApi.csproj
similarity index 54%
rename from ClassLibrary1/ClassLibrary1.csproj
rename to BPASmartClient.AgvApi/BPASmartClient.AgvApi.csproj
index 132c02c5..60bf9ead 100644
--- a/ClassLibrary1/ClassLibrary1.csproj
+++ b/BPASmartClient.AgvApi/BPASmartClient.AgvApi.csproj
@@ -1,9 +1,13 @@
-
+
net6.0
- enable
enable
+ enable
+
+
+
+
diff --git a/BPASmartClient.AgvApi/Controllers/AgvStatusController.cs b/BPASmartClient.AgvApi/Controllers/AgvStatusController.cs
new file mode 100644
index 00000000..f4309c3b
--- /dev/null
+++ b/BPASmartClient.AgvApi/Controllers/AgvStatusController.cs
@@ -0,0 +1,16 @@
+using Microsoft.AspNetCore.Mvc;
+
+namespace BPASmartClient.AgvApi.Controllers
+{
+ [ApiController]
+ [Route("apicallback/quicktron/[Controller]")]
+ public class AgvStatusController : ControllerBase
+ {
+
+ [HttpPost("AgvCallback")]
+ public string AgvCallback(Sign sign)
+ {
+ return "SUCCESS";
+ }
+ }
+}
diff --git a/BPASmartClient.AgvApi/Controllers/WeatherForecastController.cs b/BPASmartClient.AgvApi/Controllers/WeatherForecastController.cs
new file mode 100644
index 00000000..60eaac99
--- /dev/null
+++ b/BPASmartClient.AgvApi/Controllers/WeatherForecastController.cs
@@ -0,0 +1,33 @@
+using Microsoft.AspNetCore.Mvc;
+
+namespace BPASmartClient.AgvApi.Controllers
+{
+ [ApiController]
+ [Route("[controller]")]
+ public class WeatherForecastController : ControllerBase
+ {
+ private static readonly string[] Summaries = new[]
+ {
+ "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
+ };
+
+ private readonly ILogger _logger;
+
+ public WeatherForecastController(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+ [HttpGet(Name = "GetWeatherForecast")]
+ public IEnumerable Get()
+ {
+ return Enumerable.Range(1, 5).Select(index => new WeatherForecast
+ {
+ Date = DateTime.Now.AddDays(index),
+ TemperatureC = Random.Shared.Next(-20, 55),
+ Summary = Summaries[Random.Shared.Next(Summaries.Length)]
+ })
+ .ToArray();
+ }
+ }
+}
\ No newline at end of file
diff --git a/BPASmartClient.AgvApi/PersonHub.cs b/BPASmartClient.AgvApi/PersonHub.cs
new file mode 100644
index 00000000..6337749b
--- /dev/null
+++ b/BPASmartClient.AgvApi/PersonHub.cs
@@ -0,0 +1,29 @@
+using Microsoft.AspNetCore.SignalR;
+
+namespace BPASmartClient.AgvApi
+{
+ public class PersonHub : Hub
+ {
+ public override Task OnConnectedAsync()
+ {
+ Console.WriteLine($"{Context.ConnectionId}:= 连接成功");
+ return base.OnConnectedAsync();
+ }
+
+ public override Task OnDisconnectedAsync(Exception? exception)
+ {
+ Console.WriteLine($"{Context.ConnectionId}:= 断开连接");
+ return base.OnDisconnectedAsync(exception);
+ }
+
+ ///
+ /// 接收客户端发来的信息,并向客户端发送信息
+ ///
+ ///
+ ///
+ public Task Send(string str)
+ {
+ return Clients.Caller.SendAsync("SendMessage", str);
+ }
+ }
+}
diff --git a/BPASmartClient.AgvApi/Program.cs b/BPASmartClient.AgvApi/Program.cs
new file mode 100644
index 00000000..6fe552f2
--- /dev/null
+++ b/BPASmartClient.AgvApi/Program.cs
@@ -0,0 +1,36 @@
+using BPASmartClient.AgvApi;
+
+var builder = WebApplication.CreateBuilder(args);
+
+// Add services to the container.
+
+builder.Services.AddControllers();
+// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
+builder.Services.AddEndpointsApiExplorer();
+builder.Services.AddSwaggerGen();
+builder.Services.AddSignalR();
+var app = builder.Build();
+
+// Configure the HTTP request pipeline.
+if (app.Environment.IsDevelopment())
+{
+ app.UseSwagger();
+ app.UseSwaggerUI();
+}
+
+app.Use(async (context, next) =>
+{
+ context.Request.Headers["appKey"] = "0123456789abcdef";
+ context.Response.Headers["appSecret"] = "0123456789abcdef";
+ context.Response.Headers["requestId"] = "5f643ece-dc53-4d55-8e5f-d1e2dfd6a6d0";
+ context.Response.Headers["timestamp"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ context.Response.Headers["version"] = "2.8";
+ await next();
+});
+
+app.UseAuthorization();
+
+app.MapControllers();
+app.MapHub("/personhub");
+
+app.Run();
diff --git a/BPASmartClient.AgvApi/Properties/launchSettings.json b/BPASmartClient.AgvApi/Properties/launchSettings.json
new file mode 100644
index 00000000..821e5716
--- /dev/null
+++ b/BPASmartClient.AgvApi/Properties/launchSettings.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:38659",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "BPASmartClient.AgvApi": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "applicationUrl": "http://localhost:5175",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/BPASmartClient.AgvApi/Sign.cs b/BPASmartClient.AgvApi/Sign.cs
new file mode 100644
index 00000000..4386e206
--- /dev/null
+++ b/BPASmartClient.AgvApi/Sign.cs
@@ -0,0 +1,10 @@
+namespace BPASmartClient.AgvApi
+{
+ public class Sign
+ {
+ public int a { get; set; }
+ public int b { get; set; }
+ public string c { get; set; }
+ public string d { get; set; }
+ }
+}
diff --git a/BPASmartClient.AgvApi/WeatherForecast.cs b/BPASmartClient.AgvApi/WeatherForecast.cs
new file mode 100644
index 00000000..d2bb41ee
--- /dev/null
+++ b/BPASmartClient.AgvApi/WeatherForecast.cs
@@ -0,0 +1,13 @@
+namespace BPASmartClient.AgvApi
+{
+ public class WeatherForecast
+ {
+ public DateTime Date { get; set; }
+
+ public int TemperatureC { get; set; }
+
+ public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
+
+ public string? Summary { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/BPASmartClient.AgvApi/appsettings.Development.json b/BPASmartClient.AgvApi/appsettings.Development.json
new file mode 100644
index 00000000..0c208ae9
--- /dev/null
+++ b/BPASmartClient.AgvApi/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/BPASmartClient.AgvApi/appsettings.json b/BPASmartClient.AgvApi/appsettings.json
new file mode 100644
index 00000000..10f68b8c
--- /dev/null
+++ b/BPASmartClient.AgvApi/appsettings.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*"
+}
diff --git a/BPASmartClient.CustomResource/Fonts/iconfont.ttf b/BPASmartClient.CustomResource/Fonts/iconfont.ttf
index 0730867b..984ac025 100644
Binary files a/BPASmartClient.CustomResource/Fonts/iconfont.ttf and b/BPASmartClient.CustomResource/Fonts/iconfont.ttf differ
diff --git a/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs b/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs
index 6205c71f..db603c1c 100644
--- a/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs
@@ -42,6 +42,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
Date = DateTime.Now.ToString("yyyy-MM-dd"),
Time = DateTime.Now.ToString("HH:mm:ss"),
Permission = Global.userInfo.permission.ToString(),
+ UserName = Global.userInfo.UserName,
LogInfo = info
};
Sqlite.GetInstance.Base.Add(userLog);
diff --git a/BPASmartClient.CustomResource/Pages/Model/UserLog.cs b/BPASmartClient.CustomResource/Pages/Model/UserLog.cs
index 2082d188..be1d0f31 100644
--- a/BPASmartClient.CustomResource/Pages/Model/UserLog.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/UserLog.cs
@@ -31,6 +31,8 @@ namespace BPASmartClient.CustomResource.Pages.Model
public string Time { get; set; }
+ public string UserName { get; set; }
+
public string LogInfo { get; set; }
}
diff --git a/BPASmartClient.CustomResource/Pages/View/LoginView.xaml b/BPASmartClient.CustomResource/Pages/View/LoginView.xaml
index e6a01f0f..7a49bcd8 100644
--- a/BPASmartClient.CustomResource/Pages/View/LoginView.xaml
+++ b/BPASmartClient.CustomResource/Pages/View/LoginView.xaml
@@ -234,11 +234,11 @@
Grid.Row="1"
Height="40"
Margin="20,0"
- TabIndex="1"
BorderBrush="#009DFF"
FontSize="16"
Foreground="#aadddddd"
Style="{DynamicResource UserTextBoxStyle}"
+ TabIndex="1"
Text="{Binding UserName}" />
+ Style="{DynamicResource PasswordBoxStyle}"
+ TabIndex="2" />
+ Foreground="White"
+ TabIndex="3" />
diff --git a/BPASmartClient.CustomResource/Pages/View/MainView.xaml b/BPASmartClient.CustomResource/Pages/View/MainView.xaml
index 9c13a9b2..be782f19 100644
--- a/BPASmartClient.CustomResource/Pages/View/MainView.xaml
+++ b/BPASmartClient.CustomResource/Pages/View/MainView.xaml
@@ -9,6 +9,7 @@
Title="MainView"
Width="1200"
Height="700"
+ Topmost="False"
AllowsTransparency="True"
Background="{x:Null}"
WindowStartupLocation="CenterScreen"
diff --git a/BPASmartClient.CustomResource/Pages/View/UserLogView.xaml b/BPASmartClient.CustomResource/Pages/View/UserLogView.xaml
index 75e020c7..dc8eb9c9 100644
--- a/BPASmartClient.CustomResource/Pages/View/UserLogView.xaml
+++ b/BPASmartClient.CustomResource/Pages/View/UserLogView.xaml
@@ -5,6 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls"
xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
d:DesignHeight="450"
d:DesignWidth="800"
@@ -51,7 +52,7 @@
-
+
@@ -84,6 +85,76 @@
+
+
+
+
@@ -100,6 +171,17 @@
HorizontalAlignment="Right"
Orientation="Horizontal">
+
+
-
-
-
+
+
+
+
@@ -201,13 +284,21 @@
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
- Text="消息日志" />
+ Text="用户名" />
+
+
@@ -224,9 +315,10 @@
-
-
-
+
+
+
+
@@ -250,10 +342,17 @@
Margin="10,0,0,0"
HorizontalAlignment="Left"
Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding LogInfo}" />
+ Text="{Binding UserName}" />
+
+
-
-
-
+
+
+
+
@@ -304,10 +404,17 @@
Margin="10,0,0,0"
HorizontalAlignment="Left"
Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding LogInfo}" />
+ Text="{Binding UserName}" />
+
+
.GetInstance.GetData();
var res = lists.Where(p => Convert.ToDateTime(p.Date) >= StartDateTime && Convert.ToDateTime(p.Date) <= EndDateTime).ToList();
- if (res != null)
+ var result = res.Where(p => p.UserName == SearchUser && SearchUser != null && SearchUser.Length > 0).ToList();
+ var logs = result != null && SearchUser?.Length > 0 ? result : res;
+ if (logs != null)
{
HistoryUserLog.Clear();
- foreach (var item in res)
+ foreach (var item in logs)
{
HistoryUserLog.Add(item);
}
@@ -64,10 +66,11 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
private void GetHistoryUserLog()
{
var data = Sqlite.GetInstance.GetData();
- if (data != null)
+ var res = data.Where(p => p.UserName == Global.userInfo.UserName).ToList();
+ if (res != null)
{
HistoryUserLog.Clear();
- foreach (var item in data)
+ foreach (var item in res)
{
int day = DateTime.Now.Subtract(Convert.ToDateTime(item.Date)).Days;
if (day == 0)
@@ -118,6 +121,11 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
public DateTime EndDateTime { get { return _mEndDateTime; } set { _mEndDateTime = value; OnPropertyChanged(); } }
private DateTime _mEndDateTime = DateTime.Now;
+
+ public string SearchUser { get { return _mSearchUser; } set { _mSearchUser = value; OnPropertyChanged(); } }
+ private string _mSearchUser;
+
+
public ObservableCollection HistoryUserLog { get; set; } = new ObservableCollection();
public ObservableCollection UserLogs { get; set; }
diff --git a/BPASmartClient.CustomResource/RecDictionarys/DatePickeerDictionary.xaml b/BPASmartClient.CustomResource/RecDictionarys/DatePickeerDictionary.xaml
index 355b5f66..27a5e039 100644
--- a/BPASmartClient.CustomResource/RecDictionarys/DatePickeerDictionary.xaml
+++ b/BPASmartClient.CustomResource/RecDictionarys/DatePickeerDictionary.xaml
@@ -432,7 +432,7 @@
-
+
diff --git a/BPASmartClient.CustomResource/UserControls/WatermarkText.xaml b/BPASmartClient.CustomResource/UserControls/WatermarkText.xaml
new file mode 100644
index 00000000..bac128c4
--- /dev/null
+++ b/BPASmartClient.CustomResource/UserControls/WatermarkText.xaml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.CustomResource/UserControls/WatermarkText.xaml.cs b/BPASmartClient.CustomResource/UserControls/WatermarkText.xaml.cs
new file mode 100644
index 00000000..fac7f674
--- /dev/null
+++ b/BPASmartClient.CustomResource/UserControls/WatermarkText.xaml.cs
@@ -0,0 +1,121 @@
+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;
+using Microsoft.Windows;
+
+namespace BPASmartClient.CustomResource.UserControls
+{
+ ///
+ /// WatermarkText.xaml 的交互逻辑
+ ///
+ public partial class WatermarkText : UserControl
+ {
+ public WatermarkText()
+ {
+ InitializeComponent();
+ Maintb.TextChanged += Maintb_TextChanged;
+ }
+
+
+ private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ (d as WatermarkText)?.Refresh();
+ }
+
+ private void Refresh()
+ {
+ //this.Maintb.Text = Text;
+ //this.Subtb.Text = SubText;
+ //this.Maintb.Background = WTBackground;
+ }
+
+ public string Text
+ {
+ get { return (string)GetValue(TextProperty); }
+ set { SetValue(TextProperty, value); }
+ }
+ public static readonly DependencyProperty TextProperty =
+ DependencyProperty.Register("Text", typeof(string), typeof(WatermarkText),
+ new PropertyMetadata(string.Empty, new PropertyChangedCallback(OnPropertyChanged)));
+
+
+ public string SubText
+ {
+ get { return (string)GetValue(SubTextProperty); }
+ set { SetValue(SubTextProperty, value); }
+ }
+ public static readonly DependencyProperty SubTextProperty =
+ DependencyProperty.Register("SubText", typeof(string), typeof(WatermarkText),
+ new PropertyMetadata(string.Empty, new PropertyChangedCallback(OnPropertyChanged)));
+
+
+ public Brush WTBackground
+ {
+ get { return (Brush)GetValue(WTBackgroundProperty); }
+ set { SetValue(WTBackgroundProperty, value); }
+ }
+ public static readonly DependencyProperty WTBackgroundProperty =
+ DependencyProperty.Register("WTBackground", typeof(Brush), typeof(WatermarkText),
+ new PropertyMetadata(default(Brush), new PropertyChangedCallback(OnPropertyChanged)));
+
+
+ public int StrokeThickness
+ {
+ get { return (int)GetValue(StrokeThicknessProperty); }
+ set { SetValue(StrokeThicknessProperty, value); }
+ }
+ public static readonly DependencyProperty StrokeThicknessProperty =
+ DependencyProperty.Register("StrokeThickness", typeof(int), typeof(WatermarkText),
+ new PropertyMetadata(0, new PropertyChangedCallback(OnPropertyChanged)));
+
+ public Brush Stroke
+ {
+ get { return (Brush)GetValue(StrokeProperty); }
+ set { SetValue(StrokeProperty, value); }
+ }
+ public static readonly DependencyProperty StrokeProperty =
+ DependencyProperty.Register("Stroke", typeof(Brush), typeof(WatermarkText),
+ new PropertyMetadata(default(Brush), new PropertyChangedCallback(OnPropertyChanged)));
+
+
+ public CornerRadius WTCornerRadius
+ {
+ get { return (CornerRadius)GetValue(WTCornerRadiusProperty); }
+ set { SetValue(WTCornerRadiusProperty, value); }
+ }
+ public static readonly DependencyProperty WTCornerRadiusProperty =
+ DependencyProperty.Register("WTCornerRadius", typeof(CornerRadius), typeof(WatermarkText),
+ new PropertyMetadata(new CornerRadius(0), new PropertyChangedCallback(OnPropertyChanged)));
+
+
+ public Brush SubForeground
+ {
+ get { return (Brush)GetValue(SubForegroundProperty); }
+ set { SetValue(SubForegroundProperty, value); }
+ }
+ public static readonly DependencyProperty SubForegroundProperty =
+ DependencyProperty.Register("SubForeground", typeof(Brush), typeof(WatermarkText),
+ new PropertyMetadata(default(Brush), new PropertyChangedCallback(OnPropertyChanged)));
+
+
+
+ private void Maintb_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (Maintb.Text.Trim().Length > 0)
+ Subtb.Visibility = Visibility.Collapsed;
+ else
+ Subtb.Visibility = Visibility.Visible;
+ }
+ }
+}
diff --git a/ClassLibrary1/Class1.cs b/ClassLibrary1/Class1.cs
deleted file mode 100644
index fb04790e..00000000
--- a/ClassLibrary1/Class1.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace ClassLibrary1
-{
- public class Class1
- {
-
- }
-}
\ No newline at end of file
diff --git a/DosingSystem/BPASmartClient.DosingSystem.csproj b/DosingSystem/BPASmartClient.DosingSystem.csproj
index 341c5572..5b0c0f61 100644
--- a/DosingSystem/BPASmartClient.DosingSystem.csproj
+++ b/DosingSystem/BPASmartClient.DosingSystem.csproj
@@ -25,10 +25,4 @@
-
-
- $(DefaultXamlRuntime)
-
-
-
diff --git a/DosingSystem/View/AdminstratorsView.xaml b/DosingSystem/View/AdminstratorsView.xaml
deleted file mode 100644
index a0bb221e..00000000
--- a/DosingSystem/View/AdminstratorsView.xaml
+++ /dev/null
@@ -1,180 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/DosingSystem/View/AdminstratorsView.xaml.cs b/DosingSystem/View/AdminstratorsView.xaml.cs
deleted file mode 100644
index 78aef210..00000000
--- a/DosingSystem/View/AdminstratorsView.xaml.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-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;
-using static BPASmartClient.CustomResource.UserControls.UserKeyBoard;
-
-namespace BPASmartClient.DosingSystem.View
-{
- ///
- /// AdministratorsView.xaml 的交互逻辑
- ///
- public partial class AdminstratorsView : UserControl
- {
- public AdminstratorsView()
- {
- InitializeComponent();
-
- }
- private void UserControl_Loaded(object sender, RoutedEventArgs e)
- {
- this.tbx_admin.Focus();
- }
- private void MyKeyDown_Admin(object _key)
- {
- EKeyitem key = EKeyitem.A;
- if (_key.GetType() == typeof(EKeyitem)) key = (EKeyitem)_key;
- switch (key)
- {
- case EKeyitem.DEL:
- if (tbx_admin.Text.Length > 0)
- {
- tbx_admin.Text = tbx_admin.Text.Substring(0, tbx_admin.Text.Length - 1);
- }
- break;
- case EKeyitem.AC:
- tbx_admin.Text = string.Empty;
- break;
- case EKeyitem.OK:
- break;
- default:
- tbx_admin.Text += _key.ToString();
- break;
- }
- this.tbx_admin.Focus();
- }
-
- private void MyKeyDown_Password(object _key)
- {
- EKeyitem key = EKeyitem.A;
- if (_key.GetType() == typeof(EKeyitem)) key = (EKeyitem)_key;
- switch (key)
- {
- case EKeyitem.DEL:
- if (password.Password.Length > 0)
- {
- password.Password = password.Password.Substring(0, password.Password.Length - 1);
- }
- break;
- case EKeyitem.AC:
- password.Password = string.Empty;
- break;
- case EKeyitem.OK:
- break;
- default:
- password.Password += _key.ToString();
- break;
- }
-
- }
-
- private void TextBox_GotFocus(object sender, RoutedEventArgs e)
- {
- myKeyboard.MyKeyDown = MyKeyDown_Admin;
- }
-
- private void Password_GotFocus(object sender, RoutedEventArgs e)
- {
- myKeyboard.MyKeyDown = MyKeyDown_Password;
- }
- }
-}
diff --git a/DosingSystem/View/Helper/PasswordBoxHelper.cs b/DosingSystem/View/Helper/PasswordBoxHelper.cs
deleted file mode 100644
index e66a5db7..00000000
--- a/DosingSystem/View/Helper/PasswordBoxHelper.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-
-namespace BPASmartClient.DosingSystem.View.Helper
-{
- ///
- /// 为PasswordBox控件的Password增加绑定功能
- ///
- public static class PasswordBoxHelper
- {
- public static string GetPasswordContent(DependencyObject obj) => (string)obj.GetValue(PasswordContentProperty);
-
- public static void SetPasswordContent(DependencyObject obj, string value) => obj.SetValue(PasswordContentProperty, value);
-
- public static readonly DependencyProperty PasswordContentProperty =
- DependencyProperty.RegisterAttached("PasswordContent", typeof(string), typeof(PasswordBoxHelper),
- new PropertyMetadata(string.Empty, OnPasswordContentPropertyChanged));
-
- private static void OnPasswordContentPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- var box = d as PasswordBox;
- box.PasswordChanged -= OnPasswordChanged;
- var password = (string)e.NewValue;
- if (box != null && box.Password != password)
- box.Password = password;
- box.PasswordChanged += OnPasswordChanged;
- }
-
- private static void OnPasswordChanged(object sender, RoutedEventArgs e)
- {
- var box = sender as PasswordBox;
- SetPasswordContent(box, box.Password);
- }
- }
-}
diff --git a/DosingSystem/ViewModel/AdminstratorsViewModel.cs b/DosingSystem/ViewModel/AdminstratorsViewModel.cs
deleted file mode 100644
index acb7d712..00000000
--- a/DosingSystem/ViewModel/AdminstratorsViewModel.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using BPASmartClient.Helper;
-using Microsoft.Toolkit.Mvvm.ComponentModel;
-using Microsoft.Toolkit.Mvvm.Input;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Collections.ObjectModel;
-
-namespace BPASmartClient.DosingSystem.ViewModel
-{
- public class AdminstratorsViewModel : ObservableObject
- {
- public string Admin { get { return _admin; } set { _admin = value; OnPropertyChanged(); } }
- private string _admin;
-
- public string Password { get { return _password; } set { _password = value; OnPropertyChanged(); } }
- private string _password;
-
- public string ErrorMessage { get { return _errorMessage; } set { _errorMessage = value; OnPropertyChanged(); } }
- private string _errorMessage;
-
- public string SelectText { get { return _mSelectText; } set { _mSelectText = value; OnPropertyChanged(); } }
- private string _mSelectText;
-
-
- public RelayCommand AdminLoginCommand { get; set; }
-
- public ObservableCollection permission { get; set; } = new ObservableCollection();
-
- public AdminstratorsViewModel()
- {
- AdminLoginCommand = new RelayCommand(() =>
- {
- var rest = ActionManage.GetInstance.SendResult("LoginBPASmartClient.DosingSystem", $"{Admin}-={Password}-={SelectText}");
- if (rest != null && rest is string str)
- {
- ErrorMessage = str;
- }
- });
- permission.Add("管理员");
- permission.Add("操作员");
- permission.Add("观察员");
- permission.Add("技术员");
- SelectText = permission[0];
- }
- }
-}
diff --git a/DosingSystem/ViewModel/RecipeControlViewModel.cs b/DosingSystem/ViewModel/RecipeControlViewModel.cs
index 66716975..a1a3536b 100644
--- a/DosingSystem/ViewModel/RecipeControlViewModel.cs
+++ b/DosingSystem/ViewModel/RecipeControlViewModel.cs
@@ -24,23 +24,18 @@ namespace BPASmartClient.DosingSystem.ViewModel
Recipes = Json.Data.Recipes;
StartCommand = new RelayCommand