资源简介
Qt编写的列车运行预警系统,适合初学都学习
代码片段和文件信息
#include “Constant.h“
#include “CTWSys.h“
#include “CTWSysItems.h“
//#include “CTWSysRecvThread.h“
//
//
//
//
CTWSys::CTWSys(QRectF *ScreenRect QWidget *parent)
: QMainWindow(parent)
{
//
m_MainWindownRect = ScreenRect;
//
//
InitDataPackage();
//
//
CreateSystemView();
//
//
CreateSystemItems();
//
//
ConnectToServer();
}
//
//
CTWSys::~CTWSys()
{
}
//
//
void CTWSys::InitDataPackage()
{
//
//
m_RecvPackage = new PACKAGE;
m_RecvPackage->baseInfo = new BINFO;
m_RecvPackage->trainPosInfo = new TINFO;
m_RecvPackage->gpsInfo = new GINFO;
m_RecvPackage->atpInfo = new AINFO;
m_RecvPackage->stationPosInfo = new SINFO;
//
//
m_CurrTrPackage = new PACKAGE;
m_CurrTrPackage->baseInfo = new BINFO;
m_CurrTrPackage->trainPosInfo = new TINFO;
m_CurrTrPackage->gpsInfo = new GINFO;
m_CurrTrPackage->atpInfo = new AINFO;
m_CurrTrPackage->stationPosInfo = new SINFO;
//
m_CurrTrPackage->trainPosInfo->DataType = 0x02;
m_CurrTrPackage->trainPosInfo->isOwn = 0x00;
m_CurrTrPackage->trainPosInfo->TrainInfo = 0x00000000;
strcpy(m_CurrTrPackage->trainPosInfo->TrainNumber “G101“);
m_CurrTrPackage->trainPosInfo->Mileage = 0;
m_CurrTrPackage->trainPosInfo->Speed = 0;
m_CurrTrPackage->trainPosInfo->Distance = 0;
m_CurrTrPackage->trainPosInfo->LineNumber = ‘0‘;
//
//
//
//
PACKAGE *PrevTrPackage = new PACKAGE;
PrevTrPackage->baseInfo = new BINFO;
PrevTrPackage->trainPosInfo = new TINFO;
PrevTrPackage->gpsInfo = new GINFO;
PrevTrPackage->atpInfo = new AINFO;
PrevTrPackage->stationPosInfo = new SINFO;
//
PrevTrPackage->trainPosInfo->DataType = 0x02;
PrevTrPackage->trainPosInfo->isOwn = 0x01;
PrevTrPackage->trainPosInfo->TrainInfo = 0x80009F06;
strcpy(PrevTrPackage->trainPosInfo->TrainNumber “G103“);
PrevTrPackage->trainPosInfo->Mileage = 15000;
PrevTrPackage->trainPosInfo->Speed = 0;
PrevTrPackage->trainPosInfo->Distance = 15000;
PrevTrPackage->trainPosInfo->LineNumber = ‘0‘;
//
m_PrevTrPKList.append(PrevTrPackage);
//
//
//
//
PACKAGE *StaPackage0 = new PACKAGE;
StaPackage0->baseInfo = new BINFO;
StaPackage0->trainPosInfo = new TINFO;
StaPackage0->gpsInfo = new GINFO;
StaPackage0->atpInfo = new AINFO;
StaPackage0->stationPosInfo = new SINFO;
//
StaPackage0->stationPosInfo->DataType = 0x05;
strcpy(StaPackage0->stationPosInfo->StationName “ZZS“);
StaPackage0->stationPosInfo->StartMileage = 220500;
StaPackage0->stationPosInfo->EndMileage = 223000;
StaPackage0->stationPosInfo->LineCount = 5;
//
// m_StationPKList.append(StaPackage0);
//
PACKAGE *StaPackage = new PACKAGE;
StaPackage->baseInfo = new BINFO;
StaPackage->trainPosInfo = new TINFO;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4151 2011-10-22 17:31 CTWSys\Constant.h
文件 16094 2011-10-22 16:29 CTWSys\CTWSys.cpp
文件 1957 2011-10-22 16:04 CTWSys\CTWSys.h
文件 382 2011-10-22 08:52 CTWSys\CTWSys.pro
文件 32671 2011-10-22 17:33 CTWSys\CTWSys.pro.user
文件 44486 2011-10-22 17:30 CTWSys\CTWSysItems.cpp
文件 5608 2011-10-22 11:10 CTWSys\CTWSysItems.h
文件 3597 2011-10-22 08:53 CTWSys\CTWSysRecvThread.cpp
文件 808 2011-10-18 13:24 CTWSys\CTWSysRecvThread.h
文件 1372 2011-10-22 11:04 CTWSys\DataPackage.h
文件 1965 2011-10-21 00:41 CTWSys\main.cpp
目录 0 2011-11-28 22:19 CTWSys
----------- --------- ---------- ----- ----
113091 12
- 上一篇:百度网盘链接地址.txt
- 下一篇:进程代数的课件 讲得比较精简
评论
共有 条评论