This PR solve the closeModel() issue when it is called after saveFile() with new saved model name. I also update openFile() with connectToServer() so we don't have to establish connection explicitly in script via Model() or connectToServer().
Test script:
from RFEM.initModel import Model, connectToServer, openFile, saveFile, closeModel
# connectToServer() # or Model()
openFile(r'C:/Users/RojivadivaH/Desktop/Demo1.rf6')
print('Model 1 opened.')
saveFile(r'C:/Users/RojivadivaH/Desktop/new_Demo1.rf6')
print('Model 1 saved with new name.')
openFile(r'C:/Users/RojivadivaH/Desktop/Demo2.rf6')
print('Model 2 opened.')
saveFile(r'C:/Users/RojivadivaH/Desktop/new_Demo2.rf6')
print('Model 2 saved with new name.')
closeModel(2)
print('New model 2 is closed!')
closeModel(1)
print('New model 1 is closed!')
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation update
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
[ ] Unit Tests
[x] Attached examples
Test Configuration:
RFEM / RSTAB version: 6.06.0005
Python version: Python 3.11
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published in downstream modules
Description
This PR solve the
closeModel()
issue when it is called aftersaveFile()
with new saved model name. I also updateopenFile()
withconnectToServer()
so we don't have to establish connection explicitly in script viaModel()
orconnectToServer()
.Test script:
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: