Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
955f892956
5 files changed
+86
-3
No files matched your search
@@ -142,6 +142,7 @@
|
|||||||
<Compile Include="UserClass\NumericTextColumn .cs" />
|
<Compile Include="UserClass\NumericTextColumn .cs" />
|
||||||
<Compile Include="UserClass\PID.cs" />
|
<Compile Include="UserClass\PID.cs" />
|
||||||
<Compile Include="UserClass\PressKey.cs" />
|
<Compile Include="UserClass\PressKey.cs" />
|
||||||
|
<Compile Include="UserClass\SQLDATA.cs" />
|
||||||
<Compile Include="UserClass\SqliteHelper.cs" />
|
<Compile Include="UserClass\SqliteHelper.cs" />
|
||||||
<Compile Include="UserClass\StrToInt.cs" />
|
<Compile Include="UserClass\StrToInt.cs" />
|
||||||
<Compile Include="UserClass\AsyncTcpServer.cs" />
|
<Compile Include="UserClass\AsyncTcpServer.cs" />
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ using TouchSocket.Sockets;
|
|||||||
using DyeingComputer.ViewModel;
|
using DyeingComputer.ViewModel;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using ScottPlot.Colormaps;
|
using ScottPlot.Colormaps;
|
||||||
|
using static System.Windows.Forms.AxHost;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||||
|
|
||||||
namespace DyeingComputer.UserClass
|
namespace DyeingComputer.UserClass
|
||||||
{/// <summary>
|
{/// <summary>
|
||||||
@@ -92,7 +95,27 @@ namespace DyeingComputer.UserClass
|
|||||||
{
|
{
|
||||||
Dictionary<string, object> Chart_dat;
|
Dictionary<string, object> Chart_dat;
|
||||||
Chart_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
|
Chart_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
|
||||||
|
Chart_dat.GetValue("WorkOrder");
|
||||||
|
/* string WorkOrder = Chart_dat.GetValue("WorkOrder").ToString();
|
||||||
|
string ProcessName = Chart_dat.GetValue("ProcessName").ToString();
|
||||||
|
string StartTime = Chart_dat.GetValue("StartTime").ToString();
|
||||||
|
string EndTime = Chart_dat.GetValue("EndTime").ToString();
|
||||||
|
string Time = Chart_dat.GetValue("Time").ToString();
|
||||||
|
string lock_ = Chart_dat.GetValue("lock").ToString();
|
||||||
|
string state = Chart_dat.GetValue("State").ToString();
|
||||||
|
string ProcessID = Chart_dat.GetValue("ProcessID").ToString();
|
||||||
|
string Remark = Chart_dat.GetValue("Remark").ToString();*/
|
||||||
|
bool dat_w= SQLDATA.WorkOrder(Chart_dat.GetValue("WorkOrder").ToString(),
|
||||||
|
Chart_dat.GetValue("ProcessName").ToString(),
|
||||||
|
Chart_dat.GetValue("StartTime").ToString(),
|
||||||
|
Chart_dat.GetValue("EndTime").ToString(),
|
||||||
|
Chart_dat.GetValue("Time").ToString(),
|
||||||
|
Chart_dat.GetValue("Remark").ToString(),
|
||||||
|
Chart_dat.GetValue("lock").ToString(),
|
||||||
|
Chart_dat.GetValue("State").ToString(),
|
||||||
|
Chart_dat.GetValue("ProcessID").ToString());
|
||||||
|
if (!dat_w) { client.SendAsync("SC910"); }
|
||||||
|
else { client.SendAsync("SC810"+SYSKEY+SYSDAT); }
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -100,6 +123,21 @@ namespace DyeingComputer.UserClass
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { client.SendAsync("SC999"); }
|
else { client.SendAsync("SC999"); }
|
||||||
|
}//WorkOrder表信息检查写入
|
||||||
|
else if (SYSAPI == "SC811")
|
||||||
|
{
|
||||||
|
if (SYSKEY == MainWindowViewModel.SYSKEY)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
client.SendAsync("SC911");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { client.SendAsync("SC999"); }
|
||||||
}
|
}
|
||||||
else if (SYSAPI == "SC820")
|
else if (SYSAPI == "SC820")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace DyeingComputer.UserClass
|
|||||||
wr.WriteLine(Log_time + dat);
|
wr.WriteLine(Log_time + dat);
|
||||||
wr.Close();
|
wr.Close();
|
||||||
}
|
}
|
||||||
catch (Exception ex) { }
|
catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using ScottPlot.Colormaps;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using static DyeingComputer.UserClass.SqliteHelper;
|
||||||
|
|
||||||
|
namespace DyeingComputer.UserClass
|
||||||
|
{
|
||||||
|
public class SQLDATA
|
||||||
|
{
|
||||||
|
private static SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||||
|
private readonly static string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
||||||
|
//WorkOrder表检查写入
|
||||||
|
public static bool WorkOrder(string WorkOrder, string ProcessName,string StartTime, string EndTime, string Time, string Remark,string lock_,string state,string ProcessID)
|
||||||
|
{
|
||||||
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
object i = SQLiteHelpers.ExecuteScalar("select * from WorkOrder where WorkOrder = "+ WorkOrder,null);
|
||||||
|
if (i!=null)
|
||||||
|
{
|
||||||
|
SQLiteHelpers.Close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Dictionary<string, object> WorkOrder_new = new Dictionary<string, object>();//缓存函数
|
||||||
|
WorkOrder_new.Add("WorkOrder", WorkOrder);
|
||||||
|
WorkOrder_new.Add("ProcessName", ProcessName);
|
||||||
|
WorkOrder_new.Add("StartTime", StartTime);
|
||||||
|
WorkOrder_new.Add("EndTime", EndTime);
|
||||||
|
WorkOrder_new.Add("Time", Time);
|
||||||
|
WorkOrder_new.Add("Remark", Remark);
|
||||||
|
WorkOrder_new.Add("lock", Convert.ToInt16(lock_));
|
||||||
|
WorkOrder_new.Add("state", Convert.ToInt16(state));
|
||||||
|
WorkOrder_new.Add("ProcessID", ProcessID);
|
||||||
|
SQLiteHelpers.InsertData("WorkOrder", WorkOrder_new);
|
||||||
|
SQLiteHelpers.Close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -74,7 +74,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
SQL_data(); //读数据库
|
SQL_data(); //读数据库
|
||||||
UPort(); //启动串口
|
UPort(); //启动串口
|
||||||
CountDown(); //启动循环任务
|
CountDown(); //启动循环任务
|
||||||
AsyncTcpServer.Main();
|
_ = AsyncTcpServer.Main();
|
||||||
}
|
}
|
||||||
DataTable dt_con = new DataTable();
|
DataTable dt_con = new DataTable();
|
||||||
DataTable dt_sys = new DataTable();
|
DataTable dt_sys = new DataTable();
|
||||||
|
|||||||
Reference in new issue
Block a user