DCD 설정 관련 수정 #55
@@ -61,7 +61,7 @@ const val MAX_Q_SWITCH_VALUE = 250.0f
|
|||||||
const val MAX_REFER1_VALUE = 99999999 // 8 byte ascii (ENERGY DETECT MEASURED VALUE)
|
const val MAX_REFER1_VALUE = 99999999 // 8 byte ascii (ENERGY DETECT MEASURED VALUE)
|
||||||
const val DEFAULT_REFER1_VALUE = 0 // initial state
|
const val DEFAULT_REFER1_VALUE = 0 // initial state
|
||||||
|
|
||||||
const val DEFAULT_DCD_GAS_PRESSURE = 06.5f
|
const val DEFAULT_DCD_GAS_PRESSURE = 08.0f
|
||||||
const val DEFAULT_SPAY_DCD_TIME = 10
|
const val DEFAULT_SPAY_DCD_TIME = 10
|
||||||
const val DEFAULT_SPAY_DCD_DELAY = 10
|
const val DEFAULT_SPAY_DCD_DELAY = 10
|
||||||
|
|
||||||
@@ -461,17 +461,17 @@ val dcdLifeSpanAdjustLists = listOf( 0.5f, 0.7f, 0.9f, 1.0f, 1.1f, 1.2f )
|
|||||||
val dcdLifeSpanAdjustStringLists = dcdLifeSpanAdjustLists.map{ it.toString() }
|
val dcdLifeSpanAdjustStringLists = dcdLifeSpanAdjustLists.map{ it.toString() }
|
||||||
|
|
||||||
val dcdSprayValues = listOf(10, 20, 30, 40, 50, 60, 70, 80, 90, 100).map{ it.toString() }
|
val dcdSprayValues = listOf(10, 20, 30, 40, 50, 60, 70, 80, 90, 100).map{ it.toString() }
|
||||||
val dcdDelayValues = listOf(10, 20, 30, 40, 50, 60, 70, 80, 90, 100).map{ it.toString() }
|
val dcdDelayValues = listOf(10, 20, 30, 40).map{ it.toString() }
|
||||||
|
|
||||||
// default spray dcd list for options
|
// default spray dcd list for options
|
||||||
val SprayDcdList = listOf<SprayDcd>(
|
val SprayDcdList = listOf<SprayDcd>(
|
||||||
SprayDcd(status = 0x44, sprayTime = 10, sprayDelay = 10), // default
|
SprayDcd(status = 0x41, sprayTime = 10, sprayDelay = 10), // default
|
||||||
SprayDcd(status = 0x44, sprayTime = 10, sprayDelay = 10),
|
SprayDcd(status = 0x41, sprayTime = 10, sprayDelay = 10),
|
||||||
SprayDcd(status = 0x44, sprayTime = 20, sprayDelay = 20),
|
SprayDcd(status = 0x41, sprayTime = 20, sprayDelay = 10),
|
||||||
SprayDcd(status = 0x44, sprayTime = 30, sprayDelay = 20),
|
SprayDcd(status = 0x41, sprayTime = 30, sprayDelay = 20),
|
||||||
SprayDcd(status = 0x44, sprayTime = 40, sprayDelay = 40),
|
SprayDcd(status = 0x41, sprayTime = 40, sprayDelay = 20),
|
||||||
SprayDcd(status = 0x44, sprayTime = 50, sprayDelay = 50),
|
SprayDcd(status = 0x41, sprayTime = 50, sprayDelay = 30),
|
||||||
SprayDcd(status = 0x44, sprayTime = 60, sprayDelay = 60),
|
SprayDcd(status = 0x41, sprayTime = 60, sprayDelay = 30),
|
||||||
)
|
)
|
||||||
|
|
||||||
val PresetList = listOf<Preset>(
|
val PresetList = listOf<Preset>(
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.laseroptek.raman.data.model.serial
|
|||||||
import com.laseroptek.raman.const.DEFAULT_DCD_GAS_PRESSURE
|
import com.laseroptek.raman.const.DEFAULT_DCD_GAS_PRESSURE
|
||||||
|
|
||||||
data class DcdGas(
|
data class DcdGas(
|
||||||
val status: Int = 0x41, // 1Byte(A(0x41): on, D(0x44): off, P(0x50): pressure)
|
val status: Int = 0x50, // 1Byte(A(0x41): on, D(0x44): off, P(0x50): pressure)
|
||||||
val pressure: Float = DEFAULT_DCD_GAS_PRESSURE, // Ascii 4Byte (xx.x): Pressure
|
val pressure: Float = DEFAULT_DCD_GAS_PRESSURE, // Ascii 4Byte (xx.x): Pressure
|
||||||
val ok: Int = 0x00, // 1Byte(N(0x4E): Not OK, O(0x00F): OK)/
|
val ok: Int = 0x00, // 1Byte(N(0x4E): Not OK, O(0x00F): OK)/
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -256,7 +256,11 @@ fun DcdSettingPopup(
|
|||||||
mainViewModel.setSelectedSprayDcdIndex(i)
|
mainViewModel.setSelectedSprayDcdIndex(i)
|
||||||
val optionValue = mainViewModel.sprayDcdList[i]
|
val optionValue = mainViewModel.sprayDcdList[i]
|
||||||
mainViewModel.setSprayDcd(optionValue)
|
mainViewModel.setSprayDcd(optionValue)
|
||||||
mainViewModel.txPacket(READ_WRITE.WRITE, CMD.SPRAY_DCD, optionValue)
|
mainViewModel.txPacket(
|
||||||
|
READ_WRITE.WRITE,
|
||||||
|
CMD.SPRAY_DCD,
|
||||||
|
optionValue.copy(status = 0x41)
|
||||||
|
)
|
||||||
|
|
||||||
scope.launch {
|
scope.launch {
|
||||||
mainViewModel.saveSprayDcdIndexToPreference()
|
mainViewModel.saveSprayDcdIndexToPreference()
|
||||||
@@ -303,7 +307,11 @@ fun DcdSettingPopup(
|
|||||||
mainViewModel.setSelectedSprayDcdIndex(i)
|
mainViewModel.setSelectedSprayDcdIndex(i)
|
||||||
val optionValue = mainViewModel.sprayDcdList[i]
|
val optionValue = mainViewModel.sprayDcdList[i]
|
||||||
mainViewModel.setSprayDcd(optionValue)
|
mainViewModel.setSprayDcd(optionValue)
|
||||||
mainViewModel.txPacket(READ_WRITE.WRITE, CMD.SPRAY_DCD, optionValue)
|
mainViewModel.txPacket(
|
||||||
|
READ_WRITE.WRITE,
|
||||||
|
CMD.SPRAY_DCD,
|
||||||
|
optionValue.copy(status = 0x41)
|
||||||
|
)
|
||||||
|
|
||||||
scope.launch {
|
scope.launch {
|
||||||
mainViewModel.saveSprayDcdToPreference()
|
mainViewModel.saveSprayDcdToPreference()
|
||||||
@@ -603,6 +611,12 @@ fun DcdSettingPopup(
|
|||||||
sprayDcd
|
sprayDcd
|
||||||
)
|
)
|
||||||
|
|
||||||
|
mainViewModel.txPacket(
|
||||||
|
READ_WRITE.WRITE,
|
||||||
|
CMD.SPRAY_DCD,
|
||||||
|
sprayDcd.copy(status = 0x41)
|
||||||
|
)
|
||||||
|
|
||||||
mainViewModel.setSelectedSprayDcdIndex( selectedSprayDcdIndex )
|
mainViewModel.setSelectedSprayDcdIndex( selectedSprayDcdIndex )
|
||||||
//mainViewModel.setSprayDcdList( mainViewModel.sprayDcdList )
|
//mainViewModel.setSprayDcdList( mainViewModel.sprayDcdList )
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ fun DcdView(
|
|||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.width(45.px.dp)
|
.width(55.px.dp)
|
||||||
.fillMaxHeight()
|
.fillMaxHeight()
|
||||||
, horizontalAlignment = Alignment.CenterHorizontally
|
, horizontalAlignment = Alignment.CenterHorizontally
|
||||||
, verticalArrangement = Arrangement.Center
|
, verticalArrangement = Arrangement.Center
|
||||||
@@ -120,7 +120,7 @@ fun DcdView(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer( Modifier.width(10.px.dp))
|
Spacer( Modifier.width(5.px.dp))
|
||||||
|
|
||||||
VerticalDivider(
|
VerticalDivider(
|
||||||
color = Color(161,161,170),
|
color = Color(161,161,170),
|
||||||
@@ -128,7 +128,7 @@ fun DcdView(
|
|||||||
modifier = Modifier.size(1.px.dp, 30.px.dp)
|
modifier = Modifier.size(1.px.dp, 30.px.dp)
|
||||||
)
|
)
|
||||||
|
|
||||||
Spacer( Modifier.width(10.px.dp))
|
Spacer( Modifier.width(5.px.dp))
|
||||||
|
|
||||||
// Delay
|
// Delay
|
||||||
Timber.d("selectedSprayDcdIndex.value: ${selectedSprayDcdIndex}")
|
Timber.d("selectedSprayDcdIndex.value: ${selectedSprayDcdIndex}")
|
||||||
|
|||||||
@@ -843,7 +843,7 @@ class MainViewModel @Inject constructor(
|
|||||||
txPacket(READ_WRITE.WRITE, CMD.DCD_GAS, dcdGas.value.copy(status = 0x50))
|
txPacket(READ_WRITE.WRITE, CMD.DCD_GAS, dcdGas.value.copy(status = 0x50))
|
||||||
|
|
||||||
// tx SPRAY_DCD Write (DEFAULT VALUE)
|
// tx SPRAY_DCD Write (DEFAULT VALUE)
|
||||||
txPacket(READ_WRITE.WRITE, CMD.SPRAY_DCD, sprayDcd.value)
|
txPacket(READ_WRITE.WRITE, CMD.SPRAY_DCD, sprayDcd.value.copy(status = 0x41))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user