|
From: <mk...@us...> - 2003-06-26 09:26:25
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Bin
In directory sc8-pr-cvs1:/tmp/cvs-serv10855
Modified Files:
CSPSim.py TestObjects.py
Log Message:
Index: CSPSim.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/CSPSim.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** CSPSim.py 4 May 2003 11:29:40 -0000 1.4
--- CSPSim.py 26 Jun 2003 09:26:21 -0000 1.5
***************
*** 22,28 ****
--- 22,40 ----
print " --compile-data run the data compiler"
print " --config=path path to config (.ini) file"
+ print " --log=classes set the logging classes"
print " --help help message"
+ def setLogClasses():
+ if len(log_classes) == 0: return
+ flags = 0
+ for class_name in log_classes:
+ try:
+ class_flag = getattr(CSP, "CSP_"+class_name);
+ flags = flags | class_flag
+ except:
+ print "Unrecognized log class:", class_name
+ CSP.csplog().setLogClasses(flags)
+
def runCSPSim(args):
if len(args):
***************
*** 40,43 ****
--- 52,56 ----
import Shell
app = CSP.CSPSim()
+ setLogClasses()
app.init()
***************
*** 60,63 ****
--- 73,77 ----
dar = os.path.join(datapath, "sim.dar")
XML = os.path.join(datapath, "XML")
+ CSP.csplog().setLogLevels(CSP.CSP_ALL, SimData.LOG_ALERT)
#print "compile %s %s" % (XML, dar)
try:
***************
*** 96,99 ****
--- 110,114 ----
program = sys.argv[0]
all_args = sys.argv[1:]
+ log_classes = []
other_args = []
***************
*** 111,114 ****
--- 126,131 ----
elif arg.startswith("--config="):
config = arg[9:]
+ elif arg.startswith("--log="):
+ log_classes.extend(arg[6:].split(':'))
else:
other_args.append(arg)
Index: TestObjects.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/TestObjects.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestObjects.py 18 Apr 2003 12:07:00 -0000 1.1
--- TestObjects.py 26 Jun 2003 09:26:21 -0000 1.2
***************
*** 4,11 ****
def create(app):
v = SimData.Vector3
vehicle = app.createVehicle
! vehicle("sim:vehicles.aircraft.m2k", v(483010, 499010, 190.2), v(0, 100.0, 0), v(2.0, 2.0, 140.0))
! vehicle("sim:vehicles.aircraft.m2k", v(483025, 499015, 190.2), v(0, 100.0, 0), v(5.0, 0.0, 240.0))
! vehicle("sim:vehicles.aircraft.m2k", v(483040, 499020, 190.2), v(0, 100.0, 0), v(8.0, 1.0, 240.0))
! vehicle("sim:vehicles.aircraft.m2k", v(483055, 499025, 190.2), v(0, 100.0, 0), v(12.0, 3.0, 240.0))
--- 4,25 ----
def create(app):
v = SimData.Vector3
+ m = SimData.LLA()
vehicle = app.createVehicle
! # vehicle("sim:vehicles.aircraft.m2k", v(10, 10, 1000.2), v(0, 100.0, 0), v(2.0, 2.0, 140.0))
!
! # vehicle("sim:vehicles.aircraft.m2k", v(483010, 499010, 190.2), v(0, 100.0, 0), v(2.0, 2.0, 140.0))
! # vehicle("sim:vehicles.aircraft.m2k", v(483025, 499015, 190.2), v(0, 100.0, 0), v(5.0, 0.0, 240.0))
! # vehicle("sim:vehicles.aircraft.m2k", v(483040, 499020, 190.2), v(0, 100.0, 0), v(8.0, 1.0, 240.0))
! # vehicle("sim:vehicles.aircraft.m2k", v(483055, 499025, 190.2), v(0, 100.0, 0), v(12.0, 3.0, 240.0))
+
+ # m.setDegrees(37.5, -121.0, 600)
+ # vehicle("sim:vehicles.aircraft.m2k", m, v(0, 100.0, 0), v(2.0, 2.0, 2.0))
+
+ # m.setDegrees(37.6, -121.41, 2090)
+ # vehicle("sim:vehicles.aircraft.m2k", m, v(0, 100.0, 0), v(2.0, 2.0, 140.0))
+ # m.setDegrees(40.6, 14.42, 2090)
+ # vehicle("sim:vehicles.aircraft.m2k", m, v(0, 100.0, 0), v(2.0, 2.0, 140.0))
+ # m.setDegrees(42.6, 14.43, 2090)
+ # vehicle("sim:vehicles.aircraft.m2k", m, v(0, 100.0, 0), v(2.0, 2.0, 140.0))
+ #
|