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: <sv...@ww...> - 2004-07-25 00:23:17
|
Author: mkrose Date: 2004-07-24 17:23:05 -0700 (Sat, 24 Jul 2004) New Revision: 1175 Added: trunk/CSP/tools/pdot Log: Add a tool for converting gprof output to dot format. Under GNU/Linux, gprof converts raw profile data to a text report showing the call graph and time spent in each function. This new tool is very similar to cgprof (which was the inspiration), and converts the gprof report to a dot file, which can then be processed by the GraphViz library to produce a graphical representation of the call graph, annotated with timing data. This makes it very easy to visualize the bottlenecks in a program. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1175 Added: trunk/CSP/tools/pdot =================================================================== --- trunk/CSP/tools/pdot 2004-07-22 20:22:32 UTC (rev 1174) +++ trunk/CSP/tools/pdot 2004-07-25 00:23:05 UTC (rev 1175) @@ -0,0 +1,329 @@ +#!/usr/bin/python +# +# Copyright 2004 Mark Rose <mk...@us...> +# +# 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 + +# Inspired by cgprof by Mark Vertes <mv...@fr...> + + +usage = """%prog [options] [profile] + +Generates a visual call graph from gprof profile data. See gcc and gprof +for information about generating profile data. Requires GraphViz (see +http://www.graphviz.org) for postscript and X11 output. + +Example: + $ g++ -pg -g -o myexe myapp.cc # -pg enables profiling + $ ./myexe # run to collect profile data + $ gprof myexe > myexe.prof # parse the profile data + $ %prog --device=ps myexe.prof > a.ps # create a postscript call graph + $ gv a.ps # view it with gv""" + + +import os +import re +import sys + + +def wrap(method, width): + lines = [] + while len(method) > width: + part = method[:width] + idx = part.rfind(' ') + if idx >= 0: + lines.append(method[:idx]) + method = method[idx+1:] + continue + idx = part.rfind(',') + if idx >= 0: + lines.append(method[:idx+1]) + method = method[idx+1:] + idx = part.rfind('::') + if idx >= 0: + lines.append(method[:idx+2]) + method = method[idx+2:] + lines.append(method[:width]) + method = method[width:] + if method: lines.append(method) + return lines + +re_temp = re.compile(r'<.*>') +re_tparm = re.compile(r'<(.*)>') + +def first_template(identifier): + m = re_tparm.search(identifier) + if m is not None: + parms = m.group(1).split(',') + repl = first_template(parms[0]) + if len(parms) > 1: repl += ', ...' + return re_temp.sub('<%s>' % repl, identifier) + return identifier + +def parse_template(id, node): + while 1: + idx1 = id.find('<') + idx2 = id.find('>') + if idx1 >= 0 and idx1 < idx2: + node.append(id[:idx1]) + subnode = [] + rest = parse_template(id[idx1+1:], subnode) + node.append(subnode) + id = rest + continue + if idx2 >= 0: + node.append(id[:idx2]) + return id[idx2+1:] + return id + + +def abbreviate(node): + out = [] + for item in node: + if isinstance(item, str): + if item.startswith(','): + out.append(', ...') + break + if item.find(',') >= 0: + out.append('%s, ...' % item.split(',')[0]) + break + out.append(item) + else: + out.append(abbreviate(item)) + return '<%s>' % ''.join(out) + + +def filter_template(id): + tree = [] + rest = parse_template(id, tree) + out = [] + for item in tree: + if isinstance(item, str): + out.append(item) + else: + out.append(abbreviate(item)) + out.append(rest) + return ''.join(out) + + +CUT_FROM_METHOD_NAMES = ['std::', '__gnu_cxx::'] + + +def filter_method(method): + for cut in CUT_FROM_METHOD_NAMES: + method = method.replace(cut, '') + method = method.replace('unsigned ', 'u') + method = first_template(method) + if len(method) > 60: + method = '\\n'.join(wrap(method, 60)) + return method + + +class Node: + def __init__(self, fields, ref=False): + data = '' + if not ref: + if float(fields[1]) > 0: + data = '\\n(%s%%: %s self, %s child)' % tuple(fields[1:4]) + if fields[4][0] in '0123456789': + method = ' '.join(fields[5:-1]) + data += '\\n(called: %s)' % fields[4] + else: + method = ' '.join(fields[4:-1]) + self.index = fields[0] + self.cost = float(fields[1]) / 100.0 + self.external = False + else: + method = ' '.join(fields[3:-1]) + self.index = fields[-1] + self.cost = 0.0 + self.external = True + self.method = filter_method(method) + self.label = '%s\\n%s' % (self.method, data) + + def dump(self, cdot, size=None, maxcost=1.0): + if size is not None: + minsize, scale = size + sizeopt = ',fontsize="%d"' % (min(30, minsize + scale * self.cost)) + else: + sizeopt = '' + + maxhue = 0.6 + minsat = 0.1 + bri = 1.0 + if self.external: + hue = maxhue + sat = 0.0 + bri = 0.8 + elif self.cost > 0.0: + hue = maxhue * (1.0 - min(1.0, self.cost / maxcost)) + sat = min(1.0, minsat + (3.0 - minsat) * self.cost) + else: + hue = maxhue + sat = minsat + print >>cdot, (' "%s" [fillcolor="%.3f %.3f %.3f",label="%s"%s];' % + (self.index, hue, sat, bri, self.label, sizeopt)) + + +class Edge: + def __init__(self, fields, target=None, source=None): + self.weight = 0 + self.label = '' + if fields[2][0] in '0123456789': + try: + self.weight = int(fields[2].split('/')[0]) + except ValueError: + self.weight = 1 + self.label = '(%s ms, %s ms, %s)' % tuple(fields[:3]) + elif not fields[1][0] in '0123456789': + try: + self.weight = int(fields[0].split('/')[0]) + except ValueError: + self.weight = 1 + self.label = '(%s)' % fields[0] + call_index = fields[-1] + if source is not None: + self.source = source + self.target = call_index + else: + self.source = call_index + self.target = target + + def dump(self, cdot): + print >>cdot, ' "%s" -> "%s" [label="%s",weight="%d"];' % (self.source, self.target, self.label, self.weight) + + def __hash__(self): + return hash('%s->%s' % (self.source, self.target)) + def __cmp__(self, other): + return cmp(str(self), str(other)) + def __str__(self): + return '%s->%s' % (self.source, self.target) + + +def process(cin, filter=None, simple=False): + + if not filter: + cdot = sys.stdout + else: + cdot = open('.pdot~', 'wt') + + start = 0 + + called = [] + caller = '' + nodes = {} + edges = [] + + for line in cin: + if line.startswith('index % time'): + start = 1 + continue + if not start: continue + if not line.strip(): break + line = line.strip() + if line.startswith('<spontaneous>'): continue + if line.startswith('granularity:'): continue + if line.startswith('index '): continue + fields = line.split() + if not fields: continue + if line.find('<cycle [0-9]* as a whole>') >= 0: continue + if line.startswith('['): + node = Node(fields) + nodes[node.index] = node + caller = node.index + continue + if line.startswith('---'): + target = caller + for caller, fields in called: + edges.append(Edge(fields, target=target)) + caller = '' + called = [] + continue + source_index = fields[-1] + if not caller: + if not simple: + if not nodes.has_key(source_index): + nodes[source_index] = Node(fields, ref=True) + called.append((source_index, fields)) + else: + edges.append(Edge(fields, source=caller)) + + maxcost = min(1.0, reduce(lambda x, y: max(x, y.cost), nodes.values(), 0.001)) + minsize = 18 - 6 * maxcost + maxsize = 18 + 400 * maxcost + fontscale = (maxsize - minsize) / maxcost + + print >>cdot, 'digraph gprof {' + print >>cdot, ' rankdir=LR;' + print >>cdot, ' node [style=filled];' + print >>cdot, ' node [color="0.1 0.1 0.1"];' + print >>cdot, ' node [fillcolor="0.1 0.0 1.0"];' + print >>cdot, ' node [shape=box];' + print >>cdot, ' node [fontsize=%d];' % minsize + print >>cdot, ' node [fontname="Helvetica"];' + print >>cdot, ' edge [fontsize=%d];' % minsize + print >>cdot, ' edge [color="#000060"];' + print >>cdot, ' edge [fontname="Helvetica"];' + + edge_set = {} + for edge in edges: + edge_set[edge] = edge + + for node in nodes.values(): + node.dump(cdot, size=(minsize, fontscale), maxcost=maxcost) + for edge in edge_set.values(): + edge.dump(cdot) + + print >>cdot, '}' + cdot.close() + + if filter: + os.system('cat .pdot~ | %s' % filter) + + +if __name__ == '__main__': + from optparse import OptionParser + parser = OptionParser(usage) + parser.add_option('', '--device', default='dot', type='string', dest='device', + help='output device (X11, ps, or dot)') + parser.add_option('-s', '--simple', action='store_true', default=False, dest='simple', + help='omit inbound calls from unprofiled functions') + parser.add_option('', '--cut', default='', dest='cut', help='strings to remove from method names') + + (options, args) = parser.parse_args() + + if len(args) > 1: + parser.error('specify at most one profile') + if len(args) == 1: + cin = open(args[0], 'rt') + else: + cin = sys.stdin + + device = options.device.upper() + if device == 'X11': + filter = 'dotty -' + elif device == 'PS': + filter = 'dot -Tps -Gsize="11,17" -Grotate=90' + else: + filter = '' + + cut = options.cut.split(',') + CUT_FROM_METHOD_NAMES.extend(cut) + + try: + process(cin, filter=filter, simple=options.simple) + except KeyboardInterrupt: + pass + Property changes on: trunk/CSP/tools/pdot ___________________________________________________________________ Name: svn:executable + * |
From: <sv...@ww...> - 2004-07-22 20:22:38
|
Author: delta Date: 2004-07-22 13:22:32 -0700 (Thu, 22 Jul 2004) New Revision: 1174 Added: trunk/CSP/CSPSim/Data/Images/fx2.jpg Log: Missed. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1174 Added: trunk/CSP/CSPSim/Data/Images/fx2.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/fx2.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <sv...@ww...> - 2004-07-22 20:19:45
|
Author: delta Date: 2004-07-22 13:19:37 -0700 (Thu, 22 Jul 2004) New Revision: 1173 Added: trunk/CSP/CSPSim/Data/Images/CSPLogo.jpg trunk/CSP/CSPSim/Data/Images/TLabMultitex.jpg trunk/CSP/CSPSim/Data/Images/console2.jpg trunk/CSP/CSPSim/Data/Images/crescent.jpg trunk/CSP/CSPSim/Data/Images/ground-fog.jpg trunk/CSP/CSPSim/Data/Images/landing-2.jpg trunk/CSP/CSPSim/Data/Images/moonrise1.jpg trunk/CSP/CSPSim/Data/Images/sunlight2.jpg trunk/CSP/CSPSim/Data/Images/sunset4.jpg trunk/CSP/CSPSim/Data/Images/vista.jpg trunk/CSP/CSPSim/Data/Images/white-smoke-hilite.rgb trunk/CSP/CSPSim/Data/Images/white-smoke-hilite.rgb.COPYING Log: Added smoke texture file. Added jpg image files to reduce bandwith. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1173 Added: trunk/CSP/CSPSim/Data/Images/CSPLogo.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/CSPLogo.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/TLabMultitex.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/TLabMultitex.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/console2.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/console2.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/crescent.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/crescent.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/ground-fog.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/ground-fog.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/landing-2.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/landing-2.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/moonrise1.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/moonrise1.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/sunlight2.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/sunlight2.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/sunset4.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/sunset4.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/vista.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/vista.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/white-smoke-hilite.rgb =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/white-smoke-hilite.rgb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Images/white-smoke-hilite.rgb.COPYING =================================================================== --- trunk/CSP/CSPSim/Data/Images/white-smoke-hilite.rgb.COPYING 2004-07-21 16:38:07 UTC (rev 1172) +++ trunk/CSP/CSPSim/Data/Images/white-smoke-hilite.rgb.COPYING 2004-07-22 20:19:37 UTC (rev 1173) @@ -0,0 +1,4 @@ +Created by Mark Rose <mkrose AT users.sourceforge.net> +This image may be freely redistributed for any purpose +without restriction. + |
From: <sv...@ww...> - 2004-07-21 16:38:17
|
Author: mkrose Date: 2004-07-21 09:38:07 -0700 (Wed, 21 Jul 2004) New Revision: 1172 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/ScopedPointer.h Log: Add missing include. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1172 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-21 07:18:02 UTC (rev 1171) +++ trunk/CSP/SimData/CHANGES.current 2004-07-21 16:38:07 UTC (rev 1172) @@ -1,5 +1,8 @@ Version 0.4.0 (in progress) =========================== +2004-07-21: onsight + * Add missing include. + 2004-07-20: onsight * Add a method to CircularBuffer to undo getReadBuffer (similar to abandonWriteBuffer. Modified: trunk/CSP/SimData/Include/SimData/ScopedPointer.h =================================================================== --- trunk/CSP/SimData/Include/SimData/ScopedPointer.h 2004-07-21 07:18:02 UTC (rev 1171) +++ trunk/CSP/SimData/Include/SimData/ScopedPointer.h 2004-07-21 16:38:07 UTC (rev 1172) @@ -31,6 +31,7 @@ #include <SimData/Namespace.h> #include <SimData/Properties.h> +#include <cassert> NAMESPACE_SIMDATA |
From: <sv...@ww...> - 2004-07-21 07:18:08
|
Author: mkrose Date: 2004-07-21 00:18:02 -0700 (Wed, 21 Jul 2004) New Revision: 1171 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/CircularBuffer.h Log: Add a method to CircularBuffer to undo getReadBuffer (similar to abandonWriteBuffer. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1171 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-19 21:11:16 UTC (rev 1170) +++ trunk/CSP/SimData/CHANGES.current 2004-07-21 07:18:02 UTC (rev 1171) @@ -1,11 +1,14 @@ Version 0.4.0 (in progress) =========================== +2004-07-20: onsight + * Add a method to CircularBuffer to undo getReadBuffer (similar to + abandonWriteBuffer. 2004-07-19: delta * Small mingw32 macro fix in Trace.h. - + * .vcproj update. - + * SIMDATA_EXPORT symbol to export simdata::EnumLink class. 2004-07-17: onsight Modified: trunk/CSP/SimData/Include/SimData/CircularBuffer.h =================================================================== --- trunk/CSP/SimData/Include/SimData/CircularBuffer.h 2004-07-19 21:11:16 UTC (rev 1170) +++ trunk/CSP/SimData/Include/SimData/CircularBuffer.h 2004-07-21 07:18:02 UTC (rev 1171) @@ -401,6 +401,17 @@ m_read = m_next_read; } + /** Place the last block returned by getReadBuffer back into the buffer, + * as though getReadBuffer had never been called. + * + * This method is idempotent, and can be safely called even if + * getReadBuffer fails. + */ + inline void replaceReadBuffer() { + assert(m_next_read <= m_limit); + m_next_read = m_read; + } + }; |
From: <sv...@ww...> - 2004-07-19 21:11:22
|
Author: delta Date: 2004-07-19 14:11:16 -0700 (Mon, 19 Jul 2004) New Revision: 1170 Modified: trunk/CSP/SimData/Include/SimData/Enum.h Log: Very small typo in a comment explaining how to use Enum. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1170 Modified: trunk/CSP/SimData/Include/SimData/Enum.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Enum.h 2004-07-19 08:43:11 UTC (rev 1169) +++ trunk/CSP/SimData/Include/SimData/Enum.h 2004-07-19 21:11:16 UTC (rev 1170) @@ -41,7 +41,7 @@ ... }; // in the corresponding .cpp file: - simdata::Enumeration Foo::Items("apple orange=2 cherry"); + const simdata::Enumeration Foo::Items("apple orange=2 cherry"); void Foo::eat() { std::cout << "Eating one " << m_Snack.getToken() << std::endl; if (m_Snack == "cherry") { |
From: <sv...@ww...> - 2004-07-19 08:43:17
|
Author: delta Date: 2004-07-19 01:43:11 -0700 (Mon, 19 Jul 2004) New Revision: 1169 Modified: trunk/CSP/SimData/CHANGES.current Log: Oops, date typo. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1169 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-19 08:40:22 UTC (rev 1168) +++ trunk/CSP/SimData/CHANGES.current 2004-07-19 08:43:11 UTC (rev 1169) @@ -1,7 +1,7 @@ Version 0.4.0 (in progress) =========================== -2004-19-07: delta +2004-07-19: delta * Small mingw32 macro fix in Trace.h. * .vcproj update. |
From: <sv...@ww...> - 2004-07-19 08:40:32
|
Author: delta Date: 2004-07-19 01:40:22 -0700 (Mon, 19 Jul 2004) New Revision: 1168 Modified: trunk/CSP/SimData/CHANGES.current Log: Read me. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1168 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-19 08:39:33 UTC (rev 1167) +++ trunk/CSP/SimData/CHANGES.current 2004-07-19 08:40:22 UTC (rev 1168) @@ -1,5 +1,13 @@ Version 0.4.0 (in progress) =========================== + +2004-19-07: delta + * Small mingw32 macro fix in Trace.h. + + * .vcproj update. + + * SIMDATA_EXPORT symbol to export simdata::EnumLink class. + 2004-07-17: onsight * Add "custom id" static-class field to TaggedRecord subclasses. This allows applications to assign a short-hand id to each message type, |
From: <sv...@ww...> - 2004-07-19 08:39:39
|
Author: delta Date: 2004-07-19 01:39:33 -0700 (Mon, 19 Jul 2004) New Revision: 1167 Modified: trunk/CSP/SimData/Include/SimData/Enum.h Log: Added export symbol on EnumLink class. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1167 Modified: trunk/CSP/SimData/Include/SimData/Enum.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Enum.h 2004-07-19 08:38:03 UTC (rev 1166) +++ trunk/CSP/SimData/Include/SimData/Enum.h 2004-07-19 08:39:33 UTC (rev 1167) @@ -481,7 +481,7 @@ * * @ingroup BaseTypes */ -class EnumLink: public BaseType { +class SIMDATA_EXPORT EnumLink: public BaseType { friend class Enumeration; /// the associated enumeration Enumeration __E; |
From: <sv...@ww...> - 2004-07-19 08:38:10
|
Author: delta Date: 2004-07-19 01:38:03 -0700 (Mon, 19 Jul 2004) New Revision: 1166 Modified: trunk/CSP/SimData/VisualStudio2003/SimData.vcproj Log: Update. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1166 Modified: trunk/CSP/SimData/VisualStudio2003/SimData.vcproj =================================================================== --- trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-07-19 08:37:29 UTC (rev 1165) +++ trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-07-19 08:38:03 UTC (rev 1166) @@ -283,6 +283,12 @@ RelativePath="..\Include\SimData\BaseType.h"> </File> <File + RelativePath="..\Include\SimData\BufferPool.h"> + </File> + <File + RelativePath="..\Include\SimData\CircularBuffer.h"> + </File> + <File RelativePath="..\Include\SimData\Composite.h"> </File> <File @@ -307,6 +313,9 @@ RelativePath="..\Include\SimData\External.h"> </File> <File + RelativePath="..\Include\SimData\FileUtility.h"> + </File> + <File RelativePath="..\Include\SimData\GeoPos.h"> </File> <File @@ -355,6 +364,9 @@ RelativePath="..\Include\SimData\Namespace.h"> </File> <File + RelativePath="..\Include\SimData\Noise.h"> + </File> + <File RelativePath="..\Include\SimData\Object.h"> </File> <File @@ -427,9 +439,6 @@ RelativePath="..\Include\SimData\Vector3.h"> </File> <File - RelativePath="..\Include\SimData\Vector3.inl"> - </File> - <File RelativePath="..\Include\SimData\Version.h"> </File> </Filter> |
From: <sv...@ww...> - 2004-07-19 08:37:35
|
Author: delta Date: 2004-07-19 01:37:29 -0700 (Mon, 19 Jul 2004) New Revision: 1165 Modified: trunk/CSP/SimData/Include/SimData/Trace.h Log: Small mingw32 macro fix. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1165 Modified: trunk/CSP/SimData/Include/SimData/Trace.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Trace.h 2004-07-19 00:13:53 UTC (rev 1164) +++ trunk/CSP/SimData/Include/SimData/Trace.h 2004-07-19 08:37:29 UTC (rev 1165) @@ -37,7 +37,7 @@ #include <SimData/Log.h> #include <SimData/Singleton.h> -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__MINGW32__) # include <csignal> # include <execinfo.h> # include <exception> @@ -107,7 +107,7 @@ public: -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__MINGW32__) static void StackDump(std::ostream &out, int skip=0) { void *trace[64]; @@ -133,7 +133,7 @@ #endif // __GNUC__ -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__MINGW32__) private: static void __sigsegv(int sign) { @@ -166,7 +166,7 @@ * @returns true if succesful. */ static bool install() { -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__MINGW32__) signal(SIGABRT, __sigabort); signal(SIGSEGV, __sigsegv); return true; |
From: <sv...@ww...> - 2004-07-19 00:14:02
|
Author: mkrose Date: 2004-07-18 17:13:53 -0700 (Sun, 18 Jul 2004) New Revision: 1164 Modified: trunk/CSP/SimData/Include/SimData/Version.h Log: Fix url typo in doxygen main page. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1164 Modified: trunk/CSP/SimData/Include/SimData/Version.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Version.h 2004-07-17 18:45:24 UTC (rev 1163) +++ trunk/CSP/SimData/Include/SimData/Version.h 2004-07-19 00:13:53 UTC (rev 1164) @@ -72,7 +72,7 @@ * object creation capability of SimData provides a very simple way to * extend the simulation functionality using third-party plugin components. * - * See http://csp.sourcforge.net/wiki/SimData for more information + * See http://csp.sourceforge.net/wiki/SimData for more information * or post to http://csp.sourceforge.net/forum if you have suggestions * or need help. * |
From: <sv...@ww...> - 2004-07-17 18:45:30
|
Author: mkrose Date: 2004-07-17 11:45:24 -0700 (Sat, 17 Jul 2004) New Revision: 1163 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc.py Log: Fixed the tr registry include path used in the tr compiler. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1163 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-17 18:43:21 UTC (rev 1162) +++ trunk/CSP/SimData/CHANGES.current 2004-07-17 18:45:24 UTC (rev 1163) @@ -40,6 +40,8 @@ * Fixed the custom id accessor method names in tr factory. + * Fixed the tr registry include path used in the tr compiler. + 2004-07-09: onsight * Changed the formating of HashT values to use fixed-width hex instead of decimal numbers, and cleaned up the data archive Modified: trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc.py =================================================================== --- trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc.py 2004-07-17 18:43:21 UTC (rev 1162) +++ trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc.py 2004-07-17 18:45:24 UTC (rev 1163) @@ -52,7 +52,7 @@ SOURCE_HEADER="""// generated file --- do not edit!' -#include <SimData/TaggedRecordFactory.h> +#include <SimData/TaggedRecordRegistry.h> #include %(include_as)s """ |
From: <sv...@ww...> - 2004-07-17 18:43:27
|
Author: mkrose Date: 2004-07-17 11:43:21 -0700 (Sat, 17 Jul 2004) New Revision: 1162 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/TaggedRecordRegistry.h Log: Fixed the custom id accessor method names in tr factory. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1162 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-17 18:23:23 UTC (rev 1161) +++ trunk/CSP/SimData/CHANGES.current 2004-07-17 18:43:21 UTC (rev 1162) @@ -38,6 +38,8 @@ that can be allocated, and added a new method to get the total allocated space. + * Fixed the custom id accessor method names in tr factory. + 2004-07-09: onsight * Changed the formating of HashT values to use fixed-width hex instead of decimal numbers, and cleaned up the data archive Modified: trunk/CSP/SimData/Include/SimData/TaggedRecordRegistry.h =================================================================== --- trunk/CSP/SimData/Include/SimData/TaggedRecordRegistry.h 2004-07-17 18:23:23 UTC (rev 1161) +++ trunk/CSP/SimData/Include/SimData/TaggedRecordRegistry.h 2004-07-17 18:43:21 UTC (rev 1162) @@ -54,8 +54,8 @@ virtual std::string getName() const=0; virtual int getVersion() const=0; virtual TaggedRecord::Id getId() const=0; - virtual void setLocalId(int) const=0; - virtual int getLocalId() const=0; + virtual void setCustomId(int) const=0; + virtual int getCustomId() const=0; virtual ~TaggedRecordFactoryBase() { } }; |
From: <sv...@ww...> - 2004-07-17 18:23:30
|
Author: mkrose Date: 2004-07-17 11:23:23 -0700 (Sat, 17 Jul 2004) New Revision: 1161 Added: trunk/CSP/SimData/SimData/Tests/test_CircularBuffer.cpp Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/CircularBuffer.h trunk/CSP/SimData/Makefile trunk/CSP/SimData/SimData/Tests/Makefile trunk/CSP/SimData/SimData/Tests/test_Object.cpp Log: Added circular buffer unittest and tweaked the makefiles slighly to give better test failure reporting. Also fixed a small bug in CircularBuffer, renamed the method for testing the maximum block size that can be allocated, and added a new method to get the total allocated space. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1161 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-17 17:01:58 UTC (rev 1160) +++ trunk/CSP/SimData/CHANGES.current 2004-07-17 18:23:23 UTC (rev 1161) @@ -32,6 +32,12 @@ * Expand the python interface to LogStream to include setting the enabling point and time logging. + * Added circular buffer unittest and tweaked the makefiles slighly to + give better test failure reporting. Also fixed a small bug in + CircularBuffer, renamed the method for testing the maximum block size + that can be allocated, and added a new method to get the total allocated + space. + 2004-07-09: onsight * Changed the formating of HashT values to use fixed-width hex instead of decimal numbers, and cleaned up the data archive Modified: trunk/CSP/SimData/Include/SimData/CircularBuffer.h =================================================================== --- trunk/CSP/SimData/Include/SimData/CircularBuffer.h 2004-07-17 17:01:58 UTC (rev 1160) +++ trunk/CSP/SimData/Include/SimData/CircularBuffer.h 2004-07-17 18:23:23 UTC (rev 1161) @@ -70,7 +70,7 @@ m_buffer = new TYPE[count]; } - uint32 count() const { return m_count; } + uint32 getCount() const { return m_count; } ~RingQueue() { delete[] m_buffer; @@ -207,7 +207,7 @@ m_size = size + RESERVE; m_read = 0; m_write = 0; - m_limit = size; + m_limit = m_size; m_next_read = 0; m_next_write = 0; m_allocated = 0; @@ -246,7 +246,7 @@ inline uint8 *getWriteBuffer(const uint32 size) { // check that there aren't any allocated but uncommitted blocks assert(m_write == m_next_write); - if (size == 0 || getFreeSpace() < size) return 0; + if (size == 0 || getMaximumAllocation() < size) return 0; uint32 offset = m_write; // if no room at the end of the buffer; allocate from the start if (m_size - m_write < size + RESERVE) { @@ -271,7 +271,7 @@ * an upper bound (additional space may be consumed by the writer * thread at any time). */ - inline uint32 getFreeSpace() const { + inline uint32 getMaximumAllocation() const { uint32 read = m_read; if (read > m_write) { if (read - m_write <= RESERVE) return 0; @@ -282,6 +282,24 @@ return 0; } + /** Returns a measure of the number of bytes in the buffer that are + * allocated. Note that getAllocatedBytes() + getMaximumAllocation() + * will generally be less than capacity due to wasted space at the + * end of the buffer. + */ + inline uint32 getAllocatedSpace() const { + uint32 read = m_read; + uint32 write = m_write; + uint32 space; + if (read > write) { + space = (m_size + write) - read; + } else { + space = write - read; + } + if (space > RESERVE) return space - RESERVE; + return 0; + } + /** Returns true if the buffer is empty (no blocks to read). */ inline bool isEmpty() const { Modified: trunk/CSP/SimData/Makefile =================================================================== --- trunk/CSP/SimData/Makefile 2004-07-17 17:01:58 UTC (rev 1160) +++ trunk/CSP/SimData/Makefile 2004-07-17 18:23:23 UTC (rev 1161) @@ -31,8 +31,7 @@ @python setup.py make_install --verbose tests: - @$(MAKE) --no-print-directory -C SimData/Tests all - @SIMDATA_LOGFILE=SimData/Tests/.testlog python SimData/Tests/RunTests.py + @$(MAKE) --no-print-directory -C SimData/Tests all && SIMDATA_LOGFILE=SimData/Tests/.testlog python SimData/Tests/RunTests.py tests-clean: @$(MAKE) --no-print-directory -C SimData/Tests clean Modified: trunk/CSP/SimData/SimData/Tests/Makefile =================================================================== --- trunk/CSP/SimData/SimData/Tests/Makefile 2004-07-17 17:01:58 UTC (rev 1160) +++ trunk/CSP/SimData/SimData/Tests/Makefile 2004-07-17 18:23:23 UTC (rev 1161) @@ -47,16 +47,30 @@ @echo -n "Building $@..." @for foo in a; do \ $(CXX) -o $@ $(CFLAGS) $(@:=.cpp) -L$(TOPDIR)/SimData -lSimData -lpthread 2>.buildlog 1>/dev/null; \ - if [ $$? = "0" ]; then echo "ok"; else echo "failed!"; exit 1; fi; \ + if [ $$? = "0" ]; then echo "ok"; else echo "failed! (see .buildlog for details)"; exit 1; fi; \ done $ run: - @for test in $(TESTS); do \ - echo -n "Running $$test..."; \ - ./$$test 2>$$test.log 1>/dev/null; \ - if [ $$? = "0" ]; then echo "ok"; rm $$test.log; else echo "failed!"; fi; \ - done + @export FAILED_TESTS=0; \ + for test in $(TESTS); do \ + echo -n "Running $$test..."; \ + ./$$test 2>$$test.log 1>/dev/null; \ + if [ $$? = "0" ]; then \ + echo "ok"; \ + rm $$test.log; \ + else \ + echo "failed!"; \ + FAILED_TESTS=`expr $$FAILED_TESTS + 1`; \ + fi; \ + done; \ + if [ $$FAILED_TESTS -gt 0 ]; then \ + echo "********************************************"; \ + echo "$$FAILED_TESTS TEST(S) FAILED!"; \ + echo "********************************************"; \ + exit 1; \ + fi + $ all: $(TESTS) run Added: trunk/CSP/SimData/SimData/Tests/test_CircularBuffer.cpp =================================================================== --- trunk/CSP/SimData/SimData/Tests/test_CircularBuffer.cpp 2004-07-17 17:01:58 UTC (rev 1160) +++ trunk/CSP/SimData/SimData/Tests/test_CircularBuffer.cpp 2004-07-17 18:23:23 UTC (rev 1161) @@ -0,0 +1,116 @@ +/* SimData: Data Infrastructure for Simulations + * Copyright (C) 2004 Mark Rose <mk...@us...> + * + * 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. + */ + + +/** + * @file test_CircularBuffer.cpp + * @brief Test the CircularBuffer class. + */ + + +#include <SimData/CircularBuffer.h> +#include <SimData/Trace.h> + +#include <cstdlib> +#include <cassert> +#include <iostream> +#include <deque> + +#define TEST_LOOP_COUNT 1000000 +#define DBG false + +using namespace simdata; + + +void testOneByte() { + std::cerr << "RUNNING ONE BYTE TEST\n"; + CircularBuffer b(433); + assert(b.getAllocatedSpace() == 0); + assert(b.getMaximumAllocation() > 430); + for (int i = 0; i < TEST_LOOP_COUNT; ++i) { + if (DBG) std::cerr << "iteration: " << i << "\n"; + uint8 *x = b.getWriteBuffer(1); + *x = i & 255; + b.commitWriteBuffer(); + uint32 size; + x = b.getReadBuffer(size); + assert(size == 1); + assert(*x == (i & 255)); + b.releaseReadBuffer(); + } + assert(b.getAllocatedSpace() == 0); +} + + +void testRandomUse() { + std::cerr << "RUNNING RANDOM USE TEST\n"; + CircularBuffer b(1024); + std::deque<uint8*> q_ptr; + std::deque<uint32> q_size; + int n = 0; + for (int i = 0; i < TEST_LOOP_COUNT; ++i) { + if (DBG) std::cerr << "iteration: " << i << "\n"; + if (rand() & 1) { + uint32 size; + uint8 *x = b.getReadBuffer(size); + if (x != 0) { + if (DBG) std::cerr << "read " << (void*)x << " " << size << "\n"; + assert(x == q_ptr.front()); + q_ptr.pop_front(); + assert(size == q_size.front()); + q_size.pop_front(); + b.releaseReadBuffer(); + } else { + assert(q_ptr.empty()); + if (DBG) std::cerr << "read --- empty!\n"; + } + } else { + uint32 size = (rand() & 255); + uint8 *x = b.getWriteBuffer(size); + if (x != 0) { + if (DBG) std::cerr << "write " << (void*)x << " " << size << "\n"; + q_ptr.push_back(x); + q_size.push_back(size); + b.commitWriteBuffer(); + } else { + if (DBG) std::cerr << "write --- full! " << q_ptr.size() << "\n"; + } + } + } +} + + +void test() { + testRandomUse(); + testOneByte(); + ::exit(0); +} + + +int main() { + Trace::install(); + test(); + return 0; +}; + + + + + Modified: trunk/CSP/SimData/SimData/Tests/test_Object.cpp =================================================================== --- trunk/CSP/SimData/SimData/Tests/test_Object.cpp 2004-07-17 17:01:58 UTC (rev 1160) +++ trunk/CSP/SimData/SimData/Tests/test_Object.cpp 2004-07-17 18:23:23 UTC (rev 1161) @@ -1,18 +1,18 @@ /* SimData: Data Infrastructure for Simulations * Copyright (C) 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. @@ -101,7 +101,7 @@ } void test() { - // TODO + // TODO // * set and retrieve values // * split Object class declarations into a header? simdata::InterfaceRegistry ® = simdata::InterfaceRegistry::getInterfaceRegistry(); @@ -126,8 +126,8 @@ ::exit(0); } -int main() { +int main() { test(); - return 0; + return 0; }; |
From: <sv...@ww...> - 2004-07-17 17:02:06
|
Author: mkrose Date: 2004-07-17 10:01:58 -0700 (Sat, 17 Jul 2004) New Revision: 1160 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/ClientNode.cpp trunk/CSP/CSPSim/Source/RedirectServerNode.cpp Log: Cleaned up indentation in some more network code. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1160 Diff omitted (16386 bytes). |
From: <sv...@ww...> - 2004-07-17 16:35:35
|
Author: mkrose Date: 2004-07-17 09:35:25 -0700 (Sat, 17 Jul 2004) New Revision: 1159 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Log.i Log: Expand the python interface to LogStream to include setting the enabling point and time logging. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1159 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-17 16:33:34 UTC (rev 1158) +++ trunk/CSP/SimData/CHANGES.current 2004-07-17 16:35:25 UTC (rev 1159) @@ -29,6 +29,9 @@ (unit test coming soon). See the header file for docs on what they do and how to use them (nb: ring queue is still under-documented). + * Expand the python interface to LogStream to include setting the + enabling point and time logging. + 2004-07-09: onsight * Changed the formating of HashT values to use fixed-width hex instead of decimal numbers, and cleaned up the data archive Modified: trunk/CSP/SimData/Include/SimData/Log.i =================================================================== --- trunk/CSP/SimData/Include/SimData/Log.i 2004-07-17 16:33:34 UTC (rev 1158) +++ trunk/CSP/SimData/Include/SimData/Log.i 2004-07-17 16:35:25 UTC (rev 1159) @@ -35,8 +35,10 @@ ~LogStream(); void _close(); void setOutput(std::string const &fn); - void setLogPriority(int p); - void setLogCategory(int c); + void setLogPriority(int); + void setLogCategory(int); + void setTimeLogging(bool); + void setPointLogging(bool); }; NAMESPACE_SIMDATA_END // namespace simdata |
From: <sv...@ww...> - 2004-07-17 16:33:40
|
Author: mkrose Date: 2004-07-17 09:33:34 -0700 (Sat, 17 Jul 2004) New Revision: 1158 Added: trunk/CSP/SimData/Include/SimData/CircularBuffer.h trunk/CSP/SimData/Include/SimData/ThreadUtil.h Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/BufferPool.h trunk/CSP/SimData/Include/SimData/Thread.h trunk/CSP/SimData/Include/SimData/ThreadBase.h trunk/CSP/SimData/Source/SConscript trunk/CSP/SimData/Source/ThreadBase.cpp trunk/CSP/SimData/setup.py Log: Moved non-pthread specific threading support classes from ThreadBase.h to ThreadUtil.h. Minor tweaks to the Thread api to allow preconstructed tasks to be attached to a thread. Tweak to BufferPool to provide optional mutex locking. Added a ring queue and a circular buffer class. The former is still rough and largely untested. The latter has been tested extensively (unit test coming soon). See the header file for docs on what they do and how to use them (nb: ring queue is still under-documented). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1158 Diff omitted (24046 bytes). |
From: <sv...@ww...> - 2004-07-17 16:24:00
|
Author: mkrose Date: 2004-07-17 09:23:49 -0700 (Sat, 17 Jul 2004) New Revision: 1157 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/TaggedRecord.h trunk/CSP/SimData/Include/SimData/TaggedRecordRegistry.h trunk/CSP/SimData/Tools/TaggedRecordCompiler/BaseTypes.py trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc.py Log: Add "custom id" static-class field to TaggedRecord subclasses. This allows applications to assign a short-hand id to each message type, which can be more space efficient than using the full 64-bit id when communicating between servers. For transient messages, the idea is for all communicating parties to agree upon a compact id space for the messages they will exchange and then store these ids in the message classes for easy retrieval. To support the class static variables and the tagged record registry, the tagged record compiler now generates both header and source files for each input file. In the future, some of the less common tr methods may be moved to the source file. Another idea is to add an option to the compiler to omit the custom id field so that the source file doesn't need to be generated (in the case that you don't care about this functionality and don't want the overhead of a source file that must be added to the build system). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1157 Diff omitted (13437 bytes). |
From: <sv...@ww...> - 2004-07-11 08:20:56
|
Author: mkrose Date: 2004-07-11 01:20:45 -0700 (Sun, 11 Jul 2004) New Revision: 1156 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/AircraftObject.h trunk/CSP/CSPSim/Include/BaseScreen.h trunk/CSP/CSPSim/Include/GameScreen.h trunk/CSP/CSPSim/Include/InputInterface.h trunk/CSP/CSPSim/Include/LandingGear.h trunk/CSP/CSPSim/Include/Systems/AircraftInputSystem.h trunk/CSP/CSPSim/Source/AircraftObject.cpp trunk/CSP/CSPSim/Source/GameScreen.cpp trunk/CSP/CSPSim/Source/InputInterface.cpp trunk/CSP/CSPSim/Source/LandingGear.cpp trunk/CSP/CSPSim/Source/Systems/AircraftInputSystem.cpp Log: Refactored InputInterface to move the handler maps to a separate class (InputInterfaceDispatch). A static instance of this class is then created in each InputInterface subclass. This means that there will be one set of maps per InputInterface subclass (created once during static intialization), rather than one set per instance (recreated each time a new object was created). The input interface macros have changed somewhat as well. The BIND_* macros that were in the object ctors are now used in the class declaration (c.f. AircraftObject.h). There is also a macro that must be called in the .cpp file to define the static InputInterfaceDispatch instance (c.f. AircraftObject.cpp). The macros used to define static and non-static handlers have been removed. Instead just declare the handlers as normal methods in the class body, and implement them as usual in the source (.cpp) file. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1156 Diff omitted (38809 bytes). |
From: <sv...@ww...> - 2004-07-11 02:22:02
|
Author: mkrose Date: 2004-07-10 19:21:55 -0700 (Sat, 10 Jul 2004) New Revision: 1155 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/DynamicObject.cpp Log: Small formatting cleanup. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1155 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-07-10 05:19:49 UTC (rev 1154) +++ trunk/CSP/CSPSim/CHANGES.current 2004-07-11 02:21:55 UTC (rev 1155) @@ -1,6 +1,9 @@ Version 0.4.0 (in progress) =========================== +2004-07-10: onsight + * Small formatting cleanup in DynamicObject.cpp. + 2004-07-08: onsight * Slight tweak of the logging macros. See the SimData changelog for details. Modified: trunk/CSP/CSPSim/Source/DynamicObject.cpp =================================================================== --- trunk/CSP/CSPSim/Source/DynamicObject.cpp 2004-07-10 05:19:49 UTC (rev 1154) +++ trunk/CSP/CSPSim/Source/DynamicObject.cpp 2004-07-11 02:21:55 UTC (rev 1155) @@ -1,17 +1,17 @@ // Combat Simulator Project - FlightSim Demo // 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. @@ -95,13 +95,11 @@ if (!m_SceneModel) createSceneModel(); return m_SceneModel->getRoot(); } - -osg::Node* DynamicObject::getModelNode() { +osg::Node* DynamicObject::getModelNode() { if (!m_SceneModel) return 0; return m_SceneModel->getRoot(); } - void DynamicObject::setGlobalPosition(simdata::Vector3 const & position) { setGlobalPosition(position.x(), position.y(), position.z()); @@ -111,11 +109,11 @@ { if (isGrounded()) { - // if the object is fixed to the ground, ignore the z component + // if the object is fixed to the ground, ignore the z component // and use the local elevation (not implemented) // FIXME FIXME FIXME XXX XXX float offset = 0.0; - z = offset; + z = offset; } b_GlobalPosition->value() = simdata::Vector3(x, y, z); } @@ -145,7 +143,7 @@ VirtualBattlefield const *battlefield = sim->getBattlefield(); assert(battlefield); simdata::Vector3 &pos = b_GlobalPosition->value(); - pos.z() = battlefield->getGroundElevation(pos.x(), pos.y(), m_GroundHint) + offset; + pos.z() = battlefield->getGroundElevation(pos.x(), pos.y(), m_GroundHint) + offset; } @@ -156,8 +154,6 @@ } } - -// update double DynamicObject::onUpdate(double dt) { // Save the objects old position @@ -171,7 +167,6 @@ return 0.0; } - void DynamicObject::doControl(double dt) { if (m_Controller.valid()) { m_Controller->doControl(dt); @@ -199,9 +194,9 @@ VirtualBattlefield const *battlefield = sim->getBattlefield(); assert(battlefield); b_GroundZ->value() = battlefield->getGroundElevation( - b_GlobalPosition->value().x(), - b_GlobalPosition->value().y(), - b_GroundN->value(), + b_GlobalPosition->value().x(), + b_GlobalPosition->value().y(), + b_GroundN->value(), m_GroundHint ); double height = (b_GlobalPosition->value().z() - b_GroundZ->value()) * b_GroundN->value().z(); @@ -283,7 +278,6 @@ return model; } - void DynamicObject::registerChannels(Bus::Ref bus) { if (!bus) return; bus->registerChannel(b_GlobalPosition.get()); @@ -299,7 +293,6 @@ bus->registerLocalDataChannel< simdata::Ref<ObjectModel> >("Internal.ObjectModel", m_Model); } - Bus::Ref DynamicObject::getBus() { return (m_SystemsModel.valid() ? m_SystemsModel->getBus(): 0); } @@ -366,7 +359,7 @@ if (InputInterface::onMapEvent(event)) { return true; } -if (m_SystemsModel.valid() && m_SystemsModel->onMapEvent(event)) { + if (m_SystemsModel.valid() && m_SystemsModel->onMapEvent(event)) { return true; } return false; @@ -385,77 +378,69 @@ } } +NetworkMessage * DynamicObject::getUpdateMessage() { + CSP_LOG(NETWORK, DEBUG, "DynamicObject::getUpdateMessage()"); + unsigned short messageType = 2; + unsigned short payloadLen = sizeof(int) + sizeof(double) + 3*sizeof(simdata::Vector3) + sizeof(simdata::Quat) /* + sizeof(simdata::Matrix3) + sizeof(double) */; -NetworkMessage * DynamicObject::getUpdateMessage() -{ - CSP_LOG(APP, DEBUG, "DynamicObject::getUpdateMessage()"); - unsigned short messageType = 2; - unsigned short payloadLen = sizeof(int) + sizeof(double) + 3*sizeof(simdata::Vector3) + - sizeof(simdata::Quat) /* + sizeof(simdata::Matrix3) + sizeof(double) */; + NetworkMessage * message = CSPSim::theSim->getNetworkMessenger()->allocMessageBuffer(messageType, payloadLen); - NetworkMessage * message = CSPSim::theSim->getNetworkMessenger()->allocMessageBuffer(messageType, payloadLen); + ObjectUpdateMessagePayload * ptrPayload = (ObjectUpdateMessagePayload*)message->getPayloadPtr(); + ptrPayload->id = m_ID; + ptrPayload->timeStamp = CSPSim::theSim->getElapsedTime(); + b_GlobalPosition->value().writeBinary((unsigned char *)&(ptrPayload->globalPosition),24); + b_LinearVelocity->value().writeBinary((unsigned char *)&(ptrPayload->linearVelocity),24); + b_AngularVelocity->value().writeBinary((unsigned char *)&(ptrPayload->angularVelocity),24); + b_Attitude->value().writeBinary((unsigned char *)&(ptrPayload->attitude),32); - ObjectUpdateMessagePayload * ptrPayload = (ObjectUpdateMessagePayload*)message->getPayloadPtr(); - ptrPayload->id = m_ID; - ptrPayload->timeStamp = CSPSim::theSim->getElapsedTime(); - b_GlobalPosition->value().writeBinary((unsigned char *)&(ptrPayload->globalPosition),24); - b_LinearVelocity->value().writeBinary((unsigned char *)&(ptrPayload->linearVelocity),24); - b_AngularVelocity->value().writeBinary((unsigned char *)&(ptrPayload->angularVelocity),24); - b_Attitude->value().writeBinary((unsigned char *)&(ptrPayload->attitude),32); - -// simdata::MemoryWriter writer((simdata::uint8*)ptrPayload); -// writer << m_ID; -// writer << m_Type; -// writer << CSPSim::theSim->getElapsedTime(); -// b_GlobalPosition->value().serialize(writer); -// b_LinearVelocity->value().serialize(writer); -// b_AngularVelocity->value().serialize(writer); -// b_Attitude->value().serialize(writer); - - CSP_LOG(APP, DEBUG, "DynamicObject::getUpdateMessage() - returning message"); + // simdata::MemoryWriter writer((simdata::uint8*)ptrPayload); + // writer << m_ID; + // writer << m_Type; + // writer << CSPSim::theSim->getElapsedTime(); + // b_GlobalPosition->value().serialize(writer); + // b_LinearVelocity->value().serialize(writer); + // b_AngularVelocity->value().serialize(writer); + // b_Attitude->value().serialize(writer); + CSP_LOG(NETWORK, DEBUG, "DynamicObject::getUpdateMessage() - returning message"); - return message; + return message; } -void DynamicObject::putUpdateMessage(NetworkMessage* message) -{ - // read message +void DynamicObject::putUpdateMessage(NetworkMessage* message) { + // read message - ObjectUpdateMessagePayload * ptrPayload = (ObjectUpdateMessagePayload*)message->getPayloadPtr(); - // verify we have the correct id in the packet for this object. - if (m_ID == ptrPayload->id) - { -// printf("Loading update message of object %d\n", m_ID); - } - else - { -// printf("Error loading update message, object id (%d) does not match\n", idValue); - } + ObjectUpdateMessagePayload * ptrPayload = (ObjectUpdateMessagePayload*)message->getPayloadPtr(); + // verify we have the correct id in the packet for this object. + if (m_ID == ptrPayload->id) { + //printf("Loading update message of object %d\n", m_ID); + } else { + //printf("Error loading update message, object id (%d) does not match\n", idValue); + } - // we can disregard this message if the timestamp is older then the most - // recent update. - - ptrPayload->timeStamp = CSPSim::theSim->getElapsedTime(); - // - //load the other values. - b_GlobalPosition->value().readBinary((unsigned char*)&(ptrPayload->globalPosition),24); - b_LinearVelocity->value().readBinary((unsigned char *)&(ptrPayload->linearVelocity),24); - b_AngularVelocity->value().readBinary((unsigned char *)&(ptrPayload->angularVelocity),24); - b_Attitude->value().readBinary((unsigned char *)&(ptrPayload->attitude),32); - -// unsigned int _id; -// unsigned _type; -// float _timestamp; -// -// simdata::MemoryReader reader((simdata::uint8*)ptrPayload); -// reader >> _id; -// reader >> _type; -// reader >> _timestamp; -// b_GlobalPosition->value().serialize(reader); -// b_LinearVelocity->value().serialize(reader); -// b_AngularVelocity->value().serialize(reader); -// b_Attitude->value().serialize(reader); + // we can disregard this message if the timestamp is older then the most + // recent update. + + ptrPayload->timeStamp = CSPSim::theSim->getElapsedTime(); + + // load the other values. + b_GlobalPosition->value().readBinary((unsigned char*)&(ptrPayload->globalPosition),24); + b_LinearVelocity->value().readBinary((unsigned char *)&(ptrPayload->linearVelocity),24); + b_AngularVelocity->value().readBinary((unsigned char *)&(ptrPayload->angularVelocity),24); + b_Attitude->value().readBinary((unsigned char *)&(ptrPayload->attitude),32); + + //unsigned int _id; + //unsigned _type; + //float _timestamp; + // + //simdata::MemoryReader reader((simdata::uint8*)ptrPayload); + //reader >> _id; + //reader >> _type; + //reader >> _timestamp; + //b_GlobalPosition->value().serialize(reader); + //b_LinearVelocity->value().serialize(reader); + //b_AngularVelocity->value().serialize(reader); + //b_Attitude->value().serialize(reader); } |
From: <sv...@ww...> - 2004-07-10 05:19:56
|
Author: mkrose Date: 2004-07-09 22:19:49 -0700 (Fri, 09 Jul 2004) New Revision: 1154 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Source/DataArchive.cpp trunk/CSP/SimData/Source/HashUtility.cpp Log: Changed the formating of HashT values to use fixed-width hex instead of decimal numbers, and cleaned up the data archive dump formatting slightly. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1154 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-10 05:17:16 UTC (rev 1153) +++ trunk/CSP/SimData/CHANGES.current 2004-07-10 05:19:49 UTC (rev 1154) @@ -1,5 +1,10 @@ Version 0.4.0 (in progress) =========================== +2004-07-09: onsight + * Changed the formating of HashT values to use fixed-width hex + instead of decimal numbers, and cleaned up the data archive + dump formatting slightly. + 2004-07-08: onsight * Simplify the logging classes considerably, and tweak the logging macros to skip the output stream formating for messages that Modified: trunk/CSP/SimData/Source/DataArchive.cpp =================================================================== --- trunk/CSP/SimData/Source/DataArchive.cpp 2004-07-10 05:17:16 UTC (rev 1153) +++ trunk/CSP/SimData/Source/DataArchive.cpp 2004-07-10 05:19:49 UTC (rev 1154) @@ -490,10 +490,10 @@ std::string classname = _table[i].classhash.str(); if (proxy) classname = proxy->getClassName(); std::cout << std::setw(6) << _table[i].length - << std::setw(9) << _table[i].offset - << _table[i].pathhash << " " - << classname << " " - << getPathString(_table[i].pathhash) << "\n"; + << std::setw(9) << _table[i].offset << " " + << _table[i].pathhash << " " + << classname << " " + << getPathString(_table[i].pathhash) << "\n"; } } Modified: trunk/CSP/SimData/Source/HashUtility.cpp =================================================================== --- trunk/CSP/SimData/Source/HashUtility.cpp 2004-07-10 05:17:16 UTC (rev 1153) +++ trunk/CSP/SimData/Source/HashUtility.cpp 2004-07-10 05:19:49 UTC (rev 1154) @@ -1,18 +1,18 @@ /* SimDataCSP: Data Infrastructure for Simulations * Copyright (C) 2002 Mark Rose <tm...@st...> - * + * * This file is part of SimDataCSP. * * 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. @@ -23,11 +23,12 @@ * * Hash functions utilities * - * The hash functions coded here are from "Hash Functions for Hash + * The hash functions coded here are from "Hash Functions for Hash * Table Lookup" by Robert J. Jenokins Jr., and are Public Domain. * See <http://burtleburtle.net/bob/hash/evahash.html> */ #include <sstream> +#include <iomanip> #include <SimData/HashUtility.h> @@ -37,7 +38,7 @@ HASH<const char*> hashstring::h; -// The mixing step +// The mixing step #define mix(a,b,c) \ { \ a=a-b; a=a-c; a=a^(c>>13); \ @@ -57,12 +58,12 @@ * * @param k the string to hash * @param length the length of the string in bytes. - * @param initval the previous hash, or an arbitrary value - */ + * @param initval the previous hash, or an arbitrary value + */ uint32 newhash(register uint8 const *k, uint32 length, uint32 initval) { register uint32 a,b,c; // the internal state - uint32 len; // how many key bytes still need mixing + uint32 len; // how many key bytes still need mixing // Set up the internal state len = length; @@ -70,7 +71,7 @@ c = initval; // variable initialization of internal state // handle most of the key - + while (len >= 12) { a=a+(k[0]+((uint32)k[1]<<8)+((uint32)k[2]<<16) +((uint32)k[3]<<24)); @@ -86,7 +87,7 @@ case 11: c=c+((uint32)k[10]<<24); case 10: c=c+((uint32)k[9]<<16); case 9 : c=c+((uint32)k[8]<<8); - // the first byte of c is reserved for the length + // the first byte of c is reserved for the length case 8 : b=b+((uint32)k[7]<<24); case 7 : b=b+((uint32)k[6]<<16); case 6 : b=b+((uint32)k[5]<<8); @@ -95,7 +96,7 @@ case 3 : a=a+((uint32)k[2]<<16); case 2 : a=a+((uint32)k[1]<<8); case 1 : a=a+k[0]; - // case 0: nothing left to add + // case 0: nothing left to add } mix(a,b,c); // report the result @@ -125,7 +126,9 @@ } std::ostream & operator<<(std::ostream &o, const hasht &x) { - return o << "(" << x.b << ":" << x.a << ")"; + return o << "(" << std::hex << std::setw(8) << std::setfill('0') << x.b << ":" + << std::setw(8) << std::setfill('0') << x.a + << std::dec << std::setw(0) << std::setfill(' ') << ")"; } |
From: <sv...@ww...> - 2004-07-10 05:17:23
|
Author: mkrose Date: 2004-07-09 22:17:16 -0700 (Fri, 09 Jul 2004) New Revision: 1153 Modified: trunk/CSP/CSPSim/Bin/CSPSim.py trunk/CSP/CSPSim/CHANGES.current Log: Added instructions for using the --pause option for debugging under GNU/Linux. Changed the --log to --logcat, and added the ability to specify category exclusions. For example, --logcat=PHYSICS:NETWORK:TERRAIN will only log messages in those three categories, while --logcat=ALL:-NETWORK will log all categories _except_ NETWORK. Replaced the --slog parameter with --logpri, which overrides the logging priority for both simdata and cspsim. Accepts either numeric values (e.g. 5) or symbolic names (e.g. "INFO"). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1153 Modified: trunk/CSP/CSPSim/Bin/CSPSim.py =================================================================== --- trunk/CSP/CSPSim/Bin/CSPSim.py 2004-07-09 06:28:26 UTC (rev 1152) +++ trunk/CSP/CSPSim/Bin/CSPSim.py 2004-07-10 05:17:16 UTC (rev 1153) @@ -1,7 +1,7 @@ #!/usr/bin/python -O # Combat Simulator Project - CSPSim -# Copyright (C) 2002 The Combat Simulator Project +# Copyright (C) 2002, 2004 The Combat Simulator Project # http://csp.sourceforge.net # # This program is free software; you can redistribute it and/or @@ -26,12 +26,14 @@ #import Shell #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"): @@ -39,48 +41,81 @@ if os.path.exists("/dev/input/js0"): os.environ["SDL_JOYSTICK_DEVICE"]="/dev/input/js0" + def printUsage(): print "Combat Simulator Project - CSPSim" print print " Primary options:" - print " --compile-data run the data compiler" - print " --config=path path to config (.ini) file" - 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 " --client-node run networking test client node" - print " --echo-server-node run networking test echo server node" - print " --help help message" + print " --compile-data run the data compiler" + print " --config=path path to config (.ini) file" + print " --logcat=categories set the logging categories (colon-delimited)" + print " examples: --logcat=APP:TERRAIN:PHYSICS" + print " --logcat=ALL:-NETWORK (all but network)" + print " --logpri=priority set the logging priority threshold (overrides .ini)" + print " examples: --logpri=INFO" + print " --logpri=5" + print " --pause pause on startup for attaching a debug session" + print " --dump-data show the contents of sim.dar" + print " --client-node run networking test client node" + print " --echo-server-node run networking test echo server node" + print " --help help message" def setLogCategory(): - if len(log_classes) == 0: return + if len(log_categories) == 0: return flags = 0 - for class_name in log_classes: + for class_name in log_categories: + invert = 0 + if class_name.startswith('-'): + class_name = class_name[1:] + invert = 1 try: class_flag = getattr(CSP, "CSP_"+class_name); - flags = flags | class_flag + if invert: + flags = flags & ~class_flag + else: + flags = flags | class_flag except: print "Unrecognized log class:", class_name CSP.csplog().setLogCategory(flags) +def setLogPriority(): + if log_priority is None: return + CSP.csplog().setLogPriority(log_priority) + SimData.log().setLogPriority(log_priority) + + +def parseLogPriority(priority): + try: + priority = int(priority) + except ValueError: + priority = getattr(SimData, "LOG_" + priority.upper(), None) + return priority + + def runCSPSim(args): if len(args): - print "Unrecognized option '%s'" % args[0] - print + print "Unrecognized option '%s'\n" % args[0] printUsage() print sys.exit(1) + cachepath = CSP.getCachePath() dar = os.path.join(cachepath, "sim.dar") if not os.path.exists(dar): print print "Static data archive '%s' not found." % dar compileData([]) + import Shell app = CSP.CSPSim() + + # logging will have already been configured from the ini file at this point, + # so we can safely override the settings. setLogCategory() + setLogPriority() + app.init() try: @@ -105,10 +140,8 @@ 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() @@ -144,7 +177,8 @@ print 'Aborting' sys.exit(1) print - + + def runClientNode(args): print "CSPSim.py - runClientNode - Starting Test Client Node..." print "CSPSim.py - runClientNode - calling loadCSP" @@ -154,12 +188,14 @@ print "CSPSim.py - runClientNode - calling app.run" app.run() + def runEchoServerNode(args): print "Starting Test Echo Server Node..." loadCSP() app = CSP.EchoServerNode() app.run() + def loadSimData(): """Load the SimData module""" global SimData @@ -238,7 +274,8 @@ def main(argv): - global log_classes + global log_categories + global log_priority initDynamicLoading() setDefaultJoystick() @@ -248,10 +285,11 @@ # process command line options program = argv[0] all_args = argv[1:] - log_classes = [] + log_categories = [] + log_priority = None + log_priority_arg = None other_args = [] pause = 0 - simdata_loglevel = "ALERT" config = findConfig() @@ -279,39 +317,53 @@ other_args.append(arg) elif arg.startswith("--config="): config = arg[9:] - elif arg.startswith("--log="): - log_classes.extend(arg[6:].split(':')) - elif arg.startswith("--slog="): - simdata_loglevel = arg[7:] + elif arg.startswith("--logcat="): + log_categories.extend(arg[9:].split(':')) + elif arg.startswith("--logpri="): + log_priority_arg = arg[9:] else: other_args.append(arg) if action is None: action = runCSPSim + loadSimData() + + if log_priority_arg is not None: + log_priority = parseLogPriority(log_priority_arg) + if log_priority is None: + print "Invalid logging priority, using .ini setting." + + # capture Object class registration and other errors when CSP loads SimData.log().setLogCategory(SimData.LOG_ALL) SimData.log().setLogPriority(SimData.LOG_DEBUG) loadCSP() - try: - simdata_loglevel = eval("SimData.LOG_%s" % simdata_loglevel.upper()) - except: - print "Invalid SimData logging level, defaulting to 'ALERT'" - simdata_loglevel = SimData.LOG_ALERT - - SimData.log().setLogPriority(simdata_loglevel) - print "Loading configuration from '%s'." % config if not CSP.openConfig(config): print "Unable to open primary configuration file (%s)" % config sys.exit(0) if pause: - print "Hit <ctrl-break> to temporarily exit and set breakpoints." - print "When you are done, continue execution and hit <enter>." - sys.stdin.readline() + print + print "CSPSim has loaded all extension modules, and is now paused to give you" + print "an opportunity to attach a debugging session. Under GNU/Linux run the" + print "following command from a separate shell to attach a debug session:" + print + print " gdb python %d" % os.getpid() + print + print "This will run gdb and attach to the CSPSim process. Once gdb finishes" + print "loading symbols for all the modules, you can set breakpoints as needed" + print "and then enter 'c' to continue." + print + print "Finally, return to this window and press <enter> to resume CSPSim." + print + try: + sys.stdin.readline() + except KeyboardInterrupt: + sys.exit(1) action(other_args) Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-07-09 06:28:26 UTC (rev 1152) +++ trunk/CSP/CSPSim/CHANGES.current 2004-07-10 05:17:16 UTC (rev 1153) @@ -1,6 +1,22 @@ Version 0.4.0 (in progress) =========================== +2004-07-08: onsight + * Slight tweak of the logging macros. See the SimData changelog for + details. + + * Added instructions for using the --pause option for debugging under + GNU/Linux. + + * Changed the --log to --logcat, and added the ability to specify + category exclusions. For example, --logcat=PHYSICS:NETWORK:TERRAIN + will only log messages in those three categories, while + --logcat=ALL:-NETWORK will log all categories _except_ NETWORK. + + * Replaced the --slog parameter with --logpri, which overrides the + logging priority for both simdata and cspsim. Accepts either + numeric values (e.g. 5) or symbolic names (e.g. "INFO"). + 2004-07-07: onsight * More network code reformatting and redirecting messages from stdout to the csp log. Changed logging class to NETWORK. |
From: <sv...@ww...> - 2004-07-09 06:28:32
|
Author: mkrose Date: 2004-07-08 23:28:26 -0700 (Thu, 08 Jul 2004) New Revision: 1152 Modified: trunk/CSP/CSPSim/Include/Log.h trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Log.h trunk/CSP/SimData/Include/SimData/LogStream.h trunk/CSP/SimData/Include/SimData/ThreadLog.h trunk/CSP/SimData/Source/LogStream.cpp trunk/CSP/SimData/Source/Makefile Log: Simplify the logging classes considerably, and tweak the logging macros to skip the output stream formating for messages that aren't logged (due to low priority or category filtering). Previously, all messages were formatted and sent either to the real log, or dropped (one character at a time) by the underlying streambuf. When debugging is disabled, the log statements now reduce to a form that produces no code but should prevent spurious compiler warnings about unused variables (for local variables that are only referenced in the log output). Changed the makefile to always rebuild Version.cpp, so the 'build on [date]' message will be accurate. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1152 Diff omitted (14539 bytes). |
From: <sv...@ww...> - 2004-07-08 06:51:37
|
Author: mkrose Date: 2004-07-07 23:51:23 -0700 (Wed, 07 Jul 2004) New Revision: 1151 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/Log.h trunk/CSP/CSPSim/Include/SimNet/Networking.h trunk/CSP/CSPSim/Source/CSPSim.cpp trunk/CSP/CSPSim/Source/Console.cpp trunk/CSP/CSPSim/Source/SimNet/DispatchMessageHandler.cpp trunk/CSP/CSPSim/Source/SimNet/EchoMessageHandler.cpp trunk/CSP/CSPSim/Source/SimNet/MessageSocketDuplex.cpp trunk/CSP/CSPSim/Source/SimNet/NetworkAddress.cpp trunk/CSP/CSPSim/Source/SimNet/NetworkBroadcaster.cpp trunk/CSP/CSPSim/Source/SimNet/NetworkListener.cpp trunk/CSP/CSPSim/Source/SimNet/NetworkMessage.cpp trunk/CSP/CSPSim/Source/SimNet/NetworkMessenger.cpp trunk/CSP/CSPSim/Source/SimNet/NetworkNode.cpp trunk/CSP/CSPSim/Source/SimNet/NetworkSocket.cpp trunk/CSP/CSPSim/Source/SimNet/ObjectUpdateMessage.cpp trunk/CSP/CSPSim/Source/SimNet/PrintMessageHandler.cpp trunk/CSP/CSPSim/Source/SimNet/RedirectMessageHandler.cpp trunk/CSP/CSPSim/Source/Sky.cpp trunk/CSP/CSPSim/Source/SynchronousUpdate.cpp Log: More network code reformatting and redirecting messages from stdout to the csp log. Changed logging class to NETWORK. Changed a few other cout's to use the csp log, and set the osg logging level to WARN (no easy way to redirect it). stdout is fairly quiet now. Fixed a compiler warning in Console.cpp Fixed a few copyright notices Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1151 Diff omitted (61250 bytes). |