nodyang@aliyun.com 2 days ago
parent 5ba6fa3a80
commit 65538a1008

@ -110,6 +110,7 @@
<Compile Include="Entity\Log.cs" />
<Compile Include="Entity\Point.cs" />
<Compile Include="Entity\PointLog.cs" />
<Compile Include="Entity\ReadBufLog.cs" />
<Compile Include="Entity\Role.cs" />
<Compile Include="Entity\UpdateLog.cs" />
<Compile Include="Entity\User.cs" />
@ -120,6 +121,7 @@
<Compile Include="Service\FromPlanService.cs" />
<Compile Include="Service\PointLogService.cs" />
<Compile Include="Service\PointService.cs" />
<Compile Include="Service\ReadBufLogService.cs" />
<Compile Include="Service\UpdateLogService.cs" />
<Compile Include="Service\UserService.cs" />
<Compile Include="SystemEntityTypeBuilder.cs" />

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DB.Entity
{
public class ReadBufLog: BaseChimsDb
{
public DateTime CreateTime { get; set; }
/// <summary>
/// 类别
/// </summary>
public string Category { get; set; }
/// <summary>
/// 条码
/// </summary>
public string BarCode { get; set; }
}
public class ReadBufLogMapper : SystemEntityTypeBuilder<ReadBufLog>
{
public ReadBufLogMapper() : base("ReadBufLog")
{
this.Property(x => x.Category).HasSize(4);
}
}
}

@ -0,0 +1,64 @@
using Chloe;
using DB.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tool;
namespace DB.Service
{
public class ReadBufLogService
{
public PagedList<ReadBufLog> GetPagedList(int pageIndex, int pageSize, string category,DateTime beDateTime,DateTime endTime)
{
PagingResult<ReadBufLog> pagePagingResult;
using (var dbContext = DbFactory.GetContext)
{
pagePagingResult = dbContext.Query<ReadBufLog>()
//.Where(x=>x.CreateTime>=beDateTime)
//.Where(x=>x.CreateTime<=endTime)
.Where(x=>x.Category==category)
.OrderByDesc(x => x.ID)
.Paging(pageIndex, pageSize);
}
PagedList<ReadBufLog> paged =
new PagedList<ReadBufLog>(pagePagingResult.DataList,
pagePagingResult.Totals.ToInt(), pageIndex, pageSize);
return paged;
}
public void Insert(string category, string barCode)
{
using (var dbContext = DbFactory.GetContext)
{
var entity= dbContext.Query<ReadBufLog>()
.Where(x => x.Category == category)
.Where(x => x.BarCode == barCode)
.OrderBy(x => x.ID)
.Select(x => x.BarCode).FirstOrDefault();
if (string.IsNullOrEmpty(entity))
{
ReadBufLog log = new ReadBufLog();
log.CreateTime=DateTime.Now;
log.ID = SnowflakeFactory.NewId;
log.Category = category;
log.BarCode = barCode;
dbContext.Insert(log);
}
}
}
}
}

@ -97,25 +97,68 @@ namespace DB.Service
}
public PagedList<UserDto> GetPagedList(int pageIndex, int pageSize, string key, List<int> lsLevel)
public PagedList<UserDto> GetPagedList(int pageIndex, int pageSize, string key, List<int> lsLevel,long userId)
{
var roleList = roleService.GetList();
List<UserDto> ls = new List<UserDto>();
PagingResult<UserInfo> userInfoPage;
PagingResult<UserInfo> userInfoPage=new PagingResult<UserInfo>();
using (var dbContext = DbFactory.GetContext)
{
userInfoPage = dbContext.Query<UserInfo>()
.LeftJoin<Role>(((userinfo, role) => userinfo.RoleId == role.ID))
.Select((userinfo, role) => new
{
UserInfo = userinfo,
Role = role
}).WhereIf(!string.IsNullOrEmpty(key), x => x.UserInfo.UserName.Contains(key))
.Where(x=>lsLevel.Contains(x.Role.RoleLevel))
.OrderBy(x => x.Role.RoleLevel)
.Select(x => x.UserInfo)
.Paging(pageIndex, pageSize);
//操作工
if (lsLevel.Count == 1)
{
userInfoPage = dbContext.Query<UserInfo>()
.LeftJoin<Role>(((userinfo, role) => userinfo.RoleId == role.ID))
.Select((userinfo, role) => new
{
UserInfo = userinfo,
Role = role
}).WhereIf(!string.IsNullOrEmpty(key), x => x.UserInfo.UserName.Contains(key))
.Where(x=>x.UserInfo.ID==userId)
.Where(x => x.Role.RoleLevel==1)
.OrderBy(x => x.Role.RoleLevel)
.Select(x => x.UserInfo)
.Paging(pageIndex, pageSize);
}
if (lsLevel.Count == 2)
{
userInfoPage = dbContext.Query<UserInfo>()
.LeftJoin<Role>(((userinfo, role) => userinfo.RoleId == role.ID))
.Select((userinfo, role) => new
{
UserInfo = userinfo,
Role = role
}).WhereIf(!string.IsNullOrEmpty(key), x => x.UserInfo.UserName.Contains(key))
.Where(x =>x.Role.RoleLevel==1)
.OrderBy(x => x.Role.RoleLevel)
.Select(x => x.UserInfo)
.Paging(pageIndex, pageSize);
}
if (lsLevel.Count == 3)
{
userInfoPage = dbContext.Query<UserInfo>()
.LeftJoin<Role>(((userinfo, role) => userinfo.RoleId == role.ID))
.Select((userinfo, role) => new
{
UserInfo = userinfo,
Role = role
}).WhereIf(!string.IsNullOrEmpty(key), x => x.UserInfo.UserName.Contains(key))
.Where(x => (x.Role.RoleLevel == 1) || (x.Role.RoleLevel == 2))
.OrderBy(x => x.Role.RoleLevel)
.Select(x => x.UserInfo)
.Paging(pageIndex, pageSize);
}
foreach (var userInfo in userInfoPage.DataList)
{
var first = roleList.First(x => x.ID == userInfo.RoleId);

@ -53,12 +53,12 @@ namespace HZH_Controls.Controls
this.txtMinute = new HZH_Controls.Controls.TextBoxEx();
this.label4 = new System.Windows.Forms.Label();
this.txtHour = new HZH_Controls.Controls.TextBoxEx();
this.label3 = new System.Windows.Forms.Label();
this.txtDay = new HZH_Controls.Controls.TextBoxEx();
this.label2 = new System.Windows.Forms.Label();
this.txtMonth = new HZH_Controls.Controls.TextBoxEx();
this.label1 = new System.Windows.Forms.Label();
this.txtYear = new HZH_Controls.Controls.TextBoxEx();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
@ -174,19 +174,6 @@ namespace HZH_Controls.Controls
this.txtHour.TextChanged += new System.EventHandler(this.txtHour_TextChanged);
this.txtHour.Leave += new System.EventHandler(this.txtHour_Leave);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Dock = System.Windows.Forms.DockStyle.Left;
this.label3.Font = new System.Drawing.Font("微软雅黑", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.label3.Location = new System.Drawing.Point(173, 0);
this.label3.Margin = new System.Windows.Forms.Padding(0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 27);
this.label3.TabIndex = 14;
this.label3.Text = " 日";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtDay
//
this.txtDay.BorderStyle = System.Windows.Forms.BorderStyle.None;
@ -221,19 +208,6 @@ namespace HZH_Controls.Controls
this.txtDay.TextChanged += new System.EventHandler(this.txtDay_TextChanged);
this.txtDay.Leave += new System.EventHandler(this.txtDay_Leave);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Dock = System.Windows.Forms.DockStyle.Left;
this.label2.Font = new System.Drawing.Font("微软雅黑", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.label2.Location = new System.Drawing.Point(112, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 27);
this.label2.TabIndex = 12;
this.label2.Text = "月";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtMonth
//
this.txtMonth.BorderStyle = System.Windows.Forms.BorderStyle.None;
@ -268,20 +242,6 @@ namespace HZH_Controls.Controls
this.txtMonth.TextChanged += new System.EventHandler(this.txtMonth_TextChanged);
this.txtMonth.Leave += new System.EventHandler(this.txtMonth_Leave);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Left;
this.label1.Font = new System.Drawing.Font("微软雅黑", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.label1.Location = new System.Drawing.Point(51, 0);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 27);
this.label1.TabIndex = 10;
this.label1.Text = "年";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtYear
//
this.txtYear.BorderStyle = System.Windows.Forms.BorderStyle.None;
@ -316,6 +276,46 @@ namespace HZH_Controls.Controls
this.txtYear.TextChanged += new System.EventHandler(this.txtYear_TextChanged);
this.txtYear.Leave += new System.EventHandler(this.txtYear_Leave);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Dock = System.Windows.Forms.DockStyle.Left;
this.label2.Font = new System.Drawing.Font("微软雅黑", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.label2.Location = new System.Drawing.Point(112, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 27);
this.label2.TabIndex = 12;
this.label2.Text = "月";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Left;
this.label1.Font = new System.Drawing.Font("微软雅黑", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.label1.Location = new System.Drawing.Point(51, 0);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 27);
this.label1.TabIndex = 10;
this.label1.Text = "年";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Dock = System.Windows.Forms.DockStyle.Left;
this.label3.Font = new System.Drawing.Font("微软雅黑", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.label3.Location = new System.Drawing.Point(173, 0);
this.label3.Margin = new System.Windows.Forms.Padding(0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 27);
this.label3.TabIndex = 14;
this.label3.Text = " 日";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// UCDatePickerExt
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -346,18 +346,6 @@ namespace HZH_Controls.Controls
/// </summary>
private System.Windows.Forms.Label label4;
/// <summary>
/// The label3
/// </summary>
private System.Windows.Forms.Label label3;
/// <summary>
/// The label2
/// </summary>
private System.Windows.Forms.Label label2;
/// <summary>
/// The label1
/// </summary>
private System.Windows.Forms.Label label1;
/// <summary>
/// The text minute
/// </summary>
private TextBoxEx txtMinute;
@ -381,5 +369,8 @@ namespace HZH_Controls.Controls
/// The label5
/// </summary>
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label3;
}
}

@ -50,6 +50,7 @@
this.labTime = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.btnBarCode = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.panel6.SuspendLayout();
this.panel7.SuspendLayout();
@ -111,6 +112,7 @@
// panel8
//
this.panel8.BackColor = System.Drawing.Color.Transparent;
this.panel8.Controls.Add(this.btnBarCode);
this.panel8.Controls.Add(this.buttonUpdateLog);
this.panel8.Controls.Add(this.hslLanternSimplePlc);
this.panel8.Controls.Add(this.button2);
@ -145,7 +147,7 @@
//
// hslLanternSimplePlc
//
this.hslLanternSimplePlc.Location = new System.Drawing.Point(22, 641);
this.hslLanternSimplePlc.Location = new System.Drawing.Point(162, 812);
this.hslLanternSimplePlc.Name = "hslLanternSimplePlc";
this.hslLanternSimplePlc.Size = new System.Drawing.Size(78, 94);
this.hslLanternSimplePlc.TabIndex = 10;
@ -164,6 +166,7 @@
this.button2.TabIndex = 9;
this.button2.Text = "扫码设置";
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
@ -178,6 +181,7 @@
this.button1.TabIndex = 8;
this.button1.Text = "打印设置";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// btnShow
//
@ -340,6 +344,21 @@
this.label1.TabIndex = 0;
this.label1.Text = "佳通RFID层合裁切设备";
//
// btnBarCode
//
this.btnBarCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173)))));
this.btnBarCode.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnBarCode.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBarCode.ForeColor = System.Drawing.SystemColors.Window;
this.btnBarCode.Location = new System.Drawing.Point(22, 595);
this.btnBarCode.Margin = new System.Windows.Forms.Padding(4);
this.btnBarCode.Name = "btnBarCode";
this.btnBarCode.Size = new System.Drawing.Size(300, 65);
this.btnBarCode.TabIndex = 12;
this.btnBarCode.Text = "收料条码";
this.btnBarCode.UseVisualStyleBackColor = false;
this.btnBarCode.Click += new System.EventHandler(this.btnBarCode_Click);
//
// FormMain
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -380,5 +399,6 @@
private System.Windows.Forms.Label labUser;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button buttonUpdateLog;
private System.Windows.Forms.Button btnBarCode;
}
}

@ -29,8 +29,8 @@ namespace RfidWeb
private ICache cache;
TimerX _timer;
List<Button> buttons=new List<Button>();
private ReadBufLogService readBufService = new ReadBufLogService();
public FormMain()
{
cache=Cache.Default;
@ -55,7 +55,9 @@ namespace RfidWeb
private void Init()
{
_timer = new TimerX(TimeState, null, 2000, 1000);
_timer.Async=true;
// 如果所有的日志在记录之前需要在控制台显示出来
logNet.BeforeSaveToFile += (object sender, HslEventArgs e) =>
{
@ -104,13 +106,15 @@ namespace RfidWeb
labUser.Text = $"{dto.UserName}({dto.RoleName})";
labUser.ForeColor = Color.FromArgb(21, 182, 173);
}
});
});
ThreadPoolX.QueueUserWorkItem(ShowLed);
ThreadPoolX.QueueUserWorkItem(UpdateLog);
ThreadPoolX.QueueUserWorkItem(ReadBufLog);
}
private UpdateLogService updateLogService = new UpdateLogService();
@ -124,7 +128,34 @@ namespace RfidWeb
hslLanternSimplePlc.LanternBackground = result ? Color.LimeGreen : Color.Red;
cache.Remove(CacheKeyManager.Home);
}
private void ReadBufLog()
{
if (cache.ContainsKey(CacheKeyManager.ReadBufLog)) return;
cache.Set(CacheKeyManager.ReadBufLog, DateTime.Now, TimeSpan.FromSeconds(10));
var barCodea = HmiPointInfo.GetBufA();
if (barCodea.Item1)
{
readBufService.Insert("A",barCodea.Item2);
}
var barCodeb = HmiPointInfo.GetBufB();
if (barCodeb.Item1)
{
readBufService.Insert("B", barCodeb.Item2);
}
var barCodec = HmiPointInfo.GetBufC();
if (barCodec.Item1)
{
readBufService.Insert("C", barCodec.Item2);
}
cache.Remove(CacheKeyManager.ReadBufLog);
}
/// <summary>
/// 参数变化
/// </summary>
@ -172,7 +203,7 @@ namespace RfidWeb
private void btnArgument_Click(object sender, EventArgs e)
{
//FormPar
CheckLogin();
var isLogin = UserManager.IsExit();
@ -180,7 +211,7 @@ namespace RfidWeb
{
panContent.Controls.Clear();
panContent.Controls.Add(new FormPar());
CheckButton(btnArgument);
}
}
@ -227,12 +258,9 @@ namespace RfidWeb
}
Color checkColor = System.Drawing.Color.FromArgb(168, 188, 195);
Color defaultColor = System.Drawing.Color.FromArgb(21, 181, 173);
private void CheckButton(Button btn)
{
foreach (var bt in buttons)
@ -259,11 +287,12 @@ namespace RfidWeb
{
if (labUser.Text != "未登录(未授权)")
{
if (FrmDialog.ShowDialog(this, "退出登录", "提示窗体", true)
== System.Windows.Forms.DialogResult.OK)
FromEn fromEn = new FromEn();
fromEn.StartPosition = FormStartPosition.CenterScreen; // 设置窗口显示在屏幕中央
fromEn.ShowDialog();
if (!UserManager.IsExit())
{
cache.Remove(CacheKeyManager.HmiUser);
PlcConnect.Instance.Write(HmiPointInfo.Safety_level, int.Parse("0"));
btnShow_Click(new object(), EventArgs.Empty);
}
}
@ -293,5 +322,31 @@ namespace RfidWeb
CheckButton(btnMes);
}
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("开发中");
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("开发中");
}
private void btnBarCode_Click(object sender, EventArgs e)
{
panContent.Controls.Clear();
panContent.Controls.Add(new FrmBarCodeGridView());
CheckButton(btnBarCode);
// CheckLogin();
//var isLogin = UserManager.IsExit();
//if (isLogin)
//{
//}
}
}
}

@ -52,17 +52,17 @@ namespace RfidWeb.Frm
switch (OlduserDto.RoleLevel)
{
case 1:
lsInts.AddRange(new[] { 1, 2, 3 });
lsInts.AddRange(new[] { 1 });
break;
case 2:
lsInts.AddRange(new[] { 2, 3 });
lsInts.AddRange(new[] {1,2 });
break;
case 3:
lsInts.Add(3);
lsInts.AddRange(new[] { 1, 2, 3 });
break;
}
}
var page = userService.GetPagedList(index, ucPagerControl21.PageSize, key,lsInts);
var page = userService.GetPagedList(index, ucPagerControl21.PageSize, key,lsInts, OlduserDto.Id);
ucPagerControl21.PageCount = page.TotalPages;
this.dataGridView1.DataSource = page.Items;
}
@ -84,8 +84,17 @@ namespace RfidWeb.Frm
}
else
{
if (user.RoleLevel == 1)
{
MessageBox.Show("无法添加新用户");
return;
}
FormLogin fromLogin=new FormLogin();
fromLogin.ShowDialog();
Replace();
}
}

@ -46,11 +46,11 @@
this.panel3 = new System.Windows.Forms.Panel();
this.button4 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.panel4 = new System.Windows.Forms.Panel();
this.panel7 = new System.Windows.Forms.Panel();
this.button2 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.button7 = new System.Windows.Forms.Button();
@ -364,7 +364,6 @@
this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(243)))), ((int)(((byte)(248)))));
this.panel3.Controls.Add(this.button4);
this.panel3.Controls.Add(this.button3);
this.panel3.Controls.Add(this.button2);
this.panel3.Controls.Add(this.button1);
this.panel3.Controls.Add(this.label5);
this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
@ -377,9 +376,9 @@
// button4
//
this.button4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(202)))), ((int)(((byte)(188)))));
this.button4.Location = new System.Drawing.Point(624, 28);
this.button4.Location = new System.Drawing.Point(551, 28);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(165, 60);
this.button4.Size = new System.Drawing.Size(187, 60);
this.button4.TabIndex = 15;
this.button4.Text = "裁刀2屏蔽门";
this.button4.UseVisualStyleBackColor = false;
@ -387,23 +386,13 @@
// button3
//
this.button3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(202)))), ((int)(((byte)(188)))));
this.button3.Location = new System.Drawing.Point(436, 28);
this.button3.Location = new System.Drawing.Point(298, 28);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(165, 60);
this.button3.Size = new System.Drawing.Size(178, 60);
this.button3.TabIndex = 14;
this.button3.Text = "裁刀1屏蔽门";
this.button3.UseVisualStyleBackColor = false;
//
// button2
//
this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(202)))), ((int)(((byte)(188)))));
this.button2.Location = new System.Drawing.Point(215, 28);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(165, 60);
this.button2.TabIndex = 13;
this.button2.Text = "安全门启动";
this.button2.UseVisualStyleBackColor = false;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(202)))), ((int)(((byte)(188)))));
@ -439,6 +428,7 @@
//
// panel7
//
this.panel7.Controls.Add(this.button2);
this.panel7.Controls.Add(this.button6);
this.panel7.Controls.Add(this.button5);
this.panel7.Controls.Add(this.button7);
@ -448,33 +438,46 @@
this.panel7.Size = new System.Drawing.Size(910, 139);
this.panel7.TabIndex = 3;
//
// button2
//
this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(202)))), ((int)(((byte)(188)))));
this.button2.Location = new System.Drawing.Point(434, 16);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(211, 60);
this.button2.TabIndex = 59;
this.button2.Text = "毛毡带到达使用上限清除计数按钮";
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button6
//
this.button6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(202)))), ((int)(((byte)(188)))));
this.button6.Location = new System.Drawing.Point(7, 12);
this.button6.Location = new System.Drawing.Point(7, 16);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(165, 60);
this.button6.Size = new System.Drawing.Size(211, 60);
this.button6.TabIndex = 16;
this.button6.Text = "清除";
this.button6.Text = "切刀1到达使用上限清除计数按钮";
this.button6.UseVisualStyleBackColor = false;
this.button6.Click += new System.EventHandler(this.button6_Click);
//
// button5
//
this.button5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(202)))), ((int)(((byte)(188)))));
this.button5.Location = new System.Drawing.Point(215, 12);
this.button5.Location = new System.Drawing.Point(224, 16);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(165, 60);
this.button5.Size = new System.Drawing.Size(204, 60);
this.button5.TabIndex = 15;
this.button5.Text = "清除";
this.button5.Text = "切刀2到达使用上限清除计数按钮";
this.button5.UseVisualStyleBackColor = false;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// button7
//
this.button7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(202)))), ((int)(((byte)(188)))));
this.button7.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button7.Location = new System.Drawing.Point(589, 12);
this.button7.Location = new System.Drawing.Point(691, 16);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(251, 51);
this.button7.Size = new System.Drawing.Size(212, 60);
this.button7.TabIndex = 58;
this.button7.Text = "保存参数";
this.button7.UseVisualStyleBackColor = false;
@ -1178,7 +1181,6 @@
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.Panel panel6;
@ -1217,5 +1219,6 @@
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button2;
}
}

@ -275,5 +275,28 @@ namespace RfidWeb.Frm
MessageBox.Show("保存成功");
}
private void button6_Click(object sender, EventArgs e)
{
WriteTrue(HmiPointInfo.CQ_QD1_counter_reset);
MessageBox.Show("清除成功");
}
private void WriteTrue(string address)
{
PlcConnect.Instance.Write(address, true);
}
private void button5_Click(object sender, EventArgs e)
{
WriteTrue(HmiPointInfo.CQ_QD2_counter_reset);
MessageBox.Show("清除成功");
}
private void button2_Click(object sender, EventArgs e)
{
WriteTrue(HmiPointInfo.CQ_MZD_counter_reset);
MessageBox.Show("清除成功");
}
}
}

@ -0,0 +1,378 @@
namespace RfidWeb.Frm
{
partial class FromEn
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblTitle = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnOK = new HZH_Controls.Controls.UCBtnExt();
this.btnCancel = new HZH_Controls.Controls.UCBtnExt();
this.ucBtnExt1 = new HZH_Controls.Controls.UCBtnExt();
this.ucBtnExit = new HZH_Controls.Controls.UCBtnExt();
this.label5 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.ucCombox1 = new HZH_Controls.Controls.UCCombox();
this.ucTextBoxPwd = new HZH_Controls.Controls.UCTextBoxEx();
this.ucTextBoxUser = new HZH_Controls.Controls.UCTextBoxEx();
this.tableLayoutPanel1.SuspendLayout();
this.btnCancel.SuspendLayout();
this.SuspendLayout();
//
// lblTitle
//
this.lblTitle.BackColor = System.Drawing.Color.Transparent;
this.lblTitle.Dock = System.Windows.Forms.DockStyle.Top;
this.lblTitle.Font = new System.Drawing.Font("微软雅黑", 17F);
this.lblTitle.Location = new System.Drawing.Point(0, 0);
this.lblTitle.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Size = new System.Drawing.Size(557, 40);
this.lblTitle.TabIndex = 7;
this.lblTitle.Text = "个人中心";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 193F));
this.tableLayoutPanel1.Controls.Add(this.ucBtnExit, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.btnCancel, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.btnOK, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 306);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 67F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(557, 67);
this.tableLayoutPanel1.TabIndex = 8;
//
// btnOK
//
this.btnOK.BackColor = System.Drawing.Color.Transparent;
this.btnOK.BtnBackColor = System.Drawing.Color.Transparent;
this.btnOK.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOK.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(85)))), ((int)(((byte)(51)))));
this.btnOK.BtnText = "确定";
this.btnOK.ConerRadius = 5;
this.btnOK.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnOK.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnOK.EnabledMouseEffect = false;
this.btnOK.FillColor = System.Drawing.SystemColors.Control;
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.btnOK.IsRadius = false;
this.btnOK.IsShowRect = false;
this.btnOK.IsShowTips = false;
this.btnOK.Location = new System.Drawing.Point(0, 0);
this.btnOK.Margin = new System.Windows.Forms.Padding(0);
this.btnOK.Name = "btnOK";
this.btnOK.RectColor = System.Drawing.SystemColors.Control;
this.btnOK.RectWidth = 1;
this.btnOK.Size = new System.Drawing.Size(182, 67);
this.btnOK.TabIndex = 1;
this.btnOK.TabStop = false;
this.btnOK.TipsColor = System.Drawing.SystemColors.Control;
this.btnOK.TipsText = "";
this.btnOK.BtnClick += new System.EventHandler(this.btnOK_BtnClick);
//
// btnCancel
//
this.btnCancel.BackColor = System.Drawing.Color.Transparent;
this.btnCancel.BtnBackColor = System.Drawing.Color.Transparent;
this.btnCancel.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(119)))), ((int)(((byte)(232)))));
this.btnCancel.BtnText = "取消";
this.btnCancel.ConerRadius = 5;
this.btnCancel.Controls.Add(this.ucBtnExt1);
this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCancel.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnCancel.EnabledMouseEffect = false;
this.btnCancel.FillColor = System.Drawing.SystemColors.Control;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.btnCancel.IsRadius = false;
this.btnCancel.IsShowRect = false;
this.btnCancel.IsShowTips = false;
this.btnCancel.Location = new System.Drawing.Point(182, 0);
this.btnCancel.Margin = new System.Windows.Forms.Padding(0);
this.btnCancel.Name = "btnCancel";
this.btnCancel.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247)))));
this.btnCancel.RectWidth = 1;
this.btnCancel.Size = new System.Drawing.Size(182, 67);
this.btnCancel.TabIndex = 3;
this.btnCancel.TabStop = false;
this.btnCancel.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(30)))), ((int)(((byte)(99)))));
this.btnCancel.TipsText = "";
//
// ucBtnExt1
//
this.ucBtnExt1.BackColor = System.Drawing.Color.Transparent;
this.ucBtnExt1.BtnBackColor = System.Drawing.Color.Transparent;
this.ucBtnExt1.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucBtnExt1.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(119)))), ((int)(((byte)(232)))));
this.ucBtnExt1.BtnText = "取消";
this.ucBtnExt1.ConerRadius = 5;
this.ucBtnExt1.Cursor = System.Windows.Forms.Cursors.Hand;
this.ucBtnExt1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucBtnExt1.EnabledMouseEffect = false;
this.ucBtnExt1.FillColor = System.Drawing.SystemColors.Control;
this.ucBtnExt1.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucBtnExt1.IsRadius = false;
this.ucBtnExt1.IsShowRect = false;
this.ucBtnExt1.IsShowTips = false;
this.ucBtnExt1.Location = new System.Drawing.Point(0, 0);
this.ucBtnExt1.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnExt1.Name = "ucBtnExt1";
this.ucBtnExt1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247)))));
this.ucBtnExt1.RectWidth = 1;
this.ucBtnExt1.Size = new System.Drawing.Size(182, 67);
this.ucBtnExt1.TabIndex = 4;
this.ucBtnExt1.TabStop = false;
this.ucBtnExt1.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(30)))), ((int)(((byte)(99)))));
this.ucBtnExt1.TipsText = "";
this.ucBtnExt1.BtnClick += new System.EventHandler(this.ucBtnExt1_BtnClick);
//
// ucBtnExit
//
this.ucBtnExit.BackColor = System.Drawing.Color.Transparent;
this.ucBtnExit.BtnBackColor = System.Drawing.Color.Transparent;
this.ucBtnExit.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucBtnExit.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(119)))), ((int)(((byte)(232)))));
this.ucBtnExit.BtnText = "退出登录";
this.ucBtnExit.ConerRadius = 5;
this.ucBtnExit.Cursor = System.Windows.Forms.Cursors.Hand;
this.ucBtnExit.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucBtnExit.EnabledMouseEffect = false;
this.ucBtnExit.FillColor = System.Drawing.SystemColors.Control;
this.ucBtnExit.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucBtnExit.IsRadius = false;
this.ucBtnExit.IsShowRect = false;
this.ucBtnExit.IsShowTips = false;
this.ucBtnExit.Location = new System.Drawing.Point(364, 0);
this.ucBtnExit.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnExit.Name = "ucBtnExit";
this.ucBtnExit.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247)))));
this.ucBtnExit.RectWidth = 1;
this.ucBtnExit.Size = new System.Drawing.Size(193, 67);
this.ucBtnExit.TabIndex = 5;
this.ucBtnExit.TabStop = false;
this.ucBtnExit.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(30)))), ((int)(((byte)(99)))));
this.ucBtnExit.TipsText = "";
this.ucBtnExit.BtnClick += new System.EventHandler(this.ucBtnExit_BtnClick);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("微软雅黑", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(113, 194);
this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(69, 30);
this.label5.TabIndex = 18;
this.label5.Text = "级 别:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("微软雅黑", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(113, 138);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(69, 30);
this.label2.TabIndex = 17;
this.label2.Text = "密 码:";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("微软雅黑", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(113, 88);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(84, 30);
this.label1.TabIndex = 16;
this.label1.Text = "用户名:";
//
// ucCombox1
//
this.ucCombox1.BackColor = System.Drawing.Color.Transparent;
this.ucCombox1.BackColorExt = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.ucCombox1.BoxStyle = System.Windows.Forms.ComboBoxStyle.DropDown;
this.ucCombox1.ConerRadius = 5;
this.ucCombox1.DropPanelHeight = -1;
this.ucCombox1.FillColor = System.Drawing.Color.White;
this.ucCombox1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.ucCombox1.IsRadius = true;
this.ucCombox1.IsShowRect = true;
this.ucCombox1.ItemHeight = 35;
this.ucCombox1.ItemWidth = 70;
this.ucCombox1.Location = new System.Drawing.Point(215, 196);
this.ucCombox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ucCombox1.Name = "ucCombox1";
this.ucCombox1.Padding = new System.Windows.Forms.Padding(1);
this.ucCombox1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.ucCombox1.RectWidth = 1;
this.ucCombox1.SelectedIndex = -1;
this.ucCombox1.SelectedValue = "";
this.ucCombox1.SelectItemColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ucCombox1.SelectItemForeColor = System.Drawing.Color.White;
this.ucCombox1.Size = new System.Drawing.Size(215, 29);
this.ucCombox1.Source = null;
this.ucCombox1.TabIndex = 15;
this.ucCombox1.TextValue = null;
this.ucCombox1.TriangleColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
//
// ucTextBoxPwd
//
this.ucTextBoxPwd.BackColor = System.Drawing.Color.Transparent;
this.ucTextBoxPwd.ConerRadius = 5;
this.ucTextBoxPwd.Cursor = System.Windows.Forms.Cursors.IBeam;
this.ucTextBoxPwd.DecLength = 2;
this.ucTextBoxPwd.FillColor = System.Drawing.Color.Empty;
this.ucTextBoxPwd.FocusBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucTextBoxPwd.Font = new System.Drawing.Font("微软雅黑", 12F);
this.ucTextBoxPwd.InputText = "";
this.ucTextBoxPwd.InputType = HZH_Controls.TextInputType.NotControl;
this.ucTextBoxPwd.IsFocusColor = true;
this.ucTextBoxPwd.IsFouceShowKey = false;
this.ucTextBoxPwd.IsRadius = true;
this.ucTextBoxPwd.IsShowClearBtn = true;
this.ucTextBoxPwd.IsShowKeyboard = false;
this.ucTextBoxPwd.IsShowRect = true;
this.ucTextBoxPwd.IsShowSearchBtn = false;
this.ucTextBoxPwd.KeyBoardType = HZH_Controls.Controls.KeyBoardType.UCKeyBorderAll_EN;
this.ucTextBoxPwd.Location = new System.Drawing.Point(215, 138);
this.ucTextBoxPwd.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ucTextBoxPwd.MaxValue = new decimal(new int[] {
1000000,
0,
0,
0});
this.ucTextBoxPwd.MinValue = new decimal(new int[] {
1000000,
0,
0,
-2147483648});
this.ucTextBoxPwd.Name = "ucTextBoxPwd";
this.ucTextBoxPwd.Padding = new System.Windows.Forms.Padding(3);
this.ucTextBoxPwd.PasswordChar = '*';
this.ucTextBoxPwd.PromptColor = System.Drawing.Color.Gray;
this.ucTextBoxPwd.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucTextBoxPwd.PromptText = "";
this.ucTextBoxPwd.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.ucTextBoxPwd.RectWidth = 1;
this.ucTextBoxPwd.RegexPattern = "";
this.ucTextBoxPwd.Size = new System.Drawing.Size(215, 28);
this.ucTextBoxPwd.TabIndex = 14;
this.ucTextBoxPwd.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
//
// ucTextBoxUser
//
this.ucTextBoxUser.BackColor = System.Drawing.Color.Transparent;
this.ucTextBoxUser.ConerRadius = 5;
this.ucTextBoxUser.Cursor = System.Windows.Forms.Cursors.IBeam;
this.ucTextBoxUser.DecLength = 2;
this.ucTextBoxUser.FillColor = System.Drawing.Color.Empty;
this.ucTextBoxUser.FocusBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucTextBoxUser.Font = new System.Drawing.Font("微软雅黑", 12F);
this.ucTextBoxUser.InputText = "";
this.ucTextBoxUser.InputType = HZH_Controls.TextInputType.NotControl;
this.ucTextBoxUser.IsFocusColor = true;
this.ucTextBoxUser.IsFouceShowKey = false;
this.ucTextBoxUser.IsRadius = true;
this.ucTextBoxUser.IsShowClearBtn = true;
this.ucTextBoxUser.IsShowKeyboard = false;
this.ucTextBoxUser.IsShowRect = true;
this.ucTextBoxUser.IsShowSearchBtn = false;
this.ucTextBoxUser.KeyBoardType = HZH_Controls.Controls.KeyBoardType.UCKeyBorderAll_EN;
this.ucTextBoxUser.Location = new System.Drawing.Point(215, 88);
this.ucTextBoxUser.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ucTextBoxUser.MaxValue = new decimal(new int[] {
1000000,
0,
0,
0});
this.ucTextBoxUser.MinValue = new decimal(new int[] {
1000000,
0,
0,
-2147483648});
this.ucTextBoxUser.Name = "ucTextBoxUser";
this.ucTextBoxUser.Padding = new System.Windows.Forms.Padding(3);
this.ucTextBoxUser.PasswordChar = '\0';
this.ucTextBoxUser.PromptColor = System.Drawing.Color.Gray;
this.ucTextBoxUser.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucTextBoxUser.PromptText = "";
this.ucTextBoxUser.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.ucTextBoxUser.RectWidth = 1;
this.ucTextBoxUser.RegexPattern = "";
this.ucTextBoxUser.Size = new System.Drawing.Size(215, 28);
this.ucTextBoxUser.TabIndex = 13;
this.ucTextBoxUser.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
//
// FromEn
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(557, 373);
this.Controls.Add(this.label5);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.ucCombox1);
this.Controls.Add(this.ucTextBoxPwd);
this.Controls.Add(this.ucTextBoxUser);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.lblTitle);
this.Name = "FromEn";
this.Text = "个人中心";
this.tableLayoutPanel1.ResumeLayout(false);
this.btnCancel.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblTitle;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private HZH_Controls.Controls.UCBtnExt ucBtnExit;
private HZH_Controls.Controls.UCBtnExt btnCancel;
private HZH_Controls.Controls.UCBtnExt ucBtnExt1;
private HZH_Controls.Controls.UCBtnExt btnOK;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private HZH_Controls.Controls.UCCombox ucCombox1;
private HZH_Controls.Controls.UCTextBoxEx ucTextBoxPwd;
private HZH_Controls.Controls.UCTextBoxEx ucTextBoxUser;
}
}

@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NewLife.Caching;
using Tool.Model;
using Tool;
using DB.Dto;
using DB.Service;
using NewLife;
using System.Security.Cryptography;
namespace RfidWeb.Frm
{
public partial class FromEn : Form
{
private readonly string Kes = CacheKeyManager.AesPwd;
private RoleService roleService = new RoleService();
private UserService userService = new UserService();
private long id = 0;
private UserDto OlduserDto;
public FromEn()
{
InitializeComponent();
OlduserDto = UserManager.GetUser();
id=OlduserDto.Id;
FillCbo();
var info = userService.Query(id);
this.ucTextBoxUser.InputText = info.UserName;
this.ucTextBoxPwd.InputText = Aes.Create().Decrypt(info.Pwd.ToBase64(), Kes.GetBytes()).ToStr();
ucCombox1.SelectedValue = info.RoleId.ToString();
ucCombox1.Enabled = false;
ucTextBoxUser.Enabled = false;
}
public void FillCbo()
{
var list = roleService.GetList();
var level = OlduserDto.RoleLevel;
if (level == 1)
{
list = list.Where(x => x.RoleLevel == 1).ToList();
}
if (level == 2)
{
list = list.Where(x => x.RoleLevel == 1 || x.RoleLevel == 2).ToList();
}
List<KeyValuePair<string, string>> key = new List<KeyValuePair<string, string>>();
foreach (var role in list)
{
key.Add(new KeyValuePair<string, string>(role.ID.ToString(), role.RoleName));
}
ucCombox1.Source = key;
ucCombox1.SelectedIndex = 0;
}
private void ucBtnExt1_BtnClick(object sender, EventArgs e)
{
this.Close();
}
private void ucBtnExit_BtnClick(object sender, EventArgs e)
{
Cache.Default.Remove(CacheKeyManager.HmiUser);
PlcConnect.Instance.Write(HmiPointInfo.Safety_level, int.Parse("0"));
this.Close();
}
private void btnOK_BtnClick(object sender, EventArgs e)
{
var info = userService.Query(id);
info.LastModifyDate=DateTime.Now;
info.Pwd = Aes.Create().Encrypt(ucTextBoxPwd.InputText.GetBytes(), Kes.GetBytes()).ToBase64();
userService.Update(info);
this.Close();
}
}
}

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

@ -33,10 +33,10 @@
this.btnCancel = new HZH_Controls.Controls.UCBtnExt();
this.btnOK = new HZH_Controls.Controls.UCBtnExt();
this.panel1 = new System.Windows.Forms.Panel();
this.ucNo = new HZH_Controls.Controls.UCTextBoxEx();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.ucCode = new HZH_Controls.Controls.UCTextBoxEx();
this.ucNo = new HZH_Controls.Controls.UCTextBoxEx();
this.tableLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
@ -140,6 +140,50 @@
this.panel1.Size = new System.Drawing.Size(541, 252);
this.panel1.TabIndex = 9;
//
// ucNo
//
this.ucNo.BackColor = System.Drawing.Color.Transparent;
this.ucNo.ConerRadius = 5;
this.ucNo.Cursor = System.Windows.Forms.Cursors.IBeam;
this.ucNo.DecLength = 2;
this.ucNo.FillColor = System.Drawing.Color.Empty;
this.ucNo.FocusBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucNo.Font = new System.Drawing.Font("微软雅黑", 12F);
this.ucNo.InputText = "";
this.ucNo.InputType = HZH_Controls.TextInputType.NotControl;
this.ucNo.IsFocusColor = true;
this.ucNo.IsFouceShowKey = false;
this.ucNo.IsRadius = true;
this.ucNo.IsShowClearBtn = true;
this.ucNo.IsShowKeyboard = false;
this.ucNo.IsShowRect = true;
this.ucNo.IsShowSearchBtn = false;
this.ucNo.KeyBoardType = HZH_Controls.Controls.KeyBoardType.UCKeyBorderAll_EN;
this.ucNo.Location = new System.Drawing.Point(235, 91);
this.ucNo.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ucNo.MaxValue = new decimal(new int[] {
1000000,
0,
0,
0});
this.ucNo.MinValue = new decimal(new int[] {
1000000,
0,
0,
-2147483648});
this.ucNo.Name = "ucNo";
this.ucNo.Padding = new System.Windows.Forms.Padding(3);
this.ucNo.PasswordChar = '\0';
this.ucNo.PromptColor = System.Drawing.Color.Gray;
this.ucNo.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucNo.PromptText = "";
this.ucNo.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.ucNo.RectWidth = 1;
this.ucNo.RegexPattern = "";
this.ucNo.Size = new System.Drawing.Size(215, 28);
this.ucNo.TabIndex = 10;
this.ucNo.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
//
// label2
//
this.label2.AutoSize = true;
@ -206,50 +250,6 @@
this.ucCode.TabIndex = 5;
this.ucCode.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
//
// ucNo
//
this.ucNo.BackColor = System.Drawing.Color.Transparent;
this.ucNo.ConerRadius = 5;
this.ucNo.Cursor = System.Windows.Forms.Cursors.IBeam;
this.ucNo.DecLength = 2;
this.ucNo.FillColor = System.Drawing.Color.Empty;
this.ucNo.FocusBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucNo.Font = new System.Drawing.Font("微软雅黑", 12F);
this.ucNo.InputText = "";
this.ucNo.InputType = HZH_Controls.TextInputType.NotControl;
this.ucNo.IsFocusColor = true;
this.ucNo.IsFouceShowKey = false;
this.ucNo.IsRadius = true;
this.ucNo.IsShowClearBtn = true;
this.ucNo.IsShowKeyboard = false;
this.ucNo.IsShowRect = true;
this.ucNo.IsShowSearchBtn = false;
this.ucNo.KeyBoardType = HZH_Controls.Controls.KeyBoardType.UCKeyBorderAll_EN;
this.ucNo.Location = new System.Drawing.Point(235, 91);
this.ucNo.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ucNo.MaxValue = new decimal(new int[] {
1000000,
0,
0,
0});
this.ucNo.MinValue = new decimal(new int[] {
1000000,
0,
0,
-2147483648});
this.ucNo.Name = "ucNo";
this.ucNo.Padding = new System.Windows.Forms.Padding(3);
this.ucNo.PasswordChar = '\0';
this.ucNo.PromptColor = System.Drawing.Color.Gray;
this.ucNo.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucNo.PromptText = "";
this.ucNo.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.ucNo.RectWidth = 1;
this.ucNo.RegexPattern = "";
this.ucNo.Size = new System.Drawing.Size(215, 28);
this.ucNo.TabIndex = 10;
this.ucNo.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
//
// FormPlanAdd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -259,7 +259,7 @@
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.lblTitle);
this.Name = "FormPlanAdd";
this.Text = "FormPlanAdd";
this.Text = "计划管理";
this.tableLayoutPanel1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();

@ -63,7 +63,7 @@ namespace RfidWeb.Frm
fromPlan.Num = code;
fromPlan.Code=ucCode.InputText.ToString();
if (IsValidNumber(ucNo.InputText))
if (!IsValidNumber(ucNo.InputText))
{
MessageBox.Show("请输入0-2000 有效范围");
return;

@ -31,18 +31,30 @@ namespace RfidWeb.Frm
InitializeComponent();
OlduserDto = UserManager.GetUser();
label3.Text = "";
label4.Text = "";
FillCbo();
ucCombox1.SelectedIndex = 0;
}
public void FillCbo()
{
var list = roleService.GetList();
var level = OlduserDto.RoleLevel;
if (level == 1)
{
list = list.Where(x => x.RoleLevel == 1).ToList();
}
if (level == 2)
{
list = list.Where(x => x.RoleLevel == 1 || x.RoleLevel == 2).ToList();
}
List<KeyValuePair<string, string>> key = new List<KeyValuePair<string, string>>();
foreach (var role in list)
{
@ -50,11 +62,14 @@ namespace RfidWeb.Frm
}
ucCombox1.Source = key;
ucCombox1.SelectedIndex = 0;
}
public FormRegister(UserDto userDto):this()
{
this.OlduserDto = userDto;
}
public FormRegister(long id,UserDto userDto)

@ -0,0 +1,295 @@
namespace RfidWeb.Frm
{
partial class FrmBarCodeGridView
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmBarCodeGridView));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.panel1 = new System.Windows.Forms.Panel();
this.panelTop = new System.Windows.Forms.Panel();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.ucPagerControl21 = new HZH_Controls.Controls.UCPagerControl2();
this.ucBtnExt1 = new HZH_Controls.Controls.UCBtnExt();
this.ucDatePickerExt2 = new HZH_Controls.Controls.UCDatePickerExt();
this.ucDatePickerExt1 = new HZH_Controls.Controls.UCDatePickerExt();
this.ucBtnSelect = new HZH_Controls.Controls.UCBtnExt();
this.ucHorizontalList1 = new HZH_Controls.Controls.UCHorizontalList();
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.CreateTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel1.SuspendLayout();
this.panelTop.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.ucHorizontalList1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(910, 47);
this.panel1.TabIndex = 1;
//
// panelTop
//
this.panelTop.Controls.Add(this.ucBtnExt1);
this.panelTop.Controls.Add(this.ucDatePickerExt2);
this.panelTop.Controls.Add(this.ucDatePickerExt1);
this.panelTop.Controls.Add(this.ucBtnSelect);
this.panelTop.Dock = System.Windows.Forms.DockStyle.Top;
this.panelTop.Location = new System.Drawing.Point(0, 47);
this.panelTop.Name = "panelTop";
this.panelTop.Size = new System.Drawing.Size(910, 108);
this.panelTop.TabIndex = 2;
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ID,
this.BarCode,
this.CreateTime});
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle3;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.Location = new System.Drawing.Point(0, 155);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(910, 739);
this.dataGridView1.TabIndex = 4;
//
// ucPagerControl21
//
this.ucPagerControl21.BackColor = System.Drawing.Color.White;
this.ucPagerControl21.DataSource = ((System.Collections.Generic.List<object>)(resources.GetObject("ucPagerControl21.DataSource")));
this.ucPagerControl21.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ucPagerControl21.Location = new System.Drawing.Point(0, 894);
this.ucPagerControl21.Name = "ucPagerControl21";
this.ucPagerControl21.PageCount = 0;
this.ucPagerControl21.PageIndex = 1;
this.ucPagerControl21.PageModel = HZH_Controls.Controls.PageModel.Soure;
this.ucPagerControl21.PageSize = 10;
this.ucPagerControl21.Size = new System.Drawing.Size(910, 41);
this.ucPagerControl21.StartIndex = 1;
this.ucPagerControl21.TabIndex = 3;
this.ucPagerControl21.ShowSourceChanged += new HZH_Controls.Controls.PageControlEventHandler(this.ucPagerControl21_ShowSourceChanged);
//
// ucBtnExt1
//
this.ucBtnExt1.BackColor = System.Drawing.Color.White;
this.ucBtnExt1.BtnBackColor = System.Drawing.Color.White;
this.ucBtnExt1.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucBtnExt1.BtnForeColor = System.Drawing.Color.White;
this.ucBtnExt1.BtnText = "导出";
this.ucBtnExt1.ConerRadius = 5;
this.ucBtnExt1.Cursor = System.Windows.Forms.Cursors.Hand;
this.ucBtnExt1.EnabledMouseEffect = false;
this.ucBtnExt1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(101)))), ((int)(((byte)(204)))));
this.ucBtnExt1.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucBtnExt1.IsRadius = true;
this.ucBtnExt1.IsShowRect = true;
this.ucBtnExt1.IsShowTips = false;
this.ucBtnExt1.Location = new System.Drawing.Point(440, 64);
this.ucBtnExt1.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnExt1.Name = "ucBtnExt1";
this.ucBtnExt1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(83)))), ((int)(((byte)(171)))));
this.ucBtnExt1.RectWidth = 1;
this.ucBtnExt1.Size = new System.Drawing.Size(121, 39);
this.ucBtnExt1.TabIndex = 5;
this.ucBtnExt1.TabStop = false;
this.ucBtnExt1.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(101)))), ((int)(((byte)(204)))));
this.ucBtnExt1.TipsText = "";
//
// ucDatePickerExt2
//
this.ucDatePickerExt2.BackColor = System.Drawing.Color.Transparent;
this.ucDatePickerExt2.ConerRadius = 5;
this.ucDatePickerExt2.CurrentTime = new System.DateTime(2024, 11, 22, 0, 54, 0, 0);
this.ucDatePickerExt2.FillColor = System.Drawing.Color.White;
this.ucDatePickerExt2.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucDatePickerExt2.IsRadius = true;
this.ucDatePickerExt2.IsShowRect = true;
this.ucDatePickerExt2.Location = new System.Drawing.Point(4, 64);
this.ucDatePickerExt2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ucDatePickerExt2.Name = "ucDatePickerExt2";
this.ucDatePickerExt2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 0);
this.ucDatePickerExt2.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.ucDatePickerExt2.RectWidth = 1;
this.ucDatePickerExt2.Size = new System.Drawing.Size(337, 39);
this.ucDatePickerExt2.TabIndex = 4;
this.ucDatePickerExt2.TimeFontSize = 20;
this.ucDatePickerExt2.TimeType = HZH_Controls.Controls.DateTimePickerType.DateTime;
//
// ucDatePickerExt1
//
this.ucDatePickerExt1.BackColor = System.Drawing.Color.Transparent;
this.ucDatePickerExt1.ConerRadius = 5;
this.ucDatePickerExt1.CurrentTime = new System.DateTime(2024, 11, 21, 10, 54, 13, 0);
this.ucDatePickerExt1.FillColor = System.Drawing.Color.White;
this.ucDatePickerExt1.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucDatePickerExt1.IsRadius = true;
this.ucDatePickerExt1.IsShowRect = true;
this.ucDatePickerExt1.Location = new System.Drawing.Point(4, 18);
this.ucDatePickerExt1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ucDatePickerExt1.Name = "ucDatePickerExt1";
this.ucDatePickerExt1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 0);
this.ucDatePickerExt1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.ucDatePickerExt1.RectWidth = 1;
this.ucDatePickerExt1.Size = new System.Drawing.Size(335, 39);
this.ucDatePickerExt1.TabIndex = 3;
this.ucDatePickerExt1.TimeFontSize = 20;
this.ucDatePickerExt1.TimeType = HZH_Controls.Controls.DateTimePickerType.DateTime;
//
// ucBtnSelect
//
this.ucBtnSelect.BackColor = System.Drawing.Color.White;
this.ucBtnSelect.BtnBackColor = System.Drawing.Color.White;
this.ucBtnSelect.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucBtnSelect.BtnForeColor = System.Drawing.Color.White;
this.ucBtnSelect.BtnText = "查询";
this.ucBtnSelect.ConerRadius = 5;
this.ucBtnSelect.Cursor = System.Windows.Forms.Cursors.Hand;
this.ucBtnSelect.EnabledMouseEffect = false;
this.ucBtnSelect.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(101)))), ((int)(((byte)(204)))));
this.ucBtnSelect.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucBtnSelect.IsRadius = true;
this.ucBtnSelect.IsShowRect = true;
this.ucBtnSelect.IsShowTips = false;
this.ucBtnSelect.Location = new System.Drawing.Point(440, 18);
this.ucBtnSelect.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnSelect.Name = "ucBtnSelect";
this.ucBtnSelect.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(83)))), ((int)(((byte)(171)))));
this.ucBtnSelect.RectWidth = 1;
this.ucBtnSelect.Size = new System.Drawing.Size(121, 39);
this.ucBtnSelect.TabIndex = 2;
this.ucBtnSelect.TabStop = false;
this.ucBtnSelect.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(101)))), ((int)(((byte)(204)))));
this.ucBtnSelect.TipsText = "";
this.ucBtnSelect.BtnClick += new System.EventHandler(this.ucBtnSelect_BtnClick);
//
// ucHorizontalList1
//
this.ucHorizontalList1.DataSource = null;
this.ucHorizontalList1.Font = new System.Drawing.Font("宋体", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucHorizontalList1.IsAutoSelectFirst = true;
this.ucHorizontalList1.Location = new System.Drawing.Point(3, 3);
this.ucHorizontalList1.Name = "ucHorizontalList1";
this.ucHorizontalList1.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucHorizontalList1.SelectedItem = null;
this.ucHorizontalList1.Size = new System.Drawing.Size(596, 44);
this.ucHorizontalList1.TabIndex = 0;
this.ucHorizontalList1.SelectedItemEvent += new System.EventHandler(this.ucHorizontalList1_SelectedItemEvent);
//
// ID
//
this.ID.DataPropertyName = "ID";
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.ID.DefaultCellStyle = dataGridViewCellStyle2;
this.ID.HeaderText = "ID";
this.ID.Name = "ID";
this.ID.ReadOnly = true;
this.ID.Visible = false;
//
// BarCode
//
this.BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.BarCode.DataPropertyName = "BarCode";
this.BarCode.HeaderText = "条码";
this.BarCode.Name = "BarCode";
this.BarCode.ReadOnly = true;
//
// CreateTime
//
this.CreateTime.DataPropertyName = "CreateTime";
this.CreateTime.HeaderText = "时间";
this.CreateTime.Name = "CreateTime";
this.CreateTime.ReadOnly = true;
this.CreateTime.Width = 250;
//
// FrmBarCodeGridView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.dataGridView1);
this.Controls.Add(this.ucPagerControl21);
this.Controls.Add(this.panelTop);
this.Controls.Add(this.panel1);
this.Name = "FrmBarCodeGridView";
this.Size = new System.Drawing.Size(910, 935);
this.panel1.ResumeLayout(false);
this.panelTop.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private HZH_Controls.Controls.UCHorizontalList ucHorizontalList1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panelTop;
private HZH_Controls.Controls.UCBtnExt ucBtnSelect;
private HZH_Controls.Controls.UCDatePickerExt ucDatePickerExt2;
private HZH_Controls.Controls.UCDatePickerExt ucDatePickerExt1;
private HZH_Controls.Controls.UCBtnExt ucBtnExt1;
private HZH_Controls.Controls.UCPagerControl2 ucPagerControl21;
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.DataGridViewTextBoxColumn ID;
private System.Windows.Forms.DataGridViewTextBoxColumn BarCode;
private System.Windows.Forms.DataGridViewTextBoxColumn CreateTime;
}
}

@ -0,0 +1,75 @@
using DB.Service;
using HZH_Controls.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RfidWeb.Frm
{
public partial class FrmBarCodeGridView : UserControl
{
private ReadBufLogService readBufLogService = new ReadBufLogService();
public FrmBarCodeGridView()
{
InitializeComponent();
this.dataGridView1.Columns["CreateTime"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss";
var keyValue= new List<KeyValuePair<string, string>>();
keyValue.Add(new KeyValuePair<string, string>("A", "收料1"));
keyValue.Add(new KeyValuePair<string, string>("B", "收料2"));
keyValue.Add(new KeyValuePair<string, string>("C", "废料"));
ucHorizontalList1.DataSource = keyValue;
var dt = DateTime.Now;
this.ucDatePickerExt1.CurrentTime=Convert.ToDateTime(dt.ToString("yyyy-MM-dd 00:00:00"));
this.ucDatePickerExt1.CurrentTime = Convert.ToDateTime(dt.ToString("yyyy-MM-dd 23:59:59"));
this.dataGridView1.AutoGenerateColumns = false;
ucPagerControl21.PageModel = PageModel.PageCount;
ucPagerControl21.PageIndex = 1;
ucPagerControl21.PageSize = 20;
}
private void Replace()
{
ucPagerControl21.PageIndex = 1;
ucPagerControl21_ShowSourceChanged(new object());
}
private void ucPagerControl21_ShowSourceChanged(object currentSource)
{
this.dataGridView1.AutoGenerateColumns = false;
var selectedItemDataSource = ucHorizontalList1.SelectedItem.DataSource;
string key = selectedItemDataSource.Key;
var beginTime = ucDatePickerExt1.CurrentTime;
var endTime = ucDatePickerExt2.CurrentTime;
int index = ucPagerControl21.PageIndex;
var page = readBufLogService.GetPagedList(ucPagerControl21.PageIndex,
ucPagerControl21.PageSize, key,beginTime,endTime);
ucPagerControl21.PageCount = page.TotalPages;
this.dataGridView1.DataSource = page.Items;
}
private void ucBtnSelect_BtnClick(object sender, EventArgs e)
{
Replace();
}
private void ucHorizontalList1_SelectedItemEvent(object sender, EventArgs e)
{
Replace();
}
}
}

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="BarCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="CreateTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="ucPagerControl21.DataSource" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u
ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u
PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB
AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLk9iamVjdAMAAAAGX2l0
ZW1zBV9zaXplCF92ZXJzaW9uBQAACAgCAAAACQMAAAAAAAAAAAAAABADAAAAAAAAAAs=
</value>
</data>
</root>

@ -22,6 +22,7 @@ using HslControls;
using Tool;
using Tool.Model;
using HslCommunication.LogNet;
using Chloe;
namespace RfidWeb.Frm
{
@ -46,17 +47,22 @@ namespace RfidWeb.Frm
void TimeState(Object state)
{
if(cache.ContainsKey("UserAlarmShow")) return;
cache.Set("UserAlarmShow", DateTime.Now.ToString(), TimeSpan.FromSeconds(20));
stopwatc.Restart();
var stateText = HmiPointInfo.GetStateText();
this.Invoke(() =>
{
btnStatus.Text = HmiPointInfo.GetStateText();
btnStatus.Text = stateText;
});
FillAlarmGrid();
FillPromptGrid();
FillAlartLed();
FillhslLabelCombo();
stopwatc.Stop();
cache.Remove("UserAlarmShow");
logNet.WriteInfo("运行时间:"+stopwatc.Elapsed.TotalMilliseconds);
}
@ -288,25 +294,28 @@ namespace RfidWeb.Frm
{
//HmiPoint
hslLabelCombofeedingMotorSpeed.TextValue = HmiPointInfo.GetFeedingMotorSpeed.ToString();
hslLabelComboLaminated.TextValue = HmiPointInfo.GetLaminatedMotorSpeed.ToString();
hslLabelComboFelt.TextValue = HmiPointInfo.GetFeltBeltMotorSpeed.ToString();
hslLabelComboReceiving.TextValue = HmiPointInfo.GeReceivingMotorSpeed.ToString();
this.Invoke(() =>
{
hslLabelCombofeedingMotorSpeed.TextValue = HmiPointInfo.GetFeedingMotorSpeed.ToString();
hslLabelComboLaminated.TextValue = HmiPointInfo.GetLaminatedMotorSpeed.ToString();
hslLabelComboFelt.TextValue = HmiPointInfo.GetFeltBeltMotorSpeed.ToString();
hslLabelComboReceiving.TextValue = HmiPointInfo.GeReceivingMotorSpeed.ToString();
hslLabelComboProduct_counter2.TextValue = HmiPointInfo.GetProduct_counter2.ToString();
hslLabelComboProduct_counter2.TextValue = HmiPointInfo.GetProduct_counter2.ToString();
hslLabelComboCQ_Chip1_counter.TextValue = HmiPointInfo.GetCQ_Chip1_counter.ToString();
hslLabelComboCQ_Chip2_counter.TextValue = HmiPointInfo.GetCQ_Chip2_counter.ToString();
hslLabelComboCQ_Chip1_counter.TextValue = HmiPointInfo.GetCQ_Chip1_counter.ToString();
hslLabelComboCQ_Chip2_counter.TextValue = HmiPointInfo.GetCQ_Chip2_counter.ToString();
hslLabelComboQDWD1SS.TextValue = HmiPointInfo.GetQDWD1SS.ToString();
hslLabelComboQDWD2SS.TextValue = HmiPointInfo.GetQDWD2SS.ToString();
hslLabelComboQDWD1SS.TextValue = HmiPointInfo.GetQDWD1SS.ToString();
hslLabelComboQDWD2SS.TextValue = HmiPointInfo.GetQDWD2SS.ToString();
double result = HmiPointInfo.GetSWSS / 10.0;
double result = HmiPointInfo.GetSWSS / 10.0;
hslLabelComboSWSS.TextValue = result.ToString();
});
hslLabelComboSWSS.TextValue = result.ToString();
}
private void SetTrueLed(params HslLanternSimple[] simples)

@ -9,6 +9,8 @@ using Chloe.RDBMS.DDL;
using Tool;
using DB.Service;
using Tool.Model;
using HslCommunication;
using NewLife;
namespace RfidWeb
{
@ -28,47 +30,70 @@ namespace RfidWeb
var rfidSetting = RfidSetting.Current;
var dbContext = DbFactory.GetContext;
new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
Dictionary<string, string> dic = new Dictionary<string, string>
// new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
//for (int i = 0; i < 31; i++)
//{
// AlarmData data = new AlarmData();
// data.PlcAb = "B";
// data.No = i;
// data.Msg = "";
// data.Address = "FJ_alarm";
// data.ID = GetId;
// // dbContext.Insert(data);
//}
OperateResult<ushort, byte[]> read = PlcConnect.Instance.ReadTag("READ_CHIP2.BUF", ushort.Parse("25"));
if (read.IsSuccess)
{
["CUTTING_SET_TEMPERATURE1_1"] = "裁刀1温度设定1",
["CUTTING_SET_TEMPERATURE1_2"] = "裁刀1温度设定2",
["CUTTING_SET_TEMPERATURE1_3"] = "裁刀1温度设定3",
["CUTTING_SET_TEMPERATURE1_4"] = "裁刀1温度设定4",
var hexString = read.Content2.ToHexString();
}
["CUTTING_SET_TEMPERATURE2_1"] = "裁刀2温度设定1",
["CUTTING_SET_TEMPERATURE2_2"] = "裁刀2温度设定2",
["CUTTING_SET_TEMPERATURE2_3"] = "裁刀2温度设定3",
["CUTTING_SET_TEMPERATURE2_4"] = "裁刀2温度设定4",
var a = HmiPointInfo.GetBufA();
var b = HmiPointInfo.GetBufB();
var c = HmiPointInfo.GetBufC();
//Dictionary<string, string> dic = new Dictionary<string, string>
//{
// ["CUTTING_SET_TEMPERATURE1_1"] = "裁刀1温度设定1",
// ["CUTTING_SET_TEMPERATURE1_2"] = "裁刀1温度设定2",
// ["CUTTING_SET_TEMPERATURE1_3"] = "裁刀1温度设定3",
// ["CUTTING_SET_TEMPERATURE1_4"] = "裁刀1温度设定4",
["CUTTING_SET_TIME1_1"] = "裁刀1时间设定1",
["CUTTING_SET_TIME1_2"] = "裁刀1时间设定2",
["CUTTING_SET_TIME1_3"] = "裁刀1时间设定3",
["CUTTING_SET_TIME1_4"] = "裁刀1时间设定4",
// ["CUTTING_SET_TEMPERATURE2_1"] = "裁刀2温度设定1",
// ["CUTTING_SET_TEMPERATURE2_2"] = "裁刀2温度设定2",
// ["CUTTING_SET_TEMPERATURE2_3"] = "裁刀2温度设定3",
// ["CUTTING_SET_TEMPERATURE2_4"] = "裁刀2温度设定4",
["CUTTING_SET_TIME2_1"] = "裁刀2时间设定1",
["CUTTING_SET_TIME2_2"] = "裁刀2时间设定2",
["CUTTING_SET_TIME2_3"] = "裁刀2时间设定3",
["CUTTING_SET_TIME2_4"] = "裁刀2时间设定4",
};
foreach (KeyValuePair<string, string> k in dic)
{
Point point = new Point();
point.ID = SnowflakeFactory.NewId;
point.DataType = "Uint32";
point.FromType = "参数";
point.PointAddress = k.Key;
point.PointName = k.Value;
dbContext.Insert(point);
}
// ["CUTTING_SET_TIME1_1"] = "裁刀1时间设定1",
// ["CUTTING_SET_TIME1_2"] = "裁刀1时间设定2",
// ["CUTTING_SET_TIME1_3"] = "裁刀1时间设定3",
// ["CUTTING_SET_TIME1_4"] = "裁刀1时间设定4",
// ["CUTTING_SET_TIME2_1"] = "裁刀2时间设定1",
// ["CUTTING_SET_TIME2_2"] = "裁刀2时间设定2",
// ["CUTTING_SET_TIME2_3"] = "裁刀2时间设定3",
// ["CUTTING_SET_TIME2_4"] = "裁刀2时间设定4",
//};
//foreach (KeyValuePair<string, string> k in dic)
//{
// Point point = new Point();
// point.ID = SnowflakeFactory.NewId;
// point.DataType = "Uint32";
// point.FromType = "参数";
// point.PointAddress = k.Key;
// point.PointName = k.Value;
//}

@ -30,7 +30,7 @@ namespace RfidWeb
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormMain());
// Application.Run(new FromSQl());
}
}
}

@ -160,6 +160,12 @@
<Compile Include="Frm\FormPar.Designer.cs">
<DependentUpon>FormPar.cs</DependentUpon>
</Compile>
<Compile Include="Frm\FormPersionCent.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Frm\FormPersionCent.Designer.cs">
<DependentUpon>FormPersionCent.cs</DependentUpon>
</Compile>
<Compile Include="Frm\FormPlanAdd.cs">
<SubType>Form</SubType>
</Compile>
@ -172,6 +178,12 @@
<Compile Include="Frm\FormRegister.Designer.cs">
<DependentUpon>FormRegister.cs</DependentUpon>
</Compile>
<Compile Include="Frm\FrmBarCodeGridView.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Frm\FrmBarCodeGridView.Designer.cs">
<DependentUpon>FrmBarCodeGridView.cs</DependentUpon>
</Compile>
<Compile Include="Frm\FrmPlan.cs">
<SubType>UserControl</SubType>
</Compile>
@ -227,12 +239,18 @@
<EmbeddedResource Include="Frm\FormPar.resx">
<DependentUpon>FormPar.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Frm\FormPersionCent.resx">
<DependentUpon>FormPersionCent.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Frm\FormPlanAdd.resx">
<DependentUpon>FormPlanAdd.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Frm\FormRegister.resx">
<DependentUpon>FormRegister.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Frm\FrmBarCodeGridView.resx">
<DependentUpon>FrmBarCodeGridView.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Frm\FrmPlan.resx">
<DependentUpon>FrmPlan.cs</DependentUpon>
</EmbeddedResource>

@ -21,5 +21,10 @@
public static readonly string Prompt_alarmList = "Prompt_alarmList";
public static readonly string Home = "Home";
public static readonly string ReadBufLog = "ReadBufLog";
//
}
}

@ -95,6 +95,15 @@ namespace Tool.Model
return result.IsSuccess ? result.Content : 0;
}
private static Boolean GetBoolValue(string key)
{
var plc = PlcConnect.Instance;
var result = plc.ReadBool(key);
return result.Content;
}
public static readonly string CUTTING_SET_TEMPERATURE1_1 = "CUTTING_SET_TEMPERATURE1_1";
public static Int32 GetCUTTING_SET_TEMPERATURE1_1 => GetValue(CUTTING_SET_TEMPERATURE1_1);
@ -179,6 +188,56 @@ namespace Tool.Model
public static readonly string Safety_level = "Safety_level";
/// <summary>
/// 1盘料选择0卷料选择
/// </summary>
public static readonly string CH_Mode_selection = "CH_Mode_selection";
/// <summary>
/// 裁刀1屏蔽
/// </summary>
public static readonly string HMI_Cutting1_pass = "HMI_Cutting1_pass";
/// <summary>
/// 裁刀2屏蔽
/// </summary>
public static readonly string HMI_Cutting2_pass = "HMI_Cutting2_pass";
/// <summary>
/// 裁刀1屏蔽
/// </summary>
public static readonly string Cutting1_passad = "Cutting1_passad";
/// <summary>
/// 裁刀2屏蔽
/// </summary>
public static readonly string Cutting2_passad = "Cutting2_passad";
/// <summary>
/// 切刀1到达使用上限清除计数按钮
/// </summary>
public static readonly string CQ_QD1_counter_reset = "CQ_QD1_counter_reset";
/// <summary>
/// 切刀2到达使用上限清除计数按钮
/// </summary>
public static readonly string CQ_QD2_counter_reset = "CQ_QD2_counter_reset";
/// <summary>
/// 毛毡带到达使用上限清除计数按钮
/// </summary>
public static readonly string CQ_MZD_counter_reset = "CQ_MZD_counter_reset";
public static String GetStateText()
{
@ -191,7 +250,7 @@ namespace Tool.Model
switch (context)
{
case 0:
text = "异常";
text = "异常停机";
break;
case 1:
@ -207,7 +266,7 @@ namespace Tool.Model
text = "停止";
break;
case 5:
text = "安全回路常";
text = "安全回路常";
break;
}
@ -215,5 +274,81 @@ namespace Tool.Model
return text;
}
public static Dictionary<string,string> BufDictionary=new Dictionary<string,string>();
public static (bool,string) GetBufA()
{
return GetBufABC("A");
}
public static (bool, string) GetBufB()
{
return GetBufABC("B");
}
public static (bool, string) GetBufC()
{
return GetBufABC("C");
}
public static (bool, string) GetBufABC(string key2)
{
string[] str = new string[] { "READ_CHIP0.BUF", "READ_CHIP1.BUF", "READ_CHIP2.BUF" };
string kye = "";
switch (key2)
{
case "A":
kye = str[0];
break;
case "B":
kye = str[1];
break;
case "C":
kye = str[2];
break;
}
var plc = PlcConnect.Instance;
string stringBuilder = "";
OperateResult<ushort, byte[]> read = plc.ReadTag(kye, ushort.Parse("25"));
if (read.IsSuccess)
{
stringBuilder = read.Content2.ToHexString();
}
if (stringBuilder.Trim().Length == 0)
{
return (false, stringBuilder);
}
if (stringBuilder.StartsWith("000000000") || stringBuilder.StartsWith("024E6F52".ToLower()))
{
return (false, stringBuilder);
}
if (BufDictionary.TryGetValue(key2, out var val))
{
if (val == stringBuilder)
{
return (false, stringBuilder);
}
else
{
BufDictionary[key2] = stringBuilder;
return (true, stringBuilder);
}
}
else
{
BufDictionary[key2] = stringBuilder;
return (true, stringBuilder);
}
}
}
}

@ -28,8 +28,7 @@ namespace Tool
plc.Slot = 0;
plc.CommunicationPipe = new HslCommunication.Core.Pipe.PipeTcpNet(rfidSetting.PlcIp, 44818)
{
ConnectTimeOut = 5000, // 连接超时时间,单位毫秒
ReceiveTimeOut = 20000, // 接收设备数据反馈的超时时间
ConnectTimeOut = 1000, // 连接超时时间,单位毫秒
SleepTime = 0,
SocketKeepAliveTime = -1,
IsPersistentConnection = true,

Loading…
Cancel
Save