Exemplo n.º 1
0
/*******************************************************************************
  Function Name  : vHandleConnectionStatusChange
  Input(s)       : bConnectionStatus - Status of the tool connection. TRUE if
                   the tool is going to connected state
  Output         : -
  Functionality  : This function will handle connect event. This will disable
                   not supported UI controls if the tool is going to connected
                   state. This will also set the graph to Run mode. The update
                   timer will be started during connect state. During disconnect
                   this function will bring back the graph control to normal
                   mode and will kill the update timer.
  Member of      : CGraphBottomView
  Author(s)      : Raja N
  Date Created   : 10/12/2004
  Modifications  : Raja N on 14.12.2004, Implemented review comments
*******************************************************************************/
void CGraphBottomView::vHandleConnectionStatusChange(BOOL bConnectStatus)
{
    // Tool is going to connect state
    vEnableDisableButtons( bConnectStatus );

    CGraphChildFrame* pParentWnd = NULL;
    pParentWnd = (CGraphChildFrame*)pomGetParentWindow();
    //Update Graph right view
    CGraphRightView* pRightView = (CGraphRightView*)pParentWnd->pomGetRightTopViewPointer();
    pRightView->vHandleConnectionStatusChange(bConnectStatus);

    // Create/ Delete Update Timer
    if( bConnectStatus == TRUE )
    {
        // Go To Run Mode
        //m_podGraphControl->GoToRunMode();

        CGraphList* podList = NULL;

        if(pParentWnd != NULL)
        {
            pParentWnd->m_pomBottomView = this;
        }

        if(pParentWnd != NULL)
        {
            podList = pParentWnd->pGetSignalListDetails();
        }
        else
        {
            return;
        }

        //int nTimeDelay = podList->m_odGraphParameters.m_nRefreshRate;
        //nTimerID = SetTimer( defUPDATE_TIMER_ID , nTimeDelay, NULL );
    }
    else
    {
        // Go To Normal Mode
        //m_podGraphControl->GoToNormalMode();
        // Check for valid timer handle
        if( nTimerID != 0 )
        {
            // Kill Display Update Timer
            KillTimer( nTimerID );
        }
    }
}