ets

package
v0.0.0-...-ca0ddf1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpaceTypeBuilding          = "Building"
	SpaceTypeBuildingPart      = "BuildingPart"
	SpaceTypeFloor             = "Floor"
	SpaceTypeRoom              = "Room"
	SpaceTypeDistributionBoard = "DistributionBoard"
	SpaceTypeStairway          = "Stairway"
	SpaceTypeCorridor          = "Corridor"
)

Variables

This section is empty.

Functions

func NestedUnzip

func NestedUnzip(src, dest string, pwd func(string) string) ([]string, error)

Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).

func Unzip

func Unzip(src string, dest string, pwd func(string) string) ([]string, error)

Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).

Types

type ApplicationProgram

type ApplicationProgram struct {
	ID             ApplicationProgramID
	ManufacturerID ManufacturerID
	Name           string
	Version        uint
	Objects        []ComObject
	ObjectRefs     []ComObjectRef
}

ApplicationProgram is an application program.

type ApplicationProgramID

type ApplicationProgramID string

ApplicationProgramID is the ID of an application program.

type Area

type Area struct {
	ID        AreaID
	ProjectID ProjectID
	Name      string
	Address   uint16
	Lines     []Line
}

Area is an area.

type AreaID

type AreaID string

AreaID is the ID of an area.

type ComObject

type ComObject struct {
	ID                   ComObjectID
	ApplicationProgramID ApplicationProgramID
	ManufacturerID       ManufacturerID
	ModuleID             ModuleID
	Name                 string
	Text                 string
	Description          string
	FunctionText         string
	ObjectSize           string
	DatapointType        string
	Priority             string
	ReadFlag             bool
	WriteFlag            bool
	CommunicationFlag    bool
	TransmitFlag         bool
	UpdateFlag           bool
	ReadOnInitFlag       bool
}

ComObject is a communication object.

type ComObjectID

type ComObjectID string

ComObjectID is the ID of a communication object.

type ComObjectInstanceRef

type ComObjectInstanceRef struct {
	ComObjectRefID ComObjectRefID
	ComObjectID    ComObjectID
	DatapointType  string
	Links          []string
}

ComObjectInstanceRef connects a communication object reference with zero or more group addresses.

type ComObjectRef

type ComObjectRef struct {
	ID                   ComObjectRefID
	ComObjectID          ComObjectID
	ApplicationProgramID ApplicationProgramID
	ManufacturerID       ManufacturerID
	Name                 string
	Text                 string
	Description          string
	FunctionText         string
	ObjectSize           string
	DatapointType        string
	Priority             string
	ReadFlag             bool
	WriteFlag            bool
	CommunicationFlag    bool
	TransmitFlag         bool
	UpdateFlag           bool
	ReadOnInitFlag       bool
}

ComObjectRef is an instance/reference to a communication object.

type ComObjectRefID

type ComObjectRefID string

ComObjectRefID is the ID of a communication object reference.

func (ComObjectRefID) IDs

func (s ComObjectRefID) IDs() (m string, ap string, o string, r string)

IDs returns the manfucturer, applicaton program, communication object and communcation object reference ids.

func (ComObjectRefID) InstanceID

func (s ComObjectRefID) InstanceID() string

type Connector

type Connector struct {
	Receive bool
	RefID   GroupAddressID
}

Connector is a connection to a group address.

type DeviceInstance

type DeviceInstance struct {
	ID                 DeviceInstanceID
	ProjectID          ProjectID
	ManufacturerID     ManufacturerID
	HardwareID         HardwareID
	ProductID          ProductID
	Hardware2ProgramID Hardware2ProgramID
	Name               string
	Address            uint16
	ComObjects         []ComObjectInstanceRef
}

DeviceInstance is a device instance.

type DeviceInstanceID

type DeviceInstanceID string

DeviceInstanceID is the ID of a device instance.

type ExportArchive

type ExportArchive struct {
	ProjectFiles      []ProjectFile
	ManufacturerFiles []ManufacturerFile
	HardwareFiles     []HardwareFile
	// contains filtered or unexported fields
}

ExportArchive is a handle to an exported archive (.knxproj or .knxprod).

func OpenExportArchive

func OpenExportArchive(path, password string) (*ExportArchive, error)

OpenExportArchive opens the exported archive located at given path.

func (*ExportArchive) Close

func (ex *ExportArchive) Close() error

Close the archive handle.

func (*ExportArchive) Delete

func (ex *ExportArchive) Delete() error

type GroupAddress

type GroupAddress struct {
	ID            GroupAddressID
	ProjectID     ProjectID
	Name          string
	Description   string
	Address       uint16
	DatapointType string
}

GroupAddress is a group address.

type GroupAddressID

type GroupAddressID string

GroupAddressID is the ID of a group address.

type GroupAddressStyle

type GroupAddressStyle int
const (
	GroupAddressStyleThree GroupAddressStyle = iota
	GroupAddressStyleTwo
	GroupAddressStyleFree
)

type GroupRange

type GroupRange struct {
	ID         GroupRangeID
	Name       string
	RangeStart uint16
	RangeEnd   uint16
	Addresses  []GroupAddress
	SubRanges  []GroupRange
}

GroupRange is a range of group addresses.

type GroupRangeID

type GroupRangeID string

GroupRangeID is the ID of a group range.

type Hardware

type Hardware struct {
	ID                HardwareID
	Name              string
	Products          []Product
	Hardware2Programs []Hardware2Program
}

type Hardware2Program

type Hardware2Program struct {
	ManufacturerID        ManufacturerID
	HardwareID            HardwareID
	ID                    Hardware2ProgramID
	ApplicationProgramIDs []ApplicationProgramID
}

type Hardware2ProgramID

type Hardware2ProgramID string

type HardwareData

type HardwareData struct {
	Manufacturer ManufacturerID
	Hardwares    []Hardware
	Languages    []Language
}

HardwareData contains hardware-specific data.

func DecodeHardwareData

func DecodeHardwareData(r io.Reader) (*HardwareData, error)

DecodeHardwareData parses the contents of a manufacturer file.

func (*HardwareData) UnmarshalXML

func (md *HardwareData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML implements xml.Unmarshaler.

type HardwareFile

type HardwareFile struct {
	Path           string
	ManufacturerID ManufacturerID
}

HardwareFile is a hardware file.

func (*HardwareFile) Decode

func (hf *HardwareFile) Decode() (hd *HardwareData, err error)

Decode the file in order to retrieve the manufacturer data inside it.

type HardwareID

type HardwareID string

HardwareID is the ID of a manufacturer.

type Ids

type Ids struct {
	Manufacturer ManufacturerID
	AppProgram   ApplicationProgramID
	Module       ModuleID
	ComObject    ComObjectID
	ComObjectRef ComObjectRefID
}

type Installation

type Installation struct {
	Name           string
	Topology       []Area
	Locations      []Space
	GroupAddresses []GroupRange
}

Installation is an installation within a project.

type InstallationFile

type InstallationFile struct {
	Path           string
	InstallationID string
}

InstallationFile is a file that contains zero or more project installations.

func (*InstallationFile) Decode

func (i *InstallationFile) Decode() (p *Project, err error)

Decode the file in order to retrieve the project inside it.

type Language

type Language struct {
	ID           LanguageID
	Translations []Translation
}

type LanguageID

type LanguageID string

LanguageID is the ID of a language.

type Line

type Line struct {
	ID        LineID
	ProjectID ProjectID
	Name      string
	Address   uint16
	Devices   []DeviceInstance
}

Line is a line.

type LineID

type LineID string

LineID is the ID of a line.

type ManufacturerData

type ManufacturerData struct {
	ID        ManufacturerID
	Programs  []ApplicationProgram
	Languages []Language
}

ManufacturerData contains manufacturer-specific data.

func DecodeManufacturerData

func DecodeManufacturerData(r io.Reader) (*ManufacturerData, error)

DecodeManufacturerData parses the contents of a manufacturer file.

func (*ManufacturerData) UnmarshalXML

func (md *ManufacturerData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML implements xml.Unmarshaler.

type ManufacturerFile

type ManufacturerFile struct {
	Path string

	ManufacturerID       ManufacturerID
	ApplicationProgramID ApplicationProgramID
}

ManufacturerFile is a manufacturer file.

func (*ManufacturerFile) Decode

func (mf *ManufacturerFile) Decode() (md *ManufacturerData, err error)

Decode the file in order to retrieve the manufacturer data inside it.

type ManufacturerID

type ManufacturerID string

ManufacturerID is the ID of a manufacturer.

type ModuleID

type ModuleID string

type Product

type Product struct {
	ID             ProductID
	ManufacturerID ManufacturerID
	HardwareID     HardwareID
	Text           string
}

type ProductID

type ProductID string

ProductID is the ID of a product.

type Project

type Project struct {
	ID            ProjectID
	Name          string
	Installations []Installation
}

Project contains an entire project. These information are usually stored within a file located at P-XXXX/N.xml (0 <= N <= 16).

func DecodeProject

func DecodeProject(r io.Reader) (*Project, error)

DecodeProject parses the contents of a project file.

func (*Project) UnmarshalXML

func (p *Project) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML implements xml.Unmarshaler.

type ProjectFile

type ProjectFile struct {
	Path string

	ProjectID         string
	InstallationFiles []InstallationFile
}

ProjectFile is a file that contains project information.

func (*ProjectFile) Decode

func (pf *ProjectFile) Decode() (pi *ProjectInfo, err error)

Decode the file in order to retrieve the project info inside it.

type ProjectID

type ProjectID string

ProjectID is a project identifier.

type ProjectInfo

type ProjectInfo struct {
	ID           ProjectID
	Name         string
	Comment      string
	AddressStyle GroupAddressStyle
}

ProjectInfo contains project information. These information are usually stored in the P-XXXX/Project.xml file.

func DecodeProjectInfo

func DecodeProjectInfo(r io.Reader) (*ProjectInfo, error)

DecodeProjectInfo parses the contents of project info file.

func (*ProjectInfo) UnmarshalXML

func (pi *ProjectInfo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML implements xml.Unmarshaler.

type Space

type Space struct {
	ID                SpaceID
	ProjectID         ProjectID
	DeviceInstanceIDs []DeviceInstanceID
	Type              string
	Name              string
	SubSpaces         []Space
}

Space is a space for devices and other spaces.

type SpaceID

type SpaceID string

SpaceID is the ID of a space.

type Translation

type Translation struct {
	RefID TranslationRefID
	Texts map[string]string
}

type TranslationRefID

type TranslationRefID string

TranslationRefID is the ID of a translation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL