首次提交
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#include "TimeAxis_p.h"
|
||||
#include "../base/Plot.h"
|
||||
|
||||
namespace YSG {
|
||||
Q_Ptr_cpp(TimeAxis)
|
||||
PROP_P(TimeAxis, int, timePointSize)
|
||||
PROP_P(TimeAxis, int, tickPixelSpace)
|
||||
PROP_P(TimeAxis, QString, timeFormat)
|
||||
PROP_P(TimeAxis, QFont, font)
|
||||
int TimeAxis::giveData(QTime time) {
|
||||
if(!ok()) return -1;
|
||||
std::pair<int, bool> ret = d()->mTimeTicker.getNewDataTickInfo();
|
||||
auto td = d()->tempDataCache();
|
||||
td->mAllTime.push_back(time);
|
||||
if(ret.second) {
|
||||
td->mData.push_front({time, ret.first});
|
||||
}
|
||||
return ret.first;
|
||||
}
|
||||
|
||||
QTime TimeAxis::tickToTime(int tick, SRC src) {
|
||||
INIT_GET(TimeAxis)
|
||||
int offset = tick - (int)renderState->coordStart;
|
||||
return *(d()->mRingBuffer.list<QTime>() + offset);
|
||||
}
|
||||
TimeAxis::Builder::Builder(Plot* plot, Qt::Orientation orientation) {
|
||||
this->plot = plot;
|
||||
this->orientation = orientation;
|
||||
}
|
||||
TimeAxis* TimeAxis::Builder::build() {
|
||||
auto ret = new TimeAxis();
|
||||
set(ret);
|
||||
TimeAxisPrivate* pd = ret->d();
|
||||
TimeAxisRenderState* sc = pd->renderStateCache();
|
||||
PROP_R(int, timePointSize)
|
||||
PROP_R(int, tickPixelSpace)
|
||||
PROP_R(QString, timeFormat)
|
||||
PROP_R(QFont, font)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user