Skip to content
Snippets Groups Projects
Commit eeb8bf4d authored by ft-Demo's avatar ft-Demo
Browse files

commit by robo pro coding

parent ac8d90a4
No related branches found
No related tags found
No related merge requests found
Showing with 349 additions and 897 deletions
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<variables>
<variable id="@!Ly@CPr3eP`~ceVzrhQ">func</variable>
<variable id="(E@^,a%J0.[(@@uRt,0f">nfc_obj</variable>
</variables>
<block type="start_block" id="5r8Hf)nzFKt,AzMq]4)P" deletable="false" x="-313" y="-318">
<statement name="statement">
<block type="display_set_label_text" id=")S=7DR%pZxv0gvn+:0[Q">
<field name="instance_name">txt_label_version</field>
<value name="value">
<shadow type="text" id=";8tV9skg8kR+~Pm65cf!">
<field name="TEXT">Version 2024/4/15</field>
</shadow>
</value>
<block type="util_python" id="Dj!Q/gntl$YpH1Vssm}x">
<field name="value">#version 05.06.2024&amp;#10;#Bugs corrected:&amp;#10;# - "WAITING FOR ORDER" is the only status that allow orders in TXT4 Menu</field>
<next>
<block type="import_function_noreturn" id="`w4x#YJ[k0M?UR1Su9})">
<mutation parentId="xc~=wx+MD;WnZ%~eD.{f"/>
<field name="name">ini_stocks</field>
<data>xc~=wx+MD;WnZ%~eD.{f</data>
<block type="display_set_label_text" id=")S=7DR%pZxv0gvn+:0[Q">
<field name="instance_name">txt_label_version</field>
<value name="value">
<shadow type="text" id=";8tV9skg8kR+~Pm65cf!">
<field name="TEXT">Version 2024/06/05</field>
</shadow>
</value>
<next>
<block type="import_function_noreturn" id="KqR,gH-d!Z.M?|{%fjBo" inline="true">
<mutation parentId="GpNR?4P@FL?f3(jp^K8R"/>
<field name="name">initlib_log</field>
<data>GpNR?4P@FL?f3(jp^K8R</data>
<value name="lev">
<block type="math_number" id="5sMd`*.=k%dAok8`b(,.">
<field name="NUM">2</field>
</block>
</value>
<block type="import_function_noreturn" id="`w4x#YJ[k0M?UR1Su9})">
<mutation parentId="xc~=wx+MD;WnZ%~eD.{f" parentFilename="lib/Factory_Variables.py"/>
<field name="name">ini_stocks</field>
<data>{"id":"xc~=wx+MD;WnZ%~eD.{f","filename":"lib/Factory_Variables.py"}</data>
<next>
<block type="variables_set" id="bwk/Rho2Oj/W.ixs]q1/">
<field name="VAR" id="(E@^,a%J0.[(@@uRt,0f">nfc_obj</field>
<value name="VALUE">
<block type="import_function_return" id="|AQJE.V6~T!=P=jrz@u{">
<mutation parentId="(y6Yn(xC,ATdGc~b5x:D"/>
<field name="name">nfc_init</field>
<data>(y6Yn(xC,ATdGc~b5x:D</data>
<block type="import_function_noreturn" id="KqR,gH-d!Z.M?|{%fjBo" inline="true">
<mutation parentId="GpNR?4P@FL?f3(jp^K8R" parentFilename="lib/Log.py"/>
<field name="name">initlib_log</field>
<data>{"id":"GpNR?4P@FL?f3(jp^K8R","filename":"lib/Log.py"}</data>
<value name="lev">
<block type="math_number" id="5sMd`*.=k%dAok8`b(,.">
<field name="NUM">2</field>
</block>
</value>
<next>
<block type="import_function_noreturn" id="SNhe2.mQe*9Aj85vm~R5">
<mutation parentId="lpc^*Ft_iUDu`:W$utgZ"/>
<field name="name">mosquitto_restart</field>
<data>lpc^*Ft_iUDu`:W$utgZ</data>
<block type="variables_set" id="bwk/Rho2Oj/W.ixs]q1/">
<field name="VAR" id="(E@^,a%J0.[(@@uRt,0f">nfc_obj</field>
<value name="VALUE">
<block type="import_function_return" id="|AQJE.V6~T!=P=jrz@u{">
<mutation parentId="(y6Yn(xC,ATdGc~b5x:D" parentFilename="lib/Nfc.py"/>
<field name="name">nfc_init</field>
<data>{"id":"(y6Yn(xC,ATdGc~b5x:D","filename":"lib/Nfc.py"}</data>
</block>
</value>
<next>
<block type="import_function_noreturn" id="aC+0qL|+yd.);Q08]K)B">
<mutation parentId="5.8LXkA^m7G[pB^=`Df^"/>
<field name="name">init_config_MQTT</field>
<data>5.8LXkA^m7G[pB^=`Df^</data>
<block type="import_function_noreturn" id="SNhe2.mQe*9Aj85vm~R5">
<mutation parentId="lpc^*Ft_iUDu`:W$utgZ" parentFilename="lib/MQTT_Broker.py"/>
<field name="name">mosquitto_restart</field>
<data>{"id":"lpc^*Ft_iUDu`:W$utgZ","filename":"lib/MQTT_Broker.py"}</data>
<next>
<block type="import_function_noreturn" id="^J]E{a,uNS?6_Jq`c%j@">
<mutation parentId="C$zGqbZO6{R56Y@8:mVB"/>
<field name="name">ini_bridge</field>
<data>C$zGqbZO6{R56Y@8:mVB</data>
<block type="import_function_noreturn" id="aC+0qL|+yd.);Q08]K)B">
<mutation parentId="5.8LXkA^m7G[pB^=`Df^" parentFilename="lib/MQTT.py"/>
<field name="name">init_config_MQTT</field>
<data>{"id":"5.8LXkA^m7G[pB^=`Df^","filename":"lib/MQTT.py"}</data>
<next>
<block type="util_python" id="v*vzIqbKTK_rVl]-{m1y">
<field name="value">&amp;#10;&amp;#10;threads_info = [&amp;#10; {"func": thread_ftCloud, "thread": None},&amp;#10; {"func": bridge_Monitoring, "thread": None},&amp;#10; {"func": thread_Local, "thread": None},&amp;#10; {"func":tr_Order_Status ,"thread":None}&amp;#10;]&amp;#10;&amp;#10;for info in threads_info:&amp;#10; info["thread"] = start_thread(info["func"])</field>
<block type="import_function_noreturn" id="^J]E{a,uNS?6_Jq`c%j@">
<mutation parentId="C$zGqbZO6{R56Y@8:mVB" parentFilename="lib/MQTT_Bridge.py"/>
<field name="name">ini_bridge</field>
<data>{"id":"C$zGqbZO6{R56Y@8:mVB","filename":"lib/MQTT_Bridge.py"}</data>
<next>
<block type="import_function_noreturn" id="ICKxpZ[Da-,:X4`J)ZtV">
<mutation parentId="o;M#rBk%|jUB36$/t]Wv"/>
<field name="name">start_publish_threads</field>
<data>o;M#rBk%|jUB36$/t]Wv</data>
<block type="util_python" id="v*vzIqbKTK_rVl]-{m1y">
<field name="value">&amp;#10;&amp;#10;threads_info = [&amp;#10; {"func": thread_ftCloud, "thread": None},&amp;#10; {"func": bridge_Monitoring, "thread": None},&amp;#10; {"func": thread_Local, "thread": None},&amp;#10; {"func":tr_Order_Status ,"thread":None}&amp;#10;]&amp;#10;&amp;#10;for info in threads_info:&amp;#10; info["thread"] = start_thread(info["func"])</field>
<next>
<block type="loop_endless" id="2E{]QhQ@YfQdp3C[Sf}@">
<statement name="DO">
<block type="util_python" id="^F^Fm1dK0NjZv1+r2|z2">
<field name="value">#watchdog&amp;#10; for info in threads_info:&amp;#10; if not info["thread"].is_alive():&amp;#10; logging.warning("Thread {} died. Restarting...".format(info['func'].__name__))&amp;#10; info["thread"] = start_thread(info["func"])&amp;#10; time.sleep(2)</field>
<block type="import_function_noreturn" id="ICKxpZ[Da-,:X4`J)ZtV">
<mutation parentId="o;M#rBk%|jUB36$/t]Wv" parentFilename="lib/MQTT.py"/>
<field name="name">start_publish_threads</field>
<data>{"id":"o;M#rBk%|jUB36$/t]Wv","filename":"lib/MQTT.py"}</data>
<next>
<block type="loop_endless" id="2E{]QhQ@YfQdp3C[Sf}@">
<statement name="DO">
<block type="util_python" id="^F^Fm1dK0NjZv1+r2|z2">
<field name="value">#watchdog&amp;#10; for info in threads_info:&amp;#10; if not info["thread"].is_alive():&amp;#10; logging.warning("Thread {} died. Restarting...".format(info['func'].__name__))&amp;#10; info["thread"] = start_thread(info["func"])&amp;#10; time.sleep(2)</field>
</block>
</statement>
</block>
</statement>
</next>
</block>
</next>
</block>
......
......@@ -26,7 +26,10 @@ def start_thread(func):
display.set_attr("txt_label_version.text", str('Version 2024/4/15'))
#version 05.06.2024
#Bugs corrected:
# - "WAITING FOR ORDER" is the only status that allow orders in TXT4 Menu
display.set_attr("txt_label_version.text", str('Version 2024/06/05'))
ini_stocks()
initlib_log(2)
nfc_obj = nfc_init()
......
This diff is collapsed.
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<variables>
<variable id="$jP:2[G.h5L^R(N~]EJU">client</variable>
<variable id="R8jmJ9V`m*}}g.?rmH]3">state</variable>
......
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<variables>
<variable id="J|VHn@I3jX3?+oT*dEco">lev</variable>
</variables>
......@@ -16,9 +16,9 @@
<field name="value">#TRACE0_MQTT, TRACE_MQTT, DEBUG_MQTT</field>
<next>
<block type="import_function_noreturn" id="g^|@8|g)c+r|tMVErs!+" inline="true">
<mutation parentId="WNs|FIoHPysw~QC/pcQ#"/>
<mutation parentId="WNs|FIoHPysw~QC/pcQ#" parentFilename="lib/MQTT_Broker.py"/>
<field name="name">initlog_MQTT</field>
<data>WNs|FIoHPysw~QC/pcQ#</data>
<data>{"id":"WNs|FIoHPysw~QC/pcQ#","filename":"lib/MQTT_Broker.py"}</data>
<value name="_tr0">
<block type="math_number" id="aFG7R=eQhlrrb.`c71LV">
<field name="NUM">0</field>
......@@ -39,9 +39,9 @@
<field name="value">#TRACE0_FCL, TRACE_FCL, DEBUG_FCL</field>
<next>
<block type="import_function_noreturn" id="`vq^S?-Z,kRX*:cv2K3`" inline="true">
<mutation parentId="kM|#w4).nQ$SC3F_{p,W"/>
<mutation parentId="kM|#w4).nQ$SC3F_{p,W" parentFilename="lib/MQTT.py"/>
<field name="name">initlog_FCL</field>
<data>kM|#w4).nQ$SC3F_{p,W</data>
<data>{"id":"kM|#w4).nQ$SC3F_{p,W","filename":"lib/MQTT.py"}</data>
<value name="_tr0">
<block type="math_number" id="$JR}~kfBJozb4IGXeH_C">
<field name="NUM">0</field>
......@@ -62,9 +62,9 @@
<field name="value">#TRACE0_NFC, TRACE_NFC, DEBUG_NFC</field>
<next>
<block type="import_function_noreturn" id="0aTwp?w0mw:b$mYt|%KD" inline="true">
<mutation parentId="+9dMr;*]JDwo`a9dZY^0"/>
<mutation parentId="+9dMr;*]JDwo`a9dZY^0" parentFilename="lib/Nfc.py"/>
<field name="name">initlog_NFC</field>
<data>+9dMr;*]JDwo`a9dZY^0</data>
<data>{"id":"+9dMr;*]JDwo`a9dZY^0","filename":"lib/Nfc.py"}</data>
<value name="_tr0">
<block type="math_number" id="UeLb0HF8C*!VM/,9QstN">
<field name="NUM">0</field>
......
This diff is collapsed.
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<variables>
<variable id="TY1]uh1l_N-ka-%aE,zz">bridge_client</variable>
<variable id="y/35]wNG6U87gGY:~R:c">line_link</variable>
......@@ -75,9 +75,9 @@
<block type="controls_if" id="=PY(TxFW-e*^~%;T~Rsz">
<value name="IF0">
<block type="import_function_return" id="[y(E?//}ZkZy.ktdG6^d">
<mutation parentId="h;%@`#eH.]+QjUKoqp1$"/>
<mutation parentId="h;%@`#eH.]+QjUKoqp1$" parentFilename="lib/Factory_Variables.py"/>
<field name="name">get_cloud_active</field>
<data>h;%@`#eH.]+QjUKoqp1$</data>
<data>{"id":"h;%@`#eH.]+QjUKoqp1$","filename":"lib/Factory_Variables.py"}</data>
</block>
</value>
<statement name="DO0">
......
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<variables>
<variable id="?e}KOZ-s/b-DY5{q@3!%">_tr0</variable>
<variable id="okgE+p-N96bha3$|6f)M">_tr</variable>
......@@ -123,7 +123,7 @@
</value>
<next>
<block type="util_thread" id="!|RF27OiYqOCSs63J+;M">
<field name="dropdown_event">vXmh7J:+)}y^|w}.`5|,</field>
<field name="dropdown_event">{"id":"vXmh7J:+)}y^|w}.`5|,","filename":"lib/MQTT_Broker.py"}</field>
</block>
</next>
</block>
......@@ -165,9 +165,9 @@
</value>
<value name="ADD0">
<block type="import_function_return" id="@jLY3I_?K|cLCG%|6.9#">
<mutation parentId="U?12/Q8q1j]T`Y+mRPW^"/>
<mutation parentId="U?12/Q8q1j]T`Y+mRPW^" parentFilename="lib/MQTT_Broker.py"/>
<field name="name">mosquitto_status_pid</field>
<data>U?12/Q8q1j]T`Y+mRPW^</data>
<data>{"id":"U?12/Q8q1j]T`Y+mRPW^","filename":"lib/MQTT_Broker.py"}</data>
</block>
</value>
</block>
......@@ -219,9 +219,9 @@
<field name="VAR" id="b7h2}jM2($C07:HMp[5r">pid</field>
<value name="VALUE">
<block type="import_function_return" id="qVZF@L9p.@;K+c]Z4[vc">
<mutation parentId="U?12/Q8q1j]T`Y+mRPW^"/>
<mutation parentId="U?12/Q8q1j]T`Y+mRPW^" parentFilename="lib/MQTT_Broker.py"/>
<field name="name">mosquitto_status_pid</field>
<data>U?12/Q8q1j]T`Y+mRPW^</data>
<data>{"id":"U?12/Q8q1j]T`Y+mRPW^","filename":"lib/MQTT_Broker.py"}</data>
</block>
</value>
<next>
......@@ -282,9 +282,9 @@
</value>
<value name="ADD0">
<block type="import_function_return" id="KCGqcx`uRp@jVKqbV/@+">
<mutation parentId="U?12/Q8q1j]T`Y+mRPW^"/>
<mutation parentId="U?12/Q8q1j]T`Y+mRPW^" parentFilename="lib/MQTT_Broker.py"/>
<field name="name">mosquitto_status_pid</field>
<data>U?12/Q8q1j]T`Y+mRPW^</data>
<data>{"id":"U?12/Q8q1j]T`Y+mRPW^","filename":"lib/MQTT_Broker.py"}</data>
</block>
</value>
</block>
......
This diff is collapsed.
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<variables>
<variable id="?e}KOZ-s/b-DY5{q@3!%">_tr0</variable>
<variable id="okgE+p-N96bha3$|6f)M">_tr</variable>
......
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<variables>
<variable id="/1MKG;CO)Onv1[q}fd:R">nfc_remote</variable>
<variable id="(V9)5EgT,)F6gr4tYX)(">cmd</variable>
......@@ -33,9 +33,9 @@
<field name="VAR" id="T..xGr{1w*mx%.TLb8Q8">nfc_data_uid</field>
<value name="VALUE">
<block type="import_function_return" id="g`hoLf}gx+ZOe@lf~lTB">
<mutation parentId="/5m9IJ,+l?7,x+?,a:6w"/>
<mutation parentId="/5m9IJ,+l?7,x+?,a:6w" parentFilename="lib/Nfc.py"/>
<field name="name">get_nfc_data_uid</field>
<data>/5m9IJ,+l?7,x+?,a:6w</data>
<data>{"id":"/5m9IJ,+l?7,x+?,a:6w","filename":"lib/Nfc.py"}</data>
</block>
</value>
<next>
......@@ -46,9 +46,9 @@
<field name="CASE">UPPERCASE</field>
<value name="TEXT">
<block type="import_function_return" id="$A(NH)4FiG(QHzD6p36O">
<mutation parentId="Yge)ej,WUBwGTvKXl%PW"/>
<mutation parentId="Yge)ej,WUBwGTvKXl%PW" parentFilename="lib/Nfc.py"/>
<field name="name">get_nfc_data_type_str</field>
<data>Yge)ej,WUBwGTvKXl%PW</data>
<data>{"id":"Yge)ej,WUBwGTvKXl%PW","filename":"lib/Nfc.py"}</data>
</block>
</value>
</block>
......@@ -61,9 +61,9 @@
<field name="CASE">UPPERCASE</field>
<value name="TEXT">
<block type="import_function_return" id="d;?`+@}k;dc-Wu-$!XMI">
<mutation parentId="}D~CgwFLewl#S;`%0ks1"/>
<mutation parentId="}D~CgwFLewl#S;`%0ks1" parentFilename="lib/Nfc.py"/>
<field name="name">get_nfc_data_state_str</field>
<data>}D~CgwFLewl#S;`%0ks1</data>
<data>{"id":"}D~CgwFLewl#S;`%0ks1","filename":"lib/Nfc.py"}</data>
</block>
</value>
</block>
......@@ -73,9 +73,9 @@
<field name="VAR" id="R7pLCO6e;!SgynU2zedR">nfc_data_mask_str</field>
<value name="VALUE">
<block type="import_function_return" id="976q/ROcW-$ZdRbt`b.0">
<mutation parentId="*![bE~mKJ(?W[OpOtA!?"/>
<mutation parentId="*![bE~mKJ(?W[OpOtA!?" parentFilename="lib/Nfc.py"/>
<field name="name">get_nfc_data_mask_str</field>
<data>*![bE~mKJ(?W[OpOtA!?</data>
<data>{"id":"*![bE~mKJ(?W[OpOtA!?","filename":"lib/Nfc.py"}</data>
</block>
</value>
<next>
......@@ -92,9 +92,9 @@
<mutation elseif="0" else="1"/>
<value name="IF0">
<block type="import_function_return" id="(7xo=iz@*sgs%v|c8,}e">
<mutation parentId="s%J1Isy=Z2J%~d,|gI3H"/>
<mutation parentId="s%J1Isy=Z2J%~d,|gI3H" parentFilename="lib/Nfc.py"/>
<field name="name">is_nfc_data_ts_list_valid</field>
<data>s%J1Isy=Z2J%~d,|gI3H</data>
<data>{"id":"s%J1Isy=Z2J%~d,|gI3H","filename":"lib/Nfc.py"}</data>
</block>
</value>
<statement name="DO0">
......@@ -110,9 +110,9 @@
<field name="VAR" id="K^a[GU(Li`U6%tnS%t2f">list_tsstr</field>
<value name="VALUE">
<block type="import_function_return" id="NXa%@-R76/H(I^{WxX;@">
<mutation parentId="V^f3TEE$5gUcjO$oajL]"/>
<mutation parentId="V^f3TEE$5gUcjO$oajL]" parentFilename="lib/Nfc.py"/>
<field name="name">get_nfc_data_tsstr_list</field>
<data>V^f3TEE$5gUcjO$oajL]</data>
<data>{"id":"V^f3TEE$5gUcjO$oajL]","filename":"lib/Nfc.py"}</data>
</block>
</value>
<next>
......@@ -334,9 +334,9 @@
</value>
<value name="ADD0">
<block type="import_function_return" id="Gt?E%@bYniW4FWHfRb[!">
<mutation parentId="$)Q!],s(azR.@p50io5,"/>
<mutation parentId="$)Q!],s(azR.@p50io5," parentFilename="lib/Time.py"/>
<field name="name">timestamp_utcnow</field>
<data>$)Q!],s(azR.@p50io5,</data>
<data>{"id":"$)Q!],s(azR.@p50io5,","filename":"lib/Time.py"}</data>
</block>
</value>
<value name="ADD1">
......@@ -372,9 +372,9 @@
<block type="controls_if" id="if+mYT${!bha57mCC^C2">
<value name="IF0">
<block type="import_function_return" id="XROxyRXn^3|91s8ReE8|">
<mutation parentId="h;%@`#eH.]+QjUKoqp1$"/>
<mutation parentId="h;%@`#eH.]+QjUKoqp1$" parentFilename="lib/Factory_Variables.py"/>
<field name="name">get_cloud_active</field>
<data>h;%@`#eH.]+QjUKoqp1$</data>
<data>{"id":"h;%@`#eH.]+QjUKoqp1$","filename":"lib/Factory_Variables.py"}</data>
</block>
</value>
<statement name="DO0">
......@@ -400,9 +400,9 @@
<block type="mqtt_is_connected" id="8Mw$Z*3?;;jDlL;7V/$:">
<value name="name">
<block type="import_function_return" id="b}*`+{s1P/,(T-,Ty-K#">
<mutation parentId="H]fm^NWrq{BAKNz4S^.n"/>
<mutation parentId="H]fm^NWrq{BAKNz4S^.n" parentFilename="lib/Factory_Variables.py"/>
<field name="name">get_client_local</field>
<data>H]fm^NWrq{BAKNz4S^.n</data>
<data>{"id":"H]fm^NWrq{BAKNz4S^.n","filename":"lib/Factory_Variables.py"}</data>
</block>
</value>
</block>
......@@ -411,9 +411,9 @@
<block type="mqtt_publish" id="Jn[IVIVG%A`%;Jszn_Pz">
<value name="name">
<block type="import_function_return" id="?=j,}3;6#*/y0j{?d#FY">
<mutation parentId="H]fm^NWrq{BAKNz4S^.n"/>
<mutation parentId="H]fm^NWrq{BAKNz4S^.n" parentFilename="lib/Factory_Variables.py"/>
<field name="name">get_client_local</field>
<data>H]fm^NWrq{BAKNz4S^.n</data>
<data>{"id":"H]fm^NWrq{BAKNz4S^.n","filename":"lib/Factory_Variables.py"}</data>
</block>
</value>
<value name="topic">
......@@ -540,9 +540,9 @@
<field name="VAR" id="Wa_}K)a!:acam|{CgO?C">res</field>
<value name="VALUE">
<block type="import_function_return" id="~].$Sg_s|mWCeo41e(kK">
<mutation parentId="%iZxGwF^A6rpPwS@3V{r"/>
<mutation parentId="%iZxGwF^A6rpPwS@3V{r" parentFilename="lib/Nfc.py"/>
<field name="name">nfc_read_uid</field>
<data>%iZxGwF^A6rpPwS@3V{r</data>
<data>{"id":"%iZxGwF^A6rpPwS@3V{r","filename":"lib/Nfc.py"}</data>
</block>
</value>
<next>
......@@ -562,9 +562,9 @@
</value>
<statement name="DO0">
<block type="import_function_noreturn" id=":8SR99P-#5P61WgUY!#B">
<mutation parentId="IIkg9RVO;{AX,6L,O[`L"/>
<mutation parentId="IIkg9RVO;{AX,6L,O[`L" parentFilename="lib/Sound.py"/>
<field name="name">beep_blocked</field>
<data>IIkg9RVO;{AX,6L,O[`L</data>
<data>{"id":"IIkg9RVO;{AX,6L,O[`L","filename":"lib/Sound.py"}</data>
<next>
<block type="display_set_label_text" id="nM;ADXg}@39-M,APGG;U">
<field name="instance_name">txt_label_message</field>
......@@ -649,9 +649,9 @@
<field name="VAR" id="Wa_}K)a!:acam|{CgO?C">res</field>
<value name="VALUE">
<block type="import_function_return" id="I8Nn:24FVH-~^u6Ds;ju">
<mutation parentId="Dx40]*M!ll`|51o6+CaK"/>
<mutation parentId="Dx40]*M!ll`|51o6+CaK" parentFilename="lib/Nfc.py"/>
<field name="name">nfc_read</field>
<data>Dx40]*M!ll`|51o6+CaK</data>
<data>{"id":"Dx40]*M!ll`|51o6+CaK","filename":"lib/Nfc.py"}</data>
</block>
</value>
<next>
......@@ -671,9 +671,9 @@
</value>
<statement name="DO0">
<block type="import_function_noreturn" id="Un2|2f%F}DT[Sk$QGT#N">
<mutation parentId="IIkg9RVO;{AX,6L,O[`L"/>
<mutation parentId="IIkg9RVO;{AX,6L,O[`L" parentFilename="lib/Sound.py"/>
<field name="name">beep_blocked</field>
<data>IIkg9RVO;{AX,6L,O[`L</data>
<data>{"id":"IIkg9RVO;{AX,6L,O[`L","filename":"lib/Sound.py"}</data>
<next>
<block type="display_set_label_text" id="LogRbA(o~%CXHMD~PK8g">
<field name="instance_name">txt_label_message</field>
......@@ -698,16 +698,16 @@
</value>
<value name="ADD0">
<block type="import_function_return" id="w8HgxBoe@/P|=6puK[Z7">
<mutation parentId="/5m9IJ,+l?7,x+?,a:6w"/>
<mutation parentId="/5m9IJ,+l?7,x+?,a:6w" parentFilename="lib/Nfc.py"/>
<field name="name">get_nfc_data_uid</field>
<data>/5m9IJ,+l?7,x+?,a:6w</data>
<data>{"id":"/5m9IJ,+l?7,x+?,a:6w","filename":"lib/Nfc.py"}</data>
</block>
</value>
<value name="ADD1">
<block type="import_function_return" id="hqaC`0|=MET9Q6yf$}%+">
<mutation parentId="Yge)ej,WUBwGTvKXl%PW"/>
<mutation parentId="Yge)ej,WUBwGTvKXl%PW" parentFilename="lib/Nfc.py"/>
<field name="name">get_nfc_data_type_str</field>
<data>Yge)ej,WUBwGTvKXl%PW</data>
<data>{"id":"Yge)ej,WUBwGTvKXl%PW","filename":"lib/Nfc.py"}</data>
</block>
</value>
</block>
......@@ -767,9 +767,9 @@
<field name="VAR" id="Wa_}K)a!:acam|{CgO?C">res</field>
<value name="VALUE">
<block type="import_function_return" id="BEu1DS)Ez!9MWd[g:*um">
<mutation parentId="_]qe%vqe/0MkHg!~.cg}"/>
<mutation parentId="_]qe%vqe/0MkHg!~.cg}" parentFilename="lib/Nfc.py"/>
<field name="name">nfc_delete</field>
<data>_]qe%vqe/0MkHg!~.cg}</data>
<data>{"id":"_]qe%vqe/0MkHg!~.cg}","filename":"lib/Nfc.py"}</data>
</block>
</value>
<next>
......@@ -789,9 +789,9 @@
</value>
<statement name="DO0">
<block type="import_function_noreturn" id="O(G)CYcpQ;JkA/ok0lKc">
<mutation parentId="IIkg9RVO;{AX,6L,O[`L"/>
<mutation parentId="IIkg9RVO;{AX,6L,O[`L" parentFilename="lib/Sound.py"/>
<field name="name">beep_blocked</field>
<data>IIkg9RVO;{AX,6L,O[`L</data>
<data>{"id":"IIkg9RVO;{AX,6L,O[`L","filename":"lib/Sound.py"}</data>
<next>
<block type="display_set_label_text" id="]!|5%R4dtM,-)jwq?J;r">
<field name="instance_name">txt_label_message</field>
......@@ -816,9 +816,9 @@
</value>
<value name="ADD0">
<block type="import_function_return" id=":_2{BMhSllyf]dQHC!_)">
<mutation parentId="/5m9IJ,+l?7,x+?,a:6w"/>
<mutation parentId="/5m9IJ,+l?7,x+?,a:6w" parentFilename="lib/Nfc.py"/>
<field name="name">get_nfc_data_uid</field>
<data>/5m9IJ,+l?7,x+?,a:6w</data>
<data>{"id":"/5m9IJ,+l?7,x+?,a:6w","filename":"lib/Nfc.py"}</data>
</block>
</value>
</block>
......@@ -930,9 +930,9 @@
<field name="OP">AND</field>
<value name="A">
<block type="import_function_return" id="j~)z}i0V%@W@B|i61)Kq">
<mutation parentId="!F~e(.1|o)lKd]hm8h}7"/>
<mutation parentId="!F~e(.1|o)lKd]hm8h}7" parentFilename="lib/Factory_Variables.py"/>
<field name="name">get_init_finished</field>
<data>!F~e(.1|o)lKd]hm8h}7</data>
<data>{"id":"!F~e(.1|o)lKd]hm8h}7","filename":"lib/Factory_Variables.py"}</data>
</block>
</value>
<value name="B">
......
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<variables>
<variable id="$`bMp6NG:sI.HnYy+Yey">COLOR</variable>
<variable id="O~8WCQ]%{Z}*!q7+5IO/">payload_order</variable>
......@@ -36,43 +36,23 @@
<block type="controls_if" id="g^(5NIF${qpLA17]o{zR">
<mutation elseif="0" else="1"/>
<value name="IF0">
<block type="logic_operation" id="!.ILr;!od3vW*IxQi#8P">
<field name="OP">OR</field>
<block type="logic_compare" id="Pcaw9*f:C`bangC][OZl">
<field name="OP">EQ</field>
<value name="A">
<block type="logic_compare" id="Pcaw9*f:C`bangC][OZl">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="*P_f[X6f_hyocIT@YiMm">
<field name="VAR" id="ea#:|bkIed^t5n9wTSIM">msg_status</field>
</block>
</value>
<value name="B">
<block type="text" id="vZG;tnMLJ:O9db}Py`K.">
<field name="TEXT">WAITING_FOR_ORDER</field>
</block>
</value>
<block type="variables_get" id="*P_f[X6f_hyocIT@YiMm">
<field name="VAR" id="ea#:|bkIed^t5n9wTSIM">msg_status</field>
</block>
</value>
<value name="B">
<block type="logic_compare" id=",?|2nT:E`5|`3gX?fUJd">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="%(926Il3=Z;/GUKXn-H`">
<field name="VAR" id="ea#:|bkIed^t5n9wTSIM">msg_status</field>
</block>
</value>
<value name="B">
<block type="text" id="J,i2},#Hy{Aj!Y*-;oK@">
<field name="TEXT">SHIPPED</field>
</block>
</value>
<block type="text" id="vZG;tnMLJ:O9db}Py`K.">
<field name="TEXT">WAITING_FOR_ORDER</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="util_python" id="x(U6~Pgfq$DJQt^xbk=d">
<field name="value">logging.info("Reay for order ")</field>
<field name="value">logging.info("Ready for order ")&amp;#10;#print("Ready for process")</field>
<next>
<block type="variables_set" id="D+q,xC`|4LmwVY8^]9Mo">
<field name="VAR" id="`UKiiI8V-w6*ZEx6~nl?">fabric_ready</field>
......@@ -87,7 +67,7 @@
</statement>
<statement name="ELSE">
<block type="util_python" id="h8lZf-$Pm5YbE5j}3)OZ">
<field name="value">logging.info("Order in process")</field>
<field name="value">logging.info("Order in process")&amp;#10;#print("Order in process")</field>
<next>
<block type="variables_set" id="9I3+!wCh5FJN{-+kF!ql">
<field name="VAR" id="`UKiiI8V-w6*ZEx6~nl?">fabric_ready</field>
......@@ -203,9 +183,9 @@
</value>
<value name="ADD1">
<block type="import_function_return" id="WFF`Mcv$BrEzqc0XG--{">
<mutation parentId="$)Q!],s(azR.@p50io5,"/>
<mutation parentId="$)Q!],s(azR.@p50io5," parentFilename="lib/Time.py"/>
<field name="name">timestamp_utcnow</field>
<data>$)Q!],s(azR.@p50io5,</data>
<data>{"id":"$)Q!],s(azR.@p50io5,","filename":"lib/Time.py"}</data>
</block>
</value>
</block>
......@@ -240,7 +220,7 @@
</value>
<next>
<block type="util_python" id="pL`DG2Aja7ykI_5p1UNe">
<field name="value">logging.info("Ordered by Menu, color: " + COLOR )</field>
<field name="value">logging.info("Ordered by Menu, color: " + COLOR )&amp;#10;print("Ordered by Menu, color: " + COLOR )</field>
</block>
</next>
</block>
......@@ -428,9 +408,9 @@
<field name="VAR" id="M_(Xb,/ZOGT@5M[`:!fa">n</field>
<value name="VALUE">
<block type="import_function_return" id="^B5Uchi)fQn9K{-+s@$~">
<mutation parentId="ZPaB}@2!L0Nceu{7QQ2*"/>
<mutation parentId="ZPaB}@2!L0Nceu{7QQ2*" parentFilename="lib/Factory_Variables.py"/>
<field name="name">get_stock</field>
<data>ZPaB}@2!L0Nceu{7QQ2*</data>
<data>{"id":"ZPaB}@2!L0Nceu{7QQ2*","filename":"lib/Factory_Variables.py"}</data>
<value name="Color">
<block type="variables_get" id="6[Yu_3mwyE^UkSqMZ+BS">
<field name="VAR" id="BiJ?zEc53cXL}3z2)a,U">j</field>
......@@ -779,9 +759,9 @@
</value>
<statement name="DO">
<block type="import_function_noreturn" id="7*_Hyq~j|R!.l{UFfst|">
<mutation parentId="zGt??BJU7Vb9q)qi!gk!"/>
<mutation parentId="zGt??BJU7Vb9q)qi!gk!" parentFilename="lib/Factory_Variables.py"/>
<field name="name">set_stocks</field>
<data>zGt??BJU7Vb9q)qi!gk!</data>
<data>{"id":"zGt??BJU7Vb9q)qi!gk!","filename":"lib/Factory_Variables.py"}</data>
<value name="Color">
<block type="variables_get" id="$uU2!_1+-Q3*RIn7;*_]">
<field name="VAR" id="|;)wA[@LX17W!RDj{y_1">k</field>
......@@ -873,9 +853,9 @@
</value>
<statement name="DO0">
<block type="import_function_noreturn" id="k,0utZ~u{!2xww5!/![R">
<mutation parentId="#r6.+,Omq5aOSGc7}[Fq"/>
<mutation parentId="#r6.+,Omq5aOSGc7}[Fq" parentFilename="lib/Factory_Variables.py"/>
<field name="name">increase_stocks</field>
<data>#r6.+,Omq5aOSGc7}[Fq</data>
<data>{"id":"#r6.+,Omq5aOSGc7}[Fq","filename":"lib/Factory_Variables.py"}</data>
<value name="Color">
<block type="variables_get" id="bo@]-Oz5o-Vbd3H7Fdg@">
<field name="VAR" id="F~vWQ%=/z?KqKD#fipl,">c</field>
......
......@@ -46,11 +46,13 @@ def mqtt_callback_order_status(message):
except Exception as e:
logging.error(e)
print(msg_status)
if msg_status == 'WAITING_FOR_ORDER' or msg_status == 'SHIPPED':
logging.info("Reay for order ")
if msg_status == 'WAITING_FOR_ORDER':
logging.info("Ready for order ")
#print("Ready for process")
fabric_ready = True
else:
logging.info("Order in process")
#print("Order in process")
fabric_ready = False
......@@ -78,6 +80,7 @@ def Order(COLOR):
payload_order = '{{"type":"{}","ts":"{}"}}'.format(COLOR, timestamp_utcnow())
order_client.publish(topic='f/o/order', payload=payload_order, qos=0, retain=False)
logging.info("Ordered by Menu, color: " + COLOR )
print("Ordered by Menu, color: " + COLOR )
def stocks_update():
......
This diff is collapsed.
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<variables>
<variable id="26@vwe$F?cxGARIAm=?N">pl</variable>
<variable id="H_%k!|m(+!CoE9hoJYeH">bme680_period</variable>
......@@ -27,9 +27,9 @@
<field name="OP">AND</field>
<value name="A">
<block type="import_function_return" id="zrl0Olgr3+DQb%zi01dY">
<mutation parentId="!F~e(.1|o)lKd]hm8h}7"/>
<mutation parentId="!F~e(.1|o)lKd]hm8h}7" parentFilename="lib/Factory_Variables.py"/>
<field name="name">get_init_finished</field>
<data>!F~e(.1|o)lKd]hm8h}7</data>
<data>{"id":"!F~e(.1|o)lKd]hm8h}7","filename":"lib/Factory_Variables.py"}</data>
</block>
</value>
<value name="B">
......@@ -52,9 +52,9 @@
<field name="value">msg = json.loads(pl.decode("utf-8"))&amp;#10;bme680_period = msg['period']</field>
<next>
<block type="import_function_noreturn" id="SBvN+Qf#uU^Fw!!+Zxb/" inline="true">
<mutation parentId="IOw}87u/N:1x;%!i|#u-"/>
<mutation parentId="IOw}87u/N:1x;%!i|#u-" parentFilename="lib/Factory_Variables.py"/>
<field name="name">set_bme680_period</field>
<data>IOw}87u/N:1x;%!i|#u-</data>
<data>{"id":"IOw}87u/N:1x;%!i|#u-","filename":"lib/Factory_Variables.py"}</data>
<value name="value">
<block type="variables_get" id="+Rr}Yov7v.5~?WX~s-yf">
<field name="VAR" id="H_%k!|m(+!CoE9hoJYeH">bme680_period</field>
......@@ -101,9 +101,9 @@
<field name="OP">AND</field>
<value name="A">
<block type="import_function_return" id="Jjx(GTd*a8fh;i%iEm3m">
<mutation parentId="!F~e(.1|o)lKd]hm8h}7"/>
<mutation parentId="!F~e(.1|o)lKd]hm8h}7" parentFilename="lib/Factory_Variables.py"/>
<field name="name">get_init_finished</field>
<data>!F~e(.1|o)lKd]hm8h}7</data>
<data>{"id":"!F~e(.1|o)lKd]hm8h}7","filename":"lib/Factory_Variables.py"}</data>
</block>
</value>
<value name="B">
......@@ -126,9 +126,9 @@
<field name="value">msg= json.loads(pl.decode("utf-8"))&amp;#10;ldr_period = msg['period']</field>
<next>
<block type="import_function_noreturn" id="uh)8xo^fHZ?@RJT}^^,h" inline="true">
<mutation parentId="@|5fklE;AcfCo8Z4F/9["/>
<mutation parentId="@|5fklE;AcfCo8Z4F/9[" parentFilename="lib/Factory_Variables.py"/>
<field name="name">set_ldr_period</field>
<data>@|5fklE;AcfCo8Z4F/9[</data>
<data>{"id":"@|5fklE;AcfCo8Z4F/9[","filename":"lib/Factory_Variables.py"}</data>
<value name="value">
<block type="variables_get" id="^r3H4^*-z0XRt;M.4T)!">
<field name="VAR" id="6dm:3M;sg|*bS6yM4n-3">ldr_period</field>
......@@ -167,9 +167,9 @@
<field name="OP">AND</field>
<value name="A">
<block type="import_function_return" id="~wN#YQTSY4+qFVT,ib[d">
<mutation parentId="!F~e(.1|o)lKd]hm8h}7"/>
<mutation parentId="!F~e(.1|o)lKd]hm8h}7" parentFilename="lib/Factory_Variables.py"/>
<field name="name">get_init_finished</field>
<data>!F~e(.1|o)lKd]hm8h}7</data>
<data>{"id":"!F~e(.1|o)lKd]hm8h}7","filename":"lib/Factory_Variables.py"}</data>
</block>
</value>
<value name="B">
......@@ -192,9 +192,9 @@
<field name="value">msg= json.loads(pl.decode("utf-8"))&amp;#10;camera_fps = msg['fps']&amp;#10;camera_on = msg['on']</field>
<next>
<block type="import_function_noreturn" id="Hr4uUS?fiO,WY.J3.F+Z" inline="true">
<mutation parentId="T:_Ip@07Z0p)*rwYfs9?"/>
<mutation parentId="T:_Ip@07Z0p)*rwYfs9?" parentFilename="lib/Factory_Variables.py"/>
<field name="name">set_camera_fps</field>
<data>T:_Ip@07Z0p)*rwYfs9?</data>
<data>{"id":"T:_Ip@07Z0p)*rwYfs9?","filename":"lib/Factory_Variables.py"}</data>
<value name="value">
<block type="variables_get" id="o^KUX2q3UEGLcKa!cx5f">
<field name="VAR" id="15Zj:53,tGMcx|W~/?m;">camera_fps</field>
......@@ -202,9 +202,9 @@
</value>
<next>
<block type="import_function_noreturn" id="y2SzkRL/dc2V0l[8b%8U" inline="true">
<mutation parentId="=6?N,~kcJYzPy5aHjA9k"/>
<mutation parentId="=6?N,~kcJYzPy5aHjA9k" parentFilename="lib/Factory_Variables.py"/>
<field name="name">set_camera_on</field>
<data>=6?N,~kcJYzPy5aHjA9k</data>
<data>{"id":"=6?N,~kcJYzPy5aHjA9k","filename":"lib/Factory_Variables.py"}</data>
<value name="value">
<block type="variables_get" id="JPAnJow6+d26`AzTEIIM">
<field name="VAR" id="RvP$8m_v-r3C_z(jKH-g">camera_on</field>
......@@ -240,9 +240,9 @@
<field name="value">logging.log(logging.TRACE_FCL, '-')</field>
<next>
<block type="import_function_noreturn" id="qm=)6y55VPf!@],)zovI" inline="true">
<mutation parentId="rD:`*:mZjhY.Y5aY{/C/"/>
<mutation parentId="rD:`*:mZjhY.Y5aY{/C/" parentFilename="lib/Factory_Variables.py"/>
<field name="name">set_cloud_active</field>
<data>rD:`*:mZjhY.Y5aY{/C/</data>
<data>{"id":"rD:`*:mZjhY.Y5aY{/C/","filename":"lib/Factory_Variables.py"}</data>
<value name="value">
<block type="logic_boolean" id="QG%mcn:Js*o_Oc~F4n65">
<field name="BOOL">TRUE</field>
......@@ -268,9 +268,9 @@
<field name="value">logging.log(logging.DEBUG_FCL, 'set keep alive value')</field>
<next>
<block type="import_function_noreturn" id="4dg%d]VATQQ!:n=!kAWw" inline="true">
<mutation parentId="[U!xf=[/#2^I1`?Q2[Ac"/>
<mutation parentId="[U!xf=[/#2^I1`?Q2[Ac" parentFilename="lib/Factory_Variables.py"/>
<field name="name">set_keep_alive</field>
<data>[U!xf=[/#2^I1`?Q2[Ac</data>
<data>{"id":"[U!xf=[/#2^I1`?Q2[Ac","filename":"lib/Factory_Variables.py"}</data>
<value name="value">
<block type="util_runtime_measurement" id="Q6xW[LRUWe0T:d/Q+Yj=">
<field name="TIME">SECOND</field>
......@@ -287,9 +287,9 @@
<field name="OP">AND</field>
<value name="A">
<block type="import_function_return" id="vyh*}vE9-AIGm`^hrk%A">
<mutation parentId="!F~e(.1|o)lKd]hm8h}7"/>
<mutation parentId="!F~e(.1|o)lKd]hm8h}7" parentFilename="lib/Factory_Variables.py"/>
<field name="name">get_init_finished</field>
<data>!F~e(.1|o)lKd]hm8h}7</data>
<data>{"id":"!F~e(.1|o)lKd]hm8h}7","filename":"lib/Factory_Variables.py"}</data>
</block>
</value>
<value name="B">
......
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<block type="util_python_imports" id="gc{@hX#/dbc^}P{QV*,/" x="0" y="0">
<field name="value">import logging</field>
</block>
......@@ -9,7 +9,7 @@
<field name="value">logging.log(logging.TRACE, '-')</field>
<next>
<block type="util_thread" id="zaO[(Z(pxF,[*b^8X`Z|">
<field name="dropdown_event">$85jmt,h,pz0rRv^q[al</field>
<field name="dropdown_event">{"id":"$85jmt,h,pz0rRv^q[al","filename":"lib/Sound.py"}</field>
</block>
</next>
</block>
......
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<variables>
<variable id="=#ier=C6ckg_oRLb@)9!">ts</variable>
<variable id="j_|*WOq[`@oGyfu]cF__">datetime_str</variable>
......
<xml type="camera" version="2" name="TXT_M_USB1_1_camera"><item id="2" class="MotionDetector"><name>motion_detector</name><tolerance>1</tolerance><geometry><x>0</x><y>0</y><width>320</width><height>240</height></geometry></item></xml>
\ No newline at end of file
<xml type="camera" version="4" name="TXT_M_USB1_1_camera"><item id="2" class="MotionDetector"><name>motion_detector</name><tolerance>1</tolerance><geometry><x>0</x><y>0</y><width>320</width><height>240</height></geometry></item></xml>
\ No newline at end of file
<xml xmlns="https://developers.google.com/blockly/xml" version="15">
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<block type="txt4_controller" id="EI-]CpP2Xt@A:ytm?6={" x="354" y="-770">
<mutation>
<arg type="Input" name="Input-2" value="I3"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment