package repository import ( "joylink.club/rtsssimulation/repository/model/proto" ) type Station struct { Identity code string empGroups []*ElectronicComponentGroup spksComponents []IGroupedElectronicComponent deviceEcc []*proto.DeviceEcc } func NewStation(id, code string) *Station { return &Station{ Identity: identity{id, proto.DeviceType_DeviceType_Station}, code: code, } } func (s *Station) GetCode() string { return s.code } func (s *Station) EmpGroups() []*ElectronicComponentGroup { return s.empGroups } func (s *Station) SpksComponents() []IGroupedElectronicComponent { return s.spksComponents } func (s *Station) SpksButtons() []*Button { var buttons []*Button for _, c := range s.spksComponents { b, ok := c.(*Button) if ok { buttons = append(buttons, b) } } return buttons } func (s *Station) DeviceEcc() []*proto.DeviceEcc { return s.deviceEcc }