Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Holland Computing Center
HCCPiCluster
Commits
4daf9820
Commit
4daf9820
authored
Jun 06, 2019
by
Caughlin Bohn
Browse files
Checksum fix to prevent multilooping
parent
b2d545d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
DisplayNode/WorkerNetwork.py
View file @
4daf9820
...
...
@@ -113,43 +113,51 @@ s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s
.
bind
((
HOST
,
PORT
))
s
.
listen
(
1
)
#conn, addr = s.accept()
lastItem
=
0
while
1
:
conn
,
addr
=
s
.
accept
()
data
=
conn
.
recv
(
1024
)
conn
.
close
()
tempData
=
data
.
split
(
" "
)
iter
=
0
while
iter
<
int
(
tempData
[
2
]):
start
=
NodePath
[
tempData
[
0
]]
end
=
NodePath
[
tempData
[
1
]]
if
tempData
[
3
]
!=
lastItem
:
print
(
"I am lying about loops"
,
data
)
for
i
in
range
(
int
(
tempData
[
2
])):
print
(
data
,
iter
)
start
=
NodePath
[
tempData
[
0
]]
end
=
NodePath
[
tempData
[
1
]]
### To do random
start_path
=
find_path
(
NetPath
,
start
,
end
)
path
=
[]
try
:
for
i
in
range
(
0
,
len
(
start_path
)
-
1
):
path
.
append
(
start_path
[
i
]
+
start_path
[
i
+
1
])
except
:
print
(
"empty path"
)
try
:
for
a
in
path
:
data
=
128
for
i
in
NetLights
.
get
(
a
):
r
,
g
,
b
=
255
,
0
,
0
strip
.
setPixelColor
(
i
,
Color
(
r
,
g
,
b
))
strip
.
show
()
time
.
sleep
(
0.001
)
for
i
in
range
(
0
,
100
):
strip
.
setPixelColor
(
i
,
Color
(
0
,
0
,
0
))
strip
.
show
()
time
.
sleep
(
0.05
)
iter
+=
1
except
Exception
as
e
:
print
(
str
(
e
))
x
=
0
print
(
"ERROR"
)
conn
.
close
()
### To do random
start_path
=
find_path
(
NetPath
,
start
,
end
)
path
=
[]
try
:
for
i
in
range
(
0
,
len
(
start_path
)
-
1
):
path
.
append
(
start_path
[
i
]
+
start_path
[
i
+
1
])
except
:
print
(
"empty path"
)
try
:
for
a
in
path
:
for
i
in
NetLights
.
get
(
a
):
r
,
g
,
b
=
255
,
0
,
0
strip
.
setPixelColor
(
i
,
Color
(
r
,
g
,
b
))
strip
.
show
()
time
.
sleep
(
0.005
)
for
i
in
range
(
0
,
100
):
strip
.
setPixelColor
(
i
,
Color
(
0
,
0
,
0
))
strip
.
show
()
time
.
sleep
(
0.05
)
iter
+=
1
except
Exception
as
e
:
print
(
str
(
e
))
x
=
0
print
(
"ERROR"
)
lastItem
=
tempData
[
3
]
#conn.close()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment