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

commit by robo pro coding

parent 0ff24a5b
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
<variable id="1}I1z/r+5jdkU_}WMT{s">client</variable>
</variables>
<block type="util_python_imports" id=".e$$DS-W;QA]vq3]8xZ(" x="0" y="0">
<field name="value">import logging&amp;#10;import threading</field>
<field name="value">import logging&amp;#10;import os</field>
</block>
<block type="start_block" id="$#]ESP+D}J$B]GY;Y`zp" deletable="false" x="0" y="122">
<statement name="statement">
......
import logging
import os
import threading
from lib.controller import *
......
This diff is collapsed.
import logging
import sys
import os
import time
from fischertechnik.controller.Motor import Motor
......@@ -36,7 +36,7 @@ def thread_SLD():
mainSLDexternal_th()
except Exception as e:
print(e)
sys.exit()
os._exit(os.EX_OK)
def mainSLDexternal_th():
......@@ -97,11 +97,12 @@ def ejectWhite():
time.sleep(0.5)
TXT_SLD_M_O5_magnetic_valve.off()
TXT_SLD_M_O3_compressor.off()
time.sleep(0.5)
if isWhite():
state_code = 1
else:
for count in range(70):
state_code = 0
if isWhite():
state_code = 1
break
time.sleep(0.01)
def ejectRed():
......@@ -112,11 +113,12 @@ def ejectRed():
time.sleep(0.5)
TXT_SLD_M_O6_magnetic_valve.off()
TXT_SLD_M_O3_compressor.off()
time.sleep(0.5)
if isRed():
state_code = 2
else:
for count2 in range(70):
state_code = 0
if isRed():
state_code = 2
break
time.sleep(0.01)
def ejectBlue():
......@@ -127,11 +129,12 @@ def ejectBlue():
time.sleep(0.5)
TXT_SLD_M_O7_magnetic_valve.off()
TXT_SLD_M_O3_compressor.off()
time.sleep(0.5)
if isBlue():
state_code = 3
else:
for count3 in range(70):
state_code = 0
if isBlue():
state_code = 3
break
time.sleep(0.01)
def ejectFAIL():
......@@ -142,11 +145,12 @@ def ejectFAIL():
time.sleep(0.5)
TXT_SLD_M_O8_magnetic_valve.off()
TXT_SLD_M_O3_compressor.off()
time.sleep(0.5)
if isFAIL():
state_code = 4
else:
for count4 in range(70):
state_code = 0
if isFAIL():
state_code = 4
break
time.sleep(0.01)
def isWhite():
......
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