From 74adb7e8c513d84820f84c1681d5e44e4a936ad9 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 11 九月 2020 10:12:26 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/LedThread.java | 35 +++++++++++++++++++++++++++++++----
1 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/LedThread.java b/src/main/java/com/zy/core/thread/LedThread.java
index 0384e64..dd079cc 100644
--- a/src/main/java/com/zy/core/thread/LedThread.java
+++ b/src/main/java/com/zy/core/thread/LedThread.java
@@ -37,6 +37,7 @@
TextCaptionBxArea area;
DisplayStyleFactory.DisplayStyle[] styles = DisplayStyleFactory.getStyles().toArray(new DisplayStyleFactory.DisplayStyle[0]);
private Set<Integer> workNos = new HashSet<>();
+ private boolean resetStatus = false; // 澶嶄綅鐘舵��
public LedThread(Slave slave) {
this.slave = slave;
@@ -66,6 +67,10 @@
// 鍐欐暟鎹�
case 1:
write((List<LedCommand>)task.getData());
+ break;
+ // 澶嶄綅
+ case 2:
+ reset();
break;
default:
break;
@@ -104,11 +109,13 @@
// 鍒涘缓涓�涓暟鎹〉
TextBxPage page = new TextBxPage();
for (LedCommand command : list) {
- page.newLine("鍑哄簱浠诲姟锛�"+command.getWorkNo()+")");
+ page.newLine(command.getTitle() +"锛�"+command.getWorkNo()+")");
page.newLine("婧愬簱浣嶏細"+command.getSourceLocNo());
page.newLine("鐩爣绔欙細"+command.getStaNo());
- for (MatDto matDto : command.getMatDtos()) {
- page.newLine(matDto.getMaknx() + "銆愭暟閲�" + matDto.getCount() +"銆�");
+ if (!command.isEmptyMk()) {
+ for (MatDto matDto : command.getMatDtos()) {
+ page.newLine(matDto.getMaknx() + "銆愭暟閲�" + matDto.getCount() +"銆�");
+ }
}
page.newLine("\n");
}
@@ -117,13 +124,33 @@
page.setFont(new Font("瀹嬩綋",Font.PLAIN,12));
// 璁剧疆鏄剧ず鐗规妧涓哄揩閫熸墦鍑�
page.setDisplayStyle(styles[6]);
+ area.clearPages();
area.addPage(page);
pf.addArea(area);
// 鏇存柊鑺傜洰
screen.writeProgram(pf);
+ resetStatus = false;
}
-
+ private void reset() throws Bx5GException {
+ if (!resetStatus) {
+ // 鍒涘缓涓�涓暟鎹〉
+ TextBxPage page = new TextBxPage();
+ page.newLine("骞垮痉涓壃鐗╂祦瑁呭鏈夐檺鍏徃");
+ page.newLine("鑷姩鍖栫珛浣撲粨搴�");
+ page.newLine("娴欐睙涓壃鐗╂祦瑁呭鏈夐檺鍏徃");
+ // 璁剧疆瀛椾綋
+ page.setFont(new Font("瀹嬩綋",Font.PLAIN,12));
+ // 璁剧疆鏄剧ず鐗规妧涓哄揩閫熸墦鍑�
+ page.setDisplayStyle(styles[6]);
+ area.clearPages();
+ area.addPage(page);
+ pf.addArea(area);
+ // 鏇存柊鑺傜洰
+ screen.writeProgram(pf);
+ resetStatus = true;
+ }
+ }
public static void main(String[] args) throws Exception {
--
Gitblit v1.9.1