101 lines
5.1 KiB
Go
101 lines
5.1 KiB
Go
// Package orm define database data struct
|
||
package orm
|
||
|
||
import "github.com/gofrs/uuid"
|
||
|
||
type BusbarSection struct {
|
||
// 母线基本参数
|
||
Name string // 母线端名称,默认值BusX
|
||
BusbarNumber int // 母线编号,默认值1
|
||
UUID uuid.UUID
|
||
StandardVoltage float32 // 标准电压,单位kV,范围值在000.01~500.00
|
||
Desc string // 描述
|
||
IsService bool // 是否服役,值为运行/退出
|
||
Status string // 状态,值为现役/新建/计划/检修/库存可用/库存报废
|
||
PowerGridName string // 当前工程电网的顶层建模时的电网名称
|
||
RegionName string // 当前工程电网的顶层建模时的区域电网名称
|
||
FactoryStationName string // 当前工程电网的顶层建模时的厂站名称
|
||
// 母线模型参数
|
||
VoltagePercentValue float32 // 以母线标称电压为基准的百分数,默认值1.00~200.00
|
||
VoltageCalculcatedValue float32 // 通过StandardVoltage与VoltagePercentValtage计算得出的电压值,默认值0.01~1000.00
|
||
PhaseAngle float32 // 面向三相对称电网的属性值,可按A相电压考虑即可,默认值-180.00~180.00
|
||
RatedCurrent float32 // 母线额定电流,范围值0.01~65536
|
||
DynamicStableCurrent float32 // 母线动稳定电流,范围值0.01~65536
|
||
MinLoadAdjustmentCoefficient int // 最小母线负荷调整系数,范围值0-100
|
||
MaxLoadAdjustmentCoefficient int // 最大母线负荷调整系数,范围值0-500
|
||
BusbarType int // 母线类型,默认值PQ
|
||
ReferenceVoltage float32 // 母线类型,单位kV,默认值37
|
||
ReferenceVCurrent float32 // 母线类型,单位MVA,默认值100
|
||
MinS3Capacities float32 // 最小三项短路容量,范围值0.00~65536.00
|
||
MaxS3Capacities float32 // 最大三项短路容量,范围值0.00~65536.00
|
||
MinS3Current float32 // 最小三项短路电流,范围值0.00~65536.00
|
||
MaxS3Current float32 // 最大三项短路电流,范围值0.00~65536.00
|
||
MinZ3Impedance float32 // 最小三项短路阻抗,默认值 0.1,范围值0.0000~100.0000
|
||
MaxZ3Impedance float32 // 最大三项短路阻抗,默认值 0.05,范围值0.0000~100.0000
|
||
MinS1Capacity float32 // 最小单项短路容量,范围值0.00~65536.00
|
||
MaxS1Capacity float32 // 最大单项短路容量,范围值0.00~65536.00
|
||
MinS1Current float32 // 最小单项短路电流,范围值0.00~65536.00
|
||
MaxS1Current float32 // 最大单项短路电流,范围值0.00~65536.00
|
||
MinS1Impedance float32 // 最小单项短路阻抗,默认值 0.1,范围值0.0000~100.0000
|
||
MaxS1Impedance float32 // 最大单项短路阻抗,默认值 0.05,范围值0.0000~100.0000
|
||
// 母线稳定参数
|
||
UnderVoltageWarningThreshold int // 欠压预警阈值
|
||
UnderVoltageWarningRunningTime float32 // 欠压预警运行时间,默认值 10s,默认单位秒,默认范围值0s-100s
|
||
UnderVoltageAlarmThreshold int // 欠压告警阈值
|
||
UnderVoltageAlarmRunningTime float32 // 欠压告警运行时间,默认值 10s,默认单位秒,默认范围值0s-100s
|
||
OverVoltageWarningThreshold int // 过压预警阈值
|
||
OverVoltageWarningRunningTime float32 // 过压预警运行时间,默认值 10s,默认单位秒,默认范围值0s-100s
|
||
OverVoltageAlarmThreshold int // 过压告警阈值
|
||
OverVoltageAlarmRunningTime float32 // 过压告警运行时间,默认值 10s,默认单位秒,默认范围值0s-100s
|
||
PMax float32 // 有功储备裕度最大值
|
||
QMax float32 // 无功储备裕度最大值
|
||
Ulim float32 // 电压裕度
|
||
Plim float32 // 实时有功安全裕度限值,默认值30%,范围 0-100%
|
||
Qlim float32 // 实时无功安全裕度限值,默认值30%,范围 0-100%
|
||
// 母线间隔信息
|
||
MeasurementLevelCurrent []string // 测量级电流测点
|
||
MeasurementLevelVoltage []string // 测量级电压测点
|
||
ProtectionLevelCurrent []string // 保护级电流测点
|
||
ProtectionLevelVoltaget []string // 保护级电压测点
|
||
Trend []string // 潮流测点
|
||
Frequency []string // 频率测点
|
||
StatusMeasurementPoint []string // 状态测点测点
|
||
}
|
||
|
||
// TableName func respresent return table name of BusbarSection
|
||
func (b *BusbarSection) TableName() string {
|
||
return "BusbarSection"
|
||
}
|
||
|
||
func NewBusbarSection(name string) (*BusbarSection, error) {
|
||
uuid, err := uuid.NewV4()
|
||
if err != nil {
|
||
return nil, err
|
||
}
|
||
return &BusbarSection{
|
||
Name: name,
|
||
UUID: uuid,
|
||
}, nil
|
||
}
|
||
|
||
func (b *BusbarSection) BusNameLenCheck() bool {
|
||
if len([]rune(b.Name)) > 20 {
|
||
return false
|
||
}
|
||
return true
|
||
}
|
||
|
||
func (b *BusbarSection) BusVoltageCheck() bool {
|
||
if b.StandardVoltage > 500.00 || b.StandardVoltage < 000.01 {
|
||
return false
|
||
}
|
||
return true
|
||
}
|
||
|
||
func (b *BusbarSection) BusDescLenCheck() bool {
|
||
if len([]rune(b.Desc)) > 100 {
|
||
return false
|
||
}
|
||
return true
|
||
}
|