Esempio n. 1
0
        public StruCalsElecLoad ConvertLoadHang()
        {
            StruCalsElecLoad elecLoad = new StruCalsElecLoad();
            List <ElecCalsWorkConditionBase> wkCdtList     = new List <ElecCalsWorkConditionBase>();
            List <WireElecLoadLine>          LineElecLoads = new List <WireElecLoadLine>();


            for (int i = 1; i <= StruTemplate.WorkConditongs.Count; i++)
            {
                string wkNameS = StruTemplate.WorkConditongs[i];
                if (wkNameS == null)
                {
                    continue;
                }
                string wkNameE = WorkConditionMaps(wkNameS);

                //查找工况
                GetWorkCondition(wkNameE, out ElecCalsWorkConditionBase wkCdt);
                wkCdt.Id   = i;
                wkCdt.Name = wkNameS;
                wkCdtList.Add(wkCdt);

                for (int j = 0; j < StruTemplate.Wires.Count; j++)
                {
                    string wire = StruTemplate.Wires[j];

                    //GetWindLoad();
                }
            }

            return(elecLoad);
        }
Esempio n. 2
0
        public void InitElecLoadSheet(TowerTypeEnum type, StruCalsElecLoad load)
        {
            towerType = type;
            elecLoad  = load;

            UpdateElecLoadWorkSheetFromMem();
        }
        //此构造函数用于从配置文件中获取已经保存的塔位参数,所有参数都来做保存文件
        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>(),
            };
        }
        protected override void  InitializeData(string towerName)
        {
            base.InitializeData(towerName);

            BaseParas      = struCalsParas.BaseParas;
            ElecLoad       = struCalsParas.ElecLoad;
            Wind45TenParas = new ObservableCollection <StruCalsTension>(struCalsParas.ElecLoad.ExtraLoad);
        }
        //此构造函数用于不是杆塔序列中新增塔位, 线条相关的初始化信息主要来自于Template,
        public StruCalsParasCompose(string towerName, string towerType, float voltage, string templatePath, string electricalLaodFilePath, List <string> fullStressTemplatePaths, out string decodeTemolateStr)
        {
            decodeTemolateStr = "";

            TowerName    = towerName;
            SequenceName = "";

            TemplatePath = templatePath;
            TemplateName = templatePath.Substring(templatePath.LastIndexOf('\\') + 1);

            FullStressTemplatePaths = fullStressTemplatePaths;
            FullStressTemplateNames = new List <string>();
            foreach (var path in FullStressTemplatePaths)
            {
                FullStressTemplateNames.Add(path.Substring(path.LastIndexOf('\\') + 1));
            }

            TowerTypeEnum type = TowerTypeStringConvert.TowerStringToType(towerType);

            ElectricalLoadFilePath = electricalLaodFilePath;

            if (!DecodeTemplate(type, templatePath))
            {
                decodeTemolateStr = "解码模块错误!";
                return;
            }

            LineParas = new List <StruLineParas>();

            SetDefaultValue(type);
            BaseParas.Voltage = voltage;

            HPSettingsParas = new List <HangingPointSettingParas>();
            NewHangingPointSetting();

            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>(),
            };
        }
Esempio n. 6
0
        public StruCalsElecLoad ConvertLoadStrain()
        {
            StruCalsElecLoad elecLoad = new StruCalsElecLoad();
            List <ElecCalsWorkConditionBase> wkCdtList = new List <ElecCalsWorkConditionBase>();

            for (int i = 1; i <= StruTemplate.WorkConditongs.Count; i++)
            {
                string wkNameS = StruTemplate.WorkConditongs[i];
                if (wkNameS == null)
                {
                    continue;
                }
                string wkNameE = WorkConditionMaps(wkNameS);

                //查找工况
                GetWorkCondition(wkNameE, out ElecCalsWorkConditionBase wkCdt);
                wkCdt.Id   = i;
                wkCdt.Name = wkNameS;
                wkCdtList.Add(wkCdt);
            }

            return(elecLoad);
        }
        public void TestMethod07_StruCalsParas()
        {
            //var openFileDialog = new Microsoft.Win32.OpenFileDialog()
            //{
            //    Filter = "XML Files (*.xml)|*.xml",
            //};

            //if (openFileDialog.ShowDialog() != true)
            //    return;

            //StruCalsParas paras = XmlUtils.Deserializer<StruCalsParas>(openFileDialog.FileName);

            StruCalsParas paras = new StruCalsParas();

            List <ElecCalsWorkConditionBase> listWd = new List <ElecCalsWorkConditionBase>
            {
                new ElecCalsWorkConditionBase
                {
                    Id           = 1,
                    Name         = "大风",
                    IceThickness = 0,
                    Temperature  = 10,
                    WindSpeed    = 35,
                },
                new ElecCalsWorkConditionBase
                {
                    Id           = 2,
                    Name         = "覆冰",
                    IceThickness = 0,
                    Temperature  = 10,
                    WindSpeed    = 35,
                }
            };

            List <WireElecLoadLine> listLoad = new List <WireElecLoadLine>()
            {
                new WireElecLoadLine {
                    WireType = "左地",
                    ElecLoad = new List <ElecLoadLine>()
                    {
                        new ElecLoadLine
                        {
                            WorkConditionId   = 1,
                            WorkConditionName = "大风",
                            Wind       = 8.07f,
                            GMax       = 8.07f,
                            GMin       = 8.07f,
                            TensionMax = 8.07f,
                            TensionMin = 8.07f,
                        },
                        new ElecLoadLine
                        {
                            WorkConditionId   = 2,
                            WorkConditionName = "覆冰",
                            Wind       = 8.07f,
                            GMax       = 8.07f,
                            GMin       = 8.07f,
                            TensionMax = 8.07f,
                            TensionMin = 8.07f,
                        },
                    }
                },
                new WireElecLoadLine {
                    WireType = "右地",
                    ElecLoad = new List <ElecLoadLine>()
                    {
                        new ElecLoadLine
                        {
                            WorkConditionId   = 1,
                            WorkConditionName = "大风",
                            Wind       = 8.07f,
                            GMax       = 8.07f,
                            GMin       = 8.07f,
                            TensionMax = 8.07f,
                            TensionMin = 8.07f,
                        },
                        new ElecLoadLine
                        {
                            WorkConditionId   = 2,
                            WorkConditionName = "覆冰",
                            Wind       = 8.07f,
                            GMax       = 8.07f,
                            GMin       = 8.07f,
                            TensionMax = 8.07f,
                            TensionMin = 8.07f,
                        },
                    }
                }
            };

            StruCalsElecLoad elecLoad = new StruCalsElecLoad {
                WorkCondition = listWd,
                LineElecLoads = listLoad,
            };

            paras.ElecLoad = elecLoad;

            var saveFileDialog = new Microsoft.Win32.SaveFileDialog()
            {
                Filter = "XML Files (*.xml)|*.xml",
            };

            if (saveFileDialog.ShowDialog() != true)
            {
                return;
            }

            XmlUtils.Serializer <StruCalsParas>(saveFileDialog.FileName, paras);
        }