
#idString HKJ,VirtualBatteryGenerator,
#name VirtualBatteryGenerator
#handle VBG
#port none

#helpurl http://lygte-info.dk/project/TestControllerVirtualDevices%20UK.html#Virtual_battery_generator_(VBG)

;#outputOff 

; Strings to configure device in different modes
; First parameter must match a #value (4 parameter) and second parameter must match what #askMode returns
; First parameter is also used in shortcut menu
#cmdMode Capacity Capacity
outputFormat Capacity

#cmdMode Used_capacity UsedCap
outputFormat UsedCap


#askMode outputFormat?


; Setup menu functions
; The parameters on the first line is: type name page 
; Settings on the following lines are:
; read: SCPI to read value from device, is used to synchronize when opening setup page or setting equal named fields. Not always used
; askValuesReadFormat: Parse read value.
; write: Send the value to device, this field is used in combination with data fields in the details to send updates to device.
; tip: Add this tip to all components for this input field.

#interfaceType VBG

#cmdSetup number Batteri_Capacity
:read: BATTERYCAPACITY?
:write: BATTERYCAPACITY
:update: Capacity State_of_Charge
:tip: Rated battery capacity, the model data will be scaled to this value.
Ah 0 1000

#cmdSetup buttons Capacity
:write: ADDPCT
:update: State_of_Charge
:tip: A fast way to adjust the current capacity in the battery
-20% -0.2
-5% -0.05
+5%  0.05
+20%  0.2

#cmdSetup number Capacity
:read: CAPACITY?
:write: CAPACITY
:update: State_of_Charge
:tip: Current capacity in the battery, this is used to find battery voltage.
Ah 0 1000

#cmdSetup number State_of_Charge
:read: SOC?
:write: SOC
:update: Capacity
:tip: This is actual capacity divided by battery capacity
- 0 1

#cmdSetup number Current
:read: CURRENT?
:write: CURRENT
:tip: Current discharge or charge current. Use negative current for discharge.
A -1000 1000

#cmdSetup number Internal_Resistance
:read: RI?
:write: RI
:tip: This is used to increase the internal DC resistance, as standard the output will follow the recorded curves (Simulate battery getting older).
ohm 0 100

#cmdSetup numberInt Series
:read: SERIES?
:write: SERIES
:tip: Number of batteries in series
Count 1 100


#cmdSetup button Update
:update: Capacity State_of_Charge Current



#cmdSetup comboboxHot Model
:read: model?
:readmath: unQuote(value)
:write: model
:update: Capacity State_of_Charge Current Internal_Resistance Batteri_Capacity Voltages
LG_21700_M50 LG_21700_M50_5000mAh_(Grey)
Molicel_INR21700-P42A Molicel_INR21700-P42A_4200mAh_(Gray)
Samsung_INR18650-36G Samsung_INR18650-36G_3350mAh_(Purple)
LG_18650-H26 LG_18650_H26_2600mAh_(Gray)
Duracell_AA Duracell_Plus_Power_AA
Duracell_AAA Duracell_Plus_Power_AAA
Kodak_Super_Heavy_Duty_AA Kodak_Super_Heavy_Duty_AA
Kodak_Super_Heavy_Duty_AAA Kodak_Super_Heavy_Duty_AAA
Energizer_Lithium_AA Energizer_Ultimate_Lithium_AA_2019
Energizer_Lithium_AAA Energizer_Ultimate_Lithium_AAA_2019
Eneloop_AA_1900mAh Eneloop_AA_BK-3MCCE_1900mAh_(White)_2019
Eneloop_AAA_750mAh Eneloop_AAA_BK-4MCCE_750mAh_(White)_2019
Fujitsu_9V_Alkaline Fujitsu_9V_Alkaline_(Gold)
Panasonic_CR123 Panasonic_Lithium_Power_CR123
Maxell_CR2032 Maxell_CR2032
Renata_LR44 Renata_LR44

#cmdSetup info Voltages
:read: OPENVOLTAGE?
V
Initial:

#cmdSetup info Voltages
:read: endVoltage?
V
End:


#cmdSetup info Model
:read: MODELCAPACITY? 0
Ah
Capacity:


#cmdSetup info Model
:read: TESTCURRENTS?
:layout:
A
Currents:

