Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Sorting_Line_AI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fischertechnik examples
Training models
Sorting_Line_AI
Commits
2a911eb9
Commit
2a911eb9
authored
2 years ago
by
ft-Demo
Browse files
Options
Downloads
Patches
Plain Diff
commit by robo pro coding
parent
0ff24a5b
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Sorting_Line_AI.blockly
+1
-1
1 addition, 1 deletion
Sorting_Line_AI.blockly
Sorting_Line_AI.py
+1
-0
1 addition, 0 deletions
Sorting_Line_AI.py
lib/sorting_line.blockly
+179
-127
179 additions, 127 deletions
lib/sorting_line.blockly
lib/sorting_line.py
+22
-18
22 additions, 18 deletions
lib/sorting_line.py
with
203 additions
and
146 deletions
Sorting_Line_AI.blockly
+
1
−
1
View file @
2a911eb9
...
...
@@ -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&#10;import
threading
</field>
<field name="value">import logging&#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">
...
...
This diff is collapsed.
Click to expand it.
Sorting_Line_AI.py
+
1
−
0
View file @
2a911eb9
import
logging
import
os
import
threading
from
lib.controller
import
*
...
...
This diff is collapsed.
Click to expand it.
lib/sorting_line.blockly
+
179
−
127
View file @
2a911eb9
This diff is collapsed.
Click to expand it.
lib/sorting_line.py
+
22
−
18
View file @
2a911eb9
import
logging
import
sy
s
import
o
s
import
time
from
fischertechnik.controller.Motor
import
Motor
...
...
@@ -36,7 +36,7 @@ def thread_SLD():
mainSLDexternal_th
()
except
Exception
as
e
:
print
(
e
)
sy
s
.
exit
()
o
s
.
_
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
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment