Documentation
¶
Index ¶
- type Inverter
- func (i *Inverter) AddInverterToDB(db *mongo.Database) (primitive.ObjectID, error)
- func (i *Inverter) AlreadyInDB(db *mongo.Database) bool
- func (i *Inverter) DeleteInverterFromDB(db *mongo.Database) error
- func (i *Inverter) FromScrapper(e *colly.HTMLElement) error
- func (i *Inverter) ReadInverter(db *mongo.Database) error
- func (i *Inverter) UpdateInverterInDB(db *mongo.Database) error
- type TelemetryData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Inverter ¶
type Inverter struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` Serial string `bson:"serial" json:"serial"` Power float64 `bson:"power" json:"power"` Voltage float64 `bson:"voltage" json:"voltae"` Frequency float64 `bson:"frequency" json:"frequnc"` Communication bool `bson:"communication" json:"cmmuniation"` Status bool `bson:"status" json:"status"` Switch bool `bson:"switch" json:"switch"` EnergyToday float64 `bson:"energyToday" json:"energyToday"` EnergyThisMonth float64 `bson:"energyThisMonth" json:"energyThisMonth"` EnergyThisYear float64 `bson:"energyThisYear" json:"energyThisYear"` TotalEnergy float64 `bson:"totalEnergy" json:"totalEnergy"` }
Inverter : model of an inverter installed in the PV system
func ListInverters ¶
ListInverters : reads all the current inverters in the DB
func (*Inverter) AddInverterToDB ¶
AddInverterToDB : adds info about a inverter to the DB
func (*Inverter) AlreadyInDB ¶
AlreadyInDB : checks if a given inverter data is already in the DB
func (*Inverter) DeleteInverterFromDB ¶
DeleteInverterFromDB : deletes an inverter from the DB
func (*Inverter) FromScrapper ¶
func (i *Inverter) FromScrapper(e *colly.HTMLElement) error
FromScrapper : fills the inverter with data from the HTML scrapper
func (*Inverter) ReadInverter ¶
ReadInverter : reads data from a specific inverter serial
type TelemetryData ¶
type TelemetryData struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` Serial string `bson:"serial" json:"serial"` Module string `bson:"module" json:"module"` LastTelemetryTime int64 `bson:"lastTelemetryTime" json:"lastTelemetryTime"` OutputVoltage float64 `bson:"outputVoltage" json:"outputVoltage"` InputVoltage float64 `bson:"inputVoltage" json:"inputVoltage"` InputCurrent float64 `bson:"inputCurrent" json:"inputCurrent"` }
TelemetryData : PV system state captured by the data acquisition service
func ListTelemetryData ¶
ListTelemetryData : reads telemetry data from DB using an filter
func (*TelemetryData) AddDataToDB ¶
AddDataToDB : adds a telemetry read to the DB
func (*TelemetryData) AlreadyAcquired ¶
func (t *TelemetryData) AlreadyAcquired(db *mongo.Database) bool
AlreadyAcquired : checks if a given telemetry data is already in the DB
func (*TelemetryData) DeleteDataFromDB ¶
func (t *TelemetryData) DeleteDataFromDB(db *mongo.Database) error
DeleteDataFromDB : deletes a telemetry read from the DB
func (*TelemetryData) FromScrapper ¶
func (t *TelemetryData) FromScrapper(e *colly.HTMLElement) error
FromScrapper : fills the telemetry with data from the HTML scrapper