|
From: Dalal, M. (ARC-TI)[S. G. T. I. (S. Inc.)] <mic...@na...> - 2014-04-22 21:31:38
|
Chris,
I believe what you're attempting (an "all in one" Plexil app) should work, though I'm not aware of it being tried before, so there might be some catch we are unaware of.
Using the dummy-config.xml, your commands and lookup will indeed be ignored, which explains the UNKNOWN values printed.
You need to use an interface config that directs commands and lookups to the SampleAdapter, and you could use the one we've provided. I'm not sure why the initialization is failing when you tried it. Could you please try again with a Debug.cfg file in the directory from which you start PLEXIL, and send us the result? Put the following debug flags in the file:
:SampleAdapter
:InterfaceAdapter
:InterfaceManager
The resulting output will be more verbose, but should give a better idea of what's happening.
The invalidId error may or may not be related, but let's tackle the problem above first.
thanks,
Mike
On Apr 22, 2014, at 8:07 AM, Chris LANGLEY <Chr...@md...<mailto:Chr...@md...>>
wrote:
Dear Plexil Support,
Another rookie question for you.
I am trying to figure out how to build and use an interface adapter from within the same application as the executive (as opposed to linking to a shared library). To that end, I have been modifying UniversalExec.cc to try to use the code from example/sample-app (the “SampleAdapter” class). In summary, it seems that I can build the code, explicitly create a SampleAdapter, but when the plan runs, it doesn’t know where to go for the commands and lookups.
The modifications to UniversalExec.cc are as follows:
<snip>
#include "SampleAdapter.hh"
<snip>
// construct the application
PLEXIL::ExecApplication _app;
/////////////////////////////////////////////////////////////////////////////////////////////
// CL: Try to manually add a SampleAdapter adapter
std::cout << std::endl << "YO! About to add a SampleAdapter!" << std::endl;
SampleAdapter myAdapter(_app.getInterfaceManagerReference(), configElt);
_app.getInterfaceManagerReference().addInterfaceAdapter(myAdapter.getId());
std::cout << "Hmm... I wonder if that worked?" << std::endl << std::endl;
/////////////////////////////////////////////////////////////////////////////////////////////
// initialize it
std::cout << "Initializing application" << std::endl;
<snip>
I have made one modification to example/sample-app/plans/plan1.pli, which is to make the start condition always true, otherwise it doesn’t do anything (more on this below). When I run the application using this plan, I get:
Reading interface configuration from plans/dummy-config.xml
YO! About to add a SampleAdapter!
[SampleAdapter] created.
Hmm... I wonder if that worked?
Initializing application
[SampleAdapter] initialized.
Starting interfaces
[SampleAdapter] started.
Socket.cpp(62) MARK
Starting the exec
[Node:transition]Transitioning 'Root' from INACTIVE to WAITING
[Node:transition]Transitioning 'Root' from WAITING to EXECUTING
[Node:transition]Transitioning 'A' from INACTIVE to WAITING
[Node:transition]Transitioning 'Commands' from INACTIVE to WAITING
[Node:transition]Transitioning 'H' from INACTIVE to WAITING
[Node:transition]Transitioning 'A' from WAITING to EXECUTING
---- Beginning commands...
[Node:transition]Transitioning 'A' from EXECUTING to FINISHING
[Node:transition]Transitioning 'A' from FINISHING to ITERATION_ENDED
[Node:transition]Transitioning 'A' from ITERATION_ENDED to FINISHED
[Node:outcome]Outcome of 'A' is SUCCESS
[Node:transition]Transitioning 'Commands' from WAITING to EXECUTING
[Node:transition]Transitioning 'B' from INACTIVE to WAITING
[Node:transition]Transitioning 'C' from INACTIVE to WAITING
[Node:transition]Transitioning 'D' from INACTIVE to WAITING
[Node:transition]Transitioning 'E' from INACTIVE to WAITING
[Node:transition]Transitioning 'F' from INACTIVE to WAITING
[Node:transition]Transitioning 'G' from INACTIVE to WAITING
[Node:transition]Transitioning 'B' from WAITING to EXECUTING
[Node:transition]Transitioning 'C' from WAITING to EXECUTING
[Node:transition]Transitioning 'D' from WAITING to EXECUTING
[Node:transition]Transitioning 'E' from WAITING to EXECUTING
[Node:transition]Transitioning 'F' from WAITING to EXECUTING
[Node:transition]Transitioning 'G' from WAITING to EXECUTING
[Node:transition]Transitioning 'B' from EXECUTING to FINISHING
[Node:transition]Transitioning 'C' from EXECUTING to FINISHING
[Node:transition]Transitioning 'D' from EXECUTING to FINISHING
[Node:transition]Transitioning 'E' from EXECUTING to FINISHING
[Node:transition]Transitioning 'F' from EXECUTING to FINISHING
[Node:transition]Transitioning 'G' from EXECUTING to FINISHING
[Node:transition]Transitioning 'B' from FINISHING to ITERATION_ENDED
[Node:transition]Transitioning 'C' from FINISHING to ITERATION_ENDED
[Node:transition]Transitioning 'D' from FINISHING to ITERATION_ENDED
[Node:transition]Transitioning 'E' from FINISHING to ITERATION_ENDED
[Node:transition]Transitioning 'F' from FINISHING to ITERATION_ENDED
[Node:transition]Transitioning 'G' from FINISHING to ITERATION_ENDED
[Node:transition]Transitioning 'B' from ITERATION_ENDED to FINISHED
[Node:outcome]Outcome of 'B' is SUCCESS
[Node:transition]Transitioning 'C' from ITERATION_ENDED to FINISHED
[Node:outcome]Outcome of 'C' is SUCCESS
[Node:transition]Transitioning 'D' from ITERATION_ENDED to FINISHED
[Node:outcome]Outcome of 'D' is SUCCESS
[Node:transition]Transitioning 'E' from ITERATION_ENDED to FINISHED
[Node:outcome]Outcome of 'E' is SUCCESS
[Node:transition]Transitioning 'F' from ITERATION_ENDED to FINISHED
[Node:outcome]Outcome of 'F' is SUCCESS
[Node:transition]Transitioning 'G' from ITERATION_ENDED to FINISHED
[Node:outcome]Outcome of 'G' is SUCCESS
[Node:transition]Transitioning 'Commands' from EXECUTING to FINISHING
[Node:transition]Transitioning 'Commands' from FINISHING to ITERATION_ENDED
[Node:transition]Transitioning 'Commands' from ITERATION_ENDED to FINISHED
[Node:outcome]Outcome of 'Commands' is SUCCESS
[Node:transition]Transitioning 'H' from WAITING to EXECUTING
Speed and size: UNKNOWN UNKNOWN
[Node:transition]Transitioning 'H' from EXECUTING to FINISHING
[Node:transition]Transitioning 'H' from FINISHING to ITERATION_ENDED
[Node:transition]Transitioning 'H' from ITERATION_ENDED to FINISHED
[Node:outcome]Outcome of 'H' is SUCCESS
[Node:transition]Transitioning 'Root' from EXECUTING to FINISHING
[Node:transition]Transitioning 'Root' from FINISHING to ITERATION_ENDED
[Node:transition]Transitioning 'Root' from ITERATION_ENDED to FINISHED
[Node:outcome]Outcome of 'Root' is FAILURE
[SampleAdapter] stopped.
[SampleAdapter] shut down.
Plan complete, Exec exited without errors
ERROR: ../utils/Id.hh:493: Cannot remove an invalid Id<N6PLEXIL16InterfaceAdapterE>.
AllInOneSandbox: Error.cc:89: void Error::handleAssert(): Assertion `false' failed.
The fact that I get “Speed and size: UNKNOWN UNKNOWN”, and the fact that it habitually fails the notional start conditions in the original .pli, leads me to believe that the Commands and Lookups are going nowhere instead of being handled by SampleAdapter. No idea what the invalid ID is all about.
The above result is using the configuration example/dummy-config.xml. If I try the same thing with the configuration example/sample-app/interface-config.xml, I get:
YO! About to add a SampleAdapter!
[SampleAdapter] created.
Hmm... I wonder if that worked?
Initializing application
ERROR: unable to initialize application
ERROR: ../utils/Id.hh:493: Cannot remove an invalid Id<N6PLEXIL16InterfaceAdapterE>.
AllInOneSandbox: Error.cc:89: void Error::handleAssert(): Assertion `false' failed.
I assume it’s unable to initialize because it’s looking for libSampleAdapter.so, which I am explicitly trying not to use. Same invalid ID error as above.
I would really appreciate some help on how to create an all-in-one application. Thanks in advance.
Chris
Chris Langley
MDA
9445 Airport Road
Brampton, ON
L6S 4J3
(905) 790-2800 x4199
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform_______________________________________________
plexil-support mailing list
ple...@li...<mailto:ple...@li...>
https://lists.sourceforge.net/lists/listinfo/plexil-support
|