document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. private void InterpretPointFeature(IFeature pFea, int traceWeighFI)
  2. {
  3.     // Create the listItem and add the class name and OID
  4.     IDataset pDS = (IDataset)pFea.Class;
  5.     ListViewItem pLI = lvwDevices.Items.Add(pDS.Name);
  6.     pLI.UseItemStyleForSubItems = false;
  7.     if (pFea.HasOID == true)
  8.         pLI.SubItems.Add(Convert.ToString(pFea.OID));
  9.     else
  10.         pLI.SubItems.Add("No OID");
  11.  
  12.     // get the trace weight value
  13.     object rawValue = pFea.get_Value(traceWeighFI);
  14.     if (DBNull.Value.Equals(rawValue) == true)
  15.     {
  16.         AddListSubItem(pLI,"<Null>", Color.Black);
  17.         return;
  18.     }
  19.     int traceWeight = Convert.ToInt32(rawValue);
  20.     AddListSubItem(pLI, Convert.ToString(traceWeight), Color.Black);
  21.  
  22.     // Bit 30 - Normal Position
  23.     if (IsBitSet(traceWeight, 30))
  24.         AddListSubItem(pLI, "Closed", Color.Red);
  25.     else
  26.         AddListSubItem(pLI, "Open", Color.Green);
  27.  
  28.     // Bit 29 - Is Valve
  29.     if (IsBitSet(traceWeight, 29))
  30.         AddListSubItem(pLI, "Yes", Color.Green);
  31.     else
  32.         AddListSubItem(pLI, "No", Color.Red);
  33.  
  34.     // Bit 28 - Is Critical Valve
  35.     if (IsBitSet(traceWeight, 28))
  36.         AddListSubItem(pLI, "Yes", Color.Green);
  37.     else
  38.         AddListSubItem(pLI, "No", Color.Red);
  39.  
  40.     //// Bit 27 - Is Non-Controllable Fitting
  41.     if (IsBitSet(traceWeight, 27))
  42.         AddListSubItem(pLI, "Yes", Color.Green);
  43.     else
  44.         AddListSubItem(pLI, "No", Color.Red);
  45.  
  46.     //// Bit 26 - Is Controllable Fitting
  47.     if (IsBitSet(traceWeight, 26))
  48.         AddListSubItem(pLI, "Yes", Color.Green);
  49.     else
  50.         AddListSubItem(pLI, "No", Color.Red);
  51.  
  52.     // Bit 25 - Is Rectifier
  53.     if (IsBitSet(traceWeight, 25))
  54.         AddListSubItem(pLI, "Yes", Color.Green);
  55.     else
  56.         AddListSubItem(pLI, "No", Color.Red);
  57.  
  58.     //// Bit 21 - Is TBS?
  59.     if (IsBitSet(traceWeight, 21))
  60.         AddListSubItem(pLI, "Yes", Color.Green);
  61.     else
  62.         AddListSubItem(pLI, "No", Color.Red);
  63.  
  64.     //// Bit 20 - Is Regulator
  65.     if (IsBitSet(traceWeight, 20))
  66.         AddListSubItem(pLI, "Yes", Color.Green);
  67.     else
  68.         AddListSubItem(pLI, "No", Color.Red);
  69.  
  70.     //// Bit 19 - Is CP Barrier
  71.     if (IsBitSet(traceWeight, 19))
  72.         AddListSubItem(pLI, "Yes", Color.Green);
  73.     else
  74.         AddListSubItem(pLI, "No", Color.Red);
  75.  
  76.     //// Bit 18 - Is Gas System Boundary
  77.     if (IsBitSet(traceWeight, 18))
  78.         AddListSubItem(pLI, "Yes", Color.Green);
  79.     else
  80.         AddListSubItem(pLI, "No", Color.Red);
  81.  
  82.     //// Bit 17 - Is Gas Pressure System Boundary
  83.     if (IsBitSet(traceWeight, 17))
  84.         AddListSubItem(pLI, "Yes", Color.Green);
  85.     else
  86.         AddListSubItem(pLI, "No", Color.Red);
  87.  
  88.     //// Bit 16 - Is Emergency Isolation System Boundary
  89.     if (IsBitSet(traceWeight, 16))
  90.         AddListSubItem(pLI, "Yes", Color.Green);
  91.     else
  92.         AddListSubItem(pLI, "No", Color.Red);
  93. }
');