func (m *Meter) Decorate(
	totalEnergyG func() (float64, error),
	currentsG []func() (float64, error),
	batterySoCG func() (float64, error),
) api.Meter {
	var totalEnergy func() (float64, error)
	if totalEnergyG != nil {
		m.totalEnergyG = totalEnergyG
		totalEnergy = m.totalEnergy
	}

	var currents func() (float64, float64, float64, error)
	if currentsG != nil {
		m.currentsG = currentsG
		currents = m.currents
	}

	var batterySoC func() (float64, error)
	if batterySoCG != nil {
		m.batterySoCG = batterySoCG
		batterySoC = m.batterySoC
	}

	return decorateMeter(m, totalEnergy, currents, batterySoC)
}
// Decorate attaches additional capabilities to the base meter
Decorate attaches additional capabilities to the base meter
// Decorate attaches additional capabilities to the base meter
func (m *Meter) Decorate(
	totalEnergyG func() (float64, error),
	currentsG []func() (float64, error),
	batterySoCG func() (float64, error),
) api.Meter {
	var totalEnergy func() (float64, error)
	if totalEnergyG != nil {
		m.totalEnergyG = totalEnergyG
		totalEnergy = m.totalEnergy
	}
	var currents func() (float64, float64, float64, error)
	if currentsG != nil {
		m.currentsG = currentsG
		currents = m.currents
	}
	var batterySoC func() (float64, error)
	if batterySoCG != nil {
		m.batterySoCG = batterySoCG
		batterySoC = m.batterySoC
	}
	return decorateMeter(m, totalEnergy, currents, batterySoC)
}
func ( m * Meter ) Decorate ( totalEnergyG func ( ) ( float64 , error ) , currentsG [ ] func ( ) ( float64 , error ) , batterySoCG func ( ) ( float64 , error ) , ) api . Meter { var totalEnergy func ( ) ( float64 , error ) if totalEnergyG != nil { m . totalEnergyG = totalEnergyG totalEnergy = m . totalEnergy } var currents func ( ) ( float64 , float64 , float64 , error ) if currentsG != nil { m . currentsG = currentsG currents = m . currents } var batterySoC func ( ) ( float64 , error ) if batterySoCG != nil { m . batterySoCG = batterySoCG batterySoC = m . batterySoC } return decorateMeter ( m , totalEnergy , currents , batterySoC ) }
Decorate attaches additional capabilities to the base meter
Decorate attaches additional capabilities to the base meter