You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(140) |
Feb
(98) |
Mar
(152) |
Apr
(104) |
May
(71) |
Jun
(94) |
Jul
(169) |
Aug
(83) |
Sep
(47) |
Oct
(134) |
Nov
(7) |
Dec
(20) |
2004 |
Jan
(41) |
Feb
(14) |
Mar
(42) |
Apr
(47) |
May
(68) |
Jun
(143) |
Jul
(65) |
Aug
(29) |
Sep
(40) |
Oct
(34) |
Nov
(33) |
Dec
(97) |
2005 |
Jan
(29) |
Feb
(30) |
Mar
(9) |
Apr
(37) |
May
(13) |
Jun
(31) |
Jul
(22) |
Aug
(23) |
Sep
|
Oct
(37) |
Nov
(34) |
Dec
(117) |
2006 |
Jan
(48) |
Feb
(6) |
Mar
(2) |
Apr
(71) |
May
(10) |
Jun
(16) |
Jul
(7) |
Aug
(1) |
Sep
(14) |
Oct
(17) |
Nov
(25) |
Dec
(26) |
2007 |
Jan
(8) |
Feb
(2) |
Mar
(7) |
Apr
(26) |
May
|
Jun
(12) |
Jul
(30) |
Aug
(14) |
Sep
(9) |
Oct
(4) |
Nov
(7) |
Dec
(6) |
2008 |
Jan
(10) |
Feb
(10) |
Mar
(6) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(18) |
Aug
(15) |
Sep
(16) |
Oct
(5) |
Nov
(3) |
Dec
(10) |
2009 |
Jan
(11) |
Feb
(2) |
Mar
|
Apr
(15) |
May
(31) |
Jun
(18) |
Jul
(11) |
Aug
(26) |
Sep
(52) |
Oct
(17) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mk...@us...> - 2003-09-18 00:32:09
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv25328/Source Modified Files: Tag: b0_4_0 Date.cpp LUT.cpp Log Message: Index: Date.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Date.cpp,v retrieving revision 1.7.2.4 retrieving revision 1.7.2.5 diff -C2 -d -r1.7.2.4 -r1.7.2.5 *** Date.cpp 18 Sep 2003 00:27:38 -0000 1.7.2.4 --- Date.cpp 18 Sep 2003 00:32:06 -0000 1.7.2.5 *************** *** 475,479 **** setJulian(julian_); } else { ! time_ = getTime(); julian_ = getJulian(); archive(time_); --- 475,479 ---- setJulian(julian_); } else { ! time_ = static_cast<float>(getTime()); julian_ = getJulian(); archive(time_); Index: LUT.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/LUT.cpp,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -C2 -d -r1.5.2.1 -r1.5.2.2 *** LUT.cpp 22 Aug 2003 00:21:45 -0000 1.5.2.1 --- LUT.cpp 18 Sep 2003 00:32:06 -0000 1.5.2.2 *************** *** 227,231 **** typename DataVector::iterator c1 = m_Data->begin(); typename DataVector::iterator c0 = c1++; ! X s = 1.0 / (c1->first - c0->first); for (i = 0; i < n; ++i) { X x = x0 + i * dx; --- 227,231 ---- typename DataVector::iterator c1 = m_Data->begin(); typename DataVector::iterator c0 = c1++; ! X s = static_cast<X>(1.0) / (c1->first - c0->first); for (i = 0; i < n; ++i) { X x = x0 + i * dx; *************** *** 235,239 **** throwBreakpointOrder(); } ! s = 1.0 / (c1->first - c0->first); } X f = (x - c0->first) * s; --- 235,239 ---- throwBreakpointOrder(); } ! s = static_cast<X>(1.0) / (c1->first - c0->first); } X f = (x - c0->first) * s; *************** *** 408,412 **** X f; find(x, i, f); ! X value = table(i).getValue(v.rest()) * (1.0-f) + table(i+1).getValue(v.rest()) * f; __LUTLOG("getValue[N]: " << x << " " << i << " " << f << " = " << value); return value; --- 408,412 ---- X f; find(x, i, f); ! X value = table(i).getValue(v.rest()) * (static_cast<X>(1.0)-f) + table(i+1).getValue(v.rest()) * f; __LUTLOG("getValue[N]: " << x << " " << i << " " << f << " = " << value); return value; *************** *** 515,519 **** typename DataVector::iterator c1 = m_Data->begin(); typename DataVector::iterator c0 = c1++; ! X s = 1.0 / (c1->first - c0->first); for (int i = 0; i < n; ++i) { X x = x0 + i * dx; --- 515,519 ---- typename DataVector::iterator c1 = m_Data->begin(); typename DataVector::iterator c0 = c1++; ! X s = static_cast<X>(1.0) / (c1->first - c0->first); for (int i = 0; i < n; ++i) { X x = x0 + i * dx; *************** *** 523,530 **** throwBreakpointOrder(); } ! s = 1.0 / (c1->first - c0->first); } X f = (x - c0->first) * s; ! (*_table)[i] = (1.0 - f) * c0->second + f * c1->second; } } --- 523,530 ---- throwBreakpointOrder(); } ! s = static_cast<X>(1.0) / (c1->first - c0->first); } X f = (x - c0->first) * s; ! (*_table)[i] = (static_cast<X>(1.0) - f) * c0->second + f * c1->second; } } *************** *** 548,552 **** X yb = data(1).second; X h = xb - xa; ! X s = 1.0 / h; X d2s = h * h * 0.166666667; for (int i = 0; i < n; ++i) { --- 548,552 ---- X yb = data(1).second; X h = xb - xa; ! X s = static_cast<X>(1.0) / h; X d2s = h * h * 0.166666667; for (int i = 0; i < n; ++i) { *************** *** 559,571 **** yb = data(index).second; h = xb - xa; ! s = 1.0 / h; d2s = h * h * 0.166666667; } X f = (x - xa) * s; ! X g = 1.0 - f; (*_table)[i] = g * ya + f * yb + ! ((g*g-1.0)*g*uv[index-1] + ! (f*f-1.0)*f*uv[index]) * d2s; } } --- 559,571 ---- yb = data(index).second; h = xb - xa; ! s = static_cast<X>(1.0) / h; d2s = h * h * 0.166666667; } X f = (x - xa) * s; ! X g = static_cast<X>(1.0) - f; (*_table)[i] = g * ya + f * yb + ! ((g*g-static_cast<X>(1.0))*g*uv[index-1] + ! (f*f-static_cast<X>(1.0))*f*uv[index]) * d2s; } } *************** *** 604,609 **** out.data(i).second = y * y0.data(i).second + x * y1.data(i).second + ! ((y * y - 1.0) * y * c0.curve(i) + ! (x * x - 1.0) * x * c1.curve(i)) * d2s; } } --- 604,609 ---- out.data(i).second = y * y0.data(i).second + x * y1.data(i).second + ! ((y * y - static_cast<X>(1.0)) * y * c0.curve(i) + ! (x * x - static_cast<X>(1.0)) * x * c1.curve(i)) * d2s; } } *************** *** 668,672 **** X f; find(x, i, f); ! X value = table(i) * (1.0-f) + table(i+1) * f; __LUTLOG("getValue[1]: " << x << " " << i << " " << f << " = " << value); return value; --- 668,672 ---- X f; find(x, i, f); ! X value = table(i) * (static_cast<X>(1.0)-f) + table(i+1) * f; __LUTLOG("getValue[1]: " << x << " " << i << " " << f << " = " << value); return value; |
From: <mk...@us...> - 2003-09-18 00:27:48
|
Update of /cvsroot/csp/APPLICATIONS/SimData/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv24484/SimData Modified Files: Tag: b0_4_0 __init__.py Log Message: Index: __init__.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/SimData/__init__.py,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** __init__.py 23 Apr 2003 09:14:22 -0000 1.2 --- __init__.py 18 Sep 2003 00:27:38 -0000 1.2.2.1 *************** *** 20,27 **** ## @file SimData.py ! ## @auther Mark Rose <mr...@st...> ## ## @module SimData ## ## Provides minimal glue code for interfacing between C++ and Python. ## Most of the hard work is done by SWIG. Python Objects must derive --- 20,31 ---- ## @file SimData.py ! ## @author Mark Rose <mr...@st...> ## ## @module SimData ## + ## @note The procedure for declaring and registering XML interfaces + ## is under revision, and the documentation here is likely to be + ## completely out of date. + ## ## Provides minimal glue code for interfacing between C++ and Python. ## Most of the hard work is done by SWIG. Python Objects must derive *************** *** 48,68 **** - # FIXME is there a more robust means of getting the class name as a - # string? str(class) changed from python2.1 to 2.2 for new-style - # classes... - def getClassName(_class): - rep = str(_class) - if rep.startswith('<class '): - # new-style: - fullname = rep.split()[1][:-2] # extract name from <class 'name'> - else: - # old-style: - fullname = rep - parts = fullname.split('.') - return parts[-1] - - ## The C++ InterfaceRegistry. - #g_InterfaceRegistry = cSimData.cvar.g_InterfaceRegistry g_InterfaceRegistry = cSimData.InterfaceRegistry.getInterfaceRegistry() --- 52,56 ---- *************** *** 76,80 **** ## store the class directly. ! class PyInterfaceProxy(cSimData.InterfaceProxy): def __init__(self, classname, _class, _baseinterface, interface): cSimData.InterfaceProxy.__init__(self, classname, _class._hash) --- 64,68 ---- ## store the class directly. ! class _____PyInterfaceProxy(cSimData.InterfaceProxy): def __init__(self, classname, _class, _baseinterface, interface): cSimData.InterfaceProxy.__init__(self, classname, _class._hash) *************** *** 196,200 **** ## of the archive. ! class XML: def __init__(self, name, variable, required): self.name = name --- 184,188 ---- ## of the archive. ! class _____XML: def __init__(self, name, variable, required): self.name = name *************** *** 203,207 **** ! def XML_INTERFACE(_class, major, minor, *args): _baseclass = None --- 191,195 ---- ! def _____XML_INTERFACE(_class, major, minor, *args): _baseclass = None *************** *** 210,214 **** if isinstance(args[0], types.ClassType): _baseclass, args = args[0], args[1:] ! _baseclass = getClassName(_baseclass) elif isinstance(args[0], types.StringType): _baseclass, args = args[0], args[1:] --- 198,202 ---- if isinstance(args[0], types.ClassType): _baseclass, args = args[0], args[1:] ! _baseclass = _baseclass.__name__ elif isinstance(args[0], types.StringType): _baseclass, args = args[0], args[1:] *************** *** 224,227 **** --- 212,388 ---- _class.getClassHash = lambda x: x.__class__._hash proxy = PyInterfaceProxy(classname, _class, _baseinterface, args).__disown__() + + + ############################################################################# + # NEW STYLE INTERFACE + ############################################################################# + + # class SIMDATA_XML: + # typeString = { + # int: "type::int32", + # float: "type::float", + # str: "type::string" + # } + # def __init__(self, name, type, var, req): + # self.name = name + # self.type = type + # self.var = var + # self.req = req + # if issubclass(type, BaseType): + # self.typeString = type().typeString() + # else: + # self.typeString = SIMDATA_XML.typeString[type] + # + # class ObjectInterface(cSimData.ObjectInterfaceBase): + # """@brief Interface for simdata::Object derived classes implemented in + # Python. + # + # This is an internal class that provides an interfacing for accessing + # and introspecting object member variables that can be initialized + # from external (XML) data sources. The interface is equivalent to + # the C++ ObjectInterface class, but the implementation is entirely + # Python specific. + # """ + # + # def __init__(self): + # """Default constructor.""" + # self.__accessors = {} + # + # def _def(self, d): + # """Define a new member variable accessor. + # + # This is an internal method used by the SIMDATA_XML function. Do + # not call it directly. + # """ + # self.__accessors[d.name] = d + # + # def variableExists(self, name): + # """Test if the interface defines a particular member variable. + # + # @param name The external name of the member variable to test. + # """ + # return self.__accessors.has_key(name) + # + # def variableRequired(self, name): + # """Test if a particular member variable must be defined in external + # data sources. + # + # Raises IndexError if the variable does not exist. + # + # @param name The external name of the member variable to test. + # """ + # return self.__accessors[name].req + # + # def set(self, obj, name, value): + # """Set a member variable of a given object. + # + # Assigns a new value to a particular member varible of the given + # object. The variable need not be previously defined, although + # it is strongly recommended that all externally accessible member + # variables be initialized during object construction. Future + # implementations may test for such initialization and raise + # exceptions when assigning to uninitialized members. Assigned + # values are tested for type compatibility. Type mismatches + # currently result in an assertion exception, although a more + # specific exception will be used eventually. + # + # @param obj The object to modify. + # @param name The external name of the member variable to set. + # @param value The value to assign. + # """ + # a = self.__accessors[name] + # assert(isinstance(value, a.type)) + # setattr(obj, a.var, value) + # + # def get(self, obj, name): + # """Get the value of a member variable of a given object. + # + # Returns the value of a particular member variable of the + # given object. Calling this method with unknown or uninitialized + # members will raise index and attribute exceptions, respectively. + # + # @param obj The object to access. + # @param name The external name of the member variable to get. + # @returns The value of the member variable. + # """ + # a = self.__accessors[name] + # return getattr(obj, a.var) + # + # def push_back(self, obj, name, value): + # """Append a value to a member variable list of a given object. + # """ + # a = self.__accessors[name] + # getattr(obj, a.var).append(value) + # + # def clear(self, obj, name): + # """Clear a member variable list of a given object. + # """ + # a = self.__accessors[name] + # assert(isinstance([], a.type)) + # setattr(obj, a.var, []) + # + # def getVariables(self): + # """Get a list of external names of all accessible member variables.""" + # return self.__accessors.keys() + # + # def variableType(self, name): + # """Get the type string of a particular member variable. + # + # @param name The external name of the member variable. + # """ + # a = self.__accessors[name] + # return a.typeString + # + # + # def __IF_init(self, IF): + # IF.__super.__init__(self, IF.__super) + # IF.__obi = ObjectInterface() + # map(IF.__obi._def, IF.__defs) + # self.addInterface(IF.__obi) + # print "Interface", IF.__classname, "registered." + # + # def __IF_getClassName(self): + # return self.__classname + # + # def __IF_getClassHash(self): + # return self.__classhash + # + # def __IF_createObject(self): + # return self.__class() + # + # __IF_methods = { + # '__init__': __IF_init, + # 'getClassName': __IF_getClassName, + # 'getClassHash': __IF_getClassHash, + # 'createObject': __IF_createObject, + # } + # + # + # def SIMDATA_INTERFACE(cl, v, su, defs, cln = None, abstract=0): + # if su is None: + # baselist = (InterfaceProxy,) + # suif = InterfaceProxy + # else: + # baselist = (su.IF,) + # suif = su.IF + # if cln is None: cln = cl.__name__ + # iname = "%s__INTERFACE" % cln + # methods = __IF_methods.copy() + # i = type(iname, baselist, methods) + # i.__version = v + # i.__super = suif + # i.__class = cl + # i.__classname = cln + # i.__classhash = "%s:%d" % (cln, int(v)) + # i.__defs = defs + # i.__abstract = abstract + # if not abstract: + # i.__singleton = i(i) + # else: + # i.__singleton = None + # cl.IF = i + # + + |
From: <mk...@us...> - 2003-09-18 00:27:48
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv24484/Source Modified Files: Tag: b0_4_0 DataArchive.cpp Date.cpp InterfaceRegistry.cpp Log Message: Index: DataArchive.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/DataArchive.cpp,v retrieving revision 1.15.2.1 retrieving revision 1.15.2.2 diff -C2 -d -r1.15.2.1 -r1.15.2.2 *** DataArchive.cpp 22 Aug 2003 00:21:45 -0000 1.15.2.1 --- DataArchive.cpp 18 Sep 2003 00:27:38 -0000 1.15.2.2 *************** *** 26,29 **** --- 26,31 ---- #include <iomanip> + #include <sstream> + NAMESPACE_SIMDATA *************** *** 81,87 **** bool machine_little = isLittleEndian(); if (data_little != machine_little) { ! char msg[128]; ! sprintf(msg, "le(machine, data) = (%d, %d)", machine_little, data_little); ! throw BadByteOrder(msg); } } --- 83,89 ---- bool machine_little = isLittleEndian(); if (data_little != machine_little) { ! std::stringstream msg; ! msg << "le(machine, data) = (" << machine_little << ", " << data_little << ")"; ! throw BadByteOrder(msg.str()); } } Index: Date.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Date.cpp,v retrieving revision 1.7.2.3 retrieving revision 1.7.2.4 diff -C2 -d -r1.7.2.3 -r1.7.2.4 *** Date.cpp 18 Sep 2003 00:10:33 -0000 1.7.2.3 --- Date.cpp 18 Sep 2003 00:27:38 -0000 1.7.2.4 *************** *** 22,25 **** --- 22,34 ---- #include <SimData/Date.h> + #include <ctime> + + // for fast timing routines + #ifdef _WIN32 + #include <Windows.h> + #else + #include <sys/time.h> + #include <unistd.h> + #endif *************** *** 31,38 **** #ifdef _WIN32 - NAMESPACE_SIMDATA_END - #include <Windows.h> - #include <ctime> - NAMESPACE_SIMDATA static LARGE_INTEGER _tstart, _tend; static LARGE_INTEGER freq; --- 40,43 ---- *************** *** 72,78 **** #else - - #include <sys/time.h> - #include <unistd.h> static struct timeval _tstart, _tend; --- 77,80 ---- Index: InterfaceRegistry.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/InterfaceRegistry.cpp,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** InterfaceRegistry.cpp 16 Aug 2003 07:56:40 -0000 1.10 --- InterfaceRegistry.cpp 18 Sep 2003 00:27:38 -0000 1.10.2.1 *************** *** 68,113 **** } ! MemberAccessorBase * InterfaceProxy::getAccessor(const char *name, const char *cname) const { ! if (!cname) cname = "?"; ! throw InterfaceError("variable \"" + std::string(name) + "\" not defined in interface to class " + cname); ! } ! ! const TypeAdapter InterfaceProxy::get(Object *o, const char *name) const { ! return getAccessor(name)->get(o); ! } ! ! void InterfaceProxy::set(Object *o, const char *name, const TypeAdapter &v) { ! getAccessor(name)->set(o, v); ! } ! ! void InterfaceProxy::push_back(Object *o, const char *name, const TypeAdapter &v) { ! try { ! getAccessor(name)->push_back(o, v); ! } catch (TypeMismatch &e) { ! e.appendMessage(std::string("Error encountered adding to list variable \"") + name + "\" in class \"" + getClassName() + "\"."); ! throw; } } ! void InterfaceProxy::set_enum(Object *o, const char *name, const char *v) { ! getAccessor(name)->set(o, TypeAdapter(v)); ! } ! ! void InterfaceProxy::clear(Object *o, const char *name) { ! getAccessor(name)->clear(o); ! } ! ! bool InterfaceProxy::variableExists(const char *) const { ! return false; ! } ! ! bool InterfaceProxy::variableRequired(const char *name) const { ! throw InterfaceError("Variable '"+std::string(name)+"' not found in interface to class '" + getClassName() + "'"); ! return false; ! } ! ! std::string InterfaceProxy::variableType(const char *name) const { ! throw InterfaceError("Variable '"+std::string(name)+"' not found in interface to class '" + getClassName() + "'"); ! return ""; } --- 68,103 ---- } ! void InterfaceProxy::addInterface(ObjectInterfaceBase* interface, ! std::string const &classname, ! hasht const &classhash) { ! std::vector<std::string> names = interface->getVariableNames(); ! std::vector<std::string>::iterator name = names.begin(); ! for (; name != names.end(); ++name) { ! if (_interfaces.find(*name) != _interfaces.end()) { ! // variable multiply defined ! std::stringstream ss; ! ss << "variable \"" << *name << "\"" ! << " multiply defined in interface to class " ! << classname << " or parent interface."; ! std::cout << ss.str() << std::endl; ! throw InterfaceError(ss.str()); ! } ! _interfaces[*name] = interface; ! _variableNames.push_back(*name); ! if (interface->variableRequired(*name)) { ! _requiredNames.push_back(*name); ! } } + _classNames.push_back(classname); + _classHashes.push_back(classhash); } ! ObjectInterfaceBase *InterfaceProxy::findInterface(std::string const &varname, bool required) const { ! InterfaceMap::const_iterator iter = _interfaces.find(varname); ! if (iter == _interfaces.end()) { ! if (!required) return 0; ! throw InterfaceError("Variable \"" + varname + "\" not defined in interface to class \"" + getClassName() + "\""); ! } ! return iter->second; } *************** *** 122,145 **** } ! bool InterfaceProxy::isSubclass(std::string const &) const { ! return false; ! } ! ! bool InterfaceProxy::isSubclass(hasht const &) const { ! return false; ! } ! ! void InterfaceProxy::pack(Object *, Packer &) const { ! } ! ! void InterfaceProxy::unpack(Object *, UnPacker &) const { ! } ! ! std::vector<std::string> InterfaceProxy::getVariableNames() const { ! return std::vector<std::string>(); } ! std::vector<std::string> InterfaceProxy::getRequiredNames() const { ! return std::vector<std::string>(); } --- 112,121 ---- } ! bool InterfaceProxy::isSubclass(std::string const &classname) const { ! return std::find(_classNames.begin(), _classNames.end(), classname) != _classNames.end(); } ! bool InterfaceProxy::isSubclass(hasht const &classhash) const { ! return std::find(_classHashes.begin(), _classHashes.end(), classhash) != _classHashes.end(); } |
From: <mk...@us...> - 2003-09-18 00:27:41
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv24484 Modified Files: Tag: b0_4_0 CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.75.2.5 retrieving revision 1.75.2.6 diff -C2 -d -r1.75.2.5 -r1.75.2.6 *** CHANGES.current 7 Sep 2003 22:25:05 -0000 1.75.2.5 --- CHANGES.current 18 Sep 2003 00:27:37 -0000 1.75.2.6 *************** *** 1,4 **** --- 1,16 ---- Version 0.4.0 (in progress) =========================== + 2003-09-17: onsight + Changed Real::asString() to use std::stringstream instead + of snprintf. + + Changed DataArchive to use std::stringstream for an error + message. + + Fixed including std headers into simdata namespace in + Date.cpp. + + ==========> NOTE that Quaternion.h/cpp are now Quat.h/cpp + 2003-09-07: onsight Fixed signed/unsigned comparisons in Composite.h |
From: <mk...@us...> - 2003-09-18 00:10:43
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv21809/Source Modified Files: Tag: b0_4_0 Date.cpp Log Message: Index: Date.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Date.cpp,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -C2 -d -r1.7.2.2 -r1.7.2.3 *** Date.cpp 18 Sep 2003 00:09:45 -0000 1.7.2.2 --- Date.cpp 18 Sep 2003 00:10:33 -0000 1.7.2.3 *************** *** 31,35 **** #ifdef _WIN32 ! END_NAMESPACE_SIMDATA #include <Windows.h> #include <ctime> --- 31,35 ---- #ifdef _WIN32 ! NAMESPACE_SIMDATA_END #include <Windows.h> #include <ctime> |
From: <mk...@us...> - 2003-09-18 00:09:50
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv21669/Source Modified Files: Tag: b0_4_0 Date.cpp Log Message: Index: Date.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Date.cpp,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** Date.cpp 22 Aug 2003 00:21:45 -0000 1.7.2.1 --- Date.cpp 18 Sep 2003 00:09:45 -0000 1.7.2.2 *************** *** 31,36 **** --- 31,38 ---- #ifdef _WIN32 + END_NAMESPACE_SIMDATA #include <Windows.h> #include <ctime> + NAMESPACE_SIMDATA static LARGE_INTEGER _tstart, _tend; static LARGE_INTEGER freq; |
From: <mk...@us...> - 2003-09-17 23:51:12
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv18474/Source Modified Files: Tag: b0_4_0 Real.cpp Log Message: Index: Real.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Real.cpp,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** Real.cpp 22 Aug 2003 00:21:45 -0000 1.3.2.1 --- Real.cpp 17 Sep 2003 23:51:09 -0000 1.3.2.2 *************** *** 23,26 **** --- 23,28 ---- #include <SimData/Archive.h> + #include <sstream> + NAMESPACE_SIMDATA *************** *** 85,91 **** std::string Real:: asString() const { ! char fmt[128]; ! snprintf(fmt, 127, "%f", _value); ! return std::string(fmt); } --- 87,93 ---- std::string Real:: asString() const { ! std::stringstream ss; ! ss << _value; ! return ss.str(); } |
From: <mk...@us...> - 2003-09-17 07:27:39
|
Update of /cvsroot/csp/APPLICATIONS/SimData/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv14072/SimData Modified Files: Parse.py Compile.py Log Message: Index: Parse.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/SimData/Parse.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Parse.py 20 Aug 2003 02:47:10 -0000 1.12 --- Parse.py 17 Sep 2003 07:27:01 -0000 1.13 *************** *** 27,31 **** from xml.sax import ContentHandler, ErrorHandler, make_parser import xml.sax ! from gzip import GzipFile from zipfile import ZipFile import re --- 27,38 ---- from xml.sax import ContentHandler, ErrorHandler, make_parser import xml.sax ! ! # zlib is often misinstalled under windows, so don't require it. ! try: ! from gzip import GzipFileXX ! except Exception, e: ! GzipFile = None ! GzipError = str(e) ! from zipfile import ZipFile import re *************** *** 808,811 **** --- 815,820 ---- return obj if path.endswith('.gz'): + if GzipFile is None: + raise IOError, "Unable to open '%s', since zlib appears to be missing or improperly installed (%s)." % (path, GzipError) f = GzipFile(path, "rb") else: Index: Compile.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/SimData/Compile.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compile.py 11 Apr 2003 18:06:37 -0000 1.2 --- Compile.py 17 Sep 2003 07:27:01 -0000 1.3 *************** *** 28,32 **** if hasattr(sys, "setdlopenflags"): sys.setdlopenflags(0x101) - #sys.path.append("../../Source"); try: import SimData --- 28,31 ---- *************** *** 50,54 **** while 1: try: ! import CSP break except: --- 49,53 ---- while 1: try: ! import cCSP break except: |
From: <mk...@us...> - 2003-09-17 07:27:38
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv14072 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** CHANGES.current 21 Aug 2003 04:34:48 -0000 1.75 --- CHANGES.current 17 Sep 2003 07:27:01 -0000 1.76 *************** *** 2,5 **** --- 2,9 ---- =========================== + 2003-09-16: onsight + Changed Parse.py to handle misinstalled zlib modules + (usually under windows) more gracefully. + 2003-08-20: onsight Tagged r0_3_4, version 0_3_5 started. |
From: <mk...@us...> - 2003-09-16 06:57:39
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include/Theater In directory sc8-pr-cvs1:/tmp/cvs-serv15155/Include/Theater Modified Files: Tag: systems CustomLayoutModel.h FeatureGroup.h FeatureGroupList.h FeatureLayout.h FeatureObjectModel.h FeatureQuad.h Objective.h RandomBillboardModel.h RandomForestModel.h Log Message: Index: CustomLayoutModel.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Theater/CustomLayoutModel.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** CustomLayoutModel.h 26 Jun 2003 09:25:45 -0000 1.1 --- CustomLayoutModel.h 16 Sep 2003 06:57:30 -0000 1.1.2.1 *************** *** 71,83 **** virtual ~CustomLayoutModel(); ! virtual void pack(simdata::Packer& p) const { ! FeatureGroupModel::pack(p); ! p.pack(m_FeatureLayout); } - virtual void unpack(simdata::UnPacker& p) { - FeatureGroupModel::unpack(p); - p.unpack(m_FeatureLayout); - } }; --- 71,79 ---- virtual ~CustomLayoutModel(); ! virtual void serialize(simdata::Archive &archive) { ! FeatureGroupModel::serialize(archive); ! archive(m_FeatureLayout); } }; Index: FeatureGroup.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Theater/FeatureGroup.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** FeatureGroup.h 26 Jun 2003 09:25:45 -0000 1.1 --- FeatureGroup.h 16 Sep 2003 06:57:30 -0000 1.1.2.1 *************** *** 133,148 **** virtual ~FeatureGroup(); ! virtual void pack(simdata::Packer& p) const { ! Object::pack(p); ! p.pack(m_Model); ! p.pack(m_Position); ! p.pack(m_Orientation); ! } ! ! virtual void unpack(simdata::UnPacker& p) { ! Object::unpack(p); ! p.unpack(m_Model); ! p.unpack(m_Position); ! p.unpack(m_Orientation); } --- 133,141 ---- virtual ~FeatureGroup(); ! virtual void serialize(simdata::Archive &archive) { ! SimObject::serialize(archive); ! archive(m_Model); ! archive(m_Position); ! archive(m_Orientation); } Index: FeatureGroupList.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Theater/FeatureGroupList.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** FeatureGroupList.h 26 Jun 2003 09:25:45 -0000 1.1 --- FeatureGroupList.h 16 Sep 2003 06:57:30 -0000 1.1.2.1 *************** *** 56,67 **** virtual ~FeatureGroupList(); ! virtual void pack(simdata::Packer& p) const { ! Object::pack(p); ! p.pack(m_FeatureGroups); ! } ! ! virtual void unpack(simdata::UnPacker& p) { ! Object::unpack(p); ! p.unpack(m_FeatureGroups); } --- 56,62 ---- virtual ~FeatureGroupList(); ! virtual void serialize(simdata::Archive &archive) { ! Object::serialize(archive); ! archive(m_FeatureGroups); } Index: FeatureLayout.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Theater/FeatureLayout.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** FeatureLayout.h 22 Jul 2003 15:48:51 -0000 1.2 --- FeatureLayout.h 16 Sep 2003 06:57:30 -0000 1.2.2.1 *************** *** 109,129 **** void makeFeatures(std::vector<Feature> &features, int value) const; ! virtual void pack(simdata::Packer& p) const { ! Object::pack(p); ! p.pack(m_FeatureModel); ! p.pack(m_X); ! p.pack(m_Y); ! p.pack(m_Orientation); ! p.pack(m_ValueModifier); } - virtual void unpack(simdata::UnPacker& p) { - Object::unpack(p); - p.unpack(m_FeatureModel); - p.unpack(m_X); - p.unpack(m_Y); - p.unpack(m_Orientation); - p.unpack(m_ValueModifier); - } }; --- 109,121 ---- void makeFeatures(std::vector<Feature> &features, int value) const; ! virtual void serialize(simdata::Archive &archive) { ! Object::serialize(archive); ! archive(m_FeatureModel); ! archive(m_X); ! archive(m_Y); ! archive(m_Orientation); ! archive(m_ValueModifier); } }; Index: FeatureObjectModel.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Theater/FeatureObjectModel.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** FeatureObjectModel.h 26 Jun 2003 09:25:45 -0000 1.1 --- FeatureObjectModel.h 16 Sep 2003 06:57:30 -0000 1.1.2.1 *************** *** 96,112 **** virtual ~FeatureObjectModel(); ! virtual void pack(simdata::Packer& p) const { ! Object::pack(p); ! p.pack(m_HitPoints); ! p.pack(m_Value); ! p.pack(m_ObjectModel); } - virtual void unpack(simdata::UnPacker& p) { - Object::unpack(p); - p.unpack(m_HitPoints); - p.unpack(m_Value); - p.unpack(m_ObjectModel); - } }; --- 96,106 ---- virtual ~FeatureObjectModel(); ! virtual void serialize(simdata::Archive &archive) { ! Object::serialize(archive); ! archive(m_HitPoints); ! archive(m_Value); ! archive(m_ObjectModel); } }; Index: FeatureQuad.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Theater/FeatureQuad.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** FeatureQuad.h 26 Jun 2003 09:25:45 -0000 1.1 --- FeatureQuad.h 16 Sep 2003 06:57:30 -0000 1.1.2.1 *************** *** 82,103 **** osg::StateSet * getStateSet() const; ! virtual void pack(simdata::Packer& p) const { ! Object::pack(p); ! p.pack(m_Texture); ! p.pack(m_Width); ! p.pack(m_Height); ! p.pack(m_OffsetX); ! p.pack(m_OffsetY); ! p.pack(m_Lighting); ! } ! ! virtual void unpack(simdata::UnPacker& p) { ! Object::unpack(p); ! p.unpack(m_Texture); ! p.unpack(m_Width); ! p.unpack(m_Height); ! p.unpack(m_OffsetX); ! p.unpack(m_OffsetY); ! p.unpack(m_Lighting); } }; --- 82,93 ---- osg::StateSet * getStateSet() const; ! virtual void serialize(simdata::Archive &archive) { ! Object::serialize(archive); ! archive(m_Texture); ! archive(m_Width); ! archive(m_Height); ! archive(m_OffsetX); ! archive(m_OffsetY); ! archive(m_Lighting); } }; Index: Objective.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Theater/Objective.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** Objective.h 26 Jun 2003 09:25:45 -0000 1.1 --- Objective.h 16 Sep 2003 06:57:30 -0000 1.1.2.1 *************** *** 51,61 **** virtual ~Objective(); ! virtual void pack(simdata::Packer& p) const { ! FeatureGroup::pack(p); ! p.pack(m_StrategicValueModifier); ! } ! virtual void unpack(simdata::UnPacker& p) { ! FeatureGroup::unpack(p); ! p.unpack(m_StrategicValueModifier); } }; --- 51,57 ---- virtual ~Objective(); ! virtual void serialize(simdata::Archive &archive) { ! FeatureGroup::serialize(archive); ! archive(m_StrategicValueModifier); } }; Index: RandomBillboardModel.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Theater/RandomBillboardModel.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** RandomBillboardModel.h 26 Jun 2003 09:25:45 -0000 1.1 --- RandomBillboardModel.h 16 Sep 2003 06:57:30 -0000 1.1.2.1 *************** *** 76,93 **** virtual ~RandomBillboardModel(); ! virtual void pack(simdata::Packer& p) const { ! FeatureGroupModel::pack(p); ! p.pack(m_Models); ! p.pack(m_Density); ! p.pack(m_MinimumSpacing); ! p.pack(m_Seed); ! } ! ! virtual void unpack(simdata::UnPacker& p) { ! FeatureGroupModel::unpack(p); ! p.unpack(m_Models); ! p.unpack(m_Density); ! p.unpack(m_MinimumSpacing); ! p.unpack(m_Seed); } --- 76,85 ---- virtual ~RandomBillboardModel(); ! virtual void serialize(simdata::Archive &archive) { ! FeatureGroupModel::serialize(archive); ! archive(m_Models); ! archive(m_Density); ! archive(m_MinimumSpacing); ! archive(m_Seed); } Index: RandomForestModel.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Theater/RandomForestModel.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** RandomForestModel.h 26 Jun 2003 09:25:45 -0000 1.1 --- RandomForestModel.h 16 Sep 2003 06:57:30 -0000 1.1.2.1 *************** *** 90,106 **** virtual ~RandomForestModel(); ! virtual void pack(simdata::Packer& p) const { ! FeatureGroupModel::pack(p); ! p.pack(m_Models); ! p.pack(m_Density); ! p.pack(m_MinimumSpacing); ! p.pack(m_Seed); ! } ! virtual void unpack(simdata::UnPacker& p) { ! FeatureGroupModel::unpack(p); ! p.unpack(m_Models); ! p.unpack(m_Density); ! p.unpack(m_MinimumSpacing); ! p.unpack(m_Seed); } --- 90,99 ---- virtual ~RandomForestModel(); ! virtual void serialize(simdata::Archive &archive) { ! FeatureGroupModel::serialize(archive); ! archive(m_Models); ! archive(m_Density); ! archive(m_MinimumSpacing); ! archive(m_Seed); } |
From: <mk...@us...> - 2003-09-16 06:57:38
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/aircraft/m2k In directory sc8-pr-cvs1:/tmp/cvs-serv15155/Data/XML/vehicles/aircraft/m2k Modified Files: Tag: systems model.xml Log Message: Index: model.xml =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** model.xml 18 Jul 2003 21:56:38 -0000 1.12 --- model.xml 16 Sep 2003 06:57:30 -0000 1.12.2.1 *************** *** 3,8 **** <Object class="ObjectModel" static="1"> <!--External name="model_path">f35.3DS</External--> ! <!--External name="model_path">s.osg</External--> ! <External name="model_path">m2k2g.3ds</External> <Vector name="axis_0">1 0 0</Vector> <Vector name="axis_1">0 1 0</Vector> --- 3,8 ---- <Object class="ObjectModel" static="1"> <!--External name="model_path">f35.3DS</External--> ! <External name="model_path">s.osg</External> ! <!--External name="model_path">m2k2g.3ds</External--> <Vector name="axis_0">1 0 0</Vector> <Vector name="axis_1">0 1 0</Vector> *************** *** 31,35 **** <List name="animations"> <Object class="DrivenRotation"> ! <Key name="control_id">Aircraft.Rudder</Key> <Key name="model_id">Aircraft.Rudder</Key> <Int name="lod_limit">1</Int> --- 31,35 ---- <List name="animations"> <Object class="DrivenRotation"> ! <String name="channel_name">ControlSurfaces.RudderDeflection</String> <Key name="model_id">Aircraft.Rudder</Key> <Int name="lod_limit">1</Int> *************** *** 37,41 **** </Object> <Object class="DrivenRotation"> ! <Key name="control_id">Aircraft.Elevator</Key> <Key name="model_id">Aircraft.LeftElevator</Key> <Int name="lod_limit">1</Int> --- 37,41 ---- </Object> <Object class="DrivenRotation"> ! <String name="channel_name">ControlSurfaces.ElevatorDeflection</String> <Key name="model_id">Aircraft.LeftElevator</Key> <Int name="lod_limit">1</Int> *************** *** 43,47 **** </Object> <Object class="DrivenRotation"> ! <Key name="control_id">Aircraft.Elevator</Key> <Key name="model_id">Aircraft.RightElevator</Key> <Int name="lod_limit">1</Int> --- 43,47 ---- </Object> <Object class="DrivenRotation"> ! <String name="channel_name">ControlSurfaces.ElevatorDeflection</String> <Key name="model_id">Aircraft.RightElevator</Key> <Int name="lod_limit">1</Int> *************** *** 49,53 **** </Object> <Object class="DrivenRotation"> ! <Key name="control_id">Aircraft.Aileron</Key> <Key name="model_id">Aircraft.LeftAileron</Key> <Int name="lod_limit">1</Int> --- 49,53 ---- </Object> <Object class="DrivenRotation"> ! <String name="channel_name">ControlSurfaces.AileronDeflection</String> <Key name="model_id">Aircraft.LeftAileron</Key> <Int name="lod_limit">1</Int> *************** *** 55,59 **** </Object> <Object class="DrivenRotation"> ! <Key name="control_id">Aircraft.Aileron</Key> <Key name="model_id">Aircraft.RightAileron</Key> <Int name="lod_limit">1</Int> --- 55,59 ---- </Object> <Object class="DrivenRotation"> ! <String name="channel_name">ControlSurfaces.AileronDeflection</String> <Key name="model_id">Aircraft.RightAileron</Key> <Int name="lod_limit">1</Int> *************** *** 61,65 **** </Object> <Object class="DrivenRotation"> ! <Key name="control_id">Aircraft.Airbrake</Key> <Key name="model_id">Aircraft.LowerRightAirbrake</Key> <Int name="lod_limit">1</Int> --- 61,65 ---- </Object> <Object class="DrivenRotation"> ! <String name="channel_name">ControlSurfaces.AirbrakeDeflection</String> <Key name="model_id">Aircraft.LowerRightAirbrake</Key> <Int name="lod_limit">1</Int> *************** *** 67,71 **** </Object> <Object class="DrivenRotation"> ! <Key name="control_id">Aircraft.Airbrake</Key> <Key name="model_id">Aircraft.LowerLeftAirbrake</Key> <Int name="lod_limit">1</Int> --- 67,71 ---- </Object> <Object class="DrivenRotation"> ! <String name="channel_name">ControlSurfaces.AirbrakeDeflection</String> <Key name="model_id">Aircraft.LowerLeftAirbrake</Key> <Int name="lod_limit">1</Int> *************** *** 73,77 **** </Object> <Object class="DrivenRotation"> ! <Key name="control_id">Aircraft.Airbrake</Key> <Key name="model_id">Aircraft.UpperRightAirbrake</Key> <Int name="lod_limit">1</Int> --- 73,77 ---- </Object> <Object class="DrivenRotation"> ! <String name="channel_name">ControlSurfaces.AirbrakeDeflection</String> <Key name="model_id">Aircraft.UpperRightAirbrake</Key> <Int name="lod_limit">1</Int> *************** *** 79,83 **** </Object> <Object class="DrivenRotation"> ! <Key name="control_id">Aircraft.Airbrake</Key> <Key name="model_id">Aircraft.UpperLeftAirbrake</Key> <Int name="lod_limit">1</Int> --- 79,83 ---- </Object> <Object class="DrivenRotation"> ! <String name="channel_name">ControlSurfaces.AirbrakeDeflection</String> <Key name="model_id">Aircraft.UpperLeftAirbrake</Key> <Int name="lod_limit">1</Int> |
From: <mk...@us...> - 2003-09-16 06:57:38
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/aircraft In directory sc8-pr-cvs1:/tmp/cvs-serv15155/Data/XML/vehicles/aircraft Modified Files: Tag: systems m2k.xml Log Message: Index: m2k.xml =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/aircraft/m2k.xml,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** m2k.xml 18 Jul 2003 21:55:28 -0000 1.7 --- m2k.xml 16 Sep 2003 06:57:30 -0000 1.7.2.1 *************** *** 8,14 **** <Path name="model">m2k.model</Path> <Bool name="complex_physics">true</Bool> ! <!-- these values come from a FS2k2 add-on --> <Float name="aileron_min">-15.0</Float> <Float name="aileron_max">+19.5</Float> --- 8,16 ---- <Path name="model">m2k.model</Path> + + <!-- <Bool name="complex_physics">true</Bool> ! < these values come from a FS2k2 add-on > <Float name="aileron_min">-15.0</Float> <Float name="aileron_max">+19.5</Float> *************** *** 20,23 **** --- 22,26 ---- <Float name="airbrake_max">60.0</Float> <Float name="airbrake_rate">20.0</Float> + --> <!-- Mass/Inertial properties --> *************** *** 52,54 **** --- 55,60 ---- </Object> </Object> + + <Path name="human_systems">m2k.system</Path> + </Object> |
From: <mk...@us...> - 2003-09-16 06:57:35
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data In directory sc8-pr-cvs1:/tmp/cvs-serv15155/Data Modified Files: Tag: systems CSPSim.ini Log Message: Index: CSPSim.ini =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/CSPSim.ini,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** CSPSim.ini 24 Jul 2003 08:10:55 -0000 1.14 --- CSPSim.ini 16 Sep 2003 06:57:30 -0000 1.14.2.1 *************** *** 14,18 **** CachePath = ../Data InputMapPath = Input ! DataPath = ../Data FontPath = Fonts ModelPath = Models --- 14,18 ---- CachePath = ../Data InputMapPath = Input ! DataPath = ../../../../data FontPath = Fonts ModelPath = Models |
From: <mk...@us...> - 2003-09-16 06:57:35
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Bin In directory sc8-pr-cvs1:/tmp/cvs-serv15155/Bin Modified Files: Tag: systems CSPSim.py Log Message: Index: CSPSim.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/CSPSim.py,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** CSPSim.py 16 Aug 2003 10:23:12 -0000 1.11 --- CSPSim.py 16 Sep 2003 06:57:30 -0000 1.11.2.1 *************** *** 46,49 **** --- 46,50 ---- print " --log=classes set the logging classes" print " --slog=level set the simdata logging level" + print " --dump-data show the contents of sim.dar" print " --help help message" *************** *** 92,100 **** def compileData(args): datapath = CSP.getDataPath() cachepath = CSP.getCachePath() dar = os.path.join(cachepath, "sim.dar") ! XML = os.path.join(datapath, "XML") CSP.csplog().setLogLevels(CSP.CSP_ALL, SimData.LOG_ALERT) #print "compile %s %s" % (XML, dar) --- 93,113 ---- + def dumpData(args): + cachepath = CSP.getCachePath() + dar = os.path.join(cachepath, "sim.dar") + for arg in args: + if arg.startswith('--dump-data='): + dar = arg[12:] + archive = SimData.DataArchive(dar, 1) + archive.dump() + archive.getObject("sim:terrain.balkan") + archive.getObject("sim:theater.balkan") + + def compileData(args): datapath = CSP.getDataPath() cachepath = CSP.getCachePath() dar = os.path.join(cachepath, "sim.dar") ! XML = os.path.join(cachepath, "XML") CSP.csplog().setLogLevels(CSP.CSP_ALL, SimData.LOG_ALERT) #print "compile %s %s" % (XML, dar) *************** *** 220,223 **** --- 233,241 ---- if arg == '--compile-data': action = compileData + elif arg == '--dump-data': + action = dumpData + elif arg.startswith('--dump-data='): + action = dumpData + other_args.append(arg) elif arg in ("--help", "-h", "-help"): if action == None: |
From: <mk...@us...> - 2003-09-16 06:57:35
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv15155 Modified Files: Tag: systems CHANGES.current configure.in Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.69 retrieving revision 1.69.2.1 diff -C2 -d -r1.69 -r1.69.2.1 *** CHANGES.current 7 Sep 2003 22:25:49 -0000 1.69 --- CHANGES.current 16 Sep 2003 06:57:30 -0000 1.69.2.1 *************** *** 2,5 **** --- 2,34 ---- =========================== + 2003-09-15: onsight + Added SynchronousUpdate.h and SynchronousUpdate.cpp as the + basis for a new update callback infrastructure. + + 2003-09-13: onsight + Renamed Model to SystemsModel + + Removed F16Model from the build. + + Added m_SystemsModel to DynamicObject to reference the + current systems model. The setHuman() and setLocal() + methods now handle updates of the model, using two new + simdata::Path member variables: m_AgentModel and m_HumanModel. + + SystemModel updates are now hooked into DynamicObject updates. + + Input events are chained to the systems model if the dynamic + object doesn't handle them. + + Changed the mapped input event interface. The onCommand, + onAxis, and onMotion methods of InputInterface are now + private, and all mapped events are passed via the onMapEvent + method. Overriding these methods was generally used to pass + events to subobjects, so it is easier now that only one method + needs to be extended. The raw event handlers were excluded + from this interface, since raw events are more often handled + by top-level objects. MapEvent is a wrapper type that + encompasses the three original types of events. + 2003-09-07: onsight Added Include/System.h and Include/Bus.h, which provide Index: configure.in =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/configure.in,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** configure.in 22 Jul 2003 15:53:11 -0000 1.13 --- configure.in 16 Sep 2003 06:57:30 -0000 1.13.2.1 *************** *** 72,75 **** --- 72,78 ---- CSP_OSG_CONFIG(osgParticle, 0.9.4, [OpenSceneGraph Particle library]) + dnl check for libSigC++ type-safe signal libraryy + CSP_LIB_CONFIG([SIGC], [sigc], [1.0.1], [--cflags], [LibSigC++ Signal Library], [http://libsigc.sourceforge.net/]) + #CSP_LIB_CONFIG([CCGNU2], [ccgnu2], [1.0.6], [--flags], [GNU Common C++ Library], [http://www.gnu.org/software/commonc++/]) |
From: <mk...@us...> - 2003-09-16 03:35:25
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv10629 Added Files: SynchronousUpdate.cpp Log Message: --- NEW FILE: SynchronousUpdate.cpp --- // Combat Simulator Project - CSPSim // Copyright (C) 2003 The Combat Simulator Project // http://csp.sourceforge.net // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file SynchronousUpdate.cpp * **/ #include <SynchronousUpdate.h> int UpdateProxy::update(double time) { if (!m_Target) return DEAD; double dt = m_Target->onUpdate(time - m_LastUpdateTime); if (dt < 0.0) { detachTarget(); return DEAD; } m_LastUpdateTime = time; m_NextUpdateTime = time + dt; return ((dt > 0.0) ? DELAYED : IMMEDIATE); } UpdateProxy::Ref UpdateMaster::registerUpdate(UpdateTarget *target, double delay) { UpdateProxy::Ref proxy; if (target) { delay = std::max(0.0, delay); proxy = new UpdateProxy(target, this, m_Time + delay); if (delay > 0.0) { m_DelayQueue.push_back(proxy); std::push_heap(m_DelayQueue.begin(), m_DelayQueue.end(), m_Priority); } else { m_ShortList.push_back(proxy); } } return proxy; } void UpdateMaster::update(double dt) { m_Time += dt; m_Transfer.clear(); if (!m_ShortList.empty()) { UpdateList::iterator iter = m_ShortList.begin(); UpdateList::iterator end = m_ShortList.begin(); UpdateList::iterator remove; while (iter != end) { int op = (*iter)->update(m_Time); switch (op) { case UpdateProxy::IMMEDIATE: ++iter; break; case UpdateProxy::DELAYED: m_Transfer.push_back(*iter); // fall through case UpdateProxy::DEAD: remove = iter++; m_ShortList.erase(remove); break; default: break; } } } if (!m_DelayQueue.empty()) { while (m_DelayQueue.front()->nextUpdateTime() <= m_Time) { std::pop_heap(m_DelayQueue.begin(), m_DelayQueue.end(), m_Priority); int op = m_DelayQueue.back()->update(m_Time); switch (op) { case UpdateProxy::DELAYED: std::push_heap(m_DelayQueue.begin(), m_DelayQueue.end(), m_Priority); break; case UpdateProxy::IMMEDIATE: m_ShortList.push_back(m_DelayQueue.back()); // fall through case UpdateProxy::DEAD: m_DelayQueue.pop_back(); break; default: break; } } } if (!m_Transfer.empty()) { UpdateVector::iterator iter = m_Transfer.begin(); UpdateVector::iterator end = m_Transfer.end(); for (; iter != end; ++iter) { m_DelayQueue.push_back(*iter); std::push_heap(m_DelayQueue.begin(), m_DelayQueue.end(), m_Priority); } } } void UpdateTarget::registerUpdate(UpdateMaster *master) { if (master) { if (m_UpdateProxy.valid()) m_UpdateProxy->targetSelfDetach(); m_UpdateProxy = master->registerUpdate(this); } } UpdateTarget::~UpdateTarget() { if (m_UpdateProxy.valid()) m_UpdateProxy->targetSelfDetach(); } |
From: <mk...@us...> - 2003-09-16 03:35:09
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv10580 Added Files: SynchronousUpdate.h Log Message: --- NEW FILE: SynchronousUpdate.h --- // Combat Simulator Project - CSPSim // Copyright (C) 2003 The Combat Simulator Project // http://csp.sourceforge.net // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file SynchronousUpdate.h * **/ #ifndef __SYNCHRONOUSUPDATE_H__ #define __SYNCHRONOUSUPDATE_H__ #include <SimData/Ref.h> #include <algorithm> #include <vector> #include <list> #include <functional> class UpdateProxy; class UpdateMaster; class UpdateTarget { friend class UpdateProxy; private: /// A proxy for connecting to an UpdateMaster. simdata::Ref<UpdateProxy> m_UpdateProxy; /** Detach from the update proxy. */ void detachUpdateProxy() { m_UpdateProxy = 0; } protected: /** Register our update callback with an UpdateMaster. * * Note that the UpdateMaster itself must be updated in order * for our onUpdate() method to be called. The UpdateMaster * instance is usually updated as part of the main simulation * loop. */ void registerUpdate(UpdateMaster *master); public: /** Disconnect our update callback. */ virtual ~UpdateTarget(); /** Update callback. * * @param dt The time interval (in seconds) since the last call * to onUpdate() or from the time of registration until * the first callback. * @returns The minimum time until the next update callback. Return * 0.0 to receive the soonest possible callback (typically * one frame later). Negative return values will (permanantly) * disconnect the callback. */ virtual double onUpdate(double dt) { dt = dt; return -1.0; } }; class UpdateProxy: public simdata::Referenced { friend class UpdateMaster; friend class UpdateTarget; public: /// Convenience typedef for UpdateProxy references. typedef simdata::Ref<UpdateProxy> Ref; /** Get the (internal) time value of the next update. */ double nextUpdateTime() const { return m_NextUpdateTime; } /** Get the (internal) time value at the last update. */ double lastUpdateTime() const { return m_LastUpdateTime; } private: /// Connection to an update master. UpdateMaster *m_Master; /// Connection to an update target. UpdateTarget *m_Target; /// UpdateMaster time of last update. double m_LastUpdateTime; /// UpdateMaster time of next update. double m_NextUpdateTime; /// Update return modes. enum { DEAD, IMMEDIATE, DELAYED }; /** Disconnect from the target. * * NOTE: this method should only be called by ~UpdateTarget(). */ void targetSelfDetach() { m_Target = 0; } /** Disconnect from the target. */ void detachTarget() { if (m_Target) { m_Target->detachUpdateProxy(); m_Target = 0; } } /** Update the target. * * @param time The (internal) time value of the master. */ int update(double time); /** Construct a new proxy to connect a target to a master. * * @param target The update target. * @param master The update master. * @param time The current (internal) time value of the master. */ UpdateProxy(UpdateTarget *target, UpdateMaster *master, double time): m_Master(master), m_Target(target), m_LastUpdateTime(time), m_NextUpdateTime(time) { } /** Test if connected to an UpdateTarget. */ bool hasTarget() const { return m_Target != 0; } /** Test if connected to an UpdateMaster. */ bool hasMaster() const { return m_Master != 0; } }; /** Update scheduling class. * * UpdateMaster instances activate onUpdate() callback methods of attached * UpdateTarget instances. Attachments are made via UpdateProxy instances * which automatically disconnect the callbacks if the target is destroyed. * The UpdateMaster maintains a separate list for callbacks that require * "immidiate" updates (i.e. as soon as possible), and a priority queue for * callbacks that only require delayed updates. The minimum time until the * next update callback is determined by the return value of onUpdate(), * where <= 0 means immediate. Of course callbacks can only occur as * often as UpdateMaster::update is called, and this interval will also * determine the granularity of delayed callback intervals. */ class UpdateMaster { /// Binary predicate for prioritizing delayed update callbacks. struct UpdatePriority: public std::binary_function<UpdateProxy::Ref,UpdateProxy::Ref,bool> { bool operator()(UpdateProxy::Ref &a, UpdateProxy::Ref &b) { return (a->nextUpdateTime() > b->nextUpdateTime()); } } m_Priority; typedef std::vector<UpdateProxy::Ref> UpdateVector; typedef std::list<UpdateProxy::Ref> UpdateList; /// A priority queue of delayed callbacks UpdateVector m_DelayQueue; /// A list of callbacks requiring "immediate" service UpdateList m_ShortList; /// A list used to transfer callbacks from the short list to the delay queue UpdateVector m_Transfer; /// The current internal time used for prioritization double m_Time; public: /** Default constructor. */ UpdateMaster(): m_Time(0.0) { m_Transfer.reserve(64); m_DelayQueue.reserve(64); } /** Connect a new update callback. * * @param target The UpdateTarget instance to register. * @param delay The delay until the first callback (default 0.0) */ UpdateProxy::Ref registerUpdate(UpdateTarget *target, double delay = 0.0); /** Update immediate callbacks and any delayed callbacks that are ready. */ void update(double dt); }; #endif // __SYNCHRONOUSUPDATE_H__ |
From: <mk...@us...> - 2003-09-12 05:52:38
|
Update of /cvsroot/csp/APPLICATIONS/CSPEdit In directory sc8-pr-cvs1:/tmp/cvs-serv29990/CSPEdit Log Message: Directory /cvsroot/csp/APPLICATIONS/CSPEdit added to the repository |
From: <mk...@us...> - 2003-09-07 22:26:57
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv3612 Modified Files: Tag: b0_4_0 CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.75.2.4 retrieving revision 1.75.2.5 diff -C2 -d -r1.75.2.4 -r1.75.2.5 *** CHANGES.current 6 Sep 2003 08:52:06 -0000 1.75.2.4 --- CHANGES.current 7 Sep 2003 22:25:05 -0000 1.75.2.5 *************** *** 1,4 **** --- 1,7 ---- Version 0.4.0 (in progress) =========================== + 2003-09-07: onsight + Fixed signed/unsigned comparisons in Composite.h + 2003-09-05: onsight Added Composite.h, which contains template classes for |
From: <mk...@us...> - 2003-09-07 22:26:55
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv3612/Include/SimData Modified Files: Tag: b0_4_0 Composite.h Log Message: Index: Composite.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Composite.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** Composite.h 6 Sep 2003 08:52:06 -0000 1.1.2.3 --- Composite.h 7 Sep 2003 22:25:05 -0000 1.1.2.4 *************** *** 82,86 **** TRAVERSE_NONE, //< Act on only the current node. TRAVERSE_CHILDREN, //< Act on the current node and all children ! TRAVERSE_PARENTS, //< Act on the current node and all parents } TraversalMode; --- 82,86 ---- TRAVERSE_NONE, //< Act on only the current node. TRAVERSE_CHILDREN, //< Act on the current node and all children ! TRAVERSE_PARENTS //< Act on the current node and all parents } TraversalMode; *************** *** 275,280 **** * otherwise. */ ! virtual bool removeChild(int pos, int count=1) { ! if (pos >= _children.size() || count <= 0) return false; unsigned int end = pos + count; if (end > _children.size()) { --- 275,280 ---- * otherwise. */ ! virtual bool removeChild(unsigned int pos, unsigned int count=1) { ! if (pos >= _children.size() || count == 0) return false; unsigned int end = pos + count; if (end > _children.size()) { *************** *** 345,349 **** */ inline unsigned int getChildIndex(Node const *node) const { ! for (int idx = 0; idx < _children.size(); ++idx) { if (_children[idx] == node) return idx; } --- 345,349 ---- */ inline unsigned int getChildIndex(Node const *node) const { ! for (unsigned int idx = 0; idx < _children.size(); ++idx) { if (_children[idx] == node) return idx; } |
From: <mk...@us...> - 2003-09-07 22:26:28
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv3748/Include Modified Files: Bus.h System.h Log Message: Index: Bus.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Bus.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Bus.h 7 Sep 2003 16:38:32 -0000 1.1 --- Bus.h 7 Sep 2003 22:25:49 -0000 1.2 *************** *** 65,74 **** MASK_BLOCKED = 0x00000002, MASK_SHARED = 0x00000004, ! DERIVED_MASK = 0xffff0000, }; typedef enum { ACCESS_LOCAL, ! ACCESS_SHARED, } AccessType; --- 65,74 ---- MASK_BLOCKED = 0x00000002, MASK_SHARED = 0x00000004, ! DERIVED_MASK = 0xffff0000 }; typedef enum { ACCESS_LOCAL, ! ACCESS_SHARED } AccessType; *************** *** 95,99 **** */ void setEnabled(bool enabled) { ! m_Mask = (m_Mask & ~MASK_ENABLED) | (enabled ? MASK_ENABLED : 0); } --- 95,99 ---- */ void setEnabled(bool enabled) { ! m_Mask = (m_Mask & ~MASK_ENABLED) | (enabled ? MASK_ENABLED : 0U); } *************** *** 126,130 **** m_Name(name), m_Mask(0) { ! m_Mask |= (access == ACCESS_SHARED) ? MASK_SHARED : 0; } }; --- 126,130 ---- m_Name(name), m_Mask(0) { ! m_Mask |= (access == ACCESS_SHARED) ? MASK_SHARED : 0U; } }; *************** *** 186,190 **** MASK_PUSH = 0x00020000, MASK_PULL = 0x00040000, ! MASK_DIRTY = 0x00080000, }; --- 186,190 ---- MASK_PUSH = 0x00020000, MASK_PULL = 0x00040000, ! MASK_DIRTY = 0x00080000 }; *************** *** 194,198 **** NO_SIGNAL, PUSH_SIGNAL, ! PULL_SIGNAL, } SignalType; --- 194,198 ---- NO_SIGNAL, PUSH_SIGNAL, ! PULL_SIGNAL } SignalType; *************** *** 349,353 **** * @param shared Create a shared (or non-shared) channel. */ ! DataChannel(std::string const &name, T const &value, AccessType access=ACCESS_LOCAL, SignalType signal=NO_SIGNAL): m_Value(value), DataChannelBase(name, access, signal) {} static DataChannel<T> *newLocal(std::string const &name, T const &value) { --- 349,353 ---- * @param shared Create a shared (or non-shared) channel. */ ! DataChannel(std::string const &name, T const &value, AccessType access=ACCESS_LOCAL, SignalType signal=NO_SIGNAL): DataChannelBase(name, access, signal), m_Value(value) {} static DataChannel<T> *newLocal(std::string const &name, T const &value) { *************** *** 583,588 **** */ Bus(std::string const &name): - m_Name(name), m_Bound(false), m_Status(1.0), m_Enabled(true) --- 583,588 ---- */ Bus(std::string const &name): m_Bound(false), + m_Name(name), m_Status(1.0), m_Enabled(true) Index: System.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/System.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** System.h 7 Sep 2003 16:45:55 -0000 1.2 --- System.h 7 Sep 2003 22:25:49 -0000 1.3 *************** *** 120,124 **** // for internal use by the system instance, which will be // destroyed when the model goes out of scope. ! Model* System::getModel() const { return m_Model; } public: --- 120,124 ---- // for internal use by the system instance, which will be // destroyed when the model goes out of scope. ! Model* getModel() const { return m_Model; } public: *************** *** 178,182 **** Bus::Ref m_Bus; ! virtual void setModel(Model *model) {} class FindSystemByNameVisitor: public simdata::FindVisitor<System,SystemVisitor> { --- 178,182 ---- Bus::Ref m_Bus; ! virtual void setModel(Model *) {} class FindSystemByNameVisitor: public simdata::FindVisitor<System,SystemVisitor> { |
From: <mk...@us...> - 2003-09-07 22:26:14
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv3748 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** CHANGES.current 7 Sep 2003 16:48:26 -0000 1.68 --- CHANGES.current 7 Sep 2003 22:25:49 -0000 1.69 *************** *** 9,12 **** --- 9,14 ---- interface. + Minor warning cleanups in System.h and Bus.h. + 2003-08-20: onsight Tagged version r0_3_4, starting version 0.3.5 |
From: <mk...@us...> - 2003-09-07 16:48:32
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv6593 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** CHANGES.current 21 Aug 2003 08:18:37 -0000 1.67 --- CHANGES.current 7 Sep 2003 16:48:26 -0000 1.68 *************** *** 2,5 **** --- 2,12 ---- =========================== + 2003-09-07: onsight + Added Include/System.h and Include/Bus.h, which provide + infrastructure for constructing detailed vehicle models. + Several existing components such as the data recorder and + flight model need to be refactored to use this new + interface. + 2003-08-20: onsight Tagged version r0_3_4, starting version 0.3.5 |
From: <mk...@us...> - 2003-09-07 16:46:00
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv6186 Modified Files: System.h Log Message: Index: System.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/System.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** System.h 7 Sep 2003 16:40:37 -0000 1.1 --- System.h 7 Sep 2003 16:45:55 -0000 1.2 *************** *** 167,227 **** - // interface event visitors - - class EventVisitor: public SystemVisitor { - bool m_handled; - public: - typedef simdata::Ref<EventVisitor> Ref; - EventVisitor(): m_handled(false) {} - bool handled() const { return m_handled; } - void apply(System &system) { - if (m_handled) return; - m_handled = check(system); - if (!m_handled) traverse(system); - } - protected: - virtual bool check(System &system) = 0; - }; - - - class OnCommandVisitor: public EventVisitor { - std::string const &m_id; - int m_x, m_y; - public: - OnCommandVisitor(std::string const &id, int x, int y): - EventVisitor(), m_id(id), m_x(x), m_y(y) {} - protected: - bool check(System &system) { - return system.onCommand(m_id, m_x, m_y); - } - }; - - - class OnAxisVisitor: public EventVisitor { - std::string const &m_id; - double m_value; - public: - OnAxisVisitor(std::string const &id, double value): - EventVisitor(), m_id(id), m_value(value) {} - protected: - bool check(System &system) { - return system.onAxis(m_id, m_value); - } - }; - - - class OnMotionVisitor: public EventVisitor { - std::string const &m_id; - int m_x, m_y, m_dx, m_dy; - public: - OnMotionVisitor(std::string const &id, int x, int y, int dx, int dy): - EventVisitor(), m_id(id), m_x(x), m_y(y), m_dx(dx), m_dy(dy) {} - protected: - virtual bool check(System &system) { - return system.onMotion(m_id, m_x, m_y, m_dx, m_dy); - } - }; - class Model: public System { --- 167,177 ---- + /** Base class for detailed vehicle models. + * + * Model classes serve as the root node of System trees. The + * model defines a data bus shared by all systems it contains, + * and serves as the external interface of the composite system. + */ class Model: public System { *************** *** 284,286 **** --- 234,293 ---- } + + + // interface event visitors + + class EventVisitor: public SystemVisitor { + bool m_handled; + public: + typedef simdata::Ref<EventVisitor> Ref; + EventVisitor(): m_handled(false) {} + bool handled() const { return m_handled; } + void apply(System &system) { + if (m_handled) return; + m_handled = check(system); + if (!m_handled) traverse(system); + } + protected: + virtual bool check(System &system) = 0; + }; + + + class OnCommandVisitor: public EventVisitor { + std::string const &m_id; + int m_x, m_y; + public: + OnCommandVisitor(std::string const &id, int x, int y): + EventVisitor(), m_id(id), m_x(x), m_y(y) {} + protected: + bool check(System &system) { + return system.onCommand(m_id, m_x, m_y); + } + }; + + + class OnAxisVisitor: public EventVisitor { + std::string const &m_id; + double m_value; + public: + OnAxisVisitor(std::string const &id, double value): + EventVisitor(), m_id(id), m_value(value) {} + protected: + bool check(System &system) { + return system.onAxis(m_id, m_value); + } + }; + + + class OnMotionVisitor: public EventVisitor { + std::string const &m_id; + int m_x, m_y, m_dx, m_dy; + public: + OnMotionVisitor(std::string const &id, int x, int y, int dx, int dy): + EventVisitor(), m_id(id), m_x(x), m_y(y), m_dx(dx), m_dy(dy) {} + protected: + virtual bool check(System &system) { + return system.onMotion(m_id, m_x, m_y, m_dx, m_dy); + } + }; |
From: <mk...@us...> - 2003-09-07 16:40:45
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv4853 Added Files: System.h Log Message: detailed vehicle model systems infrastructure --- NEW FILE: System.h --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2003 The Combat Simulator Project // http://csp.sourceforge.net // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file System.h * * Vehicle systems base classes and infrastructure. * **/ #include <Bus.h> #include <Updater.h> #include <InputInterface.h> #include <SimData/Object.h> #include <SimData/Composite.h> class System; class Model; /// A visitor interface for traversing System graphs class SystemVisitor: public simdata::Visitor<SystemVisitor> { public: SIMDATA_VISITOR(SystemVisitor); virtual void apply(System &system) { apply((Node&)system); } virtual void apply(Model &model) { apply((System&)model); } }; typedef simdata::Composite<SystemVisitor> SystemNode; /** Base class for vehicle system components that can be connected * to a data bus. * * Subclasses should implement registerChannels() and bind(). The * former is used to expose internal data that can be accessed by * other systems over the bus, and is called automatically by the * bus when the system is first attached. The bind() method is * called once by the bus after all systems have been attached and * registered. Use this method to bind to data channels provided * by other systems over the bus. */ class System: public simdata::Object, public SystemNode, public Updater, public InputInterface { friend class Model; public: /// System reference (convenience) type. typedef simdata::Ref<System> Ref; private: Model *m_Model; std::string m_Name; class SetModelVisitor: public SystemVisitor { Model *m_Model; public: SetModelVisitor(Model *model): m_Model(model) {} virtual void apply(System &s) { s.setModel(m_Model); traverse(s); } }; virtual void setModel(Model *model); protected: /** Register channels for access to internal data by other * systems on the bus. * * Use bus->getName() to select which channels to register * if the system may be attached to more than one bus. */ virtual void registerChannels(Bus*) {} class BindVisitor: public SystemVisitor { Bus* m_Bus; public: BindVisitor(Bus *bus): m_Bus(bus) {} void apply(System &s) { s.bind(m_Bus); traverse(s); } }; /** Bind to channels provided by other systems on the bus. * * Call bus->getChannel() and bus->getSharedChannel() to * obtain references to data channels available on the * bus. These references should generally be stored as * system member variables for later use. */ virtual void bind(Bus*) {} // XXX use raw pointers here to prevent circular references // that keep the model alive. the model pointer is only // for internal use by the system instance, which will be // destroyed when the model goes out of scope. Model* System::getModel() const { return m_Model; } public: bool canBeAdded() const { return getNumParents() == 0; } /** Constructor. * * @param name The identifier string of this system. */ System(std::string const &name): m_Name(name) {} /** Get the system identifier string (name). */ std::string const &getName() const { return m_Name; } virtual bool addChild(SystemNode *node) { if (!SystemNode::addChild(node)) return false; node->accept(new SetModelVisitor(getModel())); return true; } System *addSystem(System *system, bool required = true) { if (addChild(system)) return system; assert(!required); return 0; } private: class UpdateChildrenVisitor: public SystemVisitor { double m_dt; public: UpdateChildrenVisitor(double dt): m_dt(dt) {} void apply(System &child) { child.update(m_dt); } }; public: /** Generate interval timer signals. */ virtual double onUpdate(double dt) { descend(new UpdateChildrenVisitor(dt)); return 0.0; } SIMDATA_VISITABLE(SystemVisitor); }; // interface event visitors class EventVisitor: public SystemVisitor { bool m_handled; public: typedef simdata::Ref<EventVisitor> Ref; EventVisitor(): m_handled(false) {} bool handled() const { return m_handled; } void apply(System &system) { if (m_handled) return; m_handled = check(system); if (!m_handled) traverse(system); } protected: virtual bool check(System &system) = 0; }; class OnCommandVisitor: public EventVisitor { std::string const &m_id; int m_x, m_y; public: OnCommandVisitor(std::string const &id, int x, int y): EventVisitor(), m_id(id), m_x(x), m_y(y) {} protected: bool check(System &system) { return system.onCommand(m_id, m_x, m_y); } }; class OnAxisVisitor: public EventVisitor { std::string const &m_id; double m_value; public: OnAxisVisitor(std::string const &id, double value): EventVisitor(), m_id(id), m_value(value) {} protected: bool check(System &system) { return system.onAxis(m_id, m_value); } }; class OnMotionVisitor: public EventVisitor { std::string const &m_id; int m_x, m_y, m_dx, m_dy; public: OnMotionVisitor(std::string const &id, int x, int y, int dx, int dy): EventVisitor(), m_id(id), m_x(x), m_y(y), m_dx(dx), m_dy(dy) {} protected: virtual bool check(System &system) { return system.onMotion(m_id, m_x, m_y, m_dx, m_dy); } }; class Model: public System { Bus::Ref m_Bus; virtual void setModel(Model *model) {} class FindSystemByNameVisitor: public simdata::FindVisitor<System,SystemVisitor> { std::string m_Name; public: FindSystemByNameVisitor(std::string const &name): simdata::FindVisitor<System,SystemVisitor>(), m_Name(name) {} virtual bool match(System &s) { return s.getName() == m_Name; } }; protected: virtual ~Model() { } public: bool canBeAdded() const { return false; } Bus::Ref getBus() const { assert(m_Bus.valid()); return m_Bus; } System::Ref getSystem(std::string const &name, bool required = true) { simdata::Ref< simdata::FindVisitor<System,SystemVisitor> > visitor; visitor = accept(new FindSystemByNameVisitor(name)); System::Ref found = visitor->getNode(); if (!found) { assert(!required); return 0; } return found; } void bindSystems() { accept(new BindVisitor(m_Bus.get())); } Model(std::string const &name): System(name) { m_Model = this; m_Bus = new Bus("MODEL_BUS"); } SIMDATA_VISITABLE(SystemVisitor); }; void System::setModel(Model *model) { assert(m_Model == 0 || model == 0); m_Model = model; if (model != 0) { Bus::Ref bus = model->getBus(); registerChannels(bus.get()); } } |