Fix visibility range for collective
This commit is contained in:
parent
c55ce2cf9a
commit
60a693b1b3
@ -44,7 +44,7 @@ internal fun VirtualDeviceState(
|
||||
internal class DeviceCollectiveModel(
|
||||
context: Context,
|
||||
val deviceStates: Collection<CollectiveDeviceState>,
|
||||
val visibilityRange: Distance = 1.kilometers,
|
||||
val visibilityRange: Distance = 0.5.kilometers,
|
||||
val radioRange: Distance = 5.kilometers,
|
||||
) : ModelConstructor(context), PeerConnection {
|
||||
|
||||
|
@ -44,7 +44,7 @@ internal fun generateModel(
|
||||
}
|
||||
}
|
||||
|
||||
val model = DeviceCollectiveModel(context, devices, 0.2.kilometers)
|
||||
val model = DeviceCollectiveModel(context, devices)
|
||||
|
||||
return model
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ import space.kscience.maps.coordinates.Gmc
|
||||
import space.kscience.maps.coordinates.meters
|
||||
import space.kscience.maps.features.*
|
||||
import java.nio.file.Path
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
|
||||
@Composable
|
||||
@ -69,7 +70,7 @@ fun App() {
|
||||
}
|
||||
|
||||
val collectiveModel = remember {
|
||||
generateModel(parentContext, 60)
|
||||
generateModel(parentContext, 100, reportInterval = 1.seconds)
|
||||
}
|
||||
|
||||
val roster = remember {
|
||||
@ -83,14 +84,18 @@ fun App() {
|
||||
|
||||
LaunchedEffect(collectiveModel) {
|
||||
launchCollectiveMagixServer(collectiveModel)
|
||||
|
||||
withContext(Dispatchers.IO) {
|
||||
val magixClient = MagixEndpoint.rSocketWithWebSockets("localhost")
|
||||
|
||||
client.complete(magixClient)
|
||||
|
||||
collectiveModel.roster.forEach { (id, config) ->
|
||||
scope.launch {
|
||||
devices[id] = magixClient.remoteDevice(parentContext, "listener", id, id.parseAsName())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user