/******************************************************************************* Function Name : vDelSelSubEntries Input(s) : bAllSignals - Delete All Signals Flag Output : Functionality : This function will be called to delete the selected signals from the temporary signal list. It will delete all messages if the bool bAllSignals is true. Member of : CSigWatchAddDelDlg Friend of : - Author(s) : Raja N Date Created : 25.03.2004 Modification By : Modification on : *******************************************************************************/ void CSigWatchAddDelDlg::vDelSelSubEntries(BOOL bAllEntries) { // Get the data from GUI interface vUpdateSelSubEntryList(bAllEntries); if(bAllEntries == FALSE) { UINT unSelCount = (UINT)m_omCSAData.GetSize(); for(UINT index = 0; index < unSelCount; index++) { CString omSelMainSubEntry, omMainEntry, omSubEntry; omSelMainSubEntry = m_omCSAData.GetAt(index); if( bGetMainSubName( omSelMainSubEntry, omMainEntry, omSubEntry) == TRUE ) { UINT unMainEntryID = unGetMainEntryIDFromName(omMainEntry); if ( bDeleteSubEntry(unMainEntryID, omSubEntry) != TRUE) { CString omError; omError.Format(defSTR_SW_DELETE_SIG_ERROR, omSubEntry ,omMainEntry); AfxMessageBox(omError); } } else { CString omError; omError.Format(defSTR_SW_PARSE_ERROR, omSelMainSubEntry); AfxMessageBox(omError); } } } else { if (m_podTempCallerList != NULL) { POSITION pos = m_podTempCallerList->GetHeadPosition(); while (pos) { SMAINENTRY& sMainEntry = m_podTempCallerList->GetNext(pos); POSITION SubPos = sMainEntry.m_odSelEntryList.GetHeadPosition(); while (SubPos != NULL) { POSITION TempPos = SubPos; SSUBENTRY& sSubEntry = sMainEntry.m_odSelEntryList.GetNext(SubPos); sMainEntry.m_odUnSelEntryList.AddTail(sSubEntry); sMainEntry.m_odSelEntryList.RemoveAt(TempPos); } } } } vPopulateUnSelSubEntryList(unGetSelectedMainEntryID()); }
/******************************************************************************* Function Name : unGetSelectedMainEntryID Input(s) : - Output : Functionality : This function will return the message id of the message name selected in the combo box. This will be called to get the id and it will get the id from active database Member of : CSigWatchAddDelDlg Friend of : - Author(s) : Raja N Date Created : 25.03.2004 Modification By : Modification on : *******************************************************************************/ UINT CSigWatchAddDelDlg::unGetSelectedMainEntryID() { // Assign init value to an invalid one UINT unMainEntryId = (UINT)-1; CString omMainEntryName; // Check for visible window if( m_omCombMessage.GetSafeHwnd() != NULL ) { m_omCombMessage.GetWindowText(omMainEntryName); } // Get the selected message name unMainEntryId = unGetMainEntryIDFromName(omMainEntryName); return unMainEntryId; }
/******************************************************************************* Function Name : unGetSelectedMainEntryID Input(s) : - Output : Functionality : This function will return the message id of the message name selected in the combo box. This will be called to get the id and it will get the id from active database Member of : CMainSubListDlg Friend of : - Author(s) : Raja N Date Created : 25.03.2004 Modification By : Modification on : *******************************************************************************/ UINT CMainSubListDlg::unGetSelectedMainEntryID(CString* pomMainEntryName) { // Assign init value to an invalid one UINT unMainEntryId = (UINT)-1; CString omMainEntryName; // Check for visible window if( m_omCombMessage.GetSafeHwnd() != NULL ) { m_omCombMessage.GetWindowText(omMainEntryName); } // Get the selected message name unMainEntryId = unGetMainEntryIDFromName(omMainEntryName); if (pomMainEntryName != NULL) { *pomMainEntryName = omMainEntryName; } return unMainEntryId; }