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-07-26 21:36:30
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/XML In directory sc8-pr-cvs1:/tmp/cvs-serv16455 Added Files: cspf4dat.py Log Message: --- NEW FILE: cspf4dat.py --- # Combat Simulator Project - CSPSim # Copyright (C) 2002 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. import sys class Data: pass class Table: def __init__(self, xbreaks, ybreaks, table): self.x = xbreaks self.y = ybreaks self.table = table class hnum: def __init__(self, id, scale=1.0): self.id = id self.scale = scale def process(self, data, line): setattr(data, self.id, float(line)*self.scale); return 1 class hsub: def __init__(self, id, opts): self.id = id self.opts = opts def process(self, data, line): d = Data() line = line.split() for idx in range(len(line)): self.opts[idx].process(d, line[idx]) if not hasattr(data, self.id): setattr(data, self.id, d); return 1 class hnumlist: def __init__(self, id, scale=1.0): self.id = id self.state = 0 self.scale = scale def process(self, data, line): if self.state == 0: self.state = 1 self.count = int(line) self.list = [] return 0 self.list += map(float, line.split()) if len(self.list) < self.count: return 0 self.list = map(lambda x, s=self.scale: x*s, self.list) setattr(data, self.id, self.list) return 1 class htable: def __init__(self, id, xbreaks, ybreaks, scale=1.0): self.id = id self.current = [] self.table = [] self.xbreaks = xbreaks self.ybreaks = ybreaks self.scale = scale def process(self, data, line): xbreaks = getattr(data, self.xbreaks) ybreaks = getattr(data, self.ybreaks) self.current += map(float, line.split()) if len(self.current) > len(xbreaks): raise "fubar table" if len(self.current) == len(xbreaks): self.current = map(lambda x, s=self.scale: x*s, self.current) self.table.append(self.current) if len(self.table) == len(ybreaks): table = Table(xbreaks, ybreaks, self.table) setattr(data, self.id, table) return 1 self.current = [] return 0 class ACData: handlers = [ hnum("empty_weight"), hnum("reference_area"), hnum("internal_fuel"), hnum("aoa_max"), hnum("aoa_min"), hnum("beta_max"), hnum("beta_min"), hnum("max_g"), hnum("max_roll"), hnum("min_vcas"), hnum("max_vcas"), hnum("corner_vcas"), hnum("theta_max"), hnum("num_gear"), hsub("gear1", (hnum("x"), hnum("y"), hnum("z"), hnum("rng"))), hsub("gear2", (hnum("x"), hnum("y"), hnum("z"), hnum("rng"))), hsub("gear3", (hnum("x"), hnum("y"), hnum("z"), hnum("rng"))), hnum("cg_loc"), hnum("length"), hnum("span"), hnum("fuselage_radius"), hnum("tail_height"), hnumlist("aero_mach_breaks"), hnumlist("aero_alpha_breaks"), hnum("c_l_multiplier"), htable("c_l", "aero_alpha_breaks", "aero_mach_breaks"), hnum("c_d_multiplier"), htable("c_d", "aero_alpha_breaks", "aero_mach_breaks"), hnum("c_y_multiplier"), htable("c_y", "aero_alpha_breaks", "aero_mach_breaks"), hnum("thrust_multiplier"), hnum("fuel_flow_multiplier"), hnumlist("thrust_mach_breaks"), hnumlist("thrust_altitude_breaks", 0.3048), htable("idle_thrust", "thrust_mach_breaks", "thrust_altitude_breaks", 4.545), htable("mil_thrust", "thrust_mach_breaks", "thrust_altitude_breaks", 4.545), htable("ab_thrust", "thrust_mach_breaks", "thrust_altitude_breaks", 4.545), ] def __init__(self): self.data = Data() def parse(self, f): idx = 0 line_no = 0 for line in f.xreadlines(): line_no = line_no + 1 comment = line.find('#') if comment >= 0: line = line[:comment] line = line.strip() if line == "": continue try: done = self.handlers[idx].process(self.data, line) except: print "Error parsing input, line %d" % line_no raise if done: idx = idx + 1 if idx >= len(self.handlers): break class Tabpr: tabs = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t" def __init__(self, indent): indent = self.tabs[:indent] self._indent = indent def __call__(self, *args): print "%s%s" % (self._indent, " ".join(map(str,args))) def indent(self, n=1): if n < 0: self._indent = self._indent[:n] if n > 0: self._indent = self._indent + self.tabs[:n] def table_xml(self, id, table, xspacing=1, yspacing=1, indent=0): tabpr = self.Tabpr(indent) tabpr("<Table name='%s'>" % id) tabpr.indent() tabpr("<XBreaks spacing='%s'>" % str(xspacing)) tabpr.indent() tabpr(*table.x) tabpr.indent(-1) tabpr("</XBreaks>") tabpr("<YBreaks spacing='%s'>" % str(yspacing)) tabpr.indent() tabpr(*table.y) tabpr.indent(-1) tabpr("</YBreaks>") tabpr("<Values>") tabpr.indent() for curve in table.table: tabpr(*curve) tabpr.indent(-1) tabpr("</Values>") tabpr.indent(-1) tabpr("</Table>") def engine_xml(self): self.table_xml("idle_thrust", self.data.idle_thrust, 0.1, 1000.0, 1) self.table_xml("mil_thrust", self.data.mil_thrust, 0.1, 1000.0, 1) self.table_xml("ab_thrust", self.data.ab_thrust, 0.1, 1000.0, 1) f = sys.stdin ac = ACData() ac.parse(f) ac.engine_xml() |
From: <mk...@us...> - 2003-07-26 21:35:04
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/tile In directory sc8-pr-cvs1:/tmp/cvs-serv16172 Modified Files: Makefile tile.cpp Log Message: Index: Makefile =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/tile/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 26 Jul 2003 21:32:21 -0000 1.2 --- Makefile 26 Jul 2003 21:35:01 -0000 1.3 *************** *** 1,5 **** ! all: csptiler ! csptiler: tile.cpp ! g++ -O2 -g tile.cpp -o tile -I/usr/include/python2.2 -lSimData -lz --- 1,5 ---- ! all: csptile ! csptile: tile.cpp ! g++ -O2 -g $^ -o $@ -I/usr/include/python2.2 -lSimData -lz Index: tile.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/tile/tile.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tile.cpp 22 Jul 2003 21:17:41 -0000 1.2 --- tile.cpp 26 Jul 2003 21:35:01 -0000 1.3 *************** *** 1346,1356 **** }; ! void usage() { ! std::cerr << "Usage: tile [--help] [--datpath=path] [--quiet] [ini]\n"; } ! void help() { std::cerr << "\n"; ! std::cerr << "TerrainTiler (pre-version)\n"; std::cerr << "Copyright 2003 The Combat Simulator Project <http://csp.sourceforge.net>\n"; std::cerr << "\n"; --- 1346,1356 ---- }; ! void usage(const char* arg0) { ! std::cerr << "Usage: " << arg0 << " [--help] [--datpath=path] [--quiet] [ini]\n"; } ! void help(const char *arg0) { std::cerr << "\n"; ! std::cerr << "CSP TerrainTiler (pre-version)\n"; std::cerr << "Copyright 2003 The Combat Simulator Project <http://csp.sourceforge.net>\n"; std::cerr << "\n"; *************** *** 1361,1365 **** std::cerr << "secant gnomonic projection.\n"; std::cerr << "\n"; ! usage(); std::cerr << "\n"; std::cerr << "Options:\n"; --- 1361,1365 ---- std::cerr << "secant gnomonic projection.\n"; std::cerr << "\n"; ! usage(arg0); std::cerr << "\n"; std::cerr << "Options:\n"; *************** *** 1398,1402 **** if (arg[0] == '-') { if (!strcmp(arg, "--help")) { ! help(); ::exit(0); } else --- 1398,1402 ---- if (arg[0] == '-') { if (!strcmp(arg, "--help")) { ! help(argv[0]); ::exit(0); } else *************** *** 1409,1413 **** continue; } ! usage(); ::exit(1); } else { --- 1409,1413 ---- continue; } ! usage(argv[0]); ::exit(1); } else { *************** *** 1416,1420 **** } if (ini == 0) { ! usage(); ::exit(0); } --- 1416,1420 ---- } if (ini == 0) { ! usage(argv[0]); ::exit(0); } |
From: <mk...@us...> - 2003-07-26 21:32:24
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/tile In directory sc8-pr-cvs1:/tmp/cvs-serv15787 Modified Files: Makefile Log Message: Index: Makefile =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/tile/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 22 Jul 2003 15:42:22 -0000 1.1 --- Makefile 26 Jul 2003 21:32:21 -0000 1.2 *************** *** 1,5 **** ! all: tile ! tile: tile.cpp g++ -O2 -g tile.cpp -o tile -I/usr/include/python2.2 -lSimData -lz --- 1,5 ---- ! all: csptiler ! csptiler: tile.cpp g++ -O2 -g tile.cpp -o tile -I/usr/include/python2.2 -lSimData -lz |
From: <mk...@us...> - 2003-07-26 19:44:29
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv28907 Modified Files: README TODO setup.py Log Message: Index: README =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/README,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** README 21 Mar 2003 18:23:16 -0000 1.5 --- README 26 Jul 2003 19:44:26 -0000 1.6 *************** *** 1,5 **** SimData - A library for efficient use of data XML in simulations. ! Release 0.4.0 Copyright (C) 2002, 2003 Mark Rose <mr...@st...> --- 1,5 ---- SimData - A library for efficient use of data XML in simulations. ! Release 0.3.2 Copyright (C) 2002, 2003 Mark Rose <mr...@st...> *************** *** 22,29 **** SimData was initially developed under Linux using GCC 2.95 and 3.0. ! Current development occurs mainly under GCC 3.2. The library also ! receives routine testing under MS VC6 and now .NET as part of the Combat ! Simulator Project. If you encounter problems, please report them (with ! patches if possible) to the CSP developer's forum at http://csp.sourceforge.net/forum. --- 22,30 ---- SimData was initially developed under Linux using GCC 2.95 and 3.0. ! Current development occurs mainly under GCC 3.2. GCC 3.3 has also been ! tested and will soon become the primary development platform. The ! library also receives routine testing under MS VC6 and now .NET as part ! of the Combat Simulator Project. If you encounter problems, please ! report them (with patches if possible) to the CSP developer's forum at http://csp.sourceforge.net/forum. *************** *** 45,122 **** If you are using MS VC6 you will also need have at least SP5 installed and a functional STL implementation, such as STLport (version 4.5.3 or ! newer). BUILDING: ANNOUNCEMENT ! The build process is currently depends on Makefiles (Linux) and VC ! project files (Windows), but will likely transition to Python's ! DistUtils soon. Stay tuned.... BUILDING: LINUX ! On Linux, edit the top level Makefile to customize any settings to your ! particular system. The path to the Python headers is an example of a ! parameter you might want to check. Next, just run make in the top-level directory. If all goes well this ! will create cSimData.py, _cSimData.so, and libSimData.a in the Source ! directory. BUILDING: VC6/.NET ! Load SimDataMSVC.dsw and build it in release mode. In the process, it ! should create a new file called cSimData_wrap.cpp (this file name should ! already be in project/Source) from cSimData.i which is parsed by SWIG. TESTING ! As a quick test, change to the Source directory and run Python. Try typing "import SimData". You should see a line similar to "loaded @ 0x4883012". If not, something went wrong... post to the CSP developer's forum and we can try to find the problem. - USING SIMDATA WITH CSPSIM - - The new CSP application called CSPSim relies on SimData in - two ways. First, libSimData.a is statically linked to make - the CSPSim executable. Second, the simulation data for CSPSim - needs to be compiled from XML source files to a binary data - archive using the data compiler application included with - SimData. This Python program is found in the directory - Tools/DataCompiler. Once you have built your CSPSim executable, - go to Tools/DataCompiler and run Compiler.py (from a command - prompt on windows you would probably need to type something like - "python Compiler.py"). If the Compiler can't find CSPSim - initially, it will prompt you to enter a path to CSPSim. This - path is saved in a file named .csp_path so you shouldn't have - to do this more than once. The Compiler will then print a - usage message and exit. To compile the data for CSPSim, you - must specify the top level data directory to archive, and the - name of the output archive. Given the standard location of - the files in CVS, you would type: - - ./Compiler.py ../../../CSPSim/Data/Sim ../../../CSPSim/Data/Sim.dar - - This will parse all the XML files under CSPSim/Data/Sim and create - the binary archive (named Sim.dar) needed to run CSPSim. A - script named "make_simdar" that runs the above command is provided - for your convienience. This must be rerun whenever you modify - the XML data files to incorporate the changes into Sim.dar. - - - BUILDING on Windows with msvc++6(sp5), stlport-4.5.3 (hints) - - 1) Install python2.2 and swig 1.3.17 - 2) Add python path to your global path - 3) Load SimDataMSVC.dsw - 4) Build it in release mode; in process, it should create a new file - called cSimData_wrap.cpp (this file name should already be in - project/Source) from cSimData.i which is parsed by swig. - 5) Testing procedure is same as above: As a quick test, change to the Source directory and run Python. Try typing "import SimData". You should see a line similar to "loaded @ --- 46,109 ---- If you are using MS VC6 you will also need have at least SP5 installed and a functional STL implementation, such as STLport (version 4.5.3 or ! newer). Some newer features, such as the LUT lookup table classes ! rely on advanced template constructs that aren't correctly supported ! by VC6, VC7, and older versions of GCC (<3.2). SimData functions ! correctly with these compilers as long as the templates are not ! instantiated. All current features work with GCC 3.2 and higher, and ! may work with MSVS 2003 (which reportedly comes much closer to the ISO ! C++ standard). BUILDING: ANNOUNCEMENT ! There are currently several options for building SimData: ! ! * standard Makefiles ! * MSVS projects files ! * Python's DistUtis ! * SCons ! ! The first two are the most standard ways to build SimData for Linux ! and Windows, respectively. Distutils is used primarily for ! installation on both platforms, and is called automatically by ! make and MSVC. Distutils can also be used to build the project, ! although this has received much less testing and probably suffers ! from improper dependency tracking. ! ! SCons is a brand new approach to the problem and promises to greatly ! simplify and unify the build process. So far the SCons scripts are very ! experimental, and should only be used for testing. ! ! Please report any problems building SimData to the forums at ! ! http://csp.sourceforge.net/forum BUILDING: LINUX ! On Linux, (optionally) edit the top level Makefile to customize any ! settings to your particular system. In most cases the Makefile should ! set sane defaults. Next, just run make in the top-level directory. If all goes well this ! will create cSimData.py, _cSimData.so, and libSimData.a in the SimData ! package directory. BUILDING: VC6/.NET ! Load SimDataMSVC.dsw and build it in release mode. TESTING ! As a quick test, run Python from the main SimData directory. Try typing "import SimData". You should see a line similar to "loaded @ 0x4883012". If not, something went wrong... post to the CSP developer's forum and we can try to find the problem. + After you have installed SimData, the same test should work + from any starting directory. As a quick test, change to the Source directory and run Python. Try typing "import SimData". You should see a line similar to "loaded @ *************** *** 127,162 **** INSTALLING AND USING SIMDATA - Note that installation under Windows is not yet supported. This is - being worked on, and information will be added here as soon as it is - available. - - ---------- - - 2003-03-20: Edited - work on progress. On windows, you have to - do: - - > python setup.py make_install_win - - It will install files and folders in python directory (better to be - power user or admin for that on xp). - - ---------- - - - Under Linux, depending on which method you used to build SimData, do - either: - - - $ make install - - or - - $ python setup.py install - - SimData installs itself as a package in the Python site-packages directory. The C++ headers are placed under SimData in the same directory as Python.h. To use the SimData headers for development, just add the usual Python include path (e.g. /usr/local/include/python2.2) to your list of include --- 114,128 ---- INSTALLING AND USING SIMDATA SimData installs itself as a package in the Python site-packages directory. The C++ headers are placed under SimData in the same directory as Python.h. + Under Linux, run 'make install' as root. Alternatively, you can + accomplish the same thing with 'python setup.py install'. + + Under Windows, run 'python setup.py make_install_win'. Under XP + you may need to have sufficient priviledges to write to the Python + directories. + To use the SimData headers for development, just add the usual Python include path (e.g. /usr/local/include/python2.2) to your list of include *************** *** 164,165 **** --- 130,132 ---- #include <SimData/Types.h> + Index: TODO =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/TODO,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TODO 23 Apr 2003 09:14:19 -0000 1.4 --- TODO 26 Jul 2003 19:44:26 -0000 1.5 *************** *** 63,68 **** this feature for the time being. - * More cleanup of the Link<> base classes. - * Add an OSG Math adapter header. --- 63,66 ---- Index: setup.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/setup.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** setup.py 22 Jul 2003 18:41:29 -0000 1.25 --- setup.py 26 Jul 2003 19:44:26 -0000 1.26 *************** *** 50,54 **** # REMEMBER TO 'touch Version.cpp' OR REBUILD ALL ! VERSION = "\"0.3.2\"" def copy_dir(src, dst, files, verbose=0): --- 50,54 ---- # REMEMBER TO 'touch Version.cpp' OR REBUILD ALL ! VERSION = "0.3.2" def copy_dir(src, dst, files, verbose=0): *************** *** 349,353 **** build_swig_ext.options = "-IInclude -noexcept" includes = ["Include"] ! defines = [("SIMDATA_VERSION", VERSION)] libraries = ["swigpy", "dl"] cflags = [] --- 349,353 ---- build_swig_ext.options = "-IInclude -noexcept" includes = ["Include"] ! defines = [("SIMDATA_VERSION", '"%s"' % VERSION)] libraries = ["swigpy", "dl"] cflags = [] *************** *** 375,379 **** author="Mark Rose", author_email="mr...@st...", ! url="http://csp.sourceforge.net/wiki/", packages=['SimData'], headers = headers_fullpath + interfaces_fullpath + main_interface_fullpath, --- 375,380 ---- author="Mark Rose", author_email="mr...@st...", ! url="http://csp.sourceforge.net/wiki/SimData", ! license="GNU General Public License, version 2 or later.", packages=['SimData'], headers = headers_fullpath + interfaces_fullpath + main_interface_fullpath, |
From: <mk...@us...> - 2003-07-26 18:15:25
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv13902 Modified Files: CHANGES.current Added Files: SConstruct construct.py Log Message: --- NEW FILE: SConstruct --- # -*-python-*- # SimData: Data Infrastructure for Simulations # Copyright (C) 2002, 2003 Mark Rose <tm...@st...> # # This file is part of SimData. # # 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. ############################################################################# # # This is a preliminary build system based on SCons (http://www.scons.org). # # * It is intended for testing only at this point, and will # not immediately replace the existing make, distutils, and # msvs project systems. # # * So far this script has been developed only under Linux, so # it will likely have major holes under Windows. # # * Please report any problems or patches to # http://csp.sourceforge.net/forum # # --MR ############################################################################# print "================================================" print " SimData Construction" print "================================================" EnsureSConsVersion(0,9) EnsurePythonVersion(2,2) import construct opt = construct.OptionSet() set, add = opt.methods() set.SWIG_MIN_VERSION = '1.3.16' set.PYTHON_INC = construct.getPythonInc() set.SUBDIRS = ('Source', 'Doc') add.CXXFLAGS = '-g -Wall -O2' add.CPPFLAGS = '' add.CPPPATH = ['#/Include', set.PYTHON_INC] add.SHLINKFLAGS = ' -Wl,-z,lazyload' add.SHLINKLIBS = ['dl'] add.SWFLAGS = '-c -c++ -python -noexcept' add.SWLIBS = ['swigpy'] set.PACKAGE_PREFIX = construct.getPythonLib() set.INCLUDE_PREFIX = construct.getPythonInc() options = Options('config.py', ARGUMENTS) options.Add('CXX', 'C++ compiler') options.Add('LINK', 'linker') options.Add('PACKAGE_PREFIX', 'Installation path for the SimData package') options.Add('INCLUDE_PREFIX', 'Installation path for the SimData headers and interfaces') env = Environment(options = options) opt.apply(env) construct.addSwigSupport(env) construct.addCopyFile(env) construct.addDoxygen(env) conf = Configure(env) construct.addConfigTests(conf) if not conf.checkSwig(set.SWIG_MIN_VERSION): print print " SimData requires SWIG %s or newer. If a compatible version" % set.SWIG_MIN_VERSION print " of SWIG is already installed, check that is it in the default" print " path. SWIG can be downloaded from http://www.swig.org" print Exit(1) Export('env', 'construct') for subdir in set.SUBDIRS: SConscript(subdir+'/SConscript') --- NEW FILE: construct.py --- # -*-python-*- # SimData: Data Infrastructure for Simulations # Copyright (C) 2002, 2003 Mark Rose <tm...@st...> # # This file is part of SimData. # # 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. ## # Utilities for building and installing with SCons import SCons.Action import SCons.Builder import SCons.Scanner import SCons.Util Action = SCons.Action.Action Builder = SCons.Builder.Builder Scanner = SCons.Scanner.Base import os, os.path, re, shutil # configure tests (defined below) configure_tests = {} ############################################################################ # python module and package installation ############################################################################ def getPythonInc(): from distutils import sysconfig return sysconfig.get_python_inc() def getPythonLib(): from distutils import sysconfig return sysconfig.get_python_lib() def installFile(target, source, env): """Install a source file into a target using the function specified as the INSTALL construction variable.""" try: install = env['INSTALL'] except KeyError: raise SCons.Errors.UserError('Missing INSTALL construction variable.') return install(target[0].path, source[0].path, env) def byteCompile(target, source, env): """Byte compile a python source file.""" target = str(target[0]) if target.endswith(".py") and os.path.exists(target): import py_compile try: py_compile.compile(target) os.chmod(target+"c", 0644) return 0 except: pass return 0 def installFileString(target, source, env): source = str(source[0]) target = str(target[0]) return 'copying %s -> %s' % (source, target) def byteCompileString(target, source, env): target = str(target[0]) if target.endswith(".py"): return 'byte-compiling %s to %sc' % (target, os.path.basename(target)) installFileAction = Action(installFile, installFileString) byteCompileAction = Action(byteCompile, byteCompileString) PythonInstallBuilder = Builder(action=[installFileAction, byteCompileAction]) def installPythonSources(env, dir, source): """Install specified files in the given directory.""" import SCons.Node sources = SCons.Node.arg2nodes(source, env.fs.File) dnodes = SCons.Node.arg2nodes(dir, env.fs.Dir) tgt = [] for dnode in dnodes: for src in sources: target = SCons.Node.FS.default_fs.File(src.name, dnode) tgt.append(PythonInstallBuilder(env, target, src)) if len(tgt) == 1: tgt = tgt[0] return tgt ############################################################################ # general utilities ############################################################################ def compareVersions(a, b): a = map(int, a.split('.')) b = map(int, b.split('.')) for i in range(min(len(a), len(b))): if a[i] < b[i]: return -1 if a[i] > b[i]: return 1 if len(a) < len(b): return -1 if len(a) > len(b): return 1 return 0 def addConfigTests(conf): conf.AddTests(configure_tests) ############################################################################ # additional builders ############################################################################ def addDoxygen(env): def dox(target, source, env): cwd = os.getcwd() os.chdir(os.path.dirname(str(source[0]))) sources = map(os.path.basename, map(str, source)) result = os.system("doxygen %s" % " ".join(sources)) os.chdir(cwd) return result #action = 'cd $SOURCE.dir && doxygen $SOURCES.file' action = dox env.Append(BUILDERS = {'Doxygen': Builder(action=action)}) def addCopyFile(env): def copy(target, source, env): shutil.copy(str(source[0]), str(target[0])) def report(target, source, env): source = str(source[0]) target = str(target[0]) return 'copying %s -> %s' % (source, target) CopyFile = Builder(action=Action(copy, report)) env.Append(BUILDERS = {'CopyFile': CopyFile}) ############################################################################ # SWIG support ############################################################################ SWIG = 'swig' def checkSwig(context, req_version): ok = 0 context.Message("Checking for swig %s..." % req_version) swig_in, swig_out, swig_err = os.popen3('%s -version' % SWIG, 't', 1024) if swig_err is not None: output = swig_err.readlines() output = " ".join(map(lambda x: x.strip(), output)) match = re.search(r'SWIG Version (\d+\.\d+.\d+)', output) if match is not None: swig_version = match.groups()[0] if compareVersions(swig_version, req_version) >= 0: ok = 1 if ok: context.Result("yes (%s)" % swig_version) else: context.Result("no") return ok configure_tests['checkSwig'] = checkSwig def addSwigLib(env): # XXX this should work according to the scons dev docs, but builders # don't seem to have a Copy() method yet. #swiglib = env.SharedLibrary.Copy(SHLIBPREFIX = '', LIBS = env["SWLIBS"]) #env.Append(BUILDERS = {'SwigLibrary': swiglib}) pass def addSwigBuild(env): action = '$SWIG $SWFLAGS $_CPPINCFLAGS -o ${TARGETS[0]} $SOURCES' SwigBuild = Builder(action=action, src_suffix=".i") env.Append(BUILDERS = {'SwigBuild': SwigBuild}) def addSwigDep(env): def SwigScanner(node, env, path, arg=None): cmd = env.subst('$SWIG -MM $_CPPINCFLAGS %s' % str(node)) stdin, stdout, stderr = os.popen3(cmd, 't') deps = ''.join(map(lambda x: x.strip(), stdout.readlines())) deps = map(lambda x: "#/"+x.strip(), deps.split('\\'))[1:] return deps scanner = Scanner(function = SwigScanner, skeys = ['.i'], recursive = 0) env.Append(SCANNERS = scanner) def addSwigSupport(env): global SWIG SWIG = SCons.Util.WhereIs('swig') env['SWIG'] = SWIG addSwigDep(env) addSwigLib(env) addSwigBuild(env) ############################################################ # helper classes ############################################################ class OptionSet: class Empty: pass def __init__(self): self.set = OptionSet.Empty() self.add = OptionSet.Empty() def __getattr__(self, x): d = self.__dict__ if x in d.keys(): return d[x] return getattr(d['set'], x) def methods(self): return self.set, self.add def apply(self, env): for key, value in self.set.__dict__.iteritems(): env[key] = value for key, value in self.add.__dict__.iteritems(): env.Append(**{key: value}) class Globals: class Empty: pass def __init__(self): self.add = Globals.Empty() def set(self): for key, value in self.set.__dict__.iteritems(): eval("%s=%s" % (key, value), globals(), globals()) Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** CHANGES.current 24 Jul 2003 20:24:49 -0000 1.53 --- CHANGES.current 26 Jul 2003 18:15:22 -0000 1.54 *************** *** 2,5 **** --- 2,16 ---- =========================== + 2003-07-26: onsight + Added SConstruct and SConscript scripts for building and + installing with SCons <http://www.scons.org>. Some helper + routines are in construct.py. This SCons build system + testing and evaluation purposes only at this point. Give + it a try if you like and report problems, suggestions, or + patches to <http://csp.sourceforge.net/forum>. Note that + no tests have yet been done under Windows, and while it + should work in principle there will certainly be some + significant problems early on. + 2003-07-24: onsight Removed (commented) type conversion operators in TypeAdapter. |
From: <mk...@us...> - 2003-07-26 18:15:25
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv13902/Source Modified Files: Interpolate.cpp Added Files: SConscript Log Message: --- NEW FILE: SConscript --- # -*-python-*- # SimData: Data Infrastructure for Simulations # Copyright (C) 2002, 2003 Mark Rose <tm...@st...> # # This file is part of SimData. # # 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. import os.path Import('env', 'construct') headers = """ BaseType.h Conversions.h DataArchive.h DataManager.h Date.h Enum.h Exception.h Export.h External.h FileUtility.h GeoPos.h GlibCsp.h hash_map.h HashUtility.h Integer.h InterfaceRegistry.h Interpolate.h Key.h Link.h List.h LUT.h Log.h LogStream.h Math.h Matrix3.h Noise.h ns-simdata.h Object.h ObjectInterface.h osg.h Pack.h Path.h PTS.h Quaternion.h Random.h Real.h Ref.h String.h TypeAdapter.h Types.h Vector3.h Vector3.inl Version.h """.split() interfaces = """ cSimData.i BaseType.i Conversions.i DataArchive.i DataManager.i Date.i Enum.i Exception.i External.i filemap.i GeoPos.i HashUtility.i InterfaceRegistry.i Interpolate.i Key.i Link.i List.i Log.i LUT.i Math.i Matrix3.i Noise.i Object.i Pack.i Path.i Quaternion.i Random.i Real.i String.i Types.i vector.i Vector3.i """.split() sources = """ BaseType.cpp DataArchive.cpp DataManager.cpp Date.cpp Enum.cpp Exception.cpp External.cpp FileUtility.cpp GeoPos.cpp HashUtility.cpp InterfaceRegistry.cpp Interpolate.cpp Key.cpp Link.cpp List.cpp LogStream.cpp LUT.cpp Math.cpp Matrix3.cpp Noise.cpp Object.cpp Pack.cpp Path.cpp Quaternion.cpp Random.cpp Real.cpp TypeAdapter.cpp Vector3.cpp Version.cpp """.split() package = """ __init__.py Parse.py Compile.py Debug.py cSimData.py """.split() package = map(lambda x: File('#/SimData/'+x), package) headers = map(lambda x: File('#/Include/SimData/'+x), headers) interfaces = map(lambda x: File('#/Include/SimData/'+x), interfaces) # swig module env.SwigBuild(['cSimData_wrap.cpp', 'cSimData.py'], 'cSimData') wrapper = env.CopyFile('#/SimData/cSimData.py', 'cSimData.py') sources.append('cSimData_wrap.cpp') # main libraries shared_library = env.SharedLibrary('#/SimData/_cSimData', sources, SHLIBPREFIX = '', LIBS = env["SWLIBS"]) static_library = env.StaticLibrary('#/SimData/libSimData', sources) # installation package_target = os.path.join(env['PACKAGE_PREFIX'], 'SimData') include_target = os.path.join(env['INCLUDE_PREFIX'], 'SimData') package = package + [shared_library, static_library] install_package = construct.installPythonSources(env, package_target, package) install_headers = construct.installPythonSources(env, include_target, headers + interfaces) env.Alias('install', install_package + install_headers) # default target(s) Default(shared_library, wrapper) Index: Interpolate.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Interpolate.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Interpolate.cpp 19 Jul 2003 14:02:05 -0000 1.11 --- Interpolate.cpp 26 Jul 2003 18:15:22 -0000 1.12 *************** *** 534,535 **** --- 534,536 ---- NAMESPACE_END // namespace simdata + |
From: <mk...@us...> - 2003-07-26 18:15:25
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Doc In directory sc8-pr-cvs1:/tmp/cvs-serv13902/Doc Added Files: SConscript Log Message: --- NEW FILE: SConscript --- # -*-python-*- # SimData: Data Infrastructure for Simulations # Copyright (C) 2002, 2003 Mark Rose <tm...@st...> # # This file is part of SimData. # # 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. Import("env") doxyfile = "Doxyfile" # this target is rebuild everytime it is explicitly # called, since there's no simple way to track all # the dependencies env.Alias('docs', env.Doxygen('docs', doxyfile)) |
From: <sto...@us...> - 2003-07-26 06:55:14
|
Update of /cvsroot/csp/APPLICATIONS/TerrainLab/Textures In directory sc8-pr-cvs1:/tmp/cvs-serv2660/Textures Log Message: Directory /cvsroot/csp/APPLICATIONS/TerrainLab/Textures added to the repository |
Update of /cvsroot/csp/APPLICATIONS/TerrainLab/Textures In directory sc8-pr-cvs1:/tmp/cvs-serv2879/Textures Added Files: Stone3.bmp bushes_grass_low.bmp dense_bush_low.bmp farmland_low.bmp grass_steep_slopes_low.bmp Log Message: added the ecotope code --- NEW FILE: Stone3.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bushes_grass_low.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: dense_bush_low.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: farmland_low.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: grass_steep_slopes_low.bmp --- (This appears to be a binary file; contents omitted.) |
From: <mk...@us...> - 2003-07-24 20:25:35
|
Update of /cvsroot/csp/APPLICATIONS/SimData/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv23151/SimData Modified Files: Parse.py Log Message: Index: Parse.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/SimData/Parse.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Parse.py 24 Jul 2003 20:24:49 -0000 1.10 --- Parse.py 24 Jul 2003 20:25:32 -0000 1.11 *************** *** 394,398 **** # method that swig generates will accept. yuck! def assign(self, interface, obj, name): - print "ASSIGN: ", obj, name, len(self._element) interface.set(obj, name, str(self._element)) # return --- 394,397 ---- |
From: <mk...@us...> - 2003-07-24 20:24:52
|
Update of /cvsroot/csp/APPLICATIONS/SimData/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv22976/SimData Modified Files: Parse.py Log Message: Index: Parse.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/SimData/Parse.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Parse.py 18 Jul 2003 18:44:08 -0000 1.9 --- Parse.py 24 Jul 2003 20:24:49 -0000 1.10 *************** *** 394,397 **** --- 394,398 ---- # method that swig generates will accept. yuck! def assign(self, interface, obj, name): + print "ASSIGN: ", obj, name, len(self._element) interface.set(obj, name, str(self._element)) # return |
From: <mk...@us...> - 2003-07-24 20:24:51
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv22976 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** CHANGES.current 23 Jul 2003 05:07:50 -0000 1.52 --- CHANGES.current 24 Jul 2003 20:24:49 -0000 1.53 *************** *** 2,5 **** --- 2,16 ---- =========================== + 2003-07-24: onsight + Removed (commented) type conversion operators in TypeAdapter. + These were dodgey at best, if not outright dangerous. They + are not needed in any existing code, and yet were being + called implicitly at times. The rules for implicit calls + apparently changed somewhat between gcc 3.2 and 3.3, resulting + in an exception during string assignment to object interfaces. + + ==========> WINDOWS USERS: check that this change doesn't adversely affect + existing projects. + 2003-07-22: onsight Fixed a bug in unpack(string) which could trip an assertion |
From: <mk...@us...> - 2003-07-24 20:24:51
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv22976/Include/SimData Modified Files: TypeAdapter.h Log Message: Index: TypeAdapter.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/TypeAdapter.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TypeAdapter.h 18 Jul 2003 19:47:17 -0000 1.16 --- TypeAdapter.h 24 Jul 2003 20:24:49 -0000 1.17 *************** *** 121,124 **** --- 121,131 ---- // objects + /* + * XXX + * These implicit casts are not currently used. The templated + * versions, in particular, are rather dangerous (and break under + * GCC-3.3). After a short testing period this cast code can be + * be completely removed. --MR 7/03 + template <typename T> operator T const &() const { *************** *** 139,143 **** // basic types - operator int const() const { IntCheck(); return var.i; } --- 146,149 ---- *************** *** 153,156 **** --- 159,163 ---- operator std::string const() const { StringCheck(); return s; } + */ int getInteger() const { IntCheck(); return var.i; } |
From: <mk...@us...> - 2003-07-24 08:34:40
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID In directory sc8-pr-cvs1:/tmp/cvs-serv31012 Modified Files: map2hid Log Message: Index: map2hid =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID/map2hid,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** map2hid 27 Mar 2003 03:15:31 -0000 1.3 --- map2hid 24 Jul 2003 08:34:36 -0000 1.4 *************** *** 476,529 **** self.mapping = {} ! def usage(): print "Map script to human interface device definition converter" print "Copyright (C) 2003 Mark Rose <tm...@st...>" ! print "usage: %s [--help] infile [outfile]" % sys.argv[0] - file = None - outfile = None ! for arg in sys.argv[1:]: ! if arg.startswith('--'): ! if arg == '--help': ! usage() ! print " infile : input map file" ! print " outfile : output file ('-' for stdout)" sys.exit(1) ! continue if file is None: ! file = arg ! elif outfile is None: ! outfile = arg ! else: ! usage() sys.exit(1) ! ! if outfile is None and file.endswith('.map'): ! outfile = file[:-4] + '.hid' - outf = None - if outfile == '-': - outf = sys.stdout - else: try: ! outf = open(outfile, "wt") ! except: ! print "Unable to write to '%s'." % outfile sys.exit(1) - - v = VirtualDeviceDefinition() ! try: ! v.read(file) ! except Error, e: ! print e.msg ! sys.exit(1) ! bindings = v.bind.keys() ! bindings.sort() ! for b in bindings: ! print >>outf, "=%s" % b ! for m in v.maps: ! m.write(outf) --- 476,539 ---- self.mapping = {} ! def usage(program): print "Map script to human interface device definition converter" print "Copyright (C) 2003 Mark Rose <tm...@st...>" ! print "usage: %s [--help] infile [outfile]" % program ! def main(argv): ! file = None ! outfile = None ! ! for arg in argv[1:]: ! if arg.startswith('--'): ! if arg == '--help': ! usage(argv[0]) ! print " infile : input map file" ! print " outfile : output file ('-' for stdout)" ! sys.exit(1) ! continue ! if file is None: ! file = arg ! elif outfile is None: ! outfile = arg ! else: ! usage(argv[0]) sys.exit(1) ! if file is None: ! usage(argv[0]) sys.exit(1) ! ! if outfile is None and file.endswith('.map'): ! outfile = file[:-4] + '.hid' ! ! outf = None ! if outfile == '-': ! outf = sys.stdout ! else: ! try: ! outf = open(outfile, "wt") ! except: ! print "Unable to write to '%s'." % outfile ! sys.exit(1) ! ! v = VirtualDeviceDefinition() try: ! v.read(file) ! except Error, e: ! print e.msg sys.exit(1) ! bindings = v.bind.keys() ! bindings.sort() ! for b in bindings: ! print >>outf, "=%s" % b ! for m in v.maps: ! m.write(outf) ! ! if __name__ == "__main__": ! main(sys.argv) |
From: <mk...@us...> - 2003-07-24 08:34:25
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Bin In directory sc8-pr-cvs1:/tmp/cvs-serv30984 Added Files: MakeDefaultInputMaps.py Log Message: --- NEW FILE: MakeDefaultInputMaps.py --- #!/usr/bin/python # Combat Simulator Project - CSPSim # Copyright (C) 2002 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. ## # A simple script to regenerate the default input maps import os, os.path, sys from ConfigParser import ConfigParser norm = os.path.normpath import CSPSim ini = CSPSim.findConfig() config = ConfigParser() try: config.read(ini) config_path = norm(config.get("Paths", "DataPath")) except: print >>sys.stderr, "Unable to find DataPath in '%s', aborting" % config sys.exit(1) map2hid = norm("../Tools/HID/map2hid") if not os.path.exists(map2hid): print >>sys.stderr, "Can't find '%s', aborting." % map2hid sys.exit(1) input_path = os.path.join(config_path, "Input") if not os.path.exists(input_path): print >>sys.stderr, "'%s' directory not found, aborting." % input_path sys.exit(1) cwd = os.getcwd() os.chdir(norm("../Tools/HID")) maps = ("gamescreen", "aircraft") for map in maps: source = os.path.join("Examples", "%s.map" % map) target = os.path.join(input_path, "%s.hid" % map) os.system("python map2hid %s %s" % (source, target)) print "Default input map created for %s.map; see Tools/HID/README for details." % map os.chdir(cwd) |
From: <mk...@us...> - 2003-07-24 08:10:58
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Bin In directory sc8-pr-cvs1:/tmp/cvs-serv27564/Bin Modified Files: CSPSim.py CompileData.py RebuildData.py Log Message: Index: CSPSim.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/CSPSim.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CSPSim.py 23 Jul 2003 07:11:57 -0000 1.9 --- CSPSim.py 24 Jul 2003 08:10:55 -0000 1.10 *************** *** 25,41 **** #from SimData.Compile import Compiler, CompilerUsageError ! # enable lazy loading of shared library modules if available ! if os.name == 'posix': ! import dl ! sys.setdlopenflags(dl.RTLD_GLOBAL|dl.RTLD_LAZY) ! #if hasattr(sys, "setdlopenflags"): ! # sys.setdlopenflags(0x101) ! ! # is the SDL joystick environment variable isn't set, try a standard value ! if not os.environ.has_key("SDL_JOYSTICK_DEVICE"): ! # try a reasonable default for linux ! if os.path.exists("/dev/input/js0"): ! os.environ["SDL_JOYSTICK_DEVICE"]="/dev/input/js0" def printUsage(): --- 25,40 ---- #from SimData.Compile import Compiler, CompilerUsageError ! def initDynamicLoading(): ! """Enable lazy loading of shared library modules if available""" ! if os.name == 'posix': ! import dl ! sys.setdlopenflags(dl.RTLD_GLOBAL|dl.RTLD_LAZY) ! def setDefaultJoystick(): ! """Provide a default value for the SDL joystick environment variable""" ! if not os.environ.has_key("SDL_JOYSTICK_DEVICE"): ! # try a reasonable default for linux ! if os.path.exists("/dev/input/js0"): ! os.environ["SDL_JOYSTICK_DEVICE"]="/dev/input/js0" def printUsage(): *************** *** 124,231 **** ! action = None ! # do our best to find the correct configuration file ! config_paths = [".", "~/.cspsim", "/etc/cspsim", "../Data"] ! config = "CSPSim.ini" ! for path in config_paths: ! path = os.path.join(path, "CSPSim.ini") ! path = os.path.expanduser(path) ! if os.path.exists(path): ! config = path ! break - # process command line options - program = sys.argv[0] - all_args = sys.argv[1:] - log_classes = [] - other_args = [] ! for arg in all_args: ! if arg == '--compile-data': ! action = compileData ! elif arg in ("--help", "-h", "-help"): ! if action == None: ! print ! printUsage() ! print ! sys.exit(1) else: ! other_args.append(arg) ! elif arg.startswith("--config="): ! config = arg[9:] ! elif arg.startswith("--log="): ! log_classes.extend(arg[6:].split(':')) ! else: ! other_args.append(arg) ! if action is None: ! action = runCSPSim ! # load simdata ! try: ! import SimData ! except Exception, e: ! msg = str(e) ! if len(msg) > 60: ! msg = msg.replace(": ", ":\n ") ! print """ ! ERROR: Unable to import SimData. - %s - """ % msg, ! if str(e).find("symbol") >= 0: ! print """ ! Unresolved symbols often indicate missing libraries or improper link options. ! """, ! print """ ! Please verify that SimData has been properly installed on your system. See ! the README file in the SimData distribution for details. ! """ ! sys.exit(1) ! SimData.log().setOutput("SimData.log") ! SimData.log().setLogLevels(SimData.LOG_ALL, SimData.LOG_DEBUG) ! try: ! import cCSP as CSP ! except Exception, e: ! msg = str(e) ! if len(msg) > 60: ! msg = msg.replace(": ", ":\n ") ! print """ ! ERROR: Unable to import cCSP.py - %s - """ % msg, ! if str(e).find("No module named") >= 0: ! print """ ! Some required files appear to be missing. Please verify that you have ! successfully built CSPSim. See the README for details. If you are ! still having trouble, ask for help on the forums at ! http://csp.sourceforge.net/forum ! """ ! else: ! print """ ! See the README files for additional information. If you are still having ! trouble, ask for help on the forums at ! http://csp.sourceforge.net/forum ! """ ! sys.exit(1) ! SimData.log().setLogLevels(SimData.LOG_ALL, SimData.LOG_ALERT) ! print "Loading configuration from '%s'." % config ! if not CSP.openConfig(config): ! print "Unable to open primary configuration file (%s)" % config ! sys.exit(0) ! action(other_args) --- 123,255 ---- ! def loadSimData(): ! """Load the SimData module""" ! global SimData ! try: ! import SimData as SD ! except Exception, e: ! msg = str(e) ! if len(msg) > 60: ! msg = msg.replace(": ", ":\n ") ! print """ ! ERROR: Unable to import SimData. ! %s ! """ % msg, ! if str(e).find("symbol") >= 0: ! print """ ! Unresolved symbols often indicate missing libraries or improper link options. ! """, ! print """ ! Please verify that SimData has been properly installed on your system. See ! the README file in the SimData distribution for details. ! """ ! sys.exit(1) ! SimData = SD ! def loadCSP(): ! global CSP ! try: ! import cCSP ! except Exception, e: ! msg = str(e) ! if len(msg) > 60: ! msg = msg.replace(": ", ":\n ") ! print """ ! ERROR: Unable to import cCSP.py ! ! %s ! """ % msg, ! ! if str(e).find("No module named") >= 0: ! print """ ! Some required files appear to be missing. Please verify that you have ! successfully built CSPSim. See the README for details. If you are ! still having trouble, ask for help on the forums at ! ! http://csp.sourceforge.net/forum ! ! """ else: ! print """ ! See the README files for additional information. If you are still having ! trouble, ask for help on the forums at ! http://csp.sourceforge.net/forum ! """ ! sys.exit(1) ! CSP = cCSP ! def findConfig(): ! # do our best to find the correct configuration file ! config_paths = [".", "~/.cspsim", "/etc/cspsim", "../Data"] ! config = "CSPSim.ini" ! for path in config_paths: ! path = os.path.join(path, "CSPSim.ini") ! path = os.path.expanduser(path) ! if os.path.exists(path): ! config = path ! break ! return config ! def main(argv): ! global log_classes ! initDynamicLoading() ! setDefaultJoystick() ! action = None ! # process command line options ! program = argv[0] ! all_args = argv[1:] ! log_classes = [] ! other_args = [] ! config = findConfig() ! for arg in all_args: ! if arg == '--compile-data': ! action = compileData ! elif arg in ("--help", "-h", "-help"): ! if action == None: ! print ! printUsage() ! print ! sys.exit(1) ! else: ! other_args.append(arg) ! elif arg.startswith("--config="): ! config = arg[9:] ! elif arg.startswith("--log="): ! log_classes.extend(arg[6:].split(':')) ! else: ! other_args.append(arg) ! if action is None: ! action = runCSPSim ! loadSimData() ! SimData.log().setOutput("SimData.log") ! SimData.log().setLogLevels(SimData.LOG_ALL, SimData.LOG_DEBUG) + loadCSP() + SimData.log().setLogLevels(SimData.LOG_ALL, SimData.LOG_ALERT) + + print "Loading configuration from '%s'." % config + if not CSP.openConfig(config): + print "Unable to open primary configuration file (%s)" % config + sys.exit(0) + + action(other_args) + + + if __name__ == "__main__": + main(sys.argv) Index: CompileData.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/CompileData.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CompileData.py 22 Jul 2003 07:36:36 -0000 1.4 --- CompileData.py 24 Jul 2003 08:10:55 -0000 1.5 *************** *** 26,27 **** --- 26,29 ---- import CSPSim + CSPSim.main(sys.argv) + Index: RebuildData.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/RebuildData.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RebuildData.py 22 Jul 2003 07:36:36 -0000 1.4 --- RebuildData.py 24 Jul 2003 08:10:55 -0000 1.5 *************** *** 27,28 **** --- 27,30 ---- import CSPSim + CSPSim.main(sys.argv) + |
From: <mk...@us...> - 2003-07-24 08:10:58
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data In directory sc8-pr-cvs1:/tmp/cvs-serv27564/Data Modified Files: CSPSim.ini Log Message: Index: CSPSim.ini =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/CSPSim.ini,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CSPSim.ini 23 Jul 2003 07:11:57 -0000 1.13 --- CSPSim.ini 24 Jul 2003 08:10:55 -0000 1.14 *************** *** 14,18 **** CachePath = ../Data InputMapPath = Input ! DataPath = /home/mrose/projects/csp/cvs-sf/APPLICATIONS/CSPSim/Data FontPath = Fonts ModelPath = Models --- 14,18 ---- CachePath = ../Data InputMapPath = Input ! DataPath = ../Data FontPath = Fonts ModelPath = Models |
From: <mk...@us...> - 2003-07-24 07:32:43
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID/Maps In directory sc8-pr-cvs1:/tmp/cvs-serv22765/Tools/HID/Maps Modified Files: gamescreen-core.map Log Message: Index: gamescreen-core.map =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID/Maps/gamescreen-core.map,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gamescreen-core.map 24 Jul 2003 04:54:55 -0000 1.4 --- gamescreen-core.map 24 Jul 2003 07:32:40 -0000 1.5 *************** *** 33,36 **** --- 33,37 ---- map key:p press PAUSE map key:r press TOGGLE_RECORDER + map key:ALT-w press TOGGLE_WIREFRAME map key:F12 press STATS map key:HOME press CONSOLE |
From: <mk...@us...> - 2003-07-24 07:32:42
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv22765/Source Modified Files: GameScreen.cpp VirtualScene.cpp Log Message: Index: GameScreen.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/GameScreen.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** GameScreen.cpp 24 Jul 2003 04:41:46 -0000 1.22 --- GameScreen.cpp 24 Jul 2003 07:32:39 -0000 1.23 *************** *** 80,83 **** --- 80,84 ---- BIND_ACTION("PAUSE", on_Pause); BIND_ACTION("TOGGLE_RECORDER", on_ToggleRecorder); + BIND_ACTION("TOGGLE_WIREFRAME", on_ToggleWireframe); BIND_ACTION("STATS", on_Stats); BIND_ACTION("CONSOLE", on_Console); *************** *** 445,448 **** --- 446,456 ---- void GameScreen::on_ToggleRecorder() { setRecorder(!m_DataRecorder); + } + + void GameScreen::on_ToggleWireframe() { + VirtualScene *scene = CSPSim::theSim->getScene(); + if (scene) { + scene->setWireframeMode(!scene->getWireframeMode()); + } } Index: VirtualScene.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/VirtualScene.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** VirtualScene.cpp 23 Jul 2003 07:11:57 -0000 1.10 --- VirtualScene.cpp 24 Jul 2003 07:32:40 -0000 1.11 *************** *** 179,182 **** --- 179,183 ---- m_SpinTheWorld = false; m_ResetTheWorld = false; + m_Wireframe = false; } *************** *** 642,645 **** --- 643,648 ---- void VirtualScene::setWireframeMode(bool flag) { + if (m_Wireframe == flag) return; + m_Wireframe = flag; osg::StateSet* globalStateSet = m_FarView->getGlobalStateSet(); if (!globalStateSet) { |
From: <mk...@us...> - 2003-07-24 07:32:42
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv22765/Include Modified Files: GameScreen.h VirtualScene.h Log Message: Index: GameScreen.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/GameScreen.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** GameScreen.h 24 Jul 2003 04:41:46 -0000 1.11 --- GameScreen.h 24 Jul 2003 07:32:39 -0000 1.12 *************** *** 66,69 **** --- 66,70 ---- ACTION_INTERFACE(GameScreen, on_Pause); ACTION_INTERFACE(GameScreen, on_ToggleRecorder); + ACTION_INTERFACE(GameScreen, on_ToggleWireframe); ACTION_INTERFACE(GameScreen, on_Stats); ACTION_INTERFACE(GameScreen, on_Console); Index: VirtualScene.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/VirtualScene.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** VirtualScene.h 18 Jul 2003 21:15:44 -0000 1.8 --- VirtualScene.h 24 Jul 2003 07:32:39 -0000 1.9 *************** *** 87,90 **** --- 87,91 ---- void getLookAt(simdata::Vector3 & eyePos, simdata::Vector3 & lookPos, simdata::Vector3 & upVec) const; void setWireframeMode(bool flag); + bool getWireframeMode() const { return m_Wireframe; } void setFogMode(bool flag); void setFogStart(float value); *************** *** 127,130 **** --- 128,133 ---- bool m_FogEnabled; osg::Vec4 m_FogColor; + + bool m_Wireframe; bool m_SpinTheWorld; |
From: <mk...@us...> - 2003-07-24 07:32:42
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv22765 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** CHANGES.current 24 Jul 2003 05:08:14 -0000 1.58 --- CHANGES.current 24 Jul 2003 07:32:39 -0000 1.59 *************** *** 3,6 **** --- 3,13 ---- 2003-07-23: onsight + Added wireframe toggle keybinding (alt-w by default). + Note you have to rebuild your input maps to use newly + added keybindings. If you are using the default + bindings you can just delete them (in Data/Input) and + run make (Linux only) to generate a new set. + + 2003-07-23: onsight Committed changes to GameScreen to enable toggling of the DataRecorder. By default this function is mapped |
From: <mk...@us...> - 2003-07-24 05:08:21
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv5059 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** CHANGES.current 24 Jul 2003 04:55:56 -0000 1.57 --- CHANGES.current 24 Jul 2003 05:08:14 -0000 1.58 *************** *** 15,18 **** --- 15,35 ---- Added 'r' key binding to gamescreen-core.map + Added Tools/Recorder, which contains utilities for + converting data recorder output into more useful + formats: + + Under Windows, just run: + + RecCSP --tab data-xxx.rec + + and load the resulting file into Excel. You can do + the same under Linux (substitue your favorite plotting + program for Excel). If you happen to have jgraph, + ghosstscript, and (optionally) latex installed you can + create nice pdf plots of all the recorded data very + easily by running: + + graph data-xxx.rec + 2003-07-22: onsight Increased the default window size to 800x600 so that |
From: <mk...@us...> - 2003-07-24 05:01:39
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv4201 Added Files: header.tex Log Message: --- NEW FILE: header.tex --- \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} \pagestyle{empty} \setlength{\parindent}{0cm} \begin{document} ~ \vspace{1in} \textbf{\huge CSP Flight Model Test} \medskip \textbf{\textsl{\Large Mirage 2000}} \smallskip \textbf{\today} \bigskip \bigskip Starting wings level, near sea level, accelerate in afterburner and pull hard into the vertical. On the downside of the loop, roll 180 degrees and recover level flight. %%\begin{figure}[b!] %%\center{ \includegraphics[width=12cm]{csp.ps} } %%\end{figure} \end{document} |
From: <mk...@us...> - 2003-07-24 05:00:48
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv4057a Added Files: Makefile Log Message: --- NEW FILE: Makefile --- # Makefile to assist with creating data recorder reports. # # Generates a title page from header.tex and merges it with # the rest of the graphs in .out.ps~. The combined output # is converted to pdf (out-header.pdf). The original graphs # are also converted to pdf without a title page (out.pdf). all: out.pdf out-header.pdf @rm .out.ps~ @echo "Graphs written to 'out.pdf' and 'out-header.pdf'" header.ps: header.tex @echo "Reprocessing header. If an error occurs, see header.log." @latex -interaction=nonstopmode header.tex >/dev/null @dvips header.dvi -oheader.ps >/dev/null 2>&1 out-header.pdf: header.ps .out.ps~ gs -sDEVICE=pdfwrite -sOutputFile=$@ -dBATCH -dNOPAUSE -q $^ out.pdf: .out.ps~ @ps2pdf .out.ps~ out.pdf |
From: <mk...@us...> - 2003-07-24 04:58:33
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv3606 Added Files: graph RecCSP Log Message: --- NEW FILE: graph --- ######################################################### # # Script to create pdf reports of data recordings # # usage: graph input.rec # output: out.pdf and out-header.pdf # ######################################################### ./RecCSP --jgraph $1 | jgraph -P > .out.ps~ make --- NEW FILE: RecCSP --- #!/usr/bin/python # 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. # this is an exceedingly trivial program for converting data recorder # output from CSPSim to tab delimited text that can be imported into a # spreadsheet. there is minimal error checking and lots of inelegant # hacking, which can be cleaned up by anyone that has energy for it ;-) import sys, time from struct import pack, unpack, calcsize from math import * def readint(f): return unpack("I", f.read(4))[0] def readfloat(f): return unpack("f", f.read(4))[0] def readbyte(f): return unpack("B", f.read(1))[0] def readdata(f): return unpack("If", f.read(8)) class RecorderConverter: def __init__(self): self.header = "" def convert(self, f): f.seek(-4, 2) f.seek(readint(f), 0) n = readint(f) self.channels = channels = [] self.output = output = [] for i in range(n): name = f.read(64) name = name[0:name.find("\0")] channels.append(name) n = len(channels) self.set = set = range(n) self.min_time = 1e+10 self.max_time = -1e+10 self.min_data = range(n) self.max_data = range(n) for i in range(n): set[i] = 0.0 self.min_data[i] = 1e+10 self.max_data[i] = -1e+10 self.time = -1.0 f.seek(0, 0) while 1: type, value = readdata(f) if type == 255: output.append((self.time, set[:])) break if type == 250: output.append((self.time, set[:])) self.time = value self.min_time = min(self.min_time, self.time) self.max_time = max(self.max_time, self.time) if type < n: set[type] = value self.min_data[type] = min(self.min_data[type], value) self.max_data[type] = max(self.max_data[type], value) def dumpTab(self): print "time\t%s" % '\t'.join(self.channels) for timestamp, set in self.output: if timestamp > 0: set = map(lambda x: "%e" % x, set) print "%0.3f\t%s" % (timestamp, '\t'.join(set)) def dumpJGraph(self): y_start = 8.5 y_sep = 2.0 y_limit = 0.5 y = y_start x_min = self.min_time x_max = self.max_time dt = x_max - x_min if dt <= 0.0: return mag = log10(dt) scale = pow(10.0,floor(mag)-1) if mag - floor(mag) > 0.65: scale = scale * 5.0 else: scale = scale * 2.0 x_min = int(x_min/scale)*scale x_max = int(x_max/scale+0.9999)*scale if self.header != "": print "preamble : %s" % self.header print "X 8.5" print "Y 11" for i in range(len(self.channels)): channel = self.channels[i] y_min = self.min_data[i] y_max = self.max_data[i] dy = y_max - y_min scale = -1.0 if dy > 0.0: mag = log10(dy) scale = pow(10.0, floor(mag)) if mag - floor(mag) > 0.65: scale = scale * 5.0 else: scale = scale * 2.0 y_min = floor((y_min-dy*0.1)/scale)*scale y_max = floor((y_max+dy*0.1)/scale+0.9999)*scale dy = y_max - y_min hash = scale precision = max(0, 1-mag) else: y_min = int(y_min) - 1.0 y_max = int(y_max) + 1.0 dy = y_max - y_min scale = 1.0 precision = 1 print "newgraph border title y %f font Helvetica : %s" % (y_max+dy*0.15, channel) print "xaxis mgrid_lines grid_lines grid_gray 0.5 min %f max %f size 7.0" % (x_min, x_max) if (i == len(self.channels)-1) or y < y_limit + y_sep: print "xaxis label font Helvetica : Time (sec)" print "xaxis hash_labels font Helvetica" else: print "nodraw" hash = "%f" % scale while hash.endswith('0'): hash = hash[:-1] if hash.endswith('.'): hash = hash[:-1] print "yaxis grid_lines mgrid_lines grid_gray 0.5 min %f max %f size 1.2" % (y_min, y_max) print "yaxis hash_labels font Helvetica" mhash = int(5 * scale / dy) if mhash == 2: mhash = 1 if mhash >= 3 and mhash < 7: mhash = 4 print "precision %d hash %s mhash %d" % (precision, hash, mhash) print "y_translate", y print "newcurve marktype none linetype solid linethickness 2 pts" for timestamp, set in self.output: if timestamp > 0: print timestamp, set[i] y = y - y_sep if y < y_limit: y = y_start print "newpage" def setHeader(self, header): self.header = header def usage(msg=""): if msg != "": print >>sys.stderr, "Error: %s\n" % msg print >>sys.stderr, "Data recorder to tab-delimited text converter for use with CSP." print >>sys.stderr, "Usage: %s [--tab|--jgraph] infile" % sys.argv[0] sys.exit(1) def parseHeader(filename, subst): if filename == "": return "" try: fh = open(filename, "rt") header = ' \\\n'.join(map(lambda x: x.strip(), fh.readlines())) except: print >>sys.stderr, "Unable to read header " % filename return "" for key in subst.keys(): header = header.replace("$"+key, subst[key]) return header filename = "" mode = 'tab' header_subst = {} header = "" for arg in sys.argv[1:]: if arg.startswith('-'): if arg in ('--jgraph', '--tab'): mode = arg[2:] elif arg.startswith("--header="): header = arg[9:] elif arg.startswith("--set="): key, value = arg[6:].split(':') header_subst[key] = value else: usage("unrecognized option '%s'" % arg) else: filename = arg if filename == "": usage() file = open(filename, "rb") header_subst["date"] = time.ctime() header_subst["source"] = filename header_subst["converter"] = "Generated by RecCSP, version 0.1" header = parseHeader(header, header_subst) r = RecorderConverter() r.setHeader(header) r.convert(file) if mode == 'tab': r.dumpTab() elif mode == 'jgraph': r.dumpJGraph() |