Current Page:
NeXtMidas Training
X-Midas Interoperability
NeXtOpt
Messages
Translated Messages
|
|
- "Translated" NeXtMidas Messages:
- A "translated" NeXtMidas message is one that has been put in the form of a /NM/
message usable in X-Midas.
- The /NM/ message has the following fields:
MSG_NAME |
NeXtMidas message name. |
MSG_INFO |
NeXtMidas message info. |
MSG_DATA |
NeXtMidas message data. |
MSG_FID |
NeXtMidas message from ID. (NM->XM only) |
MSG_TID |
NeXtMidas message to ID. (NM->XM only) |
- In this case MSG_DATA, is the text form of an XMValue.
- Due to the way X-Midas messaging works, MSG_DATA can not contain any "live"
objects. All objects will be converted to an XMValue-compatible form (string, number,
or table) before sending.
- Conversely messages received from X-Midas will be in a XMValue-compatible form and
primitives should use the appropriate Convert
methods (e.g. Convert.o2t(..)) rather than casting msg.getData()
to a specific object type.
- Sending messages to NeXtMidas:
- Receiving messages from NeXtMidas:
- Example:
startmacro/nmq=8k
local /M/
...
nm/on/bg/id=999
xpipe/setup/controls on
nm/xs=2 plot/id=7/msgid=XM.1 nxm.sys.dat.world.prm
...
xpipe off
nm/off
endmacro
startcontrols
label initialentry
xcontrol/lab=domenu menu item ,, "MACRO;ZoomAfrica,UnZoom"
xcontrol/lab=getmsg msmon 1 10
...
return
label domenu
if item eq 1 then
message send /NM/ 7 ,, "ZOOM" 0 {XMIN=-20,XMAX=55,YMIN=-40,YMAX=40}
else
message send /NM/ 7 ,, "UNZOOM"
endif
return
label getmsg
message get /M/
if M.name eqs "NM" then
say "Got NeXtMidas Message:"
say " NAME : ^{M.nm_msg_name}"
say " INFO : ^{M.nm_msg_info}"
say " DATA : ^{M.nm_msg_data}"
say " FID : ^{M.nm_msg_fid}"
say " TID : ^{M.nm_msg_tid}"
endif
return
...
endcontrols
New Feature (Since NeXtMidas 2.7.1): |
Support for "translated" NeXtMidas messages was added in NeXtMidas 2.7.1. Prior to
NeXtMidas 2.7.1 there was minimal support for messaging between existing NeXtMidas
primitives (e.g. PLOT) and X-Midas.
|
|
|
|