iscs ecs 调整

This commit is contained in:
xzb 2023-12-19 11:21:00 +08:00
parent dffafe98df
commit 08e4d2f8e2
2 changed files with 10 additions and 10 deletions

View File

@ -24,8 +24,8 @@ type SwitchThreePosition = uint8
const (
StpOpened SwitchThreePosition = iota //开关分闸,线路断开,未与任何位置接通
StpClosedPosition1 //开关合闸到位置1与位置1线路导通
StpClosedPosition2 //开关合闸到位置2与位置2线路导通
StpClosedWorking //隔离开关合闸
StpClosedLanding //接地开关合闸
)
/////////////////////////

View File

@ -37,8 +37,8 @@ type SwitchThreePositionOptEnum = uint8
const (
StpOpened SwitchThreePositionOptEnum = iota //开关分闸,线路断开,未与任何位置接通
StpClosedPosition1 //开关合闸到位置1与位置1线路导通
StpClosedPosition2 //开关合闸到位置2与位置2线路导通
StpClosedWorking //隔离开关合闸
StpClosedLanding //接地开关合闸
)
// ThreePositionSwitchOperate 三工位开关操作
@ -54,10 +54,10 @@ func ThreePositionSwitchOperate(w ecs.World, deviceId string, opt SwitchThreePos
switch opt {
case StpOpened:
return component.StpOpened, nil
case StpClosedPosition1:
return component.StpClosedPosition1, nil
case StpClosedPosition2:
return component.StpClosedPosition2, nil
case StpClosedWorking:
return component.StpClosedWorking, nil
case StpClosedLanding:
return component.StpClosedLanding, nil
default:
return component.StpOpened, fmt.Errorf("三工位开关操作[%d]不存在", opt)
}