|
|
@@ -49,107 +49,120 @@ namespace UAS_MES_NEW.Make
|
|
|
passPath = Path.Combine(logsPath, "pass");
|
|
|
failPath = Path.Combine(logsPath, "fail");
|
|
|
|
|
|
- string[] passFiles = Directory.GetFiles(passPath, $"*up.log");
|
|
|
+ string upRes, downRes;
|
|
|
+
|
|
|
+ List<string> SNArr = new List<string> { };
|
|
|
+ string[] passFiles = Directory.GetFiles(passPath, $"*.log");
|
|
|
foreach (string currLog in passFiles)
|
|
|
{
|
|
|
- string upRes = ParseIperfBitrate(currLog);
|
|
|
-
|
|
|
- string sn = Path.GetFileName(currLog).Split('_')[0];
|
|
|
- UpdateSN("L", sn);
|
|
|
-
|
|
|
- SQL.Clear();
|
|
|
- SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product WHERE ms_sncode = '{sn}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
|
|
|
- dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
|
|
|
- if (dt.Rows.Count == 0)
|
|
|
+ if (Path.GetFileName(currLog).Contains("up"))
|
|
|
{
|
|
|
- ShowMsg(0, $"序列号无归属工单");
|
|
|
- continue;
|
|
|
- }
|
|
|
- string wo = dt.Rows[0]["ma_code"].ToString();
|
|
|
- string logPath = Path.GetDirectoryName(currLog);
|
|
|
- string downLog = Path.Combine(logPath, $"{sn}_down.log");
|
|
|
+ upRes = ParseIperfBitrate(currLog);
|
|
|
+ string sn = Path.GetFileName(currLog).Split('_')[0];
|
|
|
+ UpdateSN("L", sn);
|
|
|
+ SNArr.Add(sn);
|
|
|
+ if (SNArr.IndexOf(sn) > 0) continue;
|
|
|
+
|
|
|
+ SQL.Clear();
|
|
|
+ SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product WHERE ms_sncode = '{sn.Replace(";", ";")}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
|
|
|
+ dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
|
|
|
+ if (dt.Rows.Count == 0)
|
|
|
+ {
|
|
|
+ ShowMsg(0, $"序列号:{sn.Replace(";", ";")},无归属工单");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ string wo = dt.Rows[0]["ma_code"].ToString();
|
|
|
+ string logPath = Path.GetDirectoryName(currLog);
|
|
|
+ string downLog = Path.Combine(logPath, $"{Path.GetFileName(currLog).Replace("up", "down")}");
|
|
|
|
|
|
- string downRes = ParseIperfBitrate(downLog);
|
|
|
- string tDetail = $"upRate/{upRes};downRate/{downRes}";
|
|
|
+ downRes = ParseIperfBitrate(downLog);
|
|
|
+ string tDetail = $"upRate/{upRes};downRate/{downRes}";
|
|
|
|
|
|
- CheckPassStation(wo, sn, "PASS", tDetail);
|
|
|
+ CheckPassStation(wo, sn, "PASS", tDetail);
|
|
|
|
|
|
- using (StreamReader SR = new StreamReader(currLog, Encoding.GetEncoding("GBK")))
|
|
|
- {
|
|
|
- string Content = SR.ReadToEnd();
|
|
|
- SR.Close();
|
|
|
- SR.Dispose();
|
|
|
- if (ConsoleLog(Content, currLog, $"{sn}_up.log"))
|
|
|
+ using (StreamReader SR = new StreamReader(currLog, Encoding.GetEncoding("GBK")))
|
|
|
{
|
|
|
- File.WriteAllText(currLog, string.Empty);
|
|
|
- File.Delete(currLog);
|
|
|
+ string Content = SR.ReadToEnd();
|
|
|
+ SR.Close();
|
|
|
+ SR.Dispose();
|
|
|
+ if (ConsoleLog(Content, currLog, $"{Path.GetFileName(currLog)}"))
|
|
|
+ {
|
|
|
+ File.WriteAllText(currLog, string.Empty);
|
|
|
+ File.Delete(currLog);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- using (StreamReader SR = new StreamReader(downLog, Encoding.GetEncoding("GBK")))
|
|
|
- {
|
|
|
- string Content = SR.ReadToEnd();
|
|
|
- SR.Close();
|
|
|
- SR.Dispose();
|
|
|
- if (ConsoleLog(Content, currLog, $"{sn}_down.log"))
|
|
|
+ using (StreamReader SR = new StreamReader(downLog, Encoding.GetEncoding("GBK")))
|
|
|
{
|
|
|
- File.WriteAllText(currLog, string.Empty);
|
|
|
- File.Delete(currLog);
|
|
|
+ string Content = SR.ReadToEnd();
|
|
|
+ SR.Close();
|
|
|
+ SR.Dispose();
|
|
|
+ if (ConsoleLog(Content, currLog, $"{Path.GetFileName(currLog).Replace("up", "down")}"))
|
|
|
+ {
|
|
|
+ File.WriteAllText(currLog, string.Empty);
|
|
|
+ File.Delete(currLog);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- string[] failFiles = Directory.GetFiles(failPath, $"*up.log");
|
|
|
+ string[] failFiles = Directory.GetFiles(failPath, $"*.log");
|
|
|
foreach (string currLog in failFiles)
|
|
|
{
|
|
|
- string upRes = ParseIperfBitrate(currLog);
|
|
|
- string sn = Path.GetFileName(currLog).Split('_')[0];
|
|
|
- UpdateSN("L", sn);
|
|
|
-
|
|
|
- SQL.Clear();
|
|
|
- SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product WHERE ms_sncode = '{sn}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
|
|
|
- dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
|
|
|
- if (dt.Rows.Count == 0)
|
|
|
+ if (Path.GetFileName(currLog).Contains("up"))
|
|
|
{
|
|
|
- ShowMsg(0, $"序列号无归属工单");
|
|
|
- continue;
|
|
|
- }
|
|
|
- string wo = dt.Rows[0]["ma_code"].ToString();
|
|
|
- string logPath = Path.GetDirectoryName(currLog);
|
|
|
- string downLog = Path.Combine(logPath, $"{sn}_down.log");
|
|
|
+ upRes = ParseIperfBitrate(currLog);
|
|
|
+ string sn = Path.GetFileName(currLog).Split('_')[0];
|
|
|
+ UpdateSN("L", sn);
|
|
|
+ SNArr.Add(sn);
|
|
|
+ if (SNArr.IndexOf(sn) > 0) continue;
|
|
|
+
|
|
|
+ SQL.Clear();
|
|
|
+ SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product WHERE ms_sncode = '{sn.Replace(";", ";")}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
|
|
|
+ dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
|
|
|
+ if (dt.Rows.Count == 0)
|
|
|
+ {
|
|
|
+ ShowMsg(0, $"序列号:{sn.Replace(";", ";")},无归属工单");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ string wo = dt.Rows[0]["ma_code"].ToString();
|
|
|
+ string logPath = Path.GetDirectoryName(currLog);
|
|
|
+ string downLog = Path.Combine(logPath, $"{Path.GetFileName(currLog).Replace("up", "down")}");
|
|
|
|
|
|
- string downRes = ParseIperfBitrate(downLog);
|
|
|
- string tDetail = $"upRate/{upRes};downRate/{downRes}";
|
|
|
+ downRes = ParseIperfBitrate(downLog);
|
|
|
+ string tDetail = $"upRate/{upRes};downRate/{downRes}";
|
|
|
|
|
|
- CheckPassStation(wo, sn, "PASS", tDetail);
|
|
|
+ CheckPassStation(wo, sn, "PASS", tDetail);
|
|
|
|
|
|
- using (StreamReader SR = new StreamReader(currLog, Encoding.GetEncoding("GBK")))
|
|
|
- {
|
|
|
- string Content = SR.ReadToEnd();
|
|
|
- SR.Close();
|
|
|
- SR.Dispose();
|
|
|
- if (ConsoleLog(Content, currLog, $"{sn}_up.log"))
|
|
|
+ using (StreamReader SR = new StreamReader(currLog, Encoding.GetEncoding("GBK")))
|
|
|
{
|
|
|
- File.WriteAllText(currLog, string.Empty);
|
|
|
- File.Delete(currLog);
|
|
|
+ string Content = SR.ReadToEnd();
|
|
|
+ SR.Close();
|
|
|
+ SR.Dispose();
|
|
|
+ if (ConsoleLog(Content, currLog, $"{Path.GetFileName(currLog)}"))
|
|
|
+ {
|
|
|
+ File.WriteAllText(currLog, string.Empty);
|
|
|
+ File.Delete(currLog);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- using (StreamReader SR = new StreamReader(downLog, Encoding.GetEncoding("GBK")))
|
|
|
- {
|
|
|
- string Content = SR.ReadToEnd();
|
|
|
- SR.Close();
|
|
|
- SR.Dispose();
|
|
|
- if (ConsoleLog(Content, currLog, $"{sn}_down.log"))
|
|
|
+ using (StreamReader SR = new StreamReader(downLog, Encoding.GetEncoding("GBK")))
|
|
|
{
|
|
|
- File.WriteAllText(currLog, string.Empty);
|
|
|
- File.Delete(currLog);
|
|
|
+ string Content = SR.ReadToEnd();
|
|
|
+ SR.Close();
|
|
|
+ SR.Dispose();
|
|
|
+ if (ConsoleLog(Content, currLog, $"{Path.GetFileName(currLog).Replace("up", "down")}"))
|
|
|
+ {
|
|
|
+ File.WriteAllText(currLog, string.Empty);
|
|
|
+ File.Delete(currLog);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
private void CheckPassStation(string wo,string sn, string testRes, string testDetail)
|
|
|
{
|
|
|
+ sn = sn.Replace(";", ";");
|
|
|
List<string> param = new List<string>() { };
|
|
|
string outMsg = "";
|
|
|
param.Add(wo);
|
|
|
@@ -165,7 +178,7 @@ namespace UAS_MES_NEW.Make
|
|
|
dh.CallProcedure("cs_insert_testrejects", ref paramList);
|
|
|
if (paramList[8].Substring(0, 2) == "OK")
|
|
|
{
|
|
|
- ShowMsg(1, $"序列号{sn}采集成功:测试结果为{testRes}");
|
|
|
+ ShowMsg(1, $"序列号{sn}采集成功:测试结果为{testRes},{testDetail}");
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, workOrder.Text, User.UserLineCode, User.UserSourceCode, "无线吞吐量", "无线吞吐量过站成功", sn, "");
|
|
|
}
|
|
|
|
|
|
@@ -181,7 +194,7 @@ namespace UAS_MES_NEW.Make
|
|
|
{
|
|
|
if (LogicHandler.SetStepResult(oWO, User.UserSourceCode, sn, "无线吞吐量", "OK", User.UserCode, out oErrMsg))
|
|
|
{
|
|
|
- ShowMsg(0, $"序列号{sn},过站记录成功");
|
|
|
+ ShowMsg(1, $"序列号{sn},过站记录成功");
|
|
|
}
|
|
|
else
|
|
|
{
|