Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var StorageHeaders = map[SimStorageType][]string{ MOTION: { "time", "altitude", "velocity", "acceleration", "thrust", }, EVENTS: { "time", "motor_status", "parachute_status", }, DYNAMICS: { "time", "position_x", "position_y", "position_z", "velocity_x", "velocity_y", "velocity_z", "acceleration_x", "acceleration_y", "acceleration_z", "orientation_x", "orientation_y", "orientation_z", "orientation_w", }, }
StorageHeaders is a map of columns for storage types
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
Name string `json:"name"`
Hash string `json:"hash"`
LastModified time.Time `json:"lastModified"` // Keep for potential compatibility, but prioritize CreationTime
CreationTime time.Time `json:"creationTime"` // More reliable timestamp
Path string
Motion *Storage
Events *Storage
Dynamics *Storage
}
type RecordManager ¶
type RecordManager struct {
// contains filtered or unexported fields
}
RecordManager manages simulation records
func NewRecordManager ¶
func NewRecordManager(baseDir string) (*RecordManager, error)
func (*RecordManager) CreateRecord ¶
func (rm *RecordManager) CreateRecord() (*Record, error)
CreateRecord creates a new record with a unique hash
func (*RecordManager) DeleteRecord ¶
func (rm *RecordManager) DeleteRecord(hash string) error
DeleteRecord deletes a record by Hash
func (*RecordManager) GetRecord ¶
func (rm *RecordManager) GetRecord(hash string) (*Record, error)
GetRecord retrieves an existing record by hash without creating a new one.
func (*RecordManager) ListRecords ¶
func (rm *RecordManager) ListRecords() ([]*Record, error)
ListRecords lists all existing valid records in the base directory.
type SimStorageType ¶ added in v0.3.5
type SimStorageType string
SimStorageType is the type of storage service (MOTION, EVENTS, etc.)
const ( // MOTION storage SimStorageType MOTION SimStorageType = "MOTION" // EVENTS storage SimStorageType EVENTS SimStorageType = "EVENTS" // DYNAMICS storage SimStorageType DYNAMICS SimStorageType = "DYNAMICS" )
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is a service that writes csv's to disk
func NewStorage ¶
func NewStorage(recordDir string, store SimStorageType) (*Storage, error)
NewStorage creates a new storage service for a specific store type within a given record directory.
func (*Storage) GetFilePath ¶
GetFilePath returns the file path of the storage service.
func (*Storage) ReadHeadersAndData ¶
ReadHeadersAndData reads the headers and data separately from the storage file