From 40af0afda8719de1305e42e17ae7bb25e730ffb9 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 12 Nov 2024 13:26:16 +0300 Subject: [PATCH] =?UTF-8?q?dev:=20=D0=BD=D0=B0=D1=87=D0=B0=D0=BB=D0=BE=20?= =?UTF-8?q?=D1=8D=D1=82=D0=B0=D0=BF=D0=B0=20=D0=B8=D0=B4=D0=B5=D0=B0=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=81=D0=BE=D0=B2=D0=BC=D0=B5=D1=89=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=20=D1=81=20=D1=8D=D1=82=D0=B0=D0=BF=D0=BE=D0=BC=20=D0=B2?= =?UTF-8?q?=20=D1=80=D0=B5=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/system_params.json | 8 ++- src/__pycache__/main.cpython-310.pyc | Bin 407 -> 407 bytes src/gui/__pycache__/app.cpython-310.pyc | Bin 2663 -> 2770 bytes .../__pycache__/plot_window.cpython-310.pyc | Bin 7871 -> 8153 bytes src/gui/app.py | 22 +++--- src/gui/plot_window.py | 64 +++++++++++------- src/uml/__pycache__/creator.cpython-310.pyc | Bin 3677 -> 3646 bytes src/uml/creator.py | 26 +++---- .../diagram_parser.cpython-310.pyc | Bin 1821 -> 2549 bytes src/utils/diagram_parser.py | 43 ++++++++---- 10 files changed, 104 insertions(+), 59 deletions(-) diff --git a/params/system_params.json b/params/system_params.json index f6e5bd7..017e7fb 100644 --- a/params/system_params.json +++ b/params/system_params.json @@ -15,5 +15,9 @@ "position_start_2": 0.08, "k_prop": 0.05, "time_capture": 100000, - "UML_time_scaler": 1000 -} \ No newline at end of file + "UML_time_scaler": 1000, + "Closure_signal": "Closing", + "Squeeze_signal": "Squeeze", + "Welding_signal": "Welding", + "Release_signal": "Relief" +} diff --git a/src/__pycache__/main.cpython-310.pyc b/src/__pycache__/main.cpython-310.pyc index 4de2b3b108740991e288b7e93ad7e06b1587bbe9..3acb9f68361e67477093a6ae0aca2ee71915bd5b 100644 GIT binary patch delta 19 ZcmbQvJe`>Y1a|-c delta 19 ZcmbQvJe`>1eO2* diff --git a/src/gui/__pycache__/app.cpython-310.pyc b/src/gui/__pycache__/app.cpython-310.pyc index 9cc4f0dd9836166b3aacd826031928f9c4b41be2..637919c6a889b0c59abc4cdfc9e72add4eea4d09 100644 GIT binary patch delta 1235 zcmZ`&TTc@~6yDj(>~y=`UT84^Q2_xrntH!K7?BX35D_1YCY!apme!Uwvx^!f>4PLb z7!u?B0r(023`63BkNXEq^u=e0iRVng7L;!0>p5q>Jv;M#GvABfN=_@2u@v~toxNOr zmiz3ilPfnMjg^1|>IPX;JQAyc7U*kAU3;fNu0w7F^lxsgDVtP$B_D_>s%nK4#I`y| z88opqF|56x%0tLY0Er&>v7cDAAoLqvTx*8BfO8TC#24+pm4f^pjOd3L)30}86F#E` zx?Bi@m~Ey4V~Y?)#?}`6dubWlGS0}@k#RQ8K?Yl>t1xf_$V5gKMn0e$(A_J<1CZ^r ziV)-0y3CtE4NOTZL9tXHJd(P{Bubz>R9q&0>Q79U@KdlCF>8z#uU;xwqL;48PeMhO zc}cuAhM5gI)K;pI_-G7G_D`pgcpPCAVGLm$z&$3mjayGgAWYIdDI>07g|>Yjg*-8% zFrGoR)73DZZnYXSwMr~IB{o!M8!bPUCG49xP+A02miE>%LtT;JW$6dkP+qC#W&`(&CH z9wm7u)VWE`Qd|Z^7Al}q*vQ;H9`;XhpTeD zF$wVw>uy8&&N+bSGyuwt!drcE(_PE#iEZtQRkrA6u$vw&w_bG@`aes{z*!Q%*xYgv zBDsx3Z`7hVF`na5>23#&=eP=v{J!ONZ!p&I0^^8~#uP>d)68HKc1g}8%=4OlZN>8v zv6*^24abyM%GK2xH}Pe3TJrcch!Wa-@!)Q|o#=7c1Pot?m4Ch|Zd>E21&dHnL;w8; DU1;?% delta 1096 zcmZuwOKTHR6rMZpxigujNm`^uZ7n_qG=fxow4i8_;-X5$g{?3QnQ5GmG~v#Tf&{au zAShkP{Q6S5+P!VsnThs=A9ai>1xcY@Y zyu#YCV||wp7z$!%7l)%Vc4h4G0x%e}p~Au;ao2<8$Hq1c8IJKHuwlhG#5lUFicMKj z0$ysA|EVgElo2IX?kIsJzU%AazA;;wzf`Sd4+E3U;2CBS;7rE!`BL_v{V2>5&eP3$ z7H)JmYkyRESb7-Y7{VMtP!ZpZ%U6y-n7e75M9q+=tt4YEW-REn6!9o`>j}TsZa0_G z8kY~}9%ODb+Y!f{;YBJ&}UJ0QyKh()c89S7cLV_0?q z!9+NTfLgOt2vvl$2=a9Yrm!=R11SgUfrL?@GQ7Jv3IEox0OdgCCW zxlhfZcywQUu~!2*s*ZPMFyH^IISt)b#JaP*FaeRAKG&OR#&cr>T_2nR4P-b0!}^iY zetlSW=EW0ws3<%9hKhJi N=bW3Am~ce>$4~l(+)w}j diff --git a/src/gui/__pycache__/plot_window.cpython-310.pyc b/src/gui/__pycache__/plot_window.cpython-310.pyc index b7f7742593d730eb5971ee68e58c4d5e39a973a1..bbd9a956cfd471119db128c15646ceebedf7d3e3 100644 GIT binary patch delta 3465 zcmaJDZERde@$J6P`}EiK;_ui_f^tBEFGfkB2}#qGwvjPTVmb6R<$AtdpWog2-Fe@; z+E+buks1p8Kq@?`m7tXzAwdyBsQ71p1pe>`Q3-w^@q|PrkcfX23Gs_k2s3+UJ2okI zdb6{$GqW?ZGqZd5{2wl)>#0;+f#1(g&Xhm@=y%dTX(wTJ5kBv209>&NQ*6ozR~dy* zpq)ZsI@x}0Ptvu;!v+Wr2`nN7x{YDK^B0VNA0THVR`88)M@z_OhdF0>(Zzd0oj(g)8KlT$J>kRmUxR z1?H6ek_9g8{t#E;dlEj6g})|~UkZ#sDd@ft5T*_(uMn7-0cF~d0+_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U0#XxxV?qxULL*gGL-4Ve9l9ytPPB!;$PAM9@DG`Ro=Ekpi!9}0;!e)lzVos;1~OrHtJ9K*Z{HVD=S2AH)&n=2 zieP7cwk#I&QW+9emach__KyH`kUeA{870Fc-AHijp{83f8iY0itqa<5^71Bc8zIL} z;yU91_bA-Na;YpL9ZF^}H+@fw)QaOpnrAOU{j;HRohvVUzP(t1`WODZ{dzY#EzTmG zN01dh6OMND7G8vLWJr5{e9f^WVR`w#7d@xPmzTJay5Oub6*kB8LREatX}*g`!TO!e z?|1x}ygCHrmV9n-6XG?53jot%5=q?NmVAgV;_wo}X@tuNuOM6rf7A8S_ym&p7>KVR z+(5uhh?@vlsKgrx&n#2n#qP0_vS`M~hJxsX*j-evcLjM*9;Y}CyzgxOxcghA@2fc7 z*v7xeFuVy<$h#Ka?%96`%a+WOIONxHh&AZhZin}K`j74UEh{S)Rr&bcx`y==DzJ1K z4KsE1@EFrp59i0kt#4=db~U;ACdhoW`Gu@b_F>eD(BP+?mJyaA-Ddsqlo$_h_db7G zy4G-D=Y?+sh*5it(HUrkr(Tt}!1ROgLGOdQOiw)29Fd{OnL>u4>7;Csh>vRqWs`DW zjIMz7RcI?mpg$tu$zQU4eyJ<_l{>*6WqvOsQBFZur4arfoO#<1K_g8QS+hm#@K+ diff --git a/src/gui/app.py b/src/gui/app.py index d5deeaa..9c5c413 100644 --- a/src/gui/app.py +++ b/src/gui/app.py @@ -9,7 +9,7 @@ from src.gui import PlotWindow, settingsWindow class app: def __init__(self): - self.parser = DiagramParser() + self.request_generator = Request(server_url='http://www.plantuml.com/plantuml/svg/') self.operSettings = settingsWindow("params\operator_params.json", 'Operator', self._update_settings) @@ -26,19 +26,21 @@ class app: def _load_preset(self): self.operator_params = read_json("params/operator_params.json") self.system_params = read_json("params/system_params.json") - + self.opt_algorithm = OptAlgorithm(operator_config=self.operator_params, system_config=self.system_params) self.ideal_times = self._get_ideal_timings(self.opt_algorithm) - - self.parser.setData("trace_samples/2024_11_08-19_30_49.csv") + self.parser = DiagramParser(system_config=self.system_params) + self.parser.setData("trace_samples/2024_11_08-19_30_52.csv") self.bool_dict = self.parser.getBoolDict() self.float_dict = self.parser.getFloatDict() + self.timings_dict = self.parser.getRealTimings() self.plotter = PlotWindow(operator_config=self.operator_params, system_config=self.system_params, opt=self.opt_algorithm, bool_dict=self.bool_dict, float_dict=self.float_dict, + timings_dict=self.timings_dict, show_settings_func=self._show_settings) self.uml_creator = UMLCreator(operator_config=self.operator_params, @@ -46,14 +48,16 @@ class app: request_generator=self.request_generator, ideal_time=self.ideal_times, bool_dict=self.bool_dict, - float_dict=self.float_dict) + float_dict=self.float_dict, + timings_dict=self.timings_dict) self.uml_creator.update_uml(operator_config=self.operator_params, system_config=self.system_params, request_generator=self.request_generator, ideal_time=self.ideal_times, bool_dict=self.bool_dict, - float_dict=self.float_dict) + float_dict=self.float_dict, + timings_dict=self.timings_dict) def _update_settings(self, _): @@ -67,13 +71,15 @@ class app: request_generator=self.request_generator, ideal_time=self.ideal_times, bool_dict=self.bool_dict, - float_dict=self.float_dict) + float_dict=self.float_dict, + timings_dict=self.timings_dict) self.plotter.update_data(operator_config=self.operator_params, system_config=self.system_params, opt=self.opt_algorithm, bool_dict=self.bool_dict, - float_dict=self.float_dict) + float_dict=self.float_dict, + timings_dict=self.timings_dict) def _show_settings(self): self.operSettings.show() diff --git a/src/gui/plot_window.py b/src/gui/plot_window.py index 98107b2..ad7225b 100644 --- a/src/gui/plot_window.py +++ b/src/gui/plot_window.py @@ -13,11 +13,14 @@ class PlotWindow: operator_config: dict, opt: OptAlgorithm, bool_dict: dict, - float_dict: dict, show_settings_func): + float_dict: dict, + timings_dict: dict, + show_settings_func): pg.setConfigOptions(antialias=True) self.opt = opt self.bool_dict = bool_dict self.float_dict = float_dict + self.timings_dict = timings_dict self.scaler = int(system_config['UML_time_scaler']) self.WeldTime = operator_config['time_wielding'] #[sec] self.alpha = 100 #[0-255 прозрачность фона] @@ -32,10 +35,12 @@ class PlotWindow: operator_config: dict, opt: OptAlgorithm, bool_dict: dict, - float_dict: dict): + float_dict: dict, + timings_dict: dict): self.opt = opt self.bool_dict = bool_dict self.float_dict = float_dict + self.timings_dict = timings_dict self.scaler = int(system_config['UML_time_scaler']) self.WeldTime = operator_config['time_wielding'] #[sec] self._getIdealTimings() @@ -95,40 +100,53 @@ class PlotWindow: self.p13.clear() self.l13.clear() - self._plotRealData() - times = np.arange(20000)/10 - self._plotIdealData(times) + timings = self._plotRealData() + #timings = np.arange(20000)/10 + self._plotIdealData(timings) def _getIdealTimings(self): data = self.opt.Ts self.idealTime = [data['tclose'], data['tgrow'], self.opt.getMarkOpen(), data["tmovement"]] def _form_idealdatGraph(self, times): - self.idealPhase0 = (self.idealTime[0])*self.scaler #Подъезд - self.idealPhase1 = (self.idealTime[0]+ self.idealTime[1])*self.scaler #Сжатие - self.idealPhase2 = (self.idealTime[0]+ self.idealTime[1] + self.WeldTime)*self.scaler #Сварка - self.idealPhase3 = (self.idealTime[0]+ self.idealTime[1] + self.idealTime[2] + self.WeldTime)*self.scaler #Разъезд - self.idealPhase4 = (sum(self.idealTime[:4]) + self.WeldTime)*self.scaler #Последнее смыкание #TODO добавить идеальное время вместо 0.25 - self.x_splitter = np.array([[0, self.idealPhase0], - [self.idealPhase0, self.idealPhase1], - [self.idealPhase1, self.idealPhase2], - [self.idealPhase2, self.idealPhase3], - [self.idealPhase3, self.idealPhase4]]) + closure_start = self.timings_dict["closure"][0]*self.scaler + compression_start = self.timings_dict["compression"][0]*self.scaler + welding_start = self.timings_dict["welding"][0]*self.scaler + opening_start = self.timings_dict["opening"][0]*self.scaler + opening_end = self.timings_dict["opening"][1]*self.scaler + + self.idealPhase0 = closure_start + (self.idealTime[0])*self.scaler #Подъезд + self.idealPhase1 = compression_start + (self.idealTime[1])*self.scaler #Сжатие + self.idealPhase2 = welding_start + (self.WeldTime)*self.scaler #Сварка + self.idealPhase3 = opening_start + (self.idealTime[2])*self.scaler #Разъезд + self.idealPhase4 = opening_end + (self.idealTime[3])*self.scaler #Последнее смыкание + + self.x_splitter = np.array([[closure_start, self.idealPhase0], + [compression_start, self.idealPhase1], + [welding_start, self.idealPhase2], + [opening_start, self.idealPhase3], + [opening_end, self.idealPhase4]]) data = [] for time in times: - if time <= self.idealPhase0: - x_fe, x_me, v_fe, v_me, f = self.opt.calcPhaseClose(time/self.scaler) - elif time <= self.idealPhase1: - x_fe, x_me, v_fe, v_me, f = self.opt.calcPhaseGrow(time/self.scaler-self.idealTime[0]) - elif time <= self.idealPhase2: + if time >= closure_start and time <= self.idealPhase0: + x_fe, x_me, v_fe, v_me, f = self.opt.calcPhaseClose((time-closure_start)/self.scaler) + elif time >= compression_start and time <= self.idealPhase1: + x_fe, x_me, v_fe, v_me, f = self.opt.calcPhaseGrow((time-compression_start)/self.scaler) + elif time >= welding_start and time <= self.idealPhase2: x_fe, x_me, v_fe, v_me, f = data[-1] - elif time <= self.idealPhase3: - x_fe, x_me, v_fe, v_me, f = self.opt.calcPhaseOpen(time/self.scaler-self.idealTime[0]-self.idealTime[1]-self.WeldTime) + elif time >= opening_start and time <= self.idealPhase3: + x_fe, x_me, v_fe, v_me, f = self.opt.calcPhaseOpen((time-opening_start)/self.scaler) + elif time >= opening_end and time <= self.idealPhase4: + x_fe, x_me, v_fe, v_me, f = self.opt.calcPhaseMovement((time-opening_end)/self.scaler) else: - x_fe, x_me, v_fe, v_me, f = self.opt.calcPhaseMovement(time/self.scaler-sum(self.idealTime[:3])-self.WeldTime) + if data: + x_fe, x_me, v_fe, v_me, f = data[-1] + else: + x_fe, x_me, v_fe, v_me, f = 0,0,0,0,0 data.append([x_fe, x_me, v_fe, v_me, f]) data = np.array(data).T return data + def _plotRealData(self): for i, (key, dat) in enumerate(self.float_dict.items()): diff --git a/src/uml/__pycache__/creator.cpython-310.pyc b/src/uml/__pycache__/creator.cpython-310.pyc index 3a905a851a99c92e1544732cc1f0c69520b86910..b95c8449c209b4d7c1e726cbe39f7efff34961a5 100644 GIT binary patch delta 1753 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;+NRU YGeLrvLx| diff --git a/src/uml/creator.py b/src/uml/creator.py index 9277588..5803b97 100644 --- a/src/uml/creator.py +++ b/src/uml/creator.py @@ -8,31 +8,30 @@ class UMLCreator: request_generator: Request, ideal_time: list[float], bool_dict: dict, - float_dict: dict): + float_dict: dict, + timings_dict: dict): self._request_generator = request_generator self._ideal_time = ideal_time self.bool_dict = bool_dict self.float_dict = float_dict + self.timings_dict = timings_dict self.scaler = int(system_config['UML_time_scaler']) self.WeldTime = operator_config['time_wielding'] def _build_data(self): - sig = [ - "Closing", - "Relief", - "Squeeze", - "Welding" - ] - closure = [self.bool_dict[sig[0]][1][0], self.bool_dict[sig[0]][2][0]] - compression = [self.bool_dict[sig[2]][1][0], self.bool_dict[sig[2]][2][0]] - opening = [self.bool_dict[sig[1]][1][0], self.bool_dict[sig[1]][-1][0]] + closure = self.timings_dict["closure"] + compression = self.timings_dict["compression"] + welding = self.timings_dict["welding"] + opening = self.timings_dict["opening"] real_data = [ [closure[0]*self.scaler, 'closure #green'], [closure[1]*self.scaler, '{-}'], [compression[0]*self.scaler+0.0001, 'compression #green'], - [compression[1]*self.scaler, 'welding #green'], + [compression[1]*self.scaler, '{-}'], + [welding[0]*self.scaler+0.0001, 'welding #green'], + [welding[1]*self.scaler, '{-}'], [opening[0]*self.scaler+0.0001, 'opening #green'], [opening[1]*self.scaler, '{-}'], ] @@ -101,14 +100,17 @@ class UMLCreator: request_generator: Request, ideal_time: list[float], bool_dict: dict, - float_dict: dict): + float_dict: dict, + timings_dict: dict): self._request_generator = request_generator self._ideal_time = ideal_time self.bool_dict = bool_dict self.float_dict = float_dict + self.timings_dict = timings_dict self.scaler = int(system_config['UML_time_scaler']) self.WeldTime = operator_config['time_wielding'] + real, client, ideal, bool_ = self._build_data() self._generate_svg(real, client, ideal, bool_) diff --git a/src/utils/__pycache__/diagram_parser.cpython-310.pyc b/src/utils/__pycache__/diagram_parser.cpython-310.pyc index 156190627a62e3f6c376cfd90d117b5350430022..3f5647d67b12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sWOr^0!3tIrD|2C!{0Z!9LO(pj>SXCeNYkBM_0b;WJ4k zdrN#SxfC!8=|~qwN7keVqbuvO0b@;W$R>=QY{3nirqzwZp$f+@L!~1%pkQ&?P)C=K zq3dlB1-YUz`JI*|V3M4WYuf8@!*c1@yI~Q&05g#h64VYgLPyEzHBmJ<`1g0+r+v66 zP*JY?;p6@zu%SfGOY8>DFBifk%z^Z4W$wu z{;cV!z_@Xu5c%o7b$1r)Ye~hs@FGm=`)43xGJ}MU$cT2ytKAtZ7|u%8CL=Cso6Kn; zM$S1?pO@syEgAStOLjyq+!8o)&3X!P>eQ^irZ&iu$vD+U6qh-G5hvNeurxQ~b(SS& zD;P$__n;l0h3PQT5H-f8eQ z+w1YK?Eh#ER11u#O%RI^)E53gx~V%Tc0icgX_AG-lW)y72JiwWHzKIp9q5|6hsTh1 zD_Av`$8ZOlRG)&F?%#6Q+Qv<59Ks}_MMO>i2?8-fbY>M=sPQ40iGr4V4wZN=)X$~3 zVg)bRNJu~vaCAz()YXCHDV1Ufcv4ch(y30)8L;4BW_OlOo8XDkk1PM;{@5 z*z}8aG;VP9lXwRQTbHvH>A*GTkb?A!Dqg{Z&09rY@~d!0JIeJK=V5ST^~ zj59e&P;Umo#UxCs6;;P;u_Dzj3e2=kxxIVEAM2TYvhZQVr^q_x5s!KtzMAJXw-l~* n9N*2uREF9 dict: + return self.boolDict - def _getBoolChanges(self, signalName): + def getFloatDict (self) -> dict: + return self.floatDict + + def getRealTimings(self) -> dict: + return self.timingsDict + + def _getBoolChanges(self, signalName) -> list: timeCode = self.data['time'] signal_values = self.data[signalName] changes = [] @@ -38,7 +53,7 @@ class DiagramParser: return changes - def _getFloatChanges(self, signalName): + def _getFloatChanges(self, signalName) -> list: timeCode = self.data['time'] signal_values = self.data[signalName] changes = []