File

src/app/services/model-run.service.ts

Description

Interface with SWIM model execution services.

Index

Properties
Methods

Constructor

constructor(http: HttpClient, http2: HttpClient, handler: HttpBackend, router: Router, loggerService: LoggerService, locale: string, errorHandler: ErrorHandlerService)

Class constructor uses http client class

Parameters :
Name Type Optional
http HttpClient No
http2 HttpClient No
handler HttpBackend No
router Router No
loggerService LoggerService No
locale string No
errorHandler ErrorHandlerService No

Methods

appendScenarioTheme
appendScenarioTheme(themeID: string)

Append the scenario themes selected for this run

Parameters :
Name Type Optional Description
themeID string No

unique theme identier

Returns : void
getAppendableInputList
getAppendableInputList(units: string)

Get model inputs filtered by units

Parameters :
Name Type Optional Description
units string No

units to filter the inputs by

Returns : {}
getAppendableList
getAppendableList(units: string, exclude: string)

Get model outputs filtered by units, excuding one of the outputs

Parameters :
Name Type Optional Description
units string No

units to filter the outputs by

exclude string No

the output to exclude from the list

Returns : {}
getModelID
getModelID()

Get the id of the currently loaded model

Returns : any

the id of the current model

getProjectionStart
getProjectionStart()

returns start date of projection included in the user scenario spec. To use on output details

Returns : any
getProjectionStartInner
getProjectionStartInner()

returns the start date of projection locally set on the service, not on the scenario spec before the run. To use on theme learn more and input details.

Returns : string
getScenarioDescription
getScenarioDescription()

Gets current user scenario description text

Returns : string
getScenarioID
getScenarioID()

Get the id of the executed user scenario

Returns : any

the id of the current executed scenario

getScenarioName
getScenarioName()

Get the name of the scenario

Returns : any
getScenarioThemes
getScenarioThemes()

Returns list of scenario themes linked to this model

Returns : {}
getScenarioUpdateListener
getScenarioUpdateListener()

Scenario update observable object

Returns : any

observable scenario updated object

getToolStatus
getToolStatus()

Returns the dynamic tool status

Returns : boolean
getUserRole
getUserRole()

gets the role of the user

Returns : string
modelServicePing
modelServicePing(modelID: string)

Ping a model service

Parameters :
Name Type Optional Description
modelID string No

model unique identifier

Returns : void
resetScenarioDescription
resetScenarioDescription()
Returns : void
setProjectionStart
setProjectionStart(start: string)

set projection start date

Parameters :
Name Type Optional
start string No
Returns : void
setScenarioDescription
setScenarioDescription(description: string)

Sets user scenario description

Parameters :
Name Type Optional Description
description string No

description text

Returns : void
setToolStatus
setToolStatus(hide: boolean)

Hide or show flag for dynamic tools on the output details

Parameters :
Name Type Optional Description
hide boolean No

if the tools should be hidden or not

Returns : void
setUserRole
setUserRole(role: string)

sets the role of the user

Parameters :
Name Type Optional Description
role string No

role string

Returns : void
submitModelScenario
submitModelScenario(modelScenario: UserScenario)

Submits a model scenario for execution Local Development: http://localhost:9280/runmodel --> Scilab Service http://localhost:9179/user-scenario-input --> GAMS Service

Testing Server: https://services.cybershare.utep.edu/swim-scilab/runmodel/ --> Scilab Service https://services.cybershare.utep.edu/water/distribuitor/ --> GAMS Service

Parameters :
Name Type Optional Description
modelScenario UserScenario No

scenario specification object Local Development: http://localhost:9280/runmodel --> Scilab Service http://localhost:9179/user-scenario-input --> GAMS Service

Testing Server: https://services.cybershare.utep.edu/swim-scilab/runmodel/ --> Scilab Service https://services.cybershare.utep.edu/water/distribuitor/ --> GAMS Service

Returns : void
updateModelDescription
updateModelDescription(description: string)

Update the model scenario description

Parameters :
Name Type Optional Description
description string No

description to append

Returns : void
updateModelScenario
updateModelScenario(scenario: UserScenario)

Update the model scenario without triggering the observable object. Used when loading saved runs from the database.

Parameters :
Name Type Optional Description
scenario UserScenario No

custom user scenario

Returns : void

Properties

Private hideTools
Default value : false

Hide Dynamic Data Tools Flag

Public lanIndex
Type : number
Default value : 0

Language Index

Public locale
Type : string
Decorators :
@Inject(LOCALE_ID)
Private modelScenario
Type : UserScenario

Holds the user scenario specification

Private modelScenarioUpdated
Default value : new Subject<UserScenario>()

Subscribable subject to updates on the user scenario specification

Private projectionStart
Type : string
Default value : '2020'

Projection start year

Private running
Default value : false

Model Semaphore

Private scenarioDescription
Type : string
Default value : ''

Descriptive text of user scenario added to the descripton field before model run

Public scenarioThemes
Type : string[]
Default value : new Array()

Scenario themes linked to this run

Private userRole
Type : string

Holds the user selected role

results matching ""

    No results matching ""