Documentation ¶
Overview ¶
Package knxproj parses the ETS file format and returns Groupaddresses with DPT.
Index ¶
- Variables
- func ParseManufacturers(path string)
- func ReadManufacturerData(tmpFolder string)
- func ReadProjects(tmpFolder string)
- func Unzip(src, dest string) error
- type ApplicationProgram
- type Area
- type ChannelInstance
- type ComObject
- type ComObjectInstanceRef
- type ComObjectRef
- type Connectors
- type Device
- type DeviceInstance
- type Devices
- type GroupAddress
- type GroupAddress2
- type GroupAddressGroup
- type GroupAddressRef
- type GroupAddresses
- type GroupRange
- type Hardware2
- type Installation
- type Line
- type Manufacturer
- type ManufacturerData
- type ManufacturerData2
- type Object
- type Objects
- type ParameterInstanceRef
- type Product
- type Project
- type ProjectInformation
- type XMLHardware
- type XMLKNXMaster
- type XMLProjectInformation
- type XMLProjectInformationData
Constants ¶
This section is empty.
Variables ¶
View Source
var AddressStyle = 3
View Source
var AllGroupAddress map[string]GroupAddress
View Source
var ComObjectRefs map[string]ComObjectRef
View Source
var ComObjects map[string]ComObject
View Source
var Hardware map[string]Product
View Source
var Language = "en-US"
View Source
var Manufacturers map[string]Manufacturer
Functions ¶
func ParseManufacturers ¶
func ParseManufacturers(path string)
func ReadManufacturerData ¶
func ReadManufacturerData(tmpFolder string)
func ReadProjects ¶
func ReadProjects(tmpFolder string)
Types ¶
type ApplicationProgram ¶
type ApplicationProgram struct { ComObjects []ComObject `xml:"Static>ComObjectTable>ComObject"` ComObjectRefs []ComObjectRef `xml:"Static>ComObjectRefs>ComObjectRef"` Name string `xml:"Name,attr"` ID string `xml:"Id,attr"` }
type ChannelInstance ¶
type ComObject ¶
type ComObject struct { ID string `xml:"Id,attr"` Name string `xml:"Name,attr"` // For what is name used? not visible in ETS Number int `xml:"Number,attr"` FunctionText string `xml:"FunctionText,attr"` ObjectSize string `xml:"ObjectSize,attr"` Text string `xml:"Text,attr"` WriteFlag string `xml:"WriteFlag,attr"` ReadFlag string `xml:"ReadFlag,attr"` ReadOnInitFlag string `xml:"ReadOnInitFlag,attr"` CommunicationFlag string `xml:"CommunicationFlag,attr"` TransmitFlag string `xml:"TransmitFlag,attr"` UpdateFlag string `xml:"UpdateFlag,attr"` DatapointType string `xml:"DatapointType,attr"` }
type ComObjectInstanceRef ¶
type ComObjectInstanceRef struct { RefID string `xml:"RefId,attr"` IsActive bool `xml:"IsActive,attr"` DatapointType string `xml:"DatapointType,attr"` Text string `xml:"Text,attr"` ChannelID string `xml:"ChannelId,attr"` Connectors Connectors `xml:"Connectors"` Description string `xml:"Description,attr"` TransmitFlag string `xml:"TransmitFlag,attr"` UpdateFlag string `xml:"UpdateFlag,attr"` WriteFlag string `xml:"WriteFlag,attr"` ReadFlag string `xml:"ReadFlag,attr"` CommunicationFlag string `xml:"CommunicationFlag,attr"` }
type ComObjectRef ¶
type ComObjectRef struct { Name string `xml:"Name,attr"` RefID string `xml:"RefId,attr"` Tag string `xml:"Tag,attr"` Text string `xml:"Text,attr"` TransmitFlag string `xml:"TransmitFlag,attr"` ReadFlag string `xml:"ReadFlag,attr"` // Enabled or Disabled WriteFlag string `xml:"WriteFlag,attr"` CommunicationFlag string `xml:"CommunicationFlag,attr"` UpdateFlag string `xml:"UpdateFlag,attr"` ReadOnInitFlag string `xml:"ReadOnInitFlag,attr"` ObjectSize string `xml:"ObjectSize,attr"` FunctionText string `xml:"FunctionText,attr"` ID string `xml:"Id,attr"` DatapointType string `xml:"DatapointType,attr"` }
Why do the ComObjectRef have the same data as the ComObject?
type Connectors ¶
type Connectors struct {
Addresses []GroupAddressRef `xml:",any"`
}
type Device ¶
type Device struct { ID string `json:"-"` ProductRefID string `json:"-"` Address string `json:"address"` Name string `json:"name"` Description string `json:"description"` Productname string `json:"productname"` Manufacturer string `json:"manufacturer"` Application string `json:"-"` Type string `json:"-"` Fingerprint string `json:"-"` SerialNumber string `json:"serialnumber"` Objects Objects `json:"objects"` DownloadRequired bool `json:"downloadrequired"` }
type DeviceInstance ¶
type DeviceInstance struct { Description string `xml:"Description,attr"` MediumConfigLoaded string `xml:"MediumConfigLoaded,attr"` Comment string `xml:"Comment,attr"` LastModified time.Time `xml:"LastModified,attr"` Hardware2ProgramRefID string `xml:"Hardware2ProgramRefId,attr"` ID string `xml:"Id,attr"` SerialNumber string `xml:"SerialNumber,attr"` IndividualAddressLoaded string `xml:"IndividualAddressLoaded,attr"` ProductRefID string `xml:"ProductRefId,attr"` ApplicationProgramLoaded string `xml:"ApplicationProgramLoaded,attr"` ParametersLoaded string `xml:"ParametersLoaded,attr"` IsCommunicationObjectVisibilityCalculated string `xml:"IsCommunicationObjectVisibilityCalculated,attr"` LastDownload time.Time `xml:"LastDownload,attr"` CommunicationPartLoaded string `xml:"CommunicationPartLoaded,attr"` Name string `xml:"Name,attr"` Address string `xml:"Address,attr"` Puid string `xml:"Puid,attr"` ComObjectInstanceRefs []ComObjectInstanceRef `xml:"ComObjectInstanceRefs>ComObjectInstanceRef"` ChannelInstances []ChannelInstance `xml:"ChannelInstances>ChannelInstance"` }
type GroupAddress ¶
type GroupAddress struct { Address string Name string ID string MainType int SubType int LinkedDevices int Flags []string }
func NewGroupAddress ¶
func NewGroupAddress(ga GroupAddress2) *GroupAddress
func (GroupAddress) DataPointType ¶
func (g GroupAddress) DataPointType() string
func (GroupAddress) String ¶
func (g GroupAddress) String() string
type GroupAddress2 ¶
type GroupAddressGroup ¶
type GroupAddressRef ¶
type GroupAddresses ¶
type GroupAddresses []GroupAddress
func (GroupAddresses) Len ¶
func (s GroupAddresses) Len() int
func (GroupAddresses) Less ¶
func (s GroupAddresses) Less(i, j int) bool
TODO: test with 2 style address
func (GroupAddresses) Swap ¶
func (s GroupAddresses) Swap(i, j int)
type GroupRange ¶
type GroupRange struct { Name string `xml:"Name,attr"` Puid int `xml:"Puid,attr"` // TODO: what does it mean? ID string `xml:"Id,attr"` RangeStart int `xml:"RangeStart,attr"` // TODO: what does it mean? RangeEnd int `xml:"RangeEnd,attr"` GroupRange []GroupRange `xml:"GroupRange"` GroupAddress []GroupAddress2 `xml:"GroupAddress"` }
type Hardware2 ¶
type Hardware2 struct { //IsCoupler string `xml:"IsCoupler,attr"` SerialNumber string `xml:"SerialNumber,attr"` //VersionNumber string `xml:"VersionNumber,attr"` //HasApplicationProgram string `xml:"HasApplicationProgram,attr"` //BusCurrent string `xml:"BusCurrent,attr"` //ID string `xml:"Id,attr"` //HasIndividualAddress string `xml:"HasIndividualAddress,attr"` //OriginalManufacturer string `xml:"OriginalManufacturer,attr"` //Name string `xml:"Name,attr"` Products []Product `xml:"Products>Product"` }
type ApplicationProgramRef struct { RefID string `xml:"RefId,attr"` }
type Manufacturer struct { RefID string `xml:"RefId,attr"` }
type Language struct { Identifier string `xml:"Identifier,attr"` }
type TranslationUnit struct { RefID string `xml:"RefId,attr"` }
type TranslationElement struct { RefID string `xml:"RefId,attr"` }
type Translation struct { AttributeName string `xml:"AttributeName,attr"` Text string `xml:"Text,attr"` }
type Installation ¶
type Installation struct { Name string `xml:"Name,attr"` BCUKey string `xml:"BCUKey,attr"` DefaultLine string `xml:"DefaultLine,attr"` Topology []Area `xml:"Topology>Area"` GroupAddresses []GroupRange `xml:"GroupAddresses>GroupRanges>GroupRange"` }
type Manufacturer ¶
type Manufacturer struct { ImportGroup string `xml:"ImportGroup,attr"` CompatibilityGroup string `xml:"CompatibilityGroup,attr"` ID string `xml:"Id,attr"` KnxManufacturerID string `xml:"KnxManufacturerId,attr"` Name string `xml:"Name,attr"` DefaultLanguage string `xml:"DefaultLanguage,attr"` ImportRestriction string `xml:"ImportRestriction,attr"` }
type ManufacturerData ¶
type ManufacturerData2 ¶
type ManufacturerData2 struct {
ApplicationProgram ApplicationProgram `xml:"ManufacturerData>Manufacturer>ApplicationPrograms>ApplicationProgram"`
}
type Object ¶
type Object struct { Number int `json:"number"` Name string `json:"name"` Function string `json:"function"` Description string `json:"description"` Groupaddress []string `json:"groupaddress"` Bit int `json:"bit"` Flags string `json:"flags"` DPT string `json:"dpt"` RefID string `json:"-"` Channel string `json:"channel"` ReadOnInit bool `json:"-"` }
type ParameterInstanceRef ¶
type Product ¶
type Product struct { DefaultLanguage string `xml:"DefaultLanguage,attr"` Hash string `xml:"Hash,attr"` ID string `xml:"Id,attr"` Text string `xml:"Text,attr"` OrderNumber string `xml:"OrderNumber,attr"` IsRailMounted string `xml:"IsRailMounted,attr"` VisibleDescription string `xml:"VisibleDescription,attr"` SerialNumber string }
type Project ¶
type Project struct { Name string `json:"name"` ID string `json:"-"` Filename string `json:"filename"` GroupAddressStyle int `json:"gaformat"` LastModified time.Time `json:"lastmodified"` DeviceList Devices `json:"devices"` GroupAddressList GroupAddresses `json:"-"` GroupAddressGroups []GroupAddressGroup `json:"-"` }
var MainProject *Project
func NewProject ¶
type ProjectInformation ¶
type ProjectInformation struct { Comment string `xml:"Comment,attr"` CodePage string `xml:"CodePage,attr"` DeviceCount string `xml:"DeviceCount,attr"` LastUsedPuid string `xml:"LastUsedPuid,attr"` GUID string `xml:"Guid,attr"` Name string `xml:"Name,attr"` GroupAddressStyle string `xml:"GroupAddressStyle,attr"` LastModified string `xml:"LastModified,attr"` }
type XMLHardware ¶
type XMLHardware struct { //Manufacturer Manufacturer `xml:"ManufacturerData>Manufacturer"` Hardware []Hardware2 `xml:"ManufacturerData>Manufacturer>Hardware>Hardware"` }
type XMLKNXMaster ¶
type XMLKNXMaster struct {
Manufacturers []Manufacturer `xml:"MasterData>Manufacturers>Manufacturer"`
}
type XMLProjectInformation ¶
type XMLProjectInformation struct { CreatedBy string `xml:"CreatedBy,attr"` ToolVersion string `xml:"ToolVersion,attr"` Project struct { ID string `xml:"Id,attr"` ProjectInformation ProjectInformation `xml:"ProjectInformation"` } }
type XMLProjectInformationData ¶
type XMLProjectInformationData struct {
Installations []Installation `xml:"Project>Installations>Installation"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.