Compare commits

...

24 Commits

Author SHA1 Message Date
Jason Wen 8ac81d1373 bump 2026-04-06 10:38:43 -04:00
Jason Wen e5ee76f88a revert 2026-04-06 10:37:32 -04:00
Jason Wen eea5936c68 even faster 2026-04-05 13:13:37 -04:00
Jason Wen b2594929e4 remove 2026-04-05 12:25:02 -04:00
Jason Wen 2584bc9622 Revert "remove"
This reverts commit 909293ab6d.
2026-04-05 12:24:59 -04:00
Jason Wen 909293ab6d remove 2026-04-05 11:49:42 -04:00
Jason Wen 13c2b74773 add low-speed MDPS fault avoidance (Optima Hybrid for now, might work for others?) 2026-04-05 11:46:56 -04:00
Test User 9932519a3b comment 2026-04-04 12:15:56 -04:00
Test User e3ae6ea5a3 bump 2026-04-04 12:11:24 -04:00
Test User 4111b3c175 align with rest 2026-04-04 12:11:10 -04:00
Test User 56a34030bf misra 2026-04-04 11:52:25 -04:00
Test User d306f457a5 32 mph confirmed 2026-04-04 11:36:01 -04:00
Test User f8b892b547 skip instead 2026-04-04 10:39:40 -04:00
Test User 4957bb69bc new more 2026-04-04 08:42:13 -04:00
Test User be1e38768d weird one 2026-04-03 20:47:46 -04:00
Test User f88be7a0d1 bump 2026-04-03 20:33:39 -04:00
Test User 6f0257fe12 Merge remote-tracking branch 'commaai/openpilot/master' into optima-h-new 2026-04-03 20:33:23 -04:00
Adeeb Shihadeh f0053d4619 jotpluggler: state transition view is only for enums (#37761)
* jotpluggler: state transition view is only for enums

* cleaner
2026-04-03 14:52:35 -07:00
Harald Schäfer 052692b25d OP model 7 (#37760)
* a76ae294-e61a-43b8-b07e-c3496dbfc5ff/100

* recompile

* unused

* correct naming
2026-04-03 09:34:03 -07:00
Test User 7f2898475c new 2026-04-02 17:25:40 -04:00
Test User fa9fb9c742 not this time 2026-04-02 07:10:43 -04:00
Test User 7dd3972810 no laneline in lkas for these optima 2026-04-02 07:05:44 -04:00
Test User ab6a93acf8 must be enforced 2026-04-02 05:17:30 -04:00
Test User d129fe1878 HKG: Fix checksum calculation for KIA_OPTIMA_H and remove from dashcamOnly 2026-04-02 05:02:21 -04:00
5 changed files with 10 additions and 86 deletions
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eb6992bd60bada6162fea298e1a414b6b3d6a326db4eda46b9de62bcd8554754
size 13393859
oid sha256:e53f4e0527766082ba7bde38e275def0fe3c14f6c59ae2854439e239884d3ecc
size 13393365
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:86680a657bbb34f997034d1930bb2cb65c38b9222cea199732f72bd45791cfad
size 13022803
oid sha256:ea89c50da3a16e710da292f97c81b083a982cfdee5c28eca0d37ed2fb99af6c5
size 13022642
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7af05e03fd170653ff5771baf373a2c57b363da12c4c411cd416dee067b4cf58
size 23266366
oid sha256:6263aa3fbb44cde6c68a34cdb7cd8c389789dbc02b15c1911afdac4e018281ae
size 23267151
+3 -79
View File
@@ -6,7 +6,6 @@
#include <cmath>
#include <cstdio>
#include <limits>
#include <unordered_set>
constexpr double PLOT_Y_PAD_FRACTION = 0.4;
@@ -74,10 +73,6 @@ struct StateBlock {
std::string label;
};
struct PaneEnumContext {
std::vector<const EnumInfo *> enums;
};
struct PaneValueFormatContext {
SeriesFormat format;
bool valid = false;
@@ -106,38 +101,6 @@ bool curves_are_bool_like(const std::vector<PreparedCurve> &prepared_curves) {
return true;
}
bool curve_is_state_like(const PreparedCurve &curve) {
if (!curve.display_info.integer_like || curve.xs.size() < 2 || curve.xs.size() != curve.ys.size()) {
return false;
}
if (curve.enum_info != nullptr) {
return true;
}
std::unordered_set<int> distinct_values;
for (double value : curve.ys) {
if (!std::isfinite(value)) {
continue;
}
distinct_values.insert(static_cast<int>(std::llround(value)));
if (distinct_values.size() > 12) {
return false;
}
}
return !distinct_values.empty();
}
bool curves_use_state_blocks(const std::vector<PreparedCurve> &prepared_curves) {
if (prepared_curves.empty()) {
return false;
}
for (const PreparedCurve &curve : prepared_curves) {
if (!curve_is_state_like(curve)) {
return false;
}
}
return true;
}
ImU32 state_block_color(int value, float alpha = 1.0f) {
static constexpr std::array<std::array<uint8_t, 3>, 8> kPalette = {{
{{111, 143, 175}},
@@ -307,36 +270,6 @@ std::optional<double> app_sample_xy_value_at_time(const std::vector<double> &xs,
return y0 + (y1 - y0) * alpha;
}
int format_enum_axis_tick(double value, char *buf, int size, void *user_data) {
const auto *ctx = static_cast<const PaneEnumContext *>(user_data);
const int idx = static_cast<int>(std::llround(value));
if (ctx != nullptr && idx >= 0 && std::abs(value - static_cast<double>(idx)) < 0.01) {
std::vector<std::string_view> names;
names.reserve(ctx->enums.size());
for (const EnumInfo *info : ctx->enums) {
if (info == nullptr || static_cast<size_t>(idx) >= info->names.size()) {
continue;
}
const std::string &name = info->names[static_cast<size_t>(idx)];
if (name.empty()) continue;
if (std::find(names.begin(), names.end(), std::string_view(name)) == names.end()) {
names.emplace_back(name);
}
}
if (!names.empty()) {
std::string joined;
for (size_t i = 0; i < names.size(); ++i) {
if (i != 0) {
joined += ", ";
}
joined += names[i];
}
return std::snprintf(buf, size, "%d (%s)", idx, joined.c_str());
}
}
return std::snprintf(buf, size, "%.6g", value);
}
int format_numeric_axis_tick(double value, char *buf, int size, void *user_data) {
const auto *ctx = static_cast<const PaneValueFormatContext *>(user_data);
if (ctx == nullptr || !ctx->valid) {
@@ -831,23 +764,16 @@ void draw_plot(const AppSession &session, Pane *pane, UiState *state) {
}
const PlotBounds bounds = compute_plot_bounds(*pane, prepared_curves, *state);
PaneEnumContext enum_context;
PaneValueFormatContext pane_value_format;
const bool state_block_mode = curves_use_state_blocks(prepared_curves);
bool all_enum_curves = !prepared_curves.empty();
bool state_block_mode = !prepared_curves.empty();
size_t max_legend_label_width = 0;
for (const PreparedCurve &curve : prepared_curves) {
max_legend_label_width = std::max(max_legend_label_width, curve.label.size());
if (curve.enum_info != nullptr) {
enum_context.enums.push_back(curve.enum_info);
} else {
all_enum_curves = false;
if (curve.enum_info == nullptr) {
state_block_mode = false;
merge_pane_value_format(&pane_value_format, curve.display_info);
}
}
if (prepared_curves.empty()) {
all_enum_curves = false;
}
const int supported_count = static_cast<int>(prepared_curves.size());
const ImVec2 plot_size = ImGui::GetContentRegionAvail();
const bool has_cursor_time = state->has_tracker_time;
@@ -895,8 +821,6 @@ void draw_plot(const AppSession &session, Pane *pane, UiState *state) {
ImPlot::SetupAxisFormat(ImAxis_X1, "%.1f");
if (state_block_mode) {
ImPlot::SetupAxisLimits(ImAxis_Y1, 0.0, 1.0, ImPlotCond_Always);
} else if (all_enum_curves && !enum_context.enums.empty()) {
ImPlot::SetupAxisFormat(ImAxis_Y1, format_enum_axis_tick, &enum_context);
} else if (pane_value_format.valid) {
ImPlot::SetupAxisFormat(ImAxis_Y1, format_numeric_axis_tick, &pane_value_format);
} else {