WSBaselineObject
Methods for Baseline and Live Data Configuration.
Methods:
create_run_info
#create_run_info(start_time, duration, name, comment) ⇒ Integer
EXCHANGE, UI
Creates a new IWLive Run Info object. A new group is also created if required.
Parameters
| Name | Type(s) | Description |
|---|---|---|
| start_time | DateTime | The simulation start time |
| duration | Float | Duration in days |
| name | String | The run name |
| comment | String | Comment |
| Return | Integer | The IWLive Run Info ID |
set_default_sim_id
#set_default_sim_id(id) ⇒ nil
EXCHANGE, UI
Sets the default simulation in the Baseline.
Parameters
| Name | Type(s) | Description |
|---|---|---|
| id | Integer | The Simulation ID |
| Return | nil |
set_live_data_id
#set_live_data_id (id, commit) ⇒ nil
EXCHANGE, UI
Sets the live data configuration in the Baseline.
Parameters
| Name | Type(s) | Description |
|---|---|---|
| id | Integer | The Live Data Configuration ID |
| commit | Integer | The commit for the live data configuration |
| Return | nil |
update_control
#update_control(run_info_id, control_id) ⇒ Boolean
EXCHANGE, UI
Updates a Control from the live data stored in the IWLive Run Info object.
Parameters
| Name | Type(s) | Description |
|---|---|---|
| run_info_id | Integer | The IWLive Run Info ID |
| control_id | Integer | The Control ID |
| Return | Boolean | True if successful |
update_from_live_data
#update_from_live_data(run_info_id) ⇒ Boolean
EXCHANGE, UI
Updates the IWLive Run Info object from live data.
Parameters
| Name | Type(s) | Description |
|---|---|---|
| run_info_id | Integer | The IWLive Run Info ID |
| Return | Boolean | True if successful , false if failed |
Example
Here is an example of using the Baseline functions:
require 'date'
iwdb = WSApplication.open
baseline=iwdb.model_object_from_type_and_id('Baseline', 35)
baseline.set_live_data_id(36, 2)
baseline.set_default_sim_id(34)
run_info_id = baseline.create_run_info(DateTime.new(1998,10,1), 1.0, 'My Run Info', 'My Comment')
baseline.update_from_live_data(run_info_id)
baseline.update_control(run_info_id, 8)
