desc:水印显示不由气体主导,无气体时,也应该显示时间

main
xiaowusky 1 year ago
parent c662b34e94
commit ac3d2b32c5

@ -7,6 +7,7 @@ import com.yinuo.safetywatcher.watcher.port.cmd.CMD
import com.yinuo.safetywatcher.watcher.port.cmd.CMD.Companion.buildSensorRangeCmd
import com.yinuo.safetywatcher.watcher.port.cmd.CMD.Companion.buildSwitchSensorCmd
import com.yinuo.safetywatcher.watcher.port.cmd.CalibrationCmd
import org.easydarwin.TxtOverlay
object GasPortUtils {
private const val BAUD_RATE = 9600
@ -40,6 +41,7 @@ object GasPortUtils {
fun initPort() {
openPorts()
readGasMsg()
TxtOverlay.startShow(null)
}
private fun openPorts() {

@ -64,8 +64,10 @@ object TxtOverlay {
private val gasMap = ConcurrentHashMap<String, Gas>()
// 外部调用,设置待显示水印文字
fun startShow(gas: Gas) {
gasMap[gas.gasName] = gas
fun startShow(gas: Gas?) {
gas?.let {
gasMap[it.gasName] = it
}
if (!looping) {
looping = true
GlobalScope.launch(Dispatchers.IO) {

Loading…
Cancel
Save