|
|
|
|
|
|
|
|
|
using DB.Entity;
|
|
|
|
|
using DB;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using Chloe.PostgreSQL.DDL;
|
|
|
|
|
using Chloe.RDBMS.DDL;
|
|
|
|
|
using Tool;
|
|
|
|
|
using DB.Service;
|
|
|
|
|
using Tool.Model;
|
|
|
|
|
|
|
|
|
|
namespace RfidWeb
|
|
|
|
|
{
|
|
|
|
|
public partial class FromSQl : Form
|
|
|
|
|
{
|
|
|
|
|
public FromSQl()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ucBtnExt1_BtnClick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//DbInfo.Init(typeof(RoleMapper).Assembly);
|
|
|
|
|
DbInfo.Init(typeof(UserInfo).Assembly);
|
|
|
|
|
var rfidSetting = RfidSetting.Current;
|
|
|
|
|
var dbContext = DbFactory.GetContext;
|
|
|
|
|
|
|
|
|
|
// new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
|
|
dic["feeding_motor_speed"] = "供料电机速度";
|
|
|
|
|
dic["Laminated_motor_speed"] = "层合电机速度";
|
|
|
|
|
dic["Felt_belt_motor_speed"] = "毛毡带电机速度";
|
|
|
|
|
dic["Receiving_Electric_motor_speed"] = "收料电机1&2速度";
|
|
|
|
|
|
|
|
|
|
dic["Product_counter2"] = "层合生产数量";
|
|
|
|
|
dic["CQ_Chip1_counter"] = "裁切1生产数量";
|
|
|
|
|
dic["CQ_Chip2_counter"] = "裁切2生产数量";
|
|
|
|
|
|
|
|
|
|
dic["QDWD1SS"] = "裁刀1温度";
|
|
|
|
|
dic["QDWD2SS"] = "裁刀2温度";
|
|
|
|
|
|
|
|
|
|
dic["QDWD2SS"] = "裁刀2温度";
|
|
|
|
|
|
|
|
|
|
foreach (var ee in dic)
|
|
|
|
|
{
|
|
|
|
|
Point point = new Point();
|
|
|
|
|
point.DataType = "Uint32";
|
|
|
|
|
point.FromType = "参数";
|
|
|
|
|
point.PointAddress = ee.Key;
|
|
|
|
|
point.PointName=ee.Value;
|
|
|
|
|
point.ID = GetId;
|
|
|
|
|
dbContext.Insert(point);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private long GetId=> SnowflakeFactory.NewId;
|
|
|
|
|
|
|
|
|
|
private void ucBtnExt2_BtnClick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
DbInfo.Init(typeof(UserInfo).Assembly);
|
|
|
|
|
UpdateLogService service = new UpdateLogService();
|
|
|
|
|
service.AddOrUpdateLog(TestFactory.TestUser(), "test", 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|