Compare commits
2 Commits
feature/IS
...
feature/IS
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6cba0674cf | ||
|
|
b87d911cea |
@@ -35,7 +35,6 @@ import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
|
||||
import com.laseroptek.raman.const.LaserParameter
|
||||
import com.laseroptek.raman.const.LASER_STATUS
|
||||
import com.laseroptek.raman.const.LaserStatusType
|
||||
import com.laseroptek.raman.const.MAX_LASER_COUNT
|
||||
import com.laseroptek.raman.const.PresetButtonType
|
||||
@@ -93,18 +92,10 @@ fun HomeScreen(
|
||||
|
||||
val presetList by mainViewModel.presetList.collectAsState()
|
||||
|
||||
LaunchedEffect(lampCount, lifeTime.lamp, laserStatus.laserStatus) {
|
||||
LaunchedEffect(Unit) {
|
||||
Timber.d("LaunchedEffect - HomeScreen")
|
||||
focusManager.clearFocus(force = true) // Hide the keyboard
|
||||
|
||||
// Ensure the system returns to StandBy when lamp thresholds are exceeded
|
||||
val lampLifetimeLimit = lifeTime.lamp
|
||||
val reachedLifetimeLimit = lampLifetimeLimit > 0 && lampCount >= lampLifetimeLimit
|
||||
if (reachedLifetimeLimit && laserStatus.laserStatus != LASER_STATUS.STAND_BY) {
|
||||
Timber.d("HomeScreen load - forcing StandBy state due to lamp count limit")
|
||||
mainViewModel.txLaserStatusEntry(LASER_STATUS.STAND_BY)
|
||||
}
|
||||
|
||||
Timber.d("Attempted to hide keyboard on EngineerScreen launch")
|
||||
}
|
||||
|
||||
@@ -491,18 +482,6 @@ fun HomeScreen(
|
||||
return@StandByButton
|
||||
}
|
||||
|
||||
val lampLifetimeLimit = lifeTime.lamp
|
||||
if (lampLifetimeLimit > 0 && lampCount >= lampLifetimeLimit) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
"Lamp lifetime limit reached",
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
return@StandByButton
|
||||
}
|
||||
|
||||
|
||||
|
||||
val hpCount = mainViewModel.getHPCount()
|
||||
if (hpCount < 1) {
|
||||
Toast.makeText(
|
||||
|
||||
@@ -108,15 +108,15 @@ fun PresetIconButton(
|
||||
Image(
|
||||
painter = painterResource(id =
|
||||
if (type == PresetButtonType.SAVE) {
|
||||
R.drawable.ic_preset_save
|
||||
R.drawable.ic_preset_save2
|
||||
} else {
|
||||
R.drawable.ic_preset_load
|
||||
}
|
||||
),
|
||||
contentDescription = "",
|
||||
modifier = Modifier
|
||||
.size(20.px.dp),
|
||||
contentScale = ContentScale.Crop
|
||||
.size(30.px.dp),
|
||||
contentScale = ContentScale.Fit
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -552,12 +552,12 @@ fun PresetLoadPopup(
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Spacer(Modifier.weight(1f))
|
||||
|
||||
if (isEditMode) {
|
||||
////////////////////////////////////////////////////
|
||||
// Edit Mode
|
||||
|
||||
Spacer(modifier = Modifier.width(10.px.dp))
|
||||
|
||||
// Preset Delete (Delete confirm popup)
|
||||
Box(
|
||||
modifier = Modifier
|
||||
@@ -578,7 +578,7 @@ fun PresetLoadPopup(
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(Modifier.width(10.px.dp))
|
||||
Spacer(Modifier.weight(1f))
|
||||
|
||||
// Preset Cancel (Reload selected item from mainViewModel)
|
||||
Box(
|
||||
@@ -729,7 +729,11 @@ fun PresetLoadPopup(
|
||||
contentScale = ContentScale.Crop
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.width(10.px.dp))
|
||||
} else {
|
||||
Spacer(Modifier.weight(1f))
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
// Select Mode - hide Keyboard
|
||||
focusManager.clearFocus(force = true) // Hide the keyboard
|
||||
@@ -790,6 +794,8 @@ fun PresetLoadPopup(
|
||||
contentScale = ContentScale.Crop
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.width(10.px.dp))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user