| 1 |
// OSRail -- a network enabled railroad operations simulator and utilities |
|---|
| 2 |
// Copyright (C) 2007,2008 Samuel E. Henley sehenley@comcast.net |
|---|
| 3 |
// |
|---|
| 4 |
// This program is free software; you can redistribute it and/or modify |
|---|
| 5 |
// it under the terms of the GNU General Public License as published by |
|---|
| 6 |
// the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 |
// (at your option) any later version. |
|---|
| 8 |
// |
|---|
| 9 |
// This program is distributed in the hope that it will be useful, |
|---|
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 |
// GNU General Public License for more details. |
|---|
| 13 |
// |
|---|
| 14 |
// You should have received a copy of the GNU General Public License along |
|---|
| 15 |
// with this program; if not, write to the Free Software Foundation, Inc., |
|---|
| 16 |
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
|---|
| 17 |
// |
|---|
| 18 |
/// \file |
|---|
| 19 |
/// Implementation file for Console manager of the simulator and the IConsoleClient factory. |
|---|
| 20 |
|
|---|
| 21 |
// Pre-Compiled Header for Simulator |
|---|
| 22 |
#include "presimulator.h" |
|---|
| 23 |
|
|---|
| 24 |
#include "consoleclient.h" |
|---|
| 25 |
#include "ipc.h" |
|---|
| 26 |
#include "launcher.h" |
|---|
| 27 |
|
|---|
| 28 |
/// \addtogroup simulator "Simulator" |
|---|
| 29 |
/// @{ |
|---|
| 30 |
/// \addtogroup simulatorcomponent "Simulator Components" |
|---|
| 31 |
/// @{ |
|---|
| 32 |
/// \addtogroup consoleclient "ConsoleClient Client" |
|---|
| 33 |
/// @{ |
|---|
| 34 |
|
|---|
| 35 |
/// Initialize console interface. |
|---|
| 36 |
|
|---|
| 37 |
extern IConsoleClient* createConsoleClient( ISystem& sys ) |
|---|
| 38 |
{ |
|---|
| 39 |
return new ConsoleClient( sys ); |
|---|
| 40 |
} |
|---|
| 41 |
|
|---|
| 42 |
ConsoleClient::ConsoleClient( ISystem& sys ) : system( sys ) |
|---|
| 43 |
{ |
|---|
| 44 |
} |
|---|
| 45 |
|
|---|
| 46 |
ConsoleClient::~ConsoleClient() |
|---|
| 47 |
{ |
|---|
| 48 |
} |
|---|
| 49 |
|
|---|
| 50 |
//vertual |
|---|
| 51 |
void ConsoleClient::startup() |
|---|
| 52 |
{ |
|---|
| 53 |
MESSAGE( "Simulator", "Console Client", "Startup" ) |
|---|
| 54 |
/// Initialize |
|---|
| 55 |
/// - Start the console utility. |
|---|
| 56 |
StringVector arg; |
|---|
| 57 |
//Full abs or relative path required because it is also the first arg |
|---|
| 58 |
String program = paths::getApplicationProgramPath(); |
|---|
| 59 |
/// \note Paths in simulator do not have trailing directory seperator. |
|---|
| 60 |
#ifdef WIN32 |
|---|
| 61 |
program += "Console.exe"; |
|---|
| 62 |
#else //Linux |
|---|
| 63 |
program += "Console"; |
|---|
| 64 |
#endif |
|---|
| 65 |
LoadProgram( program, arg ); |
|---|
| 66 |
MESSAGE( "Simulator", "Console Client", "Launched Console" ) |
|---|
| 67 |
|
|---|
| 68 |
} |
|---|
| 69 |
|
|---|
| 70 |
//virtual |
|---|
| 71 |
void ConsoleClient::operator()() |
|---|
| 72 |
{ |
|---|
| 73 |
} |
|---|
| 74 |
|
|---|
| 75 |
//virtual |
|---|
| 76 |
void ConsoleClient::shutdown() |
|---|
| 77 |
{ |
|---|
| 78 |
MESSAGE( "Simulator", "Console Client", "Shutdown" ) |
|---|
| 79 |
} |
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
/// @} group consoleclient |
|---|
| 84 |
/// @} group simulatorcomponent |
|---|
| 85 |
/// @} group simulator |
|---|