|
|
@ -17,16 +17,22 @@ using Tool;
|
|
|
|
using System.Security.Principal;
|
|
|
|
using System.Security.Principal;
|
|
|
|
using DB.Entity;
|
|
|
|
using DB.Entity;
|
|
|
|
using DB;
|
|
|
|
using DB;
|
|
|
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
using DB.Service;
|
|
|
|
|
|
|
|
using NewLife.Caching;
|
|
|
|
|
|
|
|
using Tool.Model;
|
|
|
|
|
|
|
|
|
|
|
|
namespace RfidWeb
|
|
|
|
namespace RfidWeb
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public partial class FormMain : Form
|
|
|
|
public partial class FormMain : Form
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private ILogNet logNet = ILogNetFactory.GetLogNet;
|
|
|
|
private ILogNet logNet = ILogNetFactory.GetLogNet;
|
|
|
|
|
|
|
|
private ICache cache;
|
|
|
|
TimerX _timer;
|
|
|
|
TimerX _timer;
|
|
|
|
public FormMain()
|
|
|
|
public FormMain()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
cache=Cache.Default;
|
|
|
|
|
|
|
|
|
|
|
|
DbInfo.Init(typeof(UserInfo).Assembly);
|
|
|
|
DbInfo.Init(typeof(UserInfo).Assembly);
|
|
|
|
|
|
|
|
|
|
|
|
var rfidSetting = RfidSetting.Current;
|
|
|
|
var rfidSetting = RfidSetting.Current;
|
|
|
@ -59,6 +65,8 @@ namespace RfidWeb
|
|
|
|
|
|
|
|
|
|
|
|
this.panContent.Controls.Clear();
|
|
|
|
this.panContent.Controls.Clear();
|
|
|
|
this.panContent.Controls.Add(new UserMain());
|
|
|
|
this.panContent.Controls.Add(new UserMain());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -73,6 +81,36 @@ namespace RfidWeb
|
|
|
|
label1.Text = dataTime.ToString("yyyy'/'MM'/'dd");
|
|
|
|
label1.Text = dataTime.ToString("yyyy'/'MM'/'dd");
|
|
|
|
label2.Text = dataTime.ToString("HH:mm:ss");
|
|
|
|
label2.Text = dataTime.ToString("HH:mm:ss");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ThreadPoolX.QueueUserWorkItem(UpdateLog);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private UpdateLogService updateLogService = new UpdateLogService();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateLog()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(cache.ContainsKey("UpdateLog")) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cache.Set("UpdateLog", "d", TimeSpan.FromSeconds(10));
|
|
|
|
|
|
|
|
var plc = PlcConnect.Instance;
|
|
|
|
|
|
|
|
var userDto = TestFactory.TestUser();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var strings = HmiPoint.GetValue();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var se in strings)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var res = plc.ReadUInt32(se);
|
|
|
|
|
|
|
|
if (res.IsSuccess)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
updateLogService.AddOrUpdateLog(userDto, se, res.Content);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cache.Remove("UpdateLog");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnExit_Click(object sender, EventArgs e)
|
|
|
|
private void btnExit_Click(object sender, EventArgs e)
|
|
|
|