This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NPSH Calculator tool FILE BASED result storage

Hi All,

The WaterObjects.NET SDK samples has a tool NPSH Calculator which calculates the in-memory results. How can the tool be modified to incorporate FILE BASED storage, so that the results are available across session?

Thanks,

Aparna

Parents Reply Children
  • Hi,

    I know that. But actually I have developed a tool on the lines of NPSH Calculator and in that I want to save the calculated results to file system, so that they are available across sessions. So if I get to know the modifications for changing IN-MEMORY results to FILE-BASED results in NPSH Calculator tool, I can incorporate it in my tool by adopting same approach.

    Thanks

  • Devashri, can you tell us a bit more about what you need to do with the NPSH results? What is missing from the NPSH tools in WaterCAD and WaterGEMS that has caused you to look into a WaterObjects.NET tool? What is the end goal that you are looking to achieve?


    Regards,

    Jesse Dringoli
    Technical Support Manager, OpenFlows
    Bentley Communities Site Administrator
    Bentley Systems, Inc.

  • Did you start your plug-in engine implementation using the WaterObjects.NET.NPSHCalculator example as a starting point? If so, you would have implemented a ResultDataConnection class. You will see there are some methods there for managing results.

    Deactivate

    HasResults

    IsActive

    Open

    TimeStepsInSeconds

    ResultPathAndFileNamesFor

    To implement permanent (file based) results, you have to provide an implementation for all of these methods. That is, one that differs from the in-memory sample implementation.

    The methods need to do the following.

    Deactivate - For the specified scenario, close the result file and delete it.

    HasResults - For the specified scenario, answer whether results exist (will need to check that a valid results file exists for that scenario).

    IsActive - For the specified scenario, answers whether the results file is open (e.g., a results reader has the result file open).

    Open - For the specified scenario, open the results file so that results are available.

    TimeStepsInSeconds - For the specified scenario, answer the time steps that the result set supports.

    ResultPathAndFileNamesFor - Answer all the possible results file names for the open model. That is, each and every possible results file managed by your result data connection. This allows the main application to migrate files during file save / open operations etc.

    Hope this helps.

    EDIT: Changed "field" to "file" in the last item.



  • Hi Wayne,

    I tried implementing the required methods and also save/read scenario data to/from the file. 

    But to get the additional numerical engine fields of relevant element record (pipe, junction) populated, when a WaterGEMS model is opened, what needs to be done?

    Do I need to use some event channel to extend the in-built behavior of WaterGEMS to get the extra fields populated along with default results? Typically Project opened or something similar?

    Thanks in anticipation

  • Hi Wayne,

    We successfully completed the tool with file based result feature. Thank you so much for all your help.

    We will also like to convey out special thanks to Kris, for his great help.

    Thanks Bentley!

    Team DTK