Documentation ¶
Index ¶
- func DatabaseGenerator(src uint8, path string) error
- type Data
- type Handler
- func (handler *Handler) Init(id uint8) error
- func (handler *Handler) QueryFirstSynt(id uint16) uint32
- func (handler *Handler) QueryInfo(id uint16, column string) (int, error)
- func (handler *Handler) QueryLastSynt(id uint16) uint32
- func (handler *Handler) ReadRange(id uint16, start uint32, end uint32) ([]uint32, []uint64, [][]float64, error)
- func (handler *Handler) ReadSynt(id uint16, synt uint32) (uint64, []float64, error)
- func (handler *Handler) WriteRange(id uint16, dataVec []*Data) error
- func (handler *Handler) WriteSynt(id uint16, data *Data) error
- func (handler *Handler) WriteToBuffer(id uint16, data *Data) error
- type TableInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseGenerator ¶
Types ¶
type Handler ¶
type Handler struct { utils.JsonStandard DBName string DBPointer *sql.DB Tables []string InteTable uint8 RelaTable uint8 InfoTable uint8 RecordTables []uint16 DataShapes map[uint16]uint8 DataBuffer map[uint16]chan *Data }
Handler is the main struct for the handler
func (*Handler) QueryFirstSynt ¶
QueryFirstSynt query the first time of the data Args:
id: the id of the data
Return:
time: the first time of the data
func (*Handler) QueryInfo ¶
QueryInfo query the information of the data Args:
id: the id of the data column: the column name of the data
Return:
para: the value of the column err: the error of the query
func (*Handler) QueryLastSynt ¶
QueryLastSynt query the last time of the data Args:
id: the id of the data
Return:
time: the last time of the data
func (*Handler) ReadRange ¶
func (handler *Handler) ReadRange(id uint16, start uint32, end uint32) ([]uint32, []uint64, [][]float64, error)
Read multiple rows of data from database
Args:
- id: data id
- start: start simulation timestamp
- end: end simulation timestamp
Return:
- simulation time 1D vector
- physical time 1D vector
- data matrix (2D)
- err: error
type TableInfo ¶
type TableInfo struct { utils.JsonStandard Id uint16 `json:"data_id"` Name string `json:"data_name"` Type uint16 `json:"data_type"` Subtype1 uint16 `json:"data_subtype1"` Subtype2 uint16 `json:"data_subtype2"` Rate uint16 `json:"data_rate"` Size uint16 `json:"data_size"` Unit string `json:"data_unit"` Notes string `json:"data_notes"` }
TableInfo struct defines the structure of the data information table
func ReadDataInfo ¶
ReadDataInfo function reads the data information from the specified file path Args:
path: the path of the data information file
Returns:
dataList: the list of data information
Click to show internal directories.
Click to hide internal directories.