/*!
 *
 * Copyright (c) 2020-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    TreatmentAdjustmentUltrafiltrationStart.qml
 * \author  (last)      Vy
 * \date    (last)      16-Mar-2023
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  12-May-2020
 *
 */

// Qt
import QtQuick 2.12

// Project

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

/*!
 * \brief   TreatmentAdjustmentUltrafiltrationStart.qml is the screen
 *          To adjust the treatment ultrafiltration
 */
TreatmentAdjustmentBase { id: _root
    contentItem.objectName: "TreatmentAdjustmentUltrafiltrationStart"  //SquishQt testability

    QtObject { id: _private
        property real minimum: vTreatmentUltrafiltration.minimum
        property real maximum: vTreatmentUltrafiltration.maximum
        property real value  : vTreatmentUltrafiltration.ultrafiltration_RefUFVol
    }

    signal pauseClicked()

    confirmVisible: false

    information {
        visible     : true && information.text && ! notification.visible
        imageSource : ufInfoImageSource
        text        : ufInfoText
    }

    titleText   : qsTr("ULTRAFILTRATION VOLUME") + "   " + Variables.unitTextUltrafiltrationVolume

    ProgressBarEx { id: _progressbarex
        width   : Variables.ultrafiltrationProgressbarWidth
        height  : Variables.ultraFiltrationProgressBarHeight
        anchors {
            horizontalCenter: parent.horizontalCenter
            verticalCenter  : parent.verticalCenter 
        }
        decimal : Variables.ultrafiltrationPrecision
        minimum : _private.minimum
        maximum : _private.maximum
        value   : _private.value
        valueEx : 0
    }

    TouchRect { id: _pauseButton
        onClicked: _root.pauseClicked()

        width:  Variables.buttonWidth
        height: Variables.buttonHeight
        anchors {
            top             : _progressbarex.bottom
            topMargin       : 50
            horizontalCenter: parent.horizontalCenter
        }
        isDefault: true
        Image { id: _image
            anchors {
                left          : _pauseButton.left
                leftMargin    : 65
                verticalCenter: _pauseButton.verticalCenter
            }

            width : Variables.pauseIconDiameter
            height: Variables.pauseIconDiameter
            source: "qrc:/images/iPauseDarkBlue"
        }

        text  {
            text            : qsTr("PAUSE ULTRAFILTRATION")
            font.weight     : Font.DemiBold
            font.pixelSize  : Fonts.fontPixelBack
            anchors {
                centerIn        : null // disable the parent anchor
                verticalCenter  : _pauseButton.verticalCenter
                left            : _image.right
                leftMargin      : 15
            }
        }
    }
    Text { id: _informationText
        text    : qsTr("Note: Ultrafiltration needs to be paused to edit the volume.")
        color   : "#a3b7c9"
        font {
           pixelSize: 25
        }

        anchors {
            top             : _pauseButton.bottom
            topMargin       : 35
            horizontalCenter: parent.horizontalCenter
        }
    }
}
