Пример #1
0
        void TestLoopCircuit(StartElementData data, Action <List <Element> > totalElments = null)
        {
            ClearErrorListView();

            MtTravelsalTree tree = new MtTravelsalTree(m_uIDocument.Document, data.System);
            List <Element>  eles = tree.TestCircuit(data.StartElement, m_isSameSystem, m_multiSystem, IsIsolatedElements, totalElments);

            if (eles != null && eles.Count != 0)
            {
                foreach (var ele in eles)
                {
                    AddListViewErrorData(ele, MtCommon.GetStringValue(ErrorType.Circuit));
                }
            }
            IList <PipeRelationError> pipeRelationErrors = m_dicPipeRelationError.Select(v => v.Value).ToList();

            pipeRelationErrors = pipeRelationErrors.OrderBy(v => (v.FamilyName + v.TypeName)).ToList();
            SetErrorListView(pipeRelationErrors);
        }
Пример #2
0
 public void OnTraversalTree(StartElementData data, bool isSaveIntoDB = true)
 {
     try {
         MtTravelsalTree tree = new MtTravelsalTree(m_uIDocument.Document, data.System);
         tree.TraversePipe(data.StartElement, m_isSameSystem, m_multiSystem);
         if (isSaveIntoDB)
         {
             string colName = string.Join(",", new string[] { m_systemName, m_subsystemName, m_tunnelName, m_tableName, m_columnName });
             tree.SaveIntoDB(m_dbfilepath, colName, m_isPositiveDir, m_isWaterReturnPipe);
             if (tree.IsHide)
             {
                 Document doc = m_uIDocument.Document;
                 tree.HideTraverseElement(doc);
             }
         }
         else
         {
             Document doc = m_uIDocument.Document;
             tree.HideTraverseElement(doc);
         }
     } catch (Exception) {
         TaskDialog.Show("Error", "不明所以!");
     }
 }