WorkJPanelCnc.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. package com.mes.component;
  2. import com.alibaba.fastjson2.JSON;
  3. import com.alibaba.fastjson2.JSONObject;
  4. import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
  5. import com.github.xingshuangs.iot.protocol.s7.service.S7PLC;
  6. import com.mes.ui.CacheData;
  7. import com.mes.ui.DataUtil;
  8. import com.mes.ui.MesClient;
  9. import com.mes.util.JdbcUtils;
  10. import com.mes.util.SnSlot;
  11. import org.slf4j.Logger;
  12. import org.slf4j.LoggerFactory;
  13. import javax.swing.*;
  14. import java.awt.*;
  15. import java.awt.event.MouseAdapter;
  16. import java.awt.event.MouseEvent;
  17. import java.util.Timer;
  18. import java.util.TimerTask;
  19. /**
  20. * 总成CNC工位面板(工位、PLC、DB 由 MesClient 工位表传入)
  21. * 正面 OP130A-E = 92 DB7000-7004,OP130F = 93 DB7004;反面 OP135A-D = 93 DB7000-7003
  22. *
  23. * 点位 DB700X:0.0 请求上料 / 0.1 请求下料 / 0.2 运行中 / 0.3 设备状态 / 0.4 MES允许上料
  24. * 0.5 MES允许下料 / 0.6 心跳 / 0.7 上料到设备;1.0、1.1、2、4 为预留,不读不写
  25. *
  26. * 上料:请求上料时从 sourceSlot 取码(正面=本 PLC 扫码码,反面=反面待上料码),校验通过写 0.4
  27. * 进设备:0.7 上升沿或 0.2 运行中,码从「上料」移到「加工」
  28. * 下料:请求下料时上传结果;OP130A-F 要等反面待上料码为空,上传成功后存码给反面,再写 0.5
  29. */
  30. public class WorkJPanelCnc extends JPanel {
  31. public static final Logger log = LoggerFactory.getLogger(WorkJPanelCnc.class);
  32. public static final String PLC_92 = "192.168.90.92";
  33. public static final String PLC_93 = "192.168.90.93";
  34. private static final String[] CN_NO = {"一", "二", "三", "四", "五", "六", "七", "八", "九", "十"};
  35. public String oprno; // OP130 / OP135
  36. public String pos; // 子工位 A-F
  37. public boolean front; // true=正面
  38. public String plcIp;
  39. public String plcDb;
  40. public String deviceName;
  41. public SnSlot sourceSlot; // 上料取码来源
  42. public SnSlot targetSlot; // 下料存码目标:OP130A-F=反面待上料码,反面为 null
  43. public S7PLC s7PLC;
  44. public Integer workWidth = 470;
  45. public Integer workHeight = 300;
  46. public Integer tjFeedingFlag = 0; // 0=未取码 1=已取码校验通过
  47. public Integer tjFlag = 0; // 0=空闲 1=已上料 2=加工中 3=加工结束已上传
  48. public Integer tjStatus = 0; // 下料上传标识 0=未上传 1=已上传
  49. public String lastSn = "";
  50. private boolean feedingReleased = true; // 请求上料复位过,才处理下一次上料
  51. private boolean lastToDevice = false; // 上一轮 0.7,用于取上升沿
  52. private boolean plcHeart = false;
  53. public JButton status_menu;
  54. public JTextField productSnFeeding; // 上料码
  55. public JTextField productSn; // 加工码
  56. public JButton resetFeedingBtn;
  57. public JButton resetBtn;
  58. public JLabel feedinglabel; // 0.0 请求上料
  59. public JLabel feedingmeslabel; // 0.4 MES允许上料
  60. public JLabel runlabel; // 0.2 运行中
  61. public JLabel blankinglabel; // 0.1 请求下料
  62. public JLabel blankingmeslabel; // 0.5 MES允许下料
  63. public JLabel feedingtodevicelabel; // 0.7 上料到设备
  64. public ImageIcon imageGreen;
  65. public ImageIcon imageGray;
  66. public JButton signalBtn;
  67. public PlcSignalMonitor signalMonitor;
  68. public CacheData cacheData;
  69. public String cacheName;
  70. private String lastCacheJson = "";
  71. public Timer oprnoTimer;
  72. public Timer heartTimer;
  73. /**
  74. * @param oprno OP130=正面 / OP135=反面
  75. * @param pos 子工位
  76. * @param plcIp PLC 地址
  77. * @param plcDb DB7000-DB7004
  78. * @param sourceSlot 上料取码来源
  79. * @param targetSlot 下料存码目标,null=不存码
  80. */
  81. public WorkJPanelCnc(String oprno, String pos, String plcIp, String plcDb, SnSlot sourceSlot, SnSlot targetSlot) {
  82. this.setLayout(null);
  83. this.setBackground(Color.WHITE);
  84. this.oprno = oprno;
  85. this.pos = pos;
  86. this.front = "OP130".equals(oprno);
  87. this.plcIp = plcIp;
  88. this.plcDb = plcDb;
  89. this.sourceSlot = sourceSlot;
  90. this.targetSlot = targetSlot;
  91. // 设备名沿用原编号:92 DB7000-7004=一~五号机,93 DB7000-7004=六~十号机
  92. int dbIdx = plcDb.charAt(plcDb.length() - 1) - '0';
  93. deviceName = "东侧" + CN_NO[(PLC_93.equals(plcIp) ? 5 : 0) + dbIdx] + "号机";
  94. s7PLC = new S7PLC(EPlcType.S1500, plcIp);
  95. s7PLC.setReceiveTimeout(1000);
  96. s7PLC.setConnectTimeout(1000);
  97. cacheName = "cache_" + oprno + pos;
  98. cacheData = JdbcUtils.getCache(cacheName);
  99. if (cacheData == null) {
  100. cacheData = new CacheData();
  101. cacheData.setLastSn("");
  102. cacheData.setSn("");
  103. cacheData.setFeedingSn("");
  104. cacheData.setTjStatus(0);
  105. cacheData.setTjFlag(0);
  106. cacheData.setTjFeedingFlag(0);
  107. cacheData.setError(-1);
  108. cacheData.setMsg("");
  109. JdbcUtils.setCache(cacheName, JSON.toJSONString(cacheData));
  110. }
  111. initUI();
  112. formatElementUI();
  113. startOprnoTimer();
  114. heartData();
  115. }
  116. // 界面 -----------------------------------------------------------------------------------------------------
  117. private void initUI() {
  118. JLabel oprnoLabel = new JLabel(oprno + pos);
  119. oprnoLabel.setHorizontalAlignment(SwingConstants.CENTER);
  120. oprnoLabel.setForeground(Color.BLACK);
  121. oprnoLabel.setFont(new Font("微软雅黑", Font.PLAIN, 20));
  122. oprnoLabel.setBounds(0, 0, workWidth / 5, 40);
  123. this.add(oprnoLabel);
  124. JLabel nameLabel = new JLabel(deviceName);
  125. nameLabel.setHorizontalAlignment(SwingConstants.CENTER);
  126. nameLabel.setForeground(Color.BLACK);
  127. nameLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
  128. nameLabel.setBounds(0, 17, workWidth / 5, 40);
  129. this.add(nameLabel);
  130. status_menu = new JButton("等待请求上料");
  131. status_menu.setBounds(workWidth / 5, 0, workWidth * 4 / 5, 40);
  132. status_menu.setForeground(Color.GREEN);
  133. status_menu.setFont(new Font("微软雅黑", Font.PLAIN, 16));
  134. status_menu.setBackground(Color.BLACK);
  135. this.add(status_menu);
  136. addRowLabel("上料", 50);
  137. productSnFeeding = createSnField(50);
  138. resetFeedingBtn = createResetBtn(50, () -> {
  139. String sn = productSnFeeding.getText().trim();
  140. if (confirm("确定刷新上料工件" + sn + "吗?\n刷新后该码不会退回待上料码")) {
  141. resetFeeding();
  142. }
  143. });
  144. addRowLabel("加工", 100);
  145. productSn = createSnField(100);
  146. resetBtn = createResetBtn(100, () -> {
  147. String sn = productSn.getText().trim();
  148. String tip = front ? "\n刷新后不上传该件结果,也不会存入反面待上料码" : "\n刷新后不上传该件结果";
  149. if (confirm("确定刷新加工工件" + sn + "吗?" + tip)) {
  150. resetBlanking("已手动清除加工工件");
  151. }
  152. });
  153. imageGreen = scaledIcon("/bg/green_dot.png");
  154. imageGray = scaledIcon("/bg/grey_dot.png");
  155. feedinglabel = createLight("请求上料", 0, 150);
  156. feedingmeslabel = createLight("MES允许上料", workWidth / 3, 150);
  157. runlabel = createLight("运行中", workWidth * 2 / 3, 150);
  158. blankinglabel = createLight("请求下料", 0, 190);
  159. blankingmeslabel = createLight("MES允许下料", workWidth / 3, 190);
  160. feedingtodevicelabel = createLight("上料到设备", workWidth * 2 / 3, 190);
  161. // 点击 MES 写入的灯可手动切换信号
  162. feedingmeslabel.addMouseListener(toggleSignal("MES允许上料", plcDb + ".0.4"));
  163. blankingmeslabel.addMouseListener(toggleSignal("MES允许下料", plcDb + ".0.5"));
  164. JLabel ipLabel = new JLabel("PLC " + plcIp + " | " + plcDb);
  165. ipLabel.setFont(new Font("微软雅黑", Font.PLAIN, 12));
  166. ipLabel.setForeground(Color.DARK_GRAY);
  167. ipLabel.setBounds(5, 230, workWidth * 2 / 3 + 55, 26);
  168. this.add(ipLabel);
  169. signalMonitor = new PlcSignalMonitor(s7PLC, plcDb, oprno + pos, MesClient.mesClientFrame);
  170. signalBtn = signalMonitor.createSignalButton();
  171. signalBtn.setBounds(workWidth * 2 / 3 + 63, 230, 90, 26);
  172. this.add(signalBtn);
  173. }
  174. private void addRowLabel(String text, int y) {
  175. JLabel label = new JLabel(text);
  176. label.setHorizontalAlignment(SwingConstants.CENTER);
  177. label.setForeground(Color.BLACK);
  178. label.setFont(new Font("微软雅黑", Font.PLAIN, 20));
  179. label.setBounds(0, y, workWidth / 5, 40);
  180. this.add(label);
  181. }
  182. private JTextField createSnField(int y) {
  183. JTextField field = new JTextField("");
  184. field.setHorizontalAlignment(SwingConstants.CENTER);
  185. field.setForeground(Color.BLACK);
  186. field.setFont(new Font("微软雅黑", Font.PLAIN, 16));
  187. field.setEditable(false);
  188. field.setBounds(workWidth / 5, y, workWidth * 3 / 5, 40);
  189. field.addMouseListener(new MouseAdapter() {
  190. public void mouseClicked(MouseEvent e) {
  191. String sn = field.getText().trim();
  192. if (!sn.isEmpty()) {
  193. MesClient.createQRCode(sn, oprno + pos);
  194. }
  195. }
  196. });
  197. this.add(field);
  198. return field;
  199. }
  200. private JButton createResetBtn(int y, Runnable action) {
  201. JButton btn = new JButton("刷新");
  202. btn.setFont(new Font("微软雅黑", Font.PLAIN, 22));
  203. btn.setBounds(workWidth * 4 / 5 + 10, y, workWidth / 5 - 10, 40);
  204. btn.addActionListener(e -> action.run());
  205. this.add(btn);
  206. return btn;
  207. }
  208. private JLabel createLight(String text, int x, int y) {
  209. JLabel label = new JLabel(text);
  210. label.setHorizontalAlignment(SwingConstants.LEFT);
  211. label.setIcon(imageGray);
  212. label.setForeground(Color.BLACK);
  213. label.setBounds(x, y, workWidth / 3, 30);
  214. this.add(label);
  215. return label;
  216. }
  217. private MouseAdapter toggleSignal(String name, String addr) {
  218. return new MouseAdapter() {
  219. public void mouseClicked(MouseEvent e) {
  220. boolean ret = readBoolean(addr);
  221. if (confirm("确定修改" + name + "(" + addr + ")为" + !ret + "吗?")) {
  222. writeBoolean(addr, !ret);
  223. }
  224. }
  225. };
  226. }
  227. private static ImageIcon scaledIcon(String path) {
  228. ImageIcon icon = new ImageIcon(MesClient.class.getResource(path));
  229. icon.setImage(icon.getImage().getScaledInstance(20, 20, Image.SCALE_SMOOTH));
  230. return icon;
  231. }
  232. private static boolean confirm(String msg) {
  233. return JOptionPane.showConfirmDialog(null, msg, "操作确认", JOptionPane.YES_NO_OPTION,
  234. JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION;
  235. }
  236. private ImageIcon light(boolean on) {
  237. return on ? imageGreen : imageGray;
  238. }
  239. public void formatElementUI() {
  240. cacheData = JdbcUtils.getCache(cacheName);
  241. if (cacheData == null) {
  242. return;
  243. }
  244. productSn.setText(nvl(cacheData.getSn()));
  245. productSnFeeding.setText(nvl(cacheData.getFeedingSn()));
  246. tjFlag = nvl(cacheData.getTjFlag(), 0);
  247. tjFeedingFlag = nvl(cacheData.getTjFeedingFlag(), 0);
  248. lastSn = nvl(cacheData.getLastSn());
  249. setMenuStatus(nvl(cacheData.getMsg()), nvl(cacheData.getError(), -1));
  250. this.repaint();
  251. }
  252. public void setMenuStatus(String msg, int error) {
  253. status_menu.setForeground(error == 0 ? Color.GREEN : Color.RED);
  254. status_menu.setText(msg);
  255. cacheData.setMsg(msg);
  256. cacheData.setError(error);
  257. cacheData.setTjFlag(tjFlag);
  258. cacheData.setTjFeedingFlag(tjFeedingFlag);
  259. cacheData.setTjStatus(tjStatus);
  260. cacheData.setLastSn(lastSn);
  261. cacheData.setSn(productSn.getText());
  262. cacheData.setFeedingSn(productSnFeeding.getText());
  263. // 内容没变不重复写库(等待取码时每轮都会刷新状态)
  264. String json = JSON.toJSONString(cacheData);
  265. if (!json.equals(lastCacheJson)) {
  266. JdbcUtils.setCache(cacheName, json);
  267. lastCacheJson = json;
  268. }
  269. }
  270. // 定时任务 -----------------------------------------------------------------------------------------------------
  271. public void heartData() {
  272. if (heartTimer != null) {
  273. heartTimer.cancel();
  274. }
  275. heartTimer = new Timer();
  276. heartTimer.schedule(new TimerTask() {
  277. public void run() {
  278. if (MesClient.isLogin == 1) {
  279. plcHeart = !plcHeart;
  280. writeBoolean(plcDb + ".0.6", plcHeart, false);
  281. }
  282. }
  283. }, 1000, 1000);
  284. }
  285. public void startOprnoTimer() {
  286. if (oprnoTimer != null) {
  287. oprnoTimer.cancel();
  288. }
  289. oprnoTimer = new Timer();
  290. oprnoTimer.schedule(new TimerTask() {
  291. public void run() {
  292. try {
  293. if (MesClient.isLogin == 1) {
  294. cycle();
  295. }
  296. } catch (Exception e) {
  297. log.error("<{}{}>轮询异常", oprno, pos, e);
  298. }
  299. }
  300. }, 100, 3000);
  301. }
  302. private void cycle() {
  303. boolean retFeeding = readBoolean(plcDb + ".0.0");
  304. boolean retBlanking = readBoolean(plcDb + ".0.1");
  305. boolean retRunning = readBoolean(plcDb + ".0.2");
  306. boolean retAllowFeeding = readBoolean(plcDb + ".0.4");
  307. boolean retAllowBlanking = readBoolean(plcDb + ".0.5");
  308. boolean retToDevice = readBoolean(plcDb + ".0.7");
  309. boolean toDeviceRise = retToDevice && !lastToDevice;
  310. lastToDevice = retToDevice;
  311. feedinglabel.setIcon(light(retFeeding));
  312. feedingmeslabel.setIcon(light(retAllowFeeding));
  313. runlabel.setIcon(light(retRunning));
  314. blankinglabel.setIcon(light(retBlanking));
  315. blankingmeslabel.setIcon(light(retAllowBlanking));
  316. feedingtodevicelabel.setIcon(light(retToDevice));
  317. // 请求上料撤销后复位 MES允许上料
  318. if (!retFeeding && retAllowFeeding) {
  319. writeAllowFeeding(false);
  320. } else if (retFeeding && !retAllowFeeding && tjFeedingFlag == 1 && tjFlag == 0) {
  321. // 码已校验通过但工件还没进设备时 PLC 撤销后又重新请求上料,重新允许上料
  322. writeAllowFeeding(true);
  323. }
  324. // ---------- 上料 ----------
  325. if (!retFeeding) {
  326. feedingReleased = true;
  327. }
  328. if (tjFeedingFlag == 0) {
  329. if (retFeeding && feedingReleased) {
  330. takeSn();
  331. }
  332. } else if (tjFlag == 0 && (toDeviceRise || retRunning)) {
  333. // 工件已进设备:码从上料移到加工
  334. tjFlag = 1;
  335. tjFeedingFlag = 0;
  336. productSn.setText(productSnFeeding.getText());
  337. productSnFeeding.setText("");
  338. feedingReleased = false; // 本次请求上料复位后才处理下一次,防止拿走下一件的码
  339. setMenuStatus("工件已上料到设备", 0);
  340. }
  341. // ---------- 下料 ----------
  342. // 加工码为空时直接放行下料(无码件或已上传完成)
  343. if (retBlanking && productSn.getText().isEmpty() && !retAllowBlanking) {
  344. writeAllowBlanking(true);
  345. }
  346. if (tjFlag == 0 && !retBlanking && retAllowBlanking) {
  347. writeAllowBlanking(false);
  348. }
  349. if (tjFlag == 1 && retRunning) {
  350. tjFlag = 2;
  351. writeAllowFeeding(false);
  352. writeAllowBlanking(false);
  353. setMenuStatus("工件加工中", 0);
  354. } else if (tjFlag == 2 && retBlanking) {
  355. finishWork();
  356. }
  357. }
  358. // 取码并校验:通过后清掉码槽里的码,写 MES允许上料
  359. private void takeSn() {
  360. // 同一个码校验失败后不重复请求,等人工刷新或码槽换成新码
  361. String failedSn = productSnFeeding.getText().trim();
  362. if (!failedSn.isEmpty() && (sourceSlot.isEmpty() || failedSn.equals(sourceSlot.getSn()))) {
  363. return;
  364. }
  365. if (!sourceSlot.tryLock()) {
  366. return; // 其他机台正在取码,下一轮再试
  367. }
  368. try {
  369. String sn = sourceSlot.getSn();
  370. if (sn.isEmpty()) {
  371. setMenuStatus(front ? "暂无扫码结果,等待扫码" : "反面待上料码为空,等待正面下料", -1);
  372. return;
  373. }
  374. productSnFeeding.setText(sn);
  375. lastSn = sn;
  376. JSONObject retObj = DataUtil.checkQuality(sn, oprno + pos, MesClient.user_menu.getText());
  377. if (!isOk(retObj)) {
  378. writeAllowFeeding(false);
  379. setMenuStatus(failMsg(retObj), -1);
  380. return;
  381. }
  382. sourceSlot.clearIf(sn, oprno + pos + "取码");
  383. tjFeedingFlag = 1;
  384. writeAllowFeeding(true);
  385. setMenuStatus("工件可以加工", 0);
  386. } finally {
  387. sourceSlot.unlock();
  388. }
  389. }
  390. // 请求下料:上传结果,有存码目标时成功后存码
  391. private void finishWork() {
  392. String sn = productSn.getText().trim();
  393. if (targetSlot == null) {
  394. if (upload(sn)) {
  395. resetBlanking("工件结果已提交,等待下一件");
  396. writeAllowBlanking(true);
  397. }
  398. return;
  399. }
  400. if (!targetSlot.tryLock()) {
  401. return; // 反面正在取码或其他正面机正在存码,下一轮再试
  402. }
  403. try {
  404. if (!targetSlot.isEmpty()) {
  405. setMenuStatus("反面待上料码" + targetSlot.getSn() + "未取走,暂不允许下料", -1);
  406. return;
  407. }
  408. if (upload(sn)) {
  409. targetSlot.put(sn, oprno + pos);
  410. resetBlanking("结果已提交,码已存入反面待上料码");
  411. writeAllowBlanking(true);
  412. }
  413. } finally {
  414. targetSlot.unlock();
  415. }
  416. }
  417. // 上传加工结果,失败停在 tjFlag=3 等人工刷新(与原逻辑一致)
  418. private boolean upload(String sn) {
  419. tjFlag = 3;
  420. tjStatus = 1;
  421. setMenuStatus("工件加工结束,结果上传中", 0);
  422. log.info("<{}{}>上传加工结果 sn={}", oprno, pos, sn);
  423. JSONObject retObj = DataUtil.sendQuality(sn, oprno + pos, "OK", MesClient.user_menu.getText());
  424. if (isOk(retObj)) {
  425. return true;
  426. }
  427. setMenuStatus(failMsg(retObj), -1);
  428. return false;
  429. }
  430. public void resetBlanking(String msg) {
  431. tjFlag = 0;
  432. tjStatus = 0;
  433. productSn.setText("");
  434. setMenuStatus(msg, 0);
  435. }
  436. public void resetFeeding() {
  437. tjFeedingFlag = 0;
  438. productSnFeeding.setText("");
  439. writeAllowFeeding(false);
  440. setMenuStatus("等待请求上料", 0);
  441. }
  442. private static boolean isOk(JSONObject retObj) {
  443. return retObj != null && "true".equalsIgnoreCase(String.valueOf(retObj.get("result")));
  444. }
  445. private static String failMsg(JSONObject retObj) {
  446. if (retObj == null || retObj.get("result") == null) {
  447. return "请求失败,请重试";
  448. }
  449. String msg = retObj.getString("message");
  450. return msg == null || msg.isEmpty() ? "校验失败" : msg;
  451. }
  452. private static String nvl(String s) {
  453. return s == null ? "" : s;
  454. }
  455. private static int nvl(Integer v, int def) {
  456. return v == null ? def : v;
  457. }
  458. // 与设备交互 -----------------------------------------------------------------------------------------
  459. public void writeAllowFeeding(boolean b) {
  460. writeBoolean(plcDb + ".0.4", b);
  461. }
  462. public void writeAllowBlanking(boolean b) {
  463. writeBoolean(plcDb + ".0.5", b);
  464. }
  465. public boolean readBoolean(String addr) {
  466. try {
  467. boolean ret = s7PLC.readBoolean(addr);
  468. log.info("<{}{}>读取{}-->成功,结果:{}", oprno, pos, addr, ret);
  469. return ret;
  470. } catch (Exception e) {
  471. log.error("<{}{}>读取{}-->失败:{}", oprno, pos, addr, e.getMessage());
  472. return false;
  473. }
  474. }
  475. public boolean writeBoolean(String addr, boolean value) {
  476. return writeBoolean(addr, value, true);
  477. }
  478. // 心跳不打成功日志
  479. private boolean writeBoolean(String addr, boolean value, boolean logOk) {
  480. try {
  481. s7PLC.writeBoolean(addr, value);
  482. if (logOk) {
  483. log.info("<{}{}>写入{}-->成功,写入内容:{}", oprno, pos, addr, value);
  484. }
  485. return true;
  486. } catch (Exception e) {
  487. log.error("<{}{}>写入{}-->失败,写入内容:{},{}", oprno, pos, addr, value, e.getMessage());
  488. return false;
  489. }
  490. }
  491. }