From: Markus R. <rol...@us...> - 2007-02-21 20:12:34
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30321 Modified Files: Tag: WIN32 mainframe.cpp Log Message: - support discrete simulation stepping Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.8.2.7 retrieving revision 1.8.2.8 diff -C2 -d -r1.8.2.7 -r1.8.2.8 *** mainframe.cpp 18 Feb 2007 14:25:14 -0000 1.8.2.7 --- mainframe.cpp 21 Feb 2007 20:12:25 -0000 1.8.2.8 *************** *** 417,421 **** } ! sim->SetSimStep(0.0); sim->Init(0,0); sim->SetAutoTimeMode(false); --- 417,421 ---- } ! sim->SetSimStep(SIM_SIMSTEP); sim->Init(0,0); sim->SetAutoTimeMode(false); *************** *** 456,464 **** while (! sim->WantsToQuit()) { ! wxLongLong tNow = wxGetLocalTimeMillis(); ! float tDeltaSec = (tNow - tLast).ToLong() / 1000.0; ! tLast = tNow; ! AdvanceSimulation(sim, tDeltaSec); // pump the wxWidgets message loop --- 456,470 ---- while (! sim->WantsToQuit()) { ! if (SIM_SIMSTEP > 0.0f) ! { ! AdvanceSimulation(sim, SIM_SIMSTEP); ! } else ! { ! wxLongLong tNow = wxGetLocalTimeMillis(); ! float tDeltaSec = (tNow - tLast).ToLong() / 1000.0; ! tLast = tNow; ! AdvanceSimulation(sim, tDeltaSec); ! } // pump the wxWidgets message loop *************** *** 627,631 **** InitSimulation(sim); ! AdvanceSimulation(sim, 0.01f); DoneSimulation(sim); --- 633,645 ---- InitSimulation(sim); ! ! if (SIM_SIMSTEP > 0.0) ! { ! AdvanceSimulation(sim, SIM_SIMSTEP); ! } else ! { ! AdvanceSimulation(sim, 0.01f); ! } ! DoneSimulation(sim); |