Début modif C-Vertu pour 2 itinéraires
This commit is contained in:
parent
7081376137
commit
02b67321bb
@ -80,9 +80,9 @@ ENGLOG=3
|
||||
#Une seule station doit être sélectionnée
|
||||
|
||||
#STATION=HONORE_BEAUGRAND
|
||||
STATION=ANGRIGNON
|
||||
#STATION=ANGRIGNON
|
||||
#STATION=HENRI_BOURASSA
|
||||
#STATION=COTE_VERTU
|
||||
STATION=COTE_VERTU
|
||||
#STATION=BERRI_UQAM
|
||||
#STATION=LONGUEIL
|
||||
#STATION=SAINT_MICHEL
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
|
||||
|
||||
CCDVItem::CCDVItem(CCDV *CDVPtr,QGraphicsItem *Parent)
|
||||
CCDVItem::CCDVItem(CCDV *CDVPtr, QGraphicsItem *Parent)
|
||||
{
|
||||
if(Parent != 0)
|
||||
setParentItem(Parent);
|
||||
@ -47,7 +47,7 @@ CCDVItem::CCDVItem(CCDV *CDVPtr,QGraphicsItem *Parent)
|
||||
mCDVState = CDV_STATE_FREE;
|
||||
mCurBrush = mCDVFreeBrush;
|
||||
|
||||
setGeometry(0,0,90,20);
|
||||
setGeometry(0,0,90,20);
|
||||
}
|
||||
|
||||
CCDVItem::~CCDVItem()
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#ifndef CDVITEM_H
|
||||
#define CDVITEM_H
|
||||
|
||||
|
||||
class CCDV;
|
||||
|
||||
class CCDVItem : public QGraphicsWidget
|
||||
@ -40,7 +41,7 @@ class CCDVItem : public QGraphicsWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CCDVItem(CCDV *CDVPtr,QGraphicsItem *Parent = 0);
|
||||
CCDVItem(CCDV *CDVPtr,QGraphicsItem *Parent = 0);
|
||||
~CCDVItem();
|
||||
|
||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
||||
@ -198,6 +198,12 @@ unsigned int CZTPage::SetCDVList(QList<CCDV *> *CDVListPtr)
|
||||
//adjust all their position on screen and
|
||||
//set parameters
|
||||
// unsigned int LastPos = 0;
|
||||
bool scale = false;
|
||||
if(mCDVList->size() > 9)
|
||||
{
|
||||
scale = true;
|
||||
}
|
||||
|
||||
for(int i = 0; i < mCDVList->size(); i++)
|
||||
{
|
||||
int x = 0, y = 70;
|
||||
@ -214,9 +220,14 @@ unsigned int CZTPage::SetCDVList(QList<CCDV *> *CDVListPtr)
|
||||
|
||||
}
|
||||
|
||||
if(scale)
|
||||
{
|
||||
NewCDVGraphicalItem->resize(70,NewCDVGraphicalItem->rect().height());
|
||||
}
|
||||
|
||||
NewCDVGraphicalItem->SetParameters(mCDVList->at(i)->GetLabel());
|
||||
mCDVItemsList.append(NewCDVGraphicalItem);
|
||||
x = (mCDVList->at(i)->GetCDVGraphicalPos() * NewCDVGraphicalItem->geometry().width())+90;
|
||||
x = (mCDVList->at(i)->GetCDVGraphicalPos() * NewCDVGraphicalItem->geometry().width())+90;
|
||||
if(mCDVList->at(i)->GetCDVWay() == 2)
|
||||
y += WaysSpacing+NewCDVGraphicalItem->geometry().height();
|
||||
// NewCDVGraphicalItem->setPos(i*NewCDVGraphicalItem->geometry().width()+90,70);
|
||||
|
||||
@ -133,12 +133,12 @@ unsigned int CZTSimulator::Init(CZTPage *MainPagePtr, CStation *Station, CIOMana
|
||||
CCDVItem *NewCDVGraphicalItem;
|
||||
if(mStationPtr->GetCDVList()->at(i)->GetCDVType() == CDV_NORMAL_TYPE)
|
||||
{
|
||||
NewCDVGraphicalItem = new CCDVItem(mStationPtr->GetCDVList()->at(i),this);
|
||||
NewCDVGraphicalItem = new CCDVItem(mStationPtr->GetCDVList()->at(i),this);
|
||||
}
|
||||
else
|
||||
{
|
||||
//NewCDVGraphicalItem = new CSwitchCDVItem(mStationPtr->GetCDVList()->at(i),this);
|
||||
NewCDVGraphicalItem = new CCDVItem(mStationPtr->GetCDVList()->at(i),this);
|
||||
NewCDVGraphicalItem = new CCDVItem(mStationPtr->GetCDVList()->at(i),this);
|
||||
}
|
||||
NewCDVGraphicalItem->SetParameters(mStationPtr->GetCDVList()->at(i)->GetLabel());
|
||||
mSimCDVItemsList.append(NewCDVGraphicalItem);
|
||||
|
||||
@ -54,7 +54,8 @@ CCoteVertuStation::CCoteVertuStation()
|
||||
mStationInputMasks.InputZT2PEMask = COTEVERTU_ZT2_PE_MASK;
|
||||
|
||||
//External (ethernet) input module masks
|
||||
mStationInputMasks.InputZT1ITIMask = COTEVERTU_IN_ZT1_ITI_MASK;
|
||||
mStationInputMasks.InputZT1ITIMask = COTEVERTU_IN_ZT1_10_12_ITI_MASK;
|
||||
mStationInputMasks.InputZT1_AltITIMask = COTEVERTU_IN_ZT1_10_22_ITI_MASK;
|
||||
mStationInputMasks.InputZT2ITIMask = COTEVERTU_IN_ZT2_ITI_MASK;
|
||||
mStationInputMasks.InputZT1ANMask = COTEVERTU_IN_ZT1_AN_MASK;
|
||||
mStationInputMasks.InputZT2ANMask = COTEVERTU_IN_ZT2_AN_MASK;
|
||||
@ -105,10 +106,94 @@ CCoteVertuStation::CCoteVertuStation()
|
||||
mAnalogAcqChannels.SDFAcquisitionChannel = COTEVERTU_SDF_ACQUISITION_CHANNEL;
|
||||
|
||||
mStationHasZT2 = true;
|
||||
mCurZT1Itinerary = COTEVERTU_ZT1_NO_ITINERARY;
|
||||
mTextualStationName = "Côte Vertu";
|
||||
mTextualShortName = "CVRT";
|
||||
}
|
||||
|
||||
unsigned int CCoteVertuStation::UpdateStationMasks(unsigned int ExtInputData)
|
||||
{
|
||||
mStationInputMasks.InputZT1_StdITIMask = COTEVERTU_IN_ZT1_10_12_ITI_MASK;
|
||||
if((COTEVERTU_IN_ZT1_10_12_ITI_MASK & ExtInputData) != 0)
|
||||
{
|
||||
if(mCurZT1Itinerary != COTEVERTU_ZT1_10_12_ITINERARY)
|
||||
{ //Assign masks relative to 10/12 itinerary
|
||||
mStationInputMasks.InputZT1ITIMask = COTEVERTU_IN_ZT1_10_12_ITI_MASK;
|
||||
mStationInputMasks.InputZT1ANMask = COTEVERTU_IN_ZT1_AN_MASK; //We use Modbus in C-V. AN input is obsolete but we still assign it
|
||||
mCurZT1Itinerary = COTEVERTU_ZT1_10_12_ITINERARY;
|
||||
mZT1AlarmAutoAcquireCDV = m10_12AlarmAutoAcquireCDV_2; //Not used but it's better to assign it.
|
||||
mZT1SubsequentCDV = m10_12SubsequentCDV;
|
||||
qDebug("Itinéraire 10/12 configuré");
|
||||
}
|
||||
|
||||
}
|
||||
else if((COTEVERTU_IN_ZT1_10_22_ITI_MASK & ExtInputData) != 0)
|
||||
{
|
||||
if(mCurZT1Itinerary != COTEVERTU_ZT1_10_22_ITINERARY)
|
||||
{ //Assign masks relative to 10/22 itinerary
|
||||
mStationInputMasks.InputZT1ITIMask = COTEVERTU_IN_ZT1_10_22_ITI_MASK;
|
||||
mStationInputMasks.InputZT1ANMask = COTEVERTU_IN_ZT1_AN_MASK; //We use Modbus in C-V. AN input is obsolete but we still assign it
|
||||
mCurZT1Itinerary = COTEVERTU_ZT1_10_22_ITINERARY;
|
||||
mZT1AlarmAutoAcquireCDV = m10_22AlarmAutoAcquireCDV_2; //Not used but it's better to assign it.
|
||||
mZT1SubsequentCDV = m10_22SubsequentCDV;
|
||||
qDebug("Itinéraire 10/22 configuré");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mCurZT1Itinerary = COTEVERTU_ZT1_NO_ITINERARY;
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CCoteVertuStation::GetCurrentITI()
|
||||
{
|
||||
if(mCurZT1Itinerary == COTEVERTU_ZT1_NO_ITINERARY || mCurZT1Itinerary == COTEVERTU_ZT1_10_12_ITINERARY)
|
||||
{
|
||||
return ZT_PRIMARY_ITI;
|
||||
}
|
||||
else if(mCurZT1Itinerary == COTEVERTU_ZT1_10_22_ITINERARY)
|
||||
{
|
||||
return ZT_SECONDARY_ITI;
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("Invalid mCurZT1Itinerary in CCoteVertuStation. Weird stuff!");
|
||||
return ZT_PRIMARY_ITI;
|
||||
}
|
||||
}
|
||||
|
||||
bool CCoteVertuStation::IsZT1AlarmAutoAcquireCDVOccupied()
|
||||
{
|
||||
if(GetCurrentITI() == ZT_PRIMARY_ITI) // itinéraire 10/12
|
||||
{
|
||||
if(m10_12AlarmAutoAcquireCDV_1->IsOccupied())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if(m10_12AlarmAutoAcquireCDV_2->IsOccupied())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
else // Itinéraire 10/22
|
||||
{
|
||||
if(m10_22AlarmAutoAcquireCDV_1->IsOccupied())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if(m10_22AlarmAutoAcquireCDV_2->IsOccupied())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int CCoteVertuStation::BuildStationCDVList()
|
||||
{
|
||||
CCDV *NewCDV;
|
||||
@ -133,30 +218,48 @@ unsigned int CCoteVertuStation::BuildStationCDVList()
|
||||
mZT2ApproachCDV = NewCDV; //Approach = ZT2 CDV
|
||||
mCDVList.append(NewCDV);
|
||||
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_ITI_MASK,COTEVERTU_IN_CDV_12B_MASK,CDV_NORMAL_TYPE,"12B",1,4);
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_10_12_ITI_MASK,COTEVERTU_IN_CDV_12B_MASK,CDV_NORMAL_TYPE,"12B",1,4);
|
||||
mCDVList.append(NewCDV);
|
||||
NewCDV->SetCDVDeck(true);
|
||||
|
||||
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_ITI_MASK,COTEVERTU_IN_CDV_12A_MASK,CDV_NORMAL_TYPE,"12A",1,5);
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_10_12_ITI_MASK,COTEVERTU_IN_CDV_12A_MASK,CDV_NORMAL_TYPE,"12A",1,5);
|
||||
mZT1AlarmAutoAcquireCDV = NewCDV;
|
||||
mZT1SubsequentCDV = NewCDV;
|
||||
mCDVList.append(NewCDV);
|
||||
NewCDV->SetCDVDeck(true);
|
||||
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_10_12_ITI_MASK,COTEVERTU_IN_CDV_11C_MASK,CDV_NORMAL_TYPE,"11C",1,6);
|
||||
mCDVList.append(NewCDV);
|
||||
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_ITI_MASK,COTEVERTU_IN_CDV_11B_MASK,CDV_NORMAL_TYPE,"11B (ZT1)",1,6);
|
||||
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_10_12_ITI_MASK,COTEVERTU_IN_CDV_11B_MASK,CDV_NORMAL_TYPE,"11B (ZT1)",1,7);
|
||||
mZT1CDV = NewCDV;
|
||||
mCDVList.append(NewCDV);
|
||||
|
||||
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_ITI_MASK,COTEVERTU_IN_CDV_11A_MASK,CDV_NORMAL_TYPE,"11A",1,7);
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_10_12_ITI_MASK,COTEVERTU_IN_CDV_11A_MASK,CDV_NORMAL_TYPE,"11A",1,8);
|
||||
mZT1ApproachCDV = NewCDV;
|
||||
mCDVList.append(NewCDV);
|
||||
|
||||
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_ITI_MASK,COTEVERTU_IN_CDV_10B_MASK,CDV_NORMAL_TYPE,"10B",1,8);
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_10_12_ITI_MASK,COTEVERTU_IN_CDV_10B_MASK,CDV_NORMAL_TYPE,"10B",1,9);
|
||||
mCDVList.append(NewCDV);
|
||||
|
||||
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_10_12_ITI_MASK,COTEVERTU_IN_CDV_2S177_179_MASK,CDV_NORMAL_TYPE,"10A",1,10);
|
||||
mCDVList.append(NewCDV);
|
||||
|
||||
NewCDV = new CCDV(COTEVERTU_IN_ZT1_10_22_ITI_MASK,COTEVERTU_IN_CDV_22B_MASK,CDV_NORMAL_TYPE,"22B",2,4);
|
||||
mCDVList.append(NewCDV);
|
||||
|
||||
|
||||
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
GenericInputMasks_t *CCoteVertuStation::GetInputMasks(void)
|
||||
{
|
||||
return &mStationInputMasks;
|
||||
}
|
||||
|
||||
@ -55,16 +55,31 @@
|
||||
#define COTEVERTU_IN_CDV_10B_MASK 0x00000010
|
||||
#define COTEVERTU_IN_CDV_13A_MASK 0x00000020
|
||||
#define COTEVERTU_IN_CDV_14A_MASK 0x00000040
|
||||
#define COTEVERTU_IN_CDV_13B_MASK 0x00000080
|
||||
#define COTEVERTU_IN_CDV_13B_MASK 0x00000080
|
||||
#define COTEVERTU_IN_CDV_14B_MASK 0x00000100
|
||||
#define COTEVERTU_IN_ZT1_ITI_MASK 0x00000200
|
||||
#define COTEVERTU_IN_ZT1_10_12_ITI_MASK 0x00000200
|
||||
#define COTEVERTU_IN_ZT2_ITI_MASK 0x00000400
|
||||
#define COTEVERTU_IN_ZT1_AN_MASK 0x00000800
|
||||
#define COTEVERTU_IN_ZT2_AN_MASK 0x00001000
|
||||
#define COTEVERTU_IN_ZT1_ARF_MASK 0x00002000
|
||||
#define COTEVERTU_IN_ZT2_ARF_MASK 0x00004000
|
||||
#define COTEVERTU_IN_CDV_21B_MASK 0x00080000 //22.1
|
||||
#define COTEVERTU_IN_CDV_22A_MASK 0x00100000 //22.2
|
||||
#define COTEVERTU_IN_CDV_22B_MASK 0x00200000 //23.1
|
||||
#define COTEVERTU_IN_ZT1_10_22_ITI_MASK 0x00400000 //23.2
|
||||
#define COTEVERTU_IN_CDV_2S177_179_MASK 0x00800000 //24.1
|
||||
#define COTEVERTU_IN_RES_24_2 0x01000000
|
||||
#define COTEVERTU_IN_CDV_11C_MASK 0x02000000 //25.1
|
||||
#define COTEVERTU_IN_CDV_21A_MASK 0x04000000 //25.2
|
||||
#define COTEVERTU_IN_CDV_21C_MASK 0x08000000 //26.1
|
||||
#define COTEVERTU_IN_RES_26_2 0x10000000
|
||||
#define COTEVERTU_IN_RES_27_1 0x20000000
|
||||
#define COTEVERTU_IN_RES_27_2 0x40000000
|
||||
#define COTEVERTU_IN_RES_28_1 0x80000000
|
||||
|
||||
#define COTEVERTU_IN_STATION_ID_MASK 0x00078000
|
||||
|
||||
|
||||
//External (ethernet) output module masks for Cote Vertu
|
||||
#define COTEVERTU_OUT_VP1_MASK 0x00000001
|
||||
#define COTEVERTU_OUT_VP2_MASK 0x00000002
|
||||
@ -106,12 +121,26 @@ class CCoteVertuStation : public CStation
|
||||
public:
|
||||
|
||||
CCoteVertuStation();
|
||||
|
||||
virtual GenericInputMasks_t *GetInputMasks(void);
|
||||
virtual unsigned int UpdateStationMasks(unsigned int ExtInputData);
|
||||
virtual int GetCurrentITI();
|
||||
virtual bool IsZT1AlarmAutoAcquireCDVOccupied();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
virtual unsigned int BuildStationCDVList();
|
||||
|
||||
int mCurZT1Itinerary;
|
||||
CCDV *m10_12AlarmAutoAcquireCDV_1,*m10_12AlarmAutoAcquireCDV_2, *m10_22AlarmAutoAcquireCDV_1, *m10_22AlarmAutoAcquireCDV_2;
|
||||
CCDV *m10_12SubsequentCDV, *m10_22SubsequentCDV;
|
||||
|
||||
enum eCoteVertuZT1Itineraries
|
||||
{
|
||||
COTEVERTU_ZT1_10_12_ITINERARY,
|
||||
COTEVERTU_ZT1_10_22_ITINERARY,
|
||||
COTEVERTU_ZT1_NO_ITINERARY
|
||||
};
|
||||
};
|
||||
|
||||
#endif // COTEVERTU_H
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user