From e2a8adb513440cf0cec8ed63b27a32a1d7f2bbac Mon Sep 17 00:00:00 2001 From: DD_DE <78473530+DDdotDE@users.noreply.github.com> Date: Wed, 18 Oct 2023 12:38:11 +0200 Subject: [PATCH 1/4] added new Format option added a new formating option: counter_down - giving each new file a lower number, based on 1000000 - (year10000) - (month1000) - (day100) - (hour10) - minute this way, printers that sort the files based on the name should show the newest file at the top. maybe this needs a rework to use the time at saving, not at importing the model --- GcodeFilenameFormatPlus.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GcodeFilenameFormatPlus.py b/GcodeFilenameFormatPlus.py index c8caf29..7d5f30e 100755 --- a/GcodeFilenameFormatPlus.py +++ b/GcodeFilenameFormatPlus.py @@ -167,7 +167,7 @@ def getPrintSettings(self, filename_format): return None time = QDateTime.currentDateTime().toString("HH-mm") - year = QDateTime.currentDateTime().toString("yyyy") + year = QDateTime.currentDateTime().toString("yy") month = QDateTime.currentDateTime().toString("MM") day = QDateTime.currentDateTime().toString("dd") hour = QDateTime.currentDateTime().toString("HH") @@ -175,6 +175,7 @@ def getPrintSettings(self, filename_format): second = QDateTime.currentDateTime().toString("ss") date = year + '-' + month + '-' + day datetime = date + 'T' + hour + minute + second + counter_down = str(1000000 - (int(year)*10000) - (int(month)*1000) - (int(day)*100) - (int(hour)*10) - int(minute)) tokens = re.split(r'\W+', filename_format) # TODO: split on brackets only @@ -241,6 +242,7 @@ def getPrintSettings(self, filename_format): print_settings["date"] = date print_settings["time"] = time print_settings["datetime"] = datetime + print_settings["counter_down"] = counter_down print_settings["year"] = year print_settings["month"] = month print_settings["day"] = day From 24881aa2548c316bdbc6377416df16d1737dd464 Mon Sep 17 00:00:00 2001 From: DD_DE <78473530+DDdotDE@users.noreply.github.com> Date: Wed, 18 Oct 2023 12:40:41 +0200 Subject: [PATCH 2/4] readded a format --- GcodeFilenameFormatPlus.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GcodeFilenameFormatPlus.py b/GcodeFilenameFormatPlus.py index 7d5f30e..b41eadd 100755 --- a/GcodeFilenameFormatPlus.py +++ b/GcodeFilenameFormatPlus.py @@ -167,7 +167,8 @@ def getPrintSettings(self, filename_format): return None time = QDateTime.currentDateTime().toString("HH-mm") - year = QDateTime.currentDateTime().toString("yy") + year = QDateTime.currentDateTime().toString("yyyy") + year2 = QDateTime.currentDateTime().toString("yy") month = QDateTime.currentDateTime().toString("MM") day = QDateTime.currentDateTime().toString("dd") hour = QDateTime.currentDateTime().toString("HH") @@ -175,7 +176,7 @@ def getPrintSettings(self, filename_format): second = QDateTime.currentDateTime().toString("ss") date = year + '-' + month + '-' + day datetime = date + 'T' + hour + minute + second - counter_down = str(1000000 - (int(year)*10000) - (int(month)*1000) - (int(day)*100) - (int(hour)*10) - int(minute)) + counter_down = str(1000000 - (int(year2)*10000) - (int(month)*1000) - (int(day)*100) - (int(hour)*10) - int(minute)) tokens = re.split(r'\W+', filename_format) # TODO: split on brackets only From a4b21a89ab09d78e856b5a4cf13286bd9fb7c775 Mon Sep 17 00:00:00 2001 From: DD_DE <78473530+DDdotDE@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:29:18 +0100 Subject: [PATCH 3/4] Update GcodeFilenameFormatPlus.py to not increse nimber on change of month --- GcodeFilenameFormatPlus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GcodeFilenameFormatPlus.py b/GcodeFilenameFormatPlus.py index b41eadd..ead3138 100755 --- a/GcodeFilenameFormatPlus.py +++ b/GcodeFilenameFormatPlus.py @@ -176,7 +176,7 @@ def getPrintSettings(self, filename_format): second = QDateTime.currentDateTime().toString("ss") date = year + '-' + month + '-' + day datetime = date + 'T' + hour + minute + second - counter_down = str(1000000 - (int(year2)*10000) - (int(month)*1000) - (int(day)*100) - (int(hour)*10) - int(minute)) + counter_down = str(100000000 - (int(year)*1000000) - (int(month)*80000) - (int(day)*4000) - (int(hour)*61) - int(minute)) tokens = re.split(r'\W+', filename_format) # TODO: split on brackets only From 380a72890d18588e65290e997451d76f7aadf469 Mon Sep 17 00:00:00 2001 From: DD_DE <78473530+DDdotDE@users.noreply.github.com> Date: Sat, 20 Jan 2024 23:25:06 +0100 Subject: [PATCH 4/4] Fixed negative numbers My Calculations were off... aperantly i already fixed it before but never uploaded it... had to rewrite it because i got a new pc and didnt took my files over. anyways, here is it --- GcodeFilenameFormatPlus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GcodeFilenameFormatPlus.py b/GcodeFilenameFormatPlus.py index ead3138..51a3899 100755 --- a/GcodeFilenameFormatPlus.py +++ b/GcodeFilenameFormatPlus.py @@ -176,7 +176,7 @@ def getPrintSettings(self, filename_format): second = QDateTime.currentDateTime().toString("ss") date = year + '-' + month + '-' + day datetime = date + 'T' + hour + minute + second - counter_down = str(100000000 - (int(year)*1000000) - (int(month)*80000) - (int(day)*4000) - (int(hour)*61) - int(minute)) + counter_down = str(100000000 - (int(year2)*1000000) - (int(month)*80000) - (int(day)*4000) - (int(hour)*61) - int(minute)) tokens = re.split(r'\W+', filename_format) # TODO: split on brackets only @@ -300,4 +300,4 @@ def getObjectCount(self) -> int: count += 1 - return count + return count \ No newline at end of file