Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
0898204f
Commit
0898204f
authored
Jun 20, 2016
by
Maxime Perrotin
Browse files
No more SWIG dependencies
parent
79a0d84e
Changes
2
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/Scenario.py
View file @
0898204f
...
...
@@ -21,6 +21,7 @@ import os
import
importlib
import
time
import
DV
import
ctypes
try
:
from
PythonController
import
(
OpenMsgQueueForReading
,
GetMsgQueueBufferSize
,
...
...
@@ -176,10 +177,11 @@ class PollerThread(QThread):
print
'Failed to open message queue '
+
self
.
q_name
return
-
1
buffer_size
=
GetMsgQueueBufferSize
(
msg_q
)
#p_data_from_mq = DV.new_byte_SWIG_PTR(buffer_size)
p_data_from_mq
=
ctypes
.
create_string_buffe
(
buffer_size
).
raw
while
True
:
if
self
.
stop_requested
:
return
0
p_data_from_mq
=
DV
.
new_byte_SWIG_PTR
(
buffer_size
)
msg_received_type
=
RetrieveMessageFromQueue
(
msg_q
,
buffer_size
,
p_data_from_mq
)
if
msg_received_type
==
-
1
:
...
...
asn1_value_editor/gui.py
View file @
0898204f
...
...
@@ -27,7 +27,7 @@ import logging
import
argparse
import
time
from
functools
import
partial
from
ctypes
import
CDLL
from
ctypes
import
CDLL
,
create_string_buffer
log
=
logging
.
getLogger
(
__name__
)
terminal_formatter
=
logging
.
Formatter
(
...
...
@@ -60,7 +60,7 @@ except ImportError:
datamodel
=
None
try
:
from
PythonController
import
(
OpenMsgQueueForReading
,
new_byte_SWIG_PTR
,
from
PythonController
import
(
OpenMsgQueueForReading
,
GetMsgQueueBufferSize
,
DV
,
RetrieveMessageFromQueue
)
python_controller
=
True
except
ImportError
:
...
...
@@ -108,7 +108,8 @@ class MsgQ_Poller(QThread):
"Retrying..."
.
format
(
Qname
=
self
.
Qname
))
time
.
sleep
(
1
)
bufferSize
=
GetMsgQueueBufferSize
(
self
.
_msgQueue
)
pDataFromMQ
=
new_byte_SWIG_PTR
(
bufferSize
)
#pDataFromMQ = new_byte_SWIG_PTR(bufferSize)
pDataFromMQ
=
create_string_buffer
(
bufferSize
).
raw
while
not
self
.
_bDie
:
messageReceivedType
=
RetrieveMessageFromQueue
(
self
.
_msgQueue
,
bufferSize
,
pDataFromMQ
)
...
...
@@ -202,7 +203,7 @@ def gui():
# Default: use message queue
log
.
info
(
'Using message queues to communicate'
)
if
not
python_controller
:
log
.
error
(
'Python module "PythonController" i
s missing
'
)
log
.
error
(
'Python module "PythonController"
:
i
mport error
'
)
return
-
1
elif
options
.
udp
:
msgQ
=
False
...
...
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