[dbCfg]
01 = tbSM
02 = tbSMDef
03 = tbSMDefVal
04 = tbSubSys
05 = tbSubSysDetail
06 = tbSMKind
07 = tbSMType
08 = tbLog
09 = tbSerType
10 = tbAlm
11 = tbAlmTime
12 = tbUser
13 = tbVar
14 = tbSysCfg


[dbDat0]
01 = tbSubSysDetail
02 = tbSMAlarm
03 = tbSMBrief


[dbDat]
01 = tbSMAlarm
02 = tbElec
03 = tbDio
04 = tbLog


[tbSM]
dbCfg = 1
00 = create table tbSM(SID INTEGER PRIMARY KEY,Kind INTEGER,Type INTEGER,Name VARCHAR(32),Note VARCHAR(32),State INTEGER,Tag1 INTEGGER,Tag2 INTEGER,DataMode INTEGER,SerDll VARCHAR(16),SerKind INTEGER,SerType INTEGER,SerDef VARCAHR(32),SerAddr INTEGER,SerTimeout INTEGER,SerWait INTEGER,AID INTEGER,ASubSys INTEGER,ID1 INTEGER,ID2 INTEGER,Ext1 INTEGER,Ext2 INTEGER)



[tbSMDef]
dbCfg = 1
00 = create table tbSMDef(Type INTEGER,SID INTEGER,Fld INTEGER,FldName VARCHAR(16),FldDept INTEGER,Note VARCHAR(32),vkind INTEGER,vfactor INTEGER,vmode INTEGER,vref INTEGER,vtip VARCHAR(64),vref2 INTEGER,vtip2 VARCHAR(64),ASubSys INTEGER,ANote VARCHAR(32))


[tbSMDefVal]
dbCfg = 1
00 = create table tbSMDefVal(Type INTEGER,SID INTEGER,Fld INTEGER,vmode INTEGER,vref INTEGER,vref2 INTEGER,ASubSys INTEGER,ANote VARCHAR(32))


[tbSubSys]
dbCfg = 13
00 = create table tbSubSys(SubSys INTEGER PRIMARY KEY,Name VARCHAR(32),Note VARCHAR(64),DefKind INTEGER,State INTEGER,Count INTEGER,LastUpd DATETIME)
01 = insert into tbSubSys values(0,'无','系统整体状态查询用',0,null,null,null)
02 = insert into tbSubSys values(1,'市电监测','市电监测子系统',256,null,null,null)
03 = insert into tbSubSys values(2,'配电监测','配电监测子系统',0,null,null,null)
04 = insert into tbSubSys values(3,'UPS监测','各小型大型UPS',768,null,null,null)
05 = insert into tbSubSys values(4,'电池监测','电池巡检,支持24 48 128节等',1024,null,null,null)
06 = insert into tbSubSys values(5,'温度湿度','环境温度湿度监测',1280,null,null,null)
07 = insert into tbSubSys values(6,'漏水监测','环境漏水监测',1536,null,null,null)
08 = insert into tbSubSys values(7,'空调监测','民用空调监测控制来电启动等',1792,null,null,null)
09 = insert into tbSubSys values(8,'精密空调','机房精密空调监控，支持艾默生、APC、世图兹等',2048,null,null,null)
10 = insert into tbSubSys values(9,'烟雾监测','消防烟感',0,null,null,null)
11 = insert into tbSubSys values(10,'红外监测','红外入侵监测',0,null,null,null)
12 = insert into tbSubSys values(11,'门禁门磁','门磁门禁监测控制',0,null,null,null)


[tbSubSysDetail]
dbCfg = 1
00 = create table tbSubSysDetail(SubSys INTEGER,SID INTEGER,Type INTEGER,FldDept INTEGER,Fld INTEGER,State INTEGER,LastUpd DATETIME)
dbDat0 = 1


[tbSMKind]
dbCfg = 15
00 = create table tbSMKind(Kind INTEGER,Name VARCHAR(32),Note VARCHAR(64))
01 = insert into tbSMKind values(256,'市电检测','220V380V市电检测')
02 = insert into tbSMKind values(512,'配电检测','各配电检测模块')
03 = insert into tbSMKind values(768,'UPS检测','各UPS')
04 = insert into tbSMKind values(1024,'电池检测','电池巡检（单体电压,温度,内阻鼓包等')
05 = insert into tbSMKind values(1280,'温度湿度','环境温度湿度')
06 = insert into tbSMKind values(1536,'漏水检测','漏水检测(定点,定位,范围等)')
07 = insert into tbSMKind values(1792,'空调监测','普通空调')
08 = insert into tbSMKind values(2048,'精密空调','精密空调,如STULZ APC 艾默生')
09 = insert into tbSMKind values(2304,'开关量','开关量输入输出管理')
10 = insert into tbSMKind values(2560,'报警器','报警服务器,短信猫,短信平台等')
11 = insert into tbSMKind values(2816,'监视器','串口屏,大监控屏等')
12 = insert into tbSMKind values(3072,'视频相机','串口相机,IP摄像机等')
13 = insert into tbSMKind values(3328,'门禁IC卡','门禁监控,IC卡相关')
14 = insert into tbSMKind values(3584,'类别E','其他零星')


[tbSMType]
dbCfg = 39
00 = create table tbSMType(Type INTEGER,Kind INTEGER,Name VARCHAR(32),Note VARCHAR(64))
01 = insert into tbSMType values(256,256,'OM-ACM100','三相电量采集模块0默认 1ACR 2旧款')
02 = insert into tbSMType values(512,512,'配电OM-PD220-6','6路配电开关监测')
03 = insert into tbSMType values(768,768,'UPS OM-U-SANK','UPS山特兼容KR APC...')
04 = insert into tbSMType values(771,768,'UPS OM-U-SMART','APC SMART系列')
05 = insert into tbSMType values(772,768,'UPS-SANTEK3','三进')
06 = insert into tbSMType values(1024,1024,'OM-DB100','24路蓄电池巡检，单体电压')
07 = insert into tbSMType values(1025,1024,'OM-BTA1000','48路蓄电池监测，单体电压')
08 = insert into tbSMType values(1026,1024,'OM-BTB100','n路蓄电池监测，单体电压内阻温度')
09 = insert into tbSMType values(1026,1024,'OM-BTR100','n路蓄电池监测，单体电压内阻温度')
10 = insert into tbSMType values(1027,1024,'OM-BATTDB100','n路蓄电池监测，单体电压内阻温度')
11 = insert into tbSMType values(1280,1280,'温湿度','检测环境温湿度0默认 1K 2W')
12 = insert into tbSMType values(1536,1536,'OM-LDA300/500L','漏水监测非定位或定位 同一协议')
13 = insert into tbSMType values(1792,1792,'OM-A100','民用空调监测控制485')
14 = insert into tbSMType values(1793,1792,'OM-AIRC_DAS','DAS新民用空调监测控制485')
15 = insert into tbSMType values(2048,2048,'OM-CYB100','精密空调CyberMate')
16 = insert into tbSMType values(2049,2048,'OM-CYB100EM','精密空调 EMERSON')
17 = insert into tbSMType values(2050,2048,'OM-CYB100ST','精密空调 STULZ')
18 = insert into tbSMType values(2051,2048,'OM-CYB100APC','精密空调APC')
19 = insert into tbSMType values(2052,2048,'OM-CYB50PLC','精密空调PLC')
20 = insert into tbSMType values(2304,2304,'OM-DI-08E','A6开关量输入,内置')
21 = insert into tbSMType values(2312,2304,'OM-DIO-A8','A8开关量输入输出,内置')
22 = insert into tbSMType values(2305,2304,'OM-DI-HC201','16路220v配电开关输入')
23 = insert into tbSMType values(2306,2304,'OM-DI-FD220+O','220v继电开关输出,放电')
24 = insert into tbSMType values(2307,2304,'OM-DI-PD2206','6路220v配电开关输入')
25 = insert into tbSMType values(2560,2560,'OM-3000','报警服务器OM-3000,电话,短信,彩信,警号等')
26 = insert into tbSMType values(2561,2560,'OM-PTM 101','发送短信,彩信,GRPS数据等')
27 = insert into tbSMType values(2816,2816,'OM-SMON-7','7寸串口屏，可带触摸')
28 = insert into tbSMType values(3072,3072,'OM-CAM100','串口相机OM-CAM100')
29 = insert into tbSMType values(3073,3072,'OM_CAM3GE','串口相机OM-CAM3GE')
30 = insert into tbSMType values(3074,3072,'OM_CAMIP100HK','IP摄像机OM-CAMIP100HK')
31 = insert into tbSMType values(3075,3072,'OM_CAMIP130A','IP摄像机OM-CAMIP130A')
32 = insert into tbSMType values(3076,3072,'OM_CAMIP120JY','IP摄像机OM-CAMIP120JY 景阳')
33 = insert into tbSMType values(3077,3072,'OM_CAMIP100D','IP摄像机OM-CAMIP100D 大架构')
34 = insert into tbSMType values(3078,3072,'OM_CAMIP78HK','IP摄像机OM-CAMIP78HK 球机')
35 = insert into tbSMType values(3079,3072,'OM_CAMIP2cHK','IP摄像机OM-CAMIP2cHK')
36 = insert into tbSMType values(3328,3328,'OM-ICA100','门禁系统ICA100')
37 = insert into tbSMType values(3329,3328,'OM-ICK100','门禁系统ICK100')
38 = insert into tbSMType values(2308,2304,'OM-DIO-W70XX','70xx智能IO模块')


[tbLog]
dbCfg = 1
dbDat = 1
00 = create table tbLog(LID INTEGER PRIMARY KEY,LogDate DATETIME,LogType INTEGER,LogFrom VARCHAR(32),Log VARCHAR(1028),RsvA INTEGER)


[tbSerType]
dbCfg = 5
00 = create table tbSerType(SerType INTEGER,Name VARCHAR(16),Note VARCHAR(32))
01 = insert into tbSerType values(1048576,'COMx','串口')
02 = insert into tbSerType values(2097152,'NET','网口 TCP/IP')
03 = insert into tbSerType values(4194304,'USB','USB口')
04 = insert into tbSerType values(8388608,'OMI','内置IO')


[tbAlm]
dbCfg = 3
00 = create table tbAlm(AID INTEGER PRIMARY KEY,Type INTEGER,SID INTEGER,Note VARCHAR(32),State INTEGER,TimeOn INTEGER,TimeOn2 INTEGER,TimeRedo INTEGER,AlmStyle INTEGER,AlmMask INTEGER,AlmOffMask INTEGER,AlmTid INTEGER,AlmCam INTEGER,AlmCam2 INTEGER,AlmSms VARCHAR(220),AlmTel VARCHAR(220),AlmOff VARCHAR(220),AlmRecv INTEGER,AlmRecv2 INTEGER)
01 = insert into tbAlm values(0,0,0,'无',0,45,0,1800,0,0,0,0,0,0,'','','',1,0)
02 = insert into tbAlm values(1,0,0,'通用 全时段',0,45,0,1800,0,1,1,0,0,0,'短信报警内容','电话报警内容','报警解除',1,0)


[tbAlmTime]
dbCfg = 5
00 = create table tbAlmTime(TID INTEGER PRIMARY KEY,Note VARCHAR(32),Start0 INTEGER,End0 INTEGER,Start1 INTEGER,End1 INTEGER,Start2 INTEGER,End2 INTEGER,Start3 INTEGER,End3 INTEGER,Start4 INTEGER,End4 INTEGER,Start5 INTEGER,End5 INTEGER,Start6 INTEGER,End6 INTEGER)
01 = insert into tbAlmTime values(0,'全时段报警',0,1440,0,1440,0,1440,0,1440,0,1440,0,1440,0,1440)
02 = insert into tbAlmTime values(1,'工作时段报警',480,1080,480,1080,480,1080,480,1080,480,1080,0,0,0,0)
03 = insert into tbAlmTime values(2,'周六周日报警',0,0,0,0,0,0,0,0,0,0,0,1440,0,1440)
04 = insert into tbAlmTime values(3,'自定义时段',0,0,0,0,0,0,0,0,0,0,0,0,0,0)


[tbUser]
dbCfg = 2
00 = create table tbUser(UID INTEGER PRIMARY KEY,Code VARCHAR(10),Name VARCHAR(32),State INTEGER,Kind INTEGER,Recv INTEGER,Recv2 INTEGER,Note VARCHAR(64),PwdChk INTEGER,LogDate DATETIME,LogAddr VARCHAR(32),SmsNum VARCHAR(16),TelNum VARCHAR(16),Email VARCHAR(32),Token VARCHAR(60),Expire DATETIME,OldToken VARCHAR(60))
01 = insert into tbUser(UID,Code,Name,State,Kind,Recv,Recv2,Note) values(1,'Admin','管理员',0,1,16,0,'系统管理员')


[tbVar]
dbCfg = 2
00 = create table tbVar(VID INTEGER PRIMARY KEY,Name VARCHAR(32),Kind INTEGER,Val VARCHAR(220),Note VARCHAR(64))
01 = insert into tbVar values(1,'omAppSU v1.0',1,'迈世信息技术有限公司','')


[tbSysCfg]
dbCfg = 2
00 = create table tbSysCfg(CfgID INTEGER PRIMARY KEY,LastUpd DATETIME,Unit VARCHAR(32),Addr VARCHAR(64),Num VARCHAR(16),Tel VARCAHR(16),Fax VARCHAR(16),Note VARCHAR(128),SmtpSvr VARCHAR(32),SmtpAcc VARCHAR(32),SmtpPwd VARCHAR(16),SmtpPort INTEGER,SmtpSubject VARCHAR(64),TelTry INTEGER,TelTimeout INTEGER)
01 = insert into tbSysCfg(CfgID,LastUpd) values(0,datetime(CURRENT_TIMESTAMP,'localtime'))


[tbSMAlarm]
dbDat0 = 1
dbDat = 1
00 = create table tbSMAlarm(DID INTEGER PRIMARY KEY,SID INTEGER,Type INTEGER,AID INTEGER,ASubSys INTEGER,AFld INTEGER,LastUpd DATETIME,Alm INTEGER,AlmMask INTEGER,AlmRecv INTEGER,AlmImg VARCHAR(64))


[tbSMBrief]
dbDat0 = 1
00 = create table tbSMBrief(SID INTEGER PRIMARY KEY,LastUpd DATETIME,St INTEGER,Brief VARCHAR(256))


[tbDio]
dbDat = 1
00 = create table tbDio(DID INTEGER PRIMARY KEY,SID INTEGER,Type INTEGER,Port INTEGER,Addr INTEGER,DateUpd DATETIME,State INTEGER,SnapID INTEGER,Dio INTEGER,D01 INTEGER,D02 INTEGER,D03 INTEGER,D04 INTEGER,D05 INTEGER,D06 INTEGER,D07 INTEGER,D08 INTEGER,D09 INTEGER,D10 INTEGER,D11 INTEGER,D12 INTEGER,D13 INTEGER,D14 INTEGER,D15 INTEGER,D16 INTEGER,D17 INTEGER,D18 INTEGER,D19 INTEGER,D20 INTEGER,D21 INTEGER,D22 INTEGER,D23 INTEGER,D24 INTEGER,D25 INTEGER,D26 INTEGER,D27 INTEGER,D28 INTEGER,D29 INTEGER,D30 INTEGER,D31 INTEGER,D32 INTEGER)


[tbElec]
dbDat = 1
00 = create table tbElec(DID INTEGER PRIMARY KEY,SID INTEGER,Type INTEGER,Port INTEGER,Addr INTEGER,DateUpd DATETIME,State INTEGER,SnapID INTEGER,Ygzdn INTEGER,Zyggl INTEGER,Ayggl INTEGER,Byggl INTEGER,Cyggl INTEGER,Zwggl INTEGER,Awggl INTEGER,Bwggl INTEGER,Cwggl INTEGER,Zszgl INTEGER,Aszgl INTEGER,Bszgl INTEGER,Cszgl INTEGER,Zglys INTEGER,Aglys INTEGER,Bglys INTEGER,Cglys INTEGER,Pl INTEGER,Ady INTEGER,Bdy INTEGER,Cdy INTEGER,Adl INTEGER,Bdl INTEGER,Cdl INTEGER,iYgzdn INTEGER,iZyggl INTEGER,iAyggl INTEGER,iByggl INTEGER,iCyggl INTEGER,iZwggl INTEGER,iAwggl INTEGER,iBwggl INTEGER,iCwggl INTEGER,iZszgl INTEGER,iAszgl INTEGER,iBszgl INTEGER,iCszgl INTEGER,iZglys INTEGER,iAglys INTEGER,iBglys INTEGER,iCglys INTEGER,iPl INTEGER,iAdy INTEGER,iBdy INTEGER,iCdy INTEGER,iAdl INTEGER,iBdl INTEGER,iCdl INTEGER)
