| | |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Id), ePropStatus.Error, "缺少[构件编码]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Id), ePropStatus.Error, "[换热器]缺少[构件编码]"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | if (string.IsNullOrEmpty(exchanger.Code)) |
| | | { |
| | | exchanger.Code = exchanger.Id; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Code), ePropStatus.Lack, "使用[构件编码]赋值"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Code), ePropStatus.Lack, "[换热器][编码]缺省,使用[构件编码]赋值"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Code), ePropStatus.Error, "缺少[编码]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Code), ePropStatus.Error, "[换热器]缺少[编码]"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | if (jobject.ParseString(RevitJsonProp.Name, out string name)) |
| | | { |
| | | exchanger.Name = name; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Name), ePropStatus.Lack, "[名称]缺省"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Name), ePropStatus.Lack, "[换热器][名称]缺省"); |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Name), ePropStatus.Error, "缺少[名称]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Name), ePropStatus.Error, "[换热器]缺少[名称]"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | exchanger.ModelType = modelType; |
| | | if (string.IsNullOrEmpty(exchanger.ModelType)) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.ModelType), ePropStatus.Lack, "[型号信息]缺省"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.ModelType), ePropStatus.Lack, "[换热器][型号信息]缺省"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.ModelType), ePropStatus.Error, "缺少[型号信息]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.ModelType), ePropStatus.Error, "[换热器]缺少[型号信息]"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | { |
| | | if (exchanger.Flags == null || exchanger.Flags.Count < 1) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Flags), ePropStatus.Abnormal, "[标签]格式错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Flags), ePropStatus.Abnormal, "[换热器][标签]格式错误"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Flags), ePropStatus.Error, "缺少[标签]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Flags), ePropStatus.Error, "[换热器]缺少[标签]"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Description), ePropStatus.Error, "缺少[说明信息]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Description), ePropStatus.Error, "[换热器]缺少[说明信息]"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | }).ToList(); |
| | | if (exchanger.ConnectList == null || exchanger.ConnectList.Count < 1) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.ConnectList), ePropStatus.Error, "[连接列表]解析失败"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.ConnectList), ePropStatus.Error, "[换热器][连接列表]解析失败"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.ConnectList), ePropStatus.Error, "缺少[连接列表]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.ConnectList), ePropStatus.Error, "[换热器]缺少[连接列表]"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | exchanger.StartCode = startConnect?.Id; |
| | | if (string.IsNullOrEmpty(exchanger.StartCode)) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartCode), ePropStatus.Error, "[上游构件]受[连接列表]影响解析错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartCode), ePropStatus.Error, "[换热器][上游构件]受[连接列表]影响解析错误"); |
| | | } |
| | | exchanger.StartPosition = startConnect?.Position; |
| | | if (exchanger.StartPosition == null) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartPosition), ePropStatus.Error, "[上游构件位置]受[连接列表]影响解析错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartPosition), ePropStatus.Error, "[换热器][上游构件位置]受[连接列表]影响解析错误"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | exchanger.EndCode = endConnect?.Id; |
| | | if (string.IsNullOrEmpty(exchanger.EndCode)) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndCode), ePropStatus.Error, "[下游构件]受[连接列表]影响解析错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndCode), ePropStatus.Error, "[换热器][下游构件]受[连接列表]影响解析错误"); |
| | | } |
| | | exchanger.EndPosition = endConnect?.Position; |
| | | if (exchanger.EndPosition == null) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndPosition), ePropStatus.Error, "[下游构件位置]受[连接列表]影响解析错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndPosition), ePropStatus.Error, "[换热器][下游构件位置]受[连接列表]影响解析错误"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | if (string.IsNullOrEmpty(exchanger.LinkStatus)) |
| | | { |
| | | exchanger.LinkStatus = PipeStatus.Open; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.LinkStatus), ePropStatus.Lack, "[管道状态]缺省"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.LinkStatus), ePropStatus.Lack, "[换热器][管道状态]缺省"); |
| | | } |
| | | else |
| | | { |
| | | if (!PipeStatus.Contains(exchanger.LinkStatus)) |
| | | { |
| | | exchanger.LinkStatus = PipeStatus.Open; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.LinkStatus), ePropStatus.Abnormal, "[管道状态]设置错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.LinkStatus), ePropStatus.Abnormal, "[换热器][管道状态]设置错误"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | exchanger.LinkStatus = PipeStatus.Open; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.LinkStatus), ePropStatus.Abnormal, "[管道状态]缺少或格式错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.LinkStatus), ePropStatus.Abnormal, "[换热器][管道状态]缺少或格式错误"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartElev), ePropStatus.Abnormal, "[上游标高]缺少或格式错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartElev), ePropStatus.Abnormal, "[换热器][上游标高]缺少或格式错误"); |
| | | } |
| | | |
| | | if (exchanger.StartElev <= 0) |
| | |
| | | //通过z轴自动计算 |
| | | if (exchanger.StartPosition == null) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartElev), ePropStatus.Lack, "[上游标高]缺省,受[上游构件位置]影响,无法通过Z轴自动计算"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartElev), ePropStatus.Lack, "[换热器][上游标高]缺省,受[上游构件位置]影响,无法通过Z轴自动计算"); |
| | | } |
| | | else |
| | | { |
| | | exchanger.StartElev = exchanger.StartPosition.Z; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartElev), ePropStatus.Lack, "[上游标高]缺省,通过Z轴自动计算"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartElev), ePropStatus.Lack, "[换热器][上游标高]缺省,通过Z轴自动计算"); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndElev), ePropStatus.Abnormal, "[下游标高]缺少或格式错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndElev), ePropStatus.Abnormal, "[换热器][下游标高]缺少或格式错误"); |
| | | } |
| | | |
| | | if (exchanger.EndElev <= 0) |
| | |
| | | //通过z轴自动计算 |
| | | if (exchanger.EndPosition == null) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndElev), ePropStatus.Lack, "[下游标高]缺省,受[下游构件位置]影响,无法通过Z轴自动计算"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndElev), ePropStatus.Lack, "[换热器][下游标高]缺省,受[下游构件位置]影响,无法通过Z轴自动计算"); |
| | | } |
| | | else |
| | | { |
| | | exchanger.EndElev = exchanger.EndPosition.Z; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndElev), ePropStatus.Lack, "[下游标高]缺省,通过Z轴自动计算"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndElev), ePropStatus.Lack, "[换热器][下游标高]缺省,通过Z轴自动计算"); |
| | | } |
| | | } |
| | | |
| | |
| | | exchanger.StartQuality = startQuality; |
| | | if (exchanger.StartQuality <= 0) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartQuality), ePropStatus.Lack, "[上游初始水质]缺省"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartQuality), ePropStatus.Lack, "[换热器][上游初始水质]缺省"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartQuality), ePropStatus.Abnormal, "[上游初始水质]缺少或者格式错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.StartQuality), ePropStatus.Abnormal, "[换热器][上游初始水质]缺少或者格式错误"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | exchanger.EndQuality = endQuality; |
| | | if (exchanger.EndQuality <= 0) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndQuality), ePropStatus.Lack, "[下游初始水质]缺省"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndQuality), ePropStatus.Lack, "[换热器][下游初始水质]缺省"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndQuality), ePropStatus.Abnormal, "[下游初始水质]缺少或者格式错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.EndQuality), ePropStatus.Abnormal, "[换热器][下游初始水质]缺少或者格式错误"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | exchanger.Material = material; |
| | | if (string.IsNullOrEmpty(exchanger.Material)) |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Material), ePropStatus.Lack, "[材质]缺省"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Material), ePropStatus.Lack, "[换热器][材质]缺省"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Material), ePropStatus.Abnormal, "缺少[材质]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Material), ePropStatus.Abnormal, "[换热器]缺少[材质]"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Abnormal, "[直径]缺少或者格式错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Abnormal, "[换热器][直径]缺少或者格式错误"); |
| | | } |
| | | |
| | | if (exchanger.Diameter < 1) |
| | |
| | | if (jobject[RevitJsonProp.InternalDiameter].MatchNumeric(out double internalDiameter)) |
| | | { |
| | | exchanger.Diameter = internalDiameter; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Lack, "[直径]通过[内径]进行修复]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Lack, "[换热器][直径]通过[内径]进行修复]"); |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Abnormal, "[直径]无法通过[内径]进行修复]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Abnormal, "[换热器][直径]无法通过[内径]进行修复]"); |
| | | } |
| | | } |
| | | |
| | |
| | | if (jobject[RevitJsonProp.DN].MatchNumeric(out double dn)) |
| | | { |
| | | exchanger.Diameter = dn; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Lack, "[直径]通过[公称直径]进行修复]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Lack, "[换热器][直径]通过[公称直径]进行修复]"); |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Abnormal, "[直径]无法通过[公称直径]进行修复]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Abnormal, "[换热器][直径]无法通过[公称直径]进行修复]"); |
| | | } |
| | | } |
| | | |
| | | if (exchanger.Diameter < 1) |
| | | { |
| | | exchanger.Diameter = 1000; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Lack, "[直径][内径]解析错误,使用默认值(1000mm)修正]"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Diameter), ePropStatus.Lack, "[换热器][直径][内径]解析错误,使用默认值(1000mm)修正]"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Length), ePropStatus.Abnormal, "[长度]缺少或者格式错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Length), ePropStatus.Abnormal, "[换热器][长度]缺少或者格式错误"); |
| | | } |
| | | if (exchanger.Length <= 0) |
| | | { |
| | | if (exchanger.StartPosition != null && exchanger.EndPosition != null) |
| | | { |
| | | exchanger.Length = exchanger.StartPosition.Distance(exchanger.EndPosition); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Length), ePropStatus.Lack, "[长度]缺省,通过位置自动计算"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Length), ePropStatus.Lack, "[换热器][长度]缺省,通过位置自动计算"); |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Length), ePropStatus.Abnormal, "[长度]受[连接列表]影响无法自动计算"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Length), ePropStatus.Abnormal, "[换热器][长度]受[连接列表]影响无法自动计算"); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Roughness), ePropStatus.Abnormal, "[粗糙系数]缺少或者数据格式错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Roughness), ePropStatus.Abnormal, "[换热器][粗糙系数]缺少或者数据格式错误"); |
| | | } |
| | | |
| | | if (exchanger.Roughness < 0.1) |
| | | { |
| | | exchanger.Roughness = 110; |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Roughness), ePropStatus.Lack, "[粗糙系数]解析错误,通过默认值(110)进行修正"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.Roughness), ePropStatus.Lack, "[换热器][粗糙系数]解析错误,通过默认值(110)进行修正"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | } |
| | | else |
| | | { |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.MinorLoss), ePropStatus.Abnormal, "[局部阻力系数]缺少或者数据格式错误"); |
| | | exchanger.AppendOrUpdatePropStatus(nameof(exchanger.MinorLoss), ePropStatus.Abnormal, "[换热器][局部阻力系数]缺少或者数据格式错误"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | |
| | | if (pump.RatedHz < 1) |
| | | { |
| | | pump.RatedHz = 50; |
| | | pump.AppendOrUpdatePropStatus(nameof(pump.RatedHz), ePropStatus.Lack, "[额定频率]缺省,使用默认值(50Hz)进行修正"); |
| | | } |
| | | |