MES对接
This commit is contained in:
@@ -138,9 +138,9 @@ namespace JinYuan.ControlCenters
|
||||
{
|
||||
DicStationFunction = new Dictionary<string, dgStationFunction>();
|
||||
|
||||
DicStationFunction.Add("卷芯进站", FeedingStation);
|
||||
DicStationFunction.Add("外观检测进站", FeedingStation);
|
||||
DicStationFunction.Add("NG出站", NGStation);
|
||||
DicStationFunction.Add("卷芯出站", BlankingStation);
|
||||
DicStationFunction.Add("外观检测出站", BlankingStation);
|
||||
|
||||
for (int i = 0; i < CommonMethods.ChatLineCount; i++)
|
||||
{
|
||||
@@ -1002,7 +1002,8 @@ namespace JinYuan.ControlCenters
|
||||
CommonMethods.ProOKQty = CommonMethods.PlcLink.ReadInt32("D17");//良品总数
|
||||
|
||||
CommonMethods.Ppm = CommonMethods.PlcLink.ReadInt32("D13");
|
||||
CommonMethods.JiaDL = Convert.ToDouble(CommonMethods.PlcLink.ReadFloat("D11").ToString("F2"));
|
||||
//CommonMethods.JiaDL = Convert.ToDouble(CommonMethods.PlcLink.ReadFloat("D11").ToString("F2"))/100;
|
||||
CommonMethods.JiaDL = Convert.ToDouble(CommonMethods.PlcLink.ReadInt32("D11").ToString("F2"))/100;
|
||||
|
||||
#region 开机时间/运行时间
|
||||
CommonMethods.PlcOpenAndRunTime = GetList<int>(6, 0);
|
||||
|
||||
@@ -356,7 +356,7 @@ namespace JinYuan.ControlCenters
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Instance.WriteError($"卷芯进站线程数据解析:{ex}", "SysErrorLog");
|
||||
LogHelper.Instance.WriteError($"外观检测进站线程数据解析:{ex}", "SysErrorLog");
|
||||
}
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ namespace JinYuan.ControlCenters
|
||||
//CommonMethods.PlcLink.WriteInt16("D2100", listRes[0]);//调试结果OK写入PLC
|
||||
if (result != null)
|
||||
{
|
||||
string strres = $"卷心工位发送给PLC: D2100={listRes[0]},D2101={listRes[1]},D2102={listRes[2]},";
|
||||
string strres = $"外观检工位发送给PLC: D2100={listRes[0]},D2101={listRes[1]},D2102={listRes[2]},";
|
||||
CommonMethods.AddDataMonitorLog(0, strres);
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ namespace JinYuan.ControlCenters
|
||||
|
||||
sw2.Stop();
|
||||
////输出上料数据处理耗时:
|
||||
CommonMethods.AddDataMonitorLog(0, $"卷芯进站共耗时:{sw2.Elapsed.TotalMilliseconds}ms");
|
||||
CommonMethods.AddDataMonitorLog(0, $"外观检测进站共耗时:{sw2.Elapsed.TotalMilliseconds}ms");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -474,7 +474,7 @@ namespace JinYuan.ControlCenters
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Instance.WriteError($"卷芯上料保存处理异常:{ex}", "SysErrorLog");
|
||||
LogHelper.Instance.WriteError($"外观检测上料保存处理异常:{ex}", "SysErrorLog");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -922,7 +922,7 @@ namespace JinYuan.ControlCenters
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// LogHelper.Instance.WriteError($"卷芯出站线程数据解析:{ex}", "SysErrorLog");
|
||||
// LogHelper.Instance.WriteError($"外观检测出站线程数据解析:{ex}", "SysErrorLog");
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -972,7 +972,7 @@ namespace JinYuan.ControlCenters
|
||||
// #region 数据变量定义
|
||||
// List<BGearEntity> list = new List<BGearEntity>();//实体
|
||||
// //int[] MyRes = new int[2];//AB反馈结果
|
||||
// int[] MyRes = new int[3];//三个卷芯反馈结果
|
||||
// int[] MyRes = new int[3];//三个外观检测反馈结果
|
||||
// #endregion
|
||||
// //高低位转换
|
||||
// byte[] bytes = bArrays.Content.ByteReverse();
|
||||
@@ -1551,7 +1551,7 @@ namespace JinYuan.ControlCenters
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// LogHelper.Instance.WriteError($"卷芯出站线程数据解析:{ex}", "SysErrorLog");
|
||||
// LogHelper.Instance.WriteError($"外观检测出站线程数据解析:{ex}", "SysErrorLog");
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -1592,7 +1592,7 @@ namespace JinYuan.ControlCenters
|
||||
|
||||
// sw2.Stop();
|
||||
// ////输出下料数据处理耗时:
|
||||
// CommonMethods.AddDataMonitorLog(0, $"卷芯出站共耗时:{sw2.Elapsed.TotalMilliseconds}ms");
|
||||
// CommonMethods.AddDataMonitorLog(0, $"外观检测出站共耗时:{sw2.Elapsed.TotalMilliseconds}ms");
|
||||
// }
|
||||
//}
|
||||
#endregion
|
||||
@@ -1614,7 +1614,7 @@ namespace JinYuan.ControlCenters
|
||||
#region 数据变量定义
|
||||
List<BGearEntity> list = new List<BGearEntity>();//实体
|
||||
//int[] MyRes = new int[2];//AB反馈结果
|
||||
int[] MyRes = new int[3];//三个卷芯反馈结果
|
||||
int[] MyRes = new int[3];//三个外观检测反馈结果
|
||||
#endregion
|
||||
//高低位转换
|
||||
byte[] bytes = bArrays.Content.ByteReverse();
|
||||
@@ -1889,7 +1889,7 @@ namespace JinYuan.ControlCenters
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Instance.WriteError($"卷芯出站线程数据解析:{ex}", "SysErrorLog");
|
||||
LogHelper.Instance.WriteError($"外观检测出站线程数据解析:{ex}", "SysErrorLog");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1931,7 +1931,7 @@ namespace JinYuan.ControlCenters
|
||||
|
||||
sw2.Stop();
|
||||
////输出下料数据处理耗时:
|
||||
CommonMethods.AddDataMonitorLog(0, $"卷芯出站共耗时:{sw2.Elapsed.TotalMilliseconds}ms");
|
||||
CommonMethods.AddDataMonitorLog(0, $"外观检测出站共耗时:{sw2.Elapsed.TotalMilliseconds}ms");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -101,7 +101,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="MES\MESDataCombin.cs.bak" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
|
||||
@@ -32,10 +32,11 @@ namespace JinYuan.MES
|
||||
try
|
||||
{
|
||||
StringContent stringContent = new StringContent(strJosnData, Encoding.UTF8, "application/json");
|
||||
return new HttpClient()
|
||||
string ResponseMessage= new HttpClient()
|
||||
{
|
||||
Timeout = TimeSpan.FromSeconds(6.0)
|
||||
}.PostAsync(url, (HttpContent)stringContent).Result.Content.ReadAsStringAsync().Result;
|
||||
return ResponseMessage;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace JinYuan.MES
|
||||
equipNum = equipNum,
|
||||
userName = userName,
|
||||
passWord = passWord,
|
||||
userCardID = UserCardID
|
||||
userCardID =null// UserCardID
|
||||
};
|
||||
|
||||
var nowDate = DateTime.Now;
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace JinYuan.VirtualDataLibrary
|
||||
if (type == 0)
|
||||
{
|
||||
strSql = @"SELECT CONVERT(varchar,[TestTime], 120) 时间
|
||||
,[BarCode] 卷芯码
|
||||
,[BarCode] 电芯码
|
||||
,[Result] 结果
|
||||
,[Remark] 备注
|
||||
,case when [Flag]=1 then '已上传' else '未上传' end 上传状态
|
||||
@@ -122,7 +122,7 @@ namespace JinYuan.VirtualDataLibrary
|
||||
strSql = @"SELECT CONVERT(varchar,[CSBYHASCANNINGTIME], 120) 时间
|
||||
,[CSBYHPROCESSNAME] 工序名
|
||||
,[CSBYHSCHEDULE] 班次
|
||||
,[CSBYHCODEA] 卷芯码
|
||||
,[CSBYHCODEA] 电芯码
|
||||
,[CSBYHOUTSTATIONJUDGMENTRESULT] 出站判定结果
|
||||
,[Remark] 备注
|
||||
,[RethrowNum] 复投次数
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace JinYuan.VirtualDataLibrary
|
||||
/// -3A出站数据存储到-3C
|
||||
/// </summary>
|
||||
public bool IsGet_3C = true;
|
||||
public int _卷芯条码计数 = 0;
|
||||
public int _外观检测条码计数 = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Guid
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
</startup>
|
||||
<connectionStrings>
|
||||
<add name="connDbType" connectionString="SqlServer" />
|
||||
<!--<add name="connString" connectionString="Server=.;DataBase=LargeSquareOne;Uid=jyzdh;Pwd=eve123456" />-->
|
||||
<add name="connString" connectionString="Server=ZCDEEPSEAI;DataBase=LargeSquareOne;Uid=sa;Pwd=123" />
|
||||
<add name="connString" connectionString="Server=localhost;DataBase=LargeSquareOne;Uid=sa;Pwd=123" />
|
||||
<!--<add name="connString" connectionString="Server=ZCDEEPSEAI;DataBase=LargeSquareOne;Uid=sa;Pwd=123" />-->
|
||||
<add name="connString2" connectionString="Server=192.168.2.108;DataBase=HBG_CupDataTurnover;Uid=jyzdh;Pwd=eve123456" />
|
||||
<add name="connString3" connectionString="Server=localhost;DataBase=ProConfigDB;User Id=jypz;Password=eve123456;Persist Security Info=true;Allow Zero Datetime=true;Character Set=utf8;" />
|
||||
</connectionStrings>
|
||||
|
||||
@@ -12,7 +12,7 @@ MES/
|
||||
线程耗时日志保存=False
|
||||
是否获取服务器数据=1
|
||||
是否存储C模块数据=1
|
||||
卷芯条码计数=1
|
||||
外观检测条码计数=1
|
||||
强制OK/正常NG模式切换=False
|
||||
|
||||
[MES配置]
|
||||
@@ -23,16 +23,16 @@ MES/
|
||||
白夜班交替时间=20:30:00
|
||||
MES日志保存路径=D:\APILog
|
||||
存储服务器IP地址=192.168.2.108
|
||||
员工权限校验=http://10.22.160.1/core/api/public/equipment/base/user/login/verify
|
||||
设备参数设定值请求=http://10.22.160.1/core/api/public/param/setting/request
|
||||
设备参数设定值变更=http://10.22.160.1/core/api/public/param/setting/change
|
||||
产品进站=http://10.22.160.1/core/api/public/in/station/process/currency
|
||||
产品过程加工参数=http://10.22.160.1/core/api/public/product/process/param/new/process
|
||||
产品结果加工参数=http://10.22.160.1/core/api/public/product/process/param/new/result
|
||||
产品出站=http://10.22.160.1/core/api/public/out/station/process/turn/equip
|
||||
设备报警=http://10.22.160.1/core/api/public/equipment/alarm/currency
|
||||
设备状态=http://10.22.160.1/core/api/public/eve/pm/eqm/run/status/operation
|
||||
能耗=http://10.22.160.1/core/api/public/eve/pm/energy/consumption/collection/submit
|
||||
员工权限校验=http://10.22.160.141/core/api/public/equipment/base/user/login/verify
|
||||
设备参数设定值请求=http://10.22.160.141/core/api/public/param/setting/request
|
||||
设备参数设定值变更=http://10.22.160.141/core/api/public/param/setting/change
|
||||
产品进站=http://10.22.160.141/core/api/public/in/station/process/currency
|
||||
产品过程加工参数=http://10.22.160.141/core/api/public/product/process/param/new/process
|
||||
产品结果加工参数=http://10.22.160.141/core/api/public/product/process/param/new/result
|
||||
产品出站=http://10.22.160.141/core/api/public/out/station/process/turn/equip
|
||||
设备报警=http://10.22.160.141/core/api/public/equipment/alarm/currency
|
||||
设备状态=http://10.22.160.141/core/api/public/eve/pm/eqm/run/status/operation
|
||||
能耗=http://10.22.160.141/core/api/public/eve/pm/energy/consumption/collection/submit
|
||||
风速仪=https://iot.eveportal.com:9470/eve_api/ems/iot/upload_device_collect_data
|
||||
guid=55e9ca41-814c-43a4-9e7e-34324548ade7
|
||||
DeviceState=1
|
||||
|
||||
@@ -348,7 +348,7 @@ namespace LargeSquareOne
|
||||
}
|
||||
|
||||
|
||||
#region 显示卷芯上料数据
|
||||
#region 显示外观检测上料数据
|
||||
/// <summary>
|
||||
/// 显示上料
|
||||
/// </summary>
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace LargeSquareOne
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.cmb_SelectType.Items.Add("卷芯进站");
|
||||
this.cmb_SelectType.Items.Add("卷芯出站");
|
||||
this.cmb_SelectType.Items.Add("外观检测进站");
|
||||
this.cmb_SelectType.Items.Add("外观检测出站");
|
||||
this.cmb_SelectType.SelectedIndex = 0;
|
||||
|
||||
this.dtp_Start.Value = DateTime.Now.AddHours(-2.0f);
|
||||
@@ -40,11 +40,11 @@ namespace LargeSquareOne
|
||||
private void btn_Query_Click(object sender, EventArgs e)
|
||||
{
|
||||
string str = this.cmb_SelectType.Text;
|
||||
if (string.Compare(str, "卷芯进站") == 0)
|
||||
if (string.Compare(str, "外观检测进站") == 0)
|
||||
{
|
||||
this.cmb_SelectType.SelectedIndex = 0;
|
||||
}
|
||||
else if (string.Compare(str, "卷芯出站") == 0)
|
||||
else if (string.Compare(str, "外观检测出站") == 0)
|
||||
{
|
||||
this.cmb_SelectType.SelectedIndex = 1;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,6 @@ namespace LargeSquareOne
|
||||
//存储用户对象
|
||||
CommonMethods.currentAdmin = sysAdmin;
|
||||
CommonMethods.IsLoginOk = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace LargeSquareOne
|
||||
CommonMethods.mesConfig.IsGet_Server = IniConfigHelper.ReadIniData("配置信息", "是否获取服务器数据", "1") == "1" ? true : false;
|
||||
CommonMethods.sysConfig.OKSwitching = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "强制OK/正常NG模式切换", "False"));
|
||||
CommonMethods.mesConfig.IsGet_3C = IniConfigHelper.ReadIniData("配置信息", "是否存储C模块数据", "1") == "1" ? true : false;
|
||||
CommonMethods.mesConfig._卷芯条码计数 = Convert.ToInt32(IniConfigHelper.ReadIniData("配置信息", "卷芯条码计数", "false"));
|
||||
CommonMethods.mesConfig._外观检测条码计数 = Convert.ToInt32(IniConfigHelper.ReadIniData("配置信息", "外观检测条码计数", "false"));
|
||||
|
||||
CommonMethods.mesConfig.siteCode = IniConfigHelper.ReadIniData("MES配置", "工厂代码", "false");
|
||||
CommonMethods.mesConfig.lineCode = IniConfigHelper.ReadIniData("MES配置", "产线编号", "false");
|
||||
|
||||
Reference in New Issue
Block a user