|
@@ -1114,7 +1114,7 @@ namespace MainForm
|
|
private static readonly object lockObj = new object(); // 锁对象
|
|
private static readonly object lockObj = new object(); // 锁对象
|
|
private static bool isCollectingFlagLeft;
|
|
private static bool isCollectingFlagLeft;
|
|
private static bool isCollectingFlagRight;
|
|
private static bool isCollectingFlagRight;
|
|
- private bool OpenDailogFalg = true; //是否开启扫码弹窗标识
|
|
|
|
|
|
+ public static bool OpenDailogFalg = true; //是否开启扫码弹窗标识
|
|
private static int res = 0;
|
|
private static int res = 0;
|
|
public static bool StopWhile =false; //二维码弹窗后停止循环
|
|
public static bool StopWhile =false; //二维码弹窗后停止循环
|
|
public static bool inStationPass = true; //过站结果,保存进站结果
|
|
public static bool inStationPass = true; //过站结果,保存进站结果
|
|
@@ -1748,7 +1748,7 @@ namespace MainForm
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
- #region OP30站读txt数据
|
|
|
|
|
|
+ #region OP30站读三点测高
|
|
if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32"))
|
|
if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32"))
|
|
{
|
|
{
|
|
string path = "";
|
|
string path = "";
|
|
@@ -1762,17 +1762,22 @@ namespace MainForm
|
|
string pathStr = GlobalContext.MESLaserRPath;
|
|
string pathStr = GlobalContext.MESLaserRPath;
|
|
path = DecFileName(pathStr);
|
|
path = DecFileName(pathStr);
|
|
}
|
|
}
|
|
- outRequest_Body.unitData.processData.Add(
|
|
|
|
- new XmMES_StationOutRequest_Body.XmStationOut_ProcessData()
|
|
|
|
- {
|
|
|
|
- dataName = "fMesHeightInfos",
|
|
|
|
- dataValue = GetLastLineCompensation(path)
|
|
|
|
- });
|
|
|
|
|
|
+ var item = outRequest_Body.unitData.processData.FirstOrDefault(data => data.dataName == "fMesHeightInfos");
|
|
|
|
+ if (item != null)
|
|
|
|
+ {
|
|
|
|
+ item.dataValue = GetLastLineCompensation(path);
|
|
|
|
+ }
|
|
|
|
+ //outRequest_Body.unitData.processData.Add(
|
|
|
|
+ // new XmMES_StationOutRequest_Body.XmStationOut_ProcessData()
|
|
|
|
+ // {
|
|
|
|
+ // dataName = "fMesHeightInfos",
|
|
|
|
+ // dataValue = GetLastLineCompensation(path)
|
|
|
|
+ // });
|
|
|
|
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
- #region 上传文件
|
|
|
|
|
|
+ #region 上传文件,添加附件uuid
|
|
if (GlobalContext.MESIsSendUpFile)
|
|
if (GlobalContext.MESIsSendUpFile)
|
|
{
|
|
{
|
|
foreach (var item in fileUploadData.fileData)
|
|
foreach (var item in fileUploadData.fileData)
|
|
@@ -1831,6 +1836,7 @@ namespace MainForm
|
|
{
|
|
{
|
|
AddMessage(LogType.Info, $"【出站数据 SN {sn}】上传MES服务器---失败!接口报错信息:" + mesRet);
|
|
AddMessage(LogType.Info, $"【出站数据 SN {sn}】上传MES服务器---失败!接口报错信息:" + mesRet);
|
|
}
|
|
}
|
|
|
|
+ fileUploadData.fileData.Clear();
|
|
|
|
|
|
string sql_UpStationout = ProcessData.ToStringUpdateStationOut_body(
|
|
string sql_UpStationout = ProcessData.ToStringUpdateStationOut_body(
|
|
JsonConvert.SerializeObject(outRequest_Body),
|
|
JsonConvert.SerializeObject(outRequest_Body),
|
|
@@ -2303,6 +2309,39 @@ namespace MainForm
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void CopyFileToTempPath(string morepath,string temppath) {
|
|
|
|
+ string tempPath = GlobalContext.MqttFileTempDir; //临时存放图片的文件夹
|
|
|
|
+ var morePath = morepath.Split(",");
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ if (Directory.Exists(tempPath))
|
|
|
|
+ {
|
|
|
|
+ Directory.Delete(tempPath, recursive: true); // 清理临时目录
|
|
|
|
+ }
|
|
|
|
+ foreach (var item in morePath)
|
|
|
|
+ {
|
|
|
|
+ foreach (var file in Directory.GetFiles(item, "*.*", SearchOption.AllDirectories))
|
|
|
|
+ {
|
|
|
|
+ var relativePath = file.Substring(item.Length + 1);
|
|
|
|
+ var destFile = Path.Combine(temppath, relativePath);
|
|
|
|
+ Directory.CreateDirectory(Path.GetDirectoryName(destFile));
|
|
|
|
+ File.Copy(file, destFile, overwrite: true);
|
|
|
|
+ //删除文件
|
|
|
|
+ (bool, string) newResult = DeleteFile(file);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex){
|
|
|
|
+ throw ex;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 压缩文件
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="folderPath">源文件地址</param>
|
|
|
|
+ /// <param name="zipFilePath">目标地址</param>
|
|
|
|
+ /// <returns></returns>
|
|
public static (int, string) CompressFolder(string folderPath, string zipFilePath)
|
|
public static (int, string) CompressFolder(string folderPath, string zipFilePath)
|
|
{
|
|
{
|
|
try
|
|
try
|
|
@@ -2417,19 +2456,6 @@ namespace MainForm
|
|
msg = msg + fileresult.Item2 + "\r\n";
|
|
msg = msg + fileresult.Item2 + "\r\n";
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- foreach (var imageFile in imageFiles)
|
|
|
|
- {
|
|
|
|
- if (File.Exists(imageFile))
|
|
|
|
- {
|
|
|
|
- //删除文件
|
|
|
|
- (bool, string) newResult = DeleteFile(imageFile);
|
|
|
|
- if (!newResult.Item1)
|
|
|
|
- {
|
|
|
|
- return (0, Path.GetFileName(imageFile) + newResult.Item2);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return (1, msg);
|
|
return (1, msg);
|
|
@@ -2669,6 +2695,19 @@ namespace MainForm
|
|
|
|
|
|
if (FaultData.Length > 0 && isNoAlarm && isNoNewAlarm)
|
|
if (FaultData.Length > 0 && isNoAlarm && isNoNewAlarm)
|
|
{
|
|
{
|
|
|
|
+ //如果警报都是0,则跳过解析
|
|
|
|
+ if (FaultData?.All(x => x == 0) ?? true)
|
|
|
|
+ {
|
|
|
|
+ if (flag == "left")
|
|
|
|
+ {
|
|
|
|
+ _FaultDatas_Old = FaultData.ToArray();
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ _FaultDatas_Old2 = FaultData.ToArray();
|
|
|
|
+ }
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//解析报警信息,分析当前报警在字典中的定位
|
|
//解析报警信息,分析当前报警在字典中的定位
|
|
for (int i = 0; i <= FaultData.Length - 1; i++)
|
|
for (int i = 0; i <= FaultData.Length - 1; i++)
|
|
{
|
|
{
|
|
@@ -2951,6 +2990,57 @@ namespace MainForm
|
|
return cleanedString;
|
|
return cleanedString;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void S1_OpenDialog(int plcNo,string stationNameStr,string tagBaseName,string tagMesCommName) {
|
|
|
|
+ Task.Run(() =>
|
|
|
|
+ {
|
|
|
|
+ using (var dialog = new BandBarodeDialog_S1())
|
|
|
|
+ {
|
|
|
|
+ var rs = dialog.ShowDialog();
|
|
|
|
+ if (rs == DialogResult.OK)
|
|
|
|
+ {
|
|
|
|
+ //绑定载具和产品
|
|
|
|
+ ResponseMessage message = new ResponseMessage();
|
|
|
|
+
|
|
|
|
+ message = SQLHelper.InsertCarrierBind(_strCarrierBarcode, _strProductBarcode);
|
|
|
|
+ if (message.result == false)
|
|
|
|
+ {
|
|
|
|
+ AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定失败,错误:" + message.text);
|
|
|
|
+
|
|
|
|
+ CommandFromPLC CommandToPlC = new CommandFromPLC();
|
|
|
|
+ CommandToPlC.cmd = 0;
|
|
|
|
+ CommandToPlC.cmdParam = 5;
|
|
|
|
+ CommandToPlC.cmdResult = 0;
|
|
|
|
+ WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定成功");
|
|
|
|
+
|
|
|
|
+ CommandFromPLC CommandToPlC = new CommandFromPLC();
|
|
|
|
+ CommandToPlC.cmd = 0;
|
|
|
|
+ CommandToPlC.cmdParam = 4;
|
|
|
|
+ CommandToPlC.cmdResult = 0;
|
|
|
|
+ WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
|
|
|
|
+ }
|
|
|
|
+ AddMessage(LogType.Info, $"载具码:{_strCarrierBarcode},产品码:{_strProductBarcode}");
|
|
|
|
+
|
|
|
|
+ //StopWhile = false;//开启while循环
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 连接数组元素
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="array"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ private static string ArrayToString(Array array)
|
|
|
|
+ {
|
|
|
|
+ // 使用 string.Join 连接数组元素
|
|
|
|
+ return string.Join(", ", array.Cast<object>().Select(x => x.ToString()));
|
|
|
|
+ }
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region S1
|
|
#region S1
|
|
@@ -3177,7 +3267,7 @@ namespace MainForm
|
|
/// [S1] 壳体清洁上料装备(10扫码改造注释(临时))
|
|
/// [S1] 壳体清洁上料装备(10扫码改造注释(临时))
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="plcNo">PLC编号</param>
|
|
/// <param name="plcNo">PLC编号</param>
|
|
- private void ReadStation_S1(int plcNo)
|
|
|
|
|
|
+ private async void ReadStation_S1(int plcNo)
|
|
{
|
|
{
|
|
string stationCode = "[OP10]";
|
|
string stationCode = "[OP10]";
|
|
string stationName = "壳体清洁上料";
|
|
string stationName = "壳体清洁上料";
|
|
@@ -3262,10 +3352,10 @@ namespace MainForm
|
|
//报警信息
|
|
//报警信息
|
|
_FaultDatas = stPLC_MesData.iotData.fault_codes;
|
|
_FaultDatas = stPLC_MesData.iotData.fault_codes;
|
|
|
|
|
|
- if (stPLC_MesData.mesCommFrmPLC.cmdParam == 2)
|
|
|
|
- {
|
|
|
|
- BandBarodeDialog_S1.isNoClose=true;
|
|
|
|
- }
|
|
|
|
|
|
+ //if (stPLC_MesData.mesCommFrmPLC.cmdParam == 2)
|
|
|
|
+ //{
|
|
|
|
+ // BandBarodeDialog_S1.isNoClose=true;
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
|
|
|
|
#endregion 一次性读取所有数据
|
|
#endregion 一次性读取所有数据
|
|
@@ -3281,41 +3371,47 @@ namespace MainForm
|
|
|
|
|
|
if (stPLC_MesData.mesCommFrmPLC.cmdParam==1)
|
|
if (stPLC_MesData.mesCommFrmPLC.cmdParam==1)
|
|
{
|
|
{
|
|
- using (var dialog = new BandBarodeDialog_S1())
|
|
|
|
|
|
+ if (OpenDailogFalg)
|
|
{
|
|
{
|
|
- var rs = dialog.ShowDialog();
|
|
|
|
- if (rs == DialogResult.OK)
|
|
|
|
- {
|
|
|
|
- //绑定载具和产品
|
|
|
|
- ResponseMessage message = new ResponseMessage();
|
|
|
|
-
|
|
|
|
- message = SQLHelper.InsertCarrierBind(_strCarrierBarcode, _strProductBarcode);
|
|
|
|
- if (message.result == false)
|
|
|
|
- {
|
|
|
|
- AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定失败,错误:" + message.text);
|
|
|
|
-
|
|
|
|
- CommandFromPLC CommandToPlC = new CommandFromPLC();
|
|
|
|
- CommandToPlC.cmd = 0;
|
|
|
|
- CommandToPlC.cmdParam = 5;
|
|
|
|
- CommandToPlC.cmdResult = 0;
|
|
|
|
- WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定成功");
|
|
|
|
-
|
|
|
|
- CommandFromPLC CommandToPlC = new CommandFromPLC();
|
|
|
|
- CommandToPlC.cmd = 0;
|
|
|
|
- CommandToPlC.cmdParam = 4;
|
|
|
|
- CommandToPlC.cmdResult = 0;
|
|
|
|
- WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
|
|
|
|
- }
|
|
|
|
- AddMessage(LogType.Info, $"载具码:{_strCarrierBarcode},产品码:{_strCarrierBarcode}");
|
|
|
|
-
|
|
|
|
- //StopWhile = false;//开启while循环
|
|
|
|
- }
|
|
|
|
|
|
+ //await S1_OpenDialog(plcNo, stationNameStr, tagBaseName, tagMesCommName);
|
|
|
|
+ S1_OpenDialog(plcNo, stationNameStr, tagBaseName, tagMesCommName);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //using (var dialog = new BandBarodeDialog_S1())
|
|
|
|
+ //{
|
|
|
|
+ // var rs = dialog.ShowDialog();
|
|
|
|
+ // if (rs == DialogResult.OK)
|
|
|
|
+ // {
|
|
|
|
+ // //绑定载具和产品
|
|
|
|
+ // ResponseMessage message = new ResponseMessage();
|
|
|
|
+
|
|
|
|
+ // message = SQLHelper.InsertCarrierBind(_strCarrierBarcode, _strProductBarcode);
|
|
|
|
+ // if (message.result == false)
|
|
|
|
+ // {
|
|
|
|
+ // AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定失败,错误:" + message.text);
|
|
|
|
+
|
|
|
|
+ // CommandFromPLC CommandToPlC = new CommandFromPLC();
|
|
|
|
+ // CommandToPlC.cmd = 0;
|
|
|
|
+ // CommandToPlC.cmdParam = 5;
|
|
|
|
+ // CommandToPlC.cmdResult = 0;
|
|
|
|
+ // WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定成功");
|
|
|
|
+
|
|
|
|
+ // CommandFromPLC CommandToPlC = new CommandFromPLC();
|
|
|
|
+ // CommandToPlC.cmd = 0;
|
|
|
|
+ // CommandToPlC.cmdParam = 4;
|
|
|
|
+ // CommandToPlC.cmdResult = 0;
|
|
|
|
+ // WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
|
|
|
|
+ // }
|
|
|
|
+ // AddMessage(LogType.Info, $"载具码:{_strCarrierBarcode},产品码:{_strCarrierBarcode}");
|
|
|
|
+
|
|
|
|
+ // //StopWhile = false;//开启while循环
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
@@ -3467,15 +3563,15 @@ namespace MainForm
|
|
AddMessage(LogType.Info, stationNameStr + "_进站开始");
|
|
AddMessage(LogType.Info, stationNameStr + "_进站开始");
|
|
//10扫码改造注释(临时)
|
|
//10扫码改造注释(临时)
|
|
//string sn = (string)stPLC_MesData.BarcodeSet.strProductBarcode; // 产品SN(物料码),现在PLC只有OP10和OP50返回
|
|
//string sn = (string)stPLC_MesData.BarcodeSet.strProductBarcode; // 产品SN(物料码),现在PLC只有OP10和OP50返回
|
|
- //string CarrierBarcode = (string)stPLC_MesData.BarcodeSet.strCarrierBarcode; // 载具条码;
|
|
|
|
- string sn = _strProductBarcode;
|
|
|
|
- string CarrierBarcode = _strCarrierBarcode;
|
|
|
|
|
|
+ string CarrierBarcode = (string)stPLC_MesData.BarcodeSet.strCarrierBarcode; // 载具条码;
|
|
|
|
+ string sn = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
|
|
|
|
|
|
string MachineId = GlobalContext.S1_MachineId; // 装备ID(可配置)
|
|
string MachineId = GlobalContext.S1_MachineId; // 装备ID(可配置)
|
|
string StationId = GlobalContext.S1_StationId; // 工位ID(可配置)
|
|
string StationId = GlobalContext.S1_StationId; // 工位ID(可配置)
|
|
int a1Result = (int)stPLC_MesData.iotData.testStatus; // 产品结果
|
|
int a1Result = (int)stPLC_MesData.iotData.testStatus; // 产品结果
|
|
bool pass = a1Result == 1;
|
|
bool pass = a1Result == 1;
|
|
|
|
|
|
|
|
+
|
|
if (string.IsNullOrEmpty(sn))
|
|
if (string.IsNullOrEmpty(sn))
|
|
{
|
|
{
|
|
ProgressState = false;
|
|
ProgressState = false;
|
|
@@ -3608,23 +3704,32 @@ namespace MainForm
|
|
});
|
|
});
|
|
|
|
|
|
#region 转换过站明细字符串
|
|
#region 转换过站明细字符串
|
|
-
|
|
|
|
//创建字典
|
|
//创建字典
|
|
var dic = new Dictionary<string, string>();
|
|
var dic = new Dictionary<string, string>();
|
|
// 获取结构体类型
|
|
// 获取结构体类型
|
|
- FieldInfo[] fields = typeof(OP10_DataSet_t).GetFields();
|
|
|
|
|
|
+ FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
+ string resultString = "";
|
|
|
|
|
|
// 遍历变量名转换成字典描述
|
|
// 遍历变量名转换成字典描述
|
|
foreach (FieldInfo field in fields)
|
|
foreach (FieldInfo field in fields)
|
|
{
|
|
{
|
|
//获取枚举描述
|
|
//获取枚举描述
|
|
string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
- typeof(XiaomiMESEnum_ProcessData.Enum_10_ProcessData));
|
|
|
|
|
|
+ typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
//获取过站明细的值
|
|
//获取过站明细的值
|
|
object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
- dic.Add(name, valueObj.ToString());
|
|
|
|
|
|
+ // 检查是否为数组
|
|
|
|
+ if (valueObj.GetType().IsArray)
|
|
|
|
+ {
|
|
|
|
+ var array = valueObj as Array;
|
|
|
|
+ resultString = ArrayToString(array);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ resultString = valueObj.ToString();
|
|
|
|
+ }
|
|
|
|
+ dic.Add(name, resultString);
|
|
}
|
|
}
|
|
-
|
|
|
|
string paramJson = JsonConvert.SerializeObject(dic);
|
|
string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
@@ -4070,19 +4175,29 @@ namespace MainForm
|
|
////创建字典
|
|
////创建字典
|
|
//var dic = new Dictionary<string, string>();
|
|
//var dic = new Dictionary<string, string>();
|
|
//// 获取结构体类型
|
|
//// 获取结构体类型
|
|
- //FieldInfo[] fields = typeof(OP20_DataSet_t).GetFields();
|
|
|
|
|
|
+ //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
+ //string resultString = "";
|
|
|
|
|
|
//// 遍历变量名转换成字典描述
|
|
//// 遍历变量名转换成字典描述
|
|
//foreach (FieldInfo field in fields)
|
|
//foreach (FieldInfo field in fields)
|
|
//{
|
|
//{
|
|
// //获取枚举描述
|
|
// //获取枚举描述
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
- // typeof(XiaomiMESEnum_ProcessData.Enum_20_ProcessData));
|
|
|
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
// //获取过站明细的值
|
|
// //获取过站明细的值
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
- // dic.Add(name, valueObj.ToString());
|
|
|
|
|
|
+ // // 检查是否为数组
|
|
|
|
+ // if (valueObj.GetType().IsArray)
|
|
|
|
+ // {
|
|
|
|
+ // var array = valueObj as Array;
|
|
|
|
+ // resultString = ArrayToString(array);
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // resultString = valueObj.ToString();
|
|
|
|
+ // }
|
|
|
|
+ // dic.Add(name, resultString);
|
|
//}
|
|
//}
|
|
-
|
|
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
#endregion
|
|
#endregion
|
|
string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
@@ -4704,20 +4819,31 @@ namespace MainForm
|
|
});
|
|
});
|
|
|
|
|
|
#region 转换过站明细字符串
|
|
#region 转换过站明细字符串
|
|
- //创建字典
|
|
|
|
|
|
+ ////创建字典
|
|
//var dic = new Dictionary<string, string>();
|
|
//var dic = new Dictionary<string, string>();
|
|
//// 获取结构体类型
|
|
//// 获取结构体类型
|
|
- //FieldInfo[] fields = typeof(OP30_DataSet_t).GetFields();
|
|
|
|
|
|
+ //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
+ //string resultString = "";
|
|
|
|
|
|
//// 遍历变量名转换成字典描述
|
|
//// 遍历变量名转换成字典描述
|
|
//foreach (FieldInfo field in fields)
|
|
//foreach (FieldInfo field in fields)
|
|
//{
|
|
//{
|
|
// //获取枚举描述
|
|
// //获取枚举描述
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
- // typeof(XiaomiMESEnum_ProcessData.Enum_30_ProcessData));
|
|
|
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
// //获取过站明细的值
|
|
// //获取过站明细的值
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
- // dic.Add(name, valueObj.ToString());
|
|
|
|
|
|
+ // // 检查是否为数组
|
|
|
|
+ // if (valueObj.GetType().IsArray)
|
|
|
|
+ // {
|
|
|
|
+ // var array = valueObj as Array;
|
|
|
|
+ // resultString = ArrayToString(array);
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // resultString = valueObj.ToString();
|
|
|
|
+ // }
|
|
|
|
+ // dic.Add(name, resultString);
|
|
//}
|
|
//}
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
#endregion
|
|
#endregion
|
|
@@ -4908,13 +5034,13 @@ namespace MainForm
|
|
{
|
|
{
|
|
//测试数据
|
|
//测试数据
|
|
//stPLC_MesData.mesCommFrmPLC.cmd = 2;
|
|
//stPLC_MesData.mesCommFrmPLC.cmd = 2;
|
|
- stPLC_MesData.BarcodeSet.strCarrierBarcode = "A235461";
|
|
|
|
|
|
+ //stPLC_MesData.BarcodeSet.strCarrierBarcode = "A235461";
|
|
//stPLC_MesData.BarcodeSet.strPCBBarcode = "A1507V000239";
|
|
//stPLC_MesData.BarcodeSet.strPCBBarcode = "A1507V000239";
|
|
|
|
|
|
- //stPLC_MesData.testData.fGlue_Areas = new float[] {12,22,16 };
|
|
|
|
|
|
+ //stPLC_MesData.testData.fGlue_Areas = new float[] { 12, 22, 16 };
|
|
//stPLC_MesData.testData.fGlue_AreasMax = 20f;
|
|
//stPLC_MesData.testData.fGlue_AreasMax = 20f;
|
|
//stPLC_MesData.testData.fGlue_AreasMin = 0;
|
|
//stPLC_MesData.testData.fGlue_AreasMin = 0;
|
|
- //stPLC_MesData.testData.fGlue_Heights = new float[] { 5, 8, 6.6f};
|
|
|
|
|
|
+ //stPLC_MesData.testData.fGlue_Heights = new float[] { 5, 8, 6.6f };
|
|
//stPLC_MesData.testData.fGlue_HeightsMax = 10f;
|
|
//stPLC_MesData.testData.fGlue_HeightsMax = 10f;
|
|
//stPLC_MesData.testData.fGlue_HeightsMin = 0;
|
|
//stPLC_MesData.testData.fGlue_HeightsMin = 0;
|
|
|
|
|
|
@@ -5227,42 +5353,63 @@ namespace MainForm
|
|
#region 上传图片
|
|
#region 上传图片
|
|
if (GlobalContext.MQTTIsSendUpFile)
|
|
if (GlobalContext.MQTTIsSendUpFile)
|
|
{
|
|
{
|
|
- string[] urlarry = GlobalContext.UpFilePath.Split(",");
|
|
|
|
- fileUploadData.fileData.Clear();
|
|
|
|
- foreach (var item in urlarry)
|
|
|
|
|
|
+ CopyFileToTempPath(GlobalContext.UpFilePath,GlobalContext.MqttFileTempDir);
|
|
|
|
+ if (Directory.Exists(GlobalContext.MqttFileTempDir))
|
|
{
|
|
{
|
|
- if (!string.IsNullOrEmpty(item))
|
|
|
|
|
|
+ var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result, GlobalContext.MqttFileTempDir, uuid).Result;
|
|
|
|
+ if (result.Item1==1)
|
|
{
|
|
{
|
|
- //上传图片
|
|
|
|
- var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result,
|
|
|
|
- item, uuid).Result;
|
|
|
|
OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
|
|
OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //string[] urlarry = GlobalContext.UpFilePath.Split(",");
|
|
|
|
+ //// fileUploadData.fileData.Clear();
|
|
|
|
+ //foreach (var item in urlarry)
|
|
|
|
+ //{
|
|
|
|
+ // if (!string.IsNullOrEmpty(item))
|
|
|
|
+ // {
|
|
|
|
+ // //上传图片
|
|
|
|
+ // var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result,
|
|
|
|
+ // item, uuid).Result;
|
|
|
|
+ // OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 转换过站明细字符串
|
|
#region 转换过站明细字符串
|
|
- ////创建字典
|
|
|
|
- //var dic = new Dictionary<string, string>();
|
|
|
|
- //// 获取结构体类型
|
|
|
|
- //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
|
|
+ //创建字典
|
|
|
|
+ var dic = new Dictionary<string, string>();
|
|
|
|
+ // 获取结构体类型
|
|
|
|
+ FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
+ string resultString = "";
|
|
|
|
|
|
- //// 遍历变量名转换成字典描述
|
|
|
|
- //foreach (FieldInfo field in fields)
|
|
|
|
- //{
|
|
|
|
- // //获取枚举描述
|
|
|
|
- // string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
|
- // typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
|
|
- // //获取过站明细的值
|
|
|
|
- // object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
|
- // dic.Add(name, valueObj.ToString());
|
|
|
|
- //}
|
|
|
|
- //string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
|
|
|
+ // 遍历变量名转换成字典描述
|
|
|
|
+ foreach (FieldInfo field in fields)
|
|
|
|
+ {
|
|
|
|
+ //获取枚举描述
|
|
|
|
+ string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
|
+ typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
|
|
+ //获取过站明细的值
|
|
|
|
+ object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
|
+ // 检查是否为数组
|
|
|
|
+ if (valueObj.GetType().IsArray)
|
|
|
|
+ {
|
|
|
|
+ var array = valueObj as Array;
|
|
|
|
+ resultString = ArrayToString(array);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ resultString = valueObj.ToString();
|
|
|
|
+ }
|
|
|
|
+ dic.Add(name, resultString);
|
|
|
|
+ }
|
|
|
|
+ string paramJson = JsonConvert.SerializeObject(dic);
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
- string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);//过站生产数据
|
|
|
|
|
|
+ //string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);//过站生产数据
|
|
|
|
|
|
#region MAS测试项
|
|
#region MAS测试项
|
|
XmMES_StationOutRequest_Body outRequest_Body = new XmMES_StationOutRequest_Body();
|
|
XmMES_StationOutRequest_Body outRequest_Body = new XmMES_StationOutRequest_Body();
|
|
@@ -5278,6 +5425,9 @@ namespace MainForm
|
|
float fGlue_HeightsMin = stPLC_MesData.testData.fGlue_HeightsMin;
|
|
float fGlue_HeightsMin = stPLC_MesData.testData.fGlue_HeightsMin;
|
|
|
|
|
|
XmStationOut_InspectionItemData inspectionItemData = new XmStationOut_InspectionItemData();
|
|
XmStationOut_InspectionItemData inspectionItemData = new XmStationOut_InspectionItemData();
|
|
|
|
+ inspectionItemData.childUnitSn = strProductBarcode;
|
|
|
|
+ inspectionItemData.childUnitState = AllpassFlag;
|
|
|
|
+ inspectionItemData.toolVersion = "1.0";
|
|
if (fGlue_AreasMax > fGlue_AreasMin && (fGlue_AreasMax != 0 || fGlue_AreasMin != 0))
|
|
if (fGlue_AreasMax > fGlue_AreasMin && (fGlue_AreasMax != 0 || fGlue_AreasMin != 0))
|
|
{
|
|
{
|
|
for (int i = 0; i < fGlue_Areas.Length -1 ; i++)
|
|
for (int i = 0; i < fGlue_Areas.Length -1 ; i++)
|
|
@@ -5305,10 +5455,6 @@ namespace MainForm
|
|
}
|
|
}
|
|
inspectionItemData.AddDataItem("GlueLine", "胶线高度", string.Join(",", fGlue_Heights), fGlue_HeightsMax.ToString(), fGlue_HeightsMin.ToString(), passFlag);
|
|
inspectionItemData.AddDataItem("GlueLine", "胶线高度", string.Join(",", fGlue_Heights), fGlue_HeightsMax.ToString(), fGlue_HeightsMin.ToString(), passFlag);
|
|
}
|
|
}
|
|
-
|
|
|
|
- inspectionItemData.childUnitSn = strProductBarcode;
|
|
|
|
- inspectionItemData.childUnitState = AllpassFlag;
|
|
|
|
- inspectionItemData.toolVersion = "1.0";
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
@@ -5442,7 +5588,7 @@ namespace MainForm
|
|
//stPLC_MesData.BarcodeSet.strCarrierBarcode = "A235461";
|
|
//stPLC_MesData.BarcodeSet.strCarrierBarcode = "A235461";
|
|
//stPLC_MesData.BarcodeSet.strPCBBarcode = "A1507V000239";
|
|
//stPLC_MesData.BarcodeSet.strPCBBarcode = "A1507V000239";
|
|
//stPLC_MesData.iotData.beatAction = 1;
|
|
//stPLC_MesData.iotData.beatAction = 1;
|
|
- //stPLC_MesData.iotData.beatAction = 2;
|
|
|
|
|
|
+ //stPLC_MesData.iotData.beatAction = 2;
|
|
//stPLC_MesData.iotData.beatAction = 3;
|
|
//stPLC_MesData.iotData.beatAction = 3;
|
|
//stPLC_MesData.iotData.beatAction = 4;
|
|
//stPLC_MesData.iotData.beatAction = 4;
|
|
//stPLC_MesData.iotData.beatAction = 5;
|
|
//stPLC_MesData.iotData.beatAction = 5;
|
|
@@ -5793,18 +5939,27 @@ namespace MainForm
|
|
|
|
|
|
if (GlobalContext.MQTTIsSendUpFile)
|
|
if (GlobalContext.MQTTIsSendUpFile)
|
|
{
|
|
{
|
|
- string[] urlarry = GlobalContext.UpFilePath.Split(",");
|
|
|
|
- fileUploadData.fileData.Clear();
|
|
|
|
- foreach (var item in urlarry)
|
|
|
|
|
|
+ CopyFileToTempPath(GlobalContext.UpFilePath, GlobalContext.MqttFileTempDir);
|
|
|
|
+ if (Directory.Exists(GlobalContext.MqttFileTempDir))
|
|
{
|
|
{
|
|
- if (!string.IsNullOrEmpty(item))
|
|
|
|
|
|
+ var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result, GlobalContext.MqttFileTempDir, uuid).Result;
|
|
|
|
+ if (result.Item1 == 1)
|
|
{
|
|
{
|
|
- //上传图片
|
|
|
|
- var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result,
|
|
|
|
- item, uuid).Result;
|
|
|
|
OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
|
|
OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //string[] urlarry = GlobalContext.UpFilePath.Split(",");
|
|
|
|
+ //// fileUploadData.fileData.Clear();
|
|
|
|
+ //foreach (var item in urlarry)
|
|
|
|
+ //{
|
|
|
|
+ // if (!string.IsNullOrEmpty(item))
|
|
|
|
+ // {
|
|
|
|
+ // //上传图片
|
|
|
|
+ // var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result,
|
|
|
|
+ // item, uuid).Result;
|
|
|
|
+ // OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
@@ -5813,19 +5968,29 @@ namespace MainForm
|
|
////创建字典
|
|
////创建字典
|
|
//var dic = new Dictionary<string, string>();
|
|
//var dic = new Dictionary<string, string>();
|
|
//// 获取结构体类型
|
|
//// 获取结构体类型
|
|
- //FieldInfo[] fields = typeof(OP50_DataSet_t).GetFields();
|
|
|
|
|
|
+ //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
+ //string resultString = "";
|
|
|
|
|
|
//// 遍历变量名转换成字典描述
|
|
//// 遍历变量名转换成字典描述
|
|
//foreach (FieldInfo field in fields)
|
|
//foreach (FieldInfo field in fields)
|
|
//{
|
|
//{
|
|
// //获取枚举描述
|
|
// //获取枚举描述
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
- // typeof(XiaomiMESEnum_ProcessData.Enum_50_ProcessData));
|
|
|
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
// //获取过站明细的值
|
|
// //获取过站明细的值
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
- // dic.Add(name, valueObj.ToString());
|
|
|
|
|
|
+ // // 检查是否为数组
|
|
|
|
+ // if (valueObj.GetType().IsArray)
|
|
|
|
+ // {
|
|
|
|
+ // var array = valueObj as Array;
|
|
|
|
+ // resultString = ArrayToString(array);
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // resultString = valueObj.ToString();
|
|
|
|
+ // }
|
|
|
|
+ // dic.Add(name, resultString);
|
|
//}
|
|
//}
|
|
-
|
|
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
@@ -6393,19 +6558,29 @@ namespace MainForm
|
|
////创建字典
|
|
////创建字典
|
|
//var dic = new Dictionary<string, string>();
|
|
//var dic = new Dictionary<string, string>();
|
|
//// 获取结构体类型
|
|
//// 获取结构体类型
|
|
- //FieldInfo[] fields = typeof(OP60_DataSet_t).GetFields();
|
|
|
|
|
|
+ //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
+ //string resultString = "";
|
|
|
|
|
|
//// 遍历变量名转换成字典描述
|
|
//// 遍历变量名转换成字典描述
|
|
//foreach (FieldInfo field in fields)
|
|
//foreach (FieldInfo field in fields)
|
|
//{
|
|
//{
|
|
// //获取枚举描述
|
|
// //获取枚举描述
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
- // typeof(XiaomiMESEnum_ProcessData.Enum_60_ProcessData));
|
|
|
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
// //获取过站明细的值
|
|
// //获取过站明细的值
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
- // dic.Add(name, valueObj.ToString());
|
|
|
|
|
|
+ // // 检查是否为数组
|
|
|
|
+ // if (valueObj.GetType().IsArray)
|
|
|
|
+ // {
|
|
|
|
+ // var array = valueObj as Array;
|
|
|
|
+ // resultString = ArrayToString(array);
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // resultString = valueObj.ToString();
|
|
|
|
+ // }
|
|
|
|
+ // dic.Add(name, resultString);
|
|
//}
|
|
//}
|
|
-
|
|
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
@@ -7037,17 +7212,28 @@ namespace MainForm
|
|
////创建字典
|
|
////创建字典
|
|
//var dic = new Dictionary<string, string>();
|
|
//var dic = new Dictionary<string, string>();
|
|
//// 获取结构体类型
|
|
//// 获取结构体类型
|
|
- //FieldInfo[] fields = typeof(OP70_DataSet_t).GetFields();
|
|
|
|
|
|
+ //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
+ //string resultString = "";
|
|
|
|
|
|
//// 遍历变量名转换成字典描述
|
|
//// 遍历变量名转换成字典描述
|
|
//foreach (FieldInfo field in fields)
|
|
//foreach (FieldInfo field in fields)
|
|
//{
|
|
//{
|
|
// //获取枚举描述
|
|
// //获取枚举描述
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
- // typeof(XiaomiMESEnum_ProcessData.Enum_70_ProcessData));
|
|
|
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
// //获取过站明细的值
|
|
// //获取过站明细的值
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
- // dic.Add(name, valueObj.ToString());
|
|
|
|
|
|
+ // // 检查是否为数组
|
|
|
|
+ // if (valueObj.GetType().IsArray)
|
|
|
|
+ // {
|
|
|
|
+ // var array = valueObj as Array;
|
|
|
|
+ // resultString = ArrayToString(array);
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // resultString = valueObj.ToString();
|
|
|
|
+ // }
|
|
|
|
+ // dic.Add(name, resultString);
|
|
//}
|
|
//}
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
|
|
|
@@ -7524,18 +7710,27 @@ namespace MainForm
|
|
|
|
|
|
if (GlobalContext.MQTTIsSendUpFile)
|
|
if (GlobalContext.MQTTIsSendUpFile)
|
|
{
|
|
{
|
|
- string[] urlarry = GlobalContext.UpFilePath.Split(",");
|
|
|
|
- fileUploadData.fileData.Clear();
|
|
|
|
- foreach (var item in urlarry)
|
|
|
|
|
|
+ CopyFileToTempPath(GlobalContext.UpFilePath, GlobalContext.MqttFileTempDir);
|
|
|
|
+ if (Directory.Exists(GlobalContext.MqttFileTempDir))
|
|
{
|
|
{
|
|
- if (!string.IsNullOrEmpty(item))
|
|
|
|
|
|
+ var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result, GlobalContext.MqttFileTempDir, uuid).Result;
|
|
|
|
+ if (result.Item1 == 1)
|
|
{
|
|
{
|
|
- //上传图片
|
|
|
|
- var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName,
|
|
|
|
- a1Result, item, uuid).Result;
|
|
|
|
OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
|
|
OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //string[] urlarry = GlobalContext.UpFilePath.Split(",");
|
|
|
|
+ //// fileUploadData.fileData.Clear();
|
|
|
|
+ //foreach (var item in urlarry)
|
|
|
|
+ //{
|
|
|
|
+ // if (!string.IsNullOrEmpty(item))
|
|
|
|
+ // {
|
|
|
|
+ // //上传图片
|
|
|
|
+ // var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName,
|
|
|
|
+ // a1Result, item, uuid).Result;
|
|
|
|
+ // OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
@@ -7544,17 +7739,28 @@ namespace MainForm
|
|
////创建字典
|
|
////创建字典
|
|
//var dic = new Dictionary<string, string>();
|
|
//var dic = new Dictionary<string, string>();
|
|
//// 获取结构体类型
|
|
//// 获取结构体类型
|
|
- //FieldInfo[] fields = typeof(OP80_DataSet_t).GetFields();
|
|
|
|
|
|
+ //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
+ //string resultString = "";
|
|
|
|
|
|
//// 遍历变量名转换成字典描述
|
|
//// 遍历变量名转换成字典描述
|
|
//foreach (FieldInfo field in fields)
|
|
//foreach (FieldInfo field in fields)
|
|
//{
|
|
//{
|
|
// //获取枚举描述
|
|
// //获取枚举描述
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
- // typeof(XiaomiMESEnum_ProcessData.Enum_80_ProcessData));
|
|
|
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
// //获取过站明细的值
|
|
// //获取过站明细的值
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
- // dic.Add(name, valueObj.ToString());
|
|
|
|
|
|
+ // // 检查是否为数组
|
|
|
|
+ // if (valueObj.GetType().IsArray)
|
|
|
|
+ // {
|
|
|
|
+ // var array = valueObj as Array;
|
|
|
|
+ // resultString = ArrayToString(array);
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // resultString = valueObj.ToString();
|
|
|
|
+ // }
|
|
|
|
+ // dic.Add(name, resultString);
|
|
//}
|
|
//}
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
|
|
|
@@ -7991,17 +8197,28 @@ namespace MainForm
|
|
////创建字典
|
|
////创建字典
|
|
//var dic = new Dictionary<string, string>();
|
|
//var dic = new Dictionary<string, string>();
|
|
//// 获取结构体类型
|
|
//// 获取结构体类型
|
|
- //FieldInfo[] fields = typeof(OP90_DataSet_t).GetFields();
|
|
|
|
|
|
+ //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
+ //string resultString = "";
|
|
|
|
|
|
//// 遍历变量名转换成字典描述
|
|
//// 遍历变量名转换成字典描述
|
|
//foreach (FieldInfo field in fields)
|
|
//foreach (FieldInfo field in fields)
|
|
//{
|
|
//{
|
|
// //获取枚举描述
|
|
// //获取枚举描述
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
// string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
- // typeof(XiaomiMESEnum_ProcessData.Enum_90_ProcessData));
|
|
|
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
// //获取过站明细的值
|
|
// //获取过站明细的值
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
// object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
- // dic.Add(name, valueObj.ToString());
|
|
|
|
|
|
+ // // 检查是否为数组
|
|
|
|
+ // if (valueObj.GetType().IsArray)
|
|
|
|
+ // {
|
|
|
|
+ // var array = valueObj as Array;
|
|
|
|
+ // resultString = ArrayToString(array);
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // resultString = valueObj.ToString();
|
|
|
|
+ // }
|
|
|
|
+ // dic.Add(name, resultString);
|
|
//}
|
|
//}
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
|
|