feat: add `DeviceConfig` Role descriptions

closes #848
pull/1274/head
andrekir 2024-09-28 08:54:19 -03:00
rodzic 59e25a7791
commit 2370e8b596
2 zmienionych plików z 31 dodań i 0 usunięć

Wyświetl plik

@ -12,10 +12,12 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
import com.geeksville.mesh.ConfigProtos.Config.DeviceConfig
import com.geeksville.mesh.R
import com.geeksville.mesh.copy
import com.geeksville.mesh.ui.components.DropDownPreference
import com.geeksville.mesh.ui.components.EditTextPreference
@ -23,6 +25,22 @@ import com.geeksville.mesh.ui.components.PreferenceCategory
import com.geeksville.mesh.ui.components.PreferenceFooter
import com.geeksville.mesh.ui.components.SwitchPreference
private val DeviceConfig.Role.stringRes: Int
get() = when (this) {
DeviceConfig.Role.CLIENT -> R.string.role_client
DeviceConfig.Role.CLIENT_MUTE -> R.string.role_client_mute
DeviceConfig.Role.ROUTER -> R.string.role_router
DeviceConfig.Role.ROUTER_CLIENT -> R.string.role_router_client
DeviceConfig.Role.REPEATER -> R.string.role_repeater
DeviceConfig.Role.TRACKER -> R.string.role_tracker
DeviceConfig.Role.SENSOR -> R.string.role_sensor
DeviceConfig.Role.TAK -> R.string.role_tak
DeviceConfig.Role.CLIENT_HIDDEN -> R.string.role_client_hidden
DeviceConfig.Role.LOST_AND_FOUND -> R.string.role_lost_and_found
DeviceConfig.Role.TAK_TRACKER -> R.string.role_tak_tracker
else -> R.string.unrecognized
}
@Composable
fun DeviceConfigItemList(
deviceConfig: DeviceConfig,
@ -39,6 +57,7 @@ fun DeviceConfigItemList(
item {
DropDownPreference(title = "Role",
summary = stringResource(id = deviceInput.role.stringRes),
enabled = enabled,
items = DeviceConfig.Role.entries
.filter { it != DeviceConfig.Role.UNRECOGNIZED }

Wyświetl plik

@ -43,6 +43,18 @@
<string name="routing_error_pki_failed">Encrypted Send Failed</string>
<string name="routing_error_pki_unknown_pubkey">Unknown Public Key</string>
<string name="role_client">App connected or standalone messaging device.</string>
<string name="role_client_mute">Device that does not forward packets from other devices.</string>
<string name="role_router">Infrastructure node for extending network coverage by relaying messages. Visible in nodes list.</string>
<string name="role_router_client">Combination of both ROUTER and CLIENT. Not for mobile devices.</string>
<string name="role_repeater">Infrastructure node for extending network coverage by relaying messages with minimal overhead. Not visible in nodes list.</string>
<string name="role_tracker">Broadcasts GPS position packets as priority.</string>
<string name="role_sensor">Broadcasts telemetry packets as priority.</string>
<string name="role_tak">Optimized for ATAK system communication, reduces routine broadcasts.</string>
<string name="role_client_hidden">Device that only broadcasts as needed for stealth or power savings.</string>
<string name="role_lost_and_found">Broadcasts location as message to default channel regularly for to assist with device recovery.</string>
<string name="role_tak_tracker">Enables automatic TAK PLI broadcasts and reduces routine broadcasts.</string>
<string name="elevation_suffix" translatable="false">MSL</string>
<string name="channel_air_util" translatable="false">ChUtil %.1f%% AirUtilTX %.1f%%</string>