rts-sim-module/repository/psd.go

45 lines
891 B
Go
Raw Normal View History

package repository
import "joylink.club/rtsssimulation/repository/model/proto"
type Psd struct {
Identity
platform *Platform
asdAmount int32
asdGroups []*proto.AsdGroup
componentGroups []*ElectronicComponentGroup
}
func newPsd(id string, asdAmount int32, asdGroups []*proto.AsdGroup) *Psd {
return &Psd{
Identity: identity{id, proto.DeviceType_DeviceType_Psd},
asdAmount: asdAmount,
asdGroups: asdGroups,
}
}
func (p *Psd) Platform() *Platform {
return p.platform
}
func (p *Psd) AsdAmount() int32 {
return p.asdAmount
}
2023-10-23 17:35:57 +08:00
func (p *Psd) AsdGroups() []*proto.AsdGroup {
return p.asdGroups
2023-10-23 17:35:57 +08:00
}
func (p *Psd) FindAsdGroup(group int32) *proto.AsdGroup {
for _, asdGroup := range p.asdGroups {
if asdGroup.Group == group {
return asdGroup
}
}
return nil
2023-10-23 17:35:57 +08:00
}
func (p *Psd) ComponentGroups() []*ElectronicComponentGroup {
return p.componentGroups
2023-10-23 17:35:57 +08:00
}