* Added differential lock channel to telemetry.
* Added planned job distance configuration to telemetry.
* Indicate automatic mode for reverse gears.
* Bumped TELE_VERSION to 4.
.tinyb { font-size: 1em; font-weight: bold; }
.dim { color:#888; }
-.warn1 { color:#fd0; }
-.warn2 { color:#f20; }
+.warn1 { color:#fd0 !important; }
+.warn2 { color:#f20 !important; }
.setval { color:#0af; }
.hilite { background-color: #ff0; }
.special { font-size:50%; color:#088; }
<tr><td class="tiny">Mass </td><td><span class="tinyb" id="cargomass">-</span></td></tr>
<tr><td class="tiny">From </td><td><span class="tinyb" id="source">-</span></td></tr>
<tr><td class="tiny">To </td><td><span class="tinyb" id="destination">-</span></td></tr>
+ <tr><td class="tiny">Dist </td><td><span class="tinyb" id="job_dist">-</span></td></tr>
<tr><td class="tiny">Reward </td><td><span class="tinyb" id="reward">-</span></td></tr>
</table>
</x-boxleft>
var cargomass = document.getElementById('cargomass');
var source = document.getElementById('source');
var destination = document.getElementById('destination');
+var job_dist = document.getElementById('job_dist');
var reward = document.getElementById('reward');
//
var errbar = document.getElementById('errbar');
if ( x > 0 )
return ( m ? '' : 'A' ) + ( f==14 ? ( x<3 ? 'C'+x : x-2 ) : x );
if ( x < 0 )
- return 'R' + -x;
+ return ( m ? '' : 'A' ) + 'R' + -x;
return 'N';
}
}
// Version and flag constants:
-const TELE_VERSION = 3;
+const TELE_VERSION = 4;
const TELE_FLAG_ALIVE = 1;
const MINUS_1_U32 = 4294967295; // minus one as 32 bit unsigned int
// engine gear:
if ( !last_tele || last_tele.gear_disp != tele.gear_disp || last_tele.shifter != tele.shifter )
gear.innerHTML = dgear(tele.gear_disp, tele.gear_fwdcnt, tele.shifter);
+ if ( !last_tele || last_tele.diff_lock != tele.diff_lock )
+ warn( gear, tele.diff_lock ? 2 : 0 );
// clutch:
if ( !last_tele || last_tele.clutch_eff != tele.clutch_eff ) {
if ( tele.clutch_eff > 0 )
cargomass.innerHTML = tele.job_isvalid ? (tele.job_cargo_mass / 1000).toFixed(0) + 't' : '-';
source.innerHTML = tele.job_isvalid ? tele.job_source_city : '-';
destination.innerHTML = tele.job_isvalid ? tele.job_destination_city : '-';
+ job_dist.innerHTML = tele.job_isvalid ? tele.job_planned_distance + 'km' : '-';
reward.innerHTML = tele.job_isvalid ? tele.job_income + '.-' : '-';
}
.tiny { font-size: 1em; }
.tinyb { font-size: 1em; font-weight: bold; }
-.warn1 { color:#fd0; }
-.warn2 { color:#f20; }
+.warn1 { color:#fd0 !important; }
+.warn2 { color:#f20 !important; }
.setval { color:#0af; }
.hilite { background-color: #ff0; }
.special { font-size:50%; color:#088; }
<tr><td class="tiny">Mass </td><td><span class="tinyb" id="cargomass">-</span></td></tr>
<tr><td class="tiny">From </td><td><span class="tinyb" id="source">-</span></td></tr>
<tr><td class="tiny">To </td><td><span class="tinyb" id="destination">-</span></td></tr>
+ <tr><td class="tiny">Dist </td><td><span class="tinyb" id="job_dist">-</span></td></tr>
<tr><td class="tiny">Reward </td><td><span class="tinyb" id="reward">-</span></td></tr>
</table>
</x-boxleft>
var cargomass = document.getElementById("cargomass");
var source = document.getElementById("source");
var destination = document.getElementById("destination");
+var job_dist = document.getElementById('job_dist');
var reward = document.getElementById("reward");
//
var errbar = document.getElementById("errbar");
if ( x > 0 )
return ( m ? '' : 'A' ) + ( f==14 ? ( x<3 ? 'C'+x : x-2 ) : x );
if ( x < 0 )
- return 'R' + -x;
+ return ( m ? '' : 'A' ) + 'R' + -x;
return 'N';
}
errbar.innerHTML = "Game offline";
return;
}
- else if ( tele.tele_version !== 3 ) { // TELE_VERSION
+ else if ( tele.tele_version !== 4 ) { // TELE_VERSION
errbar.style.display = "block";
errbar.innerHTML = "Version mismatch";
} else {
cctrl.innerHTML = Math.round(tele.cctrl * 3.6);
// engine gear:
gear.innerHTML = dgear(tele.gear_disp, tele.gear_fwdcnt, tele.shifter);
+ warn( gear, tele.diff_lock ? 2 : 0 );
if ( tele.clutch_eff > 0 )
gear.classList.add("hilite");
else
cargomass.innerHTML = tele.job_isvalid ? (tele.job_cargo_mass / 1000).toFixed(0) + 't' : '-';
source.innerHTML = tele.job_isvalid ? tele.job_source_city : '-';
destination.innerHTML = tele.job_isvalid ? tele.job_destination_city : '-';
+ job_dist.innerHTML = tele.job_isvalid ? tele.job_planned_distance + 'km' : '-';
reward.innerHTML = tele.job_isvalid ? tele.job_income + '.-' : '-';
}
else if (this.readyState == 4) {
* 1.00 - initial version - corresponds to 1.12 in ETS2
* 1.01 - added support for multiple trailers (doubles, triples), trailer ownership support,
* gameplay events support added
+ * 1.02 - added planned_distance_km to active job info
+ * 1.03 - added support for 'avoid_inspection', 'illegal_border_crossing' and 'hard_shoulder_violation' offence type in 'player.fined' gameplay event
+ * 1.04 - added differential lock, lift axle and hazard warning channels
*/
//@{
#define SCS_TELEMETRY_ATS_GAME_VERSION_1_00 SCS_MAKE_VERSION(1, 0)
#define SCS_TELEMETRY_ATS_GAME_VERSION_1_01 SCS_MAKE_VERSION(1, 1)
-#define SCS_TELEMETRY_ATS_GAME_VERSION_CURRENT SCS_TELEMETRY_ATS_GAME_VERSION_1_01
+#define SCS_TELEMETRY_ATS_GAME_VERSION_1_02 SCS_MAKE_VERSION(1, 2) // Patch 1.36
+#define SCS_TELEMETRY_ATS_GAME_VERSION_1_03 SCS_MAKE_VERSION(1, 3) // Patch 1.36
+#define SCS_TELEMETRY_ATS_GAME_VERSION_1_04 SCS_MAKE_VERSION(1, 4) // Patch 1.41
+#define SCS_TELEMETRY_ATS_GAME_VERSION_CURRENT SCS_TELEMETRY_ATS_GAME_VERSION_1_04
//@}
// Game specific units.
*
* If there are less trailers in game than @c SCS_TELEMETRY_trailers_count
* telemetry will return all configurations however starting from the trailer after last
- * existing one its attributes will be empty. (only one unnamed attribute will be returned)
+ * existing one its attributes will be empty.
*
* Supported attributes:
* @li id
* @li brand_id
* @li brand
* @li name
- * @li chain_type
- * @li body_type
+ * @li chain_type (reported only for first trailer)
+ * @li body_type (reported only for first trailer)
* @li license_plate
* @li license_plate_country
* @li license_plate_country_id
* @li is_cargo_loaded
* @li job_market
* @li special_job
+ * @li planned_distance_km
*/
#define SCS_TELEMETRY_CONFIG_job "job"
*/
#define SCS_TELEMETRY_CONFIG_ATTRIBUTE_delivery_time "delivery.time"
+/**
+ * @brief Planned job distance in simulated kilometers.
+ *
+ * Does not include distance driven using ferry.
+ *
+ * Type: u32
+ */
+#define SCS_TELEMETRY_CONFIG_ATTRIBUTE_planned_distance_km "planned_distance.km"
/**
* @brief Is cargo loaded on the trailer?
* @li speeding
* @li avoid_weighing
* @li illegal_trailer
+ * @li avoid_inspection
+ * @li illegal_border_crossing
+ * @li hard_shoulder_violation
+ * @li damaged_vehicle_usage
* @li generic
*
* Type: string
*/
#define SCS_TELEMETRY_TRUCK_CHANNEL_rblinker "truck.rblinker"
+/**
+ * @brief Are the hazard warning light enabled?
+ *
+ * This represents the logical enable state of the hazard warning.
+ * It it is true as long it is enabled regardless of the physical
+ * enabled state of the light (i.e. it does not blink).
+ *
+ * Type: bool
+ */
+#define SCS_TELEMETRY_TRUCK_CHANNEL_hazard_warning "truck.hazard.warning"
+
/**
* @brief Is the light in the left blinker currently on?
*
*/
#define SCS_TELEMETRY_TRUCK_CHANNEL_dashboard_backlight "truck.dashboard.backlight"
+/**
+ * @brief Is the differential lock enabled?
+ *
+ * Type: bool
+ */
+#define SCS_TELEMETRY_TRUCK_CHANNEL_differential_lock "truck.differential_lock"
+
+/**
+ * @brief Is the lift axle control set to lifted state?
+ *
+ * Type: bool
+ */
+#define SCS_TELEMETRY_TRUCK_CHANNEL_lift_axle "truck.lift_axle"
+
+/**
+ * @brief Is the lift axle indicator lit?
+ *
+ * Type: bool
+ */
+#define SCS_TELEMETRY_TRUCK_CHANNEL_lift_axle_indicator "truck.lift_axle.indicator"
+
+/**
+ * @brief Is the trailer lift axle control set to lifted state?
+ *
+ * Type: bool
+ */
+#define SCS_TELEMETRY_TRUCK_CHANNEL_trailer_lift_axle "truck.trailer.lift_axle"
+
+/**
+ * @brief Is the trailer lift axle indicator lit?
+ *
+ * Type: bool
+ */
+#define SCS_TELEMETRY_TRUCK_CHANNEL_trailer_lift_axle_indicator "truck.trailer.lift_axle.indicator"
+
// Wear info.
/**
* by ETS2 1.24 and older.
* 1.14 - added support for multiple trailers (doubles, triples), trailer ownership support,
* gameplay events support added
+ * 1.15 - added planned_distance_km to active job info
+ * 1.16 - added support for 'avoid_inspection', 'illegal_border_crossing' and 'hard_shoulder_violation' offence type in 'player.fined' gameplay event
+ * 1.17 - added differential lock, lift axle and hazard warning channels
*/
//@{
#define SCS_TELEMETRY_EUT2_GAME_VERSION_1_00 SCS_MAKE_VERSION(1, 0)
#define SCS_TELEMETRY_EUT2_GAME_VERSION_1_12 SCS_MAKE_VERSION(1, 12) // Patch 1.17
#define SCS_TELEMETRY_EUT2_GAME_VERSION_1_13 SCS_MAKE_VERSION(1, 13) // Patch 1.27
#define SCS_TELEMETRY_EUT2_GAME_VERSION_1_14 SCS_MAKE_VERSION(1, 14) // Patch 1.35
-#define SCS_TELEMETRY_EUT2_GAME_VERSION_CURRENT SCS_TELEMETRY_EUT2_GAME_VERSION_1_14
+#define SCS_TELEMETRY_EUT2_GAME_VERSION_1_15 SCS_MAKE_VERSION(1, 15) // Patch 1.36
+#define SCS_TELEMETRY_EUT2_GAME_VERSION_1_16 SCS_MAKE_VERSION(1, 16) // Patch 1.36
+#define SCS_TELEMETRY_EUT2_GAME_VERSION_1_17 SCS_MAKE_VERSION(1, 17) // Patch 1.41
+#define SCS_TELEMETRY_EUT2_GAME_VERSION_CURRENT SCS_TELEMETRY_EUT2_GAME_VERSION_1_17
//@}
// Game specific units.
n += snprintf( buf+n, size-n, " \"clutch_eff\": %.12f,\n", tele->clutch_eff ); CHKSIZE;
n += snprintf( buf+n, size-n, " \"throttle_eff\": %.12f,\n", tele->throttle_eff ); CHKSIZE;
n += snprintf( buf+n, size-n, " \"shifter\": %"PRIi32",\n", tele->shifter ); CHKSIZE;
+ n += snprintf( buf+n, size-n, " \"diff_lock\": %"PRIu8",\n", tele->diff_lock ); CHKSIZE;
n += snprintf( buf+n, size-n, " \"fuel\": %.12f,\n", tele->fuel ); CHKSIZE;
n += snprintf( buf+n, size-n, " \"fuel_warn\": %"PRIu8",\n", tele->fuel_warn ); CHKSIZE;
n += snprintf( buf+n, size-n, " \"job_cargo\": \"%s\",\n", tele->job_cargo ); CHKSIZE;
n += snprintf( buf+n, size-n, " \"job_source_city\": \"%s\",\n", tele->job_source_city ); CHKSIZE;
n += snprintf( buf+n, size-n, " \"job_destination_city\": \"%s\",\n", tele->job_destination_city ); CHKSIZE;
+ n += snprintf( buf+n, size-n, " \"job_planned_distance\": %"PRIu32",\n", tele->job_planned_distance ); CHKSIZE;
// add more here
#define TELE_STRLEN 30
-#define TELE_VERSION 3
+#define TELE_VERSION 4
#define TELE_FLAG_ALIVE 0x0001U
double clutch_eff; // effective clutch
double throttle_eff; // effective throttle
int32_t shifter; // 0 = automatic, 1 = manual
+ bool_t diff_lock; // differential lock
double fuel; // fuel amount in l
bool_t fuel_warn; // fuel low warning
char job_cargo[TELE_STRLEN]; // job cargo name
char job_source_city[TELE_STRLEN]; // job source city name
char job_destination_city[TELE_STRLEN]; // job destination city name
+ uint32_t job_planned_distance; // job planned distance in km
uint32_t trailer_cnt; // number of active trailers
};
* @li is_cargo_loaded
* @li job_market
* @li special_job
+ * @li planned_distance_km
*/
for (const scs_named_value_t *current = info->attributes; current->name; ++current) {
if ( 0 == strcmp( current->name, SCS_TELEMETRY_CONFIG_ATTRIBUTE_delivery_time ) ) {
else if ( 0 == strcmp( current->name, SCS_TELEMETRY_CONFIG_ATTRIBUTE_destination_city ) ) {
snprintf( telemetry->job_destination_city, sizeof telemetry->job_destination_city, "%s", current->value.value_string.value );
}
+ else if ( 0 == strcmp( current->name, SCS_TELEMETRY_CONFIG_ATTRIBUTE_planned_distance_km ) ) {
+ telemetry->job_planned_distance = current->value.value_u32.value;
+ }
}
}
else if ( 0 == strcmp( info->id, SCS_TELEMETRY_CONFIG_trailer ) )
&& (version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_engine_rpm, SCS_U32_NIL, SCS_VALUE_TYPE_double, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_double, &telemetry->rpm) == SCS_RESULT_ok)
&& (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) == SCS_RESULT_ok)
&& (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) == SCS_RESULT_ok)
+ && (version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_differential_lock, SCS_U32_NIL, SCS_VALUE_TYPE_bool, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_bool, &telemetry->diff_lock) == SCS_RESULT_ok)
&& (version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_effective_clutch, SCS_U32_NIL, SCS_VALUE_TYPE_double, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_double, &telemetry->clutch_eff) == SCS_RESULT_ok)
&& (version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_effective_throttle, SCS_U32_NIL, SCS_VALUE_TYPE_double, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_double, &telemetry->throttle_eff) == SCS_RESULT_ok)
&& (version_params->register_for_channel(SCS_TELEMETRY_TRUCK_CHANNEL_fuel, SCS_U32_NIL, SCS_VALUE_TYPE_double, SCS_TELEMETRY_CHANNEL_FLAG_none, telemetry_store_double, &telemetry->fuel) == SCS_RESULT_ok)