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

Module Admin - Crash of module during creating Team via command line #38

Closed
rompik opened this issue May 25, 2022 · 5 comments
Closed
Assignees
Labels
Admin Admin Module enhancement New feature or request

Comments

@rompik
Copy link
Contributor

rompik commented May 25, 2022

During creating of new Team via command line with command

PipeCad.CreateTeam("CS", "TEAM FOR STRUCTURE DISCIPLINE") 

application just crash w/out any warning. As I see in Admin.py code, it could happen due to non selecting proper Team's world container /*T. So for correct using CreateTeam command, there is need to add additional code

self.tmwlItem = PipeCad.GetItem("/*T")   # Correct world can be assigned by PipeCad automatically in Core
PipeCad.SetCurrentItem(self.tmwlItem)    # Correct world can be assigned by PipeCad automatically in Core
PipeCad.StartTransaction("Create Team")  
try:
     PipeCad.CreateTeam(aName, self.textDescription.text)
except NameError as e:
     # repr(e)
     QMessageBox.critical(self, "", str(e))
      raise
# try

aTeamItem = PipeCad.CurrentItem()         
PipeCad.CreateItem("DBLI")                         # All required members for Team can be created automatically during Team creation and implemented into Core. 

I offer to move part for selecting proper world into Qt Core code, so Python code for creating any Team, Db, User, MDB will be simplified as these elements can be created in only dedicated world which are constant during life of project. For example, in this case possible code in Python for creating Team(User, Db, MDB) will be shorter and Python developer will make less mistake:

PipeCad.StartTransaction("Create Team")  
try:
     PipeCad.CreateTeam(aName, self.textDescription.text)
except NameError as e:
     # repr(e)
     QMessageBox.critical(self, "", str(e))
      raise
# try
Module.Admin.-.Crash.of.module.during.creation.team.mp4
@eryar eryar self-assigned this May 26, 2022
@eryar eryar added the enhancement New feature or request label May 26, 2022
@eryar
Copy link
Owner

eryar commented May 26, 2022

Okay, I will set the world item in team, user, db and mdb creation functions.

@eryar eryar added the Admin Admin Module label May 26, 2022
@rompik
Copy link
Contributor Author

rompik commented May 27, 2022

I see updates, thank you! But I thought to move block for creating DBLI element of Team inside Qt Core also:

        aTeamItem = PipeCad.CurrentItem()
        PipeCad.CreateItem("DBLI")

DBLI element is required for proper functionality of PipeCad and better to keep such thing under Core control but not user. In this case code for creating Team will be more compact and robust:

PipeCad.StartTransaction("Create Team")  
try:
     PipeCad.CreateTeam(aName, self.textDescription.text)
except NameError as e:
     # repr(e)
     QMessageBox.critical(self, "", str(e))
      raise
# try

# Here is block for adding users

PipeCad.CommitTransaction()
PipeCad.SaveWork() 

@eryar
Copy link
Owner

eryar commented May 28, 2022

When create DBLI in CreateTeam funcion, current item is DBLI item, it need set current item back to TEAM Item, this will cost little time.

Your suggestion is reasonable, I will move the create DBLI function into function CreateTeam.

@eryar
Copy link
Owner

eryar commented May 30, 2022

PipeCAD-1.0.13

@rompik
Copy link
Contributor Author

rompik commented Jun 2, 2022

Thank you for fixing, now it works the same manned as expected:)
https://user-images.githubusercontent.com/12736532/171741369-23d5dc84-33e2-486a-94e7-2198a4e8af1b.mp4
I will create issues for Db/User/MDB creation to fix similar issues with automatic selection of proper hierarchy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Admin Module enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants