1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
/***************************** LICENSE START ***********************************
Copyright 2012 ECMWF and INPE. This software is distributed under the terms
of the Apache License version 2.0. In applying this license, ECMWF does not
waive the privileges and immunities granted to it by virtue of its status as
an Intergovernmental Organization or submit itself to any jurisdiction.
***************************** LICENSE END *************************************/
//
// Methods for the Create Action class
//
#include "CreateAction.h"
#include <Assertions.hpp>
#include "ObjectList.h"
#include "PlotMod.h"
#include "PlotModBuilder.h"
#include "Presentable.h"
//
// This is the exemplar object for the Create Action class
// which is loaded in the prototype map
//
static CreateAction createActionInstance("Create");
PlotModAction&
CreateAction::Instance()
{
return createActionInstance;
}
void
CreateAction::Execute ( PmContext& context )
{
// Check if request has a flag indicating that it comes from the Macro module
MvRequest req = context.InRequest().justOneRequest();
if ( PlotMod::Instance().CalledFromMacro ( req ) )
PlotMod::Instance().CalledFromMacro (true);
// Build the Tree branch associated with the Request
// First, find which builder will process the request
const char* requestName = req.getVerb();
const char* builderName = ObjectList::Find ("request", requestName, "builder");
PlotModBuilder& builder = PlotModBuilder::Find ( builderName );
// Execute the builder (return the tree node which has been created)
Presentable* superpage = builder.Execute ( context );
ensure (superpage != 0 );
// This was needed to send the driver info to Magics for each newpage.
// Now, Magics only receive the driver info once (FAMI20150514)
// Add output device to Superpage
// MvRequest deviceReq = PlotMod::Instance().OutputFormat()("OUTPUT_DEVICES");
// MvRequest spReq = superpage->Request();
// spReq("_OUTPUT_DEVICES") = deviceReq;
// superpage->SetRequest(spReq);
}
|