Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setTimeParameter error on StartTime (code: 10) #63

Open
rfsales opened this issue Sep 12, 2022 · 1 comment
Open

setTimeParameter error on StartTime (code: 10) #63

rfsales opened this issue Sep 12, 2022 · 1 comment

Comments

@rfsales
Copy link

rfsales commented Sep 12, 2022

Tryed different types of data on version "0.6.3" and "0.7.0":

# Test #1

project.setTimeParameter(10, "01:00"); //'Cannot convert "01:00" to long',
project.setTimeParameter(10, "1 pm"); //'Cannot convert "1 pm" to long'
project.setTimeParameter(10, 3600); //'Error 251: function call contains invalid parameter code'
project.setTimeParameter(10, 1); // 'Error 251: function call contains invalid parameter code'
project.setTimeParameter(10, 0); // 'Error 251: function call contains invalid parameter code'

Output:

{
  name: 'StartTime',
  cod: 10,
  desc: 'Simulation starting time of day.'
}
GET: 0
ERROR: Error: Error 251: function call contains invalid parameter code
    at Project._checkError (/epanet/node_modules/epanet-js/dist/epanet-js.cjs.development.js:1351:11)
    at Project.AnalysisOptionsFunctions.setTimeParameter (/epanet/node_modules/epanet-js/dist/epanet-js.cjs.development.js:516:10)

References:
https://epanetjs.com/api/project-functions/enumerated-types/#timeparameter
https://epanetjs.com/api/project-functions/analysis-options/#settimeparameter

@lbutler
Copy link
Contributor

lbutler commented Sep 14, 2022

Hi @rfsales ,

Thanks for bringing this to my attention, it turns out that StartTime was added after v2.2 and so isn't actually available from the toolkit.

OpenWaterAnalytics/EPANET#588

I've been looking at ways to allow the dev branch of epanet to run in epanet-js and would like to see that supported sooner than later.

Also, I was considering adding custom "unsafe" API functions to temporarily add support for specific features with the 2.2 engine.

I will leave this issue open until one of the two above options becomes ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants