New feature: speed reactive audio (Settings > Misc). Pick an MP3 and a dedicated volume; the always-on trip tracker shifts the clip's pitch and playback rate from min to max speed while you drive. Loop-with-speed is the default; a toggle enables layered overlap so speed changes never cut the clip off. Build script already compiles every module included in this commit.
26 lines
1.7 KiB
Java
26 lines
1.7 KiB
Java
import cloud.molberg.mgutility.VehicleSettingsCatalog;
|
|
import cloud.molberg.mgutility.VehicleSettingsProfile;
|
|
|
|
public final class VehicleSettingsCatalogTest {
|
|
private static void check(boolean condition, String message) {
|
|
if (!condition) throw new AssertionError(message);
|
|
}
|
|
public static void main(String[] args) {
|
|
check(VehicleSettingsCatalog.isRegenerativeLevel(0), "regen 0");
|
|
check(VehicleSettingsCatalog.isRegenerativeLevel(1), "regen 1");
|
|
check(VehicleSettingsCatalog.isRegenerativeLevel(2), "regen 2");
|
|
check(VehicleSettingsCatalog.isRegenerativeLevel(3), "regen 3");
|
|
check(VehicleSettingsCatalog.isRegenerativeLevel(5), "regen 5");
|
|
check(!VehicleSettingsCatalog.isRegenerativeLevel(4), "regen 4 rejected");
|
|
check(!VehicleSettingsCatalog.isRegenerativeLevel(6), "regen 6 rejected");
|
|
check(!VehicleSettingsCatalog.isRegenerativeLevel(7), "regen 7 rejected");
|
|
check(VehicleSettingsCatalog.get("regenerative_level").format(5).contains("experimental"), "level 5 label");
|
|
for (VehicleSettingsCatalog.Definition definition : VehicleSettingsCatalog.all())
|
|
check(!definition.id.toLowerCase().contains("ambient") && !definition.label.toLowerCase().contains("ambient lighting"), "ambient entry excluded");
|
|
check(VehicleSettingsProfile.known().allows("drive_mode"), "known profile allows drive mode");
|
|
check(!VehicleSettingsProfile.unknown().allowsWrites(), "unknown profile is read-only");
|
|
check(!VehicleSettingsProfile.match("com.allgo.rui", "old", "old", "IVehicleSettingService").allowsWrites(), "old profile read-only");
|
|
System.out.println("VehicleSettingsCatalogTest: OK");
|
|
}
|
|
}
|