/// <summary> /// 在结构计算的参数的保存文件读取参数,并保存在GlobalInfo中 /// 只用于杆塔序列中的塔 /// </summary> /// <param name="name"></param> public void ReadStruCalsTowerParas(string name, string sequence) { string struCalsDirPath = StruCalsDirForTower(name, sequence) + "\\"; string fullStessDirPath = FullStressDirForTower(name, sequence) + "\\"; string parasSavedFilePath = struCalsDirPath + ConstVar.StruCalsParasFileName; StruCalsParasCompose temp = XmlUtils.Deserializer <StruCalsParasCompose>(parasSavedFilePath); if (temp == null || temp == default(StruCalsParasCompose)) { return; } string templatePath = struCalsDirPath + temp.TemplateName; List <string> fullStressTemplatePaths = new List <string>(); foreach (var tempName in temp.FullStressTemplateNames) { fullStressTemplatePaths.Add(fullStessDirPath + tempName); } StruCalsParasCompose paras = new StruCalsParasCompose(templatePath, fullStressTemplatePaths, temp); GlobalInfo.GetInstance().StruCalsParas.Add(paras); }
//保存塔库序列中的塔 public void SaveStruCalsTowerParaInSequence(StruCalsParasCompose paras) { string dirStruCalsPath = StruCalsDirForTower(paras.TowerName, paras.SequenceName); XmlUtils.Serializer(dirStruCalsPath + "\\" + ConstVar.StruCalsParasFileName, paras); }
//此构造函数用于从配置文件中获取已经保存的塔位参数,所有参数都来做保存文件 public StruCalsParasCompose(string electricalLaodFilePath, string templatePath, List <string> fullStressTemplatePaths, StruCalsParasCompose temp) { TowerName = temp.TowerName; TemplateName = temp.TemplateName; ElectricalLoadFilePath = electricalLaodFilePath; FullStressTemplateNames = temp.FullStressTemplateNames; FullStressTemplatePaths = fullStressTemplatePaths; BaseParas = temp.BaseParas; LineParas = temp.LineParas; HPSettingsParas = temp.HPSettingsParas; DecodeTemplate(BaseParas.Type, templatePath); ResultPointLoad = new List <StruCalsPointLoad>(); ElecLoad = new StruCalsElecLoad() { CornerElecLoads = new List <WireElecLoadCorner>(), LineCornerElecLoads = new List <WireElecLoadLineCorner>(), LineElecLoads = new List <WireElecLoadLine>(), ExtraLoad = new List <StruCalsTension>(), WorkCondition = new List <ElecCalsWorkConditionBase>(), }; }