重新修改
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,6 +283,65 @@ namespace HisenceYoloDetection
|
||||
return content;
|
||||
}
|
||||
|
||||
public static string PostData(string url, string postData)
|
||||
{
|
||||
byte[] data = Encoding.UTF8.GetBytes(postData);
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.Method = "POST";
|
||||
request.ContentType = "application/x-www-form-urlencoded";
|
||||
request.ContentLength = data.Length;
|
||||
|
||||
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>
|
||||
@ -347,59 +406,46 @@ namespace HisenceYoloDetection
|
||||
public void GetTypeFromPost()
|
||||
{
|
||||
string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson";
|
||||
|
||||
DateTime dt = DateTime.Now;
|
||||
string today = dt.ToString("yyyy-MM-dd");
|
||||
|
||||
string startTime = today;
|
||||
string endTime = today;
|
||||
string lineBody = "BZ-PC";
|
||||
string materialDescript = "<22><><EFBFBD><EFBFBD>";
|
||||
|
||||
JObject patientInfo = new JObject
|
||||
string jsonData = @"
|
||||
{
|
||||
["StartTime"] = startTime,
|
||||
["EndTime"] = endTime,
|
||||
["LineBody"] = lineBody,
|
||||
["MaterialDescripts"] = new JArray { materialDescript }
|
||||
};
|
||||
""StartTime"": ""2024-07-15"",
|
||||
""EndTime"": ""2024-07-15"",
|
||||
""LineBody"": ""BZ-PC""
|
||||
}";
|
||||
|
||||
string sendData = patientInfo.ToString();
|
||||
string resultData = Post(sendData, url, "application/x-www-form-urlencoded", "application/json");
|
||||
|
||||
if (resultData != null)
|
||||
string postData = "inputvalue=" + Uri.EscapeDataString(jsonData);
|
||||
|
||||
try
|
||||
{
|
||||
JObject responseJson = JObject.Parse(resultData);
|
||||
bool success = responseJson["success"] != null && (bool)responseJson["success"];
|
||||
if (success)
|
||||
string response = PostData(url, postData);
|
||||
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
||||
string finalDefIdToFind = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7); // Ŀ<><C4BF> FinalDefID
|
||||
string productType = FindStringAfterColon(response, finalDefIdToFind);
|
||||
if (productType != null)
|
||||
{
|
||||
Console.WriteLine($"{finalDefIdToFind}: {productType}");
|
||||
|
||||
// string FinalDefIDToFind = m_sKEYENCEBar.Substring(1, 18);// Ŀ<><C4BF> FinalDefID
|
||||
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);
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string returnMsg = responseJson["ReturnMsg"] != null ? responseJson["ReturnMsg"].ToString() : "Unknown error";
|
||||
Console.WriteLine("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>" + returnMsg);
|
||||
Console.WriteLine($"FinalDefID {finalDefIdToFind} not found in response.");
|
||||
}
|
||||
}
|
||||
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>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@ -411,59 +457,49 @@ namespace HisenceYoloDetection
|
||||
Stopwatch sw = new Stopwatch();
|
||||
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 today = dt.ToString("yyyy-MM-dd");
|
||||
// string jsonData = @"
|
||||
//{
|
||||
// ""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
|
||||
{
|
||||
["StartTime"] = startTime,
|
||||
["EndTime"] = endTime,
|
||||
["LineBody"] = lineBody,
|
||||
["MaterialDescripts"] = new JArray { materialDescript }
|
||||
};
|
||||
// string postData = "inputvalue=" + Uri.EscapeDataString(jsonData);
|
||||
|
||||
// try
|
||||
// {
|
||||
// string response = PostData(url, postData);
|
||||
|
||||
|
||||
|
||||
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
||||
// string finalDefIdToFind = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7);
|
||||
// string productType = FindStringAfterColon(response, finalDefIdToFind);
|
||||
// if (productType != null)
|
||||
// {
|
||||
// Console.WriteLine($"{finalDefIdToFind}: {productType}");
|
||||
|
||||
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Console.WriteLine($"FinalDefID {finalDefIdToFind} not found in response.");
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Console.WriteLine("Error occurred:");
|
||||
// Console.WriteLine(ex.Message);
|
||||
// }
|
||||
|
||||
string sendData = patientInfo.ToString();
|
||||
string resultData = Post(sendData, url, "application/x-www-form-urlencoded", "application/json");
|
||||
|
||||
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;
|
||||
if (dataArray != null)
|
||||
{
|
||||
foreach (JObject dataItem in dataArray)
|
||||
{
|
||||
if (dataItem["FinalDefID"] != null && dataItem["FinalDefID"].ToString() == FinalDefIDToFind)
|
||||
{
|
||||
string productType = dataItem["ProductType"] != null ? dataItem["ProductType"].ToString() : "N/A";
|
||||
Console.WriteLine($"FinalDefID: {FinalDefIDToFind}, ProductType: {productType}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string returnMsg = responseJson["ReturnMsg"] != null ? responseJson["ReturnMsg"].ToString() : "Unknown error";
|
||||
Console.WriteLine("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>" + returnMsg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
sw.Stop();
|
||||
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>
|
||||
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(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.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><>
|
||||
@ -1964,31 +1996,23 @@ namespace HisenceYoloDetection
|
||||
}
|
||||
else
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
|
||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 1);//<2F><><EFBFBD><EFBFBD>
|
||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//<2F>Ƶ<EFBFBD>
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);//<2F>̵<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>
|
||||
DialogResult dr = MessageBox.Show("<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>죿", "<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
||||
if (dr == DialogResult.OK)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
|
||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//<2F><><EFBFBD><EFBFBD>
|
||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//<2F>Ƶ<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++;
|
||||
WUsums++;
|
||||
this.Invoke(new Action(() =>
|
||||
@ -2003,15 +2027,11 @@ namespace HisenceYoloDetection
|
||||
else
|
||||
{
|
||||
NGDsums++;
|
||||
<<<<<<< HEAD
|
||||
|
||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//<2F><><EFBFBD><EFBFBD>
|
||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//<2F><><EFBFBD><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(() =>
|
||||
{
|
||||
@ -2321,18 +2341,14 @@ namespace HisenceYoloDetection
|
||||
Rect rect2 = new Rect(0, 0, 0, 0);
|
||||
|
||||
CheckDiffSciHelper1.CheckDiffSci(path2, pathmat, rect2, rect2, false, "D://Hisence//Test1");
|
||||
<<<<<<< HEAD
|
||||
|
||||
*/
|
||||
|
||||
// OnGetBar();
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//<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>ֵ
|
||||
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>
|
||||
@ -2686,56 +2702,43 @@ namespace HisenceYoloDetection
|
||||
string productType = "N/A";
|
||||
string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson";
|
||||
|
||||
DateTime dt = DateTime.Now;
|
||||
string today = dt.ToString("yyyy-MM-dd");
|
||||
string jsonData = @"
|
||||
{
|
||||
""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
|
||||
{
|
||||
["StartTime"] = startTime,
|
||||
["EndTime"] = endTime,
|
||||
["LineBody"] = lineBody,
|
||||
["MaterialDescripts"] = new JArray { materialDescript }
|
||||
};
|
||||
string postData = "inputvalue=" + Uri.EscapeDataString(jsonData);
|
||||
|
||||
string sendData = patientInfo.ToString();
|
||||
string resultData = Post(sendData, url, "application/x-www-form-urlencoded", "application/json");
|
||||
try
|
||||
{
|
||||
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 = SN.Substring(1, 18);// Ŀ<><C4BF> FinalDefID
|
||||
JArray dataArray = responseJson["data"] as JArray;
|
||||
if (dataArray != null)
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
||||
string finalDefIdToFind = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7); // Ŀ<><C4BF> FinalDefID
|
||||
productType = FindStringAfterColon(response, finalDefIdToFind);
|
||||
if (productType != 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Console.WriteLine($"{finalDefIdToFind}: {productType}");
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
string returnMsg = responseJson["ReturnMsg"] != null ? responseJson["ReturnMsg"].ToString() : "Unknown error";
|
||||
Console.WriteLine("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>" + returnMsg);
|
||||
Console.WriteLine($"FinalDefID {finalDefIdToFind} not found in response.");
|
||||
}
|
||||
}
|
||||
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;
|
||||
// sw.Stop();
|
||||
@ -3793,7 +3796,7 @@ namespace HisenceYoloDetection
|
||||
{
|
||||
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