Проектирование системы обработки временных списков

Курсовой проект - Компьютеры, программирование

Другие курсовые по предмету Компьютеры, программирование

ctor>

#include "resource.h"

#include "event.h"

#include

#ifndef _AFX_NO_AFXCMN_SUPPORT

#include

#endif

#include storage;

// ===== класс окна задания нового события =====================================SetNewDialog: public CDialog

{:(char *DialogName, CWnd *Owner):((LPCTSTR)DialogName, Owner){};_msg void OnButtonAdd();_MESSAGE_MAP()

};_MESSAGE_MAP(SetNewDialog, CDialog)_COMMAND(IDADD,OnButtonAdd)_MESSAGE_MAP()_msg void SetNewDialog::OnButtonAdd()

{Y,M,D,H,Min,S,type,mess;(IDC_COMBO1)->GetWindowTextW(type);(IDC_EDIT7)->GetWindowTextW(mess);(IDC_EDIT7)->SetWindowTextW(NULL);(IDC_EDIT1)->GetWindowTextW(Y);(IDC_EDIT1)->SetWindowTextW(NULL);(IDC_EDIT2)->GetWindowTextW(M);(IDC_EDIT2)->SetWindowTextW(NULL);(IDC_EDIT3)->GetWindowTextW(D);(IDC_EDIT3)->SetWindowTextW(NULL);(IDC_EDIT4)->GetWindowTextW(H);(IDC_EDIT4)->SetWindowTextW(NULL);(IDC_EDIT5)->GetWindowTextW(Min);(IDC_EDIT5)->SetWindowTextW(NULL);(IDC_EDIT6)->GetWindowTextW(S);(IDC_EDIT6)->SetWindowTextW(NULL);.push_back(event(_ttoi(Y),_ttoi(M),_ttoi(D),_ttoi(H),_ttoi(Min),_ttoi(S),type,mess));

}

// ===== класс окна вывода всех событий ================================ShowAllDialog: public CDialog

{:(char *DialogName, CWnd *Owner):((LPCTSTR)DialogName, Owner){};_msg void OnButtonShow()

GetDlgItem(IDC_LIST2));*NeedFont=newCFont;>CreatePointFont(80,L"CourierNew");inti=0;buf;st;(IDC_LIST2)->SetFont(NeedFont);>ResetContent();(i=0;iResetContent();(i=0;i<storage.size();i++)

AddString(buf);">{=storage[i].GetTime();.Format(_T("%-24.24s %4.4d/%-2.2d/%-2.2d/%-2.2d/%-2.2d/%-2.2d s"),storage[i].GetMessage(),st.wYear,st.wMonth,st.wDay,st.wHour,st.wMinute,st.wSecond,storage[i].GetType());>AddString(buf);

}

};_MESSAGE_MAP()

};_MESSAGE_MAP(ShowAllDialog, CDialog)_COMMAND(IDShow,OnButtonShow)_MESSAGE_MAP()

// ===== класс окна вывода событий в конкретное время========================ShowEventsAt: public CDialog

{:(char *DialogName, CWnd *Owner):((LPCTSTR)DialogName, Owner){};_msg void OnButtonShow()

GetDlgItem(IDC_LIST2));>CreatePointFont(80,L"CourierNew");>SetFont(NeedFont);(IDC_EDIT1)->GetWindowTextW(Y);(IDC_EDIT2)->GetWindowTextW(M);(IDC_EDIT3)->GetWindowTextW(D);(IDC_EDIT4)->GetWindowTextW(H);(IDC_EDIT5)->GetWindowTextW(Min);(IDC_EDIT6)->GetWindowTextW(S);temp(_ttoi(Y),_ttoi(M),_ttoi(D),_ttoi(H),_ttoi(Min),_ttoi(S),"","");>ResetContent();(i=0;iResetContent();(i=0;i<storage.size();i++)

{(temp==storage[i])

AddString(buf);">{=storage[i].GetTime();.Format(_T("%-24.24s %4.4d/%-2.2d/%-2.2d/%-2.2d/%-2.2d/%-2.2d s"),storage[i].GetMessage(),st.wYear,st.wMonth,st.wDay,st.wHour,st.wMinute,st.wSecond,storage[i].GetType());>AddString(buf);

}

}

}_MESSAGE_MAP()

};_MESSAGE_MAP(ShowEventsAt, CDialog)_COMMAND(IDShow,OnButtonShow)_MESSAGE_MAP()

// ===== класс окна вывода событий в интервале времени =========================ShowEventsInInterval: public CDialog

{:(char *DialogName, CWnd *Owner):((LPCTSTR)DialogName, Owner){};_msg void OnButtonShow();_MESSAGE_MAP()

};_MESSAGE_MAP(ShowEventsInInterval, CDialog)_COMMAND(IDShow,OnButtonShow)_MESSAGE_MAP()

_msg void ShowEventsInInterval::OnButtonShow()

GetDlgItem(IDC_LIST1));>CreatePointFont(80,L"CourierNew");>SetFont(NeedFont);st;(IDC_EDIT1)->GetWindowTextW(Y);(IDC_EDIT2)->GetWindowTextW(M);(IDC_EDIT3)->GetWindowTextW(D);(IDC_EDIT4)->GetWindowTextW(H);(IDC_EDIT5)->GetWindowTextW(Min);(IDC_EDIT6)->GetWindowTextW(S);temp1(_ttoi(Y),_ttoi(M),_ttoi(D),_ttoi(H),_ttoi(Min),_ttoi(S),"","");(IDC_EDIT7)->GetWindowTextW(Y);(IDC_EDIT8)->GetWindowTextW(M);(IDC_EDIT9)->GetWindowTextW(D);(IDC_EDIT10)->GetWindowTextW(H);(IDC_EDIT11)->GetWindowTextW(Min);(IDC_EDIT12)->GetWindowTextW(S);temp2(_ttoi(Y),_ttoi(M),_ttoi(D),_ttoi(H),_ttoi(Min),_ttoi(S),"","");>ResetContent();(i=0;iResetContent();(i=0;i<storage.size();i++)

{(storage[i]>temp1 && temp2>storage[i])

AddString(buf);">{=storage[i].GetTime();.Format(_T("%-24.24s %4.4d/%-2.2d/%-2.2d/%-2.2d/%-2.2d/%-2.2d s"),storage[i].GetMessage(),st.wYear,st.wMonth,st.wDay,st.wHour,st.wMinute,st.wSecond,storage[i].GetType());>AddString(buf);

}

}

}

 

// ===== класс окна вывода прошедших событий сначала =======================ShowEventsFromBegining: public CDialog

{:(char *DialogName, CWnd *Owner):((LPCTSTR)DialogName, Owner){};_msg void OnButtonShow();_MESSAGE_MAP()

};_MESSAGE_MAP(ShowEventsFromBegining, CDialog)_COMMAND(IDShow,OnButtonShow)_MESSAGE_MAP()_msg void ShowEventsFromBegining::OnButtonShow()

GetDlgItem(IDC_LIST2));*NeedFont=newCFont;>CreatePointFont(80,L"CourierNew");(IDC_LIST2)->SetFont(NeedFont);>ResetContent();(i=0;iResetContent();(i=0;i<storage.size();i++)

{(temp>storage[i])

AddString(buf);">{=storage[i].GetTime();.Format(_T("%-24.24s %4.4d/%-2.2d/%-2.2d/%-2.2d/%-2.2d/%-2.2d s"),storage[i].GetMessage(),st.wYear,st.wMonth,st.wDay,st.wHour,st.wMinute,st.wSecond,storage[i].GetType());>AddString(buf);

}

}

}

// ===== класс проверки наличия событий в заданном интервале ===================CheckInInterval: public CDialog

{:(char *DialogName, CWnd *Owner):((LPCTSTR)DialogName, Owner){};_msg void OnButtonCheck();_MESSAGE_MAP()

};_MESSAGE_MAP(CheckInInterval, CDialog)_COMMAND(IDCheck, OnButtonCheck)_MESSAGE_MAP()_msg void CheckInInterval::OnButtonCheck()

GetWindowTextW(Y);(IDC_EDIT2)->GetWindowTextW(M);(IDC_EDIT3)->GetWindowTextW(D);(IDC_EDIT4)->GetWindowTextW(H);(IDC_EDIT5)->GetWindowTextW(Min);(IDC_EDIT6)->GetWindowTextW(S);temp1(_ttoi(Y),_ttoi(M),_ttoi(D),_ttoi(H),_ttoi(Min),_ttoi(S),"","");(IDC_EDIT7)->GetWindowTextW(Y);(IDC_EDIT8)->GetWindowTextW(M);(IDC_EDIT9)->GetWindowTextW(D);(IDC_EDIT10)->GetWindowTextW(H);(IDC_EDIT11)->GetWindowTextW(Min);(IDC_EDIT12)->GetWindowTextW(S);temp2(_ttoi(Y),_ttoi(M),_ttoi(D),_ttoi(H),_ttoi(Min),_ttoi(S),"","");(i=0;iGetWindowTextW(S);temp2(_ttoi(Y),_ttoi(M),_ttoi(D),_ttoi(H),_ttoi(Min),_ttoi(S),"","");(i=0;i<storage.size();i++)

{(storage[i]>temp1 && temp2>storage[i])

{++;

}

}.Format(L"Number of events in this inteval: %d",n);(message,L"Nunber of events");

}

// ===== класс проверки наличия событий в заданное время =======================CheckInTime: public CDialog

{:(char *DialogName, CWnd *Owner):((LPCTSTR)DialogName, Owner){};_msg void OnButtonCheck();_MESSAGE_MAP()

};_MESSAGE_MAP(CheckInTime, CDialog)_COMMAND(IDCheck,OnButtonCheck)_MESSAGE_MAP()_msg void CheckInTime::OnButtonCheck()

GetWindowTextW(Y);(IDC_EDIT2)->GetWindowTextW(M);(IDC_EDIT3)->GetWindowTextW(D);(IDC_EDIT4)->GetWindowTextW(H);(IDC_EDIT5)->GetWindowTextW(Min);(IDC_EDIT6)->GetWindowTextW(S);temp(_ttoi(Y),_ttoi(M),_ttoi