Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
#!/usr/bin/python -tt
# coding: utf-8
# Guillem Àvila Padró - Jun 2018
# Released under GNU LICENSE
# https://opensource.org/licenses/GPL-3.0
import os
import json
import time
import string
def init():
# Generic
global progenVersionNumber
progenVersionNumber = '2.2.0'
global progenBuildNumber
progenBuildNumber = time.strftime("%d")+string.uppercase[int(time.strftime("%m"))]+string.uppercase[int(time.strftime("%y")[-1])]+time.strftime("%H")+time.strftime("%M")
global profilesData
profilesData = readProfilesData()
global loggedData
loggedData = ["LFilament;RFilament;Extruder;Quality;LNozzle;RNozzle;InfillExt;PrimaryExt;SupportExt;LFlow;RFlow;Layers/Infill;DefaultSpeed;FirstLayerUnderspeed;OutLineUnderspeed;SupportUnderspeed;FirstLayerHeightPercentage;LTemp;RTemp;BTemp;\n"]
def readProfilesData():
'''
Load all the data from resources, so if the files are changed after starting the script it doesn't affect profile generation.
'''
profilesData = dict([("machine", []), ("hotend", []), ("filament", []), ("quality", [])])
for machine in os.listdir('./resources/machines'):
if machine[-5:] == '.json':
with open('./resources/machines/'+machine) as machine_file:
machineData = json.load(machine_file)
profilesData['machine'].append(machineData)
for hotend in os.listdir('./resources/hotends'):
if hotend[-5:] == '.json':
with open('./resources/hotends/'+hotend) as hotend_file:
hotendData = json.load(hotend_file)
profilesData['hotend'].append(hotendData)
profilesData['hotend'].append(dict([('id', 'None')]))
for filament in os.listdir('./resources/filaments'):
if filament[-5:] == '.json':
with open('./resources/filaments/'+filament) as filament_file:
filamentData = json.load(filament_file)
profilesData['filament'].append(filamentData)
for quality in os.listdir('./resources/quality'):
if quality[-5:] == '.json':
with open('./resources/quality/'+quality) as quality_file:
qualityData = json.load(quality_file)
profilesData['quality'].append(qualityData)
return profilesData24b2f6e95This file is pinned to the selected release. Download the original to open it in your design tool.