Exemplo n.º 1
0
/*******************************************************************************
  Function Name  : vEnableDisableControls
  Input(s)       : -
  Output         : -
  Functionality  : This function will update UI control as per the selection in
                   the element UI list and connection status
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
void CGraphLeftView::vEnableDisableControls()
{
    CGraphList* podList = NULL;
    CGraphChildFrame* pParentWnd = NULL;
    pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

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

    //SGW Code commented by Arun 21-10-2010
}
Exemplo n.º 2
0
/*******************************************************************************
  Function Name  : OnBtnVisible
  Input(s)       : -
  Output         : -
  Functionality  : This function will toggle the Visible property of the element
                   This will also update global list
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
void CGraphLeftView::OnBtnVisible()
{
    CGraphElement odSelectedElement;
    // Get handle to selected message item
    int hSelItem = m_omSignalList.GetNextItem(-1, LVNI_SELECTED);

    if ( hSelItem != -1 )
    {
        // Get Graph List from main frame
        CGraphList* podList = NULL;
        CGraphChildFrame* pParentWnd = NULL;
        pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

        // Update Element Details
        if( podList != NULL )
        {
            if( hSelItem < podList->m_omElementList.GetSize() )
            {
                odSelectedElement = podList->m_omElementList[ hSelItem ];
                odSelectedElement.m_bVisible =
                    !odSelectedElement.m_bVisible;
                podList->m_omElementList[ hSelItem ] = odSelectedElement;

                // Update Configuration Module
                //theApp.bSetData( SIGNAL_GRAPH_LIST, podList);

                // Update Button Text
                if( odSelectedElement.m_bVisible == TRUE )
                {
                    m_omBtnVisible.SetWindowText( defSTR_HIDE );
                }
                else
                {
                    m_omBtnVisible.SetWindowText( defSTR_SHOW );
                }

                // Update Graph Control
                vUpdateGraphControl( defFROM_VISIBLE,
                                     odSelectedElement.m_bVisible );
            }
            else
            {
                // Invalid Element.
                AfxMessageBox( defSTR_ELEMENT_NOT_FOUND, MB_ICONSTOP);
            }
        }
    }
}
Exemplo n.º 3
0
/*******************************************************************************
  Function Name  : OnBtnEnable
  Input(s)       : -
  Output         : -
  Functionality  : This function will toggle the Enable property of the element.
                   This will also update global list
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
void CGraphLeftView::OnBtnEnable()
{
    CGraphElement odSelectedElement;
    // Get handle to selected message item
    int hSelItem = m_omSignalList.GetNextItem(-1, LVNI_SELECTED);

    if ( hSelItem != -1 )
    {
        // Get graph list from main frame
        CGraphList* podList = nullptr;
        CGraphChildFrame* pParentWnd = nullptr;
        pParentWnd = static_cast<CGraphChildFrame*>(pomGetParentWindow());

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

        // Update Element Details
        if( podList != nullptr )
        {
            if( hSelItem < podList->m_omElementList.GetSize() )
            {
                odSelectedElement = podList->m_omElementList[ hSelItem ];
                odSelectedElement.m_bEnabled =
                    !odSelectedElement.m_bEnabled;
                podList->m_omElementList[ hSelItem ] = odSelectedElement;

                // Update Configuration Module
                //theApp.bSetData( SIGNAL_GRAPH_LIST, podList);

                // Update Button Text
                if( odSelectedElement.m_bEnabled == TRUE )
                {
                    m_omBtnEnable.SetWindowText( _(defSTR_DISABLE) );
                }
                else
                {
                    m_omBtnEnable.SetWindowText( _(defSTR_ENABLE) );
                }
                // Update Graph Control
                vUpdateGraphControl( defFROM_ENABLE,
                                     odSelectedElement.m_bEnabled );
            }
            else
            {
                // Invalid element found
                AfxMessageBox( _(defSTR_ELEMENT_NOT_FOUND), MB_ICONSTOP);
            }
        }
    }
}
Exemplo n.º 4
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 );
        }
    }
}
Exemplo n.º 5
0
/*******************************************************************************
  Function Name  : OnItemchangedListSignals
  Input(s)       : pNMHDR - Pointer to the list item struct
                   pResult - Pointer to the result value
  Output         : -
  Functionality  : This function will update line type, line color, point type,
                   point color, enable and visible properties of the selected
                   graph element
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
void CGraphLeftView::OnItemchangedListSignals(NMHDR* pNMHDR, LRESULT* /*pResult*/)
{
    NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;

    // Process only selection change message
    if(pNMListView->uNewState == ( LVIS_FOCUSED |LVIS_SELECTED ) )
    {
        // Get handle to selected message item
        int hSelItem = pNMListView->iItem;

        if ( hSelItem != -1 )
        {
            // Update selected element deteils
            CGraphList* podList = NULL;
            CGraphChildFrame* pParentWnd = NULL;
            pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

            // Update Element Details
            if( podList != NULL )
            {
                if( hSelItem < podList->m_omElementList.GetSize() )
                {
                    vSetElementDetails(podList->m_omElementList[ hSelItem ] );
                    vUpdateGraphControl( defFRM_ELEMENT_SELECTION, hSelItem );
                }
                else
                {
                    AfxMessageBox( defSTR_ELEMENT_NOT_FOUND, MB_ICONSTOP);
                }
            }

            //SGW Code commented by Arun 21-10-2010
        }
    }

    // Update UI Controls
    vEnableDisableControls();
}
Exemplo n.º 6
0
/*******************************************************************************
  Function Name  : vSaveChangedInToConfig
  Input(s)       : -
  Output         : -
  Functionality  : Updated Global Env attributes and save the changes in config
                   module
  Member of      : CGraphBottomView
  Author(s)      : Raja N
  Date Created   : 10/12/2004
  Modifications  : 
*******************************************************************************/
void CGraphBottomView::vSaveChangedInToConfig()
{	
	CGraphList * podList = NULL;
	CGraphChildFrame* pParentWnd = NULL;
	pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

    CGraphParameters * pEnv = &(podList->m_odGraphParameters);
    if( pEnv != NULL )
    {
        pEnv->m_nAction = m_nAction;
        pEnv->m_nActiveAxis = m_nAxis;
    }	
}
Exemplo n.º 7
0
/*******************************************************************************
  Function Name  : OnBtnGrid
  Input(s)       : -
  Output         : -
  Functionality  : This function will toggle grid lines. This will use graph
                   control's ShowGrid property.
  Member of      : CGraphBottomView
  Author(s)      : Raja N
  Date Created   : 10/12/2004
  Modifications  : Raja N on 14.12.2004, Review comments implemented
*******************************************************************************/
void CGraphBottomView::OnBtnGrid()
{
    CGraphList* podList = NULL;
    CGraphChildFrame* pParentWnd = NULL;
    pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

    if( podList != NULL)
    {
        CGraphParameters* pEnv =
            &(podList->m_odGraphParameters);

        if( pEnv != NULL )
        {
            // Toggle grid property
            pEnv->m_bShowGrid = !pEnv->m_bShowGrid;
            // Update Graph Control

            if (  m_pDMGraphCtrl !=NULL )
            {
                CComPtr<IDMGraphAxis> spAxisX;
                m_pDMGraphCtrl->get_Axis( HorizontalX, &spAxisX);
                spAxisX->put_ShowGrid(pEnv->m_bShowGrid ? VARIANT_TRUE : VARIANT_FALSE);
                CComPtr<IDMGraphAxis> spAxisY;
                m_pDMGraphCtrl->get_Axis( VerticalY, &spAxisY);
                spAxisY->put_ShowGrid(pEnv->m_bShowGrid ? VARIANT_TRUE : VARIANT_FALSE);
            }

            // Update Button Text
            vSetShowButtonState( pEnv->m_bShowGrid );
            // Pass Some Pointer to avoid assertion
            //theApp.bSetData( SIGNAL_GRAPH_LIST, pEnv);
        }
    }
}
Exemplo n.º 8
0
/*******************************************************************************
  Function Name  : OnBtnConfigure
  Input(s)       : -
  Output         : -
  Functionality  : This function will shoe element configuration dialog to show
                   and change view style parameters.
  Member of      : CGraphBottomView
  Author(s)      : Raja N
  Date Created   : 10/12/2004
  Modifications  : 
*******************************************************************************/
void CGraphBottomView::OnBtnConfigure() 
{
    // Create configuration dialog and show it
    CGraphConfiguration omGraphConf;

	CGraphList * podList = NULL;
	CGraphChildFrame* pParentWnd = NULL;
	pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

	CGraphParameters par;
	//omGraphConf.vSetValues(podList->m_odGraphParameters);
	omGraphConf.m_pGraphList = podList;
	omGraphConf.m_pDMGraphCtrl = m_pDMGraphCtrl;
    omGraphConf.DoModal();
}
Exemplo n.º 9
0
/*******************************************************************************
  Function Name  : OnSelchangeComboType
  Input(s)       : -
  Output         : -
  Functionality  : This function will be called by the framework if the item
                   selection in the combobox got changed. This will update the
                   selection in the global list and inm graph control
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
void CGraphLeftView::OnSelchangeComboType()
{
    UpdateData();
    CGraphElement odSelectedElement;
    // Get handle to selected message item
    int hSelItem = m_omSignalList.GetNextItem(-1, LVNI_SELECTED);

    if ( hSelItem != -1 )
    {
        CGraphList* podList = NULL;
        CGraphChildFrame* pParentWnd = NULL;
        pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

        // Update Element Details
        if( podList != NULL )
        {
            if( hSelItem < podList->m_omElementList.GetSize() )
            {
                odSelectedElement = podList->m_omElementList[ hSelItem ];
                odSelectedElement.m_nLineType = m_nLineType;
                podList->m_omElementList[ hSelItem ] = odSelectedElement;
                vUpdateGraphControl( defFROM_LINE_TYPE, m_nLineType );
            }
            else
            {
                AfxMessageBox( defSTR_ELEMENT_NOT_FOUND, MB_ICONSTOP);
            }
        }
    }
}
Exemplo n.º 10
0
/*******************************************************************************
  Function Name  : OnSelchangeComboSymbol
  Input(s)       : -
  Output         : -
  Functionality  : This function will be called by the framework if the item
                   selection in the combobox got changed. This will update the
                   selection in the global list and inm graph control
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
void CGraphLeftView::OnSelchangeComboSymbol()
{
    UpdateData();

    CGraphElement odSelectedElement;
    // Get handle to selected message item
    int hSelItem = m_omSignalList.GetNextItem(-1, LVNI_SELECTED);

    if ( hSelItem != -1 )
    {
        CGraphList* podList = nullptr;
        CGraphChildFrame* pParentWnd = nullptr;
        pParentWnd = static_cast<CGraphChildFrame*>(pomGetParentWindow());

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

        // Update Element Details
        if( podList != nullptr )
        {
            odSelectedElement = podList->m_omElementList[ hSelItem ];
            odSelectedElement.m_nPointType = m_nSymbolType;
            podList->m_omElementList[ hSelItem ] = odSelectedElement;
            vUpdateGraphControl( defFROM_POINT_TYPE, m_nSymbolType );
        }
        else
        {
            AfxMessageBox( _(defSTR_ELEMENT_NOT_FOUND), MB_ICONSTOP);
        }
    }
}
Exemplo n.º 11
0
/*******************************************************************************
  Function Name  : vPopulateGraphControl
  Input(s)       : -
  Output         : -
  Functionality  : This function initializes graph control with list of elements
                   This function will be called from init and during connect.
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  : Raja N on 11.03.2005
                   Added channel information to statistics parameters. This will
                   be used in report generation
                   Arunkumar K on 25.07.2011
                   Commented the ClearGraph() function.
*******************************************************************************/
void CGraphLeftView::vPopulateGraphControl()
{
    if( m_pDMGraphCtrl != NULL )
    {
        // Get Element List from Main Frame
        CGraphList* podList = NULL;
        CGraphChildFrame* pParentWnd = NULL;
        pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

        CGraphElement odTemp;

        if ( podList != NULL )
        {
            UINT unMsgID = 0;
            CString omStrName;
            int nItemCount  = (int)podList->m_omElementList.GetSize();
            // Get Buffer Size
            int nBufferSize = podList->m_odGraphParameters.m_nBufferSize;
            CComPtr<IDMGraphCollection> spGraphCollection;
            HRESULT hr = m_pDMGraphCtrl->get_Elements(&spGraphCollection);

            if(FAILED(hr))
            {
                return;
            }

            // Add items to the list
            for ( int nIndex = 0; nIndex < nItemCount; nIndex++ )
            {
                odTemp = podList->m_omElementList[ nIndex ];
                CComPtr<IDispatch> spDispatch;
                //adds to the end and makes it selected
                hr = spGraphCollection->Add(&spDispatch);
                CComPtr<IDMGraphElement> spElement;
                hr = GetCurrentElement(m_pDMGraphCtrl, &spElement);

                // Insert element name
                // If this is stat parameter then append the channel ID
                // prefix with the name
                if ( odTemp.m_nValueType == eSTAT_PARAM )
                {
                    CString omStrChannel;
                    omStrChannel.Format( defSTR_CHANNEL_NAME_FORMAT,
                                         defSTR_CHANNEL_NAME,
                                         odTemp.m_nFrameFormat );
                    // Prefix channel information with the stat
                    // parameter
                    omStrChannel += defSPACE_STR + odTemp.m_omStrElementName;
                    _bstr_t bstrChannel = omStrChannel;
                    spElement->put_Name(bstrChannel.GetBSTR());
                }
                else
                {
                    // Add only the Signal name
                    _bstr_t bstrElementName = odTemp.m_omStrElementName;
                    spElement->put_Name(bstrElementName.GetBSTR());
                }

                // Insert Line Color
                spElement->put_LineColor((OLE_COLOR)odTemp.m_nLineColor);
                // Insert Line Type
                spElement->put_LineType((LineType)odTemp.m_nLineType);
                // Sample Point Type
                spElement->put_PointSymbol((SymbolType)odTemp.m_nPointType);
                // Set The Symbol Type to Sold. Hardcoded
                spElement->put_SolidPoint(VARIANT_TRUE);
                // Sample point type
                spElement->put_PointColor((OLE_COLOR)odTemp.m_nPointColor);
                // Visiblity param
                spElement->put_Show(odTemp.m_bVisible  ? VARIANT_TRUE : VARIANT_FALSE);
            }

            // Set the last item as Selected
            m_omSignalList.SetItemState( nItemCount - 1,
                                         LVIS_SELECTED | LVIS_FOCUSED,
                                         LVIS_SELECTED | LVIS_FOCUSED );
        }
    }
}
Exemplo n.º 12
0
/*******************************************************************************
  Function Name  : OnColorChange
  Input(s)       : lparam - Not Used
                   wparam - ID of the control
  Output         : -
  Functionality  : This function processes Color change event posted from the
                   CColorPopup dialog. This function updates global list value
                   as per the current selection
  Member of      : CLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
LRESULT CGraphLeftView::OnColorChange(WPARAM /*wparam*/, LPARAM lparam)
{
    CGraphElement odSelectedElement;
    // Get handle to selected message item
    int hSelItem = m_omSignalList.GetNextItem(-1, LVNI_SELECTED);

    if ( hSelItem != -1 )
    {
        CGraphList* podList = NULL;
        CGraphChildFrame* pParentWnd = NULL;
        pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

        // Update Element Details
        if( podList != NULL )
        {
            if( hSelItem < podList->m_omElementList.GetSize() )
            {
                odSelectedElement = podList->m_omElementList[ hSelItem ];

                // Switch the Control ID
                switch( lparam )
                {
                        // Update Line Color
                    case IDC_LINE_COLOR:
                        odSelectedElement.m_nLineColor =
                            m_omLineColor.GetColour();
                        // Update List member
                        podList->m_omElementList[ hSelItem ] =
                            odSelectedElement;
                        // Update UI List Color
                        m_omSignalList.SetItemData( hSelItem,
                                                    odSelectedElement.m_nLineColor );
                        // Update Control
                        vUpdateGraphControl( defFROM_LINE_COLOR,
                                             odSelectedElement.m_nLineColor );
                        ((CGraphBottomView*)pParentWnd->m_pomBottomView)
                        ->vInsertSignalData();
                        ((CGraphBottomView*)pParentWnd->m_pomBottomView)
                        ->vUpdateSignalData();
                        break;

                        // Update Sample point color
                    case IDC_POINT_COLOR:
                        odSelectedElement.m_nPointColor =
                            m_omPointColor.GetColour();
                        // Update list member
                        podList->m_omElementList[ hSelItem ] =
                            odSelectedElement;
                        // Update Control
                        vUpdateGraphControl( defFROM_POINT_COLOR,
                                             odSelectedElement.m_nPointColor );
                        break;

                    default:
                        ASSERT( FALSE );
                }
            }
            else
            {
                AfxMessageBox( defSTR_ELEMENT_NOT_FOUND, MB_ICONSTOP);
            }
        }
    }

    return 0;
}
Exemplo n.º 13
0
/*******************************************************************************
  Function Name  : vPopulateElementList
  Input(s)       : -
  Output         : -
  Functionality  : This function will read global element list and will update
                   element UI list control
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  : Raja N on 11.3.2005
                   Added Channel information for statistics parameters in the
                   Type column
*******************************************************************************/
void CGraphLeftView::vPopulateElementList()
{
    // Get Element List
    CGraphList* podList = NULL;
    // Remove All items in the list
    m_omSignalList.DeleteAllItems();
    // Get List pointer
    CGraphChildFrame* pParentWnd = NULL;
    pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

    CGraphElement odTemp;

    if( podList != NULL )
    {
        UINT unMsgID = 0;
        CString omStrName;
        int nItemCount  = (int)podList->m_omElementList.GetSize();

        // Add items to the list
        for( int nIndex = 0; nIndex < nItemCount; nIndex++ )
        {
            odTemp = podList->m_omElementList[ nIndex ];

            // Statistics Parameter
            if( odTemp.m_nValueType == eSTAT_PARAM )
            {
                // Insert Category
                m_omSignalList.InsertItem( nIndex, defSTR_STATISTICS_NAME);
                // Insert element name
                m_omSignalList.SetItemText( nIndex, 1,
                                            odTemp.m_omStrElementName );
                // Insert Channel String
                CString omStrChannel;
                omStrChannel.Format( defSTR_CHANNEL_NAME_FORMAT,
                                     defSTR_CHANNEL_NAME,
                                     odTemp.m_nFrameFormat );
                m_omSignalList.SetItemText( nIndex, 2, omStrChannel );
                // Set Color of the entry
                m_omSignalList.SetItemData( nIndex, odTemp.m_nLineColor );
            }
            else
            {
                unMsgID = odTemp.m_nMsgID;
                // Get Message Name
                omStrName = odTemp.m_strMsgName;
                // Add Element Catogory
                m_omSignalList.InsertItem( nIndex, omStrName );
                // Add Element Name
                m_omSignalList.SetItemText( nIndex, 1,
                                            odTemp.m_omStrElementName );
                // Set Color of the entry
                m_omSignalList.SetItemData( nIndex, odTemp.m_nLineColor );

                // Add Value Type
                if( odTemp.m_nValueType == eRAW_VALUE )
                {
                    m_omSignalList.SetItemText( nIndex, 2, defSTR_RAW_VALUE );
                }
                else
                {
                    m_omSignalList.SetItemText( nIndex, 2, defSTR_PHY_VALUE );
                }
            }
        }
    }
}
Exemplo n.º 14
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();
    }
}
Exemplo n.º 15
0
/*******************************************************************************
  Function Name  : vInitGraphControl
  Input(s)       : -
  Output         : -
  Functionality  : This function will initialise graph control. This will set
                   viewstyle parameters of the graph control
  Member of      : CGraphBottomView
  Author(s)      : Raja N
  Date Created   : 10/12/2004
  Modifications  :
*******************************************************************************/
void CGraphBottomView::vInitGraphControl()
{
    CGraphList* podList = NULL;
    CGraphChildFrame* pParentWnd = NULL;
    pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

    if( podList != NULL )
    {
        CGraphParameters* pEnv = &podList->m_odGraphParameters;

        if( pEnv != NULL )
        {
            // Init Active Axis
            m_nAxis = pEnv->m_nActiveAxis;
            // Init Active Action
            m_nAction = pEnv->m_nAction;
            // Set Show Grid Action
            vSetShowButtonState( pEnv->m_bShowGrid );

            // Set Graph Params
            if( m_pDMGraphCtrl != NULL )
            {
                // Set Axis Color
                m_pDMGraphCtrl->put_AxisColor((OLE_COLOR)pEnv->m_nAxisColor);
                // Set Plot Area Color
                m_pDMGraphCtrl->put_PlotAreaColor((OLE_COLOR)pEnv->m_nPlotAreaColor);
                // Set Grid Color
                m_pDMGraphCtrl->put_GridColor((OLE_COLOR)pEnv->m_nGridColor);
                // Set Frame Style
                m_pDMGraphCtrl->put_FrameStyle((FrameStyle)pEnv->m_nFrameStyle);
                // Set Frame Color
                m_pDMGraphCtrl->put_ControlFrameColor((OLE_COLOR)pEnv->m_nFrameColor);
                // Set Grid Lines Count
                CComPtr<IDMGraphAxis> spAxisX;
                m_pDMGraphCtrl->get_Axis( HorizontalX, &spAxisX);
                spAxisX->put_GridNumber((short)pEnv->m_nXGridLines);
                CComPtr<IDMGraphAxis> spAxisY;
                m_pDMGraphCtrl->get_Axis( VerticalY, &spAxisY);
                spAxisY->put_GridNumber((short)pEnv->m_nYGridLines);
                // Set Show Grid
                spAxisX->put_ShowGrid(pEnv->m_bShowGrid ? VARIANT_TRUE : VARIANT_FALSE);
                spAxisY->put_ShowGrid(pEnv->m_bShowGrid ? VARIANT_TRUE : VARIANT_FALSE);
                // Set Format String
                spAxisX->put_Format( CComBSTR(defSTR_X_AXIS_FORMAT) );
                spAxisY->put_Format( CComBSTR(defSTR_Y_AXIS_FORMAT) );
                // Set X,Y Range
                double dXMin,dXMax, dYMin, dYMax;
                m_pDMGraphCtrl->GetRange(&dXMin, &dXMax, &dYMin, &dYMax);
                dYMax = 100.0;
                m_pDMGraphCtrl->SetRange(defDEFAULT_XRANGE_MIN, defDEFAULT_XRANGE_MAX, dYMin, dYMax);
                //Set the caption
                BSTR bstrCaption(L"Graph Display - CAN");
                m_pDMGraphCtrl->put_Caption(bstrCaption);
            }

            // Update Local DDX Variables
            UpdateData( FALSE );
            // Update Axis and action
            vSetAction();
        }
    }
}