CEvolveTrafficApp Class Reference

A class for the applicaiton object. More...

#include <EvolveTraffic.h>

List of all members.

Public Member Functions

void setInSimulation (bool InSim)
 CEvolveTrafficApp ()
 A class represetning the application object.
virtual BOOL InitInstance ()
virtual BOOL OnIdle (LONG lCount)
afx_msg void OnAppAbout ()

Private Attributes

bool m_bInSimulation


Detailed Description

A class for the applicaiton object.

Definition at line 25 of file EvolveTraffic.h.


Constructor & Destructor Documentation

CEvolveTrafficApp::CEvolveTrafficApp (  ) 

A class represetning the application object.

Definition at line 42 of file EvolveTraffic.cpp.

00043 {
00044         // TODO: add construction code here,
00045         // Place all significant initialization in InitInstance
00046 }


Member Function Documentation

void CEvolveTrafficApp::setInSimulation ( bool  InSim  ) 

Definition at line 227 of file EvolveTraffic.cpp.

References m_bInSimulation.

00228 {
00229         m_bInSimulation = InSim;
00230 }

BOOL CEvolveTrafficApp::InitInstance (  )  [virtual]

Definition at line 56 of file EvolveTraffic.cpp.

References IDR_MAINFRAME, m_bInSimulation, and CConfigData::ReadData().

00057 {
00058         AfxEnableControlContainer();
00059 
00060         // Standard initialization
00061         // If you are not using these features and wish to reduce the size
00062         //  of your final executable, you should remove from the following
00063         //  the specific initialization routines you do not need.
00064 
00065 #ifdef _AFXDLL
00066         Enable3dControls();                     // Call this when using MFC in a shared DLL
00067 #else
00068         Enable3dControlsStatic();       // Call this when linking to MFC statically
00069 #endif
00070 
00071         // Change the registry key under which our settings are stored.
00072         // TODO: You should modify this string to be something appropriate
00073         // such as the name of your company or organization.
00074         SetRegistryKey(_T("Local AppWizard-Generated Applications"));
00075 
00076         LoadStdProfileSettings();  // Load standard INI file options (including MRU)
00077 
00078         if (!g_ConfigData.ReadData("EvolveTraffic.ini") )
00079                 MessageBox(NULL,"Configuration file cannot be read", "EvolveTraffic", MB_OK|MB_ICONWARNING);
00080 
00081         // Register the application's document templates.  Document templates
00082         //  serve as the connection between documents, frame windows and views.
00083 
00084         CSingleDocTemplate* pDocTemplate;
00085         pDocTemplate = new CSingleDocTemplate(
00086                 IDR_MAINFRAME,
00087                 RUNTIME_CLASS(CEvolveTrafficDoc),
00088                 RUNTIME_CLASS(CMainFrame),       // main SDI frame window
00089                 RUNTIME_CLASS(CEvolveTrafficView));
00090         AddDocTemplate(pDocTemplate);
00091 
00092         // Enable DDE Execute open
00093         EnableShellOpen();
00094         RegisterShellFileTypes(TRUE);
00095 
00096         // Parse command line for standard shell commands, DDE, file open
00097         CCommandLineInfo cmdInfo;
00098         ParseCommandLine(cmdInfo);
00099 
00100         // Dispatch commands specified on the command line
00101         if (!ProcessShellCommand(cmdInfo))
00102                 return FALSE;
00103 
00104         // The one and only window has been initialized, so show and update it.
00105         m_pMainWnd->ShowWindow(SW_SHOW);
00106         m_pMainWnd->UpdateWindow();
00107 
00108         // Enable drag/drop open
00109         m_pMainWnd->DragAcceptFiles();
00110 
00111         m_bInSimulation = false;                // CC added code
00112 
00113         return TRUE;
00114 }

Here is the call graph for this function:

BOOL CEvolveTrafficApp::OnIdle ( LONG  lCount  )  [virtual]

Definition at line 204 of file EvolveTraffic.cpp.

References CEvolveTrafficView::doLoop(), and m_bInSimulation.

00205 {
00206         // The lCount param tells you how many times OnIdle has been called since the last
00207         // message was processed.  Windows uses the  0th and 1st call to OnIdle for its own 
00208         // stuff, so we don't animate until those have been done, otherwise Windows has to
00209         // wait after the 0th for the 1st call, and this could cause GUI lag. */
00210         CWinApp::OnIdle(lCount);        // Do the base class WinApp processing.
00211         if (lCount < 2)                         // Still doing Windows OnIdle processing,
00212                 return TRUE;                    // so call OnIdle again.
00213 
00214         CEvolveTrafficView* pView = (CEvolveTrafficView*)((CFrameWnd*)AfxGetMainWnd())->GetActiveView();
00215         ASSERT_VALID(pView);
00216 
00217         if(m_bInSimulation)
00218                 pView->doLoop( timeGetTime() ); // the main call
00219         
00220         return true;    // loop back here again
00221 }

Here is the call graph for this function:

void CEvolveTrafficApp::OnAppAbout (  ) 

Definition at line 194 of file EvolveTraffic.cpp.

00195 {
00196         CAboutDlg aboutDlg;
00197         aboutDlg.DoModal();
00198 }


Member Data Documentation

Definition at line 47 of file EvolveTraffic.h.

Referenced by InitInstance(), OnIdle(), and setInSimulation().


The documentation for this class was generated from the following files:

Generated on Wed Aug 20 00:48:42 2008 for EvolveTraffic by  doxygen 1.5.6