⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ss7trandlg.cpp

📁 VC6.0环境下的ss7isup部分的信令解释程序
💻 CPP
📖 第 1 页 / 共 4 页
字号:
// ss7tranDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ss7tran.h"
#include "ss7tranDlg.h"
#include "isup_def.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
	CAboutDlg();

// Dialog Data
	//{{AFX_DATA(CAboutDlg)
	enum { IDD = IDD_ABOUTBOX };
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CAboutDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	//{{AFX_MSG(CAboutDlg)
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
	//{{AFX_DATA_INIT(CAboutDlg)
	//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAboutDlg)
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
	//{{AFX_MSG_MAP(CAboutDlg)
		// No message handlers
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSs7tranDlg dialog

CSs7tranDlg::CSs7tranDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSs7tranDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSs7tranDlg)
	m_strinput = _T("");
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CSs7tranDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSs7tranDlg)
	DDX_Control(pDX, IDC_LIST1, m_lstroutput);
	DDX_Control(pDX, IDOK2, m_conempty);
	DDX_Text(pDX, IDC_EDIT1, m_strinput);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CSs7tranDlg, CDialog)
	//{{AFX_MSG_MAP(CSs7tranDlg)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(IDOK2, OnOk2)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSs7tranDlg message handlers

BOOL CSs7tranDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Add "About..." menu item to system menu.

	// IDM_ABOUTBOX must be in the system command range.
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}

void CSs7tranDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
	{
		CAboutDlg dlgAbout;
		dlgAbout.DoModal();
	}
	else
	{
		CDialog::OnSysCommand(nID, lParam);
	}
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void CSs7tranDlg::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// Draw the icon
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}

// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CSs7tranDlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}

void CSs7tranDlg::OnOk2() 
{
	// TODO: Add your control notification handler code here
	CString strtemp;
	m_strinput = _T("");
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 );
	while(pCtrl->GetCount()>0)   
	{   
		pCtrl->DeleteString(0);
	}
	UpdateData(false);
}

char strchangehex(CString str1)
{
	CString strtemp;
	char lmessage;


	strtemp=str1.Left(1);
	if (strtemp=="A")
		lmessage=10;
	else if (strtemp=="B")
		lmessage=11;
	else if (strtemp=="C")
		lmessage=12;
	else if (strtemp=="D")
		lmessage=13;
	else if (strtemp=="E")
		lmessage=14;
	else if (strtemp=="F")
		lmessage=15;
	else
		lmessage=atol(strtemp);
	lmessage*=16;
	str1.Delete(0,1);
	strtemp=str1.Left(1);
	if (strtemp=="A")
		lmessage+=10;
	else if (strtemp=="B")
		lmessage+=11;
	else if (strtemp=="C")
		lmessage+=12;
	else if (strtemp=="D")
		lmessage+=13;
	else if (strtemp=="E")
		lmessage+=14;
	else if (strtemp=="F")
		lmessage+=15;
	else
		lmessage+=atol(strtemp);

	return(lmessage);
}



CString CSs7tranDlg::get_tranpra(long len)
{
	CString strparout;
	long i;
	int pos;

	strparout="";

	for(i=0;i<len;i++)
	{
		pos=strinput.Find(",");
		strparout+=strinput.Left(pos);
		if(i<(len-1))
		{
			strparout+=",";
		}
		strinput.Delete(0,pos+1);
	}
	return strparout;
}

void CSs7tranDlg::tran_o_para(long ptr1)
{
	long i;
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 ) ; 	

	while(ptr1<lparalen)
	{
		long lparaname,lparaleno;
		CString strparaname,strparalen;
		CString  strparin;
		CString strtemp;

		strparaname=strpara[ptr1++];
		lparaname=strchangehex(strparaname);
		strparalen=strpara[ptr1++];
		lparaleno=atol(strparalen);

		strparin="";
		for(i=0;i<lparaleno;i++)
		{
			strparin+=strpara[ptr1++];
			if (i<(lparaleno-1))
				strparin+=",";
		}
		switch (lparaname)
		{
			case ISUP_PARA_Access_delivery_info:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Access delivery information (open)";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Access_delivery_info(strparin);
			}									
			break;
			case ISUP_PARA_Access_transport:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Access transport";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Access_transport(strparin);
			}									
			break;
			case ISUP_PARA_Automatic_congestion_level:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Automatic congestion level";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Automatic_congestion_level(strparin);
			}									
			break;
			case ISUP_PARA_Backward_call_indicators:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Backward call indicators";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Backward_call_indicators(strparin);
			}									
			break;
			case ISUP_PARA_Call_diversion_information:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Call diversion information";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Call_diversion_information(strparin);
			}									
			break;
			case ISUP_PARA_Call_history_information:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Call history information";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Call_history_information(strparin);
			}									
			break;
			case ISUP_PARA_Call_reference:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Call reference ";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Call_reference(strparin);
			}									
			break;
			case ISUP_PARA_Called_party_number:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Called party number";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Called_party_number(strparin);
			}									
			break;
			case ISUP_PARA_Calling_party_number:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Calling party number";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Calling_party_number(strparin);
			}									
			break;
			case ISUP_PARA_Calling_party_category:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Calling party's category";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Calling_party_category(strparin);
			}									
			break;
			case ISUP_PARA_Circuit_state_indicator:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Circuit state indicator";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Circuit_state_indicator(strparin);
			}									
			break;
			case ISUP_PARA_Cause_indicators:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Cause indicators";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Cause_indicators(strparin);
			}									
			break;
			case ISUP_PARA_Circuit_group_supervision_message_type_indicator:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Circuit group supervision message type indicator";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Circuit_group_supervision_message_type_indicator(strparin);
			}									
			break;
			case ISUP_PARA_Closed_user_group_interlock_code:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Closed user group interlock code";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Closed_user_group_interlock_code(strparin);
			}									
			break;
			case ISUP_PARA_Connected_number:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Connected number";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Connected_number(strparin);
			}									
			break;
			case ISUP_PARA_Connection_request:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Connection request (open)";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Connection_request(strparin);
			}									
			break;
			case ISUP_PARA_Continuity_indicators:
			{
				strtemp=strparaname;
				strtemp+=":";
				strtemp+="parametername__Continuity indicators";
				pCtrl->AddString(strtemp);

				strtemp=strparalen;
				strtemp+=":";
				strtemp+="length indicator";
				pCtrl->AddString(strtemp);

				tranpar_Continuity_indicators(strparin);
			}									
			break;
			case ISUP_PARA_Echo_control_information:
			{
				strtemp=strparaname;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -