change - 解决问题

master
SoulStar 1 month ago
parent 11a501e7fb
commit 821cf907f6

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NDSD_Screwdriver
namespace NDSD_Screwdriver.Entity
{
public class MonitorEntity
{

@ -1,9 +1,12 @@
using NDSD_TouchSocket;
using DNSD_DB;
using NDSD_Screwdriver.Entity;
using NDSD_TouchSocket;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Text;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -43,7 +46,7 @@ namespace NDSD_Screwdriver
/// <summary>
/// RFID列表
/// </summary>
string[] RFIDs = new string[]
public string[] RFIDs = new string[]
{
"1111222233334444",
"2222222233334444",
@ -60,6 +63,7 @@ namespace NDSD_Screwdriver
{
MessageBox.Show("服务端打开失败!");
}
}
/// <summary>
@ -122,7 +126,13 @@ namespace NDSD_Screwdriver
/// <param name="e"></param>
private void TestButton1_Click(object sender, EventArgs e)
{
if(RFIDs.Length == 0)
{
MessageBox.Show("没有值,请先设置。");
}
SetNowRowsLightState(FormUtils.TestRamColor());
RefreshRoll();
if (++NowRowIndex >= RFIDs.Length)
{
@ -132,6 +142,7 @@ namespace NDSD_Screwdriver
private void InitButton_Click(object sender, EventArgs e)
{
NowRowIndex = 0;
InitMonitirIntity();
SetRFIDValue(RFIDs);
}
@ -205,6 +216,7 @@ namespace NDSD_Screwdriver
private void SetNowRowsLightState(LightState lightState)
{
monitorEntities[NowRowIndex].RowEntitys[2].Color = FormUtils.EnumColorToBrush(lightState);
for (int i = 0; i < RFIDs.Length; i++)
{
monitorEntities[NowRowIndex].RowEntitys[0].Value = i == NowRowIndex ? "=>" : "";
@ -219,5 +231,7 @@ namespace NDSD_Screwdriver
monitorEntities[i].RowEntitys[0].Value = i == NowRowIndex ? "=>" : "";
}
}
}
}

@ -81,7 +81,7 @@
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="MonitorEntity.cs" />
<Compile Include="Entity\MonitorEntity.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ScrewdriverTest.cs">

@ -10,7 +10,7 @@ namespace NDSD_TouchSocket
{
SendAnalysis sendAnalysis;
private static TcpServer Server = TcpServer.Instance;
TcpServer Server = TcpServer.Instance;
public DOperate()
{

@ -14,6 +14,8 @@ namespace NDSD_TouchSocket
public static TcpServer Instance => lazy.Value;
string ClientIP;
string ClientPort;
TcpService service = new TcpService();
@ -30,6 +32,8 @@ namespace NDSD_TouchSocket
{
Console.WriteLine(client.IP + " 成功连接");
service.ResetIdAsync(client.Id, client.IP);
this.ClientIP = client.IP;
this.ClientPort = client.Port.ToString();
return EasyTask.CompletedTask;
};//有客户端成功连接
service.Closing = (client, e) =>
@ -89,12 +93,12 @@ namespace NDSD_TouchSocket
}
}
public async void SendMessage(byte[] bytes)
public void SendMessage(byte[] bytes)
{
//尝试性获取
if (service.TryGetClient("192.168.0.178", out var sessionClient))
if (service.TryGetClient(ClientIP, out var sessionClient))
{
await sessionClient.SendAsync(bytes);
sessionClient.SendAsync(bytes);
}
return;
}

Loading…
Cancel
Save