/*!
 *
 * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
 * \copyright                                                       \n
 *          THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM,  \n
 *          IN PART OR IN WHOLE,                                    \n
 *          WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n
 *
 * \file    TreatmentPressure.qml
 * \date    2020/01/27
 * \author  Behrouz NematiPour
 *
 */

// Qt
import QtQuick 2.12
import QtQuick.Controls 2.12

// Project
import Gui.Actions 0.1;

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

/*!
 * \brief   Treatment Screen Pressure section
 */
TouchArea { id: _pressureTouchArea
    clip: false
    x: leftColumnX
    y: row3Y
    width: _flowsTouchArea.width
    height  : 200
    isTouchable: true
    orientation: TouchArea.Orientation.Horizontal
    title: qsTr("PRESSURE") + " " + qsTr("(mmHg)")
    RangeBar { id: _arterialRangeBar
        x: 0
        y: 75
        width   : 175
        height  :  15
        rangebar.color: Colors.pressuresArterialBar

        value   :    0

        // TEST : simulation code
        minimum : -400
        maximum :  400
        lowerBound: -300
        upperBound:  100
        NumberAnimation on value {
            duration: 70000
            from: _arterialRangeBar.minimum
            to: _arterialRangeBar.maximum
            loops: Animation.Infinite
        }
        Text { id: _arterialText
            anchors {
                left: parent.left
                top: parent.bottom
                topMargin: 35
            }
            text: qsTr("Arterial")
            font.pixelSize: Fonts.fontPixelPresseuresText
            color: Colors.pressuresText
        }
    }

    RangeBar { id: _venousRangeBar
        x: 200
        y: 75
        width   : 175
        height  :  15
        rangebar.color: Colors.pressuresVenousBar

        value   :   0

        // TEST : simulation code
        minimum: -100
        maximum:  800
        lowerBound: -100
        upperBound:  500

        NumberAnimation on value {
            duration: 70000
            from    : _venousRangeBar.minimum
            to      : _venousRangeBar.maximum
            loops   : Animation.Infinite
        }
        Text { id: _venousText
            anchors {
                left: parent.left
                top: parent.bottom
                topMargin: 35
            }
            text: qsTr("Venous")
            font.pixelSize: Fonts.fontPixelPresseuresText
            color: Colors.pressuresText
        }
    }
}
