Resize pour l'utilisation en remote desktop.
TODO: Rendre ça configurable...
This commit is contained in:
parent
ee21de7686
commit
9b4aa89f1a
@ -28,8 +28,8 @@
|
|||||||
#define GLOBAL_DEFINE
|
#define GLOBAL_DEFINE
|
||||||
|
|
||||||
//Screen resolution.
|
//Screen resolution.
|
||||||
#define SCREEN_RES_WIDTH 1600
|
#define SCREEN_RES_WIDTH 1200
|
||||||
#define SCREEN_RES_HEIGHT 768
|
#define SCREEN_RES_HEIGHT 700
|
||||||
|
|
||||||
//Train parameters
|
//Train parameters
|
||||||
#define MR_BOGIE_LENGTH 1.52 //meters
|
#define MR_BOGIE_LENGTH 1.52 //meters
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
|
|
||||||
|
|
||||||
CLogViewPage::CLogViewPage(QGraphicsWidget *Parent)
|
CLogViewPage::CLogViewPage(QGraphicsWidget *Parent, qreal LogViewPageWidth)
|
||||||
{
|
{
|
||||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||||
setParentItem(Parent);
|
setParentItem(Parent);
|
||||||
@ -75,15 +75,19 @@ CLogViewPage::CLogViewPage(QGraphicsWidget *Parent)
|
|||||||
qreal PlotsHeight = ((GRAPH_ZONE_HEIGHT - 60) / (ZT1_DISCREET_PLOTTABLE_NB_PARAM + ZT1_ANALOG_PLOTTABLE_NB_PARAM));
|
qreal PlotsHeight = ((GRAPH_ZONE_HEIGHT - 60) / (ZT1_DISCREET_PLOTTABLE_NB_PARAM + ZT1_ANALOG_PLOTTABLE_NB_PARAM));
|
||||||
PlotsHeight -= (20 + (10/(ZT1_DISCREET_PLOTTABLE_NB_PARAM + ZT1_ANALOG_PLOTTABLE_NB_PARAM))) ; //space between plots
|
PlotsHeight -= (20 + (10/(ZT1_DISCREET_PLOTTABLE_NB_PARAM + ZT1_ANALOG_PLOTTABLE_NB_PARAM))) ; //space between plots
|
||||||
int CurPlot = 0;
|
int CurPlot = 0;
|
||||||
|
mGraphZoneWidth = LogViewPageWidth - GRAPH_ZONE_X_OFFSET;
|
||||||
|
qDebug("Size = %f",mGraphZoneWidth);
|
||||||
for(int param = 0; param < ZT1_DISCREET_PLOTTABLE_NB_PARAM; param++)
|
for(int param = 0; param < ZT1_DISCREET_PLOTTABLE_NB_PARAM; param++)
|
||||||
{
|
{
|
||||||
mZT1DiscreetPlots[param].mParamID = param;
|
mZT1DiscreetPlots[param].mParamID = param;
|
||||||
mZT1DiscreetPlots[param].mDataSet = new QList<CGraphDiscreteDataPair*>;
|
mZT1DiscreetPlots[param].mDataSet = new QList<CGraphDiscreteDataPair*>;
|
||||||
|
|
||||||
CGraphItem * NewGraph = new CGraphItem(this);
|
CGraphItem * NewGraph = new CGraphItem(this);
|
||||||
|
|
||||||
//NewGraph->setPos(GRAPH_ZONE_X_OFFSET,param * (40 + 20)+10);
|
//NewGraph->setPos(GRAPH_ZONE_X_OFFSET,param * (40 + 20)+10);
|
||||||
NewGraph->setPos(GRAPH_ZONE_X_OFFSET,CurPlot++ * (PlotsHeight + 20) + 10);
|
NewGraph->setPos(GRAPH_ZONE_X_OFFSET,CurPlot++ * (PlotsHeight + 20) + 10);
|
||||||
NewGraph->resize(GRAPH_ZONE_WIDTH,PlotsHeight);
|
// NewGraph->resize(GRAPH_ZONE_WIDTH,PlotsHeight);
|
||||||
|
NewGraph->resize(mGraphZoneWidth,PlotsHeight);
|
||||||
|
|
||||||
mZT1DiscreetPlots[param].mPlotGaph = NewGraph;
|
mZT1DiscreetPlots[param].mPlotGaph = NewGraph;
|
||||||
mZT1DiscreetPlots[param].mPlotGaph->SetData(mZT1DiscreetPlots[param].mDataSet);
|
mZT1DiscreetPlots[param].mPlotGaph->SetData(mZT1DiscreetPlots[param].mDataSet);
|
||||||
@ -105,7 +109,8 @@ CLogViewPage::CLogViewPage(QGraphicsWidget *Parent)
|
|||||||
CAnalogGraphItem *NewGraph = new CAnalogGraphItem(this);
|
CAnalogGraphItem *NewGraph = new CAnalogGraphItem(this);
|
||||||
// NewGraph->setPos(GRAPH_ZONE_X_OFFSET,(param+DISCREET_PLOTTABLE_NB_PARAM)*(40+20)+10);
|
// NewGraph->setPos(GRAPH_ZONE_X_OFFSET,(param+DISCREET_PLOTTABLE_NB_PARAM)*(40+20)+10);
|
||||||
NewGraph->setPos(GRAPH_ZONE_X_OFFSET,CurPlot++ * (PlotsHeight + 20) + 10);
|
NewGraph->setPos(GRAPH_ZONE_X_OFFSET,CurPlot++ * (PlotsHeight + 20) + 10);
|
||||||
NewGraph->resize(GRAPH_ZONE_WIDTH,PlotsHeight);
|
//NewGraph->resize(GRAPH_ZONE_WIDTH,PlotsHeight);
|
||||||
|
NewGraph->resize(mGraphZoneWidth,PlotsHeight);
|
||||||
|
|
||||||
mZT1AnalogPlots[param].mPlotGaph = NewGraph;
|
mZT1AnalogPlots[param].mPlotGaph = NewGraph;
|
||||||
mZT1AnalogPlots[param].mPlotGaph->SetData(mZT1AnalogPlots[param].mDataSet);
|
mZT1AnalogPlots[param].mPlotGaph->SetData(mZT1AnalogPlots[param].mDataSet);
|
||||||
@ -115,7 +120,8 @@ CLogViewPage::CLogViewPage(QGraphicsWidget *Parent)
|
|||||||
mZT1AnalogPlots[ZT1_ANALOG_PLOTTABLE_TRAIN_SPEED_PARAM].mPlotGaph->SetLabel("Vitesse",GRAPH_ZONE_X_OFFSET);
|
mZT1AnalogPlots[ZT1_ANALOG_PLOTTABLE_TRAIN_SPEED_PARAM].mPlotGaph->SetLabel("Vitesse",GRAPH_ZONE_X_OFFSET);
|
||||||
mZT1AnalogPlots[ZT1_ANALOG_PLOTTABLE_PGCOMBINED_PARAM].mPlotGaph->SetLabel("Détection",GRAPH_ZONE_X_OFFSET);
|
mZT1AnalogPlots[ZT1_ANALOG_PLOTTABLE_PGCOMBINED_PARAM].mPlotGaph->SetLabel("Détection",GRAPH_ZONE_X_OFFSET);
|
||||||
mZT1AnalogPlots[ZT1_ANALOG_PLOTTABLE_SDF_DATA_PARAM].mPlotGaph->SetLabel("SDF",GRAPH_ZONE_X_OFFSET);
|
mZT1AnalogPlots[ZT1_ANALOG_PLOTTABLE_SDF_DATA_PARAM].mPlotGaph->SetLabel("SDF",GRAPH_ZONE_X_OFFSET);
|
||||||
mZT1AnalogPlots[ZT1_ANALOG_PLOTTABLE_SDF_DATA_PARAM].mPlotGaph->resize(GRAPH_ZONE_WIDTH,PlotsHeight*2);
|
// mZT1AnalogPlots[ZT1_ANALOG_PLOTTABLE_SDF_DATA_PARAM].mPlotGaph->resize(GRAPH_ZONE_WIDTH,PlotsHeight*2);
|
||||||
|
mZT1AnalogPlots[ZT1_ANALOG_PLOTTABLE_SDF_DATA_PARAM].mPlotGaph->resize(mGraphZoneWidth,PlotsHeight*2);
|
||||||
|
|
||||||
//Setup ZT2 Plots
|
//Setup ZT2 Plots
|
||||||
PlotsHeight = ((GRAPH_ZONE_HEIGHT - 60) / (ZT2_DISCREET_PLOTTABLE_NB_PARAM + ZT2_ANALOG_PLOTTABLE_NB_PARAM));
|
PlotsHeight = ((GRAPH_ZONE_HEIGHT - 60) / (ZT2_DISCREET_PLOTTABLE_NB_PARAM + ZT2_ANALOG_PLOTTABLE_NB_PARAM));
|
||||||
@ -146,9 +152,11 @@ CLogViewPage::CLogViewPage(QGraphicsWidget *Parent)
|
|||||||
mVCursor->resize(3,GRAPH_ZONE_HEIGHT);
|
mVCursor->resize(3,GRAPH_ZONE_HEIGHT);
|
||||||
mVCursor->setZValue(2);
|
mVCursor->setZValue(2);
|
||||||
|
|
||||||
mHCursor = new CHorizontalGraphCursorWidget(GRAPH_ZONE_WIDTH,this);
|
// mHCursor = new CHorizontalGraphCursorWidget(GRAPH_ZONE_WIDTH,this);
|
||||||
|
mHCursor = new CHorizontalGraphCursorWidget(mGraphZoneWidth,this);
|
||||||
mHCursor->setPos(0,0);
|
mHCursor->setPos(0,0);
|
||||||
mHCursor->resize(GRAPH_ZONE_WIDTH,3);
|
//mHCursor->resize(GRAPH_ZONE_WIDTH,3);
|
||||||
|
mHCursor->resize(mGraphZoneWidth,3);
|
||||||
mHCursor->setZValue(2);
|
mHCursor->setZValue(2);
|
||||||
|
|
||||||
// mCursorPosTxt = new QGraphicsTextItem(this);
|
// mCursorPosTxt = new QGraphicsTextItem(this);
|
||||||
@ -157,22 +165,22 @@ CLogViewPage::CLogViewPage(QGraphicsWidget *Parent)
|
|||||||
|
|
||||||
mCursorsZoomButton = new CTextButtonWidget("Zoom curseurs");
|
mCursorsZoomButton = new CTextButtonWidget("Zoom curseurs");
|
||||||
mCursorsZoomButton->setParentItem(this);
|
mCursorsZoomButton->setParentItem(this);
|
||||||
mCursorsZoomButton->setPos(10,700);
|
mCursorsZoomButton->setPos(10,700-100);
|
||||||
connect(mCursorsZoomButton,SIGNAL(TxtButtonClicked(CTextButtonWidget*)),this,SLOT(ButtonClicked(CTextButtonWidget*)));
|
connect(mCursorsZoomButton,SIGNAL(TxtButtonClicked(CTextButtonWidget*)),this,SLOT(ButtonClicked(CTextButtonWidget*)));
|
||||||
|
|
||||||
mZoomInButton = new CTextButtonWidget(" +",0,25,25);
|
mZoomInButton = new CTextButtonWidget(" +",0,25,25);
|
||||||
mZoomInButton->setParentItem(this);
|
mZoomInButton->setParentItem(this);
|
||||||
mZoomInButton->setPos(95,730);
|
mZoomInButton->setPos(95,730-100);
|
||||||
connect(mZoomInButton,SIGNAL(TxtButtonClicked(CTextButtonWidget*)),this,SLOT(ButtonClicked(CTextButtonWidget*)));
|
connect(mZoomInButton,SIGNAL(TxtButtonClicked(CTextButtonWidget*)),this,SLOT(ButtonClicked(CTextButtonWidget*)));
|
||||||
|
|
||||||
mZoomOutButton = new CTextButtonWidget(" -",0,25,25);
|
mZoomOutButton = new CTextButtonWidget(" -",0,25,25);
|
||||||
mZoomOutButton->setParentItem(this);
|
mZoomOutButton->setParentItem(this);
|
||||||
mZoomOutButton->setPos(10,730);
|
mZoomOutButton->setPos(10,730-100);
|
||||||
connect(mZoomOutButton,SIGNAL(TxtButtonClicked(CTextButtonWidget*)),this,SLOT(ButtonClicked(CTextButtonWidget*)));
|
connect(mZoomOutButton,SIGNAL(TxtButtonClicked(CTextButtonWidget*)),this,SLOT(ButtonClicked(CTextButtonWidget*)));
|
||||||
|
|
||||||
mZoomResetButton = new CTextButtonWidget(" R",0,25,25);
|
mZoomResetButton = new CTextButtonWidget(" R",0,25,25);
|
||||||
mZoomResetButton->setParentItem(this);
|
mZoomResetButton->setParentItem(this);
|
||||||
mZoomResetButton->setPos(50,730);
|
mZoomResetButton->setPos(50,730-100);
|
||||||
connect(mZoomResetButton,SIGNAL(TxtButtonClicked(CTextButtonWidget*)),this,SLOT(ButtonClicked(CTextButtonWidget*)));
|
connect(mZoomResetButton,SIGNAL(TxtButtonClicked(CTextButtonWidget*)),this,SLOT(ButtonClicked(CTextButtonWidget*)));
|
||||||
|
|
||||||
mStaticCursor1 = new CVerticalGraphCursorWidget(GRAPH_ZONE_HEIGHT,this);
|
mStaticCursor1 = new CVerticalGraphCursorWidget(GRAPH_ZONE_HEIGHT,this);
|
||||||
@ -188,39 +196,46 @@ CLogViewPage::CLogViewPage(QGraphicsWidget *Parent)
|
|||||||
mStaticCursor2->hide();
|
mStaticCursor2->hide();
|
||||||
|
|
||||||
mStaticCursorDeltaTimeTxt = new QGraphicsTextItem(this);
|
mStaticCursorDeltaTimeTxt = new QGraphicsTextItem(this);
|
||||||
mStaticCursorDeltaTimeTxt->setPos(130,700);
|
mStaticCursorDeltaTimeTxt->setPos(130,700-100);
|
||||||
mStaticCursorDeltaTimeTxt->setPlainText("Delta curseurs: ?");
|
mStaticCursorDeltaTimeTxt->setPlainText("Delta curseurs: ?");
|
||||||
|
|
||||||
mCursor1TimeTxt = new QGraphicsTextItem(this);
|
mCursor1TimeTxt = new QGraphicsTextItem(this);
|
||||||
mCursor1TimeTxt->setPlainText("Position curseur 1 : ?");
|
mCursor1TimeTxt->setPlainText("Curs. 1 : ?");
|
||||||
mCursor1TimeTxt->setPos(130,720);
|
mCursor1TimeTxt->setPos(130,720-100);
|
||||||
mCursor2TimeTxt = new QGraphicsTextItem(this);
|
mCursor2TimeTxt = new QGraphicsTextItem(this);
|
||||||
mCursor2TimeTxt->setPlainText("Position curseur 2 : ?");
|
mCursor2TimeTxt->setPlainText("Curs. 2 : ?");
|
||||||
mCursor2TimeTxt->setPos(130,740);
|
mCursor2TimeTxt->setPos(130,740-100);
|
||||||
mPassageStats1Txt = new QGraphicsTextItem(this);
|
mPassageStats1Txt = new QGraphicsTextItem(this);
|
||||||
mPassageStats1Txt->setPos(350,700);
|
mPassageStats1Txt->setPos(250,700-100);
|
||||||
mPassageStats1Txt->setPlainText("Date & heure: \nStation : \nPosition : ");
|
mPassageStats1Txt->setPlainText("Date & heure: \nStation : \nPosition : ");
|
||||||
mPassageStats2Txt = new QGraphicsTextItem(this);
|
mPassageStats2Txt = new QGraphicsTextItem(this);
|
||||||
mPassageStats2Txt->setPos(600,700);
|
mPassageStats2Txt->setPos(500,700-100);
|
||||||
mPassageStats2Txt->setPlainText("Vitesse Max : Mph\nVitesse Min: Mph\nSeuil PG : ");
|
mPassageStats2Txt->setPlainText("Vitesse Max : Mph\nVitesse Min: Mph\nSeuil PG : ");
|
||||||
|
|
||||||
mRuler = new CGraphRulerWidget(GRAPH_ZONE_WIDTH,this);
|
|
||||||
|
// mRuler = new CGraphRulerWidget(GRAPH_ZONE_WIDTH,this);
|
||||||
|
mRuler = new CGraphRulerWidget(mGraphZoneWidth,this);
|
||||||
mRuler->setZValue(1);
|
mRuler->setZValue(1);
|
||||||
mRuler->setPos(GRAPH_ZONE_X_OFFSET,670);
|
mRuler->setPos(GRAPH_ZONE_X_OFFSET,670-100);
|
||||||
mRuler->resize(GRAPH_ZONE_WIDTH,20);
|
// mRuler->resize(GRAPH_ZONE_WIDTH,20);
|
||||||
|
mRuler->resize(mGraphZoneWidth,20);
|
||||||
|
|
||||||
|
|
||||||
mRankRuler = new CRankRulerWidget(GRAPH_ZONE_WIDTH,this);
|
// mRankRuler = new CRankRulerWidget(GRAPH_ZONE_WIDTH,this);
|
||||||
|
mRankRuler = new CRankRulerWidget(mGraphZoneWidth,this);
|
||||||
mRankRuler->setZValue(1);
|
mRankRuler->setZValue(1);
|
||||||
mRankRuler->resize(GRAPH_ZONE_WIDTH,10);
|
// mRankRuler->resize(GRAPH_ZONE_WIDTH,10);
|
||||||
mRankRuler->setPos(GRAPH_ZONE_X_OFFSET,655);
|
mRankRuler->resize(mGraphZoneWidth,10);
|
||||||
|
mRankRuler->setPos(GRAPH_ZONE_X_OFFSET,655-100);
|
||||||
mRankRuler->SetLabel("Rang:",GRAPH_ZONE_X_OFFSET);
|
mRankRuler->SetLabel("Rang:",GRAPH_ZONE_X_OFFSET);
|
||||||
|
|
||||||
|
|
||||||
mEventRuler = new CEventRulerWidget(GRAPH_ZONE_WIDTH,this);
|
// mEventRuler = new CEventRulerWidget(GRAPH_ZONE_WIDTH,this);
|
||||||
|
mEventRuler = new CEventRulerWidget(mGraphZoneWidth,this);
|
||||||
mEventRuler->setZValue(1);
|
mEventRuler->setZValue(1);
|
||||||
mEventRuler->resize(GRAPH_ZONE_WIDTH,10);
|
// mEventRuler->resize(GRAPH_ZONE_WIDTH,10);
|
||||||
mEventRuler->setPos(GRAPH_ZONE_X_OFFSET,640);
|
mEventRuler = new CEventRulerWidget(mGraphZoneWidth,this);
|
||||||
|
mEventRuler->setPos(GRAPH_ZONE_X_OFFSET,640-100);
|
||||||
mEventRuler->SetLabel("Décl:",GRAPH_ZONE_X_OFFSET);
|
mEventRuler->SetLabel("Décl:",GRAPH_ZONE_X_OFFSET);
|
||||||
|
|
||||||
mScrollAnimationTimer.start();
|
mScrollAnimationTimer.start();
|
||||||
@ -626,7 +641,8 @@ void CLogViewPage::SetLogData(CLogElement *element)
|
|||||||
mTotalTimeSpan = mMaxTime - mMinTime;
|
mTotalTimeSpan = mMaxTime - mMinTime;
|
||||||
mCurTimeSpan = mStopTime - mStartTime;
|
mCurTimeSpan = mStopTime - mStartTime;
|
||||||
|
|
||||||
mCurPixelTickValue = (qreal)GRAPH_ZONE_WIDTH/(qreal)mCurTimeSpan; //pixels per microsecs
|
// mCurPixelTickValue = (qreal)GRAPH_ZONE_WIDTH/(qreal)mCurTimeSpan; //pixels per microsecs
|
||||||
|
mCurPixelTickValue = mGraphZoneWidth/(qreal)mCurTimeSpan; //pixels per microsecs
|
||||||
mCursorPos = mStartTime;
|
mCursorPos = mStartTime;
|
||||||
|
|
||||||
mPassageStats1Txt->setPlainText(QString().sprintf("Date & heure: %s\nStation : %s\nPosition : %s",mPassageDateTime.toUtf8().data(),mPassageStation.toUtf8().data()," "));
|
mPassageStats1Txt->setPlainText(QString().sprintf("Date & heure: %s\nStation : %s\nPosition : %s",mPassageDateTime.toUtf8().data(),mPassageStation.toUtf8().data()," "));
|
||||||
@ -753,7 +769,8 @@ void CLogViewPage::ZoomIn(bool CenterOnCursor)
|
|||||||
|
|
||||||
//Convert time to pixels (in the new timespan)
|
//Convert time to pixels (in the new timespan)
|
||||||
quint64 AbsoluteTime = CursorTime - StartTime;
|
quint64 AbsoluteTime = CursorTime - StartTime;
|
||||||
qreal PixelsPernSecs = (qreal)GRAPH_ZONE_WIDTH/(NewSpan);
|
// qreal PixelsPernSecs = (qreal)GRAPH_ZONE_WIDTH/(NewSpan);
|
||||||
|
qreal PixelsPernSecs = mGraphZoneWidth/(NewSpan);
|
||||||
qreal Pixel = AbsoluteTime * PixelsPernSecs;
|
qreal Pixel = AbsoluteTime * PixelsPernSecs;
|
||||||
|
|
||||||
Pixel += GRAPH_ZONE_X_OFFSET;
|
Pixel += GRAPH_ZONE_X_OFFSET;
|
||||||
@ -762,7 +779,8 @@ void CLogViewPage::ZoomIn(bool CenterOnCursor)
|
|||||||
qreal DeltaX = Pixel - mCursorPos;
|
qreal DeltaX = Pixel - mCursorPos;
|
||||||
|
|
||||||
//convert this to an amount of time
|
//convert this to an amount of time
|
||||||
qint64 DeltaTime = ((qint64)DeltaX * NewSpan)/GRAPH_ZONE_WIDTH;
|
// qint64 DeltaTime = ((qint64)DeltaX * NewSpan)/GRAPH_ZONE_WIDTH;
|
||||||
|
qint64 DeltaTime = ((qint64)DeltaX * NewSpan)/mGraphZoneWidth;
|
||||||
|
|
||||||
//Shift the timespan to center the zoom on the cursor.
|
//Shift the timespan to center the zoom on the cursor.
|
||||||
StartTime += DeltaTime;
|
StartTime += DeltaTime;
|
||||||
@ -815,7 +833,8 @@ void CLogViewPage::ZoomOut(bool CenterOnCursor)
|
|||||||
|
|
||||||
//Convert time to pixels (in the new timespan)
|
//Convert time to pixels (in the new timespan)
|
||||||
quint64 AbsoluteTime = CursorTime - StartTime;
|
quint64 AbsoluteTime = CursorTime - StartTime;
|
||||||
qreal PixelsPernSecs = (qreal)GRAPH_ZONE_WIDTH/(NewSpan);
|
//qreal PixelsPernSecs = (qreal)GRAPH_ZONE_WIDTH/(NewSpan);
|
||||||
|
qreal PixelsPernSecs = mGraphZoneWidth/(NewSpan);
|
||||||
qreal Pixel = AbsoluteTime * PixelsPernSecs;
|
qreal Pixel = AbsoluteTime * PixelsPernSecs;
|
||||||
|
|
||||||
Pixel += GRAPH_ZONE_X_OFFSET;
|
Pixel += GRAPH_ZONE_X_OFFSET;
|
||||||
@ -824,7 +843,8 @@ void CLogViewPage::ZoomOut(bool CenterOnCursor)
|
|||||||
qreal DeltaX = Pixel - mCursorPos;
|
qreal DeltaX = Pixel - mCursorPos;
|
||||||
|
|
||||||
//convert this to an amount of time
|
//convert this to an amount of time
|
||||||
qint64 DeltaTime = ((qint64)DeltaX * NewSpan)/GRAPH_ZONE_WIDTH;
|
// qint64 DeltaTime = ((qint64)DeltaX * NewSpan)/GRAPH_ZONE_WIDTH;
|
||||||
|
qint64 DeltaTime = ((qint64)DeltaX * NewSpan)/mGraphZoneWidth;
|
||||||
|
|
||||||
//Shift the timespan to center the zoom on the cursor.
|
//Shift the timespan to center the zoom on the cursor.
|
||||||
StartTime += DeltaTime;
|
StartTime += DeltaTime;
|
||||||
@ -874,7 +894,7 @@ void CLogViewPage::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
mStaticCursor1->SetCursor();
|
mStaticCursor1->SetCursor();
|
||||||
mStaticCursor1->show();
|
mStaticCursor1->show();
|
||||||
UpdateStaticCursorsDeltaTime();
|
UpdateStaticCursorsDeltaTime();
|
||||||
mCursor1TimeTxt->setPlainText(QString().sprintf("Position curseur 1 : %d ms",(int)(mStaticCursor1->GetTime()/1000000)));
|
mCursor1TimeTxt->setPlainText(QString().sprintf("Curs. 1 : %d ms",(int)(mStaticCursor1->GetTime()/1000000)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(event->button() == Qt::RightButton)
|
if(event->button() == Qt::RightButton)
|
||||||
@ -883,7 +903,7 @@ void CLogViewPage::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
mStaticCursor2->SetTime(GetTimeForPixel(event->pos().x()));
|
mStaticCursor2->SetTime(GetTimeForPixel(event->pos().x()));
|
||||||
mStaticCursor2->SetCursor();
|
mStaticCursor2->SetCursor();
|
||||||
mStaticCursor2->show();
|
mStaticCursor2->show();
|
||||||
mCursor2TimeTxt->setPlainText(QString().sprintf("Position curseur 2 : %d ms",(int)(mStaticCursor2->GetTime()/1000000)));
|
mCursor2TimeTxt->setPlainText(QString().sprintf("Curs. 2 : %d ms",(int)(mStaticCursor2->GetTime()/1000000)));
|
||||||
UpdateStaticCursorsDeltaTime();
|
UpdateStaticCursorsDeltaTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -898,7 +918,8 @@ void CLogViewPage::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
//qreal Drag = 50;
|
//qreal Drag = 50;
|
||||||
if(Drag != 0)
|
if(Drag != 0)
|
||||||
{
|
{
|
||||||
qreal TickValue = (qreal)GRAPH_ZONE_WIDTH/(qreal)mCurTimeSpan;
|
// qreal TickValue = (qreal)GRAPH_ZONE_WIDTH/(qreal)mCurTimeSpan;
|
||||||
|
qreal TickValue = mGraphZoneWidth/(qreal)mCurTimeSpan;
|
||||||
qreal temp = TickValue/Drag;
|
qreal temp = TickValue/Drag;
|
||||||
//quint64 usecsDrag = 1/(mCurPixelTickValue/Drag);
|
//quint64 usecsDrag = 1/(mCurPixelTickValue/Drag);
|
||||||
qint64 usecsDrag = 1/temp;
|
qint64 usecsDrag = 1/temp;
|
||||||
@ -1049,7 +1070,8 @@ void CLogViewPage::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
|||||||
qreal CLogViewPage::GetPixelForTime(quint64 Time)
|
qreal CLogViewPage::GetPixelForTime(quint64 Time)
|
||||||
{
|
{
|
||||||
quint64 AbsoluteTime = Time - mStartTime;
|
quint64 AbsoluteTime = Time - mStartTime;
|
||||||
qreal PixelsPernSecs = (qreal)GRAPH_ZONE_WIDTH/(mStopTime - mStartTime);
|
//qreal PixelsPernSecs = (qreal)GRAPH_ZONE_WIDTH/(mStopTime - mStartTime);
|
||||||
|
qreal PixelsPernSecs = mGraphZoneWidth/(mStopTime - mStartTime);
|
||||||
qreal Pixel = AbsoluteTime * PixelsPernSecs;
|
qreal Pixel = AbsoluteTime * PixelsPernSecs;
|
||||||
|
|
||||||
return Pixel+GRAPH_ZONE_X_OFFSET;
|
return Pixel+GRAPH_ZONE_X_OFFSET;
|
||||||
@ -1058,7 +1080,8 @@ qreal CLogViewPage::GetPixelForTime(quint64 Time)
|
|||||||
quint64 CLogViewPage::GetTimeForPixel(qreal PixelPos)
|
quint64 CLogViewPage::GetTimeForPixel(qreal PixelPos)
|
||||||
{
|
{
|
||||||
PixelPos -= GRAPH_ZONE_X_OFFSET;
|
PixelPos -= GRAPH_ZONE_X_OFFSET;
|
||||||
qreal nSecsPerPixels = (mStopTime - mStartTime)/GRAPH_ZONE_WIDTH;
|
//qreal nSecsPerPixels = (mStopTime - mStartTime)/GRAPH_ZONE_WIDTH;
|
||||||
|
qreal nSecsPerPixels = (mStopTime - mStartTime)/mGraphZoneWidth;
|
||||||
quint64 AbsoluteTimeForPixel = PixelPos*nSecsPerPixels;
|
quint64 AbsoluteTimeForPixel = PixelPos*nSecsPerPixels;
|
||||||
quint64 Time = mStartTime + AbsoluteTimeForPixel;
|
quint64 Time = mStartTime + AbsoluteTimeForPixel;
|
||||||
|
|
||||||
@ -1083,7 +1106,8 @@ unsigned int CLogViewPage::ShowSpan(quint64 TimePos1, quint64 TimePos2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mCurTimeSpan = mStopTime - mStartTime;
|
mCurTimeSpan = mStopTime - mStartTime;
|
||||||
mCurPixelTickValue = (qreal)GRAPH_ZONE_WIDTH/(qreal)mCurTimeSpan; //pixels per microsecs
|
//mCurPixelTickValue = (qreal)GRAPH_ZONE_WIDTH/(qreal)mCurTimeSpan; //pixels per microsecs
|
||||||
|
mCurPixelTickValue = mGraphZoneWidth/(qreal)mCurTimeSpan; //pixels per microsecs
|
||||||
|
|
||||||
if(mViewType == ZT1_LOG_TYPE)
|
if(mViewType == ZT1_LOG_TYPE)
|
||||||
{
|
{
|
||||||
@ -1156,9 +1180,10 @@ unsigned int CLogViewPage::AdjustMouseCursorPos(qreal PosX, qreal PosY)
|
|||||||
mCursorPos = PosX;
|
mCursorPos = PosX;
|
||||||
if(mCursorPos < GRAPH_ZONE_X_OFFSET)
|
if(mCursorPos < GRAPH_ZONE_X_OFFSET)
|
||||||
mCursorPos = GRAPH_ZONE_X_OFFSET;
|
mCursorPos = GRAPH_ZONE_X_OFFSET;
|
||||||
else if(mCursorPos > GRAPH_ZONE_WIDTH + GRAPH_ZONE_X_OFFSET)
|
// else if(mCursorPos > GRAPH_ZONE_WIDTH + GRAPH_ZONE_X_OFFSET)
|
||||||
mCursorPos = GRAPH_ZONE_WIDTH + GRAPH_ZONE_X_OFFSET;
|
// mCursorPos = GRAPH_ZONE_WIDTH + GRAPH_ZONE_X_OFFSET;
|
||||||
|
else if(mCursorPos > mGraphZoneWidth + GRAPH_ZONE_X_OFFSET)
|
||||||
|
mCursorPos = mGraphZoneWidth + GRAPH_ZONE_X_OFFSET;
|
||||||
qreal HCursorPos = PosY;
|
qreal HCursorPos = PosY;
|
||||||
if(HCursorPos > GRAPH_ZONE_HEIGHT)
|
if(HCursorPos > GRAPH_ZONE_HEIGHT)
|
||||||
HCursorPos = GRAPH_ZONE_HEIGHT;
|
HCursorPos = GRAPH_ZONE_HEIGHT;
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
#include "QElapsedTimer"
|
#include "QElapsedTimer"
|
||||||
|
|
||||||
#define GRAPH_ZONE_WIDTH 880//900
|
#define GRAPH_ZONE_WIDTH 880//900
|
||||||
#define GRAPH_ZONE_HEIGHT 650//700
|
#define GRAPH_ZONE_HEIGHT 600//700
|
||||||
#define GRAPH_ZONE_X_OFFSET 70 //50
|
#define GRAPH_ZONE_X_OFFSET 70 //50
|
||||||
#define MIN_TIMESPAN 1000 //1 millisecond
|
#define MIN_TIMESPAN 1000 //1 millisecond
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ class CLogViewPage : public CGuiPage
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CLogViewPage(QGraphicsWidget *Parent = 0);
|
CLogViewPage(QGraphicsWidget *Parent = 0, qreal LogViewPageWidth = 800);
|
||||||
~CLogViewPage();
|
~CLogViewPage();
|
||||||
|
|
||||||
COutilZT *mProgramHandle;
|
COutilZT *mProgramHandle;
|
||||||
@ -167,6 +167,7 @@ private:
|
|||||||
QGraphicsTextItem *mStaticCursorDeltaTimeTxt, *mCursor1TimeTxt, *mCursor2TimeTxt;
|
QGraphicsTextItem *mStaticCursorDeltaTimeTxt, *mCursor1TimeTxt, *mCursor2TimeTxt;
|
||||||
QGraphicsTextItem *mPassageStats1Txt,*mPassageStats2Txt;
|
QGraphicsTextItem *mPassageStats1Txt,*mPassageStats2Txt;
|
||||||
QString mPassageDateTime, mPassageStation;
|
QString mPassageDateTime, mPassageStation;
|
||||||
|
qreal mGraphZoneWidth;
|
||||||
|
|
||||||
CGraphRulerWidget *mRuler;
|
CGraphRulerWidget *mRuler;
|
||||||
CRankRulerWidget *mRankRuler;
|
CRankRulerWidget *mRankRuler;
|
||||||
|
|||||||
@ -90,10 +90,10 @@ Panel::Panel()
|
|||||||
////////////////////////
|
////////////////////////
|
||||||
|
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
|
qreal LogViewPageWidth(650);
|
||||||
|
|
||||||
mMainPage = new CMainPage();
|
mMainPage = new CMainPage();
|
||||||
mDatabaseModeLogViewPage = new CLogViewPage();
|
mDatabaseModeLogViewPage = new CLogViewPage(0,LogViewPageWidth);
|
||||||
mDatabaseModeLogListPage = new CLogsListPage();
|
mDatabaseModeLogListPage = new CLogsListPage();
|
||||||
mOptionsPage = new COptionsPage();
|
mOptionsPage = new COptionsPage();
|
||||||
mNetworkZTListPage = new CNetworkZTListPage();
|
mNetworkZTListPage = new CNetworkZTListPage();
|
||||||
@ -101,7 +101,7 @@ Panel::Panel()
|
|||||||
mRemoteZTPage = new CRemoteZTPage();
|
mRemoteZTPage = new CRemoteZTPage();
|
||||||
mZTLogViewerPage = new CZTLogViewerPage(0,false);
|
mZTLogViewerPage = new CZTLogViewerPage(0,false);
|
||||||
mNetworkModeLogListPage = new CLogsListPage();
|
mNetworkModeLogListPage = new CLogsListPage();
|
||||||
mNetworkModeLogViewPage = new CLogViewPage();
|
mNetworkModeLogViewPage = new CLogViewPage(0,LogViewPageWidth);
|
||||||
mProgressBarPage = new CProgressBarPage();
|
mProgressBarPage = new CProgressBarPage();
|
||||||
mRemoteZTCtrlPage = new CRemoteZTCtrlPage();
|
mRemoteZTCtrlPage = new CRemoteZTCtrlPage();
|
||||||
mDatabaseMgrPage = new CDatabaseMgrPage();
|
mDatabaseMgrPage = new CDatabaseMgrPage();
|
||||||
@ -131,7 +131,7 @@ Panel::Panel()
|
|||||||
mMainPage->setZValue(0);
|
mMainPage->setZValue(0);
|
||||||
mMainPage->resize(10,SCREEN_RES_HEIGHT);
|
mMainPage->resize(10,SCREEN_RES_HEIGHT);
|
||||||
|
|
||||||
const static int LogViewPageWidth(750);
|
|
||||||
mDatabaseModeLogViewPage->setPos(SCREEN_RES_WIDTH-LogViewPageWidth,0);
|
mDatabaseModeLogViewPage->setPos(SCREEN_RES_WIDTH-LogViewPageWidth,0);
|
||||||
mDatabaseModeLogViewPage->resize(LogViewPageWidth/*980*/,SCREEN_RES_HEIGHT);
|
mDatabaseModeLogViewPage->resize(LogViewPageWidth/*980*/,SCREEN_RES_HEIGHT);
|
||||||
mDatabaseModeLogViewPage->setZValue(0);
|
mDatabaseModeLogViewPage->setZValue(0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user