📄 fax_polling_vcdlg.h
字号:
// Fax_Event_VCDlg.h : header file
//
#if !defined(AFX_Fax_Event_VCDLG_H__2719AD39_556B_4238_A238_791BC0DDB330__INCLUDED_)
#define AFX_Fax_Event_VCDLG_H__2719AD39_556B_4238_A238_791BC0DDB330__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "shpa3api.h"
#include "FirstDlg.h"
#include "SecondDlg.h"
#include "ThirdDlg.h"
#include "FourthDlg.h"
//Chinese: 传真方向
//English: fax direction
enum {
C_SEND_FAX, //send fax
C_RECEIVE_FAX //receive fax
};
//Chinese: 通道类型
//English: type of channel
enum{
ANALOG_CH=0, //Chinese: 模拟外线通道
//English: Analog trunk channel
INTER_CH=1, //Chinese: 内线通道
//English: Station channel
USER_CH=2, //Chinese: 坐席通道
//English: Station channel
REC_CH=3, //Chinese: 录音通道
//English: Record channel
SS1_CH=4, //Chinese: 数字通道(中国NO.1信令)
//English: Digital channel (SS1)
FAX_CH=5, //Chinese: 传真资源通道
//English: Fax channel
TUP_CH=6, //Chinese: 数字通道(中国NO.7信令TUP)
//English: Digital channel (SS7 TUP)
ISDN_USER_CH=7, //Chinese: 数字通道(ISDN用户侧)
//English: Digital channel (ISDN user side)
ISDN_NET_CH = 8, //Chinese: 数字通道(ISDN网络侧)
//English: Digital channel (ISDN network side)
SOFTFAX_CH = 9, //Chinese: 软传真
//English: Soft fax
MAGNET_CH = 10 //Chinese: 磁石通道
//English: Magnet channel
};
//Chinese: 自定义中继通道状态
//English: user-defined trunk channel state
enum{
TRK_IDLE, //Chinese: 空闲
//English: idle
TRK_PLAY_VOC1, //Chinese: 播放语音提示:"这里是传真与模拟演示程序,按1收取传真,按2发送传真"
//English: Play voice 'this is fax demo system: press 1 to receive fax file; press 2 to transmit fax file'
TRK_PLAY_VOC2, //Chinese: 播放语音提示:请按启动键开始
//English: play voice 2:"please press key 'start' to continue"
TRK_DIALING, //Chinese: 正在拨号
//English: dialing
TRK_FAXING, //Chinese: 传真过程中
//English: faxing...
};
//Chinese: 自定义传真通道状态
//English: user-defined fax channel state
enum{
FAX_IDLE, //Chinese: 空闲
//English: idle
FAX_CHECK_END, //Chinese: 传真过程中
//English: faxing...
};
//Chinese: 传真通道
//English: fax channel
typedef struct tagFAX_STRUCT
{
BOOL bUseful; //Chinese: 本通道是否占用标志:FALSE-未被占用 TRUE-已被占用
//English: channel seizure flag: FALSE- not seized TRUE-seized
char szChErrMsg[250]; //Chinese: 出错信息
//English: error message
char szPage[10]; //Chinese: 传真页数
//English: number of fax pages
char szGetID[30]; //Chinese: 对方传真ID
//English: ID of the receiver's fax machine
int nDirection; //Chinese: 传真方向:0-发送 1-接收
//English: fax direction : 0-send 1-receive
int nStep; //Chinese: 自定义传真通道状态
//English: user-defined fax channel state
int nAnswered; //Chinese: 是否按下启动键:0-没有 1-按下
//English: check whether press start-up button : 0-no 1-yes
char szRcvPathFile[250]; //Chinese: 接收传真文件名
//English: file name received(include path)
char szSendFile[250]; //Chinese: 发送文件名
//English: file name to be sent
char szSendPath[250]; //Chinese: 发送路径名
//English: path for sending fax file
int nStartPage; //Chinese: 起始页
//English: start page
int nEndPage; //Chinese: 结束页
//English: end page
int nCheckEnd; //Chinese: 传真任务执行结果判断
//English: test execution result of faxing task
int nTrunkCh; //Chinese: 与传真通道总线相连的中继通道
//English: trunk channel ID linked to fax channel
int nHowFile; //Chinese: 传真文件类型:0-单文件 1-多文件 2-多文件(可设置页码)
//English: modes of sending fax file: 0-single file 1-multi-file 2- multi-file with page number
int nSCTNumber; //Chinese: ffSCT型多文件个数
//English: number of files in ffSCT format
FAX_FILE_SCT *pffSCT;
int nAllBytes; //Chinese: 待发送的总字节数
//English: total number of bytes to be sent
int nSendBytes; //Chinese: 已发送的字节数
//English: number of bytes sent
int nRcvBytes; //Chinese: 已接收的字节数
//English: number of bytes received
}FAX_STRUCT;
//trunk channel
typedef struct tagTRUNK_STRUCT
{
BOOL bEnCalled; //Chinese: 是否允许呼叫 TRUE-允许 FALSE-不允许
//English: enable or disenable calling: TRUE-enable FALSE-forbid
BOOL bRecord; //Chinese: 是否录音 TRUE-录音 FALSE-不录音
//English: recording or not : TRUE-record FALSE-not record
int nCallFlag; //Chinese: 呼入还是呼出: 0-呼入 1-呼出
//English: inbound or outbound call : 0-inbound 1-call outbound
int nLineState; //Chinese: 通道状态
//English: channel state
char szChErrMsg[250]; //Chinese: 出错信息
//English: error message
char szCallNo[20]; //Chinese: 呼出号码
//English: called party number
char szCallerId[20]; //Chinese: 主叫号码
//English: calling party number
char szDtmf[20]; //Chinese: 收到的DTMF码
//English: DTMF received
int nToFaxCh; //Chinese: 与中继通道总线相连的传真通道
//English: fax channel connected with trunk channel by bus
int nStep; //Chinese: 自定义中继通道状态
//English: user-defined trunk channel state
int nAutoOrNot; //Chinese: 收发传真方式: 0-自动收发 1-提示收发
//English: faxing mode: 0- automatic 1- manual
BOOL bUseful; //Chinese: 本通道是否占用标志:FALSE-未被占用 TRUE-已被占用
//English: channel seizure flag: FALSE- not seized TRUE-seized
int nIndex; //Chinese: 收到的DTMF是第几个
//English: Which number is the received DTMF?
char szDtmfChose[1]; //Chinese: 存储首次收到的"1"或"2"码字
//English: stored the first received DTMF of "1" or "2"
int nFirstDtmf; //Chinese: 指示是否是首次收到"1"或"2"码字
//English: check if it is the first received DTMF "1" or "2"
int nTimer; //Chinese: 定时器号
//English: timer ID
BOOL bLinked;
}TRUNK_STRUCT;
/////////////////////////////////////////////////////////////////////////////
// CFax_Polling_VCDlg dialog
class CFax_Polling_VCDlg : public CDialog
{
public:
CFirstDlg m_FirstDlg;
CSecondDlg m_SecondDlg;
CThirdDlg m_ThirdDlg;
CFourthDlg m_FourthDlg;
CString strLab[20];
//0-IDC_STATIC_FAXSPEED 传真速率
//1-IDC_STATIC_APPEND_STOP 传真追加与终止
//2-IDC_STATIC_FAXCH 传真通道
//3-IDC_BUTTON_APPEND_FILE 浏览
//4-IDC_STATIC_FAX_MODE 收发传真方式
//5-IDC_STATIC_TRUNKCH 中继通道
//6-IDC_RADIO_AUTO 自动收发传真
//7-IDC_RADIO_MANUAL 提示收发传真
//8-IDC_STATIC_RECORD 通道录音
//9-IDC_STATIC_TRUNKCH_ID 中继通道
//10-IDC_CHECK_RECORD 录音
//11-IDC_STATIC_FAX_ID 传真ID设置
//12-IDC_STATIC_FAXCH_ID 传真通道
//13-IDC_STATIC_SETID 设置ID号
// Construction
public:
static DWORD WINAPI MyThreadFunction(LPVOID lparam);
CFax_Polling_VCDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CFax_Polling_VCDlg();
// Dialog Data
//{{AFX_DATA(CFax_Polling_VCDlg)
enum { IDD = IDD_Fax_Event_VC_DIALOG };
CComboBox m_cmbFaxCh;
CTabCtrl m_TabCtrl;
CListCtrl m_TrkChList;
CListCtrl m_FaxChList;
CComboBox m_cmbTrkChNo;
CComboBox m_cmbTrkCh;
CComboBox m_cmbFaxChNo;
CString m_strAppendFile;
int m_nAutoOrNot;
int m_nFaxSpeed;
BOOL m_bRecord;
CString m_strSetId;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFax_Polling_VCDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CFax_Polling_VCDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnRadioSpeed4800();
afx_msg void OnRadioSpeed9600();
afx_msg void OnRadioSpeed14400();
afx_msg void OnButtonAppendFile();
afx_msg void OnButtonAppendSend();
afx_msg void OnButtonFaxStop();
afx_msg void OnRadioAuto();
afx_msg void OnRadioManual();
afx_msg void OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg void OnSelchangeComboTrkCh();
afx_msg void OnCheckRecord();
afx_msg void OnSelchangeComboTrkch();
afx_msg void OnButtonSetId();
afx_msg void OnChangeEditSetId();
afx_msg void OnDestroy();
afx_msg void OnTimer(UINT nIDEvent);
virtual void OnOK()
{
}
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
int m_nTotalCh; //Chinese: 总的通道数
//English: total number of channels
char m_szErrMsg[200]; //Chinese: 出错信息
//English: error message
FAX_STRUCT m_FaxCh[500]; //Chinese: 传真通道
//English: fax channel
TRUNK_STRUCT m_TrkCh[500]; //Chinese: 中继通道
//English: trunk channel
char m_szCurPath[MAX_PATH]; //Chinese: 当前路径
//English: current path
char m_szAppendFile[50]; //Chinese: 追加传真文件
//English: append fax file
FILE *m_LogFile; //Chinese: 指向已创建的日志文件的指针
//English: pointers pointing at log file created
BOOL m_bLog; //Chinese: 是否成功创建日志文件:0-未成功 1- 成功
//English: flag indicating if log file is successfully created: 0-unsuccessful 1-successful
int m_nTabShow; //Chinese: IDC-TAB资源框的选择
//English: choices provided by IDC-TAB resource framework:
//0-IDD_FIRST_DLG 1-IDD_SECOND_DLG 2-IDD_THIRD_DLG 3-IDD_FOURTH_DLG
void UpdateTrunkChListCtrl();//Chinese: 更新中继通道列表
//English: update trunk channel list
void UpdateFaxChListCtrl(); //Chinese: 更新传真通道列表
//English: update fax channel list
void WriteLog(char* szLog); //Chinese: 写日志
//English: write log messages
BOOL InitCtiBoard(); //Chinese: 初始化板卡
//English: initialize board
int FindAnIdleFaxCh(); //Chinese: 搜索空闲传真通道
//English: search for an idle fax channel
int FindAnIdleTrunkCh(); //Chinese: 搜索空闲中继通道
//English: search for an idle trunk channel
void InitTrunkChListCtrl(); //Chinese: 初始化中继通道列表
//English: initialize trunk channel list
void InitFaxChListCtrl(); //Chinese: 初始化传真通道列表
//English: initialize fax channel list
void TrunkProc(UINT event, WPARAM wParam, LPARAM lParam);
void FaxProc(UINT event, WPARAM wParam, LPARAM lParam);
void ScanTaskQueue(); //Chinese: 扫描任务队列
//English: scan task queue
void Hangup(int nChannel); //hangup
void InitLab();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_Fax_Event_VCDLG_H__2719AD39_556B_4238_A238_791BC0DDB330__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -