package com.laseroptek.raman.data.source.preference

import com.laseroptek.raman.data.model.LifeTime
import com.laseroptek.raman.data.model.Preset
import com.laseroptek.raman.data.model.Refer2
import com.laseroptek.raman.data.model.serial.EnergyMeasured
import com.laseroptek.raman.data.model.serial.QSwitch
import com.laseroptek.raman.data.model.serial.SprayDcd
import com.laseroptek.raman.data.model.serial.Temperature
import kotlinx.coroutines.flow.Flow

interface Preference {

    suspend fun clearAllPreferences()

    suspend fun saveSliderVolumeToPreference(volume: Float)
    suspend fun getSliderVolumeFromPreference(): Flow<Float>

    suspend fun saveGuideBeamToPreference(guideBeam: Float)
    suspend fun getGuideBeamFromPreference(): Flow<Float>

    suspend fun saveGuideBeamMinToPreference(guideBeamMin: Int)
    suspend fun getGuideBeamMinFromPreference(): Flow<Int>

    suspend fun saveGuideBeamMaxToPreference(guideBeamMax: Int)
    suspend fun getGuideBeamMaxFromPreference(): Flow<Int>

    suspend fun saveHpCountToPreference(hpCount: Int)
    suspend fun getHpCountToPreference(): Flow<Int>

    suspend fun saveLampCountToPreference(lampCount: Int)
    suspend fun getLampCountFromPreference(): Flow<Int>

    suspend fun saveDcdCountToPreference(dcdCount: Int)
    suspend fun getDcdCountFromPreference(): Flow<Int>

    suspend fun saveSprayDcdIndexToPreference(sprayDcdIndex: Int)
    suspend fun getSprayDcdIndexFromPreference(): Flow<Int>

    suspend fun saveOpTimeHourToPreference(opTimeHour: Long)
    suspend fun getOpTimeHourFromPreference(): Flow<Long>

    suspend fun saveSprayDcdToPreference(sprayDcd: SprayDcd)
    suspend fun getSprayDcdFromPreference(): Flow<SprayDcd>

    suspend fun saveQSwitchToPreference(qSwitch: QSwitch)
    suspend fun getQSwitchFromPreference(): Flow<QSwitch>

    suspend fun saveLifeTimeToPreference(lifeTime: LifeTime)
    suspend fun getLifeTimeFromPreference(): Flow<LifeTime>

    suspend fun saveTemperatureToPreference(temp: Temperature)
    suspend fun getTemperatureFromPreference(): Flow<Temperature>

    suspend fun saveTemperatureWriteToPreference(temp: Temperature)
    suspend fun getTemperatureWriteFromPreference(): Flow<Temperature>

    suspend fun saveEnergyMeasuredWriteToPreference(temp: EnergyMeasured)
    suspend fun getEnergyMeasuredWriteFromPreference(): Flow<EnergyMeasured>

    suspend fun saveEnergyRefer2ToPreference(refer2: Refer2)
    suspend fun getEnergyRefer2FromPreference(): Flow<Refer2>

    suspend fun getVoltageTableFromPreference(
    ): Flow<Map<Pair<Float, Float>, Int>>
    suspend fun saveVoltageTableToPreference(
        voltageTable: Map<Pair<Float, Float>, Int>
    )

    suspend fun savePresetListToPreference(
        presetList: List<Preset>
    )
    suspend fun getPresetListFromPreference(): Flow<List<Preset>>

    suspend fun saveSprayDcdList(
        sprayDcdList: List<SprayDcd>
    )
    suspend fun getSprayDcdList(): Flow<List<SprayDcd>>

    //////
    suspend fun saveProductSerialListToPreference(productList: List<String>)
    suspend fun getProductSerialListFromPreference(): Flow<List<String>>

    suspend fun saveLaserHandSerialListToPreference(serialList: List<String>)
    suspend fun getLaserHandSerialListFromPreference(): Flow<List<String>>

    suspend fun savePowerSupplySerialListToPreference(powerSupplySerialList: List<String>)
    suspend fun getPowerSupplySerialListFromPreference(): Flow<List<String>>
    /////

}