mapper

package
v0.1.89 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SLAVE_ENV_PREFIX = "slave_"
)

Variables

This section is empty.

Functions

func CurrentToRatio added in v0.1.51

func CurrentToRatio(current float64) float64

Returns the 4-20mA input signal to a ratio, 4000uA => 0.0, 8000uA => 0.25, 12000uA => 0.5, 16000uA => 0.75, 20000uA => 1.0 current is in uA (1000000uA is 1A) return value is a ratio (0.0 .. 1.0)

func HeightToVolume added in v0.1.51

func HeightToVolume(height float64, sensorOffset float64, heights []interface{}, volumes []interface{}) (result float64, err error)

Returns the HeightToVolume corresponding to the measured height. This function is used when a pressure sensor is used in a tank. height is in m sensorOffset is in m (positive means that the sensor is placed above the bottom of the tank, negative value means that the sensor is placed below the tank) heights is in m, list of heights with corresponding volumes volumes is in m3, list of volumes with corresponding heights return value is in m3

func ListToFloats added in v0.1.51

func ListToFloats(input []interface{}) ([]float64, error)

func MovingAverage added in v0.1.88

func MovingAverage(values []message.SingleValueMapped) float64

func PressureToHeight added in v0.1.51

func PressureToHeight(pressure float64, density float64) float64

Converts a pressure and density to a height pressure is in Pa (1 Bar is 100000 Pascal) density is in kg/m3 (typical value for diesel is 840) return value is in m

Types

type AggregateMapper added in v0.1.41

type AggregateMapper struct {
	// contains filtered or unexported fields
}

func NewAggregateMapper added in v0.1.41

func NewAggregateMapper(c config.MapperConfig, emc []config.ExpressionMappingConfig) (*AggregateMapper, error)

func (*AggregateMapper) DoMap added in v0.1.41

func (m *AggregateMapper) DoMap(input *message.Mapped) (*message.Mapped, error)

func (*AggregateMapper) Map added in v0.1.41

func (m *AggregateMapper) Map(subscriber mangos.Socket, publisher mangos.Socket)

type CSVMapper added in v0.1.2

type CSVMapper struct {
	// contains filtered or unexported fields
}

func NewCSVMapper added in v0.1.2

func NewCSVMapper(c config.CSVMapperConfig, cmc []config.CSVMappingConfig) (*CSVMapper, error)

func (*CSVMapper) DoMap added in v0.1.9

func (m *CSVMapper) DoMap(r *message.Raw) (*message.Mapped, error)

func (*CSVMapper) Map added in v0.1.2

func (m *CSVMapper) Map(subscriber mangos.Socket, publisher mangos.Socket)

type CanBusMapper added in v0.1.26

type CanBusMapper struct {
	// contains filtered or unexported fields
}

func NewCanBusMapper added in v0.1.26

func (*CanBusMapper) DoMap added in v0.1.26

func (m *CanBusMapper) DoMap(r *message.Raw) (*message.Mapped, error)

func (*CanBusMapper) Map added in v0.1.26

func (m *CanBusMapper) Map(subscriber mangos.Socket, publisher mangos.Socket)

type DBC added in v0.1.26

type DBC map[uint32]*dbc.MessageDef

type ExpressionEnvironment added in v0.1.47

type ExpressionEnvironment map[string]interface{}

func NewExpressionEnvironment added in v0.1.47

func NewExpressionEnvironment() ExpressionEnvironment

type ExpressionFilter added in v0.1.80

type ExpressionFilter struct {
	// contains filtered or unexported fields
}

func NewExpressionFilter added in v0.1.80

func NewExpressionFilter(emc []config.ExpressionMappingConfig) (*ExpressionFilter, error)

func (*ExpressionFilter) DoMap added in v0.1.80

func (f *ExpressionFilter) DoMap(delta *message.Mapped) (*message.Mapped, error)

func (*ExpressionFilter) Map added in v0.1.80

func (f *ExpressionFilter) Map(subscriber mangos.Socket, publisher mangos.Socket)

type JSONMapper added in v0.1.16

type JSONMapper struct {
	// contains filtered or unexported fields
}

func NewJSONMapper added in v0.1.16

func NewJSONMapper(c config.MapperConfig, jmc []config.JSONMappingConfig) (*JSONMapper, error)

func (*JSONMapper) DoMap added in v0.1.16

func (m *JSONMapper) DoMap(r *message.Raw) (*message.Mapped, error)

func (*JSONMapper) Map added in v0.1.16

func (m *JSONMapper) Map(subscriber mangos.Socket, publisher mangos.Socket)

type MappedMapper added in v0.1.40

type MappedMapper interface {
	DoMap(*message.Mapped) (*message.Mapped, error)
}

type Mapper

type Mapper interface {
	Map(subscriber mangos.Socket, publisher mangos.Socket)
}

Mapper interface

type ModbusMapper

type ModbusMapper struct {
	// contains filtered or unexported fields
}

func (*ModbusMapper) DoMap added in v0.1.9

func (m *ModbusMapper) DoMap(r *message.Raw) (*message.Mapped, error)

func (*ModbusMapper) Map

func (m *ModbusMapper) Map(subscriber mangos.Socket, publisher mangos.Socket)

type Nmea0183Mapper

type Nmea0183Mapper struct {
	// contains filtered or unexported fields
}

func NewNmea0183Mapper

func NewNmea0183Mapper(c config.MapperConfig) (*Nmea0183Mapper, error)

func (*Nmea0183Mapper) DoMap added in v0.1.9

func (m *Nmea0183Mapper) DoMap(r *message.Raw) (*message.Mapped, error)

func (*Nmea0183Mapper) Map

func (m *Nmea0183Mapper) Map(subscriber mangos.Socket, publisher mangos.Socket)

type RateLimitFilter added in v0.1.80

type RateLimitFilter struct {
	// contains filtered or unexported fields
}

func NewRateLimitFilter added in v0.1.80

func NewRateLimitFilter(c *config.RateLimitFilterConfig) (*RateLimitFilter, error)

func (*RateLimitFilter) DoMap added in v0.1.80

func (m *RateLimitFilter) DoMap(delta *message.Mapped) (*message.Mapped, error)

func (*RateLimitFilter) Map added in v0.1.80

func (f *RateLimitFilter) Map(subscriber mangos.Socket, publisher mangos.Socket)

type RealMapper added in v0.1.9

type RealMapper interface {
	DoMap(*message.Raw) (*message.Mapped, error)
}

type Signal added in v0.1.26

type Signal struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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