/*LICENSE_START*/
/*
 *  Copyright (C) 2016  Washington University School of Medicine
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/*LICENSE_END*/

#include "OperationName.h"
#include "OperationException.h"

using namespace caret;
using namespace std;

AString OperationName::getCommandSwitch()
{
    return "-command-switch";
}

AString OperationName::getShortDescription()
{
    return "SHORT DESCRIPTION";
}

OperationParameters* OperationName::getParameters()
{
    OperationParameters* ret = new OperationParameters();
    
    //ret->addSurfaceParameter(1, "surface", "the surface to compute on");
    
    //ret->addMetricOutputParameter(2, "metric-out", "the output metric");
    
    //OptionalParameter* columnSelect = ret->createOptionalParameter(3, "-column", "select a single column");
    //columnSelect->addStringParameter(1, "column", "the column number or name");
    
    ret->setHelpText(
        AString("This is where you set the help text.  ") +
        "DO NOT add the info about what the command line format is, and do not give the command switch, " +
        "short description, or the short descriptions of parameters.  " +
        "Do not indent, manually break long lines, or format the text in any way " +
        "other than to separate paragraphs within the help text prose, usually with two newlines."
    );
    return ret;
}

void OperationName::useParameters(OperationParameters* myParams, ProgressObject* myProgObj)
{
    LevelProgress myProgress(myProgObj);
    //SurfaceFile* mySurf = myParams->getSurface(1);//gets the surface with key 1
    //MetricFile* myMetricOut = myParams->getOutputMetric(2);//gets the output metric with key 2
    //OptionalParameter* columnSelect = myParams->getOptionalParameter(3);//gets optional parameter with key 3
    /*int columnNum = -1;
    if (columnSelect->m_present)
    {//set up to use the single column
        columnNum = (int)myMetric->getMapIndexFromNameOrNumber(columnSelect->getString(1));
        if (columnNum < 0 || columnNum >= myMetric->getNumberOfMaps())
        {
            throw OperationException("invalid column specified");
        }
    }//*/
    //do the work here
    //myProgress.reportProgress(0.5f);//this is how you would report being half finished, if the operation takes a while (probably not)
}
