From 10c65da3d2af7056f48d9301e83f53f102f76e18 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期一, 30 十月 2023 14:52:11 +0800
Subject: [PATCH] fix

---
 conf/config.go |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/conf/config.go b/conf/config.go
index bf7ffbd..1888f21 100644
--- a/conf/config.go
+++ b/conf/config.go
@@ -70,6 +70,15 @@
 	plc struct {
 		FinishNumberTimeInterval int
 		TotalNumberTimeInterval  int
+		ModbusIntType            string
+		SlaveId                  int
+		Package                  string
+		StandbyTime              int64
+	}
+
+	Prompt struct {
+		SafeProduce     string `json:"safeProduce,omitempty"`
+		PlcNotConnected string `json:"plcNotConnected,omitempty"`
 	}
 
 	config struct {
@@ -90,6 +99,8 @@
 
 		//PLC
 		PLC plc
+
+		Prompt Prompt
 	}
 )
 
@@ -112,6 +123,9 @@
 	if err := Viper.Unmarshal(&Conf); err != nil {
 		log.Fatalf("Unmarshal err:%v", err)
 	}
+	if Conf.PLC.StandbyTime == 0 {
+		Conf.PLC.StandbyTime = 300 //5鍒嗛挓
+	}
 	ShowConfig()
 }
 

--
Gitblit v1.8.0