Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Commit

Permalink
Add the suffix to a file if it does not have one
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqwsx committed Nov 12, 2019
1 parent 66ad3b2 commit 589497c
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions elegooMarsUtility/xyCompensateGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
import emUtility

layout = [
[sg.Text('Please enter your calibration data, input and output file')],
[sg.Text('First layer compensation:', size=(23, 1)), sg.InputText('6', size=(32, 1))],
[sg.Text('Normal layer compensation:', size=(23, 1)), sg.InputText('0', size=(32, 1))],
[sg.Text('Input file:', size=(10, 1)), sg.InputText(size=(30, 1)), sg.FileBrowse(size=(10, 1), file_types=(("CBDDLP Files", "*.cbddlp"),))],
[sg.Text('Output file:', size=(10, 1)), sg.InputText(size=(30, 1)), sg.FileSaveAs(size=(10, 1), file_types=(("CBDDLP Files", "*.cbddlp"),))],
[sg.Submit(button_text='Run', size=(25, 1)), sg.Cancel(button_text='Exit', size=(25, 1))]
[sg.Text("Please enter your calibration data, input and output file")],
[sg.Text("First layer compensation:", size=(23, 1)), sg.InputText("6", size=(32, 1))],
[sg.Text("Normal layer compensation:", size=(23, 1)), sg.InputText("0", size=(32, 1))],
[sg.Text("Input file:", size=(10, 1)), sg.InputText(size=(30, 1)), sg.FileBrowse(size=(10, 1), file_types=(("CBDDLP Files", "*.cbddlp"),))],
[sg.Text("Output file:", size=(10, 1)), sg.InputText(size=(30, 1)), sg.FileSaveAs(size=(10, 1), file_types=(("CBDDLP Files", "*.cbddlp"),))],
[sg.Submit(button_text="Run", size=(25, 1)), sg.Cancel(button_text="Exit", size=(25, 1))]
]
window = sg.Window('Elegoo Mars utility').Layout(layout)
window = sg.Window("Elegoo Mars utility").Layout(layout)

while True:
button, values = window.Read()

if button == 'Exit':
if button == "Exit":
sys.exit(0)

try:
Expand All @@ -42,16 +42,18 @@
sg.Popup("Error: you have to select output file")
continue
outputFilename = values[3]
if not outputFilename.endswith(".cbddlp"):
outputFilename += ".cbddlp"

break
window.Close()

layout = [ [sg.Text('Applying the compensation')],
[sg.ProgressBar(1, orientation='h', size=(20, 20), key='progress')],
layout = [ [sg.Text("Applying the compensation")],
[sg.ProgressBar(1, orientation="h", size=(20, 20), key="progress")],
]

window = sg.Window('Window Title', layout).Finalize()
progress_bar = window.FindElement('progress')
window = sg.Window("Elegoo Mars utility", layout).Finalize()
progress_bar = window.FindElement("progress")
emUtility.xyCompensate(inputFilename, normalCompensation, firstCompensation, outputFilename,
lambda x, y: progress_bar.UpdateBar(x, y))
window.Close()
Expand Down

0 comments on commit 589497c

Please sign in to comment.