Documentation
¶
Overview ¶
Implements simple, delta and PID based power controller.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProgramAlreadyRunning = errors.New("program already running") ErrNoProgramRunning = errors.New("no program running") )
Functions ¶
This section is empty.
Types ¶
type ControlEngine ¶
type ControlEngine struct {
// contains filtered or unexported fields
}
func NewEngine ¶
func NewEngine(halkoConfig *types.HalkoConfig, storage *storage.FileStorage, endpoints *types.APIEndpoints) *ControlEngine
func (*ControlEngine) CurrentStatus ¶
func (engine *ControlEngine) CurrentStatus() *types.ExecutionStatus
func (*ControlEngine) GetDefaults ¶
func (engine *ControlEngine) GetDefaults() *types.Defaults
func (*ControlEngine) StartEngine ¶
func (engine *ControlEngine) StartEngine(program *types.Program) error
func (*ControlEngine) StopEngine ¶
func (engine *ControlEngine) StopEngine() error
type PidController ¶
type PidController struct {
Config *types.PidSettings
State PidControllerState
}
func NewPidController ¶
func NewPidController(config *types.PidSettings) *PidController
type PidControllerState ¶
type PidControllerState struct {
CurrentError float32
CurrentErrorIntegral float32
CurrentErrorDerivative float32
PreviousUpdate int64
}
PidControllerState holds mutable state for a PidController.
type PowerCommand ¶
type PowerCommand struct {
Percent uint8 `json:"percent"`
}
type PowerController ¶
type PowerController struct {
PidController *PidController
TargetTemperature float32
Settings *types.PowerPidSettings
}
func NewPowerController ¶
func NewPowerController(targetTemperature float32, settings *types.PowerPidSettings) *PowerController
New power controller with the given configuration and settings.
type PowerResponse ¶
type PowerResponse struct {
Percent int `json:"percent"`
}
type PowerStatusResponse ¶
type PowerStatusResponse struct {
Data map[string]PowerResponse `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.