diff --git a/SocketExample/RFIDmonitor.csproj b/SocketExample/RFIDmonitor.csproj
index cd8b0c5..650a992 100644
--- a/SocketExample/RFIDmonitor.csproj
+++ b/SocketExample/RFIDmonitor.csproj
@@ -269,6 +269,9 @@
+
+
+
diff --git a/SocketExample/TCPWindowV2.xaml b/SocketExample/TCPWindowV2.xaml
index 40ce6cd..6eed3a0 100644
--- a/SocketExample/TCPWindowV2.xaml
+++ b/SocketExample/TCPWindowV2.xaml
@@ -8,7 +8,7 @@
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:local="clr-namespace:SocketExample"
mc:Ignorable="d"
- Title="RFID读写器多终端监控软件v1.08" Height="680" Width="1180"
+ Title="RFID读写器多终端监控软件v1.091" Height="680" Width="1180"
Background="Transparent" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterScreen">
@@ -88,37 +88,44 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -192,37 +199,32 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -514,10 +516,10 @@
-
-
-
-
+
+
+
+
diff --git a/SocketExample/TCPWindowV2.xaml.cs b/SocketExample/TCPWindowV2.xaml.cs
index eb458be..b48bf42 100644
--- a/SocketExample/TCPWindowV2.xaml.cs
+++ b/SocketExample/TCPWindowV2.xaml.cs
@@ -207,9 +207,9 @@ namespace SocketExample
//页面初始化
int[] Powerdatasource = { 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 };
string[] GPOdatasource = { "高", "低" };
- string[] SendTextdatasource = { "单次读取", "时间段盘点" };
+ string[] SendTextdatasource = { "单次盘点", "时间段盘点" };
- Borderwidth = ((int)SystemParameters.PrimaryScreenWidth - 60) / 4; //动态生成界面宽度
+ Borderwidth = GetTerminalWidth(); //动态生成界面宽度
MessageText = string.Empty;
IPtext = "192.168.0.7";//默认IP
Porttext = "20108";//默认端口
@@ -265,7 +265,7 @@ namespace SocketExample
Text = Text.Replace(" ", "");
path = "";
string time = DateTime.Now.ToString();
- string currentTime = time.Substring(9, time.Length - 9);
+ string currentTime = DateTime.Now.ToString("T");
var mes = e.ByteBlock.Span.ToString(Encoding.UTF8);
byte[] data = e.ByteBlock.Span.ToArray();
string hexString = BitConverter.ToString(data).Replace("-", " ");
@@ -276,7 +276,7 @@ namespace SocketExample
string commandState = readStateString.Substring(6, 2);//获取命令
if (commandState != "81")
- Infotext += $"({currentTime})客户端接收到信息:\n{hexString}\n\n";
+ Infotext += $"({currentTime})客户端接收到信息:\n{hexString}\n";
int i = Convert.ToInt32(dataLength, 16);
if (i != 0)
@@ -650,6 +650,24 @@ namespace SocketExample
throw new NotImplementedException();
}
+ public int GetTerminalWidth()
+ {
+ int number = 4;
+ int width = ((int)SystemParameters.PrimaryScreenWidth - 60) / number;
+ while(width<360 || width > 700){
+ if (width < 360)
+ {
+ number--;
+ }
+ else if(width >700)
+ {
+ number++;
+ }
+ width = ((int)SystemParameters.PrimaryScreenWidth - 60) / number;
+ }
+ return width;
+ }
+
static void GetGPIOThread(ITcpClient client)
{
byte[] data = strToToHexByte("AA 55 00 81 81 0D");//获取GPIO状态
@@ -859,8 +877,8 @@ namespace SocketExample
byte[] data = null;
switch (message)
{
- case "单次读取":
- ActionType = "单次读取";
+ case "单次盘点":
+ ActionType = "单次盘点";
data = strToToHexByte(CheckForOnce());//单次
break;
/*
@@ -1000,8 +1018,8 @@ namespace SocketExample
//byte[] data = null;
switch (selcetion)
{
- case "单次读取":
- ActionType = "单次读取";
+ case "单次盘点":
+ ActionType = "单次盘点";
//data = strToToHexByte("AA 55 02 01 00 64 67 0D");//单次
break;
/*
@@ -1214,12 +1232,19 @@ namespace SocketExample
{
MessageBox.Show("请输入有效的正整数", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
}
+ Welcome_StackPanel.Visibility = Visibility.Visible;
+ NewTerminal_StackPanel.Visibility = Visibility.Collapsed;
}
private void Shutdown_Button_Click(object sender, RoutedEventArgs e)
{
Application.Current.Shutdown();
}
+ private void CreateTerminal_Button_Click(object sender, RoutedEventArgs e)
+ {
+ Welcome_StackPanel.Visibility = Visibility.Collapsed;
+ NewTerminal_StackPanel.Visibility = Visibility.Visible;
+ }
private void Maxmize_Button_Click(object sender, RoutedEventArgs e)
{
@@ -1512,5 +1537,6 @@ namespace SocketExample
WindowHeight = this.Height;
OriginWindowState = this.WindowState;
}
+
}
}
diff --git a/SocketExample/新增.png b/SocketExample/新增.png
new file mode 100644
index 0000000..ddf9a97
Binary files /dev/null and b/SocketExample/新增.png differ