assembly id hinzugefügt. Linke Frame wereitert. to_json und from_json implementiert. load and save implementiert

This commit is contained in:
2024-01-16 16:44:27 +01:00
parent 93829f4b12
commit 5aea1a0377
4 changed files with 215 additions and 139 deletions
+62 -78
View File
@@ -3,84 +3,68 @@ from caditem import CadItem
from CreoMigrateGui import App
from controller import Controller
red_ids = ( '400102274', '400102275', '400102190', '400102198',
'400102161', '400102277', '400102163', '400102278',
'400102282', '400102284', '400102195', 'MA0000008',
'MA0000004', '929055170', '400102267', '400102235',
'400102236', 'MA0000006', '400102237', '400102238',
'400102239', '400102268', '829416159', '924031058',
'924031081', '822064091', '822066199', '822066200')
parent_children_mapping = {'400102196': ['400102125', '400102126', '400102130',
'400102161', '400102163', '400102165',
'400102166', '400102167', '400102168',
'400102190', '400102195', '400102198',
'400102246', '400102247', '400102267',
'400102272', '400102274', '400102275',
'400102277', '400102278', '400102282',
'400102284', '400102417', '720002003',
'721001034', '821114025', '822064091',
'822066085', '822996075', '829416061',
'829516004', '911021113', '911021181',
'911021259', '911091054', '911091096',
'911091097', '911251013', '912011009',
'919050006', '924031058',
'924031081'],
'400102282': ['822066026', '822066089', '919010052'],
'400102195': ['822066075', '822066216',
'822066154', '822066101', '822064090',
'822066196', '400102129', '822066217',
'822066160', '822066215', '913041045',
'913011009', '911011057', '822064035',
'925011006', '911091041', '913051040',
'911021112', '911021166', '825006003',
'912041005', '911011014', '911011009',
'911021144', '911021001', '913011016',
'929055170', '913011010', '911021035',
'829416065', '712000151',
'712000100'],
'822066075': ['822066157', '822066162', '911261023'],
'822066162': ['822064013'],
'822066196': ['MA0000008'],
'822066160': ['MA0000004'],
'822064035': ['822066065'],
'822064093': ['822066204', '822066205', '822066206', '822066207', '822066208'],
'822066220': ['924031033'],
'822064091': ['822066212', '822064093', '822066220',
'822066200', '912011010', '911021156',
'822066201', '911071027', '913011109',
'911011070', '913011001', '710005021',
'919010055', '720000008', '720000007'],
'400102267': ['400102235', '829416159', '829416077',
'829416079', '911021260', '911021147',
'911251014'],
'400102235': ['400102236', '400102237', '400102238',
'400102239', '400102268', '911021143',
'911021054', '911021055'],
'400102236': ['MA0000006'],
'829416159': ['829416089'],
'400102130': ['400102142'],
'821116004': ['822026004'],
'400102168': ['821116001'],
'821114025': ['911081007', '821116053'],
'400102167': ['821116004']}
model = CadItem("400102196")
gui_data = {
"teilenummer":"400102142",
"pdm_kategorie_neu":"Einzelteil",
"neuaufbau" :"False",
"lebenszyklus_status_neu" :"Serie",
"aus_halbzeug_neu" :"True",
"zusatzinfos_text_neu": 'Dies sind neue Zusatzinfos',
}
model.set_gui_dict(gui_data)
model.set_parent_children(parent_children_mapping)
model.set_red_ids(red_ids)
json_str = """
{
"parent_children_mapping": {
"400102130": [ "400102142" ],
"400102167": [ "821116004" ],
"400102168": [ "821116001" ],
"400102195": [ "822066075", "822066216", "822066154", "822066101",
"822064090", "822066196", "400102129", "822066217", "822066160",
"822066215", "913041045", "913011009", "911011057", "822064035",
"925011006", "911091041", "913051040", "911021112", "911021166",
"825006003", "912041005", "911011014", "911011009", "911021144",
"911021001", "913011016", "929055170", "913011010", "911021035",
"829416065", "712000151", "712000100" ],
"400102196": [ "400102125", "400102126", "400102130", "400102161",
"400102163", "400102165", "400102166", "400102167", "400102168",
"400102190", "400102195", "400102198", "400102246", "400102247",
"400102267", "400102272", "400102274", "400102275", "400102277",
"400102278", "400102282", "400102284", "400102417", "720002003",
"721001034", "821114025", "822064091", "822066085", "822996075",
"829416061", "829516004", "911021113", "911021181", "911021259",
"911091054", "911091096", "911091097", "911251013", "912011009",
"919050006", "924031058", "924031081" ],
"400102235": [ "400102236", "400102237", "400102238", "400102239",
"400102268", "911021143", "911021054", "911021055" ],
"400102236": [ "MA0000006" ],
"400102267": [ "400102235", "829416159", "829416077", "829416079",
"911021260", "911021147", "911251014" ],
"400102282": [ "822066026", "822066089", "919010052" ],
"821114025": [ "911081007", "821116053" ],
"821116004": [ "822026004" ],
"822064035": [ "822066065" ],
"822064091": [ "822066212", "822064093", "822066220", "822066200",
"912011010", "911021156", "822066201", "911071027", "913011109",
"911011070", "913011001", "710005021", "919010055", "720000008", "720000007" ],
"822064093": [ "822066204", "822066205", "822066206", "822066207", "822066208" ],
"822066075": [ "822066157", "822066162", "911261023" ],
"822066160": [ "MA0000004" ],
"822066162": [ "822064013" ],
"822066196": [ "MA0000008" ],
"822066220": [ "924031033" ],
"829416159": [ "829416089" ]
},
"red_ids": [ "400102274", "400102275", "400102190", "400102198", "400102161",
"400102277", "400102163", "400102278", "400102282", "400102284",
"400102195", "MA0000008", "MA0000004", "929055170", "400102267",
"400102235", "400102236", "MA0000006", "400102237", "400102238",
"400102239", "400102268", "829416159", "924031058", "924031081",
"822064091", "822066199", "822066200" ],
"gui_data": {
"asm_id": "400102196",
"teilenummer": "400102142",
"pdm_kategorie_neu": "Einzelteil",
"neuaufbau": "False",
"lebenszyklus_status_neu": "Serie",
"aus_halbzeug_neu": "True",
"zusatzinfos_text_neu": "Dies sind neue Zusatzinfos"
},
"data": {}
}
"""
model = CadItem()
model.from_json(json_str)
root = tk.Tk()
app = App(root)