fix
zhangqian
2023-10-30 10c65da3d2af7056f48d9301e83f53f102f76e18
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()
}