Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(enable bool)
- func DecodeToString(b []byte, bits int) string
- func DecodeToUInt(b []byte, bits int) (uint64, error)
- func SetUserDebug(f TraceFunc)
- func TraceError(format string, v ...interface{})
- func TraceInfo(format string, v ...interface{})
- type BvFileIndex
- type BvFileInfo
- type SensorData
- type SensorDataList
- type TraceFunc
Constants ¶
View Source
const ( BitsUint8 = 8 BitsUint16 = 16 BitsUint32 = 32 BitsUint64 = 64 BitsUintX = 100 // string )
View Source
const ( LevelEmergency = iota LevelAlert LevelCritical LevelError LevelWarning LevelNotice LevelInformational LevelDebug )
View Source
const Version string = "V1.0.0"
Variables ¶
View Source
var BvFileIndexTable = []BvFileIndex{ {Name: "CustomerSeriNum", Size: 8, Index: 0, Bits: BitsUint32}, {Name: "ManufacSerial", Size: 8, Index: 8, Bits: BitsUint32}, {Name: "CustomerResets", Size: 4, Index: 16, Bits: BitsUint16}, {Name: "ConfigTime", Size: 8, Index: 20, Bits: BitsUint32}, {Name: "LoggerStartDate", Size: 8, Index: 28, Bits: BitsUint32}, {Name: "LoggerStopDate", Size: 8, Index: 36, Bits: BitsUint32}, {Name: "StartupDelay", Size: 8, Index: 44, Bits: BitsUint32}, {Name: "MeasurInterval", Size: 8, Index: 52, Bits: BitsUint32}, {Name: "TemperatureUnits", Size: 1, Index: 60, Bits: BitsUint8}, {Name: "HighBinTempTripPoint_A", Size: 4, Index: 61, Bits: BitsUint16}, {Name: "HighBinFuncCounter_A", Size: 8, Index: 65, Bits: BitsUint32}, {Name: "HighFuncLimit_A", Size: 8, Index: 73, Bits: BitsUint32}, {Name: "HighBinTempTripPoint_B", Size: 4, Index: 81, Bits: BitsUint16}, {Name: "HighBinFuncCounter_B", Size: 8, Index: 85, Bits: BitsUint32}, {Name: "HighFuncLimit_B", Size: 8, Index: 93, Bits: BitsUint32}, {Name: "LowBinTempTripPoint_A", Size: 4, Index: 101, Bits: BitsUint16}, {Name: "LowBinFuncCounter_A", Size: 8, Index: 105, Bits: BitsUint32}, {Name: "LowFuncLimit_A", Size: 8, Index: 113, Bits: BitsUint32}, {Name: "LowBinTempTripPoint_B", Size: 4, Index: 121, Bits: BitsUint16}, {Name: "LowBinFuncCounter_B", Size: 8, Index: 125, Bits: BitsUint32}, {Name: "LowFuncLimit_B", Size: 8, Index: 133, Bits: BitsUint32}, {Name: "AVR", Size: 4, Index: 141, Bits: BitsUint16}, {Name: "MKT", Size: 4, Index: 145, Bits: BitsUint16}, {Name: "TotalTime_HighB", Size: 8, Index: 149, Bits: BitsUint32}, {Name: "TotalTime_HighA", Size: 8, Index: 157, Bits: BitsUint32}, {Name: "TotalTime_2_8", Size: 8, Index: 165, Bits: BitsUint32}, {Name: "TotalTime_LowA", Size: 8, Index: 173, Bits: BitsUint32}, {Name: "TotalTime_LowB", Size: 8, Index: 181, Bits: BitsUint32}, {Name: "NoOfViola_HighB", Size: 8, Index: 189, Bits: BitsUint32}, {Name: "NoOfViola_HighA", Size: 8, Index: 197, Bits: BitsUint32}, {Name: "NoOfViola_LowA", Size: 8, Index: 205, Bits: BitsUint32}, {Name: "NoOfViola_LowB", Size: 8, Index: 213, Bits: BitsUint32}, {Name: "LongestTime_HighB", Size: 8, Index: 221, Bits: BitsUint32}, {Name: "LongestTime_HighA", Size: 8, Index: 229, Bits: BitsUint32}, {Name: "LongestTime_LowA", Size: 8, Index: 237, Bits: BitsUint32}, {Name: "LongestTime_LowB", Size: 8, Index: 245, Bits: BitsUint32}, {Name: "LogerName", Size: 22, Index: 253, Bits: BitsUintX}, {Name: "TimeBase", Size: 10, Index: 275, Bits: BitsUintX}, {Name: "ConfigBy", Size: 20, Index: 285, Bits: BitsUintX}, {Name: "Notes", Size: 96, Index: 305, Bits: BitsUintX}, {Name: "NumberOfPoints", Size: 8, Index: 401, Bits: BitsUint32}, {Name: "Temperature_0", Size: 4, Index: 409, Bits: BitsUint16}, }
BvFileIndexTable bv文件变量位置表
Functions ¶
func DecodeToUInt ¶
DecodeToUInt 解码bin为 uint8/uint16/uint32
Types ¶
type BvFileIndex ¶
bv bin data format
func GetBvFileIndexByName ¶
func GetBvFileIndexByName(name string) *BvFileIndex
type BvFileInfo ¶
type BvFileInfo struct { CustomerSeriNum string // u32 顾客系列号 ManufacSerial string // u32 厂家系列号 CustomerResets int64 // u16 顾客复位次数 ConfigTime int64 // u32 配置时间 LoggerStartDate int64 // u32 启动时间 LoggerStopDate int64 // u32 停止时间 StartupDelay int64 // u32 启动延时时间 MeasurInterval int64 // u32 测量间隔 TemperatureUnits string // u8 温度单位 HighBinTempTripPoint_A int64 // u16 上限配置值 ? HighBinTempTripPoint_A_Temp float32 // 上限配置值 - 温度 HighBinTempTripPoint_A_Humi float32 // 上限配置值 - 湿度 HighBinFuncCounter_A int64 // u32 超上限秒数 HighFuncLimit_A string // u32 上限值 ? HighBinTempTripPoint_B int64 // u16 上上限配置值 ? HighBinTempTripPoint_B_Temp float32 // 上上限配置值 - 温度 HighBinTempTripPoint_B_Humi float32 // 上上限配置值 - 湿度 HighBinFuncCounter_B int64 // u32 超上上限秒数 HighFuncLimit_B string // u32 上上限值 ? LowBinTempTripPoint_A int64 // u16 下限配置值 ? LowBinTempTripPoint_A_Temp float32 // 下限配置值 - 温度 LowBinTempTripPoint_A_Humi float32 // 下限配置值 - 湿度 LowBinFuncCounter_A int64 // u32 超下限秒数 LowFuncLimit_A string // u32 下限值 ? LowBinTempTripPoint_B int64 // u16 下下限配置值 ? LowBinTempTripPoint_B_Temp float32 // 下限配置值 - 温度 LowBinTempTripPoint_B_Humi float32 // 下限配置值 - 湿度 LowBinFuncCounter_B int64 // u32 超下下限秒数 LowFuncLimit_B string // u32 下下限值 ? AVR float32 // u16 平均温度 MKT float32 // u16 MKT 值 TotalTime_HighB int64 // u32 超上上限总的秒数 TotalTime_HighA int64 // u32 超上限总的秒数 TotalTime_2_8 int64 // u32 未超上限和下限的秒数 TotalTime_LowA int64 // u32 超下限总的秒数 TotalTime_LowB int64 // u32 超下下限总的秒数 NoOfViola_HighB int64 // u32 超上上限总的点数 NoOfViola_HighA int64 // u32 超上限总的点数 NoOfViola_LowA int64 // u32 超下限总的点数 NoOfViola_LowB int64 // u32 超下下限总的点数 LongestTime_HighB int64 // u32 超上上限最长一次秒数 LongestTime_HighA int64 // u32 超上限最长一次秒数 LongestTime_LowA int64 // u32 超下限最长一次秒数 LongestTime_LowB int64 // u32 超下下限紧长一次秒数 LogerName string // u8 记录仪名称字符串 TimeBase string // u8 基于格林威治时间的各国时间描述符 ConfigBy string // u8 配置者描述符 Notes string // u8 留言/笔记字符串 NumberOfPoints int64 // u32 数据点数 PDFPassword string // u8 PDF文件的打开密码 ? Temperature_0 int64 // u16/u32 4字节时为温度或者 8字节时为温湿度 Data []*SensorData // 传感器数据点 }
BvFileInfo bv文件头信息
type SensorData ¶
type SensorData struct { At *int64 `json:"at,omitempty"` T *float32 `json:"t,omitempty"` H *float32 `json:"h,omitempty"` }
SensorData 传感器数据点
type SensorDataList ¶
type SensorDataList []*SensorData
SensorDataList 传感器数据点
func (SensorDataList) Len ¶
func (a SensorDataList) Len() int
func (SensorDataList) Less ¶
func (a SensorDataList) Less(i, j int) bool
func (SensorDataList) Swap ¶
func (a SensorDataList) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.