datacache

package
v0.0.0-...-212a885 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DeadbandConst = 0.000001

DeadbandConst 死区的最小常量

Variables

This section is empty.

Functions

func Deadband

func Deadband(a, b, c float64) bool

Deadband 死区判断,判断是否在死区范围内

func FloatEqual

func FloatEqual(a, b float64) bool

FloatEqual 判断是否相等

Types

type Cache

type Cache struct {
	routine.Routine
	// contains filtered or unexported fields
}

Cache 缓存文件

func (*Cache) GetItems

func (me *Cache) GetItems(t int64) (items []*Item, err error)

GetItems 获取一个文件的全部点

func (*Cache) GetSavePath

func (me *Cache) GetSavePath() string

GetSavePath 获取保存的路径

func (*Cache) Reset

func (me *Cache) Reset()

Reset 复位

func (*Cache) SetSaveDays

func (me *Cache) SetSaveDays(days int)

SetSaveDays 设置保存的天数

func (*Cache) SetSavePath

func (me *Cache) SetSavePath(path string) (err error)

SetSavePath 设置数据保存的路径

func (*Cache) Setup

func (me *Cache) Setup() (err error)

Setup 初始化设置

func (*Cache) Update

func (me *Cache) Update(id int32, value float64, status byte, time int64)

Update 更新内存数据

func (*Cache) UpdateWithDeadband

func (me *Cache) UpdateWithDeadband(id int32, value float64, status byte, time int64, deadband float64)

UpdateWithDeadband 更新内存数据

type Item

type Item struct {
	ID         int32
	Value      float64
	Status     byte
	Time       int32
	Deadband   float64
	LastValue  float64
	LastStatus byte
}

Item 数据

func (*Item) Decode

func (me *Item) Decode(b []byte) (err *ee.Error)

Decode 解码

func (*Item) Encode

func (me *Item) Encode() []byte

Encode 编码

func (*Item) String

func (me *Item) String() string

String 字符串

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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