From b175a9fb3fcd6d7ed1196a8c4c303f1bc6372d91 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 09 四月 2024 14:27:09 +0800
Subject: [PATCH] 调整测量图形显示
---
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java b/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
index 22af7d8..b2fa075 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -61,6 +61,39 @@
@Autowired
private JdbcConnections jdbcConnections;
+ // 鍐欏叆word
+ @GetMapping("/WriteWord")
+ public Result WriteWord(String address,float value) {
+ System.err.println("鍐欏叆word"+address+"+"+value);
+ if(address.equals("DB10.224")||address.equals("DB10.226")||address.equals("DB10.228")||address.equals("DB10.230")){
+
+ S7control.getinstance().WriteWord(address, (short)value);
+ }else{
+ S7control.getinstance().writeFloat32(address, value);
+ }
+
+ Map<String, Object> map = new HashMap<>();
+ map.put("message", "200");
+ return Result.success(map);
+ }
+
+ // 鍐欏叆bit
+ @GetMapping("/WriteBit")
+ public Result WriteBit(String address,short value) {
+
+ boolean values;
+ if (value == 0) {
+ values=false;
+ }else{
+ values=true;
+ }
+ S7control.getinstance().WriteBit(address, values);
+ System.err.println("鍐欏叆bit"+address+"+"+values);
+ Map<String, Object> map = new HashMap<>();
+ map.put("message", "200");
+ return Result.success(map);
+ }
+
// 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛鏉冮檺
@GetMapping("/SelectPermissionByUserName")
public Result SelectPermissionByUserName(String username) throws SQLException {
--
Gitblit v1.8.0