FlowToItem
Inherits from Object
Description
An object that converts FloWorks flow (continuous or bulk) into discrete FlexSim flow items.
Properties
flowControl | Gets or sets the Flow Control that manages the flow rates for this object. |
input | FlowObject.InputOutput object that allows access to FloWorks object's input ports. |
stats | Allows access to a FloWorks object's statistics. |
Methods
connect | Connect a FloWorks object to this object. |
impact | Applies an impact factor to the maximum input and/or output flow rate and waits for resume(). |
resume | Ends an impact factor event, which temporarily decreased or increased the maximum flow of a FloWorks object. |
stop | Applies an impact factor of zero to the maximum input and output flow rate, sets the FloWorks state of the object, and waits for resume(). |
Details
FlowToItem.flowControl
Object flowControl
Description
Gets or sets the Flow Control that manages the flow rates for this object.
The FlowControl is responsible for optimizing the flow through a network. Every object that is connected to the FlowControl is part of the network the FlowControl will optimize. Every flow object must be part of a FlowControl. The controller will calculate all rates throughout the network. After the flows have been established a new event will be created to recalculate the flow. This happens for instance when a tank becomes full or empty.
By requesting this property, you will get a reference to the Flow Control that currently manages this object.
By setting this property, you can change the Flow Control that manages the object. To disconnect the object from any flow networks, assign nullvar.
FlowToItem.input
FlowObject.InputOutput input
Description
FlowObject.InputOutput object that allows access to FloWorks object's input ports.
See the FlowObject.InputOutput documentation for more information.
FlowToItem.stats
readonly stats
Description
Allows access to a FloWorks object's statistics.
This property provides the following properties and methods:
input - returns the current cumulative inflow of the object.
output - returns the current discrete output statistic of the object.
utilization - returns the flow utilization of this object as a number between 0 and 1.
state(Variant& profile = nullvar) - returns a state tracked variable. If no profile argument is given, or if it is 1, then the default FloWorks state profile is returned. If the profile argument is equal to 0, the default FlexSim state profile is returned (note that most FloWorks objects do not use this). Other state profiles can be returned by providing the profile number or name.
// Get the state of a pump
FlowObject obj = model().find("FlowPump1");
int curState = obj.stats.state().value;
FlowToItem.connect()
void connect( FlowObject connectTo ) |
Parameters
connectTo | The object to connect to. |
Description
Connect a FloWorks object to this object.
In some models, you want to dynamically connect and disconnect ports.
After dynamically (i.e. during the model run, not before Reset) connecting or disconnecting ports a recalculation of the flow rates is required.
This recalculation is not triggered when you use the default FlexSim commands such as contextdragconnection.
Therefore FloWorks provides two commands: FlowObject.connect and FlowObject.(input/output).ports.disconnect .
FlowToItem.impact()
void impact( treenode eventObject , double impactFactor , int isInputInfluenced , int isOutputInfluenced , int flowState = 0 ) |
Parameters
eventObject | The event object that causes the impact. You must pass the same treenode to .resume() to end the event. |
impactFactor | The impact factor applied to the flow. Zero will stop all flow, an impact factor less than 1 will reduce the flow, and an impact factor greater than 1 will temporarily increase the maximum possible flow. |
isInputInfluenced | When non-zero, the impact factor will be applied to the maximum input flow. For non-content-holding objects, always use this parameter. |
isOutputInfluenced | For tanks, when non-zero, the impact factor will (also) be applied to the maximum outflow rate. |
flowState | The state to set on the FloWorks state profile while the impact factor is active (and not overridden by other events). |
Description
Applies an impact factor to the maximum input and/or output flow rate and waits for resume().
Start an impact factor event, which temporarily decreases or increases the maximum flow of a FloWorks object.
The impact factor event applies a multiplicative factor to the maximum flow rate, which can completely stop or reduce the flow because of a failure mode; but by setting a factor larger than 1 this function can also be used to model increased productivity due to e.g. seasonal fluctuations.
This function is called automatically from the "down" trigger of a FloWorks Impact Event, you do not usually need to call it manually.
FlowToItem.resume()
void resume( treenode eventObject ) |
Parameters
eventObject | The event object that caused the impact. You must pass the same event that was used in stop() to enable the impact factor. |
Description
Ends an impact factor event, which temporarily decreased or increased the maximum flow of a FloWorks object.
Ends an impact factor event, which temporarily decreased or increased the maximum flow of a FloWorks object.
The impact factor event applies a multiplicative factor to the maximum flow rate, which can completely stop or reduce the flow because of a failure mode; but by setting a factor larger than 1 this function can also be used to model increased productivity due to e.g. seasonal fluctuations.
This function is called automatically from the "up" trigger of a FloWorks Impact Event, you usually only need to call it manually if you explicitly used the .stop() command.
Note that multiple events may be active on a flow object at any time, and multiple flow objects may be impacted by an event, so you may need to call this command more than once.
FlowToItem.stop()
void stop( treenode eventObject , int flowState ) |
Parameters
eventObject | The event object that causes the impact. You must pass the same treenode to .resume() to end the event. |
flowState | The state to set on the FloWorks state profile while the impact factor is active (and not overridden by other events). |
Description
Applies an impact factor of zero to the maximum input and output flow rate, sets the FloWorks state of the object, and waits for resume().
Start an impact factor event, which temporarily stops all inflow and outflow of a FloWorks object.
This function is equivalent to calling FlowObject.impact(eventObject, 0, true, true, flowState).