当前位置: 首页>>代码示例>>C++>>正文


C++ CGraphChildFrame::pGetSignalListDetails方法代码示例

本文整理汇总了C++中CGraphChildFrame::pGetSignalListDetails方法的典型用法代码示例。如果您正苦于以下问题:C++ CGraphChildFrame::pGetSignalListDetails方法的具体用法?C++ CGraphChildFrame::pGetSignalListDetails怎么用?C++ CGraphChildFrame::pGetSignalListDetails使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGraphChildFrame的用法示例。


在下文中一共展示了CGraphChildFrame::pGetSignalListDetails方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: vPopulateElementList

/*******************************************************************************
  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 = static_cast<CGraphChildFrame*>(pomGetParentWindow());

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

    CGraphElement odTemp;
    if( podList != NULL )
    {
        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
            {
                // 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 );
                }
            }
        }
    }
}
开发者ID:Schrenk,项目名称:busmaster,代码行数:83,代码来源:GraphLeftView.cpp

示例2: ClearGraph

/*******************************************************************************
  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 = static_cast<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();
    }
}
开发者ID:Schrenk,项目名称:busmaster,代码行数:72,代码来源:GraphLeftView.cpp

示例3: OnColorChange

/*******************************************************************************
  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 = nullptr;
        CGraphChildFrame* pParentWnd = nullptr;
        pParentWnd = static_cast<CGraphChildFrame*>(pomGetParentWindow());

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

        // Update Element Details
        if( podList != nullptr )
        {
            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 );
                        (static_cast<CGraphBottomView*>(pParentWnd->m_pomBottomView))
                        ->vInsertSignalData();
                        (static_cast<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;
}
开发者ID:BlackVodka,项目名称:busmaster,代码行数:84,代码来源:GraphLeftView.cpp

示例4: ClearGraph

/*******************************************************************************
  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 = static_cast<CGraphChildFrame*>(pomGetParentWindow());

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

        CGraphElement odTemp;

        if ( podList != NULL )
        {
            CString omStrName;
            int nItemCount  = (int)podList->m_omElementList.GetSize();
            // Get Buffer Size
            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 );
        }
    }
}
开发者ID:ArunMaiya,项目名称:busmaster,代码行数:100,代码来源:GraphLeftView.cpp


注:本文中的CGraphChildFrame::pGetSignalListDetails方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。