Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-cloning
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
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yogesh.m
opcua-cloning
Commits
ac715366
Commit
ac715366
authored
Mar 15, 2023
by
yogesh.m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
024a7d4f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
__pycache__/opcua_receiver.cpython-39.pyc
__pycache__/opcua_receiver.cpython-39.pyc
+0
-0
main.py
main.py
+9
-6
opcua_receiver.py
opcua_receiver.py
+6
-7
No files found.
__pycache__/opcua_receiver.cpython-39.pyc
View file @
ac715366
No preview for this file type
main.py
View file @
ac715366
import
tkinter
as
tk
import
tkinter
as
tk
from
opcua_transmitter
import
transmitter_main
from
opcua_transmitter
import
transmitter_main
#
from opcua_receiver import receive_main
from
opcua_receiver
import
receive_main
class
App
(
tk
.
Frame
):
class
App
(
tk
.
Frame
):
def
__init__
(
self
,
master
=
None
):
def
__init__
(
self
,
master
=
None
):
...
@@ -125,11 +125,14 @@ class App(tk.Frame):
...
@@ -125,11 +125,14 @@ class App(tk.Frame):
send_to_ip
=
self
.
server_udp_ip_entry
.
get
()
send_to_ip
=
self
.
server_udp_ip_entry
.
get
()
send_to_port
=
int
(
self
.
server_udp_port_entry
.
get
())
send_to_port
=
int
(
self
.
server_udp_port_entry
.
get
())
status
=
transmitter_main
(
hash_server_ip
,
hash_server_port
,
send_to_ip
,
send_to_port
,
url
,
namespace
)
status
=
transmitter_main
(
hash_server_ip
,
hash_server_port
,
send_to_ip
,
send_to_port
,
url
,
namespace
)
# else:
else
:
# status = receive_main(_Endpoint_Url,_Namespace_Server,_udp_hash_receiver_ip,_udp_hash_receiver_port,_localIP,_localPort)
Endpoint_Url
=
self
.
url_entry
.
get
()
Namespace_Server
=
self
.
namespace_entry
.
get
()
# Clear the entry widget
udp_hash_receiver_ip
=
self
.
udp_hash_receiver_ip_entry
.
get
()
self
.
url_entry
.
delete
(
0
,
tk
.
END
)
udp_hash_receiver_port
=
self
.
udp_hash_receiver_port_entry
.
get
()
localIP
=
self
.
udp_ip_entry
.
get
()
localPort
=
self
.
udp_port_entry
.
get
()
status
=
receive_main
(
Endpoint_Url
,
Namespace_Server
,
udp_hash_receiver_ip
,
udp_hash_receiver_port
,
localIP
,
localPort
)
def
back_of_send
(
self
):
def
back_of_send
(
self
):
# Remove existing widgets
# Remove existing widgets
...
...
opcua_receiver.py
View file @
ac715366
...
@@ -14,13 +14,6 @@ udp_hash_receiver_port=data["configuration"]["udp_hash_receiver_port"]
...
@@ -14,13 +14,6 @@ udp_hash_receiver_port=data["configuration"]["udp_hash_receiver_port"]
localIP
=
data
[
"configuration"
][
"udp_ip"
]
localIP
=
data
[
"configuration"
][
"udp_ip"
]
localPort
=
data
[
"configuration"
][
"udp_port"
]
localPort
=
data
[
"configuration"
][
"udp_port"
]
bufferSize
=
1024
UDPServerSocket
=
socket
.
socket
(
family
=
socket
.
AF_INET
,
type
=
socket
.
SOCK_DGRAM
)
UDPServerSocket
.
bind
((
localIP
,
localPort
))
t1
=
threading
.
Thread
(
target
=
st
,
args
=
(
Endpoint_Url
,
Namespace_Server
,
udp_hash_receiver_ip
,
udp_hash_receiver_port
,))
t1
.
start
()
opua
=
None
opua
=
None
sock
=
None
sock
=
None
...
@@ -36,6 +29,12 @@ def start_server():
...
@@ -36,6 +29,12 @@ def start_server():
def
receive_packets
():
def
receive_packets
():
print
(
"wait until server starts ..."
)
print
(
"wait until server starts ..."
)
t1
=
threading
.
Thread
(
target
=
st
,
args
=
(
Endpoint_Url
,
Namespace_Server
,
udp_hash_receiver_ip
,
udp_hash_receiver_port
,))
t1
.
start
()
bufferSize
=
1024
UDPServerSocket
=
socket
.
socket
(
family
=
socket
.
AF_INET
,
type
=
socket
.
SOCK_DGRAM
)
UDPServerSocket
.
bind
((
localIP
,
localPort
))
opua
,
sock
=
start_server
()
opua
,
sock
=
start_server
()
print
(
"receiving packets ..."
)
print
(
"receiving packets ..."
)
while
(
True
):
while
(
True
):
...
...
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