feat: 重构 AGV 对接与在制品查询,新增 PLC 手动监控功能
This commit is contained in:
@@ -31,8 +31,6 @@ const (
|
||||
CfgPipelineCache = "pipeline_cache"
|
||||
// CfgAllowCrossDay 允许叫非今日排产的料(B5 跨日:1=允许(默认,工位端预警提示),0=禁止)
|
||||
CfgAllowCrossDay = "call.allow_cross_day"
|
||||
// CfgCallMaxQty 单次叫料上限(B5:0=不限(默认),>0=单张叫料单请求量封顶)
|
||||
CfgCallMaxQty = "call.max_qty"
|
||||
)
|
||||
|
||||
// startedAt 服务启动时刻(本机信息展示用)
|
||||
@@ -48,7 +46,6 @@ type SettingsVO struct {
|
||||
LogRetentionDays int `json:"logRetentionDays"` // 事件日志保留天数(0=不清理)
|
||||
PipelineCache int `json:"pipelineCache"` // 滚筒线缓存模式(1=缓存并行,0=串行;预留,PLC 真机接入时生效)
|
||||
AllowCrossDay int `json:"allowCrossDay"` // 允许叫非今日排产的料(1=允许(默认),0=禁止)
|
||||
CallMaxQty int `json:"callMaxQty"` // 单次叫料上限(0=不限(默认))
|
||||
|
||||
// 本机基础信息(只读)
|
||||
LocalIPs []string `json:"localIPs"` // 本机内网 IPv4 列表
|
||||
@@ -68,7 +65,6 @@ type SettingsReq struct {
|
||||
LogRetentionDays *int `json:"logRetentionDays"`
|
||||
PipelineCache *int `json:"pipelineCache"`
|
||||
AllowCrossDay *int `json:"allowCrossDay"`
|
||||
CallMaxQty *int `json:"callMaxQty"`
|
||||
}
|
||||
|
||||
// defaults 建议默认值(未配置时生效)
|
||||
@@ -79,7 +75,6 @@ var settingsDefaults = map[string]int{
|
||||
CfgLogRetention: 0,
|
||||
CfgPipelineCache: 0,
|
||||
CfgAllowCrossDay: 1,
|
||||
CfgCallMaxQty: 0,
|
||||
}
|
||||
|
||||
// GetSettings 读取基础设置 + 本机信息。DB 读失败时按默认值返回(设置页必须能打开)。
|
||||
@@ -98,7 +93,6 @@ func (s *Service) GetSettings(ctx context.Context) (*SettingsVO, error) {
|
||||
LogRetentionDays: cfgIntFrom(kv, CfgLogRetention),
|
||||
PipelineCache: cfgIntFrom(kv, CfgPipelineCache),
|
||||
AllowCrossDay: cfgIntFrom(kv, CfgAllowCrossDay),
|
||||
CallMaxQty: cfgIntFrom(kv, CfgCallMaxQty),
|
||||
LocalIPs: localIPv4s(),
|
||||
ListenAddr: fmt.Sprintf("%s:%d", s.ctx.Config.Host, s.ctx.Config.Port),
|
||||
DBInfo: fmt.Sprintf("%s:%d/%s", s.ctx.Config.Database.Host, s.ctx.Config.Database.Port, s.ctx.Config.Database.Dbname),
|
||||
@@ -132,7 +126,6 @@ func (s *Service) SaveSettings(ctx context.Context, req SettingsReq, operator st
|
||||
{CfgLogRetention, req.LogRetentionDays, 0, 3650, "事件日志保留天数(0=不清理)"},
|
||||
{CfgPipelineCache, req.PipelineCache, 0, 1, "滚筒线缓存模式(1=启用缓存位并行流转,0=串行不缓存);预留配置,PLC 真机接入时生效"},
|
||||
{CfgAllowCrossDay, req.AllowCrossDay, 0, 1, "允许叫非今日排产的料(1=允许,工位端预警提示;0=禁止)"},
|
||||
{CfgCallMaxQty, req.CallMaxQty, 0, 100000, "单次叫料上限(0=不限)"},
|
||||
}
|
||||
for _, it := range items {
|
||||
if it.val == nil {
|
||||
|
||||
Reference in New Issue
Block a user