Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IC-Interface Control
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mateus Goto
IC-Interface Control
Commits
29ab8c8e
Commit
29ab8c8e
authored
Jul 20, 2022
by
Mateus Goto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fixed] minors issues 2
parent
fa51a0e2
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
24 additions
and
25 deletions
+24
-25
Control_Interface/__pycache__/controlInterface.cpython-39.pyc
...rol_Interface/__pycache__/controlInterface.cpython-39.pyc
+0
-0
Control_Interface/controlInterface.py
Control_Interface/controlInterface.py
+17
-12
Control_Interface/tempCodeRunnerFile.py
Control_Interface/tempCodeRunnerFile.py
+2
-0
NHR9400series/NHR9410.py
NHR9400series/NHR9410.py
+1
-2
NHR9400series/NHR9430.py
NHR9400series/NHR9430.py
+1
-1
NHR9400series/__pycache__/NHR9410.cpython-39.pyc
NHR9400series/__pycache__/NHR9410.cpython-39.pyc
+0
-0
NHR9400series/__pycache__/NHR9430.cpython-39.pyc
NHR9400series/__pycache__/NHR9430.cpython-39.pyc
+0
-0
Utility/IPFinder.py
Utility/IPFinder.py
+1
-2
Utility/__pycache__/IPFinder.cpython-39.pyc
Utility/__pycache__/IPFinder.cpython-39.pyc
+0
-0
main.py
main.py
+2
-8
No files found.
Control_Interface/__pycache__/controlInterface.cpython-39.pyc
View file @
29ab8c8e
No preview for this file type
Control_Interface/controlInterface.py
View file @
29ab8c8e
...
@@ -8,15 +8,14 @@ from Utility.IPFinder import IPFinder
...
@@ -8,15 +8,14 @@ from Utility.IPFinder import IPFinder
class
controlInterface
:
class
controlInterface
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
__listIp
=
[]
self
.
__listIp
=
IPFinder
().
getList
()
self
.
__listUsedIp
=
[]
self
.
__listUsedIp
=
[]
self
.
__nhr9410
=
[]
self
.
__nhr9410
=
[]
self
.
__nhr9430
=
[]
self
.
__nhr9430
=
[]
#refresh the list of ip
#refresh the list of ip
def
refresh
(
self
):
def
refresh
(
self
):
ipfinder
=
IPFinder
()
self
.
__listIp
=
IPFinder
().
getList
()
self
.
__listIp
=
ipfinder
.
getList
()
for
ip
in
self
.
__listUsedIp
:
for
ip
in
self
.
__listUsedIp
:
self
.
__listIp
.
remove
(
ip
)
self
.
__listIp
.
remove
(
ip
)
...
@@ -25,22 +24,28 @@ class controlInterface:
...
@@ -25,22 +24,28 @@ class controlInterface:
new
=
NHR9410
()
new
=
NHR9410
()
new
.
__init__
()
new
.
__init__
()
new
.
locateIp
(
self
.
__listIp
)
new
.
locateIp
(
self
.
__listIp
)
print
(
self
.
getListIp
())
usedIp
=
new
.
getIp
()
usedIp
=
new
.
getIp
()
self
.
__listIp
.
remove
(
usedIp
)
print
(
type
(
usedIp
))
self
.
__listUsedIp
.
append
(
usedIp
)
try
:
self
.
__nhr9410
.
append
(
new
)
self
.
__listIp
.
remove
(
usedIp
)
self
.
__listUsedIp
.
append
(
usedIp
)
self
.
__nhr9430
.
append
(
new
)
except
:
print
(
"Any IP adress matched"
)
#create a NHR9430 object
#create a NHR9430 object
def
newNhr9430
(
self
):
def
newNhr9430
(
self
):
new
=
NHR9430
()
new
=
NHR9430
()
new
.
__init__
()
new
.
__init__
()
new
.
locateIp
(
self
.
__listIp
)
usedIp
=
new
.
locateIp
(
self
.
__listIp
)
usedIp
=
new
.
getIp
()
#print(usedIp)
self
.
__listIp
.
remove
(
usedIp
)
try
:
self
.
__listUsedIp
.
append
(
usedIp
)
self
.
__listIp
.
remove
(
usedIp
)
self
.
__nhr9430
.
append
(
new
)
self
.
__listUsedIp
.
append
(
usedIp
)
self
.
__nhr9430
.
append
(
new
)
except
:
print
(
"Any IP adress matched"
)
def
getNhr9410
(
self
):
def
getNhr9410
(
self
):
return
self
.
__nhr9410
return
self
.
__nhr9410
...
...
Control_Interface/tempCodeRunnerFile.py
0 → 100644
View file @
29ab8c8e
usedIp
=
new
.
getIp
()
\ No newline at end of file
NHR9400series/NHR9410.py
View file @
29ab8c8e
...
@@ -16,13 +16,12 @@ class NHR9410(NHR9400):
...
@@ -16,13 +16,12 @@ class NHR9410(NHR9400):
if
recv
.
find
(
"NH Research,9410-"
)
!=
-
1
:
#if find this subtring
if
recv
.
find
(
"NH Research,9410-"
)
!=
-
1
:
#if find this subtring
self
.
__ip
=
client
self
.
__ip
=
client
print
(
"Connection successfully"
)
print
(
"Connection successfully"
)
break
return
self
.
__ip
else
:
else
:
print
(
"Connection failed 1"
)
print
(
"Connection failed 1"
)
self
.
__s
.
close
()
self
.
__s
.
close
()
except
:
except
:
print
(
"Connection failed 2"
)
print
(
"Connection failed 2"
)
pass
...
...
NHR9400series/NHR9430.py
View file @
29ab8c8e
...
@@ -73,7 +73,7 @@ class NHR9430(NHR9400):
...
@@ -73,7 +73,7 @@ class NHR9430(NHR9400):
if
recv
.
find
(
"NH Research,9430-"
)
!=
-
1
:
#if find this subtring
if
recv
.
find
(
"NH Research,9430-"
)
!=
-
1
:
#if find this subtring
self
.
__ip
=
client
self
.
__ip
=
client
print
(
"Connection successfully"
)
print
(
"Connection successfully"
)
break
return
self
.
__ip
else
:
else
:
print
(
"Connection failed 1"
)
print
(
"Connection failed 1"
)
self
.
__s
.
close
()
self
.
__s
.
close
()
...
...
NHR9400series/__pycache__/NHR9410.cpython-39.pyc
View file @
29ab8c8e
No preview for this file type
NHR9400series/__pycache__/NHR9430.cpython-39.pyc
View file @
29ab8c8e
No preview for this file type
Utility/IPFinder.py
View file @
29ab8c8e
...
@@ -23,8 +23,7 @@ class IPFinder:
...
@@ -23,8 +23,7 @@ class IPFinder:
result
=
srp
(
packet
,
timeout
=
3
,
retry
=
1
,
verbose
=
0
)[
0
]
result
=
srp
(
packet
,
timeout
=
3
,
retry
=
1
,
verbose
=
0
)[
0
]
clients
=
[]
clients
=
[]
for
sent
,
received
in
result
:
for
sent
,
received
in
result
:
clients
.
append
({
"ip"
:
received
.
psrc
})
clients
.
append
(
received
.
psrc
)
print
(
clients
)
self
.
__clients
=
clients
self
.
__clients
=
clients
...
...
Utility/__pycache__/IPFinder.cpython-39.pyc
View file @
29ab8c8e
No preview for this file type
main.py
View file @
29ab8c8e
...
@@ -2,20 +2,14 @@ from Control_Interface.controlInterface import controlInterface
...
@@ -2,20 +2,14 @@ from Control_Interface.controlInterface import controlInterface
from
Utility.IPFinder
import
IPFinder
from
Utility.IPFinder
import
IPFinder
interface
=
controlInterface
()
interface
=
controlInterface
()
ips
=
[]
interface
.
__init__
()
ips
=
IPFinder
().
getList
()
print
(
ips
)
interface
.
newNhr9410
()
interface
.
newNhr9410
()
interface
.
newNhr9430
()
interface
.
newNhr9430
()
#interface.newNhr9430()
#interface.newNhr9430()
nhr10
=
[]
nhr10
=
[]
print
(
nhr10
)
nhr30
=
[]
nhr30
=
[]
nhr10
=
interface
.
getNhr9410
()
nhr10
=
interface
.
getNhr9410
()
nhr30
=
interface
.
getNhr9430
()
nhr30
=
interface
.
getNhr9430
()
print
(
nhr10
)
print
(
nhr10
)
print
(
nhr30
)
print
(
nhr30
)
\ No newline at end of file
nhr10
[
0
].
getIp
nhr30
[
0
].
getIp
Write
Preview
Markdown
is supported
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