中化加油站项目
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.
 
 
 
 
 
 

246 lines
8.0 KiB

import { MarkKindType, MarkType, MarkTagPos } from "../model/data/mark/mark-data";
import { FacilityPosType, FacilityType } from "../model/data/model-data/model-data-facility";
import { TsTool } from "../tool/ts-tool";
//配置、常量管理器
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;//长按时间(毫秒)
/**
* 获取设备资源完整路径(从assets子目录开始)
* @param facilityPosType
* @param type
*/
static getResPath_facility(facilityPosType: FacilityPosType, type: FacilityType): string {
let result = "mesh/facilities/";
// result += facilityPosType.toString() + "/";
result += (type).toLocaleLowerCase();
result += "/";
return result;
}
/**
* 查询设备是否需要展示图标
* @param type
*/
static getFacilityNeedIcon(type: FacilityType) {
let result = false;
switch (type) {
case FacilityType.PL:
case FacilityType.QY:
case FacilityType.TPBZ:
case FacilityType.DWBZ:
case FacilityType.JY_JYJ://临时
case FacilityType.JY_YG://临时
result = true;
break;
}
if (TsTool.stringContain(type, "XF_")) {
result = true;
}
return result;
}
/**
* 获取设备icon的url
* @param type 设备的类型
* @param pos 设备的位置(室内还是室外)
*/
static getFacilityIconUrl(type: FacilityType, pos: FacilityPosType): string {
let result = ConfigManager.c_resPath_assetsRoot + "images/facility/" + pos + '/' + type + ".png";
return result;
}
/**
* 根据设备类型获取名称
* @param type 设备类型
*/
static getFacilityTypeName(type: FacilityType): string {
let result = "未知";
switch (type) {
//自定义放置
case FacilityType.PL: result = "毗邻"; break;
case FacilityType.QY: result = "区域"; break;
case FacilityType.TPBZ: result = "图片标注"; break;
case FacilityType.DWBZ: result = "点位标注"; break;
//内建
case FacilityType.XF_MHQ_PT_4: result = "4kg普通灭火器"; break;
case FacilityType.XF_MHQ_PT_8: result = "8kg普通灭火器"; break;
case FacilityType.XF_MHQ_PT_35: result = "35kg普通灭火器"; break;
case FacilityType.XF_MHQ_GF_4: result = "4kg干粉灭火器"; break;
case FacilityType.XF_MHQ_GF_8: result = "8kg干粉灭火器"; break;
case FacilityType.XF_MHQ_GF_35: result = "35kg干粉灭火器"; break;
case FacilityType.XF_MHT: result = "灭火毯"; break;
case FacilityType.XF_XFQ: result = "消防锹"; break;
case FacilityType.XF_XFT: result = "消防桶"; break;
case FacilityType.XF_XFCM: result = "消防长矛"; break;
case FacilityType.XF_XFF: result = "消防斧"; break;
case FacilityType.XF_XFS: result = "消防沙"; break;
}
return result;
}
/**
* 查询某设备所处位置类型(室内还是室外)
* @param facilityType
*/
static getPosType(facilityType: FacilityType): FacilityPosType {
let result = FacilityPosType.In;
switch (facilityType) {
case FacilityType.PL:
case FacilityType.QY:
case FacilityType.TPBZ:
case FacilityType.DWBZ: result = FacilityPosType.Out; 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
}