修复BUG

This commit is contained in:
zhangzhuo 2025-03-26 15:02:43 +08:00
parent e06cf5cba4
commit e3e12cb62b
2 changed files with 35 additions and 25 deletions

View File

@ -132,23 +132,23 @@ public class HyosungPlcService(ILogger<HyosungPlcService> logger) : IHyosungPlcS
switch (slave)
{
case 0:
masterCount = 1;
slaveCount = 1;
break;
case 1:
masterCount = 2;
slaveCount = 2;
break;
case 2:
masterCount = 6;
slaveCount = 6;
break;
case 3:
masterCount = 14;
slaveCount = 14;
break;
case 4:
masterCount = 30;
slaveCount = 30;
break;
}
await _writer.WriteShortsAsync(13050, [1, 1, slaveCount, masterCount]);
await _writer.WriteShortsAsync(13050, [1, 1, 1, masterCount]);
}
public async Task WritePrintLabelResultAsync(int index, bool result)

View File

@ -365,6 +365,9 @@ public class HyosungRuntime(
private async Task OnRequestGetPrintLabel(string arg)
{
try
{
logger.LogInformation("request print option");
currentPrintTrayCode = arg;
var tray = await trayService.GetByCode(arg);
var variety = await varietyService.GetById(tray.VarietyId);
@ -381,9 +384,16 @@ public class HyosungRuntime(
// controlNo += 1;
//
// }
tray = await trayService.PrintTrayAsync(arg, mod,variety);
tray = await trayService.PrintTrayAsync(arg, mod, variety);
await dictService.SetValue("System", "CurrentPackingTrayCode", arg);
await hyosungPlcService.WritePrintLableOptionsAsync(variety.MasterLabelCount,variety.SubLabelCount);
await hyosungPlcService.WritePrintLableOptionsAsync(variety.MasterLabelCount, variety.SubLabelCount);
logger.LogInformation("request print option succeed");
}
catch(Exception e)
{
logger.LogError(e, "GetPrintOptionError");
}
}
/// <summary>