Class ProcessSnapshot

java.lang.Object
neqsim.process.util.export.ProcessSnapshot
All Implemented Interfaces:
Serializable

public class ProcessSnapshot extends Object implements Serializable
Represents a snapshot of a process system state at a point in time.

Snapshots capture the complete state of measurement devices and key process variables, enabling checkpointing, comparison, and state restoration.

Version:
1.0
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • snapshotId

      private final String snapshotId
    • timestamp

      private final Instant timestamp
    • measurementValues

      private final Map<String,Double> measurementValues
    • measurementUnits

      private final Map<String,String> measurementUnits
    • additionalState

      private final Map<String,Object> additionalState
    • description

      private String description
  • Constructor Details

    • ProcessSnapshot

      public ProcessSnapshot(String snapshotId)
      Creates a new process snapshot.
      Parameters:
      snapshotId - unique identifier for this snapshot
    • ProcessSnapshot

      public ProcessSnapshot(String snapshotId, Instant timestamp)
      Creates a snapshot with a specific timestamp.
      Parameters:
      snapshotId - unique identifier
      timestamp - the snapshot timestamp
  • Method Details

    • setMeasurement

      public void setMeasurement(String name, double value, String unit)
      Stores a measurement value.
      Parameters:
      name - measurement name
      value - measurement value
      unit - measurement unit
    • getMeasurement

      public double getMeasurement(String name)
      Gets a measurement value.
      Parameters:
      name - measurement name
      Returns:
      the value or NaN if not found
    • getMeasurementUnit

      public String getMeasurementUnit(String name)
      Gets a measurement unit.
      Parameters:
      name - measurement name
      Returns:
      the unit or null if not found
    • getMeasurementNames

      public String[] getMeasurementNames()
      Gets all measurement names.
      Returns:
      array of measurement names
    • setState

      public void setState(String key, Object value)
      Stores additional state information.
      Parameters:
      key - state key
      value - state value
    • getState

      public Object getState(String key)
      Gets additional state information.
      Parameters:
      key - state key
      Returns:
      the value or null
    • getSnapshotId

      public String getSnapshotId()
      Gets the snapshot ID.
      Returns:
      snapshot ID
    • getTimestamp

      public Instant getTimestamp()
      Gets the snapshot timestamp.
      Returns:
      timestamp
    • getDescription

      public String getDescription()
      Gets the description.
      Returns:
      description or null
    • setDescription

      public void setDescription(String description)
      Sets the description.
      Parameters:
      description - snapshot description
    • getAllMeasurements

      public Map<String,Double> getAllMeasurements()
      Gets all measurements as a map.
      Returns:
      map of measurement names to values
    • diff

      public ProcessDelta diff(ProcessSnapshot other)
      Calculates the difference from another snapshot.
      Parameters:
      other - the other snapshot
      Returns:
      ProcessDelta representing the changes
    • toString

      public String toString()
      Overrides:
      toString in class Object