public static void WriteMechanicalSystem(MechanicalSystem system) { string flow = InvalidString; try { flow = system.GetFlow().ToString(); } catch (Exception) { } Trace.WriteLine("Flow: " + flow); Trace.WriteLine("IsWellConnected: " + system.IsWellConnected); Trace.WriteLine("SystemType: " + system.SystemType); Trace.WriteLine("+DuctNetwork"); Trace.Indent(); foreach (Element element in system.DuctNetwork) { LogUtility.WriteElement(element, false); Trace.WriteLine(""); } Trace.Unindent(); WriteMEPSystem(system); }
private void Stream( ArrayList data, MechanicalSystem mechSys ) { data.Add( new Snoop.Data.ClassSeparator( typeof( MechanicalSystem ) ) ); data.Add( new Snoop.Data.Object( "Base equipment connector", mechSys.BaseEquipmentConnector ) ); data.Add( new Snoop.Data.Enumerable( "Duct network", mechSys.DuctNetwork ) ); data.Add( new Snoop.Data.Double( "Flow", mechSys.GetFlow() ) ); data.Add( new Snoop.Data.Bool( "Is well connected", mechSys.IsWellConnected ) ); data.Add( new Snoop.Data.Double( "Static pressure", mechSys.GetStaticPressure() ) ); data.Add( new Snoop.Data.String( "System type", mechSys.SystemType.ToString() ) ); }
/// <summary> /// Write basic information of the MEP system into the XML file /// </summary> /// <param name="writer">XMLWriter object</param> private void WriteBasicInfo(XmlWriter writer) { MechanicalSystem ms = null; PipingSystem ps = null; if (m_isMechanicalSystem) { ms = m_system as MechanicalSystem; } else { ps = m_system as PipingSystem; } // Write basic information of the system writer.WriteStartElement("BasicInformation"); // Write Name property writer.WriteStartElement("Name"); writer.WriteString(m_system.Name); writer.WriteEndElement(); // Write Id property writer.WriteStartElement("Id"); writer.WriteValue(m_system.Id.ToString()); writer.WriteEndElement(); // Write UniqueId property writer.WriteStartElement("UniqueId"); writer.WriteString(m_system.UniqueId); writer.WriteEndElement(); // Write SystemType property writer.WriteStartElement("SystemType"); if (m_isMechanicalSystem) { writer.WriteString(ms.SystemType.ToString()); } else { writer.WriteString(ps.SystemType.ToString()); } writer.WriteEndElement(); // Write Category property writer.WriteStartElement("Category"); writer.WriteAttributeString("Id", m_system.Category.Id.ToString()); writer.WriteAttributeString("Name", m_system.Category.Name); writer.WriteEndElement(); // Write IsWellConnected property writer.WriteStartElement("IsWellConnected"); if (m_isMechanicalSystem) { writer.WriteValue(ms.IsWellConnected); } else { writer.WriteValue(ps.IsWellConnected); } writer.WriteEndElement(); // Write HasBaseEquipment property writer.WriteStartElement("HasBaseEquipment"); bool hasBaseEquipment = ((m_system.BaseEquipment == null) ? false : true); writer.WriteValue(hasBaseEquipment); writer.WriteEndElement(); // Write TerminalElementsCount property writer.WriteStartElement("TerminalElementsCount"); writer.WriteValue(m_system.Elements.Size); writer.WriteEndElement(); // Write Flow property writer.WriteStartElement("Flow"); if (m_isMechanicalSystem) { writer.WriteValue(ms.GetFlow()); } else { writer.WriteValue(ps.GetFlow()); } writer.WriteEndElement(); // Close basic information writer.WriteEndElement(); }