Class TorgManager

java.lang.Object
neqsim.process.mechanicaldesign.torg.TorgManager

public class TorgManager extends Object
Manager class for applying Technical Requirements Documents (TORG) to process systems.

The TorgManager provides methods to:

  • Load TORG documents from various data sources
  • Apply TORG requirements to individual equipment or entire process systems
  • Validate equipment designs against TORG specifications
  • Generate compliance reports

Example usage:

// Create TORG manager with CSV data source
TorgManager manager = new TorgManager();
manager.addDataSource(CsvTorgDataSource.fromResource("designdata/torg/projects.csv"));

// Load and apply TORG to process system
manager.loadAndApply("PROJECT-001", processSystem);

// Or manually create and apply a TORG
TechnicalRequirementsDocument torg =
    TechnicalRequirementsDocument.builder().projectId("MANUAL-001")
        .addStandard("pressure vessel design code", StandardType.ASME_VIII_DIV1).build();

manager.apply(torg, processSystem);
Version:
1.0
Author:
esol
  • Field Details

    • logger

      private static final org.apache.logging.log4j.Logger logger
    • dataSources

      private final List<TorgDataSource> dataSources
      Data sources for loading TORG documents.
    • activeTorg

      private TechnicalRequirementsDocument activeTorg
      Currently active TORG.
    • appliedStandards

      private final Map<String, List<StandardType>> appliedStandards
      Cache of applied standards per equipment.
  • Constructor Details

    • TorgManager

      public TorgManager()
      Create a new TorgManager with no data sources.
    • TorgManager

      public TorgManager(TorgDataSource dataSource)
      Create a TorgManager with a single data source.
      Parameters:
      dataSource - the data source to use
  • Method Details

    • addDataSource

      public TorgManager addDataSource(TorgDataSource dataSource)
      Add a data source for loading TORG documents.
      Parameters:
      dataSource - the data source to add
      Returns:
      this manager for chaining
    • load

      public Optional<TechnicalRequirementsDocument> load(String projectId)
      Load a TORG by project ID from the configured data sources.
      Parameters:
      projectId - the project identifier
      Returns:
      optional containing the TORG if found
    • load

      public Optional<TechnicalRequirementsDocument> load(String companyIdentifier, String projectName)
      Load a TORG by company and project name.
      Parameters:
      companyIdentifier - the company identifier
      projectName - the project name
      Returns:
      optional containing the TORG if found
    • loadAndApply

      public boolean loadAndApply(String projectId, ProcessSystem processSystem)
      Load a TORG and apply it to a process system.
      Parameters:
      projectId - the project identifier
      processSystem - the process system to configure
      Returns:
      true if TORG was found and applied
    • apply

      public void apply(TechnicalRequirementsDocument torg, ProcessSystem processSystem)
      Apply a TORG to a process system.

      This method iterates through all equipment in the process system and applies the appropriate design standards from the TORG based on equipment type.

      Parameters:
      torg - the TORG to apply
      processSystem - the process system to configure
    • applyToEquipment

      public void applyToEquipment(TechnicalRequirementsDocument torg, ProcessEquipmentInterface equipment)
      Apply a TORG to a single equipment item.
      Parameters:
      torg - the TORG to apply
      equipment - the equipment to configure
    • getActiveTorg

      public TechnicalRequirementsDocument getActiveTorg()
      Get the currently active TORG.
      Returns:
      the active TORG, or null if none
    • setActiveTorg

      public void setActiveTorg(TechnicalRequirementsDocument torg)
      Set the active TORG without applying it.
      Parameters:
      torg - the TORG to set as active
    • getAppliedStandards

      public List<StandardType> getAppliedStandards(String equipmentName)
      Get the standards that were applied to a specific equipment.
      Parameters:
      equipmentName - the equipment name
      Returns:
      list of applied standards, empty if none
    • getAllAppliedStandards

      public Map<String, List<StandardType>> getAllAppliedStandards()
      Get all applied standards across all equipment.
      Returns:
      map of equipment name to applied standards
    • getAvailableProjects

      public List<String> getAvailableProjects()
      Get a list of all available project IDs across all data sources.
      Returns:
      list of available project IDs
    • generateSummary

      public String generateSummary()
      Generate a summary report of applied standards.
      Returns:
      formatted summary string
    • reset

      public void reset()
      Clear all applied standards and reset the manager.