You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
232 lines
8.5 KiB
232 lines
8.5 KiB
import { MarkKindType, MarkType, MarkTagPos } from "../model/data/mark/mark-data"; |
|
import { FacilityPosType, FacilityType } from "../model/data/model-data/model-data-facility"; |
|
|
|
//配置、常量管理器 |
|
export class ConfigManager { |
|
static readonly c_resPath_assetsRoot = 'assets/'; //资源根目录 |
|
|
|
static readonly c_resPath_institutionsRoot = 'institutions/'; //单位 |
|
static readonly c_reaPath_facilityProperty = "facilityProperty";//设备属性资源(一般是图片) |
|
static readonly c_resPath_facilitiesRoot = 'facilities/'; //设备资源 |
|
static readonly c_resPath_facilityIcon = "images/facility/";// 设备icon |
|
|
|
|
|
static readonly c_size_facilityIconSize = 40;//设备icon的大小 |
|
|
|
static readonly c_time_longPress = 500;//长按时间(毫秒) |
|
|
|
|
|
/** |
|
* 获取设备icon的url |
|
* @param type 设备的类型 |
|
* @param pos 设备的位置(室内还是室外) |
|
*/ |
|
static getFacilityIconUrl(type: FacilityType, pos: FacilityPosType): string { |
|
|
|
let result = ConfigManager.c_resPath_assetsRoot + "images/facility/" + type + ".png"; |
|
return result; |
|
} |
|
|
|
/** |
|
* 根据设备类型获取名称 |
|
* @param type 设备类型 |
|
*/ |
|
static getFacilityTypeName(type: FacilityType): string { |
|
let result = "未知"; |
|
switch (type) { |
|
case FacilityType.AQCK: result = "安全出口"; break; |
|
case FacilityType.DSXHS: result = "地上消火栓"; break; |
|
case FacilityType.DXXHS: result = "地下消火栓"; break; |
|
case FacilityType.SZDSXHS: result = "市政地上消火栓"; break; |
|
case FacilityType.SZDXXHS: result = "市政地下消火栓"; break; |
|
case FacilityType.DSSBJHQ: result = "地上水泵接合器"; break; |
|
case FacilityType.DXSBJHQ: result = "地下水泵接合器"; break; |
|
case FacilityType.QBSBJHQ: result = "墙壁式接合器"; break; |
|
case FacilityType.DGNSBJHQ: result = "多功能接合器"; break; |
|
case FacilityType.GD: result = "高度"; break; |
|
case FacilityType.PL: result = "毗邻"; break; |
|
case FacilityType.JTQ: result = "禁停区"; break; |
|
case FacilityType.JJQ: result = "集结区"; break; |
|
case FacilityType.TPBZ: result = "图片标注"; break; |
|
|
|
case FacilityType.XKS: result = "消控室"; break; |
|
case FacilityType.BF: result = "泵房"; break; |
|
case FacilityType.SX: result = "水箱"; break; |
|
case FacilityType.LSXFB: result = "立式消防泵"; break; |
|
case FacilityType.WSXFB: result = "卧式消防泵"; break; |
|
case FacilityType.CYXFB: result = "柴油消防泵"; break; |
|
case FacilityType.FHFQ: result = "防火分区"; break; |
|
case FacilityType.SNXHS: result = "室内消火栓"; break; |
|
case FacilityType.FHM: result = "防火门"; break; |
|
case FacilityType.FHJL: result = "防火卷帘"; break; |
|
case FacilityType.SSLT: result = "疏散楼梯"; break; |
|
case FacilityType.XFDT: result = "消防电梯"; break; |
|
case FacilityType.PTDT: result = "普通电梯"; break; |
|
case FacilityType.WXY: result = "危险源"; break; |
|
case FacilityType.ZDQY: result = "重点区域"; break; |
|
case FacilityType.DWBZ: result = "点位标注"; break; |
|
case FacilityType.HT: result = "货梯"; break; |
|
|
|
case FacilityType.BNC: result = "避难层"; break;//特殊 |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* 查询某设备所处位置类型(室内还是室外) |
|
* @param facilityType |
|
*/ |
|
static getPosType(facilityType: FacilityType): FacilityPosType { |
|
let result = FacilityPosType.Indoor; |
|
|
|
switch (facilityType) { |
|
case FacilityType.AQCK: |
|
case FacilityType.DSXHS: |
|
case FacilityType.DXXHS: |
|
case FacilityType.SZDXXHS: |
|
case FacilityType.SZDSXHS: |
|
case FacilityType.DSSBJHQ: |
|
case FacilityType.DXSBJHQ: |
|
case FacilityType.QBSBJHQ: |
|
case FacilityType.DGNSBJHQ: |
|
case FacilityType.GD: |
|
case FacilityType.PL: |
|
case FacilityType.JTQ: |
|
case FacilityType.JJQ: |
|
case FacilityType.TPBZ: result = FacilityPosType.Outdoor; break; |
|
case FacilityType.DWBZ: |
|
case FacilityType.ZDQY: |
|
case FacilityType.WXY: result = FacilityPosType.Public; break; |
|
} |
|
return result; |
|
} |
|
|
|
|
|
//#region 事态标绘 |
|
|
|
/** |
|
* 事态标绘的名称配置 |
|
*/ |
|
static s_markName = new Map<MarkType, string>([ |
|
[MarkType.SYA, "伤员"], |
|
[MarkType.SYB, "伤员"], |
|
[MarkType.SYC, "伤员"], |
|
[MarkType.SYD, "伤员"], |
|
[MarkType.ZQR, "知情人"], |
|
[MarkType.WXP, "危险品"], |
|
[MarkType.ZWD, "杂物堆"], |
|
[MarkType.PCD, "破拆点"], |
|
[MarkType.H, "火"], |
|
[MarkType.TPH, "突破火"], |
|
[MarkType.SNH, "室内火"], |
|
[MarkType.YWA, "烟雾"], |
|
[MarkType.YWB, "烟雾"], |
|
[MarkType.YWC, "烟雾"], |
|
[MarkType.MHF, "灭火服"], |
|
[MarkType.JYF, "救援服"], |
|
[MarkType.GRF, "隔热服"], |
|
[MarkType.FHF, "防化服"], |
|
[MarkType.BHF, "避火服"], |
|
[MarkType.YWXFY, "义务消防员"], |
|
[MarkType.AQS, "安全哨"], |
|
[MarkType.MTC, "摩托车"], |
|
[MarkType.XLC, "巡逻车"], |
|
[MarkType.SGC, "水罐车"], |
|
[MarkType.PMC, "泡沫车"], |
|
[MarkType.GPC, "高喷车"], |
|
[MarkType.DGPTC, "登高平台车"], |
|
[MarkType.YTC, "云梯车"], |
|
[MarkType.QXJYC, "抢险救援车"], |
|
[MarkType.QCC, "器材车"], |
|
[MarkType.ZMC, "照明车"], |
|
[MarkType.PCC, "破拆车"], |
|
[MarkType.PYC, "排烟车"], |
|
[MarkType.ZHC, "指挥车"], |
|
[MarkType.GCGSC, "高层供水车"], |
|
[MarkType.KQHXCQC, "空气呼吸充气车"], |
|
[MarkType.GA, "公安"], |
|
[MarkType.JJ, "交警"], |
|
[MarkType.YS, "医生"], |
|
[MarkType.QXRY, "抢修人员"], |
|
[MarkType.JHC, "救护车"], |
|
[MarkType.JC, "警车"], |
|
[MarkType.DLQXC, "电力抢修车"], |
|
[MarkType.RQQXC, "燃气抢修车"], |
|
[MarkType.GSQXC, "供水抢修车"], |
|
[MarkType.HBJCC, "环保检测车"], |
|
[MarkType.JTYSC, "交通运输车"], |
|
[MarkType.WSFYC, "卫生防疫车"], |
|
[MarkType.YJTXC, "应急通信车"], |
|
[MarkType.JCA, "轿车"], |
|
[MarkType.JCB, "轿车"], |
|
[MarkType.JCC, "轿车"], |
|
[MarkType.DSZ, "董事长"], |
|
[MarkType.JL, "经理"], |
|
[MarkType.FZ, "副总"], |
|
[MarkType.MS, "秘书"], |
|
[MarkType.ZJ, "总监"], |
|
[MarkType.ZG, "主管"], |
|
[MarkType.ZZ, "组长"], |
|
[MarkType.QT, "前台"], |
|
[MarkType.SJS, "设计师"], |
|
[MarkType.CXY, "程序员"], |
|
[MarkType.ZYA, "职员"], |
|
[MarkType.ZYB, "职员"], |
|
[MarkType.JG, "技工"], |
|
[MarkType.BA, "保安"], |
|
[MarkType.JJX, "警戒线"], |
|
[MarkType.SD, "水带"], |
|
[MarkType.JGLX, "进攻路线"], |
|
[MarkType.CT, "撤退"], |
|
[MarkType.ZHB, "指挥部"], |
|
[MarkType.LT6, "6米拉梯"], |
|
[MarkType.LT15, "15米拉梯"], |
|
[MarkType.FSQ, "分水器"], |
|
[MarkType.STB, "手抬泵"], |
|
[MarkType.SP, "水炮"], |
|
[MarkType.WZ, "文字"], |
|
[MarkType.JJQ, "集结区"], |
|
[MarkType.QYSDA, "区域设定"], |
|
[MarkType.QYSDB, "区域设定"], |
|
]); |
|
|
|
/** |
|
* 获取事态标绘素材的名称 |
|
* @param type |
|
*/ |
|
static getMarkName(type: MarkType) { |
|
if (ConfigManager.s_markName.has(type)) { |
|
return ConfigManager.s_markName.get(type); |
|
} |
|
else { |
|
return "未知"; |
|
} |
|
} |
|
|
|
/** |
|
* 获取事态标绘模型的路径 |
|
* @param type |
|
* @param pos |
|
*/ |
|
static getMarkModelPath(pos: MarkTagPos, type: MarkType): string { |
|
|
|
let result = ConfigManager.c_resPath_assetsRoot + "mark/" + pos.toLocaleLowerCase() + "/" + type.toLocaleLowerCase() + "/"; |
|
return result; |
|
} |
|
|
|
/** |
|
* 获取事态标绘素材的图标 |
|
* @param type |
|
* @param pos |
|
*/ |
|
static getMarkIconUrl(pos: MarkTagPos, type: MarkType): string { |
|
|
|
let result = ConfigManager.c_resPath_assetsRoot + "images/mark/" + pos.toLocaleLowerCase() + "/" + type.toLocaleLowerCase() + ".png"; |
|
return result; |
|
} |
|
|
|
|
|
|
|
//#endregion |
|
|
|
} |