FlowsheetBase Class

Abstract base class for all DWSIM flowsheet implementations. Provides core flowsheet functionality including simulation object management, property package handling, calculation orchestration, undo/redo, scripting, and XML serialization support.

Definition

Namespace: DWSIM.FlowsheetBase
Assembly: DWSIM.FlowsheetBase (in DWSIM.FlowsheetBase.dll) Version: 10.0.0.0
[ComVisibleAttribute(true)]
public abstract class FlowsheetBase : IFlowsheet, 
	IFlowsheetCalculationQueue
Inheritance
Object    FlowsheetBase
Derived
Implements
IFlowsheet, IFlowsheetCalculationQueue

Constructors

Properties

AvailableCompounds 
AvailableExternalUnitOperations 
AvailablePropertyPackagesGets or sets the dictionary of property packages available for selection in this flowsheet instance.
AvailableSimulationObjects 
AvailableSystemsOfUnitsGets or sets the list of unit-of-measure systems available for this flowsheet.
CalculationQueueGets or sets the FIFO queue of pending calculation requests consumed by the flowsheet solver.
Charts 
DynamicModeGets or sets a value indicating whether the flowsheet is operating in dynamic simulation mode.
DynamicsManagerGets or sets the dynamics manager responsible for dynamic simulation scheduling and event handling.
ErrorMessage 
ErrorMessagesGets or sets the list of exceptions raised during the last calculation pass.
ExternalSolvers 
ExternalUnitOperationsGets or sets the dictionary of external (plugin-defined) unit operations registered with this flowsheet.
ExtraPropertiesGets or sets a dynamic property bag for attaching arbitrary extra data to the flowsheet at runtime.
FileDatabaseProvider 
FilePathGets or sets the full file path of the simulation file on disk.
FlowsheetOptionsGets the flowsheet configuration options (units, compounds, property packages, solver settings).
GHGEmissionCompositionsGets or sets the dictionary of GHG emission compositions associated with streams in this flowsheet.
GraphicObjectsGets or sets the dictionary of all graphic objects currently placed on the flowsheet surface, keyed by unique ID.
InternalUnitOperationsGets or sets the dictionary of internal unit operations registered with this flowsheet.
LastSuccessfulSolutionState 
MasterFlowsheet 
MasterUnitOp 
Message 
MessagesLogGets or sets the list of informational and diagnostic messages generated during simulation.
MobileCompatibilityMode 
Options 
ParticleSizeDistributions 
PropertyPackagesGets or sets the dictionary of property packages attached to this flowsheet, keyed by unique ID.
PythonPreprocessor 
ReactionsGets or sets the dictionary of reactions defined for this flowsheet, keyed by unique ID.
ReactionSetsGets or sets the dictionary of reaction sets (groups of reactions) defined for this flowsheet, keyed by name.
RedirectMessagesGets or sets a value indicating whether flowsheet messages should be redirected to an external listener instead of the UI log.
Results 
ScriptKeywordsFGets or sets custom script keyword definitions for flowsheet-level scripts.
ScriptKeywordsUGets or sets custom script keyword definitions for user-defined unit operation scripts.
Scripts 
SelectedCompoundsGets or sets the ordered dictionary of compounds currently selected for this flowsheet, sorted according to the configured ordering mode.
SimulationObjectsGets or sets the dictionary of all simulation objects in this flowsheet, keyed by unique ID.
Solved 
StoredSolutions 
SupressDataLoadingGets or sets a value indicating whether data loading is suppressed during deserialization.
SupressMessages 
UtilityPlugins 
WatchItems 
WeatherProviderGets or sets the weather data provider used for ambient condition lookups.

Methods

AddCompound 
AddCompoundsToMaterialStream Adds all compounds currently selected in the flowsheet to all phases of the given material stream, then equalises the overall composition and recalculates mass fractions.
AddConnectedObjects Automatically creates and connects material/energy streams around the specified object according to the given scheme.
AddDefaultProperties 
AddExternalUOs 
AddFlowsheetObjectCreates a simulation object by type name at the default position (50, 50) and assigns the given object name.
AddGraphicObjectAdds a graphic object to both the drawing surface and the GraphicObjects dictionary.
AddGraphicObjects 
AddObject(ObjectType, Int32, Int32, String)Creates a simulation object of the specified type, places its graphic on the surface, and returns the new object.
AddObject(ObjectType, Int32, Int32, String, String)Creates a simulation object with an explicit ID, places its graphic on the surface, and returns the new object.
AddObject(String, Int32, Int32, String, String, Boolean) Creates a simulation object identified by its human-readable type name and places it on the flowsheet surface.
AddObjectToSurface Low-level method that instantiates the graphic and simulation objects for a given ObjectType, adds them to the drawing surface and the SimulationObjects dictionary, and returns the new object's ID.
AddPropertyPackageRegisters a property package with the flowsheet, assigning a unique ID and tag if not already set.
AddPropPacks 
AddReaction 
AddReactionSet 
AddReactionToSet 
AddSimulationObjectAdds a simulation object directly to the SimulationObjects dictionary without creating a graphic counterpart.
AddSimulationObjects 
AddSystemsOfUnits 
AddTables 
AddUndoRedoAction 
AutoLayout 
CalcReactionStoichiometry 
ChangeCalculationOrder 
CheckStatusChecks whether the flowsheet solver should pause or abort the current calculation, e.g. on user request.
CheckTag 
ClearLog 
Clone 
CloseOpenEditFormsCloses all currently open property editors. Must be implemented by the concrete host.
Connect Connects two simulation objects. If both are unit operations, an intermediate material stream is created automatically and positioned between them.
ConnectObject 
ConnectObjectsConnects two graphic objects via their connector ports and registers an undo snapshot.
CopyObjects 
CreateAndAddPropertyPackage 
CreateConversionReaction Creates a conversion reaction
CreateEquilibriumReaction Creates an equilibrium reaction
CreateHetCatReaction creates a heterogeneous catalytic reaction
CreateKineticReaction creates a kinetic reaction
CreatePropertyPackage 
CreateReactionSet 
CutObjects 
DeleteObject 
DeleteSelectedObject Removes a graphic object and its associated simulation object from the flowsheet, automatically disconnecting all attached connectors and cleaning up spec/adjust references.
DisconnectDisconnects two previously connected simulation objects via their graphic representations.
DisconnectObjectsDisconnects two previously connected graphic objects and registers an undo snapshot.
DisplayBrowserWindow 
DisplayDockableBrowserWindow 
DisplayFormDisplays a form or panel within the flowsheet's docking area. Must be implemented by the concrete UI host.
GetApplicationObject 
GetAvailableFlowsheetObjectTypeNamesReturns a sorted array of all built-in flowsheet object type names that can be passed to AddObject(String, Int32, Int32, String, String, Boolean).
GetAvailablePropertyPackages 
GetCompound 
GetDockPanel 
GetFlowsheetBag 
GetFlowsheetGraphicObjectReturns the graphic object whose user-visible tag matches the specified value.
GetFlowsheetSimulationObjectReturns the simulation object whose user-visible tag matches the specified value.
GetFlowsheetSurfaceHeight 
GetFlowsheetSurfaceWidth 
GetNewInstanceCreates and returns a new empty flowsheet instance of the same concrete type.
GetObject 
GetProcessData 
GetPropertyPackage 
GetPropertyPackages 
GetReaction 
GetReactionSet 
GetResultIDs 
GetResultUnits 
GetResultValue 
GetScriptText 
GetSelectedFlowsheetSimulationObject Returns the currently selected simulation object, or searches by tag if one is provided.
GetSimulationFileDirectory 
GetSimulationFilePath 
GetSnapshot 
GetSnapshotObjectID 
GetSpreadsheetData 
GetSpreadsheetFormat 
GetSpreadsheetObject 
GetSurfaceReturns the underlying GraphicsSurface used for drawing and hit-testing flowsheet objects.
GetSurfaceControlReturns the UI control that hosts the drawing surface, or Nothing in non-UI contexts.
GetTranslatedString(String) Looks up a localised string by key, searching flowsheet string resources first, then property name resources. Falls back to the original key if no translation is found.
GetTranslatedString(String, String)Overload that ignores locale and delegates to GetTranslatedString(String).
GetUtility 
Initialize 
IsZipFilePasswordProtected 
LoadExtenders 
LoadFromExtensionsFolder 
LoadFromMXML 
LoadFromXML 
LoadProcessData 
LoadZippedXML 
LoadZippedXMLDoc 
NaturalLayout 
PasteObjects 
ProcessRedo 
ProcessScripts 
ProcessUndo 
RefreshInterface 
RegisterSnapshot 
ReleaseResources 
RequestCalculation Requests a flowsheet calculation, optionally scoped to a single changed object. When sender is provided the object is queued and the solver runs asynchronously.
RequestCalculation2Requests a full flowsheet calculation, optionally blocking the calling thread until it completes.
RequestCalculation3Requests a calculation scoped to a single object, or a full solve when Obj is Nothing.
RequestCalculationAndWaitRuns a full flowsheet calculation synchronously and returns any exceptions raised during the solve.
RequestSave 
RequestSaveWithDirectory 
RequestSaveWithPath 
Reset 
ResetCalculationStatusMarks all simulation objects as dirty and uncalculated, forcing a full recalculation on the next solve request.
RestoreLastSuccessfulSolutionState 
RestoreSnapshot 
RunCodeOnUIThread 
RunCodeOnUIThread2 
RunScript 
RunScript_IronPython 
RunScript_PythonNET 
RunScriptAsync 
SaveCurrentStateAsLastSuccessfulSolution 
SavePFDScreenshotToPNG 
SaveToMXML 
SaveToXML 
SetDirtyStatus 
SetMessageListener 
SetPropertyResourcesManagerSets the resource manager used for resolving localised property names in this flowsheet.
SetResourcesManagerSets the resource manager used for resolving localised strings in this flowsheet.
SetTranslateTextExternalFunction 
ShowDebugInfoWrites a debug message at the specified verbosity level to the diagnostic output. Must be implemented by the concrete host.
ShowMessageDisplays a message to the user via the log panel or equivalent output. Must be implemented by the concrete host.
SolveRequests a full flowsheet calculation using the configured solver mode.
ToggleFlowsheetAnimation 
TriggerNewDataLoadedEvent Raises the new-data-loaded event. Override in derived classes to update the UI after data changes.
UnloadExtenders 
UpdateInformation 
UpdateInterface 
UpdateMassAndEnergyBalance 
UpdateOpenEditFormsRefreshes all open property editors to reflect the current state of simulation objects. Must be implemented by the concrete host.
UpdateSpreadsheet 
WriteSpreadsheetVariables 

Events

FlowsheetLoadedFromXMLRaised after the flowsheet state has been successfully deserialized from XML.
FlowsheetLoadingFromXMLRaised just before the flowsheet state is deserialized from XML.
FlowsheetSavedToXMLRaised after the flowsheet state has been successfully serialized to XML.
FlowsheetSavingToXMLRaised just before the flowsheet state is serialized to XML.

Fields

_translatefunctionOptional translation function used to localize strings returned by GetTranslatedString(String).
AvailablePropPacks 
ExtendersShared list of extender collections that add custom menu items or initialization scripts to flowsheet windows.
FlowsheetSurface 
GetSpreadsheetObjectFuncFunction that returns the active spreadsheet object for scripting access.
loaded 
LoadSpreadsheetDataDelegate invoked to load spreadsheet data from the simulation XML document.
ObjectList 
OptimizationCollectionCollection of optimization cases defined for this flowsheet.
prm 
RedoStackStack of serialized snapshots used to support redo operations.
RetrieveSpreadsheetDataFunction that retrieves cell values from the spreadsheet by range address.
RetrieveSpreadsheetFormatFunction that retrieves cell formatting information from the spreadsheet by range address.
rm 
SaveSpreadsheetDataDelegate invoked to load spreadsheet data from the simulation XML document.
SensAnalysisCollectionCollection of sensitivity analysis cases defined for this flowsheet.
UndoStackStack of serialized snapshots used to support undo operations.

Extension Methods

GetEnumNames
(Defined by General)
IsValidDouble
(Defined by General)

Explicit Interface Implementations

See Also