Documentation ¶
Index ¶
- Variables
- type Clock
- type Config
- type GPIOConfig
- type GPIOPhaseStatus
- type Heater
- type HeaterPhaseConfig
- type HeaterPhaseStatus
- type MoveToNextConfig
- type MoveToNextStatus
- type MoveToNextStatusTemperature
- type MoveToNextType
- type Option
- type Output
- type PhaseConfig
- type Process
- func (p *Process) Finish() (Status, error)
- func (c Process) GetConfig() Config
- func (p *Process) MoveToNext() (Status, error)
- func (p *Process) Process() (Status, error)
- func (p *Process) Run() (Status, error)
- func (p *Process) Running() bool
- func (c Process) SetGPIOGlobalConfig(conf []GPIOConfig) error
- func (p *Process) SetPhaseConfig(nb uint, conf PhaseConfig) error
- func (c Process) SetPhaseNumber(number uint)
- func (c Process) UpdateHeaters(heaters []Heater)
- func (c Process) UpdateOutputs(outputs []Output)
- func (c Process) UpdateSensors(sensors []Sensor)
- func (c Process) Validate() error
- type Sensor
- type Status
- type TemperaturePhaseStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoHeaters = errors.New("can't execute process without heaters") ErrNoTSensors = errors.New("can't execute process without temperature sensors") ErrNoSuchPhase = errors.New("requested phase number doesn't exist") ErrWrongHeaterID = errors.New("requested heater ID doesn't exist") ErrWrongSensorID = errors.New("requested sensor ID doesn't exist") ErrWrongGpioID = errors.New("requested gpio ID doesn't exist") ErrWrongHeaterPower = errors.New("power must be in range <0, 100>") ErrDifferentGPIOSConfig = errors.New("different number of gpio configs and gpios") ErrHeaterConfigDiffersFromHeatersLen = errors.New("different number of heaters configs and heaters") ErrByTimeWrongTime = errors.New("timeleft must be greater than 0") ErrByTemperatureWrongID = errors.New("chosen ByTemperature, but id doesn't exist") ErrUnknownType = errors.New("MoveToNextType unknown") ErrNotRunning = errors.New("not running") ErrTooManyErrorOnTemperature = errors.New("too many consecutive errors on Temperature") ErrSetPower = errors.New("on heater SetPower") ErrSetValue = errors.New("on output Set") ErrDuplicatedID = errors.New("duplicated ID in config") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { PhaseNumber uint `json:"phase_number"` Phases []PhaseConfig `json:"phases"` GlobalGPIO []GPIOConfig `json:"global_gpio"` Sensors []string `json:"sensors"` }
type GPIOConfig ¶
type GPIOPhaseStatus ¶
type HeaterPhaseConfig ¶
type HeaterPhaseStatus ¶
type HeaterPhaseStatus struct {
HeaterPhaseConfig
}
type MoveToNextConfig ¶
type MoveToNextConfig struct { Type MoveToNextType `json:"type"` Sensors []string `json:"sensors"` SensorID string `json:"sensor_id"` SensorThreshold float64 `json:"sensor_threshold"` TimeLeft int64 `json:"time_left"` }
type MoveToNextStatus ¶
type MoveToNextStatus struct { Type MoveToNextType `json:"type"` TimeLeft int64 `json:"time_left"` Temperature MoveToNextStatusTemperature `json:"temperature,omitempty"` }
type PhaseConfig ¶
type PhaseConfig struct { Next MoveToNextConfig `json:"next"` Heaters []HeaterPhaseConfig `json:"heaters"` GPIO []GPIOConfig `json:"gpio"` }
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
func (*Process) MoveToNext ¶
func (Process) SetGPIOGlobalConfig ¶
func (c Process) SetGPIOGlobalConfig(conf []GPIOConfig) error
func (*Process) SetPhaseConfig ¶
func (p *Process) SetPhaseConfig(nb uint, conf PhaseConfig) error
func (Process) SetPhaseNumber ¶
func (c Process) SetPhaseNumber(number uint)
func (Process) UpdateHeaters ¶
func (c Process) UpdateHeaters(heaters []Heater)
func (Process) UpdateOutputs ¶
func (c Process) UpdateOutputs(outputs []Output)
func (Process) UpdateSensors ¶
func (c Process) UpdateSensors(sensors []Sensor)
type Status ¶
type Status struct { Running bool `json:"running"` Done bool `json:"done"` PhaseNumber uint `json:"phase_number"` StartTime time.Time `json:"start_time"` EndTime time.Time `json:"end_time"` Next MoveToNextStatus `json:"next"` Heaters []HeaterPhaseStatus `json:"heaters"` Temperature []TemperaturePhaseStatus `json:"temperature"` GPIO []GPIOPhaseStatus `json:"gpio"` Errors []string `json:"errors"` }
type TemperaturePhaseStatus ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.