add commit

This commit is contained in:
steven
2026-02-28 12:45:29 +09:00
parent 392640a686
commit d9a6b6d02b
400 changed files with 52300 additions and 0 deletions

222
app/build.gradle.kts Normal file
View File

@@ -0,0 +1,222 @@
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.compose)
}
android {
compileSdk = libs.versions.compileSdk.get().toInt()
namespace = "com.laseroptek.raman"
defaultConfig {
applicationId = "com.laseroptek.raman"
versionCode = 173
versionName = "1.7.3"
minSdk = libs.versions.minSdk.get().toInt()
maxSdk = libs.versions.maxSdk.get().toInt()
//noinspection ExpiredTargetSdkVersion
targetSdk = libs.versions.targetSdk.get().toInt()
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters += "arm64-v8a"
}
}
signingConfigs {
// Important: change the keystore for a production deployment
//val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore")
val localKeystore = rootProject.file("keystore/platform.keystore")
//val hasKeyInfo = userKeystore.exists()
getByName("debug") {
storeFile = localKeystore
storePassword = "123456"
keyAlias = "platform"
keyPassword = "123456"
}
create("release") {
storeFile = localKeystore
storePassword = "123456"
keyAlias = "platform"
keyPassword = "123456"
}
}
buildTypes {
getByName("debug") {
isMinifyEnabled = false
isDebuggable = true
signingConfig = signingConfigs.getByName("debug")
}
getByName("release") {
isMinifyEnabled = false // default is true but wait too much build time
isDebuggable = false
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
compose = true
buildConfig = true
}
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "3.22.1"
}
}
packaging {
resources {
excludes += "/META-INF/AL2.0"
excludes += "/META-INF/LGPL2.1"
}
jniLibs {
useLegacyPackaging = false
}
}
ndkVersion = "27.0.12077973"
lint {
disable.add("NullSafeMutableLiveData")
}
}
kotlin {
jvmToolchain(17)
compilerOptions {
freeCompilerArgs.add("-Xcontext-parameters")
}
}
dependencies {
// Kotlin and Coroutines
implementation(libs.kotlin.stdlib)
implementation(libs.kotlinx.coroutines.android)
// Dependency injection
implementation(libs.androidx.hilt.navigation.compose)
implementation(libs.hilt.android)
ksp(libs.hilt.compiler)
ksp(libs.hilt.android.compiler)
// Database
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)
// Logging
implementation(libs.timber)
// Compose
val composeBom = platform(libs.androidx.compose.bom)
implementation(composeBom)
androidTestImplementation(composeBom)
// splash
implementation(libs.androidx.core.splashscreen)
// reflection
implementation(kotlin("reflect"))
//lottie
implementation(libs.lottie.compose)
implementation(libs.snapper)
implementation(libs.androidx.compose.animation)
implementation(libs.androidx.compose.foundation.layout)
implementation(libs.androidx.compose.material.iconsExtended)
// Material Android 12 and above.
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.materialWindow)
implementation(libs.androidx.compose.runtime)
// Compose BOM
implementation(platform(libs.androidx.compose.bom.v20251001))
// Add this line
implementation(libs.androidx.foundation)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.constraintlayout.compose)
implementation(libs.androidx.activity.compose)
implementation(libs.accompanist.swiperefresh)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.activity.ktx)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.security.crypto.ktx)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.window)
implementation(libs.androidx.localbroadcastmanager)
implementation(libs.androidx.glance)
implementation(libs.androidx.glance.appwidget)
implementation(libs.androidx.glance.material3)
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.lifecycle.viewmodel.savedstate)
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.lifecycle.viewModelCompose)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.snapper)
implementation(libs.gson)
// json binary serialization (completely avoids the "double serialization" problem because there's only one serialization step.)
implementation(libs.kotlinx.serialization.json)
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.6.3")
// repeatOnLifecycle
implementation(libs.lifecycle.runtime.ktx.v262)
debugImplementation(libs.androidx.compose.ui.test.manifest)
debugImplementation(libs.androidx.compose.ui.tooling)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.androidx.test.rules)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.kotlinx.coroutines.test)
androidTestImplementation(libs.androidx.compose.ui.test)
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
//implementation(libs.accompanist.systemuicontroller)
//accompanist System UI Controller (immerssive mode)
// LockView
//implementation(libs.androidx.constraintlayout.compose)
// Wheel Picker
//implementation(libs.kmp.date.time.picker)
}

132
app/proguard-rules.pro vendored Normal file
View File

@@ -0,0 +1,132 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
-renamesourcefileattribute SourceFile
# Repackage classes into the top-level.
-repackageclasses
# This is generated automatically by the Android Gradle plugin.
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn org.conscrypt.Conscrypt$Version
-dontwarn org.conscrypt.Conscrypt
-dontwarn org.conscrypt.ConscryptHostnameVerifier
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE
# JNI (for native C++ code) - More Robust Rules
-keepclasseswithmembers,allowshrinking class * {
native <methods>;
}
-keep class *JNI* { *; }
# Hilt / Dagger - Updated Rules
-keep class dagger.hilt.internal.aggregatedroot.codegen.* { <init>(); }
-keep class hilt_aggregated_deps.** { <init>(); }
-keep @dagger.hilt.InstallIn class *
-keep @dagger.hilt.codegen.OriginatingElement class *
-keep @dagger.hilt.android.HiltAndroidApp class *
-keep @dagger.hilt.android.WithFragmentBindings class *
-keep @dagger.assisted.Assisted class *
-keep @dagger.assisted.AssistedFactory class *
-keep @dagger.assisted.AssistedInject class *
-keepclassmembers class * { @dagger.assisted.AssistedInject <init>(...); }
# Keep Dagger-generated component implementations.
-keep class *_*_HiltComponents_* {}
# Keep application's modules.
-keep @dagger.Module class * { <methods>; }
# Keep bindings and their constructors.
-keep @javax.inject.Inject class * { <init>(...); <fields>; }
-keep @javax.inject.Singleton class *
-keepclassmembers class * { @javax.inject.Inject <init>(...); @javax.inject.Inject <fields>; }
# Keep Parcelable creators
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
# Keep Serializable classes
-keep class * implements java.io.Serializable { *; }
# Gson (for data/model classes that are serialized/deserialized)
-keep class com.google.gson.Gson
-keep class com.google.gson.GsonBuilder
-keep class com.google.gson.reflect.TypeToken
-keepclassmembers class com.laseroptek.raman.data.model.** { *; }
-keepattributes Signature
-keepattributes *Annotation*
# Coroutines & StateFlow
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory
-keepnames class kotlinx.coroutines.flow.**
-keepclassmembers class kotlinx.coroutines.flow.** { *; }
-keep class kotlinx.coroutines.flow.StateFlowImpl { *; }
# Room
-keep class androidx.room.RoomDatabase
-keepclassmembers class * extends androidx.room.RoomDatabase {
<init>(...);
java.lang.Object Companion;
}
# Lottie
-keep class com.airbnb.lottie.** { *; }
# Glance App Widget
-keepclasseswithmembers public class * extends androidx.glance.appwidget.GlanceAppWidgetReceiver
-keepclasseswithmembers public class * extends androidx.glance.appwidget.GlanceAppWidget
-keep public class * implements androidx.glance.state.GlanceStateDefinition { *; }
# AndroidX Security Crypto
-keep class androidx.security.crypto.** { *; }
# ConstraintLayout Compose
-keep public class androidx.constraintlayout.** { *; }
# Snapper (from Chris Banes)
-keep class dev.chrisbanes.snapper.** { *; }
# Jetpack Compose
-keep class androidx.compose.runtime.** { *; }
-keepclasseswithmembers public class * {
@androidx.compose.runtime.Composable <methods>;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
-keep class androidx.compose.ui.platform.AndroidCompositionLocals_androidKt { *; }
# Keep the SerialPort class and its members from being obfuscated or removed,
# as they are accessed from native code (JNI).
-keep class com.laseroptek.raman.data.source.serial.SerialPort {
<fields>;
<methods>;
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.laseroptek.raman
import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import org.junit.Assert.assertEquals
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class HomeScreenTests {
@get:Rule
val composeTestRule = createComposeRule()
/**
* Checks that the Snackbar is shown when the HomeScreen data contains an error.
*/
@Test
fun postsContainError_snackbarShown() {
val snackbarHostState = SnackbarHostState()
composeTestRule.setContent {
}
// Then the first message received in the Snackbar is an error message
runBlocking {
// snapshotFlow converts a State to a Kotlin Flow so we can observe it
// wait for the first a non-null `currentSnackbarData`
val actualSnackbarText = snapshotFlow { snackbarHostState.currentSnackbarData }
.filterNotNull().first().visuals.message
val expectedSnackbarText = InstrumentationRegistry.getInstrumentation()
.targetContext.resources.getString(R.string.load_error)
assertEquals(expectedSnackbarText, actualSnackbarText)
}
}
}

View File

@@ -0,0 +1,28 @@
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.laseroptek.raman
import android.content.Context
import androidx.compose.ui.test.junit4.ComposeContentTestRule
/**
* Launches the app from a test context
*/
fun ComposeContentTestRule.launchramanAppApp(context: Context) {
setContent {
}
}

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!--
<permission
android:name="android.permission.PROVISION_MANAGED_DEVICE_SILENTLY"
android:protectionLevel="signature|preinstalled" />
-->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.USB_PERMISSION" />
<uses-permission
android:name="android.permission.SET_TIME"
android:protectionLevel="signature|privileged"
tools:ignore="ProtectedPermissions" />
<application
android:name=".VasCURA589App"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:enableOnBackInvokedCallback="true"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.raman"
tools:targetApi="tiramisu">
<!-- adjustResize ensures that the main window resizes to make room for the soft keyboard-->
<!-- android:windowSoftInputMode="adjustResize" -->
<activity
android:name=".ui.MainActivity"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="landscape"
android:stateNotNeeded="true"
android:windowSoftInputMode="adjustPan"
tools:ignore="DiscouragedApi">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
</intent-filter>
</activity>
</application>
</manifest>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.22.1)
project(SerialPortNativeLib C CXX) # Added for good practice
add_library(serial_port SHARED
SerialPort.c)
# Compatibility with 16K pages for Android 15+ support on 64-bit devices.
# See https://developer.android.com/guide/practices/page-sizes
if(ANDROID_ABI STREQUAL "arm64-v8a")
target_link_options(serial_port PRIVATE "-Wl,-z,max-page-size=16384")
endif()

View File

@@ -0,0 +1,149 @@
#include "SerialPort.h"
#include <termios.h>
#include <pthread.h>
#include <unistd.h>
#define MAX_THREAD_LIMIT 32
static speed_t getBaudrate(jint baudrate)
{
switch(baudrate) {
case 0: return B0;
case 50: return B50;
case 75: return B75;
case 110: return B110;
case 134: return B134;
case 150: return B150;
case 200: return B200;
case 300: return B300;
case 600: return B600;
case 1200: return B1200;
case 1800: return B1800;
case 2400: return B2400;
case 4800: return B4800;
case 9600: return B9600;
case 19200: return B19200;
case 38400: return B38400;
case 57600: return B57600;
case 115200: return B115200;
case 230400: return B230400;
case 460800: return B460800;
case 500000: return B500000;
case 576000: return B576000;
case 921600: return B921600;
case 1000000: return B1000000;
case 1152000: return B1152000;
case 1500000: return B1500000;
case 2000000: return B2000000;
case 2500000: return B2500000;
case 3000000: return B3000000;
case 3500000: return B3500000;
case 4000000: return B4000000;
default: return -1;
}
}
struct {
pthread_t tid;
jobject clazz;
} threads[MAX_THREAD_LIMIT];
JavaVM *vm;
jfieldID mFD;
jmethodID onNativeData;
void *comm_read() {
JNIEnv *env;
(*vm)->AttachCurrentThread(vm, &env, NULL);
jclass clazz = NULL;
for (int i = 0; i < MAX_THREAD_LIMIT; i++) {
if (pthread_equal(pthread_self(), threads[i].tid)) {
clazz = threads[i].clazz;
if (mFD == NULL || onNativeData == NULL) {
jclass obj = (*env)->GetObjectClass(env, clazz);
mFD = (*env)->GetFieldID(env, obj, "mFD", "I");
onNativeData = (*env)->GetMethodID(env, obj, "onNativeData", "([B)V");
}
break;
}
}
if (clazz != NULL) {
int fd;
while ((fd = (*env)->GetIntField(env, clazz, mFD)) != -1) {
int size = 1024;
jbyte data[size];
int len = read(fd, data, size);
if (len > 0) {
jbyteArray bytes = (*env)->NewByteArray(env, len);
(*env)->SetByteArrayRegion(env, bytes, 0, len, data);
(*env)->CallVoidMethod(env, clazz, onNativeData, bytes);
} else if (len < 0) {
// DETECT: Hardware level error (e.g. unplugged)
// Send a specific error byte like 0x0E to trigger the Error result in Repository
jbyteArray errorBytes = (*env)->NewByteArray(env, 1);
jbyte err = 0x0E;
(*env)->SetByteArrayRegion(env, errorBytes, 0, 1, &err);
(*env)->CallVoidMethod(env, clazz, onNativeData, errorBytes);
}
usleep(10000);
}
}
if (vm != NULL) {
int isFree = 1;
for (int i = 0; i < MAX_THREAD_LIMIT; i++) {
if (threads[i].clazz != NULL) {
if (threads[i].clazz == clazz) {
(*env)->DeleteGlobalRef(env, clazz);
threads[i].clazz = clazz = NULL;
} else {
isFree = 0;
if (clazz == NULL) break;
}
}
}
(*vm)->DetachCurrentThread(vm);
if (isFree) {
onNativeData = NULL;
mFD = NULL;
vm = NULL;
}
}
return 0;
}
JNIEXPORT void JNICALL
Java_com_laseroptek_raman_data_source_serial_SerialPort_open(JNIEnv *env, jclass clazz, int fd, int baudrate) {
tcflush(fd, TCIOFLUSH);
struct termios cfg;
tcgetattr(fd, &cfg);
cfmakeraw(&cfg);
speed_t speed = getBaudrate(baudrate);
cfsetispeed(&cfg, speed);
cfsetospeed(&cfg, speed);
tcsetattr(fd, TCSANOW, &cfg);
for (int i = 0; i < MAX_THREAD_LIMIT; i++) {
if (threads[i].clazz == NULL) {
if (vm == NULL) {
(*env)->GetJavaVM(env, &vm);
}
threads[i].clazz = (*env)->NewGlobalRef(env, clazz);
pthread_create(&threads[i].tid, NULL, comm_read, NULL);
break;
}
}
}
JNIEXPORT void JNICALL
Java_com_laseroptek_raman_data_source_serial_SerialPort_write(JNIEnv *env, __unused jclass _, int fd, jbyteArray bytes) {
jbyte *data = (*env)->GetByteArrayElements(env, bytes, NULL);
if (data != NULL) {
write(fd, data, (*env)->GetArrayLength(env, bytes));
(*env)->ReleaseByteArrayElements(env, bytes, data, JNI_ABORT);
}
}
JNIEXPORT void JNICALL
Java_com_laseroptek_raman_data_source_serial_SerialPort_close(__unused JNIEnv *_, __unused jclass __, int fd) {
close(fd);
}

View File

@@ -0,0 +1,21 @@
#include <jni.h>
#ifndef _SERIAL_PORT
#define _SERIAL_PORT
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT void JNICALL
Java_com_laseroptek_raman_data_source_serial_SerialPort_open(JNIEnv *, jobject, int, int);
JNIEXPORT void JNICALL
Java_com_laseroptek_raman_data_source_serial_SerialPort_write(JNIEnv *, jobject, int, jbyteArray);
JNIEXPORT void JNICALL
Java_com_laseroptek_raman_data_source_serial_SerialPort_close(JNIEnv *, jobject, int);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,40 @@
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.laseroptek.raman
import android.app.Application
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber
@HiltAndroidApp
class VasCURA589App : Application() {
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
Timber.plant(object : Timber.DebugTree() {
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
super.log(priority, "$tag", message, t)
}
override fun createStackElementTag(element: StackTraceElement): String {
return "[%s:%s:%s]".format(element.fileName, element.lineNumber, element.methodName)
}
})
}
}
}

View File

@@ -0,0 +1,653 @@
package com.laseroptek.raman.const
//
// Energy Table1 (HANDPIENCE-5x5)
// - Map<Pair<Float, Float>, Float>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Fluence(J/cm²)>, Energy(J)>
//
val EnergyTable_5_5 = mapOf(
// Pulse Width = 0.5f
Pair(0.5f,2.0f) to 0.500f,
Pair(0.5f,2.1f) to 0.525f,
Pair(0.5f,2.2f) to 0.550f,
Pair(0.5f,2.3f) to 0.575f,
Pair(0.5f,2.4f) to 0.600f,
Pair(0.5f,2.5f) to 0.625f,
Pair(0.5f,2.6f) to 0.650f,
Pair(0.5f,2.7f) to 0.675f,
Pair(0.5f,2.8f) to 0.700f,
Pair(0.5f,2.9f) to 0.725f,
Pair(0.5f,3.0f) to 0.750f,
Pair(0.5f,3.2f) to 0.800f,
Pair(0.5f,3.4f) to 0.850f,
Pair(0.5f,3.6f) to 0.900f,
Pair(0.5f,3.8f) to 0.950f,
Pair(0.5f,4.0f) to 1.000f,
Pair(0.5f,4.2f) to 1.050f,
Pair(0.5f,4.4f) to 1.100f,
Pair(0.5f,4.6f) to 1.150f,
Pair(0.5f,4.8f) to 1.200f,
Pair(0.5f,5.0f) to 1.250f,
Pair(0.5f,5.5f) to 1.375f,
Pair(0.5f,6.0f) to 1.500f,
Pair(0.5f,6.5f) to 1.625f,
Pair(0.5f,7.0f) to 1.750f,
Pair(0.5f,7.5f) to 1.875f,
Pair(0.5f,8.0f) to 2.000f,
// Pulse Width = 1f
Pair(1f, 2.0f) to 0.500f,
Pair(1f, 2.1f) to 0.525f,
Pair(1f, 2.2f) to 0.550f,
Pair(1f, 2.3f) to 0.575f,
Pair(1f, 2.4f) to 0.600f,
Pair(1f, 2.5f) to 0.625f,
Pair(1f, 2.6f) to 0.650f,
Pair(1f, 2.7f) to 0.675f,
Pair(1f, 2.8f) to 0.700f,
Pair(1f, 2.9f) to 0.725f,
Pair(1f, 3.0f) to 0.750f,
Pair(1f, 3.2f) to 0.800f,
Pair(1f, 3.4f) to 0.850f,
Pair(1f, 3.6f) to 0.900f,
Pair(1f, 3.8f) to 0.950f,
Pair(1f, 4.0f) to 1.000f,
Pair(1f, 4.2f) to 1.050f,
Pair(1f, 4.4f) to 1.100f,
Pair(1f, 4.6f) to 1.150f,
Pair(1f, 4.8f) to 1.200f,
Pair(1f, 5.0f) to 1.250f,
Pair(1f, 5.5f) to 1.375f,
Pair(1f, 6.0f) to 1.500f,
Pair(1f, 6.5f) to 1.625f,
Pair(1f, 7.0f) to 1.750f,
Pair(1f, 7.5f) to 1.875f,
Pair(1f, 8.0f) to 2.000f,
Pair(1f, 8.5f) to 2.125f,
Pair(1f, 9.0f) to 2.250f,
Pair(1f, 9.5f) to 2.375f,
Pair(1f, 10.0f) to 2.500f,
Pair(1f, 11.0f) to 2.750f,
Pair(1f, 12.0f) to 3.000f,
// Pulse Width = 1.5f
Pair(1.5f, 2.0f) to 0.500f,
Pair(1.5f, 2.1f) to 0.525f,
Pair(1.5f, 2.2f) to 0.550f,
Pair(1.5f, 2.3f) to 0.575f,
Pair(1.5f, 2.4f) to 0.600f,
Pair(1.5f, 2.5f) to 0.625f,
Pair(1.5f, 2.6f) to 0.650f,
Pair(1.5f, 2.7f) to 0.675f,
Pair(1.5f, 2.8f) to 0.700f,
Pair(1.5f, 2.9f) to 0.725f,
Pair(1.5f, 3.0f) to 0.750f,
Pair(1.5f, 3.2f) to 0.800f,
Pair(1.5f, 3.4f) to 0.850f,
Pair(1.5f, 3.6f) to 0.900f,
Pair(1.5f, 3.8f) to 0.950f,
Pair(1.5f, 4.0f) to 1.000f,
Pair(1.5f, 4.2f) to 1.050f,
Pair(1.5f, 4.4f) to 1.100f,
Pair(1.5f, 4.6f) to 1.150f,
Pair(1.5f, 4.8f) to 1.200f,
Pair(1.5f, 5.0f) to 1.250f,
Pair(1.5f, 5.5f) to 1.375f,
Pair(1.5f, 6.0f) to 1.500f,
Pair(1.5f, 6.5f) to 1.625f,
Pair(1.5f, 7.0f) to 1.750f,
Pair(1.5f, 7.5f) to 1.875f,
Pair(1.5f, 8.0f) to 2.000f,
Pair(1.5f, 8.5f) to 2.125f,
Pair(1.5f, 9.0f) to 2.250f,
Pair(1.5f, 9.5f) to 2.375f,
Pair(1.5f, 10.0f) to 2.500f,
Pair(1.5f, 11.0f) to 2.750f,
Pair(1.5f, 12.0f) to 3.000f,
Pair(1.5f, 13.0f) to 3.250f,
Pair(1.5f, 14.0f) to 3.500f,
Pair(1.5f, 15.0f) to 3.750f,
Pair(1.5f, 16.0f) to 4.000f,
// Pulse Width = 3f
Pair(3f, 2.0f ) to 0.500f,
Pair(3f, 2.1f ) to 0.525f,
Pair(3f, 2.2f ) to 0.550f,
Pair(3f, 2.3f ) to 0.575f,
Pair(3f, 2.4f ) to 0.600f,
Pair(3f, 2.5f ) to 0.625f,
Pair(3f, 2.6f ) to 0.650f,
Pair(3f, 2.7f ) to 0.675f,
Pair(3f, 2.8f ) to 0.700f,
Pair(3f, 2.9f ) to 0.725f,
Pair(3f, 3.0f ) to 0.750f,
Pair(3f, 3.2f ) to 0.800f,
Pair(3f, 3.4f ) to 0.850f,
Pair(3f, 3.6f ) to 0.900f,
Pair(3f, 3.8f ) to 0.950f,
Pair(3f, 4.0f ) to 1.000f,
Pair(3f, 4.2f ) to 1.050f,
Pair(3f, 4.4f ) to 1.100f,
Pair(3f, 4.6f ) to 1.150f,
Pair(3f, 4.8f ) to 1.200f,
Pair(3f, 5.0f ) to 1.250f,
Pair(3f, 5.5f ) to 1.375f,
Pair(3f, 6.0f ) to 1.500f,
Pair(3f, 6.5f ) to 1.625f,
Pair(3f, 7.0f ) to 1.750f,
Pair(3f, 7.5f ) to 1.875f,
Pair(3f, 8.0f ) to 2.000f,
Pair(3f, 8.5f ) to 2.125f,
Pair(3f, 9.0f ) to 2.250f,
Pair(3f, 9.5f ) to 2.375f,
Pair(3f, 10.0f) to 2.500f,
Pair(3f, 11.0f) to 2.750f,
Pair(3f, 12.0f) to 3.000f,
Pair(3f, 13.0f) to 3.250f,
Pair(3f, 14.0f) to 3.500f,
Pair(3f, 15.0f) to 3.750f,
Pair(3f, 16.0f) to 4.000f,
Pair(3f, 17.0f) to 4.250f,
Pair(3f, 18.0f) to 4.500f,
Pair(3f, 19.0f) to 4.750f,
Pair(3f, 20.0f) to 5.000f,
Pair(3f, 21.0f) to 5.250f,
Pair(3f, 22.0f) to 5.500f,
Pair(3f, 23.0f) to 5.750f,
Pair(3f, 24.0f) to 6.000f,
// Pulse Width = 5f
Pair(5f, 2.0f) to 0.500f,
Pair(5f, 2.1f) to 0.525f,
Pair(5f, 2.2f) to 0.550f,
Pair(5f, 2.3f) to 0.575f,
Pair(5f, 2.4f) to 0.600f,
Pair(5f, 2.5f) to 0.625f,
Pair(5f, 2.6f) to 0.650f,
Pair(5f, 2.7f) to 0.675f,
Pair(5f, 2.8f) to 0.700f,
Pair(5f, 2.9f) to 0.725f,
Pair(5f, 3.0f) to 0.750f,
Pair(5f, 3.2f) to 0.800f,
Pair(5f, 3.4f) to 0.850f,
Pair(5f, 3.6f) to 0.900f,
Pair(5f, 3.8f) to 0.950f,
Pair(5f, 4.0f) to 1.000f,
Pair(5f, 4.2f) to 1.050f,
Pair(5f, 4.4f) to 1.100f,
Pair(5f, 4.6f) to 1.150f,
Pair(5f, 4.8f) to 1.200f,
Pair(5f, 5.0f) to 1.250f,
Pair(5f, 5.5f) to 1.375f,
Pair(5f, 6.0f) to 1.500f,
Pair(5f, 6.5f) to 1.625f,
Pair(5f, 7.0f) to 1.750f,
Pair(5f, 7.5f) to 1.875f,
Pair(5f, 8.0f) to 2.000f,
Pair(5f, 8.5f) to 2.125f,
Pair(5f, 9.0f) to 2.250f,
Pair(5f, 9.5f) to 2.375f,
Pair(5f, 10.0f) to 2.500f,
Pair(5f, 11.0f) to 2.750f,
Pair(5f, 12.0f) to 3.000f,
Pair(5f, 13.0f) to 3.250f,
Pair(5f, 14.0f) to 3.500f,
Pair(5f, 15.0f) to 3.750f,
Pair(5f, 16.0f) to 4.000f,
Pair(5f, 17.0f) to 4.250f,
Pair(5f, 18.0f) to 4.500f,
Pair(5f, 19.0f) to 4.750f,
Pair(5f, 20.0f) to 5.000f,
Pair(5f, 21.0f) to 5.250f,
Pair(5f, 22.0f) to 5.500f,
Pair(5f, 23.0f) to 5.750f,
Pair(5f, 24.0f) to 6.000f,
Pair(5f, 25.0f) to 6.250f,
Pair(5f, 26.0f) to 6.500f,
Pair(5f, 27.0f) to 6.750f,
Pair(5f, 28.0f) to 7.000f,
// Pulse Width = 10f
Pair(10f, 2.0f) to 0.500f,
Pair(10f, 2.1f) to 0.525f,
Pair(10f, 2.2f) to 0.550f,
Pair(10f, 2.3f) to 0.575f,
Pair(10f, 2.4f) to 0.600f,
Pair(10f, 2.5f) to 0.625f,
Pair(10f, 2.6f) to 0.650f,
Pair(10f, 2.7f) to 0.675f,
Pair(10f, 2.8f) to 0.700f,
Pair(10f, 2.9f) to 0.725f,
Pair(10f, 3.0f) to 0.750f,
Pair(10f, 3.2f) to 0.800f,
Pair(10f, 3.4f) to 0.850f,
Pair(10f, 3.6f) to 0.900f,
Pair(10f, 3.8f) to 0.950f,
Pair(10f, 4.0f) to 1.000f,
Pair(10f, 4.2f) to 1.050f,
Pair(10f, 4.4f) to 1.100f,
Pair(10f, 4.6f) to 1.150f,
Pair(10f, 4.8f) to 1.200f,
Pair(10f, 5.0f) to 1.250f,
Pair(10f, 5.5f) to 1.375f,
Pair(10f, 6.0f) to 1.500f,
Pair(10f, 6.5f) to 1.625f,
Pair(10f, 7.0f) to 1.750f,
Pair(10f, 7.5f) to 1.875f,
Pair(10f, 8.0f) to 2.000f,
Pair(10f, 8.5f) to 2.125f,
Pair(10f, 9.0f) to 2.250f,
Pair(10f, 9.5f) to 2.375f,
Pair(10f, 10.0f) to 2.500f,
Pair(10f, 11.0f) to 2.750f,
Pair(10f, 12.0f) to 3.000f,
Pair(10f, 13.0f) to 3.250f,
Pair(10f, 14.0f) to 3.500f,
Pair(10f, 15.0f) to 3.750f,
Pair(10f, 16.0f) to 4.000f,
Pair(10f, 17.0f) to 4.250f,
Pair(10f, 18.0f) to 4.500f,
Pair(10f, 19.0f) to 4.750f,
Pair(10f, 20.0f) to 5.000f,
Pair(10f, 21.0f) to 5.250f,
Pair(10f, 22.0f) to 5.500f,
Pair(10f, 23.0f) to 5.750f,
Pair(10f, 24.0f) to 6.000f,
Pair(10f, 25.0f) to 6.250f,
Pair(10f, 26.0f) to 6.500f,
Pair(10f, 27.0f) to 6.750f,
Pair(10f, 28.0f) to 7.000f,
Pair(10f, 29.0f) to 7.250f,
Pair(10f, 30.0f) to 7.500f,
Pair(10f, 31.0f) to 7.750f,
Pair(10f, 32.0f) to 8.000f,
Pair(10f, 33.0f) to 8.250f,
Pair(10f, 34.0f) to 8.500f,
Pair(10f, 35.0f) to 8.750f,
Pair(10f, 36.0f) to 9.000f,
Pair(10f, 37.0f) to 9.250f,
Pair(10f, 38.0f) to 9.500f,
Pair(10f, 39.0f) to 9.750f,
Pair(10f, 40.0f) to 10.000f,
// Pulse Width = 15f
Pair(15f, 2.0f) to 0.500f,
Pair(15f, 2.1f) to 0.525f,
Pair(15f, 2.2f) to 0.550f,
Pair(15f, 2.3f) to 0.575f,
Pair(15f, 2.4f) to 0.600f,
Pair(15f, 2.5f) to 0.625f,
Pair(15f, 2.6f) to 0.650f,
Pair(15f, 2.7f) to 0.675f,
Pair(15f, 2.8f) to 0.700f,
Pair(15f, 2.9f) to 0.725f,
Pair(15f, 3.0f) to 0.750f,
Pair(15f, 3.2f) to 0.800f,
Pair(15f, 3.4f) to 0.850f,
Pair(15f, 3.6f) to 0.900f,
Pair(15f, 3.8f) to 0.950f,
Pair(15f, 4.0f) to 1.000f,
Pair(15f, 4.2f) to 1.050f,
Pair(15f, 4.4f) to 1.100f,
Pair(15f, 4.6f) to 1.150f,
Pair(15f, 4.8f) to 1.200f,
Pair(15f, 5.0f) to 1.250f,
Pair(15f, 5.5f) to 1.375f,
Pair(15f, 6.0f) to 1.500f,
Pair(15f, 6.5f) to 1.625f,
Pair(15f, 7.0f) to 1.750f,
Pair(15f, 7.5f) to 1.875f,
Pair(15f, 8.0f) to 2.000f,
Pair(15f, 8.5f) to 2.125f,
Pair(15f, 9.0f) to 2.250f,
Pair(15f, 9.5f) to 2.375f,
Pair(15f, 10.0f) to 2.500f,
Pair(15f, 11.0f) to 2.750f,
Pair(15f, 12.0f) to 3.000f,
Pair(15f, 13.0f) to 3.250f,
Pair(15f, 14.0f) to 3.500f,
Pair(15f, 15.0f) to 3.750f,
Pair(15f, 16.0f) to 4.000f,
Pair(15f, 17.0f) to 4.250f,
Pair(15f, 18.0f) to 4.500f,
Pair(15f, 19.0f) to 4.750f,
Pair(15f, 20.0f) to 5.000f,
Pair(15f, 21.0f) to 5.250f,
Pair(15f, 22.0f) to 5.500f,
Pair(15f, 23.0f) to 5.750f,
Pair(15f, 24.0f) to 6.000f,
Pair(15f, 25.0f) to 6.250f,
Pair(15f, 26.0f) to 6.500f,
Pair(15f, 27.0f) to 6.750f,
Pair(15f, 28.0f) to 7.000f,
Pair(15f, 29.0f) to 7.250f,
Pair(15f, 30.0f) to 7.500f,
Pair(15f, 31.0f) to 7.750f,
Pair(15f, 32.0f) to 8.000f,
Pair(15f, 33.0f) to 8.250f,
Pair(15f, 34.0f) to 8.500f,
Pair(15f, 35.0f) to 8.750f,
Pair(15f, 36.0f) to 9.000f,
Pair(15f, 37.0f) to 9.250f,
Pair(15f, 38.0f) to 9.500f,
Pair(15f, 39.0f) to 9.750f,
Pair(15f, 40.0f) to 10.000f,
// Pulse Width = 20f
Pair(20f, 2.0f) to 0.500f,
Pair(20f, 2.1f) to 0.525f,
Pair(20f, 2.2f) to 0.550f,
Pair(20f, 2.3f) to 0.575f,
Pair(20f, 2.4f) to 0.600f,
Pair(20f, 2.5f) to 0.625f,
Pair(20f, 2.6f) to 0.650f,
Pair(20f, 2.7f) to 0.675f,
Pair(20f, 2.8f) to 0.700f,
Pair(20f, 2.9f) to 0.725f,
Pair(20f, 3.0f) to 0.750f,
Pair(20f, 3.2f) to 0.800f,
Pair(20f, 3.4f) to 0.850f,
Pair(20f, 3.6f) to 0.900f,
Pair(20f, 3.8f) to 0.950f,
Pair(20f, 4.0f) to 1.000f,
Pair(20f, 4.2f) to 1.050f,
Pair(20f, 4.4f) to 1.100f,
Pair(20f, 4.6f) to 1.150f,
Pair(20f, 4.8f) to 1.200f,
Pair(20f, 5.0f) to 1.250f,
Pair(20f, 5.5f) to 1.375f,
Pair(20f, 6.0f) to 1.500f,
Pair(20f, 6.5f) to 1.625f,
Pair(20f, 7.0f) to 1.750f,
Pair(20f, 7.5f) to 1.875f,
Pair(20f, 8.0f) to 2.000f,
Pair(20f, 8.5f) to 2.125f,
Pair(20f, 9.0f) to 2.250f,
Pair(20f, 9.5f) to 2.375f,
Pair(20f, 10.0f) to 2.500f,
Pair(20f, 11.0f) to 2.750f,
Pair(20f, 12.0f) to 3.000f,
Pair(20f, 13.0f) to 3.250f,
Pair(20f, 14.0f) to 3.500f,
Pair(20f, 15.0f) to 3.750f,
Pair(20f, 16.0f) to 4.000f,
Pair(20f, 17.0f) to 4.250f,
Pair(20f, 18.0f) to 4.500f,
Pair(20f, 19.0f) to 4.750f,
Pair(20f, 20.0f) to 5.000f,
Pair(20f, 21.0f) to 5.250f,
Pair(20f, 22.0f) to 5.500f,
Pair(20f, 23.0f) to 5.750f,
Pair(20f, 24.0f) to 6.000f,
Pair(20f, 25.0f) to 6.250f,
Pair(20f, 26.0f) to 6.500f,
Pair(20f, 27.0f) to 6.750f,
Pair(20f, 28.0f) to 7.000f,
Pair(20f, 29.0f) to 7.250f,
Pair(20f, 30.0f) to 7.500f,
Pair(20f, 31.0f) to 7.750f,
Pair(20f, 32.0f) to 8.000f,
Pair(20f, 33.0f) to 8.250f,
Pair(20f, 34.0f) to 8.500f,
Pair(20f, 35.0f) to 8.750f,
Pair(20f, 36.0f) to 9.000f,
Pair(20f, 37.0f) to 9.250f,
Pair(20f, 38.0f) to 9.500f,
Pair(20f, 39.0f) to 9.750f,
Pair(20f, 40.0f) to 10.000f,
// Pulse Width = 25f
Pair(25f, 2.0f) to 0.500f,
Pair(25f, 2.1f) to 0.525f,
Pair(25f, 2.2f) to 0.550f,
Pair(25f, 2.3f) to 0.575f,
Pair(25f, 2.4f) to 0.600f,
Pair(25f, 2.5f) to 0.625f,
Pair(25f, 2.6f) to 0.650f,
Pair(25f, 2.7f) to 0.675f,
Pair(25f, 2.8f) to 0.700f,
Pair(25f, 2.9f) to 0.725f,
Pair(25f, 3.0f) to 0.750f,
Pair(25f, 3.2f) to 0.800f,
Pair(25f, 3.4f) to 0.850f,
Pair(25f, 3.6f) to 0.900f,
Pair(25f, 3.8f) to 0.950f,
Pair(25f, 4.0f) to 1.000f,
Pair(25f, 4.2f) to 1.050f,
Pair(25f, 4.4f) to 1.100f,
Pair(25f, 4.6f) to 1.150f,
Pair(25f, 4.8f) to 1.200f,
Pair(25f, 5.0f) to 1.250f,
Pair(25f, 5.5f) to 1.375f,
Pair(25f, 6.0f) to 1.500f,
Pair(25f, 6.5f) to 1.625f,
Pair(25f, 7.0f) to 1.750f,
Pair(25f, 7.5f) to 1.875f,
Pair(25f, 8.0f) to 2.000f,
Pair(25f, 8.5f) to 2.125f,
Pair(25f, 9.0f) to 2.250f,
Pair(25f, 9.5f) to 2.375f,
Pair(25f, 10.0f) to 2.500f,
Pair(25f, 11.0f) to 2.750f,
Pair(25f, 12.0f) to 3.000f,
Pair(25f, 13.0f) to 3.250f,
Pair(25f, 14.0f) to 3.500f,
Pair(25f, 15.0f) to 3.750f,
Pair(25f, 16.0f) to 4.000f,
Pair(25f, 17.0f) to 4.250f,
Pair(25f, 18.0f) to 4.500f,
Pair(25f, 19.0f) to 4.750f,
Pair(25f, 20.0f) to 5.000f,
Pair(25f, 21.0f) to 5.250f,
Pair(25f, 22.0f) to 5.500f,
Pair(25f, 23.0f) to 5.750f,
Pair(25f, 24.0f) to 6.000f,
Pair(25f, 25.0f) to 6.250f,
Pair(25f, 26.0f) to 6.500f,
Pair(25f, 27.0f) to 6.750f,
Pair(25f, 28.0f) to 7.000f,
Pair(25f, 29.0f) to 7.250f,
Pair(25f, 30.0f) to 7.500f,
Pair(25f, 31.0f) to 7.750f,
Pair(25f, 32.0f) to 8.000f,
Pair(25f, 33.0f) to 8.250f,
Pair(25f, 34.0f) to 8.500f,
Pair(25f, 35.0f) to 8.750f,
Pair(25f, 36.0f) to 9.000f,
Pair(25f, 37.0f) to 9.250f,
Pair(25f, 38.0f) to 9.500f,
Pair(25f, 39.0f) to 9.750f,
Pair(25f, 40.0f) to 10.000f,
// Pulse Width = 30f
Pair(30f, 2.0f) to 0.500f,
Pair(30f, 2.1f) to 0.525f,
Pair(30f, 2.2f) to 0.550f,
Pair(30f, 2.3f) to 0.575f,
Pair(30f, 2.4f) to 0.600f,
Pair(30f, 2.5f) to 0.625f,
Pair(30f, 2.6f) to 0.650f,
Pair(30f, 2.7f) to 0.675f,
Pair(30f, 2.8f) to 0.700f,
Pair(30f, 2.9f) to 0.725f,
Pair(30f, 3.0f) to 0.750f,
Pair(30f, 3.2f) to 0.800f,
Pair(30f, 3.4f) to 0.850f,
Pair(30f, 3.6f) to 0.900f,
Pair(30f, 3.8f) to 0.950f,
Pair(30f, 4.0f) to 1.000f,
Pair(30f, 4.2f) to 1.050f,
Pair(30f, 4.4f) to 1.100f,
Pair(30f, 4.6f) to 1.150f,
Pair(30f, 4.8f) to 1.200f,
Pair(30f, 5.0f) to 1.250f,
Pair(30f, 5.5f) to 1.375f,
Pair(30f, 6.0f) to 1.500f,
Pair(30f, 6.5f) to 1.625f,
Pair(30f, 7.0f) to 1.750f,
Pair(30f, 7.5f) to 1.875f,
Pair(30f, 8.0f) to 2.000f,
Pair(30f, 8.5f) to 2.125f,
Pair(30f, 9.0f) to 2.250f,
Pair(30f, 9.5f) to 2.375f,
Pair(30f, 10.0f) to 2.500f,
Pair(30f, 11.0f) to 2.750f,
Pair(30f, 12.0f) to 3.000f,
Pair(30f, 13.0f) to 3.250f,
Pair(30f, 14.0f) to 3.500f,
Pair(30f, 15.0f) to 3.750f,
Pair(30f, 16.0f) to 4.000f,
Pair(30f, 17.0f) to 4.250f,
Pair(30f, 18.0f) to 4.500f,
Pair(30f, 19.0f) to 4.750f,
Pair(30f, 20.0f) to 5.000f,
Pair(30f, 21.0f) to 5.250f,
Pair(30f, 22.0f) to 5.500f,
Pair(30f, 23.0f) to 5.750f,
Pair(30f, 24.0f) to 6.000f,
Pair(30f, 25.0f) to 6.250f,
Pair(30f, 26.0f) to 6.500f,
Pair(30f, 27.0f) to 6.750f,
Pair(30f, 28.0f) to 7.000f,
Pair(30f, 29.0f) to 7.250f,
Pair(30f, 30.0f) to 7.500f,
Pair(30f, 31.0f) to 7.750f,
Pair(30f, 32.0f) to 8.000f,
Pair(30f, 33.0f) to 8.250f,
Pair(30f, 34.0f) to 8.500f,
Pair(30f, 35.0f) to 8.750f,
Pair(30f, 36.0f) to 9.000f,
Pair(30f, 37.0f) to 9.250f,
Pair(30f, 38.0f) to 9.500f,
Pair(30f, 39.0f) to 9.750f,
Pair(30f, 40.0f) to 10.000f,
// Pulse Width = 35f
Pair(35f, 2.0f) to 0.500f,
Pair(35f, 2.1f) to 0.525f,
Pair(35f, 2.2f) to 0.550f,
Pair(35f, 2.3f) to 0.575f,
Pair(35f, 2.4f) to 0.600f,
Pair(35f, 2.5f) to 0.625f,
Pair(35f, 2.6f) to 0.650f,
Pair(35f, 2.7f) to 0.675f,
Pair(35f, 2.8f) to 0.700f,
Pair(35f, 2.9f) to 0.725f,
Pair(35f, 3.0f) to 0.750f,
Pair(35f, 3.2f) to 0.800f,
Pair(35f, 3.4f) to 0.850f,
Pair(35f, 3.6f) to 0.900f,
Pair(35f, 3.8f) to 0.950f,
Pair(35f, 4.0f) to 1.000f,
Pair(35f, 4.2f) to 1.050f,
Pair(35f, 4.4f) to 1.100f,
Pair(35f, 4.6f) to 1.150f,
Pair(35f, 4.8f) to 1.200f,
Pair(35f, 5.0f) to 1.250f,
Pair(35f, 5.5f) to 1.375f,
Pair(35f, 6.0f) to 1.500f,
Pair(35f, 6.5f) to 1.625f,
Pair(35f, 7.0f) to 1.750f,
Pair(35f, 7.5f) to 1.875f,
Pair(35f, 8.0f) to 2.000f,
Pair(35f, 8.5f) to 2.125f,
Pair(35f, 9.0f) to 2.250f,
Pair(35f, 9.5f) to 2.375f,
Pair(35f, 10.0f) to 2.500f,
Pair(35f, 11.0f) to 2.750f,
Pair(35f, 12.0f) to 3.000f,
Pair(35f, 13.0f) to 3.250f,
Pair(35f, 14.0f) to 3.500f,
Pair(35f, 15.0f) to 3.750f,
Pair(35f, 16.0f) to 4.000f,
Pair(35f, 17.0f) to 4.250f,
Pair(35f, 18.0f) to 4.500f,
Pair(35f, 19.0f) to 4.750f,
Pair(35f, 20.0f) to 5.000f,
Pair(35f, 21.0f) to 5.250f,
Pair(35f, 22.0f) to 5.500f,
Pair(35f, 23.0f) to 5.750f,
Pair(35f, 24.0f) to 6.000f,
Pair(35f, 25.0f) to 6.250f,
Pair(35f, 26.0f) to 6.500f,
Pair(35f, 27.0f) to 6.750f,
Pair(35f, 28.0f) to 7.000f,
Pair(35f, 29.0f) to 7.250f,
Pair(35f, 30.0f) to 7.500f,
Pair(35f, 31.0f) to 7.750f,
Pair(35f, 32.0f) to 8.000f,
Pair(35f, 33.0f) to 8.250f,
Pair(35f, 34.0f) to 8.500f,
Pair(35f, 35.0f) to 8.750f,
Pair(35f, 36.0f) to 9.000f,
Pair(35f, 37.0f) to 9.250f,
Pair(35f, 38.0f) to 9.500f,
Pair(35f, 39.0f) to 9.750f,
Pair(35f, 40.0f) to 10.000f,
// Pulse Width = 40f
Pair(40f, 2.0f) to 0.500f,
Pair(40f, 2.1f) to 0.525f,
Pair(40f, 2.2f) to 0.550f,
Pair(40f, 2.3f) to 0.575f,
Pair(40f, 2.4f) to 0.600f,
Pair(40f, 2.5f) to 0.625f,
Pair(40f, 2.6f) to 0.650f,
Pair(40f, 2.7f) to 0.675f,
Pair(40f, 2.8f) to 0.700f,
Pair(40f, 2.9f) to 0.725f,
Pair(40f, 3.0f) to 0.750f,
Pair(40f, 3.2f) to 0.800f,
Pair(40f, 3.4f) to 0.850f,
Pair(40f, 3.6f) to 0.900f,
Pair(40f, 3.8f) to 0.950f,
Pair(40f, 4.0f) to 1.000f,
Pair(40f, 4.2f) to 1.050f,
Pair(40f, 4.4f) to 1.100f,
Pair(40f, 4.6f) to 1.150f,
Pair(40f, 4.8f) to 1.200f,
Pair(40f, 5.0f) to 1.250f,
Pair(40f, 5.5f) to 1.375f,
Pair(40f, 6.0f) to 1.500f,
Pair(40f, 6.5f) to 1.625f,
Pair(40f, 7.0f) to 1.750f,
Pair(40f, 7.5f) to 1.875f,
Pair(40f, 8.0f) to 2.000f,
Pair(40f, 8.5f) to 2.125f,
Pair(40f, 9.0f) to 2.250f,
Pair(40f, 9.5f) to 2.375f,
Pair(40f, 10.0f) to 2.500f,
Pair(40f, 11.0f) to 2.750f,
Pair(40f, 12.0f) to 3.000f,
Pair(40f, 13.0f) to 3.250f,
Pair(40f, 14.0f) to 3.500f,
Pair(40f, 15.0f) to 3.750f,
Pair(40f, 16.0f) to 4.000f,
Pair(40f, 17.0f) to 4.250f,
Pair(40f, 18.0f) to 4.500f,
Pair(40f, 19.0f) to 4.750f,
Pair(40f, 20.0f) to 5.000f,
Pair(40f, 21.0f) to 5.250f,
Pair(40f, 22.0f) to 5.500f,
Pair(40f, 23.0f) to 5.750f,
Pair(40f, 24.0f) to 6.000f,
Pair(40f, 25.0f) to 6.250f,
Pair(40f, 26.0f) to 6.500f,
Pair(40f, 27.0f) to 6.750f,
Pair(40f, 28.0f) to 7.000f,
Pair(40f, 29.0f) to 7.250f,
Pair(40f, 30.0f) to 7.500f,
Pair(40f, 31.0f) to 7.750f,
Pair(40f, 32.0f) to 8.000f,
Pair(40f, 33.0f) to 8.250f,
Pair(40f, 34.0f) to 8.500f,
Pair(40f, 35.0f) to 8.750f,
Pair(40f, 36.0f) to 9.000f,
Pair(40f, 37.0f) to 9.250f,
Pair(40f, 38.0f) to 9.500f,
Pair(40f, 39.0f) to 9.750f,
Pair(40f, 40.0f) to 10.000f,
)

View File

@@ -0,0 +1,509 @@
package com.laseroptek.raman.const
//
// Energy Table3 (HANDPIENCE-10x10)
// - Map<Pair<Float, Float>, Float>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Fluence(J/cm²)>, Energy(J)>
//
val EnergyTable_10_10 = mapOf(
// Pulse Width = 0.5f
Pair(0.5f, 0.5f) to 0.500f,
Pair(0.5f, 0.6f) to 0.600f,
Pair(0.5f, 0.7f) to 0.700f,
Pair(0.5f, 0.8f) to 0.800f,
Pair(0.5f, 0.9f) to 0.900f,
Pair(0.5f, 1.0f) to 1.000f,
Pair(0.5f, 1.1f) to 1.100f,
Pair(0.5f, 1.2f) to 1.200f,
Pair(0.5f, 1.3f) to 1.300f,
Pair(0.5f, 1.4f) to 1.400f,
Pair(0.5f, 1.5f) to 1.500f,
Pair(0.5f, 1.6f) to 1.600f,
Pair(0.5f, 1.7f) to 1.700f,
Pair(0.5f, 1.8f) to 1.800f,
Pair(0.5f, 1.9f) to 1.900f,
Pair(0.5f, 2.0f) to 2.000f,
// Pulse Width = 1f
Pair(1f, 0.5f) to 0.500f,
Pair(1f, 0.6f) to 0.600f,
Pair(1f, 0.7f) to 0.700f,
Pair(1f, 0.8f) to 0.800f,
Pair(1f, 0.9f) to 0.900f,
Pair(1f, 1.0f) to 1.000f,
Pair(1f, 1.1f) to 1.100f,
Pair(1f, 1.2f) to 1.200f,
Pair(1f, 1.3f) to 1.300f,
Pair(1f, 1.4f) to 1.400f,
Pair(1f, 1.5f) to 1.500f,
Pair(1f, 1.6f) to 1.600f,
Pair(1f, 1.7f) to 1.700f,
Pair(1f, 1.8f) to 1.800f,
Pair(1f, 1.9f) to 1.900f,
Pair(1f, 2.0f) to 2.000f,
Pair(1f, 2.1f) to 2.100f,
Pair(1f, 2.2f) to 2.200f,
Pair(1f, 2.3f) to 2.300f,
Pair(1f, 2.4f) to 2.400f,
Pair(1f, 2.5f) to 2.500f,
Pair(1f, 2.6f) to 2.600f,
Pair(1f, 2.7f) to 2.700f,
Pair(1f, 2.8f) to 2.800f,
Pair(1f, 2.9f) to 2.900f,
Pair(1f, 3.0f) to 3.000f,
// Pulse Width = 1.5f
Pair(1.5f, 0.5f) to 0.500f,
Pair(1.5f, 0.6f) to 0.600f,
Pair(1.5f, 0.7f) to 0.700f,
Pair(1.5f, 0.8f) to 0.800f,
Pair(1.5f, 0.9f) to 0.900f,
Pair(1.5f, 1.0f) to 1.000f,
Pair(1.5f, 1.1f) to 1.100f,
Pair(1.5f, 1.2f) to 1.200f,
Pair(1.5f, 1.3f) to 1.300f,
Pair(1.5f, 1.4f) to 1.400f,
Pair(1.5f, 1.5f) to 1.500f,
Pair(1.5f, 1.6f) to 1.600f,
Pair(1.5f, 1.7f) to 1.700f,
Pair(1.5f, 1.8f) to 1.800f,
Pair(1.5f, 1.9f) to 1.900f,
Pair(1.5f, 2.0f) to 2.000f,
Pair(1.5f, 2.1f) to 2.100f,
Pair(1.5f, 2.2f) to 2.200f,
Pair(1.5f, 2.3f) to 2.300f,
Pair(1.5f, 2.4f) to 2.400f,
Pair(1.5f, 2.5f) to 2.500f,
Pair(1.5f, 2.6f) to 2.600f,
Pair(1.5f, 2.7f) to 2.700f,
Pair(1.5f, 2.8f) to 2.800f,
Pair(1.5f, 2.9f) to 2.900f,
Pair(1.5f, 3.0f) to 3.000f,
Pair(1.5f, 3.2f) to 3.200f,
Pair(1.5f, 3.4f) to 3.400f,
Pair(1.5f, 3.6f) to 3.600f,
Pair(1.5f, 3.8f) to 3.800f,
Pair(1.5f, 4.0f) to 4.000f,
// Pulse Width = 3f
Pair(3f, 0.5f) to 0.500f,
Pair(3f, 0.6f) to 0.600f,
Pair(3f, 0.7f) to 0.700f,
Pair(3f, 0.8f) to 0.800f,
Pair(3f, 0.9f) to 0.900f,
Pair(3f, 1.0f) to 1.000f,
Pair(3f, 1.1f) to 1.100f,
Pair(3f, 1.2f) to 1.200f,
Pair(3f, 1.3f) to 1.300f,
Pair(3f, 1.4f) to 1.400f,
Pair(3f, 1.5f) to 1.500f,
Pair(3f, 1.6f) to 1.600f,
Pair(3f, 1.7f) to 1.700f,
Pair(3f, 1.8f) to 1.800f,
Pair(3f, 1.9f) to 1.900f,
Pair(3f, 2.0f) to 2.000f,
Pair(3f, 2.1f) to 2.100f,
Pair(3f, 2.2f) to 2.200f,
Pair(3f, 2.3f) to 2.300f,
Pair(3f, 2.4f) to 2.400f,
Pair(3f, 2.5f) to 2.500f,
Pair(3f, 2.6f) to 2.600f,
Pair(3f, 2.7f) to 2.700f,
Pair(3f, 2.8f) to 2.800f,
Pair(3f, 2.9f) to 2.900f,
Pair(3f, 3.0f) to 3.000f,
Pair(3f, 3.2f) to 3.200f,
Pair(3f, 3.4f) to 3.400f,
Pair(3f, 3.6f) to 3.600f,
Pair(3f, 3.8f) to 3.800f,
Pair(3f, 4.0f) to 4.000f,
Pair(3f, 4.2f) to 4.200f,
Pair(3f, 4.4f) to 4.400f,
Pair(3f, 4.6f) to 4.600f,
Pair(3f, 4.8f) to 4.800f,
Pair(3f, 5.0f) to 5.000f,
Pair(3f, 5.5f) to 5.500f,
Pair(3f, 6.0f) to 6.000f,
// Pulse Width = 5f
Pair(5f, 0.5f) to 0.500f,
Pair(5f, 0.6f) to 0.600f,
Pair(5f, 0.7f) to 0.700f,
Pair(5f, 0.8f) to 0.800f,
Pair(5f, 0.9f) to 0.900f,
Pair(5f, 1.0f) to 1.000f,
Pair(5f, 1.1f) to 1.100f,
Pair(5f, 1.2f) to 1.200f,
Pair(5f, 1.3f) to 1.300f,
Pair(5f, 1.4f) to 1.400f,
Pair(5f, 1.5f) to 1.500f,
Pair(5f, 1.6f) to 1.600f,
Pair(5f, 1.7f) to 1.700f,
Pair(5f, 1.8f) to 1.800f,
Pair(5f, 1.9f) to 1.900f,
Pair(5f, 2.0f) to 2.000f,
Pair(5f, 2.1f) to 2.100f,
Pair(5f, 2.2f) to 2.200f,
Pair(5f, 2.3f) to 2.300f,
Pair(5f, 2.4f) to 2.400f,
Pair(5f, 2.5f) to 2.500f,
Pair(5f, 2.6f) to 2.600f,
Pair(5f, 2.7f) to 2.700f,
Pair(5f, 2.8f) to 2.800f,
Pair(5f, 2.9f) to 2.900f,
Pair(5f, 3.0f) to 3.000f,
Pair(5f, 3.2f) to 3.200f,
Pair(5f, 3.4f) to 3.400f,
Pair(5f, 3.6f) to 3.600f,
Pair(5f, 3.8f) to 3.800f,
Pair(5f, 4.0f) to 4.000f,
Pair(5f, 4.2f) to 4.200f,
Pair(5f, 4.4f) to 4.400f,
Pair(5f, 4.6f) to 4.600f,
Pair(5f, 4.8f) to 4.800f,
Pair(5f, 5.0f) to 5.000f,
Pair(5f, 5.5f) to 5.500f,
Pair(5f, 6.0f) to 6.000f,
Pair(5f, 6.5f) to 6.500f,
Pair(5f, 7.0f) to 7.000f,
// Pulse Width = 10f
Pair(10f, 0.5f) to 0.500f,
Pair(10f, 0.6f) to 0.600f,
Pair(10f, 0.7f) to 0.700f,
Pair(10f, 0.8f) to 0.800f,
Pair(10f, 0.9f) to 0.900f,
Pair(10f, 1.0f) to 1.000f,
Pair(10f, 1.1f) to 1.100f,
Pair(10f, 1.2f) to 1.200f,
Pair(10f, 1.3f) to 1.300f,
Pair(10f, 1.4f) to 1.400f,
Pair(10f, 1.5f) to 1.500f,
Pair(10f, 1.6f) to 1.600f,
Pair(10f, 1.7f) to 1.700f,
Pair(10f, 1.8f) to 1.800f,
Pair(10f, 1.9f) to 1.900f,
Pair(10f, 2.0f) to 2.000f,
Pair(10f, 2.1f) to 2.100f,
Pair(10f, 2.2f) to 2.200f,
Pair(10f, 2.3f) to 2.300f,
Pair(10f, 2.4f) to 2.400f,
Pair(10f, 2.5f) to 2.500f,
Pair(10f, 2.6f) to 2.600f,
Pair(10f, 2.7f) to 2.700f,
Pair(10f, 2.8f) to 2.800f,
Pair(10f, 2.9f) to 2.900f,
Pair(10f, 3.0f) to 3.000f,
Pair(10f, 3.2f) to 3.200f,
Pair(10f, 3.4f) to 3.400f,
Pair(10f, 3.6f) to 3.600f,
Pair(10f, 3.8f) to 3.800f,
Pair(10f, 4.0f) to 4.000f,
Pair(10f, 4.2f) to 4.200f,
Pair(10f, 4.4f) to 4.400f,
Pair(10f, 4.6f) to 4.600f,
Pair(10f, 4.8f) to 4.800f,
Pair(10f, 5.0f) to 5.000f,
Pair(10f, 5.5f) to 5.500f,
Pair(10f, 6.0f) to 6.000f,
Pair(10f, 6.5f) to 6.500f,
Pair(10f, 7.0f) to 7.000f,
Pair(10f, 7.5f) to 7.500f,
Pair(10f, 8.0f) to 8.000f,
Pair(10f, 8.5f) to 8.500f,
Pair(10f, 9.0f) to 9.000f,
Pair(10f, 9.5f) to 9.500f,
Pair(10f, 10.0f) to 10.000f,
// Pulse Width = 15f
Pair(15f, 0.5f) to 0.500f,
Pair(15f, 0.6f) to 0.600f,
Pair(15f, 0.7f) to 0.700f,
Pair(15f, 0.8f) to 0.800f,
Pair(15f, 0.9f) to 0.900f,
Pair(15f, 1.0f) to 1.000f,
Pair(15f, 1.1f) to 1.100f,
Pair(15f, 1.2f) to 1.200f,
Pair(15f, 1.3f) to 1.300f,
Pair(15f, 1.4f) to 1.400f,
Pair(15f, 1.5f) to 1.500f,
Pair(15f, 1.6f) to 1.600f,
Pair(15f, 1.7f) to 1.700f,
Pair(15f, 1.8f) to 1.800f,
Pair(15f, 1.9f) to 1.900f,
Pair(15f, 2.0f) to 2.000f,
Pair(15f, 2.1f) to 2.100f,
Pair(15f, 2.2f) to 2.200f,
Pair(15f, 2.3f) to 2.300f,
Pair(15f, 2.4f) to 2.400f,
Pair(15f, 2.5f) to 2.500f,
Pair(15f, 2.6f) to 2.600f,
Pair(15f, 2.7f) to 2.700f,
Pair(15f, 2.8f) to 2.800f,
Pair(15f, 2.9f) to 2.900f,
Pair(15f, 3.0f) to 3.000f,
Pair(15f, 3.2f) to 3.200f,
Pair(15f, 3.4f) to 3.400f,
Pair(15f, 3.6f) to 3.600f,
Pair(15f, 3.8f) to 3.800f,
Pair(15f, 4.0f) to 4.000f,
Pair(15f, 4.2f) to 4.200f,
Pair(15f, 4.4f) to 4.400f,
Pair(15f, 4.6f) to 4.600f,
Pair(15f, 4.8f) to 4.800f,
Pair(15f, 5.0f) to 5.000f,
Pair(15f, 5.5f) to 5.500f,
Pair(15f, 6.0f) to 6.000f,
Pair(15f, 6.5f) to 6.500f,
Pair(15f, 7.0f) to 7.000f,
Pair(15f, 7.5f) to 7.500f,
Pair(15f, 8.0f) to 8.000f,
Pair(15f, 8.5f) to 8.500f,
Pair(15f, 9.0f) to 9.000f,
Pair(15f, 9.5f) to 9.500f,
Pair(15f, 10.0f) to 10.000f,
// Pulse Width = 20f
Pair(20f, 0.5f) to 0.500f,
Pair(20f, 0.6f) to 0.600f,
Pair(20f, 0.7f) to 0.700f,
Pair(20f, 0.8f) to 0.800f,
Pair(20f, 0.9f) to 0.900f,
Pair(20f, 1.0f) to 1.000f,
Pair(20f, 1.1f) to 1.100f,
Pair(20f, 1.2f) to 1.200f,
Pair(20f, 1.3f) to 1.300f,
Pair(20f, 1.4f) to 1.400f,
Pair(20f, 1.5f) to 1.500f,
Pair(20f, 1.6f) to 1.600f,
Pair(20f, 1.7f) to 1.700f,
Pair(20f, 1.8f) to 1.800f,
Pair(20f, 1.9f) to 1.900f,
Pair(20f, 2.0f) to 2.000f,
Pair(20f, 2.1f) to 2.100f,
Pair(20f, 2.2f) to 2.200f,
Pair(20f, 2.3f) to 2.300f,
Pair(20f, 2.4f) to 2.400f,
Pair(20f, 2.5f) to 2.500f,
Pair(20f, 2.6f) to 2.600f,
Pair(20f, 2.7f) to 2.700f,
Pair(20f, 2.8f) to 2.800f,
Pair(20f, 2.9f) to 2.900f,
Pair(20f, 3.0f) to 3.000f,
Pair(20f, 3.2f) to 3.200f,
Pair(20f, 3.4f) to 3.400f,
Pair(20f, 3.6f) to 3.600f,
Pair(20f, 3.8f) to 3.800f,
Pair(20f, 4.0f) to 4.000f,
Pair(20f, 4.2f) to 4.200f,
Pair(20f, 4.4f) to 4.400f,
Pair(20f, 4.6f) to 4.600f,
Pair(20f, 4.8f) to 4.800f,
Pair(20f, 5.0f) to 5.000f,
Pair(20f, 5.5f) to 5.500f,
Pair(20f, 6.0f) to 6.000f,
Pair(20f, 6.5f) to 6.500f,
Pair(20f, 7.0f) to 7.000f,
Pair(20f, 7.5f) to 7.500f,
Pair(20f, 8.0f) to 8.000f,
Pair(20f, 8.5f) to 8.500f,
Pair(20f, 9.0f) to 9.000f,
Pair(20f, 9.5f) to 9.500f,
Pair(20f, 10.0f) to 10.000f,
// Pulse Width = 25f
Pair(25f, 0.5f) to 0.500f,
Pair(25f, 0.6f) to 0.600f,
Pair(25f, 0.7f) to 0.700f,
Pair(25f, 0.8f) to 0.800f,
Pair(25f, 0.9f) to 0.900f,
Pair(25f, 1.0f) to 1.000f,
Pair(25f, 1.1f) to 1.100f,
Pair(25f, 1.2f) to 1.200f,
Pair(25f, 1.3f) to 1.300f,
Pair(25f, 1.4f) to 1.400f,
Pair(25f, 1.5f) to 1.500f,
Pair(25f, 1.6f) to 1.600f,
Pair(25f, 1.7f) to 1.700f,
Pair(25f, 1.8f) to 1.800f,
Pair(25f, 1.9f) to 1.900f,
Pair(25f, 2.0f) to 2.000f,
Pair(25f, 2.1f) to 2.100f,
Pair(25f, 2.2f) to 2.200f,
Pair(25f, 2.3f) to 2.300f,
Pair(25f, 2.4f) to 2.400f,
Pair(25f, 2.5f) to 2.500f,
Pair(25f, 2.6f) to 2.600f,
Pair(25f, 2.7f) to 2.700f,
Pair(25f, 2.8f) to 2.800f,
Pair(25f, 2.9f) to 2.900f,
Pair(25f, 3.0f) to 3.000f,
Pair(25f, 3.2f) to 3.200f,
Pair(25f, 3.4f) to 3.400f,
Pair(25f, 3.6f) to 3.600f,
Pair(25f, 3.8f) to 3.800f,
Pair(25f, 4.0f) to 4.000f,
Pair(25f, 4.2f) to 4.200f,
Pair(25f, 4.4f) to 4.400f,
Pair(25f, 4.6f) to 4.600f,
Pair(25f, 4.8f) to 4.800f,
Pair(25f, 5.0f) to 5.000f,
Pair(25f, 5.5f) to 5.500f,
Pair(25f, 6.0f) to 6.000f,
Pair(25f, 6.5f) to 6.500f,
Pair(25f, 7.0f) to 7.000f,
Pair(25f, 7.5f) to 7.500f,
Pair(25f, 8.0f) to 8.000f,
Pair(25f, 8.5f) to 8.500f,
Pair(25f, 9.0f) to 9.000f,
Pair(25f, 9.5f) to 9.500f,
Pair(25f, 10.0f) to 10.000f,
// Pulse Width = 30f
Pair(30f, 0.5f) to 0.500f,
Pair(30f, 0.6f) to 0.600f,
Pair(30f, 0.7f) to 0.700f,
Pair(30f, 0.8f) to 0.800f,
Pair(30f, 0.9f) to 0.900f,
Pair(30f, 1.0f) to 1.000f,
Pair(30f, 1.1f) to 1.100f,
Pair(30f, 1.2f) to 1.200f,
Pair(30f, 1.3f) to 1.300f,
Pair(30f, 1.4f) to 1.400f,
Pair(30f, 1.5f) to 1.500f,
Pair(30f, 1.6f) to 1.600f,
Pair(30f, 1.7f) to 1.700f,
Pair(30f, 1.8f) to 1.800f,
Pair(30f, 1.9f) to 1.900f,
Pair(30f, 2.0f) to 2.000f,
Pair(30f, 2.1f) to 2.100f,
Pair(30f, 2.2f) to 2.200f,
Pair(30f, 2.3f) to 2.300f,
Pair(30f, 2.4f) to 2.400f,
Pair(30f, 2.5f) to 2.500f,
Pair(30f, 2.6f) to 2.600f,
Pair(30f, 2.7f) to 2.700f,
Pair(30f, 2.8f) to 2.800f,
Pair(30f, 2.9f) to 2.900f,
Pair(30f, 3.0f) to 3.000f,
Pair(30f, 3.2f) to 3.200f,
Pair(30f, 3.4f) to 3.400f,
Pair(30f, 3.6f) to 3.600f,
Pair(30f, 3.8f) to 3.800f,
Pair(30f, 4.0f) to 4.000f,
Pair(30f, 4.2f) to 4.200f,
Pair(30f, 4.4f) to 4.400f,
Pair(30f, 4.6f) to 4.600f,
Pair(30f, 4.8f) to 4.800f,
Pair(30f, 5.0f) to 5.000f,
Pair(30f, 5.5f) to 5.500f,
Pair(30f, 6.0f) to 6.000f,
Pair(30f, 6.5f) to 6.500f,
Pair(30f, 7.0f) to 7.000f,
Pair(30f, 7.5f) to 7.500f,
Pair(30f, 8.0f) to 8.000f,
Pair(30f, 8.5f) to 8.500f,
Pair(30f, 9.0f) to 9.000f,
Pair(30f, 9.5f) to 9.500f,
Pair(30f, 10.0f) to 10.000f,
// Pulse Width = 35f
Pair(35f, 0.5f) to 0.500f,
Pair(35f, 0.6f) to 0.600f,
Pair(35f, 0.7f) to 0.700f,
Pair(35f, 0.8f) to 0.800f,
Pair(35f, 0.9f) to 0.900f,
Pair(35f, 1.0f) to 1.000f,
Pair(35f, 1.1f) to 1.100f,
Pair(35f, 1.2f) to 1.200f,
Pair(35f, 1.3f) to 1.300f,
Pair(35f, 1.4f) to 1.400f,
Pair(35f, 1.5f) to 1.500f,
Pair(35f, 1.6f) to 1.600f,
Pair(35f, 1.7f) to 1.700f,
Pair(35f, 1.8f) to 1.800f,
Pair(35f, 1.9f) to 1.900f,
Pair(35f, 2.0f) to 2.000f,
Pair(35f, 2.1f) to 2.100f,
Pair(35f, 2.2f) to 2.200f,
Pair(35f, 2.3f) to 2.300f,
Pair(35f, 2.4f) to 2.400f,
Pair(35f, 2.5f) to 2.500f,
Pair(35f, 2.6f) to 2.600f,
Pair(35f, 2.7f) to 2.700f,
Pair(35f, 2.8f) to 2.800f,
Pair(35f, 2.9f) to 2.900f,
Pair(35f, 3.0f) to 3.000f,
Pair(35f, 3.2f) to 3.200f,
Pair(35f, 3.4f) to 3.400f,
Pair(35f, 3.6f) to 3.600f,
Pair(35f, 3.8f) to 3.800f,
Pair(35f, 4.0f) to 4.000f,
Pair(35f, 4.2f) to 4.200f,
Pair(35f, 4.4f) to 4.400f,
Pair(35f, 4.6f) to 4.600f,
Pair(35f, 4.8f) to 4.800f,
Pair(35f, 5.0f) to 5.000f,
Pair(35f, 5.5f) to 5.500f,
Pair(35f, 6.0f) to 6.000f,
Pair(35f, 6.5f) to 6.500f,
Pair(35f, 7.0f) to 7.000f,
Pair(35f, 7.5f) to 7.500f,
Pair(35f, 8.0f) to 8.000f,
Pair(35f, 8.5f) to 8.500f,
Pair(35f, 9.0f) to 9.000f,
Pair(35f, 9.5f) to 9.500f,
Pair(35f, 10.0f) to 10.000f,
// Pulse Width = 40f
Pair(40f, 0.5f) to 0.500f,
Pair(40f, 0.6f) to 0.600f,
Pair(40f, 0.7f) to 0.700f,
Pair(40f, 0.8f) to 0.800f,
Pair(40f, 0.9f) to 0.900f,
Pair(40f, 1.0f) to 1.000f,
Pair(40f, 1.1f) to 1.100f,
Pair(40f, 1.2f) to 1.200f,
Pair(40f, 1.3f) to 1.300f,
Pair(40f, 1.4f) to 1.400f,
Pair(40f, 1.5f) to 1.500f,
Pair(40f, 1.6f) to 1.600f,
Pair(40f, 1.7f) to 1.700f,
Pair(40f, 1.8f) to 1.800f,
Pair(40f, 1.9f) to 1.900f,
Pair(40f, 2.0f) to 2.000f,
Pair(40f, 2.1f) to 2.100f,
Pair(40f, 2.2f) to 2.200f,
Pair(40f, 2.3f) to 2.300f,
Pair(40f, 2.4f) to 2.400f,
Pair(40f, 2.5f) to 2.500f,
Pair(40f, 2.6f) to 2.600f,
Pair(40f, 2.7f) to 2.700f,
Pair(40f, 2.8f) to 2.800f,
Pair(40f, 2.9f) to 2.900f,
Pair(40f, 3.0f) to 3.000f,
Pair(40f, 3.2f) to 3.200f,
Pair(40f, 3.4f) to 3.400f,
Pair(40f, 3.6f) to 3.600f,
Pair(40f, 3.8f) to 3.800f,
Pair(40f, 4.0f) to 4.000f,
Pair(40f, 4.2f) to 4.200f,
Pair(40f, 4.4f) to 4.400f,
Pair(40f, 4.6f) to 4.600f,
Pair(40f, 4.8f) to 4.800f,
Pair(40f, 5.0f) to 5.000f,
Pair(40f, 5.5f) to 5.500f,
Pair(40f, 6.0f) to 6.000f,
Pair(40f, 6.5f) to 6.500f,
Pair(40f, 7.0f) to 7.000f,
Pair(40f, 7.5f) to 7.500f,
Pair(40f, 8.0f) to 8.000f,
Pair(40f, 8.5f) to 8.500f,
Pair(40f, 9.0f) to 9.000f,
Pair(40f, 9.5f) to 9.500f,
Pair(40f, 10.0f) to 10.000f,
)

View File

@@ -0,0 +1,435 @@
package com.laseroptek.raman.const
//
// Energy Table4 (HANDPIENCE-12x12)
// - Map<Pair<Float, Float>, Float>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Fluence(J/cm²)>, Energy(J)>
//
val EnergyTable_12_12 = mapOf(
// Pulse Width = 0.5f
Pair(0.5f, 0.4f) to 0.576f,
Pair(0.5f, 0.5f) to 0.720f,
Pair(0.5f, 0.6f) to 0.864f,
Pair(0.5f, 0.7f) to 1.008f,
Pair(0.5f, 0.8f) to 1.152f,
Pair(0.5f, 0.9f) to 1.296f,
Pair(0.5f, 1.0f) to 1.440f,
Pair(0.5f, 1.1f) to 1.584f,
Pair(0.5f, 1.2f) to 1.728f,
Pair(0.5f, 1.3f) to 1.872f,
// Pulse Width = 1f
Pair(1f, 0.4f) to 0.576f,
Pair(1f, 0.5f) to 0.720f,
Pair(1f, 0.6f) to 0.864f,
Pair(1f, 0.7f) to 1.008f,
Pair(1f, 0.8f) to 1.152f,
Pair(1f, 0.9f) to 1.296f,
Pair(1f, 1.0f) to 1.440f,
Pair(1f, 1.1f) to 1.584f,
Pair(1f, 1.2f) to 1.728f,
Pair(1f, 1.3f) to 1.872f,
Pair(1f, 1.4f) to 2.016f,
Pair(1f, 1.5f) to 2.160f,
Pair(1f, 1.6f) to 2.304f,
Pair(1f, 1.7f) to 2.448f,
Pair(1f, 1.8f) to 2.592f,
Pair(1f, 1.9f) to 2.736f,
Pair(1f, 2.0f) to 2.880f,
// Pulse Width = 1.5f
Pair(1.5f, 0.4f) to 0.576f,
Pair(1.5f, 0.5f) to 0.720f,
Pair(1.5f, 0.6f) to 0.864f,
Pair(1.5f, 0.7f) to 1.008f,
Pair(1.5f, 0.8f) to 1.152f,
Pair(1.5f, 0.9f) to 1.296f,
Pair(1.5f, 1.0f) to 1.440f,
Pair(1.5f, 1.1f) to 1.584f,
Pair(1.5f, 1.2f) to 1.728f,
Pair(1.5f, 1.3f) to 1.872f,
Pair(1.5f, 1.4f) to 2.016f,
Pair(1.5f, 1.5f) to 2.160f,
Pair(1.5f, 1.6f) to 2.304f,
Pair(1.5f, 1.7f) to 2.448f,
Pair(1.5f, 1.8f) to 2.592f,
Pair(1.5f, 1.9f) to 2.736f,
Pair(1.5f, 2.0f) to 2.880f,
Pair(1.5f, 2.1f) to 3.024f,
Pair(1.5f, 2.2f) to 3.168f,
Pair(1.5f, 2.3f) to 3.312f,
Pair(1.5f, 2.4f) to 3.456f,
Pair(1.5f, 2.5f) to 3.600f,
Pair(1.5f, 2.6f) to 3.744f,
Pair(1.5f, 2.7f) to 3.888f,
// Pulse Width = 3f
Pair(3f, 0.4f) to 0.576f,
Pair(3f, 0.5f) to 0.720f,
Pair(3f, 0.6f) to 0.864f,
Pair(3f, 0.7f) to 1.008f,
Pair(3f, 0.8f) to 1.152f,
Pair(3f, 0.9f) to 1.296f,
Pair(3f, 1.0f) to 1.440f,
Pair(3f, 1.1f) to 1.584f,
Pair(3f, 1.2f) to 1.728f,
Pair(3f, 1.3f) to 1.872f,
Pair(3f, 1.4f) to 2.016f,
Pair(3f, 1.5f) to 2.160f,
Pair(3f, 1.6f) to 2.304f,
Pair(3f, 1.7f) to 2.448f,
Pair(3f, 1.8f) to 2.592f,
Pair(3f, 1.9f) to 2.736f,
Pair(3f, 2.0f) to 2.880f,
Pair(3f, 2.1f) to 3.024f,
Pair(3f, 2.2f) to 3.168f,
Pair(3f, 2.3f) to 3.312f,
Pair(3f, 2.4f) to 3.456f,
Pair(3f, 2.5f) to 3.600f,
Pair(3f, 2.6f) to 3.744f,
Pair(3f, 2.7f) to 3.888f,
Pair(3f, 2.8f) to 4.032f,
Pair(3f, 2.9f) to 4.176f,
Pair(3f, 3.0f) to 4.320f,
Pair(3f, 3.2f) to 4.608f,
Pair(3f, 3.4f) to 4.896f,
Pair(3f, 3.6f) to 5.184f,
Pair(3f, 3.8f) to 5.472f,
Pair(3f, 4.0f) to 5.760f,
// Pulse Width = 5f
Pair(5f, 0.4f) to 0.576f,
Pair(5f, 0.5f) to 0.720f,
Pair(5f, 0.6f) to 0.864f,
Pair(5f, 0.7f) to 1.008f,
Pair(5f, 0.8f) to 1.152f,
Pair(5f, 0.9f) to 1.296f,
Pair(5f, 1.0f) to 1.440f,
Pair(5f, 1.1f) to 1.584f,
Pair(5f, 1.2f) to 1.728f,
Pair(5f, 1.3f) to 1.872f,
Pair(5f, 1.4f) to 2.016f,
Pair(5f, 1.5f) to 2.160f,
Pair(5f, 1.6f) to 2.304f,
Pair(5f, 1.7f) to 2.448f,
Pair(5f, 1.8f) to 2.592f,
Pair(5f, 1.9f) to 2.736f,
Pair(5f, 2.0f) to 2.880f,
Pair(5f, 2.1f) to 3.024f,
Pair(5f, 2.2f) to 3.168f,
Pair(5f, 2.3f) to 3.312f,
Pair(5f, 2.4f) to 3.456f,
Pair(5f, 2.5f) to 3.600f,
Pair(5f, 2.6f) to 3.744f,
Pair(5f, 2.7f) to 3.888f,
Pair(5f, 2.8f) to 4.032f,
Pair(5f, 2.9f) to 4.176f,
Pair(5f, 3.0f) to 4.320f,
Pair(5f, 3.2f) to 4.608f,
Pair(5f, 3.4f) to 4.896f,
Pair(5f, 3.6f) to 5.184f,
Pair(5f, 3.8f) to 5.472f,
Pair(5f, 4.0f) to 5.760f,
Pair(5f, 4.2f) to 6.048f,
Pair(5f, 4.4f) to 6.336f,
Pair(5f, 4.6f) to 6.624f,
Pair(5f, 4.8f) to 6.912f,
// Pulse Width = 10f
Pair(10f, 0.4f) to 0.576f,
Pair(10f, 0.5f) to 0.720f,
Pair(10f, 0.6f) to 0.864f,
Pair(10f, 0.7f) to 1.008f,
Pair(10f, 0.8f) to 1.152f,
Pair(10f, 0.9f) to 1.296f,
Pair(10f, 1.0f) to 1.440f,
Pair(10f, 1.1f) to 1.584f,
Pair(10f, 1.2f) to 1.728f,
Pair(10f, 1.3f) to 1.872f,
Pair(10f, 1.4f) to 2.016f,
Pair(10f, 1.5f) to 2.160f,
Pair(10f, 1.6f) to 2.304f,
Pair(10f, 1.7f) to 2.448f,
Pair(10f, 1.8f) to 2.592f,
Pair(10f, 1.9f) to 2.736f,
Pair(10f, 2.0f) to 2.880f,
Pair(10f, 2.1f) to 3.024f,
Pair(10f, 2.2f) to 3.168f,
Pair(10f, 2.3f) to 3.312f,
Pair(10f, 2.4f) to 3.456f,
Pair(10f, 2.5f) to 3.600f,
Pair(10f, 2.6f) to 3.744f,
Pair(10f, 2.7f) to 3.888f,
Pair(10f, 2.8f) to 4.032f,
Pair(10f, 2.9f) to 4.176f,
Pair(10f, 3.0f) to 4.320f,
Pair(10f, 3.2f) to 4.608f,
Pair(10f, 3.4f) to 4.896f,
Pair(10f, 3.6f) to 5.184f,
Pair(10f, 3.8f) to 5.472f,
Pair(10f, 4.0f) to 5.760f,
Pair(10f, 4.2f) to 6.048f,
Pair(10f, 4.4f) to 6.336f,
Pair(10f, 4.6f) to 6.624f,
Pair(10f, 4.8f) to 6.912f,
Pair(10f, 5.0f) to 7.200f,
Pair(10f, 5.5f) to 7.920f,
Pair(10f, 6.0f) to 8.640f,
Pair(10f, 6.5f) to 9.360f,
// Pulse Width = 15f
Pair(15f, 0.4f) to 0.576f,
Pair(15f, 0.5f) to 0.720f,
Pair(15f, 0.6f) to 0.864f,
Pair(15f, 0.7f) to 1.008f,
Pair(15f, 0.8f) to 1.152f,
Pair(15f, 0.9f) to 1.296f,
Pair(15f, 1.0f) to 1.440f,
Pair(15f, 1.1f) to 1.584f,
Pair(15f, 1.2f) to 1.728f,
Pair(15f, 1.3f) to 1.872f,
Pair(15f, 1.4f) to 2.016f,
Pair(15f, 1.5f) to 2.160f,
Pair(15f, 1.6f) to 2.304f,
Pair(15f, 1.7f) to 2.448f,
Pair(15f, 1.8f) to 2.592f,
Pair(15f, 1.9f) to 2.736f,
Pair(15f, 2.0f) to 2.880f,
Pair(15f, 2.1f) to 3.024f,
Pair(15f, 2.2f) to 3.168f,
Pair(15f, 2.3f) to 3.312f,
Pair(15f, 2.4f) to 3.456f,
Pair(15f, 2.5f) to 3.600f,
Pair(15f, 2.6f) to 3.744f,
Pair(15f, 2.7f) to 3.888f,
Pair(15f, 2.8f) to 4.032f,
Pair(15f, 2.9f) to 4.176f,
Pair(15f, 3.0f) to 4.320f,
Pair(15f, 3.2f) to 4.608f,
Pair(15f, 3.4f) to 4.896f,
Pair(15f, 3.6f) to 5.184f,
Pair(15f, 3.8f) to 5.472f,
Pair(15f, 4.0f) to 5.760f,
Pair(15f, 4.2f) to 6.048f,
Pair(15f, 4.4f) to 6.336f,
Pair(15f, 4.6f) to 6.624f,
Pair(15f, 4.8f) to 6.912f,
Pair(15f, 5.0f) to 7.200f,
Pair(15f, 5.5f) to 7.920f,
Pair(15f, 6.0f) to 8.640f,
Pair(15f, 6.5f) to 9.360f,
// Pulse Width = 20f
Pair(20f, 0.4f) to 0.576f,
Pair(20f, 0.5f) to 0.720f,
Pair(20f, 0.6f) to 0.864f,
Pair(20f, 0.7f) to 1.008f,
Pair(20f, 0.8f) to 1.152f,
Pair(20f, 0.9f) to 1.296f,
Pair(20f, 1.0f) to 1.440f,
Pair(20f, 1.1f) to 1.584f,
Pair(20f, 1.2f) to 1.728f,
Pair(20f, 1.3f) to 1.872f,
Pair(20f, 1.4f) to 2.016f,
Pair(20f, 1.5f) to 2.160f,
Pair(20f, 1.6f) to 2.304f,
Pair(20f, 1.7f) to 2.448f,
Pair(20f, 1.8f) to 2.592f,
Pair(20f, 1.9f) to 2.736f,
Pair(20f, 2.0f) to 2.880f,
Pair(20f, 2.1f) to 3.024f,
Pair(20f, 2.2f) to 3.168f,
Pair(20f, 2.3f) to 3.312f,
Pair(20f, 2.4f) to 3.456f,
Pair(20f, 2.5f) to 3.600f,
Pair(20f, 2.6f) to 3.744f,
Pair(20f, 2.7f) to 3.888f,
Pair(20f, 2.8f) to 4.032f,
Pair(20f, 2.9f) to 4.176f,
Pair(20f, 3.0f) to 4.320f,
Pair(20f, 3.2f) to 4.608f,
Pair(20f, 3.4f) to 4.896f,
Pair(20f, 3.6f) to 5.184f,
Pair(20f, 3.8f) to 5.472f,
Pair(20f, 4.0f) to 5.760f,
Pair(20f, 4.2f) to 6.048f,
Pair(20f, 4.4f) to 6.336f,
Pair(20f, 4.6f) to 6.624f,
Pair(20f, 4.8f) to 6.912f,
Pair(20f, 5.0f) to 7.200f,
Pair(20f, 5.5f) to 7.920f,
Pair(20f, 6.0f) to 8.640f,
Pair(20f, 6.5f) to 9.360f,
// Pulse Width = 25f
Pair(25f, 0.4f) to 0.576f,
Pair(25f, 0.5f) to 0.720f,
Pair(25f, 0.6f) to 0.864f,
Pair(25f, 0.7f) to 1.008f,
Pair(25f, 0.8f) to 1.152f,
Pair(25f, 0.9f) to 1.296f,
Pair(25f, 1.0f) to 1.440f,
Pair(25f, 1.1f) to 1.584f,
Pair(25f, 1.2f) to 1.728f,
Pair(25f, 1.3f) to 1.872f,
Pair(25f, 1.4f) to 2.016f,
Pair(25f, 1.5f) to 2.160f,
Pair(25f, 1.6f) to 2.304f,
Pair(25f, 1.7f) to 2.448f,
Pair(25f, 1.8f) to 2.592f,
Pair(25f, 1.9f) to 2.736f,
Pair(25f, 2.0f) to 2.880f,
Pair(25f, 2.1f) to 3.024f,
Pair(25f, 2.2f) to 3.168f,
Pair(25f, 2.3f) to 3.312f,
Pair(25f, 2.4f) to 3.456f,
Pair(25f, 2.5f) to 3.600f,
Pair(25f, 2.6f) to 3.744f,
Pair(25f, 2.7f) to 3.888f,
Pair(25f, 2.8f) to 4.032f,
Pair(25f, 2.9f) to 4.176f,
Pair(25f, 3.0f) to 4.320f,
Pair(25f, 3.2f) to 4.608f,
Pair(25f, 3.4f) to 4.896f,
Pair(25f, 3.6f) to 5.184f,
Pair(25f, 3.8f) to 5.472f,
Pair(25f, 4.0f) to 5.760f,
Pair(25f, 4.2f) to 6.048f,
Pair(25f, 4.4f) to 6.336f,
Pair(25f, 4.6f) to 6.624f,
Pair(25f, 4.8f) to 6.912f,
Pair(25f, 5.0f) to 7.200f,
Pair(25f, 5.5f) to 7.920f,
Pair(25f, 6.0f) to 8.640f,
Pair(25f, 6.5f) to 9.360f,
// Pulse Width = 30f
Pair(30f, 0.4f) to 0.576f,
Pair(30f, 0.5f) to 0.720f,
Pair(30f, 0.6f) to 0.864f,
Pair(30f, 0.7f) to 1.008f,
Pair(30f, 0.8f) to 1.152f,
Pair(30f, 0.9f) to 1.296f,
Pair(30f, 1.0f) to 1.440f,
Pair(30f, 1.1f) to 1.584f,
Pair(30f, 1.2f) to 1.728f,
Pair(30f, 1.3f) to 1.872f,
Pair(30f, 1.4f) to 2.016f,
Pair(30f, 1.5f) to 2.160f,
Pair(30f, 1.6f) to 2.304f,
Pair(30f, 1.7f) to 2.448f,
Pair(30f, 1.8f) to 2.592f,
Pair(30f, 1.9f) to 2.736f,
Pair(30f, 2.0f) to 2.880f,
Pair(30f, 2.1f) to 3.024f,
Pair(30f, 2.2f) to 3.168f,
Pair(30f, 2.3f) to 3.312f,
Pair(30f, 2.4f) to 3.456f,
Pair(30f, 2.5f) to 3.600f,
Pair(30f, 2.6f) to 3.744f,
Pair(30f, 2.7f) to 3.888f,
Pair(30f, 2.8f) to 4.032f,
Pair(30f, 2.9f) to 4.176f,
Pair(30f, 3.0f) to 4.320f,
Pair(30f, 3.2f) to 4.608f,
Pair(30f, 3.4f) to 4.896f,
Pair(30f, 3.6f) to 5.184f,
Pair(30f, 3.8f) to 5.472f,
Pair(30f, 4.0f) to 5.760f,
Pair(30f, 4.2f) to 6.048f,
Pair(30f, 4.4f) to 6.336f,
Pair(30f, 4.6f) to 6.624f,
Pair(30f, 4.8f) to 6.912f,
Pair(30f, 5.0f) to 7.200f,
Pair(30f, 5.5f) to 7.920f,
Pair(30f, 6.0f) to 8.640f,
Pair(30f, 6.5f) to 9.360f,
// Pulse Width = 35f
Pair(35f, 0.4f) to 0.576f,
Pair(35f, 0.5f) to 0.720f,
Pair(35f, 0.6f) to 0.864f,
Pair(35f, 0.7f) to 1.008f,
Pair(35f, 0.8f) to 1.152f,
Pair(35f, 0.9f) to 1.296f,
Pair(35f, 1.0f) to 1.440f,
Pair(35f, 1.1f) to 1.584f,
Pair(35f, 1.2f) to 1.728f,
Pair(35f, 1.3f) to 1.872f,
Pair(35f, 1.4f) to 2.016f,
Pair(35f, 1.5f) to 2.160f,
Pair(35f, 1.6f) to 2.304f,
Pair(35f, 1.7f) to 2.448f,
Pair(35f, 1.8f) to 2.592f,
Pair(35f, 1.9f) to 2.736f,
Pair(35f, 2.0f) to 2.880f,
Pair(35f, 2.1f) to 3.024f,
Pair(35f, 2.2f) to 3.168f,
Pair(35f, 2.3f) to 3.312f,
Pair(35f, 2.4f) to 3.456f,
Pair(35f, 2.5f) to 3.600f,
Pair(35f, 2.6f) to 3.744f,
Pair(35f, 2.7f) to 3.888f,
Pair(35f, 2.8f) to 4.032f,
Pair(35f, 2.9f) to 4.176f,
Pair(35f, 3.0f) to 4.320f,
Pair(35f, 3.2f) to 4.608f,
Pair(35f, 3.4f) to 4.896f,
Pair(35f, 3.6f) to 5.184f,
Pair(35f, 3.8f) to 5.472f,
Pair(35f, 4.0f) to 5.760f,
Pair(35f, 4.2f) to 6.048f,
Pair(35f, 4.4f) to 6.336f,
Pair(35f, 4.6f) to 6.624f,
Pair(35f, 4.8f) to 6.912f,
Pair(35f, 5.0f) to 7.200f,
Pair(35f, 5.5f) to 7.920f,
Pair(35f, 6.0f) to 8.640f,
Pair(35f, 6.5f) to 9.360f,
// Pulse Width = 40f
Pair(40f, 0.4f) to 0.576f,
Pair(40f, 0.5f) to 0.720f,
Pair(40f, 0.6f) to 0.864f,
Pair(40f, 0.7f) to 1.008f,
Pair(40f, 0.8f) to 1.152f,
Pair(40f, 0.9f) to 1.296f,
Pair(40f, 1.0f) to 1.440f,
Pair(40f, 1.1f) to 1.584f,
Pair(40f, 1.2f) to 1.728f,
Pair(40f, 1.3f) to 1.872f,
Pair(40f, 1.4f) to 2.016f,
Pair(40f, 1.5f) to 2.160f,
Pair(40f, 1.6f) to 2.304f,
Pair(40f, 1.7f) to 2.448f,
Pair(40f, 1.8f) to 2.592f,
Pair(40f, 1.9f) to 2.736f,
Pair(40f, 2.0f) to 2.880f,
Pair(40f, 2.1f) to 3.024f,
Pair(40f, 2.2f) to 3.168f,
Pair(40f, 2.3f) to 3.312f,
Pair(40f, 2.4f) to 3.456f,
Pair(40f, 2.5f) to 3.600f,
Pair(40f, 2.6f) to 3.744f,
Pair(40f, 2.7f) to 3.888f,
Pair(40f, 2.8f) to 4.032f,
Pair(40f, 2.9f) to 4.176f,
Pair(40f, 3.0f) to 4.320f,
Pair(40f, 3.2f) to 4.608f,
Pair(40f, 3.4f) to 4.896f,
Pair(40f, 3.6f) to 5.184f,
Pair(40f, 3.8f) to 5.472f,
Pair(40f, 4.0f) to 5.760f,
Pair(40f, 4.2f) to 6.048f,
Pair(40f, 4.4f) to 6.336f,
Pair(40f, 4.6f) to 6.624f,
Pair(40f, 4.8f) to 6.912f,
Pair(40f, 5.0f) to 7.200f,
Pair(40f, 5.5f) to 7.920f,
Pair(40f, 6.0f) to 8.640f,
Pair(40f, 6.5f) to 9.360f,
)

View File

@@ -0,0 +1,572 @@
package com.laseroptek.raman.const
//
// Energy Table5 (HANDPIENCE-3x15)
// - Map<Pair<Float, Float>, Float>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Fluence(J/cm²)>, Energy(J)>
//
val EnergyTable_3_15 = mapOf(
// Pulse Width = 0.5f
Pair(0.5f, 1.2f) to 0.540f,
Pair(0.5f, 1.3f) to 0.585f,
Pair(0.5f, 1.4f) to 0.630f,
Pair(0.5f, 1.5f) to 0.675f,
Pair(0.5f, 1.6f) to 0.720f,
Pair(0.5f, 1.7f) to 0.765f,
Pair(0.5f, 1.8f) to 0.810f,
Pair(0.5f, 1.9f) to 0.855f,
Pair(0.5f, 2.0f) to 0.900f,
Pair(0.5f, 2.1f) to 0.945f,
Pair(0.5f, 2.2f) to 0.990f,
Pair(0.5f, 2.3f) to 1.035f,
Pair(0.5f, 2.4f) to 1.080f,
Pair(0.5f, 2.5f) to 1.125f,
Pair(0.5f, 2.6f) to 1.170f,
Pair(0.5f, 2.7f) to 1.215f,
Pair(0.5f, 2.8f) to 1.260f,
Pair(0.5f, 2.9f) to 1.305f,
Pair(0.5f, 3.0f) to 1.350f,
Pair(0.5f, 3.2f) to 1.440f,
Pair(0.5f, 3.4f) to 1.530f,
Pair(0.5f, 3.6f) to 1.620f,
Pair(0.5f, 3.8f) to 1.710f,
Pair(0.5f, 4.0f) to 1.800f,
Pair(0.5f, 4.2f) to 1.890f,
Pair(0.5f, 4.4f) to 1.980f,
// Pulse Width = 1f
Pair(1f, 1.2f) to 0.540f,
Pair(1f, 1.3f) to 0.585f,
Pair(1f, 1.4f) to 0.630f,
Pair(1f, 1.5f) to 0.675f,
Pair(1f, 1.6f) to 0.720f,
Pair(1f, 1.7f) to 0.765f,
Pair(1f, 1.8f) to 0.810f,
Pair(1f, 1.9f) to 0.855f,
Pair(1f, 2.0f) to 0.900f,
Pair(1f, 2.1f) to 0.945f,
Pair(1f, 2.2f) to 0.990f,
Pair(1f, 2.3f) to 1.035f,
Pair(1f, 2.4f) to 1.080f,
Pair(1f, 2.5f) to 1.125f,
Pair(1f, 2.6f) to 1.170f,
Pair(1f, 2.7f) to 1.215f,
Pair(1f, 2.8f) to 1.260f,
Pair(1f, 2.9f) to 1.305f,
Pair(1f, 3.0f) to 1.350f,
Pair(1f, 3.2f) to 1.440f,
Pair(1f, 3.4f) to 1.530f,
Pair(1f, 3.6f) to 1.620f,
Pair(1f, 3.8f) to 1.710f,
Pair(1f, 4.0f) to 1.800f,
Pair(1f, 4.2f) to 1.890f,
Pair(1f, 4.4f) to 1.980f,
Pair(1f, 4.6f) to 2.070f,
Pair(1f, 4.8f) to 2.160f,
Pair(1f, 5.0f) to 2.250f,
Pair(1f, 5.5f) to 2.475f,
Pair(1f, 6.0f) to 2.700f,
Pair(1f, 6.5f) to 2.925f,
// Pulse Width = 1.5f
Pair(1.5f, 1.2f) to 0.540f,
Pair(1.5f, 1.3f) to 0.585f,
Pair(1.5f, 1.4f) to 0.630f,
Pair(1.5f, 1.5f) to 0.675f,
Pair(1.5f, 1.6f) to 0.720f,
Pair(1.5f, 1.7f) to 0.765f,
Pair(1.5f, 1.8f) to 0.810f,
Pair(1.5f, 1.9f) to 0.855f,
Pair(1.5f, 2.0f) to 0.900f,
Pair(1.5f, 2.1f) to 0.945f,
Pair(1.5f, 2.2f) to 0.990f,
Pair(1.5f, 2.3f) to 1.035f,
Pair(1.5f, 2.4f) to 1.080f,
Pair(1.5f, 2.5f) to 1.125f,
Pair(1.5f, 2.6f) to 1.170f,
Pair(1.5f, 2.7f) to 1.215f,
Pair(1.5f, 2.8f) to 1.260f,
Pair(1.5f, 2.9f) to 1.305f,
Pair(1.5f, 3.0f) to 1.350f,
Pair(1.5f, 3.2f) to 1.440f,
Pair(1.5f, 3.4f) to 1.530f,
Pair(1.5f, 3.6f) to 1.620f,
Pair(1.5f, 3.8f) to 1.710f,
Pair(1.5f, 4.0f) to 1.800f,
Pair(1.5f, 4.2f) to 1.890f,
Pair(1.5f, 4.4f) to 1.980f,
Pair(1.5f, 4.6f) to 2.070f,
Pair(1.5f, 4.8f) to 2.160f,
Pair(1.5f, 5.0f) to 2.250f,
Pair(1.5f, 5.5f) to 2.475f,
Pair(1.5f, 6.0f) to 2.700f,
Pair(1.5f, 6.5f) to 2.925f,
Pair(1.5f, 7.0f) to 3.150f,
Pair(1.5f, 7.5f) to 3.375f,
Pair(1.5f, 8.0f) to 3.600f,
Pair(1.5f, 8.5f) to 3.825f,
// Pulse Width = 3f
Pair(3f, 1.2f) to 0.540f,
Pair(3f, 1.3f) to 0.585f,
Pair(3f, 1.4f) to 0.630f,
Pair(3f, 1.5f) to 0.675f,
Pair(3f, 1.6f) to 0.720f,
Pair(3f, 1.7f) to 0.765f,
Pair(3f, 1.8f) to 0.810f,
Pair(3f, 1.9f) to 0.855f,
Pair(3f, 2.0f) to 0.900f,
Pair(3f, 2.1f) to 0.945f,
Pair(3f, 2.2f) to 0.990f,
Pair(3f, 2.3f) to 1.035f,
Pair(3f, 2.4f) to 1.080f,
Pair(3f, 2.5f) to 1.125f,
Pair(3f, 2.6f) to 1.170f,
Pair(3f, 2.7f) to 1.215f,
Pair(3f, 2.8f) to 1.260f,
Pair(3f, 2.9f) to 1.305f,
Pair(3f, 3.0f) to 1.350f,
Pair(3f, 3.2f) to 1.440f,
Pair(3f, 3.4f) to 1.530f,
Pair(3f, 3.6f) to 1.620f,
Pair(3f, 3.8f) to 1.710f,
Pair(3f, 4.0f) to 1.800f,
Pair(3f, 4.2f) to 1.890f,
Pair(3f, 4.4f) to 1.980f,
Pair(3f, 4.6f) to 2.070f,
Pair(3f, 4.8f) to 2.160f,
Pair(3f, 5.0f) to 2.250f,
Pair(3f, 5.5f) to 2.475f,
Pair(3f, 6.0f) to 2.700f,
Pair(3f, 6.5f) to 2.925f,
Pair(3f, 7.0f) to 3.150f,
Pair(3f, 7.5f) to 3.375f,
Pair(3f, 8.0f) to 3.600f,
Pair(3f, 8.5f) to 3.825f,
Pair(3f, 9.0f) to 4.050f,
Pair(3f, 9.5f) to 4.275f,
Pair(3f, 10.0f) to 4.500f,
Pair(3f, 11.0f) to 4.950f,
Pair(3f, 12.0f) to 5.400f,
Pair(3f, 13.0f) to 5.850f,
// Pulse Width = 5f
Pair(5f, 1.2f) to 0.540f,
Pair(5f, 1.3f) to 0.585f,
Pair(5f, 1.4f) to 0.630f,
Pair(5f, 1.5f) to 0.675f,
Pair(5f, 1.6f) to 0.720f,
Pair(5f, 1.7f) to 0.765f,
Pair(5f, 1.8f) to 0.810f,
Pair(5f, 1.9f) to 0.855f,
Pair(5f, 2.0f) to 0.900f,
Pair(5f, 2.1f) to 0.945f,
Pair(5f, 2.2f) to 0.990f,
Pair(5f, 2.3f) to 1.035f,
Pair(5f, 2.4f) to 1.080f,
Pair(5f, 2.5f) to 1.125f,
Pair(5f, 2.6f) to 1.170f,
Pair(5f, 2.7f) to 1.215f,
Pair(5f, 2.8f) to 1.260f,
Pair(5f, 2.9f) to 1.305f,
Pair(5f, 3.0f) to 1.350f,
Pair(5f, 3.2f) to 1.440f,
Pair(5f, 3.4f) to 1.530f,
Pair(5f, 3.6f) to 1.620f,
Pair(5f, 3.8f) to 1.710f,
Pair(5f, 4.0f) to 1.800f,
Pair(5f, 4.2f) to 1.890f,
Pair(5f, 4.4f) to 1.980f,
Pair(5f, 4.6f) to 2.070f,
Pair(5f, 4.8f) to 2.160f,
Pair(5f, 5.0f) to 2.250f,
Pair(5f, 5.5f) to 2.475f,
Pair(5f, 6.0f) to 2.700f,
Pair(5f, 6.5f) to 2.925f,
Pair(5f, 7.0f) to 3.150f,
Pair(5f, 7.5f) to 3.375f,
Pair(5f, 8.0f) to 3.600f,
Pair(5f, 8.5f) to 3.825f,
Pair(5f, 9.0f) to 4.050f,
Pair(5f, 9.5f) to 4.275f,
Pair(5f, 10.0f) to 4.500f,
Pair(5f, 11.0f) to 4.950f,
Pair(5f, 12.0f) to 5.400f,
Pair(5f, 13.0f) to 5.850f,
Pair(5f, 14.0f) to 6.300f,
Pair(5f, 15.0f) to 6.750f,
// Pulse Width = 10f
Pair(10f, 1.2f) to 0.540f,
Pair(10f, 1.3f) to 0.585f,
Pair(10f, 1.4f) to 0.630f,
Pair(10f, 1.5f) to 0.675f,
Pair(10f, 1.6f) to 0.720f,
Pair(10f, 1.7f) to 0.765f,
Pair(10f, 1.8f) to 0.810f,
Pair(10f, 1.9f) to 0.855f,
Pair(10f, 2.0f) to 0.900f,
Pair(10f, 2.1f) to 0.945f,
Pair(10f, 2.2f) to 0.990f,
Pair(10f, 2.3f) to 1.035f,
Pair(10f, 2.4f) to 1.080f,
Pair(10f, 2.5f) to 1.125f,
Pair(10f, 2.6f) to 1.170f,
Pair(10f, 2.7f) to 1.215f,
Pair(10f, 2.8f) to 1.260f,
Pair(10f, 2.9f) to 1.305f,
Pair(10f, 3.0f) to 1.350f,
Pair(10f, 3.2f) to 1.440f,
Pair(10f, 3.4f) to 1.530f,
Pair(10f, 3.6f) to 1.620f,
Pair(10f, 3.8f) to 1.710f,
Pair(10f, 4.0f) to 1.800f,
Pair(10f, 4.2f) to 1.890f,
Pair(10f, 4.4f) to 1.980f,
Pair(10f, 4.6f) to 2.070f,
Pair(10f, 4.8f) to 2.160f,
Pair(10f, 5.0f) to 2.250f,
Pair(10f, 5.5f) to 2.475f,
Pair(10f, 6.0f) to 2.700f,
Pair(10f, 6.5f) to 2.925f,
Pair(10f, 7.0f) to 3.150f,
Pair(10f, 7.5f) to 3.375f,
Pair(10f, 8.0f) to 3.600f,
Pair(10f, 8.5f) to 3.825f,
Pair(10f, 9.0f) to 4.050f,
Pair(10f, 9.5f) to 4.275f,
Pair(10f, 10.0f) to 4.500f,
Pair(10f, 11.0f) to 4.950f,
Pair(10f, 12.0f) to 5.400f,
Pair(10f, 13.0f) to 5.850f,
Pair(10f, 14.0f) to 6.300f,
Pair(10f, 15.0f) to 6.750f,
Pair(10f, 16.0f) to 7.200f,
Pair(10f, 17.0f) to 7.650f,
Pair(10f, 18.0f) to 8.100f,
Pair(10f, 19.0f) to 8.550f,
Pair(10f, 20.0f) to 9.000f,
Pair(10f, 21.0f) to 9.450f,
Pair(10f, 22.0f) to 9.900f,
// Pulse Width = 15f
Pair(15f, 1.2f) to 0.540f,
Pair(15f, 1.3f) to 0.585f,
Pair(15f, 1.4f) to 0.630f,
Pair(15f, 1.5f) to 0.675f,
Pair(15f, 1.6f) to 0.720f,
Pair(15f, 1.7f) to 0.765f,
Pair(15f, 1.8f) to 0.810f,
Pair(15f, 1.9f) to 0.855f,
Pair(15f, 2.0f) to 0.900f,
Pair(15f, 2.1f) to 0.945f,
Pair(15f, 2.2f) to 0.990f,
Pair(15f, 2.3f) to 1.035f,
Pair(15f, 2.4f) to 1.080f,
Pair(15f, 2.5f) to 1.125f,
Pair(15f, 2.6f) to 1.170f,
Pair(15f, 2.7f) to 1.215f,
Pair(15f, 2.8f) to 1.260f,
Pair(15f, 2.9f) to 1.305f,
Pair(15f, 3.0f) to 1.350f,
Pair(15f, 3.2f) to 1.440f,
Pair(15f, 3.4f) to 1.530f,
Pair(15f, 3.6f) to 1.620f,
Pair(15f, 3.8f) to 1.710f,
Pair(15f, 4.0f) to 1.800f,
Pair(15f, 4.2f) to 1.890f,
Pair(15f, 4.4f) to 1.980f,
Pair(15f, 4.6f) to 2.070f,
Pair(15f, 4.8f) to 2.160f,
Pair(15f, 5.0f) to 2.250f,
Pair(15f, 5.5f) to 2.475f,
Pair(15f, 6.0f) to 2.700f,
Pair(15f, 6.5f) to 2.925f,
Pair(15f, 7.0f) to 3.150f,
Pair(15f, 7.5f) to 3.375f,
Pair(15f, 8.0f) to 3.600f,
Pair(15f, 8.5f) to 3.825f,
Pair(15f, 9.0f) to 4.050f,
Pair(15f, 9.5f) to 4.275f,
Pair(15f, 10.0f) to 4.500f,
Pair(15f, 11.0f) to 4.950f,
Pair(15f, 12.0f) to 5.400f,
Pair(15f, 13.0f) to 5.850f,
Pair(15f, 14.0f) to 6.300f,
Pair(15f, 15.0f) to 6.750f,
Pair(15f, 16.0f) to 7.200f,
Pair(15f, 17.0f) to 7.650f,
Pair(15f, 18.0f) to 8.100f,
Pair(15f, 19.0f) to 8.550f,
Pair(15f, 20.0f) to 9.000f,
Pair(15f, 21.0f) to 9.450f,
Pair(15f, 22.0f) to 9.900f,
// Pulse Width = 20f
Pair(20f, 1.2f) to 0.540f,
Pair(20f, 1.3f) to 0.585f,
Pair(20f, 1.4f) to 0.630f,
Pair(20f, 1.5f) to 0.675f,
Pair(20f, 1.6f) to 0.720f,
Pair(20f, 1.7f) to 0.765f,
Pair(20f, 1.8f) to 0.810f,
Pair(20f, 1.9f) to 0.855f,
Pair(20f, 2.0f) to 0.900f,
Pair(20f, 2.1f) to 0.945f,
Pair(20f, 2.2f) to 0.990f,
Pair(20f, 2.3f) to 1.035f,
Pair(20f, 2.4f) to 1.080f,
Pair(20f, 2.5f) to 1.125f,
Pair(20f, 2.6f) to 1.170f,
Pair(20f, 2.7f) to 1.215f,
Pair(20f, 2.8f) to 1.260f,
Pair(20f, 2.9f) to 1.305f,
Pair(20f, 3.0f) to 1.350f,
Pair(20f, 3.2f) to 1.440f,
Pair(20f, 3.4f) to 1.530f,
Pair(20f, 3.6f) to 1.620f,
Pair(20f, 3.8f) to 1.710f,
Pair(20f, 4.0f) to 1.800f,
Pair(20f, 4.2f) to 1.890f,
Pair(20f, 4.4f) to 1.980f,
Pair(20f, 4.6f) to 2.070f,
Pair(20f, 4.8f) to 2.160f,
Pair(20f, 5.0f) to 2.250f,
Pair(20f, 5.5f) to 2.475f,
Pair(20f, 6.0f) to 2.700f,
Pair(20f, 6.5f) to 2.925f,
Pair(20f, 7.0f) to 3.150f,
Pair(20f, 7.5f) to 3.375f,
Pair(20f, 8.0f) to 3.600f,
Pair(20f, 8.5f) to 3.825f,
Pair(20f, 9.0f) to 4.050f,
Pair(20f, 9.5f) to 4.275f,
Pair(20f, 10.0f) to 4.500f,
Pair(20f, 11.0f) to 4.950f,
Pair(20f, 12.0f) to 5.400f,
Pair(20f, 13.0f) to 5.850f,
Pair(20f, 14.0f) to 6.300f,
Pair(20f, 15.0f) to 6.750f,
Pair(20f, 16.0f) to 7.200f,
Pair(20f, 17.0f) to 7.650f,
Pair(20f, 18.0f) to 8.100f,
Pair(20f, 19.0f) to 8.550f,
Pair(20f, 20.0f) to 9.000f,
Pair(20f, 21.0f) to 9.450f,
Pair(20f, 22.0f) to 9.900f,
// Pulse Width = 25f
Pair(25f, 1.2f) to 0.540f,
Pair(25f, 1.3f) to 0.585f,
Pair(25f, 1.4f) to 0.630f,
Pair(25f, 1.5f) to 0.675f,
Pair(25f, 1.6f) to 0.720f,
Pair(25f, 1.7f) to 0.765f,
Pair(25f, 1.8f) to 0.810f,
Pair(25f, 1.9f) to 0.855f,
Pair(25f, 2.0f) to 0.900f,
Pair(25f, 2.1f) to 0.945f,
Pair(25f, 2.2f) to 0.990f,
Pair(25f, 2.3f) to 1.035f,
Pair(25f, 2.4f) to 1.080f,
Pair(25f, 2.5f) to 1.125f,
Pair(25f, 2.6f) to 1.170f,
Pair(25f, 2.7f) to 1.215f,
Pair(25f, 2.8f) to 1.260f,
Pair(25f, 2.9f) to 1.305f,
Pair(25f, 3.0f) to 1.350f,
Pair(25f, 3.2f) to 1.440f,
Pair(25f, 3.4f) to 1.530f,
Pair(25f, 3.6f) to 1.620f,
Pair(25f, 3.8f) to 1.710f,
Pair(25f, 4.0f) to 1.800f,
Pair(25f, 4.2f) to 1.890f,
Pair(25f, 4.4f) to 1.980f,
Pair(25f, 4.6f) to 2.070f,
Pair(25f, 4.8f) to 2.160f,
Pair(25f, 5.0f) to 2.250f,
Pair(25f, 5.5f) to 2.475f,
Pair(25f, 6.0f) to 2.700f,
Pair(25f, 6.5f) to 2.925f,
Pair(25f, 7.0f) to 3.150f,
Pair(25f, 7.5f) to 3.375f,
Pair(25f, 8.0f) to 3.600f,
Pair(25f, 8.5f) to 3.825f,
Pair(25f, 9.0f) to 4.050f,
Pair(25f, 9.5f) to 4.275f,
Pair(25f, 10.0f) to 4.500f,
Pair(25f, 11.0f) to 4.950f,
Pair(25f, 12.0f) to 5.400f,
Pair(25f, 13.0f) to 5.850f,
Pair(25f, 14.0f) to 6.300f,
Pair(25f, 15.0f) to 6.750f,
Pair(25f, 16.0f) to 7.200f,
Pair(25f, 17.0f) to 7.650f,
Pair(25f, 18.0f) to 8.100f,
Pair(25f, 19.0f) to 8.550f,
Pair(25f, 20.0f) to 9.000f,
Pair(25f, 21.0f) to 9.450f,
Pair(25f, 22.0f) to 9.900f,
// Pulse Width = 30f
Pair(30f, 1.2f) to 0.540f,
Pair(30f, 1.3f) to 0.585f,
Pair(30f, 1.4f) to 0.630f,
Pair(30f, 1.5f) to 0.675f,
Pair(30f, 1.6f) to 0.720f,
Pair(30f, 1.7f) to 0.765f,
Pair(30f, 1.8f) to 0.810f,
Pair(30f, 1.9f) to 0.855f,
Pair(30f, 2.0f) to 0.900f,
Pair(30f, 2.1f) to 0.945f,
Pair(30f, 2.2f) to 0.990f,
Pair(30f, 2.3f) to 1.035f,
Pair(30f, 2.4f) to 1.080f,
Pair(30f, 2.5f) to 1.125f,
Pair(30f, 2.6f) to 1.170f,
Pair(30f, 2.7f) to 1.215f,
Pair(30f, 2.8f) to 1.260f,
Pair(30f, 2.9f) to 1.305f,
Pair(30f, 3.0f) to 1.350f,
Pair(30f, 3.2f) to 1.440f,
Pair(30f, 3.4f) to 1.530f,
Pair(30f, 3.6f) to 1.620f,
Pair(30f, 3.8f) to 1.710f,
Pair(30f, 4.0f) to 1.800f,
Pair(30f, 4.2f) to 1.890f,
Pair(30f, 4.4f) to 1.980f,
Pair(30f, 4.6f) to 2.070f,
Pair(30f, 4.8f) to 2.160f,
Pair(30f, 5.0f) to 2.250f,
Pair(30f, 5.5f) to 2.475f,
Pair(30f, 6.0f) to 2.700f,
Pair(30f, 6.5f) to 2.925f,
Pair(30f, 7.0f) to 3.150f,
Pair(30f, 7.5f) to 3.375f,
Pair(30f, 8.0f) to 3.600f,
Pair(30f, 8.5f) to 3.825f,
Pair(30f, 9.0f) to 4.050f,
Pair(30f, 9.5f) to 4.275f,
Pair(30f, 10.0f) to 4.500f,
Pair(30f, 11.0f) to 4.950f,
Pair(30f, 12.0f) to 5.400f,
Pair(30f, 13.0f) to 5.850f,
Pair(30f, 14.0f) to 6.300f,
Pair(30f, 15.0f) to 6.750f,
Pair(30f, 16.0f) to 7.200f,
Pair(30f, 17.0f) to 7.650f,
Pair(30f, 18.0f) to 8.100f,
Pair(30f, 19.0f) to 8.550f,
Pair(30f, 20.0f) to 9.000f,
Pair(30f, 21.0f) to 9.450f,
Pair(30f, 22.0f) to 9.900f,
// Pulse Width = 35f
Pair(35f, 1.2f) to 0.540f,
Pair(35f, 1.3f) to 0.585f,
Pair(35f, 1.4f) to 0.630f,
Pair(35f, 1.5f) to 0.675f,
Pair(35f, 1.6f) to 0.720f,
Pair(35f, 1.7f) to 0.765f,
Pair(35f, 1.8f) to 0.810f,
Pair(35f, 1.9f) to 0.855f,
Pair(35f, 2.0f) to 0.900f,
Pair(35f, 2.1f) to 0.945f,
Pair(35f, 2.2f) to 0.990f,
Pair(35f, 2.3f) to 1.035f,
Pair(35f, 2.4f) to 1.080f,
Pair(35f, 2.5f) to 1.125f,
Pair(35f, 2.6f) to 1.170f,
Pair(35f, 2.7f) to 1.215f,
Pair(35f, 2.8f) to 1.260f,
Pair(35f, 2.9f) to 1.305f,
Pair(35f, 3.0f) to 1.350f,
Pair(35f, 3.2f) to 1.440f,
Pair(35f, 3.4f) to 1.530f,
Pair(35f, 3.6f) to 1.620f,
Pair(35f, 3.8f) to 1.710f,
Pair(35f, 4.0f) to 1.800f,
Pair(35f, 4.2f) to 1.890f,
Pair(35f, 4.4f) to 1.980f,
Pair(35f, 4.6f) to 2.070f,
Pair(35f, 4.8f) to 2.160f,
Pair(35f, 5.0f) to 2.250f,
Pair(35f, 5.5f) to 2.475f,
Pair(35f, 6.0f) to 2.700f,
Pair(35f, 6.5f) to 2.925f,
Pair(35f, 7.0f) to 3.150f,
Pair(35f, 7.5f) to 3.375f,
Pair(35f, 8.0f) to 3.600f,
Pair(35f, 8.5f) to 3.825f,
Pair(35f, 9.0f) to 4.050f,
Pair(35f, 9.5f) to 4.275f,
Pair(35f, 10.0f) to 4.500f,
Pair(35f, 11.0f) to 4.950f,
Pair(35f, 12.0f) to 5.400f,
Pair(35f, 13.0f) to 5.850f,
Pair(35f, 14.0f) to 6.300f,
Pair(35f, 15.0f) to 6.750f,
Pair(35f, 16.0f) to 7.200f,
Pair(35f, 17.0f) to 7.650f,
Pair(35f, 18.0f) to 8.100f,
Pair(35f, 19.0f) to 8.550f,
Pair(35f, 20.0f) to 9.000f,
Pair(35f, 21.0f) to 9.450f,
Pair(35f, 22.0f) to 9.900f,
// Pulse Width = 40f
Pair(40f, 1.2f) to 0.540f,
Pair(40f, 1.3f) to 0.585f,
Pair(40f, 1.4f) to 0.630f,
Pair(40f, 1.5f) to 0.675f,
Pair(40f, 1.6f) to 0.720f,
Pair(40f, 1.7f) to 0.765f,
Pair(40f, 1.8f) to 0.810f,
Pair(40f, 1.9f) to 0.855f,
Pair(40f, 2.0f) to 0.900f,
Pair(40f, 2.1f) to 0.945f,
Pair(40f, 2.2f) to 0.990f,
Pair(40f, 2.3f) to 1.035f,
Pair(40f, 2.4f) to 1.080f,
Pair(40f, 2.5f) to 1.125f,
Pair(40f, 2.6f) to 1.170f,
Pair(40f, 2.7f) to 1.215f,
Pair(40f, 2.8f) to 1.260f,
Pair(40f, 2.9f) to 1.305f,
Pair(40f, 3.0f) to 1.350f,
Pair(40f, 3.2f) to 1.440f,
Pair(40f, 3.4f) to 1.530f,
Pair(40f, 3.6f) to 1.620f,
Pair(40f, 3.8f) to 1.710f,
Pair(40f, 4.0f) to 1.800f,
Pair(40f, 4.2f) to 1.890f,
Pair(40f, 4.4f) to 1.980f,
Pair(40f, 4.6f) to 2.070f,
Pair(40f, 4.8f) to 2.160f,
Pair(40f, 5.0f) to 2.250f,
Pair(40f, 5.5f) to 2.475f,
Pair(40f, 6.0f) to 2.700f,
Pair(40f, 6.5f) to 2.925f,
Pair(40f, 7.0f) to 3.150f,
Pair(40f, 7.5f) to 3.375f,
Pair(40f, 8.0f) to 3.600f,
Pair(40f, 8.5f) to 3.825f,
Pair(40f, 9.0f) to 4.050f,
Pair(40f, 9.5f) to 4.275f,
Pair(40f, 10.0f) to 4.500f,
Pair(40f, 11.0f) to 4.950f,
Pair(40f, 12.0f) to 5.400f,
Pair(40f, 13.0f) to 5.850f,
Pair(40f, 14.0f) to 6.300f,
Pair(40f, 15.0f) to 6.750f,
Pair(40f, 16.0f) to 7.200f,
Pair(40f, 17.0f) to 7.650f,
Pair(40f, 18.0f) to 8.100f,
Pair(40f, 19.0f) to 8.550f,
Pair(40f, 20.0f) to 9.000f,
Pair(40f, 21.0f) to 9.450f,
Pair(40f, 22.0f) to 9.900f,
)

View File

@@ -0,0 +1,563 @@
package com.laseroptek.raman.const
//
// Energy Table2 (HANDPIENCE-7x7)
// - Map<Pair<Float, Float>, Float>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Fluence(J/cm²)>, Energy(J)>
//
val EnergyTable_7_7 = mapOf(
// Pulse Width = 0.5f
Pair(0.5f, 1.1f) to 0.539f,
Pair(0.5f, 1.2f) to 0.588f,
Pair(0.5f, 1.3f) to 0.637f,
Pair(0.5f, 1.4f) to 0.686f,
Pair(0.5f, 1.5f) to 0.735f,
Pair(0.5f, 1.6f) to 0.784f,
Pair(0.5f, 1.7f) to 0.833f,
Pair(0.5f, 1.8f) to 0.882f,
Pair(0.5f, 1.9f) to 0.931f,
Pair(0.5f, 2.0f) to 0.980f,
Pair(0.5f, 2.1f) to 1.029f,
Pair(0.5f, 2.2f) to 1.078f,
Pair(0.5f, 2.3f) to 1.127f,
Pair(0.5f, 2.4f) to 1.176f,
Pair(0.5f, 2.5f) to 1.225f,
Pair(0.5f, 2.6f) to 1.274f,
Pair(0.5f, 2.7f) to 1.323f,
Pair(0.5f, 2.8f) to 1.372f,
Pair(0.5f, 2.9f) to 1.421f,
Pair(0.5f, 3.0f) to 1.470f,
Pair(0.5f, 3.2f) to 1.568f,
Pair(0.5f, 3.4f) to 1.666f,
Pair(0.5f, 3.6f) to 1.764f,
Pair(0.5f, 3.8f) to 1.862f,
Pair(0.5f, 4.0f) to 1.960f,
// Pulse Width = 1f
Pair(1f, 1.1f) to 0.539f,
Pair(1f, 1.2f) to 0.588f,
Pair(1f, 1.3f) to 0.637f,
Pair(1f, 1.4f) to 0.686f,
Pair(1f, 1.5f) to 0.735f,
Pair(1f, 1.6f) to 0.784f,
Pair(1f, 1.7f) to 0.833f,
Pair(1f, 1.8f) to 0.882f,
Pair(1f, 1.9f) to 0.931f,
Pair(1f, 2.0f) to 0.980f,
Pair(1f, 2.1f) to 1.029f,
Pair(1f, 2.2f) to 1.078f,
Pair(1f, 2.3f) to 1.127f,
Pair(1f, 2.4f) to 1.176f,
Pair(1f, 2.5f) to 1.225f,
Pair(1f, 2.6f) to 1.274f,
Pair(1f, 2.7f) to 1.323f,
Pair(1f, 2.8f) to 1.372f,
Pair(1f, 2.9f) to 1.421f,
Pair(1f, 3.0f) to 1.470f,
Pair(1f, 3.2f) to 1.568f,
Pair(1f, 3.4f) to 1.666f,
Pair(1f, 3.6f) to 1.764f,
Pair(1f, 3.8f) to 1.862f,
Pair(1f, 4.0f) to 1.960f,
Pair(1f, 4.2f) to 2.058f,
Pair(1f, 4.4f) to 2.156f,
Pair(1f, 4.6f) to 2.254f,
Pair(1f, 4.8f) to 2.352f,
Pair(1f, 5.0f) to 2.450f,
Pair(1f, 5.5f) to 2.695f,
Pair(1f, 6.0f) to 2.940f,
// Pulse Width = 1.5f
Pair(1.5f, 1.1f) to 0.539f,
Pair(1.5f, 1.2f) to 0.588f,
Pair(1.5f, 1.3f) to 0.637f,
Pair(1.5f, 1.4f) to 0.686f,
Pair(1.5f, 1.5f) to 0.735f,
Pair(1.5f, 1.6f) to 0.784f,
Pair(1.5f, 1.7f) to 0.833f,
Pair(1.5f, 1.8f) to 0.882f,
Pair(1.5f, 1.9f) to 0.931f,
Pair(1.5f, 2.0f) to 0.980f,
Pair(1.5f, 2.1f) to 1.029f,
Pair(1.5f, 2.2f) to 1.078f,
Pair(1.5f, 2.3f) to 1.127f,
Pair(1.5f, 2.4f) to 1.176f,
Pair(1.5f, 2.5f) to 1.225f,
Pair(1.5f, 2.6f) to 1.274f,
Pair(1.5f, 2.7f) to 1.323f,
Pair(1.5f, 2.8f) to 1.372f,
Pair(1.5f, 2.9f) to 1.421f,
Pair(1.5f, 3.0f) to 1.470f,
Pair(1.5f, 3.2f) to 1.568f,
Pair(1.5f, 3.4f) to 1.666f,
Pair(1.5f, 3.6f) to 1.764f,
Pair(1.5f, 3.8f) to 1.862f,
Pair(1.5f, 4.0f) to 1.960f,
Pair(1.5f, 4.2f) to 2.058f,
Pair(1.5f, 4.4f) to 2.156f,
Pair(1.5f, 4.6f) to 2.254f,
Pair(1.5f, 4.8f) to 2.352f,
Pair(1.5f, 5.0f) to 2.450f,
Pair(1.5f, 5.5f) to 2.695f,
Pair(1.5f, 6.0f) to 2.940f,
Pair(1.5f, 6.5f) to 3.185f,
Pair(1.5f, 7.0f) to 3.430f,
Pair(1.5f, 7.5f) to 3.675f,
Pair(1.5f, 8.0f) to 3.920f,
// Pulse Width = 3f
Pair(3f, 1.1f) to 0.539f,
Pair(3f, 1.2f) to 0.588f,
Pair(3f, 1.3f) to 0.637f,
Pair(3f, 1.4f) to 0.686f,
Pair(3f, 1.5f) to 0.735f,
Pair(3f, 1.6f) to 0.784f,
Pair(3f, 1.7f) to 0.833f,
Pair(3f, 1.8f) to 0.882f,
Pair(3f, 1.9f) to 0.931f,
Pair(3f, 2.0f) to 0.980f,
Pair(3f, 2.1f) to 1.029f,
Pair(3f, 2.2f) to 1.078f,
Pair(3f, 2.3f) to 1.127f,
Pair(3f, 2.4f) to 1.176f,
Pair(3f, 2.5f) to 1.225f,
Pair(3f, 2.6f) to 1.274f,
Pair(3f, 2.7f) to 1.323f,
Pair(3f, 2.8f) to 1.372f,
Pair(3f, 2.9f) to 1.421f,
Pair(3f, 3.0f) to 1.470f,
Pair(3f, 3.2f) to 1.568f,
Pair(3f, 3.4f) to 1.666f,
Pair(3f, 3.6f) to 1.764f,
Pair(3f, 3.8f) to 1.862f,
Pair(3f, 4.0f) to 1.960f,
Pair(3f, 4.2f) to 2.058f,
Pair(3f, 4.4f) to 2.156f,
Pair(3f, 4.6f) to 2.254f,
Pair(3f, 4.8f) to 2.352f,
Pair(3f, 5.0f) to 2.450f,
Pair(3f, 5.5f) to 2.695f,
Pair(3f, 6.0f) to 2.940f,
Pair(3f, 6.5f) to 3.185f,
Pair(3f, 7.0f) to 3.430f,
Pair(3f, 7.5f) to 3.675f,
Pair(3f, 8.0f) to 3.920f,
Pair(3f, 8.5f) to 4.165f,
Pair(3f, 9.0f) to 4.410f,
Pair(3f, 9.5f) to 4.655f,
Pair(3f, 10.0f) to 4.900f,
Pair(3f, 11.0f) to 5.390f,
Pair(3f, 12.0f) to 5.880f,
// Pulse Width = 5f
Pair(5f, 1.1f) to 0.539f,
Pair(5f, 1.2f) to 0.588f,
Pair(5f, 1.3f) to 0.637f,
Pair(5f, 1.4f) to 0.686f,
Pair(5f, 1.5f) to 0.735f,
Pair(5f, 1.6f) to 0.784f,
Pair(5f, 1.7f) to 0.833f,
Pair(5f, 1.8f) to 0.882f,
Pair(5f, 1.9f) to 0.931f,
Pair(5f, 2.0f) to 0.980f,
Pair(5f, 2.1f) to 1.029f,
Pair(5f, 2.2f) to 1.078f,
Pair(5f, 2.3f) to 1.127f,
Pair(5f, 2.4f) to 1.176f,
Pair(5f, 2.5f) to 1.225f,
Pair(5f, 2.6f) to 1.274f,
Pair(5f, 2.7f) to 1.323f,
Pair(5f, 2.8f) to 1.372f,
Pair(5f, 2.9f) to 1.421f,
Pair(5f, 3.0f) to 1.470f,
Pair(5f, 3.2f) to 1.568f,
Pair(5f, 3.4f) to 1.666f,
Pair(5f, 3.6f) to 1.764f,
Pair(5f, 3.8f) to 1.862f,
Pair(5f, 4.0f) to 1.960f,
Pair(5f, 4.2f) to 2.058f,
Pair(5f, 4.4f) to 2.156f,
Pair(5f, 4.6f) to 2.254f,
Pair(5f, 4.8f) to 2.352f,
Pair(5f, 5.0f) to 2.450f,
Pair(5f, 5.5f) to 2.695f,
Pair(5f, 6.0f) to 2.940f,
Pair(5f, 6.5f) to 3.185f,
Pair(5f, 7.0f) to 3.430f,
Pair(5f, 7.5f) to 3.675f,
Pair(5f, 8.0f) to 3.920f,
Pair(5f, 8.5f) to 4.165f,
Pair(5f, 9.0f) to 4.410f,
Pair(5f, 9.5f) to 4.655f,
Pair(5f, 10.0f) to 4.900f,
Pair(5f, 11.0f) to 5.390f,
Pair(5f, 12.0f) to 5.880f,
Pair(5f, 13.0f) to 6.370f,
Pair(5f, 14.0f) to 6.860f,
// Pulse Width = 10f
Pair(10f, 1.1f) to 0.539f,
Pair(10f, 1.2f) to 0.588f,
Pair(10f, 1.3f) to 0.637f,
Pair(10f, 1.4f) to 0.686f,
Pair(10f, 1.5f) to 0.735f,
Pair(10f, 1.6f) to 0.784f,
Pair(10f, 1.7f) to 0.833f,
Pair(10f, 1.8f) to 0.882f,
Pair(10f, 1.9f) to 0.931f,
Pair(10f, 2.0f) to 0.980f,
Pair(10f, 2.1f) to 1.029f,
Pair(10f, 2.2f) to 1.078f,
Pair(10f, 2.3f) to 1.127f,
Pair(10f, 2.4f) to 1.176f,
Pair(10f, 2.5f) to 1.225f,
Pair(10f, 2.6f) to 1.274f,
Pair(10f, 2.7f) to 1.323f,
Pair(10f, 2.8f) to 1.372f,
Pair(10f, 2.9f) to 1.421f,
Pair(10f, 3.0f) to 1.470f,
Pair(10f, 3.2f) to 1.568f,
Pair(10f, 3.4f) to 1.666f,
Pair(10f, 3.6f) to 1.764f,
Pair(10f, 3.8f) to 1.862f,
Pair(10f, 4.0f) to 1.960f,
Pair(10f, 4.2f) to 2.058f,
Pair(10f, 4.4f) to 2.156f,
Pair(10f, 4.6f) to 2.254f,
Pair(10f, 4.8f) to 2.352f,
Pair(10f, 5.0f) to 2.450f,
Pair(10f, 5.5f) to 2.695f,
Pair(10f, 6.0f) to 2.940f,
Pair(10f, 6.5f) to 3.185f,
Pair(10f, 7.0f) to 3.430f,
Pair(10f, 7.5f) to 3.675f,
Pair(10f, 8.0f) to 3.920f,
Pair(10f, 8.5f) to 4.165f,
Pair(10f, 9.0f) to 4.410f,
Pair(10f, 9.5f) to 4.655f,
Pair(10f, 10.0f) to 4.900f,
Pair(10f, 11.0f) to 5.390f,
Pair(10f, 12.0f) to 5.880f,
Pair(10f, 13.0f) to 6.370f,
Pair(10f, 14.0f) to 6.860f,
Pair(10f, 15.0f) to 7.350f,
Pair(10f, 16.0f) to 7.840f,
Pair(10f, 17.0f) to 8.330f,
Pair(10f, 18.0f) to 8.820f,
Pair(10f, 19.0f) to 9.310f,
Pair(10f, 20.0f) to 9.800f,
// Pulse Width = 15f
Pair(15f, 1.1f) to 0.539f,
Pair(15f, 1.2f) to 0.588f,
Pair(15f, 1.3f) to 0.637f,
Pair(15f, 1.4f) to 0.686f,
Pair(15f, 1.5f) to 0.735f,
Pair(15f, 1.6f) to 0.784f,
Pair(15f, 1.7f) to 0.833f,
Pair(15f, 1.8f) to 0.882f,
Pair(15f, 1.9f) to 0.931f,
Pair(15f, 2.0f) to 0.980f,
Pair(15f, 2.1f) to 1.029f,
Pair(15f, 2.2f) to 1.078f,
Pair(15f, 2.3f) to 1.127f,
Pair(15f, 2.4f) to 1.176f,
Pair(15f, 2.5f) to 1.225f,
Pair(15f, 2.6f) to 1.274f,
Pair(15f, 2.7f) to 1.323f,
Pair(15f, 2.8f) to 1.372f,
Pair(15f, 2.9f) to 1.421f,
Pair(15f, 3.0f) to 1.470f,
Pair(15f, 3.2f) to 1.568f,
Pair(15f, 3.4f) to 1.666f,
Pair(15f, 3.6f) to 1.764f,
Pair(15f, 3.8f) to 1.862f,
Pair(15f, 4.0f) to 1.960f,
Pair(15f, 4.2f) to 2.058f,
Pair(15f, 4.4f) to 2.156f,
Pair(15f, 4.6f) to 2.254f,
Pair(15f, 4.8f) to 2.352f,
Pair(15f, 5.0f) to 2.450f,
Pair(15f, 5.5f) to 2.695f,
Pair(15f, 6.0f) to 2.940f,
Pair(15f, 6.5f) to 3.185f,
Pair(15f, 7.0f) to 3.430f,
Pair(15f, 7.5f) to 3.675f,
Pair(15f, 8.0f) to 3.920f,
Pair(15f, 8.5f) to 4.165f,
Pair(15f, 9.0f) to 4.410f,
Pair(15f, 9.5f) to 4.655f,
Pair(15f, 10.0f) to 4.900f,
Pair(15f, 11.0f) to 5.390f,
Pair(15f, 12.0f) to 5.880f,
Pair(15f, 13.0f) to 6.370f,
Pair(15f, 14.0f) to 6.860f,
Pair(15f, 15.0f) to 7.350f,
Pair(15f, 16.0f) to 7.840f,
Pair(15f, 17.0f) to 8.330f,
Pair(15f, 18.0f) to 8.820f,
Pair(15f, 19.0f) to 9.310f,
Pair(15f, 20.0f) to 9.800f,
// Pulse Width = 20f
Pair(20f, 1.1f) to 0.539f,
Pair(20f, 1.2f) to 0.588f,
Pair(20f, 1.3f) to 0.637f,
Pair(20f, 1.4f) to 0.686f,
Pair(20f, 1.5f) to 0.735f,
Pair(20f, 1.6f) to 0.784f,
Pair(20f, 1.7f) to 0.833f,
Pair(20f, 1.8f) to 0.882f,
Pair(20f, 1.9f) to 0.931f,
Pair(20f, 2.0f) to 0.980f,
Pair(20f, 2.1f) to 1.029f,
Pair(20f, 2.2f) to 1.078f,
Pair(20f, 2.3f) to 1.127f,
Pair(20f, 2.4f) to 1.176f,
Pair(20f, 2.5f) to 1.225f,
Pair(20f, 2.6f) to 1.274f,
Pair(20f, 2.7f) to 1.323f,
Pair(20f, 2.8f) to 1.372f,
Pair(20f, 2.9f) to 1.421f,
Pair(20f, 3.0f) to 1.470f,
Pair(20f, 3.2f) to 1.568f,
Pair(20f, 3.4f) to 1.666f,
Pair(20f, 3.6f) to 1.764f,
Pair(20f, 3.8f) to 1.862f,
Pair(20f, 4.0f) to 1.960f,
Pair(20f, 4.2f) to 2.058f,
Pair(20f, 4.4f) to 2.156f,
Pair(20f, 4.6f) to 2.254f,
Pair(20f, 4.8f) to 2.352f,
Pair(20f, 5.0f) to 2.450f,
Pair(20f, 5.5f) to 2.695f,
Pair(20f, 6.0f) to 2.940f,
Pair(20f, 6.5f) to 3.185f,
Pair(20f, 7.0f) to 3.430f,
Pair(20f, 7.5f) to 3.675f,
Pair(20f, 8.0f) to 3.920f,
Pair(20f, 8.5f) to 4.165f,
Pair(20f, 9.0f) to 4.410f,
Pair(20f, 9.5f) to 4.655f,
Pair(20f, 10.0f) to 4.900f,
Pair(20f, 11.0f) to 5.390f,
Pair(20f, 12.0f) to 5.880f,
Pair(20f, 13.0f) to 6.370f,
Pair(20f, 14.0f) to 6.860f,
Pair(20f, 15.0f) to 7.350f,
Pair(20f, 16.0f) to 7.840f,
Pair(20f, 17.0f) to 8.330f,
Pair(20f, 18.0f) to 8.820f,
Pair(20f, 19.0f) to 9.310f,
Pair(20f, 20.0f) to 9.800f,
// Pulse Width = 25f
Pair(25f, 1.1f) to 0.539f,
Pair(25f, 1.2f) to 0.588f,
Pair(25f, 1.3f) to 0.637f,
Pair(25f, 1.4f) to 0.686f,
Pair(25f, 1.5f) to 0.735f,
Pair(25f, 1.6f) to 0.784f,
Pair(25f, 1.7f) to 0.833f,
Pair(25f, 1.8f) to 0.882f,
Pair(25f, 1.9f) to 0.931f,
Pair(25f, 2.0f) to 0.980f,
Pair(25f, 2.1f) to 1.029f,
Pair(25f, 2.2f) to 1.078f,
Pair(25f, 2.3f) to 1.127f,
Pair(25f, 2.4f) to 1.176f,
Pair(25f, 2.5f) to 1.225f,
Pair(25f, 2.6f) to 1.274f,
Pair(25f, 2.7f) to 1.323f,
Pair(25f, 2.8f) to 1.372f,
Pair(25f, 2.9f) to 1.421f,
Pair(25f, 3.0f) to 1.470f,
Pair(25f, 3.2f) to 1.568f,
Pair(25f, 3.4f) to 1.666f,
Pair(25f, 3.6f) to 1.764f,
Pair(25f, 3.8f) to 1.862f,
Pair(25f, 4.0f) to 1.960f,
Pair(25f, 4.2f) to 2.058f,
Pair(25f, 4.4f) to 2.156f,
Pair(25f, 4.6f) to 2.254f,
Pair(25f, 4.8f) to 2.352f,
Pair(25f, 5.0f) to 2.450f,
Pair(25f, 5.5f) to 2.695f,
Pair(25f, 6.0f) to 2.940f,
Pair(25f, 6.5f) to 3.185f,
Pair(25f, 7.0f) to 3.430f,
Pair(25f, 7.5f) to 3.675f,
Pair(25f, 8.0f) to 3.920f,
Pair(25f, 8.5f) to 4.165f,
Pair(25f, 9.0f) to 4.410f,
Pair(25f, 9.5f) to 4.655f,
Pair(25f, 10.0f) to 4.900f,
Pair(25f, 11.0f) to 5.390f,
Pair(25f, 12.0f) to 5.880f,
Pair(25f, 13.0f) to 6.370f,
Pair(25f, 14.0f) to 6.860f,
Pair(25f, 15.0f) to 7.350f,
Pair(25f, 16.0f) to 7.840f,
Pair(25f, 17.0f) to 8.330f,
Pair(25f, 18.0f) to 8.820f,
Pair(25f, 19.0f) to 9.310f,
Pair(25f, 20.0f) to 9.800f,
// Pulse Width = 30f
Pair(30f, 1.1f) to 0.539f,
Pair(30f, 1.2f) to 0.588f,
Pair(30f, 1.3f) to 0.637f,
Pair(30f, 1.4f) to 0.686f,
Pair(30f, 1.5f) to 0.735f,
Pair(30f, 1.6f) to 0.784f,
Pair(30f, 1.7f) to 0.833f,
Pair(30f, 1.8f) to 0.882f,
Pair(30f, 1.9f) to 0.931f,
Pair(30f, 2.0f) to 0.980f,
Pair(30f, 2.1f) to 1.029f,
Pair(30f, 2.2f) to 1.078f,
Pair(30f, 2.3f) to 1.127f,
Pair(30f, 2.4f) to 1.176f,
Pair(30f, 2.5f) to 1.225f,
Pair(30f, 2.6f) to 1.274f,
Pair(30f, 2.7f) to 1.323f,
Pair(30f, 2.8f) to 1.372f,
Pair(30f, 2.9f) to 1.421f,
Pair(30f, 3.0f) to 1.470f,
Pair(30f, 3.2f) to 1.568f,
Pair(30f, 3.4f) to 1.666f,
Pair(30f, 3.6f) to 1.764f,
Pair(30f, 3.8f) to 1.862f,
Pair(30f, 4.0f) to 1.960f,
Pair(30f, 4.2f) to 2.058f,
Pair(30f, 4.4f) to 2.156f,
Pair(30f, 4.6f) to 2.254f,
Pair(30f, 4.8f) to 2.352f,
Pair(30f, 5.0f) to 2.450f,
Pair(30f, 5.5f) to 2.695f,
Pair(30f, 6.0f) to 2.940f,
Pair(30f, 6.5f) to 3.185f,
Pair(30f, 7.0f) to 3.430f,
Pair(30f, 7.5f) to 3.675f,
Pair(30f, 8.0f) to 3.920f,
Pair(30f, 8.5f) to 4.165f,
Pair(30f, 9.0f) to 4.410f,
Pair(30f, 9.5f) to 4.655f,
Pair(30f, 10.0f) to 4.900f,
Pair(30f, 11.0f) to 5.390f,
Pair(30f, 12.0f) to 5.880f,
Pair(30f, 13.0f) to 6.370f,
Pair(30f, 14.0f) to 6.860f,
Pair(30f, 15.0f) to 7.350f,
Pair(30f, 16.0f) to 7.840f,
Pair(30f, 17.0f) to 8.330f,
Pair(30f, 18.0f) to 8.820f,
Pair(30f, 19.0f) to 9.310f,
Pair(30f, 20.0f) to 9.800f,
// Pulse Width = 35f
Pair(35f, 1.1f) to 0.539f,
Pair(35f, 1.2f) to 0.588f,
Pair(35f, 1.3f) to 0.637f,
Pair(35f, 1.4f) to 0.686f,
Pair(35f, 1.5f) to 0.735f,
Pair(35f, 1.6f) to 0.784f,
Pair(35f, 1.7f) to 0.833f,
Pair(35f, 1.8f) to 0.882f,
Pair(35f, 1.9f) to 0.931f,
Pair(35f, 2.0f) to 0.980f,
Pair(35f, 2.1f) to 1.029f,
Pair(35f, 2.2f) to 1.078f,
Pair(35f, 2.3f) to 1.127f,
Pair(35f, 2.4f) to 1.176f,
Pair(35f, 2.5f) to 1.225f,
Pair(35f, 2.6f) to 1.274f,
Pair(35f, 2.7f) to 1.323f,
Pair(35f, 2.8f) to 1.372f,
Pair(35f, 2.9f) to 1.421f,
Pair(35f, 3.0f) to 1.470f,
Pair(35f, 3.2f) to 1.568f,
Pair(35f, 3.4f) to 1.666f,
Pair(35f, 3.6f) to 1.764f,
Pair(35f, 3.8f) to 1.862f,
Pair(35f, 4.0f) to 1.960f,
Pair(35f, 4.2f) to 2.058f,
Pair(35f, 4.4f) to 2.156f,
Pair(35f, 4.6f) to 2.254f,
Pair(35f, 4.8f) to 2.352f,
Pair(35f, 5.0f) to 2.450f,
Pair(35f, 5.5f) to 2.695f,
Pair(35f, 6.0f) to 2.940f,
Pair(35f, 6.5f) to 3.185f,
Pair(35f, 7.0f) to 3.430f,
Pair(35f, 7.5f) to 3.675f,
Pair(35f, 8.0f) to 3.920f,
Pair(35f, 8.5f) to 4.165f,
Pair(35f, 9.0f) to 4.410f,
Pair(35f, 9.5f) to 4.655f,
Pair(35f, 10.0f) to 4.900f,
Pair(35f, 11.0f) to 5.390f,
Pair(35f, 12.0f) to 5.880f,
Pair(35f, 13.0f) to 6.370f,
Pair(35f, 14.0f) to 6.860f,
Pair(35f, 15.0f) to 7.350f,
Pair(35f, 16.0f) to 7.840f,
Pair(35f, 17.0f) to 8.330f,
Pair(35f, 18.0f) to 8.820f,
Pair(35f, 19.0f) to 9.310f,
Pair(35f, 20.0f) to 9.800f,
// Pulse Width = 40f
Pair(40f, 1.1f) to 0.539f,
Pair(40f, 1.2f) to 0.588f,
Pair(40f, 1.3f) to 0.637f,
Pair(40f, 1.4f) to 0.686f,
Pair(40f, 1.5f) to 0.735f,
Pair(40f, 1.6f) to 0.784f,
Pair(40f, 1.7f) to 0.833f,
Pair(40f, 1.8f) to 0.882f,
Pair(40f, 1.9f) to 0.931f,
Pair(40f, 2.0f) to 0.980f,
Pair(40f, 2.1f) to 1.029f,
Pair(40f, 2.2f) to 1.078f,
Pair(40f, 2.3f) to 1.127f,
Pair(40f, 2.4f) to 1.176f,
Pair(40f, 2.5f) to 1.225f,
Pair(40f, 2.6f) to 1.274f,
Pair(40f, 2.7f) to 1.323f,
Pair(40f, 2.8f) to 1.372f,
Pair(40f, 2.9f) to 1.421f,
Pair(40f, 3.0f) to 1.470f,
Pair(40f, 3.2f) to 1.568f,
Pair(40f, 3.4f) to 1.666f,
Pair(40f, 3.6f) to 1.764f,
Pair(40f, 3.8f) to 1.862f,
Pair(40f, 4.0f) to 1.960f,
Pair(40f, 4.2f) to 2.058f,
Pair(40f, 4.4f) to 2.156f,
Pair(40f, 4.6f) to 2.254f,
Pair(40f, 4.8f) to 2.352f,
Pair(40f, 5.0f) to 2.450f,
Pair(40f, 5.5f) to 2.695f,
Pair(40f, 6.0f) to 2.940f,
Pair(40f, 6.5f) to 3.185f,
Pair(40f, 7.0f) to 3.430f,
Pair(40f, 7.5f) to 3.675f,
Pair(40f, 8.0f) to 3.920f,
Pair(40f, 8.5f) to 4.165f,
Pair(40f, 9.0f) to 4.410f,
Pair(40f, 9.5f) to 4.655f,
Pair(40f, 10.0f) to 4.900f,
Pair(40f, 11.0f) to 5.390f,
Pair(40f, 12.0f) to 5.880f,
Pair(40f, 13.0f) to 6.370f,
Pair(40f, 14.0f) to 6.860f,
Pair(40f, 15.0f) to 7.350f,
Pair(40f, 16.0f) to 7.840f,
Pair(40f, 17.0f) to 8.330f,
Pair(40f, 18.0f) to 8.820f,
Pair(40f, 19.0f) to 9.310f,
Pair(40f, 20.0f) to 9.800f,
)

View File

@@ -0,0 +1,509 @@
package com.laseroptek.raman.const
//
// Hz Table3 (HANDPIENCE-10x10)
// - Map<Pair<Float, Float>, Int>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Fluence(J/cm²)>, HzType(int)>
//
val HzTable_10_10 = mapOf(
// Pulse Width = 0.5f
Pair(0.5f, 0.5f) to KEY_BLUE,
Pair(0.5f, 0.6f) to KEY_BLUE,
Pair(0.5f, 0.7f) to KEY_BLUE,
Pair(0.5f, 0.8f) to KEY_BLUE,
Pair(0.5f, 0.9f) to KEY_BLUE,
Pair(0.5f, 1.0f) to KEY_BLUE,
Pair(0.5f, 1.1f) to KEY_YELLOW,
Pair(0.5f, 1.2f) to KEY_YELLOW,
Pair(0.5f, 1.3f) to KEY_YELLOW,
Pair(0.5f, 1.4f) to KEY_YELLOW,
Pair(0.5f, 1.5f) to KEY_YELLOW,
Pair(0.5f, 1.6f) to KEY_YELLOW,
Pair(0.5f, 1.7f) to KEY_YELLOW,
Pair(0.5f, 1.8f) to KEY_YELLOW,
Pair(0.5f, 1.9f) to KEY_YELLOW,
Pair(0.5f, 2.0f) to KEY_YELLOW,
// Pulse Width = 1f
Pair(1f, 0.5f) to KEY_BLUE,
Pair(1f, 0.6f) to KEY_YELLOW,
Pair(1f, 0.7f) to KEY_YELLOW,
Pair(1f, 0.8f) to KEY_YELLOW,
Pair(1f, 0.9f) to KEY_YELLOW,
Pair(1f, 1.0f) to KEY_YELLOW,
Pair(1f, 1.1f) to KEY_RED,
Pair(1f, 1.2f) to KEY_RED,
Pair(1f, 1.3f) to KEY_RED,
Pair(1f, 1.4f) to KEY_RED,
Pair(1f, 1.5f) to KEY_RED,
Pair(1f, 1.6f) to KEY_RED,
Pair(1f, 1.7f) to KEY_RED,
Pair(1f, 1.8f) to KEY_RED,
Pair(1f, 1.9f) to KEY_RED,
Pair(1f, 2.0f) to KEY_RED,
Pair(1f, 2.1f) to KEY_GRAY,
Pair(1f, 2.2f) to KEY_GRAY,
Pair(1f, 2.3f) to KEY_GRAY,
Pair(1f, 2.4f) to KEY_GRAY,
Pair(1f, 2.5f) to KEY_GRAY,
Pair(1f, 2.6f) to KEY_GRAY,
Pair(1f, 2.7f) to KEY_GRAY,
Pair(1f, 2.8f) to KEY_GRAY,
Pair(1f, 2.9f) to KEY_GRAY,
Pair(1f, 3.0f) to KEY_GRAY,
// Pulse Width = 1.5f
Pair(1.5f, 0.5f) to KEY_YELLOW,
Pair(1.5f, 0.6f) to KEY_RED,
Pair(1.5f, 0.7f) to KEY_RED,
Pair(1.5f, 0.8f) to KEY_RED,
Pair(1.5f, 0.9f) to KEY_RED,
Pair(1.5f, 1.0f) to KEY_RED,
Pair(1.5f, 1.1f) to KEY_GRAY,
Pair(1.5f, 1.2f) to KEY_GRAY,
Pair(1.5f, 1.3f) to KEY_GRAY,
Pair(1.5f, 1.4f) to KEY_GRAY,
Pair(1.5f, 1.5f) to KEY_GRAY,
Pair(1.5f, 1.6f) to KEY_GRAY,
Pair(1.5f, 1.7f) to KEY_GRAY,
Pair(1.5f, 1.8f) to KEY_GRAY,
Pair(1.5f, 1.9f) to KEY_GRAY,
Pair(1.5f, 2.0f) to KEY_GRAY,
Pair(1.5f, 2.1f) to KEY_GRAY,
Pair(1.5f, 2.2f) to KEY_GRAY,
Pair(1.5f, 2.3f) to KEY_GRAY,
Pair(1.5f, 2.4f) to KEY_GRAY,
Pair(1.5f, 2.5f) to KEY_GRAY,
Pair(1.5f, 2.6f) to KEY_GRAY,
Pair(1.5f, 2.7f) to KEY_GRAY,
Pair(1.5f, 2.8f) to KEY_GRAY,
Pair(1.5f, 2.9f) to KEY_GRAY,
Pair(1.5f, 3.0f) to KEY_GRAY,
Pair(1.5f, 3.2f) to KEY_GRAY,
Pair(1.5f, 3.4f) to KEY_GRAY,
Pair(1.5f, 3.6f) to KEY_GRAY,
Pair(1.5f, 3.8f) to KEY_GRAY,
Pair(1.5f, 4.0f) to KEY_GRAY,
// Pulse Width = 3f
Pair(3f, 0.5f) to KEY_RED,
Pair(3f, 0.6f) to KEY_GRAY,
Pair(3f, 0.7f) to KEY_GRAY,
Pair(3f, 0.8f) to KEY_GRAY,
Pair(3f, 0.9f) to KEY_GRAY,
Pair(3f, 1.0f) to KEY_GRAY,
Pair(3f, 1.1f) to KEY_GRAY,
Pair(3f, 1.2f) to KEY_GRAY,
Pair(3f, 1.3f) to KEY_GRAY,
Pair(3f, 1.4f) to KEY_GRAY,
Pair(3f, 1.5f) to KEY_GRAY,
Pair(3f, 1.6f) to KEY_GRAY,
Pair(3f, 1.7f) to KEY_GRAY,
Pair(3f, 1.8f) to KEY_GRAY,
Pair(3f, 1.9f) to KEY_GRAY,
Pair(3f, 2.0f) to KEY_GRAY,
Pair(3f, 2.1f) to KEY_GRAY,
Pair(3f, 2.2f) to KEY_GRAY,
Pair(3f, 2.3f) to KEY_GRAY,
Pair(3f, 2.4f) to KEY_GRAY,
Pair(3f, 2.5f) to KEY_GRAY,
Pair(3f, 2.6f) to KEY_GRAY,
Pair(3f, 2.7f) to KEY_GRAY,
Pair(3f, 2.8f) to KEY_GRAY,
Pair(3f, 2.9f) to KEY_GRAY,
Pair(3f, 3.0f) to KEY_GRAY,
Pair(3f, 3.2f) to KEY_GRAY,
Pair(3f, 3.4f) to KEY_GRAY,
Pair(3f, 3.6f) to KEY_GRAY,
Pair(3f, 3.8f) to KEY_GRAY,
Pair(3f, 4.0f) to KEY_GRAY,
Pair(3f, 4.2f) to KEY_GRAY,
Pair(3f, 4.4f) to KEY_GRAY,
Pair(3f, 4.6f) to KEY_GRAY,
Pair(3f, 4.8f) to KEY_GRAY,
Pair(3f, 5.0f) to KEY_GRAY,
Pair(3f, 5.5f) to KEY_GRAY,
Pair(3f, 6.0f) to KEY_GRAY,
// Pulse Width = 5f
Pair(5f, 0.5f) to KEY_RED,
Pair(5f, 0.6f) to KEY_GRAY,
Pair(5f, 0.7f) to KEY_GRAY,
Pair(5f, 0.8f) to KEY_GRAY,
Pair(5f, 0.9f) to KEY_GRAY,
Pair(5f, 1.0f) to KEY_GRAY,
Pair(5f, 1.1f) to KEY_GRAY,
Pair(5f, 1.2f) to KEY_GRAY,
Pair(5f, 1.3f) to KEY_GRAY,
Pair(5f, 1.4f) to KEY_GRAY,
Pair(5f, 1.5f) to KEY_GRAY,
Pair(5f, 1.6f) to KEY_GRAY,
Pair(5f, 1.7f) to KEY_GRAY,
Pair(5f, 1.8f) to KEY_GRAY,
Pair(5f, 1.9f) to KEY_GRAY,
Pair(5f, 2.0f) to KEY_GRAY,
Pair(5f, 2.1f) to KEY_GRAY,
Pair(5f, 2.2f) to KEY_GRAY,
Pair(5f, 2.3f) to KEY_GRAY,
Pair(5f, 2.4f) to KEY_GRAY,
Pair(5f, 2.5f) to KEY_GRAY,
Pair(5f, 2.6f) to KEY_GRAY,
Pair(5f, 2.7f) to KEY_GRAY,
Pair(5f, 2.8f) to KEY_GRAY,
Pair(5f, 2.9f) to KEY_GRAY,
Pair(5f, 3.0f) to KEY_GRAY,
Pair(5f, 3.2f) to KEY_GRAY,
Pair(5f, 3.4f) to KEY_GRAY,
Pair(5f, 3.6f) to KEY_GRAY,
Pair(5f, 3.8f) to KEY_GRAY,
Pair(5f, 4.0f) to KEY_GRAY,
Pair(5f, 4.2f) to KEY_GRAY,
Pair(5f, 4.4f) to KEY_GRAY,
Pair(5f, 4.6f) to KEY_GRAY,
Pair(5f, 4.8f) to KEY_GRAY,
Pair(5f, 5.0f) to KEY_GRAY,
Pair(5f, 5.5f) to KEY_GRAY,
Pair(5f, 6.0f) to KEY_GRAY,
Pair(5f, 6.5f) to KEY_GRAY,
Pair(5f, 7.0f) to KEY_GRAY,
// Pulse Width = 10f
Pair(10f, 0.5f) to KEY_GRAY,
Pair(10f, 0.6f) to KEY_GRAY,
Pair(10f, 0.7f) to KEY_GRAY,
Pair(10f, 0.8f) to KEY_GRAY,
Pair(10f, 0.9f) to KEY_GRAY,
Pair(10f, 1.0f) to KEY_GRAY,
Pair(10f, 1.1f) to KEY_GRAY,
Pair(10f, 1.2f) to KEY_GRAY,
Pair(10f, 1.3f) to KEY_GRAY,
Pair(10f, 1.4f) to KEY_GRAY,
Pair(10f, 1.5f) to KEY_GRAY,
Pair(10f, 1.6f) to KEY_GRAY,
Pair(10f, 1.7f) to KEY_GRAY,
Pair(10f, 1.8f) to KEY_GRAY,
Pair(10f, 1.9f) to KEY_GRAY,
Pair(10f, 2.0f) to KEY_GRAY,
Pair(10f, 2.1f) to KEY_GRAY,
Pair(10f, 2.2f) to KEY_GRAY,
Pair(10f, 2.3f) to KEY_GRAY,
Pair(10f, 2.4f) to KEY_GRAY,
Pair(10f, 2.5f) to KEY_GRAY,
Pair(10f, 2.6f) to KEY_GRAY,
Pair(10f, 2.7f) to KEY_GRAY,
Pair(10f, 2.8f) to KEY_GRAY,
Pair(10f, 2.9f) to KEY_GRAY,
Pair(10f, 3.0f) to KEY_GRAY,
Pair(10f, 3.2f) to KEY_GRAY,
Pair(10f, 3.4f) to KEY_GRAY,
Pair(10f, 3.6f) to KEY_GRAY,
Pair(10f, 3.8f) to KEY_GRAY,
Pair(10f, 4.0f) to KEY_GRAY,
Pair(10f, 4.2f) to KEY_GRAY,
Pair(10f, 4.4f) to KEY_GRAY,
Pair(10f, 4.6f) to KEY_GRAY,
Pair(10f, 4.8f) to KEY_GRAY,
Pair(10f, 5.0f) to KEY_GRAY,
Pair(10f, 5.5f) to KEY_GRAY,
Pair(10f, 6.0f) to KEY_GRAY,
Pair(10f, 6.5f) to KEY_GRAY,
Pair(10f, 7.0f) to KEY_GRAY,
Pair(10f, 7.5f) to KEY_GRAY,
Pair(10f, 8.0f) to KEY_GRAY,
Pair(10f, 8.5f) to KEY_GRAY,
Pair(10f, 9.0f) to KEY_GRAY,
Pair(10f, 9.5f) to KEY_GRAY,
Pair(10f, 10.0f) to KEY_GRAY,
// Pulse Width = 15f
Pair(15f, 0.5f) to KEY_GRAY,
Pair(15f, 0.6f) to KEY_GRAY,
Pair(15f, 0.7f) to KEY_GRAY,
Pair(15f, 0.8f) to KEY_GRAY,
Pair(15f, 0.9f) to KEY_GRAY,
Pair(15f, 1.0f) to KEY_GRAY,
Pair(15f, 1.1f) to KEY_GRAY,
Pair(15f, 1.2f) to KEY_GRAY,
Pair(15f, 1.3f) to KEY_GRAY,
Pair(15f, 1.4f) to KEY_GRAY,
Pair(15f, 1.5f) to KEY_GRAY,
Pair(15f, 1.6f) to KEY_GRAY,
Pair(15f, 1.7f) to KEY_GRAY,
Pair(15f, 1.8f) to KEY_GRAY,
Pair(15f, 1.9f) to KEY_GRAY,
Pair(15f, 2.0f) to KEY_GRAY,
Pair(15f, 2.1f) to KEY_GRAY,
Pair(15f, 2.2f) to KEY_GRAY,
Pair(15f, 2.3f) to KEY_GRAY,
Pair(15f, 2.4f) to KEY_GRAY,
Pair(15f, 2.5f) to KEY_GRAY,
Pair(15f, 2.6f) to KEY_GRAY,
Pair(15f, 2.7f) to KEY_GRAY,
Pair(15f, 2.8f) to KEY_GRAY,
Pair(15f, 2.9f) to KEY_GRAY,
Pair(15f, 3.0f) to KEY_GRAY,
Pair(15f, 3.2f) to KEY_GRAY,
Pair(15f, 3.4f) to KEY_GRAY,
Pair(15f, 3.6f) to KEY_GRAY,
Pair(15f, 3.8f) to KEY_GRAY,
Pair(15f, 4.0f) to KEY_GRAY,
Pair(15f, 4.2f) to KEY_GRAY,
Pair(15f, 4.4f) to KEY_GRAY,
Pair(15f, 4.6f) to KEY_GRAY,
Pair(15f, 4.8f) to KEY_GRAY,
Pair(15f, 5.0f) to KEY_GRAY,
Pair(15f, 5.5f) to KEY_GRAY,
Pair(15f, 6.0f) to KEY_GRAY,
Pair(15f, 6.5f) to KEY_GRAY,
Pair(15f, 7.0f) to KEY_GRAY,
Pair(15f, 7.5f) to KEY_GRAY,
Pair(15f, 8.0f) to KEY_GRAY,
Pair(15f, 8.5f) to KEY_GRAY,
Pair(15f, 9.0f) to KEY_GRAY,
Pair(15f, 9.5f) to KEY_GRAY,
Pair(15f, 10.0f) to KEY_GRAY,
// Pulse Width = 20f
Pair(20f, 0.5f) to KEY_GRAY,
Pair(20f, 0.6f) to KEY_GRAY,
Pair(20f, 0.7f) to KEY_GRAY,
Pair(20f, 0.8f) to KEY_GRAY,
Pair(20f, 0.9f) to KEY_GRAY,
Pair(20f, 1.0f) to KEY_GRAY,
Pair(20f, 1.1f) to KEY_GRAY,
Pair(20f, 1.2f) to KEY_GRAY,
Pair(20f, 1.3f) to KEY_GRAY,
Pair(20f, 1.4f) to KEY_GRAY,
Pair(20f, 1.5f) to KEY_GRAY,
Pair(20f, 1.6f) to KEY_GRAY,
Pair(20f, 1.7f) to KEY_GRAY,
Pair(20f, 1.8f) to KEY_GRAY,
Pair(20f, 1.9f) to KEY_GRAY,
Pair(20f, 2.0f) to KEY_GRAY,
Pair(20f, 2.1f) to KEY_GRAY,
Pair(20f, 2.2f) to KEY_GRAY,
Pair(20f, 2.3f) to KEY_GRAY,
Pair(20f, 2.4f) to KEY_GRAY,
Pair(20f, 2.5f) to KEY_GRAY,
Pair(20f, 2.6f) to KEY_GRAY,
Pair(20f, 2.7f) to KEY_GRAY,
Pair(20f, 2.8f) to KEY_GRAY,
Pair(20f, 2.9f) to KEY_GRAY,
Pair(20f, 3.0f) to KEY_GRAY,
Pair(20f, 3.2f) to KEY_GRAY,
Pair(20f, 3.4f) to KEY_GRAY,
Pair(20f, 3.6f) to KEY_GRAY,
Pair(20f, 3.8f) to KEY_GRAY,
Pair(20f, 4.0f) to KEY_GRAY,
Pair(20f, 4.2f) to KEY_GRAY,
Pair(20f, 4.4f) to KEY_GRAY,
Pair(20f, 4.6f) to KEY_GRAY,
Pair(20f, 4.8f) to KEY_GRAY,
Pair(20f, 5.0f) to KEY_GRAY,
Pair(20f, 5.5f) to KEY_GRAY,
Pair(20f, 6.0f) to KEY_GRAY,
Pair(20f, 6.5f) to KEY_GRAY,
Pair(20f, 7.0f) to KEY_GRAY,
Pair(20f, 7.5f) to KEY_GRAY,
Pair(20f, 8.0f) to KEY_GRAY,
Pair(20f, 8.5f) to KEY_GRAY,
Pair(20f, 9.0f) to KEY_GRAY,
Pair(20f, 9.5f) to KEY_GRAY,
Pair(20f, 10.0f) to KEY_GRAY,
// Pulse Width = 25f
Pair(25f, 0.5f) to KEY_GRAY,
Pair(25f, 0.6f) to KEY_GRAY,
Pair(25f, 0.7f) to KEY_GRAY,
Pair(25f, 0.8f) to KEY_GRAY,
Pair(25f, 0.9f) to KEY_GRAY,
Pair(25f, 1.0f) to KEY_GRAY,
Pair(25f, 1.1f) to KEY_GRAY,
Pair(25f, 1.2f) to KEY_GRAY,
Pair(25f, 1.3f) to KEY_GRAY,
Pair(25f, 1.4f) to KEY_GRAY,
Pair(25f, 1.5f) to KEY_GRAY,
Pair(25f, 1.6f) to KEY_GRAY,
Pair(25f, 1.7f) to KEY_GRAY,
Pair(25f, 1.8f) to KEY_GRAY,
Pair(25f, 1.9f) to KEY_GRAY,
Pair(25f, 2.0f) to KEY_GRAY,
Pair(25f, 2.1f) to KEY_GRAY,
Pair(25f, 2.2f) to KEY_GRAY,
Pair(25f, 2.3f) to KEY_GRAY,
Pair(25f, 2.4f) to KEY_GRAY,
Pair(25f, 2.5f) to KEY_GRAY,
Pair(25f, 2.6f) to KEY_GRAY,
Pair(25f, 2.7f) to KEY_GRAY,
Pair(25f, 2.8f) to KEY_GRAY,
Pair(25f, 2.9f) to KEY_GRAY,
Pair(25f, 3.0f) to KEY_GRAY,
Pair(25f, 3.2f) to KEY_GRAY,
Pair(25f, 3.4f) to KEY_GRAY,
Pair(25f, 3.6f) to KEY_GRAY,
Pair(25f, 3.8f) to KEY_GRAY,
Pair(25f, 4.0f) to KEY_GRAY,
Pair(25f, 4.2f) to KEY_GRAY,
Pair(25f, 4.4f) to KEY_GRAY,
Pair(25f, 4.6f) to KEY_GRAY,
Pair(25f, 4.8f) to KEY_GRAY,
Pair(25f, 5.0f) to KEY_GRAY,
Pair(25f, 5.5f) to KEY_GRAY,
Pair(25f, 6.0f) to KEY_GRAY,
Pair(25f, 6.5f) to KEY_GRAY,
Pair(25f, 7.0f) to KEY_GRAY,
Pair(25f, 7.5f) to KEY_GRAY,
Pair(25f, 8.0f) to KEY_GRAY,
Pair(25f, 8.5f) to KEY_GRAY,
Pair(25f, 9.0f) to KEY_GRAY,
Pair(25f, 9.5f) to KEY_GRAY,
Pair(25f, 10.0f) to KEY_GRAY,
// Pulse Width = 30f
Pair(30f, 0.5f) to KEY_GRAY,
Pair(30f, 0.6f) to KEY_GRAY,
Pair(30f, 0.7f) to KEY_GRAY,
Pair(30f, 0.8f) to KEY_GRAY,
Pair(30f, 0.9f) to KEY_GRAY,
Pair(30f, 1.0f) to KEY_GRAY,
Pair(30f, 1.1f) to KEY_GRAY,
Pair(30f, 1.2f) to KEY_GRAY,
Pair(30f, 1.3f) to KEY_GRAY,
Pair(30f, 1.4f) to KEY_GRAY,
Pair(30f, 1.5f) to KEY_GRAY,
Pair(30f, 1.6f) to KEY_GRAY,
Pair(30f, 1.7f) to KEY_GRAY,
Pair(30f, 1.8f) to KEY_GRAY,
Pair(30f, 1.9f) to KEY_GRAY,
Pair(30f, 2.0f) to KEY_GRAY,
Pair(30f, 2.1f) to KEY_GRAY,
Pair(30f, 2.2f) to KEY_GRAY,
Pair(30f, 2.3f) to KEY_GRAY,
Pair(30f, 2.4f) to KEY_GRAY,
Pair(30f, 2.5f) to KEY_GRAY,
Pair(30f, 2.6f) to KEY_GRAY,
Pair(30f, 2.7f) to KEY_GRAY,
Pair(30f, 2.8f) to KEY_GRAY,
Pair(30f, 2.9f) to KEY_GRAY,
Pair(30f, 3.0f) to KEY_GRAY,
Pair(30f, 3.2f) to KEY_GRAY,
Pair(30f, 3.4f) to KEY_GRAY,
Pair(30f, 3.6f) to KEY_GRAY,
Pair(30f, 3.8f) to KEY_GRAY,
Pair(30f, 4.0f) to KEY_GRAY,
Pair(30f, 4.2f) to KEY_GRAY,
Pair(30f, 4.4f) to KEY_GRAY,
Pair(30f, 4.6f) to KEY_GRAY,
Pair(30f, 4.8f) to KEY_GRAY,
Pair(30f, 5.0f) to KEY_GRAY,
Pair(30f, 5.5f) to KEY_GRAY,
Pair(30f, 6.0f) to KEY_GRAY,
Pair(30f, 6.5f) to KEY_GRAY,
Pair(30f, 7.0f) to KEY_GRAY,
Pair(30f, 7.5f) to KEY_GRAY,
Pair(30f, 8.0f) to KEY_GRAY,
Pair(30f, 8.5f) to KEY_GRAY,
Pair(30f, 9.0f) to KEY_GRAY,
Pair(30f, 9.5f) to KEY_GRAY,
Pair(30f, 10.0f) to KEY_GRAY,
// Pulse Width = 35f
Pair(35f, 0.5f) to KEY_GRAY,
Pair(35f, 0.6f) to KEY_GRAY,
Pair(35f, 0.7f) to KEY_GRAY,
Pair(35f, 0.8f) to KEY_GRAY,
Pair(35f, 0.9f) to KEY_GRAY,
Pair(35f, 1.0f) to KEY_GRAY,
Pair(35f, 1.1f) to KEY_GRAY,
Pair(35f, 1.2f) to KEY_GRAY,
Pair(35f, 1.3f) to KEY_GRAY,
Pair(35f, 1.4f) to KEY_GRAY,
Pair(35f, 1.5f) to KEY_GRAY,
Pair(35f, 1.6f) to KEY_GRAY,
Pair(35f, 1.7f) to KEY_GRAY,
Pair(35f, 1.8f) to KEY_GRAY,
Pair(35f, 1.9f) to KEY_GRAY,
Pair(35f, 2.0f) to KEY_GRAY,
Pair(35f, 2.1f) to KEY_GRAY,
Pair(35f, 2.2f) to KEY_GRAY,
Pair(35f, 2.3f) to KEY_GRAY,
Pair(35f, 2.4f) to KEY_GRAY,
Pair(35f, 2.5f) to KEY_GRAY,
Pair(35f, 2.6f) to KEY_GRAY,
Pair(35f, 2.7f) to KEY_GRAY,
Pair(35f, 2.8f) to KEY_GRAY,
Pair(35f, 2.9f) to KEY_GRAY,
Pair(35f, 3.0f) to KEY_GRAY,
Pair(35f, 3.2f) to KEY_GRAY,
Pair(35f, 3.4f) to KEY_GRAY,
Pair(35f, 3.6f) to KEY_GRAY,
Pair(35f, 3.8f) to KEY_GRAY,
Pair(35f, 4.0f) to KEY_GRAY,
Pair(35f, 4.2f) to KEY_GRAY,
Pair(35f, 4.4f) to KEY_GRAY,
Pair(35f, 4.6f) to KEY_GRAY,
Pair(35f, 4.8f) to KEY_GRAY,
Pair(35f, 5.0f) to KEY_GRAY,
Pair(35f, 5.5f) to KEY_GRAY,
Pair(35f, 6.0f) to KEY_GRAY,
Pair(35f, 6.5f) to KEY_GRAY,
Pair(35f, 7.0f) to KEY_GRAY,
Pair(35f, 7.5f) to KEY_GRAY,
Pair(35f, 8.0f) to KEY_GRAY,
Pair(35f, 8.5f) to KEY_GRAY,
Pair(35f, 9.0f) to KEY_GRAY,
Pair(35f, 9.5f) to KEY_GRAY,
Pair(35f, 10.0f) to KEY_GRAY,
// Pulse Width = 40f
Pair(40f, 0.5f) to KEY_GRAY,
Pair(40f, 0.6f) to KEY_GRAY,
Pair(40f, 0.7f) to KEY_GRAY,
Pair(40f, 0.8f) to KEY_GRAY,
Pair(40f, 0.9f) to KEY_GRAY,
Pair(40f, 1.0f) to KEY_GRAY,
Pair(40f, 1.1f) to KEY_GRAY,
Pair(40f, 1.2f) to KEY_GRAY,
Pair(40f, 1.3f) to KEY_GRAY,
Pair(40f, 1.4f) to KEY_GRAY,
Pair(40f, 1.5f) to KEY_GRAY,
Pair(40f, 1.6f) to KEY_GRAY,
Pair(40f, 1.7f) to KEY_GRAY,
Pair(40f, 1.8f) to KEY_GRAY,
Pair(40f, 1.9f) to KEY_GRAY,
Pair(40f, 2.0f) to KEY_GRAY,
Pair(40f, 2.1f) to KEY_GRAY,
Pair(40f, 2.2f) to KEY_GRAY,
Pair(40f, 2.3f) to KEY_GRAY,
Pair(40f, 2.4f) to KEY_GRAY,
Pair(40f, 2.5f) to KEY_GRAY,
Pair(40f, 2.6f) to KEY_GRAY,
Pair(40f, 2.7f) to KEY_GRAY,
Pair(40f, 2.8f) to KEY_GRAY,
Pair(40f, 2.9f) to KEY_GRAY,
Pair(40f, 3.0f) to KEY_GRAY,
Pair(40f, 3.2f) to KEY_GRAY,
Pair(40f, 3.4f) to KEY_GRAY,
Pair(40f, 3.6f) to KEY_GRAY,
Pair(40f, 3.8f) to KEY_GRAY,
Pair(40f, 4.0f) to KEY_GRAY,
Pair(40f, 4.2f) to KEY_GRAY,
Pair(40f, 4.4f) to KEY_GRAY,
Pair(40f, 4.6f) to KEY_GRAY,
Pair(40f, 4.8f) to KEY_GRAY,
Pair(40f, 5.0f) to KEY_GRAY,
Pair(40f, 5.5f) to KEY_GRAY,
Pair(40f, 6.0f) to KEY_GRAY,
Pair(40f, 6.5f) to KEY_GRAY,
Pair(40f, 7.0f) to KEY_GRAY,
Pair(40f, 7.5f) to KEY_GRAY,
Pair(40f, 8.0f) to KEY_GRAY,
Pair(40f, 8.5f) to KEY_GRAY,
Pair(40f, 9.0f) to KEY_GRAY,
Pair(40f, 9.5f) to KEY_GRAY,
Pair(40f, 10.0f) to KEY_GRAY,
)

View File

@@ -0,0 +1,434 @@
package com.laseroptek.raman.const
//
// Hz Table4 (HANDPIENCE-12x12)
// - Map<Pair<Float, Float>, Int>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Fluence(J/cm²)>, HzType(Hz)>
//
val HzTable_12_12 = mapOf(
// Pulse Width = 0.5f
Pair(0.5f, 0.4f) to KEY_BLUE,
Pair(0.5f, 0.5f) to KEY_BLUE,
Pair(0.5f, 0.6f) to KEY_BLUE,
Pair(0.5f, 0.7f) to KEY_YELLOW,
Pair(0.5f, 0.8f) to KEY_YELLOW,
Pair(0.5f, 0.9f) to KEY_YELLOW,
Pair(0.5f, 1.0f) to KEY_YELLOW,
Pair(0.5f, 1.1f) to KEY_YELLOW,
Pair(0.5f, 1.2f) to KEY_YELLOW,
Pair(0.5f, 1.3f) to KEY_YELLOW,
// Pulse Width = 1f
Pair(1f, 0.4f) to KEY_YELLOW,
Pair(1f, 0.5f) to KEY_YELLOW,
Pair(1f, 0.6f) to KEY_YELLOW,
Pair(1f, 0.7f) to KEY_RED,
Pair(1f, 0.8f) to KEY_RED,
Pair(1f, 0.9f) to KEY_RED,
Pair(1f, 1.0f) to KEY_RED,
Pair(1f, 1.1f) to KEY_RED,
Pair(1f, 1.2f) to KEY_RED,
Pair(1f, 1.3f) to KEY_RED,
Pair(1f, 1.4f) to KEY_GRAY,
Pair(1f, 1.5f) to KEY_GRAY,
Pair(1f, 1.6f) to KEY_GRAY,
Pair(1f, 1.7f) to KEY_GRAY,
Pair(1f, 1.8f) to KEY_GRAY,
Pair(1f, 1.9f) to KEY_GRAY,
Pair(1f, 2.0f) to KEY_GRAY,
// Pulse Width = 1.5f
Pair(1.5f, 0.4f) to KEY_RED,
Pair(1.5f, 0.5f) to KEY_RED,
Pair(1.5f, 0.6f) to KEY_RED,
Pair(1.5f, 0.7f) to KEY_GRAY,
Pair(1.5f, 0.8f) to KEY_GRAY,
Pair(1.5f, 0.9f) to KEY_GRAY,
Pair(1.5f, 1.0f) to KEY_GRAY,
Pair(1.5f, 1.1f) to KEY_GRAY,
Pair(1.5f, 1.2f) to KEY_GRAY,
Pair(1.5f, 1.3f) to KEY_GRAY,
Pair(1.5f, 1.4f) to KEY_GRAY,
Pair(1.5f, 1.5f) to KEY_GRAY,
Pair(1.5f, 1.6f) to KEY_GRAY,
Pair(1.5f, 1.7f) to KEY_GRAY,
Pair(1.5f, 1.8f) to KEY_GRAY,
Pair(1.5f, 1.9f) to KEY_GRAY,
Pair(1.5f, 2.0f) to KEY_GRAY,
Pair(1.5f, 2.1f) to KEY_GRAY,
Pair(1.5f, 2.2f) to KEY_GRAY,
Pair(1.5f, 2.3f) to KEY_GRAY,
Pair(1.5f, 2.4f) to KEY_GRAY,
Pair(1.5f, 2.5f) to KEY_GRAY,
Pair(1.5f, 2.6f) to KEY_GRAY,
Pair(1.5f, 2.7f) to KEY_GRAY,
// Pulse Width = 3f
Pair(3f, 0.4f) to KEY_GRAY,
Pair(3f, 0.5f) to KEY_GRAY,
Pair(3f, 0.6f) to KEY_GRAY,
Pair(3f, 0.7f) to KEY_GRAY,
Pair(3f, 0.8f) to KEY_GRAY,
Pair(3f, 0.9f) to KEY_GRAY,
Pair(3f, 1.0f) to KEY_GRAY,
Pair(3f, 1.1f) to KEY_GRAY,
Pair(3f, 1.2f) to KEY_GRAY,
Pair(3f, 1.3f) to KEY_GRAY,
Pair(3f, 1.4f) to KEY_GRAY,
Pair(3f, 1.5f) to KEY_GRAY,
Pair(3f, 1.6f) to KEY_GRAY,
Pair(3f, 1.7f) to KEY_GRAY,
Pair(3f, 1.8f) to KEY_GRAY,
Pair(3f, 1.9f) to KEY_GRAY,
Pair(3f, 2.0f) to KEY_GRAY,
Pair(3f, 2.1f) to KEY_GRAY,
Pair(3f, 2.2f) to KEY_GRAY,
Pair(3f, 2.3f) to KEY_GRAY,
Pair(3f, 2.4f) to KEY_GRAY,
Pair(3f, 2.5f) to KEY_GRAY,
Pair(3f, 2.6f) to KEY_GRAY,
Pair(3f, 2.7f) to KEY_GRAY,
Pair(3f, 2.8f) to KEY_GRAY,
Pair(3f, 2.9f) to KEY_GRAY,
Pair(3f, 3.0f) to KEY_GRAY,
Pair(3f, 3.2f) to KEY_GRAY,
Pair(3f, 3.4f) to KEY_GRAY,
Pair(3f, 3.6f) to KEY_GRAY,
Pair(3f, 3.8f) to KEY_GRAY,
Pair(3f, 4.0f) to KEY_GRAY,
// Pulse Width = 5f
Pair(5f, 0.4f) to KEY_GRAY,
Pair(5f, 0.5f) to KEY_GRAY,
Pair(5f, 0.6f) to KEY_GRAY,
Pair(5f, 0.7f) to KEY_GRAY,
Pair(5f, 0.8f) to KEY_GRAY,
Pair(5f, 0.9f) to KEY_GRAY,
Pair(5f, 1.0f) to KEY_GRAY,
Pair(5f, 1.1f) to KEY_GRAY,
Pair(5f, 1.2f) to KEY_GRAY,
Pair(5f, 1.3f) to KEY_GRAY,
Pair(5f, 1.4f) to KEY_GRAY,
Pair(5f, 1.5f) to KEY_GRAY,
Pair(5f, 1.6f) to KEY_GRAY,
Pair(5f, 1.7f) to KEY_GRAY,
Pair(5f, 1.8f) to KEY_GRAY,
Pair(5f, 1.9f) to KEY_GRAY,
Pair(5f, 2.0f) to KEY_GRAY,
Pair(5f, 2.1f) to KEY_GRAY,
Pair(5f, 2.2f) to KEY_GRAY,
Pair(5f, 2.3f) to KEY_GRAY,
Pair(5f, 2.4f) to KEY_GRAY,
Pair(5f, 2.5f) to KEY_GRAY,
Pair(5f, 2.6f) to KEY_GRAY,
Pair(5f, 2.7f) to KEY_GRAY,
Pair(5f, 2.8f) to KEY_GRAY,
Pair(5f, 2.9f) to KEY_GRAY,
Pair(5f, 3.0f) to KEY_GRAY,
Pair(5f, 3.2f) to KEY_GRAY,
Pair(5f, 3.4f) to KEY_GRAY,
Pair(5f, 3.6f) to KEY_GRAY,
Pair(5f, 3.8f) to KEY_GRAY,
Pair(5f, 4.0f) to KEY_GRAY,
Pair(5f, 4.2f) to KEY_GRAY,
Pair(5f, 4.4f) to KEY_GRAY,
Pair(5f, 4.6f) to KEY_GRAY,
Pair(5f, 4.8f) to KEY_GRAY,
// Pulse Width = 10f
Pair(10f, 0.4f) to KEY_GRAY,
Pair(10f, 0.5f) to KEY_GRAY,
Pair(10f, 0.6f) to KEY_GRAY,
Pair(10f, 0.7f) to KEY_GRAY,
Pair(10f, 0.8f) to KEY_GRAY,
Pair(10f, 0.9f) to KEY_GRAY,
Pair(10f, 1.0f) to KEY_GRAY,
Pair(10f, 1.1f) to KEY_GRAY,
Pair(10f, 1.2f) to KEY_GRAY,
Pair(10f, 1.3f) to KEY_GRAY,
Pair(10f, 1.4f) to KEY_GRAY,
Pair(10f, 1.5f) to KEY_GRAY,
Pair(10f, 1.6f) to KEY_GRAY,
Pair(10f, 1.7f) to KEY_GRAY,
Pair(10f, 1.8f) to KEY_GRAY,
Pair(10f, 1.9f) to KEY_GRAY,
Pair(10f, 2.0f) to KEY_GRAY,
Pair(10f, 2.1f) to KEY_GRAY,
Pair(10f, 2.2f) to KEY_GRAY,
Pair(10f, 2.3f) to KEY_GRAY,
Pair(10f, 2.4f) to KEY_GRAY,
Pair(10f, 2.5f) to KEY_GRAY,
Pair(10f, 2.6f) to KEY_GRAY,
Pair(10f, 2.7f) to KEY_GRAY,
Pair(10f, 2.8f) to KEY_GRAY,
Pair(10f, 2.9f) to KEY_GRAY,
Pair(10f, 3.0f) to KEY_GRAY,
Pair(10f, 3.2f) to KEY_GRAY,
Pair(10f, 3.4f) to KEY_GRAY,
Pair(10f, 3.6f) to KEY_GRAY,
Pair(10f, 3.8f) to KEY_GRAY,
Pair(10f, 4.0f) to KEY_GRAY,
Pair(10f, 4.2f) to KEY_GRAY,
Pair(10f, 4.4f) to KEY_GRAY,
Pair(10f, 4.6f) to KEY_GRAY,
Pair(10f, 4.8f) to KEY_GRAY,
Pair(10f, 5.0f) to KEY_GRAY,
Pair(10f, 5.5f) to KEY_GRAY,
Pair(10f, 6.0f) to KEY_GRAY,
Pair(10f, 6.5f) to KEY_GRAY,
// Pulse Width = 15f
Pair(15f, 0.4f) to KEY_GRAY,
Pair(15f, 0.5f) to KEY_GRAY,
Pair(15f, 0.6f) to KEY_GRAY,
Pair(15f, 0.7f) to KEY_GRAY,
Pair(15f, 0.8f) to KEY_GRAY,
Pair(15f, 0.9f) to KEY_GRAY,
Pair(15f, 1.0f) to KEY_GRAY,
Pair(15f, 1.1f) to KEY_GRAY,
Pair(15f, 1.2f) to KEY_GRAY,
Pair(15f, 1.3f) to KEY_GRAY,
Pair(15f, 1.4f) to KEY_GRAY,
Pair(15f, 1.5f) to KEY_GRAY,
Pair(15f, 1.6f) to KEY_GRAY,
Pair(15f, 1.7f) to KEY_GRAY,
Pair(15f, 1.8f) to KEY_GRAY,
Pair(15f, 1.9f) to KEY_GRAY,
Pair(15f, 2.0f) to KEY_GRAY,
Pair(15f, 2.1f) to KEY_GRAY,
Pair(15f, 2.2f) to KEY_GRAY,
Pair(15f, 2.3f) to KEY_GRAY,
Pair(15f, 2.4f) to KEY_GRAY,
Pair(15f, 2.5f) to KEY_GRAY,
Pair(15f, 2.6f) to KEY_GRAY,
Pair(15f, 2.7f) to KEY_GRAY,
Pair(15f, 2.8f) to KEY_GRAY,
Pair(15f, 2.9f) to KEY_GRAY,
Pair(15f, 3.0f) to KEY_GRAY,
Pair(15f, 3.2f) to KEY_GRAY,
Pair(15f, 3.4f) to KEY_GRAY,
Pair(15f, 3.6f) to KEY_GRAY,
Pair(15f, 3.8f) to KEY_GRAY,
Pair(15f, 4.0f) to KEY_GRAY,
Pair(15f, 4.2f) to KEY_GRAY,
Pair(15f, 4.4f) to KEY_GRAY,
Pair(15f, 4.6f) to KEY_GRAY,
Pair(15f, 4.8f) to KEY_GRAY,
Pair(15f, 5.0f) to KEY_GRAY,
Pair(15f, 5.5f) to KEY_GRAY,
Pair(15f, 6.0f) to KEY_GRAY,
Pair(15f, 6.5f) to KEY_GRAY,
// Pulse Width = 20f
Pair(20f, 0.4f) to KEY_GRAY,
Pair(20f, 0.5f) to KEY_GRAY,
Pair(20f, 0.6f) to KEY_GRAY,
Pair(20f, 0.7f) to KEY_GRAY,
Pair(20f, 0.8f) to KEY_GRAY,
Pair(20f, 0.9f) to KEY_GRAY,
Pair(20f, 1.0f) to KEY_GRAY,
Pair(20f, 1.1f) to KEY_GRAY,
Pair(20f, 1.2f) to KEY_GRAY,
Pair(20f, 1.3f) to KEY_GRAY,
Pair(20f, 1.4f) to KEY_GRAY,
Pair(20f, 1.5f) to KEY_GRAY,
Pair(20f, 1.6f) to KEY_GRAY,
Pair(20f, 1.7f) to KEY_GRAY,
Pair(20f, 1.8f) to KEY_GRAY,
Pair(20f, 1.9f) to KEY_GRAY,
Pair(20f, 2.0f) to KEY_GRAY,
Pair(20f, 2.1f) to KEY_GRAY,
Pair(20f, 2.2f) to KEY_GRAY,
Pair(20f, 2.3f) to KEY_GRAY,
Pair(20f, 2.4f) to KEY_GRAY,
Pair(20f, 2.5f) to KEY_GRAY,
Pair(20f, 2.6f) to KEY_GRAY,
Pair(20f, 2.7f) to KEY_GRAY,
Pair(20f, 2.8f) to KEY_GRAY,
Pair(20f, 2.9f) to KEY_GRAY,
Pair(20f, 3.0f) to KEY_GRAY,
Pair(20f, 3.2f) to KEY_GRAY,
Pair(20f, 3.4f) to KEY_GRAY,
Pair(20f, 3.6f) to KEY_GRAY,
Pair(20f, 3.8f) to KEY_GRAY,
Pair(20f, 4.0f) to KEY_GRAY,
Pair(20f, 4.2f) to KEY_GRAY,
Pair(20f, 4.4f) to KEY_GRAY,
Pair(20f, 4.6f) to KEY_GRAY,
Pair(20f, 4.8f) to KEY_GRAY,
Pair(20f, 5.0f) to KEY_GRAY,
Pair(20f, 5.5f) to KEY_GRAY,
Pair(20f, 6.0f) to KEY_GRAY,
Pair(20f, 6.5f) to KEY_GRAY,
// Pulse Width = 25f
Pair(25f, 0.4f) to KEY_GRAY,
Pair(25f, 0.5f) to KEY_GRAY,
Pair(25f, 0.6f) to KEY_GRAY,
Pair(25f, 0.7f) to KEY_GRAY,
Pair(25f, 0.8f) to KEY_GRAY,
Pair(25f, 0.9f) to KEY_GRAY,
Pair(25f, 1.0f) to KEY_GRAY,
Pair(25f, 1.1f) to KEY_GRAY,
Pair(25f, 1.2f) to KEY_GRAY,
Pair(25f, 1.3f) to KEY_GRAY,
Pair(25f, 1.4f) to KEY_GRAY,
Pair(25f, 1.5f) to KEY_GRAY,
Pair(25f, 1.6f) to KEY_GRAY,
Pair(25f, 1.7f) to KEY_GRAY,
Pair(25f, 1.8f) to KEY_GRAY,
Pair(25f, 1.9f) to KEY_GRAY,
Pair(25f, 2.0f) to KEY_GRAY,
Pair(25f, 2.1f) to KEY_GRAY,
Pair(25f, 2.2f) to KEY_GRAY,
Pair(25f, 2.3f) to KEY_GRAY,
Pair(25f, 2.4f) to KEY_GRAY,
Pair(25f, 2.5f) to KEY_GRAY,
Pair(25f, 2.6f) to KEY_GRAY,
Pair(25f, 2.7f) to KEY_GRAY,
Pair(25f, 2.8f) to KEY_GRAY,
Pair(25f, 2.9f) to KEY_GRAY,
Pair(25f, 3.0f) to KEY_GRAY,
Pair(25f, 3.2f) to KEY_GRAY,
Pair(25f, 3.4f) to KEY_GRAY,
Pair(25f, 3.6f) to KEY_GRAY,
Pair(25f, 3.8f) to KEY_GRAY,
Pair(25f, 4.0f) to KEY_GRAY,
Pair(25f, 4.2f) to KEY_GRAY,
Pair(25f, 4.4f) to KEY_GRAY,
Pair(25f, 4.6f) to KEY_GRAY,
Pair(25f, 4.8f) to KEY_GRAY,
Pair(25f, 5.0f) to KEY_GRAY,
Pair(25f, 5.5f) to KEY_GRAY,
Pair(25f, 6.0f) to KEY_GRAY,
Pair(25f, 6.5f) to KEY_GRAY,
// Pulse Width = 30f
Pair(30f, 0.4f) to KEY_GRAY,
Pair(30f, 0.5f) to KEY_GRAY,
Pair(30f, 0.6f) to KEY_GRAY,
Pair(30f, 0.7f) to KEY_GRAY,
Pair(30f, 0.8f) to KEY_GRAY,
Pair(30f, 0.9f) to KEY_GRAY,
Pair(30f, 1.0f) to KEY_GRAY,
Pair(30f, 1.1f) to KEY_GRAY,
Pair(30f, 1.2f) to KEY_GRAY,
Pair(30f, 1.3f) to KEY_GRAY,
Pair(30f, 1.4f) to KEY_GRAY,
Pair(30f, 1.5f) to KEY_GRAY,
Pair(30f, 1.6f) to KEY_GRAY,
Pair(30f, 1.7f) to KEY_GRAY,
Pair(30f, 1.8f) to KEY_GRAY,
Pair(30f, 1.9f) to KEY_GRAY,
Pair(30f, 2.0f) to KEY_GRAY,
Pair(30f, 2.1f) to KEY_GRAY,
Pair(30f, 2.2f) to KEY_GRAY,
Pair(30f, 2.3f) to KEY_GRAY,
Pair(30f, 2.4f) to KEY_GRAY,
Pair(30f, 2.5f) to KEY_GRAY,
Pair(30f, 2.6f) to KEY_GRAY,
Pair(30f, 2.7f) to KEY_GRAY,
Pair(30f, 2.8f) to KEY_GRAY,
Pair(30f, 2.9f) to KEY_GRAY,
Pair(30f, 3.0f) to KEY_GRAY,
Pair(30f, 3.2f) to KEY_GRAY,
Pair(30f, 3.4f) to KEY_GRAY,
Pair(30f, 3.6f) to KEY_GRAY,
Pair(30f, 3.8f) to KEY_GRAY,
Pair(30f, 4.0f) to KEY_GRAY,
Pair(30f, 4.2f) to KEY_GRAY,
Pair(30f, 4.4f) to KEY_GRAY,
Pair(30f, 4.6f) to KEY_GRAY,
Pair(30f, 4.8f) to KEY_GRAY,
Pair(30f, 5.0f) to KEY_GRAY,
Pair(30f, 5.5f) to KEY_GRAY,
Pair(30f, 6.0f) to KEY_GRAY,
Pair(30f, 6.5f) to KEY_GRAY,
// Pulse Width = 35f
Pair(35f, 0.4f) to KEY_GRAY,
Pair(35f, 0.5f) to KEY_GRAY,
Pair(35f, 0.6f) to KEY_GRAY,
Pair(35f, 0.7f) to KEY_GRAY,
Pair(35f, 0.8f) to KEY_GRAY,
Pair(35f, 0.9f) to KEY_GRAY,
Pair(35f, 1.0f) to KEY_GRAY,
Pair(35f, 1.1f) to KEY_GRAY,
Pair(35f, 1.2f) to KEY_GRAY,
Pair(35f, 1.3f) to KEY_GRAY,
Pair(35f, 1.4f) to KEY_GRAY,
Pair(35f, 1.5f) to KEY_GRAY,
Pair(35f, 1.6f) to KEY_GRAY,
Pair(35f, 1.7f) to KEY_GRAY,
Pair(35f, 1.8f) to KEY_GRAY,
Pair(35f, 1.9f) to KEY_GRAY,
Pair(35f, 2.0f) to KEY_GRAY,
Pair(35f, 2.1f) to KEY_GRAY,
Pair(35f, 2.2f) to KEY_GRAY,
Pair(35f, 2.3f) to KEY_GRAY,
Pair(35f, 2.4f) to KEY_GRAY,
Pair(35f, 2.5f) to KEY_GRAY,
Pair(35f, 2.6f) to KEY_GRAY,
Pair(35f, 2.7f) to KEY_GRAY,
Pair(35f, 2.8f) to KEY_GRAY,
Pair(35f, 2.9f) to KEY_GRAY,
Pair(35f, 3.0f) to KEY_GRAY,
Pair(35f, 3.2f) to KEY_GRAY,
Pair(35f, 3.4f) to KEY_GRAY,
Pair(35f, 3.6f) to KEY_GRAY,
Pair(35f, 3.8f) to KEY_GRAY,
Pair(35f, 4.0f) to KEY_GRAY,
Pair(35f, 4.2f) to KEY_GRAY,
Pair(35f, 4.4f) to KEY_GRAY,
Pair(35f, 4.6f) to KEY_GRAY,
Pair(35f, 4.8f) to KEY_GRAY,
Pair(35f, 5.0f) to KEY_GRAY,
Pair(35f, 5.5f) to KEY_GRAY,
Pair(35f, 6.0f) to KEY_GRAY,
Pair(35f, 6.5f) to KEY_GRAY,
// Pulse Width = 40f
Pair(40f, 0.4f) to KEY_GRAY,
Pair(40f, 0.5f) to KEY_GRAY,
Pair(40f, 0.6f) to KEY_GRAY,
Pair(40f, 0.7f) to KEY_GRAY,
Pair(40f, 0.8f) to KEY_GRAY,
Pair(40f, 0.9f) to KEY_GRAY,
Pair(40f, 1.0f) to KEY_GRAY,
Pair(40f, 1.1f) to KEY_GRAY,
Pair(40f, 1.2f) to KEY_GRAY,
Pair(40f, 1.3f) to KEY_GRAY,
Pair(40f, 1.4f) to KEY_GRAY,
Pair(40f, 1.5f) to KEY_GRAY,
Pair(40f, 1.6f) to KEY_GRAY,
Pair(40f, 1.7f) to KEY_GRAY,
Pair(40f, 1.8f) to KEY_GRAY,
Pair(40f, 1.9f) to KEY_GRAY,
Pair(40f, 2.0f) to KEY_GRAY,
Pair(40f, 2.1f) to KEY_GRAY,
Pair(40f, 2.2f) to KEY_GRAY,
Pair(40f, 2.3f) to KEY_GRAY,
Pair(40f, 2.4f) to KEY_GRAY,
Pair(40f, 2.5f) to KEY_GRAY,
Pair(40f, 2.6f) to KEY_GRAY,
Pair(40f, 2.7f) to KEY_GRAY,
Pair(40f, 2.8f) to KEY_GRAY,
Pair(40f, 2.9f) to KEY_GRAY,
Pair(40f, 3.0f) to KEY_GRAY,
Pair(40f, 3.2f) to KEY_GRAY,
Pair(40f, 3.4f) to KEY_GRAY,
Pair(40f, 3.6f) to KEY_GRAY,
Pair(40f, 3.8f) to KEY_GRAY,
Pair(40f, 4.0f) to KEY_GRAY,
Pair(40f, 4.2f) to KEY_GRAY,
Pair(40f, 4.4f) to KEY_GRAY,
Pair(40f, 4.6f) to KEY_GRAY,
Pair(40f, 4.8f) to KEY_GRAY,
Pair(40f, 5.0f) to KEY_GRAY,
Pair(40f, 5.5f) to KEY_GRAY,
Pair(40f, 6.0f) to KEY_GRAY,
Pair(40f, 6.5f) to KEY_GRAY,
)

View File

@@ -0,0 +1,572 @@
package com.laseroptek.raman.const
//
// Hz Table5 (HANDPIENCE-3x15)
// - Map<Pair<Float, Float>, Int>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Fluence(J/cm²)>, HzType(int)>
//
val HzTable_3_15 = mapOf(
// Pulse Width = 0.5f
Pair(0.5f, 1.2f) to KEY_BLUE,
Pair(0.5f, 1.3f) to KEY_BLUE,
Pair(0.5f, 1.4f) to KEY_BLUE,
Pair(0.5f, 1.5f) to KEY_BLUE,
Pair(0.5f, 1.6f) to KEY_BLUE,
Pair(0.5f, 1.7f) to KEY_BLUE,
Pair(0.5f, 1.8f) to KEY_BLUE,
Pair(0.5f, 1.9f) to KEY_BLUE,
Pair(0.5f, 2.0f) to KEY_BLUE,
Pair(0.5f, 2.1f) to KEY_BLUE,
Pair(0.5f, 2.2f) to KEY_BLUE,
Pair(0.5f, 2.3f) to KEY_YELLOW,
Pair(0.5f, 2.4f) to KEY_YELLOW,
Pair(0.5f, 2.5f) to KEY_YELLOW,
Pair(0.5f, 2.6f) to KEY_YELLOW,
Pair(0.5f, 2.7f) to KEY_YELLOW,
Pair(0.5f, 2.8f) to KEY_YELLOW,
Pair(0.5f, 2.9f) to KEY_YELLOW,
Pair(0.5f, 3.0f) to KEY_YELLOW,
Pair(0.5f, 3.2f) to KEY_YELLOW,
Pair(0.5f, 3.4f) to KEY_YELLOW,
Pair(0.5f, 3.6f) to KEY_YELLOW,
Pair(0.5f, 3.8f) to KEY_YELLOW,
Pair(0.5f, 4.0f) to KEY_YELLOW,
Pair(0.5f, 4.2f) to KEY_YELLOW,
Pair(0.5f, 4.4f) to KEY_YELLOW,
// Pulse Width = 1f
Pair(1f, 1.2f) to KEY_YELLOW,
Pair(1f, 1.3f) to KEY_YELLOW,
Pair(1f, 1.4f) to KEY_YELLOW,
Pair(1f, 1.5f) to KEY_YELLOW,
Pair(1f, 1.6f) to KEY_YELLOW,
Pair(1f, 1.7f) to KEY_YELLOW,
Pair(1f, 1.8f) to KEY_YELLOW,
Pair(1f, 1.9f) to KEY_YELLOW,
Pair(1f, 2.0f) to KEY_YELLOW,
Pair(1f, 2.1f) to KEY_YELLOW,
Pair(1f, 2.2f) to KEY_YELLOW,
Pair(1f, 2.3f) to KEY_RED,
Pair(1f, 2.4f) to KEY_RED,
Pair(1f, 2.5f) to KEY_RED,
Pair(1f, 2.6f) to KEY_RED,
Pair(1f, 2.7f) to KEY_RED,
Pair(1f, 2.8f) to KEY_RED,
Pair(1f, 2.9f) to KEY_RED,
Pair(1f, 3.0f) to KEY_RED,
Pair(1f, 3.2f) to KEY_RED,
Pair(1f, 3.4f) to KEY_RED,
Pair(1f, 3.6f) to KEY_RED,
Pair(1f, 3.8f) to KEY_RED,
Pair(1f, 4.0f) to KEY_RED,
Pair(1f, 4.2f) to KEY_RED,
Pair(1f, 4.4f) to KEY_RED,
Pair(1f, 4.6f) to KEY_GRAY,
Pair(1f, 4.8f) to KEY_GRAY,
Pair(1f, 5.0f) to KEY_GRAY,
Pair(1f, 5.5f) to KEY_GRAY,
Pair(1f, 6.0f) to KEY_GRAY,
Pair(1f, 6.5f) to KEY_GRAY,
// Pulse Width = 1.5f
Pair(1.5f, 1.2f) to KEY_RED,
Pair(1.5f, 1.3f) to KEY_RED,
Pair(1.5f, 1.4f) to KEY_RED,
Pair(1.5f, 1.5f) to KEY_RED,
Pair(1.5f, 1.6f) to KEY_RED,
Pair(1.5f, 1.7f) to KEY_RED,
Pair(1.5f, 1.8f) to KEY_RED,
Pair(1.5f, 1.9f) to KEY_RED,
Pair(1.5f, 2.0f) to KEY_RED,
Pair(1.5f, 2.1f) to KEY_RED,
Pair(1.5f, 2.2f) to KEY_RED,
Pair(1.5f, 2.3f) to KEY_GRAY,
Pair(1.5f, 2.4f) to KEY_GRAY,
Pair(1.5f, 2.5f) to KEY_GRAY,
Pair(1.5f, 2.6f) to KEY_GRAY,
Pair(1.5f, 2.7f) to KEY_GRAY,
Pair(1.5f, 2.8f) to KEY_GRAY,
Pair(1.5f, 2.9f) to KEY_GRAY,
Pair(1.5f, 3.0f) to KEY_GRAY,
Pair(1.5f, 3.2f) to KEY_GRAY,
Pair(1.5f, 3.4f) to KEY_GRAY,
Pair(1.5f, 3.6f) to KEY_GRAY,
Pair(1.5f, 3.8f) to KEY_GRAY,
Pair(1.5f, 4.0f) to KEY_GRAY,
Pair(1.5f, 4.2f) to KEY_GRAY,
Pair(1.5f, 4.4f) to KEY_GRAY,
Pair(1.5f, 4.6f) to KEY_GRAY,
Pair(1.5f, 4.8f) to KEY_GRAY,
Pair(1.5f, 5.0f) to KEY_GRAY,
Pair(1.5f, 5.5f) to KEY_GRAY,
Pair(1.5f, 6.0f) to KEY_GRAY,
Pair(1.5f, 6.5f) to KEY_GRAY,
Pair(1.5f, 7.0f) to KEY_GRAY,
Pair(1.5f, 7.5f) to KEY_GRAY,
Pair(1.5f, 8.0f) to KEY_GRAY,
Pair(1.5f, 8.5f) to KEY_GRAY,
// Pulse Width = 3f
Pair(3f, 1.2f) to KEY_GRAY,
Pair(3f, 1.3f) to KEY_GRAY,
Pair(3f, 1.4f) to KEY_GRAY,
Pair(3f, 1.5f) to KEY_GRAY,
Pair(3f, 1.6f) to KEY_GRAY,
Pair(3f, 1.7f) to KEY_GRAY,
Pair(3f, 1.8f) to KEY_GRAY,
Pair(3f, 1.9f) to KEY_GRAY,
Pair(3f, 2.0f) to KEY_GRAY,
Pair(3f, 2.1f) to KEY_GRAY,
Pair(3f, 2.2f) to KEY_GRAY,
Pair(3f, 2.3f) to KEY_GRAY,
Pair(3f, 2.4f) to KEY_GRAY,
Pair(3f, 2.5f) to KEY_GRAY,
Pair(3f, 2.6f) to KEY_GRAY,
Pair(3f, 2.7f) to KEY_GRAY,
Pair(3f, 2.8f) to KEY_GRAY,
Pair(3f, 2.9f) to KEY_GRAY,
Pair(3f, 3.0f) to KEY_GRAY,
Pair(3f, 3.2f) to KEY_GRAY,
Pair(3f, 3.4f) to KEY_GRAY,
Pair(3f, 3.6f) to KEY_GRAY,
Pair(3f, 3.8f) to KEY_GRAY,
Pair(3f, 4.0f) to KEY_GRAY,
Pair(3f, 4.2f) to KEY_GRAY,
Pair(3f, 4.4f) to KEY_GRAY,
Pair(3f, 4.6f) to KEY_GRAY,
Pair(3f, 4.8f) to KEY_GRAY,
Pair(3f, 5.0f) to KEY_GRAY,
Pair(3f, 5.5f) to KEY_GRAY,
Pair(3f, 6.0f) to KEY_GRAY,
Pair(3f, 6.5f) to KEY_GRAY,
Pair(3f, 7.0f) to KEY_GRAY,
Pair(3f, 7.5f) to KEY_GRAY,
Pair(3f, 8.0f) to KEY_GRAY,
Pair(3f, 8.5f) to KEY_GRAY,
Pair(3f, 9.0f) to KEY_GRAY,
Pair(3f, 9.5f) to KEY_GRAY,
Pair(3f, 10.0f) to KEY_GRAY,
Pair(3f, 11.0f) to KEY_GRAY,
Pair(3f, 12.0f) to KEY_GRAY,
Pair(3f, 13.0f) to KEY_GRAY,
// Pulse Width = 5f
Pair(5f, 1.2f) to KEY_GRAY,
Pair(5f, 1.3f) to KEY_GRAY,
Pair(5f, 1.4f) to KEY_GRAY,
Pair(5f, 1.5f) to KEY_GRAY,
Pair(5f, 1.6f) to KEY_GRAY,
Pair(5f, 1.7f) to KEY_GRAY,
Pair(5f, 1.8f) to KEY_GRAY,
Pair(5f, 1.9f) to KEY_GRAY,
Pair(5f, 2.0f) to KEY_GRAY,
Pair(5f, 2.1f) to KEY_GRAY,
Pair(5f, 2.2f) to KEY_GRAY,
Pair(5f, 2.3f) to KEY_GRAY,
Pair(5f, 2.4f) to KEY_GRAY,
Pair(5f, 2.5f) to KEY_GRAY,
Pair(5f, 2.6f) to KEY_GRAY,
Pair(5f, 2.7f) to KEY_GRAY,
Pair(5f, 2.8f) to KEY_GRAY,
Pair(5f, 2.9f) to KEY_GRAY,
Pair(5f, 3.0f) to KEY_GRAY,
Pair(5f, 3.2f) to KEY_GRAY,
Pair(5f, 3.4f) to KEY_GRAY,
Pair(5f, 3.6f) to KEY_GRAY,
Pair(5f, 3.8f) to KEY_GRAY,
Pair(5f, 4.0f) to KEY_GRAY,
Pair(5f, 4.2f) to KEY_GRAY,
Pair(5f, 4.4f) to KEY_GRAY,
Pair(5f, 4.6f) to KEY_GRAY,
Pair(5f, 4.8f) to KEY_GRAY,
Pair(5f, 5.0f) to KEY_GRAY,
Pair(5f, 5.5f) to KEY_GRAY,
Pair(5f, 6.0f) to KEY_GRAY,
Pair(5f, 6.5f) to KEY_GRAY,
Pair(5f, 7.0f) to KEY_GRAY,
Pair(5f, 7.5f) to KEY_GRAY,
Pair(5f, 8.0f) to KEY_GRAY,
Pair(5f, 8.5f) to KEY_GRAY,
Pair(5f, 9.0f) to KEY_GRAY,
Pair(5f, 9.5f) to KEY_GRAY,
Pair(5f, 10.0f) to KEY_GRAY,
Pair(5f, 11.0f) to KEY_GRAY,
Pair(5f, 12.0f) to KEY_GRAY,
Pair(5f, 13.0f) to KEY_GRAY,
Pair(5f, 14.0f) to KEY_GRAY,
Pair(5f, 15.0f) to KEY_GRAY,
// Pulse Width = 10f
Pair(10f, 1.2f) to KEY_GRAY,
Pair(10f, 1.3f) to KEY_GRAY,
Pair(10f, 1.4f) to KEY_GRAY,
Pair(10f, 1.5f) to KEY_GRAY,
Pair(10f, 1.6f) to KEY_GRAY,
Pair(10f, 1.7f) to KEY_GRAY,
Pair(10f, 1.8f) to KEY_GRAY,
Pair(10f, 1.9f) to KEY_GRAY,
Pair(10f, 2.0f) to KEY_GRAY,
Pair(10f, 2.1f) to KEY_GRAY,
Pair(10f, 2.2f) to KEY_GRAY,
Pair(10f, 2.3f) to KEY_GRAY,
Pair(10f, 2.4f) to KEY_GRAY,
Pair(10f, 2.5f) to KEY_GRAY,
Pair(10f, 2.6f) to KEY_GRAY,
Pair(10f, 2.7f) to KEY_GRAY,
Pair(10f, 2.8f) to KEY_GRAY,
Pair(10f, 2.9f) to KEY_GRAY,
Pair(10f, 3.0f) to KEY_GRAY,
Pair(10f, 3.2f) to KEY_GRAY,
Pair(10f, 3.4f) to KEY_GRAY,
Pair(10f, 3.6f) to KEY_GRAY,
Pair(10f, 3.8f) to KEY_GRAY,
Pair(10f, 4.0f) to KEY_GRAY,
Pair(10f, 4.2f) to KEY_GRAY,
Pair(10f, 4.4f) to KEY_GRAY,
Pair(10f, 4.6f) to KEY_GRAY,
Pair(10f, 4.8f) to KEY_GRAY,
Pair(10f, 5.0f) to KEY_GRAY,
Pair(10f, 5.5f) to KEY_GRAY,
Pair(10f, 6.0f) to KEY_GRAY,
Pair(10f, 6.5f) to KEY_GRAY,
Pair(10f, 7.0f) to KEY_GRAY,
Pair(10f, 7.5f) to KEY_GRAY,
Pair(10f, 8.0f) to KEY_GRAY,
Pair(10f, 8.5f) to KEY_GRAY,
Pair(10f, 9.0f) to KEY_GRAY,
Pair(10f, 9.5f) to KEY_GRAY,
Pair(10f, 10.0f) to KEY_GRAY,
Pair(10f, 11.0f) to KEY_GRAY,
Pair(10f, 12.0f) to KEY_GRAY,
Pair(10f, 13.0f) to KEY_GRAY,
Pair(10f, 14.0f) to KEY_GRAY,
Pair(10f, 15.0f) to KEY_GRAY,
Pair(10f, 16.0f) to KEY_GRAY,
Pair(10f, 17.0f) to KEY_GRAY,
Pair(10f, 18.0f) to KEY_GRAY,
Pair(10f, 19.0f) to KEY_GRAY,
Pair(10f, 20.0f) to KEY_GRAY,
Pair(10f, 21.0f) to KEY_GRAY,
Pair(10f, 22.0f) to KEY_GRAY,
// Pulse Width = 15f
Pair(15f, 1.2f) to KEY_GRAY,
Pair(15f, 1.3f) to KEY_GRAY,
Pair(15f, 1.4f) to KEY_GRAY,
Pair(15f, 1.5f) to KEY_GRAY,
Pair(15f, 1.6f) to KEY_GRAY,
Pair(15f, 1.7f) to KEY_GRAY,
Pair(15f, 1.8f) to KEY_GRAY,
Pair(15f, 1.9f) to KEY_GRAY,
Pair(15f, 2.0f) to KEY_GRAY,
Pair(15f, 2.1f) to KEY_GRAY,
Pair(15f, 2.2f) to KEY_GRAY,
Pair(15f, 2.3f) to KEY_GRAY,
Pair(15f, 2.4f) to KEY_GRAY,
Pair(15f, 2.5f) to KEY_GRAY,
Pair(15f, 2.6f) to KEY_GRAY,
Pair(15f, 2.7f) to KEY_GRAY,
Pair(15f, 2.8f) to KEY_GRAY,
Pair(15f, 2.9f) to KEY_GRAY,
Pair(15f, 3.0f) to KEY_GRAY,
Pair(15f, 3.2f) to KEY_GRAY,
Pair(15f, 3.4f) to KEY_GRAY,
Pair(15f, 3.6f) to KEY_GRAY,
Pair(15f, 3.8f) to KEY_GRAY,
Pair(15f, 4.0f) to KEY_GRAY,
Pair(15f, 4.2f) to KEY_GRAY,
Pair(15f, 4.4f) to KEY_GRAY,
Pair(15f, 4.6f) to KEY_GRAY,
Pair(15f, 4.8f) to KEY_GRAY,
Pair(15f, 5.0f) to KEY_GRAY,
Pair(15f, 5.5f) to KEY_GRAY,
Pair(15f, 6.0f) to KEY_GRAY,
Pair(15f, 6.5f) to KEY_GRAY,
Pair(15f, 7.0f) to KEY_GRAY,
Pair(15f, 7.5f) to KEY_GRAY,
Pair(15f, 8.0f) to KEY_GRAY,
Pair(15f, 8.5f) to KEY_GRAY,
Pair(15f, 9.0f) to KEY_GRAY,
Pair(15f, 9.5f) to KEY_GRAY,
Pair(15f, 10.0f) to KEY_GRAY,
Pair(15f, 11.0f) to KEY_GRAY,
Pair(15f, 12.0f) to KEY_GRAY,
Pair(15f, 13.0f) to KEY_GRAY,
Pair(15f, 14.0f) to KEY_GRAY,
Pair(15f, 15.0f) to KEY_GRAY,
Pair(15f, 16.0f) to KEY_GRAY,
Pair(15f, 17.0f) to KEY_GRAY,
Pair(15f, 18.0f) to KEY_GRAY,
Pair(15f, 19.0f) to KEY_GRAY,
Pair(15f, 20.0f) to KEY_GRAY,
Pair(15f, 21.0f) to KEY_GRAY,
Pair(15f, 22.0f) to KEY_GRAY,
// Pulse Width = 20f
Pair(20f, 1.2f) to KEY_GRAY,
Pair(20f, 1.3f) to KEY_GRAY,
Pair(20f, 1.4f) to KEY_GRAY,
Pair(20f, 1.5f) to KEY_GRAY,
Pair(20f, 1.6f) to KEY_GRAY,
Pair(20f, 1.7f) to KEY_GRAY,
Pair(20f, 1.8f) to KEY_GRAY,
Pair(20f, 1.9f) to KEY_GRAY,
Pair(20f, 2.0f) to KEY_GRAY,
Pair(20f, 2.1f) to KEY_GRAY,
Pair(20f, 2.2f) to KEY_GRAY,
Pair(20f, 2.3f) to KEY_GRAY,
Pair(20f, 2.4f) to KEY_GRAY,
Pair(20f, 2.5f) to KEY_GRAY,
Pair(20f, 2.6f) to KEY_GRAY,
Pair(20f, 2.7f) to KEY_GRAY,
Pair(20f, 2.8f) to KEY_GRAY,
Pair(20f, 2.9f) to KEY_GRAY,
Pair(20f, 3.0f) to KEY_GRAY,
Pair(20f, 3.2f) to KEY_GRAY,
Pair(20f, 3.4f) to KEY_GRAY,
Pair(20f, 3.6f) to KEY_GRAY,
Pair(20f, 3.8f) to KEY_GRAY,
Pair(20f, 4.0f) to KEY_GRAY,
Pair(20f, 4.2f) to KEY_GRAY,
Pair(20f, 4.4f) to KEY_GRAY,
Pair(20f, 4.6f) to KEY_GRAY,
Pair(20f, 4.8f) to KEY_GRAY,
Pair(20f, 5.0f) to KEY_GRAY,
Pair(20f, 5.5f) to KEY_GRAY,
Pair(20f, 6.0f) to KEY_GRAY,
Pair(20f, 6.5f) to KEY_GRAY,
Pair(20f, 7.0f) to KEY_GRAY,
Pair(20f, 7.5f) to KEY_GRAY,
Pair(20f, 8.0f) to KEY_GRAY,
Pair(20f, 8.5f) to KEY_GRAY,
Pair(20f, 9.0f) to KEY_GRAY,
Pair(20f, 9.5f) to KEY_GRAY,
Pair(20f, 10.0f) to KEY_GRAY,
Pair(20f, 11.0f) to KEY_GRAY,
Pair(20f, 12.0f) to KEY_GRAY,
Pair(20f, 13.0f) to KEY_GRAY,
Pair(20f, 14.0f) to KEY_GRAY,
Pair(20f, 15.0f) to KEY_GRAY,
Pair(20f, 16.0f) to KEY_GRAY,
Pair(20f, 17.0f) to KEY_GRAY,
Pair(20f, 18.0f) to KEY_GRAY,
Pair(20f, 19.0f) to KEY_GRAY,
Pair(20f, 20.0f) to KEY_GRAY,
Pair(20f, 21.0f) to KEY_GRAY,
Pair(20f, 22.0f) to KEY_GRAY,
// Pulse Width = 25f
Pair(25f, 1.2f) to KEY_GRAY,
Pair(25f, 1.3f) to KEY_GRAY,
Pair(25f, 1.4f) to KEY_GRAY,
Pair(25f, 1.5f) to KEY_GRAY,
Pair(25f, 1.6f) to KEY_GRAY,
Pair(25f, 1.7f) to KEY_GRAY,
Pair(25f, 1.8f) to KEY_GRAY,
Pair(25f, 1.9f) to KEY_GRAY,
Pair(25f, 2.0f) to KEY_GRAY,
Pair(25f, 2.1f) to KEY_GRAY,
Pair(25f, 2.2f) to KEY_GRAY,
Pair(25f, 2.3f) to KEY_GRAY,
Pair(25f, 2.4f) to KEY_GRAY,
Pair(25f, 2.5f) to KEY_GRAY,
Pair(25f, 2.6f) to KEY_GRAY,
Pair(25f, 2.7f) to KEY_GRAY,
Pair(25f, 2.8f) to KEY_GRAY,
Pair(25f, 2.9f) to KEY_GRAY,
Pair(25f, 3.0f) to KEY_GRAY,
Pair(25f, 3.2f) to KEY_GRAY,
Pair(25f, 3.4f) to KEY_GRAY,
Pair(25f, 3.6f) to KEY_GRAY,
Pair(25f, 3.8f) to KEY_GRAY,
Pair(25f, 4.0f) to KEY_GRAY,
Pair(25f, 4.2f) to KEY_GRAY,
Pair(25f, 4.4f) to KEY_GRAY,
Pair(25f, 4.6f) to KEY_GRAY,
Pair(25f, 4.8f) to KEY_GRAY,
Pair(25f, 5.0f) to KEY_GRAY,
Pair(25f, 5.5f) to KEY_GRAY,
Pair(25f, 6.0f) to KEY_GRAY,
Pair(25f, 6.5f) to KEY_GRAY,
Pair(25f, 7.0f) to KEY_GRAY,
Pair(25f, 7.5f) to KEY_GRAY,
Pair(25f, 8.0f) to KEY_GRAY,
Pair(25f, 8.5f) to KEY_GRAY,
Pair(25f, 9.0f) to KEY_GRAY,
Pair(25f, 9.5f) to KEY_GRAY,
Pair(25f, 10.0f) to KEY_GRAY,
Pair(25f, 11.0f) to KEY_GRAY,
Pair(25f, 12.0f) to KEY_GRAY,
Pair(25f, 13.0f) to KEY_GRAY,
Pair(25f, 14.0f) to KEY_GRAY,
Pair(25f, 15.0f) to KEY_GRAY,
Pair(25f, 16.0f) to KEY_GRAY,
Pair(25f, 17.0f) to KEY_GRAY,
Pair(25f, 18.0f) to KEY_GRAY,
Pair(25f, 19.0f) to KEY_GRAY,
Pair(25f, 20.0f) to KEY_GRAY,
Pair(25f, 21.0f) to KEY_GRAY,
Pair(25f, 22.0f) to KEY_GRAY,
// Pulse Width = 30f
Pair(30f, 1.2f) to KEY_GRAY,
Pair(30f, 1.3f) to KEY_GRAY,
Pair(30f, 1.4f) to KEY_GRAY,
Pair(30f, 1.5f) to KEY_GRAY,
Pair(30f, 1.6f) to KEY_GRAY,
Pair(30f, 1.7f) to KEY_GRAY,
Pair(30f, 1.8f) to KEY_GRAY,
Pair(30f, 1.9f) to KEY_GRAY,
Pair(30f, 2.0f) to KEY_GRAY,
Pair(30f, 2.1f) to KEY_GRAY,
Pair(30f, 2.2f) to KEY_GRAY,
Pair(30f, 2.3f) to KEY_GRAY,
Pair(30f, 2.4f) to KEY_GRAY,
Pair(30f, 2.5f) to KEY_GRAY,
Pair(30f, 2.6f) to KEY_GRAY,
Pair(30f, 2.7f) to KEY_GRAY,
Pair(30f, 2.8f) to KEY_GRAY,
Pair(30f, 2.9f) to KEY_GRAY,
Pair(30f, 3.0f) to KEY_GRAY,
Pair(30f, 3.2f) to KEY_GRAY,
Pair(30f, 3.4f) to KEY_GRAY,
Pair(30f, 3.6f) to KEY_GRAY,
Pair(30f, 3.8f) to KEY_GRAY,
Pair(30f, 4.0f) to KEY_GRAY,
Pair(30f, 4.2f) to KEY_GRAY,
Pair(30f, 4.4f) to KEY_GRAY,
Pair(30f, 4.6f) to KEY_GRAY,
Pair(30f, 4.8f) to KEY_GRAY,
Pair(30f, 5.0f) to KEY_GRAY,
Pair(30f, 5.5f) to KEY_GRAY,
Pair(30f, 6.0f) to KEY_GRAY,
Pair(30f, 6.5f) to KEY_GRAY,
Pair(30f, 7.0f) to KEY_GRAY,
Pair(30f, 7.5f) to KEY_GRAY,
Pair(30f, 8.0f) to KEY_GRAY,
Pair(30f, 8.5f) to KEY_GRAY,
Pair(30f, 9.0f) to KEY_GRAY,
Pair(30f, 9.5f) to KEY_GRAY,
Pair(30f, 10.0f) to KEY_GRAY,
Pair(30f, 11.0f) to KEY_GRAY,
Pair(30f, 12.0f) to KEY_GRAY,
Pair(30f, 13.0f) to KEY_GRAY,
Pair(30f, 14.0f) to KEY_GRAY,
Pair(30f, 15.0f) to KEY_GRAY,
Pair(30f, 16.0f) to KEY_GRAY,
Pair(30f, 17.0f) to KEY_GRAY,
Pair(30f, 18.0f) to KEY_GRAY,
Pair(30f, 19.0f) to KEY_GRAY,
Pair(30f, 20.0f) to KEY_GRAY,
Pair(30f, 21.0f) to KEY_GRAY,
Pair(30f, 22.0f) to KEY_GRAY,
// Pulse Width = 35f
Pair(35f, 1.2f) to KEY_GRAY,
Pair(35f, 1.3f) to KEY_GRAY,
Pair(35f, 1.4f) to KEY_GRAY,
Pair(35f, 1.5f) to KEY_GRAY,
Pair(35f, 1.6f) to KEY_GRAY,
Pair(35f, 1.7f) to KEY_GRAY,
Pair(35f, 1.8f) to KEY_GRAY,
Pair(35f, 1.9f) to KEY_GRAY,
Pair(35f, 2.0f) to KEY_GRAY,
Pair(35f, 2.1f) to KEY_GRAY,
Pair(35f, 2.2f) to KEY_GRAY,
Pair(35f, 2.3f) to KEY_GRAY,
Pair(35f, 2.4f) to KEY_GRAY,
Pair(35f, 2.5f) to KEY_GRAY,
Pair(35f, 2.6f) to KEY_GRAY,
Pair(35f, 2.7f) to KEY_GRAY,
Pair(35f, 2.8f) to KEY_GRAY,
Pair(35f, 2.9f) to KEY_GRAY,
Pair(35f, 3.0f) to KEY_GRAY,
Pair(35f, 3.2f) to KEY_GRAY,
Pair(35f, 3.4f) to KEY_GRAY,
Pair(35f, 3.6f) to KEY_GRAY,
Pair(35f, 3.8f) to KEY_GRAY,
Pair(35f, 4.0f) to KEY_GRAY,
Pair(35f, 4.2f) to KEY_GRAY,
Pair(35f, 4.4f) to KEY_GRAY,
Pair(35f, 4.6f) to KEY_GRAY,
Pair(35f, 4.8f) to KEY_GRAY,
Pair(35f, 5.0f) to KEY_GRAY,
Pair(35f, 5.5f) to KEY_GRAY,
Pair(35f, 6.0f) to KEY_GRAY,
Pair(35f, 6.5f) to KEY_GRAY,
Pair(35f, 7.0f) to KEY_GRAY,
Pair(35f, 7.5f) to KEY_GRAY,
Pair(35f, 8.0f) to KEY_GRAY,
Pair(35f, 8.5f) to KEY_GRAY,
Pair(35f, 9.0f) to KEY_GRAY,
Pair(35f, 9.5f) to KEY_GRAY,
Pair(35f, 10.0f) to KEY_GRAY,
Pair(35f, 11.0f) to KEY_GRAY,
Pair(35f, 12.0f) to KEY_GRAY,
Pair(35f, 13.0f) to KEY_GRAY,
Pair(35f, 14.0f) to KEY_GRAY,
Pair(35f, 15.0f) to KEY_GRAY,
Pair(35f, 16.0f) to KEY_GRAY,
Pair(35f, 17.0f) to KEY_GRAY,
Pair(35f, 18.0f) to KEY_GRAY,
Pair(35f, 19.0f) to KEY_GRAY,
Pair(35f, 20.0f) to KEY_GRAY,
Pair(35f, 21.0f) to KEY_GRAY,
Pair(35f, 22.0f) to KEY_GRAY,
// Pulse Width = 40f
Pair(40f, 1.2f) to KEY_GRAY,
Pair(40f, 1.3f) to KEY_GRAY,
Pair(40f, 1.4f) to KEY_GRAY,
Pair(40f, 1.5f) to KEY_GRAY,
Pair(40f, 1.6f) to KEY_GRAY,
Pair(40f, 1.7f) to KEY_GRAY,
Pair(40f, 1.8f) to KEY_GRAY,
Pair(40f, 1.9f) to KEY_GRAY,
Pair(40f, 2.0f) to KEY_GRAY,
Pair(40f, 2.1f) to KEY_GRAY,
Pair(40f, 2.2f) to KEY_GRAY,
Pair(40f, 2.3f) to KEY_GRAY,
Pair(40f, 2.4f) to KEY_GRAY,
Pair(40f, 2.5f) to KEY_GRAY,
Pair(40f, 2.6f) to KEY_GRAY,
Pair(40f, 2.7f) to KEY_GRAY,
Pair(40f, 2.8f) to KEY_GRAY,
Pair(40f, 2.9f) to KEY_GRAY,
Pair(40f, 3.0f) to KEY_GRAY,
Pair(40f, 3.2f) to KEY_GRAY,
Pair(40f, 3.4f) to KEY_GRAY,
Pair(40f, 3.6f) to KEY_GRAY,
Pair(40f, 3.8f) to KEY_GRAY,
Pair(40f, 4.0f) to KEY_GRAY,
Pair(40f, 4.2f) to KEY_GRAY,
Pair(40f, 4.4f) to KEY_GRAY,
Pair(40f, 4.6f) to KEY_GRAY,
Pair(40f, 4.8f) to KEY_GRAY,
Pair(40f, 5.0f) to KEY_GRAY,
Pair(40f, 5.5f) to KEY_GRAY,
Pair(40f, 6.0f) to KEY_GRAY,
Pair(40f, 6.5f) to KEY_GRAY,
Pair(40f, 7.0f) to KEY_GRAY,
Pair(40f, 7.5f) to KEY_GRAY,
Pair(40f, 8.0f) to KEY_GRAY,
Pair(40f, 8.5f) to KEY_GRAY,
Pair(40f, 9.0f) to KEY_GRAY,
Pair(40f, 9.5f) to KEY_GRAY,
Pair(40f, 10.0f) to KEY_GRAY,
Pair(40f, 11.0f) to KEY_GRAY,
Pair(40f, 12.0f) to KEY_GRAY,
Pair(40f, 13.0f) to KEY_GRAY,
Pair(40f, 14.0f) to KEY_GRAY,
Pair(40f, 15.0f) to KEY_GRAY,
Pair(40f, 16.0f) to KEY_GRAY,
Pair(40f, 17.0f) to KEY_GRAY,
Pair(40f, 18.0f) to KEY_GRAY,
Pair(40f, 19.0f) to KEY_GRAY,
Pair(40f, 20.0f) to KEY_GRAY,
Pair(40f, 21.0f) to KEY_GRAY,
Pair(40f, 22.0f) to KEY_GRAY,
)

View File

@@ -0,0 +1,653 @@
package com.laseroptek.raman.const
//
// Hz Table1 (HANDPIENCE-5x5)
// - Map<Pair<Float, Float>, Int>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Fluence(J/cm²)>, HzType(int)>
//
val HzTable_5_5 = mapOf(
// Pulse Width = 0.5f
Pair(0.5f,2.0f) to KEY_GREEN,
Pair(0.5f,2.1f) to KEY_BLUE,
Pair(0.5f,2.2f) to KEY_BLUE,
Pair(0.5f,2.3f) to KEY_BLUE,
Pair(0.5f,2.4f) to KEY_BLUE,
Pair(0.5f,2.5f) to KEY_BLUE,
Pair(0.5f,2.6f) to KEY_BLUE,
Pair(0.5f,2.7f) to KEY_BLUE,
Pair(0.5f,2.8f) to KEY_BLUE,
Pair(0.5f,2.9f) to KEY_BLUE,
Pair(0.5f,3.0f) to KEY_BLUE,
Pair(0.5f,3.2f) to KEY_BLUE,
Pair(0.5f,3.4f) to KEY_BLUE,
Pair(0.5f,3.6f) to KEY_BLUE,
Pair(0.5f,3.8f) to KEY_BLUE,
Pair(0.5f,4.0f) to KEY_YELLOW,
Pair(0.5f,4.2f) to KEY_YELLOW,
Pair(0.5f,4.4f) to KEY_YELLOW,
Pair(0.5f,4.6f) to KEY_YELLOW,
Pair(0.5f,4.8f) to KEY_YELLOW,
Pair(0.5f,5.0f) to KEY_YELLOW,
Pair(0.5f,5.5f) to KEY_YELLOW,
Pair(0.5f,6.0f) to KEY_YELLOW,
Pair(0.5f,6.5f) to KEY_YELLOW,
Pair(0.5f,7.0f) to KEY_YELLOW,
Pair(0.5f,7.5f) to KEY_YELLOW,
Pair(0.5f,8.0f) to KEY_YELLOW,
// Pulse Width = 1f
Pair(1f, 2.0f) to KEY_BLUE,
Pair(1f, 2.1f) to KEY_YELLOW,
Pair(1f, 2.2f) to KEY_YELLOW,
Pair(1f, 2.3f) to KEY_YELLOW,
Pair(1f, 2.4f) to KEY_YELLOW,
Pair(1f, 2.5f) to KEY_YELLOW,
Pair(1f, 2.6f) to KEY_YELLOW,
Pair(1f, 2.7f) to KEY_YELLOW,
Pair(1f, 2.8f) to KEY_YELLOW,
Pair(1f, 2.9f) to KEY_YELLOW,
Pair(1f, 3.0f) to KEY_YELLOW,
Pair(1f, 3.2f) to KEY_YELLOW,
Pair(1f, 3.4f) to KEY_YELLOW,
Pair(1f, 3.6f) to KEY_YELLOW,
Pair(1f, 3.8f) to KEY_YELLOW,
Pair(1f, 4.0f) to KEY_YELLOW,
Pair(1f, 4.2f) to KEY_RED,
Pair(1f, 4.4f) to KEY_RED,
Pair(1f, 4.6f) to KEY_RED,
Pair(1f, 4.8f) to KEY_RED,
Pair(1f, 5.0f) to KEY_RED,
Pair(1f, 5.5f) to KEY_RED,
Pair(1f, 6.0f) to KEY_RED,
Pair(1f, 6.5f) to KEY_RED,
Pair(1f, 7.0f) to KEY_RED,
Pair(1f, 7.5f) to KEY_RED,
Pair(1f, 8.0f) to KEY_RED,
Pair(1f, 8.5f) to KEY_GRAY,
Pair(1f, 9.0f) to KEY_GRAY,
Pair(1f, 9.5f) to KEY_GRAY,
Pair(1f, 10.0f) to KEY_GRAY,
Pair(1f, 11.0f) to KEY_GRAY,
Pair(1f, 12.0f) to KEY_GRAY,
// Pulse Width = 1.5f
Pair(1.5f, 2.0f) to KEY_YELLOW,
Pair(1.5f, 2.1f) to KEY_RED,
Pair(1.5f, 2.2f) to KEY_RED,
Pair(1.5f, 2.3f) to KEY_RED,
Pair(1.5f, 2.4f) to KEY_RED,
Pair(1.5f, 2.5f) to KEY_RED,
Pair(1.5f, 2.6f) to KEY_RED,
Pair(1.5f, 2.7f) to KEY_RED,
Pair(1.5f, 2.8f) to KEY_RED,
Pair(1.5f, 2.9f) to KEY_RED,
Pair(1.5f, 3.0f) to KEY_RED,
Pair(1.5f, 3.2f) to KEY_RED,
Pair(1.5f, 3.4f) to KEY_RED,
Pair(1.5f, 3.6f) to KEY_RED,
Pair(1.5f, 3.8f) to KEY_RED,
Pair(1.5f, 4.0f) to KEY_RED,
Pair(1.5f, 4.2f) to KEY_GRAY,
Pair(1.5f, 4.4f) to KEY_GRAY,
Pair(1.5f, 4.6f) to KEY_GRAY,
Pair(1.5f, 4.8f) to KEY_GRAY,
Pair(1.5f, 5.0f) to KEY_GRAY,
Pair(1.5f, 5.5f) to KEY_GRAY,
Pair(1.5f, 6.0f) to KEY_GRAY,
Pair(1.5f, 6.5f) to KEY_GRAY,
Pair(1.5f, 7.0f) to KEY_GRAY,
Pair(1.5f, 7.5f) to KEY_GRAY,
Pair(1.5f, 8.0f) to KEY_GRAY,
Pair(1.5f, 8.5f) to KEY_GRAY,
Pair(1.5f, 9.0f) to KEY_GRAY,
Pair(1.5f, 9.5f) to KEY_GRAY,
Pair(1.5f, 10.0f) to KEY_GRAY,
Pair(1.5f, 11.0f) to KEY_GRAY,
Pair(1.5f, 12.0f) to KEY_GRAY,
Pair(1.5f, 13.0f) to KEY_GRAY,
Pair(1.5f, 14.0f) to KEY_GRAY,
Pair(1.5f, 15.0f) to KEY_GRAY,
Pair(1.5f, 16.0f) to KEY_GRAY,
// Pulse Width = 3f
Pair(3f, 2.0f ) to KEY_RED,
Pair(3f, 2.1f ) to KEY_GRAY,
Pair(3f, 2.2f ) to KEY_GRAY,
Pair(3f, 2.3f ) to KEY_GRAY,
Pair(3f, 2.4f ) to KEY_GRAY,
Pair(3f, 2.5f ) to KEY_GRAY,
Pair(3f, 2.6f ) to KEY_GRAY,
Pair(3f, 2.7f ) to KEY_GRAY,
Pair(3f, 2.8f ) to KEY_GRAY,
Pair(3f, 2.9f ) to KEY_GRAY,
Pair(3f, 3.0f ) to KEY_GRAY,
Pair(3f, 3.2f ) to KEY_GRAY,
Pair(3f, 3.4f ) to KEY_GRAY,
Pair(3f, 3.6f ) to KEY_GRAY,
Pair(3f, 3.8f ) to KEY_GRAY,
Pair(3f, 4.0f ) to KEY_GRAY,
Pair(3f, 4.2f ) to KEY_GRAY,
Pair(3f, 4.4f ) to KEY_GRAY,
Pair(3f, 4.6f ) to KEY_GRAY,
Pair(3f, 4.8f ) to KEY_GRAY,
Pair(3f, 5.0f ) to KEY_GRAY,
Pair(3f, 5.5f ) to KEY_GRAY,
Pair(3f, 6.0f ) to KEY_GRAY,
Pair(3f, 6.5f ) to KEY_GRAY,
Pair(3f, 7.0f ) to KEY_GRAY,
Pair(3f, 7.5f ) to KEY_GRAY,
Pair(3f, 8.0f ) to KEY_GRAY,
Pair(3f, 8.5f ) to KEY_GRAY,
Pair(3f, 9.0f ) to KEY_GRAY,
Pair(3f, 9.5f ) to KEY_GRAY,
Pair(3f, 10.0f) to KEY_GRAY,
Pair(3f, 11.0f) to KEY_GRAY,
Pair(3f, 12.0f) to KEY_GRAY,
Pair(3f, 13.0f) to KEY_GRAY,
Pair(3f, 14.0f) to KEY_GRAY,
Pair(3f, 15.0f) to KEY_GRAY,
Pair(3f, 16.0f) to KEY_GRAY,
Pair(3f, 17.0f) to KEY_GRAY,
Pair(3f, 18.0f) to KEY_GRAY,
Pair(3f, 19.0f) to KEY_GRAY,
Pair(3f, 20.0f) to KEY_GRAY,
Pair(3f, 21.0f) to KEY_GRAY,
Pair(3f, 22.0f) to KEY_GRAY,
Pair(3f, 23.0f) to KEY_GRAY,
Pair(3f, 24.0f) to KEY_GRAY,
// Pulse Width = 5f
Pair(5f, 2.0f) to KEY_RED,
Pair(5f, 2.1f) to KEY_GRAY,
Pair(5f, 2.2f) to KEY_GRAY,
Pair(5f, 2.3f) to KEY_GRAY,
Pair(5f, 2.4f) to KEY_GRAY,
Pair(5f, 2.5f) to KEY_GRAY,
Pair(5f, 2.6f) to KEY_GRAY,
Pair(5f, 2.7f) to KEY_GRAY,
Pair(5f, 2.8f) to KEY_GRAY,
Pair(5f, 2.9f) to KEY_GRAY,
Pair(5f, 3.0f) to KEY_GRAY,
Pair(5f, 3.2f) to KEY_GRAY,
Pair(5f, 3.4f) to KEY_GRAY,
Pair(5f, 3.6f) to KEY_GRAY,
Pair(5f, 3.8f) to KEY_GRAY,
Pair(5f, 4.0f) to KEY_GRAY,
Pair(5f, 4.2f) to KEY_GRAY,
Pair(5f, 4.4f) to KEY_GRAY,
Pair(5f, 4.6f) to KEY_GRAY,
Pair(5f, 4.8f) to KEY_GRAY,
Pair(5f, 5.0f) to KEY_GRAY,
Pair(5f, 5.5f) to KEY_GRAY,
Pair(5f, 6.0f) to KEY_GRAY,
Pair(5f, 6.5f) to KEY_GRAY,
Pair(5f, 7.0f) to KEY_GRAY,
Pair(5f, 7.5f) to KEY_GRAY,
Pair(5f, 8.0f) to KEY_GRAY,
Pair(5f, 8.5f) to KEY_GRAY,
Pair(5f, 9.0f) to KEY_GRAY,
Pair(5f, 9.5f) to KEY_GRAY,
Pair(5f, 10.0f) to KEY_GRAY,
Pair(5f, 11.0f) to KEY_GRAY,
Pair(5f, 12.0f) to KEY_GRAY,
Pair(5f, 13.0f) to KEY_GRAY,
Pair(5f, 14.0f) to KEY_GRAY,
Pair(5f, 15.0f) to KEY_GRAY,
Pair(5f, 16.0f) to KEY_GRAY,
Pair(5f, 17.0f) to KEY_GRAY,
Pair(5f, 18.0f) to KEY_GRAY,
Pair(5f, 19.0f) to KEY_GRAY,
Pair(5f, 20.0f) to KEY_GRAY,
Pair(5f, 21.0f) to KEY_GRAY,
Pair(5f, 22.0f) to KEY_GRAY,
Pair(5f, 23.0f) to KEY_GRAY,
Pair(5f, 24.0f) to KEY_GRAY,
Pair(5f, 25.0f) to KEY_GRAY,
Pair(5f, 26.0f) to KEY_GRAY,
Pair(5f, 27.0f) to KEY_GRAY,
Pair(5f, 28.0f) to KEY_GRAY,
// Pulse Width = 10f
Pair(10f, 2.0f) to KEY_GRAY,
Pair(10f, 2.1f) to KEY_GRAY,
Pair(10f, 2.2f) to KEY_GRAY,
Pair(10f, 2.3f) to KEY_GRAY,
Pair(10f, 2.4f) to KEY_GRAY,
Pair(10f, 2.5f) to KEY_GRAY,
Pair(10f, 2.6f) to KEY_GRAY,
Pair(10f, 2.7f) to KEY_GRAY,
Pair(10f, 2.8f) to KEY_GRAY,
Pair(10f, 2.9f) to KEY_GRAY,
Pair(10f, 3.0f) to KEY_GRAY,
Pair(10f, 3.2f) to KEY_GRAY,
Pair(10f, 3.4f) to KEY_GRAY,
Pair(10f, 3.6f) to KEY_GRAY,
Pair(10f, 3.8f) to KEY_GRAY,
Pair(10f, 4.0f) to KEY_GRAY,
Pair(10f, 4.2f) to KEY_GRAY,
Pair(10f, 4.4f) to KEY_GRAY,
Pair(10f, 4.6f) to KEY_GRAY,
Pair(10f, 4.8f) to KEY_GRAY,
Pair(10f, 5.0f) to KEY_GRAY,
Pair(10f, 5.5f) to KEY_GRAY,
Pair(10f, 6.0f) to KEY_GRAY,
Pair(10f, 6.5f) to KEY_GRAY,
Pair(10f, 7.0f) to KEY_GRAY,
Pair(10f, 7.5f) to KEY_GRAY,
Pair(10f, 8.0f) to KEY_GRAY,
Pair(10f, 8.5f) to KEY_GRAY,
Pair(10f, 9.0f) to KEY_GRAY,
Pair(10f, 9.5f) to KEY_GRAY,
Pair(10f, 10.0f) to KEY_GRAY,
Pair(10f, 11.0f) to KEY_GRAY,
Pair(10f, 12.0f) to KEY_GRAY,
Pair(10f, 13.0f) to KEY_GRAY,
Pair(10f, 14.0f) to KEY_GRAY,
Pair(10f, 15.0f) to KEY_GRAY,
Pair(10f, 16.0f) to KEY_GRAY,
Pair(10f, 17.0f) to KEY_GRAY,
Pair(10f, 18.0f) to KEY_GRAY,
Pair(10f, 19.0f) to KEY_GRAY,
Pair(10f, 20.0f) to KEY_GRAY,
Pair(10f, 21.0f) to KEY_GRAY,
Pair(10f, 22.0f) to KEY_GRAY,
Pair(10f, 23.0f) to KEY_GRAY,
Pair(10f, 24.0f) to KEY_GRAY,
Pair(10f, 25.0f) to KEY_GRAY,
Pair(10f, 26.0f) to KEY_GRAY,
Pair(10f, 27.0f) to KEY_GRAY,
Pair(10f, 28.0f) to KEY_GRAY,
Pair(10f, 29.0f) to KEY_GRAY,
Pair(10f, 30.0f) to KEY_GRAY,
Pair(10f, 31.0f) to KEY_GRAY,
Pair(10f, 32.0f) to KEY_GRAY,
Pair(10f, 33.0f) to KEY_GRAY,
Pair(10f, 34.0f) to KEY_GRAY,
Pair(10f, 35.0f) to KEY_GRAY,
Pair(10f, 36.0f) to KEY_GRAY,
Pair(10f, 37.0f) to KEY_GRAY,
Pair(10f, 38.0f) to KEY_GRAY,
Pair(10f, 39.0f) to KEY_GRAY,
Pair(10f, 40.0f) to KEY_GRAY,
// Pulse Width = 15f
Pair(15f, 2.0f) to KEY_GRAY,
Pair(15f, 2.1f) to KEY_GRAY,
Pair(15f, 2.2f) to KEY_GRAY,
Pair(15f, 2.3f) to KEY_GRAY,
Pair(15f, 2.4f) to KEY_GRAY,
Pair(15f, 2.5f) to KEY_GRAY,
Pair(15f, 2.6f) to KEY_GRAY,
Pair(15f, 2.7f) to KEY_GRAY,
Pair(15f, 2.8f) to KEY_GRAY,
Pair(15f, 2.9f) to KEY_GRAY,
Pair(15f, 3.0f) to KEY_GRAY,
Pair(15f, 3.2f) to KEY_GRAY,
Pair(15f, 3.4f) to KEY_GRAY,
Pair(15f, 3.6f) to KEY_GRAY,
Pair(15f, 3.8f) to KEY_GRAY,
Pair(15f, 4.0f) to KEY_GRAY,
Pair(15f, 4.2f) to KEY_GRAY,
Pair(15f, 4.4f) to KEY_GRAY,
Pair(15f, 4.6f) to KEY_GRAY,
Pair(15f, 4.8f) to KEY_GRAY,
Pair(15f, 5.0f) to KEY_GRAY,
Pair(15f, 5.5f) to KEY_GRAY,
Pair(15f, 6.0f) to KEY_GRAY,
Pair(15f, 6.5f) to KEY_GRAY,
Pair(15f, 7.0f) to KEY_GRAY,
Pair(15f, 7.5f) to KEY_GRAY,
Pair(15f, 8.0f) to KEY_GRAY,
Pair(15f, 8.5f) to KEY_GRAY,
Pair(15f, 9.0f) to KEY_GRAY,
Pair(15f, 9.5f) to KEY_GRAY,
Pair(15f, 10.0f) to KEY_GRAY,
Pair(15f, 11.0f) to KEY_GRAY,
Pair(15f, 12.0f) to KEY_GRAY,
Pair(15f, 13.0f) to KEY_GRAY,
Pair(15f, 14.0f) to KEY_GRAY,
Pair(15f, 15.0f) to KEY_GRAY,
Pair(15f, 16.0f) to KEY_GRAY,
Pair(15f, 17.0f) to KEY_GRAY,
Pair(15f, 18.0f) to KEY_GRAY,
Pair(15f, 19.0f) to KEY_GRAY,
Pair(15f, 20.0f) to KEY_GRAY,
Pair(15f, 21.0f) to KEY_GRAY,
Pair(15f, 22.0f) to KEY_GRAY,
Pair(15f, 23.0f) to KEY_GRAY,
Pair(15f, 24.0f) to KEY_GRAY,
Pair(15f, 25.0f) to KEY_GRAY,
Pair(15f, 26.0f) to KEY_GRAY,
Pair(15f, 27.0f) to KEY_GRAY,
Pair(15f, 28.0f) to KEY_GRAY,
Pair(15f, 29.0f) to KEY_GRAY,
Pair(15f, 30.0f) to KEY_GRAY,
Pair(15f, 31.0f) to KEY_GRAY,
Pair(15f, 32.0f) to KEY_GRAY,
Pair(15f, 33.0f) to KEY_GRAY,
Pair(15f, 34.0f) to KEY_GRAY,
Pair(15f, 35.0f) to KEY_GRAY,
Pair(15f, 36.0f) to KEY_GRAY,
Pair(15f, 37.0f) to KEY_GRAY,
Pair(15f, 38.0f) to KEY_GRAY,
Pair(15f, 39.0f) to KEY_GRAY,
Pair(15f, 40.0f) to KEY_GRAY,
// Pulse Width = 20f
Pair(20f, 2.0f) to KEY_GRAY,
Pair(20f, 2.1f) to KEY_GRAY,
Pair(20f, 2.2f) to KEY_GRAY,
Pair(20f, 2.3f) to KEY_GRAY,
Pair(20f, 2.4f) to KEY_GRAY,
Pair(20f, 2.5f) to KEY_GRAY,
Pair(20f, 2.6f) to KEY_GRAY,
Pair(20f, 2.7f) to KEY_GRAY,
Pair(20f, 2.8f) to KEY_GRAY,
Pair(20f, 2.9f) to KEY_GRAY,
Pair(20f, 3.0f) to KEY_GRAY,
Pair(20f, 3.2f) to KEY_GRAY,
Pair(20f, 3.4f) to KEY_GRAY,
Pair(20f, 3.6f) to KEY_GRAY,
Pair(20f, 3.8f) to KEY_GRAY,
Pair(20f, 4.0f) to KEY_GRAY,
Pair(20f, 4.2f) to KEY_GRAY,
Pair(20f, 4.4f) to KEY_GRAY,
Pair(20f, 4.6f) to KEY_GRAY,
Pair(20f, 4.8f) to KEY_GRAY,
Pair(20f, 5.0f) to KEY_GRAY,
Pair(20f, 5.5f) to KEY_GRAY,
Pair(20f, 6.0f) to KEY_GRAY,
Pair(20f, 6.5f) to KEY_GRAY,
Pair(20f, 7.0f) to KEY_GRAY,
Pair(20f, 7.5f) to KEY_GRAY,
Pair(20f, 8.0f) to KEY_GRAY,
Pair(20f, 8.5f) to KEY_GRAY,
Pair(20f, 9.0f) to KEY_GRAY,
Pair(20f, 9.5f) to KEY_GRAY,
Pair(20f, 10.0f) to KEY_GRAY,
Pair(20f, 11.0f) to KEY_GRAY,
Pair(20f, 12.0f) to KEY_GRAY,
Pair(20f, 13.0f) to KEY_GRAY,
Pair(20f, 14.0f) to KEY_GRAY,
Pair(20f, 15.0f) to KEY_GRAY,
Pair(20f, 16.0f) to KEY_GRAY,
Pair(20f, 17.0f) to KEY_GRAY,
Pair(20f, 18.0f) to KEY_GRAY,
Pair(20f, 19.0f) to KEY_GRAY,
Pair(20f, 20.0f) to KEY_GRAY,
Pair(20f, 21.0f) to KEY_GRAY,
Pair(20f, 22.0f) to KEY_GRAY,
Pair(20f, 23.0f) to KEY_GRAY,
Pair(20f, 24.0f) to KEY_GRAY,
Pair(20f, 25.0f) to KEY_GRAY,
Pair(20f, 26.0f) to KEY_GRAY,
Pair(20f, 27.0f) to KEY_GRAY,
Pair(20f, 28.0f) to KEY_GRAY,
Pair(20f, 29.0f) to KEY_GRAY,
Pair(20f, 30.0f) to KEY_GRAY,
Pair(20f, 31.0f) to KEY_GRAY,
Pair(20f, 32.0f) to KEY_GRAY,
Pair(20f, 33.0f) to KEY_GRAY,
Pair(20f, 34.0f) to KEY_GRAY,
Pair(20f, 35.0f) to KEY_GRAY,
Pair(20f, 36.0f) to KEY_GRAY,
Pair(20f, 37.0f) to KEY_GRAY,
Pair(20f, 38.0f) to KEY_GRAY,
Pair(20f, 39.0f) to KEY_GRAY,
Pair(20f, 40.0f) to KEY_GRAY,
// Pulse Width = 25f
Pair(25f, 2.0f) to KEY_GRAY,
Pair(25f, 2.1f) to KEY_GRAY,
Pair(25f, 2.2f) to KEY_GRAY,
Pair(25f, 2.3f) to KEY_GRAY,
Pair(25f, 2.4f) to KEY_GRAY,
Pair(25f, 2.5f) to KEY_GRAY,
Pair(25f, 2.6f) to KEY_GRAY,
Pair(25f, 2.7f) to KEY_GRAY,
Pair(25f, 2.8f) to KEY_GRAY,
Pair(25f, 2.9f) to KEY_GRAY,
Pair(25f, 3.0f) to KEY_GRAY,
Pair(25f, 3.2f) to KEY_GRAY,
Pair(25f, 3.4f) to KEY_GRAY,
Pair(25f, 3.6f) to KEY_GRAY,
Pair(25f, 3.8f) to KEY_GRAY,
Pair(25f, 4.0f) to KEY_GRAY,
Pair(25f, 4.2f) to KEY_GRAY,
Pair(25f, 4.4f) to KEY_GRAY,
Pair(25f, 4.6f) to KEY_GRAY,
Pair(25f, 4.8f) to KEY_GRAY,
Pair(25f, 5.0f) to KEY_GRAY,
Pair(25f, 5.5f) to KEY_GRAY,
Pair(25f, 6.0f) to KEY_GRAY,
Pair(25f, 6.5f) to KEY_GRAY,
Pair(25f, 7.0f) to KEY_GRAY,
Pair(25f, 7.5f) to KEY_GRAY,
Pair(25f, 8.0f) to KEY_GRAY,
Pair(25f, 8.5f) to KEY_GRAY,
Pair(25f, 9.0f) to KEY_GRAY,
Pair(25f, 9.5f) to KEY_GRAY,
Pair(25f, 10.0f) to KEY_GRAY,
Pair(25f, 11.0f) to KEY_GRAY,
Pair(25f, 12.0f) to KEY_GRAY,
Pair(25f, 13.0f) to KEY_GRAY,
Pair(25f, 14.0f) to KEY_GRAY,
Pair(25f, 15.0f) to KEY_GRAY,
Pair(25f, 16.0f) to KEY_GRAY,
Pair(25f, 17.0f) to KEY_GRAY,
Pair(25f, 18.0f) to KEY_GRAY,
Pair(25f, 19.0f) to KEY_GRAY,
Pair(25f, 20.0f) to KEY_GRAY,
Pair(25f, 21.0f) to KEY_GRAY,
Pair(25f, 22.0f) to KEY_GRAY,
Pair(25f, 23.0f) to KEY_GRAY,
Pair(25f, 24.0f) to KEY_GRAY,
Pair(25f, 25.0f) to KEY_GRAY,
Pair(25f, 26.0f) to KEY_GRAY,
Pair(25f, 27.0f) to KEY_GRAY,
Pair(25f, 28.0f) to KEY_GRAY,
Pair(25f, 29.0f) to KEY_GRAY,
Pair(25f, 30.0f) to KEY_GRAY,
Pair(25f, 31.0f) to KEY_GRAY,
Pair(25f, 32.0f) to KEY_GRAY,
Pair(25f, 33.0f) to KEY_GRAY,
Pair(25f, 34.0f) to KEY_GRAY,
Pair(25f, 35.0f) to KEY_GRAY,
Pair(25f, 36.0f) to KEY_GRAY,
Pair(25f, 37.0f) to KEY_GRAY,
Pair(25f, 38.0f) to KEY_GRAY,
Pair(25f, 39.0f) to KEY_GRAY,
Pair(25f, 40.0f) to KEY_GRAY,
// Pulse Width = 30f
Pair(30f, 2.0f) to KEY_GRAY,
Pair(30f, 2.1f) to KEY_GRAY,
Pair(30f, 2.2f) to KEY_GRAY,
Pair(30f, 2.3f) to KEY_GRAY,
Pair(30f, 2.4f) to KEY_GRAY,
Pair(30f, 2.5f) to KEY_GRAY,
Pair(30f, 2.6f) to KEY_GRAY,
Pair(30f, 2.7f) to KEY_GRAY,
Pair(30f, 2.8f) to KEY_GRAY,
Pair(30f, 2.9f) to KEY_GRAY,
Pair(30f, 3.0f) to KEY_GRAY,
Pair(30f, 3.2f) to KEY_GRAY,
Pair(30f, 3.4f) to KEY_GRAY,
Pair(30f, 3.6f) to KEY_GRAY,
Pair(30f, 3.8f) to KEY_GRAY,
Pair(30f, 4.0f) to KEY_GRAY,
Pair(30f, 4.2f) to KEY_GRAY,
Pair(30f, 4.4f) to KEY_GRAY,
Pair(30f, 4.6f) to KEY_GRAY,
Pair(30f, 4.8f) to KEY_GRAY,
Pair(30f, 5.0f) to KEY_GRAY,
Pair(30f, 5.5f) to KEY_GRAY,
Pair(30f, 6.0f) to KEY_GRAY,
Pair(30f, 6.5f) to KEY_GRAY,
Pair(30f, 7.0f) to KEY_GRAY,
Pair(30f, 7.5f) to KEY_GRAY,
Pair(30f, 8.0f) to KEY_GRAY,
Pair(30f, 8.5f) to KEY_GRAY,
Pair(30f, 9.0f) to KEY_GRAY,
Pair(30f, 9.5f) to KEY_GRAY,
Pair(30f, 10.0f) to KEY_GRAY,
Pair(30f, 11.0f) to KEY_GRAY,
Pair(30f, 12.0f) to KEY_GRAY,
Pair(30f, 13.0f) to KEY_GRAY,
Pair(30f, 14.0f) to KEY_GRAY,
Pair(30f, 15.0f) to KEY_GRAY,
Pair(30f, 16.0f) to KEY_GRAY,
Pair(30f, 17.0f) to KEY_GRAY,
Pair(30f, 18.0f) to KEY_GRAY,
Pair(30f, 19.0f) to KEY_GRAY,
Pair(30f, 20.0f) to KEY_GRAY,
Pair(30f, 21.0f) to KEY_GRAY,
Pair(30f, 22.0f) to KEY_GRAY,
Pair(30f, 23.0f) to KEY_GRAY,
Pair(30f, 24.0f) to KEY_GRAY,
Pair(30f, 25.0f) to KEY_GRAY,
Pair(30f, 26.0f) to KEY_GRAY,
Pair(30f, 27.0f) to KEY_GRAY,
Pair(30f, 28.0f) to KEY_GRAY,
Pair(30f, 29.0f) to KEY_GRAY,
Pair(30f, 30.0f) to KEY_GRAY,
Pair(30f, 31.0f) to KEY_GRAY,
Pair(30f, 32.0f) to KEY_GRAY,
Pair(30f, 33.0f) to KEY_GRAY,
Pair(30f, 34.0f) to KEY_GRAY,
Pair(30f, 35.0f) to KEY_GRAY,
Pair(30f, 36.0f) to KEY_GRAY,
Pair(30f, 37.0f) to KEY_GRAY,
Pair(30f, 38.0f) to KEY_GRAY,
Pair(30f, 39.0f) to KEY_GRAY,
Pair(30f, 40.0f) to KEY_GRAY,
// Pulse Width = 35f
Pair(35f, 2.0f) to KEY_GRAY,
Pair(35f, 2.1f) to KEY_GRAY,
Pair(35f, 2.2f) to KEY_GRAY,
Pair(35f, 2.3f) to KEY_GRAY,
Pair(35f, 2.4f) to KEY_GRAY,
Pair(35f, 2.5f) to KEY_GRAY,
Pair(35f, 2.6f) to KEY_GRAY,
Pair(35f, 2.7f) to KEY_GRAY,
Pair(35f, 2.8f) to KEY_GRAY,
Pair(35f, 2.9f) to KEY_GRAY,
Pair(35f, 3.0f) to KEY_GRAY,
Pair(35f, 3.2f) to KEY_GRAY,
Pair(35f, 3.4f) to KEY_GRAY,
Pair(35f, 3.6f) to KEY_GRAY,
Pair(35f, 3.8f) to KEY_GRAY,
Pair(35f, 4.0f) to KEY_GRAY,
Pair(35f, 4.2f) to KEY_GRAY,
Pair(35f, 4.4f) to KEY_GRAY,
Pair(35f, 4.6f) to KEY_GRAY,
Pair(35f, 4.8f) to KEY_GRAY,
Pair(35f, 5.0f) to KEY_GRAY,
Pair(35f, 5.5f) to KEY_GRAY,
Pair(35f, 6.0f) to KEY_GRAY,
Pair(35f, 6.5f) to KEY_GRAY,
Pair(35f, 7.0f) to KEY_GRAY,
Pair(35f, 7.5f) to KEY_GRAY,
Pair(35f, 8.0f) to KEY_GRAY,
Pair(35f, 8.5f) to KEY_GRAY,
Pair(35f, 9.0f) to KEY_GRAY,
Pair(35f, 9.5f) to KEY_GRAY,
Pair(35f, 10.0f) to KEY_GRAY,
Pair(35f, 11.0f) to KEY_GRAY,
Pair(35f, 12.0f) to KEY_GRAY,
Pair(35f, 13.0f) to KEY_GRAY,
Pair(35f, 14.0f) to KEY_GRAY,
Pair(35f, 15.0f) to KEY_GRAY,
Pair(35f, 16.0f) to KEY_GRAY,
Pair(35f, 17.0f) to KEY_GRAY,
Pair(35f, 18.0f) to KEY_GRAY,
Pair(35f, 19.0f) to KEY_GRAY,
Pair(35f, 20.0f) to KEY_GRAY,
Pair(35f, 21.0f) to KEY_GRAY,
Pair(35f, 22.0f) to KEY_GRAY,
Pair(35f, 23.0f) to KEY_GRAY,
Pair(35f, 24.0f) to KEY_GRAY,
Pair(35f, 25.0f) to KEY_GRAY,
Pair(35f, 26.0f) to KEY_GRAY,
Pair(35f, 27.0f) to KEY_GRAY,
Pair(35f, 28.0f) to KEY_GRAY,
Pair(35f, 29.0f) to KEY_GRAY,
Pair(35f, 30.0f) to KEY_GRAY,
Pair(35f, 31.0f) to KEY_GRAY,
Pair(35f, 32.0f) to KEY_GRAY,
Pair(35f, 33.0f) to KEY_GRAY,
Pair(35f, 34.0f) to KEY_GRAY,
Pair(35f, 35.0f) to KEY_GRAY,
Pair(35f, 36.0f) to KEY_GRAY,
Pair(35f, 37.0f) to KEY_GRAY,
Pair(35f, 38.0f) to KEY_GRAY,
Pair(35f, 39.0f) to KEY_GRAY,
Pair(35f, 40.0f) to KEY_GRAY,
// Pulse Width = 40f
Pair(40f, 2.0f) to KEY_GRAY,
Pair(40f, 2.1f) to KEY_GRAY,
Pair(40f, 2.2f) to KEY_GRAY,
Pair(40f, 2.3f) to KEY_GRAY,
Pair(40f, 2.4f) to KEY_GRAY,
Pair(40f, 2.5f) to KEY_GRAY,
Pair(40f, 2.6f) to KEY_GRAY,
Pair(40f, 2.7f) to KEY_GRAY,
Pair(40f, 2.8f) to KEY_GRAY,
Pair(40f, 2.9f) to KEY_GRAY,
Pair(40f, 3.0f) to KEY_GRAY,
Pair(40f, 3.2f) to KEY_GRAY,
Pair(40f, 3.4f) to KEY_GRAY,
Pair(40f, 3.6f) to KEY_GRAY,
Pair(40f, 3.8f) to KEY_GRAY,
Pair(40f, 4.0f) to KEY_GRAY,
Pair(40f, 4.2f) to KEY_GRAY,
Pair(40f, 4.4f) to KEY_GRAY,
Pair(40f, 4.6f) to KEY_GRAY,
Pair(40f, 4.8f) to KEY_GRAY,
Pair(40f, 5.0f) to KEY_GRAY,
Pair(40f, 5.5f) to KEY_GRAY,
Pair(40f, 6.0f) to KEY_GRAY,
Pair(40f, 6.5f) to KEY_GRAY,
Pair(40f, 7.0f) to KEY_GRAY,
Pair(40f, 7.5f) to KEY_GRAY,
Pair(40f, 8.0f) to KEY_GRAY,
Pair(40f, 8.5f) to KEY_GRAY,
Pair(40f, 9.0f) to KEY_GRAY,
Pair(40f, 9.5f) to KEY_GRAY,
Pair(40f, 10.0f) to KEY_GRAY,
Pair(40f, 11.0f) to KEY_GRAY,
Pair(40f, 12.0f) to KEY_GRAY,
Pair(40f, 13.0f) to KEY_GRAY,
Pair(40f, 14.0f) to KEY_GRAY,
Pair(40f, 15.0f) to KEY_GRAY,
Pair(40f, 16.0f) to KEY_GRAY,
Pair(40f, 17.0f) to KEY_GRAY,
Pair(40f, 18.0f) to KEY_GRAY,
Pair(40f, 19.0f) to KEY_GRAY,
Pair(40f, 20.0f) to KEY_GRAY,
Pair(40f, 21.0f) to KEY_GRAY,
Pair(40f, 22.0f) to KEY_GRAY,
Pair(40f, 23.0f) to KEY_GRAY,
Pair(40f, 24.0f) to KEY_GRAY,
Pair(40f, 25.0f) to KEY_GRAY,
Pair(40f, 26.0f) to KEY_GRAY,
Pair(40f, 27.0f) to KEY_GRAY,
Pair(40f, 28.0f) to KEY_GRAY,
Pair(40f, 29.0f) to KEY_GRAY,
Pair(40f, 30.0f) to KEY_GRAY,
Pair(40f, 31.0f) to KEY_GRAY,
Pair(40f, 32.0f) to KEY_GRAY,
Pair(40f, 33.0f) to KEY_GRAY,
Pair(40f, 34.0f) to KEY_GRAY,
Pair(40f, 35.0f) to KEY_GRAY,
Pair(40f, 36.0f) to KEY_GRAY,
Pair(40f, 37.0f) to KEY_GRAY,
Pair(40f, 38.0f) to KEY_GRAY,
Pair(40f, 39.0f) to KEY_GRAY,
Pair(40f, 40.0f) to KEY_GRAY,
)

View File

@@ -0,0 +1,564 @@
package com.laseroptek.raman.const
//
// HzTable2 (HANDPIENCE-7x7)
// - Map<Pair<Float, Float>, Int>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Fluence(J/cm²)>, HzType(int)>
//
val HzTable_7_7 = mapOf(
// Pulse Width = 0.5f
Pair(0.5f, 1.1f) to KEY_BLUE,
Pair(0.5f, 1.2f) to KEY_BLUE,
Pair(0.5f, 1.3f) to KEY_BLUE,
Pair(0.5f, 1.4f) to KEY_BLUE,
Pair(0.5f, 1.5f) to KEY_BLUE,
Pair(0.5f, 1.6f) to KEY_BLUE,
Pair(0.5f, 1.7f) to KEY_BLUE,
Pair(0.5f, 1.8f) to KEY_BLUE,
Pair(0.5f, 1.9f) to KEY_BLUE,
Pair(0.5f, 2.0f) to KEY_BLUE,
Pair(0.5f, 2.1f) to KEY_YELLOW,
Pair(0.5f, 2.2f) to KEY_YELLOW,
Pair(0.5f, 2.3f) to KEY_YELLOW,
Pair(0.5f, 2.4f) to KEY_YELLOW,
Pair(0.5f, 2.5f) to KEY_YELLOW,
Pair(0.5f, 2.6f) to KEY_YELLOW,
Pair(0.5f, 2.7f) to KEY_YELLOW,
Pair(0.5f, 2.8f) to KEY_YELLOW,
Pair(0.5f, 2.9f) to KEY_YELLOW,
Pair(0.5f, 3.0f) to KEY_YELLOW,
Pair(0.5f, 3.2f) to KEY_YELLOW,
Pair(0.5f, 3.4f) to KEY_YELLOW,
Pair(0.5f, 3.6f) to KEY_YELLOW,
Pair(0.5f, 3.8f) to KEY_YELLOW,
Pair(0.5f, 4.0f) to KEY_YELLOW,
// Pulse Width = 1f
Pair(1f, 1.1f) to KEY_YELLOW,
Pair(1f, 1.2f) to KEY_YELLOW,
Pair(1f, 1.3f) to KEY_YELLOW,
Pair(1f, 1.4f) to KEY_YELLOW,
Pair(1f, 1.5f) to KEY_YELLOW,
Pair(1f, 1.6f) to KEY_YELLOW,
Pair(1f, 1.7f) to KEY_YELLOW,
Pair(1f, 1.8f) to KEY_YELLOW,
Pair(1f, 1.9f) to KEY_YELLOW,
Pair(1f, 2.0f) to KEY_YELLOW,
Pair(1f, 2.1f) to KEY_RED,
Pair(1f, 2.2f) to KEY_RED,
Pair(1f, 2.3f) to KEY_RED,
Pair(1f, 2.4f) to KEY_RED,
Pair(1f, 2.5f) to KEY_RED,
Pair(1f, 2.6f) to KEY_RED,
Pair(1f, 2.7f) to KEY_RED,
Pair(1f, 2.8f) to KEY_RED,
Pair(1f, 2.9f) to KEY_RED,
Pair(1f, 3.0f) to KEY_RED,
Pair(1f, 3.2f) to KEY_RED,
Pair(1f, 3.4f) to KEY_RED,
Pair(1f, 3.6f) to KEY_RED,
Pair(1f, 3.8f) to KEY_RED,
Pair(1f, 4.0f) to KEY_RED,
Pair(1f, 4.2f) to KEY_GRAY,
Pair(1f, 4.4f) to KEY_GRAY,
Pair(1f, 4.6f) to KEY_GRAY,
Pair(1f, 4.8f) to KEY_GRAY,
Pair(1f, 5.0f) to KEY_GRAY,
Pair(1f, 5.5f) to KEY_GRAY,
Pair(1f, 6.0f) to KEY_GRAY,
// Pulse Width = 1.5f
Pair(1.5f, 1.1f) to KEY_RED,
Pair(1.5f, 1.2f) to KEY_RED,
Pair(1.5f, 1.3f) to KEY_RED,
Pair(1.5f, 1.4f) to KEY_RED,
Pair(1.5f, 1.5f) to KEY_RED,
Pair(1.5f, 1.6f) to KEY_RED,
Pair(1.5f, 1.7f) to KEY_RED,
Pair(1.5f, 1.8f) to KEY_RED,
Pair(1.5f, 1.9f) to KEY_RED,
Pair(1.5f, 2.0f) to KEY_RED,
Pair(1.5f, 2.1f) to KEY_GRAY,
Pair(1.5f, 2.2f) to KEY_GRAY,
Pair(1.5f, 2.3f) to KEY_GRAY,
Pair(1.5f, 2.4f) to KEY_GRAY,
Pair(1.5f, 2.5f) to KEY_GRAY,
Pair(1.5f, 2.6f) to KEY_GRAY,
Pair(1.5f, 2.7f) to KEY_GRAY,
Pair(1.5f, 2.8f) to KEY_GRAY,
Pair(1.5f, 2.9f) to KEY_GRAY,
Pair(1.5f, 3.0f) to KEY_GRAY,
Pair(1.5f, 3.2f) to KEY_GRAY,
Pair(1.5f, 3.4f) to KEY_GRAY,
Pair(1.5f, 3.6f) to KEY_GRAY,
Pair(1.5f, 3.8f) to KEY_GRAY,
Pair(1.5f, 4.0f) to KEY_GRAY,
Pair(1.5f, 4.2f) to KEY_GRAY,
Pair(1.5f, 4.4f) to KEY_GRAY,
Pair(1.5f, 4.6f) to KEY_GRAY,
Pair(1.5f, 4.8f) to KEY_GRAY,
Pair(1.5f, 5.0f) to KEY_GRAY,
Pair(1.5f, 5.5f) to KEY_GRAY,
Pair(1.5f, 6.0f) to KEY_GRAY,
Pair(1.5f, 6.5f) to KEY_GRAY,
Pair(1.5f, 7.0f) to KEY_GRAY,
Pair(1.5f, 7.5f) to KEY_GRAY,
Pair(1.5f, 8.0f) to KEY_GRAY,
// Pulse Width = 3f
Pair(3f, 1.1f) to KEY_RED,
Pair(3f, 1.2f) to KEY_GRAY,
Pair(3f, 1.3f) to KEY_GRAY,
Pair(3f, 1.4f) to KEY_GRAY,
Pair(3f, 1.5f) to KEY_GRAY,
Pair(3f, 1.6f) to KEY_GRAY,
Pair(3f, 1.7f) to KEY_GRAY,
Pair(3f, 1.8f) to KEY_GRAY,
Pair(3f, 1.9f) to KEY_GRAY,
Pair(3f, 2.0f) to KEY_GRAY,
Pair(3f, 2.1f) to KEY_GRAY,
Pair(3f, 2.2f) to KEY_GRAY,
Pair(3f, 2.3f) to KEY_GRAY,
Pair(3f, 2.4f) to KEY_GRAY,
Pair(3f, 2.5f) to KEY_GRAY,
Pair(3f, 2.6f) to KEY_GRAY,
Pair(3f, 2.7f) to KEY_GRAY,
Pair(3f, 2.8f) to KEY_GRAY,
Pair(3f, 2.9f) to KEY_GRAY,
Pair(3f, 3.0f) to KEY_GRAY,
Pair(3f, 3.2f) to KEY_GRAY,
Pair(3f, 3.4f) to KEY_GRAY,
Pair(3f, 3.6f) to KEY_GRAY,
Pair(3f, 3.8f) to KEY_GRAY,
Pair(3f, 4.0f) to KEY_GRAY,
Pair(3f, 4.2f) to KEY_GRAY,
Pair(3f, 4.4f) to KEY_GRAY,
Pair(3f, 4.6f) to KEY_GRAY,
Pair(3f, 4.8f) to KEY_GRAY,
Pair(3f, 5.0f) to KEY_GRAY,
Pair(3f, 5.5f) to KEY_GRAY,
Pair(3f, 6.0f) to KEY_GRAY,
Pair(3f, 6.5f) to KEY_GRAY,
Pair(3f, 7.0f) to KEY_GRAY,
Pair(3f, 7.5f) to KEY_GRAY,
Pair(3f, 8.0f) to KEY_GRAY,
Pair(3f, 8.5f) to KEY_GRAY,
Pair(3f, 9.0f) to KEY_GRAY,
Pair(3f, 9.5f) to KEY_GRAY,
Pair(3f, 10.0f) to KEY_GRAY,
Pair(3f, 11.0f) to KEY_GRAY,
Pair(3f, 12.0f) to KEY_GRAY,
// Pulse Width = 5f
Pair(5f, 1.1f) to KEY_GRAY,
Pair(5f, 1.2f) to KEY_GRAY,
Pair(5f, 1.3f) to KEY_GRAY,
Pair(5f, 1.4f) to KEY_GRAY,
Pair(5f, 1.5f) to KEY_GRAY,
Pair(5f, 1.6f) to KEY_GRAY,
Pair(5f, 1.7f) to KEY_GRAY,
Pair(5f, 1.8f) to KEY_GRAY,
Pair(5f, 1.9f) to KEY_GRAY,
Pair(5f, 2.0f) to KEY_GRAY,
Pair(5f, 2.1f) to KEY_GRAY,
Pair(5f, 2.2f) to KEY_GRAY,
Pair(5f, 2.3f) to KEY_GRAY,
Pair(5f, 2.4f) to KEY_GRAY,
Pair(5f, 2.5f) to KEY_GRAY,
Pair(5f, 2.6f) to KEY_GRAY,
Pair(5f, 2.7f) to KEY_GRAY,
Pair(5f, 2.8f) to KEY_GRAY,
Pair(5f, 2.9f) to KEY_GRAY,
Pair(5f, 3.0f) to KEY_GRAY,
Pair(5f, 3.2f) to KEY_GRAY,
Pair(5f, 3.4f) to KEY_GRAY,
Pair(5f, 3.6f) to KEY_GRAY,
Pair(5f, 3.8f) to KEY_GRAY,
Pair(5f, 4.0f) to KEY_GRAY,
Pair(5f, 4.2f) to KEY_GRAY,
Pair(5f, 4.4f) to KEY_GRAY,
Pair(5f, 4.6f) to KEY_GRAY,
Pair(5f, 4.8f) to KEY_GRAY,
Pair(5f, 5.0f) to KEY_GRAY,
Pair(5f, 5.5f) to KEY_GRAY,
Pair(5f, 6.0f) to KEY_GRAY,
Pair(5f, 6.5f) to KEY_GRAY,
Pair(5f, 7.0f) to KEY_GRAY,
Pair(5f, 7.5f) to KEY_GRAY,
Pair(5f, 8.0f) to KEY_GRAY,
Pair(5f, 8.5f) to KEY_GRAY,
Pair(5f, 9.0f) to KEY_GRAY,
Pair(5f, 9.5f) to KEY_GRAY,
Pair(5f, 10.0f) to KEY_GRAY,
Pair(5f, 11.0f) to KEY_GRAY,
Pair(5f, 12.0f) to KEY_GRAY,
Pair(5f, 13.0f) to KEY_GRAY,
Pair(5f, 14.0f) to KEY_GRAY,
// Pulse Width = 10f
Pair(10f, 1.1f) to KEY_GRAY,
Pair(10f, 1.2f) to KEY_GRAY,
Pair(10f, 1.3f) to KEY_GRAY,
Pair(10f, 1.4f) to KEY_GRAY,
Pair(10f, 1.5f) to KEY_GRAY,
Pair(10f, 1.6f) to KEY_GRAY,
Pair(10f, 1.7f) to KEY_GRAY,
Pair(10f, 1.8f) to KEY_GRAY,
Pair(10f, 1.9f) to KEY_GRAY,
Pair(10f, 2.0f) to KEY_GRAY,
Pair(10f, 2.1f) to KEY_GRAY,
Pair(10f, 2.2f) to KEY_GRAY,
Pair(10f, 2.3f) to KEY_GRAY,
Pair(10f, 2.4f) to KEY_GRAY,
Pair(10f, 2.5f) to KEY_GRAY,
Pair(10f, 2.6f) to KEY_GRAY,
Pair(10f, 2.7f) to KEY_GRAY,
Pair(10f, 2.8f) to KEY_GRAY,
Pair(10f, 2.9f) to KEY_GRAY,
Pair(10f, 3.0f) to KEY_GRAY,
Pair(10f, 3.2f) to KEY_GRAY,
Pair(10f, 3.4f) to KEY_GRAY,
Pair(10f, 3.6f) to KEY_GRAY,
Pair(10f, 3.8f) to KEY_GRAY,
Pair(10f, 4.0f) to KEY_GRAY,
Pair(10f, 4.2f) to KEY_GRAY,
Pair(10f, 4.4f) to KEY_GRAY,
Pair(10f, 4.6f) to KEY_GRAY,
Pair(10f, 4.8f) to KEY_GRAY,
Pair(10f, 5.0f) to KEY_GRAY,
Pair(10f, 5.5f) to KEY_GRAY,
Pair(10f, 6.0f) to KEY_GRAY,
Pair(10f, 6.5f) to KEY_GRAY,
Pair(10f, 7.0f) to KEY_GRAY,
Pair(10f, 7.5f) to KEY_GRAY,
Pair(10f, 8.0f) to KEY_GRAY,
Pair(10f, 8.5f) to KEY_GRAY,
Pair(10f, 9.0f) to KEY_GRAY,
Pair(10f, 9.5f) to KEY_GRAY,
Pair(10f, 10.0f) to KEY_GRAY,
Pair(10f, 11.0f) to KEY_GRAY,
Pair(10f, 12.0f) to KEY_GRAY,
Pair(10f, 13.0f) to KEY_GRAY,
Pair(10f, 14.0f) to KEY_GRAY,
Pair(10f, 15.0f) to KEY_GRAY,
Pair(10f, 16.0f) to KEY_GRAY,
Pair(10f, 17.0f) to KEY_GRAY,
Pair(10f, 18.0f) to KEY_GRAY,
Pair(10f, 19.0f) to KEY_GRAY,
Pair(10f, 20.0f) to KEY_GRAY,
// Pulse Width = 15f
Pair(15f, 1.1f) to KEY_GRAY,
Pair(15f, 1.2f) to KEY_GRAY,
Pair(15f, 1.3f) to KEY_GRAY,
Pair(15f, 1.4f) to KEY_GRAY,
Pair(15f, 1.5f) to KEY_GRAY,
Pair(15f, 1.6f) to KEY_GRAY,
Pair(15f, 1.7f) to KEY_GRAY,
Pair(15f, 1.8f) to KEY_GRAY,
Pair(15f, 1.9f) to KEY_GRAY,
Pair(15f, 2.0f) to KEY_GRAY,
Pair(15f, 2.1f) to KEY_GRAY,
Pair(15f, 2.2f) to KEY_GRAY,
Pair(15f, 2.3f) to KEY_GRAY,
Pair(15f, 2.4f) to KEY_GRAY,
Pair(15f, 2.5f) to KEY_GRAY,
Pair(15f, 2.6f) to KEY_GRAY,
Pair(15f, 2.7f) to KEY_GRAY,
Pair(15f, 2.8f) to KEY_GRAY,
Pair(15f, 2.9f) to KEY_GRAY,
Pair(15f, 3.0f) to KEY_GRAY,
Pair(15f, 3.2f) to KEY_GRAY,
Pair(15f, 3.4f) to KEY_GRAY,
Pair(15f, 3.6f) to KEY_GRAY,
Pair(15f, 3.8f) to KEY_GRAY,
Pair(15f, 4.0f) to KEY_GRAY,
Pair(15f, 4.2f) to KEY_GRAY,
Pair(15f, 4.4f) to KEY_GRAY,
Pair(15f, 4.6f) to KEY_GRAY,
Pair(15f, 4.8f) to KEY_GRAY,
Pair(15f, 5.0f) to KEY_GRAY,
Pair(15f, 5.5f) to KEY_GRAY,
Pair(15f, 6.0f) to KEY_GRAY,
Pair(15f, 6.5f) to KEY_GRAY,
Pair(15f, 7.0f) to KEY_GRAY,
Pair(15f, 7.5f) to KEY_GRAY,
Pair(15f, 8.0f) to KEY_GRAY,
Pair(15f, 8.5f) to KEY_GRAY,
Pair(15f, 9.0f) to KEY_GRAY,
Pair(15f, 9.5f) to KEY_GRAY,
Pair(15f, 10.0f) to KEY_GRAY,
Pair(15f, 11.0f) to KEY_GRAY,
Pair(15f, 12.0f) to KEY_GRAY,
Pair(15f, 13.0f) to KEY_GRAY,
Pair(15f, 14.0f) to KEY_GRAY,
Pair(15f, 15.0f) to KEY_GRAY,
Pair(15f, 16.0f) to KEY_GRAY,
Pair(15f, 17.0f) to KEY_GRAY,
Pair(15f, 18.0f) to KEY_GRAY,
Pair(15f, 19.0f) to KEY_GRAY,
Pair(15f, 20.0f) to KEY_GRAY,
// Pulse Width = 20f
Pair(20f, 1.1f) to KEY_GRAY,
Pair(20f, 1.2f) to KEY_GRAY,
Pair(20f, 1.3f) to KEY_GRAY,
Pair(20f, 1.4f) to KEY_GRAY,
Pair(20f, 1.5f) to KEY_GRAY,
Pair(20f, 1.6f) to KEY_GRAY,
Pair(20f, 1.7f) to KEY_GRAY,
Pair(20f, 1.8f) to KEY_GRAY,
Pair(20f, 1.9f) to KEY_GRAY,
Pair(20f, 2.0f) to KEY_GRAY,
Pair(20f, 2.1f) to KEY_GRAY,
Pair(20f, 2.2f) to KEY_GRAY,
Pair(20f, 2.3f) to KEY_GRAY,
Pair(20f, 2.4f) to KEY_GRAY,
Pair(20f, 2.5f) to KEY_GRAY,
Pair(20f, 2.6f) to KEY_GRAY,
Pair(20f, 2.7f) to KEY_GRAY,
Pair(20f, 2.8f) to KEY_GRAY,
Pair(20f, 2.9f) to KEY_GRAY,
Pair(20f, 3.0f) to KEY_GRAY,
Pair(20f, 3.2f) to KEY_GRAY,
Pair(20f, 3.4f) to KEY_GRAY,
Pair(20f, 3.6f) to KEY_GRAY,
Pair(20f, 3.8f) to KEY_GRAY,
Pair(20f, 4.0f) to KEY_GRAY,
Pair(20f, 4.2f) to KEY_GRAY,
Pair(20f, 4.4f) to KEY_GRAY,
Pair(20f, 4.6f) to KEY_GRAY,
Pair(20f, 4.8f) to KEY_GRAY,
Pair(20f, 5.0f) to KEY_GRAY,
Pair(20f, 5.5f) to KEY_GRAY,
Pair(20f, 6.0f) to KEY_GRAY,
Pair(20f, 6.5f) to KEY_GRAY,
Pair(20f, 7.0f) to KEY_GRAY,
Pair(20f, 7.5f) to KEY_GRAY,
Pair(20f, 8.0f) to KEY_GRAY,
Pair(20f, 8.5f) to KEY_GRAY,
Pair(20f, 9.0f) to KEY_GRAY,
Pair(20f, 9.5f) to KEY_GRAY,
Pair(20f, 10.0f) to KEY_GRAY,
Pair(20f, 11.0f) to KEY_GRAY,
Pair(20f, 12.0f) to KEY_GRAY,
Pair(20f, 13.0f) to KEY_GRAY,
Pair(20f, 14.0f) to KEY_GRAY,
Pair(20f, 15.0f) to KEY_GRAY,
Pair(20f, 16.0f) to KEY_GRAY,
Pair(20f, 17.0f) to KEY_GRAY,
Pair(20f, 18.0f) to KEY_GRAY,
Pair(20f, 19.0f) to KEY_GRAY,
Pair(20f, 20.0f) to KEY_GRAY,
// Pulse Width = 25f
Pair(25f, 1.1f) to KEY_GRAY,
Pair(25f, 1.2f) to KEY_GRAY,
Pair(25f, 1.3f) to KEY_GRAY,
Pair(25f, 1.4f) to KEY_GRAY,
Pair(25f, 1.5f) to KEY_GRAY,
Pair(25f, 1.6f) to KEY_GRAY,
Pair(25f, 1.7f) to KEY_GRAY,
Pair(25f, 1.8f) to KEY_GRAY,
Pair(25f, 1.9f) to KEY_GRAY,
Pair(25f, 2.0f) to KEY_GRAY,
Pair(25f, 2.1f) to KEY_GRAY,
Pair(25f, 2.2f) to KEY_GRAY,
Pair(25f, 2.3f) to KEY_GRAY,
Pair(25f, 2.4f) to KEY_GRAY,
Pair(25f, 2.5f) to KEY_GRAY,
Pair(25f, 2.6f) to KEY_GRAY,
Pair(25f, 2.7f) to KEY_GRAY,
Pair(25f, 2.8f) to KEY_GRAY,
Pair(25f, 2.9f) to KEY_GRAY,
Pair(25f, 3.0f) to KEY_GRAY,
Pair(25f, 3.2f) to KEY_GRAY,
Pair(25f, 3.4f) to KEY_GRAY,
Pair(25f, 3.6f) to KEY_GRAY,
Pair(25f, 3.8f) to KEY_GRAY,
Pair(25f, 4.0f) to KEY_GRAY,
Pair(25f, 4.2f) to KEY_GRAY,
Pair(25f, 4.4f) to KEY_GRAY,
Pair(25f, 4.6f) to KEY_GRAY,
Pair(25f, 4.8f) to KEY_GRAY,
Pair(25f, 5.0f) to KEY_GRAY,
Pair(25f, 5.5f) to KEY_GRAY,
Pair(25f, 6.0f) to KEY_GRAY,
Pair(25f, 6.5f) to KEY_GRAY,
Pair(25f, 7.0f) to KEY_GRAY,
Pair(25f, 7.5f) to KEY_GRAY,
Pair(25f, 8.0f) to KEY_GRAY,
Pair(25f, 8.5f) to KEY_GRAY,
Pair(25f, 9.0f) to KEY_GRAY,
Pair(25f, 9.5f) to KEY_GRAY,
Pair(25f, 10.0f) to KEY_GRAY,
Pair(25f, 11.0f) to KEY_GRAY,
Pair(25f, 12.0f) to KEY_GRAY,
Pair(25f, 13.0f) to KEY_GRAY,
Pair(25f, 14.0f) to KEY_GRAY,
Pair(25f, 15.0f) to KEY_GRAY,
Pair(25f, 16.0f) to KEY_GRAY,
Pair(25f, 17.0f) to KEY_GRAY,
Pair(25f, 18.0f) to KEY_GRAY,
Pair(25f, 19.0f) to KEY_GRAY,
Pair(25f, 20.0f) to KEY_GRAY,
// Pulse Width = 30f
Pair(30f, 1.1f) to KEY_GRAY,
Pair(30f, 1.2f) to KEY_GRAY,
Pair(30f, 1.3f) to KEY_GRAY,
Pair(30f, 1.4f) to KEY_GRAY,
Pair(30f, 1.5f) to KEY_GRAY,
Pair(30f, 1.6f) to KEY_GRAY,
Pair(30f, 1.7f) to KEY_GRAY,
Pair(30f, 1.8f) to KEY_GRAY,
Pair(30f, 1.9f) to KEY_GRAY,
Pair(30f, 2.0f) to KEY_GRAY,
Pair(30f, 2.1f) to KEY_GRAY,
Pair(30f, 2.2f) to KEY_GRAY,
Pair(30f, 2.3f) to KEY_GRAY,
Pair(30f, 2.4f) to KEY_GRAY,
Pair(30f, 2.5f) to KEY_GRAY,
Pair(30f, 2.6f) to KEY_GRAY,
Pair(30f, 2.7f) to KEY_GRAY,
Pair(30f, 2.8f) to KEY_GRAY,
Pair(30f, 2.9f) to KEY_GRAY,
Pair(30f, 3.0f) to KEY_GRAY,
Pair(30f, 3.2f) to KEY_GRAY,
Pair(30f, 3.4f) to KEY_GRAY,
Pair(30f, 3.6f) to KEY_GRAY,
Pair(30f, 3.8f) to KEY_GRAY,
Pair(30f, 4.0f) to KEY_GRAY,
Pair(30f, 4.2f) to KEY_GRAY,
Pair(30f, 4.4f) to KEY_GRAY,
Pair(30f, 4.6f) to KEY_GRAY,
Pair(30f, 4.8f) to KEY_GRAY,
Pair(30f, 5.0f) to KEY_GRAY,
Pair(30f, 5.5f) to KEY_GRAY,
Pair(30f, 6.0f) to KEY_GRAY,
Pair(30f, 6.5f) to KEY_GRAY,
Pair(30f, 7.0f) to KEY_GRAY,
Pair(30f, 7.5f) to KEY_GRAY,
Pair(30f, 8.0f) to KEY_GRAY,
Pair(30f, 8.5f) to KEY_GRAY,
Pair(30f, 9.0f) to KEY_GRAY,
Pair(30f, 9.5f) to KEY_GRAY,
Pair(30f, 10.0f) to KEY_GRAY,
Pair(30f, 11.0f) to KEY_GRAY,
Pair(30f, 12.0f) to KEY_GRAY,
Pair(30f, 13.0f) to KEY_GRAY,
Pair(30f, 14.0f) to KEY_GRAY,
Pair(30f, 15.0f) to KEY_GRAY,
Pair(30f, 16.0f) to KEY_GRAY,
Pair(30f, 17.0f) to KEY_GRAY,
Pair(30f, 18.0f) to KEY_GRAY,
Pair(30f, 19.0f) to KEY_GRAY,
Pair(30f, 20.0f) to KEY_GRAY,
// Pulse Width = 35f
Pair(35f, 1.1f) to KEY_GRAY,
Pair(35f, 1.2f) to KEY_GRAY,
Pair(35f, 1.3f) to KEY_GRAY,
Pair(35f, 1.4f) to KEY_GRAY,
Pair(35f, 1.5f) to KEY_GRAY,
Pair(35f, 1.6f) to KEY_GRAY,
Pair(35f, 1.7f) to KEY_GRAY,
Pair(35f, 1.8f) to KEY_GRAY,
Pair(35f, 1.9f) to KEY_GRAY,
Pair(35f, 2.0f) to KEY_GRAY,
Pair(35f, 2.1f) to KEY_GRAY,
Pair(35f, 2.2f) to KEY_GRAY,
Pair(35f, 2.3f) to KEY_GRAY,
Pair(35f, 2.4f) to KEY_GRAY,
Pair(35f, 2.5f) to KEY_GRAY,
Pair(35f, 2.6f) to KEY_GRAY,
Pair(35f, 2.7f) to KEY_GRAY,
Pair(35f, 2.8f) to KEY_GRAY,
Pair(35f, 2.9f) to KEY_GRAY,
Pair(35f, 3.0f) to KEY_GRAY,
Pair(35f, 3.2f) to KEY_GRAY,
Pair(35f, 3.4f) to KEY_GRAY,
Pair(35f, 3.6f) to KEY_GRAY,
Pair(35f, 3.8f) to KEY_GRAY,
Pair(35f, 4.0f) to KEY_GRAY,
Pair(35f, 4.2f) to KEY_GRAY,
Pair(35f, 4.4f) to KEY_GRAY,
Pair(35f, 4.6f) to KEY_GRAY,
Pair(35f, 4.8f) to KEY_GRAY,
Pair(35f, 5.0f) to KEY_GRAY,
Pair(35f, 5.5f) to KEY_GRAY,
Pair(35f, 6.0f) to KEY_GRAY,
Pair(35f, 6.5f) to KEY_GRAY,
Pair(35f, 7.0f) to KEY_GRAY,
Pair(35f, 7.5f) to KEY_GRAY,
Pair(35f, 8.0f) to KEY_GRAY,
Pair(35f, 8.5f) to KEY_GRAY,
Pair(35f, 9.0f) to KEY_GRAY,
Pair(35f, 9.5f) to KEY_GRAY,
Pair(35f, 10.0f) to KEY_GRAY,
Pair(35f, 11.0f) to KEY_GRAY,
Pair(35f, 12.0f) to KEY_GRAY,
Pair(35f, 13.0f) to KEY_GRAY,
Pair(35f, 14.0f) to KEY_GRAY,
Pair(35f, 15.0f) to KEY_GRAY,
Pair(35f, 16.0f) to KEY_GRAY,
Pair(35f, 17.0f) to KEY_GRAY,
Pair(35f, 18.0f) to KEY_GRAY,
Pair(35f, 19.0f) to KEY_GRAY,
Pair(35f, 20.0f) to KEY_GRAY,
// Pulse Width = 40f
Pair(40f, 1.1f) to KEY_GRAY,
Pair(40f, 1.2f) to KEY_GRAY,
Pair(40f, 1.3f) to KEY_GRAY,
Pair(40f, 1.4f) to KEY_GRAY,
Pair(40f, 1.5f) to KEY_GRAY,
Pair(40f, 1.6f) to KEY_GRAY,
Pair(40f, 1.7f) to KEY_GRAY,
Pair(40f, 1.8f) to KEY_GRAY,
Pair(40f, 1.9f) to KEY_GRAY,
Pair(40f, 2.0f) to KEY_GRAY,
Pair(40f, 2.1f) to KEY_GRAY,
Pair(40f, 2.2f) to KEY_GRAY,
Pair(40f, 2.3f) to KEY_GRAY,
Pair(40f, 2.4f) to KEY_GRAY,
Pair(40f, 2.5f) to KEY_GRAY,
Pair(40f, 2.6f) to KEY_GRAY,
Pair(40f, 2.7f) to KEY_GRAY,
Pair(40f, 2.8f) to KEY_GRAY,
Pair(40f, 2.9f) to KEY_GRAY,
Pair(40f, 3.0f) to KEY_GRAY,
Pair(40f, 3.2f) to KEY_GRAY,
Pair(40f, 3.4f) to KEY_GRAY,
Pair(40f, 3.6f) to KEY_GRAY,
Pair(40f, 3.8f) to KEY_GRAY,
Pair(40f, 4.0f) to KEY_GRAY,
Pair(40f, 4.2f) to KEY_GRAY,
Pair(40f, 4.4f) to KEY_GRAY,
Pair(40f, 4.6f) to KEY_GRAY,
Pair(40f, 4.8f) to KEY_GRAY,
Pair(40f, 5.0f) to KEY_GRAY,
Pair(40f, 5.5f) to KEY_GRAY,
Pair(40f, 6.0f) to KEY_GRAY,
Pair(40f, 6.5f) to KEY_GRAY,
Pair(40f, 7.0f) to KEY_GRAY,
Pair(40f, 7.5f) to KEY_GRAY,
Pair(40f, 8.0f) to KEY_GRAY,
Pair(40f, 8.5f) to KEY_GRAY,
Pair(40f, 9.0f) to KEY_GRAY,
Pair(40f, 9.5f) to KEY_GRAY,
Pair(40f, 10.0f) to KEY_GRAY,
Pair(40f, 11.0f) to KEY_GRAY,
Pair(40f, 12.0f) to KEY_GRAY,
Pair(40f, 13.0f) to KEY_GRAY,
Pair(40f, 14.0f) to KEY_GRAY,
Pair(40f, 15.0f) to KEY_GRAY,
Pair(40f, 16.0f) to KEY_GRAY,
Pair(40f, 17.0f) to KEY_GRAY,
Pair(40f, 18.0f) to KEY_GRAY,
Pair(40f, 19.0f) to KEY_GRAY,
Pair(40f, 20.0f) to KEY_GRAY,
)

View File

@@ -0,0 +1,490 @@
package com.laseroptek.raman.const
import androidx.compose.ui.graphics.Color
import com.laseroptek.raman.R
import com.laseroptek.raman.data.model.IconButtonItem
import com.laseroptek.raman.data.model.Preset
import com.laseroptek.raman.data.model.serial.SprayDcd
import com.laseroptek.raman.utils.ext.formatWithThousandComma
///////////////////////////////////////////////////////////
// GLOBAL CONST
const val SHOW_ENERGY_DETECT_CLOSE = true
const val SHOW_ENERGY_DETECT = true
const val DATABASE_VERSION = 1
const val ENGINEER_PIN_NUNBER = "064589"
const val txRepeatMillis = 1 * 1000L // tx repeat (millis) : 1 sec (for real) vs 60 sec (for dev)
const val preHeatingMillis = 5 * 60 * 1000L // 5 * 60 * 1000L
const val SERIAL_PORT_NAME = "/dev/ttyS0"
const val SERIAL_BAUDRATE = 38400
///////////////////////////////////////////////////////////
// MIN MAX DEFAULT CONST
const val MIN_GUIDE_BEAM = 0
const val DEFAULT_GUIDE_BEAM = 1000
const val MAX_GUIDE_BEAM = 2000
const val MAX_LAMP_COUNT = 999999999
const val MAX_LASER_COUNT = 999999999
const val MAX_OP_TIME = 999999999
const val MAX_CHART_COLUMN_DATA_SIZE = 25
const val DEFAULT_LIFETIME_LAMP = 1000000
const val DEFAULT_LIFETIME_HP = 1000000
const val DEFAULT_LIFETIME_DETECTOR = 999999
const val DEFAULT_LIFETIME_WATER = 999999
const val MAX_LIFETIME_LAMP = 1000000
const val MAX_LIFETIME_HP = 1000000
const val MAX_LIFETIME_DETECTOR = 999999
const val MAX_LIFETIME_WATER = 999999
const val DEFAULT_REFER2_GOOD = 0.10f
const val DEFAULT_REFER2_ACCEPTABLE = 0.25f
const val DEFAULT_REFER2_BAD = 0.25f
const val MAX_REFER2_VALUE = 100 // 100% (= 1.0f)
const val MAX_TEMP_INT_DIGIT = 3 // 3 자리수 (xxx)
const val MAX_TEMP_DECIMAL_DIGIT = 1 // 1 자리수 (.x)
const val MAX_TEMP_VALUE = 100.0f // 최대 값
const val DEFAULT_Q_SWITCH_VALUE = 000.0f
const val MIN_Q_SWITCH_VALUE = 000.0f
const val MAX_Q_SWITCH_VALUE = 250.0f
const val MAX_REFER1_VALUE = 99999999 // 8 byte ascii (ENERGY DETECT MEASURED VALUE)
const val DEFAULT_REFER1_VALUE = 0 // initial state
const val DEFAULT_DCD_GAS_PRESSURE = 06.5f
const val DEFAULT_SPAY_DCD_TIME = 10
const val DEFAULT_SPAY_DCD_DELAY = 10
const val MAX_LOG_COUNT = 259200 // 약 1개월 정도 (30일/5초 * 3600 * 12)
const val RX_TIMEOUT_THRESHOLD = 5000L // 5 초
object CMD {
const val VERSION = 0x01
const val LASER_STATUS = 0x03
const val PURGE_BUBBLE = 0x05
const val DCD_GAS = 0x06
const val SPRAY_DCD = 0x07
const val HAND_PIECE = 0x08
const val GUIDE_BEAM = 0x09
const val HP_SHOT_COUNT = 0x0A
const val ENERGE_METER = 0x0B
const val TEMPERATURE = 0x0C
const val OVEN = 0x0D
const val Q_SWITCH = 0x0F
const val ERROR = 0x10
const val WARNING = 0x11
const val ENERGY_DETECT = 0x14
const val UPDATE_FIRMWARE = 0x20
const val CMD_FLAG = 0x80
const val WRITE_FLAG = 0x40
const val STX = 0x21
const val ETX = 0x0D
const val TIMEOUT = 0x01F4 // 500
}
object LASER_STATUS {
const val STAND_BY = 0x53 // (S)tandBy
const val READY = 0x52 // (R)eady
const val LASER_ON = 0x4C // (L)aserOn
const val INTERVAL = 0x49 // (I)nterval
}
object PURGE_STATUS {
const val ACCEPT = 0x41 // Activate (or Accept)
const val COMPLTE = 0x42 // Completed
const val FAIL = 0x46 // Defuse
const val INIT = 0x00
}
object DCD_STATUS {
const val ON = 0x41 // A
const val OFF = 0x44 // D
const val PRESSURE = 0x50
}
object SPRAY_STATUS {
const val ON = 0x41 // A
const val OFF = 0x44 // D
const val PRESSURE = 0x50
}
enum class READ_WRITE {
READ, WRITE, NONE
}
enum class TX_RX {
TX, RX, NONE
}
enum class AlertType {
WARNING,
ERROR
}
val ERROR_TABLE: List<Int> = listOf (
R.string.err_none, // 00
R.string.err_ps_comm,
R.string.err_head_comm,
R.string.err_simmer,
R.string.err_charge,
R.string.err_discharge,
R.string.err_optical_system,
R.string.err_water_level,
R.string.err_water_flow,
R.string.err_e_detect_system,
R.string.err_ktp_temp, // 10
R.string.err_chamber_temp,
R.string.err_baseplate_temp,
R.string.err_water_temp,
R.string.err_dcd_temp,
R.string.err_dcd_pressure,
R.string.err_shutter1,
R.string.err_shutter2,
R.string.err_not_defined,
R.string.err_interlock,
R.string.err_other, // 20
)
val WARNING_TABLE: List<Int> = listOf (
R.string.warn_none, // 00
R.string.warn_water_level,
R.string.warn_optical_energy,
R.string.warn_dcd_gas_shortage,
R.string.warn_dcd_bubble,
R.string.warn_internal_temp_high,
R.string.warn_internal_temp_low,
R.string.warn_humidity_1,
R.string.warn_humidity_2,
R.string.warn_hp_tip,
R.string.warn_lamp_count, // 10
R.string.warn_not_defined,
R.string.warn_not_defined,
R.string.warn_not_defined,
R.string.warn_not_defined,
R.string.warn_not_defined,
R.string.warn_not_defined,
R.string.warn_not_defined,
R.string.warn_not_defined,
R.string.warn_not_defined,
R.string.warn_not_defined, // 20
)
val handPieceTypes = listOf<String> (
"NONE",
"5x5",
"7x7",
"10x10",
"12x12",
"3x15",
"NONE",
"NONE",
)
val validHandPieceTypes = handPieceTypes.filter { it != "NONE" }
val lifeTimeTypes = listOf<String> (
"Lamp",
"HP 5x5",
"HP 7x7",
"HP 10x10",
"HP 12x12",
"HP 3x15",
"Detector",
"Water",
)
val temperatureTypes = listOf<String> (
"KTP",
"Chamber 1",
"Chamber 2",
"Baseplate",
"Water",
"Reserved",
"Reserved",
"Reserved",
)
// PulseDurations (= Pulse Width): xx.xf (ms), 12단계
val PulseDurations: List<Float> = listOf (
0.5f,
1.0f,
1.5f,
3.0f,
5.0f,
10.0f,
15.0f,
20.0f,
25.0f,
30.0f,
35.0f,
40.0f
)
// Fluences (= Energy): xxx (J/cm²),
// FluenceTable_0 (PulseWith: 0.5)
val Fluences: List<Float> = listOf (
2.0f,
2.1f,
2.2f,
2.3f,
2.4f,
2.5f,
2.6f,
2.7f,
2.8f,
2.9f,
3.0f,
3.2f,
3.4f,
3.6f,
3.8f,
4.0f,
4.2f,
4.4f,
4.6f,
4.8f,
5.0f,
5.5f,
6.0f,
6.5f,
7.0f,
7.5f,
8.0f,
)
// Energy (J) - Fixed Energy List
val Energies: List<Float> = listOf (
00.5f,
01.0f,
02.0f,
03.0f,
04.0f,
05.0f,
06.0f,
07.0f,
08.0f,
09.0f,
10.0f
)
// Repetitions (= Frequency): xx.xf (Hz)
val Repetitions: List<Float> = listOf (
01.0f,
02.0f,
03.0f,
04.0f,
05.0f,
06.0f,
07.0f,
08.0f,
09.0f,
10.0f
)
// Define integer keys for your lists
// You can choose any integers that make sense for your application
const val KEY_GREEN = 0
const val KEY_BLUE = 1
const val KEY_YELLOW = 2
const val KEY_RED = 3
const val KEY_GRAY = 4
// Combined map
// eg. get RepetitionList by Key.
// val repetitionList: List<Float>? = RepetitionsByColorKey[KEY_GRAY]
val RepetitionsByColorKey: Map<Int, List<Float>> = mapOf(
KEY_GREEN to listOf (
01.0f,
02.0f,
03.0f,
04.0f,
05.0f,
06.0f,
07.0f,
08.0f,
09.0f,
10.0f
),
KEY_BLUE to listOf (
01.0f,
02.0f,
03.0f,
04.0f,
05.0f,
),
KEY_YELLOW to listOf (
01.0f,
02.0f,
03.0f,
),
KEY_RED to listOf (
01.0f,
02.0f,
),
KEY_GRAY to listOf (
01.0f,
)
)
enum class LaserParameter {
PulseWidth,
Fluence,
Repetition,
}
enum class UpDownState {
Up,
Down
}
enum class GASCanValueState {
On,
Off
}
enum class PurgeState {
On,
Off,
Disabled
}
enum class GasSettingState {
On,
Off
}
enum class MinMaxUpDownState {
MinUp,
MinDown,
MaxUp,
MaxDown,
MinLongUp,
MinLongDown,
MaxLongUp,
MaxLongDown,
}
enum class LaserStatusType {
PULSE_DURATION,
FLUENCE,
REPETITION,
SKIN_TEMP,
}
enum class PresetButtonType {
SAVE,
LOAD,
}
val engineerModeButtonLists: List<IconButtonItem> = listOf(
IconButtonItem(
title = R.string.update_title,
image = R.drawable.ic_update,
containerColor = Color(26,51,81),
contentColor = Color(255,255,255)
),
IconButtonItem(
title = R.string.default_title,
image = R.drawable.ic_default,
containerColor = Color(36,67,105),
contentColor = Color(255,255,255)
),
IconButtonItem(
title = R.string.save_title,
image = R.drawable.ic_save,
containerColor = Color(35,35,33),
contentColor = Color(243,205,81)
),
IconButtonItem(
title = R.string.load_title,
image = R.drawable.ic_load,
containerColor = Color(46,103,59),
contentColor = Color(255,255,255)
),
IconButtonItem(
title = R.string.import_title,
image = R.drawable.ic_import,
containerColor = Color(47,51,57),
contentColor = Color(255,255,255)
),
IconButtonItem(
title = R.string.export_title,
image = R.drawable.ic_export,
containerColor = Color(47,51,57),
contentColor = Color(255,255,255)
),
IconButtonItem(
title = R.string.log_title,
image = R.drawable.ic_log,
containerColor = Color(255,255,255),
contentColor = Color(0,0,0)
),
)
// Product Serial Number
// eg. LO-3ND-BU-OCL-D
// LO : 회사 약호
// 3ND : 제품 기호
// BU : 제조년도 (끝2자리)
// OCL: 생산수량
// D : 제조월
// 제조연도 (십의자리) 또는 생산수량 (십의자리)
private val productYearOrQuantityTenthRange = 'A' .. 'J'
val productYearOrQuantityTenthRangeList = productYearOrQuantityTenthRange.toList().map{it.toString()}
// 제조연도 (일의자리)
private val productYearOrQuantityOnethRange = 'L' .. 'U'
val productYearOrQuantityOnethRangeList = productYearOrQuantityOnethRange.toList().map{it.toString()}
// 생산수량 (백의 자리)
private val productQuantityHundredthRange = '0' .. '9'
val productQuantityHundredthRangeList = productQuantityHundredthRange.toList().map{it.toString()}
// 제조월 (1월 ~ 12월)
val productMonthLists = listOf("L", "A", "S", "E", "R", "O", "P", "T", "2", "K", "N", "D")
val dcdCanTypeLists = listOf(350, 700) // listOf( 100, 300, 500, 700, 1000)
val dcdCanTypeFormatedLists = dcdCanTypeLists.map{ it.formatWithThousandComma() + " ml" }
val dcdLifeSpanAdjustLists = listOf( 0.5f, 0.7f, 0.9f, 1.0f, 1.1f, 1.2f )
val dcdLifeSpanAdjustStringLists = dcdLifeSpanAdjustLists.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() }
// default spray dcd list for options
val SprayDcdList = listOf<SprayDcd>(
SprayDcd(status = 0x44, sprayTime = 10, sprayDelay = 10), // default
SprayDcd(status = 0x44, sprayTime = 10, sprayDelay = 10),
SprayDcd(status = 0x44, sprayTime = 20, sprayDelay = 20),
SprayDcd(status = 0x44, sprayTime = 30, sprayDelay = 20),
SprayDcd(status = 0x44, sprayTime = 40, sprayDelay = 40),
SprayDcd(status = 0x44, sprayTime = 50, sprayDelay = 50),
SprayDcd(status = 0x44, sprayTime = 60, sprayDelay = 60),
)
val PresetList = listOf<Preset>(
/*
Preset(id = 0, handPieceType = 0, pulseWidth = 0.5f, fluence = 2.0f, repetition = 1.0f, priority = 0, name = "00"),
Preset(id = 1, handPieceType = 0, pulseWidth = 0.5f, fluence = 2.0f, repetition = 1.0f, priority = 1, name = "01"),
Preset(id = 2, handPieceType = 0, pulseWidth = 0.5f, fluence = 2.0f, repetition = 1.0f, priority = 2, name = "02"),
Preset(id = 3, handPieceType = 0, pulseWidth = 0.5f, fluence = 2.0f, repetition = 1.0f, priority = 3, name = "03"),
Preset(id = 4, handPieceType = 0, pulseWidth = 0.5f, fluence = 2.0f, repetition = 1.0f, priority = 4, name = "04"),
Preset(id = 5, handPieceType = 0, pulseWidth = 0.5f, fluence = 2.0f, repetition = 1.0f, priority = 5, name = "05"),
...
*/
)

View File

@@ -0,0 +1,181 @@
package com.laseroptek.raman.const
//
// Voltage Table
// - Map<Pair<Float, Float>, Int>
// - Map<Pair<KEY1, KEY2>, VALUE>
// - Map<Pair<PulseWidth(ms), Energy(J)>, Voltage(V)>
// > PulseWidth = 0.5, 1.0, 1.5, 3.0, 4.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0 (13 단계)
// > Energy = 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0 (11 단계)
val VoltageTable = mapOf(
// Pulse Width = 0.5f
Pair(0.5f, 00.5f) to 440,
Pair(0.5f, 01.0f) to 441,
Pair(0.5f, 02.0f) to 442,
Pair(0.5f, 03.0f) to 443,
Pair(0.5f, 04.0f) to 444,
Pair(0.5f, 05.0f) to 445,
Pair(0.5f, 06.0f) to 446,
Pair(0.5f, 07.0f) to 447,
Pair(0.5f, 08.0f) to 448,
Pair(0.5f, 09.0f) to 449,
Pair(0.5f, 10.0f) to 450,
// Pulse Width = 1.0f
Pair(1.0f, 00.5f) to 441,
Pair(1.0f, 01.0f) to 442,
Pair(1.0f, 02.0f) to 443,
Pair(1.0f, 03.0f) to 444,
Pair(1.0f, 04.0f) to 445,
Pair(1.0f, 05.0f) to 446,
Pair(1.0f, 06.0f) to 447,
Pair(1.0f, 07.0f) to 448,
Pair(1.0f, 08.0f) to 449,
Pair(1.0f, 09.0f) to 450,
Pair(1.0f, 10.0f) to 451,
// Pulse Width = 1.5f
Pair(1.5f, 00.5f) to 442,
Pair(1.5f, 01.0f) to 443,
Pair(1.5f, 02.0f) to 444,
Pair(1.5f, 03.0f) to 445,
Pair(1.5f, 04.0f) to 446,
Pair(1.5f, 05.0f) to 447,
Pair(1.5f, 06.0f) to 458,
Pair(1.5f, 07.0f) to 459,
Pair(1.5f, 08.0f) to 450,
Pair(1.5f, 09.0f) to 451,
Pair(1.5f, 10.0f) to 452,
// Pulse Width = 3f
Pair(3.0f, 00.5f) to 443,
Pair(3.0f, 01.0f) to 444,
Pair(3.0f, 02.0f) to 445,
Pair(3.0f, 03.0f) to 446,
Pair(3.0f, 04.0f) to 447,
Pair(3.0f, 05.0f) to 448,
Pair(3.0f, 06.0f) to 449,
Pair(3.0f, 07.0f) to 450,
Pair(3.0f, 08.0f) to 453,
Pair(3.0f, 09.0f) to 453,
Pair(3.0f, 10.0f) to 453,
// Pulse Width = 4f
Pair(4.0f, 00.5f) to 444,
Pair(4.0f, 01.0f) to 445,
Pair(4.0f, 02.0f) to 446,
Pair(4.0f, 03.0f) to 447,
Pair(4.0f, 04.0f) to 448,
Pair(4.0f, 05.0f) to 449,
Pair(4.0f, 06.0f) to 450,
Pair(4.0f, 07.0f) to 451,
Pair(4.0f, 08.0f) to 452,
Pair(4.0f, 09.0f) to 453,
Pair(4.0f, 10.0f) to 454,
// Pulse Width = 5f
Pair(5.0f, 00.5f) to 445,
Pair(5.0f, 01.0f) to 446,
Pair(5.0f, 02.0f) to 447,
Pair(5.0f, 03.0f) to 448,
Pair(5.0f, 04.0f) to 449,
Pair(5.0f, 05.0f) to 450,
Pair(5.0f, 06.0f) to 451,
Pair(5.0f, 07.0f) to 452,
Pair(5.0f, 08.0f) to 453,
Pair(5.0f, 09.0f) to 454,
Pair(5.0f, 10.0f) to 455,
// Pulse Width = 10f
Pair(10.0f, 00.5f) to 446,
Pair(10.0f, 01.0f) to 447,
Pair(10.0f, 02.0f) to 448,
Pair(10.0f, 03.0f) to 449,
Pair(10.0f, 04.0f) to 450,
Pair(10.0f, 05.0f) to 451,
Pair(10.0f, 06.0f) to 452,
Pair(10.0f, 07.0f) to 453,
Pair(10.0f, 08.0f) to 454,
Pair(10.0f, 09.0f) to 455,
Pair(10.0f, 10.0f) to 456,
// Pulse Width = 15f
Pair(15.0f, 00.5f) to 446,
Pair(15.0f, 01.0f) to 447,
Pair(15.0f, 02.0f) to 448,
Pair(15.0f, 03.0f) to 449,
Pair(15.0f, 04.0f) to 450,
Pair(15.0f, 05.0f) to 451,
Pair(15.0f, 06.0f) to 452,
Pair(15.0f, 07.0f) to 453,
Pair(15.0f, 08.0f) to 454,
Pair(15.0f, 09.0f) to 455,
Pair(15.0f, 10.0f) to 456,
// Pulse Width = 20f
Pair(20.0f, 00.5f) to 446,
Pair(20.0f, 01.0f) to 447,
Pair(20.0f, 02.0f) to 448,
Pair(20.0f, 03.0f) to 449,
Pair(20.0f, 04.0f) to 450,
Pair(20.0f, 05.0f) to 451,
Pair(20.0f, 06.0f) to 452,
Pair(20.0f, 07.0f) to 453,
Pair(20.0f, 08.0f) to 454,
Pair(20.0f, 09.0f) to 455,
Pair(20.0f, 10.0f) to 456,
// Pulse Width = 25f
Pair(25.0f, 00.5f) to 446,
Pair(25.0f, 01.0f) to 447,
Pair(25.0f, 02.0f) to 448,
Pair(25.0f, 03.0f) to 449,
Pair(25.0f, 04.0f) to 450,
Pair(25.0f, 05.0f) to 451,
Pair(25.0f, 06.0f) to 452,
Pair(25.0f, 07.0f) to 453,
Pair(25.0f, 08.0f) to 454,
Pair(25.0f, 09.0f) to 455,
Pair(25.0f, 10.0f) to 456,
// Pulse Width = 30f
Pair(30.0f, 00.5f) to 446,
Pair(30.0f, 01.0f) to 447,
Pair(30.0f, 02.0f) to 448,
Pair(30.0f, 03.0f) to 449,
Pair(30.0f, 04.0f) to 450,
Pair(30.0f, 05.0f) to 451,
Pair(30.0f, 06.0f) to 452,
Pair(30.0f, 07.0f) to 453,
Pair(30.0f, 08.0f) to 454,
Pair(30.0f, 09.0f) to 455,
Pair(30.0f, 10.0f) to 456,
// Pulse Width = 35f
Pair(35.0f, 00.5f) to 446,
Pair(35.0f, 01.0f) to 447,
Pair(35.0f, 02.0f) to 448,
Pair(35.0f, 03.0f) to 449,
Pair(35.0f, 04.0f) to 450,
Pair(35.0f, 05.0f) to 451,
Pair(35.0f, 06.0f) to 452,
Pair(35.0f, 07.0f) to 453,
Pair(35.0f, 08.0f) to 454,
Pair(35.0f, 09.0f) to 455,
Pair(35.0f, 10.0f) to 456,
// Pulse Width = 40f
Pair(40.0f, 00.5f) to 446,
Pair(40.0f, 01.0f) to 447,
Pair(40.0f, 02.0f) to 448,
Pair(40.0f, 03.0f) to 449,
Pair(40.0f, 04.0f) to 450,
Pair(40.0f, 05.0f) to 451,
Pair(40.0f, 06.0f) to 452,
Pair(40.0f, 07.0f) to 453,
Pair(40.0f, 08.0f) to 454,
Pair(40.0f, 09.0f) to 455,
Pair(40.0f, 10.0f) to 456
)

View File

@@ -0,0 +1,16 @@
package com.laseroptek.raman.data.model
enum class CountType {
LASER,
LAMP,
DCD;
}
/*
println("Index of CountType.LASER: ${CountType.LASER.index}") // Output: Index of CountType.LASER: 0
println("Index of CountType.LAMP: ${CountType.LAMP.index}") // Output: Index of CountType.LAMP: 1
println("Index of CountType.DCD: ${CountType.DCD.index}") // Output: Index of CountType.DCD: 2
// Or, if you prefer to use ordinal directly:
println("Ordinal of CountType.LAMP: ${CountType.LAMP.ordinal}") // Output: Ordinal of CountType.LAMP: 1
*/

View File

@@ -0,0 +1,6 @@
package com.laseroptek.raman.data.model
data class DcdType(
var canType: Int = 350, // 700 ml (fixed), 1,000 ml
var lifeSpan: Float = 1.0f, // Lifespan Adjust value
)

View File

@@ -0,0 +1,4 @@
package com.laseroptek.raman.data.model
// Energy TableEntry : Preference save format
data class FluenceEntry(val pulse: Float, val fluence: Float, val energy: Float)

View File

@@ -0,0 +1,12 @@
package com.laseroptek.raman.data.model
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.compose.ui.graphics.Color
data class IconButtonItem (
@param:StringRes val title: Int,
@param:DrawableRes val image: Int,
val containerColor: Color, // background color
val contentColor: Color // icon and text color
)

View File

@@ -0,0 +1,17 @@
package com.laseroptek.raman.data.model
import com.laseroptek.raman.const.DEFAULT_LIFETIME_DETECTOR
import com.laseroptek.raman.const.DEFAULT_LIFETIME_HP
import com.laseroptek.raman.const.DEFAULT_LIFETIME_LAMP
import com.laseroptek.raman.const.DEFAULT_LIFETIME_WATER
data class LifeTime(
val lamp: Int = DEFAULT_LIFETIME_LAMP,
val hp5x5: Int = DEFAULT_LIFETIME_HP,
val hp7x7: Int = DEFAULT_LIFETIME_HP,
val hp10x10: Int = DEFAULT_LIFETIME_HP,
val hp12x12: Int = DEFAULT_LIFETIME_HP,
val hp3x15: Int = DEFAULT_LIFETIME_HP,
val detector: Int = DEFAULT_LIFETIME_DETECTOR,
val water: Int = DEFAULT_LIFETIME_WATER,
)

View File

@@ -0,0 +1,26 @@
package com.laseroptek.raman.data.model
import com.laseroptek.raman.const.Fluences
import com.laseroptek.raman.const.PulseDurations
// Preset to Voltage of LaserStatus
data class Preset(
var pulseWidth: Float = PulseDurations[0],
var fluence: Float = Fluences[0],
var repetition: Float = 1f,
var name: String = "",
var priority: Int = 0, // 0: none, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6,
var handPieceType: Int = 0,
var id: Int = 0 // seq no 추가 시 max id + 1
)
/* cf)
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 = 00.0f, // xx.x (Pulse PulseWidth? 0.5, 1, 1.5, 4, 5, 10 .. 40 ms : 12 단계)
var frequence: Float = 00.0f // xx.x (Repetition? 1, 1.5, 2 10hz : 10 단계)
)
*/

View File

@@ -0,0 +1,11 @@
package com.laseroptek.raman.data.model
import com.laseroptek.raman.const.DEFAULT_REFER2_ACCEPTABLE
import com.laseroptek.raman.const.DEFAULT_REFER2_BAD
import com.laseroptek.raman.const.DEFAULT_REFER2_GOOD
data class Refer2(
var good: Float = DEFAULT_REFER2_GOOD, // Good - default - 10%
var acceptable: Float = DEFAULT_REFER2_ACCEPTABLE, // Acceptable - default 25%
var bad: Float = DEFAULT_REFER2_BAD, // Bad - default 25%
)

View File

@@ -0,0 +1,5 @@
package com.laseroptek.raman.data.model
// Repetition TableEntry : Preference save format
// repetition: (0: Green 6~10Hz, 1: Blue 4~5Hz, 2: Yellow: 3Hz, 3: Red: 2Hz, 4: grAy: 1Hz)
data class RepetitionEntry(val pulse: Float, val fluence: Float, val hzType: Int)

View File

@@ -0,0 +1,10 @@
package com.laseroptek.raman.data.model
data class SerialNumber (
val char1: Char = 'B',
val char2: Char = 'M',
val char3: Char = '1',
val char4: Char = 'B',
val char5: Char = 'B',
val char6: Char = 'S',
)

View File

@@ -0,0 +1,14 @@
package com.laseroptek.raman.data.model
/**
* A generic class that holds a value or an exception
*/
sealed class SerialResult<out R> {
data class Success<out T>(val data: T) : SerialResult<T>()
data class Error(val exception: Exception) : SerialResult<Nothing>()
//data class Loading<out T>(val isLoading: Boolean) : SerialResult<T>()
}
fun <T> SerialResult<T>.successOr(fallback: T): T {
return (this as? SerialResult.Success<T>)?.data ?: fallback
}

View File

@@ -0,0 +1,4 @@
package com.laseroptek.raman.data.model
// Voltage Table Entry : Preference save format
data class VoltageEntry(val pulse: Float, val energy: Float, val voltage: Int)

View File

@@ -0,0 +1,6 @@
package com.laseroptek.raman.data.model.chart
sealed class AnimationMode {
data class Together(val delayBuilder: (index: Int) -> Long = { 0 }) : AnimationMode()
data object OneByOne : AnimationMode()
}

View File

@@ -0,0 +1,11 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
data class BarProperties(
val thickness: Dp = 15.dp,
val spacing: Dp = 6.dp,
val cornerRadius: Bars.Data.Radius = Bars.Data.Radius.None,
val style: DrawStyle = DrawStyle.Fill
)

View File

@@ -0,0 +1,61 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.AnimationVector1D
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import kotlin.random.Random
data class Bars(
val label: String,
val values: List<Data>
) {
data class Data(
val id:Int = Random.nextInt(0, 999999),
val label: String? = null,
val value: Double,
val color: Brush,
val properties: BarProperties? = null,
val animationSpec: AnimationSpec<Float>? = null,
val animator:Animatable<Float, AnimationVector1D> = Animatable(0f)
) {
sealed class Radius() {
data object None : Radius()
data class Circular(val radius: Dp) : Radius()
data class Rectangle(
val topLeft: Dp = 0.dp,
val topRight: Dp = 0.dp,
val bottomLeft: Dp = 0.dp,
val bottomRight: Dp = 0.dp
) : Radius()
fun reverse(horizontal:Boolean = false):Radius{
return when(this){
is Circular, is None->{
this
}
is Rectangle->{
if (horizontal){
copy(
topLeft = topRight,
topRight = topLeft,
bottomLeft = bottomRight,
bottomRight = bottomLeft
)
}else{
copy(
topLeft = bottomLeft,
topRight = bottomRight,
bottomLeft = topLeft,
bottomRight = topRight
)
}
}
}
}
}
}
}

View File

@@ -0,0 +1,7 @@
package com.laseroptek.raman.data.model.chart
data class DividerProperties(
val enabled:Boolean = true,
val xAxisProperties:LineProperties = LineProperties(),
val yAxisProperties:LineProperties = LineProperties()
)

View File

@@ -0,0 +1,20 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.tween
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
data class DotProperties(
val enabled: Boolean = false,
val radius: Dp = 3.dp,
val color: Brush = SolidColor(Color(0xffE1E2EC)),
val strokeWidth: Dp = 2.dp,
val strokeColor: Brush = SolidColor(Color.Unspecified),
val strokeStyle: StrokeStyle = StrokeStyle.Normal,
val animationEnabled:Boolean = true,
val animationSpec: AnimationSpec<Float> = tween(300)
)

View File

@@ -0,0 +1,28 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.graphics.drawscope.DrawStyle as CanvasDrawStyle
sealed class DrawStyle() {
data class Stroke(val width: Dp = 2.dp, val strokeStyle: StrokeStyle = StrokeStyle.Normal) :
DrawStyle()
data object Fill : DrawStyle()
fun getStyle(density: Float):CanvasDrawStyle{
return when(this){
is Stroke->{
return Stroke(
width = this.width.value*density,
pathEffect = this.strokeStyle.pathEffect
)
}
is Fill->{
return androidx.compose.ui.graphics.drawscope.Fill
}
}
}
}

View File

@@ -0,0 +1,22 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
data class GridProperties(
val enabled: Boolean = true,
val xAxisProperties: AxisProperties = AxisProperties(),
val yAxisProperties: AxisProperties = AxisProperties()
){
data class AxisProperties(
val enabled: Boolean = true,
val style: StrokeStyle = StrokeStyle.Normal,
val color: Brush = SolidColor(Color.Gray),
val thickness: Dp = (.5).dp,
val lineCount:Int = 5
)
}

View File

@@ -0,0 +1,71 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.laseroptek.raman.utils.ext.format
sealed class IndicatorProperties(
open val enabled:Boolean,
open val textStyle: TextStyle,
open val count: IndicatorCount,
open val position: IndicatorPosition,
open val padding: Dp,
open val contentBuilder: (Double) -> String
)
data class VerticalIndicatorProperties(
override val enabled: Boolean = true,
override val textStyle: TextStyle = TextStyle.Default.copy(fontSize = 12.sp),
override val count: IndicatorCount = IndicatorCount.CountBased(count = 5),
override val position: IndicatorPosition.Vertical = IndicatorPosition.Vertical.Bottom,
override val padding: Dp = 12.dp,
override val contentBuilder: (Double) -> String = {
it.format(1)
}
) : IndicatorProperties(
enabled = enabled,
textStyle = textStyle,
count = count,
position = position,
contentBuilder = contentBuilder,
padding = padding
)
data class HorizontalIndicatorProperties(
override val enabled: Boolean = false,
override val textStyle: TextStyle = TextStyle.Default.copy(fontSize = 12.sp),
override val count: IndicatorCount = IndicatorCount.CountBased(count = 5),
override val position: IndicatorPosition.Horizontal = IndicatorPosition.Horizontal.Start,
override val padding: Dp = 12.dp,
override val contentBuilder: (Double) -> String = {
it.format(1)
}
) : IndicatorProperties(
enabled = enabled,
textStyle = textStyle,
count = count,
position = position,
contentBuilder = contentBuilder,
padding = padding
)
sealed interface IndicatorPosition {
enum class Vertical : IndicatorPosition {
Top,
Bottom
}
enum class Horizontal: IndicatorPosition {
Start,
End
}
}
sealed class IndicatorCount {
data class CountBased(val count: Int) : IndicatorCount()
data class StepBased(val stepBy: Double) : IndicatorCount()
}

View File

@@ -0,0 +1,15 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
data class LineProperties(
val enabled: Boolean = true,
val style: StrokeStyle = StrokeStyle.Normal,
val color: Brush = SolidColor(Color.Gray),
val thickness: Dp = (.5).dp,
)

View File

@@ -0,0 +1,9 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.sp
data class LabelHelperProperties(
val enabled:Boolean = false,
val textStyle: TextStyle = TextStyle.Default.copy(fontSize = 8.sp)
)

View File

@@ -0,0 +1,16 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
data class LabelProperties(
val enabled:Boolean = true,
val textStyle: TextStyle = TextStyle.Default.copy(fontSize = 12.sp, textAlign = TextAlign.End),
val padding:Dp = 12.dp,
val labels: List<String> = listOf(),
val rotationDegreeOnSizeConflict: Float = -45f,
val forceRotation: Boolean = false,
)

View File

@@ -0,0 +1,33 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.AnimationVector1D
import androidx.compose.animation.core.EaseInOutCubic
import androidx.compose.animation.core.tween
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.unit.dp
data class Line(
val label: String,
var values: List<Double>,
val color: Brush,
val firstGradientFillColor: Color? = null,
val secondGradientFillColor: Color? = null,
val drawStyle: DrawStyle = DrawStyle.Stroke(2.dp),
val strokeAnimationSpec: AnimationSpec<Float> = tween(2000, easing = EaseInOutCubic),
val gradientAnimationSpec: AnimationSpec<Float> = tween(2000),
val gradientAnimationDelay: Long = 1000,
val dotProperties: DotProperties? = DotProperties(
enabled = true,
color = SolidColor(Color(0xffE1E2EC)),
strokeWidth = 2.dp,
strokeColor = SolidColor(Color(0, 204, 204)),
),
val popupProperties: PopupProperties? = null,
val curvedEdges:Boolean? = true,
val strokeProgress: Animatable<Float, AnimationVector1D> = Animatable(0f),
val gradientProgress: Animatable<Float, AnimationVector1D> = Animatable(0f),
)

View File

@@ -0,0 +1,24 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.tween
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.laseroptek.raman.utils.ext.format
data class PopupProperties(
val enabled: Boolean = false,
val animationSpec: AnimationSpec<Float> = tween(400),
val duration: Long = 1500,
val textStyle: TextStyle = TextStyle.Default.copy(fontSize = 12.sp),
val containerColor: Color = Color(0xff313131),
val cornerRadius: Dp = 6.dp,
val contentHorizontalPadding: Dp = 4.dp,
val contentVerticalPadding: Dp = 2.dp,
val contentBuilder: (value: Double) -> String = {
it.format(1)
}
)

View File

@@ -0,0 +1,37 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.ui.graphics.PathEffect
sealed class StrokeStyle{
data object Normal:StrokeStyle()
data class Dashed(val intervals:FloatArray = floatArrayOf(10f,10f), val phase:Float = 10f):StrokeStyle() {
override fun equals(other: Any?): Boolean {
if (this === other) return true
other as Dashed
if (!intervals.contentEquals(other.intervals)) return false
if (phase != other.phase) return false
return true
}
override fun hashCode(): Int {
var result = intervals.contentHashCode()
result = 31 * result + phase.hashCode()
return result
}
}
val pathEffect:PathEffect? get() {
return when(this){
is Normal->{
null
}
is Dashed->{
PathEffect.dashPathEffect(intervals = intervals, phase = phase)
}
}
}
}

View File

@@ -0,0 +1,22 @@
package com.laseroptek.raman.data.model.chart
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.tween
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
data class ZeroLineProperties(
val enabled: Boolean = false,
val style: StrokeStyle = StrokeStyle.Normal,
val color: Brush = SolidColor(Color.Gray),
val thickness: Dp = (.5).dp,
val animationSpec:AnimationSpec<Float> = tween(durationMillis = 1000, delayMillis = 300),
val zType: ZType = ZType.Under
){
enum class ZType{
Under,Above
}
}

View File

@@ -0,0 +1,3 @@
package com.laseroptek.raman.data.model.engineer
data class LaserCount (val count : Int)

View File

@@ -0,0 +1,5 @@
package com.laseroptek.raman.data.model.serial
data class Alert(
val code: Int = 0,
)

View File

@@ -0,0 +1,9 @@
package com.laseroptek.raman.data.model.serial
import com.laseroptek.raman.const.DEFAULT_DCD_GAS_PRESSURE
data class DcdGas(
val status: Int = 0x41, // 1Byte(A(0x41): on, D(0x44): off, P(0x50): 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)/
)

View File

@@ -0,0 +1,5 @@
package com.laseroptek.raman.data.model.serial
data class DcdGasOnOff(
val status: Int = 0x54, // 0x54(T), 0x41(A: on), 0x44(D: off)
)

View File

@@ -0,0 +1,11 @@
package com.laseroptek.raman.data.model.serial
// type: 0x03 (Control to detect energy)
data class EnergyControl(
val type: Int = 0x03, // Control to detect energy (1Byte)
val status: Int = 0x41, // (1 Byte)
// - 0x41('A': Start), 0x42('B': Stop) : Tx
// - 0x47('G': Good), 0x4E('N': Not good) : Rx
val voltage: Int = 0x000 // 3 bytes
)

View File

@@ -0,0 +1,10 @@
package com.laseroptek.raman.data.model.serial
// type: 0x03 (Control to detect energy)
data class EnergyControlStop(
val type: Int = 0x03, // Control to detect energy (1Byte)
val status: Int = 0x41, // (1 Byte)
// - 0x41('A': Start), 0x42('B': Stop) : Tx
// - 0x47('G': Good), 0x4E('N': Not good) : Rx
)

View File

@@ -0,0 +1,11 @@
package com.laseroptek.raman.data.model.serial
// type: 0x02 (Check if insert in mount)
// type: 0x02 (Remove the handpiece in mount)
data class EnergyHandpiece(
val type: Int = 0x02, // Handpiece (1 Byte)
val status: Int = 0x41, // (1 Byte)
// - 0x41('A': Check), 0x42('B': Remove) : Tx
// - 0x47('G': Good), 0x4E('N': Not good) : Rx
)

View File

@@ -0,0 +1,11 @@
package com.laseroptek.raman.data.model.serial
// type: 0x02 (Check if insert in mount)
// type: 0x02 (Remove the handpiece in mount)
data class EnergyHandpieceRemove(
val type: Int = 0x02, // Handpiece (1 Byte)
val status: Int = 0x42, // (1 Byte)
// - 0x41('A': Check), 0x42('B': Remove) : Tx
// - 0x47('G': Good), 0x4E('N': Not good) : Rx
)

View File

@@ -0,0 +1,12 @@
package com.laseroptek.raman.data.model.serial
// type: 0x04 (Transmit the measured data)
data class EnergyMeasured(
val type: Int = 0x04, // Transmit the measured data (1 Byte)
val status: Int = 0x45, // (1 Byte)
// - 0x45('E': mEasured), 0x47('G': Good), 0x4E('N': Not good) : Rx
val i: Int = 0x69,
val measured: Int = 0x00, // (8 Byte) : Tx (Internal)
val e: Int = 0x65,
val measured2: Int = 0x00, // (8 Byte) : Tx (Extenal)
)

View File

@@ -0,0 +1,8 @@
package com.laseroptek.raman.data.model.serial
// type: 0x01 (Version)
data class EnergyVersion(
val type: Int = 0x01, // Version (1 Byte)
val hardware: String = "000A", // n.n.n.m (4 Bytes) : Rx
val software: String = "000A", // n.n.n.m (4 Bytes) : Rx
)

View File

@@ -0,0 +1,5 @@
package com.laseroptek.raman.data.model.serial
data class GuideBeam(
val value:Int = 0, // ascii 4 bytes (0 ~ 4000)
)

View File

@@ -0,0 +1,5 @@
package com.laseroptek.raman.data.model.serial
data class HPShotCount(
val count:Int = 0 // ascii (00 ~ 99)
)

View File

@@ -0,0 +1,5 @@
package com.laseroptek.raman.data.model.serial
data class HandPiece(
val type:Int = 1 // ascii (00 ~ 99)
)

View File

@@ -0,0 +1,29 @@
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],
)
*/

View File

@@ -0,0 +1,7 @@
package com.laseroptek.raman.data.model.serial
data class Oven(
val type: Byte = 0x41,
val ktp: Float = 00.0f
)

View File

@@ -0,0 +1,33 @@
package com.laseroptek.raman.data.model.serial
data class Packet(
val stx: ByteArray = byteArrayOf(0x21),
val cmd: ByteArray = byteArrayOf(0x00),
val data: ByteArray = byteArrayOf(),
val cs: ByteArray = byteArrayOf(0x0000),
val etx: ByteArray = byteArrayOf(0x0D)
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as Packet
if (!stx.contentEquals(other.stx)) return false
if (!cmd.contentEquals(other.cmd)) return false
if (!data.contentEquals(other.data)) return false
if (!cs.contentEquals(other.cs)) return false
if (!etx.contentEquals(other.etx)) return false
return true
}
override fun hashCode(): Int {
var result = stx.contentHashCode()
result = 31 * result + cmd.contentHashCode()
result = 31 * result + data.contentHashCode()
result = 31 * result + cs.contentHashCode()
result = 31 * result + etx.contentHashCode()
return result
}
}

View File

@@ -0,0 +1,6 @@
package com.laseroptek.raman.data.model.serial
// Read - Rx - 16Bytes
data class PurgeBubble(
val value: Int = 0x00 // 0x41 (Accept), 0x42 (Complete), 0x44(Deny), 0x00(Initial)
)

View File

@@ -0,0 +1,15 @@
package com.laseroptek.raman.data.model.serial
import com.laseroptek.raman.const.DEFAULT_Q_SWITCH_VALUE
data class QSwitch(
var delayTime: Float = DEFAULT_Q_SWITCH_VALUE,
var intervalTime: Float = DEFAULT_Q_SWITCH_VALUE
)
val Q_SWITCH_TOGGLE = listOf<String> (
"+0.5",
"+10.0",
"-10.0",
"-0.5",
)

View File

@@ -0,0 +1,10 @@
package com.laseroptek.raman.data.model.serial
import com.laseroptek.raman.const.DEFAULT_SPAY_DCD_DELAY
import com.laseroptek.raman.const.DEFAULT_SPAY_DCD_TIME
data class SprayDcd(
var status: Int = 0x41, // 1Byte(A(0x41): on, D(0x44): off, P(0x50): pressure)
var sprayTime: Int = DEFAULT_SPAY_DCD_TIME, // Ascii 3Byte (xxx): spray time (010 ~ 100 ms)
var sprayDelay: Int = DEFAULT_SPAY_DCD_DELAY // Ascii 3Byte (xxx): spray delay (010 ~ 100 ms)
)

View File

@@ -0,0 +1,13 @@
package com.laseroptek.raman.data.model.serial
data class Temperature(
val ktp: Float = 50.0f, // Postassium, Titanyl, Phosphate
val chamber1: Float = 80.0f,
val chamber2: Float = 80.0f,
val basePlate: Float = 45.0f,
val water: Float = 80.0f,
val intTemperature: Float = 0.0f,
val intHumidity: Float = 0.0f,
val extTemperature: Float = 0.0f,
val extHumidity: Float = 0.0f,
)

View File

@@ -0,0 +1,35 @@
package com.laseroptek.raman.data.model.serial
/*
val temp = Temperature(ktp = 1.1f)
val temperatureTimeStamp = TemperatureTimeStamp.fromTemperature(temp)
*/
data class TemperatureTimeStamp(
val ktp: Float = 00.0f,
val chamber1: Float = 00.0f,
val chamber2: Float = 00.0f,
val basePlate: Float = 00.0f,
val water: Float = 00.0f,
val intTemperature: Float = 00.0f,
val intHumidity: Float = 00.0f,
val extTemperature: Float = 00.0f,
val extHumidity: Float = 00.0f,
var timestamp: Long = 0L
) {
companion object {
fun fromTemperature(temperature: Temperature, timestamp: Long): TemperatureTimeStamp {
return TemperatureTimeStamp(
ktp = temperature.ktp,
chamber1 = temperature.chamber1,
chamber2 = temperature.chamber2,
basePlate = temperature.basePlate,
water = temperature.water,
intTemperature = temperature.intTemperature,
intHumidity = temperature.intHumidity,
extTemperature = temperature.extTemperature,
extHumidity = temperature.extHumidity,
timestamp = timestamp
)
}
}
}

View File

@@ -0,0 +1,15 @@
package com.laseroptek.raman.data.model.serial
import com.laseroptek.raman.BuildConfig
//import com.laseroptek.raman.const.VERSION_CODE
//import com.laseroptek.raman.const.VERSION_NAME
data class Version(
var lhHwRev: String = "000A",
var lhSwVer: String = "000A",
var psHwVer: String = "000A",
var psSwVer: String = "000A",
var verCode: String = BuildConfig.VERSION_CODE.toString(), // VERSION_CODE.toString(), //
var verName: String = BuildConfig.VERSION_NAME // VERSION_NAME //
)

View File

@@ -0,0 +1,11 @@
package com.laseroptek.raman.data.source.db
import com.laseroptek.raman.data.source.db.model.SerialLog
import kotlinx.coroutines.flow.Flow
interface DatabaseService {
fun selectSerialLog(maxRecord: Int) : Flow<List<SerialLog>>
suspend fun insertSerialLog(serialLog: SerialLog)
suspend fun trimLogs(limit: Int)
}

View File

@@ -0,0 +1,40 @@
package com.laseroptek.raman.data.datasource.db
import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.laseroptek.raman.const.DATABASE_VERSION
import com.laseroptek.raman.data.source.db.dao.SerialLogDao
import com.laseroptek.raman.data.source.db.model.SerialLog
/**
* The [RoomDatabase] we use in this app.
*/
@Database(entities = [SerialLog::class], version = DATABASE_VERSION, exportSchema = false)
abstract class RamanDatabase : RoomDatabase() {
abstract fun serialLogDao(): SerialLogDao
companion object {
const val DATABASE_NAME = "raman.db"
// Optional: Singleton pattern if not using Hilt (Hilt handles this better)
@Volatile
private var INSTANCE: RamanDatabase? = null
fun getInstance(context: Context): RamanDatabase {
return INSTANCE ?: synchronized(this) {
val instance = Room.databaseBuilder(
context.applicationContext,
RamanDatabase::class.java,
DATABASE_NAME
)
// Add migrations here if DATABASE_VERSION increases
// .addMigrations(MIGRATION_1_2, MIGRATION_2_3)
.fallbackToDestructiveMigration(dropAllTables = true) // Use with caution, deletes data on schema change if no migration
.build()
INSTANCE = instance
instance
}
}
}
}

View File

@@ -0,0 +1,19 @@
package com.laseroptek.raman.data.source.db
import com.laseroptek.raman.data.datasource.db.RamanDatabase
import com.laseroptek.raman.data.source.db.model.SerialLog
import kotlinx.coroutines.flow.Flow
class RamanDatabaseService(private val ramanDatabase: RamanDatabase) : DatabaseService {
override fun selectSerialLog(maxRecord: Int): Flow<List<SerialLog>> {
return ramanDatabase.serialLogDao().selectSerialLog(maxRecord)
}
override suspend fun insertSerialLog(serialLog: SerialLog) {
ramanDatabase.serialLogDao().insertSerialLog(serialLog)
}
override suspend fun trimLogs(limit: Int) {
ramanDatabase.serialLogDao().trimLogs(limit)
}
}

View File

@@ -0,0 +1,27 @@
package com.laseroptek.raman.data.datasource.db.dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Update
/**
* Base DAO.
*/
interface BaseDao<T> {
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insert(entity: T): Long
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertAll(vararg entity: T)
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertAll(entities: Collection<T>)
@Update(onConflict = OnConflictStrategy.REPLACE)
suspend fun update(entity: T)
@Delete
suspend fun delete(entity: T): Int
}

View File

@@ -0,0 +1,31 @@
package com.laseroptek.raman.data.source.db.dao
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Transaction
import com.laseroptek.raman.data.datasource.db.dao.BaseDao
import com.laseroptek.raman.data.source.db.model.SerialLog
import kotlinx.coroutines.flow.Flow
@Dao
abstract class SerialLogDao : BaseDao<SerialLog> {
@Transaction
@Query("SELECT * FROM serial_log ORDER BY ts DESC LIMIT :maxRecord")
abstract fun selectSerialLog(maxRecord: Int) : Flow<List<SerialLog>>
@Insert
abstract suspend fun insertSerialLog(serialLog: SerialLog)
@Query("""
DELETE FROM serial_log
WHERE id IN (
SELECT id FROM serial_log
ORDER BY ts ASC
LIMIT (SELECT COUNT(*) FROM serial_log) - :limit
)
""")
abstract suspend fun trimLogs(limit: Int)
}

View File

@@ -0,0 +1,52 @@
package com.laseroptek.raman.data.source.db.model
import androidx.compose.runtime.Immutable
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
@Entity(
tableName = "serial_log",
indices = [
Index("id", unique = true)
]
)
@Immutable
data class SerialLog(
@PrimaryKey(autoGenerate = true)
val id: Long = 0, // Optional: auto-generated primary key
val ts: Long = 0,
val cmd: Int = 0,
val tx: Boolean = false,
val w: Boolean = false,
val data: ByteArray = emptyList<Byte>().toByteArray(), // Room can handle ByteArray
val desc: String = ""
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as SerialLog
if (id != other.id) return false
if (ts != other.ts) return false
if (cmd != other.cmd) return false
if (tx != other.tx) return false
if (w != other.w) return false
if (!data.contentEquals(other.data)) return false
if (desc != other.desc) return false
return true
}
override fun hashCode(): Int {
var result = id.hashCode()
result = 31 * result + ts.hashCode()
result = 31 * result + cmd
result = 31 * result + tx.hashCode()
result = 31 * result + w.hashCode()
result = 31 * result + data.contentHashCode()
result = 31 * result + desc.hashCode()
return result
}
}

View File

@@ -0,0 +1,91 @@
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>>
/////
}

View File

@@ -0,0 +1,128 @@
package com.laseroptek.raman.data.source.serial
import android.os.ParcelFileDescriptor
import timber.log.Timber
import java.io.File
import javax.inject.Inject
import javax.inject.Singleton
@Singleton // Ensure the wrapper is a singleton if using Hilt
class SerialPort @Inject constructor() {
private var mFD = -1
private var mDataCallBack: DataCallback? = null
private var preventLibraryLoad = false
private constructor(preventLoading: Boolean) : this() {
this.preventLibraryLoad = preventLoading
if (preventLoading) {
Timber.d("SerialPort (dummy) created with library loading PREVENTED.")
}
}
init {
Timber.d("SerialPort instance created. Library loading will be lazy.")
}
companion object {
@Volatile
private var isLibraryLoaded = false
/**
* Consolidated Thread-safe lazy loader.
* Using @Synchronized on the companion method ensures the library
* is only loaded once for the entire application process.
*/
@Synchronized
fun ensureLibraryLoaded(): Boolean {
if (!isLibraryLoaded) {
try {
System.loadLibrary("serial_port")
isLibraryLoaded = true
Timber.d("Native library 'serial_port' loaded successfully.")
} catch (e: Exception) {
Timber.e(e, "Failed to load native library 'serial_port'")
}
}
return isLibraryLoaded
}
fun createDummy(): SerialPort {
return SerialPort(preventLoading = true)
}
}
fun open(path: String, speed: Int, dataCallBack: DataCallback?) {
// 1. Check if we should load the library
if (!preventLibraryLoad) {
if (!ensureLibraryLoaded()) {
Timber.e("Cannot open port: Native library failed to load.")
dataCallBack?.onData(byteArrayOf(0xE))
return
}
} else {
Timber.w("Port open called on dummy instance. Skipping native logic.")
return
}
try {
mDataCallBack = dataCallBack
val file = File(path)
if (!file.exists()) throw Exception("Device path $path does not exist")
val pFD = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_WRITE)
mFD = pFD.detachFd()
pFD.close()
if (mFD == -1) throw Exception("Failed to get valid FD")
// Call native open
open(mFD, speed)
Timber.d("Port open success (fd = %d)", mFD)
} catch (e: Exception) {
Timber.e(e, "Error opening port")
dataCallBack?.onData(byteArrayOf(0xE))
}
}
fun write(data: ByteArray) {
if (preventLibraryLoad) {
Timber.w("Write called on dummy. Data: ${data.contentToString()}")
return
}
val fd = mFD
if (fd != -1 && isLibraryLoaded) {
write(fd, data)
} else {
throw Exception("Port error: FD is -1 or Library not loaded")
}
}
fun close() {
val fd = mFD
if (fd != -1) {
if (isLibraryLoaded) {
close(fd)
}
mFD = -1
Timber.d("Port closed.")
}
}
fun getFD(): Int = mFD
// --- Native Callbacks & Methods ---
private fun onNativeData(data: ByteArray) {
if (mFD != -1) mDataCallBack?.onData(data)
}
private external fun open(fd: Int, speed: Int)
private external fun write(fd: Int, data: ByteArray)
private external fun close(fd: Int)
interface DataCallback {
fun onData(data: ByteArray)
}
}

View File

@@ -0,0 +1,12 @@
package com.laseroptek.raman.data.source.serial
import com.laseroptek.raman.data.model.SerialResult
import kotlinx.coroutines.flow.Flow
interface SerialPortInterface {
suspend fun open(path: String, speed: Int) : Flow<SerialResult<ByteArray>>
fun write(data: ByteArray) : SerialResult<String>
fun close() : SerialResult<String>
fun getFD() : Int
}

View File

@@ -0,0 +1,19 @@
package com.laseroptek.raman.di
import android.app.Application
import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object AppModule {
@Provides
@Singleton
fun provideApplicationContext(application: Application): Context {
return application.applicationContext
}
}

View File

@@ -0,0 +1,45 @@
package com.laseroptek.raman.di
import android.content.Context
import androidx.room.Room
import com.laseroptek.raman.data.datasource.db.RamanDatabase
import com.laseroptek.raman.data.source.db.DatabaseService
import com.laseroptek.raman.data.source.db.RamanDatabaseService
import com.laseroptek.raman.repository.DatabaseRepository
import com.laseroptek.raman.utils.DefaultDispatcherProvider
import com.laseroptek.raman.utils.DispatcherProvider
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
class DatabaseModule {
@Provides
@Singleton
fun provideDispatcher(): DispatcherProvider = DefaultDispatcherProvider()
@Singleton
@Provides
fun provideDatabaseRepository(databaseService: DatabaseService)= DatabaseRepository(databaseService)
@Provides
@Singleton
fun provideDatabaseService(appDatabase: RamanDatabase): DatabaseService {
return RamanDatabaseService(appDatabase)
}
@Provides
@Singleton
fun provideDatabase(
@ApplicationContext context: Context,
): RamanDatabase = Room.databaseBuilder(context, RamanDatabase::class.java, RamanDatabase.DATABASE_NAME)
// This is not recommended for normal apps, but the goal of this sample isn't to
// showcase all of Room.
.fallbackToDestructiveMigration(dropAllTables = true)
.build()
}

View File

@@ -0,0 +1,20 @@
package com.laseroptek.raman.di
import android.content.Context
import com.laseroptek.raman.repository.PreferenceRepository
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object PreferenceModule {
@Singleton
@Provides
fun provideDataStoreRepository(@ApplicationContext context: Context)= PreferenceRepository(context)
}

View File

@@ -0,0 +1,19 @@
package com.laseroptek.raman.di
import com.laseroptek.raman.data.source.serial.SerialPort
import com.laseroptek.raman.repository.SerialPortRepository
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object SerialPortModule {
@Singleton
@Provides
fun provideSerialPortRepository(serialPort: SerialPort) = SerialPortRepository(serialPort)
}

View File

@@ -0,0 +1,137 @@
package com.laseroptek.raman.navigation
import android.content.res.Configuration
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.NavigationRail
import androidx.compose.material3.NavigationRailItem
import androidx.compose.material3.NavigationRailItemDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import com.laseroptek.raman.ui.common.icon.mainIcon
import com.laseroptek.raman.utils.ext.px
import com.laseroptek.raman.utils.ext.toIntPx
import timber.log.Timber
@Composable
fun NavigationSideBar(
items: List<NavigationItem>,
currentRoute: String?,
innerPadding: PaddingValues,
onItemClick: (NavigationItem) -> Unit = {},
modifier: Modifier = Modifier
) {
// TestOnly {
Timber.d("top: %d.dp", innerPadding.calculateTopPadding().toIntPx) // top: 15.dp
Timber.d("bottom: %d.dp", innerPadding.calculateBottomPadding().toIntPx) // bottom: 0.dp
// } TestOnly
NavigationRail(
containerColor = Color.Transparent, // #F7F7F7
contentColor = Color.Transparent, // #EBEBEB
modifier = modifier
.size(102.px.dp, 316.px.dp)
.padding(
start = 30.px.dp,
//bottom = 60.px.dp
),
) {
Column(
modifier = Modifier
.size(72.px.dp, 256.px.dp)
.background(Color(21,21,21), RoundedCornerShape(40.px.dp)),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
items.filter { navigationItem ->
navigationItem.show
}.forEach { navigationItem ->
NavigationRailItem(
selected = navigationItem.route == currentRoute,
onClick = { onItemClick(navigationItem) },
icon = {
Box(
modifier = Modifier
.size(width = 60.px.dp, height = 60.px.dp)
.background(if (navigationItem.route == currentRoute) Color(80,70,35) else Color.Transparent
, RoundedCornerShape(36.px.dp)),
Alignment.Center
) {
Image(
painter = painterResource(id = mainIcon(navigationItem.route)),
contentDescription = null,
modifier = Modifier.size(24.px.dp),
colorFilter = if (navigationItem.route == currentRoute) ColorFilter.tint(Color(222,173,11)) else ColorFilter.tint(Color.White)
)
}
},
modifier = Modifier.size (width = 60.px.dp, height = 60.px.dp)
.align(Alignment.CenterHorizontally)
.clip(RoundedCornerShape(36.px.dp))
.background(if (navigationItem.route == currentRoute) Color(80,70,35) else Color.Transparent)
,
colors = NavigationRailItemDefaults.colors(
selectedIconColor = Color.White, // Color of the selected icon
unselectedIconColor = Color.Gray, // Color of the unselected icon
selectedTextColor = Color.White, // Color of the selected label
unselectedTextColor = Color.Gray, // Color of the unselected label
indicatorColor = Color.Transparent // Background color of the selected item
)
)
}
}
}
}
@Preview(
uiMode = Configuration.UI_MODE_NIGHT_NO,
showBackground = false,
device = "spec:width=1280dp,height=720dp,dpi=150,isRound=false,chinSize=0dp,orientation=landscape"
)
@Composable
fun PreviewNavigationSideBar() {
Column(
modifier = Modifier
.wrapContentSize()
.background(Color.White),
horizontalAlignment = Alignment.CenterHorizontally,
) {
val rootNavController = rememberNavController()
val navBackStackEntry by rootNavController.currentBackStackEntryAsState()
val currentRoute by remember(navBackStackEntry) {
derivedStateOf {
navBackStackEntry?.destination?.route
}
}
NavigationSideBar(
items = navigationItemsLists,
currentRoute = currentRoute,
innerPadding = PaddingValues(0.dp),
)
}
}

View File

@@ -0,0 +1,12 @@
package com.laseroptek.raman.navigation
import androidx.annotation.StringRes
data class NavigationItem(
@param:StringRes val title: Int,
val route: String,
val show: Boolean = true,
)

View File

@@ -0,0 +1,72 @@
/*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.laseroptek.raman.navigation
import com.laseroptek.raman.R
object Graph {
const val NAVIGATION_BAR_SCREEN_GRAPH = "navigationBarScreenGraph"
}
sealed class Routes(var route: String) {
data object Splash : Routes("splash")
data object Main : Routes("main")
data object Home : Routes("home")
data object Info : Routes("info")
data object Config : Routes("config")
data object Lock : Routes("lock")
data object Engineer : Routes("engineer")
}
val navigationItemsLists: List<NavigationItem> = listOf(
NavigationItem(
title = R.string.home,
route = Routes.Home.route,
),
NavigationItem(
title = R.string.info,
route = Routes.Info.route,
),
NavigationItem(
title = R.string.config,
route = Routes.Config.route,
),
NavigationItem(
title = R.string.lock,
route = Routes.Lock.route,
),
NavigationItem(
title = R.string.engineer,
route = Routes.Engineer.route,
show = false,
),
)
enum class LockNavigation {
Enter,
EnterConfirm,
Lock,
ExitConfirm,
}

View File

@@ -0,0 +1,91 @@
package com.laseroptek.raman.navigation.graphs
import android.content.res.Configuration
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.laseroptek.raman.data.datasource.db.RamanDatabase
import com.laseroptek.raman.data.source.db.RamanDatabaseService
import com.laseroptek.raman.navigation.Routes
import com.laseroptek.raman.repository.DatabaseRepository
import com.laseroptek.raman.repository.PreferenceRepository
import com.laseroptek.raman.repository.SerialPortRepository
import com.laseroptek.raman.ui.screens.config.ConfigScreen
import com.laseroptek.raman.ui.screens.engineer.EngineerScreen
import com.laseroptek.raman.ui.screens.home.HomeScreen
import com.laseroptek.raman.ui.screens.info.InfoScreen
import com.laseroptek.raman.ui.screens.lock.LockScreen
import com.laseroptek.raman.ui.screens.main.MainViewModel
import com.laseroptek.raman.utils.DefaultDispatcherProvider
@Composable
fun MainNavGraph(
mainNavController: NavHostController = rememberNavController(),
innerPadding: PaddingValues = PaddingValues(),
mainViewModel: MainViewModel = hiltViewModel<MainViewModel>(),
) {
NavHost(
navController = mainNavController,
startDestination = Routes.Home.route,
) {
composable(route = Routes.Home.route) {
HomeScreen(
paddingValues = innerPadding,
mainViewModel = mainViewModel,
)
}
composable(route = Routes.Info.route) {
InfoScreen(
paddingValues = innerPadding,
mainViewModel = mainViewModel,
)
}
composable(route = Routes.Config.route) {
ConfigScreen(
mainNavController = mainNavController,
paddingValues = innerPadding,
mainViewModel = mainViewModel,
)
}
composable(route = Routes.Lock.route) {
LockScreen(
mainNavController = mainNavController
)
}
composable(route = Routes.Engineer.route) {
EngineerScreen(
mainNavController = mainNavController,
paddingValues = innerPadding,
mainViewModel = mainViewModel,
)
}
}
}
@Preview(
apiLevel = 34,
uiMode = Configuration.UI_MODE_NIGHT_NO,
showBackground = false,
device = "spec:width=1920dp,height=1080dp,dpi=150,isRound=false,chinSize=0dp,orientation=landscape"
)
@Composable
fun PreviewMainNavGraph(
mainViewModel:MainViewModel = MainViewModel(
preferenceRepository = PreferenceRepository(LocalContext.current),
serialPortRepository = SerialPortRepository.createWithFakeRepository(),
databaseRepository = DatabaseRepository(RamanDatabaseService(RamanDatabase.getInstance(LocalContext.current))),
dispatcherProvider = DefaultDispatcherProvider(),
applicationContext = LocalContext.current
)
) {
MainNavGraph(
mainViewModel = mainViewModel,
)
}

View File

@@ -0,0 +1,45 @@
package com.laseroptek.raman.navigation.graphs
import android.annotation.SuppressLint
import androidx.compose.runtime.Composable
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.laseroptek.raman.navigation.Routes
import com.laseroptek.raman.ui.screens.main.MainScreen
import com.laseroptek.raman.ui.screens.main.MainViewModel
import com.laseroptek.raman.ui.screens.splash.SplashView
@SuppressLint("NewApi")
@Composable
fun SplashNavGraph(
splashNavController: NavHostController = rememberNavController(),
mainNavController: NavHostController = rememberNavController(),
mainViewModel: MainViewModel = hiltViewModel<MainViewModel>()
) {
NavHost(
navController = splashNavController,
startDestination = Routes.Splash.route,
) {
composable(
route = Routes.Splash.route
) {
SplashView(
splashNavController,
mainViewModel = mainViewModel
)
}
composable(
route = Routes.Main.route
) {
MainScreen(
mainNavController,
mainViewModel
)
}
}
}

View File

@@ -0,0 +1,30 @@
package com.laseroptek.raman.repository
import com.laseroptek.raman.data.source.db.DatabaseService
import com.laseroptek.raman.data.source.db.model.SerialLog
import dagger.hilt.android.scopes.ViewModelScoped
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.withContext
import javax.inject.Inject
@ViewModelScoped
class DatabaseRepository @Inject constructor(
private val databaseService: DatabaseService
) {
suspend fun selectSerialLog(maxRecord: Int): Flow<List<SerialLog>> {
return databaseService.selectSerialLog(maxRecord)
}
suspend fun insertSerialLog(serialLog: SerialLog) {
withContext(Dispatchers.IO) {
databaseService.insertSerialLog(serialLog)
}
}
suspend fun trimLogs(limit: Int) {
withContext(Dispatchers.IO) {
databaseService.trimLogs(limit)
}
}
}

View File

@@ -0,0 +1,562 @@
package com.laseroptek.raman.repository
import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.floatPreferencesKey
import androidx.datastore.preferences.core.intPreferencesKey
import androidx.datastore.preferences.core.longPreferencesKey
import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.datastore.preferences.preferencesDataStore
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.laseroptek.raman.const.PresetList
import com.laseroptek.raman.const.SprayDcdList
import com.laseroptek.raman.const.VoltageTable
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.VoltageEntry
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 com.laseroptek.raman.data.source.preference.Preference
import dagger.hilt.android.scopes.ViewModelScoped
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.map
import timber.log.Timber
const val DataStore_NAME = "ramanDataStore"
val Context.datastore : DataStore<Preferences> by preferencesDataStore(name = DataStore_NAME)
@ViewModelScoped
class PreferenceRepository(private val context: Context) : Preference {
private val gson = Gson()
companion object{
// Native Type
val SLIDER_VOLUME = floatPreferencesKey("SLIDER_VOLUME")
val GUIDE_BEAM = floatPreferencesKey("GUIDE_BEAM")
val OP_TIME_HOUR = longPreferencesKey("OP_TIME_HOUR")
val LAMP_COUNT = intPreferencesKey("LAMP_COUNT")
val GUIDE_BEAM_MIN = intPreferencesKey("GUIDE_BEAM_MIN")
val GUIDE_BEAM_MAX = intPreferencesKey("GUIDE_BEAM_MAX")
val DCD_COUNT = intPreferencesKey("DCD_COUNT")
val HP_COUNT = intPreferencesKey("HP_COUNT")
val SPRAY_DCD_INDEX = intPreferencesKey("SPRAY_DCD_INDEX")
// List of Custom Object Type
val VOLTAGE_TABLE = stringPreferencesKey("VOLTAGE_TABLE")
val PRESET_LIST = stringPreferencesKey("PRESET_LIST")
val SPRAY_DCD_LIST = stringPreferencesKey("SPRAY_DCD_LIST")
// Custom Object Type
val SPRAY_DCD = stringPreferencesKey("SPRAY_DCD")
val Q_SWITCH = stringPreferencesKey("Q_SWITCH")
val LIFE_TIME = stringPreferencesKey("LIFE_TIME")
val TEMPERATURE = stringPreferencesKey("TEMPERATURE")
val TEMPERATURE_WRITE = stringPreferencesKey("TEMPERATURE_WRITE")
val ENERGY_MEASURED_WRITE = stringPreferencesKey("ENERGY_MEASURED_WRITE")
val ENERGY_REFER_2 = stringPreferencesKey("ENERGY_REFER_2")
// List of String Object Type
val PRODUCT_SERIAL = stringPreferencesKey("PRODUCT_SERIAL")
val LASER_HAND_SERIAL = stringPreferencesKey("LASER_HAND_SERIAL")
val POWER_SUPPLY_SERIAL = stringPreferencesKey("POWER_SUPPLY_SERIAL")
}
override suspend fun clearAllPreferences() {
context.datastore.edit { preferences ->
preferences.clear()
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
// Map of Native Type
override suspend fun saveSliderVolumeToPreference(volume: Float) {
try {
context.datastore.edit { preferences ->
preferences[SLIDER_VOLUME] = volume
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize SLIDER_VOLUME to JSON.")
}
}
override suspend fun getSliderVolumeFromPreference(): Flow<Float> {
return context.datastore.data.map { preferences ->
preferences[SLIDER_VOLUME] ?: 0f
}.distinctUntilChanged().catch { e ->
Timber.e(e, "Failed to get or parse SLIDER_VOLUME. Emitting default.")
emit(0f)
}
}
override suspend fun saveGuideBeamToPreference(guideBeam: Float) {
try {
context.datastore.edit { preferences ->
preferences[GUIDE_BEAM] = guideBeam
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize GUIDE_BEAM to JSON.")
}
}
override suspend fun getGuideBeamFromPreference(): Flow<Float> {
return context.datastore.data.map { preferences ->
preferences[GUIDE_BEAM] ?: 0f
}.distinctUntilChanged().catch { e ->
Timber.e(e, "Failed to get or parse GUIDE_BEAM. Emitting default.")
emit(0f)
}
}
override suspend fun saveOpTimeHourToPreference(opTimeHour: Long) {
try {
context.datastore.edit { preferences ->
preferences[OP_TIME_HOUR] = opTimeHour
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize OP_TIME_HOUR to JSON.")
}
}
override suspend fun getOpTimeHourFromPreference(): Flow<Long> {
return context.datastore.data.map { preferences ->
preferences[OP_TIME_HOUR] ?: 0L
}.distinctUntilChanged().catch { e ->
Timber.e(e, "Failed to get or parse OP_TIME_HOUR. Emitting default.")
emit(0L)
}
}
override suspend fun saveHpCountToPreference(hpCount: Int) {
try {
context.datastore.edit { preferences ->
preferences[HP_COUNT] = hpCount
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize HP_COUNT to JSON.")
}
}
override suspend fun getHpCountToPreference(): Flow<Int> {
return context.datastore.data.map { preferences ->
preferences[HP_COUNT] ?: 0
}.distinctUntilChanged().catch { e ->
Timber.e(e, "Failed to get or parse HP_COUNT. Emitting default.")
emit(0)
}
}
override suspend fun saveLampCountToPreference(lampCount: Int) {
try {
context.datastore.edit { preferences ->
preferences[LAMP_COUNT] = lampCount
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize LAMP_COUNT to JSON.")
}
}
override suspend fun getLampCountFromPreference(): Flow<Int> {
return context.datastore.data.map { preferences ->
preferences[LAMP_COUNT] ?: 0
}.distinctUntilChanged().catch { e ->
Timber.e(e, "Failed to get or parse LAMP_COUNT. Emitting default.")
emit(0)
}
}
override suspend fun saveGuideBeamMinToPreference(guideBeamMin: Int) {
try {
context.datastore.edit { preferences ->
preferences[GUIDE_BEAM_MIN] = guideBeamMin
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize GUIDE_BEAM_MIN to JSON.")
}
}
override suspend fun getGuideBeamMinFromPreference(): Flow<Int> {
return context.datastore.data.map { preferences ->
preferences[GUIDE_BEAM_MIN] ?: 0
}.distinctUntilChanged().catch { e ->
Timber.e(e, "Failed to get or parse GUIDE_BEAM_MIN. Emitting default.")
emit(0)
}
}
override suspend fun saveGuideBeamMaxToPreference(guideBeamMax: Int) {
try {
context.datastore.edit { preferences ->
preferences[GUIDE_BEAM_MAX] = guideBeamMax
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize GUIDE_BEAM_MAX to JSON.")
}
}
override suspend fun getGuideBeamMaxFromPreference(): Flow<Int> {
return context.datastore.data.map { preferences ->
preferences[GUIDE_BEAM_MAX] ?: 0
}.distinctUntilChanged().catch { e ->
Timber.e(e, "Failed to get or parse GUIDE_BEAM_MAX. Emitting default.")
emit(0)
}
}
override suspend fun saveSprayDcdIndexToPreference(sprayDcdIndex: Int) {
try {
context.datastore.edit { preferences ->
preferences[SPRAY_DCD_INDEX] = sprayDcdIndex
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize SPRAY_SPRAY_DCD_INDEX to JSON.")
}
}
override suspend fun getSprayDcdIndexFromPreference(): Flow<Int> {
return context.datastore.data.map { preferences ->
preferences[SPRAY_DCD_INDEX] ?: 0
}.distinctUntilChanged().catch { e ->
Timber.e(e, "Failed to get or parse SPRAY_SPRAY_DCD_INDEX. Emitting default.")
emit(0)
}
}
override suspend fun saveDcdCountToPreference(dcdCount: Int) {
try {
context.datastore.edit { preferences ->
preferences[DCD_COUNT] = dcdCount
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize DCD_COUNT to JSON.")
}
}
override suspend fun getDcdCountFromPreference(): Flow<Int> {
return context.datastore.data.map { preferences ->
preferences[DCD_COUNT] ?: 0
}.distinctUntilChanged().catch { e ->
Timber.e(e, "Failed to get or parse DCD_COUNT. Emitting default.")
emit(0)
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
// Map of Custom Object
override suspend fun saveSprayDcdToPreference(sprayDcd: SprayDcd) {
try {
val jsonString = gson.toJson(sprayDcd)
context.datastore.edit { preferences ->
preferences[SPRAY_DCD] = jsonString
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize SPRAY_DCD to JSON.")
}
}
override suspend fun getSprayDcdFromPreference(): Flow<SprayDcd> {
return context.datastore.data.map { preferences ->
preferences[SPRAY_DCD]
}.distinctUntilChanged().map{ jsonString ->
gson.fromJson(jsonString, SprayDcd::class.java) ?: SprayDcd()
}.catch { e ->
Timber.e(e, "Failed to get or parse SPRAY_DCD. Emitting default.")
emit(SprayDcd())
}
}
override suspend fun saveQSwitchToPreference(qSwitch: QSwitch) {
try {
val jsonString = gson.toJson(qSwitch)
context.datastore.edit { preferences ->
preferences[Q_SWITCH] = jsonString
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize Q_SWITCH to JSON.")
}
}
override suspend fun getQSwitchFromPreference(): Flow<QSwitch> {
return context.datastore.data.map { preferences ->
preferences[Q_SWITCH]
}.distinctUntilChanged().map{ jsonString ->
gson.fromJson(jsonString, QSwitch::class.java) ?: QSwitch()
}.catch { e ->
Timber.e(e, "Failed to get or parse Q_SWITCH. Emitting default.")
emit(QSwitch())
}
}
override suspend fun saveLifeTimeToPreference(lifeTime: LifeTime) {
try {
val jsonString = gson.toJson(lifeTime)
context.datastore.edit { preferences ->
preferences[LIFE_TIME] = jsonString
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize LIFE_TIME to JSON.")
}
}
override suspend fun getLifeTimeFromPreference(): Flow<LifeTime> {
return context.datastore.data.map { preferences ->
preferences[LIFE_TIME]
}.distinctUntilChanged().map{ jsonString ->
gson.fromJson(jsonString, LifeTime::class.java) ?: LifeTime()
}.catch { e ->
Timber.e(e, "Failed to get or parse LIFE_TIME. Emitting default.")
emit(LifeTime())
}
}
override suspend fun saveTemperatureToPreference(temp: Temperature) {
try {
val jsonString = gson.toJson(temp)
context.datastore.edit { preferences ->
preferences[TEMPERATURE] = jsonString
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize TEMPERATURE to JSON.")
}
}
override suspend fun getTemperatureFromPreference(): Flow<Temperature> {
return context.datastore.data.map { preferences ->
preferences[TEMPERATURE]
}.distinctUntilChanged().map{ jsonString ->
gson.fromJson(jsonString, Temperature::class.java) ?: Temperature()
}.catch { e ->
Timber.e(e, "Failed to get or parse TEMPERATURE. Emitting default.")
emit(Temperature())
}
}
override suspend fun saveTemperatureWriteToPreference(temp: Temperature) {
try {
val jsonString = gson.toJson(temp)
context.datastore.edit { preferences ->
preferences[TEMPERATURE_WRITE] = jsonString
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize TEMPERATURE_WRITE to JSON.")
}
}
override suspend fun getTemperatureWriteFromPreference(): Flow<Temperature> {
return context.datastore.data.map { preferences ->
preferences[TEMPERATURE_WRITE]
}.distinctUntilChanged().map{ jsonString ->
gson.fromJson(jsonString, Temperature::class.java) ?: Temperature()
}.catch { e ->
Timber.e(e, "Failed to get or parse TEMPERATURE_WRITE. Emitting default.")
emit(Temperature())
}
}
override suspend fun saveEnergyMeasuredWriteToPreference(temp: EnergyMeasured) {
try {
val jsonString = gson.toJson(temp)
context.datastore.edit { preferences ->
preferences[ENERGY_MEASURED_WRITE] = jsonString
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize ENERGY_MEASURED_WRITE to JSON.")
}
}
override suspend fun getEnergyMeasuredWriteFromPreference(): Flow<EnergyMeasured> {
return context.datastore.data.map { preferences ->
preferences[ENERGY_MEASURED_WRITE]
}.distinctUntilChanged().map{jsonString ->
gson.fromJson(jsonString, EnergyMeasured::class.java) ?: EnergyMeasured()
}.catch { e ->
Timber.e(e, "Failed to get or parse ENERGY_MEASURED_WRITE. Emitting default.")
emit(EnergyMeasured())
}
}
override suspend fun saveEnergyRefer2ToPreference(refer2: Refer2) {
try {
val jsonString = gson.toJson(refer2)
context.datastore.edit { preferences ->
preferences[ENERGY_REFER_2] = jsonString
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize ENERGY_REFER_2 to JSON.")
}
}
override suspend fun getEnergyRefer2FromPreference(): Flow<Refer2> {
return context.datastore.data.map { preferences ->
preferences[ENERGY_REFER_2]
}.distinctUntilChanged().map{ jsonString ->
gson.fromJson(jsonString, Refer2::class.java) ?: Refer2()
}.catch { e ->
Timber.e(e, "Failed to get or parse ENERGY_REFER_2. Emitting default.")
emit(Refer2())
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
// Map of Pair<Float, Float> to Int to List<VoltageTable>
override suspend fun saveVoltageTableToPreference(voltageTable: Map<Pair<Float, Float>, Int>) {
try {
val serializableList = voltageTable.map { (key, value) ->
VoltageEntry(key.first, key.second, value)
}
context.datastore.edit { preferences ->
preferences[VOLTAGE_TABLE] = gson.toJson(serializableList)
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize VOLTAGE_TABLE to JSON.")
}
}
override suspend fun getVoltageTableFromPreference(): Flow<Map<Pair<Float, Float>, Int>> {
return context.datastore.data.map { preferences ->
preferences[VOLTAGE_TABLE]
}.distinctUntilChanged().map{ jsonString ->
if (!jsonString.isNullOrBlank()) {
val type = object : TypeToken<List<VoltageEntry>>() {}.type
val list: List<VoltageEntry> = gson.fromJson(jsonString, type) ?: emptyList()
list.associate { Pair(it.pulse, it.energy) to it.voltage }
} else {
VoltageTable
}
}.catch { e ->
Timber.e(e, "Failed to get or parse VOLTAGE_TABLE. Emitting default.")
emit(VoltageTable)
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
// List of Custom Object
override suspend fun savePresetListToPreference(presetList: List<Preset>) {
try {
context.datastore.edit { preferences ->
preferences[PRESET_LIST] = gson.toJson(presetList)
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize VOLTAGE_TABLE to JSON.")
}
}
override suspend fun getPresetListFromPreference(): Flow<List<Preset>> {
return context.datastore.data.map { preferences ->
preferences[PRESET_LIST]
}.distinctUntilChanged().map { jsonString ->
if (!jsonString.isNullOrBlank()) {
val type = object : TypeToken<List<Preset>>() {}.type
gson.fromJson(jsonString, type) ?: PresetList
} else {
PresetList
}
}.catch { e ->
Timber.e(e, "Failed to get or parse PRESET_LIST. Emitting default.")
emit(PresetList)
}
}
override suspend fun saveSprayDcdList(sprayDcdList: List<SprayDcd>) {
try {
context.datastore.edit { preferences ->
preferences[SPRAY_DCD_LIST] = gson.toJson(sprayDcdList)
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize SPRAY_DCD_LIST to JSON.")
}
}
override suspend fun getSprayDcdList(): Flow<List<SprayDcd>> {
return context.datastore.data.map { preferences ->
preferences[SPRAY_DCD_LIST]
}.distinctUntilChanged().map { jsonString ->
if (!jsonString.isNullOrBlank()) {
val type = object : TypeToken<List<SprayDcd>>() {}.type
gson.fromJson(jsonString, type) ?: SprayDcdList
} else {
SprayDcdList
}
}.catch { e ->
Timber.e(e, "Failed to get or parse SPRAY_DCD_LIST. Emitting default.")
emit(SprayDcdList)
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
// List of Native (String)
override suspend fun saveProductSerialListToPreference(productList: List<String>) {
try {
context.datastore.edit { preferences ->
preferences[PRODUCT_SERIAL] = gson.toJson(productList)
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize PRODUCT_SERIAL to JSON.")
}
}
override suspend fun getProductSerialListFromPreference(): Flow<List<String>> {
return context.datastore.data.map { preferences ->
preferences[PRODUCT_SERIAL]
}.distinctUntilChanged().map{ jsonString ->
if (!jsonString.isNullOrBlank()) {
val type = object : TypeToken<List<String>>() {}.type
gson.fromJson(jsonString, type) ?: listOf("B", "U", "O", "C", "L", "D")
} else {
listOf("B", "U", "O", "C", "L", "D")
}
}.catch { e ->
Timber.e(e, "Failed to get or parse PRODUCT_SERIAL. Emitting default.")
emit(listOf("B", "U", "O", "C", "L", "D"))
}
}
override suspend fun saveLaserHandSerialListToPreference(serialList: List<String>) {
try {
context.datastore.edit { preferences ->
preferences[LASER_HAND_SERIAL] = gson.toJson(serialList)
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize LASER_HAND_SERIAL to JSON.")
}
}
override suspend fun getLaserHandSerialListFromPreference(): Flow<List<String>> {
return context.datastore.data.map { preferences ->
preferences[LASER_HAND_SERIAL]
}.distinctUntilChanged().map { jsonString ->
if (!jsonString.isNullOrBlank()) {
val type = object : TypeToken<List<String>>() {}.type
gson.fromJson(jsonString, type) ?: listOf("B", "U", "O", "C", "L", "D")
} else {
listOf("B", "U", "O", "C", "L", "D")
}
}.catch { e ->
Timber.e(e, "Failed to get or parse LASER_HAND_SERIAL. Emitting default.")
emit(listOf("B", "U", "O", "C", "L", "D"))
}
}
override suspend fun savePowerSupplySerialListToPreference(powerSupplySerialList: List<String>) {
try {
context.datastore.edit { preferences ->
preferences[POWER_SUPPLY_SERIAL] = gson.toJson(powerSupplySerialList)
}
} catch (e: Exception) {
Timber.e(e, "Failed to serialize POWER_SUPPLY_SERIAL to JSON.")
}
}
override suspend fun getPowerSupplySerialListFromPreference(): Flow<List<String>> {
return context.datastore.data.map { preferences ->
preferences[POWER_SUPPLY_SERIAL]
}.distinctUntilChanged().map { jsonString ->
if (!jsonString.isNullOrBlank()) {
val type = object : TypeToken<List<String>>() {}.type
gson.fromJson(jsonString, type) ?: listOf("B", "U", "O", "C", "L", "D")
} else {
listOf("B", "U", "O", "C", "L", "D")
}
}.catch { e ->
Timber.e(e, "Failed to get or parse POWER_SUPPLY_SERIAL. Emitting default.")
emit(listOf("B", "U", "O", "C", "L", "D"))
}
}
}

View File

@@ -0,0 +1,64 @@
package com.laseroptek.raman.repository
import com.laseroptek.raman.data.model.SerialResult
import com.laseroptek.raman.data.source.serial.SerialPort
import com.laseroptek.raman.data.source.serial.SerialPortInterface
import dagger.hilt.android.scopes.ViewModelScoped
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow
import javax.inject.Inject
@ViewModelScoped
class SerialPortRepository @Inject constructor(
private var serialPort: SerialPort
) : SerialPortInterface {
companion object {
// Fake constructor 1: Create a SerialPort with a specific (fake) File Descriptor
fun createWithFakeRepository(): SerialPortRepository {
return SerialPortRepository()
}
}
private constructor() : this(
serialPort = SerialPort.createDummy()
)
override suspend fun open(path: String, speed: Int) : Flow<SerialResult<ByteArray>> = callbackFlow {
serialPort.open(path, speed, object : SerialPort.DataCallback {
override fun onData(data: ByteArray) {
// 명령단위로 데이터를 끊어서 처리 (한번에 송수신 가능한 크기는 1024 byte (1K))
if (data.contentEquals(byteArrayOf(0x0E))) {
trySend(SerialResult.Error(Exception("Port error")))
} else {
trySend(SerialResult.Success(data))
}
}
})
awaitClose()
}
override fun write(data: ByteArray) : SerialResult<String> {
SerialPort.ensureLibraryLoaded()
try {
serialPort.write(data)
return SerialResult.Success("Write success")
} catch (e: Exception) {
return SerialResult.Error(e)
}
}
override fun close() : SerialResult<String> {
try {
serialPort.close()
return SerialResult.Success("Port close success")
} catch (e: Exception) {
return SerialResult.Error(e)
}
}
override fun getFD() : Int {
return serialPort.getFD()
}
}

View File

@@ -0,0 +1,279 @@
package com.laseroptek.raman.ui
import android.content.Context
import android.content.Intent
import android.content.res.Configuration
import android.content.res.Resources
import android.media.AudioManager
import android.os.Build
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.viewModels
import androidx.annotation.RequiresApi
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.navigation.compose.rememberNavController
import com.laseroptek.raman.const.CMD
import com.laseroptek.raman.const.LASER_STATUS
import com.laseroptek.raman.const.READ_WRITE
import com.laseroptek.raman.ui.screens.main.MainScreen
import com.laseroptek.raman.ui.screens.main.MainViewModel
import com.laseroptek.raman.ui.theme.LightColors
import com.laseroptek.raman.ui.theme.MainTheme
import com.laseroptek.raman.utils.SharedPreferenceHelper
import com.laseroptek.raman.utils.SystemSound.setCurrentSystemVolume
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import timber.log.Timber
import java.util.Locale
@AndroidEntryPoint
class MainActivity : ComponentActivity() {
////////////////////////////////////////////////////////////////////////////////////////////////
// private val
/** mainViewModel - MainActivity ViewModel
* - 모든 Screen/View에서 공통으로 사용하는 ViewModel
* - Preference 초기 값 설정.
* - Serial 수신 및 수신 데이터 처리.
* - Serial 송신.
*/
private val mainViewModel: MainViewModel by viewModels()
/** selectApkLauncher - ActivityResultLauncher for selecting APK file.
* - apk 설치 파일 선택 및 설치
*/
//var selectedApkUri: Uri? = null
private val selectApkLauncher: ActivityResultLauncher<Intent> =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
// This callback is executed when the file chooser is closed.
// Reliably hide the system navigation bar to restore the app's immersive state.
setSystemBarsVisible(false)
if (result.resultCode == RESULT_OK) {
result.data?.data?.let { uri ->
//selectedApkUri = uri
Timber.d("Selected APK URI: $uri")
}
} else {
Timber.d("No APK file selected")
//selectedApkUri = null
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
// override functions
/** attachBaseContext - language setting
* - onCreate() 이전에 호출 됨
* - Locale 및 Resouce 반영
*/
override fun attachBaseContext(newBase: Context) {
val selectedLanguage = SharedPreferenceHelper.getString(newBase, "language", "en") ?: "en"
Timber.d("attachBaseContext: language: ${selectedLanguage}")
val locale = Locale.forLanguageTag(selectedLanguage)
Locale.setDefault(locale) // Set default locale for the app
val config = Configuration(newBase.resources.configuration)
config.setLocale(locale)
val localizedContext = newBase.createConfigurationContext(config)
super.attachBaseContext(localizedContext)
}
fun setSystemBarsVisible(visible: Boolean) {
val windowInsetsController = WindowCompat.getInsetsController(window, window.decorView)
if (visible) {
// Makes the bars visible and pushes your app content down.
WindowCompat.setDecorFitsSystemWindows(window, true)
windowInsetsController.show(WindowInsetsCompat.Type.systemBars())
} else {
// Allows your app content to draw behind the bars (edge-to-edge).
WindowCompat.setDecorFitsSystemWindows(window, false)
windowInsetsController.systemBarsBehavior =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
// Hides the bars, making them transparent.
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
}
}
@RequiresApi(Build.VERSION_CODES.R)
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setSystemBarsVisible(false)
enableEdgeToEdge()
// hide soft keyboard (not working)
//window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)
// Set Full Screen (Immersive Mode)
/*
val windowInsetsController = WindowCompat.getInsetsController(window, window.decorView)
windowInsetsController.apply {
systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
hide(WindowInsetsCompat.Type.statusBars())
hide(WindowInsetsCompat.Type.navigationBars())
hide(WindowInsetsCompat.Type.systemBars())
//hide(WindowInsetsCompat.Type.ime()) // hide soft keyboard (not working)
}
*/
/*
window.attributes.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
WindowCompat.setDecorFitsSystemWindows(window, true)
val windowInsetsController = WindowCompat.getInsetsController(window, window.decorView)
windowInsetsController.show(WindowInsetsCompat.Type.systemBars())
*/
initialize()
// apk observeUpdateEvents
observeUpdateEvents()
setContent {
rememberNavController()
val mainNavController = rememberNavController()
//추후 동적으로 테마 변경 요청시 고려.
//var isDarkTheme by remember { mutableStateOf(false) } // Initial theme state
MainTheme(
colorScheme = LightColors // DarkColors
) {
/*
SplashNavGraph(
splashNavController = splashNavController,
mainNavController = mainNavController,
mainViewModel = mainViewModel,
)
*/
MainScreen(
mainNavController,
mainViewModel
)
}
}
}
override fun onPause() {
super.onPause()
Timber.d("onPause")
// set laser status (false)
mainViewModel.txPacket(READ_WRITE.WRITE, CMD.LASER_STATUS, byteArrayOf(LASER_STATUS.STAND_BY.toByte()))
}
override fun onDestroy() {
super.onDestroy()
Timber.d("onDestroy")
// - not used
//unregisterReceiver(usbReceiver)
}
////////////////////////////////////////////////////////////////////////////////////////////////
// private functions
/** observeUpdateEvents - apkUpdateEvent monitoring
* - Engineer Mode에서 Update 시 발생시킨 Event 모니터
*/
private fun observeUpdateEvents() {
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
mainViewModel.apkUpdateEvent.collect {
Timber.d("apkUpdateEvent received")
// Before launching the system file chooser, show the navigation bar.
setSystemBarsVisible(true)
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT).apply {
addCategory(Intent.CATEGORY_OPENABLE)
type = "application/vnd.android.package-archive" // MIME type for APK files
}
selectApkLauncher.launch(intent)
}
}
}
}
// not working
/*
private fun setAppLocale(languageCode: String) { // e.g., "es", "fr-CA"
val appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags(languageCode)
AppCompatDelegate.setApplicationLocales(appLocale)
// No need to manually call recreate() usually, AppCompat handles it.
}
*/
private fun initialize() {
// Force VM creation on Main thread (instantly)
val vm = mainViewModel
// Timber.d("density: ${Resources.getSystem().displayMetrics.density}")
// Use Dispatchers.Default for orchestration to keep IO free for disk
lifecycleScope.launch(Dispatchers.IO) {
try {
// 1. Heavy background work
vm.performFullInitialization()
withContext(Dispatchers.Main) {
// 2. STAGGERED START:
// Let the Main Thread draw the Loading screen one last time
delay(200)
// 3. Sync Volume (this can be slow, do it before flipping the UI)
setCurrentSystemVolume(
applicationContext,
AudioManager.STREAM_MUSIC,
vm.sliderVolume.value.toInt()
)
// 4. IMPORTANT: Signal initialization
vm.setInitialized(true)
// 5. POST-RENDER DELAY:
// Wait for the Dashboard to actually draw before starting Serial Loops.
// This prevents serial interrupts from stealing CPU during the first frame.
delay(200)
vm.txPacketOnce()
vm.rxPacketLoop()
vm.txPacketLoop()
Timber.d("System fully operational.")
}
} catch (e: Exception) {
Timber.e(e)
}
}
}
// End of File
////////////////////////////////////////////////////////////////////////////////////////////////
}

View File

@@ -0,0 +1,196 @@
package com.laseroptek.raman.ui.common.button
import android.content.res.Configuration
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.laseroptek.raman.R
import com.laseroptek.raman.ui.theme.RobotoTypography
import com.laseroptek.raman.utils.ext.dropShadow
import com.laseroptek.raman.utils.ext.noRippleClickable
import com.laseroptek.raman.utils.ext.px
@Composable
fun ButtonWithGradientHIconAndText(
modifier: Modifier = Modifier,
painter: Painter = painterResource(id = R.drawable.ic_spray),
title: String = "Purge",
onClick: () -> Unit = {}
) {
Row(
modifier = modifier
.noRippleClickable {
onClick.invoke()
},
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
) {
Image(
modifier = Modifier.size(14.px.dp, 14.px.dp),
painter = painter,
contentDescription = null,
contentScale = ContentScale.Crop,
colorFilter = ColorFilter.tint(Color.Black)
)
Spacer(modifier = Modifier.width(4.px.dp))
Text(
text = title,
style = RobotoTypography.bodySmall,
fontWeight = FontWeight.Thin,
fontSize = 14.px.sp,
color = Color.Black,
)
}
}
@Preview(
uiMode = Configuration.UI_MODE_NIGHT_NO,
showBackground = false
)
@Composable
fun PreviewButtonWithGradientHIconAndText() {
Column (
modifier = Modifier.background(Color.White),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
ButtonWithGradientHIconAndText(
modifier = Modifier
.size(85.px.dp, 32.px.dp)
.clip(RoundedCornerShape(7.px.dp))
.background(
brush = Brush.linearGradient(
colorStops = arrayOf(
0.0f to Color(43, 20, 63),
1.0f to Color(123, 74, 152),
)
)
)
.border(1.5.px.dp, color = Color(92, 47, 130), shape = RoundedCornerShape(7.px.dp))
.dropShadow(
shape = RoundedCornerShape(7.px.dp),
color = Color(243,205,81).copy(alpha = 0.2f),
blur = 3.5.px.dp,
offsetX = 0.px.dp,
offsetY = 0.px.dp,
spread = 0.px.dp
)
.dropShadow(
shape = RoundedCornerShape(7.px.dp),
color = Color(0,0,0).copy(alpha = 0.1f),
blur = 3.5.px.dp,
offsetX = 1.75.px.dp,
offsetY = 1.75.px.dp,
spread = 0.px.dp
),
title = "Purge",
painter = painterResource(id = R.drawable.ic_purge),
onClick = {
// Perform action when button is clicked
}
)
Spacer(modifier = Modifier.height(16.px.dp))
ButtonWithGradientHIconAndText(
modifier = Modifier
.size(76.px.dp, 32.px.dp)
.clip(RoundedCornerShape(7.px.dp))
.background(
brush = Brush.linearGradient(
colorStops = arrayOf(
0.0f to Color(47, 51, 57),
1.0f to Color(83, 88, 97),
)
)
)
.border(1.5.px.dp, color = Color(92, 99, 107), shape = RoundedCornerShape(7.px.dp))
.dropShadow(
shape = RoundedCornerShape(7.px.dp),
color = Color(243,205,81).copy(alpha = 0.2f),
blur = 3.5.px.dp,
offsetX = 0.px.dp,
offsetY = 0.px.dp,
spread = 0.px.dp
)
.dropShadow(
shape = RoundedCornerShape(7.px.dp),
color = Color(0,0,0).copy(alpha = 0.1f),
blur = 3.5.px.dp,
offsetX = 1.75.px.dp,
offsetY = 1.75.px.dp,
spread = 0.px.dp
),
title = "Refresh",
painter = painterResource(id = R.drawable.ic_refresh),
onClick = {
// Perform action when button is clicked
}
)
Spacer(modifier = Modifier.height(16.px.dp))
ButtonWithGradientHIconAndText(
modifier = Modifier
.size(76.px.dp, 32.px.dp)
.clip(RoundedCornerShape(7.px.dp))
.background(
brush = Brush.linearGradient(
colorStops = arrayOf(
0.0f to Color(82, 63, 2),
1.0f to Color(204, 156, 0),
)
)
)
.border(1.5.px.dp, color = Color(142, 110, 5), shape = RoundedCornerShape(7.px.dp))
.dropShadow(
shape = RoundedCornerShape(7.px.dp),
color = Color(243,205,81).copy(alpha = 0.2f),
blur = 3.5.px.dp,
offsetX = 0.px.dp,
offsetY = 0.px.dp,
spread = 0.px.dp
)
.dropShadow(
shape = RoundedCornerShape(7.px.dp),
color = Color(0,0,0).copy(alpha = 0.1f),
blur = 3.5.px.dp,
offsetX = 1.75.px.dp,
offsetY = 1.75.px.dp,
spread = 0.px.dp
),
title = "Test",
painter = painterResource(id = R.drawable.ic_spray),
onClick = {
// Perform action when button is clicked
}
)
}
}

View File

@@ -0,0 +1,101 @@
package com.laseroptek.raman.ui.common.button
import android.content.res.Configuration
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.laseroptek.raman.R
import com.laseroptek.raman.ui.theme.RacingSansOneTypography
import com.laseroptek.raman.ui.theme.RobotoTypography
import com.laseroptek.raman.utils.ext.noRippleClickable
import com.laseroptek.raman.utils.ext.px
@Composable
fun ButtonWithHIconAndText(
modifier: Modifier = Modifier.size(483.px.dp, 174.px.dp),
text: String,
style: TextStyle = RacingSansOneTypography.titleSmall,
fontSize: TextUnit = 60.px.sp,
textColor: Color = Color.Black,
backgroundColor: Color = Color(255,204,2),
roundedCornerShape: RoundedCornerShape = RoundedCornerShape(topStart = 110.px.dp, topEnd = 24.px.dp, bottomStart = 24.px.dp, bottomEnd = 24.px.dp),
trailingIcon: @Composable() () -> Unit ={},
leadingIcon: @Composable() () -> Unit ={},
isDisabled: MutableState<Boolean> = mutableStateOf(false),
onClick: () -> Unit = {}
) {
Surface(
shadowElevation = 4.px.dp,
shape = roundedCornerShape,
color = backgroundColor,
){
Row(
modifier = if (! isDisabled.value) modifier.noRippleClickable(onClick = onClick) else modifier,
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
){
leadingIcon()
Spacer(Modifier.width(24.px.dp))
//Text(text, color = textColor, fontWeight = FontWeight.Bold,)
Text(
text = text,
style = RobotoTypography.bodyMedium.copy(
textAlign = TextAlign.End,
fontWeight = FontWeight.Medium,
),
fontSize = fontSize,
color = textColor,
)
trailingIcon()
}
}
}
@Preview(
uiMode = Configuration.UI_MODE_NIGHT_NO,
showBackground = false
)
@Composable
fun PreviewButtonWithHIconAndText() {
Column(
modifier = Modifier.size(483.px.dp, 174.px.dp),
horizontalAlignment = Alignment.CenterHorizontally) {
ButtonWithHIconAndText(
text = "STANDBY",
leadingIcon = {
//Icon(Icons.Filled.Star, contentDescription = null, tint = Color.White)
Image(
painter = painterResource(id = R.drawable.ic_play),
contentDescription = null,
modifier = Modifier.size(49.px.dp)
)
},
onClick = {
// Perform action when button is clicked
}
)
}
}

Some files were not shown because too many files have changed in this diff Show More