2024-12-02 16:13:16 +08:00
|
|
|
|
// Package orm define database data struct
|
|
|
|
|
|
package orm
|
2024-11-22 16:41:04 +08:00
|
|
|
|
|
|
|
|
|
|
import "github.com/gofrs/uuid"
|
|
|
|
|
|
|
2024-12-09 16:05:48 +08:00
|
|
|
|
// BusbarSection define busbar section model
|
2024-11-22 16:41:04 +08:00
|
|
|
|
type BusbarSection struct {
|
|
|
|
|
|
// 母线基本参数
|
2024-12-30 16:39:11 +08:00
|
|
|
|
ComponentID int64 // compoent表ID
|
2024-12-10 16:36:59 +08:00
|
|
|
|
BusbarName string // 母线端名称,默认值BusX
|
2024-12-04 15:57:11 +08:00
|
|
|
|
BusbarNumber int // 母线编号,默认值1
|
2024-12-10 16:36:59 +08:00
|
|
|
|
UUID uuid.UUID `gorm:"column:global_uuid;primaryKey"`
|
2024-12-04 15:57:11 +08:00
|
|
|
|
StandardVoltage float32 // 标准电压,单位kV,范围值在000.01~500.00
|
2024-12-10 16:36:59 +08:00
|
|
|
|
BusbarDesc string // 描述
|
2024-12-04 15:57:11 +08:00
|
|
|
|
IsService bool // 是否服役,值为运行/退出
|
|
|
|
|
|
Status string // 状态,值为现役/新建/计划/检修/库存可用/库存报废
|
|
|
|
|
|
PowerGridName string // 当前工程电网的顶层建模时的电网名称
|
|
|
|
|
|
RegionName string // 当前工程电网的顶层建模时的区域电网名称
|
|
|
|
|
|
FactoryStationName string // 当前工程电网的顶层建模时的厂站名称
|
2024-11-22 16:41:04 +08:00
|
|
|
|
// 母线模型参数
|
|
|
|
|
|
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
|
2024-12-10 16:36:59 +08:00
|
|
|
|
BusbarType string // 母线类型,默认值PQ
|
|
|
|
|
|
ReferenceVoltage float32 // 基准电压,单位kV,默认值37
|
|
|
|
|
|
ReferenceCurrent float32 // 基准电流,单位MVA,默认值100
|
2024-11-22 16:41:04 +08:00
|
|
|
|
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
|
2024-12-10 16:36:59 +08:00
|
|
|
|
MinZ1Impedance float32 // 最小单项短路阻抗,默认值 0.1,范围值0.0000~100.0000
|
|
|
|
|
|
MaxZ1Impedance float32 // 最大单项短路阻抗,默认值 0.05,范围值0.0000~100.0000
|
2024-11-22 16:41:04 +08:00
|
|
|
|
// 母线稳定参数
|
|
|
|
|
|
UnderVoltageWarningThreshold int // 欠压预警阈值
|
2024-12-10 16:36:59 +08:00
|
|
|
|
UnderVoltageWarningRunningTime int // 欠压预警运行时间,默认值 10s,默认单位秒,默认范围值0s-100s
|
2024-11-22 16:41:04 +08:00
|
|
|
|
UnderVoltageAlarmThreshold int // 欠压告警阈值
|
2024-12-10 16:36:59 +08:00
|
|
|
|
UnderVoltageAlarmRunningTime int // 欠压告警运行时间,默认值 10s,默认单位秒,默认范围值0s-100s
|
2024-11-22 16:41:04 +08:00
|
|
|
|
OverVoltageWarningThreshold int // 过压预警阈值
|
2024-12-10 16:36:59 +08:00
|
|
|
|
OverVoltageWarningRunningTime int // 过压预警运行时间,默认值 10s,默认单位秒,默认范围值0s-100s
|
2024-11-22 16:41:04 +08:00
|
|
|
|
OverVoltageAlarmThreshold int // 过压告警阈值
|
2024-12-10 16:36:59 +08:00
|
|
|
|
OverVoltageAlarmRunningTime int // 过压告警运行时间,默认值 10s,默认单位秒,默认范围值0s-100s
|
2024-11-22 16:41:04 +08:00
|
|
|
|
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 // 状态测点测点
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-09 16:05:48 +08:00
|
|
|
|
// TableName func respresent return table name of busbar section
|
2024-12-02 16:13:16 +08:00
|
|
|
|
func (b *BusbarSection) TableName() string {
|
|
|
|
|
|
return "BusbarSection"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-30 16:39:11 +08:00
|
|
|
|
// SetComponentID func implement BasicModelInterface interface
|
|
|
|
|
|
func (b *BusbarSection) SetComponentID(componentID int64) {
|
|
|
|
|
|
b.ComponentID = componentID
|
2024-12-04 15:57:11 +08:00
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ReturnTableName func implement BasicModelInterface interface
|
|
|
|
|
|
func (b *BusbarSection) ReturnTableName() string {
|
|
|
|
|
|
return "BusbarSection"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-11-22 16:41:04 +08:00
|
|
|
|
func NewBusbarSection(name string) (*BusbarSection, error) {
|
|
|
|
|
|
uuid, err := uuid.NewV4()
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
return nil, err
|
|
|
|
|
|
}
|
|
|
|
|
|
return &BusbarSection{
|
2024-12-10 16:36:59 +08:00
|
|
|
|
BusbarName: name,
|
|
|
|
|
|
UUID: uuid,
|
2024-11-22 16:41:04 +08:00
|
|
|
|
}, nil
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (b *BusbarSection) BusNameLenCheck() bool {
|
2024-12-10 16:36:59 +08:00
|
|
|
|
if len([]rune(b.BusbarName)) > 20 {
|
2024-11-22 16:41:04 +08:00
|
|
|
|
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 {
|
2024-12-10 16:36:59 +08:00
|
|
|
|
if len([]rune(b.BusbarDesc)) > 100 {
|
2024-11-22 16:41:04 +08:00
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
return true
|
|
|
|
|
|
}
|