/*
 * Copyright 2023,2024 Digi International Inc.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
class CCIMX6SBC extends ConnectCoreDevice {

    // Public constants.
    static DEVICE_TYPE = "ccimx6sbc";
    static PLATFORM_NAME = "ConnectCore 6 SBC";

    // Variables.
    BOARD_IMAGE = "ccimx6sbc_board.png";
    BOARD_IMAGE_SCALE = 60;

    CPU_COMPONENT_VISIBLE = true;
    CPU_COMPONENT_HAS_PANEL = true;
    CPU_COMPONENT_HAS_ARROW = true;
    CPU_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    CPU_COMPONENT_PANEL_ORIENTATION = VALUE_LEFT;
    CPU_COMPONENT_PANEL_HORIZONTAL_PERCENT = 83;
    CPU_COMPONENT_PANEL_VERTICAL_PERCENT = 32;
    CPU_COMPONENT_ARROW_PERCENT = 40;
    CPU_COMPONENT_AREA_TOP_PERCENT = 29;
    CPU_COMPONENT_AREA_LEFT_PERCENT = 62;
    CPU_COMPONENT_AREA_WIDTH_PERCENT = 19.5;
    CPU_COMPONENT_AREA_HEIGHT_PERCENT = 26;

    MEMORY_COMPONENT_VISIBLE = true;
    MEMORY_COMPONENT_HAS_PANEL = true;
    MEMORY_COMPONENT_HAS_ARROW = true;
    MEMORY_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    MEMORY_COMPONENT_PANEL_ORIENTATION = VALUE_RIGHT;
    MEMORY_COMPONENT_PANEL_HORIZONTAL_PERCENT = 53.5;
    MEMORY_COMPONENT_PANEL_VERTICAL_PERCENT = 23;
    MEMORY_COMPONENT_ARROW_PERCENT = 29;
    MEMORY_COMPONENT_AREA_TOP_PERCENT = 16;
    MEMORY_COMPONENT_AREA_LEFT_PERCENT = 47.5;
    MEMORY_COMPONENT_AREA_WIDTH_PERCENT = 13.2;
    MEMORY_COMPONENT_AREA_HEIGHT_PERCENT = 47.4;

    WIFI_BT_COMPONENT_VISIBLE = true;
    WIFI_BT_COMPONENT_HAS_PANEL = true;
    WIFI_BT_COMPONENT_HAS_ARROW = true;
    WIFI_BT_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    WIFI_BT_COMPONENT_PANEL_ORIENTATION = VALUE_LEFT;
    WIFI_BT_COMPONENT_PANEL_HORIZONTAL_PERCENT = 74.5;
    WIFI_BT_COMPONENT_PANEL_VERTICAL_PERCENT = 4;
    WIFI_BT_COMPONENT_ARROW_PERCENT = 19;
    WIFI_BT_COMPONENT_AREA_TOP_PERCENT = 16;
    WIFI_BT_COMPONENT_AREA_LEFT_PERCENT = 65;
    WIFI_BT_COMPONENT_AREA_WIDTH_PERCENT = 8;
    WIFI_BT_COMPONENT_AREA_HEIGHT_PERCENT = 11;

    ETHERNET0_COMPONENT_VISIBLE = true;
    ETHERNET0_COMPONENT_HAS_PANEL = true;
    ETHERNET0_COMPONENT_HAS_ARROW = true;
    ETHERNET0_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    ETHERNET0_COMPONENT_PANEL_ORIENTATION = VALUE_BOTTOM;
    ETHERNET0_COMPONENT_PANEL_HORIZONTAL_PERCENT = 0;
    ETHERNET0_COMPONENT_PANEL_VERTICAL_PERCENT = 34;
    ETHERNET0_COMPONENT_ARROW_PERCENT = 20;
    ETHERNET0_COMPONENT_AREA_TOP_PERCENT = 68.3;
    ETHERNET0_COMPONENT_AREA_LEFT_PERCENT = 14;
    ETHERNET0_COMPONENT_AREA_WIDTH_PERCENT = 14.5;
    ETHERNET0_COMPONENT_AREA_HEIGHT_PERCENT = 26.2;

    ETHERNET1_COMPONENT_VISIBLE = true;
    ETHERNET1_COMPONENT_HAS_PANEL = true;
    ETHERNET1_COMPONENT_HAS_ARROW = true;
    ETHERNET1_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    ETHERNET1_COMPONENT_PANEL_ORIENTATION = VALUE_BOTTOM;
    ETHERNET1_COMPONENT_PANEL_HORIZONTAL_PERCENT = 33;
    ETHERNET1_COMPONENT_PANEL_VERTICAL_PERCENT = 36;
    ETHERNET1_COMPONENT_ARROW_PERCENT = 35;
    ETHERNET1_COMPONENT_AREA_TOP_PERCENT = 66;
    ETHERNET1_COMPONENT_AREA_LEFT_PERCENT = 28.5;
    ETHERNET1_COMPONENT_AREA_WIDTH_PERCENT = 16.5;
    ETHERNET1_COMPONENT_AREA_HEIGHT_PERCENT = 29;

    CONSOLE_COMPONENT_VISIBLE = true;
    CONSOLE_COMPONENT_HAS_PANEL = false;
    CONSOLE_COMPONENT_HAS_ARROW = false;
    CONSOLE_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    CONSOLE_COMPONENT_AREA_TOP_PERCENT = 22.5;
    CONSOLE_COMPONENT_AREA_LEFT_PERCENT = 9.75;
    CONSOLE_COMPONENT_AREA_WIDTH_PERCENT = 3.25;
    CONSOLE_COMPONENT_AREA_HEIGHT_PERCENT = 7;

    VIDEO_COMPONENT_VISIBLE = true;
    VIDEO_COMPONENT_HAS_PANEL = true;
    VIDEO_COMPONENT_HAS_ARROW = true;
    VIDEO_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    VIDEO_COMPONENT_PANEL_ORIENTATION = VALUE_RIGHT;
    VIDEO_COMPONENT_PANEL_HORIZONTAL_PERCENT = 55.5;
    VIDEO_COMPONENT_PANEL_VERTICAL_PERCENT = 83;
    VIDEO_COMPONENT_ARROW_PERCENT = 86;
    VIDEO_COMPONENT_AREA_TOP_PERCENT = 80.5;
    VIDEO_COMPONENT_AREA_LEFT_PERCENT = 46;
    VIDEO_COMPONENT_AREA_WIDTH_PERCENT = 13.5;
    VIDEO_COMPONENT_AREA_HEIGHT_PERCENT = 14;

    AUDIO_COMPONENT_VISIBLE = true;
    AUDIO_COMPONENT_HAS_PANEL = true;
    AUDIO_COMPONENT_HAS_ARROW = true;
    AUDIO_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    AUDIO_COMPONENT_PANEL_ORIENTATION = VALUE_LEFT;
    AUDIO_COMPONENT_PANEL_HORIZONTAL_PERCENT = 77;
    AUDIO_COMPONENT_PANEL_VERTICAL_PERCENT = 79;
    AUDIO_COMPONENT_ARROW_PERCENT = 84;
    AUDIO_COMPONENT_AREA_TOP_PERCENT = 76.6;
    AUDIO_COMPONENT_AREA_LEFT_PERCENT = 67.2;
    AUDIO_COMPONENT_AREA_WIDTH_PERCENT = 8.7;
    AUDIO_COMPONENT_AREA_HEIGHT_PERCENT = 18.5;

    LED_COMPONENT_VISIBLE = true;
    LED_COMPONENT_HAS_PANEL = true;
    LED_COMPONENT_HAS_ARROW = false;
    LED_COMPONENT_PANEL_ALWAYS_VISIBLE = true;
    LED_COMPONENT_PANEL_ORIENTATION = VALUE_LEFT;
    LED_COMPONENT_PANEL_HORIZONTAL_PERCENT = 17;
    LED_COMPONENT_PANEL_VERTICAL_PERCENT = 13.5;
    LED_COMPONENT_AREA_TOP_PERCENT = 15.5;
    LED_COMPONENT_AREA_LEFT_PERCENT = 13;
    LED_COMPONENT_AREA_WIDTH_PERCENT = 2.75;
    LED_COMPONENT_AREA_HEIGHT_PERCENT = 5;

    FLASH_MEMORY_COMPONENT_VISIBLE = true;
    FLASH_MEMORY_COMPONENT_HAS_PANEL = true;
    FLASH_MEMORY_COMPONENT_HAS_ARROW = true;
    FLASH_MEMORY_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    FLASH_MEMORY_COMPONENT_PANEL_ORIENTATION = VALUE_RIGHT;
    FLASH_MEMORY_COMPONENT_PANEL_HORIZONTAL_PERCENT = 25.2;
    FLASH_MEMORY_COMPONENT_PANEL_VERTICAL_PERCENT = 56;
    FLASH_MEMORY_COMPONENT_ARROW_PERCENT = 64;
    FLASH_MEMORY_COMPONENT_AREA_TOP_PERCENT = 57.7;
    FLASH_MEMORY_COMPONENT_AREA_LEFT_PERCENT = 76.2;
    FLASH_MEMORY_COMPONENT_AREA_WIDTH_PERCENT = 12.5;
    FLASH_MEMORY_COMPONENT_AREA_HEIGHT_PERCENT = 15;


    // Capabilities
    SUPPORTS_VIDEO_BRIGHTNESS = false;
    SUPPORTS_NUM_ETHERNET = 1;

    // Misc info
    PCB_COLOR = ID_COLOR_GREEN;

    // Constructor.
    constructor(deviceData) {
        super(CCIMX6SBC.DEVICE_TYPE, CCIMX6SBC.PLATFORM_NAME, deviceData);
    }
}
