/*!
 *
 * Copyright (c) 2023-2023 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)      18-Jul-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

    onVisibleChanged: {
        if ( visible ) {
            vAdjustmentVersions     .doAdjustment()
            vAdjustmentServiceDates .doAdjustment()
        }
    }

    TouchGrid {
        anchors.centerIn: parent
        colCount    : 2
        colSpacing  : 50
        rowCount    : 8
        rowSpacing  : 0
        itemHeight  : 50
        itemWidth   : 550
        touchable   : false
        itemsHasLine: [
            0, // title C1
            1,1,1,1,1,1,1,
            0, // title C2
            1,1,1,1,
        ]
        itemsValueLeftMargin: 300
        itemsValue  : [
            ""                                          ,
            Qt                      .application.version,
            vAdjustmentVersions     .hdVerDevice        ,
            vAdjustmentVersions     .hdVerFPGA          ,
            vAdjustmentVersions     .hdSerial           ,
            vAdjustmentVersions     .dgVerDevice        ,
            vAdjustmentVersions     .dgVerFPGA          ,
            vAdjustmentVersions     .dgSerial           ,
            "",
            vAdjustmentServiceDates .hdLastServiceDate  ,
            vAdjustmentServiceDates .hdNextServiceDate  ,
            vAdjustmentServiceDates .dgLastServiceDate  ,
            vAdjustmentServiceDates .dgNextServiceDate  ,
        ]
        itemsText   : [
            qsTr("Versions"             ), // col1 title
            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"     ),

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

        ]
    }
}
