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-12-18 10:50:41
|
Author: mkrose Date: 2004-12-18 02:50:33 -0800 (Sat, 18 Dec 2004) New Revision: 1403 Modified: trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/NetworkInterface.h Log: Some internal reshuffling/renaming methods and variables related to disconnected peers. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1403 Modified: trunk/CSP/SimNet/NetworkInterface.cpp =================================================================== --- trunk/CSP/SimNet/NetworkInterface.cpp 2004-12-18 10:41:09 UTC (rev 1402) +++ trunk/CSP/SimNet/NetworkInterface.cpp 2004-12-18 10:50:33 UTC (rev 1403) @@ -259,18 +259,13 @@ } bool NetworkInterface::handleDeadPeer(PeerInfo *peer) { - m_DeadPeerQueue.push_back(peer->getId()); - // if noone is cleaning the queue, do it for them. - if (m_DeadPeerQueue.size() > 100) { - m_DeadPeerQueue.pop_front(); - } return true; } PeerId NetworkInterface::nextDisconnectedPeerId() { - if (m_DeadPeerQueue.empty()) return 0; - PeerId next = m_DeadPeerQueue.front(); - m_DeadPeerQueue.pop_front(); + if (m_DisconnectedPeerQueue.empty()) return 0; + PeerId next = m_DisconnectedPeerQueue.front(); + m_DisconnectedPeerQueue.pop_front(); return next; } @@ -758,12 +753,20 @@ SIMNET_LOG(PEER, INFO, "remove peer " << id); PeerInfo *peer = getPeer(id); assert(peer && peer->isActive()); + notifyPeerDisconnect(id); ConnectionPoint point = peer->getNode().getConnectionPoint(); m_IpPeerMap.erase(point); peer->disable(); m_ActivePeers->removePeer(peer); } +void NetworkInterface::notifyPeerDisconnect(PeerId id) { + m_DisconnectedPeerQueue.push_back(id); + // if noone is cleaning the queue, do it for them. + if (m_DisconnectedPeerQueue.size() > 100) { + m_DisconnectedPeerQueue.pop_front(); + } +} void NetworkInterface::setServer(NetworkNode const &server_node, double incoming, double outgoing) { assert(m_Initialized && m_LocalId == 0); Modified: trunk/CSP/SimNet/NetworkInterface.h =================================================================== --- trunk/CSP/SimNet/NetworkInterface.h 2004-12-18 10:41:09 UTC (rev 1402) +++ trunk/CSP/SimNet/NetworkInterface.h 2004-12-18 10:50:33 UTC (rev 1403) @@ -222,8 +222,12 @@ */ bool handleDeadPeer(PeerInfo *peer); + /** Add a peer to the disconnected peer queue, accessible via nextDisconnectedPeerId(). + */ + void notifyPeerDisconnect(PeerId id); + // Queue of dead peers. See nextDisconnectedPeerId(). - std::deque<PeerId> m_DeadPeerQueue; + std::deque<PeerId> m_DisconnectedPeerQueue; /** Called by ActivePeerList to resend a reliable packet that has not been * confirmed by the destination host. @@ -378,9 +382,9 @@ PeerInfo const *getPeer(PeerId id) const; /** Returns true if one or more peers have disconnected, but have - * not yet been processed by nextDeadPeer. + * not yet been processed by nextDisconnectedPeer. */ - inline bool hasDisconnectedPeers() const { return !m_DeadPeerQueue.empty(); } + inline bool hasDisconnectedPeers() const { return !m_DisconnectedPeerQueue.empty(); } /** Get the id of the next peer that has disconnected, or zero if * no disconnection notifications are pending. This routine can |
From: <sv...@ww...> - 2004-12-18 10:41:15
|
Author: mkrose Date: 2004-12-18 02:41:09 -0800 (Sat, 18 Dec 2004) New Revision: 1402 Modified: trunk/CSP/SimNet/PeerInfo.cpp trunk/CSP/SimNet/PeerInfo.h Log: Lazily allocate the duplicate filter when a PeerInfo is first activated. The previous fixed buffer implementation was wasting about 32 meg (8kb times 4k PeerInfos). Also reduces the inactivity timeout to 15 sec (from 30). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1402 Modified: trunk/CSP/SimNet/PeerInfo.cpp =================================================================== --- trunk/CSP/SimNet/PeerInfo.cpp 2004-12-18 10:36:40 UTC (rev 1401) +++ trunk/CSP/SimNet/PeerInfo.cpp 2004-12-18 10:41:09 UTC (rev 1402) @@ -48,6 +48,7 @@ m_provisional(false), m_lifetime(0.0), m_next_confirmation_id(1000), + m_duplicate_filter(0), m_duplicate_filter_low(true), m_statmode_toggle(false), m_throttle_threshold(0), @@ -78,9 +79,15 @@ m_last_deactivation_time(0.0), m_socket(0) { - memset(m_duplicate_filter, 0, sizeof(m_duplicate_filter)); } +PeerInfo::~PeerInfo() { + if (m_duplicate_filter) { + delete[] m_duplicate_filter; + m_duplicate_filter = 0; + } +} + void PeerInfo::update(double dt, double scale_desired_rate_to_self) { // update time averages with stats from the latest cycle @@ -199,6 +206,10 @@ m_socket->connect(node.getAddress(), node.getPort()); m_total_peer_incoming_bandwidth = incoming; m_total_peer_outgoing_bandwidth = outgoing; + assert(!m_duplicate_filter); + m_duplicate_filter = new simdata::uint32[65536/32]; + assert(m_duplicate_filter); + memset(m_duplicate_filter, 0, 4*65536/32); m_active = true; } @@ -278,6 +289,8 @@ void PeerInfo::disable() { if (m_active) { m_last_deactivation_time = simdata::get_realtime(); + delete[] m_duplicate_filter; + m_duplicate_filter = 0; } m_active = false; if (m_socket.valid()) m_socket->disconnect(); @@ -332,7 +345,7 @@ ni->resend(packet); } bool remove = false; - if (peer->getDeadTime() > 30.0) { + if (peer->getDeadTime() > 15.0) { SIMNET_LOG(PEER, ALERT, "dead time expired for peer " << peer->getId() << " (" << peer->getDeadTime() << " s)"); if (ni->handleDeadPeer(peer)) remove = true; } Modified: trunk/CSP/SimNet/PeerInfo.h =================================================================== --- trunk/CSP/SimNet/PeerInfo.h 2004-12-18 10:36:40 UTC (rev 1401) +++ trunk/CSP/SimNet/PeerInfo.h 2004-12-18 10:41:09 UTC (rev 1402) @@ -73,7 +73,7 @@ ConfirmationId m_next_confirmation_id; - simdata::uint32 m_duplicate_filter[65536/32]; + simdata::uint32 *m_duplicate_filter; bool m_duplicate_filter_low; bool m_statmode_toggle; @@ -172,6 +172,7 @@ public: PeerInfo(); + ~PeerInfo(); /** Initialize the peer id. Can only be called once. */ |
From: <sv...@ww...> - 2004-12-18 10:36:49
|
Author: mkrose Date: 2004-12-18 02:36:40 -0800 (Sat, 18 Dec 2004) New Revision: 1401 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/DemeterTerrain.cpp Log: Check for CSPSim/Data/Terrain, and print clearer diagnostic information if it isn't found. Previously Demeter just segfaulted, and the last CSPSim.log entry mentioned the terrain. This is a fairly common case for new installs, since the terrain files must be downloaded separately. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1401 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-18 10:33:41 UTC (rev 1400) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-18 10:36:40 UTC (rev 1401) @@ -11,6 +11,11 @@ CSPSim.py calls cspinput to try to regenerate them from the examples in ../Tools/HID/Examples. + * Check for CSPSim/Data/Terrain, and print clearer diagnostic information + if it isn't found. Previously Demeter just segfaulted, and the last + CSPSim.log entry mentioned the terrain. This is a fairly common case + for new installs, since the terrain files must be downloaded separately. + 2004-12-17: delta * Updated FlightModel and m2k xml related files. Modified: trunk/CSP/CSPSim/Source/DemeterTerrain.cpp =================================================================== --- trunk/CSP/CSPSim/Source/DemeterTerrain.cpp 2004-12-18 10:33:41 UTC (rev 1400) +++ trunk/CSP/CSPSim/Source/DemeterTerrain.cpp 2004-12-18 10:36:40 UTC (rev 1401) @@ -25,6 +25,7 @@ #include "DemeterTerrain.h" #include "Config.h" +#include "Exception.h" #include <Demeter/Terrain.h> #include <Demeter/DemeterDrawable.h> @@ -32,6 +33,7 @@ #include <SimCore/Util/Log.h> #include <SimData/InterfaceRegistry.h> +#include <SimData/FileUtility.h> #include <osg/Geode> #include <osg/StateSet> @@ -56,7 +58,7 @@ */ DemeterTerrain::DemeterTerrain() { - CSP_LOG(TERRAIN, DEBUG, "DemeterTerrain::DemeterTerrain" ); + CSP_LOG(TERRAIN, DEBUG, "DemeterTerrain::DemeterTerrain"); m_TerrainLattice = NULL; m_Terrain = NULL; m_TerrainTextureFactory = NULL; @@ -66,11 +68,11 @@ m_PreloadTextures = true; m_TextureFactory = false; m_MaxTriangles = 50000; - + m_DetailTextureFile.setSource(""); m_TextureFile.setSource(""); m_ElevationFile.setSource(""); - + m_VertexSpacing = 1.0; m_VertexHeight = 1.0; m_Lattice = false; @@ -108,16 +110,18 @@ void DemeterTerrain::load() { if (m_Loaded) return; std::string terrain_path = getDataPath("TerrainPath"); - if (m_Lattice) - { + CSP_LOG(APP, INFO, "Using terrain path " << terrain_path); + if (!simdata::ospath::exists(terrain_path)) { + CSP_LOG(APP, ERROR, "Terrain path " << terrain_path << " not found"); + throw csp::DataError("Terrain path " + terrain_path + " not found"); + } + if (m_Lattice) { // create lattice Demeter::Settings::GetInstance()->SetMediaPath(terrain_path.c_str()); createTerrainLattice(); m_TerrainNode = createTerrainLatticeNode(m_TerrainLattice.get()); m_TerrainNode->setName("TerrainLatticeNode"); - } - else - { + } else { // create single terrain node Demeter::Settings::GetInstance()->SetMediaPath(terrain_path.c_str()); createTerrain(); @@ -126,13 +130,12 @@ } m_Loaded = true; } - + /** * Activate the terrain engine. */ -void DemeterTerrain::activate() -{ +void DemeterTerrain::activate() { if (!m_Active) { m_Active = true; load(); @@ -142,8 +145,7 @@ /** * Deactivate the terrain engine. */ -void DemeterTerrain::deactivate() -{ +void DemeterTerrain::deactivate() { if (m_Active) { m_Active = false; } @@ -210,14 +212,13 @@ } -int DemeterTerrain::createTerrain() -{ - CSP_LOG(TERRAIN, DEBUG, "DemeterTerrain::createTerrain() " ); +int DemeterTerrain::createTerrain() { + CSP_LOG(TERRAIN, DEBUG, "DemeterTerrain::createTerrain() "); updateDemeterSettings(); if (!m_TextureFactory) { if (m_DetailTextureFile.getSource() == "") { m_Terrain = new Demeter::Terrain(m_ElevationFile.getSource().c_str(),m_TextureFile.getSource().c_str(),NULL, - m_VertexSpacing,m_VertexHeight,m_MaxTriangles); + m_VertexSpacing,m_VertexHeight,m_MaxTriangles); } else { m_Terrain = new Demeter::Terrain(m_ElevationFile.getSource().c_str(),m_TextureFile.getSource().c_str(), m_DetailTextureFile.getSource().c_str(),m_VertexSpacing,m_VertexHeight,m_MaxTriangles); @@ -254,41 +255,39 @@ } -int DemeterTerrain::createTerrainLattice() -{ +int DemeterTerrain::createTerrainLattice() { + CSP_LOG(TERRAIN, DEBUG, "DemeterTerrain::createTerrainLattice()..."); - CSP_LOG(TERRAIN, DEBUG, "DemeterTerrain::createTerrainLattice()..." ); - //float detailThreshold = Config.GetFloat("TerraindetailThreshold"); - + updateDemeterSettings(); - + //char terrainTextureDetail[256]; // Config.GetString(terrainTextureDetail, "TerrainTextureDetail"); // if (m_DetailTextureFile == "") // { // m_TerrainLattice = new Demeter::TerrainLattice(m_LatticeBaseName.c_str(), -// m_LatticeElevExt.c_str(), m_LatticeTexExt.c_str(), +// m_LatticeElevExt.c_str(), m_LatticeTexExt.c_str(), // NULL, m_VertexSpacing, m_VertexHeight, m_MaxTriangles, // false, m_LatticeWidth, m_LatticeHeight); // } // else // { // m_TerrainLattice = new Demeter::TerrainLattice(m_LatticeBaseName.c_str(), -// m_LatticeElevExt.c_str(), m_LatticeTexExt.c_str(), +// m_LatticeElevExt.c_str(), m_LatticeTexExt.c_str(), // m_DetailTextureFile.c_str(), m_VertexSpacing, m_VertexHeight, m_MaxTriangles, // false, m_LatticeWidth, m_LatticeHeight); // // } - m_TerrainLattice = new Demeter::TerrainLattice(m_LatticeBaseName.c_str(), - m_LatticeElevExt.c_str(), /*m_LatticeTexExt.c_str() */ NULL, - m_DetailTextureFile.getSource().c_str(), m_VertexSpacing, m_VertexHeight, m_MaxTriangles, - //NULL, m_VertexSpacing, m_VertexHeight, m_MaxTriangles, - true, m_LatticeWidth, m_LatticeHeight); - + m_LatticeElevExt.c_str(), /*m_LatticeTexExt.c_str() */ NULL, + m_DetailTextureFile.getSource().c_str(), + m_VertexSpacing, m_VertexHeight, m_MaxTriangles, + //NULL, m_VertexSpacing, m_VertexHeight, m_MaxTriangles, + true, m_LatticeWidth, m_LatticeHeight); + // just to catch your attention ;-) it may be ok to just delete any // pre-existing terraintexturefactory. assert(!m_TerrainTextureFactory); @@ -297,12 +296,11 @@ m_TerrainLattice->SetTextureFactory(m_TerrainTextureFactory, 2, 2); m_TerrainLattice->SetDetailThreshold(m_DetailThreshold); - CSP_LOG(TERRAIN, DEBUG, "Terrain size: " << m_TerrainLattice->GetWidth() << "(" << m_Width << "), " << - m_TerrainLattice->GetHeight() << "(" << m_Height << ")"); + CSP_LOG(TERRAIN, DEBUG, "Terrain size: " << m_TerrainLattice->GetWidth() << "(" << m_Width << "), " << m_TerrainLattice->GetHeight() << "(" << m_Height << ")"); assert(m_TerrainLattice->GetWidth() == m_Width); assert(m_TerrainLattice->GetHeight() == m_Height); - - // XXX it appears to be critical that the camera position be setup correctly + + // XXX it appears to be critical that the camera position be setup correctly // here at the start. doing so afterward can result in very strange texture // anomalies in demeter. don't know why, but it is a problem in general // since we don't know exactly where the sim will start at this point! @@ -314,8 +312,7 @@ return 1; } -void DemeterTerrain::setCameraPosition(double x, double y, double z) -{ +void DemeterTerrain::setCameraPosition(double x, double y, double z) { if (m_TerrainLattice.valid()) { CSP_LOG(TERRAIN, DEBUG, "Terrain camera @ " << (m_Offset + simdata::Vector3(x,y,z))); m_TerrainLattice->SetCameraPosition(x+m_Offset.x(), y+m_Offset.y(), z+m_Offset.z()); @@ -323,10 +320,9 @@ } -osg::Node* DemeterTerrain::createTerrainLatticeNode(Demeter::TerrainLattice* pTerrainLattice) -{ - CSP_LOG(TERRAIN, INFO, "DemeterTerrain::createTerrainLatticeNode" ); - +osg::Node* DemeterTerrain::createTerrainLatticeNode(Demeter::TerrainLattice* pTerrainLattice) { + CSP_LOG(TERRAIN, INFO, "DemeterTerrain::createTerrainLatticeNode"); + Demeter::DemeterLatticeDrawable* pLatticeDrawable = NULL; osg::Geode* pGeode = NULL; @@ -347,14 +343,13 @@ catch(...) { CSP_LOG(TERRAIN, ERROR, "Caught Exception in DemeterTerrain::createTerrainLatticeNode"); } - - return pGeode; + + return pGeode; } -osg::Node* DemeterTerrain::createTerrainNode(Demeter::Terrain* pTerrain) -{ - CSP_LOG(TERRAIN, INFO, "DemeterTerrain::createTerrainNode" ); +osg::Node* DemeterTerrain::createTerrainNode(Demeter::Terrain* pTerrain) { + CSP_LOG(TERRAIN, INFO, "DemeterTerrain::createTerrainNode"); osg::Geode* pGeode = NULL; @@ -371,8 +366,7 @@ return pGeode; } -int DemeterTerrain::getTerrainPolygonsRendered() const -{ +int DemeterTerrain::getTerrainPolygonsRendered() const { if (m_TerrainLattice.valid()) { return m_TerrainLattice->GetLatticePolygonsRendered(); } else if (m_Terrain.valid()) { @@ -383,8 +377,7 @@ } -void DemeterTerrain::updateDemeterSettings() -{ +void DemeterTerrain::updateDemeterSettings() { std::string terrain_path = getDataPath("TerrainPath"); bool verbose = g_Config.getBool("Debug", "Demeter", false, true); Demeter::Settings::GetInstance()->SetMediaPath(terrain_path.c_str()); |
From: <sv...@ww...> - 2004-12-18 10:33:54
|
Author: mkrose Date: 2004-12-18 02:33:41 -0800 (Sat, 18 Dec 2004) New Revision: 1400 Modified: trunk/CSP/SimNet/NetworkNode.cpp trunk/CSP/SimNet/NetworkNode.h Log: Minor improvements to the NetworkNode api. Also provides stream output operators that are useful for logging. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1400 Modified: trunk/CSP/SimNet/NetworkNode.cpp =================================================================== --- trunk/CSP/SimNet/NetworkNode.cpp 2004-12-18 10:31:07 UTC (rev 1399) +++ trunk/CSP/SimNet/NetworkNode.cpp 2004-12-18 10:33:41 UTC (rev 1400) @@ -74,18 +74,10 @@ return m_addr; } -ost::tpport_t NetworkNode::getPort() const { - return m_port; -} - const char * NetworkNode::getHostname() const { return m_addr.getHostname(); } -simdata::uint32 NetworkNode::getIp() const { - return m_addr.getAddress().s_addr; -} - std::string NetworkNode::ipToString(simdata::uint32 addr) { std::ostringstream os; os << (addr & 0xff) << "." << ((addr >> 8) & 0xff) << "." << ((addr >> 16) & 0xff) << "." << (addr >> 24); Modified: trunk/CSP/SimNet/NetworkNode.h =================================================================== --- trunk/CSP/SimNet/NetworkNode.h 2004-12-18 10:31:07 UTC (rev 1399) +++ trunk/CSP/SimNet/NetworkNode.h 2004-12-18 10:33:41 UTC (rev 1400) @@ -100,7 +100,7 @@ /** Get the host receive port. */ - ost::tpport_t getPort() const; + inline ost::tpport_t getPort() const { return m_port; } /** Get the host ip address. */ @@ -109,23 +109,38 @@ /** Convert ip address and port to a ConnectionPoint. */ inline ConnectionPoint getConnectionPoint() const { - return ConnectionPoint(m_addr.getAddress().s_addr, m_port); + return ConnectionPoint(getIp(), getPort()); } /** Get the ip address as a 32-bit int, in network byte-order. */ - simdata::uint32 getIp() const; + inline simdata::uint32 getIp() const { + return m_addr.getAddress().s_addr; + } /** Get the host name. */ const char * getHostname() const; - /** Test if an ip address is unroutable (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). + /** Get ip address as a dotted-quad string. + */ + inline std::string getIpString() const { + return ipToString(getIp()); + } + + /** Return true if this ip is routable (ie, not 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). + */ + inline bool isRoutable() const { + return isRoutable(getIp()); + } + + /** Test if an ip address is routable (ie, not 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). * @param addr 32-bit ipv4 address in network byte-order. */ static bool isRoutable(simdata::uint32 addr) { return ((addr & 0xffff) != 43200) && // 192.168. 0. 0 - 192.168.255.255 ((addr & 0x00ff) != 10) && // 10. 0. 0. 0 - 10.255.255.255 + ((addr & 0x00ff) != 127) && // 127. 0. 0. 0 - 127.255.255.255 ((addr & 0xf0ff) != 4268); // 172. 16. 0. 0 - 172. 31.255.255 } @@ -136,6 +151,14 @@ }; +inline std::ostream &operator<<(std::ostream &os, NetworkNode const &node) { + return os << node.getIpString() << ':' << node.getPort() << " (" << node.getHostname() << ")"; +} + +inline std::ostream &operator<<(std::ostream &os, ConnectionPoint const &point) { + return os << NetworkNode(point); +} + } // namespace simnet #endif // __SIMNET_NETWORKNODE_H__ |
From: <sv...@ww...> - 2004-12-18 10:31:14
|
Author: mkrose Date: 2004-12-18 02:31:07 -0800 (Sat, 18 Dec 2004) New Revision: 1399 Modified: trunk/CSP/CSPSim/Bin/CSPSim.py trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Tools/HID/cspinput Log: Minor changes to the cspinput command line. Now takes -Ipath option to set the base include path, and -o to specify the output file (instead of using the 2nd non-flag argument). Added a check in CSPSim.py for aircraft.hid and gamescreen.hid in ../Data/Input. If not found, CSPSim.py calls cspinput to try to regenerate them from the examples in ../Tools/HID/Examples. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1399 Modified: trunk/CSP/CSPSim/Bin/CSPSim.py =================================================================== --- trunk/CSP/CSPSim/Bin/CSPSim.py 2004-12-18 10:19:27 UTC (rev 1398) +++ trunk/CSP/CSPSim/Bin/CSPSim.py 2004-12-18 10:31:07 UTC (rev 1399) @@ -50,6 +50,21 @@ os.environ["SDL_JOYSTICK_DEVICE"]="/dev/input/js0" +def ensureDefaultHID(hid_file): + """ + Verify that the specified hid input definition exists. If not, generate it from + from the example input maps in ../Tools/HID/Examples + """ + if not os.path.exists('../Data/Input'): return + output = '../Data/Input/%s.hid' % hid_file + if not os.path.exists(output): + os.system('../Tools/HID/cspinput -I../Tools/HID -o%s ../Tools/HID/Examples/%s.map' % (output, hid_file)) + if os.path.exists(output): + print 'Default input map created for %s.hid; see Tools/HID/README for details.' % hid_file + else: + print 'Unable to create default input map for %s.hid; see Tools/HID/README for details.' % hid_file + + def printUsage(): print "Combat Simulator Project - CSPSim" print @@ -64,8 +79,6 @@ 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" @@ -117,6 +130,9 @@ print "Static data archive '%s' not found." % dar compileData([]) + ensureDefaultHID('aircraft') + ensureDefaultHID('gamescreen') + import Shell app = cCSP.CSPSim() @@ -188,23 +204,6 @@ print -def runClientNode(args): - print "CSPSim.py - runClientNode - Starting Test Client Node..." - print "CSPSim.py - runClientNode - calling loadCSP" - loadCSP() - print "CSPSim.py - runClientNode - calling CSP.ClientNode" - app = cCSP.ClientNode() - print "CSPSim.py - runClientNode - calling app.run" - app.run() - - -def runEchoServerNode(args): - print "Starting Test Echo Server Node..." - loadCSP() - app = cCSP.EchoServerNode() - app.run() - - def loadSimData(): """Load the SimData module""" global SimData @@ -310,10 +309,6 @@ elif arg.startswith('--dump-data='): action = dumpData other_args.append(arg) - elif arg == '--client-node': - action = runClientNode - elif arg == '--echo-server-node': - action = runEchoServerNode elif arg == '--pause': pause = 1 elif arg in ("--help", "-h", "-help"): @@ -336,7 +331,6 @@ if action is None: action = runCSPSim - loadSimData() if log_priority_arg is not None: Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-18 10:19:27 UTC (rev 1398) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-18 10:31:07 UTC (rev 1399) @@ -4,6 +4,13 @@ * Add a message box to the onscreen display that displays/scrolls several lines of text, and fades out when unchanged for several seconds. + * Minor changes to the cspinput command line. Now takes -Ipath option to + set the base include path, and -o to specify the output file (instead + of using the 2nd non-flag argument). Added a check in CSPSim.py for + aircraft.hid and gamescreen.hid in ../Data/Input. If not found, + CSPSim.py calls cspinput to try to regenerate them from the examples + in ../Tools/HID/Examples. + 2004-12-17: delta * Updated FlightModel and m2k xml related files. Modified: trunk/CSP/CSPSim/Tools/HID/cspinput =================================================================== --- trunk/CSP/CSPSim/Tools/HID/cspinput 2004-12-18 10:19:27 UTC (rev 1398) +++ trunk/CSP/CSPSim/Tools/HID/cspinput 2004-12-18 10:31:07 UTC (rev 1399) @@ -1,29 +1,35 @@ #!/usr/bin/env python # Combat Simulator Project - MAP2HID input script compiler -# 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 # 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. -## @author Mark Rose <tm...@st...> +## @author Mark Rose <mk...@us...> +""" +Combat Simulator Project Input Map Compiler +usage: %(prog)s [flags] infile +""" + import sys import os.path +from CSP.base import app KMODS = { @@ -168,7 +174,7 @@ class VirtualDeviceDefinition: - def __init__(self): + def __init__(self, include_path='.'): self.included = {} self.values = {} self.scripts = {} @@ -177,13 +183,16 @@ self.definitions = {} self.devices = {} self.filestack = [] - self.pathstack = ['.'] + self.pathstack = [include_path] self.line = 0 self.file = "" self.bind = {} def read(self, fn): - f = open(fn, 'rt') + if fn == '-': + f = sys.stdin + else: + f = open(fn, 'rt') if f is not None: self.file = fn self.parse(f) @@ -475,40 +484,17 @@ self.mode = 0 self.mapping = {} -def usage(program): - print "CSP 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(args): + mapfile = None -def main(argv): - file = None - outfile = None + if len(args) != 1: + app.usage() + return 1 - 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) + mapfile = args[0] - if file is None: - usage(argv[0]) - sys.exit(1) - - if outfile is None and file.endswith('.map'): - outfile = file[:-4] + '.hid' - - outf = None + outfile = app.options.output_file if outfile == '-': outf = sys.stdout else: @@ -516,15 +502,17 @@ outf = open(outfile, "wt") except: print "Unable to write to '%s'." % outfile - sys.exit(1) - - v = VirtualDeviceDefinition() + return 1 + v = VirtualDeviceDefinition(include_path=app.options.include_path) + try: - v.read(file) + v.read(mapfile) + except KeyboardInterrupt: + return 0 except Error, e: print e.msg - sys.exit(1) + return 1 bindings = v.bind.keys() bindings.sort() @@ -533,7 +521,10 @@ for m in v.maps: m.write(outf) + return 0 -if __name__ == "__main__": - main(sys.argv) +app.addOption('-I', '--include_path', metavar='PATH', default='.', help='default include path') +app.addOption('-o', '--output_file', metavar='FILE', default='-', help='output file (default stdout)') +app.start() + |
From: <sv...@ww...> - 2004-12-18 10:19:43
|
Author: mkrose Date: 2004-12-18 02:19:27 -0800 (Sat, 18 Dec 2004) New Revision: 1398 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/ScreenInfo.h trunk/CSP/CSPSim/Include/ScreenInfoManager.h trunk/CSP/CSPSim/Source/ScreenInfo.cpp trunk/CSP/CSPSim/Source/ScreenInfoManager.cpp Log: Add a message box to the onscreen display that displays/scrolls several lines of text, and fades out when unchanged for several seconds. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1398 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-18 10:14:34 UTC (rev 1397) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-18 10:19:27 UTC (rev 1398) @@ -1,22 +1,26 @@ Version 0.4.0 (in progress) =========================== +2004-12-17: onsight + * Add a message box to the onscreen display that displays/scrolls several + lines of text, and fades out when unchanged for several seconds. + 2004-12-17: delta * Updated FlightModel and m2k xml related files. - + ==> ALL USERS: run RebuildData.py. - + 2004-12-17: Lologramme * Add hangar - + 2004-12-16: Lologramme * add control tower - + 2004-12-15: delta * Lologramme checked in the runway for a new airbase. - + * Added a new version of balkanMapElev.7-7.bmp to be used with this new airbase (Data/Images). - + * Moved the aircraft to be on the runway at start up. 2004-12-15: onsight @@ -33,20 +37,20 @@ * Rename the runway model file to all lowercase (wasn't found under linux). ==> Run ComplileData.py after updating to pick up the changes. - + 2004-12-14: onsight * Minor fix for the engine cutoff function under linux. - + 2004-12-13: Lologramme * Replace Runway by New runway with taxi and roads - + 2004-12-14: delta * Minor anti-warnings changes in SimCore/Battlefield/LocalBattlefield.cpp. - + * Slighty flatten the joystick inputs. * Other minor changes. - + 2004-12-13: delta * Updated Data/XML/vehicles/aircraft/m2k/thrust.xml with more accurate m2k data. Modified: trunk/CSP/CSPSim/Include/ScreenInfo.h =================================================================== --- trunk/CSP/CSPSim/Include/ScreenInfo.h 2004-12-18 10:14:34 UTC (rev 1397) +++ trunk/CSP/CSPSim/Include/ScreenInfo.h 2004-12-18 10:19:27 UTC (rev 1398) @@ -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. @@ -36,7 +36,7 @@ class DynamicObject; -class ScreenInfo: public osg::Geode +class ScreenInfo: public osg::Geode { protected: std::string m_TTFPath; @@ -53,7 +53,7 @@ }; -class Framerate: public ScreenInfo +class Framerate: public ScreenInfo { float m_MinFps, m_MaxFps, m_Cumul; osgText::Text* m_Date; @@ -65,7 +65,7 @@ }; -class GeneralStats: public ScreenInfo +class GeneralStats: public ScreenInfo { osgText::Text* m_Altitude; osgText::Text* m_GlobalPosition; @@ -78,7 +78,7 @@ }; -class ObjectStats: public ScreenInfo +class ObjectStats: public ScreenInfo { // input device informations std::vector<osg::ref_ptr<osgText::Text> > m_ObjectStats; @@ -93,6 +93,20 @@ }; +class MessageBox: public ScreenInfo +{ + std::vector<osg::ref_ptr<osgText::Text> > m_Messages; + int m_Lines; + float m_Delay; + float m_Alpha; + double m_LastUpdate; +protected: + ~MessageBox(){} +public: + MessageBox(int posx, int posy, int lines, float delay); + void addLine(std::string const &line); + virtual void update(); +}; #endif // __SCREENINFO_H__ Modified: trunk/CSP/CSPSim/Include/ScreenInfoManager.h =================================================================== --- trunk/CSP/CSPSim/Include/ScreenInfoManager.h 2004-12-18 10:14:34 UTC (rev 1397) +++ trunk/CSP/CSPSim/Include/ScreenInfoManager.h 2004-12-18 10:19:27 UTC (rev 1398) @@ -37,6 +37,7 @@ void setStatus(std::string const & name, bool bvisible); bool getStatus(std::string const & name); void changeObjectStats(int ScreenWidth, int ScreenHeight,simdata::Ref<DynamicObject> const& activeObject); + void addMessage(std::string const &line); private: osg::MatrixTransform* m_modelview_abs; ScreenInfo* getScreenInfo(std::string const & name); Modified: trunk/CSP/CSPSim/Source/ScreenInfo.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ScreenInfo.cpp 2004-12-18 10:14:34 UTC (rev 1397) +++ trunk/CSP/CSPSim/Source/ScreenInfo.cpp 2004-12-18 10:19:27 UTC (rev 1398) @@ -33,8 +33,11 @@ #include <sstream> #include <osg/Texture2D> +#include <osg/StateSet> #include <osgText/Text> +#include <SimData/Timing.h> + using std::max; using std::min; using std::setprecision; @@ -226,3 +229,48 @@ } } +MessageBox::MessageBox(int posx, int posy, int lines, float delay) + : ScreenInfo(posx, posy, "MESSAGE BOX"), m_Lines(lines), m_Delay(delay), m_Alpha(1.0), m_LastUpdate(0) +{ + if (m_Text) { + removeDrawable(m_Text); + } + int stepy = static_cast<int>(m_CharacterSize); + for (int i = 0; i < lines; ++i) { + osg::ref_ptr<osgText::Text> line = makeText(posx, posy - i * stepy); + m_Messages.push_back(line); + addDrawable(line.get()); + } + if (!getUpdateCallback()) { + setUpdateCallback(new UpdateCallback); + } +} + +void MessageBox::addLine(std::string const &line) { + m_LastUpdate = simdata::get_realtime(); + for (int i = m_Lines-1; i > 0; --i) { + m_Messages[i]->setText(m_Messages[i-1]->getText()); + } + if (m_Lines > 0) { + m_Messages[0]->setText(line); + } +} + +void MessageBox::update() { + double now = simdata::get_realtime(); + float dt = static_cast<float>(now - m_LastUpdate); + float old_alpha = m_Alpha; + if (dt > m_Delay) { + m_Alpha = std::max<float>(0, 1.0 - (dt - m_Delay)); + } else { + m_Alpha = 1.0; + } + if (m_Alpha != old_alpha) { + for (int i = 0; i < m_Lines; ++i) { + m_Messages[i]->setColor(osg::Vec4(1, 1, 1, m_Alpha)); + if (m_Alpha == 0.0) { + m_Messages[i]->setText(""); + } + } + } +} Modified: trunk/CSP/CSPSim/Source/ScreenInfoManager.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ScreenInfoManager.cpp 2004-12-18 10:14:34 UTC (rev 1397) +++ trunk/CSP/CSPSim/Source/ScreenInfoManager.cpp 2004-12-18 10:19:27 UTC (rev 1398) @@ -36,11 +36,13 @@ osg::ref_ptr<ScreenInfo> pause = new ScreenInfo(ScreenWidth-5*offsetpos,ScreenHeight-offsetpos,"PAUSE", "PAUSE"); osg::ref_ptr<ScreenInfo> record = new ScreenInfo(ScreenWidth-15*offsetpos,ScreenHeight-offsetpos,"RECORD", "RECORD"); osg::ref_ptr<GeneralStats> generalStats = new GeneralStats(offsetpos, ScreenHeight / 5); + osg::ref_ptr<MessageBox> messageBox = new MessageBox(offsetpos, ScreenHeight / 2, 4, 4.0); rootNode->addChild(framerate.get()); rootNode->addChild(pause.get()); rootNode->addChild(record.get()); rootNode->addChild(generalStats.get()); + rootNode->addChild(messageBox.get()); osg::StateSet *rootState = rootNode->getOrCreateStateSet(); rootState->setMode(GL_LIGHTING,osg::StateAttribute::OFF); @@ -129,3 +131,10 @@ } } +void ScreenInfoManager::addMessage(std::string const &line) +{ + MessageBox *mbox = dynamic_cast<MessageBox*>(getScreenInfo("MESSAGE BOX")); + if (mbox) { + mbox->addLine(line); + } +} |
From: <sv...@ww...> - 2004-12-18 10:14:41
|
Author: mkrose Date: 2004-12-18 02:14:34 -0800 (Sat, 18 Dec 2004) New Revision: 1397 Added: trunk/CSP/SimCore/Util/Callback.h trunk/CSP/SimCore/Util/CallbackDecl.h Log: Add sigc callback wrappers for safely binding to methods in classes that do not subclass sigc::object. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1397 Added: trunk/CSP/SimCore/Util/Callback.h =================================================================== --- trunk/CSP/SimCore/Util/Callback.h 2004-12-18 10:08:48 UTC (rev 1396) +++ trunk/CSP/SimCore/Util/Callback.h 2004-12-18 10:14:34 UTC (rev 1397) @@ -0,0 +1,160 @@ +// Combat Simulator Project - CSPSim +// Copyright (C) 2004 The Combat Simulator Project +// http://csp.sourceforge.net +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +/** + * @file Callback.h + * @brief Provides an adaptor for sigc++-1.2 member function slots. + * + * The adaptors do not require the target class to subclass SigC::Object, + * but are equally safe (unlike SigC::slot_class). Automatic disconnect + * is handled by making the callbacks instance variables, so they are + * destroyed (and thereby disconnect) at the same time the target object + * is destroyed. + * + * At present the signal and callback classes only support slots with no + * return value and a limited number of arguements. + * + * Sample use: + * + * @code + * + * class Target { + * void bar(double); + * Callback1<double> _barHandler; + * public: + * Target(): barHandler(this, &Bar::bar) { } + * Callback1<double>& barHandler() { return _barHandler; } + * }; + * + * void Source { + * Signal1<double> _barSignal; + * void signalBar(double x) { _barSignal.emit(x); } + * public: + * Signal1<double>& barSignal() { return _barSignal; } + * }; + * + * Source source; + * Target target; + * source.barSignal().connect(target.barHandler()); + * + * @endcode + * + **/ + + +#ifndef __SIMCORE_UTIL_CALLBACK_H__ +#define __SIMCORE_UTIL_CALLBACK_H__ + +#include <SimCore/Util/CallbackDecl.h> +#include <sigc++/sigc++.h> + +namespace simcore { + + +// Callbacks -------------------------------------------------------------------------- + +template <class C> +class _CallbackAdaptor0: public SigC::Object { + typedef void (C::*Method)(); + C *_instance; + Method _method; +public: + inline void bounce() { (_instance->*_method)(); } + _CallbackAdaptor0(C *instance, Method method) : _instance(instance), _method(method) { } +}; + +class Callback0: private simdata::ScopedPointer<SigC::Object>, public SigC::Slot0<void> { +public: + template <class C> + Callback0(C *instance, void (C::*method)()) : + simdata::ScopedPointer<SigC::Object>(new _CallbackAdaptor0<C>(instance, method)), + SigC::Slot0<void>(SigC::slot(*dynamic_cast<_CallbackAdaptor0<C>*>(get()), &_CallbackAdaptor0<C>::bounce)) { } +}; + +template <class C, typename M> +class _CallbackAdaptor1: public SigC::Object { + typedef void (C::*Method)(M); + C *_instance; + Method _method; +public: + inline void bounce(M m) { (_instance->*_method)(m); } + _CallbackAdaptor1(C *instance, Method method) : _instance(instance), _method(method) { } +}; + +template <typename M> +class Callback1: private simdata::ScopedPointer<SigC::Object>, public SigC::Slot1<void, M> { +public: + template <class C> + Callback1(C *instance, void (C::*method)(M)) : + simdata::ScopedPointer<SigC::Object>(new _CallbackAdaptor1<C, M>(instance, method)), + SigC::Slot1<void, M>(SigC::slot(*dynamic_cast<_CallbackAdaptor1<C, M>*>(get()), &_CallbackAdaptor1<C, M>::bounce)) { } +}; + +template <class C, typename M, typename N> +class _CallbackAdaptor2: public SigC::Object { + typedef void (C::*Method)(M, N); + C *_instance; + Method _method; +public: + inline void bounce(M m, N n) { (_instance->*_method)(m, n); } + _CallbackAdaptor2(C *instance, Method method) : _instance(instance), _method(method) { } +}; + +template <typename M, typename N> +class Callback2: private simdata::ScopedPointer<SigC::Object>, public SigC::Slot2<void, M, N> { +public: + template <class C> + Callback2(C *instance, void (C::*method)(M, N)) : + simdata::ScopedPointer<SigC::Object>(new _CallbackAdaptor2<C, M, N>(instance, method)), + SigC::Slot2<void, M, N>(SigC::slot(*dynamic_cast<_CallbackAdaptor2<C, M, N>*>(get()), &_CallbackAdaptor2<C, M, N>::bounce)) { } +}; + + +// Signals ---------------------------------------------------------------------------- + +class Signal0: public SigC::Signal0<void> { }; + +template <typename M> +class Signal1: public SigC::Signal1<void, M> { }; + +template <typename M, typename N> +class Signal2: public SigC::Signal2<void, M, N> { }; + + +// ScopedPointer Callbacks ----------------------------------------------------------- + +template <class C> +ScopedCallback0::ScopedCallback0(C *instance, void (C::*method)()) + : simdata::ScopedPointer<Callback0>(new Callback0(instance, method)) { } + +template <typename M> +template <class C> +ScopedCallback1<M>::ScopedCallback1<M>(C *instance, void (C::*method)(M)) + : simdata::ScopedPointer<Callback1<M> >(new Callback1<M>(instance, method)) { } + +template <typename M, typename N> +template <class C> +ScopedCallback2<M, N>::ScopedCallback2<M, N>(C *instance, void (C::*method)(M, N)) + : simdata::ScopedPointer<Callback2<M, N> >(new Callback2<M, N>(instance, method)) { } + + +} // namespace simcore + +#endif // __SIMCORE_UTIL_CALLBACK_H__ + Added: trunk/CSP/SimCore/Util/CallbackDecl.h =================================================================== --- trunk/CSP/SimCore/Util/CallbackDecl.h 2004-12-18 10:08:48 UTC (rev 1396) +++ trunk/CSP/SimCore/Util/CallbackDecl.h 2004-12-18 10:14:34 UTC (rev 1397) @@ -0,0 +1,59 @@ +// Combat Simulator Project - CSPSim +// Copyright (C) 2004 The Combat Simulator Project +// http://csp.sourceforge.net +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +/** + * @file CallbackDecl.h + * @brief Forward declarations for callback and signal templates. + * + **/ + + +#ifndef __SIMCORE_UTIL_CALLBACKDECL_H__ +#define __SIMCORE_UTIL_CALLBACKDECL_H__ + +#include <SimData/ScopedPointer.h> + +namespace simcore { + +class Callback0; +template <typename M> class Callback1; +template <typename M, typename N> class Callback2; + +class Signal0; +template <typename M> class Signal1; +template <typename M, typename N> class Signal2; + +struct ScopedCallback0: public simdata::ScopedPointer<Callback0> { + template <class C> ScopedCallback0(C *instance, void (C::*method)()); +}; + +template <typename M> +struct ScopedCallback1: public simdata::ScopedPointer<Callback1<M> > { + template <class C> ScopedCallback1(C *instance, void (C::*method)(M)); +}; + +template <typename M, typename N> +struct ScopedCallback2: public simdata::ScopedPointer<Callback2<M, N> > { + template <class C> ScopedCallback2(C *instance, void (C::*method)(M, N)); +}; + +} // namespace simcore + +#endif // __SIMCORE_UTIL_CALLBACKDECL_H__ + |
From: <sv...@ww...> - 2004-12-18 10:08:54
|
Author: mkrose Date: 2004-12-18 02:08:48 -0800 (Sat, 18 Dec 2004) New Revision: 1396 Modified: trunk/CSP/SimData/Source/FileUtility.cpp Log: Fix a bug in simdata::ospath::exists(). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1396 Modified: trunk/CSP/SimData/Source/FileUtility.cpp =================================================================== --- trunk/CSP/SimData/Source/FileUtility.cpp 2004-12-17 23:05:00 UTC (rev 1395) +++ trunk/CSP/SimData/Source/FileUtility.cpp 2004-12-18 10:08:48 UTC (rev 1396) @@ -198,7 +198,7 @@ #else // POSIX (hopefully) static const int mode = F_OK; #endif - return access(path.c_str(), mode) != 0; + return access(path.c_str(), mode) == 0; } ospath::DirectoryContents ospath::getDirectoryContents(std::string const &path) { |
From: <sv...@ww...> - 2004-12-17 23:05:06
|
Author: delta Date: 2004-12-17 15:05:00 -0800 (Fri, 17 Dec 2004) New Revision: 1395 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/fm.xml trunk/CSP/CSPSim/Include/FlightModel.h trunk/CSP/CSPSim/Source/AircraftPhysicsModel.cpp trunk/CSP/CSPSim/Source/FlightModel.cpp Log: * Updated FlightModel and m2k xml related files. ==> ALL USERS: run RebuildData.py. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1395 Diff omitted (16752 bytes). |
From: <sv...@ww...> - 2004-12-17 22:07:42
|
Author: lologramme Date: 2004-12-17 14:07:35 -0800 (Fri, 17 Dec 2004) New Revision: 1394 Added: trunk/CSP/CSPSim/Data/Models/hangar02/ trunk/CSP/CSPSim/Data/Models/hangar02/hang2-1.jpg trunk/CSP/CSPSim/Data/Models/hangar02/hang2-2.jpg trunk/CSP/CSPSim/Data/Models/hangar02/hangar02.3ds trunk/CSP/CSPSim/Data/Models/hangar02/tole.jpeg trunk/CSP/CSPSim/Data/XML/theater/balkan/hangar2.xml trunk/CSP/CSPSim/Data/XML/theater/balkan/hangar2/ trunk/CSP/CSPSim/Data/XML/theater/balkan/hangar2/model.xml Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/theater/balkan/airbase.xml Log: Add hangar Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1394 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-17 04:16:26 UTC (rev 1393) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-17 22:07:35 UTC (rev 1394) @@ -1,5 +1,8 @@ Version 0.4.0 (in progress) =========================== +2004-12-17: Lologramme + * Add hangar + 2004-12-16: Lologramme * add control tower Added: trunk/CSP/CSPSim/Data/Models/hangar02/hang2-1.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Models/hangar02/hang2-1.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Models/hangar02/hang2-2.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Models/hangar02/hang2-2.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Models/hangar02/hangar02.3ds =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Models/hangar02/hangar02.3ds ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Models/hangar02/tole.jpeg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Models/hangar02/tole.jpeg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/CSP/CSPSim/Data/XML/theater/balkan/airbase.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/theater/balkan/airbase.xml 2004-12-17 04:16:26 UTC (rev 1393) +++ trunk/CSP/CSPSim/Data/XML/theater/balkan/airbase.xml 2004-12-17 22:07:35 UTC (rev 1394) @@ -14,5 +14,11 @@ <Float name="y">-30</Float> <Float name="orientation">1.57</Float> </Object> + <Object class="FeatureLayout"> + <Path name="model">hangar2</Path> + <Float name="x">421</Float> + <Float name="y">-300</Float> + <Float name="orientation">-1.57</Float> + </Object> </List> </Object> Added: trunk/CSP/CSPSim/Data/XML/theater/balkan/hangar2/model.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/theater/balkan/hangar2/model.xml 2004-12-17 04:16:26 UTC (rev 1393) +++ trunk/CSP/CSPSim/Data/XML/theater/balkan/hangar2/model.xml 2004-12-17 22:07:35 UTC (rev 1394) @@ -0,0 +1,17 @@ +<?xml version="1.0" standalone="no"?> + +<Object class="ObjectModel"> + <External name="model_path">hangar02/hangar02.3ds</External> + <Vector name="axis_0">1 0 0</Vector> + <Vector name="axis_1">0 1.0 0.0</Vector> + <Vector name="offset">0 0 0.0</Vector> + <Float name="polygon_offset">-1</Float> + <Bool name="lighting">true</Bool> + <!--Int name="cull_face">1</Int--> + <Float name="scale">1.0</Float> + <!--List name="contacts"> + <Vector>0.0 0.0 0.0</Vector> + </List--> + <Bool name="smooth">true</Bool> + <Bool name="filter">true</Bool> +</Object> Added: trunk/CSP/CSPSim/Data/XML/theater/balkan/hangar2.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/theater/balkan/hangar2.xml 2004-12-17 04:16:26 UTC (rev 1393) +++ trunk/CSP/CSPSim/Data/XML/theater/balkan/hangar2.xml 2004-12-17 22:07:35 UTC (rev 1394) @@ -0,0 +1,6 @@ +<?xml version="1.0" standalone="no"?> + +<Object class="FeatureObjectModel"> + <Path name="model">hangar2.model</Path> + <Int name="hit_points">20</Int> +</Object> |
From: <sv...@ww...> - 2004-12-17 04:16:34
|
Author: mkrose Date: 2004-12-16 20:16:26 -0800 (Thu, 16 Dec 2004) New Revision: 1393 Added: trunk/CSP/CSPSim/Data/Models/tower1/tower1.3ds Removed: trunk/CSP/CSPSim/Data/Models/tower1/tower1.3DS Log: Rename tower model file to lowercase. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1393 Deleted: trunk/CSP/CSPSim/Data/Models/tower1/tower1.3DS =================================================================== (Binary files differ) Copied: trunk/CSP/CSPSim/Data/Models/tower1/tower1.3ds (from rev 1392, trunk/CSP/CSPSim/Data/Models/tower1/tower1.3DS) |
From: <sv...@ww...> - 2004-12-16 19:29:43
|
Author: lologramme Date: 2004-12-16 11:29:34 -0800 (Thu, 16 Dec 2004) New Revision: 1392 Added: trunk/CSP/CSPSim/Data/Models/tower1/ trunk/CSP/CSPSim/Data/Models/tower1/texture1.jpg trunk/CSP/CSPSim/Data/Models/tower1/tower1.3DS trunk/CSP/CSPSim/Data/XML/theater/balkan/tower1.xml trunk/CSP/CSPSim/Data/XML/theater/balkan/tower1/ trunk/CSP/CSPSim/Data/XML/theater/balkan/tower1/model.xml Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/theater/balkan/airbase.xml Log: Added control tower Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1392 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-16 06:43:41 UTC (rev 1391) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-16 19:29:34 UTC (rev 1392) @@ -1,6 +1,12 @@ Version 0.4.0 (in progress) =========================== +2004-12-16: Lologramme + * add control tower +2004-12-13: Lologramme + * Replace Runway by New runway with taxi and roads + +======= 2004-12-15: onsight * Fix m2k animations bound to different channels. An driven rotation animation can only use a single input channel. More complex animations, @@ -349,7 +355,7 @@ * Changed the linear look-up of animations in ModelProcessor into a std::multimap look-up. - * Changed the CullCallback from AnimationCallback into an + * Changed the CullCallback from AnimationCallback into an UpdateCallback to be threads safe w.r.t. the scenegraph. * Extended animation toolkit such that a node can be bound to @@ -377,67 +383,67 @@ * XML/vehicles/aircraft/m2k/model.xml has been patched to reflect a differential system on the Mirage 2000. The mirage 2000 model itself has been grantly improved by Lologramme. Furthermore, more - animation hooks are now present. + animation hooks are now present. Finally, Sony Tuckson improved the textures' set. - * Reenabled smoke effects but that will need more work in the near + * Reenabled smoke effects but that will need more work in the near future. - + * Added Images/Smoke. - + ==> All users: rebuild sim.dar - + 2004-07-28: delta - * Added an IsoContour class in RandomBillboardModel - describing the "boundary" of the region. Currently + * Added an IsoContour class in RandomBillboardModel + describing the "boundary" of the region. Currently supports circle and rectangle. - - * Added Images/Trees containing trees splat textures + + * Added Images/Trees containing trees splat textures and Images/Logo containing images for LogoScreen. Patched LogoScreen.cpp, Data/theater/balkan/airbase.xml and Data/theater/balkan/forest.xml to use this stuff. - + ==> All users: rebuild sim.dar 2004-07-27: delta * Added #undef ERROR in Log.h & System.h. - - * Moved AeroDynamics.cpp, base.cpp, main.cpp and trees.cpp + + * Moved AeroDynamics.cpp, base.cpp, main.cpp and trees.cpp to Source/old. - + * Small cleanup in CameraAgent. Simplified CameraCommand. - - * Added a balkan dir under CSPSim/Data/XML/theater. - CSPSim/Data/XML/theater/balkan.xml should now refers to - files in this dir. A special area of the Balkan terrain - (balkanMapElev.7-7.bmp) has been flatten out to receive + + * Added a balkan dir under CSPSim/Data/XML/theater. + CSPSim/Data/XML/theater/balkan.xml should now refers to + files in this dir. A special area of the Balkan terrain + (balkanMapElev.7-7.bmp) has been flatten out to receive an airbase (see note below). - Changed the starting position of the m2k in createBalkan + Changed the starting position of the m2k in createBalkan from TestObjects.py. - - * Mapped the rudder to US_keyboard:COMMA (dec) and - US_keyboard:PERIOD (inc) in file + + * Mapped the rudder to US_keyboard:COMMA (dec) and + US_keyboard:PERIOD (inc) in file CSPSim/Tools/HID/Maps/aircraft-core.map. - + * Fixed a small bug(typo?) in the rudder decay. - - * Added limit min and max to AircraftSimpleFCS::Deflection for - elevators' and ailerons' deflection. + + * Added limit min and max to AircraftSimpleFCS::Deflection for + elevators' and ailerons' deflection. XML/vehicles/aircraft/m2k/systems.xml has been patched. - + * Changed various logo image file formats to jpg to save bandwith (LogoScreen). - + * Simplified derived classes of ScreenInfo. Slighty modified the position of texts. - + * A few changes in SmokeEffects. - - * Updated vs project. Many network source files are in the project + + * Updated vs project. Many network source files are in the project but excluded from the built. - + * Other minor changes. - + ==> All users: rebuild sim.dar and aircraft.hid. Copy balkanMapElev.7-7.bmp from CSPSim/Images to CSPSim/Terrain Added: trunk/CSP/CSPSim/Data/Models/tower1/texture1.jpg =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Models/tower1/texture1.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/CSP/CSPSim/Data/Models/tower1/tower1.3DS =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Models/tower1/tower1.3DS ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/CSP/CSPSim/Data/XML/theater/balkan/airbase.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/theater/balkan/airbase.xml 2004-12-16 06:43:41 UTC (rev 1391) +++ trunk/CSP/CSPSim/Data/XML/theater/balkan/airbase.xml 2004-12-16 19:29:34 UTC (rev 1392) @@ -8,6 +8,11 @@ <Float name="y">0</Float> <Float name="orientation">0.0</Float> </Object> - + <Object class="FeatureLayout"> + <Path name="model">tower1</Path> + <Float name="x">393</Float> + <Float name="y">-30</Float> + <Float name="orientation">1.57</Float> + </Object> </List> </Object> Added: trunk/CSP/CSPSim/Data/XML/theater/balkan/tower1/model.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/theater/balkan/tower1/model.xml 2004-12-16 06:43:41 UTC (rev 1391) +++ trunk/CSP/CSPSim/Data/XML/theater/balkan/tower1/model.xml 2004-12-16 19:29:34 UTC (rev 1392) @@ -0,0 +1,17 @@ +<?xml version="1.0" standalone="no"?> + +<Object class="ObjectModel"> + <External name="model_path">tower1/tower1.3ds</External> + <Vector name="axis_0">1 0 0</Vector> + <Vector name="axis_1">0 1.0 0.0</Vector> + <Vector name="offset">0 0 0.0</Vector> + <Float name="polygon_offset">-1</Float> + <Bool name="lighting">true</Bool> + <!--Int name="cull_face">1</Int--> + <Float name="scale">1.0</Float> + <!--List name="contacts"> + <Vector>0.0 0.0 0.0</Vector> + </List--> + <Bool name="smooth">true</Bool> + <Bool name="filter">true</Bool> +</Object> Added: trunk/CSP/CSPSim/Data/XML/theater/balkan/tower1.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/theater/balkan/tower1.xml 2004-12-16 06:43:41 UTC (rev 1391) +++ trunk/CSP/CSPSim/Data/XML/theater/balkan/tower1.xml 2004-12-16 19:29:34 UTC (rev 1392) @@ -0,0 +1,6 @@ +<?xml version="1.0" standalone="no"?> + +<Object class="FeatureObjectModel"> + <Path name="model">tower1.model</Path> + <Int name="hit_points">20</Int> +</Object> |
From: <sv...@ww...> - 2004-12-16 06:43:47
|
Author: mkrose Date: 2004-12-15 22:43:41 -0800 (Wed, 15 Dec 2004) New Revision: 1391 Added: trunk/CSP/CSPSim/Data/Models/Runway/runway.3ds Removed: trunk/CSP/CSPSim/Data/Models/Runway/runway.3DS Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/systems.xml Log: * Fix m2k animations bound to different channels. An driven rotation animation can only use a single input channel. More complex animations, such as coordinated motion of elevators and ailerons requires either special handling in the FCS system (with dedicated channels for each control surface), or a custom animation callback. * Fix the deflection limits for the m2k ailerons and elevators. The new values may not be correct, but at least the aileron limits are symmetric. * Rename the runway model file to all lowercase (wasn't found under linux). ==> Run ComplileData.py after updating to pick up the changes. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1391 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-15 20:05:59 UTC (rev 1390) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-16 06:43:41 UTC (rev 1391) @@ -1,6 +1,21 @@ Version 0.4.0 (in progress) =========================== +2004-12-15: onsight + * Fix m2k animations bound to different channels. An driven rotation + animation can only use a single input channel. More complex animations, + such as coordinated motion of elevators and ailerons requires either + special handling in the FCS system (with dedicated channels for each + control surface), or a custom animation callback. + + * Fix the deflection limits for the m2k ailerons and elevators. The new + values may not be correct, but at least the aileron limits are + symmetric. + + * Rename the runway model file to all lowercase (wasn't found under linux). + +==> Run ComplileData.py after updating to pick up the changes. + 2004-12-14: onsight * Minor fix for the engine cutoff function under linux. Deleted: trunk/CSP/CSPSim/Data/Models/Runway/runway.3DS =================================================================== (Binary files differ) Copied: trunk/CSP/CSPSim/Data/Models/Runway/runway.3ds (from rev 1388, trunk/CSP/CSPSim/Data/Models/Runway/runway.3DS) Modified: trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml 2004-12-15 20:05:59 UTC (rev 1390) +++ trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml 2004-12-16 06:43:41 UTC (rev 1391) @@ -29,24 +29,12 @@ <Vector name="axis">0 -0.34 0.94</Vector> </Object> - <Object class="DrivenRotation"> - <String name="channel_name">ControlSurfaces.ElevatorDeflection</String> - <Key name="model_id">Aircraft.LeftOuterAileron</Key> - <Int name="lod_limit">1</Int> - <Vector name="axis">-1 0 0</Vector> - </Object> <Object class="DrivenRotation"> <String name="channel_name">ControlSurfaces.ElevatorDeflection</String> <Key name="model_id">Aircraft.LeftAileron</Key> <Int name="lod_limit">1</Int> <Vector name="axis">-1 0 0</Vector> </Object> - <Object class="DrivenRotation"> - <String name="channel_name">ControlSurfaces.ElevatorDeflection</String> - <Key name="model_id">Aircraft.RightOuterAileron</Key> - <Int name="lod_limit">1</Int> - <Vector name="axis">-1 0 0</Vector> - </Object> <Object class="DrivenRotation"> <String name="channel_name">ControlSurfaces.ElevatorDeflection</String> <Key name="model_id">Aircraft.RightAileron</Key> @@ -60,20 +48,8 @@ <Int name="lod_limit">1</Int> <Vector name="axis">1 0 0</Vector> </Object> - <Object class="DrivenRotation"> - <String name="channel_name">ControlSurfaces.AileronDeflection</String> - <Key name="model_id">Aircraft.LeftAileron</Key> - <Int name="lod_limit">1</Int> - <Vector name="axis">1 0 0</Vector> - </Object> <Object class="DrivenRotation"> <String name="channel_name">ControlSurfaces.AileronDeflection</String> - <Key name="model_id">Aircraft.RightAileron</Key> - <Int name="lod_limit">1</Int> - <Vector name="axis">-1 0 0</Vector> - </Object> - <Object class="DrivenRotation"> - <String name="channel_name">ControlSurfaces.AileronDeflection</String> <Key name="model_id">Aircraft.RightOuterAileron</Key> <Int name="lod_limit">1</Int> <Vector name="axis">-1 0 0</Vector> Modified: trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/systems.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/systems.xml 2004-12-15 20:05:59 UTC (rev 1390) +++ trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/systems.xml 2004-12-16 06:43:41 UTC (rev 1391) @@ -5,8 +5,8 @@ <Object class="AircraftInputSystem" /> <Object class="AircraftSimpleFCS"> <Float name="elevator_limit0">-25.0</Float> - <Float name="elevator_limit1">16.0</Float> - <Float name="aileron_limit0">-25</Float> + <Float name="elevator_limit1">25.0</Float> + <Float name="aileron_limit0">-16</Float> <Float name="aileron_limit1">16</Float> <Float name="rudder_limit">30.0</Float> <Float name="airbrake_limit">60.0</Float> |
From: <sv...@ww...> - 2004-12-15 20:06:08
|
Author: delta Date: 2004-12-15 12:05:59 -0800 (Wed, 15 Dec 2004) New Revision: 1390 Added: trunk/CSP/CSPSim/Data/Images/balkanMapElev.7-7.bmp Log: * Copy this file to CSPSim/Data/terrain. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1390 Added: trunk/CSP/CSPSim/Data/Images/balkanMapElev.7-7.bmp =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/balkanMapElev.7-7.bmp ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <sv...@ww...> - 2004-12-15 18:14:01
|
Author: delta Date: 2004-12-15 10:13:51 -0800 (Wed, 15 Dec 2004) New Revision: 1389 Modified: trunk/CSP/CSPSim/Bin/TestObjects.py Log: * Moved the aircraft at start up to be at the bottom of the runway. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1389 Modified: trunk/CSP/CSPSim/Bin/TestObjects.py =================================================================== --- trunk/CSP/CSPSim/Bin/TestObjects.py 2004-12-15 17:27:52 UTC (rev 1388) +++ trunk/CSP/CSPSim/Bin/TestObjects.py 2004-12-15 18:13:51 UTC (rev 1389) @@ -38,7 +38,7 @@ v = SimData.Vector3 m = SimData.LLA() vehicle = app.createVehicle - vehicle("sim:vehicles.aircraft.m2k", v(-29403, -10980, 88.5), v(0, 0, 0), v(0.0, 0.0, 180.0)) + vehicle("sim:vehicles.aircraft.m2k", v(-29495, -10530, 88.5), v(0, 0, 0), v(0.0, 0.0, 180.0)) #vehicle("sim:vehicles.aircraft.m2k", v(-29413, -10980, 98.75), v(0, 100.0, 0), v(5.0, 0.0, 180.0)) #vehicle("sim:vehicles.aircraft.m2k", v(-29413, -10980, 108.75), v(0, 100.0, 0), v(5.0, 0.0, 180.0)) #vehicle("sim:vehicles.aircraft.m2k", v(-29413, -10980, 118.75), v(0, 100.0, 0), v(5.0, 0.0, 180.0)) |
From: <sv...@ww...> - 2004-12-15 17:27:58
|
Author: lologramme Date: 2004-12-15 09:27:52 -0800 (Wed, 15 Dec 2004) New Revision: 1388 Added: trunk/CSP/CSPSim/Data/Models/Runway/T01.jpg trunk/CSP/CSPSim/Data/Models/Runway/T02.jpg trunk/CSP/CSPSim/Data/Models/Runway/T03.jpg trunk/CSP/CSPSim/Data/Models/Runway/T04.jpg trunk/CSP/CSPSim/Data/Models/Runway/T05.jpg trunk/CSP/CSPSim/Data/Models/Runway/T06.jpg trunk/CSP/CSPSim/Data/Models/Runway/route01.jpg trunk/CSP/CSPSim/Data/Models/Runway/runway.3DS trunk/CSP/CSPSim/Data/Models/Runway/taxi01.jpg trunk/CSP/CSPSim/Data/XML/theater/balkan/runway.xml trunk/CSP/CSPSim/Data/XML/theater/balkan/runway/ trunk/CSP/CSPSim/Data/XML/theater/balkan/runway/model.xml Removed: trunk/CSP/CSPSim/Data/Models/Runway/runway01.jpg trunk/CSP/CSPSim/Data/Models/Runway/runway01.osg Modified: trunk/CSP/CSPSim/Data/XML/theater/balkan/airbase.xml trunk/CSP/CSPSim/Data/XML/theater/runway/model.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml Log: * Replace Runway by New runway with taxi and roads Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1388 Diff omitted (33207 bytes). |
From: <sv...@ww...> - 2004-12-15 17:20:30
|
Author: lologramme Date: 2004-12-15 09:20:23 -0800 (Wed, 15 Dec 2004) New Revision: 1387 Added: trunk/CSP/CSPSim/Data/Images/Old/balkanMapElev.7-7_old.bmp Removed: trunk/CSP/CSPSim/Data/Images/balkanMapElev.7-7_old.bmp Log: Test for Lologramme from an 1.1 client. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1387 Added: trunk/CSP/CSPSim/Data/Images/Old/balkanMapElev.7-7_old.bmp =================================================================== (Binary files differ) Property changes on: trunk/CSP/CSPSim/Data/Images/Old/balkanMapElev.7-7_old.bmp ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/CSP/CSPSim/Data/Images/balkanMapElev.7-7_old.bmp =================================================================== (Binary files differ) |
From: <sv...@ww...> - 2004-12-15 17:12:57
|
Author: lologramme Date: 2004-12-15 09:12:50 -0800 (Wed, 15 Dec 2004) New Revision: 1386 Added: trunk/CSP/CSPSim/Data/Images/Old/ Log: New test for Lologramme. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1386 |
From: <sv...@ww...> - 2004-12-15 17:09:49
|
Author: lologramme Date: 2004-12-15 09:09:42 -0800 (Wed, 15 Dec 2004) New Revision: 1385 Added: trunk/CSP/CSPSim/Data/Images/balkanMapElev.7-7_old.bmp Removed: trunk/CSP/CSPSim/Data/Images/balkanMapElev.7-7.bmp Log: Test for Lologramme Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1385 Deleted: trunk/CSP/CSPSim/Data/Images/balkanMapElev.7-7.bmp =================================================================== (Binary files differ) Copied: trunk/CSP/CSPSim/Data/Images/balkanMapElev.7-7_old.bmp (from rev 1384, trunk/CSP/CSPSim/Data/Images/balkanMapElev.7-7.bmp) |
From: <sv...@ww...> - 2004-12-15 09:23:47
|
Author: mkrose Date: 2004-12-15 01:23:39 -0800 (Wed, 15 Dec 2004) New Revision: 1384 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/Engine.cpp trunk/CSP/SimNet/PeerInfo.cpp Log: Minor fix for the engine cutoff function under linux. Bug fix in dup packet filter. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1384 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-15 09:12:50 UTC (rev 1383) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-15 09:23:39 UTC (rev 1384) @@ -1,14 +1,17 @@ Version 0.4.0 (in progress) =========================== +2004-12-14: onsight + * Minor fix for the engine cutoff function under linux. + 2004-12-13: delta - * Updated Data/XML/vehicles/aircraft/m2k/thrust.xml with more accurate + * Updated Data/XML/vehicles/aircraft/m2k/thrust.xml with more accurate m2k data. - + * Added a cutting function on the engine when aoa is too low or high. - + * Slightly moved the aircraft at startup. - + 2004-12-12: onsight * Several networking fixes, but the most relevant changes for CSPSim are: @@ -33,9 +36,9 @@ interpolating positions. 2004-12-12: delta - * Updated Data/Models/Mirage2000/m2k/model.osg and associated - textures (adding T1.jpg) by Lologramme. - + * Updated Data/Models/Mirage2000/m2k/model.osg and associated + textures (adding T1.jpg) by Lologramme. + 2004-12-05: delta * Updated CSPSim.vcproj, added SimNet to the build, cleaned up source and header directories and added a custom build step on Modified: trunk/CSP/CSPSim/Source/Engine.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Engine.cpp 2004-12-15 09:12:50 UTC (rev 1383) +++ trunk/CSP/CSPSim/Source/Engine.cpp 2004-12-15 09:23:39 UTC (rev 1384) @@ -163,15 +163,13 @@ // / -pi/2 if x = -a // f(x) = | 0 if x in [-a/2,b/2] (0 < a, b) // \ b if x = b - double ret = abs(x-m_B/2) + x-m_B/2 + simdata::PI_2*(m_A/2+x - abs(m_A/2+x))/m_A; + double ret = std::abs(x-m_B/2) + x-m_B/2 + simdata::PI_2*(m_A/2+x - std::abs(m_A/2+x))/m_A; return ret; } void EngineDynamics::cut() { double alpha = b_Alpha->value(); - if (abs(alpha) > simdata::PI_2) - alpha -= simdata::sign(alpha)*simdata::PI; - if (alpha < -m_A) { + if ((std::abs(alpha) > simdata::PI_2) || (alpha < -m_A)) { m_Force = simdata::Vector3::ZERO; } else if (alpha < m_B) { Modified: trunk/CSP/SimNet/PeerInfo.cpp =================================================================== --- trunk/CSP/SimNet/PeerInfo.cpp 2004-12-15 09:12:50 UTC (rev 1383) +++ trunk/CSP/SimNet/PeerInfo.cpp 2004-12-15 09:23:39 UTC (rev 1384) @@ -268,7 +268,7 @@ if (m_duplicate_filter_low && (id >= 65536/32*3/4)) { m_duplicate_filter_low = false; memset(reinterpret_cast<char*>(m_duplicate_filter), 0, 65536/2); - } else if (!m_duplicate_filter_low && (id >= 65536/32/4)) { + } else if (!m_duplicate_filter_low && (id >= 65536/32/4) && (id < 65536/32/2)) { m_duplicate_filter_low = true; memset(reinterpret_cast<char*>(m_duplicate_filter) + 65536/2, 0, 65536/2); } |
From: <sv...@ww...> - 2004-12-15 09:12:57
|
Author: delta Date: 2004-12-15 01:12:50 -0800 (Wed, 15 Dec 2004) New Revision: 1383 Modified: trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h Log: * Added std:: scope in front of double abs(double) to avoid confusion with the c function int abs(int). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1383 Modified: trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h =================================================================== --- trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h 2004-12-15 03:48:58 UTC (rev 1382) +++ trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h 2004-12-15 09:12:50 UTC (rev 1383) @@ -65,7 +65,7 @@ } // experiment a poor flatting function virtual double flat(double x) const { - double abs_x = abs(x); + double abs_x = std::abs(x); double scale = x*x*(3.0 - 2.0*abs_x); return scale * x; } |
From: <sv...@ww...> - 2004-12-15 03:49:10
|
Author: lologramme Date: 2004-12-14 19:48:58 -0800 (Tue, 14 Dec 2004) New Revision: 1382 Modified: trunk/CSP/CSPSim/Data/Images/Smoke/white-smoke-hilite.rgb.COPYING Log: test Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1382 Modified: trunk/CSP/CSPSim/Data/Images/Smoke/white-smoke-hilite.rgb.COPYING =================================================================== --- trunk/CSP/CSPSim/Data/Images/Smoke/white-smoke-hilite.rgb.COPYING 2004-12-15 00:00:18 UTC (rev 1381) +++ trunk/CSP/CSPSim/Data/Images/Smoke/white-smoke-hilite.rgb.COPYING 2004-12-15 03:48:58 UTC (rev 1382) @@ -1,4 +1,4 @@ Created by Mark Rose <mkrose AT users.sourceforge.net> This image may be freely redistributed for any purpose -without restriction. +without restriction. |
From: <sv...@ww...> - 2004-12-15 00:00:27
|
Author: delta Date: 2004-12-14 16:00:18 -0800 (Tue, 14 Dec 2004) New Revision: 1381 Modified: trunk/CSP/CSPSim/Source/Engine.cpp Log: * Use aoa mod pi in the engine cutting function. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1381 Modified: trunk/CSP/CSPSim/Source/Engine.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Engine.cpp 2004-12-14 22:08:23 UTC (rev 1380) +++ trunk/CSP/CSPSim/Source/Engine.cpp 2004-12-15 00:00:18 UTC (rev 1381) @@ -169,6 +169,8 @@ void EngineDynamics::cut() { double alpha = b_Alpha->value(); + if (abs(alpha) > simdata::PI_2) + alpha -= simdata::sign(alpha)*simdata::PI; if (alpha < -m_A) { m_Force = simdata::Vector3::ZERO; } |
From: <sv...@ww...> - 2004-12-14 22:08:30
|
Author: delta Date: 2004-12-14 14:08:23 -0800 (Tue, 14 Dec 2004) New Revision: 1380 Modified: trunk/CSP/CSPSim/Include/Systems/AircraftInputSystem.h trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp Log: * Minor anti-warnings changes in SimCore/Battlefield/LocalBattlefield.cpp. * Slighty flatten the joystick inputs. * Other minor changes. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1380 Modified: trunk/CSP/CSPSim/Include/Systems/AircraftInputSystem.h =================================================================== --- trunk/CSP/CSPSim/Include/Systems/AircraftInputSystem.h 2004-12-14 10:19:14 UTC (rev 1379) +++ trunk/CSP/CSPSim/Include/Systems/AircraftInputSystem.h 2004-12-14 22:08:23 UTC (rev 1380) @@ -63,7 +63,7 @@ } m_Channel->value() = simdata::clampTo(v, m_Minimum, m_Maximum); } - double getValue() { + double getValue() const { return m_Channel->value(); } void setValue(double value) { Modified: trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h =================================================================== --- trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h 2004-12-14 10:19:14 UTC (rev 1379) +++ trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h 2004-12-14 22:08:23 UTC (rev 1380) @@ -29,9 +29,11 @@ #include <algorithm> #include <cmath> -#include <System.h> +#include <SimData/Math.h> + #include <SimCore/Util/Log.h> +#include <System.h> class AircraftSimpleFCS: public System { @@ -61,10 +63,16 @@ void registerOutput(Bus *bus, std::string const &name) { b_Output = bus->registerLocalDataChannel(name, 0.0); } - void update(double dt) { + // experiment a poor flatting function + virtual double flat(double x) const { + double abs_x = abs(x); + double scale = x*x*(3.0 - 2.0*abs_x); + return scale * x; + } + virtual void update(double dt) { double input = 0.0; double output = b_Output->value(); - if (b_Input.valid()) input = b_Input->value() * m_Limit; + if (b_Input.valid()) input = flat(b_Input->value()) * m_Limit; double smooth = std::min(1.0, 10.0*std::abs(output-input)); if (output < input) { output = std::min(output + smooth*m_Rate*dt, m_Limit1); Modified: trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2004-12-14 10:19:14 UTC (rev 1379) +++ trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2004-12-14 22:08:23 UTC (rev 1380) @@ -173,7 +173,7 @@ * @param interval The interval between updates, in seconds. * @param detail The level of detail for updates sent to this peer (0-9). */ - void setUpdateParameters(PeerId id, double interval, int detail); + void setUpdateParameters(PeerId id, double interval, simdata::uint16 detail); }; @@ -755,7 +755,7 @@ // finally, send all pending updates for (int i = 0; i < target_count; ++i) { const int detail = targets[i] >> 24; - const int id = targets[i] & 0xffffff; + const PeerId id = static_cast<PeerId>(targets[i] & 0xffffff); simnet::NetworkMessage::Ref msg = m_DetailCache[detail].msg; if (msg.valid()) { m_Connection->send(msg, static_cast<PeerId>(id)); @@ -768,7 +768,7 @@ return (m_PeerUpdates[0].next_update - m_UpdateTime) * 1e-3; } -void LocalBattlefield::UnitUpdateProxy::setUpdateParameters(PeerId id, double interval, int detail) { +void LocalBattlefield::UnitUpdateProxy::setUpdateParameters(PeerId id, double interval, simdata::uint16 detail) { assert(detail >= 0 && detail < DETAIL_LEVELS); simdata::uint16 interval_ms = static_cast<simdata::uint16>(interval * 1000.0); const unsigned n = m_PeerUpdates.size(); @@ -821,7 +821,7 @@ // 2 = 3.2-6.4 km // 1 = 6.4-12.8 km // 0 = >12.8 km - int detail = std::max(0, 9 - static_cast<int>(1.4427 * log(std::max(1.0, distance / 25.0)))); + simdata::uint16 detail = static_cast<simdata::uint16>(std::max(0, 9 - static_cast<int>(1.4427 * log(std::max(1.0, distance / 25.0))))); m_UpdateProxy->setUpdateParameters(id, interval, detail); } |
From: <sv...@ww...> - 2004-12-14 10:19:24
|
Author: mkrose Date: 2004-12-14 02:19:14 -0800 (Tue, 14 Dec 2004) New Revision: 1379 Modified: trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h trunk/CSP/SimNet/NetBase.h trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/NetworkInterface.h trunk/CSP/SimNet/PeerInfo.cpp trunk/CSP/SimNet/PeerInfo.h Log: Add filtering of duplicate reliable packets. Note that reliable packet reordering is not implemented (although not currently needed, either). Fix a minor bug in the stringification of packet headers. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1379 Diff omitted (11106 bytes). |