|
|
@@ -73,9 +73,7 @@ namespace UAS_MES_NEW.Make
|
|
|
string outPath = Path.Combine(Application.StartupPath, fp_name);
|
|
|
using (WebClient client = new WebClient())
|
|
|
{
|
|
|
- //client.DownloadFile($"http://192.168.1.86:8099/mes/{fp_path}", outPath);
|
|
|
- //webCli.DownloadFile("http://erp.ubtob.net:11791/" + fp_path, outPath);
|
|
|
-
|
|
|
+ client.DownloadFile("http://10.200.40.243:8099/" + fp_path, outPath);
|
|
|
pahtArr.Add(outPath);
|
|
|
}
|
|
|
}
|
|
|
@@ -187,8 +185,6 @@ namespace UAS_MES_NEW.Make
|
|
|
PrintList.Enabled = false;
|
|
|
Template.Enabled = false;
|
|
|
|
|
|
- string str1 = Application.StartupPath + "\\机身标 (1).btw";
|
|
|
-
|
|
|
string str = pahtArr[Template.SelectedIndex];
|
|
|
_printer = new LabelPrinter(str);
|
|
|
_printer.SetPrinter(PrintList.Text);
|
|
|
@@ -248,7 +244,21 @@ namespace UAS_MES_NEW.Make
|
|
|
this.Invoke(new Action(() =>
|
|
|
{
|
|
|
currCount += 1;
|
|
|
- Match match = Regex.Match(e.Message, @"V\x00\r([A-Z0-9]+)");
|
|
|
+ if (e.Message.Length >= 10)
|
|
|
+ {
|
|
|
+ string serialNumber = e.Message.Substring(3, e.Message.Length - 6);
|
|
|
+ ShowMsg(1, $"第{currCount}次接收,收到来自 {e.ClientId} 的消息: {serialNumber}");
|
|
|
+ if (!string.IsNullOrEmpty(PrintList.Text))
|
|
|
+ {
|
|
|
+ var parameters = new Dictionary<string, string>()
|
|
|
+ {
|
|
|
+ {"SN", serialNumber}
|
|
|
+ };
|
|
|
+ bool success = _printer.PrintLabel(parameters);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*Match match = Regex.Match(e.Message, @"V\x00\r([A-Z0-9]+)");
|
|
|
if (match.Success)
|
|
|
{
|
|
|
string serialNumber = match.Groups[1].Value;
|
|
|
@@ -262,7 +272,7 @@ namespace UAS_MES_NEW.Make
|
|
|
};
|
|
|
bool success = _printer.PrintLabel(parameters);
|
|
|
|
|
|
- /*var batchParameters = new List<Dictionary<string, string>>();
|
|
|
+ var batchParameters = new List<Dictionary<string, string>>();
|
|
|
for (int i = 1; i <= 10; i++)
|
|
|
{
|
|
|
batchParameters.Add(parameters);
|
|
|
@@ -270,9 +280,9 @@ namespace UAS_MES_NEW.Make
|
|
|
int printedCount = _printer.PrintLabels(batchParameters, (current, total) =>
|
|
|
{
|
|
|
Console.WriteLine($"进度: {current}/{total}");
|
|
|
- });*/
|
|
|
+ });
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
/*VerifyResultMessage message = new VerifyResultMessage
|
|
|
{
|