コード例 #1
0
 public static void getAffectingComponents(
     SystemComponent selectedComponent,
     List <SystemComponent> listOfAffectingComponents)
 {
     for (int index1 = 0; index1 < Tools.DataBase.Count; ++index1)
     {
         if (selectedComponent.getName() != Tools.DataBase[index1].getName())
         {
             for (int index2 = 0; index2 < Tools.DataBase[index1].getFaultsList().Count; ++index2)
             {
                 for (int index3 = 0; index3 < Tools.DataBase[index1].getFaultsList()[index2].getAffectedComponents().Count; ++index3)
                 {
                     if (selectedComponent.getName() == Tools.DataBase[index1].getFaultsList()[index2].getAffectedComponents()[index3].getName() && Tools.findComponentInListOfComponents(listOfAffectingComponents, Tools.DataBase[index1].getName()) == null)
                     {
                         listOfAffectingComponents.Add(Tools.DataBase[index1]);
                         if (!Tools.isComponentParentIsAlsoHisSon(Tools.DataBase[index1], selectedComponent))
                         {
                             Tools.getAffectingComponents(Tools.DataBase[index1], listOfAffectingComponents);
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
 public static void createAffectedComponentsList(
     SystemComponent selectedComponent,
     Fault selectedFault,
     List <SystemComponent> affectedComponents)
 {
     affectedComponents.Add(selectedComponent);
     Tools.getAffeectedComponents(selectedComponent.getName(), selectedFault, affectedComponents);
 }
コード例 #3
0
 public static void getAffeectedComponents(
     string selectedComponentName,
     Fault selectedFault,
     List <SystemComponent> affectedComponents)
 {
     for (int index1 = 0; index1 < selectedFault.getAffectedComponents().Count; ++index1)
     {
         SystemComponent affectedComponent = selectedFault.getAffectedComponents()[index1];
         if (affectedComponent.getName() != selectedComponentName && Tools.findComponentInListOfComponents(selectedFault.getAffectedComponents(), selectedComponentName) == null)
         {
             affectedComponents.Add(affectedComponent);
             for (int index2 = 0; index2 < affectedComponent.getFaultsList().Count; ++index2)
             {
                 Tools.getAffeectedComponents(affectedComponent.getName(), affectedComponent.getFaultsList()[index2], affectedComponents);
             }
         }
     }
 }
コード例 #4
0
 public static bool isComponentParentIsAlsoHisSon(
     SystemComponent parent,
     SystemComponent selectedComponent)
 {
     for (int index1 = 0; index1 < selectedComponent.getFaultsList().Count; ++index1)
     {
         for (int index2 = 0; index2 < selectedComponent.getFaultsList()[index1].getAffectedComponents().Count; ++index2)
         {
             if (parent.getName() == selectedComponent.getFaultsList()[index1].getAffectedComponents()[index2].getName())
             {
                 return(true);
             }
         }
     }
     return(false);
 }
コード例 #5
0
 public bool isEquals(SystemComponent component)
 {
     return(this.name == component.getName());
 }