fix: restore particle timeline readiness after field adapter
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled

This commit is contained in:
OpenAI Codex
2026-09-04 13:43:30 +08:00
parent dcedbe7394
commit a418e50a01
9 changed files with 170 additions and 8 deletions

View File

@@ -35,7 +35,7 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() {
private var styleLoadEpoch = 0L
private var styleReady = false
// Display mirror only; Core remains the playback state authority.
private var timelineState = "READY"
private var timelineState = "NOT READY"
private var timelineSpeed = "1x"
override fun onCreate(savedInstanceState: Bundle?) {
@@ -114,7 +114,7 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() {
timeWindowMode = true
fixtureMode = FIXTURE_UNIFORM_EAST
timeMix = 0.0f
timelineState = "READY"
timelineState = "NOT READY"
if (this::maplibreMap.isInitialized) loadValidationStyle(active, enabled, "TIME_WINDOW")
}
findViewById<Button>(R.id.validationMix0).setOnClickListener { setTimeMix(0.0f) }
@@ -199,7 +199,7 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() {
if (!maplibreMap.controlRasterArraySourceTimeline(PARTICLE_SOURCE_ID, command, value)) {
Log.i(TAG, "ParticleTimeline: event=REJECTED command=$command")
} else {
timelineState = when (command) { 0 -> "PLAYING"; 1 -> "PAUSED"; 6, 7 -> "WAITING"; 8 -> "PAUSED"; else -> timelineState }
timelineState = when (command) { 0 -> "PLAY"; 1 -> "PAUSE"; 6 -> "WAIT"; 7 -> "INVALID"; 8 -> "PAUSE"; else -> timelineState }
if (command == 2) timelineSpeed = "${value}x"
status.text = statusText()
Log.i(TAG, "ParticleTimeline: event=COMMAND command=$command value=$value")
@@ -219,7 +219,8 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() {
Log.i(TAG, "ParticleGPU: event=STYLE_LOAD epoch=$styleLoadEpoch reason=$reason")
maplibreMap.setStyle(Style.Builder().fromJson(validationStyle(active, enabled))) {
styleReady = true
status.text = state
if (timeWindowMode) timelineState = "READY"
status.text = statusText()
}
}
@@ -380,7 +381,7 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() {
} else {
"EAST"
}
val playback = if (timeWindowMode) " · $timelineState · $timelineSpeed" else ""
val playback = if (timeWindowMode) " · TL $timelineState · $timelineSpeed" else ""
return "$mask · $runtime · $fields$playback · MIX ${(timeMix * 100).toInt()}% · $particleCount · W ${"%.1f".format(lineWidth)} L ${"%.3f".format(particleLength)} O ${(particleOpacity * 100).toInt()} T ${(trailOpacity * 100).toInt()} F ${(trailFade * 100).toInt()} C ${if (speedColorEnabled) "ON" else "OFF"}"
}