|  |  |  | 
|---|
|  |  |  | package com.zy.core.thread; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.zy.common.entity.Parameter; | 
|---|
|  |  |  | import com.zy.common.model.MatDto; | 
|---|
|  |  |  | import com.zy.core.Slave; | 
|---|
|  |  |  | import com.zy.core.ThreadHandler; | 
|---|
|  |  |  | 
|---|
|  |  |  | import onbon.bx05.utils.DisplayStyleFactory; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.awt.*; | 
|---|
|  |  |  | import java.util.HashSet; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Set; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * Created by vincent on 2020/9/1 | 
|---|
|  |  |  | 
|---|
|  |  |  | private StringBuffer stringBuffer = new StringBuffer(); | 
|---|
|  |  |  | private List<LedCommand> commandList; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private StringBuffer errorMsg = new StringBuffer(); | 
|---|
|  |  |  | //    private StringBuffer errorMsg = new StringBuffer(); | 
|---|
|  |  |  | private Map<String,String> errorMsg = new LinkedHashMap<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public LedThread(Slave slave) { | 
|---|
|  |  |  | this.slave = slave; | 
|---|
|  |  |  | 
|---|
|  |  |  | reset7(); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 5: | 
|---|
|  |  |  | error((String) task.getData()); | 
|---|
|  |  |  | error((Map<String,String>) task.getData()); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 6: | 
|---|
|  |  |  | errorReset(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private void error(String msg) { | 
|---|
|  |  |  | errorMsg.delete(0, errorMsg.length()); | 
|---|
|  |  |  | errorMsg.append(msg); | 
|---|
|  |  |  | private void error(Map<String,String> msg) { | 
|---|
|  |  |  | errorMsg.clear(); | 
|---|
|  |  |  | errorMsg.putAll(msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void errorReset() { | 
|---|
|  |  |  | this.errorMsg.delete(0, errorMsg.length()); | 
|---|
|  |  |  | this.errorMsg.clear(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|