@@ -4633,7 +4633,7 @@ void data_recording(data::DataOperationEnum operation, data::Cursor &cursor, dat
4633
4633
static int yAtTouchDown;
4634
4634
4635
4635
if (g_focusDataId == DATA_ID_DLOG_VISIBLE_VALUE_OFFSET) {
4636
- dlog_view::DlogValueParams *dlogValueParams = dlog_view::getVisibleDlogValueParams (recording, dlog_view::getNumVisibleDlogValues (recording) > 4 ? recording.selectedVisibleValueIndex : g_focusCursor.i );
4636
+ dlog_view::DlogValueParams *dlogValueParams = dlog_view::getVisibleDlogValueParams (recording, ! dlog_view::yAxisHasDifferentUnits (recording) ? recording.selectedVisibleValueIndex : g_focusCursor.i );
4637
4637
4638
4638
if (touchDrag->type == EVENT_TYPE_TOUCH_DOWN) {
4639
4639
valueAtTouchDown = dlogValueParams->offset ;
@@ -4649,7 +4649,7 @@ void data_recording(data::DataOperationEnum operation, data::Cursor &cursor, dat
4649
4649
dlogValueParams->offset = newOffset;
4650
4650
}
4651
4651
} else if (g_focusDataId == DATA_ID_DLOG_VISIBLE_VALUE_DIV) {
4652
- dlog_view::DlogValueParams *dlogValueParams = dlog_view::getVisibleDlogValueParams (recording, dlog_view::getNumVisibleDlogValues (recording) > 4 ? recording.selectedVisibleValueIndex : g_focusCursor.i );
4652
+ dlog_view::DlogValueParams *dlogValueParams = dlog_view::getVisibleDlogValueParams (recording, ! dlog_view::yAxisHasDifferentUnits (recording) ? recording.selectedVisibleValueIndex : g_focusCursor.i );
4653
4653
4654
4654
if (touchDrag->type == EVENT_TYPE_TOUCH_DOWN) {
4655
4655
valueAtTouchDown = dlogValueParams->div ;
@@ -4752,7 +4752,7 @@ void data_dlog_overlay(data::DataOperationEnum operation, data::Cursor &cursor,
4752
4752
int state = 0 ;
4753
4753
int numVisibleDlogValues = dlog_view::getNumVisibleDlogValues (recording);
4754
4754
4755
- if (dlog_view::g_showLegend && numVisibleDlogValues <= 4 ) {
4755
+ if (dlog_view::g_showLegend && dlog_view::yAxisHasDifferentUnits (recording) ) {
4756
4756
state = numVisibleDlogValues;
4757
4757
}
4758
4758
@@ -4799,7 +4799,7 @@ void data_dlog_overlay_over_4(data::DataOperationEnum operation, data::Cursor &c
4799
4799
value = data::Value (&overlay, VALUE_TYPE_POINTER);
4800
4800
} else if (operation == data::DATA_OPERATION_UPDATE_OVERLAY_DATA) {
4801
4801
dlog_view::Recording &recording = dlog_view::getRecording ();
4802
- overlay.state = dlog_view::g_showLegend && dlog_view::getNumVisibleDlogValues (recording) > 4 ? 1 : 0 ;
4802
+ overlay.state = dlog_view::g_showLegend && ! dlog_view::yAxisHasDifferentUnits (recording);
4803
4803
4804
4804
WidgetCursor &widgetCursor = *(WidgetCursor *)value.getVoidPointer ();
4805
4805
overlay.width = widgetCursor.widget ->w ;
@@ -4822,15 +4822,15 @@ void data_dlog_visible_values(data::DataOperationEnum operation, data::Cursor &c
4822
4822
void data_dlog_visible_value_label (data::DataOperationEnum operation, data::Cursor &cursor, data::Value &value) {
4823
4823
if (operation == data::DATA_OPERATION_GET) {
4824
4824
dlog_view::Recording &recording = dlog_view::getRecording ();
4825
- int dlogValueIndex = dlog_view::getDlogValueIndex (recording, dlog_view::getNumVisibleDlogValues (recording) > 4 ? recording.selectedVisibleValueIndex : cursor.i );
4825
+ int dlogValueIndex = dlog_view::getDlogValueIndex (recording, ! dlog_view::yAxisHasDifferentUnits (recording) ? recording.selectedVisibleValueIndex : cursor.i );
4826
4826
value = Value (dlogValueIndex, VALUE_TYPE_DLOG_VALUE_LABEL);
4827
4827
}
4828
4828
}
4829
4829
4830
4830
void data_dlog_visible_value_div (data::DataOperationEnum operation, data::Cursor &cursor, data::Value &value) {
4831
4831
#if OPTION_SD_CARD
4832
4832
dlog_view::Recording &recording = dlog_view::getRecording ();
4833
- int dlogValueIndex = dlog_view::getDlogValueIndex (recording, dlog_view::getNumVisibleDlogValues (recording) > 4 ? recording.selectedVisibleValueIndex : cursor.i );
4833
+ int dlogValueIndex = dlog_view::getDlogValueIndex (recording, ! dlog_view::yAxisHasDifferentUnits (recording) ? recording.selectedVisibleValueIndex : cursor.i );
4834
4834
4835
4835
if (operation == data::DATA_OPERATION_GET) {
4836
4836
bool focused = g_focusCursor == cursor && g_focusDataId == DATA_ID_DLOG_VISIBLE_VALUE_DIV;
@@ -4866,7 +4866,7 @@ void data_dlog_visible_value_div(data::DataOperationEnum operation, data::Cursor
4866
4866
void data_dlog_visible_value_offset (data::DataOperationEnum operation, data::Cursor &cursor, data::Value &value) {
4867
4867
#if OPTION_SD_CARD
4868
4868
dlog_view::Recording &recording = dlog_view::getRecording ();
4869
- int dlogValueIndex = dlog_view::getDlogValueIndex (recording, dlog_view::getNumVisibleDlogValues (recording) > 4 ? recording.selectedVisibleValueIndex : cursor.i );
4869
+ int dlogValueIndex = dlog_view::getDlogValueIndex (recording, ! dlog_view::yAxisHasDifferentUnits (recording) ? recording.selectedVisibleValueIndex : cursor.i );
4870
4870
4871
4871
if (operation == data::DATA_OPERATION_GET) {
4872
4872
bool focused = g_focusCursor == cursor && g_focusDataId == DATA_ID_DLOG_VISIBLE_VALUE_OFFSET;
@@ -4985,7 +4985,7 @@ void data_dlog_visible_value_cursor(data::DataOperationEnum operation, data::Cur
4985
4985
#if OPTION_SD_CARD
4986
4986
if (operation == data::DATA_OPERATION_GET) {
4987
4987
dlog_view::Recording &recording = dlog_view::getRecording ();
4988
- int dlogValueIndex = dlog_view::getDlogValueIndex (recording, dlog_view::getNumVisibleDlogValues (recording) > 4 ? recording.selectedVisibleValueIndex : cursor.i );
4988
+ int dlogValueIndex = dlog_view::getDlogValueIndex (recording, ! dlog_view::yAxisHasDifferentUnits (recording) ? recording.selectedVisibleValueIndex : cursor.i );
4989
4989
auto ytDataGetValue = data::ytDataGetGetValueFunc (cursor, DATA_ID_RECORDING);
4990
4990
float max;
4991
4991
float min = ytDataGetValue (ytDataGetPosition (cursor, DATA_ID_RECORDING) + recording.cursorOffset , dlogValueIndex, &max);
0 commit comments