Ajout des infos Modbus aux fichiers de passage
-Modification des fichiers de passage pour inclure les infos supplémentaires obtenus par Modbus (type et composition du train)
This commit is contained in:
parent
7868264c95
commit
fcfa86a27b
@ -76,11 +76,11 @@ ENGLOG=3
|
|||||||
#STATION=ANGRIGNON
|
#STATION=ANGRIGNON
|
||||||
#STATION=HENRI_BOURASSA
|
#STATION=HENRI_BOURASSA
|
||||||
#STATION=COTE_VERTU
|
#STATION=COTE_VERTU
|
||||||
#STATION=BERRI_UQAM
|
STATION=BERRI_UQAM
|
||||||
#STATION=LONGUEIL
|
#STATION=LONGUEIL
|
||||||
#STATION=SAINT_MICHEL
|
#STATION=SAINT_MICHEL
|
||||||
#STATION=SNOWDON_L5
|
#STATION=SNOWDON_L5
|
||||||
#STATION=MONTMORENCY
|
#STATION=MONTMORENCY
|
||||||
#STATION=MONTMORENCY_10_12
|
#STATION=MONTMORENCY_10_12
|
||||||
#STATION=MONTMORENCY_10_22
|
#STATION=MONTMORENCY_10_22
|
||||||
STATION=DU_COLLEGE
|
#STATION=DU_COLLEGE
|
||||||
|
|||||||
Binary file not shown.
@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
#define DEFAULT_PASSWORD "zonetest"
|
#define DEFAULT_PASSWORD "zonetest"
|
||||||
#define BASE_FILE_MAGICNBR 0xDEADBEEF
|
#define BASE_FILE_MAGICNBR 0xDEADBEEF
|
||||||
#define TRAINLOG_FILE_MAGICNBR BASE_FILE_MAGICNBR + 1
|
#define TRAINLOG_FILE_MAGICNBR BASE_FILE_MAGICNBR + 15
|
||||||
|
|
||||||
|
|
||||||
//Misc definitions
|
//Misc definitions
|
||||||
|
|||||||
@ -519,13 +519,32 @@ void CLogsListPage::ShowItemSummary(CLogElement *Element)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Summary.sprintf("Statistiques du passage:\n\nDate: %s\nHeure: %s\nTrain : %s\nNombre d'éléments: %d\nVitesse moyenne : %f mph\nPassage problématique: %s\n\nDéclenchements: \n",
|
QString Composition("Inconnue");
|
||||||
ZT1LogElement->mPassageDateTime.toString("yyyy/MM/dd").toAscii().data(),
|
if(ZT1LogElement->mFlags.mTrainCompo1 != 0) //if compo is valid, this will be != 0...
|
||||||
ZT1LogElement->mPassageDateTime.toString("hh:mm:ss").toAscii().data(),
|
{
|
||||||
CZTData::GetTrainTypeString(ZT1LogElement->mTrainType),
|
Composition = QString("%1 - %2 - %3").arg(ZT1LogElement->mFlags.mTrainCompo1).arg(ZT1LogElement->mFlags.mTrainCompo2).arg(ZT1LogElement->mFlags.mTrainCompo3);
|
||||||
ZT1LogElement->mNbElements,
|
}
|
||||||
MeanSpeed,
|
QString TrainType = CZTData::GetTrainTypeString(ZT1LogElement->mTrainType);
|
||||||
Problem.toUtf8().data());
|
if(ZT1LogElement->mFlags.mModbusTrainType != MODBUS_CC_TRAIN_TYPE_INVALID_NOT_UPDATED)
|
||||||
|
{
|
||||||
|
TrainType = CZTData::GetModbusTrainTypeString(ZT1LogElement->mFlags.mModbusTrainType);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Summary.sprintf("Statistiques du passage:\n\nDate: %s\nHeure: %s\nTrain : %s\nNombre d'éléments: %d\nVitesse moyenne : %f mph\nPassage problématique: %s\n\nDéclenchements: \n",
|
||||||
|
// ZT1LogElement->mPassageDateTime.toString("yyyy/MM/dd").toAscii().data(),
|
||||||
|
// ZT1LogElement->mPassageDateTime.toString("hh:mm:ss").toAscii().data(),
|
||||||
|
// CZTData::GetTrainTypeString(ZT1LogElement->mTrainType),
|
||||||
|
// ZT1LogElement->mNbElements,
|
||||||
|
// MeanSpeed,
|
||||||
|
// Problem.toUtf8().data());
|
||||||
|
|
||||||
|
Summary = QString("Statistiques du passage:\n\nDate: %1\nHeure: %2\nTrain : %3\nNombre d'éléments: %4\nComposition : %5\nPassage problématique: %6\n\nDéclenchements: \n")\
|
||||||
|
.arg(ZT1LogElement->mPassageDateTime.toString("yyyy/MM/dd"))\
|
||||||
|
.arg(ZT1LogElement->mPassageDateTime.toString("hh:mm:ss"))\
|
||||||
|
.arg(TrainType)\
|
||||||
|
.arg(ZT1LogElement->mNbElements)\
|
||||||
|
.arg(Composition)\
|
||||||
|
.arg(Problem.toUtf8().data());
|
||||||
|
|
||||||
if(ZT1LogElement->mZTDetections.size() > 0)
|
if(ZT1LogElement->mZTDetections.size() > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -453,6 +453,17 @@ qint16 CModbusCCMgr::GetZT1TrainType()
|
|||||||
return Type;
|
return Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint16 CModbusCCMgr::GetZT1RawTrainType()
|
||||||
|
{
|
||||||
|
bool OK = false;
|
||||||
|
return mModbusRepo->GetSingleReg(MODBUS_CC_ZT1_TRAIN_TYPE_REG_ADD,&OK);
|
||||||
|
}
|
||||||
|
qint16 CModbusCCMgr::GetZT2RawTrainType()
|
||||||
|
{
|
||||||
|
bool OK = false;
|
||||||
|
return mModbusRepo->GetSingleReg(MODBUS_CC_ZT2_TRAIN_TYPE_REG_ADD,&OK);
|
||||||
|
}
|
||||||
|
|
||||||
qint16 CModbusCCMgr::GetZT2TrainType()
|
qint16 CModbusCCMgr::GetZT2TrainType()
|
||||||
{
|
{
|
||||||
bool OK = false;
|
bool OK = false;
|
||||||
|
|||||||
@ -67,7 +67,9 @@ public:
|
|||||||
bool GetZT2InhibitionFlag(); //Retourne l'état de l'inhibition de ZT2
|
bool GetZT2InhibitionFlag(); //Retourne l'état de l'inhibition de ZT2
|
||||||
int ClearZT2InhibitionFlag(); //Désactive l'inhibition ZT2
|
int ClearZT2InhibitionFlag(); //Désactive l'inhibition ZT2
|
||||||
qint16 GetZT1TrainType(); //Retourne le type de train actuel ZT1
|
qint16 GetZT1TrainType(); //Retourne le type de train actuel ZT1
|
||||||
qint16 GetZT2TrainType(); //Retourne le type de train actuel ZT1
|
qint16 GetZT2TrainType(); //Retourne le type de train actuel ZT2
|
||||||
|
qint16 GetZT1RawTrainType(); //Retourne le type de train
|
||||||
|
qint16 GetZT2RawTrainType(); //Retourne le type de train
|
||||||
int SetZTWatchdogEnabled(bool Enabled); //Permet de désactiver le Watchdog de la ZT (pour le mode entretien)
|
int SetZTWatchdogEnabled(bool Enabled); //Permet de désactiver le Watchdog de la ZT (pour le mode entretien)
|
||||||
int SetActivatedITI(int ITI); //Fixe l'itinéraire ZT1 cheminé par le train pour en informer la CC
|
int SetActivatedITI(int ITI); //Fixe l'itinéraire ZT1 cheminé par le train pour en informer la CC
|
||||||
|
|
||||||
|
|||||||
@ -104,104 +104,104 @@ unsigned int CSimulationScenario::CreateScenario()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//// //ZT2
|
// //ZT2
|
||||||
|
|
||||||
|
|
||||||
// InsertNewStep(STEP_ACTION_REGISTER_ZT2_ITI,300);
|
InsertNewStep(STEP_ACTION_REGISTER_ZT2_ITI,300);
|
||||||
// InsertNewStep(STEP_ACTION_OCCUPY_ZT2,300);
|
InsertNewStep(STEP_ACTION_OCCUPY_ZT2,300);
|
||||||
|
|
||||||
// for(int bogie = 1; bogie <= 18; bogie++)
|
for(int bogie = 1; bogie <= 18; bogie++)
|
||||||
// {
|
{
|
||||||
// InsertNewStep(STEP_ACTION_ACTIVATE_ZT2_S1,SENSOR_DELAY);
|
InsertNewStep(STEP_ACTION_ACTIVATE_ZT2_S1,SENSOR_DELAY);
|
||||||
// InsertNewStep(STEP_ACTION_DEACTIVATE_ZT2_S1,BOGIE_DELAY);
|
InsertNewStep(STEP_ACTION_DEACTIVATE_ZT2_S1,BOGIE_DELAY);
|
||||||
|
|
||||||
// // if(bogie == 5 || bogie == 2)
|
// if(bogie == 5 || bogie == 2)
|
||||||
// {
|
{
|
||||||
// // InsertNewStep(STEP_ACTION_ACTIVATE_ZT2_PPE,5);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_ZT2_PPE,5);
|
||||||
// // InsertNewStep(STEP_ACTION_DEACTIVATE_ZT2_PPE,1);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_ZT2_PPE,1);
|
||||||
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // if(bogie == 3 || bogie == 10)
|
// if(bogie == 3 || bogie == 10)
|
||||||
// {
|
{
|
||||||
//// InsertNewStep(STEP_ACTION_ACTIVATE_ZT2_PPI,3);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_ZT2_PPI,3);
|
||||||
//// InsertNewStep(STEP_ACTION_DEACTIVATE_ZT2_PPI,1);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_ZT2_PPI,1);
|
||||||
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //if(bogie != 3)
|
//if(bogie != 3)
|
||||||
// {
|
{
|
||||||
// InsertNewStep(STEP_ACTION_ACTIVATE_ZT2_S1,SENSOR_DELAY);
|
InsertNewStep(STEP_ACTION_ACTIVATE_ZT2_S1,SENSOR_DELAY);
|
||||||
// InsertNewStep(STEP_ACTION_DEACTIVATE_ZT2_S1,BOGIE_DELAY);
|
InsertNewStep(STEP_ACTION_DEACTIVATE_ZT2_S1,BOGIE_DELAY);
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
// InsertNewStep(STEP_ACTION_DESTROY_ZT2_ITI,800);
|
InsertNewStep(STEP_ACTION_DESTROY_ZT2_ITI,800);
|
||||||
// InsertNewStep(STEP_ACTION_FREE_ZT2,800);
|
InsertNewStep(STEP_ACTION_FREE_ZT2,800);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//// MR
|
//// MR
|
||||||
InsertNewStep(STEP_ACTION_REGISTER_ZT1_ITI,300);
|
// InsertNewStep(STEP_ACTION_REGISTER_ZT1_ITI,300);
|
||||||
InsertNewStep(STEP_ACTION_OCCUPY_ZT1_APPROACH,300);
|
// InsertNewStep(STEP_ACTION_OCCUPY_ZT1_APPROACH,300);
|
||||||
InsertNewStep(STEP_ACTION_OCCUPY_ZT1,300);
|
// InsertNewStep(STEP_ACTION_OCCUPY_ZT1,300);
|
||||||
|
|
||||||
for(int bogie = 1; bogie <= 12; bogie++)
|
// for(int bogie = 1; bogie <= 12; bogie++)
|
||||||
{
|
// {
|
||||||
// if(bogie != 5 && bogie != 7)
|
// // if(bogie != 5 && bogie != 7)
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_PGI,0);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_PGI,0);
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_PGE,0);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_PGE,0);
|
||||||
//V00 DETECTION
|
////V00 DETECTION
|
||||||
if(bogie != 9)
|
// if(bogie != 9)
|
||||||
{
|
// {
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_S1,SENSOR_DELAY);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_S1,SENSOR_DELAY);
|
||||||
}
|
// }
|
||||||
InsertNewStep(STEP_ACTION_DEACTIVATE_S1,BOGIE_DELAY);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_S1,BOGIE_DELAY);
|
||||||
InsertNewStep(STEP_ACTION_DEACTIVATE_PGI,0);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_PGI,0);
|
||||||
InsertNewStep(STEP_ACTION_DEACTIVATE_PGE,0);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_PGE,0);
|
||||||
|
|
||||||
//FN DETECTION
|
////FN DETECTION
|
||||||
if(bogie != 5 && bogie != 8 && bogie != 3)
|
// if(bogie != 5 && bogie != 8 && bogie != 3)
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_FN,0);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_FN,0);
|
||||||
|
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_S1,SENSOR_DELAY);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_S1,SENSOR_DELAY);
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_S2,SENSOR_DELAY);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_S2,SENSOR_DELAY);
|
||||||
InsertNewStep(STEP_ACTION_DEACTIVATE_S1,BOGIE_DELAY);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_S1,BOGIE_DELAY);
|
||||||
|
|
||||||
//PPI DETECTION
|
////PPI DETECTION
|
||||||
// if(bogie == 6 || bogie == 9)
|
//// if(bogie == 6 || bogie == 9)
|
||||||
// InsertNewStep(STEP_ACTION_ACTIVATE_PPI,0);
|
//// InsertNewStep(STEP_ACTION_ACTIVATE_PPI,0);
|
||||||
|
|
||||||
//FN DETECTION
|
////FN DETECTION
|
||||||
if(bogie != 5 && bogie != 8 && bogie != 3)
|
// if(bogie != 5 && bogie != 8 && bogie != 3)
|
||||||
InsertNewStep(STEP_ACTION_DEACTIVATE_FN,0);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_FN,0);
|
||||||
|
|
||||||
// InsertNewStep(STEP_ACTION_ACTIVATE_S2,SENSOR_DELAY);
|
//// InsertNewStep(STEP_ACTION_ACTIVATE_S2,SENSOR_DELAY);
|
||||||
InsertNewStep(STEP_ACTION_DEACTIVATE_S2,BOGIE_DELAY);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_S2,BOGIE_DELAY);
|
||||||
|
|
||||||
//PPI DETECTION
|
////PPI DETECTION
|
||||||
// if(bogie == 6 || bogie == 9)
|
//// if(bogie == 6 || bogie == 9)
|
||||||
// InsertNewStep(STEP_ACTION_DEACTIVATE_PPI,0);
|
//// InsertNewStep(STEP_ACTION_DEACTIVATE_PPI,0);
|
||||||
|
|
||||||
// if(bogie != 2 && bogie != 11)
|
// // if(bogie != 2 && bogie != 11)
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_PGI,0);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_PGI,0);
|
||||||
// if(bogie != 2 && bogie != 11)
|
// // if(bogie != 2 && bogie != 11)
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_PGE,0);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_PGE,0);
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_S2,SENSOR_DELAY);
|
// InsertNewStep(STEP_ACTION_ACTIVATE_S2,SENSOR_DELAY);
|
||||||
InsertNewStep(STEP_ACTION_DEACTIVATE_S2,BOGIE_DELAY);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_S2,BOGIE_DELAY);
|
||||||
InsertNewStep(STEP_ACTION_DEACTIVATE_PGI,0);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_PGI,0);
|
||||||
InsertNewStep(STEP_ACTION_DEACTIVATE_PGE,0);
|
// InsertNewStep(STEP_ACTION_DEACTIVATE_PGE,0);
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
InsertNewStep(STEP_ACTION_DESTROY_ZT1_ITI,800);
|
// InsertNewStep(STEP_ACTION_DESTROY_ZT1_ITI,800);
|
||||||
|
|
||||||
InsertNewStep(STEP_ACTION_FREE_ZT1,800);
|
// InsertNewStep(STEP_ACTION_FREE_ZT1,800);
|
||||||
|
|
||||||
InsertNewStep(STEP_ACTION_FREE_ZT1_APPROACH,800);
|
// InsertNewStep(STEP_ACTION_FREE_ZT1_APPROACH,800);
|
||||||
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,7 @@ unsigned int CTrainLogFileMgr::SaveTrainLog(QString LogFilePathName, CZT1Log *ZT
|
|||||||
|
|
||||||
QDataStream * OutputStream = new QDataStream(BinaryLogFile);
|
QDataStream * OutputStream = new QDataStream(BinaryLogFile);
|
||||||
|
|
||||||
quint32 MagicNbr = BASE_FILE_MAGICNBR+1;
|
quint32 MagicNbr = TRAINLOG_FILE_MAGICNBR;
|
||||||
|
|
||||||
quint32 NbLogEntry = 0,NbDetections = 0;
|
quint32 NbLogEntry = 0,NbDetections = 0;
|
||||||
quint32 LogType = ZT1_LOG_TYPE;
|
quint32 LogType = ZT1_LOG_TYPE;
|
||||||
@ -68,6 +68,7 @@ unsigned int CTrainLogFileMgr::SaveTrainLog(QString LogFilePathName, CZT1Log *ZT
|
|||||||
quint64 ThreadDataStartTime = 0, ThreadDataEndTime = 0;
|
quint64 ThreadDataStartTime = 0, ThreadDataEndTime = 0;
|
||||||
qreal MeanSpeed = 0;
|
qreal MeanSpeed = 0;
|
||||||
QDateTime DateTime;
|
QDateTime DateTime;
|
||||||
|
const quint32 OutilZTReservedFlags[10] = {0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE};
|
||||||
|
|
||||||
|
|
||||||
//Compute some stats
|
//Compute some stats
|
||||||
@ -125,11 +126,20 @@ unsigned int CTrainLogFileMgr::SaveTrainLog(QString LogFilePathName, CZT1Log *ZT
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
*OutputStream << MagicNbr << LogType << NbLogEntry << NbDetections;
|
*OutputStream << MagicNbr;
|
||||||
|
for(int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
*OutputStream << OutilZTReservedFlags[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
*OutputStream << LogType << NbLogEntry << NbDetections;
|
||||||
*OutputStream << StationName;
|
*OutputStream << StationName;
|
||||||
|
|
||||||
*OutputStream << ZT1Log->mZT1Flags;
|
*OutputStream << ZT1Log->mZT1Flags;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*OutputStream << TrainType << NbElements << ThreadDataStartTime << ThreadDataEndTime << MeanSpeed << DateTime;
|
*OutputStream << TrainType << NbElements << ThreadDataStartTime << ThreadDataEndTime << MeanSpeed << DateTime;
|
||||||
|
|
||||||
|
|
||||||
@ -183,7 +193,7 @@ unsigned int CTrainLogFileMgr::SaveTrainLog(QString LogFilePathName,CZT2Log *ZT2
|
|||||||
|
|
||||||
QDataStream * OutputStream = new QDataStream(BinaryLogFile);
|
QDataStream * OutputStream = new QDataStream(BinaryLogFile);
|
||||||
|
|
||||||
quint32 MagicNbr = BASE_FILE_MAGICNBR+1;
|
quint32 MagicNbr = TRAINLOG_FILE_MAGICNBR;
|
||||||
|
|
||||||
quint32 NbLogEntry,NbDetections;
|
quint32 NbLogEntry,NbDetections;
|
||||||
quint32 LogType = ZT2_LOG_TYPE;
|
quint32 LogType = ZT2_LOG_TYPE;
|
||||||
@ -191,7 +201,7 @@ unsigned int CTrainLogFileMgr::SaveTrainLog(QString LogFilePathName,CZT2Log *ZT2
|
|||||||
NbDetections = ZT2DetectionsLog->size();
|
NbDetections = ZT2DetectionsLog->size();
|
||||||
quint32 NbElements = 0;
|
quint32 NbElements = 0;
|
||||||
QDateTime DateTime = ZT2Log->mZT2LogData.at(0)->mDateTime;
|
QDateTime DateTime = ZT2Log->mZT2LogData.at(0)->mDateTime;
|
||||||
|
const quint32 OutilZTReservedFlags[10] = {0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE,0xBAADCAFE};
|
||||||
|
|
||||||
//Get some stats
|
//Get some stats
|
||||||
for(int j = 0; j < ZT2Log->mZT2LogData.size(); j++)
|
for(int j = 0; j < ZT2Log->mZT2LogData.size(); j++)
|
||||||
@ -208,11 +218,18 @@ unsigned int CTrainLogFileMgr::SaveTrainLog(QString LogFilePathName,CZT2Log *ZT2
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
*OutputStream << MagicNbr << LogType << NbLogEntry << NbDetections;
|
*OutputStream << MagicNbr;
|
||||||
|
for(int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
*OutputStream << OutilZTReservedFlags[i];
|
||||||
|
}
|
||||||
|
*OutputStream << LogType << NbLogEntry << NbDetections;
|
||||||
*OutputStream << StationName;
|
*OutputStream << StationName;
|
||||||
|
|
||||||
*OutputStream << ZT2Log->mZT2Flags;
|
*OutputStream << ZT2Log->mZT2Flags;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*OutputStream << NbElements << DateTime;
|
*OutputStream << NbElements << DateTime;
|
||||||
|
|
||||||
//write detections
|
//write detections
|
||||||
@ -263,7 +280,7 @@ CLogElement* CTrainLogFileMgr::OpenTrainLog(QString LogFilePathName,unsigned int
|
|||||||
quint32 MagicNbr,NbLogEntry,NbDetections,LogType;
|
quint32 MagicNbr,NbLogEntry,NbDetections,LogType;
|
||||||
|
|
||||||
*InputStream >> MagicNbr;
|
*InputStream >> MagicNbr;
|
||||||
if(MagicNbr != BASE_FILE_MAGICNBR+1)
|
if(MagicNbr != TRAINLOG_FILE_MAGICNBR)
|
||||||
{
|
{
|
||||||
|
|
||||||
CEngLog::instance()->AddLogString(QString().sprintf("Fichier de passage invalide (Magic number) %s",LogFilePathName.toAscii().data()),3);
|
CEngLog::instance()->AddLogString(QString().sprintf("Fichier de passage invalide (Magic number) %s",LogFilePathName.toAscii().data()),3);
|
||||||
@ -274,6 +291,9 @@ CLogElement* CTrainLogFileMgr::OpenTrainLog(QString LogFilePathName,unsigned int
|
|||||||
Retvalue = RET_ERROR;
|
Retvalue = RET_ERROR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
quint32 OutilZTFlags;
|
||||||
|
for(int i = 0; i < 10; i++)
|
||||||
|
*InputStream >> OutilZTFlags;
|
||||||
|
|
||||||
*InputStream >> LogType;
|
*InputStream >> LogType;
|
||||||
|
|
||||||
@ -291,11 +311,11 @@ CLogElement* CTrainLogFileMgr::OpenTrainLog(QString LogFilePathName,unsigned int
|
|||||||
|
|
||||||
PassageLog->mLogFileName = LogFilePathName;
|
PassageLog->mLogFileName = LogFilePathName;
|
||||||
|
|
||||||
|
|
||||||
*InputStream >> NbLogEntry;
|
*InputStream >> NbLogEntry;
|
||||||
*InputStream >> NbDetections;
|
*InputStream >> NbDetections;
|
||||||
*InputStream >> PassageLog->mStationName;
|
*InputStream >> PassageLog->mStationName;
|
||||||
*InputStream >> PassageLog->mFlags;
|
*InputStream >> PassageLog->mFlags;
|
||||||
|
|
||||||
*InputStream >> PassageLog->mTrainType;
|
*InputStream >> PassageLog->mTrainType;
|
||||||
*InputStream >> PassageLog->mNbElements;
|
*InputStream >> PassageLog->mNbElements;
|
||||||
*InputStream >> PassageLog->mThreadDataStartTime;
|
*InputStream >> PassageLog->mThreadDataStartTime;
|
||||||
@ -354,6 +374,7 @@ CLogElement* CTrainLogFileMgr::OpenTrainLog(QString LogFilePathName,unsigned int
|
|||||||
*InputStream >> NbDetections;
|
*InputStream >> NbDetections;
|
||||||
*InputStream >> PassageLog->mStationName;
|
*InputStream >> PassageLog->mStationName;
|
||||||
*InputStream >> PassageLog->mFlags;
|
*InputStream >> PassageLog->mFlags;
|
||||||
|
|
||||||
*InputStream >> NbElements;
|
*InputStream >> NbElements;
|
||||||
*InputStream >> DateTime;
|
*InputStream >> DateTime;
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "ZTData.h"
|
#include "ZTData.h"
|
||||||
|
#include "ModbusCCMgr.h"
|
||||||
|
|
||||||
const char * CZTData::TrainTypeString[] = {"Inconnu","MR63/73", "MPM10", "MR63", "MR73", "Véhicule Travaux"};
|
const char * CZTData::TrainTypeString[] = {"Inconnu","MR63/73", "MPM10", "MR63", "MR73", "Véhicule Travaux"};
|
||||||
CZTData::CZTData()
|
CZTData::CZTData()
|
||||||
@ -82,6 +83,41 @@ const char* CZTData::GetTrainTypeString(unsigned int TrainType)
|
|||||||
return TrainTypeString[TrainType];
|
return TrainTypeString[TrainType];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* CZTData::GetModbusTrainTypeString(unsigned int TrainType)
|
||||||
|
{
|
||||||
|
switch(TrainType)
|
||||||
|
{
|
||||||
|
case MODBUS_CC_TRAIN_TYPE_MR63:
|
||||||
|
{
|
||||||
|
return "MR63";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case MODBUS_CC_TRAIN_TYPE_MR73:
|
||||||
|
{
|
||||||
|
return "MR73";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case MODBUS_CC_TRAIN_TYPE_MPM10:
|
||||||
|
{
|
||||||
|
return "MPM10";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case MODBUS_CC_TRAIN_TYPE_MAINTENANCE:
|
||||||
|
{
|
||||||
|
return "Vehicule Travaux";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case MODBUS_CC_TRAIN_TYPE_INVALID_ATS_OFFLINE:
|
||||||
|
case MODBUS_CC_TRAIN_TYPE_INVALID_SERVICE_REBOOT:
|
||||||
|
case MODBUS_CC_TRAIN_TYPE_INVALID_NOT_UPDATED:
|
||||||
|
case MODBUS_CC_TRAIN_TYPE_INVALID_SACL_OFFLINE:
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return "Inconnu";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CZT1LogData::CZT1LogData(CZT1ThreadData *ThreadData):
|
CZT1LogData::CZT1LogData(CZT1ThreadData *ThreadData):
|
||||||
mZT1ThreadData(ThreadData)
|
mZT1ThreadData(ThreadData)
|
||||||
@ -129,7 +165,20 @@ QDataStream &operator<<(QDataStream &out, const CZT1FlagsData &source)
|
|||||||
<< source.mPGCalibrationON
|
<< source.mPGCalibrationON
|
||||||
<< source.mPGTresholdValue
|
<< source.mPGTresholdValue
|
||||||
<< source.mAnalogTracePresent
|
<< source.mAnalogTracePresent
|
||||||
<< source.mIsProblematicPassage;
|
<< source.mIsProblematicPassage
|
||||||
|
<< source.mTrainCompo1
|
||||||
|
<< source.mTrainCompo2
|
||||||
|
<< source.mTrainCompo3
|
||||||
|
<< source.mModbusTrainType
|
||||||
|
<< source.mUnusedFlag12
|
||||||
|
<< source.mUnusedFlag13
|
||||||
|
<< source.mUnusedFlag14
|
||||||
|
<< source.mUnusedFlag15
|
||||||
|
<< source.mUnusedFlag16
|
||||||
|
<< source.mUnusedFlag17
|
||||||
|
<< source.mUnusedFlag18
|
||||||
|
<< source.mUnusedFlag19
|
||||||
|
<< source.mUnusedFlag20;
|
||||||
|
|
||||||
//do not save mPEQ1Type
|
//do not save mPEQ1Type
|
||||||
|
|
||||||
@ -143,8 +192,20 @@ QDataStream &operator>>(QDataStream &in, CZT1FlagsData &dest)
|
|||||||
>> dest.mPGCalibrationON
|
>> dest.mPGCalibrationON
|
||||||
>> dest.mPGTresholdValue
|
>> dest.mPGTresholdValue
|
||||||
>> dest.mAnalogTracePresent
|
>> dest.mAnalogTracePresent
|
||||||
>> dest.mIsProblematicPassage;
|
>> dest.mIsProblematicPassage
|
||||||
|
>> dest.mTrainCompo1
|
||||||
|
>> dest.mTrainCompo2
|
||||||
|
>> dest.mTrainCompo3
|
||||||
|
>> dest.mModbusTrainType
|
||||||
|
>> dest.mUnusedFlag12
|
||||||
|
>> dest.mUnusedFlag13
|
||||||
|
>> dest.mUnusedFlag14
|
||||||
|
>> dest.mUnusedFlag15
|
||||||
|
>> dest.mUnusedFlag16
|
||||||
|
>> dest.mUnusedFlag17
|
||||||
|
>> dest.mUnusedFlag18
|
||||||
|
>> dest.mUnusedFlag19
|
||||||
|
>> dest.mUnusedFlag20;
|
||||||
//do not restore mPEQ1Type
|
//do not restore mPEQ1Type
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
@ -152,14 +213,34 @@ QDataStream &operator>>(QDataStream &in, CZT1FlagsData &dest)
|
|||||||
|
|
||||||
QDataStream &operator<<(QDataStream &out, const CZT2FlagsData &source)
|
QDataStream &operator<<(QDataStream &out, const CZT2FlagsData &source)
|
||||||
{
|
{
|
||||||
out << source.mIsProblematicPassage;
|
out << source.mIsProblematicPassage
|
||||||
|
<< source.mTrainCompo1
|
||||||
|
<< source.mTrainCompo2
|
||||||
|
<< source.mTrainCompo3
|
||||||
|
<< source.mModbusTrainType
|
||||||
|
<< source.mUnusedFlag6
|
||||||
|
<< source.mUnusedFlag7
|
||||||
|
<< source.mUnusedFlag8
|
||||||
|
<< source.mUnusedFlag9
|
||||||
|
<< source.mUnusedFlag10;
|
||||||
|
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream &operator>>(QDataStream &in, CZT2FlagsData &dest)
|
QDataStream &operator>>(QDataStream &in, CZT2FlagsData &dest)
|
||||||
{
|
{
|
||||||
in >> dest.mIsProblematicPassage;
|
in >> dest.mIsProblematicPassage
|
||||||
|
>> dest.mTrainCompo1
|
||||||
|
>> dest.mTrainCompo2
|
||||||
|
>> dest.mTrainCompo3
|
||||||
|
>> dest.mModbusTrainType
|
||||||
|
>> dest.mUnusedFlag6
|
||||||
|
>> dest.mUnusedFlag7
|
||||||
|
>> dest.mUnusedFlag8
|
||||||
|
>> dest.mUnusedFlag9
|
||||||
|
>> dest.mUnusedFlag10;
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -167,6 +167,8 @@ public:
|
|||||||
static const char *TrainTypeString[];
|
static const char *TrainTypeString[];
|
||||||
static const char *GetTrainTypeString(unsigned int TrainType);
|
static const char *GetTrainTypeString(unsigned int TrainType);
|
||||||
|
|
||||||
|
static const char *GetModbusTrainTypeString(unsigned int TrainType);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//This class contains data from the ZT1 analysis thread
|
//This class contains data from the ZT1 analysis thread
|
||||||
@ -198,7 +200,6 @@ public:
|
|||||||
void operator=(CZT1ThreadData& a);
|
void operator=(CZT1ThreadData& a);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class CZT1FlagsData
|
class CZT1FlagsData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -209,6 +210,19 @@ public:
|
|||||||
qint32 mAnalogTracePresent;
|
qint32 mAnalogTracePresent;
|
||||||
qint32 mIsProblematicPassage; //This flag will be set if problems have been detected but not sent to PCC due to PURE comitee rules.
|
qint32 mIsProblematicPassage; //This flag will be set if problems have been detected but not sent to PCC due to PURE comitee rules.
|
||||||
qint32 mPEQ1Type; //Not saved in passage files...
|
qint32 mPEQ1Type; //Not saved in passage files...
|
||||||
|
qint32 mTrainCompo1;
|
||||||
|
qint32 mTrainCompo2;
|
||||||
|
qint32 mTrainCompo3;
|
||||||
|
qint32 mModbusTrainType;
|
||||||
|
qint32 mUnusedFlag12;
|
||||||
|
qint32 mUnusedFlag13;
|
||||||
|
qint32 mUnusedFlag14;
|
||||||
|
qint32 mUnusedFlag15;
|
||||||
|
qint32 mUnusedFlag16;
|
||||||
|
qint32 mUnusedFlag17;
|
||||||
|
qint32 mUnusedFlag18;
|
||||||
|
qint32 mUnusedFlag19;
|
||||||
|
qint32 mUnusedFlag20;
|
||||||
};
|
};
|
||||||
QDataStream &operator<<(QDataStream &out, const CZT1FlagsData &source);
|
QDataStream &operator<<(QDataStream &out, const CZT1FlagsData &source);
|
||||||
QDataStream &operator>>(QDataStream &in, CZT1FlagsData &dest);
|
QDataStream &operator>>(QDataStream &in, CZT1FlagsData &dest);
|
||||||
@ -217,6 +231,15 @@ class CZT2FlagsData
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
qint32 mIsProblematicPassage; //This flag will be set if problems have been detected but not sent to PCC due to PURE comitee rules.
|
qint32 mIsProblematicPassage; //This flag will be set if problems have been detected but not sent to PCC due to PURE comitee rules.
|
||||||
|
qint32 mTrainCompo1;
|
||||||
|
qint32 mTrainCompo2;
|
||||||
|
qint32 mTrainCompo3;
|
||||||
|
qint32 mModbusTrainType;
|
||||||
|
qint32 mUnusedFlag6;
|
||||||
|
qint32 mUnusedFlag7;
|
||||||
|
qint32 mUnusedFlag8;
|
||||||
|
qint32 mUnusedFlag9;
|
||||||
|
qint32 mUnusedFlag10;
|
||||||
};
|
};
|
||||||
QDataStream &operator<<(QDataStream &out, const CZT2FlagsData &source);
|
QDataStream &operator<<(QDataStream &out, const CZT2FlagsData &source);
|
||||||
QDataStream &operator>>(QDataStream &in, CZT2FlagsData &dest);
|
QDataStream &operator>>(QDataStream &in, CZT2FlagsData &dest);
|
||||||
|
|||||||
@ -382,6 +382,10 @@ unsigned int CZTStateMachine::ZT1StateMachine(unsigned int Event, unsigned int S
|
|||||||
//update train info received from the CC Modbus interface
|
//update train info received from the CC Modbus interface
|
||||||
mTrainTypeDetected = (unsigned)mModbusCCMgr->GetZT1TrainType();
|
mTrainTypeDetected = (unsigned)mModbusCCMgr->GetZT1TrainType();
|
||||||
mZT1TrainComposition = mModbusCCMgr->GetZT1TrainComposition();
|
mZT1TrainComposition = mModbusCCMgr->GetZT1TrainComposition();
|
||||||
|
mZT1Log.mZT1Flags.mTrainCompo1 = (qint32)mZT1TrainComposition.at(0);
|
||||||
|
mZT1Log.mZT1Flags.mTrainCompo2 = (qint32)mZT1TrainComposition.at(1);
|
||||||
|
mZT1Log.mZT1Flags.mTrainCompo3 = (qint32)mZT1TrainComposition.at(2);
|
||||||
|
mZT1Log.mZT1Flags.mModbusTrainType = mModbusCCMgr->GetZT1RawTrainType();
|
||||||
mZTPagePTr->SetZT1TrainData(mTrainTypeDetected,mZT1TrainComposition);
|
mZTPagePTr->SetZT1TrainData(mTrainTypeDetected,mZT1TrainComposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1162,8 +1166,13 @@ unsigned int CZTStateMachine::ZT2StateMachine(unsigned int Event, unsigned int S
|
|||||||
//update train info received from the CC Modbus interface
|
//update train info received from the CC Modbus interface
|
||||||
mZT2TrainType = (unsigned)mModbusCCMgr->GetZT2TrainType();
|
mZT2TrainType = (unsigned)mModbusCCMgr->GetZT2TrainType();
|
||||||
mZT2TrainComposition = mModbusCCMgr->GetZT2TrainComposition();
|
mZT2TrainComposition = mModbusCCMgr->GetZT2TrainComposition();
|
||||||
|
mZT2Log.mZT2Flags.mTrainCompo1 = (qint32)mZT2TrainComposition.at(0);
|
||||||
|
mZT2Log.mZT2Flags.mTrainCompo2 = (qint32)mZT2TrainComposition.at(1);
|
||||||
|
mZT2Log.mZT2Flags.mTrainCompo3 = (qint32)mZT2TrainComposition.at(2);
|
||||||
|
mZT2Log.mZT2Flags.mModbusTrainType = mModbusCCMgr->GetZT2RawTrainType();
|
||||||
mZTPagePTr->SetZT2TrainData(mZT2TrainType,mZT2TrainComposition);
|
mZTPagePTr->SetZT2TrainData(mZT2TrainType,mZT2TrainComposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
InsertZT2LogItem();
|
InsertZT2LogItem();
|
||||||
mZT2WorkerThread->UpdateDetectionConfig(mZTDetectionConfig);
|
mZT2WorkerThread->UpdateDetectionConfig(mZTDetectionConfig);
|
||||||
mTKGenerator->UpdateDetectionConfig(mZTDetectionConfig);
|
mTKGenerator->UpdateDetectionConfig(mZTDetectionConfig);
|
||||||
@ -1529,6 +1538,10 @@ unsigned int CZTStateMachine::DestroyZT1Log()
|
|||||||
mZT1Log.mZT1Flags.mPGTresholdValue = 0;
|
mZT1Log.mZT1Flags.mPGTresholdValue = 0;
|
||||||
mZT1Log.mZT1Flags.mAnalogTracePresent = (mSDFAnalogMonitorInterface != 0);
|
mZT1Log.mZT1Flags.mAnalogTracePresent = (mSDFAnalogMonitorInterface != 0);
|
||||||
mZT1Log.mZT1Flags.mIsProblematicPassage = 0;
|
mZT1Log.mZT1Flags.mIsProblematicPassage = 0;
|
||||||
|
mZT1Log.mZT1Flags.mTrainCompo1 = 0;
|
||||||
|
mZT1Log.mZT1Flags.mTrainCompo2 = 0;
|
||||||
|
mZT1Log.mZT1Flags.mTrainCompo3 = 0;
|
||||||
|
mZT1Log.mZT1Flags.mModbusTrainType = MODBUS_CC_TRAIN_TYPE_INVALID_NOT_UPDATED;
|
||||||
|
|
||||||
mZT1PEQType = PEQ1_UNKNOWN_TYPE;
|
mZT1PEQType = PEQ1_UNKNOWN_TYPE;
|
||||||
|
|
||||||
@ -1579,6 +1592,10 @@ unsigned int CZTStateMachine::DestroyZT2Log()
|
|||||||
delete mZT2Log.mZT2LogData.at(i);
|
delete mZT2Log.mZT2LogData.at(i);
|
||||||
}
|
}
|
||||||
mZT2Log.mZT2LogData.clear();
|
mZT2Log.mZT2LogData.clear();
|
||||||
|
mZT2Log.mZT2Flags.mModbusTrainType = MODBUS_CC_TRAIN_TYPE_INVALID_NOT_UPDATED;
|
||||||
|
mZT2Log.mZT2Flags.mTrainCompo1 = 0;
|
||||||
|
mZT2Log.mZT2Flags.mTrainCompo2 = 0;
|
||||||
|
mZT2Log.mZT2Flags.mTrainCompo3 = 0;
|
||||||
|
|
||||||
for(int i = 0; i < mZT2DetectionsLog.size(); i++)
|
for(int i = 0; i < mZT2DetectionsLog.size(); i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -725,10 +725,10 @@ unsigned int CZoneTest::InitStation()
|
|||||||
{
|
{
|
||||||
StationName = "LONGUEIL";
|
StationName = "LONGUEIL";
|
||||||
}
|
}
|
||||||
else if((key & MONTMORENCY_IN_STATION_ID_MASK) == MONTMORENCY_STATION_KEY)
|
// else if((key & MONTMORENCY_IN_STATION_ID_MASK) == MONTMORENCY_STATION_KEY)
|
||||||
{
|
// {
|
||||||
StationName = "MONTMORENCY";
|
// StationName = "MONTMORENCY";
|
||||||
}
|
// }
|
||||||
else if((key & MONTMORENCY1012_IN_STATION_ID_MASK) == MONTMORENCY1012_STATION_KEY)
|
else if((key & MONTMORENCY1012_IN_STATION_ID_MASK) == MONTMORENCY1012_STATION_KEY)
|
||||||
{
|
{
|
||||||
StationName = "MONTMORENCY_10_12";
|
StationName = "MONTMORENCY_10_12";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user