Пример #1
0
/*******************************************************************************
  Function Name  : vHandleConfigFileChange
  Input(s)       : lParam, wParam - Not Used
  Output         : -
  Functionality  : Handles connection change event. Initialised graph and list
                   control members
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
LRESULT CGraphLeftView::vHandleConfigFileChange( WPARAM /*wParam*/, LPARAM /*lParam*/)
{
    // Update List Control
    vPopulateElementList();
    // Update UI Controls
    vEnableDisableControls();

    if ( m_pDMGraphCtrl )
    {
        // Remove All items in the control
        m_pDMGraphCtrl->ClearGraph();
    }
    // Add Elements in to the graph control
    vPopulateGraphControl();
    return 0;
}
Пример #2
0
/*******************************************************************************
  Function Name  : vHandleConnectionStatusChange
  Input(s)       : bConnect - TRUE if the tool is connected, FALSE otherwise
  Output         : -
  Functionality  : Handles connection change event. Initialised graph control
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  : Arunkumar K on 25/07/2011
                   Added ClearGraph() function call.
*******************************************************************************/
void CGraphLeftView::vHandleConnectionStatusChange(BOOL bConnect)
{
    if( bConnect  && m_pDMGraphCtrl)
    {
        // Remove All items in the control
        m_pDMGraphCtrl->ClearGraph();
        // Set X,Y Range
        double dXMin,dXMax, dYMin, dYMax;
        m_pDMGraphCtrl->GetRange(&dXMin, &dXMax, &dYMin, &dYMax);
        dYMin = 0.0;
        dYMax = 100.0;
        m_pDMGraphCtrl->SetRange(defDEFAULT_XRANGE_MIN, defDEFAULT_XRANGE_MAX, dYMin, dYMax);
    }

    BOOL bEnable = !bConnect;
    // Update Local Instance
    m_bConnectionStatus = bConnect;

    // Update Configuration Controls
    if(bEnable)
    {
        CGraphList* podList = NULL;
        CGraphChildFrame* pParentWnd = NULL;
        pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

        // Update UI Elements
        if( podList != NULL )
        {
            if( podList->m_omElementList.GetSize() > 0 &&
                    m_omSignalList.GetSelectedCount() > 0 )
            {
                vEnableControls( bEnable );
            }
        }
    }
    else
    {
        vEnableControls( bEnable );
    }

    // Disable Configure button
    CWnd* pWnd = NULL;
    pWnd = GetDlgItem( IDC_BTN_CONFIGURE );

    if( pWnd != NULL )
    {
        pWnd->EnableWindow( bEnable );
    }

    if( bConnect == TRUE )
    {
        // Add Elements in to the graph control
        vPopulateGraphControl();
    }
}