a
This commit is contained in:
@@ -0,0 +1,528 @@
|
||||
// UpDateTimeWindow.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "geomative.h"
|
||||
#include "UpDateTimeWindow.h"
|
||||
#include "GD10OperCmd.h"
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CUpDateTimeWindow dialog
|
||||
|
||||
extern BOOL GetSubStringInHeadAndTail(const CString& szSource, CString& szSub, const CString& szHead, const CString& szTail);
|
||||
extern int g_iTransFileMode;
|
||||
extern int g_iUILanguage;
|
||||
extern bool bIsInteger(CString strTxt);
|
||||
CUpDateTimeWindow::CUpDateTimeWindow(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CUpDateTimeWindow::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CUpDateTimeWindow)
|
||||
m_Start = 0;
|
||||
m_Width = 0;
|
||||
m_Length = 0;
|
||||
m_pDev = NULL;
|
||||
//}}AFX_DATA_INIT
|
||||
m_listArray.RemoveAll();
|
||||
}
|
||||
|
||||
|
||||
void CUpDateTimeWindow::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CUpDateTimeWindow)
|
||||
DDX_Control(pDX, IDC_TIMEWINDOW, m_TimeWindow);
|
||||
// DDX_Text(pDX, IDC_START, m_Start);
|
||||
// DDX_Text(pDX, IDC_WIDTH, m_Width);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CUpDateTimeWindow, CDialog)
|
||||
//{{AFX_MSG_MAP(CUpDateTimeWindow)
|
||||
ON_BN_CLICKED(IDC_ADD, OnAdd)
|
||||
ON_BN_CLICKED(IDC_DELELTE, OnDelelte)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CUpDateTimeWindow message handlers
|
||||
|
||||
void CUpDateTimeWindow::OnOK()
|
||||
{
|
||||
// TODO: Add extra validation here
|
||||
|
||||
if (m_listArray.GetSize() == 0)
|
||||
{
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("不能为空!"));
|
||||
else
|
||||
MessageBoxEx(NULL, _T("Windows is empty"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
return;
|
||||
}
|
||||
|
||||
//最多只能有20个时窗
|
||||
if (m_listArray.GetSize() > 20)
|
||||
{
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("时窗个数不能超过20个"));
|
||||
else
|
||||
MessageBoxEx(NULL, _T("Can not add window more than 20"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
return;
|
||||
}
|
||||
|
||||
if (NULL == m_pDev)
|
||||
{
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("设备点为空!"));
|
||||
else
|
||||
MessageBoxEx(NULL, _T("Point of device is null"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
return;
|
||||
}
|
||||
|
||||
//首先要把list里的东西都取出来
|
||||
CString szStart = _T("");
|
||||
CString szWidth = _T("");
|
||||
//将激电时窗的配置从10改到20
|
||||
int nStart[20];
|
||||
int nWidth[20];
|
||||
int n = 0;
|
||||
for (; n < 20; n++)
|
||||
{
|
||||
nStart[n] = 0;
|
||||
nWidth[n] = 0;
|
||||
}
|
||||
|
||||
|
||||
for (n = 0; n < m_TimeWindow.GetItemCount(); n++)
|
||||
{
|
||||
szStart = m_TimeWindow.GetItemText(n, 1);
|
||||
szWidth = m_TimeWindow.GetItemText(n, 3);
|
||||
|
||||
nStart[n] = atoi(szStart.GetBuffer(0));
|
||||
nWidth[n] = atoi(szWidth.GetBuffer(0));
|
||||
}
|
||||
|
||||
|
||||
|
||||
CString szOrder = _T("");
|
||||
CString szResBuff = _T("");
|
||||
CString szRes = _T("");
|
||||
if (EN_TRANSFER_FILE_BY_USB == g_iTransFileMode)
|
||||
{
|
||||
szOrder.Format(_T("*m0,%d,%d;*m1,%d,%d;*m2,%d,%d;*m3,%d,%d;*m4,%d,%d;*m5,%d,%d;*m6,%d,%d;*m7,%d,%d;*m8,%d,%d;*m9,%d,%d;")
|
||||
_T("*m10,%d,%d;*m11,%d,%d;*m12,%d,%d;*m13,%d,%d;*m14,%d,%d;*m15,%d,%d;*m16,%d,%d;*m17,%d,%d;*m18,%d,%d;*m19,%d,%d"),
|
||||
nStart[0],nWidth[0],
|
||||
nStart[1],nWidth[1],
|
||||
nStart[2],nWidth[2],
|
||||
nStart[3],nWidth[3],
|
||||
nStart[4],nWidth[4],
|
||||
nStart[5],nWidth[5],
|
||||
nStart[6],nWidth[6],
|
||||
nStart[7],nWidth[7],
|
||||
nStart[8],nWidth[8],
|
||||
nStart[9],nWidth[9],
|
||||
nStart[10],nWidth[10],
|
||||
nStart[11],nWidth[11],
|
||||
nStart[12],nWidth[12],
|
||||
nStart[13],nWidth[13],
|
||||
nStart[14],nWidth[14],
|
||||
nStart[15],nWidth[15],
|
||||
nStart[16],nWidth[16],
|
||||
nStart[17],nWidth[17],
|
||||
nStart[18],nWidth[18],
|
||||
nStart[19],nWidth[19]);
|
||||
if (CGD10OperCmd::GetInstance()->set_param(szOrder))
|
||||
{
|
||||
m_result = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("设置参数失败!"));
|
||||
else
|
||||
MessageBoxEx(NULL, _T("Set parameter failed!"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
m_result = FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
szOrder.Format(_T("set_param(\"*m0,%d,%d;*m1,%d,%d;*m2,%d,%d;*m3,%d,%d;*m4,%d,%d;*m5,%d,%d;*m6,%d,%d;*m7,%d,%d;*m8,%d,%d;*m9,%d,%d;")
|
||||
_T("*m10,%d,%d;*m11,%d,%d;*m12,%d,%d;*m13,%d,%d;*m14,%d,%d;*m15,%d,%d;*m16,%d,%d;*m17,%d,%d;*m18,%d,%d;*m19,%d,%d;\")\r\n"),
|
||||
nStart[0],nWidth[0],
|
||||
nStart[1],nWidth[1],
|
||||
nStart[2],nWidth[2],
|
||||
nStart[3],nWidth[3],
|
||||
nStart[4],nWidth[4],
|
||||
nStart[5],nWidth[5],
|
||||
nStart[6],nWidth[6],
|
||||
nStart[7],nWidth[7],
|
||||
nStart[8],nWidth[8],
|
||||
nStart[9],nWidth[9],
|
||||
nStart[10],nWidth[10],
|
||||
nStart[11],nWidth[11],
|
||||
nStart[12],nWidth[12],
|
||||
nStart[13],nWidth[13],
|
||||
nStart[14],nWidth[14],
|
||||
nStart[15],nWidth[15],
|
||||
nStart[16],nWidth[16],
|
||||
nStart[17],nWidth[17],
|
||||
nStart[18],nWidth[18],
|
||||
nStart[19],nWidth[19]);
|
||||
if (m_pDev->ExecuteOrder(szOrder, _T(">"), &szResBuff))
|
||||
{
|
||||
GetSubStringInHeadAndTail(szResBuff, szRes, _T("["), _T("]"));
|
||||
if (_T("1") != szRes)
|
||||
{
|
||||
CString strErr = _T("");
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
{
|
||||
strErr.Format(_T("执行顺序错误!result_code = %s"), szRes);
|
||||
AfxMessageBox(strErr);
|
||||
}
|
||||
else
|
||||
{
|
||||
strErr.Format(_T("Excute order error!result_code = %s"), szRes);
|
||||
MessageBoxEx(NULL, strErr, STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
}
|
||||
m_result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_result = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("下载订单到设备失败!"));
|
||||
else
|
||||
MessageBoxEx(NULL, _T("Download order to device failed!"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
m_result = FALSE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!m_result)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CString szSql = _T("");
|
||||
_CommandPtr pRecTd = NULL;
|
||||
pRecTd.CreateInstance(_uuidof(Command));
|
||||
pRecTd->ActiveConnection = m_pConnection;
|
||||
|
||||
szSql.Empty();
|
||||
szSql.Format(_T("update acds set M0ST=%d,M0TW=%d,M1ST=%d,M1TW=%d,M2ST=%d,M2TW=%d,M3ST=%d,M3TW=%d,M4ST=%d,M4TW=%d,")
|
||||
_T("M5ST=%d,M5TW=%d,M6ST=%d,M6TW=%d,M7ST=%d,M7TW=%d,M8ST=%d,M8TW=%d,M9ST=%d,M9TW=%d,M10ST=%d,M10TW=%d,M11ST=%d,M11TW=%d,")
|
||||
_T("M12ST=%d,M12TW=%d,M13ST=%d,M13TW=%d,M14ST=%d,M14TW=%d,M15ST=%d,M15TW=%d,M16ST=%d,M16TW=%d,M17ST=%d,M17TW=%d,")
|
||||
_T("M18ST=%d,M18TW=%d,M19ST=%d,M19TW=%d where DEID=%u"),
|
||||
nStart[0],nWidth[0],
|
||||
nStart[1],nWidth[1],
|
||||
nStart[2],nWidth[2],
|
||||
nStart[3],nWidth[3],
|
||||
nStart[4],nWidth[4],
|
||||
nStart[5],nWidth[5],
|
||||
nStart[6],nWidth[6],
|
||||
nStart[7],nWidth[7],
|
||||
nStart[8],nWidth[8],
|
||||
nStart[9],nWidth[9],
|
||||
nStart[10],nWidth[10],
|
||||
nStart[11],nWidth[11],
|
||||
nStart[12],nWidth[12],
|
||||
nStart[13],nWidth[13],
|
||||
nStart[14],nWidth[14],
|
||||
nStart[15],nWidth[15],
|
||||
nStart[16],nWidth[16],
|
||||
nStart[17],nWidth[17],
|
||||
nStart[18],nWidth[18],
|
||||
nStart[19],nWidth[19],
|
||||
m_dwID);
|
||||
|
||||
pRecTd->CommandText = szSql.AllocSysString();
|
||||
pRecTd->Execute(NULL, NULL, adCmdText);
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("操作成功!"));
|
||||
else
|
||||
MessageBoxEx(NULL, _T("Operation success!"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
m_sComPort.ClearCommReceiveBuff();
|
||||
m_sComPort.ClearCommSendBuff();
|
||||
|
||||
CString szOrder = _T("");
|
||||
CString szResBuff = _T("");
|
||||
CString szRes = _T("");
|
||||
char aResBuff[1024] = {0};
|
||||
int iResSize = (int)VAL_ZERO;
|
||||
int iPollingTime = (int)VAL_ZERO;
|
||||
|
||||
|
||||
szOrder.Empty();
|
||||
szOrder.Format(_T("\r\n"));
|
||||
m_sComPort.SendDataDirectly(szOrder.GetBuffer(szOrder.GetLength()), szOrder.GetLength());
|
||||
Sleep(500);
|
||||
|
||||
szOrder.ReleaseBuffer();
|
||||
szOrder.Empty();
|
||||
|
||||
m_sComPort.ClearCommSendBuff();
|
||||
m_sComPort.ClearCommReceiveBuff();
|
||||
|
||||
szOrder.Empty();
|
||||
szOrder.Format(_T("set_param(\"*m0,%d,%d;*m1,%d,%d;*m2,%d,%d;*m3,%d,%d;*m4,%d,%d;*m5,%d,%d;*m6,%d,%d;*m7,%d,%d;*m8,%d,%d;*m9,%d,%d;\")\r\n"),
|
||||
nStart[0],nWidth[0],
|
||||
nStart[1],nWidth[1],
|
||||
nStart[2],nWidth[2],
|
||||
nStart[3],nWidth[3],
|
||||
nStart[4],nWidth[4],
|
||||
nStart[5],nWidth[5],
|
||||
nStart[6],nWidth[6],
|
||||
nStart[7],nWidth[7],
|
||||
nStart[8],nWidth[8],
|
||||
nStart[9],nWidth[9]
|
||||
);
|
||||
// AfxMessageBox(szOrder);
|
||||
Sleep(100);
|
||||
m_sComPort.SendDataDirectly(szOrder.GetBuffer(szOrder.GetLength()), szOrder.GetLength());
|
||||
szOrder.ReleaseBuffer();
|
||||
// TransDelay(g_iTransMode, 100, 200);
|
||||
|
||||
iResSize = (int)VAL_ZERO;
|
||||
memset(aResBuff, 0, sizeof(aResBuff));
|
||||
szResBuff.Empty();
|
||||
iPollingTime = 0;
|
||||
while ((szResBuff.Find(_T(">")) == -1) && (iPollingTime < 3))
|
||||
{
|
||||
Sleep(500);
|
||||
while (m_sComPort.ReceiveDataDirectly(aResBuff, &iResSize) == TRUE)
|
||||
{
|
||||
szResBuff.Insert(szResBuff.GetLength(), aResBuff);
|
||||
|
||||
iResSize = (int)VAL_ZERO;
|
||||
memset(aResBuff, 0, sizeof(aResBuff));
|
||||
}
|
||||
iPollingTime++;
|
||||
}
|
||||
////////////////////////////////////////////////////////
|
||||
if (3 == iPollingTime)
|
||||
{
|
||||
m_result = FALSE;
|
||||
}
|
||||
GetSubStringInHeadAndTail(szResBuff, szRes, _T("["), _T("]"));
|
||||
|
||||
if (_T("1") != szRes)
|
||||
{
|
||||
m_result = FALSE;
|
||||
}
|
||||
|
||||
m_result = TRUE;
|
||||
|
||||
*/
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
BOOL CUpDateTimeWindow::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
m_TimeWindow.SetExtendedStyle(m_TimeWindow.GetExtendedStyle()|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
{
|
||||
SetWindowText(_T("时窗信息"));
|
||||
GetDlgItem(IDC_STATIC_TW_START)->SetWindowText(_T("起始"));
|
||||
GetDlgItem(IDC_STATIC_TW_WIDTH)->SetWindowText(_T("宽度"));
|
||||
GetDlgItem(IDC_ADD)->SetWindowText(_T("增加"));
|
||||
GetDlgItem(IDC_DELELTE)->SetWindowText(_T("删除"));
|
||||
GetDlgItem(IDOK)->SetWindowText(_T("完成"));
|
||||
GetDlgItem(IDCANCEL)->SetWindowText(_T("取消"));
|
||||
m_TimeWindow.InsertColumn(0,"序号", 40,72);
|
||||
m_TimeWindow.InsertColumn(1,"开始(ms)", 40,72);
|
||||
m_TimeWindow.InsertColumn(2,"结束(ms)", 40,72);
|
||||
m_TimeWindow.InsertColumn(3,"宽度(ms)", 40,72);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_TimeWindow.InsertColumn(0,"Index", 40,72);
|
||||
m_TimeWindow.InsertColumn(1,"Start(ms)", 40,72);
|
||||
m_TimeWindow.InsertColumn(2,"End(ms)", 40,72);
|
||||
m_TimeWindow.InsertColumn(3,"Width(ms)", 40,72);
|
||||
}
|
||||
|
||||
((CEdit*)GetDlgItem(IDC_START))->SetLimitText(10);
|
||||
((CEdit*)GetDlgItem(IDC_WIDTH))->SetLimitText(10);
|
||||
m_Start = 0;
|
||||
m_Width = 0;
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void CUpDateTimeWindow::OnAdd()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
// hHook = SetWindowsHookEx(WH_CBT,(HOOKPROC)CBTHookProc,AfxGetInstanceHandle(),NULL);
|
||||
// UpdateData(TRUE);
|
||||
CString strStart = _T(""), strWidth = _T("");
|
||||
GetDlgItem(IDC_START)->GetWindowText(strStart);
|
||||
GetDlgItem(IDC_WIDTH)->GetWindowText(strWidth);
|
||||
if (!bIsInteger(strStart) || !bIsInteger(strWidth))
|
||||
{
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("请输入整数"));
|
||||
else
|
||||
MessageBoxEx(NULL, _T("Please input an integer value!"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
return;
|
||||
}
|
||||
m_Start = atoi(strStart);
|
||||
m_Width = atoi(strWidth);
|
||||
|
||||
//起始位置要大于0且时窗宽度不能为0
|
||||
if (m_Start < 0 || m_Width == 0)
|
||||
{
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("起始时间不能小于0,并且宽度不能为为0"));
|
||||
else
|
||||
MessageBoxEx(NULL, _T("Start time can't less than zero, and time width can't be zero!"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
return;
|
||||
}
|
||||
|
||||
if ((m_Start < 0 || m_Start > 16000) || ((m_Start+m_Width) < 0 || (m_Start+m_Width) > 16000))
|
||||
{
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("起始与宽度值总和不能超过16000!"));
|
||||
else
|
||||
MessageBoxEx(NULL, _T("The sum of start and width values cannot exceed 16000."), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
return;
|
||||
}
|
||||
|
||||
// if (m_Start == m_Width)
|
||||
// {
|
||||
// if (LANG_ZHCN == g_iUILanguage)
|
||||
// AfxMessageBox(_T("宽度不能等于起点!"));
|
||||
// else
|
||||
// AfxMessageBox("width can not be equal start");
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
//时窗不可以重叠
|
||||
int nStart = 0, nWidth = 0, nEnd = 0;
|
||||
int nIndex = 0;
|
||||
CString szTmp = _T("");
|
||||
for (int n = 0; n < m_listArray.GetSize(); n++)
|
||||
{
|
||||
szTmp = m_listArray.GetAt(n);
|
||||
nIndex = szTmp.Find(";");
|
||||
|
||||
nStart = atoi(szTmp.Left(nIndex));
|
||||
nWidth = atoi(szTmp.Right(szTmp.GetLength() - nIndex - 1));
|
||||
nEnd = nStart + nWidth;
|
||||
|
||||
//取消对时窗重叠的判断added by lsq 20161124
|
||||
/*
|
||||
//判断起点在已有区间的位置
|
||||
if (m_Start < nStart) //在区间左边
|
||||
{
|
||||
if ( (m_Start + m_Width) > nStart)
|
||||
{
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("时窗位置不能有重叠!"));
|
||||
else
|
||||
AfxMessageBox("Time window can't overlap!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (m_Start < nEnd) //在区间右边
|
||||
{
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
AfxMessageBox(_T("时窗位置不能有重叠!"));
|
||||
else
|
||||
AfxMessageBox("Time window can't overlap!");
|
||||
return;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
szTmp.Empty();
|
||||
szTmp.Format("%d;%d", m_Start, m_Width);
|
||||
|
||||
m_listArray.Add(szTmp);
|
||||
|
||||
ShowWindowList();
|
||||
}
|
||||
|
||||
void CUpDateTimeWindow::OnDelelte()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
// CString szTmp = _T("");
|
||||
// int nId = 0;
|
||||
POSITION pos = m_TimeWindow.GetFirstSelectedItemPosition();
|
||||
|
||||
if (pos != NULL)
|
||||
{
|
||||
while (pos)
|
||||
{
|
||||
//获取选中的那一行,对应m_listArray中的索引
|
||||
int nItem = m_TimeWindow.GetNextSelectedItem(pos);
|
||||
//nItem -= nId;//同时删除多笔数据时,数据在m_listArray中向前移动了nItem次
|
||||
m_listArray.RemoveAt(nItem);
|
||||
ShowWindowList();
|
||||
// nId++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void CUpDateTimeWindow::ShowWindowList()
|
||||
{
|
||||
CString szStart = _T("");
|
||||
CString szWidth = _T("");
|
||||
CString szEnd = _T("");
|
||||
|
||||
CString szTmp = _T("");
|
||||
int nIndex = 0;
|
||||
|
||||
int nStart = 0;
|
||||
int nWidth = 0;
|
||||
|
||||
m_TimeWindow.DeleteAllItems();
|
||||
|
||||
for (int n = 0; n < m_listArray.GetSize(); n++)
|
||||
{
|
||||
szTmp = m_listArray.GetAt(n);
|
||||
nIndex = szTmp.Find(";");
|
||||
|
||||
szStart = szTmp.Left(nIndex);
|
||||
szWidth = szTmp.Right(szTmp.GetLength() - nIndex - 1);
|
||||
|
||||
nStart = atoi(szStart.GetBuffer(0));
|
||||
nWidth = atoi(szWidth.GetBuffer(0));
|
||||
szEnd.Format("%d", nStart + nWidth);
|
||||
|
||||
szTmp.Empty();
|
||||
szTmp.Format("M%d", n);
|
||||
m_TimeWindow.InsertItem(n, szTmp);
|
||||
m_TimeWindow.SetItemText(n, 1, szStart);
|
||||
m_TimeWindow.SetItemText(n, 2, szEnd);
|
||||
m_TimeWindow.SetItemText(n, 3, szWidth);
|
||||
|
||||
szTmp.Empty();
|
||||
szEnd.Empty();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user