add - 添加闪烁 优化代码 准备添加灯的逻辑

master
SoulStar 1 month ago
parent 5e6738ae64
commit 4bf8ca37cf

@ -58,11 +58,11 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Mapper\StudentMap.cs" />
<Compile Include="Mapper\Maps.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SQLiteContext.cs" />
<Compile Include="SqlLiteTool.cs" />
<Compile Include="Student.cs" />
<Compile Include="Entitys.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

@ -0,0 +1,42 @@
using System;
using System.ComponentModel;
using Chloe.Annotations;
namespace DNSD_DB
{
public class RfidSetting
{
[Column(IsPrimaryKey = true)]
[AutoIncrement]
[DisplayName("自增主键")]
public int ID { get; set; }
public string RfidNo { get; set; }
public string Green { get; set; }
public string Yellow { get; set; }
public string Red { get; set; }
public bool IsEnable { get; set; }
public DateTime CreateDateTime { get; set; }
}
public class RFIDLog
{
[Column(IsPrimaryKey = true)]
[AutoIncrement]
public int ID { get; set; }
public DateTime CreateTime { get; set; }
public string LogText { get; set; }
public string RFIDId { get; set; }
}
}

@ -2,22 +2,23 @@
namespace DNSD_DB.Mapper
{
public class StudentMap:EntityTypeBuilder<Student>
public class RfidSettingMap : EntityTypeBuilder<RfidSetting>
{
public StudentMap()
public RfidSettingMap()
{
this.MapTo("Student");
this.MapTo("RfidSetting");
this.Property(a => a.ID).IsAutoIncrement().IsPrimaryKey();
}
}
public class RfidSettingMap : EntityTypeBuilder<RfidSetting>
public class RFIDLogMap : EntityTypeBuilder<RFIDLog>
{
public RfidSettingMap()
public RFIDLogMap()
{
this.MapTo("RfidSetting");
this.MapTo("RFIDLog");
this.Property(a => a.ID).IsAutoIncrement().IsPrimaryKey();
}
}

@ -13,9 +13,11 @@ namespace DNSD_DB
public static void CreateTable(string db)
{
DbConfiguration.UseTypeBuilders(typeof(StudentMap));
DbConfiguration.UseTypeBuilders(typeof(RfidSettingMap));
DbConfiguration.UseTypeBuilders(typeof(RFIDLogMap));
IDbContext dbContext = new SQLiteContext(new SQLiteConnectionFactory(db));
new SQLiteTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
}

@ -1,66 +0,0 @@
using System;
using System.ComponentModel;
using Chloe.Annotations;
namespace DNSD_DB
{
public class Student
{
/// <summary>
/// 学生ID [主键,自动递增]
/// </summary>
[Column(IsPrimaryKey = true)]
[AutoIncrement]
[DisplayName("学生ID")]
public int ID { get; set; }
/// <summary>
/// 班级ID
/// </summary>
public int ClassID { get; set; }
/// <summary>
/// 学生姓名
/// </summary>
public string Name { get; set; }
/// <summary>
/// 学生年龄
/// </summary>
public int Age { get; set; }
/// <summary>
/// 学生性别
/// </summary>
public string Gender { get; set; }
}
public class RfidSetting
{
[Column(IsPrimaryKey = true)]
[AutoIncrement]
[DisplayName("自增主见")]
public int ID { get; set; }
public string RfidNo { get; set; }
public string Green { get; set; }
public string Yellow { get; set; }
public string Red { get; set; }
public bool IsEnable { get; set; }
public DateTime CreateDateTime { get; set; }
}
}

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NDSD_Screwdriver.Entity
{
public class LightsEntity
{
public int Green { get; set; }
public int Yellow { get; set; }
public int Red { get; set; }
}
}

@ -11,6 +11,10 @@ namespace NDSD_Screwdriver
{
public static Random r = new Random();
/// <summary>
/// 随机颜色测试
/// </summary>
/// <returns></returns>
public static Brush TestRamColor()
{
int i = r.Next(0, 4);
@ -22,9 +26,18 @@ namespace NDSD_Screwdriver
{
return Brushes.Yellow;
}
else return Brushes.Red;
else /*if (i == 3)*/
{
return Brushes.Red;
}
//else return Brushes.Transparent;
}
/// <summary>
/// 颜色枚举值转换为颜色
/// </summary>
/// <param name="lightState"></param>
/// <returns></returns>
public static Brush EnumColorToBrush(LightState lightState)
{
switch (lightState)

@ -29,10 +29,6 @@
private void InitializeComponent()
{
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.RfidNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Green = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Yellow = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Red = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnSave = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
@ -41,6 +37,11 @@
this.label1 = new System.Windows.Forms.Label();
this.ServerPortTextbox = new System.Windows.Forms.TextBox();
this.ServerIPTextbox = new System.Windows.Forms.TextBox();
this.RfidNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Green = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Yellow = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Red = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label3 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
@ -63,46 +64,6 @@
this.dataGridView1.Size = new System.Drawing.Size(615, 657);
this.dataGridView1.TabIndex = 0;
//
// RfidNo
//
this.RfidNo.DataPropertyName = "RfidNo";
this.RfidNo.HeaderText = "Rfid";
this.RfidNo.MaxInputLength = 10;
this.RfidNo.MinimumWidth = 8;
this.RfidNo.Name = "RfidNo";
this.RfidNo.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.RfidNo.Width = 150;
//
// Green
//
this.Green.DataPropertyName = "Green";
this.Green.HeaderText = "绿灯";
this.Green.MaxInputLength = 2;
this.Green.MinimumWidth = 8;
this.Green.Name = "Green";
this.Green.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.Green.Width = 80;
//
// Yellow
//
this.Yellow.DataPropertyName = "Yellow";
this.Yellow.HeaderText = "黄灯";
this.Yellow.MaxInputLength = 2;
this.Yellow.MinimumWidth = 8;
this.Yellow.Name = "Yellow";
this.Yellow.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.Yellow.Width = 80;
//
// Red
//
this.Red.DataPropertyName = "Red";
this.Red.HeaderText = "红灯";
this.Red.MaxInputLength = 5;
this.Red.MinimumWidth = 8;
this.Red.Name = "Red";
this.Red.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.Red.Width = 80;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.dataGridView1);
@ -117,7 +78,7 @@
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(27, 753);
this.btnSave.Location = new System.Drawing.Point(27, 723);
this.btnSave.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(163, 75);
@ -184,11 +145,61 @@
this.ServerIPTextbox.TabIndex = 0;
this.ServerIPTextbox.Text = "192.168.0.101";
//
// RfidNo
//
this.RfidNo.DataPropertyName = "RfidNo";
this.RfidNo.HeaderText = "Rfid";
this.RfidNo.MaxInputLength = 20;
this.RfidNo.MinimumWidth = 20;
this.RfidNo.Name = "RfidNo";
this.RfidNo.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.RfidNo.Width = 150;
//
// Green
//
this.Green.DataPropertyName = "Green";
this.Green.HeaderText = "绿灯";
this.Green.MaxInputLength = 2;
this.Green.MinimumWidth = 8;
this.Green.Name = "Green";
this.Green.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.Green.Width = 80;
//
// Yellow
//
this.Yellow.DataPropertyName = "Yellow";
this.Yellow.HeaderText = "黄灯";
this.Yellow.MaxInputLength = 2;
this.Yellow.MinimumWidth = 8;
this.Yellow.Name = "Yellow";
this.Yellow.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.Yellow.Width = 80;
//
// Red
//
this.Red.DataPropertyName = "Red";
this.Red.HeaderText = "红灯";
this.Red.MaxInputLength = 5;
this.Red.MinimumWidth = 8;
this.Red.Name = "Red";
this.Red.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.Red.Width = 80;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(169, 9);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(423, 15);
this.label3.TabIndex = 4;
this.label3.Text = "配置报警灯时,请按照:绿->黄->红 的顺序从大到小填写DO口";
//
// FrmSetting
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1796, 937);
this.ClientSize = new System.Drawing.Size(1160, 819);
this.Controls.Add(this.label3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.groupBox1);
@ -200,6 +211,7 @@
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -208,15 +220,16 @@
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.DataGridViewTextBoxColumn RfidNo;
private System.Windows.Forms.DataGridViewTextBoxColumn Green;
private System.Windows.Forms.DataGridViewTextBoxColumn Yellow;
private System.Windows.Forms.DataGridViewTextBoxColumn Red;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox ServerPortTextbox;
private System.Windows.Forms.TextBox ServerIPTextbox;
private System.Windows.Forms.Button SetServerIPButton;
private System.Windows.Forms.DataGridViewTextBoxColumn RfidNo;
private System.Windows.Forms.DataGridViewTextBoxColumn Green;
private System.Windows.Forms.DataGridViewTextBoxColumn Yellow;
private System.Windows.Forms.DataGridViewTextBoxColumn Red;
private System.Windows.Forms.Label label3;
}
}

@ -14,6 +14,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Serialization;
namespace NDSD_Screwdriver
{
@ -34,6 +35,8 @@ namespace NDSD_Screwdriver
/// </summary>
private List<MonitorEntity> monitorEntities;
private List<RfidSetting> rfidSettings;
private Random rand = new Random();
///// <summary>
@ -46,23 +49,28 @@ namespace NDSD_Screwdriver
/// </summary>
public int NowRowIndex = 0;
/// <summary>
/// 准备工作的行号
/// </summary>
public int ReadyRowIndex = 0;
/// <summary>
/// RFID列表
/// </summary>
public string[] RFIDs = new string[]
{
"1111222233334444",
"2222222233334444",
"3333222233334444",
"4444222233334444",
"5555222233334444"
};
public string[] RFIDs;
public List<LightsEntity> lightsEntities;
Thread thread;
bool flag = false;
SerialPortFactory serialPort;
private CancellationTokenSource cancellationTokenSource;
private int textindex = 0;
public MainForm()
{
InitializeComponent();
@ -71,25 +79,27 @@ namespace NDSD_Screwdriver
{
MessageBox.Show("服务端打开失败!");
}
serialPort=new SerialPortFactory();
FlashThread();
serialPort = new SerialPortFactory();
StartLongRunningTask();
}
private void StartLongRunningTask()
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
{
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
if (server != null)
{
while (!cancellationTokenSource.Token.IsCancellationRequested)
if (!server.ServerStop())
{
// 这里是你的长期运行逻辑
Thread.Sleep(1000); // 模拟一些长时间的工作
MessageBox.Show("服务端关闭失败!");
}
}, cancellationTokenSource.Token);
if (!server.ServerDispose())
{
MessageBox.Show("服务端释放失败!");
}
}
}
#region 按钮
/// <summary>
/// 打开DO测试
@ -99,117 +109,153 @@ namespace NDSD_Screwdriver
private void DOTest_Click(object sender, EventArgs e)
{
string str= serialPort.Read();
//string str = serialPort.Read();
ScrewdriverTest screwdriverTest = new ScrewdriverTest(server, DOperate);
screwdriverTest.Show();
}
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
/// <summary>
/// 测试按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void TestButton1_Click(object sender, EventArgs e)
{
if (server != null)
if (RFIDs.Length == 0)
{
if (!server.ServerStop())
{
MessageBox.Show("服务端关闭失败!");
}
if (!server.ServerDispose())
{
MessageBox.Show("服务端释放失败!");
}
MessageBox.Show("没有值,请先设置。");
}
SetNowWorkRow(RFIDs[textindex]);
SetNowRowsLightState(1);
if (flag && thread.ThreadState == ThreadState.Suspended)
{
thread.Resume();
}
RefreshRoll();
if (++textindex >= RFIDs.Length)
{
textindex = 0;
}
}
/// <summary>
/// 列表回调函数
/// 初始化按钮
/// </summary>
/// <param name="g"></param>
/// <param name="rowIndex"></param>
/// <param name="colIndex"></param>
/// <param name="rectangle"></param>
/// <param name="value"></param>
/// <param name="sf"></param>
private void ScrewdriverMonitor_OnDrawCellTextEvent(Graphics g, int rowIndex, int colIndex, RectangleF rectangle, string value, StringFormat sf)
/// <param name="sender"></param>
/// <param name="e"></param>
private void InitButton_Click(object sender, EventArgs e)
{
foreach (MonitorEntity entity in monitorEntities)
NowRowIndex = 0;
//读取rfid数据
var ctx = SqlLiteTool.GetDb(AppTool.GetDb());
var list = ctx.Query<RfidSetting>().Where(x => x.IsEnable == true).ToList();
RFIDs = list.Select(x => x.RfidNo).ToArray();
//读取报警灯数据
lightsEntities = new List<LightsEntity>();
for (int i = 0; i < list.Count; i++)
{
if (rowIndex == entity.RowIndex)
lightsEntities.Add(new LightsEntity()
{
foreach (RowEntity rowEneiey in entity.RowEntitys)
{
if (colIndex == rowEneiey.ColumnIndex)
{
g.FillRectangle(rowEneiey.Color, rectangle);
g.DrawString(rowEneiey.Value, this.ScrewdriverMonitor.Font, Brushes.Black, rectangle, sf);
}
}
}
Green = Convert.ToInt32(list[i].Green),
Yellow = Convert.ToInt32(list[i].Yellow),
Red = Convert.ToInt32(list[i].Red),
});
}
//初始化列表框架
monitorEntities = new List<MonitorEntity>();
for (int i = 0; i < RFIDs.Length; i++)
{
monitorEntities.Add(new MonitorEntity()
{
RowIndex = i,
RowEntitys = InitRows(i)
});
}
if (flag)
{
thread.Suspend();
}
//更新值
for (int i = 0; i < RFIDs.Length; i++)
{
monitorEntities[i].RowEntitys[1].Value = RFIDs[i];
}
RefreshRoll();
}
/// <summary>
/// 测试按钮
/// 打开设置界面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void TestButton1_Click(object sender, EventArgs e)
private void SettingButton_Click(object sender, EventArgs e)
{
if (RFIDs.Length == 0)
FrmSetting frmSetting = new FrmSetting();
frmSetting.Show();
}
/// <summary>
/// 服务端重启按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ServerRestartButton_Click(object sender, EventArgs e)
{
if (server.ServerRestart(MemorySetting.ServerIP, MemorySetting.ServerPort))
{
MessageBox.Show("没有值,请先设置。");
MessageBox.Show("服务器重启成功!");
}
SetNowRowsLightState(FormUtils.TestRamColor());
RefreshRoll();
if (++NowRowIndex >= RFIDs.Length)
else
{
NowRowIndex = 0;
MessageBox.Show("服务器重启失败!请手动启动服务器。");
}
}
private void InitButton_Click(object sender, EventArgs e)
{
NowRowIndex = 0;
InitMonitirIntity();
//var ctx = SqlLiteTool.GetDb(AppTool.GetDb());
//var list = ctx.Query<RfidSetting>().Where(x => x.IsEnable == true).ToList();
//RFIDs = list.Select(x => x.RfidNo).ToArray();
SetRFIDValue(RFIDs);
}
/// <summary>
/// 刷新列表
/// 服务端手动启动
/// </summary>
private void RefreshRoll()
/// <param name="sender"></param>
/// <param name="e"></param>
private void StartServerButton_Click(object sender, EventArgs e)
{
for (int i = 0; i < RFIDs.Length; i++)
if (!server.ServerOpen(MemorySetting.ServerIP, MemorySetting.ServerPort))
{
ScrewdriverMonitor.AddRowTop(new string[]{
"",
"",
""
});
MessageBox.Show("服务端打开失败!");
}
else
{
MessageBox.Show("服务器启动成功");
}
}
/// <summary>
/// 初始化整个列表
/// 服务端手动停止
/// </summary>
private void InitMonitirIntity()
/// <param name="sender"></param>
/// <param name="e"></param>
private void ServerStopButton_Click(object sender, EventArgs e)
{
monitorEntities = new List<MonitorEntity>();
for (int i = 0; i < RFIDs.Length; i++)
if (server != null)
{
monitorEntities.Add(new MonitorEntity()
if (!server.ServerStop())
{
RowIndex = i,
RowEntitys = InitRows(i)
});
MessageBox.Show("服务端关闭失败!");
}
if (!server.ServerDispose())
{
MessageBox.Show("服务端释放失败!");
}
}
RefreshRoll();
}
#endregion
#region 功能性方法
/// <summary>
/// 初始化一行
/// </summary>
@ -229,84 +275,162 @@ namespace NDSD_Screwdriver
}
/// <summary>
/// 初始化RFID数据
/// 刷新列表
/// </summary>
/// <param name="rFIDvalue">RFID列表</param>
private void SetRFIDValue(string[] rFIDvalue)
private void RefreshRoll()
{
for (int i = 0; i < rFIDvalue.Length; i++)
for (int i = 0; i < RFIDs.Length; i++)
{
monitorEntities[i].RowEntitys[1].Value = rFIDvalue[i];
ScrewdriverMonitor.AddRowTop(new string[]{
"",
"",
""
});
}
}
/// <summary>
/// 设置当前行指示灯的状态以及工作的行
/// 设置当前行指示灯的状态以及工作的行的标识 输入枚举类
/// </summary>
/// <param name="lightState"></param>
private void SetNowRowsLightState(LightState lightState)
{
monitorEntities[NowRowIndex].RowEntitys[2].Color = FormUtils.EnumColorToBrush(lightState);
SetNowRowsLightState(FormUtils.EnumColorToBrush(lightState));
}
for (int i = 0; i < RFIDs.Length; i++)
{
monitorEntities[NowRowIndex].RowEntitys[0].Value = i == NowRowIndex ? "=>" : "";
}
private void SetNowRowsLightState(int lightState)
{
SetNowRowsLightState((LightState)lightState);
}
/// <summary>
/// 设置当前行指示灯的状态以及工作的行的标识 输入Brush
/// </summary>
/// <param name="brush"></param>
private void SetNowRowsLightState(Brush brush)
{
if (monitorEntities.Count == 0)
{
return;
}
monitorEntities[NowRowIndex].RowEntitys[2].Color = brush;
SetNextRowsFlash();
for (int i = 0; i < RFIDs.Length; i++)
{
monitorEntities[i].RowEntitys[0].Value = i == NowRowIndex ? "=>" : "";
}
}
private void SettingButton_Click(object sender, EventArgs e)
{
FrmSetting frmSetting = new FrmSetting();
frmSetting.Show();
}
private void ServerRestartButton_Click(object sender, EventArgs e)
/// <summary>
/// 设置待工作灯闪烁
/// </summary>
private void SetNextRowsFlash()
{
if (server.ServerRestart(MemorySetting.ServerIP, MemorySetting.ServerPort))
ReadyRowIndex = NowRowIndex + 1;
if (ReadyRowIndex >= RFIDs.Length)
{
MessageBox.Show("服务器重启成功!");
ReadyRowIndex = 0;
thread.Suspend();
return;
}
else
if (!flag)
{
MessageBox.Show("服务器重启失败!请手动启动服务器。");
thread.Start();
flag = true;
}
}
private void StartServerButton_Click(object sender, EventArgs e)
/// <summary>
/// 根据读取到的RFID条码设置当前工作的行
/// </summary>
/// <param name="rfid">读取到的RFID</param>
private void SetNowWorkRow(string rfid)
{
if (!server.ServerOpen(MemorySetting.ServerIP, MemorySetting.ServerPort))
for (int i = 0; i < RFIDs.Length; i++)
{
MessageBox.Show("服务端打开失败!");
if (monitorEntities[i].RowEntitys[1].Value == rfid)
{
NowRowIndex = i;
return;
}
}
else
}
/// <summary>
/// 根据IO口控制灯的开关
/// </summary>
private void LightControl()
{
}
/// <summary>
/// 列表回调函数
/// </summary>
/// <param name="g"></param>
/// <param name="rowIndex"></param>
/// <param name="colIndex"></param>
/// <param name="rectangle"></param>
/// <param name="value"></param>
/// <param name="sf"></param>
private void ScrewdriverMonitor_OnDrawCellTextEvent(Graphics g, int rowIndex, int colIndex, RectangleF rectangle, string value, StringFormat sf)
{
foreach (MonitorEntity entity in monitorEntities)
{
MessageBox.Show("服务器启动成功");
if (rowIndex == entity.RowIndex)
{
foreach (RowEntity rowEneiey in entity.RowEntitys)
{
if (colIndex == rowEneiey.ColumnIndex)
{
g.FillRectangle(rowEneiey.Color, rectangle);
g.DrawString(rowEneiey.Value, this.ScrewdriverMonitor.Font, Brushes.Black, rectangle, sf);
}
}
}
}
}
private void ServerStopButton_Click(object sender, EventArgs e)
/// <summary>
/// RFID刷新任务
/// </summary>
private void StartLongRunningTask()
{
if (server != null)
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
{
if (!server.ServerStop())
while (!cancellationTokenSource.Token.IsCancellationRequested)
{
MessageBox.Show("服务端关闭失败!");
// 这里是你的长期运行逻辑
Thread.Sleep(1000); // 模拟一些长时间的工作
}
if (!server.ServerDispose())
}, cancellationTokenSource.Token);
}
/// <summary>
/// 等待工作指示灯闪烁进程
/// </summary>
private void FlashThread()
{
//等待闪烁线程
thread = new Thread(() =>
{
while (true)
{
MessageBox.Show("服务端释放失败!");
DOperate.DTimeOpen(1, 1);
monitorEntities[ReadyRowIndex].RowEntitys[2].Color = Brushes.Yellow;
RefreshRoll();
Thread.Sleep(1000);
monitorEntities[ReadyRowIndex].RowEntitys[2].Color = Brushes.Transparent;
RefreshRoll();
Thread.Sleep(1000);
}
}
});
}
#endregion
}
}

@ -102,6 +102,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AppTool.cs" />
<Compile Include="Entity\LightsEntity.cs" />
<Compile Include="FrmSetting.cs">
<SubType>Form</SubType>
</Compile>

Loading…
Cancel
Save