]> git.mxchange.org Git - flightgear.git/blob - JSBsim/FGModel.cpp
2d9a6abedc7b5046abd82f7cea4425d6f43e614c
[flightgear.git] / JSBsim / FGModel.cpp
1 /*******************************************************************************
2
3  Module:       FGModel.cpp
4  Author:       Jon Berndt
5  Date started: 11/11/98
6  Purpose:      Base class for all models
7  Called by:    FGSimExec, et. al.
8
9  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
10
11  This program is free software; you can redistribute it and/or modify it under
12  the terms of the GNU General Public License as published by the Free Software
13  Foundation; either version 2 of the License, or (at your option) any later
14  version.
15
16  This program is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
19  details.
20
21  You should have received a copy of the GNU General Public License along with
22  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23  Place - Suite 330, Boston, MA  02111-1307, USA.
24
25  Further information about the GNU General Public License can also be found on
26  the world wide web at http://www.gnu.org.
27
28 FUNCTIONAL DESCRIPTION
29 --------------------------------------------------------------------------------
30 This base class for the FGAero, FGRotational, etc. classes defines methods
31 common to all models.
32
33 ARGUMENTS
34 --------------------------------------------------------------------------------
35
36
37 HISTORY
38 --------------------------------------------------------------------------------
39
40
41 ********************************************************************************
42 INCLUDES
43 *******************************************************************************/
44
45 #include "FGModel.h"
46
47 /*******************************************************************************
48 ************************************ CODE **************************************
49 *******************************************************************************/
50
51 FGModel::FGModel()
52 {
53   NextModel = 0L;
54   exe_ctr = 1;
55 }
56
57
58 FGModel::~FGModel()
59 {
60 }
61
62
63 bool FGModel::Run()
64 {
65   if (exe_ctr == 1) {
66     if (exe_ctr++ >= rate) exe_ctr = 1;
67     return false;
68   } else {
69     if (exe_ctr++ >= rate) exe_ctr = 1;
70     return true;
71   }
72 }
73
74