| | |
| | | /// <param name="dic">Dictionary类</param> |
| | | /// <param name="key">健</param> |
| | | /// <param name="value">值</param> |
| | | public void dictionary(Dictionary<string, string> dic, string key, string value) |
| | | public void dictionary(Dictionary<string, string> dic, string key, string value) |
| | | { |
| | | if (dic.ContainsKey(key)) //判断是否存在键值 |
| | | { |
| | |
| | | { |
| | | var list = new List<HDL_ON.Entity.Function>(); |
| | | var list1 = Entity.FunctionList.List.GetDeviceFunctionList(); |
| | | var list2 = this.GetVideoDeviceList(); |
| | | list.AddRange(list1); |
| | | list.AddRange(list2); |
| | | #if DEBUG |
| | | GetTestDevice(ref list, true); |
| | | #endif |
| | | return list; |
| | | } |
| | | /// <summary> |
| | | /// 获取可视对讲设备列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<HDL_ON.Entity.Function> GetVideoDeviceList() |
| | | { |
| | | var functionList = new List<Function>(); |
| | | return functionList; |
| | | } |
| | | /// <summary> |
| | | /// 获取场景列表 |
| | |
| | | /// <returns></returns> |
| | | public string GetDeviceIconPath(Function device) |
| | | { |
| | | |
| | | if (SPK.MusicStandard == device.spk |
| | | || SPK.AvMusic == device.spk) |
| | | { |
| | | return "MusicIcon/localMusic.png"; |
| | | } |
| | | else if (SPK.SensorPm10 == device.spk |
| | | || SPK.SensorPirHold == device.spk |
| | | ) |
| | | { |
| | | return "LogicIcon/sensor.png"; |
| | | } |
| | | else if (SPK.DoorLock == device.spk |
| | | || SPK.VideoDoorLock == device.spk) |
| | | { |
| | | return "FunctionIcon/DoorLock/DoorLock.png"; |
| | | } |
| | | //else if (SPK.SensorDryContact == device.spk |
| | | // || SPK.SensorDryContact2 == device.spk |
| | | // || SPK.OtherCommon == device.spk |
| | | // ) |
| | | //{ |
| | | // return "LogicIcon/ganjiedian.png"; |
| | | //} |
| | | //else if (SPK.SensorLight == device.spk) |
| | | //{ |
| | | // return "LogicIcon/lightloguc.png"; |
| | | //} |
| | | //LogicIcon/heatlogic.png" |
| | | return $"FunctionIcon/Icon/{device.IconName}.png"; |
| | | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 获取设备类型图标(已弃用 2022年11月25日14:07:30) |
| | | /// </summary> |
| | |
| | | string strPath = ""; |
| | | switch (spk) |
| | | { |
| | | case SPK.IpCam_Imou: |
| | | { |
| | | strPath = $"FunctionIcon/Icon/{SPK.IpCam_Imou.Replace(".", "")}.png"; |
| | | } |
| | | break; |
| | | case SPK.MechanicalArm: |
| | | { |
| | | strPath = "LogicIcon/lightloguc.png"; |
| | | } |
| | | break; |
| | | case SPK.doorgate: |
| | | { |
| | | strPath = "VideoIcon/keshiduijiang.png"; |
| | | } |
| | | break; |
| | | case SPK.AirSwitch: |
| | | { |
| | | strPath = "FunctionIcon/Icon/electricalbreaker.png"; |
| | | } |
| | | break; |
| | | case SPK.PanelSocket: |
| | | case SPK.ElectricSocket: |
| | | { |
| | | strPath = "FunctionIcon/Icon/electricalsocket.png"; |
| | | } |
| | | break; |
| | | case SPK.LightSwitch: |
| | | case SPK.LightRGB: |
| | | case SPK.LightRGBW: |
| | |
| | | strPath = "LogicIcon/airconditionerlogic.png"; |
| | | } |
| | | break; |
| | | case SPK.HvacCac: |
| | | strPath = "FunctionIcon/Icon/hvaccac.png"; |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.HvacFloorHeat: |
| | | { |
| | |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | strPath = "LogicIcon/heatlogic.png"; |
| | | } |
| | | break; |
| | | case SPK.SensorSmoke: |
| | | case SPK.SensorWater: |
| | | case SPK.SensorGas: |
| | | case SPK.SensorDryContact: |
| | | case SPK.SensorDryContact2: |
| | | case SPK.SensorShanLan: |
| | | case SPK.SensorDuiShe: |
| | | case SPK.SensorPir: |
| | | case SPK.SensorDoorWindow: |
| | | case SPK.SensorUtrasonic: |
| | | case SPK.SensorMmvPose: |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | case SPK.SensorEnvironment:case SPK.SensorEnvironmentHailin: |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | | case SPK.SensorTemperature: |
| | | case SPK.SensorHumidity: |
| | | case SPK.SensorCO2: |
| | | case SPK.SensorPm25: |
| | | case SPK.SensorTVOC: |
| | | case SPK.SensorHcho: |
| | | case SPK.SensorHelp: |
| | | case SPK.SensorPirHold: |
| | | |
| | | { |
| | | strPath = "LogicIcon/sensor.png"; |
| | | } |
| | | break; |
| | | case SPK.DoorLock: |
| | | { |
| | | strPath = "FunctionIcon/DoorLock/DoorLock.png"; |
| | | } |
| | | break; |
| | | case SPK.MusicStandard: |
| | | case SPK.AvMusic: |
| | | { |
| | | strPath = "MusicIcon/localMusic.png"; |
| | | } |
| | | break; |
| | | } |
| | |
| | | List<string> deviceStrTypeList = new List<string>(); |
| | | deviceStrTypeList.Clear(); |
| | | |
| | | |
| | | //群控 |
| | | var gp = deviceList.Find((device) => |
| | | device.spk == SPK.GroupControl); |
| | | if (gp != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.GroupControl)); |
| | | } |
| | | |
| | | ///灯光类 |
| | | var lightjosn = deviceList.Find((device) => |
| | | device.spk == SPK.LightSwitch |
| | |
| | | || device.spk == SPK.LightCCT |
| | | || device.spk == SPK.LightRGB |
| | | || device.spk == SPK.LightRGBW |
| | | || device.spk == SPK.OtherCommon |
| | | ); |
| | | if (lightjosn != null) |
| | | { |
| | |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.AirFresh)); |
| | | } |
| | | ///传感器类 |
| | | var sensor = deviceList.Find((device) => |
| | | device.spk == SPK.SensorWater |
| | | || device.spk == SPK.SensorGas |
| | | || device.spk == SPK.SensorSmoke |
| | | || device.spk == SPK.SensorDryContact || device.spk == SPK.SensorDryContact2 |
| | | || device.spk == SPK.SensorShanLan |
| | | || device.spk == SPK.SensorDuiShe |
| | | || device.spk == SPK.SensorPir |
| | | || device.spk == SPK.SensorDoorWindow |
| | | || device.spk == SPK.SensorUtrasonic |
| | | || device.spk == SPK.SensorMmvPose |
| | | || device.spk == SPK.SenesorMegahealth |
| | | || device.spk == SPK.SenesorMegahealth2 |
| | | || device.spk == SPK.SensorEnvironment || device.spk == SPK.SensorEnvironmentHailin |
| | | || device.spk == SPK.SensorEnvironment2 |
| | | || device.spk == SPK.SensorEnvironment3 |
| | | || device.spk == SPK.SensorTemperature |
| | | || device.spk == SPK.SensorHumidity |
| | | || device.spk == SPK.SensorCO2 |
| | | || device.spk == SPK.SensorPm25 |
| | | || device.spk == SPK.SensorTVOC |
| | | || device.spk == SPK.SensorHcho |
| | | || device.spk == SPK.SensorHelp |
| | | || device.spk == SPK.SensorPm10 |
| | | || device.spk == SPK.SensorPirHold |
| | | || device.spk == SPK.SensorLight |
| | | ); |
| | | if (sensor != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Sensor)); |
| | | } |
| | | ///家电类 |
| | | var electric = deviceList.Find((device) => |
| | | device.spk == SPK.AirSwitch |
| | | || device.spk == SPK.PanelSocket |
| | | || device.spk == SPK.ElectricSocket |
| | | || device.spk == SPK.ElectricalTvHisense |
| | | ); |
| | | if (electric != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Electric)); |
| | | } |
| | | ///门锁类 |
| | | var doorlock = deviceList.Find((device) => device.spk == SPK.DoorLock |
| | | || device.spk == SPK.VideoDoorLock); |
| | | if (doorlock != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.DoorLock)); |
| | | } |
| | | ///音乐类 |
| | | var music = deviceList.Find((device) => device.spk == SPK.MusicStandard || device.spk == SPK.AvMusic); |
| | | if (music != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Music)); |
| | | } |
| | | ///可视对讲 |
| | | var doorgate = deviceList.Find((device) => device.spk == SPK.doorgate); |
| | | if (doorgate != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.VideoIntercom)); |
| | | } |
| | | ///机械手类 |
| | | var MechanicalArm = deviceList.Find((device) => |
| | | device.spk == SPK.MechanicalArm); |
| | | if (MechanicalArm != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.jixieshou)); |
| | | } |
| | | ///摄像头类 |
| | | var camera = deviceList.Find((device) => |
| | | device.spk == SPK.IpCam_Imou || device.spk == SPK.Ev_Ipcam || device.spk == SPK.Peephole); |
| | | if (camera != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.shexiangtou)); |
| | | } |
| | | return deviceStrTypeList; |
| | | |
| | | } |
| | |
| | | functionTypeList.Add(SPK.LightRGB); |
| | | functionTypeList.Add(SPK.LightRGBW); |
| | | functionTypeList.Add(SPK.LightCCT); |
| | | functionTypeList.Add(SPK.AirSwitch); |
| | | functionTypeList.Add(SPK.PanelSocket); |
| | | functionTypeList.Add(SPK.ElectricSocket); |
| | | functionTypeList.Add(SPK.OtherCommon); |
| | | } |
| | | //群控 |
| | | else if (deviceType == Language.StringByID(StringId.GroupControl)) |
| | | { |
| | | functionTypeList.Add(SPK.GroupControl); |
| | | } |
| | | ///窗帘类 |
| | | else if (deviceType == Language.StringByID(StringId.Curtain)) |
| | |
| | | { |
| | | functionTypeList.Add(SPK.AcStandard); |
| | | functionTypeList.Add(SPK.HvacAC); |
| | | functionTypeList.Add(SPK.HvacCac); |
| | | functionTypeList.Add(SPK.AcIr); |
| | | } |
| | | ///地暖类 |
| | |
| | | { |
| | | functionTypeList.Add(SPK.AirFreshStandard); functionTypeList.Add(SPK.HvacAirFresh); |
| | | } |
| | | ///传感器类 |
| | | else if (deviceType == Language.StringByID(StringId.Sensor)) |
| | | { |
| | | functionTypeList.Add(SPK.SensorSmoke); |
| | | functionTypeList.Add(SPK.SensorWater); |
| | | functionTypeList.Add(SPK.SensorGas); |
| | | functionTypeList.Add(SPK.SensorDryContact); functionTypeList.Add(SPK.SensorDryContact2); |
| | | functionTypeList.Add(SPK.SensorShanLan); |
| | | functionTypeList.Add(SPK.SensorDuiShe); |
| | | functionTypeList.Add(SPK.SensorPir); |
| | | functionTypeList.Add(SPK.SensorDoorWindow); |
| | | functionTypeList.Add(SPK.SensorUtrasonic); |
| | | functionTypeList.Add(SPK.SensorMmvPose); |
| | | functionTypeList.Add(SPK.SenesorMegahealth); |
| | | functionTypeList.Add(SPK.SenesorMegahealth2); |
| | | functionTypeList.Add(SPK.SensorEnvironment); functionTypeList.Add(SPK.SensorEnvironmentHailin); |
| | | functionTypeList.Add(SPK.SensorEnvironment2); |
| | | functionTypeList.Add(SPK.SensorEnvironment3); |
| | | functionTypeList.Add(SPK.SensorTemperature); |
| | | functionTypeList.Add(SPK.SensorHumidity); |
| | | functionTypeList.Add(SPK.SensorCO2); |
| | | functionTypeList.Add(SPK.SensorPm25); |
| | | functionTypeList.Add(SPK.SensorTVOC); |
| | | functionTypeList.Add(SPK.SensorHcho); |
| | | functionTypeList.Add(SPK.SensorHelp); |
| | | functionTypeList.Add(SPK.SensorPm10); |
| | | functionTypeList.Add(SPK.SensorPirHold); |
| | | functionTypeList.Add(SPK.SensorLight); |
| | | |
| | | |
| | | } |
| | | ///家电类 |
| | | else if (deviceType == Language.StringByID(StringId.Electric)) |
| | | { |
| | | functionTypeList.Add(SPK.AirSwitch); |
| | | functionTypeList.Add(SPK.PanelSocket); |
| | | functionTypeList.Add(SPK.ElectricSocket); |
| | | functionTypeList.Add(SPK.ElectricalTvHisense); |
| | | } |
| | | ///门锁类 |
| | | else if (deviceType == Language.StringByID(StringId.DoorLock)) |
| | | { |
| | | functionTypeList.Add(SPK.DoorLock); |
| | | functionTypeList.Add(SPK.VideoDoorLock); |
| | | } |
| | | ///音乐类 |
| | | else if (deviceType == Language.StringByID(StringId.Music)) |
| | | { |
| | | functionTypeList.Add(SPK.MusicStandard); |
| | | functionTypeList.Add(SPK.AvMusic); |
| | | } |
| | | ///HDL可视对讲 |
| | | else if (deviceType == Language.StringByID(StringId.VideoIntercom)) |
| | | { |
| | | functionTypeList.Add(SPK.doorgate); |
| | | } |
| | | ///机械手类 |
| | | else if (deviceType == Language.StringByID(StringId.jixieshou)) |
| | | { |
| | | functionTypeList.Add(SPK.MechanicalArm); |
| | | } |
| | | ///摄像头类 |
| | | else if (deviceType == Language.StringByID(StringId.shexiangtou)) |
| | | { |
| | | functionTypeList.Add(SPK.IpCam_Imou); |
| | | functionTypeList.Add(SPK.Ev_Ipcam); |
| | | functionTypeList.Add(SPK.Peephole); |
| | | } |
| | | else |
| | | { |
| | | //全部区域 |
| | | functionTypeList.Add(SPK.GroupControl); |
| | | functionTypeList.Add(SPK.Peephole); |
| | | functionTypeList.Add(SPK.Ev_Ipcam); |
| | | functionTypeList.Add(SPK.LightSwitch); |
| | | functionTypeList.Add(SPK.LightDimming); |
| | | functionTypeList.Add(SPK.LightRGB); |
| | | functionTypeList.Add(SPK.LightRGBW); |
| | | functionTypeList.Add(SPK.LightCCT); |
| | | functionTypeList.Add(SPK.AirSwitch); |
| | | functionTypeList.Add(SPK.PanelSocket); |
| | | functionTypeList.Add(SPK.ElectricSocket); |
| | | functionTypeList.Add(SPK.CurtainSwitch); |
| | | functionTypeList.Add(SPK.CurtainRoller); |
| | | functionTypeList.Add(SPK.CurtainTrietex); |
| | |
| | | functionTypeList.Add(SPK.HvacFloorHeat); |
| | | functionTypeList.Add(SPK.AirFreshStandard); |
| | | functionTypeList.Add(SPK.HvacAirFresh); |
| | | functionTypeList.Add(SPK.SensorSmoke); |
| | | functionTypeList.Add(SPK.SensorWater); |
| | | functionTypeList.Add(SPK.SensorGas); |
| | | functionTypeList.Add(SPK.SensorDryContact); |
| | | functionTypeList.Add(SPK.SensorDryContact2); |
| | | functionTypeList.Add(SPK.SensorShanLan); |
| | | functionTypeList.Add(SPK.SensorDuiShe); |
| | | functionTypeList.Add(SPK.SensorPir); |
| | | functionTypeList.Add(SPK.SensorDoorWindow); |
| | | functionTypeList.Add(SPK.SensorUtrasonic); |
| | | functionTypeList.Add(SPK.SensorMmvPose); |
| | | functionTypeList.Add(SPK.SenesorMegahealth); |
| | | functionTypeList.Add(SPK.SenesorMegahealth2); |
| | | functionTypeList.Add(SPK.SensorEnvironment); functionTypeList.Add(SPK.SensorEnvironmentHailin); |
| | | functionTypeList.Add(SPK.SensorEnvironment2); |
| | | functionTypeList.Add(SPK.SensorEnvironment3); |
| | | functionTypeList.Add(SPK.SensorTemperature); |
| | | functionTypeList.Add(SPK.SensorHumidity); |
| | | functionTypeList.Add(SPK.SensorCO2); |
| | | functionTypeList.Add(SPK.SensorPm25); |
| | | functionTypeList.Add(SPK.SensorTVOC); |
| | | functionTypeList.Add(SPK.SensorHcho); |
| | | functionTypeList.Add(SPK.AirSwitch); |
| | | functionTypeList.Add(SPK.PanelSocket); |
| | | functionTypeList.Add(SPK.ElectricSocket); |
| | | functionTypeList.Add(SPK.HvacCac); |
| | | functionTypeList.Add(SPK.SensorHelp); |
| | | functionTypeList.Add(SPK.DoorLock); |
| | | functionTypeList.Add(SPK.CurtainDream); |
| | | functionTypeList.Add(SPK.MusicStandard); |
| | | functionTypeList.Add(SPK.AvMusic); |
| | | functionTypeList.Add(SPK.doorgate); |
| | | functionTypeList.Add(SPK.MechanicalArm); |
| | | functionTypeList.Add(SPK.IpCam_Imou); |
| | | functionTypeList.Add(SPK.SensorPm10); |
| | | functionTypeList.Add(SPK.VideoDoorLock); |
| | | functionTypeList.Add(SPK.AcIr); |
| | | functionTypeList.Add(SPK.SensorPirHold); |
| | | functionTypeList.Add(SPK.ElectricalTvHisense); |
| | | functionTypeList.Add(SPK.SensorLight); |
| | | functionTypeList.Add(SPK.OtherCommon); |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | case condition_if: |
| | | { |
| | | deviceTypeList.Add(SPK.Ev_Ipcam); |
| | | deviceTypeList.Add(SPK.Peephole); |
| | | deviceTypeList.Add(SPK.LightSwitch); |
| | | deviceTypeList.Add(SPK.LightRGB); |
| | | deviceTypeList.Add(SPK.LightRGBW); |
| | |
| | | deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAC);deviceTypeList.Add(SPK.AcIr); |
| | | deviceTypeList.Add(SPK.AirFreshStandard); deviceTypeList.Add(SPK.HvacAirFresh); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat); |
| | | deviceTypeList.Add(SPK.SensorSmoke); |
| | | deviceTypeList.Add(SPK.SensorWater); |
| | | deviceTypeList.Add(SPK.SensorGas); |
| | | deviceTypeList.Add(SPK.SensorDryContact); deviceTypeList.Add(SPK.SensorDryContact2); |
| | | deviceTypeList.Add(SPK.SensorShanLan); |
| | | deviceTypeList.Add(SPK.SensorDuiShe); |
| | | deviceTypeList.Add(SPK.SensorPir); |
| | | deviceTypeList.Add(SPK.SensorDoorWindow); |
| | | deviceTypeList.Add(SPK.SensorUtrasonic); |
| | | deviceTypeList.Add(SPK.SensorMmvPose); |
| | | deviceTypeList.Add(SPK.SenesorMegahealth); |
| | | deviceTypeList.Add(SPK.SenesorMegahealth2); |
| | | deviceTypeList.Add(SPK.SensorEnvironment); deviceTypeList.Add(SPK.SensorEnvironmentHailin); |
| | | deviceTypeList.Add(SPK.SensorEnvironment2); |
| | | deviceTypeList.Add(SPK.SensorEnvironment3); |
| | | deviceTypeList.Add(SPK.SensorTemperature); |
| | | deviceTypeList.Add(SPK.SensorHumidity); |
| | | deviceTypeList.Add(SPK.SensorCO2); |
| | | deviceTypeList.Add(SPK.SensorPm25); |
| | | deviceTypeList.Add(SPK.SensorTVOC); |
| | | deviceTypeList.Add(SPK.SensorHcho); |
| | | deviceTypeList.Add(SPK.AirSwitch); |
| | | deviceTypeList.Add(SPK.PanelSocket); |
| | | deviceTypeList.Add(SPK.ElectricSocket); |
| | | deviceTypeList.Add(SPK.HvacCac); |
| | | deviceTypeList.Add(SPK.SensorHelp); |
| | | deviceTypeList.Add(SPK.DoorLock); |
| | | deviceTypeList.Add(SPK.doorgate); |
| | | deviceTypeList.Add(SPK.IpCam_Imou); |
| | | deviceTypeList.Add(SPK.SensorPm10); |
| | | deviceTypeList.Add(SPK.VideoDoorLock); |
| | | deviceTypeList.Add(SPK.AcIr); |
| | | deviceTypeList.Add(SPK.SensorPirHold); |
| | | deviceTypeList.Add(SPK.SensorLight); |
| | | |
| | | } |
| | | break; |
| | | case target_if: |
| | | { |
| | | deviceTypeList.Add(SPK.GroupControl); |
| | | deviceTypeList.Add(SPK.LightSwitch); |
| | | deviceTypeList.Add(SPK.LightRGB); |
| | | deviceTypeList.Add(SPK.LightRGBW); |
| | |
| | | deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAC); deviceTypeList.Add(SPK.AcIr); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat); |
| | | deviceTypeList.Add(SPK.AirFreshStandard); deviceTypeList.Add(SPK.HvacAirFresh); |
| | | deviceTypeList.Add(SPK.AirSwitch); |
| | | deviceTypeList.Add(SPK.PanelSocket); |
| | | deviceTypeList.Add(SPK.ElectricSocket); |
| | | deviceTypeList.Add(SPK.CurtainDream); |
| | | deviceTypeList.Add(SPK.MusicStandard); |
| | | deviceTypeList.Add(SPK.AvMusic); |
| | | deviceTypeList.Add(SPK.MechanicalArm); |
| | | deviceTypeList.Add(SPK.AcIr); |
| | | deviceTypeList.Add(SPK.ElectricalTvHisense); |
| | | deviceTypeList.Add(SPK.OtherCommon); |
| | | } |
| | | break; |
| | | } |
| | |
| | | get |
| | | { |
| | | return Entity.DB_ResidenceData.Instance.CurrentRegion.isOtherShare; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 拼接时间格式//"{h}h{m}min{s}s"; |
| | | /// </summary> |
| | | /// <param name="totalSeconds">秒(没有默认传入0)</param> |
| | | /// <returns></returns> |
| | | public string getTimeStr(string totalSeconds) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(totalSeconds)) |
| | | { |
| | | return ""; |
| | | } |
| | | int time = int.Parse(totalSeconds); |
| | | int h = time / (60 * 60); |
| | | int m = time % (60 * 60) / 60; |
| | | int s = (time % (60 * 60) % 60); |
| | | |
| | | if (h == 0 && m != 0 && s != 0) |
| | | { |
| | | return $"{m}min{s}s"; |
| | | } |
| | | else if (h == 0 && m == 0 && s != 0) |
| | | { |
| | | return $"{s}s"; |
| | | } |
| | | else if (h == 0 && m != 0 && s == 0) |
| | | { |
| | | return $"{m}min"; |
| | | } |
| | | else if (h != 0 && m == 0 && s != 0) |
| | | { |
| | | return $"{h}h{s}s"; |
| | | } |
| | | else if (h != 0 && m == 0 && s == 0) |
| | | { |
| | | return $"{h}h"; |
| | | } |
| | | else if (h != 0 && m != 0 && s == 0) |
| | | { |
| | | return $"{h}h{m}min"; |
| | | } |
| | | else if (h != 0 && m != 0 && s != 0) |
| | | { |
| | | return $"{h}h{m}min{s}s"; |
| | | } |
| | | else if (h == 0 && m == 0 && s == 0) |
| | | { |
| | | return $"0s"; |
| | | } |
| | | return ""; |
| | | } |
| | | catch |
| | | { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | //模拟设备 |
| | | var functions = new List<Function> { |
| | | //new Entity.Function { sid = "1234567890", name = "超声波传感器", spk = Entity.SPK.SensorUtrasonic }, |
| | | // new Entity.Function { sid = "1234567891", name = "温度传感器", spk = Entity.SPK.SensorTemperature }, |
| | | // new Entity.Function { sid = "1234567892", name = "湿度传感器", spk = Entity.SPK.SensorHumidity }, |
| | | new Entity.Function { sid = "1234567890", name = "光照传感器", spk = Entity.SPK.SensorLight }, |
| | | new Entity.Function { sid = "1234567891", name = "干节点", spk = Entity.SPK.SensorDryContact }, |
| | | new Entity.Function { sid = "1234567892", name = "紧急求助传感器", spk = Entity.SPK.SensorHelp }, |
| | | new Entity.Function { sid = "12345678921", name = "通用开关", spk = Entity.SPK.OtherCommon }, |
| | | //new Entity.Function { sid = "12345678933456", name = "门锁", spk = Entity.SPK.DoorLock }, |
| | | // new Entity.Function { sid = "1234567895444", name = "视频门锁", spk = Entity.SPK.VideoDoorLock }, |
| | | //new Entity.Function { sid = "12345678968888", name = "人体存在传感器", spk = Entity.SPK.SensorPirHold }, |
| | | //new Entity.Function { sid = "12345678968888", name = "测试猫眼", spk = Entity.SPK.Peephole }, |
| | | //new Entity.Function { sid = "12345678968889", name = "测试萤石摄像头", spk = Entity.SPK.Ev_Ipcam }, |
| | | new Entity.Function { sid = "123456789688889", name = "人体存在传感器", spk = Entity.SPK.SensorPirHold }, |
| | | new Entity.Function { sid = "12345678968888", name = "测试猫眼", spk = Entity.SPK.Peephole }, |
| | | new Entity.Function { sid = "12345678968889", name = "测试萤石摄像头", spk = Entity.SPK.Ev_Ipcam }, |
| | | // new Entity.Function { sid = "1234567897", name = "毫米波传感器1", spk = Entity.SPK.SenesorMegahealth2 }, |
| | | // new Entity.Function { sid = "1234567899", name = "门磁传感器", spk = Entity.SPK.SensorDoorWindow }, |
| | | // new Entity.Function { sid = "12345678991234", name = "HDL机械手", spk = Entity.SPK.MechanicalArm }, |
| | | // new Entity.Function { sid = "123456789912345", name = "海曼机械手", spk = Entity.SPK.MechanicalArm }, |
| | | //new Entity.Function { sid = "12345678991234566844", name = "大华摄像头", spk = Entity.SPK.IpCam_Imou }, |
| | | new Entity.Function { sid = "12345678991234566844", name = "大华摄像头", spk = Entity.SPK.IpCam_Imou }, |
| | | new Entity.Function { sid = "12345678991234567", name = "RGB", spk = Entity.SPK.LightRGB }, |
| | | new Entity.Function { sid = "123456789912345678", name = "RGBW", spk = Entity.SPK.LightRGBW }, |
| | | new Function { spk = SPK.ElectricalTvHisense, name = "海信电视1",sid="123456789"}, |
| | | }; |
| | | foreach (var function in functions) |
| | | { |