Exemple #1
0
 /// <summary>
 /// Assignes the load group to the correct field depending on its type
 /// </summary>
 /// <param name="loadGroup"><see cref="LoadGroupBase">A specific load group instance, derived from LoadGroupBase</see></param>
 /// <param name="replaceExisting">True if the general load group already contains a specific load group</param>
 public void AddSpecificLoadGroup(LoadGroupBase loadGroup, bool replaceExisting)
 {
     if (loadGroup is LoadGroupPermanent)
     {
         if ((GetSpecificLoadGroup() == null) || replaceExisting)
         {
             this.ModelLoadGroupPermanent = (LoadGroupPermanent)loadGroup;
         }
         else
         {
             throw new System.ArgumentException("There already exists a specific load group in the general load group");
         }
     }
     else if (loadGroup is LoadGroupTemporary)
     {
         if ((GetSpecificLoadGroup() == null) || replaceExisting)
         {
             this.ModelLoadGroupTemporary = (LoadGroupTemporary)loadGroup;
         }
         else
         {
             throw new System.ArgumentException("Load group type not yet implemented");
         }
     }
 }
Exemple #2
0
        /// <summary>
        /// Gets the specific load group from one of the general load groups fields
        /// </summary>
        /// <returns></returns>
        public LoadGroupBase GetSpecificLoadGroup()
        {
            LoadGroupBase specificLoadGroup = null;

            if (ModelLoadGroupPermanent != null)
            {
                specificLoadGroup = ModelLoadGroupPermanent;
            }
            else if (ModelLoadGroupTemporary != null)
            {
                specificLoadGroup = ModelLoadGroupTemporary;
            }

            return(specificLoadGroup);
        }
Exemple #3
0
        /// <summary>
        /// Gets the load group type of the specific load group that the general load group owns
        /// </summary>
        /// <returns>The type pf the load group</returns>
        public ELoadGroupType GetLoadGroupType()
        {
            LoadGroupBase  specificLoadGroup = GetSpecificLoadGroup();
            ELoadGroupType type = ELoadGroupType.Permanent;

            if (specificLoadGroup is LoadGroupPermanent)
            {
                type = ELoadGroupType.Permanent;
            }
            else if (specificLoadGroup is LoadGroupTemporary)
            {
                type = ELoadGroupType.Temporary;
            }
            return(type);
        }
Exemple #4
0
 /// <summary>
 /// Public constructor.
 /// </summary>
 /// <param name="guid">LoadCase guid reference.</param>
 public ModelLoadCaseInGroup(System.Guid guid, LoadGroupBase parentLoadGroup)
 {
     this.Guid = guid;
     LoadGroup = parentLoadGroup;
 }
Exemple #5
0
 /// <summary>
 /// Public constructor
 /// </summary>
 /// <param name="LoadGroup">Specific load group object</param>
 public ModelGeneralLoadGroup(LoadGroupBase LoadGroup)
 {
     EntityCreated();
     AddSpecificLoadGroup(LoadGroup, false);
     Name = LoadGroup.Name;
 }