##// END OF EJS Templates
change grapheRange to graphRange
perrinel -
r516:4905fe79fee7
parent child
Show More
@@ -142,7 +142,7 void VariableAcquisitionWorker::onVariableDataAcquired(QUuid acqIdentifier,
142
142
143 if (it != impl->m_VIdentifierToCurrrentAcqIdNextIdPairMap.cend()) {
143 if (it != impl->m_VIdentifierToCurrrentAcqIdNextIdPairMap.cend()) {
144 if (it->second.second.isNull()) {
144 if (it->second.second.isNull()) {
145 // There is no next request, we can remove the varibale request
145 // There is no next request, we can remove the variable request
146 impl->removeVariableRequest(acqRequest.m_vIdentifier);
146 impl->removeVariableRequest(acqRequest.m_vIdentifier);
147 }
147 }
148 else {
148 else {
@@ -23,36 +23,36 Q_LOGGING_CATEGORY(LOG_VariableController, "VariableController")
23
23
24 namespace {
24 namespace {
25
25
26 SqpRange computeSynchroRangeRequested(const SqpRange &varRange, const SqpRange &grapheRange,
26 SqpRange computeSynchroRangeRequested(const SqpRange &varRange, const SqpRange &graphRange,
27 const SqpRange &oldGraphRange)
27 const SqpRange &oldGraphRange)
28 {
28 {
29 auto zoomType = VariableController::getZoomType(grapheRange, oldGraphRange);
29 auto zoomType = VariableController::getZoomType(graphRange, oldGraphRange);
30
30
31 auto varRangeRequested = varRange;
31 auto varRangeRequested = varRange;
32 switch (zoomType) {
32 switch (zoomType) {
33 case AcquisitionZoomType::ZoomIn: {
33 case AcquisitionZoomType::ZoomIn: {
34 auto deltaLeft = grapheRange.m_TStart - oldGraphRange.m_TStart;
34 auto deltaLeft = graphRange.m_TStart - oldGraphRange.m_TStart;
35 auto deltaRight = oldGraphRange.m_TEnd - grapheRange.m_TEnd;
35 auto deltaRight = oldGraphRange.m_TEnd - graphRange.m_TEnd;
36 varRangeRequested.m_TStart += deltaLeft;
36 varRangeRequested.m_TStart += deltaLeft;
37 varRangeRequested.m_TEnd -= deltaRight;
37 varRangeRequested.m_TEnd -= deltaRight;
38 break;
38 break;
39 }
39 }
40
40
41 case AcquisitionZoomType::ZoomOut: {
41 case AcquisitionZoomType::ZoomOut: {
42 auto deltaLeft = oldGraphRange.m_TStart - grapheRange.m_TStart;
42 auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart;
43 auto deltaRight = grapheRange.m_TEnd - oldGraphRange.m_TEnd;
43 auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd;
44 varRangeRequested.m_TStart -= deltaLeft;
44 varRangeRequested.m_TStart -= deltaLeft;
45 varRangeRequested.m_TEnd += deltaRight;
45 varRangeRequested.m_TEnd += deltaRight;
46 break;
46 break;
47 }
47 }
48 case AcquisitionZoomType::PanRight: {
48 case AcquisitionZoomType::PanRight: {
49 auto deltaRight = grapheRange.m_TEnd - oldGraphRange.m_TEnd;
49 auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd;
50 varRangeRequested.m_TStart += deltaRight;
50 varRangeRequested.m_TStart += deltaRight;
51 varRangeRequested.m_TEnd += deltaRight;
51 varRangeRequested.m_TEnd += deltaRight;
52 break;
52 break;
53 }
53 }
54 case AcquisitionZoomType::PanLeft: {
54 case AcquisitionZoomType::PanLeft: {
55 auto deltaLeft = oldGraphRange.m_TStart - grapheRange.m_TStart;
55 auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart;
56 varRangeRequested.m_TStart -= deltaLeft;
56 varRangeRequested.m_TStart -= deltaLeft;
57 varRangeRequested.m_TEnd -= deltaLeft;
57 varRangeRequested.m_TEnd -= deltaLeft;
58 break;
58 break;
@@ -149,8 +149,8 void VisualizationGraphWidget::setRange(std::shared_ptr<Variable> variable, cons
149
149
150 SqpRange VisualizationGraphWidget::graphRange() const noexcept
150 SqpRange VisualizationGraphWidget::graphRange() const noexcept
151 {
151 {
152 auto grapheRange = ui->widget->xAxis->range();
152 auto graphRange = ui->widget->xAxis->range();
153 return SqpRange{grapheRange.lower, grapheRange.upper};
153 return SqpRange{graphRange.lower, graphRange.upper};
154 }
154 }
155
155
156 void VisualizationGraphWidget::setGraphRange(const SqpRange &range)
156 void VisualizationGraphWidget::setGraphRange(const SqpRange &range)
@@ -288,8 +288,8 void VisualizationGraphWidget::onDataCacheVariableUpdated()
288 // - use an ordered_multimap and the algos of std to group the values by key
288 // - use an ordered_multimap and the algos of std to group the values by key
289 // - use a map (unique keys) and store as values directly the list of components
289 // - use a map (unique keys) and store as values directly the list of components
290
290
291 auto grapheRange = ui->widget->xAxis->range();
291 auto graphRange = ui->widget->xAxis->range();
292 auto dateTime = SqpRange{grapheRange.lower, grapheRange.upper};
292 auto dateTime = SqpRange{graphRange.lower, graphRange.upper};
293
293
294 for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
294 for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
295 it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
295 it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
@@ -81,10 +81,10 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<V
81
81
82
82
83 // Lambda to synchronize zone widget
83 // Lambda to synchronize zone widget
84 auto synchronizeZoneWidget = [this, graphWidget](const SqpRange &grapheRange,
84 auto synchronizeZoneWidget = [this, graphWidget](const SqpRange &graphRange,
85 const SqpRange &oldGraphRange) {
85 const SqpRange &oldGraphRange) {
86
86
87 auto zoomType = VariableController::getZoomType(grapheRange, oldGraphRange);
87 auto zoomType = VariableController::getZoomType(graphRange, oldGraphRange);
88 auto frameLayout = ui->visualizationZoneFrame->layout();
88 auto frameLayout = ui->visualizationZoneFrame->layout();
89 for (auto i = 0; i < frameLayout->count(); ++i) {
89 for (auto i = 0; i < frameLayout->count(); ++i) {
90 auto graphChild
90 auto graphChild
@@ -94,8 +94,8 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<V
94 auto graphChildRange = graphChild->graphRange();
94 auto graphChildRange = graphChild->graphRange();
95 switch (zoomType) {
95 switch (zoomType) {
96 case AcquisitionZoomType::ZoomIn: {
96 case AcquisitionZoomType::ZoomIn: {
97 auto deltaLeft = grapheRange.m_TStart - oldGraphRange.m_TStart;
97 auto deltaLeft = graphRange.m_TStart - oldGraphRange.m_TStart;
98 auto deltaRight = oldGraphRange.m_TEnd - grapheRange.m_TEnd;
98 auto deltaRight = oldGraphRange.m_TEnd - graphRange.m_TEnd;
99 graphChildRange.m_TStart += deltaLeft;
99 graphChildRange.m_TStart += deltaLeft;
100 graphChildRange.m_TEnd -= deltaRight;
100 graphChildRange.m_TEnd -= deltaRight;
101 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomIn");
101 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomIn");
@@ -104,37 +104,37 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<V
104 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight")
104 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight")
105 << deltaRight;
105 << deltaRight;
106 qCCritical(LOG_VisualizationZoneWidget())
106 qCCritical(LOG_VisualizationZoneWidget())
107 << tr("TORM: dt") << grapheRange.m_TEnd - grapheRange.m_TStart;
107 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
108
108
109 break;
109 break;
110 }
110 }
111
111
112 case AcquisitionZoomType::ZoomOut: {
112 case AcquisitionZoomType::ZoomOut: {
113 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomOut");
113 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomOut");
114 auto deltaLeft = oldGraphRange.m_TStart - grapheRange.m_TStart;
114 auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart;
115 auto deltaRight = grapheRange.m_TEnd - oldGraphRange.m_TEnd;
115 auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd;
116 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: deltaLeft")
116 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: deltaLeft")
117 << deltaLeft;
117 << deltaLeft;
118 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight")
118 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight")
119 << deltaRight;
119 << deltaRight;
120 qCCritical(LOG_VisualizationZoneWidget())
120 qCCritical(LOG_VisualizationZoneWidget())
121 << tr("TORM: dt") << grapheRange.m_TEnd - grapheRange.m_TStart;
121 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
122 graphChildRange.m_TStart -= deltaLeft;
122 graphChildRange.m_TStart -= deltaLeft;
123 graphChildRange.m_TEnd += deltaRight;
123 graphChildRange.m_TEnd += deltaRight;
124 break;
124 break;
125 }
125 }
126 case AcquisitionZoomType::PanRight: {
126 case AcquisitionZoomType::PanRight: {
127 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: PanRight");
127 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: PanRight");
128 auto deltaRight = grapheRange.m_TEnd - oldGraphRange.m_TEnd;
128 auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd;
129 graphChildRange.m_TStart += deltaRight;
129 graphChildRange.m_TStart += deltaRight;
130 graphChildRange.m_TEnd += deltaRight;
130 graphChildRange.m_TEnd += deltaRight;
131 qCCritical(LOG_VisualizationZoneWidget())
131 qCCritical(LOG_VisualizationZoneWidget())
132 << tr("TORM: dt") << grapheRange.m_TEnd - grapheRange.m_TStart;
132 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
133 break;
133 break;
134 }
134 }
135 case AcquisitionZoomType::PanLeft: {
135 case AcquisitionZoomType::PanLeft: {
136 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: PanLeft");
136 qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: PanLeft");
137 auto deltaLeft = oldGraphRange.m_TStart - grapheRange.m_TStart;
137 auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart;
138 graphChildRange.m_TStart -= deltaLeft;
138 graphChildRange.m_TStart -= deltaLeft;
139 graphChildRange.m_TEnd -= deltaLeft;
139 graphChildRange.m_TEnd -= deltaLeft;
140 break;
140 break;
General Comments 1
Under Review
author

Auto status change to "Under Review"

You need to be logged in to leave comments. Login now