/*
 * Copyright (C) 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 CCMP255 extends ConnectCoreDevice {

    // Public constants.
    static DEVICE_TYPE = "ccmp255-dvk";
    static PLATFORM_NAME = "ConnectCore MP255";

    // Variables.
    BOARD_IMAGE = "ccmp25-dvk_board.png";
    BOARD_IMAGE_SCALE = 82;

    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_RIGHT;
    CPU_COMPONENT_PANEL_HORIZONTAL_PERCENT = 61.5;
    CPU_COMPONENT_PANEL_VERTICAL_PERCENT = 43;
    CPU_COMPONENT_ARROW_PERCENT = 52.5;
    CPU_COMPONENT_AREA_TOP_PERCENT = 48.5;
    CPU_COMPONENT_AREA_LEFT_PERCENT = 40;
    CPU_COMPONENT_AREA_WIDTH_PERCENT = 7.2;
    CPU_COMPONENT_AREA_HEIGHT_PERCENT = 9.6;

    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_BOTTOM;
    MEMORY_COMPONENT_PANEL_HORIZONTAL_PERCENT = 25;
    MEMORY_COMPONENT_PANEL_VERTICAL_PERCENT = 62;
    MEMORY_COMPONENT_ARROW_PERCENT = 43;
    MEMORY_COMPONENT_AREA_TOP_PERCENT = 37.4;
    MEMORY_COMPONENT_AREA_LEFT_PERCENT = 38.3;
    MEMORY_COMPONENT_AREA_WIDTH_PERCENT = 9.8;
    MEMORY_COMPONENT_AREA_HEIGHT_PERCENT = 9.2;

    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 = 57;
    WIFI_BT_COMPONENT_PANEL_VERTICAL_PERCENT = 22;
    WIFI_BT_COMPONENT_ARROW_PERCENT = 41.5;
    WIFI_BT_COMPONENT_AREA_TOP_PERCENT = 37.5;
    WIFI_BT_COMPONENT_AREA_LEFT_PERCENT = 49.5;
    WIFI_BT_COMPONENT_AREA_WIDTH_PERCENT = 5.9;
    WIFI_BT_COMPONENT_AREA_HEIGHT_PERCENT = 7.9;

    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_TOP;
    ETHERNET0_COMPONENT_PANEL_HORIZONTAL_PERCENT = 61;
    ETHERNET0_COMPONENT_PANEL_VERTICAL_PERCENT = 22.5;
    ETHERNET0_COMPONENT_ARROW_PERCENT = 62.5;
    ETHERNET0_COMPONENT_AREA_TOP_PERCENT = 2;
    ETHERNET0_COMPONENT_AREA_LEFT_PERCENT = 58.5;
    ETHERNET0_COMPONENT_AREA_WIDTH_PERCENT = 9.8;
    ETHERNET0_COMPONENT_AREA_HEIGHT_PERCENT = 17;

    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_TOP;
    ETHERNET1_COMPONENT_PANEL_HORIZONTAL_PERCENT = 5;
    ETHERNET1_COMPONENT_PANEL_VERTICAL_PERCENT = 22.5;
    ETHERNET1_COMPONENT_ARROW_PERCENT = 32.5;
    ETHERNET1_COMPONENT_AREA_TOP_PERCENT = 2;
    ETHERNET1_COMPONENT_AREA_LEFT_PERCENT = 29.2;
    ETHERNET1_COMPONENT_AREA_WIDTH_PERCENT = 9.8;
    ETHERNET1_COMPONENT_AREA_HEIGHT_PERCENT = 17;

    ETHERNET2_COMPONENT_VISIBLE = false;
    ETHERNET2_COMPONENT_HAS_PANEL = true;
    ETHERNET2_COMPONENT_HAS_ARROW = true;
    ETHERNET2_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    ETHERNET2_COMPONENT_PANEL_ORIENTATION = VALUE_TOP;
    ETHERNET2_COMPONENT_PANEL_HORIZONTAL_PERCENT = 33;
    ETHERNET2_COMPONENT_PANEL_VERTICAL_PERCENT = 22.5;
    ETHERNET2_COMPONENT_ARROW_PERCENT = 47.5;
    ETHERNET2_COMPONENT_AREA_TOP_PERCENT = 2;
    ETHERNET2_COMPONENT_AREA_LEFT_PERCENT = 44;
    ETHERNET2_COMPONENT_AREA_WIDTH_PERCENT = 9.8;
    ETHERNET2_COMPONENT_AREA_HEIGHT_PERCENT = 17;

    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.1;
    CONSOLE_COMPONENT_AREA_LEFT_PERCENT = 89.8;
    CONSOLE_COMPONENT_AREA_WIDTH_PERCENT = 4.9;
    CONSOLE_COMPONENT_AREA_HEIGHT_PERCENT = 6.2;

    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_BOTTOM;
    VIDEO_COMPONENT_PANEL_HORIZONTAL_PERCENT = 55;
    VIDEO_COMPONENT_PANEL_VERTICAL_PERCENT = 51.8;
    VIDEO_COMPONENT_ARROW_PERCENT = 89;
    VIDEO_COMPONENT_AREA_TOP_PERCENT = 49.5;
    VIDEO_COMPONENT_AREA_LEFT_PERCENT = 86.8;
    VIDEO_COMPONENT_AREA_WIDTH_PERCENT = 8.4;
    VIDEO_COMPONENT_AREA_HEIGHT_PERCENT = 11.8;

    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_TOP;
    AUDIO_COMPONENT_PANEL_HORIZONTAL_PERCENT = 0;
    AUDIO_COMPONENT_PANEL_VERTICAL_PERCENT = 20;
    AUDIO_COMPONENT_ARROW_PERCENT = 18;
    AUDIO_COMPONENT_AREA_TOP_PERCENT = 5;
    AUDIO_COMPONENT_AREA_LEFT_PERCENT = 17.8;
    AUDIO_COMPONENT_AREA_WIDTH_PERCENT = 5.3;
    AUDIO_COMPONENT_AREA_HEIGHT_PERCENT = 11.6;

    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_BOTTOM;
    LED_COMPONENT_PANEL_HORIZONTAL_PERCENT = 69;
    LED_COMPONENT_PANEL_VERTICAL_PERCENT = 10;
    LED_COMPONENT_AREA_TOP_PERCENT = 89;
    LED_COMPONENT_AREA_LEFT_PERCENT = 68;
    LED_COMPONENT_AREA_WIDTH_PERCENT = 1.8;
    LED_COMPONENT_AREA_HEIGHT_PERCENT = 4;

    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_TOP;
    FLASH_MEMORY_COMPONENT_PANEL_HORIZONTAL_PERCENT = 40;
    FLASH_MEMORY_COMPONENT_PANEL_VERTICAL_PERCENT = 60.2;
    FLASH_MEMORY_COMPONENT_ARROW_PERCENT = 50;
    FLASH_MEMORY_COMPONENT_AREA_TOP_PERCENT = 50;
    FLASH_MEMORY_COMPONENT_AREA_LEFT_PERCENT = 48;
    FLASH_MEMORY_COMPONENT_AREA_WIDTH_PERCENT = 8;
    FLASH_MEMORY_COMPONENT_AREA_HEIGHT_PERCENT = 9;


    // Capabilities
    SUPPORTS_VIDEO_BRIGHTNESS = false;
    SUPPORTS_NUM_ETHERNET = 2;

    // Misc info
    PCB_COLOR = ID_COLOR_BLUE;

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