Example #1
0
void CTxFunctionsView::OnButtonApply()
{
    SetUpdateBtnChanges();
    //save the values of delay between blocks
    UINT                    unTimerVal;
    CString                 csTimerVal;
    CTxMsgBlocksView* pomBlockView = NULL;
    pomBlockView = (CTxMsgBlocksView*)pomGetBlocksViewPointer();
    if(pomBlockView)
    {
        pomBlockView->GetDlgItemText(IDC_EDIT_BLOCK_TRG_TIMER_VAL, csTimerVal);

        if(((CButton*) pomBlockView->GetDlgItem(IDC_CHECK_MSG_BLOCK_DELAY))->GetCheck() == BST_CHECKED)
        {
            CTxWndDataStore::ouGetTxWndDataStoreObj().m_bDelayBetweenMsgBlocks = true;
            CTxMsgManager::s_bDelayBetweenBlocksOnly = true;
            pomBlockView->m_bDelayBtnBlocks = true;
        }
        else
        {
            CTxWndDataStore::ouGetTxWndDataStoreObj().m_bDelayBetweenMsgBlocks = false;
            CTxMsgManager::s_bDelayBetweenBlocksOnly = false;
            pomBlockView->m_bDelayBtnBlocks = false;
        }
    }

    unTimerVal = (UINT)atol(csTimerVal.GetBuffer(0));

    CTxWndDataStore::ouGetTxWndDataStoreObj().m_unTimeDelayBtwnMsgBlocks = unTimerVal;
    CTxMsgManager::s_unTimeDelayBtnMsgBlocks = unTimerVal;
    this->SetFocus();

    // The following block of code can be enabled if message to be transmitted in following scenario :
    // Message transmission is ON, Empty block is present. Added a message to the
    // empty block and Update button is selected
    /*if(CTxMsgManager::s_TxFlags.nGetFlagStatus(TX_SENDMESG))
    {
        CTxMsgBlocksView* pBlocksView = (CTxMsgBlocksView*)pomGetBlocksViewPointer();
        PSMSGBLOCKLIST psMsgCurrentBlock = NULL;
        if (NULL != pomBlockView)
        {
            psMsgCurrentBlock =  pomBlockView->psGetMsgBlockPointer(
                pomBlockView->m_nSelectedMsgBlockIndex,
                pomBlockView->m_psMsgBlockList );
            // If no msg is present at the start of msg transmission and if the
            // user adds a one or more msg and selects the update button, then send the new msg
            if(psMsgCurrentBlock->m_unMsgCount >= 1)
            {
                CTxMsgManager::s_podGetTxMsgManager()->vStartTransmission(0);
            }
        }
    }*/
}
Example #2
0
/*******************************************************************************
  Function Name  : OnBnClickedCheckAutoUpdate
  Input(s)       : -
  Output         : -
  Functionality  : This checkbox updates the content automaticallyan stores it in
                   global store
  Member of      : CTxFunctionsView
  Author(s)      : Ashwin. R. Uchil
  Date Created   : 28.5.2012
  Modifications  :
*******************************************************************************/
void CTxFunctionsView::OnBnClickedCheckAutoUpdate()
{
    CTxMsgBlocksView* pBlocksView = (CTxMsgBlocksView*)pomGetBlocksViewPointer();
    if (NULL != pBlocksView)
    {
        if (NULL == pBlocksView->m_psMsgBlockList)
        {
            GetDlgItem(IDC_BTN_UPDATE)->EnableWindow(FALSE);
        }
        else
        {
            GetDlgItem(IDC_BTN_UPDATE)->EnableWindow(TRUE);
        }
    }
    else
    {
        GetDlgItem(IDC_BTN_UPDATE)->EnableWindow(FALSE);
    }

    if((m_CheckBoxAutoUpdate.GetCheck() == BST_CHECKED))
    {
        vAccessButtonApply();
        CTxWndDataStore::ouGetTxWndDataStoreObj().m_bAutoSavedEnabled = true;
        //CTxMsgManager::s_bDelayBetweenBlocksOnly = true;
        if (NULL != pBlocksView)
        {
            UINT                    unTimerVal;
            CString                 csTimerVal;
            pBlocksView->GetDlgItemText(IDC_EDIT_BLOCK_TRG_TIMER_VAL, csTimerVal);
            unTimerVal = (UINT)atol(csTimerVal.GetBuffer(0));
            CTxWndDataStore::ouGetTxWndDataStoreObj().m_unTimeDelayBtwnMsgBlocks = unTimerVal;
            CTxMsgManager::s_unTimeDelayBtnMsgBlocks = unTimerVal;
            //set the status of delay between blocks
            if(pBlocksView->m_omDelayBtwnBlocks.GetCheck() == BST_CHECKED)
            {
                CTxMsgManager::s_bDelayBetweenBlocksOnly = true;
                CTxWndDataStore::ouGetTxWndDataStoreObj().m_bDelayBetweenMsgBlocks = true;
                pBlocksView->m_bDelayBtnBlocks = true;
            }
            else
            {
                CTxMsgManager::s_bDelayBetweenBlocksOnly = false;
                CTxWndDataStore::ouGetTxWndDataStoreObj().m_bDelayBetweenMsgBlocks = false;
                pBlocksView->m_bDelayBtnBlocks = false;
            }
        }
    }
    else
    {
        CTxWndDataStore::ouGetTxWndDataStoreObj().m_bAutoSavedEnabled = false;
        //CTxMsgManager::s_bDelayBetweenBlocksOnly = false;
    }
}
Example #3
0
/*******************************************************************************
 Function Name    : vApplyChanges
 Input(s)         :
 Output           :
 Functionality    : This function is used to apply changes in the global shared
                    memory
 Member of        : CTxFunctionsView
 Friend of        :  -
 Author(s)        : Raja N
 Date Created     : 19.07.2004
 Modification By  :
 Modification on  :
*******************************************************************************/
void CTxFunctionsView::vApplyChanges()
{
    // Get Other view pointers
    CTxMsgBlocksView* pomBlockView = NULL;
    CTxMsgListView* pomListView = NULL;
    pomBlockView = (CTxMsgBlocksView*)pomGetBlocksViewPointer();
    pomListView = (CTxMsgListView* )pomGetListViewPointer();

    if( pomBlockView != NULL && pomListView != NULL )
    {
        PSMSGBLOCKLIST psMsgBlock = NULL;
        psMsgBlock = pomBlockView->psGetMsgBlockPointer(
                         pomBlockView->m_nSelectedMsgBlockIndex,
                         pomBlockView->m_psMsgBlockList );
        // Update the last selected message block details in case user has
        // modified it.
        if(psMsgBlock != NULL )
        {
            pomBlockView->vUpdateMsgBlockDetials(psMsgBlock);
            psMsgBlock->m_bModified = true;
        }

        // Set the value in configuration class.
        CTxWndDataStore::ouGetTxWndDataStoreObj().bSetTxData( TX_MSG_BLOCK_COUNT,
                (void*)&(pomBlockView->m_unMsgBlockCount) );
        // Data is set only if messagae block count is more then zero.
        if( pomBlockView->m_unMsgBlockCount > 0 )
        {
            CTxWndDataStore::ouGetTxWndDataStoreObj().bSetTxData( TX_MSG_UPDATE,
                    (void*)(pomBlockView->m_psMsgBlockList) );
            // Allocate memory for globle list
            BOOL bAllocateMemory =
                CTxMsgManager::s_podGetTxMsgManager()->bAllocateMemoryForGlobalTxList();
            // Update Message List
            if(bAllocateMemory == TRUE )
            {
                CTxMsgManager::s_podGetTxMsgManager()->vAssignMsgBlockList();
            }
        }
        //Save Window position
        CTxMsgChildFrame* pTxWnd = (CTxMsgChildFrame*)pomGetParentWindow();
        // Update view pointer
        if( pTxWnd != NULL )
        {
            // Register this view pointer
            pTxWnd->vUpdateWndCo_Ords();

        }
        if(pomBlockView->m_omDelayBtwnBlocks.GetCheck() == BST_CHECKED)
        {
            CTxWndDataStore::ouGetTxWndDataStoreObj().m_bDelayBetweenMsgBlocks = true;  //update the global variable
            CTxMsgManager::s_bDelayBetweenBlocksOnly = true;

            UINT                    unTimerVal;
            CString                 csTimerVal;
            pomBlockView->GetDlgItemText(IDC_EDIT_BLOCK_TRG_TIMER_VAL, csTimerVal);
            unTimerVal = (UINT)atol(csTimerVal.GetBuffer(0));

            CTxWndDataStore::ouGetTxWndDataStoreObj().m_unTimeDelayBtwnMsgBlocks = unTimerVal;
            CTxMsgManager::s_unTimeDelayBtnMsgBlocks = unTimerVal;
        }
        else
        {
            CTxWndDataStore::ouGetTxWndDataStoreObj().m_bDelayBetweenMsgBlocks = false;
            CTxMsgManager::s_bDelayBetweenBlocksOnly = false;
        }
        /* CString                     csTimeDelay;
         ((CEdit*)pomBlockView->GetDlgItem(IDC_EDIT_BLOCK_TRG_TIMER_VAL))->GetWindowTextA(csTimeDelay);
         CTxMsgManager::s_unTimeDelayBtnMsgBlocks = atol(csTimeDelay.GetBuffer(0));*/
    }
}