2000-03-22 22:01:33 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
FILENAME: uiuc_warnings_errors.cpp
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
DESCRIPTION:
|
|
|
|
|
|
|
|
Prints to screen the follow:
|
|
|
|
|
|
|
|
- Error Code (errorCode)
|
|
|
|
|
|
|
|
- Message indicating the problem. This message should be preceded by
|
2003-05-13 18:45:04 +00:00
|
|
|
"Warning", "Error" or "Note". Warnings are non-fatal and the code
|
|
|
|
will pause. Errors are fatal and will stop the code. Notes are
|
|
|
|
only for information.
|
2000-03-22 22:01:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
STATUS: alpha version
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
REFERENCES: based on "menu reader" format of Michael Selig
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
HISTORY: 01/29/2000 initial release
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
AUTHOR(S): Bipin Sehgal <bsehgal@uiuc.edu>
|
|
|
|
Jeff Scott <jscott@mail.com>
|
|
|
|
Michael Selig <m-selig@uiuc.edu>
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
VARIABLES:
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
INPUTS: -error code
|
|
|
|
-input line
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
OUTPUTS: -warning/error message to screen
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
CALLED BY: uiuc_menu.cpp
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
CALLS TO: none
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
COPYRIGHT: (C) 2000 by Michael Selig
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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
|
2006-02-21 17:37:31 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2000-03-22 22:01:33 +00:00
|
|
|
|
|
|
|
**********************************************************************/
|
2000-12-13 23:02:02 +00:00
|
|
|
|
2008-06-02 21:09:51 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
2000-03-22 22:01:33 +00:00
|
|
|
#include "uiuc_warnings_errors.h"
|
|
|
|
|
2008-07-29 08:27:48 +00:00
|
|
|
using std::cerr;
|
|
|
|
using std::endl;
|
2001-01-11 04:54:33 +00:00
|
|
|
|
2002-12-31 18:26:02 +00:00
|
|
|
#ifndef _MSC_VER
|
2008-07-29 08:27:48 +00:00
|
|
|
using std::exit;
|
2001-01-11 04:54:33 +00:00
|
|
|
#endif
|
2000-12-13 23:02:02 +00:00
|
|
|
|
2008-06-02 21:09:51 +00:00
|
|
|
void uiuc_warnings_errors(int errorCode, std::string line)
|
2000-03-22 22:01:33 +00:00
|
|
|
{
|
|
|
|
switch (errorCode)
|
|
|
|
{
|
|
|
|
case 1:
|
2002-11-08 17:03:49 +00:00
|
|
|
cerr << "UIUC ERROR 1: The value of the coefficient in \"" << line << "\" should be of type float" << endl;
|
|
|
|
exit(-1);
|
|
|
|
break;
|
2000-03-22 22:01:33 +00:00
|
|
|
case 2:
|
2003-05-13 18:45:04 +00:00
|
|
|
cerr << "UIUC ERROR 2: Unknown identifier in \"" << line << "\" (check uiuc_map_*.cpp)" << endl;
|
2002-11-08 17:03:49 +00:00
|
|
|
exit(-1);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
cerr << "UIUC ERROR 3: Slipstream effects only work w/ the engine simpleSingleModel line: \"" << line << endl;
|
|
|
|
exit(-1);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
cerr << "UIUC ERROR 4: Downwash mode does not exist: \"" << line << endl;
|
|
|
|
exit(-1);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
cerr << "UIUC ERROR 5: Must use dyn_on_speed not equal to zero: \"" << line << endl;
|
|
|
|
exit(-1);
|
|
|
|
break;
|
2003-05-13 18:45:04 +00:00
|
|
|
case 6:
|
|
|
|
cerr << "UIUC ERROR 6: Table lookup data exceeds 99 point limit: \"" << endl;
|
|
|
|
exit(-1);
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
cerr << "UIUC ERROR 7: Need to download data file for the ornithopter. Go to http://www.aae.uiuc.edu/m-selig/apasim/Aircraft-uiuc.html " << endl;
|
|
|
|
exit(-1);
|
|
|
|
break;
|
2000-03-22 22:01:33 +00:00
|
|
|
}
|
2016-01-12 18:50:31 +00:00
|
|
|
|
|
|
|
cerr << "UIUC UNKNOWN ERROR" << endl;
|
|
|
|
exit(-1);
|
2000-03-22 22:01:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// end uiuc_warnings_errors.cpp
|