| 1 |
/* GCompris - Connection.qml |
| 2 |
* |
| 3 |
* SPDX-FileCopyrightText: 2020 Aiswarya Kaitheri Kandoth <[email protected]> |
| 4 |
* |
| 5 |
* Authors: |
| 6 |
* Bruno Coudoin <[email protected]> (GTK+ version) |
| 7 |
* Aiswarya Kaitheri Kandoth <[email protected]> (Qt Quick port) |
| 8 |
* |
| 9 |
* SPDX-License-Identifier: GPL-3.0-or-later |
| 10 |
*/ |
| 11 |
import QtQuick |
| 12 |
import core 1.0 |
| 13 |
import "../analog_electricity.js" as Activity |
| 14 |
|
| 15 |
ElectricalComponent { |
| 16 |
id: connection |
| 17 |
terminalSize: 0.2 |
| 18 |
noOfConnectionPoints: 1 |
| 19 |
information: qsTr("A simple connection point to connect several wires in an electrical circuit.") |
| 20 |
source: Activity.url + "connection.svg" |
| 21 |
|
| 22 |
property alias connectionPoints: connectionPoints |
| 23 |
property string componentName: "Connection" |
| 24 |
property var externalNetlistIndex: [0] |
| 25 |
|
| 26 |
Repeater { |
| 27 |
id: connectionPoints |
| 28 |
model: 1 |
| 29 |
delegate: connectionPoint |
| 30 |
Component { |
| 31 |
id: connectionPoint |
| 32 |
TerminalPoint { |
| 33 |
posX: 0.5 |
| 34 |
posY: 0.5 |
| 35 |
} |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
function checkConnections() { |
| 40 |
return; |
| 41 |
} |
| 42 |
|
| 43 |
function updateValues() { |
| 44 |
return; |
| 45 |
} |
| 46 |
|
| 47 |
function initConnections() { |
| 48 |
var connectionIndex = Activity.connectionCount; |
| 49 |
connection.externalNetlistIndex[0] = ++connectionIndex; |
| 50 |
connectionPoints.itemAt(0).updateNetlistIndex(connectionIndex); |
| 51 |
Activity.connectionCount = connectionIndex; |
| 52 |
} |
| 53 |
|
| 54 |
function addToNetlist() { |
| 55 |
return; |
| 56 |
} |
| 57 |
} |