summaryrefslogtreecommitdiffstats
path: root/build.sh
blob: 9496f0095a6b35218e63677c7b08da4ca9987872 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash

function build {
	echo "ACTION: build"
	source ~/agl/sdk/porter/environment*
	if [ ! -d "$1/$2" ]; then
		echo "INFO: build dir ($1/$2) doesn't exist, created it!"
		mkdir -p "$1/$2"
	fi
	pushd "$1/$2"
	#cd "$1/$2"
	cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$3 $1
	make
	popd
}

function clean {
	echo "ACTION: clean"
	if [ -d "$1/$2" ]; then
		rm -vrf "$1/$2"
	fi
}

function rebuild {
	clean $1 $2
	build $1 $2 $3
}

function printhelp {
	echo "Usage: build.sh <action> <subdir> [config]"
	echo "	action: can be one of the following"
	echo "		build: build this project."
	echo "		rebuild: rebuild this project."
	echo "		clean: clean the previous build."
	echo "		install: install the build result."
	echo "	subdir: the subdir into which the build is done."
	echo "	config: can be Debug or Release. Ignored if the action is 'clean'."
}

function checkparams {
	if [ "$#" -ne "$(($1+1))" ]; then
		echo "ERROR: Wrong number of parameters, expected $1 but got $(($#-1))"
		printhelp
		exit 1
	fi
}

function main {
	CURRENT_DIR=$( dirname "$(readlink -f "$0")" )
	echo "Current script: $CURRENT_DIR"

	if [ "$#" -lt "1" ]; then
		echo "ERROR: At least <action> must be specified!"
		exit 1
	fi

	case "$1" in
		"build")
			checkparams 3 $*
			build $CURRENT_DIR $2 $3
			;;
		"rebuild")
			checkparams 3 $*
			rebuild $CURRENT_DIR $2 $3
			;;
		"clean")
			checkparams 2 $*
			clean $CURRENT_DIR $2
			;;
		"install")
			checkparams 3 $*
			echo "ERROR: Not implemented yet!"
			;;
		*)
			echo "ERROR: Unknown action '$3'!"
			exit 1 
			;;
	esac
}

main $*
binding.fanSpeed = value } } Label { anchors.left: fanSpeedSlider.left anchors.top: fanSpeedSlider.bottom font.pixelSize: 32 text: translator.translate(qsTr('FAN SPEED'), translator.language) } } } RowLayout { Layout.fillHeight: true Layout.fillWidth: true Layout.alignment: Layout.Center spacing: 20 ColumnLayout { Layout.fillWidth: true spacing: 20 SeatHeatButton { id: leftSeat side: 'Left' } HeatDegree { onCurrentItemChanged: { console.log("Left Temp changed",degree) binding.leftTemperature = degree } } } ColumnLayout { Layout.fillWidth: true spacing: 20 ToggleButton { onImage: './images/HMI_HVAC_Active.svg' offImage: './images/HMI_HVAC_Inactive.svg' Label { anchors.centerIn: parent color: parent.checked ? '#00ADDC' : '#848286' text: translator.translate(qsTr('A/C'), translator.language) font.pixelSize: parent.height / 3 } onCheckedChanged: { console.debug('A/C', checked) } } ToggleButton { onImage: './images/HMI_HVAC_Active.svg' offImage: './images/HMI_HVAC_Inactive.svg' Label { anchors.centerIn: parent color: parent.checked ? '#00ADDC' : '#848286' text: translator.translate(qsTr('AUTO'), translator.language) font.pixelSize: parent.height / 3 } onCheckedChanged: { console.debug('AUTO', checked) } } ToggleButton { onImage: './images/HMI_HVAC_Circulation_Active.svg' offImage: './images/HMI_HVAC_Circulation_Inactive.svg' onCheckedChanged: { console.debug('Circulation', checked) } } } ColumnLayout { Layout.fillWidth: true spacing: 20 SeatHeatButton { id: rightSeat side: 'Right' } HeatDegree { onCurrentItemChanged: { console.log("Right Temp changed",degree) binding.rightTemperature = degree } } } } RowLayout { Layout.fillHeight: true Layout.alignment: Qt.AlignHCenter spacing: root.width / 20 Repeater { model: ['AirDown', 'AirUp', 'AirRight', 'Rear', 'Front'] ToggleButton { onImage: './images/HMI_HVAC_%1_Active.svg'.arg(model.modelData) offImage: './images/HMI_HVAC_%1_Inactive.svg'.arg(model.modelData) onCheckedChanged: { console.debug(model.modelData, checked) } } } } } }