#!/bin/bash #Modified by ajshafer on Aug 15 if [ -z "$1" ] ; then echo "GenMOOSApp: usage: $0 [app-name] [prefix]" exit 0 fi if [ -z "$2" ] ; then echo "GenMOOSApp: usage: $0 [app-name] [prefix]" exit 0 fi mkdir $2$1 cd $2$1 cat >> ${1}.h <> ${1}Main.cpp <> $2${1}.moos <> ${1}.cpp < #include "${1}.h" //--------------------------------------------------------- // Constructor ${1}::${1}() { } //--------------------------------------------------------- // Destructor ${1}::~${1}() { } //--------------------------------------------------------- // Procedure: OnNewMail bool ${1}::OnNewMail(MOOSMSG_LIST &NewMail) { MOOSMSG_LIST::iterator p; for(p=NewMail.begin(); p!=NewMail.end(); p++) { CMOOSMsg &msg = *p; } return true; } //--------------------------------------------------------- // Procedure: OnConnectToServer bool ${1}::OnConnectToServer() { // register for variables here // possibly look at the mission file? // m_MissionReader.GetConfigurationParam("Name", ); // m_Comms.Register("VARNAME", is_float(int)); return true; } //--------------------------------------------------------- // Procedure: Iterate() bool ${1}::Iterate() { // happens AppTick times per second return true; } //--------------------------------------------------------- // Procedure: OnStartUp() bool ${1}::OnStartUp() { // happens before connection is open return true; } EOF echo "$2${1} generated"