/** @file SOFIELeve1.cpp @brief Top level routine for the SOFIE Level 1 Processing System Uses 4 Event objects as the primary container for data flowing through the processing system @author John Burton @date Fri Apr 14 17:03:48 2006 @copyright (©) Copyright 2006 by GATS, Inc., 11864 Canon Blvd, Suite 101, Newport News VA 23606 All Rights Reserved. No part of this software or publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise without the prior written permission of GATS, Inc. */ // //----------------------------------------------------------------------- // Include Files: //----------------------------------------------------------------------- // #include #include "Event.h" #include "ConfigFile.h" #include "SOFIELevel1.h" #include "GATS_Utilities.hpp" #include // //----------------------------------------------------------------------- // Defines and Macros: //----------------------------------------------------------------------- // using namespace std; // //----------------------------------------------------------------------- // Global Variables: //----------------------------------------------------------------------- // map ExecMap; // //----------------------------------------------------------------------- // Utility Routines: //----------------------------------------------------------------------- // /// /// plotEventVars displays set of EventVars selected from the Event object /// \c ev using the EventVar \c Plot method. The set of EventVars is /// specified by the list of variable names contained in the vector of /// strings \c plotlist. /// @param ev - the Event object containing the EventVars to be plotted /// @param plotlist - the list of EventVar names to be plotted /// @param fname - a string to be passed to the EventVar \c Plot method /// title parameter. /// int plotEventVars(Event &ev, vector plotlist, string fname) { int i,j,typ; string vname; EventVarVect iEVV; EventVarVect fEVV; EventVarVect dEVV; for(i=0; i::iterator iter; // iterator to find a given function in the map vector ExecList; // List of modules to be executed to process an Event vector PlotList; // List of EventVars to be plotted int i; // index into the ExecList string vector int ret; // value returned by the executable module funcptr func; // function pointer to the executable module string fname; // name of the currently executing function string logentry; // log entry // // Open log file in Level 1 Event Object and timestamp entries // L1.openEventLog("SOFIELevel1Processing.log"); L1.enableLogTimeStamp(); logentry = string("Processing Event: ") + GATS_Utilities::ConvertToString(L0.getEventNumber()); cerr << endl; cerr << logentry << endl; cerr << endl; L1.addLogEntry(logentry); // logentry = string("Sunset/Sunrise flag: ") + // GATS_Utilities::ConvertToString(L0.getSRSSFlag()); // cerr << logentry << endl; // L1.addLogEntry(logentry); // // Get and step through ExecList // ExecList = cf.GetStrValues("SOFIELevel1","ExecList"); for(i=0;i EventList; // List of events to process (from configuration file string fname; // Filename of the top level configuration file // // Check command line options // int c; // inidividual command line argument extern char *optarg; // List of command line arguments extern int optind,opterr,optopt; // Index into the list of command line arguments while((c = getopt(argc,argv,"A:a:E:e:f:m:n:T:t:rj")) != EOF) switch(c) { default: break; } if(optind < argc) fname = string(argv[optind]); else fname = "SOFIELevel1.ini"; // // Open and parse the top level configuration file // cf.open(fname); // // Initialize ExecMap - map of names vs. pointers to functions // for(i=0;i