chore: 初始化东安动力MES采集程序

This commit is contained in:
yexingqiang
2026-05-29 13:57:19 +08:00
commit b5c49a5d86
1121 changed files with 168795 additions and 0 deletions

73
SyUpLoad/SyUpLoad.sln Normal file
View File

@@ -0,0 +1,73 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32602.291
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyUpLoad", "SyUpLoad\SyUpLoad.csproj", "{81604748-73C5-43FA-8E27-BE0AB28618C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "00-0Json8.3.1", "..\Common\00-1Json8.3\Json8.3\00-0Json8.3.1.csproj", "{1A10FDB2-1A6A-44A8-AB4D-33387563247E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "00MesWorkMqtt", "..\Common\00MesWorkMqtt\MesWorkMqtt\00MesWorkMqtt.csproj", "{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "01_01DoWhatPlc", "..\Common\01DoWhatPlc\01_01DoWhatPlc.csproj", "{0D1AF432-439A-4920-8692-43AE139F5530}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02_02WebApiCallPLC", "..\Common\02WebApiCall\02_02WebApiCallPLC.csproj", "{3E6D1DD5-01C9-435F-9941-61F906CE35BB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "04-DataBaseAccess", "..\Common\04DataBaseAccess\DataBaseAccess\04-DataBaseAccess.csproj", "{F434E066-4C59-47C8-AA82-6F48CC84501A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "07BusinessFacade", "..\Common\07WebBusinessFacade\BusinessFacade\07BusinessFacade.csproj", "{F0A0C525-03FD-428A-9B17-7F54AA0E4475}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "08-WebFun_base", "..\Common\08WebFun_base\WebFun_base\08-WebFun_base.csproj", "{D98BE764-ADEB-488D-9714-61E308AA8201}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "09-MesDataFunction", "..\Common\09MesDataFunction\MesDataFunction\09-MesDataFunction.csproj", "{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{81604748-73C5-43FA-8E27-BE0AB28618C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{81604748-73C5-43FA-8E27-BE0AB28618C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81604748-73C5-43FA-8E27-BE0AB28618C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81604748-73C5-43FA-8E27-BE0AB28618C3}.Release|Any CPU.Build.0 = Release|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Release|Any CPU.Build.0 = Release|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Release|Any CPU.Build.0 = Release|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Release|Any CPU.Build.0 = Release|Any CPU
{3E6D1DD5-01C9-435F-9941-61F906CE35BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E6D1DD5-01C9-435F-9941-61F906CE35BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E6D1DD5-01C9-435F-9941-61F906CE35BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E6D1DD5-01C9-435F-9941-61F906CE35BB}.Release|Any CPU.Build.0 = Release|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Release|Any CPU.Build.0 = Release|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Release|Any CPU.Build.0 = Release|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Release|Any CPU.Build.0 = Release|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AC76E79B-C576-4AF6-889E-57D1B50CC4F4}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!--<add key="MqttUrl" value="124.220.32.217:1883,MES/InstantMessaging/MisServer" />-->
<add key="MqttUrl" value="124.220.15.242:1883,MES/InstantMessaging/SY/MisServer"/>
<add key="MqttTargetTopic" value="MES/InstantMessaging/SY"/>
<add key="MqttTargetTopicTagTypeCodeID" value="MES/TagTypeCodeID"/>
<add key="Url_WebApi" value="http://localhost:41186"/>
<add key="ConnectionString_MES" value="server=124.220.15.242\MSSQLSERVER2012,1433;User ID=meswork;Password=126.com;database=MacroinfBasicDB_SY;Connection Reset=FALSE"/>
<add key="OPName01" value="OP1010|1"/>
<add key="OPName02" value="OP1011|2"/>
<add key="OPName03" value="OP0050|3"/>
<!--扫描枪COM口-->
<add key="PortName" value="COM1"/>
<!--读超时即在1000内未读到数据就引起超时异常-->
<add key="ReadTimeout" value="1000"/>
<!--比特率-->
<add key="BaudRate" value="115200"/>
<!--祛除后尾乱码-->
<add key="ScannerTrim" value="1"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,325 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Data;
using System.Net;
using System.IO;
using System.IO.Ports;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace SyUpLoad
{
partial class PartLoad
{
/// <summary>
/// 从DataReceived扫描枪发送条码到处理程序
/// BarCode(string barCode)
/// </summary>
/// <param name="barCode"></param>
public delegate void BarCodeInvoke(string barCode);
/// <summary>
/// BarCode(string barCode)
/// 从DataReceived扫描枪发送条码到处理程序
/// </summary>
BarCodeInvoke barCodeInvoke;
/// <summary>
/// 当前扫描枪类型
/// 1:手持2固定
/// </summary>
string ScannerType_Current = "1";
//手持扫描枪
private System.IO.Ports.SerialPort serialPort1 = new SerialPort();
/// <summary>
/// 初始化COM通讯口
/// </summary>
public void SetCOM()
{
try
{
//首选扫描枪
barCodeInvoke = new BarCodeInvoke(BarCode);
SetCOM1();
}
catch (Exception err)
{
// ApplicationLog.WriteLog(err, err.Message);
}
}
/// <summary>
/// 初始化COM通讯口
/// </summary>
public void SetCOM1()
{
try
{
//if (ApplicationConfig.PortName.Length < 3)
//{
// return;
//}
serialPort1.PortName = PortName; //端口号
serialPort1.BaudRate = BaudRate; //比特率默认为9600
serialPort1.Parity = Parity.None;//奇偶校验
serialPort1.StopBits = StopBits.One;//停止位
serialPort1.ReadTimeout = ReadTimeout; //读超时即在1000内未读到数据就引起超时异常
serialPort1.DtrEnable = true;
serialPort1.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived);
OpenSerialPort();
}
catch (Exception err)
{
//ApplicationLog.WriteLog(err, err.Message);
}
finally
{
}
}
/// <summary>
/// 关闭扫描枪
/// </summary>
private void OpenSerialPortAll()
{
SetCOM1();
}
/// <summary>
/// 打开扫描枪
/// </summary>
private bool OpenSerialPort()
{
try
{
//if (ApplicationConfig.PortName.Length < 4)
//{
// return true;
//}
if (serialPort1 == null) return true;
if (!serialPort1.IsOpen)
{
serialPort1.Open();
SerialPort_Closing = false;
}
return true;
}
catch (Exception err)
{
//ApplicationLog.WriteLog(err, err.Message);
return false;
}
}
/// <summary>
/// 关闭扫描枪
/// </summary>
private bool CloseSerialPort()
{
try
{
//if (ApplicationConfig.PortName.Length < 4)
//{
// return true;
//}
if (serialPort1 == null) return true;
//根据当前串口对象,来判断操作
if (serialPort1.IsOpen)
{
SerialPort_Closing = true;
while (SerialPort_Listening) Application.DoEvents();
serialPort1.Close();
}
return true;
}
catch (Exception err)
{
//ApplicationLog.WriteLog(err, "CloseSerialPort");
return false;
}
}
/// <summary>
/// 关闭扫描枪
/// </summary>
private void CloseSerialPortAll()
{
CloseSerialPort();
}
/// <summary>
/// 是否没有执行完invoke相关操作
/// </summary>
private bool SerialPort_Listening = false;
/// <summary>
/// 是否正在关闭串口执行Application.DoEvents
/// </summary>
private bool SerialPort_Closing = false;
/// <summary>
/// 处理手持扫描枪
/// 对于总线缸盖上线工位扫描枪是固定扫描枪。F102
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
//byte[] readBuf;
//int HowTime = ApplicationConfig.HowTime;
//int ByteTime = ApplicationConfig.ByteTime;
string barCode;
//获取或设置一个值,该值在串行通信过程中启用数据终端就绪 (DTR) 信号。
//如果为 true则启用数据终端就绪 (DTR);否则为 false。默认为 false。
bool DtrEnable = serialPort1.DtrEnable;
//如果已将数据设置就绪信号发送到该端口,则为 true否则为 false。
bool DsrHolding = serialPort1.DsrHolding;
//如果端口处于中断状态,则为 true否则为 false。
bool BreakState = serialPort1.BreakState; ;
if (SerialPort_Closing) return;
//如果正在关闭,忽略操作,直接返回, 尽快的完成串口监听线程的一次循环
try
{
//设置标记说明我已经开始处理数据一会儿要使用系统UI的。
SerialPort_Listening = true;
//20110225 zhangji
//获取扫描枪信息时加延时,否则可能无法完全读取扫描的信息
Thread.Sleep(200);
int n = serialPort1.BytesToRead;
byte[] buf = new byte[n];
//声明一个临时数组存储当前来的串口数据
serialPort1.Read(buf, 0, n);
n = n - ScannerTrim;
barCode = Encoding.UTF8.GetString(buf, 0, n);
BeginInvoke(barCodeInvoke, new Object[] { barCode });
}
catch (Exception err)
{
barCode = "";
//ApplicationLog.WriteLog(err, err.Message);
}
finally
{
//清空扫描枪缓冲区
serialPort1.DiscardInBuffer();
SerialPort_Listening = false;//我用完了ui可以关闭串口了。
//最后用完了先关闭串口,然后再打开串口
CloseSerialPort();
OpenSerialPort();
}
}
/// <summary>
/// 字符数组转字符串16进制
/// </summary>
/// <param name="InBytes"> 二进制字节</param>
/// <returns>类似"01 02 0F"</returns>
public static string ByteToString(byte[] InBytes)
{
string StringOut = "";
foreach (byte InByte in InBytes)
{
StringOut = StringOut + String.Format("{0:X2}", InByte) + " ";
}
return StringOut.Trim();
}
/// <summary>
/// strhex 转字节数组
/// </summary>
/// <param name="InString">类似"01 02 0F" 用空格分开的 </param>
/// <returns></returns>
public static byte[] StringToByte_Int(string InString)
{
string[] ByteStrings;
ByteStrings = InString.Split("|".ToCharArray());
byte[] ByteOut;
ByteOut = new byte[ByteStrings.Length];
try
{
for (int i = 0; i <= ByteStrings.Length - 1; i++)
{
ByteOut[i] = byte.Parse(ByteStrings[i]);
}
}
catch (Exception err)
{
//ApplicationLog.WriteLog(err, err.Message);
}
return ByteOut;
}
/// <summary>
/// strhex 转字节数组
/// </summary>
/// <param name="InString">类似"01 02 0F" 用空格分开的 </param>
/// <returns></returns>
public static byte[] StringToByte(string InString)
{
string[] ByteStrings;
ByteStrings = InString.Split(" ".ToCharArray());
byte[] ByteOut;
ByteOut = new byte[ByteStrings.Length];
for (int i = 0; i <= ByteStrings.Length - 1; i++)
{
ByteOut[i] = byte.Parse(ByteStrings[i], System.Globalization.NumberStyles.HexNumber);
}
return ByteOut;
}
/// <summary>
/// strhex 转字节数组
/// </summary>
/// <param name="InString">类似"01 02 0F" 中间无空格</param>
/// <returns></returns>
public static byte[] StringToByte_2(string InString)
{
byte[] ByteOut;
InString = InString.Replace(" ", "");
try
{
string[] ByteStrings = new string[InString.Length / 2];
int j = 0;
for (int i = 0; i < ByteStrings.Length; i++)
{
ByteStrings[i] = InString.Substring(j, 2);
j += 2;
}
ByteOut = new byte[ByteStrings.Length];
for (int i = 0; i <= ByteStrings.Length - 1; i++)
{
ByteOut[i] = byte.Parse(ByteStrings[i], System.Globalization.NumberStyles.HexNumber);
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
return ByteOut;
}
/// <summary>
/// 字符串 转16进制字符串
/// </summary>
/// <param name="InString">unico</param>
/// <returns>类似“01 0f”</returns>
public static string Str_To_0X(string InString)
{
return ByteToString(UnicodeEncoding.Default.GetBytes(InString));
}
}
}

View File

@@ -0,0 +1,57 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Data;
using System.Net;
using System.IO;
using System.IO.Ports;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Configuration;
namespace SyUpLoad
{
/// <summary>
/// 扫描枪
/// </summary>
partial class PartLoad
{
string PortName = ConfigurationManager.AppSettings["PortName"];
int ReadTimeout = Convert.ToInt32( ConfigurationManager.AppSettings["ReadTimeout"]);
int BaudRate = Convert.ToInt32(ConfigurationManager.AppSettings["BaudRate"]);
int ScannerTrim = Convert.ToInt32(ConfigurationManager.AppSettings["ScannerTrim"]);
/// <summary>
/// 处理条码信息
/// </summary>
/// <param name="barCode"></param>
private void BarCode(string barCode)
{
try
{
barCode = barCode.Replace("\r\n", "");
textBox_barcode.Text = barCode;
button_barcode_Click(null, null);
//string sendStr = "BarCode|Bar|" + ApplicationConfig.OpName + "|" + barCode;
//发送UDP到MES通讯服务器
//ApplicationLog.WriteLog("11111111111111");
//asySendMessage(sendStr);
}
catch (Exception err)
{
// ApplicationLog.WriteLog(err, "BarCode");
}
}
}
}

View File

View File

@@ -0,0 +1,174 @@
using bizFacade;
using MesServerWork;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SyUpLoad
{
class SyUpLoadFun1
{
public static void MesServerFunction(string msgValue)
{
try
{
DoWhatPlc.ReturnValueString rv = Newtonsoft.Json.JsonConvert.DeserializeObject<DoWhatPlc.ReturnValueString>(msgValue);
string OpName;
string tagValue;
string fun;
string mesServerCode;
string mesServerdllName;
OpName = rv.OpName;
switch (rv.TagValue.ToLower())
{
case "false":
tagValue = "0";
break;
case "true":
tagValue = "1";
break;
default:
tagValue = rv.TagValue;
break;
}
switch (rv.TagTypeCodeID)
{
//PLC 申请发动机编号 PartLoad
case "43":
PartLoad(OpName, tagValue);
break;
//PLC 传递机型 EngineTypeGetOverPLC
case "44":
EngineTypeGetOverPLC(OpName, tagValue);
break;
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesServerFunction");
}
}
/// <summary>
/// MES将盆子码(DB24-63)[74]、小车号(DBB20)[112]、机型代码(DBB22)[73]、机型(DBB64-103)[75]信息写到交互DB块中
/// (DBX0.1=1)[5] MES传递机型
/// </summary>
public static void PartLoad(string OpName,string tagValue)
{
//获得 盆子码(发动机号)、小车号、机型代码、机型
try
{
int engineTypeID;
string engineID;
string engineType;
byte kuweiNum;
if (tagValue == "1")
{
// BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
DataTable dt;
BaseDataSystemMES.GetUpLoadBarCodeEngineID(OpName, out dt);
if (dt.Rows.Count < 1)
{
//button_ManualPartLoad.Invoke(new Action(() => {
// button_ManualPartLoad.Enabled = true;
//}));
MessageBox.Show("虚拟库存无件,请扫描上线工位小车上的工件条码");
return;
}
engineTypeID = Convert.ToInt32(dt.Rows[0]["机型代码"]);
engineID = dt.Rows[0]["发动机号"].ToString();
engineType = dt.Rows[0]["发动机型号"].ToString();
kuweiNum = Convert.ToByte(dt.Rows[0]["库位号"]);
string OrderForm = dt.Rows[0]["订单号"].ToString();
MIS_BASE.Read_PalletCode(OpName, out int PartPallet_Code);
//BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, OrderForm, engineTypeID, engineType, engineID, PartPallet_Code, 0, 0, "");
////将产品信息写入PLC
MIS_BASE.Write_EngineTypeID_MES(OpName, engineTypeID);
MIS_BASE.Write_EngineType_MES(OpName, engineType);
MIS_BASE.Write_EngineID_MES(OpName, engineID);
DtWebApi.ReadWritePLC.WritePLC("112", OpName, kuweiNum);
MIS_BASE.Write_EngineTypeGetOver_MES(OpName, true);
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function03:PartLoad");
}
}
/// <summary>
/// 44
/// 1 : 保存数据
/// 0 :复位
/// </summary>
/// <param name="tagValue"></param>
public static void EngineTypeGetOverPLC(string opName,string tagValue)
{
switch (tagValue)
{
case "0":
MIS_BASE.Write_EngineTypeGetOver_MES(opName, false);
MIS_BASE.Write_MaterialVerifyOver(opName, false);
break;
case "1":
//string opName;
string orderForm="";
int PartPalletCode;
string engineType;
int engineTypeID;
string engineID;
string barCodeType="1";
// BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
////将产品信息从PLC读取
MIS_BASE.Read_EngineTypeID(opName,out engineTypeID);
MIS_BASE.Read_EngineType(opName, out engineType);
MIS_BASE.Read_EngineID(opName, out engineID);
MIS_BASE.Read_PalletCode(opName, out PartPalletCode);
string kuweiNum = DtWebApi.ReadWritePLC.ReadPLC("112", opName).ToString();
BaseDataSystemMES.GetUpLoadEngineIDOrderForm(opName,kuweiNum, out DataTable dt);
if(dt.Rows.Count>0)
{
orderForm = dt.Rows[0]["订单号"].ToString();
}
BaseDataSystemMES.OpName_MIS_MOBY_Insert(opName, orderForm, engineTypeID, engineType, engineID, PartPalletCode, 0, 0, "");
//MES保存数据 减掉盆子库存
/// <summary>
/// 电子看板_发动机号_线首工位_增加
/// </summary>
/// <param name="opName">工位号</param>
/// <param name="orderForm">订单号</param>
/// <param name="PartPalletCode">托盘号</param>
/// <param name="engineType">工件机型</param>
/// <param name="dt">工件机型,机型代码,工件编号, 壳体编号型号,工件流水号,QR码,基本流水号</param>
BaseDataSystemMES.GetEngineID_Save_Outline(opName, orderForm, PartPalletCode.ToString(), engineType, engineTypeID, engineID, barCodeType);
BaseDataSystemMES.GetUpLoadBarCode_0utUpdate(opName, kuweiNum);
MIS_BASE.Write_MaterialVerifyOver(opName, true);
break;
}
}
}
}

229
SyUpLoad/SyUpLoad/Fun2.cs Normal file
View File

@@ -0,0 +1,229 @@
using bizFacade;
using MesServerWork;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SyUpLoad
{
class SyUpLoadFun2
{
public static void MesServerFunction(string msgValue)
{
try
{
DoWhatPlc.ReturnValueString rv = Newtonsoft.Json.JsonConvert.DeserializeObject<DoWhatPlc.ReturnValueString>(msgValue);
string OpName;
string tagValue;
string fun;
string mesServerCode;
string mesServerdllName;
OpName = rv.OpName;
switch (rv.TagValue.ToLower())
{
case "false":
tagValue = "0";
break;
case "true":
tagValue = "1";
break;
default:
tagValue = rv.TagValue;
break;
}
switch (rv.TagTypeCodeID)
{
////PLC 申请发动机编号 PartLoad
//case "43":
// PartLoad(OpName, tagValue);
// break;
////PLC 传递机型 EngineTypeGetOverPLC
//case "44":
// EngineTypeGetOverPLC(OpName, tagValue);
// break;
//MES 申请下线 PalletDown
case "50":
PalletDown(OpName, tagValue);
break;
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesServerFunction");
}
}
public static void PalletDown(string opName, string tagValue)
{
switch (tagValue)
{
case "0":
DtWebApi.ReadWritePLC.WritePLC("35", opName, false);
break;
case "1":
//保存数据
//string opName;
string orderForm = "";
int PartPalletCode;
string engineType;
int engineTypeID;
string engineID;
string barCodeType = "1";
// BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
////将产品信息从PLC读取
MIS_BASE.Read_EngineTypeID(opName, out engineTypeID);
MIS_BASE.Read_EngineType(opName, out engineType);
MIS_BASE.Read_EngineID(opName, out engineID);
MIS_BASE.Read_PalletCode(opName, out PartPalletCode);
string kuweiNum = DtWebApi.ReadWritePLC.ReadPLC("112", opName).ToString();
//第一步,查询订单号,保存机型、机型代码、总成号、托盘号、订单号到数据库
BaseDataSystemMES.GetEngineID_Select(opName, engineID, out DataTable dt);
if (dt != null && dt.Rows.Count > 0)
{
orderForm = Convert.ToString(dt.Rows[0]["订单号"]);
}
//BaseDataSystemMES.GetUpLoadEngineIDOrderForm(opName, kuweiNum, out DataTable dt);
//if (dt.Rows.Count > 0)
//{
// orderForm = dt.Rows[0]["订单号"].ToString();
//}
BaseDataSystemMES.OpName_MIS_MOBY_Insert(opName, orderForm, engineTypeID, engineType, engineID, PartPalletCode, 0, 0, "");
DtWebApi.ReadWritePLC.WritePLC("35", opName, true);
break;
}
}
/// <summary>
/// PartLoadDBX500.3=1[43]
/// </summary>
public static void PartLoad(string OpName,string tagValue)
{
//获得 盆子码(发动机号)、小车号、机型代码、机型
try
{
int engineTypeID;
string engineID;
string engineType;
string PartCode_engineType;
byte kuweiNum;
if (tagValue == "1")
{
////将产品信息读PLC
MIS_BASE.Read_EngineTypeID(OpName,out engineTypeID);
MIS_BASE.Read_EngineType(OpName,out engineType);
MIS_BASE.Read_EngineID(OpName,out engineID);
string PartCode1;
string[] PartCodeList = new string[6];
string PartCode2;
string PartCode3;
string PartCode4;
string PartCode5;
string PartCode6;
PartCodeList[0] = DtWebApi.ReadWritePLC.ReadPLC("2001", OpName).ToString();
PartCodeList[1] = DtWebApi.ReadWritePLC.ReadPLC("2002", OpName).ToString();
PartCodeList[2] = DtWebApi.ReadWritePLC.ReadPLC("2003", OpName).ToString();
PartCodeList[3] = DtWebApi.ReadWritePLC.ReadPLC("2004", OpName).ToString();
PartCodeList[4] = DtWebApi.ReadWritePLC.ReadPLC("2005", OpName).ToString();
PartCodeList[5] = DtWebApi.ReadWritePLC.ReadPLC("2006", OpName).ToString();
int codeID=2007;//2007 2008 2009 2010 2011 2012
bool IsMath=false;
for (int i = 0; i < PartCodeList.Length; i++)
{
codeID = codeID + i;
//处理字符串
PartCode_engineType = GetEngineType(PartCodeList[i]);
if (PartCode_engineType != null)
{
if (PartCode_engineType == engineType)
{
DtWebApi.ReadWritePLC.WritePLC(codeID.ToString(), OpName, 1);
IsMath = true;
}
else
{
DtWebApi.ReadWritePLC.WritePLC(codeID.ToString(), OpName, 2);
}
}
}
if(IsMath)
{
DtWebApi.ReadWritePLC.WritePLC("2014", OpName, 1);
}
else
{
DtWebApi.ReadWritePLC.WritePLC("2014", OpName, 2);
}
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function03:PartLoad");
}
}
private static string GetEngineType(string PartCode)
{
return PartCode;
}
/// <summary>
/// 44
/// 1 : 保存数据
/// 0 :复位
/// </summary>
/// <param name="tagValue"></param>
public static void EngineTypeGetOverPLC(string opName,string tagValue)
{
switch (tagValue)
{
case "0":
DtWebApi.ReadWritePLC.WritePLC("2014", opName, 0);
MIS_BASE.Write_MaterialVerifyOver(opName, false);
break;
case "1":
string engineType;
int engineTypeID;
string engineID;
string engineType_MES;
int engineTypeID_MES;
string engineID_MES;
// BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
////将产品信息从PLC读取
MIS_BASE.Read_EngineTypeID(opName,out engineTypeID);
MIS_BASE.Read_EngineType(opName, out engineType);
MIS_BASE.Read_EngineID(opName, out engineID);
//将分线数据,汇总到总线
////将产品信息从PLC读取
MIS_BASE.Read_EngineTypeID_MES(opName, out engineTypeID_MES);
MIS_BASE.Read_EngineType_MES(opName, out engineType_MES);
MIS_BASE.Read_EngineID_MES(opName, out engineID_MES);
//1转移数据到总线
BaseDataSystemMES.MailLineAndSubLineData_Insert(engineID, engineTypeID, engineType, engineID_MES);//分线上总线数据转移
MIS_BASE.Write_MaterialVerifyOver(opName, true);
break;
}
}
}
}

View File

@@ -0,0 +1,222 @@
using bizFacade;
using MesServerWork;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SyUpLoad
{
class SyUpLoadFun3
{
public static void MesServerFunction(string msgValue)
{
try
{
DoWhatPlc.ReturnValueString rv = Newtonsoft.Json.JsonConvert.DeserializeObject<DoWhatPlc.ReturnValueString>(msgValue);
string OpName;
string tagValue;
string fun;
string mesServerCode;
string mesServerdllName;
OpName = rv.OpName;
switch (rv.TagValue.ToLower())
{
case "false":
tagValue = "0";
break;
case "true":
tagValue = "1";
break;
default:
tagValue = rv.TagValue;
break;
}
switch (rv.TagTypeCodeID)
{
//PLC 申请发动机编号 PartLoad
case "43":
PartLoad(OpName, tagValue);
break;
//PLC 传递机型 EngineTypeGetOverPLC
case "44":
EngineTypeGetOverPLC(OpName, tagValue);
break;
//MES 申请下线 PalletDown
case "50":
PalletDown(OpName, tagValue);
break;
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesServerFunction");
}
}
public static void PalletDown(string opName, string tagValue)
{
switch (tagValue)
{
case "0":
DtWebApi.ReadWritePLC.WritePLC("35", opName, false);
break;
case "1":
//保存数据
//string opName;
string orderForm = "";
int PartPalletCode;
string engineType;
int engineTypeID;
string engineID;
string barCodeType = "1";
// BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
////将产品信息从PLC读取
MIS_BASE.Read_EngineTypeID(opName, out engineTypeID);
MIS_BASE.Read_EngineType(opName, out engineType);
MIS_BASE.Read_EngineID(opName, out engineID);
MIS_BASE.Read_PalletCode(opName, out PartPalletCode);
string kuweiNum = DtWebApi.ReadWritePLC.ReadPLC("112", opName).ToString();
//第一步,查询订单号,保存机型、机型代码、总成号、托盘号、订单号到数据库
BaseDataSystemMES.GetEngineID_Select(opName, engineID, out DataTable dt);
if (dt != null && dt.Rows.Count > 0)
{
orderForm = Convert.ToString(dt.Rows[0]["订单号"]);
}
//BaseDataSystemMES.GetUpLoadEngineIDOrderForm(opName, kuweiNum, out DataTable dt);
//if (dt.Rows.Count > 0)
//{
// orderForm = dt.Rows[0]["订单号"].ToString();
//}
BaseDataSystemMES.OpName_MIS_MOBY_Insert(opName, orderForm, engineTypeID, engineType, engineID, PartPalletCode, 0, 0, "");
DtWebApi.ReadWritePLC.WritePLC("35", opName, true);
break;
}
}
/// <summary>
/// MES将盆子码(DB24-63)[74]、小车号(DBB20)[112]、机型代码(DBB22)[73]、机型(DBB64-103)[75]信息写到交互DB块中
/// (DBX0.1=1)[5] MES传递机型
/// </summary>
public static void PartLoad(string OpName,string tagValue)
{
//获得 盆子码(发动机号)、小车号、机型代码、机型
try
{
int engineTypeID;
string engineID;
string engineType;
byte kuweiNum;
if (tagValue == "1")
{
// BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
DataTable dt;
BaseDataSystemMES.GetUpLoadBarCodeEngineID(OpName, out dt);
if (dt.Rows.Count < 1)
{
//button_ManualPartLoad.Invoke(new Action(() => {
// button_ManualPartLoad.Enabled = true;
//}));
MessageBox.Show("虚拟库存无件,请扫描上线工位小车上的工件条码");
return;
}
engineTypeID = Convert.ToInt32(dt.Rows[0]["机型代码"]);
engineID = dt.Rows[0]["发动机号"].ToString();
engineType = dt.Rows[0]["发动机型号"].ToString();
kuweiNum = Convert.ToByte(dt.Rows[0]["库位号"]);
string OrderForm = dt.Rows[0]["订单号"].ToString();
MIS_BASE.Read_PalletCode(OpName, out int PartPallet_Code);
//BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, OrderForm, engineTypeID, engineType, engineID, PartPallet_Code, 0, 0, "");
////将产品信息写入PLC
MIS_BASE.Write_EngineTypeID_MES(OpName, engineTypeID);
MIS_BASE.Write_EngineType_MES(OpName, engineType);
MIS_BASE.Write_EngineID_MES(OpName, engineID);
DtWebApi.ReadWritePLC.WritePLC("112", OpName, kuweiNum);
MIS_BASE.Write_EngineTypeGetOver_MES(OpName, true);
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function03:PartLoad");
}
}
/// <summary>
/// 44
/// 1 : 保存数据
/// 0 :复位
/// </summary>
/// <param name="tagValue"></param>
public static void EngineTypeGetOverPLC(string opName,string tagValue)
{
switch (tagValue)
{
case "0":
MIS_BASE.Write_EngineTypeGetOver_MES(opName, false);
MIS_BASE.Write_MaterialVerifyOver(opName, false);
break;
case "1":
//string opName;
string orderForm="";
int PartPalletCode;
string engineType;
int engineTypeID;
string engineID;
string barCodeType="1";
// BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
////将产品信息从PLC读取
MIS_BASE.Read_EngineTypeID(opName,out engineTypeID);
MIS_BASE.Read_EngineType(opName, out engineType);
MIS_BASE.Read_EngineID(opName, out engineID);
MIS_BASE.Read_PalletCode(opName, out PartPalletCode);
string kuweiNum = DtWebApi.ReadWritePLC.ReadPLC("112", opName).ToString();
BaseDataSystemMES.GetUpLoadEngineIDOrderForm(opName,kuweiNum, out DataTable dt);
if(dt.Rows.Count>0)
{
orderForm = dt.Rows[0]["订单号"].ToString();
}
BaseDataSystemMES.OpName_MIS_MOBY_Insert(opName, orderForm, engineTypeID, engineType, engineID, PartPalletCode, 0, 0, "");
//MES保存数据 减掉盆子库存
/// <summary>
/// 电子看板_发动机号_线首工位_增加
/// </summary>
/// <param name="opName">工位号</param>
/// <param name="orderForm">订单号</param>
/// <param name="PartPalletCode">托盘号</param>
/// <param name="engineType">工件机型</param>
/// <param name="dt">工件机型,机型代码,工件编号, 壳体编号型号,工件流水号,QR码,基本流水号</param>
BaseDataSystemMES.GetEngineID_Save_Outline(opName, orderForm, PartPalletCode.ToString(), engineType, engineTypeID, engineID, barCodeType);
BaseDataSystemMES.GetUpLoadBarCode_0utUpdate(opName, kuweiNum);
MIS_BASE.Write_MaterialVerifyOver(opName, true);
break;
}
}
}
}

View File

@@ -0,0 +1,134 @@
using System;
using System.Data;
using bizFacade;
using MesServerWork;
namespace SyUpLoad
{
partial class PartLoad
{
/// <summary>
/// 正常逻辑工作(传递机型)
/// </summary>
/// <param name="OpName"></param>
/// <param name="EngineTypeID"></param>
/// <param name="EngineType"></param>
/// <param name="EngineID"></param>
/// <param name="PartPallet_Code"></param>
private void EngineTypeGetOver_PLC_Work(string OpName, int EngineTypeID, string EngineType, string EngineID, int PartPallet_Code)
{
int IsAllowWork;
int IsrepairBarcode = 0;//拆解返修标志
int RepairPartStatusPLC = 0;
int MES_QualityMask = 1;
string OrderForm = "";//订单号
string EngineID_MES;
string repairBarcode = "";//拆解返修条码
bool MesRead = false;
bool MesReadOver = false;
DataTable dt;
MIS_BASE.Read_EngineID_MES(OpName, out EngineID_MES);//获取MES总成号
MIS_BASE.Read_MesReadOver(OpName, out MesReadOver); //保存完成
MIS_BASE.Read_QualityData_Read_CF(OpName, out MesRead); //允许保存
MIS_BASE.Read_PalletInfo(OpName, out MES_QualityMask);//合格标志
MIS_BASE.Read_RepairStatus_PLC(OpName, out RepairPartStatusPLC);//返修标志
BaseDataSystemMES.GetEngineID_Select(OpName, EngineID, out dt);//查询订单信息
if (dt != null&&dt.Rows.Count > 0)
{
OrderForm = Convert.ToString(dt.Rows[0]["订单号"]);
IsrepairBarcode = Convert.ToInt32(dt.Rows[0]["拆解标志"]);
repairBarcode = Convert.ToString(dt.Rows[0]["拆解返修条码"]);
}
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, OrderForm, EngineTypeID, EngineType, EngineID, PartPallet_Code, 0, IsrepairBarcode, repairBarcode);
SaveMobyMessage(OpName, EngineTypeID, EngineType, EngineID, OrderForm);
Sendmessage("5", "1", OpName);
SendInfomation("QualityMask", Convert.ToString(MES_QualityMask), OpName);
SendInfomation("RepairPartStatusPLC", Convert.ToString(RepairPartStatusPLC), OpName);
BaseDataSystemMES.MaterialPush_EngineIDStatus_Insert(OpName);
if (EngineID_MES == EngineID)
{
string kuweiNum;
kuweiNum = DtWebApi.ReadWritePLC.ReadPLC(warehouseLocation.ToString(), OpName).ToString();
BaseDataSystemMES.GetUpLoadBarCode_0utUpdate(OpName, kuweiNum);
MIS_BASE.Write_FixAllow(OpName, true);
InitOpname01();
}
else
{
AsyncSendMessage_Notice(OpName, "PLC与MES不一致");
}
}
private void InitOpname01()
{
BaseDataSystemMES.GetUpLoadBarCode(OPName01, out DataTable dt_OPName01);
dataGridView_OPA1001.Invoke(new Action(() => {
dataGridView_OPA1001.DataSource = dt_OPName01;
}));
}
/// <summary>
/// 保存MOBY信息
/// </summary>
/// <param name="OpName"></param>
/// <param name="engineTypeID"></param>
/// <param name="engineType"></param>
/// <param name="engineID"></param>
private void SaveMobyMessage(string OpName, int engineTypeID, string engineType, string engineID, string orderForm)
{
if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID == null)
{
MIS_BASE.InitHashtable_MesServerCode();
}
if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID.ContainsKey(OpName))
{
MIS_BASE.hashtable_EngineGetOver_EngineTypeID[OpName] = engineTypeID;
}
if (MIS_BASE.hashtable_EngineGetOver_EngineType.ContainsKey(OpName))
{
MIS_BASE.hashtable_EngineGetOver_EngineType[OpName] = engineType;
}
if (MIS_BASE.hashtable_EngineGetOver_EngineID.ContainsKey(OpName))
{
MIS_BASE.hashtable_EngineGetOver_EngineID[OpName] = engineID;
}
if (MIS_BASE.hashtable_EngineGetOver_OrderForm.ContainsKey(OpName))
{
MIS_BASE.hashtable_EngineGetOver_OrderForm[OpName] = orderForm;
}
}
/// <summary>
/// 返修件需要工作
/// </summary>
/// <param name="OpName">工位号</param>
private void IsNeedRepaire_OK(string OpName)
{
int isRepair;
int engineTypeID;
string engineType = "";
string engineID = "";
string palletCode = "";
string orderForm = "";
string repairCode = "";
//从监控系统中查询出本工位信息
BaseDataSystemMES.OpName_MIS_Moby_Select(OpName,
out orderForm, out engineTypeID, out engineType,
out engineID, out palletCode, out isRepair, out repairCode);
EngineTypeGetOver_PLC_Work(OpName, engineTypeID, engineType, engineID, Convert.ToInt32(palletCode));
}
}
}

View File

@@ -0,0 +1,139 @@
using System;
using bizFacade;
//using SystemFramework;
namespace SyUpLoad
{
/// <summary>
/// 此类用于向WEB发送各种类型消息
/// </summary>
partial class PartLoad
{
/// <summary>
/// 批量发送WEB消息Value为BOOL值
/// </summary>
/// <param name="MessageNumm">消息编号组合</param>
/// <param name="Value">消息值组合</param>
/// <param name="OpName">工位号</param>
void Sendmessage(string MessageNumm, string Value, string OpName)
{
for (int i = 0; i < MessageNumm.Length; i++)
{
Sendmessage(MessageNumm[i], Value[i].ToString(), OpName);
}
}
/// <summary>
/// 选择发送给WEB的消息
/// </summary>
/// <param name="Num">消息类型</param>
/// <param name="OpName">消息工位</param>
void Sendmessage(char Num, string Value, string OpName)
{
string SendMessage;
switch (Num)
{
case '1':
//1直接在界面通过选择机型确认工序内容
SendMessage = "MES|ProcessList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '2':
//2显示物料
SendMessage = "MES|MaterialList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '3':
//3显示操作指导图片
SendMessage = "MES|PicShow|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '4':
//4显示订单完工数量
SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '5':
SendMessage = "MES|ShowMoby|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '6':
SendMessage = "MES|MaterialCheckPosition|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '7':
SendMessage = "MES|WorkStart|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '8':
break;
case '9':
SendMessage = "MES|ConfirmOkGo|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case 'a':
SendMessage = "MES|FixAllow|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
}
}
/// <summary>
/// 向WEB发送信息value为字符串
/// </summary>
/// <param name="Command">消息种类</param>
/// <param name="Value">消息内容</param>
/// <param name="OpName">工位号</param>
void SendInfomation(string Command, string Value, string OpName)
{
string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
}
/// <summary>
/// 发送在线产量、在线节拍
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private void SendActuallyCount(string OpName, int tagValue)
{
//当工件离开时,更新在线产量、在线节拍
if (tagValue == 0)
{
try
{
int opNameCount = 0;//在线产量
int opNameCountTime = 0;//在线节拍
//基本数据_工作日历_班次产量查询_New
BaseDataSystemMES.OpNameCount_New(OpName, out opNameCount, out opNameCountTime);
string SendMessage;
SendMessage = "MES|ActuallyCount|" + OpName + "|" + opNameCount.ToString() + "&" + opNameCountTime.ToString();
AsyncSendMessage(SendMessage);
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function03:SendActuallyCount");
}
}
}
}
}

View File

@@ -0,0 +1,57 @@
using bizFacade;
//using SystemFramework;
using MesServerWork;
namespace SyUpLoad
{
partial class PartLoad
{
/// <summary>
/// 发送信息到MES通讯服务器或者其他的
/// </summary>
/// <param name="Message"></param>
private void AsyncSendMessage(string Message)
{
// asyncSendMessage(Message);
MIS_BASE.asyncSendMessage(Message);
//Thread t = new Thread(delegate() { asyncSendMessage(Message); });
//t.Start();
}
/// <summary>
/// 发送提示消息
/// </summary>
/// <param name="Message"></param>
private void AsyncSendMessage_Notice(string opname, string notice)
{
//通知Web界面
BaseDataSystemMES.Web_Notice_Insert(opname, notice);
string SendMessage = "MES|Notice|" + opname + "|" + "1";
MIS_BASE.asyncSendMessage(SendMessage);
}
/// <summary>
/// 发送信息到打印机
/// </summary>
/// <param name="Message"></param>
private void asyncSendMessageToMark(string Message)
{
//System.Threading.Thread.Sleep(10);
string messageSend = (string)Message;
//UDPClientSend.Send_ALL(ApplicationConfig.MES_MarkPortNum, messageSend);
}
/// <summary>
/// 发送信息到LED
/// </summary>
/// <param name="Message"></param>
private void asyncSendMessageLED(string OpName)
{
//发送到大屏幕显示 41104
string strMessage = "MIS|" + OpName + "|" + "0" + "|" + "1";
//UDPClientSend.Send_ALL(ApplicationConfig.Port_ShowLED_ProductCount, strMessage);
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,180 @@
using bizFacade;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SyUpLoad
{
public partial class PartLoad
{
/// <summary>
/// 获取自动或手动,并以对应的方式创建总成号
/// </summary>
/// <param name="opName">工位号</param>
/// <param name="engineType">产品型号</param>
/// <param name="engineID">产品编号</param>
private void CreateEngineID(string OpName, out string engineType, out int engineTypeID, out string engineID, out string orderForm)
{
//string orderForm = "";//订单号
string repairCode = "";//返修代码
string engineID2 = "";
string palletCode = "";//托盘编号
int palletCode_PLC = 0;
int isRepair = 0;
int engineNumber = 0;
int IsAutoOrManul = 0;//0为自动方式1为手动方式
DataTable dt_EngineType = null;
DataTable dt_temp_isAutoOrManul;//查询创建总成编号的table
engineType = "";
engineID = "";
//获取订单号,发动机型号,发动机型号代码(在线首工位将选择的订单,机型等信息保存到监控表中)
BaseDataSystemMES.OpName_MIS_Moby_Select(OpName, out orderForm, out engineTypeID, out engineType, out engineID2, out palletCode, out isRepair, out repairCode);
//MIS_BASE.Read_PalletCode(OpName, out palletCode_PLC);//获取托盘编号
//以自动或手动方式创建发动机号
CreateEngineID(OpName, IsAutoOrManul, orderForm, engineType, engineTypeID, palletCode_PLC.ToString(), engineNumber, out dt_EngineType, out engineID);
}
/// <summary>
/// 以自动或手动方式创建工件编号
/// </summary>
/// <param name="opName">工位号</param>
/// <param name="IsAutoOrManul">自动手动</param>
/// <param name="orderForm">订单号</param>
/// <param name="engineType">产品型号</param>
/// <param name="engineTypeID">产品型号代码</param>
/// <param name="palletCode">托盘编号</param>
/// <param name="engineYear">手动创建_年</param>
/// <param name="engineMoon">手动创建_月</param>
/// <param name="engineDay">手动创建_日</param>
/// <param name="engineNumber">流水号</param>
/// <param name="dt_EngineType">返回信息</param>
/// <param name="engineID">产品编号</param>
/// <param name="printBarCode1_MES"></param>
/// <param name="printBarCode2_MES"></param>
private void CreateEngineID(string opName, int IsAutoOrManul, string orderForm, string engineType, int engineTypeID, string palletCode, int engineNumber, out DataTable dt_EngineType, out string engineID)
{
string engineYear = "";
string engineMoon = "";
string engineDay = "";
DataTable dt_MaualPrint;
dt_EngineType = null;
engineID = "";
//自动方式创建工件编号
CreateEngineID_Auto(opName, orderForm, engineType, engineTypeID, palletCode, out dt_EngineType, out engineID);
if (!GetEngineID_Save(opName, IsAutoOrManul, orderForm, engineType, engineTypeID, engineID, palletCode.ToString(), dt_EngineType, engineYear, engineMoon, engineDay))
{
engineID = "";
engineTypeID = -1;
engineType = "";
//AsyncSendMessage_Notice(opName, "保存工件信息出错...");
return;
}
}
/// <summary>
/// 自动方式创建工件编号
/// </summary>
/// <param name="opName"></param>
/// <param name="orderForm"></param>
/// <param name="engineType"></param>
/// <param name="engineTypeID"></param>
/// <param name="palletCode">托盘号</param>
/// <param name="dt_EngineType"></param>
/// <param name="engineID">发动机号</param>
private void CreateEngineID_Auto(string opName, string orderForm, string engineType, int engineTypeID, string palletCode, out DataTable dt_EngineType, out string engineID)
{
dt_EngineType = null;
engineID = "";
BaseDataSystemMES.GetEngineID_Auto_branch(opName, engineType, palletCode, out dt_EngineType);
if (dt_EngineType != null && dt_EngineType.Rows.Count > 0)
{
engineID = dt_EngineType.Rows[0]["发动机号"].ToString();
}
}
/// <summary>
/// 手动方式创建总成号
/// </summary>
/// <param name="opName"></param>
/// <param name="orderForm"></param>
/// <param name="engineType"></param>
/// <param name="engineTypeID"></param>
/// <param name="palletCode"></param>
/// <param name="engineYear"></param>
/// <param name="engineMoon"></param>
/// <param name="engineDay"></param>
/// <param name="engineNumber"></param>
/// <param name="dt_EngineType"></param>
/// <param name="engineID"></param>
private void CreateEngineID_Manul(string opName, string orderForm, string engineType, int engineTypeID, string palletCode,
string engineYear, string engineMoon, string engineDay, int engineNumber, out DataTable dt_EngineType, out string engineID)
{
dt_EngineType = null;
engineID = "";
//手动方式创建
BaseDataSystemMES.GetEngineID_Manual_branch(opName, engineType, engineYear, engineMoon, engineDay, engineNumber, true, out dt_EngineType);
if (dt_EngineType != null)
{
if (dt_EngineType.Rows.Count > 0)
{
engineID = dt_EngineType.Rows[0]["发动机号"].ToString();
}
}
}
/// <summary>
/// 电子看板_发动机号_线首工位_增加
/// </summary>
/// <param name="opName"></param>
/// <param name="IsAutoOrManul"></param>
/// <param name="orderForm"></param>
/// <param name="engineType"></param>
/// <param name="engineTypeID"></param>
/// <param name="engineID"></param>
/// <param name="partPalletCode"></param>
/// <param name="dt_EngineType"></param>
/// <param name="year"></param>
/// <param name="month"></param>
/// <param name="day"></param>
/// <returns></returns>
private bool GetEngineID_Save(string opName, int IsAutoOrManul,
string orderForm, string engineType, int engineTypeID, string engineID, string partPalletCode, DataTable dt_EngineType,
string year, string month, string day
)
{
if (IsAutoOrManul == 1)
{
string EngineID_DateTime = year + "-" + month + "-" + day + " 00:00:00";
return BaseDataSystemMES.GetEngineID_ManulEngine_Save(opName, orderForm, partPalletCode, engineType, EngineID_DateTime, dt_EngineType);
}
else
{
return BaseDataSystemMES.GetEngineID_Save(opName, orderForm, partPalletCode, engineType, dt_EngineType);
}
}
}
}

786
SyUpLoad/SyUpLoad/PartLoad.Designer.cs generated Normal file
View File

@@ -0,0 +1,786 @@
namespace SyUpLoad
{
partial class PartLoad
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button_barcode = new System.Windows.Forms.Button();
this.textBox_barcode = new System.Windows.Forms.TextBox();
this.dataGridView_OPA1001 = new System.Windows.Forms.DataGridView();
this.dataGridView_OPA1002 = new System.Windows.Forms.DataGridView();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.button_ManualPartLoad3 = new System.Windows.Forms.Button();
this.button_ManualPartLoad2 = new System.Windows.Forms.Button();
this.textBox__PlcPosition3 = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.textBox__PlcPosition2 = new System.Windows.Forms.TextBox();
this.textBox_PlcEngineID3 = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.textBox_PlcType3 = new System.Windows.Forms.TextBox();
this.textBox_PlcEngineID2 = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.textBox_PlcType2 = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.checkBox_MesReadOver3 = new System.Windows.Forms.CheckBox();
this.checkBox_WorkStart3 = new System.Windows.Forms.CheckBox();
this.checkBox_MesRead3 = new System.Windows.Forms.CheckBox();
this.checkBox_MesGoOver3 = new System.Windows.Forms.CheckBox();
this.checkBox_PlcEngineTypeGetOver3 = new System.Windows.Forms.CheckBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.checkBox_WorkStart2 = new System.Windows.Forms.CheckBox();
this.checkBox_MesReadOver2 = new System.Windows.Forms.CheckBox();
this.checkBox_MesRead2 = new System.Windows.Forms.CheckBox();
this.checkBox_MesGoOver2 = new System.Windows.Forms.CheckBox();
this.checkBox_PlcEngineTypeGetOver2 = new System.Windows.Forms.CheckBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button_ManualPartLoad = new System.Windows.Forms.Button();
this.textBox__PlcPosition = new System.Windows.Forms.TextBox();
this.textBox_PlcEngineID = new System.Windows.Forms.TextBox();
this.textBox_MesPosition = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.textBox_MesEngineID = new System.Windows.Forms.TextBox();
this.textBox_PlcType = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.textBox_MesType = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.checkBox_WorkStart = new System.Windows.Forms.CheckBox();
this.checkBox_MesGoOver = new System.Windows.Forms.CheckBox();
this.checkBox_PlcEngineTypeGetOver = new System.Windows.Forms.CheckBox();
this.checkBox_MesEngineTypeGetOver = new System.Windows.Forms.CheckBox();
this.checkBox_PartLoad = new System.Windows.Forms.CheckBox();
this.button_OrderForm = new System.Windows.Forms.Button();
this.radioButton6 = new System.Windows.Forms.RadioButton();
this.radioButton5 = new System.Windows.Forms.RadioButton();
this.radioButton4 = new System.Windows.Forms.RadioButton();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
((System.ComponentModel.ISupportInitialize)(this.dataGridView_OPA1001)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView_OPA1002)).BeginInit();
this.groupBox1.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// button_barcode
//
this.button_barcode.Location = new System.Drawing.Point(677, 59);
this.button_barcode.Name = "button_barcode";
this.button_barcode.Size = new System.Drawing.Size(61, 23);
this.button_barcode.TabIndex = 4;
this.button_barcode.Text = "扫描条码";
this.button_barcode.UseVisualStyleBackColor = true;
this.button_barcode.Click += new System.EventHandler(this.button_barcode_Click);
//
// textBox_barcode
//
this.textBox_barcode.Location = new System.Drawing.Point(530, 20);
this.textBox_barcode.Name = "textBox_barcode";
this.textBox_barcode.Size = new System.Drawing.Size(208, 21);
this.textBox_barcode.TabIndex = 3;
//
// dataGridView_OPA1001
//
this.dataGridView_OPA1001.AllowUserToAddRows = false;
this.dataGridView_OPA1001.AllowUserToDeleteRows = false;
this.dataGridView_OPA1001.AllowUserToResizeColumns = false;
this.dataGridView_OPA1001.AllowUserToResizeRows = false;
this.dataGridView_OPA1001.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView_OPA1001.Location = new System.Drawing.Point(6, 107);
this.dataGridView_OPA1001.MultiSelect = false;
this.dataGridView_OPA1001.Name = "dataGridView_OPA1001";
this.dataGridView_OPA1001.RowTemplate.Height = 23;
this.dataGridView_OPA1001.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView_OPA1001.Size = new System.Drawing.Size(384, 201);
this.dataGridView_OPA1001.TabIndex = 5;
//
// dataGridView_OPA1002
//
this.dataGridView_OPA1002.AllowUserToAddRows = false;
this.dataGridView_OPA1002.AllowUserToDeleteRows = false;
this.dataGridView_OPA1002.AllowUserToResizeColumns = false;
this.dataGridView_OPA1002.AllowUserToResizeRows = false;
this.dataGridView_OPA1002.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView_OPA1002.Location = new System.Drawing.Point(6, 20);
this.dataGridView_OPA1002.MultiSelect = false;
this.dataGridView_OPA1002.Name = "dataGridView_OPA1002";
this.dataGridView_OPA1002.RowTemplate.Height = 23;
this.dataGridView_OPA1002.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView_OPA1002.Size = new System.Drawing.Size(384, 193);
this.dataGridView_OPA1002.TabIndex = 5;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.button_ManualPartLoad3);
this.groupBox1.Controls.Add(this.button_ManualPartLoad2);
this.groupBox1.Controls.Add(this.textBox__PlcPosition3);
this.groupBox1.Controls.Add(this.label12);
this.groupBox1.Controls.Add(this.textBox__PlcPosition2);
this.groupBox1.Controls.Add(this.textBox_PlcEngineID3);
this.groupBox1.Controls.Add(this.label9);
this.groupBox1.Controls.Add(this.textBox_PlcType3);
this.groupBox1.Controls.Add(this.textBox_PlcEngineID2);
this.groupBox1.Controls.Add(this.label11);
this.groupBox1.Controls.Add(this.textBox_PlcType2);
this.groupBox1.Controls.Add(this.label10);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.groupBox5);
this.groupBox1.Controls.Add(this.groupBox4);
this.groupBox1.Controls.Add(this.dataGridView_OPA1002);
this.groupBox1.Location = new System.Drawing.Point(12, 332);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(776, 309);
this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "分线上线";
//
// button_ManualPartLoad3
//
this.button_ManualPartLoad3.Location = new System.Drawing.Point(315, 253);
this.button_ManualPartLoad3.Name = "button_ManualPartLoad3";
this.button_ManualPartLoad3.Size = new System.Drawing.Size(75, 40);
this.button_ManualPartLoad3.TabIndex = 19;
this.button_ManualPartLoad3.Text = "手动转线";
this.button_ManualPartLoad3.UseVisualStyleBackColor = true;
//
// button_ManualPartLoad2
//
this.button_ManualPartLoad2.Enabled = false;
this.button_ManualPartLoad2.Location = new System.Drawing.Point(633, 200);
this.button_ManualPartLoad2.Name = "button_ManualPartLoad2";
this.button_ManualPartLoad2.Size = new System.Drawing.Size(124, 36);
this.button_ManualPartLoad2.TabIndex = 18;
this.button_ManualPartLoad2.Text = "手动入库";
this.button_ManualPartLoad2.UseVisualStyleBackColor = true;
this.button_ManualPartLoad2.Click += new System.EventHandler(this.button_ManualPartLoad2_Click);
//
// textBox__PlcPosition3
//
this.textBox__PlcPosition3.Location = new System.Drawing.Point(167, 282);
this.textBox__PlcPosition3.Name = "textBox__PlcPosition3";
this.textBox__PlcPosition3.Size = new System.Drawing.Size(141, 21);
this.textBox__PlcPosition3.TabIndex = 17;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(100, 285);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(47, 12);
this.label12.TabIndex = 16;
this.label12.Text = "PLC库位";
//
// textBox__PlcPosition2
//
this.textBox__PlcPosition2.Location = new System.Drawing.Point(475, 89);
this.textBox__PlcPosition2.Name = "textBox__PlcPosition2";
this.textBox__PlcPosition2.Size = new System.Drawing.Size(141, 21);
this.textBox__PlcPosition2.TabIndex = 17;
//
// textBox_PlcEngineID3
//
this.textBox_PlcEngineID3.Location = new System.Drawing.Point(167, 255);
this.textBox_PlcEngineID3.Name = "textBox_PlcEngineID3";
this.textBox_PlcEngineID3.Size = new System.Drawing.Size(141, 21);
this.textBox_PlcEngineID3.TabIndex = 14;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(408, 92);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(47, 12);
this.label9.TabIndex = 16;
this.label9.Text = "PLC库位";
//
// textBox_PlcType3
//
this.textBox_PlcType3.Location = new System.Drawing.Point(167, 228);
this.textBox_PlcType3.Name = "textBox_PlcType3";
this.textBox_PlcType3.Size = new System.Drawing.Size(141, 21);
this.textBox_PlcType3.TabIndex = 15;
//
// textBox_PlcEngineID2
//
this.textBox_PlcEngineID2.Location = new System.Drawing.Point(475, 62);
this.textBox_PlcEngineID2.Name = "textBox_PlcEngineID2";
this.textBox_PlcEngineID2.Size = new System.Drawing.Size(141, 21);
this.textBox_PlcEngineID2.TabIndex = 14;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(100, 258);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(59, 12);
this.label11.TabIndex = 12;
this.label11.Text = "PLC流水号";
//
// textBox_PlcType2
//
this.textBox_PlcType2.Location = new System.Drawing.Point(475, 35);
this.textBox_PlcType2.Name = "textBox_PlcType2";
this.textBox_PlcType2.Size = new System.Drawing.Size(141, 21);
this.textBox_PlcType2.TabIndex = 15;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(100, 231);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(47, 12);
this.label10.TabIndex = 13;
this.label10.Text = "PLC机型";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(408, 65);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(59, 12);
this.label7.TabIndex = 12;
this.label7.Text = "PLC流水号";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(408, 38);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(47, 12);
this.label8.TabIndex = 13;
this.label8.Text = "PLC机型";
//
// groupBox5
//
this.groupBox5.Controls.Add(this.checkBox_MesReadOver3);
this.groupBox5.Controls.Add(this.checkBox_WorkStart3);
this.groupBox5.Controls.Add(this.checkBox_MesRead3);
this.groupBox5.Controls.Add(this.checkBox_MesGoOver3);
this.groupBox5.Controls.Add(this.checkBox_PlcEngineTypeGetOver3);
this.groupBox5.Location = new System.Drawing.Point(410, 155);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(124, 144);
this.groupBox5.TabIndex = 10;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "PLC通讯";
//
// checkBox_MesReadOver3
//
this.checkBox_MesReadOver3.AutoSize = true;
this.checkBox_MesReadOver3.Location = new System.Drawing.Point(20, 122);
this.checkBox_MesReadOver3.Name = "checkBox_MesReadOver3";
this.checkBox_MesReadOver3.Size = new System.Drawing.Size(72, 16);
this.checkBox_MesReadOver3.TabIndex = 19;
this.checkBox_MesReadOver3.Text = "保存完成";
this.checkBox_MesReadOver3.UseVisualStyleBackColor = true;
//
// checkBox_WorkStart3
//
this.checkBox_WorkStart3.AutoSize = true;
this.checkBox_WorkStart3.Location = new System.Drawing.Point(20, 20);
this.checkBox_WorkStart3.Name = "checkBox_WorkStart3";
this.checkBox_WorkStart3.Size = new System.Drawing.Size(72, 16);
this.checkBox_WorkStart3.TabIndex = 8;
this.checkBox_WorkStart3.Text = "工件到位";
this.checkBox_WorkStart3.UseVisualStyleBackColor = true;
//
// checkBox_MesRead3
//
this.checkBox_MesRead3.AutoSize = true;
this.checkBox_MesRead3.Location = new System.Drawing.Point(20, 89);
this.checkBox_MesRead3.Name = "checkBox_MesRead3";
this.checkBox_MesRead3.Size = new System.Drawing.Size(72, 16);
this.checkBox_MesRead3.TabIndex = 20;
this.checkBox_MesRead3.Text = "允许保存";
this.checkBox_MesRead3.UseVisualStyleBackColor = true;
//
// checkBox_MesGoOver3
//
this.checkBox_MesGoOver3.AutoSize = true;
this.checkBox_MesGoOver3.Location = new System.Drawing.Point(20, 67);
this.checkBox_MesGoOver3.Name = "checkBox_MesGoOver3";
this.checkBox_MesGoOver3.Size = new System.Drawing.Size(90, 16);
this.checkBox_MesGoOver3.TabIndex = 8;
this.checkBox_MesGoOver3.Text = "MES工作完成";
this.checkBox_MesGoOver3.UseVisualStyleBackColor = true;
//
// checkBox_PlcEngineTypeGetOver3
//
this.checkBox_PlcEngineTypeGetOver3.AutoSize = true;
this.checkBox_PlcEngineTypeGetOver3.Location = new System.Drawing.Point(20, 45);
this.checkBox_PlcEngineTypeGetOver3.Name = "checkBox_PlcEngineTypeGetOver3";
this.checkBox_PlcEngineTypeGetOver3.Size = new System.Drawing.Size(90, 16);
this.checkBox_PlcEngineTypeGetOver3.TabIndex = 8;
this.checkBox_PlcEngineTypeGetOver3.Text = "PLC传递机型";
this.checkBox_PlcEngineTypeGetOver3.UseVisualStyleBackColor = true;
//
// groupBox4
//
this.groupBox4.Controls.Add(this.checkBox_WorkStart2);
this.groupBox4.Controls.Add(this.checkBox_MesReadOver2);
this.groupBox4.Controls.Add(this.checkBox_MesRead2);
this.groupBox4.Controls.Add(this.checkBox_MesGoOver2);
this.groupBox4.Controls.Add(this.checkBox_PlcEngineTypeGetOver2);
this.groupBox4.Location = new System.Drawing.Point(633, 20);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(124, 169);
this.groupBox4.TabIndex = 10;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "PLC通讯";
//
// checkBox_WorkStart2
//
this.checkBox_WorkStart2.AutoSize = true;
this.checkBox_WorkStart2.Location = new System.Drawing.Point(20, 20);
this.checkBox_WorkStart2.Name = "checkBox_WorkStart2";
this.checkBox_WorkStart2.Size = new System.Drawing.Size(72, 16);
this.checkBox_WorkStart2.TabIndex = 8;
this.checkBox_WorkStart2.Text = "工件到位";
this.checkBox_WorkStart2.UseVisualStyleBackColor = true;
//
// checkBox_MesReadOver2
//
this.checkBox_MesReadOver2.AutoSize = true;
this.checkBox_MesReadOver2.Location = new System.Drawing.Point(20, 135);
this.checkBox_MesReadOver2.Name = "checkBox_MesReadOver2";
this.checkBox_MesReadOver2.Size = new System.Drawing.Size(72, 16);
this.checkBox_MesReadOver2.TabIndex = 8;
this.checkBox_MesReadOver2.Text = "保存完成";
this.checkBox_MesReadOver2.UseVisualStyleBackColor = true;
//
// checkBox_MesRead2
//
this.checkBox_MesRead2.AutoSize = true;
this.checkBox_MesRead2.Location = new System.Drawing.Point(20, 96);
this.checkBox_MesRead2.Name = "checkBox_MesRead2";
this.checkBox_MesRead2.Size = new System.Drawing.Size(72, 16);
this.checkBox_MesRead2.TabIndex = 8;
this.checkBox_MesRead2.Text = "允许保存";
this.checkBox_MesRead2.UseVisualStyleBackColor = true;
//
// checkBox_MesGoOver2
//
this.checkBox_MesGoOver2.AutoSize = true;
this.checkBox_MesGoOver2.Location = new System.Drawing.Point(20, 74);
this.checkBox_MesGoOver2.Name = "checkBox_MesGoOver2";
this.checkBox_MesGoOver2.Size = new System.Drawing.Size(90, 16);
this.checkBox_MesGoOver2.TabIndex = 8;
this.checkBox_MesGoOver2.Text = "MES工作完成";
this.checkBox_MesGoOver2.UseVisualStyleBackColor = true;
//
// checkBox_PlcEngineTypeGetOver2
//
this.checkBox_PlcEngineTypeGetOver2.AutoSize = true;
this.checkBox_PlcEngineTypeGetOver2.Location = new System.Drawing.Point(20, 47);
this.checkBox_PlcEngineTypeGetOver2.Name = "checkBox_PlcEngineTypeGetOver2";
this.checkBox_PlcEngineTypeGetOver2.Size = new System.Drawing.Size(90, 16);
this.checkBox_PlcEngineTypeGetOver2.TabIndex = 8;
this.checkBox_PlcEngineTypeGetOver2.Text = "PLC传递机型";
this.checkBox_PlcEngineTypeGetOver2.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.button_ManualPartLoad);
this.groupBox2.Controls.Add(this.textBox__PlcPosition);
this.groupBox2.Controls.Add(this.textBox_PlcEngineID);
this.groupBox2.Controls.Add(this.textBox_MesPosition);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.textBox_MesEngineID);
this.groupBox2.Controls.Add(this.textBox_PlcType);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.textBox_MesType);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.groupBox3);
this.groupBox2.Controls.Add(this.button_OrderForm);
this.groupBox2.Controls.Add(this.radioButton6);
this.groupBox2.Controls.Add(this.radioButton5);
this.groupBox2.Controls.Add(this.radioButton4);
this.groupBox2.Controls.Add(this.radioButton3);
this.groupBox2.Controls.Add(this.radioButton2);
this.groupBox2.Controls.Add(this.radioButton1);
this.groupBox2.Controls.Add(this.dataGridView_OPA1001);
this.groupBox2.Controls.Add(this.textBox_barcode);
this.groupBox2.Controls.Add(this.button_barcode);
this.groupBox2.Location = new System.Drawing.Point(12, 12);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(776, 314);
this.groupBox2.TabIndex = 9;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "分线上线";
//
// button_ManualPartLoad
//
this.button_ManualPartLoad.Enabled = false;
this.button_ManualPartLoad.Location = new System.Drawing.Point(633, 262);
this.button_ManualPartLoad.Name = "button_ManualPartLoad";
this.button_ManualPartLoad.Size = new System.Drawing.Size(124, 36);
this.button_ManualPartLoad.TabIndex = 12;
this.button_ManualPartLoad.Text = "手动上线";
this.button_ManualPartLoad.UseVisualStyleBackColor = true;
//this.button_ManualPartLoad.Click += new System.EventHandler(this.button_ManualPartLoad_Click);
//
// textBox__PlcPosition
//
this.textBox__PlcPosition.Location = new System.Drawing.Point(475, 259);
this.textBox__PlcPosition.Name = "textBox__PlcPosition";
this.textBox__PlcPosition.Size = new System.Drawing.Size(141, 21);
this.textBox__PlcPosition.TabIndex = 11;
//
// textBox_PlcEngineID
//
this.textBox_PlcEngineID.Location = new System.Drawing.Point(475, 232);
this.textBox_PlcEngineID.Name = "textBox_PlcEngineID";
this.textBox_PlcEngineID.Size = new System.Drawing.Size(141, 21);
this.textBox_PlcEngineID.TabIndex = 11;
//
// textBox_MesPosition
//
this.textBox_MesPosition.Location = new System.Drawing.Point(475, 169);
this.textBox_MesPosition.Name = "textBox_MesPosition";
this.textBox_MesPosition.Size = new System.Drawing.Size(141, 21);
this.textBox_MesPosition.TabIndex = 11;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(408, 262);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(47, 12);
this.label6.TabIndex = 10;
this.label6.Text = "PLC库位";
//
// textBox_MesEngineID
//
this.textBox_MesEngineID.Location = new System.Drawing.Point(475, 142);
this.textBox_MesEngineID.Name = "textBox_MesEngineID";
this.textBox_MesEngineID.Size = new System.Drawing.Size(141, 21);
this.textBox_MesEngineID.TabIndex = 11;
//
// textBox_PlcType
//
this.textBox_PlcType.Location = new System.Drawing.Point(475, 205);
this.textBox_PlcType.Name = "textBox_PlcType";
this.textBox_PlcType.Size = new System.Drawing.Size(141, 21);
this.textBox_PlcType.TabIndex = 11;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(408, 172);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(47, 12);
this.label3.TabIndex = 10;
this.label3.Text = "MES库位";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(408, 235);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(59, 12);
this.label5.TabIndex = 10;
this.label5.Text = "PLC流水号";
//
// textBox_MesType
//
this.textBox_MesType.Location = new System.Drawing.Point(475, 115);
this.textBox_MesType.Name = "textBox_MesType";
this.textBox_MesType.Size = new System.Drawing.Size(141, 21);
this.textBox_MesType.TabIndex = 11;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(408, 208);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(47, 12);
this.label4.TabIndex = 10;
this.label4.Text = "PLC机型";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(408, 145);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(59, 12);
this.label2.TabIndex = 10;
this.label2.Text = "MES流水号";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(408, 118);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 12);
this.label1.TabIndex = 10;
this.label1.Text = "MES机型";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.checkBox_WorkStart);
this.groupBox3.Controls.Add(this.checkBox_MesGoOver);
this.groupBox3.Controls.Add(this.checkBox_PlcEngineTypeGetOver);
this.groupBox3.Controls.Add(this.checkBox_MesEngineTypeGetOver);
this.groupBox3.Controls.Add(this.checkBox_PartLoad);
this.groupBox3.Location = new System.Drawing.Point(633, 107);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(124, 146);
this.groupBox3.TabIndex = 9;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "PLC通讯";
//
// checkBox_WorkStart
//
this.checkBox_WorkStart.AutoSize = true;
this.checkBox_WorkStart.Location = new System.Drawing.Point(20, 20);
this.checkBox_WorkStart.Name = "checkBox_WorkStart";
this.checkBox_WorkStart.Size = new System.Drawing.Size(72, 16);
this.checkBox_WorkStart.TabIndex = 8;
this.checkBox_WorkStart.Text = "工件到位";
this.checkBox_WorkStart.UseVisualStyleBackColor = true;
//
// checkBox_MesGoOver
//
this.checkBox_MesGoOver.AutoSize = true;
this.checkBox_MesGoOver.Location = new System.Drawing.Point(20, 111);
this.checkBox_MesGoOver.Name = "checkBox_MesGoOver";
this.checkBox_MesGoOver.Size = new System.Drawing.Size(90, 16);
this.checkBox_MesGoOver.TabIndex = 8;
this.checkBox_MesGoOver.Text = "MES工作完成";
this.checkBox_MesGoOver.UseVisualStyleBackColor = true;
//
// checkBox_PlcEngineTypeGetOver
//
this.checkBox_PlcEngineTypeGetOver.AutoSize = true;
this.checkBox_PlcEngineTypeGetOver.Location = new System.Drawing.Point(20, 89);
this.checkBox_PlcEngineTypeGetOver.Name = "checkBox_PlcEngineTypeGetOver";
this.checkBox_PlcEngineTypeGetOver.Size = new System.Drawing.Size(90, 16);
this.checkBox_PlcEngineTypeGetOver.TabIndex = 8;
this.checkBox_PlcEngineTypeGetOver.Text = "PLC传递机型";
this.checkBox_PlcEngineTypeGetOver.UseVisualStyleBackColor = true;
//
// checkBox_MesEngineTypeGetOver
//
this.checkBox_MesEngineTypeGetOver.AutoSize = true;
this.checkBox_MesEngineTypeGetOver.Location = new System.Drawing.Point(20, 67);
this.checkBox_MesEngineTypeGetOver.Name = "checkBox_MesEngineTypeGetOver";
this.checkBox_MesEngineTypeGetOver.Size = new System.Drawing.Size(90, 16);
this.checkBox_MesEngineTypeGetOver.TabIndex = 8;
this.checkBox_MesEngineTypeGetOver.Text = "MES传递机型";
this.checkBox_MesEngineTypeGetOver.UseVisualStyleBackColor = true;
//
// checkBox_PartLoad
//
this.checkBox_PartLoad.AutoSize = true;
this.checkBox_PartLoad.Location = new System.Drawing.Point(20, 42);
this.checkBox_PartLoad.Name = "checkBox_PartLoad";
this.checkBox_PartLoad.Size = new System.Drawing.Size(72, 16);
this.checkBox_PartLoad.TabIndex = 8;
this.checkBox_PartLoad.Text = "申请上线";
this.checkBox_PartLoad.UseVisualStyleBackColor = true;
//
// button_OrderForm
//
this.button_OrderForm.Location = new System.Drawing.Point(530, 59);
this.button_OrderForm.Name = "button_OrderForm";
this.button_OrderForm.Size = new System.Drawing.Size(75, 23);
this.button_OrderForm.TabIndex = 7;
this.button_OrderForm.Text = "下订单";
this.button_OrderForm.UseVisualStyleBackColor = true;
//
// radioButton6
//
this.radioButton6.AutoSize = true;
this.radioButton6.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.radioButton6.Location = new System.Drawing.Point(304, 68);
this.radioButton6.Name = "radioButton6";
this.radioButton6.Size = new System.Drawing.Size(104, 33);
this.radioButton6.TabIndex = 6;
this.radioButton6.Text = "库位6";
this.radioButton6.UseVisualStyleBackColor = true;
//
// radioButton5
//
this.radioButton5.AutoSize = true;
this.radioButton5.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.radioButton5.Location = new System.Drawing.Point(304, 29);
this.radioButton5.Name = "radioButton5";
this.radioButton5.Size = new System.Drawing.Size(104, 33);
this.radioButton5.TabIndex = 6;
this.radioButton5.Text = "库位5";
this.radioButton5.UseVisualStyleBackColor = true;
//
// radioButton4
//
this.radioButton4.AutoSize = true;
this.radioButton4.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.radioButton4.Location = new System.Drawing.Point(158, 68);
this.radioButton4.Name = "radioButton4";
this.radioButton4.Size = new System.Drawing.Size(104, 33);
this.radioButton4.TabIndex = 6;
this.radioButton4.Text = "库位4";
this.radioButton4.UseVisualStyleBackColor = true;
//
// radioButton3
//
this.radioButton3.AutoSize = true;
this.radioButton3.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.radioButton3.Location = new System.Drawing.Point(158, 29);
this.radioButton3.Name = "radioButton3";
this.radioButton3.Size = new System.Drawing.Size(104, 33);
this.radioButton3.TabIndex = 6;
this.radioButton3.Text = "库位3";
this.radioButton3.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.radioButton2.Location = new System.Drawing.Point(19, 68);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(104, 33);
this.radioButton2.TabIndex = 6;
this.radioButton2.Text = "库位2";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.radioButton1.Location = new System.Drawing.Point(19, 29);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(104, 33);
this.radioButton1.TabIndex = 6;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "库位1";
this.radioButton1.UseVisualStyleBackColor = true;
//
// PartLoad
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 653);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.DoubleBuffered = true;
this.Name = "PartLoad";
this.Text = "Form1";
this.Load += new System.EventHandler(this.PartLoad_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView_OPA1001)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView_OPA1002)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button button_barcode;
private System.Windows.Forms.TextBox textBox_barcode;
private System.Windows.Forms.DataGridView dataGridView_OPA1001;
private System.Windows.Forms.DataGridView dataGridView_OPA1002;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.RadioButton radioButton6;
private System.Windows.Forms.RadioButton radioButton5;
private System.Windows.Forms.RadioButton radioButton4;
private System.Windows.Forms.RadioButton radioButton3;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.Button button_OrderForm;
private System.Windows.Forms.CheckBox checkBox_PartLoad;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox checkBox_WorkStart;
private System.Windows.Forms.CheckBox checkBox_MesGoOver;
private System.Windows.Forms.CheckBox checkBox_PlcEngineTypeGetOver;
private System.Windows.Forms.CheckBox checkBox_MesEngineTypeGetOver;
private System.Windows.Forms.TextBox textBox__PlcPosition;
private System.Windows.Forms.TextBox textBox_PlcEngineID;
private System.Windows.Forms.TextBox textBox_MesPosition;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox_MesEngineID;
private System.Windows.Forms.TextBox textBox_PlcType;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox_MesType;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button_ManualPartLoad;
private System.Windows.Forms.TextBox textBox_PlcEngineID2;
private System.Windows.Forms.TextBox textBox_PlcType2;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.CheckBox checkBox_WorkStart2;
private System.Windows.Forms.CheckBox checkBox_MesGoOver2;
private System.Windows.Forms.CheckBox checkBox_PlcEngineTypeGetOver2;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.CheckBox checkBox_WorkStart3;
private System.Windows.Forms.CheckBox checkBox_MesGoOver3;
private System.Windows.Forms.CheckBox checkBox_PlcEngineTypeGetOver3;
private System.Windows.Forms.TextBox textBox__PlcPosition2;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.CheckBox checkBox_MesReadOver2;
private System.Windows.Forms.CheckBox checkBox_MesRead2;
private System.Windows.Forms.Button button_ManualPartLoad2;
private System.Windows.Forms.TextBox textBox__PlcPosition3;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox textBox_PlcEngineID3;
private System.Windows.Forms.TextBox textBox_PlcType3;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.CheckBox checkBox_MesReadOver3;
private System.Windows.Forms.CheckBox checkBox_MesRead3;
private System.Windows.Forms.Button button_ManualPartLoad3;
}
}

View File

@@ -0,0 +1,93 @@
using MesWorkMqtt;
using MQTTnet.Client.Connecting;
using MQTTnet.Client.Disconnecting;
using MQTTnet.Client.Receiving;
using bizFacade;
using MesWorkMqtt;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MQTTnet;
using System.Threading;
using DoWhatPlc;
using MesServerWork;
namespace SyUpLoad
{
public partial class PartLoad
{
private void button_barcode_Click(object sender, EventArgs e)
{
string opName;
string kuweiNum;
string barCode;
string orderForm;
string engineID;
string engineType;
int engineTypeID;
opName = OPName01;
barCode = textBox_barcode.Text.Replace("\r\n", "");
kuweiNum = Get_kuweiNum();
if (kuweiNum == "0") return;
CreateEngineID(opName, out engineType, out engineTypeID, out engineID, out orderForm);
if(engineID.Length<1)
{
MessageBox.Show("入库失败");
return;
}
BaseDataSystemMES.GetUpLoadBarCode_Update(opName, kuweiNum, barCode, orderForm,
engineID, engineType, engineTypeID);
BaseDataSystemMES.GetUpLoadBarCode(OPName01, out DataTable dt_OPName01);
dataGridView_OPA1001.DataSource = dt_OPName01;
}
private string Get_kuweiNum()
{
string kuweiNum = "0";
if (radioButton1.Checked)
{
kuweiNum = "1";
}
else if (radioButton2.Checked)
{
kuweiNum = "2";
}
else if (radioButton3.Checked)
{
kuweiNum = "3";
}
else if (radioButton4.Checked)
{
kuweiNum = "4";
}
else if (radioButton5.Checked)
{
kuweiNum = "5";
}
else if (radioButton6.Checked)
{
kuweiNum = "6";
}
return kuweiNum;
}
}
}

View File

@@ -0,0 +1,160 @@
using MesWorkMqtt;
using MQTTnet.Client.Connecting;
using MQTTnet.Client.Disconnecting;
using MQTTnet.Client.Receiving;
using bizFacade;
using MesWorkMqtt;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MQTTnet;
using System.Threading;
using DoWhatPlc;
using MesServerWork;
namespace SyUpLoad
{
public partial class PartLoad
{
/// <summary>
/// 申请上线
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
/// <summary>
/// 申请上线
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private void fun_PartLoadManual(string OpName)
{
try
{
bool engineTypeGetOver_MES;
bool partLoad;
MIS_BASE.Read_EngineTypeGetOver_MES(OpName, out engineTypeGetOver_MES);
MIS_BASE.Read_PartLoad(OpName, out partLoad);
if(partLoad == false || engineTypeGetOver_MES==true)
{
MessageBox.Show("检查申请上线信号");
return;
}
//DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
//string OpName = OPName01;
//int tagValue = Convert.ToInt32(msgEvent.TagValue);
//SetChekcBox(tagValue, checkBox_PartLoad);
int engineTypeID;
string engineID;
string engineType;
byte kuweiNum;
//if (tagValue == 1)
{
// BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
DataTable dt;
BaseDataSystemMES.GetUpLoadBarCodeEngineID(OpName, out dt);
if (dt.Rows.Count < 1)
{
button_ManualPartLoad.Invoke(new Action(() => {
button_ManualPartLoad.Enabled = true;
}));
MessageBox.Show("虚拟库存无件,请扫描上线工位小车上的工件条码");
return;
}
engineTypeID = Convert.ToInt32(dt.Rows[0]["机型代码"]);
engineID = dt.Rows[0]["发动机号"].ToString();
engineType = dt.Rows[0]["发动机型号"].ToString();
kuweiNum = Convert.ToByte(dt.Rows[0]["库位号"]);
////将产品信息写入PLC
MIS_BASE.Write_EngineTypeID_MES(OpName, engineTypeID);
MIS_BASE.Write_EngineType_MES(OpName, engineType);
MIS_BASE.Write_EngineID_MES(OpName, engineID);
DtWebApi.ReadWritePLC.WritePLC(warehouseLocation.ToString(), OpName, kuweiNum);
MIS_BASE.Write_EngineTypeGetOver_MES(OpName, true);
////将产品信息写入PLC
MIS_BASE.Read_EngineTypeID_MES(OpName, out engineTypeID);
MIS_BASE.Read_EngineType_MES(OpName, out engineType);
MIS_BASE.Read_EngineID_MES(OpName, out engineID);
kuweiNum = Convert.ToByte(DtWebApi.ReadWritePLC.ReadPLC(warehouseLocation.ToString(), OpName));
SetTextBox(engineType, textBox_MesType);
SetTextBox(engineID, textBox_MesEngineID);
SetTextBox(kuweiNum.ToString(), textBox_MesPosition);
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function03:PartLoad");
}
}
private void fun_PartLoadManual2(string OpName)
{
try
{
bool engineTypeGetOver;
bool partLoad;
int engineTypeID;
string engineID;
string engineType;
byte kuweiNum;
MIS_BASE.Read_EngineGetOver_PLC(OpName, out engineTypeGetOver);
if (engineTypeGetOver == false)
{
MessageBox.Show("检查传递机型信号");
return;
}
DataTable dt;
BaseDataSystemMES.GetUnLoadWarehouseNo(OpName, out dt);
if (dt.Rows.Count == 0)
{
MessageBox.Show("下线库位已满");
button_ManualPartLoad2.Invoke(new Action(() => {
button_ManualPartLoad2.Enabled = true;
}));
return;
}
else
{
kuweiNum = Convert.ToByte(dt.Rows[0]["库位号"]);
DtWebApi.ReadWritePLC.WritePLC(warehouseLocation.ToString(), OpName, kuweiNum);
MIS_BASE.Write_FixAllow(OpName, true);
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function03:PartLoad");
}
}
}
}

View File

@@ -0,0 +1,105 @@
using MesWorkMqtt;
using MQTTnet.Client.Connecting;
using MQTTnet.Client.Disconnecting;
using MQTTnet.Client.Receiving;
using bizFacade;
using MesWorkMqtt;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MQTTnet;
using System.Threading;
using DoWhatPlc;
using MesServerWork;
namespace SyUpLoad
{
public partial class PartLoad
{
private void MesServerFunction1(string msgValue)
{
try
{
DoWhatPlc.ReturnValueString rv = Newtonsoft.Json.JsonConvert.DeserializeObject<DoWhatPlc.ReturnValueString>(msgValue);
string OpName;
string tagValue;
string fun;
string mesServerCode;
string mesServerdllName;
OpName = rv.OpName;
switch (rv.TagValue.ToLower())
{
case "false":
tagValue = "0";
break;
case "true":
tagValue = "1";
break;
default:
tagValue = rv.TagValue;
break;
}
switch(rv.TagTypeCodeID)
{
//PLC 申请发动机编号 PartLoad
case "43":
break;
//PLC 传递机型 EngineTypeGetOverPLC
case "44":
break;
//MES 传递机型 EngineTypeGetOverMES
case "5":
break;
//MES 工作完成 MaterialVerifyOver
case "7":
break;
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesServerFunction");
}
}
private void fun_EngineTypeGetOverMES(object e)
{
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
int tagValue = Convert.ToInt32(msgEvent.TagValue);
var cb = button_ManualPartLoad;
cb.Invoke(new Action(() => {
if (tagValue == 1)
{
cb.Enabled = false;
}
else
{
cb.Enabled = true;
}
}));
SetChekcBox(tagValue, checkBox_MesEngineTypeGetOver);
}
private void button_ManualPartLoad_Click(object sender, EventArgs e)
{
fun_PartLoadManual(OPName01);
}
}
}

View File

@@ -0,0 +1,53 @@
using MesWorkMqtt;
using MQTTnet.Client.Connecting;
using MQTTnet.Client.Disconnecting;
using MQTTnet.Client.Receiving;
using bizFacade;
using MesWorkMqtt;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MQTTnet;
using System.Threading;
using DoWhatPlc;
using MesServerWork;
namespace SyUpLoad
{
public partial class PartLoad
{
private void SetChekcBox(int tagValue, object checkBox)
{
CheckBox cb = (CheckBox)checkBox;
cb.Invoke(new Action(() => {
if (tagValue == 1)
{
cb.Checked = true;
cb.BackColor = Color.LightGreen;
}
else
{
cb.Checked = false;
cb.BackColor = Color.Gray;
}
}));
}
private void SetTextBox(string text, object controlBox)
{
TextBox cb = (TextBox)controlBox;
cb.Invoke(new Action(() => {
cb.Text = text;
}));
}
}
}

View File

@@ -0,0 +1,184 @@
using MesWorkMqtt;
using MQTTnet.Client.Connecting;
using MQTTnet.Client.Disconnecting;
using MQTTnet.Client.Receiving;
using bizFacade;
using MesWorkMqtt;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MQTTnet;
using System.Threading;
using DoWhatPlc;
using MesServerWork;
using System.Collections;
namespace SyUpLoad
{
public partial class PartLoad : Form
{
public static string MqttUrl = ConfigurationManager.AppSettings["MqttUrl"];
public static string MqttTargetTopic = ConfigurationManager.AppSettings["MqttTargetTopic"];
public static string Url_WebApi = ConfigurationManager.AppSettings["Url_WebApi"];
public static string ConnectionString_MES = ConfigurationManager.AppSettings["ConnectionString_MES"];
public static string OPName01Fun = ConfigurationManager.AppSettings["OPName01"];
public static string OPName02Fun = ConfigurationManager.AppSettings["OPName02"];
//public static string OPName03Fun = ConfigurationManager.AppSettings["OPName03"];
//第一个库房工位号
public static string OPName01;
//第二个库房工位号
public static string OPName02;
public static byte warehouseLocation = 112;
Hashtable ht_OpnameFun;
DataTable dt_OPName01;
DataTable dt_OPName02;
public PartLoad()
{
InitializeComponent();
InitHashTable();
BaseDataSystemMES.GetUpLoadBarCode(OPName01, out DataTable dt_OPName01);
BaseDataSystemMES.GetUpLoadBarCode(OPName02, out DataTable dt_OPName02);
dataGridView_OPA1001.DataSource = dt_OPName01;
dataGridView_OPA1002.DataSource = dt_OPName02;
}
private void InitHashTable()
{
ht_OpnameFun = new Hashtable();
var op = OPName01Fun.Split('|');
ht_OpnameFun.Add(op[0], op[1]);
OPName01 = op[0];
op = OPName02Fun.Split('|');
ht_OpnameFun.Add(op[0], op[1]);
OPName02 = op[0];
//op = OPName03Fun.Split('|');
//ht_OpnameFun.Add(op[0], op[1]);
}
private void PartLoad_Load(object sender, EventArgs e)
{
SetCOM();
Mqtt.StartAsync();
Mqtt.mqttClient.ConnectedHandler = new MqttClientConnectedHandlerDelegate(OnSubscriberConnected);
Mqtt.mqttClient.DisconnectedHandler = new MqttClientDisconnectedHandlerDelegate(OnSubscriberDisconnected);
Mqtt.mqttClient.ApplicationMessageReceivedHandler = new MqttApplicationMessageReceivedHandlerDelegate(OnSubscriberMessageReceived);
////MesServerCode哈希表创建
//MesServerWork.MIS_BASE.InitHashtable_MesServerCode();
}
private void OnSubscriberConnected(MqttClientConnectedEventArgs x)
{
//var rec = x.AuthenticateResult.ResultCode.ToString();
//label_State.Text = rec;
}
private void OnSubscriberDisconnected(MqttClientDisconnectedEventArgs x)
{
//var rec = x.AuthenticateResult.ResultCode.ToString();
//label_State.Text = rec;
}
private void OnSubscriberMessageReceived(MqttApplicationMessageReceivedEventArgs x)
{
var rec = x.ApplicationMessage.ConvertPayloadToString();
//保存数据
//ThreadPool.QueueUserWorkItem(MIS_Funtion, rec);
//处理MES业务
ThreadPool.QueueUserWorkItem(TransferInfToMES, rec);
}
private void TransferInfToMES(object text)
{
try
{
string recData = text.ToString();
string[] dataArray = recData.Split('|');
if (dataArray.Length != 4)
return;
//消息来源
string m_Source = dataArray[0].ToString();
//消息类型 Barcode
string m_Command = dataArray[1].ToString();
//工位号
string m_OpName = dataArray[2].ToString();
//消息参数
string m_Value = dataArray[3].ToString();
//if (!m_WorkStart_OpName.ContainsKey(m_OpName)) return; //当前系统是否存在该工位
switch (m_Source)
{
case "BarCode":
//处理条码逻辑
if (m_Command == "Bar")
{
//MesServerFunction(m_OpName, m_Value, "fun_Barcode");
}
break;
case "WEB":
if (m_Command == "Barcode")
{
//MesServerFunction(m_OpName, m_Value, "fun_Barcode");
}
else
{
string Content = m_Command + "|" + m_Value;
//MesServerFunction(m_OpName, Content, "fun_WebSubmit");
}
break;
case "PLC":
if (!ht_OpnameFun.ContainsKey(m_OpName)) return;
string funID = ht_OpnameFun[m_OpName].ToString();
switch(funID)
{
case "1":
SyUpLoadFun1.MesServerFunction(m_Value);
break;
case "2":
//SyUpLoadFun2.MesServerFunction(m_Value);
break;
case "3":
//SyUpLoadFun3.MesServerFunction(m_Value);
break;
//case "3":
// MesServerFunction(m_Value);
// break;
}
break;
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "TransferInf");
}
}
private void button_ManualPartLoad2_Click(object sender, EventArgs e)
{
//fun_PartLoadManual2(OPName02);
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SyUpLoad
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new PartLoad());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("SyUpLoad")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SyUpLoad")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("81604748-73c5-43fa-8e27-be0ab28618c3")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace SyUpLoad.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SyUpLoad.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace SyUpLoad.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,205 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{81604748-73C5-43FA-8E27-BE0AB28618C3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>SyUpLoad</RootNamespace>
<AssemblyName>SyUpLoad</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MQTTnet, Version=3.0.15.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\MQTTnet.dll</HintPath>
</Reference>
<Reference Include="MQTTnet.Extensions.ManagedClient, Version=3.0.15.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\MQTTnet.Extensions.ManagedClient.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.ConfigurationManager, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Configuration.ConfigurationManager.6.0.1\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Data.OracleClient" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Security, Version=4.0.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Security.4.3.2\lib\net46\System.Net.Security.dll</HintPath>
</Reference>
<Reference Include="System.Net.WebSockets, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.WebSockets.4.3.0\lib\net46\System.Net.WebSockets.dll</HintPath>
</Reference>
<Reference Include="System.Net.WebSockets.Client, Version=4.0.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.WebSockets.Client.4.3.2\lib\net46\System.Net.WebSockets.Client.dll</HintPath>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.Security.AccessControl, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.AccessControl.6.0.0\lib\net461\System.Security.AccessControl.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.Security.Permissions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Permissions.6.0.0\lib\net461\System.Security.Permissions.dll</HintPath>
</Reference>
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
</Reference>
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="BarCode\MESPC.BarCode.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BarCode\MESPC.BarCode.Read.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Fun2.cs" />
<Compile Include="Fun1.EngineTypeGetOverPLC.cs" />
<Compile Include="Methods\EngineGetOverBaseWork.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Fun3.EngineTypeGetOverPLC.cs" />
<Compile Include="Methods\SubmitToMisweb.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Methods\UDP.Send.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PartLoad.CreateEngineID.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PartLoad.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PartLoad.Designer.cs">
<DependentUpon>PartLoad.cs</DependentUpon>
</Compile>
<Compile Include="PartLoad.Fun1.BarCode.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PartLoad.SetControl.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="PartLoad.resx">
<DependentUpon>PartLoad.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Methods\vssver2.scc" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\00-1Json8.3\Json8.3\00-0Json8.3.1.csproj">
<Project>{1a10fdb2-1a6a-44a8-ab4d-33387563247e}</Project>
<Name>00-0Json8.3.1</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\00MesWorkMqtt\MesWorkMqtt\00MesWorkMqtt.csproj">
<Project>{f55da1a0-a982-4479-8c47-0d9a5aaf3e18}</Project>
<Name>00MesWorkMqtt</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\01DoWhatPlc\01_01DoWhatPlc.csproj">
<Project>{0d1af432-439a-4920-8692-43ae139f5530}</Project>
<Name>01_01DoWhatPlc</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\02WebApiCall\02_02WebApiCallPLC.csproj">
<Project>{3e6d1dd5-01c9-435f-9941-61f906ce35bb}</Project>
<Name>02_02WebApiCallPLC</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\04DataBaseAccess\DataBaseAccess\04-DataBaseAccess.csproj">
<Project>{f434e066-4c59-47c8-aa82-6f48cc84501a}</Project>
<Name>04-DataBaseAccess</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\07WebBusinessFacade\BusinessFacade\07BusinessFacade.csproj">
<Project>{f0a0c525-03fd-428a-9b17-7f54aa0e4475}</Project>
<Name>07BusinessFacade</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\08WebFun_base\WebFun_base\08-WebFun_base.csproj">
<Project>{d98be764-adeb-488d-9714-61e308aa8201}</Project>
<Name>08-WebFun_base</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\09MesDataFunction\MesDataFunction\09-MesDataFunction.csproj">
<Project>{90e76fb4-646d-45e2-95db-0b8ab4e465d6}</Project>
<Name>09-MesDataFunction</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets'))" />
</Target>
</Project>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net461" />
<package id="NETStandard.Library" version="2.0.0" targetFramework="net461" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" />
<package id="System.Configuration.ConfigurationManager" version="6.0.1" targetFramework="net461" />
<package id="System.Net.Security" version="4.3.2" targetFramework="net461" />
<package id="System.Net.WebSockets" version="4.3.0" targetFramework="net461" />
<package id="System.Net.WebSockets.Client" version="4.3.2" targetFramework="net461" />
<package id="System.Security.AccessControl" version="6.0.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" requireReinstallation="true" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Permissions" version="6.0.0" targetFramework="net461" />
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net461" />
</packages>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
<appSettings>
<add key="Url_WebApi" value="http://localhost:41181"/>
</appSettings>
</configuration>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
SyUpLoad/dll/MQTTnet.dll Normal file

Binary file not shown.