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
c47adf57
Commit
c47adf57
authored
Mar 16, 2023
by
yogesh.m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
afcff3ff
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
12 deletions
+33
-12
.idea/workspace.xml
.idea/workspace.xml
+16
-1
__pycache__/hash_sender.cpython-39.pyc
__pycache__/hash_sender.cpython-39.pyc
+0
-0
__pycache__/opcua_receiver.cpython-39.pyc
__pycache__/opcua_receiver.cpython-39.pyc
+0
-0
__pycache__/opcua_transmitter.cpython-39.pyc
__pycache__/opcua_transmitter.cpython-39.pyc
+0
-0
hash_sender.py
hash_sender.py
+1
-0
main.py
main.py
+16
-11
opcua_subscriber/__pycache__/opcua_subscribe.cpython-39.pyc
opcua_subscriber/__pycache__/opcua_subscribe.cpython-39.pyc
+0
-0
No files found.
.idea/workspace.xml
View file @
c47adf57
...
@@ -4,7 +4,11 @@
...
@@ -4,7 +4,11 @@
<option
name=
"autoReloadType"
value=
"SELECTIVE"
/>
<option
name=
"autoReloadType"
value=
"SELECTIVE"
/>
</component>
</component>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"e733891a-c063-4f94-92d6-4559e921107b"
name=
"Default Changelist"
comment=
""
/>
<list
default=
"true"
id=
"e733891a-c063-4f94-92d6-4559e921107b"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/hash_sender.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/hash_sender.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/main.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/main.py"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
...
@@ -197,4 +201,15 @@
...
@@ -197,4 +201,15 @@
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"Vcs.Log.Tabs.Properties"
>
<option
name=
"TAB_STATES"
>
<map>
<entry
key=
"MAIN"
>
<value>
<State
/>
</value>
</entry>
</map>
</option>
</component>
</project>
</project>
\ No newline at end of file
__pycache__/hash_sender.cpython-39.pyc
View file @
c47adf57
No preview for this file type
__pycache__/opcua_receiver.cpython-39.pyc
View file @
c47adf57
No preview for this file type
__pycache__/opcua_transmitter.cpython-39.pyc
View file @
c47adf57
No preview for this file type
hash_sender.py
View file @
c47adf57
...
@@ -55,6 +55,7 @@ async def get_send_hash(ENDPOINT,NAMESPACE,server_hash_udp_ip,server_hash_udp_po
...
@@ -55,6 +55,7 @@ async def get_send_hash(ENDPOINT,NAMESPACE,server_hash_udp_ip,server_hash_udp_po
string_length
=
len
(
utf8_encoded_string
)
string_length
=
len
(
utf8_encoded_string
)
length_bytes
=
struct
.
pack
(
"!I"
,
string_length
)
length_bytes
=
struct
.
pack
(
"!I"
,
string_length
)
binary_data
=
length_bytes
+
utf8_encoded_string
binary_data
=
length_bytes
+
utf8_encoded_string
print
(
binary_data
)
UDPClientSocket
.
sendto
(
binary_data
,
serverAddressPort
)
UDPClientSocket
.
sendto
(
binary_data
,
serverAddressPort
)
def
send_hash
(
Endpoint
,
Namespace
,
server_hash_udp_ip
,
server_hash_udp_port
):
def
send_hash
(
Endpoint
,
Namespace
,
server_hash_udp_ip
,
server_hash_udp_port
):
...
...
main.py
View file @
c47adf57
...
@@ -5,6 +5,7 @@ import threading
...
@@ -5,6 +5,7 @@ import threading
import
sys
import
sys
import
os
import
os
import
json
import
json
import
multiprocessing
cache_data
=
{
cache_data
=
{
"sender_cache"
:{
"sender_url"
:
"url"
,
"sender_namespace"
:
"namespace"
,
"hash_server_ip"
:
""
,
"hash_server_port"
:
""
,
"send_to_ip"
:
""
,
"send_to_port"
:
""
},
"sender_cache"
:{
"sender_url"
:
"url"
,
"sender_namespace"
:
"namespace"
,
"hash_server_ip"
:
""
,
"hash_server_port"
:
""
,
"send_to_ip"
:
""
,
"send_to_port"
:
""
},
...
@@ -30,12 +31,15 @@ class App(tk.Frame):
...
@@ -30,12 +31,15 @@ class App(tk.Frame):
self
.
pack
()
self
.
pack
()
self
.
master
.
protocol
(
"WM_DELETE_WINDOW"
,
self
.
on_closing
)
self
.
master
.
protocol
(
"WM_DELETE_WINDOW"
,
self
.
on_closing
)
self
.
create_widgets
()
self
.
create_widgets
()
self
.
t1
=
None
def
on_closing
(
self
):
def
on_closing
(
self
):
file
=
open
(
platforms
[
sys
.
platform
],
"w+"
)
file
=
open
(
platforms
[
sys
.
platform
],
"w+"
)
file
.
write
(
json
.
dumps
(
cache_data
))
file
.
write
(
json
.
dumps
(
cache_data
))
file
.
close
()
file
.
close
()
root
.
destroy
()
root
.
destroy
()
if
(
self
.
t1
):
self
.
t1
.
terminate
()
def
create_widgets
(
self
):
def
create_widgets
(
self
):
# Label at the top
# Label at the top
...
@@ -176,8 +180,8 @@ class App(tk.Frame):
...
@@ -176,8 +180,8 @@ class App(tk.Frame):
send_to_port
=
self
.
server_udp_port_entry
.
get
()
send_to_port
=
self
.
server_udp_port_entry
.
get
()
cache_data
[
"sender_cache"
][
"send_to_port"
]
=
send_to_port
cache_data
[
"sender_cache"
][
"send_to_port"
]
=
send_to_port
self
.
server_udp_port_entry
.
configure
(
state
=
"disabled"
)
self
.
server_udp_port_entry
.
configure
(
state
=
"disabled"
)
t1
=
threading
.
Thread
(
target
=
transmitter_main
,
args
=
(
hash_server_ip
,
int
(
hash_server_port
),
send_to_ip
,
int
(
send_to_port
),
url
,
namespace
,))
self
.
t1
=
multiprocessing
.
Process
(
target
=
transmitter_main
,
args
=
(
hash_server_ip
,
int
(
hash_server_port
),
send_to_ip
,
int
(
send_to_port
),
url
,
namespace
,))
t1
.
start
()
self
.
t1
.
start
()
else
:
else
:
Endpoint_Url
=
self
.
url_entry
.
get
()
Endpoint_Url
=
self
.
url_entry
.
get
()
cache_data
[
"receiver_cache"
][
"receiver_url"
]
=
Endpoint_Url
cache_data
[
"receiver_cache"
][
"receiver_url"
]
=
Endpoint_Url
...
@@ -197,8 +201,8 @@ class App(tk.Frame):
...
@@ -197,8 +201,8 @@ class App(tk.Frame):
localPort
=
self
.
udp_port_entry
.
get
()
localPort
=
self
.
udp_port_entry
.
get
()
cache_data
[
"receiver_cache"
][
"localPort"
]
=
localPort
cache_data
[
"receiver_cache"
][
"localPort"
]
=
localPort
self
.
udp_port_entry
.
configure
(
state
=
"disabled"
)
self
.
udp_port_entry
.
configure
(
state
=
"disabled"
)
t1
=
threading
.
Thread
(
target
=
receive_main
,
args
=
(
Endpoint_Url
,
Namespace_Server
,
udp_hash_receiver_ip
,
int
(
udp_hash_receiver_port
),
localIP
,
int
(
localPort
),))
self
.
t1
=
multiprocessing
.
Process
(
target
=
receive_main
,
args
=
(
Endpoint_Url
,
Namespace_Server
,
udp_hash_receiver_ip
,
int
(
udp_hash_receiver_port
),
localIP
,
int
(
localPort
),))
t1
.
start
()
self
.
t1
.
start
()
def
back_of_send
(
self
):
def
back_of_send
(
self
):
# Remove existing widgets
# Remove existing widgets
...
@@ -235,11 +239,12 @@ class App(tk.Frame):
...
@@ -235,11 +239,12 @@ class App(tk.Frame):
self
.
udp_port_entry
.
pack_forget
()
self
.
udp_port_entry
.
pack_forget
()
self
.
create_widgets
()
self
.
create_widgets
()
# Create the main window
if
__name__
==
"__main__"
:
root
=
tk
.
Tk
()
# Create the main window
root
=
tk
.
Tk
()
# Create the app
# Create the app
app
=
App
(
master
=
root
)
app
=
App
(
master
=
root
)
app
.
grid
()
app
.
grid
()
# Run the app
# Run the app
app
.
mainloop
()
app
.
mainloop
()
opcua_subscriber/__pycache__/opcua_subscribe.cpython-39.pyc
View file @
c47adf57
No preview for this file type
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