From 093d3074c8d7b06c58ca6a0b6d281b916c5d95d1 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 30 十月 2023 12:26:59 +0800 Subject: [PATCH] fix --- conf/config.go | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/conf/config.go b/conf/config.go index d18e32e..1888f21 100644 --- a/conf/config.go +++ b/conf/config.go @@ -73,7 +73,12 @@ ModbusIntType string SlaveId int Package string - KeepAlive bool + StandbyTime int64 + } + + Prompt struct { + SafeProduce string `json:"safeProduce,omitempty"` + PlcNotConnected string `json:"plcNotConnected,omitempty"` } config struct { @@ -94,6 +99,8 @@ //PLC PLC plc + + Prompt Prompt } ) @@ -116,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