1.初始化项目。保险起见bin目录完整提交 2.基于现场代码为调整过的初始项目(此次提交还未解决代码差异问题)
This commit is contained in:
@@ -0,0 +1,162 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using AGVSystem.Cls;
|
||||
|
||||
namespace AGVSystem.A17168
|
||||
{
|
||||
// Token: 0x02000031 RID: 49
|
||||
public class UPDateDBList
|
||||
{
|
||||
// Token: 0x06000294 RID: 660 RVA: 0x00053A58 File Offset: 0x00051C58
|
||||
public static void UpDateDb()
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool flag = UPDateDBList.upDbList.Count > 0;
|
||||
if (flag)
|
||||
{
|
||||
bool flag2 = UPDateDBList.upDbList[0] != null;
|
||||
if (flag2)
|
||||
{
|
||||
bool flag3 = UPDateDBList.upDbList[0] is Location_Log;
|
||||
if (flag3)
|
||||
{
|
||||
Location_Log location_Log = (Location_Log)UPDateDBList.upDbList[0];
|
||||
string a = UPDateDBList.db.Command(string.Concat(new string[]
|
||||
{
|
||||
"INSERT INTO [Location_Log] ([Dt] ,[Agv_ID] ,[Loc_ID] ,[Value] ,[Loc_ID2] ,[Value2],[Value3]) VALUES ('",
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
|
||||
"',",
|
||||
location_Log.Agv_Id.ToString(),
|
||||
",",
|
||||
location_Log.Loc_ID.ToString(),
|
||||
",",
|
||||
location_Log.Value.ToString(),
|
||||
",",
|
||||
location_Log.Loc_ID2.ToString(),
|
||||
",",
|
||||
location_Log.Value2.ToString(),
|
||||
",",
|
||||
location_Log.Value3.ToString(),
|
||||
")"
|
||||
}));
|
||||
bool flag4 = a == "1";
|
||||
if (flag4)
|
||||
{
|
||||
UPDateDBList.upDbList.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bool flag5 = UPDateDBList.upDbList[0] is CrossInfo_Insert;
|
||||
if (flag5)
|
||||
{
|
||||
CrossInfo_Insert crossInfo_Insert = (CrossInfo_Insert)UPDateDBList.upDbList[0];
|
||||
string sqlstr = string.Concat(new string[]
|
||||
{
|
||||
"INSERT INTO [Go_Log] ([Dt] ,[Agv_id] ,[Type] ,[Location],[plc_value]) VALUES ('",
|
||||
crossInfo_Insert.dt.ToString("yyyy-MM-dd HH:mm:ss.fff"),
|
||||
"',",
|
||||
crossInfo_Insert.agv_no.ToString(),
|
||||
",'",
|
||||
crossInfo_Insert.Info,
|
||||
"',",
|
||||
crossInfo_Insert.LandMark.ToString(),
|
||||
",",
|
||||
crossInfo_Insert.plc_value.ToString(),
|
||||
")"
|
||||
});
|
||||
string a2 = UPDateDBList.db.Command(sqlstr);
|
||||
bool flag6 = a2 == "1";
|
||||
if (flag6)
|
||||
{
|
||||
UPDateDBList.upDbList.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bool flag7 = UPDateDBList.upDbList[0] is Warn_Log;
|
||||
if (flag7)
|
||||
{
|
||||
Warn_Log warn_Log = (Warn_Log)UPDateDBList.upDbList[0];
|
||||
string sqlstr2 = string.Concat(new string[]
|
||||
{
|
||||
"INSERT INTO [Warn_Log] ([Dt] ,[Agv_id] ,[Type] ,[Reset]) VALUES ('",
|
||||
warn_Log.Dt,
|
||||
"',",
|
||||
warn_Log.Agv_id,
|
||||
",'",
|
||||
warn_Log.Type,
|
||||
"','",
|
||||
(warn_Log.Reset == null) ? "NULL" : warn_Log.Reset,
|
||||
"')"
|
||||
});
|
||||
string a3 = UPDateDBList.db.Command(sqlstr2);
|
||||
bool flag8 = a3 == "1";
|
||||
if (flag8)
|
||||
{
|
||||
UPDateDBList.upDbList.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bool flag9 = UPDateDBList.upDbList[0] is AgvInfo;
|
||||
if (flag9)
|
||||
{
|
||||
AgvInfo agvInfo = (AgvInfo)UPDateDBList.upDbList[0];
|
||||
string text = "UPDATE [dbo].[AgvInfo]\r\n SET [Loc_ID] = '{1}',Status = '{2}'\r\n WHERE id = '{0}'";
|
||||
text = string.Format(text, agvInfo.Agv_ID, agvInfo.Location_Display, agvInfo.Enable ? 1 : 0);
|
||||
string a4 = UPDateDBList.db.Command(text);
|
||||
bool flag10 = a4 == "1";
|
||||
if (flag10)
|
||||
{
|
||||
UPDateDBList.upDbList.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UPDateDBList.upDbList.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
bool flag11 = UPDateDBList.sqlList.Count > 0;
|
||||
if (flag11)
|
||||
{
|
||||
string a5 = UPDateDBList.db.Command(UPDateDBList.sqlList[0]);
|
||||
bool flag12 = a5 == "1";
|
||||
if (flag12)
|
||||
{
|
||||
UPDateDBList.sqlList.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000668 RID: 1640
|
||||
public static List<object> upDbList = new List<object>();
|
||||
|
||||
// Token: 0x04000669 RID: 1641
|
||||
public static List<string> sqlList = new List<string>();
|
||||
|
||||
// Token: 0x0400066A RID: 1642
|
||||
public static ClsDBConn_sql db = new ClsDBConn_sql();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user