From c6fc0af829722c305f49a32330dad1aa26298003 Mon Sep 17 00:00:00 2001 From: MAKOMO Date: Mon, 16 Sep 2024 19:05:27 +0200 Subject: [PATCH] - reduces the size of linux builds - removes incorrectly reconstructed custom events outside of the CHARGE to DROP period on quitting the designer (Discussion #1696) --- src/artisan-linux.spec | 22 +++++++++++++++++++++- src/artisanlib/canvas.py | 17 ++++++++++++----- src/build-linux.sh | 9 +++++++-- wiki/ReleaseHistory.md | 3 ++- 4 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/artisan-linux.spec b/src/artisan-linux.spec index c9f8a0aa4..45326340e 100644 --- a/src/artisan-linux.spec +++ b/src/artisan-linux.spec @@ -24,13 +24,33 @@ hiddenimports_list=[ 'babel.numbers' ] +EXCLUDES = [ + 'PyQt5', + 'PyQt6.Multimedia', + 'PyQt6.Network', + 'PyQt6.OpenGL', + 'PyQt6.PrintSupport', + 'PyQt6.QtQml', + 'PyQt6.QtQuick', + 'PyQt6.QtWebChannel', + 'PyQt6.QtPositioning', + 'PyQt6.QtRemoteObjects', + 'PyQt6.QtSensors', + 'PyQt6.QtSerialPort', + 'PyQt6.QtSpatialAudio', + 'PyQt6.QtTest', + 'PyQt6.QtTextToSpeech', + 'PyQt6.QtWebEngineQuick', + 'PyQt6.QtWebEngineWidgets' +] + a = Analysis(['artisan.py'], pathex=[path], binaries=BINARIES, datas=[], hookspath=[], runtime_hooks=[], - excludes=['PyQt5'], + excludes=EXCLUDES, hiddenimports=hiddenimports_list, win_no_prefer_redirects=False, win_private_assemblies=False, diff --git a/src/artisanlib/canvas.py b/src/artisanlib/canvas.py index b8b7bf12e..a9e768726 100644 --- a/src/artisanlib/canvas.py +++ b/src/artisanlib/canvas.py @@ -283,7 +283,7 @@ class tgraphcanvas(FigureCanvas): 'l_eventtype3dots', 'l_eventtype4dots', 'l_eteventannos', 'l_bteventannos', 'l_eventtype1annos', 'l_eventtype2annos', 'l_eventtype3annos', 'l_eventtype4annos', 'l_annotations', 'l_background_annotations', 'l_annotations_dict', 'l_annotations_pos_dict', 'l_event_flags_dict', 'l_event_flags_pos_dict', 'ai', 'timeclock', 'threadserver', 'designerflag', 'designerconnections', 'mousepress', 'indexpoint', - 'workingline', 'eventtimecopy', 'specialeventsStringscopy', 'specialeventsvaluecopy', 'specialeventstypecopy', 'currentx', 'currenty', + 'workingline', 'eventtimecopy', 'etypescopy', 'specialeventsStringscopy', 'specialeventsvaluecopy', 'specialeventstypecopy', 'currentx', 'currenty', 'designertimeinit', 'BTsplinedegree', 'ETsplinedegree', 'reproducedesigner', 'designertemp1init', 'designertemp2init', 'ax_background_designer', 'designer_timez', 'time_step_size', '_designer_orange_mark', '_designer_orange_mark_shown', '_designer_blue_mark', '_designer_blue_mark_shown', 'l_temp1_markers', 'l_temp2_markers', 'l_stat1', 'l_stat2', 'l_stat3', 'l_div1', 'l_div2', 'l_div3', 'l_div4', @@ -1960,6 +1960,7 @@ def __init__(self, parent:QWidget, dpi:int, locale:str, aw:'ApplicationWindow') self.indexpoint:int = 0 self.workingline:int = 2 #selects 1:ET or 2:BT self.eventtimecopy:List[float] = [] + self.etypescopy:List[str] = [] self.specialeventsStringscopy:List[str] = [] self.specialeventsvaluecopy:List[float] = [] self.specialeventstypecopy:List[int] = [] @@ -15952,6 +15953,7 @@ def designer(self) -> None: # # reset also the special event copy held for the designer self.eventtimecopy = [] + self.eventtimecopy = [] self.specialeventsStringscopy = [] self.specialeventsvaluecopy = [] self.specialeventstypecopy = [] @@ -16088,6 +16090,7 @@ def initfromprofile(self) -> bool: for spe in self.specialevents: #save relative time of events self.eventtimecopy.append(self.timex[spe]-self.timex[self.timeindex[0]]) + self.etypescopy = self.etypes[:] #find lowest point from profile to be converted lpindex = self.aw.findTP() @@ -16932,10 +16935,14 @@ def convert_designer(self) -> None: if self.eventtimecopy: self.clearEvents() # first clear previous special event lists for i, etc in enumerate(self.eventtimecopy): - self.addEvent(self.time2index(etc + self.timex[self.timeindex[0]]), - self.specialeventstypecopy[i], - self.specialeventsStringscopy[i], - self.specialeventsvaluecopy[i]) + tx_idx:int = self.time2index(etc + self.timex[self.timeindex[0]]) + if tx_idx > -1: + # only if event time is between CHARGE and DROP we reconstruct the event + self.addEvent(tx_idx, + self.specialeventstypecopy[i], + self.specialeventsStringscopy[i], + self.specialeventsvaluecopy[i]) + self.etypes = self.etypescopy[:] #check for extra devices num = len(self.timex) diff --git a/src/build-linux.sh b/src/build-linux.sh index f206ec7f7..4670592ce 100755 --- a/src/build-linux.sh +++ b/src/build-linux.sh @@ -169,8 +169,13 @@ cp -R includes/Icons/* dist/Icons rm -rf dist/_internal/libQt5* rm -rf dist/_internal/PyQt5 -rm -rf dist/_internal/PyQt6/Qt6/translations -rm -rf dist/_internal/PyQt6/Qt6/qml/QtQuick3D +#rm -rf dist/_internal/PyQt6/Qt6/translations # some translations (qt, qtbase and qtconnectivity) are used! +#rm -rf dist/_internal/PyQt6/Qt6/qml/QtQuick3D + +# remove matplotlib sample data +rm -rf dist/_internal/matplotlib/mpl-data/sample_data +# remove large unused fontTools source file +rm -rf dist/_internal/fontTools/misc/bezierTools.c # remove automatically collected libs that might break things on some installations (eg. Ubuntu 16.04) # so it is better to rely on the system installed once diff --git a/wiki/ReleaseHistory.md b/wiki/ReleaseHistory.md index a4415dc5a..c0ce5588f 100644 --- a/wiki/ReleaseHistory.md +++ b/wiki/ReleaseHistory.md @@ -17,7 +17,7 @@ v3.0.3 - adds control function to [Diedrich DR](https://artisan-scope.org/machines/diedrich/) machine setup and adds [Diedrich CR](https://artisan-scope.org/machines/diedrich/) machine setup * CHANGES - - start the scheduler automatically on connected to artisan.plus if there are incompleted scheduled items + - start the scheduler automatically on connected to artisan.plus if there are incomplete scheduled items * FIXES - updates Cropster XLS importer ([Issue #1685](../../../issues/1685)) @@ -25,6 +25,7 @@ v3.0.3 - fixes missing statistic content ([Discussion #1689](../../../discussions/1689)) - fixes a regression which prevented loading settings written (slightly broken) by Artisan v3.0 ([Discussion #1692](../../../discussions/1692)) - fixes a regression communicating with some serial MODBUS devices resulting from a more strict protocol interpretation by the underlying MODBUS pymodbus lib 3.7 introduced in Artisan v3.0.2, by adding a 'strict' flag (default off) to the serial MODBUS configuration ([Issue #1694](../../../issues/1694)) + - removes incorrectly reconstructed custom events outside of the CHARGE to DROP period on quitting the designer ([Discussion #1696](../../../discussions/1696))