units_common

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnitServicePrefix = ".service/"
	ItemNameError     = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Unit

type Unit struct {
	Started  bool
	Stopping bool
	// contains filtered or unexported fields
}

func (*Unit) GetConfig

func (c *Unit) GetConfig() string

func (*Unit) GetConfigMeta

func (c *Unit) GetConfigMeta() string

func (*Unit) GetItem

func (c *Unit) GetItem(name string) (common_interfaces.ItemValue, error)

func (*Unit) GetItemsOfUnit

func (c *Unit) GetItemsOfUnit(unitId string) ([]common_interfaces.ItemGetUnitItems, error)

func (*Unit) GetValue

func (c *Unit) GetValue(name string) string

func (*Unit) IDataStorage added in v1.0.6

func (c *Unit) IDataStorage() common_interfaces.IDataStorage

func (*Unit) Id

func (c *Unit) Id() string

func (*Unit) IsStarted

func (c *Unit) IsStarted() bool

func (*Unit) LogError

func (c *Unit) LogError(value string)

func (*Unit) LogInfo

func (c *Unit) LogInfo(value string)

func (*Unit) MainItem

func (c *Unit) MainItem() string

func (*Unit) Name

func (c *Unit) Name() string

func (*Unit) SetConfig

func (c *Unit) SetConfig(config string)

func (*Unit) SetError

func (c *Unit) SetError(value string)

func (*Unit) SetFloat64

func (c *Unit) SetFloat64(name string, value float64, UOM string, precision int)

func (*Unit) SetIUnit

func (c *Unit) SetIUnit(iUnit common_interfaces.IUnit)

func (*Unit) SetId

func (c *Unit) SetId(id string)

func (*Unit) SetInt

func (c *Unit) SetInt(name string, value int, UOM string)

func (*Unit) SetInt16

func (c *Unit) SetInt16(name string, value int16, UOM string)

func (*Unit) SetInt32

func (c *Unit) SetInt32(name string, value int32, UOM string)

func (*Unit) SetInt64

func (c *Unit) SetInt64(name string, value int64, UOM string)

func (*Unit) SetMainItem

func (c *Unit) SetMainItem(mainItem string)

func (*Unit) SetName

func (c *Unit) SetName(unitName string)

func (*Unit) SetString

func (c *Unit) SetString(name string, value string, UOM string)

func (*Unit) SetStringService

func (c *Unit) SetStringService(name string, value string, UOM string)

func (*Unit) SetType

func (c *Unit) SetType(unitType string)

func (*Unit) SetUInt16

func (c *Unit) SetUInt16(name string, value uint16, UOM string)

func (*Unit) SetUInt32

func (c *Unit) SetUInt32(name string, value uint32, UOM string)

func (*Unit) SetUInt64

func (c *Unit) SetUInt64(name string, value uint64, UOM string)

func (*Unit) Start

func (c *Unit) Start(iDataStorage common_interfaces.IDataStorage) error

func (*Unit) Stop

func (c *Unit) Stop()

func (*Unit) TouchItem

func (c *Unit) TouchItem(name string)

func (*Unit) Type

func (c *Unit) Type() string

type UnitConfigItem

type UnitConfigItem struct {
	Name              string            `json:"name"`
	DisplayName       string            `json:"display_name"`
	Type              string            `json:"type"`
	MinValue          string            `json:"min_value"`
	MaxValue          string            `json:"max_value"`
	Format            string            `json:"format"`
	Children          []*UnitConfigItem `json:"children"`
	DefaultValue      string            `json:"default_value"`
	ItemIsDisplayName bool              `json:"item_is_display_name"`
}

func LoadUnitConfigItems

func LoadUnitConfigItems(data string) []*UnitConfigItem

func NewUnitConfigItem

func NewUnitConfigItem(name string, displayName string, defaultValue string, tp string, minValue string, maxValue string, format string) *UnitConfigItem

func (*UnitConfigItem) Add

func (c *UnitConfigItem) Add(name string, displayName string, defaultValue string, tp string, minValue string, maxValue string, format string) *UnitConfigItem

func (*UnitConfigItem) Marshal

func (c *UnitConfigItem) Marshal() string

type UnitInfo

type UnitInfo struct {
	Id             string `json:"id"`
	Name           string `json:"name"`
	Type           string `json:"type"`
	TypeForDisplay string `json:"type_for_display"`
	Config         string `json:"config"`
	Enable         bool   `json:"enable"`
}

type UnitType

type UnitType struct {
	TypeCode    string
	DisplayName string
	Picture     []byte
	ConfigMeta  string
}

Jump to

Keyboard shortcuts

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