mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Sending serialized global_settings
Containers currently don't have a function to return their content as JSON or dict
This commit is contained in:
parent
cbb8eebf72
commit
8f450d0d2f
1 changed files with 1 additions and 21 deletions
|
@ -49,26 +49,6 @@ class SliceInfo(Extension):
|
||||||
Logger.log("d", "'info/send_slice_info' is turned off.")
|
Logger.log("d", "'info/send_slice_info' is turned off.")
|
||||||
return # Do nothing, user does not want to send data
|
return # Do nothing, user does not want to send data
|
||||||
|
|
||||||
# Load all machine definitions and put them in machine_settings dict
|
|
||||||
#setting_file_name = Application.getInstance().getActiveMachineInstance().getMachineSettings()._json_file
|
|
||||||
machine_settings = {}
|
|
||||||
#with open(setting_file_name, "rt", -1, "utf-8") as f:
|
|
||||||
# data = json.load(f, object_pairs_hook = collections.OrderedDict)
|
|
||||||
#machine_settings[os.path.basename(setting_file_name)] = copy.deepcopy(data)
|
|
||||||
active_machine_definition= Application.getInstance().getMachineManager().getActiveMachineInstance().getMachineDefinition()
|
|
||||||
data = active_machine_definition._json_data
|
|
||||||
# Loop through inherited json files
|
|
||||||
setting_file_name = active_machine_definition._path
|
|
||||||
while True:
|
|
||||||
if "inherits" in data:
|
|
||||||
inherited_setting_file_name = os.path.dirname(setting_file_name) + "/" + data["inherits"]
|
|
||||||
with open(inherited_setting_file_name, "rt", -1, "utf-8") as f:
|
|
||||||
data = json.load(f, object_pairs_hook = collections.OrderedDict)
|
|
||||||
machine_settings[os.path.basename(inherited_setting_file_name)] = copy.deepcopy(data)
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
|
|
||||||
|
|
||||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
|
|
||||||
# Get total material used (in mm^3)
|
# Get total material used (in mm^3)
|
||||||
|
@ -102,7 +82,7 @@ class SliceInfo(Extension):
|
||||||
"processor": platform.processor(),
|
"processor": platform.processor(),
|
||||||
"machine": platform.machine(),
|
"machine": platform.machine(),
|
||||||
"platform": platform.platform(),
|
"platform": platform.platform(),
|
||||||
"machine_settings": json.dumps(machine_settings),
|
"global_settings": global_container_stack.serialize(),
|
||||||
"version": Application.getInstance().getVersion(),
|
"version": Application.getInstance().getVersion(),
|
||||||
"modelhash": "None",
|
"modelhash": "None",
|
||||||
"printtime": str(print_information.currentPrintTime),
|
"printtime": str(print_information.currentPrintTime),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue