- Gerber Editor: made geometry transfer (which is slow) to Editor to be multithreaded

- Gerber Editor: plotting process is showed in the status bar
This commit is contained in:
Marius Stanciu
2019-04-05 15:28:32 +03:00
committed by Marius
parent 4ecdfba29c
commit cefb74d792
4 changed files with 88 additions and 48 deletions

View File

@@ -7949,9 +7949,15 @@ The normal flow when working in FlatCAM is the following:</span></p>
t = threading.Thread(target=lambda: self.check_project_file_size(1, filename=filename))
t.start()
# using Alfe's answer from here:
# https://stackoverflow.com/questions/474528/what-is-the-best-way-to-repeatedly-execute-a-function-every-x-seconds-in-python
def check_project_file_size(self, delay, filename):
"""
Using Alfe's answer from here:
https://stackoverflow.com/questions/474528/what-is-the-best-way-to-repeatedly-execute-a-function-every-x-seconds-in-python
:param delay: period of checking if project file size is more than zero; in seconds
:param filename: the name of the project file to be checked for size more than zero
:return:
"""
next_time = time.time() + delay
while True:
time.sleep(max(0, next_time - time.time()))