PRAGMA busy_timeout=6000;
--
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
drop TABLE if exists hrs;
CREATE TABLE hrs(  RegNo,  Description TEXT);
INSERT INTO hrs VALUES('0','On/Off');
INSERT INTO hrs VALUES('1','AC output 0:Bat 1:PV 2:Utl 3:Pv&Utl');
INSERT INTO hrs VALUES('2','Charge 0:Pv 1:PV&Utl 2:Pvonly');
INSERT INTO hrs VALUES('3','Uti Out Start 0-23 hour');
INSERT INTO hrs VALUES('4','UtilOut End 0-23 hour');
INSERT INTO hrs VALUES('5','Uti Charge Start 0-23 hour');
INSERT INTO hrs VALUES('6','Uti Charge End 0-23 hour');
INSERT INTO hrs VALUES('7','PV input 0:Independent');
INSERT INTO hrs VALUES('8','AC Input Mode 1:UPS 95-140');
INSERT INTO hrs VALUES('9','Firmware version Start');
INSERT INTO hrs VALUES('14','Firmware version End');
INSERT INTO hrs VALUES('15','LCD Language');
INSERT INTO hrs VALUES('17','-');
INSERT INTO hrs VALUES('18','Output volt type');
INSERT INTO hrs VALUES('19','Output Freq.type 1:60hZ');
INSERT INTO hrs VALUES('20','Overload Restart 0:Yes');
INSERT INTO hrs VALUES('21','Overtemp Restart 0:Yes');
INSERT INTO hrs VALUES('22','Buzzer 1:No');
INSERT INTO hrs VALUES('23','Serial # Start');
INSERT INTO hrs VALUES('27','Serial # End');
INSERT INTO hrs VALUES('28','Inverter Module Hi');
INSERT INTO hrs VALUES('29','Inverter Module Lo');
INSERT INTO hrs VALUES('30','Comm Address');
INSERT INTO hrs VALUES('31','Flash Start0x0100:Control Board');
INSERT INTO hrs VALUES('32','Reset User Information');
INSERT INTO hrs VALUES('33','Reset to Factory');
INSERT INTO hrs VALUES('34','Max. Charge Current');
INSERT INTO hrs VALUES('35','Bulk Charge Voltage');
INSERT INTO hrs VALUES('36','Float Charge Voltage');
INSERT INTO hrs VALUES('37','BatteryLoSwitchToUti');
INSERT INTO hrs VALUES('38','AC Charge Current');
INSERT INTO hrs VALUES('39','Battery Type 4:USE2');
INSERT INTO hrs VALUES('40','Aging Mode');
INSERT INTO hrs VALUES('45','System time-Year');
INSERT INTO hrs VALUES('46','System-time Month');
INSERT INTO hrs VALUES('47','System-time Day');
INSERT INTO hrs VALUES('48','System-time Hour');
INSERT INTO hrs VALUES('49','System-time Minute');
INSERT INTO hrs VALUES('50','System-time Second');
INSERT INTO hrs VALUES('73','Modbus version*10');
INSERT INTO hrs VALUES('77','Rate Watts');
INSERT INTO hrs VALUES('95','AC switch to Battery');
INSERT INTO hrs VALUES('106','Battery Protocol');
INSERT INTO hrs VALUES('107','Audio Alarm Enable');
INSERT INTO hrs VALUES('108','uwEqEn');
INSERT INTO hrs VALUES('109','uwEqChgVolt');
INSERT INTO hrs VALUES('110','uwEqTime');
INSERT INTO hrs VALUES('111','uwEqTimeOut');
INSERT INTO hrs VALUES('112','uwEqInterval');
INSERT INTO hrs VALUES('113','uwMaxDisChgCurr');
COMMIT;

PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
drop TABLE if exists SystemStatuses;
CREATE TABLE SystemStatuses(
  "SystemStatusId" text,
  "SystemStatus" TEXT
);
INSERT INTO SystemStatuses VALUES('0','Standby');
INSERT INTO SystemStatuses VALUES('1','PV and Grid Combine Discharge');
INSERT INTO SystemStatuses VALUES('2','Discharge');
INSERT INTO SystemStatuses VALUES('3','Fault');
INSERT INTO SystemStatuses VALUES('4','Flash');
INSERT INTO SystemStatuses VALUES('5','PV charge');
INSERT INTO SystemStatuses VALUES('6','AC charge');
INSERT INTO SystemStatuses VALUES('7','Combine charge');
INSERT INTO SystemStatuses VALUES('8','Combine charge and Bypass');
INSERT INTO SystemStatuses VALUES('9','PV charge and Bypass');
INSERT INTO SystemStatuses VALUES('10','AC charge and Bypass');
INSERT INTO SystemStatuses VALUES('11','Bypass');
INSERT INTO SystemStatuses VALUES('12','PV charge and Discharge');
COMMIT;

-- corrected for 120VAC
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
drop TABLE if exists ACInModels;
CREATE TABLE ACInModels(
  "ACInModelId" text,
  "ACInModel" TEXT
);
INSERT INTO ACInModels VALUES('0','APL,65-140VAC');
INSERT INTO ACInModels VALUES('1','UPS,95-140VAC');
INSERT INTO ACInModels VALUES('2','GEN');
COMMIT;

--P01
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
drop TABLE if exists OutputConfigs;
CREATE TABLE OutputConfigs(
  "OutputConfigId" text,
  "OutputConfig" TEXT
);
INSERT INTO OutputConfigs VALUES('1','SOL,PV>Bat>@UTI');
INSERT INTO OutputConfigs VALUES('2','UTI,Uti>PV>Bat');
INSERT INTO OutputConfigs VALUES('0','SBU,PV>Bat>UTI');
COMMIT;

--P14
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
drop TABLE if exists ChargeConfigs;
CREATE TABLE ChargeConfigs(
  "ChargeConfigId" text,
  "ChargeConfig" TEXT
);
INSERT INTO ChargeConfigs VALUES('0','CSO,PV first');
INSERT INTO ChargeConfigs VALUES('1','S&U,PV&UTI');
INSERT INTO ChargeConfigs VALUES('2','OSO,PV Only');
COMMIT;

PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
drop TABLE if exists BatteryTypes;
CREATE TABLE BatteryTypes(
  "BatteryTypeId" TEXT,
  "BatteryType" TEXT
);
INSERT INTO BatteryTypes VALUES('0','AGM');
INSERT INTO BatteryTypes VALUES('1','FLD');
INSERT INTO BatteryTypes VALUES('2','USE');
INSERT INTO BatteryTypes VALUES('3','Lithium');
INSERT INTO BatteryTypes VALUES('4','USE2');
COMMIT;

