From: Urban Wallasch Date: Fri, 26 Jul 2019 05:20:01 +0000 (+0200) Subject: * Include effective clutch channel in telemetry. X-Git-Tag: v0.1.0~71 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=bbf7fbc83ae0d47a24f6ba7804f7c460e9cf188e;p=ets2_tele.git * Include effective clutch channel in telemetry. * Indicate clutch state by highliting gear display in dash.html. * Indicate paused state by dimming default font color in dash.html. --- diff --git a/dash.html b/dash.html index a1c66eb..7cb2e82 100644 --- a/dash.html +++ b/dash.html @@ -13,6 +13,11 @@ html, body { color: white; } +x-content { + display: block; + width: 100%; +} + x-boxleft, x-boxright { display: block; padding: 0.2em; @@ -46,15 +51,20 @@ x-boxright { float:right; } .warn1 { color:#fd0; } .warn2 { color:#f20; } .setval { color:#0af; } +.grey { color: #444 !important; } +.hilite { background-color: #ff0; } + + -- km/h - km/h x  + 0 rpm - km @@ -71,6 +81,8 @@ x-boxright { float:right; } - km/h + + diff --git a/telehttpd.c b/telehttpd.c index 4c095cf..4cc32d9 100644 --- a/telehttpd.c +++ b/telehttpd.c @@ -77,6 +77,7 @@ static void write_telejson( int fd ) { write(fd, buf, sprintf( buf, " \"rpm\": %f,\n", telemetry->rpm ) ); write(fd, buf, sprintf( buf, " \"gear\": %d,\n", telemetry->gear ) ); write(fd, buf, sprintf( buf, " \"gear_disp\": %d,\n", telemetry->gear_disp ) ); + write(fd, buf, sprintf( buf, " \"clutch_eff\": %f,\n", telemetry->clutch_eff ) ); write(fd, buf, sprintf( buf, " \"fuel\": %f,\n", telemetry->fuel ) ); write(fd, buf, sprintf( buf, " \"fuel_warn\": %d,\n", (int)telemetry->fuel_warn ) ); diff --git a/telelogger.c b/telelogger.c index dbe489f..bf62025 100644 --- a/telelogger.c +++ b/telelogger.c @@ -52,6 +52,7 @@ static int log_console(void) { printf( "rpm: %.0f /min\n", telemetry->rpm ); printf( "gear: %d\n", telemetry->gear ); printf( "gear d: %d\n", telemetry->gear_disp ); + printf( "clutch eff: %.1f\n", telemetry->clutch_eff ); printf( "fuel: %.1f l\n", telemetry->fuel ); printf( "fuel warn: %s\n", telemetry->fuel_warn ? "yes" : "no" ); diff --git a/telemetry.cpp b/telemetry.cpp index 791e3d0..aa3802b 100644 --- a/telemetry.cpp +++ b/telemetry.cpp @@ -406,6 +406,7 @@ SCSAPI_RESULT scs_telemetry_init(const scs_u32_t version, const scs_telemetry_in version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_engine_rpm, SCS_U32_NIL, SCS_VALUE_TYPE_float, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_float, &telemetry->rpm); version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_engine_gear, SCS_U32_NIL, SCS_VALUE_TYPE_s32, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_s32, &telemetry->gear); version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_displayed_gear, SCS_U32_NIL, SCS_VALUE_TYPE_s32, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_s32, &telemetry->gear_disp); + version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_effective_clutch, SCS_U32_NIL, SCS_VALUE_TYPE_float, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_float, &telemetry->clutch_eff); version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_fuel, SCS_U32_NIL, SCS_VALUE_TYPE_float, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_float, &telemetry->fuel); version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_fuel_warning, SCS_U32_NIL, SCS_VALUE_TYPE_bool, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_bool, &telemetry->fuel_warn); diff --git a/telemetry.h b/telemetry.h index f359ca8..c0f06ef 100644 --- a/telemetry.h +++ b/telemetry.h @@ -29,6 +29,7 @@ struct telemetry_state_t { float rpm; // engine rpm int gear; // engine gear int gear_disp; // displayed gear + float clutch_eff; // effective clutch float fuel; // fuel amount in l bool fuel_warn; // fuel low warning