Click or drag to resize

SimulationWorker Class

Simulation worker is a class that performs the actual simulation, by using the IMike1DController. It handles special log file writing, html summery/error, apv files. It also takes care of running any autocalibration before the actual simulation.

Special behavior can be specified in the SimulationParameters.

Inheritance Hierarchy
SystemObject
  DHI.Mike1D.SimLauncherSimulationWorker

Namespace:  DHI.Mike1D.SimLauncher
Assembly:  DHI.Mike1D.SimLauncher (in DHI.Mike1D.SimLauncher.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public class SimulationWorker

The SimulationWorker type exposes the following members.

Constructors
  NameDescription
Public methodSimulationWorker
Constructor. If form is null, then the simulation run in silent mode (no GUI output)
Top
Properties
  NameDescription
Public propertyController
Controller that the worker is currently working on.
Public propertyDiagnosticsHandler
Diagnostics handler that are used for all diagnostics objects and events.
Public propertyHtmlErrorLog
Public propertyHtmlSummary
Public propertyMike1DData
Public propertyNumberOfRuns
Number of consecutive runs to complete when the user chooses to re-run the calculation. Only relevant for Pipe Design simulations. Default value is 1.
Public propertySetupFilePath
Path of setup file
Public propertySimulationParameters
Simulation parameters
Public propertyWorkerThread
Top
Methods
  NameDescription
Public methodStatic memberCreateSetupfilenameWithID
Create a setup file name including the id provided.
Public methodDispose
Releases all resources used by the SimulationWorker
Public methodStatic memberDrawTextProgressBar
Draw a progress bar at the current cursor position. Be careful not to Console.WriteLine or anything whilst using this to show progress!
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFlipPauseFlag
Flip the Pause flag, i.e. if running, make it pause, if paused, make it run.
Public methodStatic memberGetDefaultLogFileName
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodLoad
Load the setup
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberModifySetupfilepathWithID
Modify the setup file path to include the id.
Public methodRun
Public methodStatic memberRunXmlCompare
Run compare on original mike1d data object and an object loaded from xml.
Public methodStartWorkInBackground
Calling this method will load and run the simulation (call Work) in a background thread
Public methodStopSimulation
Stop the simulation. The simulation will end when the current time step has been completed.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWork
Public methodWriteHtmlSummary
Top
Events
  NameDescription
Public eventControllerEvent
Event that is raised while the controller is running. It is raised whenever the state of the controller changes.

This is a shortcut for registering for the ControllerEvent. The sender of the event is the IMike1DController that triggered the event.

Note that some simulation types use more than one controller, and the same set of events will be triggered several times.

Public eventErrorEvent
Event triggered in case an error occured. This will also be triggered before an exception is thrown.
Public eventNewControllerEvent
Event triggered when a new controller is created. This can be used to retrieve and connect to the latest controller by using the Controller property
Public eventSetupLoadedEvent
Event triggered when a setup has been loaded
Public eventSetupLoadingEvent
Event triggered when a setup starts loading
Public eventSimulationDoneEvent
Event triggered when the simulation is done
Public eventSimulationPauseEvent
Event triggered in case the simulation has been paused.
Top
Fields
  NameDescription
Public fieldStatic memberDateTimeFormatString
Date time format used for log files and GUI.
Top
See Also