/*
Hlavná trieda programu používateľského rozhrania ...
 */

import CommunicationAndSaving.propertiesFile;
import CommunicationAndSaving.serialCommunication;
import Windows.Window;
import measurementThread.ArduinoAnswear;

import java.io.IOException;
import java.util.Properties;

public class goniofotometer {

    public static void main(String[] args) throws IOException, IOException {

        /*
        Inicializujú sa objekty tried, ktoré sú následne
        použité, ako parametre triedy "Window" ....
        */
        serialCommunication serial = new serialCommunication();
        propertiesFile properties_File = propertiesFile.getInstance();
        ArduinoAnswear answear = new ArduinoAnswear(serial);

        /*
        Vytvorenie objekt "firstProperties", do ktorého sa
        ukladajú nastavenie meracieho procesu ... ukladajú
        sa parametre v podobe textových dvojíc, podľa
        formátu "key - value"
         */
        Properties firstProperties = new Properties();
        firstProperties.setProperty("ID1_manufacturer", "-");
        firstProperties.setProperty("ID2_type", String.valueOf(0));
        firstProperties.setProperty("ID3_symmetry", String.valueOf(0));
        firstProperties.setProperty("ID5_Dc", String.valueOf(15));
        firstProperties.setProperty("ID7_Dg", String.valueOf(1));
        firstProperties.setProperty("ID8_measurementNumber", "-");
        firstProperties.setProperty("ID9_luminaireName", "-");
        firstProperties.setProperty("ID10_luminaireNumber", "-");
        firstProperties.setProperty("ID11_fileName", "-");
        firstProperties.setProperty("ID12_dateName", "-");
        firstProperties.setProperty("ID13_luminaireLength", String.valueOf(1.0));
        firstProperties.setProperty("ID14_luminaireWidth", String.valueOf(0.0));
        firstProperties.setProperty("ID15_luminaireHeight", String.valueOf(0.0));
        firstProperties.setProperty("ID16_luminaireArea", String.valueOf(0.0));
        firstProperties.setProperty("ID17_widthLuminaireArea", String.valueOf(0.0));
        firstProperties.setProperty("ID18_heightLiminaireAreaC0", String.valueOf(0.0));
        firstProperties.setProperty("ID19_heightLiminaireAreaC90", String.valueOf(0.0));
        firstProperties.setProperty("ID20_heightLiminaireAreaC180", String.valueOf(0.0));
        firstProperties.setProperty("ID21_heightLiminaireAreaC270", String.valueOf(0.0));
        firstProperties.setProperty("ID22_DFF", String.valueOf(0.0));
        firstProperties.setProperty("ID23_LORL", String.valueOf(0.0));
        firstProperties.setProperty("ID24_conversionFactor", String.valueOf(0.0));
        firstProperties.setProperty("ID25_tiltLuinaire", String.valueOf(0.0));
        firstProperties.setProperty("ID26a_numberOfLamp", String.valueOf(1));
        firstProperties.setProperty("ID26b_typeOfLamp", "-");
        firstProperties.setProperty("ID26c_fluxOfLamp", String.valueOf(1.0));
        firstProperties.setProperty("ID26d_ColorTemperatureOfLamp", String.valueOf(0.0));
        firstProperties.setProperty("ID26e_colorRenderingIndex", String.valueOf(0.0));
        firstProperties.setProperty("ID26f_allPowerSupply", String.valueOf(0.0));
        firstProperties.setProperty("ID27_DR_k060", String.valueOf(0.0));
        firstProperties.setProperty("ID27_DR_k080", String.valueOf(0.0));
        firstProperties.setProperty("ID27_DR_k100", String.valueOf(0.0));
        firstProperties.setProperty("ID27_DR_k125", String.valueOf(0.0));
        firstProperties.setProperty("ID27_DR_k150", String.valueOf(0.0));
        firstProperties.setProperty("ID27_DR_k200", String.valueOf(0.0));
        firstProperties.setProperty("ID27_DR_k250", String.valueOf(0.0));
        firstProperties.setProperty("ID27_DR_k300", String.valueOf(0.0));
        firstProperties.setProperty("ID27_DR_k400", String.valueOf(0.0));
        firstProperties.setProperty("ID27_DR_k500", String.valueOf(0.0));
        firstProperties.setProperty("USBport", "USB-SERIAL CH340 (COM6)");
        firstProperties.setProperty("File Path", "C:\\Users\\Martin Ivor\\Desktop\\FILE_DP_send\\Measerement-Results");
        properties_File.setAllByUserProperties(firstProperties);

        /*
        Vytvorenie inštancie triedy Window, ktorá vykresľuje okno
        používateľského rozhrania goniofotometra ...
         */
        Window window = new Window(serial, properties_File, answear);
    }
}
