Aufruf der Methoden aus manage_configs zur Erzeugung aller nötigen .csv Dateien und der .json Datei der Baugruppe
This commit is contained in:
+24
-5
@@ -4,9 +4,11 @@ import tkinter as tk
|
||||
from gui import App
|
||||
from caditem import CadItem
|
||||
from controller import Controller, GuiLogic
|
||||
from manage_configs import Configs
|
||||
from manage_configs import Configs, SivasAssemblyData
|
||||
import argparse
|
||||
import os
|
||||
from get_teilestamm import FetchSivasTeilestamm
|
||||
|
||||
|
||||
demo_data = """
|
||||
{
|
||||
@@ -108,6 +110,7 @@ if __name__ == '__main__':
|
||||
|
||||
environment = Environment()
|
||||
output_dir = environment.out_dir
|
||||
data_dir = environment.data_dir
|
||||
configs = Configs(environment.cfg_dir)
|
||||
configs.set_env(environment)
|
||||
|
||||
@@ -117,11 +120,27 @@ if __name__ == '__main__':
|
||||
build_gui(model, configs)
|
||||
|
||||
elif args.sivasid:
|
||||
id = args.sivasid
|
||||
path = os.path.join(output_dir, id + '.json')
|
||||
if os.path.exist(path):
|
||||
sivasid = args.sivasid.strip()
|
||||
filename = sivasid + '.json'
|
||||
|
||||
assembl_path = os.path.join(output_dir, filename)
|
||||
if os.path.exists(assembl_path):
|
||||
# wenn schon einmal das assembly als json abgespeichert wurde, dann dieses laden
|
||||
model.load(demo_data)
|
||||
build_gui(model, configs)
|
||||
else:
|
||||
# ansonsten sich die Einzelteile als .csv und den Aufbau des Assemblies als .json holen
|
||||
sivas_teilestamm = FetchSivasTeilestamm(sivasid, data_dir)
|
||||
sivas_teilestamm.get_unmigrated_teilstamm_csvs()
|
||||
redids = sivas_teilestamm.get_red_ids()
|
||||
sad = SivasAssemblyData(data_dir, filename)
|
||||
parent_children = sad.get_parent_children()
|
||||
|
||||
model.set_red_ids(redids)
|
||||
model.set_parent_children(parent_children)
|
||||
model.set_asm_id(sivasid)
|
||||
|
||||
# dann die Gui damit aufbauen
|
||||
build_gui(model, configs)
|
||||
else:
|
||||
parser.print_help()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user