/*!
 *
 * Copyright (c) 2023-2024 Diality Inc. - All Rights Reserved.
 * \copyright
 * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN
 * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
 *
 * \file    SettingsInformation.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      11-Sep-2023
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  18-Jul-2023
 *
 */

// Qt
import QtQuick 2.12

//  Qml imports
import "qrc:/globals"
import "qrc:/compounds"


/*!
 * \brief   SettingsInformation is the screen
 *          which queries the system for the versions and serial numbers and service records
 *          and display them
 */
SettingsBase    { id: _root
    itemIndex       : SettingsStack.Information

    confirmVisible          : false

    TouchGrid {
        anchors.top             : parent.top
        anchors.topMargin       : 170
        anchors.horizontalCenter: parent.horizontalCenter

        colCount    : 2
        colSpacing  : 100
        rowCount    : 12 // this number indicates when to move to the next column
        rowSpacing  : 0
        itemHeight  : 70
        itemWidth   : 700
        touchable   : false
        itemsHasLine: [
            0, // title C1
            1,1,1,1,1,1,1,1,
            0,0,0,
            0, // title C2
            1,1,1,1,
            0, // title C2B
            1,1,1,1
        ]
        itemsHasIndent: [
            0, // title C1
            1,1,1,1,1,1,1,1,
            0,0,0,
            0, // title C2
            1,1,1,1,
            0, // title C2B
            1,1,1,1
        ]
        itemsValueLeftMargin: itemWidth / 2 + 50
        itemsUnitLeftMargin : itemWidth / 4 + 50
        itemsValue  : [
            ""                                          ,
            vDevice                 .osVersion          ,
            Qt                      .application.version,
            vAdjustmentVersions     .hdVerDevice        ,
            vAdjustmentVersions     .hdVerFPGA          ,
            vAdjustmentVersions     .hdSerial           ,
            vAdjustmentVersions     .dgVerDevice        ,
            vAdjustmentVersions     .dgVerFPGA          ,
            vAdjustmentVersions     .dgSerial           ,
            "", "", "", "", // Space and title
            vAdjustmentServiceDates .hdLastServiceDate  ,
            vAdjustmentServiceDates .hdNextServiceDate  ,
            vAdjustmentServiceDates .dgLastServiceDate  ,
            vAdjustmentServiceDates .dgNextServiceDate  ,
            "",         // Space and title
            vHDUsageInfo            .totalTxHours                   ,
            vHDUsageInfo            .totalTxHoursSinceLastService   ,
            vHDUsageInfo            .epochOfStartOfLastTx           ,
            vHDUsageInfo            .epochOfLastRecordReset         ,
        ]
        itemsText   : [
            qsTr("Versions"             ), // col1 title
            qsTr("OS Version"           ),
            qsTr("UI Version"           ),
            qsTr("HD Version"           ),
            qsTr("HD FPGA Version"      ),
            qsTr("HD Serial Number"     ),
            qsTr("DG Version"           ),
            qsTr("DG FPGA Version"      ),
            qsTr("DG Serial Number"     ),
            "", "", "", // Holders for last elements

            qsTr("Service"              ), // col2 title
            qsTr("HD Last Service Date" ),
            qsTr("HD Next Service Date" ),
            qsTr("DG Last Service Date" ),
            qsTr("DG Next Service Date" ),

            qsTr("Treatment"                ),
            qsTr("Total Hours"              ),
            qsTr("Hours Since Last Service" ),
            qsTr("Last Start"               ),
            qsTr("Last Reset"               ),
        ]
    }
}
