package com.laseroptek.raman.data.model.serial

import com.laseroptek.raman.const.PulseDurations

data class LaserStatus(
    var laserStatus: Int = 0x53,    // 0x53(Standby) or 0x52(Ready) or 0x4C(Laser on) or 0x49(Interval)
    var voltage: Int = 0,           // ascii 3 byte (PulseWidth() ms, Energy/Fluence() J/cm² : 13 단계 ) -> Votage
    var onTime: Float = PulseDurations[0],      // xx.x ms (= Pulse PulseWidth = Pulse Duration) : 0.5, 1, 1.5, 4, 5, 10 .. 40 ms : 12 단계)
    var frequence: Float = 1f     // xx.x Hz (= Repetition? 1, 1.5, 2 hz : 10Hz까지)
)

val laserStatusMap = mapOf(
    0x53 to "STANDBY",
    0x52 to "READY",
    0x4C to "LASER ON",
    0x49 to "LASER ON", // ""INTERVAL"
)

fun getLaserStatusString(laserStatus: Int): String {
    return laserStatusMap[laserStatus] ?: "STANDBY"
}

/* cf)
data class Preset(
    var pulseWidth: Float = PulseDurations[0],
    var fluence: Float = Fluences[0],
    var repetition: Float = Repetitions[0],
)
*/