[gme-users] Getting current filename or database connection string from within interpreter

Joe Porter joe.porter at gmail.com
Tue Oct 14 17:35:05 CDT 2008


We just had this discussion on the GReAT list.  It's fairly straightforward
unless you are using CrossLinks.

The rough procedure:
0. Use the GReAT Master Interpreter to generate standalone code.
1. Run the UDM interpreter wizard  (c:\Program Files\UDM\bin\UIntWiz.exe) to
create your project:
1a.  Take the defaults on the first page unless you know better.
1b.  Enter the Meta-name.h and Meta-name.cpp that were generated by GReAT.
1c.  Enter your component name (pick something), and select the box that
says "Display Icon on GME Toolbar".
1d.  Finish -- the generated project will have a few quirks.  You may have
to edit Include/Linking paths to get it to build.  I sincerely hope that
will be fixed in the next release.  Send e-mail to the UDM list if you get
stuck.

2.  Copy the guts of the main() function and the includes into the
CUdmApp::UdmMain function in your UDM interpreter.   It should look
something like this (your include file and type names will be different, of
course):

<top of file>
#include "GenSchedGen_2_ESMoL.h"

...

void CUdmApp::UdmMain( ... )  // Parameters
{

Udm::Object rootObject=p_backend->GetRootObject();
    ESMoL::RootFolder rf = ESMoL::RootFolder::Cast( rootObject );

// Add objects to input packets.
    if ( rf )
    {
        Packets_t eSMOLIns_1;
        eSMOLIns_1.push_back(rf);

        // transformation
        TopLevel_0 topLevel_0;
        topLevel_0( eSMOLIns_1);
    }
    else
    {
        AfxMessageBox( "No root folder found (or invalid cast)!" );
    }
}

I cross-posted this message to the GReAT users list (and UDM, just in
case).  If your transformation has CrossLinks then you will need a small
patch to get your models initialized at startup.  If you need to link in a
library from your transformation you will have to copy that into your UDM
project by hand as well.

-Joe

On Tue, Oct 14, 2008 at 4:19 PM, Gramatges, David (US SSA) <
david.gramatges at baesystems.com> wrote:

>  Is there a good way of getting the current filename (.mga file) being
> used or database connection string being used from within
> Component:invokeEx() (GME interpreter)?  I would like to pass this result as
> the systemname argument for Udm::SmartDataNetwork::OpenExisting().
>
>
>
> Alternatively, is there a good way of using the Project reference passed
> into Component::invokeEx() to achieve the same effect?
>
>
>
> What is the best way of using generated code from GReAT within a GME
> interpreter?
>
>
>
> Thanks,
>
> Dave
>
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20081014/8032f6fc/attachment.html 


More information about the gme-users mailing list