예제 #1
0
        //public int NewNo { get; set; }

        // Display Info of the RFEM Objects on Panels
        // Parameters are separated by ";". The component split text can be used to break the string down into a list.
        public override string ToString()
        {
            return(string.Format($"RFEM-SurfaceLoad;No:{No};LoadCase:{LoadCase};" +
                                 $"F1:{Magnitude1.ToString("0.00")}[kN/m²];F2:{Magnitude2.ToString("0.00")}[kN/m²];F3:{Magnitude3.ToString("0.00")}[kN/m²];" +
                                 $"T4:{Magnitude4.ToString("0.00")};T5:{Magnitude5.ToString("0.00")};T6:{Magnitude6.ToString("0.00")};" +
                                 $"Node1No:{Node1No.ToString()};Node2No:{Node2No.ToString()};Node3No:{Node3No.ToString()};" +
                                 $"LoadType:{LoadType.ToString()};LoadDistType:{LoadDistType.ToString()};LoadDirType:{LoadDirType.ToString()};" +
                                 $"SurfaceList:{((SurfaceList == "") ? "-" : SurfaceList)};IsValid:{IsValid};ID:{((ID == "") ? "-" : ID)};Tag:{((Tag == "") ? "-" : Tag)};" +
                                 $"ToModify:{ToModify};ToDelete:{ToDelete};Comment:{((Comment == "") ? "-" : Comment)};"));
        }
예제 #2
0
        private void DoLoad(LoadType loadType)
        {
            lock (loadLock)
            {
                instance.timer.Change(Timeout.Infinite, Timeout.Infinite);
                var tran = Cat.NewTransaction("LoadDataSource", loadType.ToString());
                logger.Info("Load data source begin - " + loadType.ToString());

                try
                {
                    if (instance.names == null)
                        instance.names = instance.GetNames();

                    if (instance.names.Length > 0)
                    {
                        var coll = DataSourceProvider.GetProvider().GetConnectionStrings(instance.names);
                        DataSourceManager.AddConnectionStrings(coll);

                        string names = string.Join(",", DataSourceManager.GetAllNames());
                        Cat.LogEvent("LoadDataSource.Cache", "LoadDataSource.Cache.Entries", CatConstants.SUCCESS, names);
                        logger.Info("Data sources cached", names);
                    }

                    tran.Status = CatConstants.SUCCESS;
                }
                catch (Exception ex)
                {
                    var msg = "Error occured during loading data source.";
                    Cat.LogError(msg, ex);
                    tran.SetStatus(ex);
                    logger.Error(msg, ex);

                    if (loadType == LoadType.Initialize)
                        throw;
                }
                finally
                {
                    tran.Complete();
                    logger.Info("Load data source end.");
                    instance.timer.Change(ConfigHelper.UpdateInterval * 1000, Timeout.Infinite);
                }
            }
        }
        //public int NewNo { get; set; }

        // Display Info of the RFEM Objects on Panels
        // Parameters are separated by ";". The component split text can be used to break the string down into a list.
        public override string ToString()
        {
            return(string.Format($"RFEM-LineLoad;No:{No};LoadCase:{LoadCase};" +
                                 $"F1:{Magnitude1.ToString("0.00")}[kN/m]|[kN];F2:{Magnitude2.ToString("0.00")}[kN/m]|[m]|[-];F3:{Magnitude3.ToString("0.00")}[kN/m];" +
                                 $"t1:{DistanceA.ToString("0.00")}[-];t2:{DistanceB.ToString("0.00")}[-];" +
                                 $"OverTotalLength:{OverTotalLength.ToString()};RelativeDistances:{RelativeDistances.ToString()};" +
                                 $"LoadArray:{LoadArray.ToLabelString()}" +
                                 $"LoadType:{LoadType.ToString()};LoadDistType:{LoadDistType.ToString()};LoadDirType:{LoadDirType.ToString()};LoadRefType:{LoadRefType.ToString()};" +
                                 $"LineList:{((LineList == "") ? "-" : LineList)};IsValid:{IsValid};ID:{((ID == "") ? "-" : ID)};Tag:{((Tag == "") ? "-" : Tag)};" +
                                 $"ToModify:{ToModify};ToDelete:{ToDelete};Comment:{((Comment == "") ? "-" : Comment)};"));
        }
예제 #4
0
        ///	<summary>
        /// 从文件或者URL加载XML
        /// Easy way to load XML from a file or URL
        /// </summary>
        public bool LoadXML(string sourceXMLOrFile, LoadType loadType, Encoding encoding)
        {
            bool bLoadResult = false;

            try
            {
                switch (loadType)
                {
                    case LoadType.FromString:
                        m_xmlDocument.LoadXml(sourceXMLOrFile); // loading from source XML text
                        break;

                    case LoadType.FromLocalFile:
                        m_xmlDocument.Load(sourceXMLOrFile); // loading from a file
                        break;

                    case LoadType.FromURL:
                        {
                            string sURLContent = GetURLContent(sourceXMLOrFile, encoding);
                            m_xmlDocument.LoadXml(sURLContent);
                            break;
                        }

                    default:
                        string sErr = "Developer note:  No LoadType case supported for " + loadType.ToString();
                        throw (new Exception(sErr));
                }

                DoPostLoadCreateInit();

                bLoadResult = true;
            }
            catch (Exception e)
            {
                HandleException(e);
            }

            return bLoadResult;
        }
예제 #5
0
        private void SetResourceLoadType(LoadType loadType)
        {
            string fullName = m_SelectedResource.FullName;

            if (m_Controller.SetResourceLoadType(m_SelectedResource.Name, m_SelectedResource.Variant, loadType))
            {
                Debug.Log(Utility.Text.Format("Set resource '{0}' load type to '{1}' success.", fullName, loadType.ToString()));
            }
            else
            {
                Debug.LogWarning(Utility.Text.Format("Set resource '{0}' load type to '{1}' failure.", fullName, loadType.ToString()));
            }
        }
        public double GetEffectiveLength(double l_u, double d, LateralBracingCondition BracingConditition,
                                         SupportCondition Support, LoadType LoadType, int NumberOfLoads = 0)
        {
            double l_e = double.PositiveInfinity;

            //adjust values
            SupportCondition        bc = Support;
            LateralBracingCondition br = BracingConditition;
            int N = NumberOfLoads;

            if (bc == SupportCondition.Cantilever)
            {
                br = LateralBracingCondition.Unbraced;
            }
            if (bc == SupportCondition.SingleSpan)
            {
                if (LoadType == NDS2015.LoadType.UniformlyDistributed)
                {
                    br = LateralBracingCondition.Unbraced;
                }
                else
                {
                    if (br == LateralBracingCondition.Unbraced && N > 2)
                    {
                        N = 2;
                    }
                    else
                    {
                        if (N > 7)
                        {
                            N = 7;
                        }
                    }
                }
            }
            //Find value in table

            #region Read Effective Length Data

            var SampleValue = new
            { BC = "", LoadType = "", Br = "", N = 1,
              l_d_Less7_luFactor  = 0.0,
              l_d_Less7_dFactor   = 0.0,
              l_d_Less14_luFactor = 0.0,
              l_d_Less14_dFactor  = 0.0,
              l_d_More14_luFactor = 0.0,
              l_d_More14_dFactor  = 0.0 }; // sample
            var EffectiveLengthTableVals = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.NDS2015_Table3_3_3EffectiveLength))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Length == 10)
                    {
                        string _BC                  = Vals[0];
                        string _LoadType            = Vals[1];
                        string _Br                  = Vals[2];
                        int    _N                   = int.Parse(Vals[3]);
                        double _l_d_Less7_luFactor  = double.Parse(Vals[4]);
                        double _l_d_Less7_dFactor   = double.Parse(Vals[5]);
                        double _l_d_Less14_luFactor = double.Parse(Vals[6]);
                        double _l_d_Less14_dFactor  = double.Parse(Vals[7]);
                        double _l_d_More14_luFactor = double.Parse(Vals[8]);
                        double _l_d_More14_dFactor  = double.Parse(Vals[9]);

                        EffectiveLengthTableVals.Add
                            (new
                        {
                            BC                  = _BC,
                            LoadType            = _LoadType,
                            Br                  = _Br,
                            N                   = _N,
                            l_d_Less7_luFactor  = _l_d_Less7_luFactor,
                            l_d_Less7_dFactor   = _l_d_Less7_dFactor,
                            l_d_Less14_luFactor = _l_d_Less14_luFactor,
                            l_d_Less14_dFactor  = _l_d_Less14_dFactor,
                            l_d_More14_luFactor = _l_d_More14_luFactor,
                            l_d_More14_dFactor  = _l_d_More14_dFactor
                        }

                            );
                    }
                }
            }

            #endregion

            double lu_factor = 0.0;
            double dFactor   = 0.0;

            var EffectiveLengthEntryData = EffectiveLengthTableVals.First(l =>
                                                                          l.BC == bc.ToString() &&
                                                                          l.Br == br.ToString() &&
                                                                          l.LoadType == LoadType.ToString() &&
                                                                          l.N == NumberOfLoads);
            if (EffectiveLengthEntryData != null)
            {
                if (l_u / 4 < 7)
                {
                }
                else if (l_u <= 14.3)
                {
                }
                else
                {
                }
            }
            else
            {
                return(double.PositiveInfinity);
            }

            l_e = lu_factor * l_u + dFactor * d;

            return(l_e);
        }
예제 #7
0
        ///<summary>
        ///  从文件或者URL加载XML
        ///  Easy way to load XML from a file or URL
        ///</summary>
        public bool LoadXML(string sourceXMLOrFile, LoadType loadType, Encoding encoding)
        {
            bool bLoadResult = false;

            try
            {
                switch (loadType)
                {
                case LoadType.FromString:
                    m_xmlDocument.LoadXml(sourceXMLOrFile);     // loading from source XML text
                    break;

                case LoadType.FromLocalFile:
                    m_xmlDocument.Load(sourceXMLOrFile);     // loading from a file
                    break;

                case LoadType.FromURL:
                {
                    string sURLContent = GetURLContent(sourceXMLOrFile, encoding);
                    m_xmlDocument.LoadXml(sURLContent);
                    break;
                }

                default:
                    string sErr = "Developer note:  No LoadType case supported for " + loadType.ToString();
                    throw (new Exception(sErr));
                }

                DoPostLoadCreateInit();

                bLoadResult = true;
            }
            catch (Exception e)
            {
                HandleException(e);
            }

            return(bLoadResult);
        }
        /// <summary>
        /// 加载xml字符串或者文件到内存中
        /// </summary>
        /// <param name="sourceXMLOrFile">源xml</param>
        /// <param name="loadType">加载的方式,如FromString,FromLocalFile,FromURL</param>
        /// <returns>true,加载成功;false,加载失败。</returns>
        public bool LoadXML(string sourceXMLOrFile, LoadType loadType)
        {
            bool result = false;

            try
            {
                switch (loadType)
                {
                case LoadType.FromString:
                    //从字符串中加载xml文件
                    this.m_xmlDocument.LoadXml(sourceXMLOrFile);
                    break;

                case LoadType.FromLocalFile:
                    //从本地文件加载xml文件
                    this.m_xmlDocument.Load(sourceXMLOrFile);
                    break;

                case LoadType.FromURL:
                {
                    string sURLContent = this.GetURLContent(sourceXMLOrFile);
                    this.m_xmlDocument.LoadXml(sURLContent);
                    break;
                }

                default:
                    string sErr = "Developer note: No LoadType case supported for " + loadType.ToString();
                    throw (new Exception(sErr));
                }
                //创建XPathNavigator游标,并移动到根节点
                this.DoPostLoadCreateInit();
                result = true;
            }
            catch (Exception ex)
            {
                this.HandleException(ex);
            }

            return(result);
        }
예제 #9
0
        public double GetEffectiveLength(double l_u, double d, LateralBracingCondition BracingConditition,
            SupportCondition Support, LoadType LoadType, int NumberOfLoads = 0)
        {
            double l_e = double.PositiveInfinity;

            //adjust values
            SupportCondition bc = Support;
            LateralBracingCondition br = BracingConditition;
            int N = NumberOfLoads;

            if (bc == SupportCondition.Cantilever)
            {
                br = LateralBracingCondition.Unbraced;
            }
            if (bc == SupportCondition.SingleSpan)
            {
                if (LoadType ==  NDS2015.LoadType.UniformlyDistributed)
                {
                    br = LateralBracingCondition.Unbraced;
                }
                else
                {
                    if (br == LateralBracingCondition.Unbraced && N>2)
                    {
                        N = 2;
                    }
                    else
                    {
                        if (N>7)
                        {
                            N = 7;
                        }
                    }
                }
            }
            //Find value in table

            #region Read Effective Length Data

            var SampleValue = new 
            { BC = "", LoadType = "", Br = "", N=1,
                l_d_Less7_luFactor= 0.0,
                l_d_Less7_dFactor= 0.0, 
                l_d_Less14_luFactor = 0.0, 
                l_d_Less14_dFactor = 0.0,
                l_d_More14_luFactor = 0.0, 
                l_d_More14_dFactor = 0.0 
            }; // sample
            var EffectiveLengthTableVals = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.NDS2015_Table3_3_3EffectiveLength))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Length == 10)
                    {

                        string _BC =        Vals[0];
                        string _LoadType =  Vals[1];
                        string _Br =        Vals[2];
                        int _N =         int.Parse(Vals[3]);
                        double _l_d_Less7_luFactor  =double.Parse(Vals[4]);
                        double _l_d_Less7_dFactor = double.Parse(Vals[5]);
                        double _l_d_Less14_luFactor = double.Parse(Vals[6]);
                        double _l_d_Less14_dFactor = double.Parse(Vals[7]);
                        double _l_d_More14_luFactor = double.Parse(Vals[8]);
                        double _l_d_More14_dFactor  =double.Parse(Vals[9]);

                        EffectiveLengthTableVals.Add
                        (new
                            {
                                BC =        _BC ,        
                                LoadType =  _LoadType ,  
                                Br =        _Br ,
                                N=_N,
                                l_d_Less7_luFactor = _l_d_Less7_luFactor , 
                                l_d_Less7_dFactor  = _l_d_Less7_dFactor  , 
                                l_d_Less14_luFactor= _l_d_Less14_luFactor, 
                                l_d_Less14_dFactor = _l_d_Less14_dFactor , 
                                l_d_More14_luFactor= _l_d_More14_luFactor, 
                                l_d_More14_dFactor = _l_d_More14_dFactor  

                           }

                        );
                    }
                }

            }

            #endregion

            double lu_factor = 0.0;
            double dFactor = 0.0;

            var EffectiveLengthEntryData = EffectiveLengthTableVals.First(l => 
                l.BC==bc.ToString()
                && l.Br == br.ToString()
                && l.LoadType == LoadType.ToString()
                && l.N == NumberOfLoads);
                    if (EffectiveLengthEntryData != null)
                    {

                        if (l_u/4<7)
                        {
                           
                        }
                        else if (l_u<=14.3 )
                        {
                            
                        }
                        else
                        {

                        }
                    }
                    else
                    {
                        return double.PositiveInfinity;
                    }

                    l_e = lu_factor * l_u + dFactor * d;

                    return l_e;
        }