-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/task 5 implement import functi #17
Feature/task 5 implement import functi #17
Conversation
- Fixed naming in the dialogs - Switched command positions in InitGui - Added file open dialog with JSON filter to import command --- Task #5: Implement Import Functionality
Use the JsonImporter in the CommandImport --- Task #5: Implement Import Functionality
- Add full import function in JsonImporter - Use that function in CommandImport - Add test function for full import - Add test fixture json file --- Task #5: Implement Import Functionality
- Add JsonProductAssembly call - Add json product tests --- Task #5: Implement Import Functionality
Also: - Add test data in test_json_data - Add test case with that data in test_json_product_assembly - Update test_full_import --- Task #5: Implement Import Functionality
Importing twice should result in the same output as importing once. json_importer: Create FreeCAD filename from JSON filename test_json_importer: Add testcase for importing twice json_product: - Add function to compare AJsonProducts - Only create a part if it doesn't exist already - Clear the placement when reimporting --- Task #5: Implement Import Functionality
Add a simple solution in json_product_child to propagate values from parent to children and also test this behavior. The current method results in children only having an absolute position (and rotation) instead of a relative one to their parent. This should be reconsidered with usability and the export functionality in mind. --- Task #5: Implement Import Functionality
Because of CRUD assume that a change from Virtual Satellite side has always newer information, so we can simply clear the first imported file and use the newer file. For that: - Add a function to clear a file in active_document - Call that function in full_import - Get FreeCAD document from ProductRoot instead of filename (so different versions can easily be saved in different files) - Add new test fixture --- Task #5: Implement Import Functionality
- Add a module directory in FreeCAD Appdata: - Create directory in Init - Provide it with Environment - Use it in CommandImport - Update documentation and Log Messages - Update part update in json_product: Now deletes and recreates existing parts --- Task #5: Implement Import Functionality
Also add the Mod directory --- Task #5: Implement Import Functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks in general quite fine to me. I think we should sit down together to have a look into some details before merging into development.
if filename != '': | ||
FreeCAD.Console.PrintMessage(f"Selected file '{filename}'\n") | ||
|
||
json_importer = JsonImporter(Environment.get_appdata_module_path() + os.sep) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to hand over this appdata_module_path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an issue for this: #19
--- Task #5: Implement Import Functionality
Add: - test_create_part_product_subassembly_with_root_part - test_create_part_product_assembly_and_subassembly_with_root_part - test_create_part_product_assembly_with_root_part_with_traverser (empty test) --- Task #5: Implement Import Functionality
--- Task #5: Implement Import Functionality
- Add first test cases - Add the test class to TestVirtualSatelliteApp - Update traverser - Update product assembly test --- Task #5: Implement Import Functionality
--- Task #5: Implement Import Functionality
Try to use the traverser in the importer and reactivating the full_import test case showed problems with assemblies having the same name and uuid as their part. To further investigate that, test cases were added in the traverser. --- Task #5: Implement Import Functionality
These solve the problem of having a part and an assembly with the same name and uuid. - Add the identifiers to json_definitions - Update the names in part and product files and corresponding test files --- Task #5: Implement Import Functionality
--- Task #5: Implement Import Functionality
--- Task #5: Implement Import Functionality
--- Task #5: Implement Import Functionality
Add import functionality:
CRUD will be tested later in #18
Closes #5