重新修改
This commit is contained in:
1185
HisenceYoloDetection/MainForm.Designer.cs
generated
1185
HisenceYoloDetection/MainForm.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -283,16 +283,75 @@ namespace HisenceYoloDetection
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Post<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
public static string PostData(string url, string postData)
|
||||||
/// <summary>
|
{
|
||||||
/// http Post<73><74><EFBFBD><EFBFBD>
|
byte[] data = Encoding.UTF8.GetBytes(postData);
|
||||||
/// </summary>
|
|
||||||
/// <param name="parameterData"><3E><><EFBFBD><EFBFBD></param>
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||||
/// <param name="serviceUrl"><3E><><EFBFBD>ʵ<EFBFBD>ַ</param>
|
request.Method = "POST";
|
||||||
/// <param name="ContentType">Ĭ<><C4AC> application/json , application/x-www-form-urlencoded,multipart/form-data,raw,binary </param>
|
request.ContentType = "application/x-www-form-urlencoded";
|
||||||
/// <param name="Accept">Ĭ<><C4AC>application/json</param>
|
request.ContentLength = data.Length;
|
||||||
/// <returns></returns>
|
|
||||||
public string Post(string parameterData, string serviceUrl, string contentType = "application/x-www-form-urlencoded", string accept = "application/json")
|
using (Stream stream = request.GetRequestStream())
|
||||||
|
{
|
||||||
|
stream.Write(data, 0, data.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
||||||
|
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
|
||||||
|
{
|
||||||
|
return reader.ReadToEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static string FindStringAfterColon(string response, string targetString)
|
||||||
|
{
|
||||||
|
int targetIndex = response.IndexOf(targetString);
|
||||||
|
if (targetIndex == -1)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"δ<>ҵ<EFBFBD><D2B5>ַ<EFBFBD><D6B7><EFBFBD>: {targetString}");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ð<EFBFBD>ź<EFBFBD><C5BA><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
int colonIndex = response.IndexOf(':', targetIndex);
|
||||||
|
if (colonIndex == -1 || colonIndex <= targetIndex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("<22><>Ŀ<EFBFBD><C4BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD>ð<EFBFBD><C3B0>");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD>ʼ<EFBFBD><CABC>λ<EFBFBD><CEBB>
|
||||||
|
int startQuoteIndex = response.IndexOf('"', colonIndex + 1);
|
||||||
|
if (startQuoteIndex == -1)
|
||||||
|
{
|
||||||
|
Console.WriteLine("δ<>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// <20><><EFBFBD>ұպ<D2B1><D5BA><EFBFBD><EFBFBD>ŵ<EFBFBD>λ<EFBFBD><CEBB>
|
||||||
|
int endQuoteIndex = response.IndexOf('"', startQuoteIndex + 1);
|
||||||
|
if (endQuoteIndex == -1)
|
||||||
|
{
|
||||||
|
Console.WriteLine("δ<>ҵ<EFBFBD><D2B5>պϵ<D5BA><CFB5><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5>ַ<EFBFBD><D6B7><EFBFBD>
|
||||||
|
return response.Substring(startQuoteIndex + 1, endQuoteIndex - startQuoteIndex - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Post<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/// <summary>
|
||||||
|
/// http Post<73><74><EFBFBD><EFBFBD>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parameterData"><3E><><EFBFBD><EFBFBD></param>
|
||||||
|
/// <param name="serviceUrl"><3E><><EFBFBD>ʵ<EFBFBD>ַ</param>
|
||||||
|
/// <param name="ContentType">Ĭ<><C4AC> application/json , application/x-www-form-urlencoded,multipart/form-data,raw,binary </param>
|
||||||
|
/// <param name="Accept">Ĭ<><C4AC>application/json</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string Post(string parameterData, string serviceUrl, string contentType = "application/x-www-form-urlencoded", string accept = "application/json")
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -347,58 +406,45 @@ namespace HisenceYoloDetection
|
|||||||
public void GetTypeFromPost()
|
public void GetTypeFromPost()
|
||||||
{
|
{
|
||||||
string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson";
|
string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson";
|
||||||
|
string jsonData = @"
|
||||||
|
{
|
||||||
|
""StartTime"": ""2024-07-15"",
|
||||||
|
""EndTime"": ""2024-07-15"",
|
||||||
|
""LineBody"": ""BZ-PC""
|
||||||
|
}";
|
||||||
|
|
||||||
DateTime dt = DateTime.Now;
|
|
||||||
string today = dt.ToString("yyyy-MM-dd");
|
|
||||||
|
|
||||||
string startTime = today;
|
string postData = "inputvalue=" + Uri.EscapeDataString(jsonData);
|
||||||
string endTime = today;
|
|
||||||
string lineBody = "BZ-PC";
|
|
||||||
string materialDescript = "<22><><EFBFBD><EFBFBD>";
|
|
||||||
|
|
||||||
JObject patientInfo = new JObject
|
try
|
||||||
{
|
{
|
||||||
["StartTime"] = startTime,
|
string response = PostData(url, postData);
|
||||||
["EndTime"] = endTime,
|
|
||||||
["LineBody"] = lineBody,
|
|
||||||
["MaterialDescripts"] = new JArray { materialDescript }
|
|
||||||
};
|
|
||||||
|
|
||||||
string sendData = patientInfo.ToString();
|
|
||||||
string resultData = Post(sendData, url, "application/x-www-form-urlencoded", "application/json");
|
|
||||||
|
|
||||||
if (resultData != null)
|
|
||||||
{
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
||||||
JObject responseJson = JObject.Parse(resultData);
|
string finalDefIdToFind = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7); // Ŀ<><C4BF> FinalDefID
|
||||||
bool success = responseJson["success"] != null && (bool)responseJson["success"];
|
string productType = FindStringAfterColon(response, finalDefIdToFind);
|
||||||
if (success)
|
if (productType != null)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine($"{finalDefIdToFind}: {productType}");
|
||||||
|
|
||||||
// string FinalDefIDToFind = m_sKEYENCEBar.Substring(1, 18);// Ŀ<><C4BF> FinalDefID
|
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||||
JArray dataArray = responseJson["data"] as JArray;
|
|
||||||
if (dataArray != null)
|
|
||||||
{
|
|
||||||
foreach (JObject dataItem in dataArray)
|
|
||||||
{
|
|
||||||
string finalDefID = dataItem["FinalDefID"] != null ? dataItem["FinalDefID"].ToString() : "N/A";
|
|
||||||
string productType = dataItem["ProductType"] != null ? dataItem["ProductType"].ToString() : "N/A";
|
|
||||||
DayTypeDics.Add(finalDefID, productType);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string returnMsg = responseJson["ReturnMsg"] != null ? responseJson["ReturnMsg"].ToString() : "Unknown error";
|
Console.WriteLine($"FinalDefID {finalDefIdToFind} not found in response.");
|
||||||
Console.WriteLine("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>" + returnMsg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
Console.WriteLine("Error occurred:");
|
||||||
|
Console.WriteLine(ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -411,59 +457,49 @@ namespace HisenceYoloDetection
|
|||||||
Stopwatch sw = new Stopwatch();
|
Stopwatch sw = new Stopwatch();
|
||||||
sw.Start();
|
sw.Start();
|
||||||
|
|
||||||
string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson";
|
// string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson";
|
||||||
|
|
||||||
DateTime dt = DateTime.Now;
|
// string jsonData = @"
|
||||||
string today = dt.ToString("yyyy-MM-dd");
|
//{
|
||||||
|
// ""StartTime"": ""2024-07-15"",
|
||||||
|
// ""EndTime"": ""2024-07-15"",
|
||||||
|
// ""LineBody"": ""BZ-PC""
|
||||||
|
// }";
|
||||||
|
|
||||||
string startTime = today;
|
|
||||||
string endTime = today;
|
|
||||||
string lineBody = "BZ-PC";
|
|
||||||
string materialDescript = "<22><><EFBFBD><EFBFBD>";
|
|
||||||
|
|
||||||
JObject patientInfo = new JObject
|
// string postData = "inputvalue=" + Uri.EscapeDataString(jsonData);
|
||||||
{
|
|
||||||
["StartTime"] = startTime,
|
|
||||||
["EndTime"] = endTime,
|
|
||||||
["LineBody"] = lineBody,
|
|
||||||
["MaterialDescripts"] = new JArray { materialDescript }
|
|
||||||
};
|
|
||||||
|
|
||||||
string sendData = patientInfo.ToString();
|
// try
|
||||||
string resultData = Post(sendData, url, "application/x-www-form-urlencoded", "application/json");
|
// {
|
||||||
|
// string response = PostData(url, postData);
|
||||||
|
|
||||||
if (resultData != null)
|
|
||||||
{
|
|
||||||
JObject responseJson = JObject.Parse(resultData);
|
|
||||||
bool success = responseJson["success"] != null && (bool)responseJson["success"];
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
|
|
||||||
string FinalDefIDToFind = m_sKEYENCEBar.Substring(1, 18);// Ŀ<><C4BF> FinalDefID
|
|
||||||
JArray dataArray = responseJson["data"] as JArray;
|
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
||||||
if (dataArray != null)
|
// string finalDefIdToFind = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7);
|
||||||
{
|
// string productType = FindStringAfterColon(response, finalDefIdToFind);
|
||||||
foreach (JObject dataItem in dataArray)
|
// if (productType != null)
|
||||||
{
|
// {
|
||||||
if (dataItem["FinalDefID"] != null && dataItem["FinalDefID"].ToString() == FinalDefIDToFind)
|
// Console.WriteLine($"{finalDefIdToFind}: {productType}");
|
||||||
{
|
|
||||||
string productType = dataItem["ProductType"] != null ? dataItem["ProductType"].ToString() : "N/A";
|
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
|
||||||
Console.WriteLine($"FinalDefID: {FinalDefIDToFind}, ProductType: {productType}");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
// }
|
||||||
}
|
// else
|
||||||
}
|
// {
|
||||||
else
|
// Console.WriteLine($"FinalDefID {finalDefIdToFind} not found in response.");
|
||||||
{
|
// }
|
||||||
string returnMsg = responseJson["ReturnMsg"] != null ? responseJson["ReturnMsg"].ToString() : "Unknown error";
|
// }
|
||||||
Console.WriteLine("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>" + returnMsg);
|
// catch (Exception ex)
|
||||||
}
|
// {
|
||||||
}
|
// Console.WriteLine("Error occurred:");
|
||||||
else
|
// Console.WriteLine(ex.Message);
|
||||||
{
|
// }
|
||||||
Console.WriteLine("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
||||||
}
|
|
||||||
|
|
||||||
sw.Stop();
|
sw.Stop();
|
||||||
Console.WriteLine("ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD><69>" + sw.ElapsedMilliseconds);
|
Console.WriteLine("ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD><69>" + sw.ElapsedMilliseconds);
|
||||||
|
|
||||||
@ -558,14 +594,10 @@ namespace HisenceYoloDetection
|
|||||||
|
|
||||||
OnSpeedShow();//<2F>߳̿<DFB3><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD>ʾ<EFBFBD>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD>
|
OnSpeedShow();//<2F>߳̿<DFB3><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD>ʾ<EFBFBD>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
OnPostionShow();//<2F>߳̿<DFB3><CCBF><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ʾ<EFBFBD>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD>
|
OnPostionShow();//<2F>߳̿<DFB3><CCBF><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ʾ<EFBFBD>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
<<<<<<< HEAD
|
|
||||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//<2F>Ƶ<EFBFBD>
|
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//<2F>Ƶ<EFBFBD>
|
||||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);//<2F>̵<EFBFBD>
|
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);//<2F>̵<EFBFBD>
|
||||||
=======
|
|
||||||
melsecPLCTCPDriver.WriteInt("554", 1);//<2F>Ƶ<EFBFBD><C6B5><EFBFBD>
|
|
||||||
melsecPLCTCPDriver.WriteInt("552", 0);//<2F><><EFBFBD><EFBFBD><EFBFBD>ƴ<EFBFBD><C6B4><EFBFBD><EFBFBD><EFBFBD>״̬
|
|
||||||
melsecPLCTCPDriver.WriteInt("556", 0);
|
|
||||||
>>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7
|
|
||||||
//t = new System.Timers.Timer(10000);//ʵ<><CAB5><EFBFBD><EFBFBD>Timer<65>࣬<EFBFBD><E0A3AC><EFBFBD>ü<EFBFBD><C3BC><EFBFBD>ʱ<EFBFBD><CAB1>Ϊ10000<30><30><EFBFBD>룻
|
//t = new System.Timers.Timer(10000);//ʵ<><CAB5><EFBFBD><EFBFBD>Timer<65>࣬<EFBFBD><E0A3AC><EFBFBD>ü<EFBFBD><C3BC><EFBFBD>ʱ<EFBFBD><CAB1>Ϊ10000<30><30><EFBFBD>룻
|
||||||
//t.Elapsed += new System.Timers.ElapsedEventHandler(Execute);//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ִ<EFBFBD><D6B4><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>
|
//t.Elapsed += new System.Timers.ElapsedEventHandler(Execute);//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ִ<EFBFBD><D6B4><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>
|
||||||
//t.AutoReset = true;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>һ<EFBFBD>Σ<EFBFBD>false<73><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һֱִ<D6B1><D6B4>(true)<29><>
|
//t.AutoReset = true;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>һ<EFBFBD>Σ<EFBFBD>false<73><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һֱִ<D6B1><D6B4>(true)<29><>
|
||||||
@ -1964,31 +1996,23 @@ namespace HisenceYoloDetection
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<<<<<<< HEAD
|
|
||||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 1);//<2F><><EFBFBD><EFBFBD>
|
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 1);//<2F><><EFBFBD><EFBFBD>
|
||||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//<2F>Ƶ<EFBFBD>
|
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//<2F>Ƶ<EFBFBD>
|
||||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);//<2F>̵<EFBFBD>
|
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);//<2F>̵<EFBFBD>
|
||||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 1);//<2F><><EFBFBD><EFBFBD>
|
melsecPLCTCPDriver.WriteInt(WaringAdress, 1);//<2F><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
=======
|
|
||||||
melsecPLCTCPDriver.WriteInt("552", 1);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
melsecPLCTCPDriver.WriteInt("554", 0);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
melsecPLCTCPDriver.WriteInt("556", 0);
|
|
||||||
melsecPLCTCPDriver.WriteInt("558", 1);//<2F><><EFBFBD><EFBFBD>
|
|
||||||
|
|
||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD>NGϴ<47>»<EFBFBD>
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD>NGϴ<47>»<EFBFBD>
|
||||||
DialogResult dr = MessageBox.Show("<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>죿", "<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
DialogResult dr = MessageBox.Show("<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>죿", "<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
||||||
if (dr == DialogResult.OK)
|
if (dr == DialogResult.OK)
|
||||||
{
|
{
|
||||||
<<<<<<< HEAD
|
|
||||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//<2F><><EFBFBD><EFBFBD>
|
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//<2F><><EFBFBD><EFBFBD>
|
||||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//<2F>Ƶ<EFBFBD>
|
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//<2F>Ƶ<EFBFBD>
|
||||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//<2F><><EFBFBD><EFBFBD>
|
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//<2F><><EFBFBD><EFBFBD>
|
||||||
=======
|
|
||||||
melsecPLCTCPDriver.WriteInt("552", 0);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
melsecPLCTCPDriver.WriteInt("554", 1);//<2F>Ƶ<EFBFBD><C6B5><EFBFBD>
|
|
||||||
melsecPLCTCPDriver.WriteInt("558", 0);//<2F><><EFBFBD><EFBFBD>
|
|
||||||
>>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7
|
|
||||||
OKDsums++;
|
OKDsums++;
|
||||||
WUsums++;
|
WUsums++;
|
||||||
this.Invoke(new Action(() =>
|
this.Invoke(new Action(() =>
|
||||||
@ -2003,15 +2027,11 @@ namespace HisenceYoloDetection
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
NGDsums++;
|
NGDsums++;
|
||||||
<<<<<<< HEAD
|
|
||||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//<2F><><EFBFBD><EFBFBD>
|
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//<2F><><EFBFBD><EFBFBD>
|
||||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//<2F><><EFBFBD><EFBFBD>
|
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//<2F><><EFBFBD><EFBFBD>
|
||||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//<2F>Ƶ<EFBFBD>
|
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//<2F>Ƶ<EFBFBD>
|
||||||
=======
|
|
||||||
melsecPLCTCPDriver.WriteInt("558", 0);//<2F><><EFBFBD><EFBFBD>
|
|
||||||
melsecPLCTCPDriver.WriteInt("552", 0);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
melsecPLCTCPDriver.WriteInt("554", 1);//<2F>Ƶ<EFBFBD><C6B5><EFBFBD>
|
|
||||||
>>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7
|
|
||||||
|
|
||||||
this.Invoke(new Action(() =>
|
this.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
@ -2321,18 +2341,14 @@ namespace HisenceYoloDetection
|
|||||||
Rect rect2 = new Rect(0, 0, 0, 0);
|
Rect rect2 = new Rect(0, 0, 0, 0);
|
||||||
|
|
||||||
CheckDiffSciHelper1.CheckDiffSci(path2, pathmat, rect2, rect2, false, "D://Hisence//Test1");
|
CheckDiffSciHelper1.CheckDiffSci(path2, pathmat, rect2, rect2, false, "D://Hisence//Test1");
|
||||||
<<<<<<< HEAD
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// OnGetBar();
|
// OnGetBar();
|
||||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//<2F>̵<EFBFBD>
|
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//<2F>̵<EFBFBD>
|
||||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//<2F>Ƶ<EFBFBD>
|
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//<2F>Ƶ<EFBFBD>
|
||||||
=======
|
|
||||||
|
|
||||||
*/
|
|
||||||
// OnGetBar();
|
|
||||||
melsecPLCTCPDriver.WriteInt("556", 1);//<2F>̵<EFBFBD><CCB5><EFBFBD>
|
|
||||||
melsecPLCTCPDriver.WriteInt("554", 0);//<2F>Ƶ<EFBFBD><C6B5><EFBFBD>
|
|
||||||
TriggerCameral2();//<2F><><EFBFBD>紥<EFBFBD><E7B4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>SN<53><4E>ȡ<EFBFBD>ͺ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF>еõ<D0B5><C3B5><EFBFBD>ֵ
|
TriggerCameral2();//<2F><><EFBFBD>紥<EFBFBD><E7B4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>SN<53><4E>ȡ<EFBFBD>ͺ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF>еõ<D0B5><C3B5><EFBFBD>ֵ
|
||||||
ReadyDetect();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
|
ReadyDetect();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
|
||||||
ThreadPost();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>պ<EFBFBD><D5BA><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>յ<EFBFBD><D5B5>ͺ<EFBFBD>
|
ThreadPost();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>պ<EFBFBD><D5BA><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>յ<EFBFBD><D5B5>ͺ<EFBFBD>
|
||||||
@ -2686,56 +2702,43 @@ namespace HisenceYoloDetection
|
|||||||
string productType = "N/A";
|
string productType = "N/A";
|
||||||
string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson";
|
string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson";
|
||||||
|
|
||||||
DateTime dt = DateTime.Now;
|
string jsonData = @"
|
||||||
string today = dt.ToString("yyyy-MM-dd");
|
{
|
||||||
|
""StartTime"": ""2024-07-15"",
|
||||||
|
""EndTime"": ""2024-07-15"",
|
||||||
|
""LineBody"": ""BZ-PC""
|
||||||
|
}";
|
||||||
|
|
||||||
string startTime = today;
|
|
||||||
string endTime = today;
|
|
||||||
string lineBody = "BZ-PC";
|
|
||||||
string materialDescript = "<22><><EFBFBD><EFBFBD>";
|
|
||||||
|
|
||||||
JObject patientInfo = new JObject
|
string postData = "inputvalue=" + Uri.EscapeDataString(jsonData);
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
["StartTime"] = startTime,
|
string response = PostData(url, postData);
|
||||||
["EndTime"] = endTime,
|
|
||||||
["LineBody"] = lineBody,
|
|
||||||
["MaterialDescripts"] = new JArray { materialDescript }
|
|
||||||
};
|
|
||||||
|
|
||||||
string sendData = patientInfo.ToString();
|
|
||||||
string resultData = Post(sendData, url, "application/x-www-form-urlencoded", "application/json");
|
|
||||||
|
|
||||||
if (resultData != null)
|
|
||||||
{
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
||||||
JObject responseJson = JObject.Parse(resultData);
|
string finalDefIdToFind = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7); // Ŀ<><C4BF> FinalDefID
|
||||||
bool success = responseJson["success"] != null && (bool)responseJson["success"];
|
productType = FindStringAfterColon(response, finalDefIdToFind);
|
||||||
if (success)
|
if (productType != null)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine($"{finalDefIdToFind}: {productType}");
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string FinalDefIDToFind = SN.Substring(1, 18);// Ŀ<><C4BF> FinalDefID
|
|
||||||
JArray dataArray = responseJson["data"] as JArray;
|
|
||||||
if (dataArray != null)
|
|
||||||
{
|
|
||||||
foreach (JObject dataItem in dataArray)
|
|
||||||
{
|
|
||||||
if (dataItem["FinalDefID"] != null && dataItem["FinalDefID"].ToString() == FinalDefIDToFind)
|
|
||||||
{
|
|
||||||
productType = dataItem["ProductType"] != null ? dataItem["ProductType"].ToString() : "N/A";
|
|
||||||
Console.WriteLine($"FinalDefID: {FinalDefIDToFind}, ProductType: {productType}");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string returnMsg = responseJson["ReturnMsg"] != null ? responseJson["ReturnMsg"].ToString() : "Unknown error";
|
Console.WriteLine($"FinalDefID {finalDefIdToFind} not found in response.");
|
||||||
Console.WriteLine("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>" + returnMsg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
Console.WriteLine("Error occurred:");
|
||||||
|
Console.WriteLine(ex.Message);
|
||||||
}
|
}
|
||||||
return productType;
|
return productType;
|
||||||
// sw.Stop();
|
// sw.Stop();
|
||||||
@ -3793,7 +3796,7 @@ namespace HisenceYoloDetection
|
|||||||
{
|
{
|
||||||
if (!m_sKEYENCEBar.IsNullOrEmpty())
|
if (!m_sKEYENCEBar.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
OcrBarBox.Text = m_sKEYENCEBar;
|
OcrBarBox.Text = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user