Exemplo n.º 1
0
        /// <summary>
        /// Gets the cases.
        /// </summary>
        public void FillCases()
        {
            if (_loadCombinations == null)
            {
                return;
            }
            _loadCombinations.GetCaseList(Name,
                                          out var caseComboTypes,
                                          out var caseComboNames,
                                          out var scaleFactors);

            for (int i = 0; i < scaleFactors.Length; i++)
            {
                switch (caseComboTypes[i])
                {
                case eCaseComboType.LoadCase:
                    LoadCase loadCase = LoadCase.Factory(caseComboNames[i]);
                    Cases.Add(new LoadTuple <LoadCase>(loadCase, scaleFactors[i]));
                    break;

                case eCaseComboType.LoadCombo:
                    LoadCombination loadCombo = Factory(caseComboNames[i]);
                    Combinations.Add(new LoadTuple <LoadCombination>(loadCombo, scaleFactors[i]));
                    break;

                default:
                    break;
                }
            }
        }
        /// <summary>
        /// Returns a new load combination class.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <param name="analyzer">The analyzer.</param>
        /// <param name="loadCases">The load cases.</param>
        /// <param name="loadCombinations">The load combinations.</param>
        /// <param name="uniqueName">Unique load combination name.</param>
        /// <returns>Steel.</returns>
        internal static LoadCombination Factory(
            ApiCSiApplication app,
            Analyzer analyzer,
            LoadCases loadCases,
            LoadCombinations loadCombinations,
            string uniqueName)
        {
            LoadCombination loadCombination = new LoadCombination(app, analyzer, loadCases, loadCombinations, uniqueName);

            loadCombination.FillData();

            return(loadCombination);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets all load combinations.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <returns>List&lt;LoadPattern&gt;.</returns>
        public static List <LoadCombination> GetAll()
        {
            List <LoadCombination> loadCombinations     = new List <LoadCombination>();
            List <string>          loadCombinationNames = GetNameList();

            foreach (var loadCombinationName in loadCombinationNames)
            {
                LoadCombination loadCombination = Factory(loadCombinationName);

                loadCombinations.Add(loadCombination);
            }

            return(loadCombinations);
        }
 /// <summary>
 /// Adds or modifies one response combination in the list of cases included in the load combination.
 /// </summary>
 /// <param name="loadCombination">The load combination included within the load combination.</param>
 /// <param name="scaleFactor">The scale factor multiplying the combination.</param>
 /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
 public void SetComboList(
     LoadCombination loadCombination,
     double scaleFactor)
 {
     _apiLoadCombinations.SetCaseList(Name, eCaseComboType.LoadCombo, loadCombination.Name, scaleFactor);
     if (Combinations.Any(c => c.Load == loadCombination))
     {
         var combinations = new List <LoadTuple <LoadCombination> >(Combinations.Where(c => c.Load == loadCombination));
         combinations[0].Scale = scaleFactor;
     }
     else
     {
         Combinations.Add(new LoadTuple <LoadCombination>(loadCombination, scaleFactor));
     }
 }
        /// <summary>
        /// Gets the cases.
        /// </summary>
        public void FillCases()
        {
            _cases = new List <LoadTuple <LoadCase> >();
            foreach (var caseName in CaseNames)
            {
                LoadCase loadCase = _loadCases.FillItem(caseName.Item1);
                _cases.Add(new LoadTuple <LoadCase>(loadCase, caseName.Item2));
            }

            _combinations = new List <LoadTuple <LoadCombination> >();
            foreach (var combinationName in CombinationNames)
            {
                LoadCombination loadCombo = _loadCombinations.FillItem(combinationName.Item1);
                _combinations.Add(new LoadTuple <LoadCombination>(loadCombo, combinationName.Item2));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Returns a new load combination class.
        /// </summary>
        /// <param name="uniqueName">Unique load combination name.</param>
        /// <returns>Steel.</returns>
        public static LoadCombination Factory(string uniqueName)
        {
            if (Registry.Materials.Keys.Contains(uniqueName))
            {
                return(Registry.LoadCombinations[uniqueName]);
            }

            LoadCombination loadCombination = new LoadCombination(uniqueName);

            if (_loadCombinations != null)
            {
                loadCombination.FillData();
            }
            Registry.LoadCombinations.Add(uniqueName, loadCombination);
            return(loadCombination);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Selects or deselects a load combination for deflection design.
        /// </summary>
        /// <param name="loadCombination">An existing load combination.</param>
        /// <param name="selectLoadCombination">True: The specified load combination is selected as a design combination for deflection design.
        /// False: The combination is not selected for deflection design.</param>
        /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
        private void set(LoadCombination loadCombination, bool selectLoadCombination)
        {
            _apiComboDeflection.SetComboDeflection(loadCombination.Name, selectLoadCombination);

            if (selectLoadCombination)
            {
                if (!CombinationNames.Contains(loadCombination.Name))
                {
                    CombinationNames.Add(loadCombination.Name);
                }
                if (!Combinations.Contains(loadCombination))
                {
                    _combinations.Add(loadCombination);
                }
            }
            else
            {
                CombinationNames.Remove(loadCombination.Name);
                _combinations.Remove(loadCombination);
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Removes the combination.
 /// </summary>
 /// <param name="loadCombination">The load combination.</param>
 public void Remove(LoadCombination loadCombination)
 {
     set(loadCombination, selectLoadCombination: false);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Adds the combination.
 /// </summary>
 /// <param name="loadCombination">The load combination.</param>
 public void Add(LoadCombination loadCombination)
 {
     set(loadCombination, selectLoadCombination: true);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Removes one load case or load combination from the list of cases included in the specified load combination.
 /// </summary>
 /// <param name="loadCombination">The load combination included within the load combination.</param>
 /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
 public void RemoveCombo(LoadCombination loadCombination)
 {
     _apiLoadCombinations?.DeleteCase(Name, eCaseComboType.LoadCombo, loadCombination.Name);
     CombinationNames.Remove(CombinationNames.FirstOrDefault(o => o.Item1 == loadCombination.Name));
     Combinations.Remove(Combinations.FirstOrDefault(o => o.Load == loadCombination));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Deletes one load case or load combination from the list of cases included in the specified load combination.
 /// </summary>
 /// <param name="loadCombination">The load combination included within the load combination.</param>
 /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
 public void DeleteCombo(LoadCombination loadCombination)
 {
     _loadCombinations?.DeleteCase(Name, eCaseComboType.LoadCombo, loadCombination.Name);
 }