Skip to content

Commit

Permalink
reformatted binary detection
Browse files Browse the repository at this point in the history
  • Loading branch information
cansik committed Nov 20, 2019
1 parent d70495c commit d270ce3
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ import kotlin.math.max
class BinaryObjectIdentifier(config: PipelineConfig = PipelineConfig()) : ObjectIdentifier(config) {

override fun recognizeObjectId(devices: List<TactileDevice>) {
devices.filter { it.state == TrackingEntityState.Alive
&& it.timeSinceLastStateChange > config.minDetectedTime.value }
devices.filter {
it.state == TrackingEntityState.Alive
&& it.timeSinceLastStateChange > config.minDetectedTime.value
}
.forEach {
when (it.identification.identifierPhase) {
BinaryIdentifierPhase.Requested -> start(it)
BinaryIdentifierPhase.Sampling -> sampling(it)
BinaryIdentifierPhase.Identifying -> identify(it)
BinaryIdentifierPhase.Detected -> {
when (it.identification.identifierPhase) {
BinaryIdentifierPhase.Requested -> start(it)
BinaryIdentifierPhase.Sampling -> sampling(it)
BinaryIdentifierPhase.Identifying -> identify(it)
BinaryIdentifierPhase.Detected -> {
}
}
}
}
}

private fun start(device: TactileDevice) {
Expand Down

0 comments on commit d270ce3

Please sign in to comment.