/// <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"); } } }
/// <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); }
/// <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); }
/// <summary> /// Public constructor. /// </summary> /// <param name="guid">LoadCase guid reference.</param> public ModelLoadCaseInGroup(System.Guid guid, LoadGroupBase parentLoadGroup) { this.Guid = guid; LoadGroup = parentLoadGroup; }
/// <summary> /// Public constructor /// </summary> /// <param name="LoadGroup">Specific load group object</param> public ModelGeneralLoadGroup(LoadGroupBase LoadGroup) { EntityCreated(); AddSpecificLoadGroup(LoadGroup, false); Name = LoadGroup.Name; }