> Rather than investing time to re-invent the wheel here, better try to modify your EPICS driver process to
become a midas process.
I am with Stefan on this. Quite a bit of work went into the tmfe c++ framework to make it easy/easier to do
this - take an existing standalone c/c++ program and midas-ize it: in main(), "just add" calls to connect to
midas and to start the midas threads - rpc handler, watchdog, etc.
Alternatively, one can write a midas "stdout+stderr bridge", and start your standalone program
from the programs page like this:
myprogram |& cm_msg_bridge --name "myprogram" (redirect both stdout and stderr to cm_msg_bridge stdin)
cm_msg_bridge would read stdin and put them in cm_msg(). it will connect to midas using the name "myprogram"
to make it show "green" on the status page and it will be stoppable from the programs page.
care will need to be taken for myprogram to die cleanly when stdout and stderr are closed after cm_msg_bridge
exits.
K.O. |