[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [gcompris/gsoc_pulkit_digital_electricity] src/activities/digital_electricity: digital_electricity, 
From:       Johnny Jazeix <null () kde ! org>
Date:       2017-12-28 21:03:28
Message-ID: E1eUfKq-0004AA-Sg () code ! kde ! org
[Download RAW message or body]

Git commit 8133ffbbd27773c8d5803ea0b7045265bd63c989 by Johnny Jazeix.
Committed on 28/12/2017 at 21:03.
Pushed by jjazeix into branch 'gsoc_pulkit_digital_electricity'.

digital_electricity, fix toolbar size, clean code, update wire position when mouse \
move (else no update with onPaintedWidthChanged with Qt5.10), reduce component sizes

M  +8    -3    src/activities/digital_electricity/ActivityInfo.qml
M  +26   -23   src/activities/digital_electricity/Dataset.qml
M  +10   -2    src/activities/digital_electricity/DigitalElectricity.qml
M  +23   -21   src/activities/digital_electricity/ListWidget.qml
M  +2    -2    src/activities/digital_electricity/Wire.qml
M  +1    -1    src/activities/digital_electricity/components/AndGate.qml
M  +4    -5    src/activities/digital_electricity/components/BCDToSevenSegment.qml
M  +4    -6    src/activities/digital_electricity/components/BcdCounter.qml
M  +2    -3    src/activities/digital_electricity/components/Comparator.qml
M  +0    -1    src/activities/digital_electricity/components/DigitalLight.qml
M  +11   -7    src/activities/digital_electricity/components/ElectricalComponent.qml
M  +1    -1    src/activities/digital_electricity/components/NandGate.qml
M  +1    -1    src/activities/digital_electricity/components/NorGate.qml
M  +1    -1    src/activities/digital_electricity/components/OrGate.qml
M  +2    -2    src/activities/digital_electricity/components/SevenSegment.qml
M  +2    -2    src/activities/digital_electricity/components/SignalGenerator.qml
M  +4    -4    src/activities/digital_electricity/components/TerminalPoint.qml
M  +1    -1    src/activities/digital_electricity/components/XorGate.qml
M  +9    -11   src/activities/digital_electricity/digital_electricity.js
D  +0    -461  src/activities/digital_electricity/resource/ElectricalComponents.qml

https://commits.kde.org/gcompris/8133ffbbd27773c8d5803ea0b7045265bd63c989

diff --git a/src/activities/digital_electricity/ActivityInfo.qml \
b/src/activities/digital_electricity/ActivityInfo.qml index d3a07f64..5c35efef 100644
--- a/src/activities/digital_electricity/ActivityInfo.qml
+++ b/src/activities/digital_electricity/ActivityInfo.qml
@@ -19,16 +19,21 @@ import GCompris 1.0
 
 ActivityInfo {
   name: "digital_electricity/DigitalElectricity.qml"
-  difficulty: 1
+  difficulty: 6
   icon: "digital_electricity/digital_electricity.svg"
   author: "Pulkit Gupta &lt;pulkitnsit@gmail.com&gt;"
   demo: true
+  //: Activity title
   title: qsTr("Digital Electricity")
+  //: Help title
   description: qsTr("Create and simulate a digital electric schema")
-  //intro: "put here in comment the text for the intro voice"
+  //intro: "Learn how the digital electricity works and create your own circuit"
+  //: Help goal
   goal: qsTr("Freely create a digital electric schema with a real time simulation of \
it.") +  //: Help prerequisite
   prerequisite: qsTr("Requires some basic understanding of the concept of digital \
                electronics.")
-  manual: qsTr("Drag electrical components from the selector and drop them in the \
working area.You can also move components by dragging them. To delete a component, \
select the deletion tool on top of the component selector, and select the component. \
You can click on the component and then on the rotate button to rotate it or info \
button to get information about it. You can click on the switch to open and close it. \
To connect two terminals, click on first terminal, then on second terminal. To \
deselect terminal or delete tool, click on any empty area. The simulation is updated \
in real time by any user action.") +  //: Help manual
+  manual: qsTr("Drag electrical components from the selector and drop them in the \
working area. You can also move components by dragging them. To delete a component, \
select the deletion tool on top of the component selector, and select the component. \
You can click on the component and then on the rotate button to rotate it or info \
button to get information about it. You can click on the switch to open and close it. \
To connect two terminals, click on first terminal, then on second terminal. To \
deselect terminal or delete tool, click on any empty area. The simulation is updated \
in real time by any user action.")  credit: ""
   section: "experimental"
   createdInVersion: 9000
diff --git a/src/activities/digital_electricity/Dataset.qml \
b/src/activities/digital_electricity/Dataset.qml index 237467fe..84342d0f 100644
--- a/src/activities/digital_electricity/Dataset.qml
+++ b/src/activities/digital_electricity/Dataset.qml
@@ -3,7 +3,7 @@
  * Copyright (C) 2017 Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>
  *
  * Authors:
- *   Bruno Coudoin <bruno.coudoin@gcompris.net> (GTK+ version)
+ *   Bruno Coudoin <bruno.coudoin@gcompris.net> (Gtk+ version)
  *   Rudra Nil Basu <rudra.nil.basu.1996@gmail.com> (Qt Quick port)
  *
  *   This program is free software; you can redistribute it and/or modify
@@ -41,7 +41,7 @@ QtObject {
         'componentSource': 'DigitalLight.qml',
         'width': 0.12,
         'height': 0.12,
-        'toolTipText': qsTr("Digital Light")
+        'toolTipText': qsTr("Digital light")
     }
     property var andGate: {
         'imageName': 'gateAnd.svg',
@@ -104,31 +104,34 @@ QtObject {
         'componentSource': 'BCDToSevenSegment.qml',
         'width': 0.3,
         'height': 0.4,
-        'toolTipText': qsTr("BCD To 7 Segment")
+        'toolTipText': qsTr("BCD to 7 segment")
     }
     property var sevenSegmentDisplay: {
         'imageName': 'sevenSegmentDisplay.svg',
         'componentSource': 'SevenSegment.qml',
         'width': 0.18,
         'height': 0.4,
-        'toolTipText': qsTr("7 Segment Display")
+        'toolTipText': qsTr("7 segment display")
     }
     property var signalGenerator: {
         'imageName': 'signalGenerator.svg',
         'componentSource': 'SignalGenerator.qml',
         'width': 0.25,
         'height': 0.18,
-        'toolTipText': qsTr("Signal Generator")
+        'toolTipText': qsTr("Signal generator")
     }
     property var bcdCounter: {
         'imageName': 'bcdCounter.svg',
         'componentSource': 'BcdCounter.qml',
         'width': 0.3,
         'height': 0.4,
-        'toolTipText': qsTr("BCD Counter")
+        'toolTipText': qsTr("BCD counter")
     }
     // List of all components
-    property var componentList: [zero, one, digitalLight, andGate, orGate, notGate, \
xorGate, nandGate, norGate, switchKey, comparator, bcdToSevenSegment, \
sevenSegmentDisplay, signalGenerator, bcdCounter] +    property var componentList: \
[zero, one, digitalLight, andGate, orGate,  +                                 \
notGate, xorGate, nandGate, norGate, switchKey, +                                 \
comparator, bcdToSevenSegment, +                                 sevenSegmentDisplay, \
signalGenerator, bcdCounter]  
     property var problemType: {
         'lightTheBulb': 1,
@@ -149,8 +152,8 @@ QtObject {
             playAreaComponentPositionY: [0.3],
             type: [problemType.lightTheBulb],
             introMessage: [
-                qsTr("The Digital light will glow when its terminal is connected \
                with an input of 1"),
-                qsTr("Turn the Digital light on using the inputs provided")
+                qsTr("The digital light will glow when its terminal is connected \
with an input of 1."), +                qsTr("Turn the digital light on using the \
inputs provided.")  ]
         },
         // level 2
@@ -163,8 +166,8 @@ QtObject {
             playAreaComponentPositionY: [0.3, 0.3],
             type: [problemType.lightTheBulb],
             introMessage: [
-                qsTr("The AND Gate produces an output of one when both of its input \
                terminals are of value 1"),
-                qsTr("Turn the Digital light on using an AND gate and the inputs \
provided") +                qsTr("The AND gate produces an output of one when both of \
its input terminals are of value 1."), +                qsTr("Turn the digital light \
on using an AND gate and the inputs provided.")  ]
         },
         // level 3
@@ -177,8 +180,8 @@ QtObject {
             playAreaComponentPositionY: [0.3, 0.3],
             type: [problemType.lightTheBulb],
             introMessage: [
-                qsTr("The OR Gate produces an output of 1 when at least one of the \
                input terminal is of value 1"),
-                qsTr("Turn the Digital light on using an OR gate and the inputs \
provided") +                qsTr("The OR gate produces an output of 1 when at least \
one of its input terminals is of value 1."), +                qsTr("Turn the digital \
light on using an OR gate and the inputs provided.")  ]
         },
         // level 4
@@ -191,20 +194,20 @@ QtObject {
             playAreaComponentPositionY: [0.1, 0.4, 0.3, 0.3, 0.4],
             type: [problemType.lightTheBulb],
             introMessage: [
-                qsTr("NOTE: You can draw multiple wires from the output terminal of \
a component.") +                qsTr("Note: You can draw multiple wires from the \
output terminal of a component.")  ]
         },
         // level 5
         {
             inputComponentList: [zero],
-            playAreaComponentList: [notGate, notGate,  orGate, orGate, andGate, \
digitalLight], +            playAreaComponentList: [notGate, notGate, orGate, orGate, \
andGate, digitalLight],  determiningComponentsIndex: [5],
             wires: [ [4, 0, 5, 0], [2, 0, 4, 0], [3, 0, 4, 1]],
             playAreaComponentPositionX: [0.2, 0.2, 0.5, 0.5, 0.6, 0.8],
             playAreaComponentPositionY: [0.1, 0.4, 0.2, 0.6, 0.4, 0.4],
             type: [problemType.lightTheBulb],
             introMessage: [
-                qsTr("The NOT gate takes a single binary input and flips the value \
in the output") +                qsTr("The NOT gate takes a single binary input and \
flips the value in the output.")  ]
         },
         // level 6
@@ -217,7 +220,7 @@ QtObject {
             playAreaComponentPositionY: [0.4, 0.4],
             type: [problemType.lightTheBulb],
             introMessage: [
-                qsTr("The NAND Gate takes two binary inputs and produces one binary \
output"), +                qsTr("The NAND gate takes two binary inputs and produces \
                one binary output."),
                 qsTr("The output of the NAND gate will be zero if the both the \
                inputs are \"0\". Else, the output will be one."),
                 qsTr("For a more detailed description about the gate, select it and \
click on the info button."),  qsTr("Light the bulb using the NAND gate provided.")
@@ -228,7 +231,7 @@ QtObject {
             inputComponentList: [zero, one, andGate, orGate, nandGate],
             playAreaComponentList: [switchKey, switchKey, switchKey, digitalLight],
             determiningComponentsIndex: [0, 1, 2, 3],
-            wires: [  ],
+            wires: [],
             playAreaComponentPositionX: [0.2, 0.2, 0.2, 0.8],
             playAreaComponentPositionY: [0.2, 0.5, 0.8, 0.5],
             type: [problemType.equation3Variables],
@@ -251,7 +254,7 @@ QtObject {
             playAreaComponentPositionY: [0.4, 0.4],
             type: [problemType.lightTheBulb],
             introMessage: [
-                qsTr("The XOR Gate takes two binary inputs and produces one binary \
output"), +                qsTr("The XOR Gate takes two binary inputs and produces \
                one binary output."),
                 qsTr("The output of the XOR gate will be one if the number of \"1\" \
in the input is odd. Else, the output will be zero."),  qsTr("Light the bulb using \
the XOR gate provided.")  ]
@@ -261,7 +264,7 @@ QtObject {
             inputComponentList: [zero, one, xorGate],
             playAreaComponentList: [switchKey, switchKey, switchKey, digitalLight],
             determiningComponentsIndex: [0, 1, 2, 3],
-            wires: [  ],
+            wires: [],
             playAreaComponentPositionX: [0.2, 0.2, 0.2, 0.8],
             playAreaComponentPositionY: [0.2, 0.4, 0.6, 0.4],
             type: [problemType.equation3Variables],
@@ -269,7 +272,7 @@ QtObject {
                 return A ^ B ^ C
             },
             introMessage: [
-                qsTr("Light the bulb using the three switches such that the bulb \
glows when odd number of the switches are turned on") +                qsTr("Light \
the bulb using the three switches such that the bulb glows when odd number of the \
switches are turned on.")  ]
         },
         // level 10
@@ -436,7 +439,7 @@ QtObject {
             playAreaComponentPositionY: [0.3, 0.3],
             type: [problemType.others],
             introMessage: [
-                qsTr("The component in the middle is the BCD to seven segment \
converter."), +                qsTr("The component in the middle is a BCD to seven \
                segment converter."),
                 qsTr("It takes 4 bits as input represented in the binary coded \
                decimal (BCD) format and converts the BCD number into a seven segment \
                code."),
                 qsTr("The output of the converter is connected to the seven segment \
                display, to view the value of the input provided."),
                 qsTr("Display the number \"6\" in the seven segment display.")
@@ -452,7 +455,7 @@ QtObject {
             playAreaComponentPositionY: [0.2, 0.6, 0.2, 0.2],
             type: [problemType.others],
             introMessage: [
-                qsTr("The signal generator on the left is used to generate \
alternating signals between 0 and 1 in a given time period taken as input. The time \
period by default is 1 second, but it can be changed between 0.25 and 2s"), +         \
qsTr("The signal generator on the left is used to generate alternating signals \
between 0 and 1 in a given time period taken as input. The time period by default is \
                1 second, but it can be changed between 0.25 and 2s."),
                 qsTr("The BCD counter placed under it is a special type of counter \
                which can count from 0 to 9 and back to 0 on application of a clock \
                signal."),
                 qsTr("Connect the components to make sure that the count of 0 to 9 \
is visible in the seven segment dispay provided.")  ]
diff --git a/src/activities/digital_electricity/DigitalElectricity.qml \
b/src/activities/digital_electricity/DigitalElectricity.qml index 670b8527..a4c27cdb \
                100644
--- a/src/activities/digital_electricity/DigitalElectricity.qml
+++ b/src/activities/digital_electricity/DigitalElectricity.qml
@@ -5,6 +5,7 @@
  * Authors:
  *   Bruno Coudoin <bruno.coudoin@gcompris.net> (GTK+ version)
  *   Pulkit Gupta <pulkitnsit@gmail.com> (Qt Quick port)
+ *   Rudra Nil Basu <rudra.nil.basu.1996@gmail.com> (Qt Quick port)
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -280,8 +281,15 @@ ActivityBase {
                             height: inputOutputTxt.cellSize
                             border.color: "black"
                             border.width: 1
-                            color: ((index % truthTable.columns) / \
                (truthTablesModel.inputs - 1)) <= 1 ?
-                                   "#c7ecfb" : "#47ffc2"
+                            color: {
+                                if(truthTablesModel.inputs == 1) {
+                                    return index%2 == 0 ? "#c7ecfb" : "#47ffc2"
+                                }
+                                else {
+                                    return ((index % truthTable.columns) / \
(truthTablesModel.inputs - 1)) <= 1 ? "#c7ecfb" : "#47ffc2" +                         \
} +                            }
+                                   
                             GCText {
                                 id: truthTableValue
                                 anchors.centerIn: parent
diff --git a/src/activities/digital_electricity/ListWidget.qml \
b/src/activities/digital_electricity/ListWidget.qml index 3b5e53a5..eb17045c 100644
--- a/src/activities/digital_electricity/ListWidget.qml
+++ b/src/activities/digital_electricity/ListWidget.qml
@@ -43,9 +43,10 @@ Item {
     property alias zoomOutBtn: zoomOutBtn
 
     signal hideToolbar
-
     onHideToolbar: toolButton.showToolBar = false
 
+    property int minIconWidth: listWidget.vert ? Math.min((background.width - \
1.5*view.width) / 6, 100) : Math.min((background.height - 1.5*bar.height - \
view.height) / 6, 100) +
     ListModel {
         id: mymodel
     }
@@ -105,10 +106,10 @@ Item {
 
         Rectangle {
             id: toolButton
-            width: listWidget.vert ? listWidget.width : listWidget.height
-            height: listWidget.vert ? listWidget.width : listWidget.height
+            width: (listWidget.vert ? listWidget.width : listWidget.height) - \
listWidget.anchors.leftMargin +            height: width
             color: "black"
-            radius: 100
+            radius: width
 
             property bool showToolBar: false
 
@@ -154,14 +155,14 @@ Item {
                     Image {
                         id: toolDelete
                         state: "notSelected"
-                        width: 100
-                        height: 100
+                        width: minIconWidth
+                        height: width
                         source: Activity.url + "deleteOn.svg"
                         fillMode: Image.PreserveAspectFit
                         MouseArea {
                             anchors.fill: parent
                             onClicked: {
-                                toolDelete.state = toolDelete.state == "selected" ? \
"notSelected" : "selected" +                                toolDelete.state = \
                (toolDelete.state == "selected") ? "notSelected" : "selected"
                                 Activity.toolDelete = !Activity.toolDelete
                                 Activity.toolDeleteSticky = false
                             }
@@ -174,7 +175,7 @@ Item {
                         states: [
                             State {
                                 name: "selected"
-                                PropertyChanges{
+                                PropertyChanges {
                                     target: toolDelete
                                     source: Activity.url + "deleteOn.svg"
                                 }
@@ -192,14 +193,15 @@ Item {
                     Image {
                         id: info
                         source: Activity.url + "Info.svg"
-                        width: 100
-                        height: 100
+                        width: minIconWidth
+                        height: width
                         fillMode: Image.PreserveAspectFit
                         MouseArea {
                             anchors.fill: parent
                             onClicked: {
                                 if(!Activity.animationInProgress && parent.state == \
"canBeSelected") {  Activity.displayInfo()
+                                    hideToolbar()
                                 }
                             }
                         }
@@ -223,8 +225,8 @@ Item {
 
                     Image {
                         id: rotateLeft
-                        width: 100
-                        height: 100
+                        width: minIconWidth
+                        height: width
                         source: Activity.url + "rotateLeft.svg"
                         fillMode: Image.PreserveAspectFit
                         state: "CanNotBeSelected"
@@ -239,7 +241,7 @@ Item {
                         states: [
                             State {
                                 name: "canBeSelected"
-                                PropertyChanges{
+                                PropertyChanges {
                                     target: rotateLeft
                                     source: Activity.url + "rotateLeft.svg"
                                 }
@@ -256,8 +258,8 @@ Item {
 
                     Image {
                         id: rotateRight
-                        width: 100
-                        height: 100
+                        width: minIconWidth
+                        height: width
                         source: Activity.url + "rotateRight.svg"
                         fillMode: Image.PreserveAspectFit
                         state: "CanNotBeSelected"
@@ -289,9 +291,9 @@ Item {
 
                     Rectangle {
                         id: zoomInBtn
-                        width: 100
-                        height: 100
-                        radius: 100
+                        width: minIconWidth
+                        height: width
+                        radius: width
 
                         color: "black"
 
@@ -325,9 +327,9 @@ Item {
 
                     Rectangle {
                         id: zoomOutBtn
-                        width: 100
-                        height: 100
-                        radius: 100
+                        width: minIconWidth
+                        height: width
+                        radius: width
 
                         color: "black"
 
diff --git a/src/activities/digital_electricity/Wire.qml \
b/src/activities/digital_electricity/Wire.qml index 303fa1a5..dab9aa23 100644
--- a/src/activities/digital_electricity/Wire.qml
+++ b/src/activities/digital_electricity/Wire.qml
@@ -20,10 +20,10 @@
  *   along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 import QtQuick 2.6
-import "digital_electricity.js" as Activity
-
 import GCompris 1.0
 
+import "digital_electricity.js" as Activity
+
 Rectangle {
     id: wire
 
diff --git a/src/activities/digital_electricity/components/AndGate.qml \
b/src/activities/digital_electricity/components/AndGate.qml index 7b6e9797..ee681703 \
                100644
--- a/src/activities/digital_electricity/components/AndGate.qml
+++ b/src/activities/digital_electricity/components/AndGate.qml
@@ -27,7 +27,7 @@ ElectricalComponent {
     terminalSize: 0.246
     noOfInputs: 2
     noOfOutputs: 1
-    property variant inputTerminalPosY: [0.219, 0.773]
+    property var inputTerminalPosY: [0.219, 0.773]
 
     information: qsTr("AND gate takes 2 or more binary input in its input terminals \
                and outputs a single " +
                       "value. The output is 0 if any of the input is 0, else it is \
                1. In this activity, " +
diff --git a/src/activities/digital_electricity/components/BCDToSevenSegment.qml \
b/src/activities/digital_electricity/components/BCDToSevenSegment.qml index \
                b904a1dd..9f91163d 100644
--- a/src/activities/digital_electricity/components/BCDToSevenSegment.qml
+++ b/src/activities/digital_electricity/components/BCDToSevenSegment.qml
@@ -30,13 +30,13 @@ ElectricalComponent {
     noOfInputs: 4
     noOfOutputs: 7
 
-    property variant inputTerminalPosY: [0.057,0.35,0.649,0.935]
-    property variant outputTerminalPosY: [0.048,0.198,0.353,0.509,0.664,0.812,0.952]
+    property var inputTerminalPosY: [0.057, 0.35, 0.649, 0.935]
+    property var outputTerminalPosY: [0.048, 0.198, 0.353, 0.509, 0.664, 0.812, \
0.952]  
-    property variant blackChar: \
["BCDTo7SegmentA_black.svg","BCDTo7SegmentB_black.svg","BCDTo7SegmentC_black.svg", +  \
property var blackChar: \
                ["BCDTo7SegmentA_black.svg","BCDTo7SegmentB_black.svg","BCDTo7SegmentC_black.svg",
                
                                  \
"BCDTo7SegmentD_black.svg","BCDTo7SegmentE_black.svg","BCDTo7SegmentF_black.svg",  \
                "BCDTo7SegmentG_black.svg"]
-    property variant redChar: \
["BCDTo7SegmentA_red.svg","BCDTo7SegmentB_red.svg","BCDTo7SegmentC_red.svg", +    \
property var redChar: \
                ["BCDTo7SegmentA_red.svg","BCDTo7SegmentB_red.svg","BCDTo7SegmentC_red.svg",
                
                                \
"BCDTo7SegmentD_red.svg","BCDTo7SegmentE_red.svg","BCDTo7SegmentF_red.svg",  \
"BCDTo7SegmentG_red.svg"]  
@@ -90,7 +90,6 @@ ElectricalComponent {
     }
 
     function updateOutput(wireVisited) {
-
         var i
         for(i = 1 ; i < truthTable.length ; ++i) {
             var j
diff --git a/src/activities/digital_electricity/components/BcdCounter.qml \
b/src/activities/digital_electricity/components/BcdCounter.qml index \
                1e06155b..a0a03154 100644
--- a/src/activities/digital_electricity/components/BcdCounter.qml
+++ b/src/activities/digital_electricity/components/BcdCounter.qml
@@ -20,16 +20,16 @@
  *   along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 import QtQuick 2.6
-import "../digital_electricity.js" as Activity
-
 import GCompris 1.0
 
+import "../digital_electricity.js" as Activity
+
 ElectricalComponent {
     id: bcdTo7Segment
     terminalSize: 0.127
     noOfInputs: 1
     noOfOutputs: 4
-    property variant outputTerminalPosY: [0.064, 0.345, 0.645, 0.936]
+    property var outputTerminalPosY: [0.064, 0.345, 0.645, 0.936]
     property int count: 0
     property int previousInp: 0
 
@@ -37,7 +37,7 @@ ElectricalComponent {
                       "incrementing by the specified time period")
 
     truthTable: []
-    property variant outputTable: [['0','0','0','0'],
+    property var outputTable: [['0','0','0','0'],
                                    ['0','0','0','1'],
                                    ['0','0','1','0'],
                                    ['0','0','1','1'],
@@ -80,7 +80,6 @@ ElectricalComponent {
     }
 
     function updateOutput(wireVisited) {
-
         for(var i = 0 ; i < noOfOutputs ; ++i) {
             var terminal = outputTerminals.itemAt(i)
             terminal.value = outputTable[count][i]
@@ -89,7 +88,6 @@ ElectricalComponent {
         }
 
         if(previousInp != inputTerminals.itemAt(0).value) {
-
             previousInp = inputTerminals.itemAt(0).value
             count = (count + 1) % 10;
 
diff --git a/src/activities/digital_electricity/components/Comparator.qml \
b/src/activities/digital_electricity/components/Comparator.qml index \
                2134dfc9..ec428c9c 100644
--- a/src/activities/digital_electricity/components/Comparator.qml
+++ b/src/activities/digital_electricity/components/Comparator.qml
@@ -27,8 +27,8 @@ ElectricalComponent {
     terminalSize: 0.214
     noOfInputs: 2
     noOfOutputs: 3
-    property variant inputTerminalPosY: [0.211, 0.784]
-    property variant outputTerminalPosY: [0.128, 0.481, 0.88]
+    property var inputTerminalPosY: [0.211, 0.784]
+    property var outputTerminalPosY: [0.128, 0.481, 0.88]
 
     information: qsTr("Comparator takes 2 numbers as input, A and B. It compares \
                them and outputs 3 " +
                       "values. First value is true if A < B, else it is false. \
Second value is true " + @@ -70,7 +70,6 @@ ElectricalComponent {
     }
 
     function updateOutput(wireVisited) {
-
         outputTerminals.itemAt(0).value = (inputTerminals.itemAt(0).value < \
                inputTerminals.itemAt(1).value)
         outputTerminals.itemAt(1).value = (inputTerminals.itemAt(0).value == \
                inputTerminals.itemAt(1).value)
         outputTerminals.itemAt(2).value = (inputTerminals.itemAt(0).value > \
                inputTerminals.itemAt(1).value)
diff --git a/src/activities/digital_electricity/components/DigitalLight.qml \
b/src/activities/digital_electricity/components/DigitalLight.qml index \
                74c62df0..a02fd24a 100644
--- a/src/activities/digital_electricity/components/DigitalLight.qml
+++ b/src/activities/digital_electricity/components/DigitalLight.qml
@@ -51,7 +51,6 @@ ElectricalComponent {
     }
 
     function updateOutput(wireVisited) {
-
         if(inputTerminals.itemAt(0).value == 1)
             imgSrc = "DigitalLightOn.svg"
         else
diff --git a/src/activities/digital_electricity/components/ElectricalComponent.qml \
b/src/activities/digital_electricity/components/ElectricalComponent.qml index \
                5c0d40c0..617d9bd8 100644
--- a/src/activities/digital_electricity/components/ElectricalComponent.qml
+++ b/src/activities/digital_electricity/components/ElectricalComponent.qml
@@ -20,10 +20,10 @@
  *   along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 import QtQuick 2.6
-import "../digital_electricity.js" as Activity
-
 import GCompris 1.0
 
+import "../digital_electricity.js" as Activity
+
 Image {
     id: electricalComponent
     property double posX
@@ -33,7 +33,7 @@ Image {
     property string imgSrc
     property string information
     property string toolTipTxt
-    property variant truthTable: []
+    property var truthTable: []
     property int index
     property int noOfInputs
     property int noOfOutputs
@@ -67,7 +67,7 @@ Image {
         property: "rotation"
         from: initialAngle; to: initialAngle + rotationAngle
         duration: 1
-        onStarted:{Activity.animationInProgress = true}
+        onStarted:{ Activity.animationInProgress = true }
         onStopped: {
             initialAngle = initialAngle + rotationAngle
             Activity.updateWires(index)
@@ -78,7 +78,8 @@ Image {
                 Activity.animationInProgress = false
                 updateDragConstraints()
             }
-            else rotateComponent.start()
+            else
+                rotateComponent.start()
         }
         easing.type: Easing.InOutQuad
     }
@@ -137,9 +138,12 @@ Image {
         onReleased: {
             parent.posX = parent.x / parent.parent.width
             parent.posY = parent.y / parent.parent.height
-            parent.x = Qt.binding(function() { return parent.posX * \
                parent.parent.width })
-            parent.y = Qt.binding(function() { return parent.posY * \
parent.parent.height })  Activity.updateToolTip("")
         }
+
+        onPositionChanged: {
+            updateDragConstraints()
+            Activity.updateWires(index)
+        }
     }
 }
diff --git a/src/activities/digital_electricity/components/NandGate.qml \
b/src/activities/digital_electricity/components/NandGate.qml index 1206cd1e..7881cbfe \
                100644
--- a/src/activities/digital_electricity/components/NandGate.qml
+++ b/src/activities/digital_electricity/components/NandGate.qml
@@ -27,7 +27,7 @@ ElectricalComponent {
     terminalSize: 0.273
     noOfInputs: 2
     noOfOutputs: 1
-    property variant inputTerminalPosY: [0.174, 0.786]
+    property var inputTerminalPosY: [0.174, 0.786]
 
     information: qsTr("NAND gate takes 2 or more binary input in its input terminals \
                and outputs a single " +
                       "value. It is the complement of AND gate. In this activity, a \
                2 input NAND gate is " +
diff --git a/src/activities/digital_electricity/components/NorGate.qml \
b/src/activities/digital_electricity/components/NorGate.qml index 84461d35..ceebd181 \
                100644
--- a/src/activities/digital_electricity/components/NorGate.qml
+++ b/src/activities/digital_electricity/components/NorGate.qml
@@ -27,7 +27,7 @@ ElectricalComponent {
     terminalSize: 0.251
     noOfInputs: 2
     noOfOutputs: 1
-    property variant inputTerminalPosY: [0.205, 0.769]
+    property var inputTerminalPosY: [0.205, 0.769]
 
     information: qsTr("NOR gate takes 2 or more binary input in its input terminals \
                and outputs a single " +
                       "value. It is the complement of OR gate. In this activity, a 2 \
                input NOR gate is " +
diff --git a/src/activities/digital_electricity/components/OrGate.qml \
b/src/activities/digital_electricity/components/OrGate.qml index 10c23698..621d939c \
                100644
--- a/src/activities/digital_electricity/components/OrGate.qml
+++ b/src/activities/digital_electricity/components/OrGate.qml
@@ -27,7 +27,7 @@ ElectricalComponent {
     terminalSize: 0.251
     noOfInputs: 2
     noOfOutputs: 1
-    property variant inputTerminalPosY: [0.223, 0.786]
+    property var inputTerminalPosY: [0.223, 0.786]
 
     information: qsTr("OR gate takes 2 or more binary input in its input terminals \
                and outputs a single " +
                       "value. The output is 1 if any of the input is 1, else it is \
                0. In this activity, a " +
diff --git a/src/activities/digital_electricity/components/SevenSegment.qml \
b/src/activities/digital_electricity/components/SevenSegment.qml index \
                348d1171..ccfeeb02 100644
--- a/src/activities/digital_electricity/components/SevenSegment.qml
+++ b/src/activities/digital_electricity/components/SevenSegment.qml
@@ -29,8 +29,8 @@ ElectricalComponent {
     terminalSize: 0.116
     noOfInputs: 7
     noOfOutputs: 0
-    property variant inputTerminalPosY: [0.058,0.195,0.337,0.484,0.636,0.791,0.942]
-    property variant redBars: \
["sevenSegmentDisplayA.svg","sevenSegmentDisplayB.svg","sevenSegmentDisplayC.svg", +  \
property var inputTerminalPosY: [0.058,0.195,0.337,0.484,0.636,0.791,0.942] +    \
property var redBars: \
                ["sevenSegmentDisplayA.svg","sevenSegmentDisplayB.svg","sevenSegmentDisplayC.svg",
                
                                \
"sevenSegmentDisplayD.svg","sevenSegmentDisplayE.svg","sevenSegmentDisplayF.svg",  \
"sevenSegmentDisplayG.svg"]  
diff --git a/src/activities/digital_electricity/components/SignalGenerator.qml \
b/src/activities/digital_electricity/components/SignalGenerator.qml index \
                9949945f..38ae3237 100644
--- a/src/activities/digital_electricity/components/SignalGenerator.qml
+++ b/src/activities/digital_electricity/components/SignalGenerator.qml
@@ -41,7 +41,7 @@ ElectricalComponent {
 
     property alias outputTerminals: outputTerminals
     property double period: 1
-    property variant periodFraction: ["1/4","1/2","1","2"]
+    property var periodFraction: ["1/4","1/2","1","2"]
     property int periodIndex: 2
 
     Repeater {
@@ -156,7 +156,7 @@ ElectricalComponent {
             verticalAlignment: Text.AlignVCenter
             height: parent.height - 10
             width: parent.width - 10
-            text: qsTr("%1s").arg(signalGenerator.periodFraction[periodIndex])
+            text: qsTr("%1 s").arg(signalGenerator.periodFraction[periodIndex])
         }
     }
 }
diff --git a/src/activities/digital_electricity/components/TerminalPoint.qml \
b/src/activities/digital_electricity/components/TerminalPoint.qml index \
                979660bc..24457952 100644
--- a/src/activities/digital_electricity/components/TerminalPoint.qml
+++ b/src/activities/digital_electricity/components/TerminalPoint.qml
@@ -20,10 +20,10 @@
  *   along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 import QtQuick 2.6
-import "../digital_electricity.js" as Activity
-
 import GCompris 1.0
 
+import "../digital_electricity.js" as Activity
+
 Rectangle {
     id: terminalPoint
 
@@ -33,12 +33,12 @@ Rectangle {
     property bool selected: false
     property string type
     property int value: 0
-    property variant wires: []
+    property var wires: []
 
     width: size * parent.paintedHeight
     height: size * parent.paintedHeight
     radius: width / 2
-    color: "Black"
+    color: "black"
 
     x: (parent.width - parent.paintedWidth) / 2 + posX * parent.paintedWidth - width \
                / 2
     y: (parent.height - parent.paintedHeight) / 2 + posY * parent.paintedHeight - \
                height / 2
diff --git a/src/activities/digital_electricity/components/XorGate.qml \
b/src/activities/digital_electricity/components/XorGate.qml index 3fd6186f..8ae94d75 \
                100644
--- a/src/activities/digital_electricity/components/XorGate.qml
+++ b/src/activities/digital_electricity/components/XorGate.qml
@@ -27,7 +27,7 @@ ElectricalComponent {
     terminalSize: 0.229
     noOfInputs: 2
     noOfOutputs: 1
-    property variant inputTerminalPosY: [0.248, 0.762]
+    property var inputTerminalPosY: [0.248, 0.762]
 
     information: qsTr("XOR gate takes 2 or more binary input in its input terminals \
                and outputs a single " +
                       "value. The output is 1 if number of '1' in input is odd, and \
                0 if number of '1' in " +
diff --git a/src/activities/digital_electricity/digital_electricity.js \
b/src/activities/digital_electricity/digital_electricity.js index cb746d86..f1719a15 \
                100644
--- a/src/activities/digital_electricity/digital_electricity.js
+++ b/src/activities/digital_electricity/digital_electricity.js
@@ -5,6 +5,7 @@
  * Authors:
  *   Bruno Coudoin <bruno.coudoin@gcompris.net> (GTK+ version)
  *   Pulkit Gupta <pulkitnsit@gmail.com> (Qt Quick port)
+ *   Rudra Nil Basu <rudra.nil.basu.1996@gmail.com> (Qt Quick port)
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -80,7 +81,6 @@ function stop() {
 
 function initLevel() {
     items.bar.level = currentLevel
-    var sizeMultiplier = 1 + (1 / (1.5 * currentLevel))
 
     items.availablePieces.view.currentDisplayedGroup = 0
     items.availablePieces.view.previousNavigation = 1
@@ -104,7 +104,7 @@ function initLevel() {
 
     if (!items.isTutorialMode) {
         items.tutorialInstruction.index = -1
-        loadFreeMode(sizeMultiplier)
+        loadFreeMode()
     } else {
         // load tutorial levels from dataset
         processingAnswer = false
@@ -115,8 +115,8 @@ function initLevel() {
             items.availablePieces.model.append( {
                "imgName": currentInputComponent.imageName,
                "componentSrc": currentInputComponent.componentSource,
-               "imgWidth": currentInputComponent.width * sizeMultiplier,
-               "imgHeight": currentInputComponent.height * sizeMultiplier,
+               "imgWidth": currentInputComponent.width,
+               "imgHeight": currentInputComponent.height,
                "toolTipText": currentInputComponent.toolTipText
             })
         }
@@ -163,14 +163,14 @@ function initLevel() {
     }
 }
 
-function loadFreeMode(sizeMultiplier) {
+function loadFreeMode() {
     var componentList = items.tutorialDataset.componentList
     for (var i = 0; i < componentList.length; i++) {
         items.availablePieces.model.append( {
             "imgName": componentList[i].imageName,
             "componentSrc": componentList[i].componentSource,
-            "imgWidth": sizeMultiplier * componentList[i].width,
-            "imgHeight": sizeMultiplier * componentList[i].height,
+            "imgWidth": componentList[i].width,
+            "imgHeight": componentList[i].height,
             "toolTipText": componentList[i].toolTipText
         })
     }
@@ -193,9 +193,7 @@ function checkAnswer() {
         }
     } else if (problemType == items.tutorialDataset.problemType.equation1Variable) {
         var switch1 = determiningComponents[0]
-
         var digitalLight = determiningComponents[1]
-
         var switch1InitialState = switch1.imgSrc
 
         for (var A = 0; A <= 1; A++) {
@@ -631,9 +629,9 @@ function removeWire(wire) {
     var outTerminal = wire.from
 
     var removeIndex = inTerminal.wires.indexOf(wire)
-    inTerminal.wires.splice(removeIndex,1)
+    inTerminal.wires.splice(removeIndex, 1)
     removeIndex = outTerminal.wires.indexOf(wire)
-    outTerminal.wires.splice(removeIndex,1)
+    outTerminal.wires.splice(removeIndex, 1)
     connected[wire.to] = -1
 
     inTerminal.value = 0
diff --git a/src/activities/digital_electricity/resource/ElectricalComponents.qml \
b/src/activities/digital_electricity/resource/ElectricalComponents.qml deleted file \
mode 100644 index 82ee1928..00000000
--- a/src/activities/digital_electricity/resource/ElectricalComponents.qml
+++ /dev/null
@@ -1,461 +0,0 @@
-/* GCompris
- *
- * Copyright (C) 2016 Pulkit Gupta <pulkitnsit@gmail.com>
- *
- * Authors:
- *   Bruno Coudoin <bruno.coudoin@gcompris.net> (GTK+ version)
- *   Pulkit Gupta <pulkitnsit@gmail.com> (Qt Quick port)
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 3 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-import QtQuick 2.6
-
-QtObject {
-    property variant components : [
-        {
-            "imgName": "zero.svg",
-            "imgWidth": 0.12,
-            "imgHeight": 0.2,
-            "toolTipText": qsTr("Zero input"),
-            "terminalSize": 0.205,
-            "inputTerminals": [],
-            "outputTerminals": [
-                {
-                    "posX": 0.91,
-                    "posY": 0.5,
-                    "value": 0
-                }
-            ],
-            "information": qsTr("Digital electronics is a branch of electronics that \
                handle digital signals " +
-                                "(i.e discrete signals instead of continous \
                signals). Therefore all values within " +
-                                "a range or band represent the same numeric value. \
                In most cases, the number of " +
-                                "these states is two and they are represented by two \
                voltage bands: one near a " +
-                                "reference value (typically termed as 'ground' or \
                zero volts), and other value near " +
-                                "the supply voltage. These correspond to the 'false' \
                ('0') and 'true' ('1') values " +
-                                "of the Boolean domain respectively (named after its \
                inventor, George Boole). " +
-                                "In this activity, you can give '0' and '1' as input \
                to other logical devices, " +
-                                "and see their output through an output device."),
-            "truthTable": []
-
-        },
-        {
-            "imgName": "one.svg",
-            "imgWidth": 0.12,
-            "imgHeight": 0.2,
-            "toolTipText": qsTr("One input"),
-            "terminalSize": 0.218,
-            "inputTerminals": [],
-            "outputTerminals": [
-                {
-                    "posX": 0.91,
-                    "posY": 0.5,
-                    "value": 1
-                }
-            ],
-            "information": qsTr("Digital electronics is a branch of electronics that \
                handle digital signals " +
-                                "(i.e discrete signals instead of continous \
                signals). Therefore all values within " +
-                                "a range or band represent the same numeric value. \
                In most cases, the number of " +
-                                "these states is two and they are represented by two \
                voltage bands: one near a " +
-                                "reference value (typically termed as 'ground' or \
                zero volts), and other value near " +
-                                "the supply voltage. These correspond to the 'false' \
                ('0') and 'true' ('1') values " +
-                                "of the Boolean domain respectively (named after its \
                inventor, George Boole). " +
-                                "In this activity, you can give '0' and '1' as input \
                to other logical devices, " +
-                                "and see their output through an output device."),
-            "truthTable": []
-        },
-        {
-            "imgName": "BCDTo7Segment.svg",
-            "imgWidth": 0.3,
-            "imgHeight": 0.4,
-            "toolTipText": qsTr("BCD To 7 Segment"),
-            "terminalSize": 0.097,
-            "inputTerminals": [
-                {
-                    "posX": 0.031,
-                    "posY": 0.057
-                },
-                {
-                    "posX": 0.031,
-                    "posY": 0.35
-                },
-                {
-                    "posX": 0.031,
-                    "posY": 0.649
-                },
-                {
-                    "posX": 0.031,
-                    "posY": 0.935
-                }
-            ],
-            "outputTerminals": [
-                {
-                    "posX": 0.969,
-                    "posY": 0.048
-                },
-                {
-                    "posX": 0.969,
-                    "posY": 0.198
-                },
-                {
-                    "posX": 0.969,
-                    "posY": 0.353
-                },
-                {
-                    "posX": 0.968,
-                    "posY": 0.509
-                },
-                {
-                    "posX": 0.969,
-                    "posY": 0.664
-                },
-                {
-                    "posX": 0.969,
-                    "posY": 0.812
-                },
-                {
-                    "posX": 0.969,
-                    "posY": 0.952
-                }
-            ],
-            "information": qsTr("BCD to 7 segment converter takes 4 binary inputs in \
                its input terminals and gives " +
-                                "7 binary outputs. The 4 binary inputs represents a \
                BCD number (binary-coded decimal). " +
-                                "The converter converts this BCD number to \
                corresponding bits, which are used to " +
-                                "display the decimal number (represented by the BCD \
                number) on the 7 segment display. " +
-                                "The truth table for BCD To 7 Segment converted \
                is:"),
-            "truthTable": [['A','B','C','D','a','b','c','d','e','f','g'],
-                           ['0','0','0','0','1','1','1','1','1','1','0'],
-                           ['0','0','0','1','0','1','1','0','0','0','0'],
-                           ['0','0','1','0','1','1','0','1','1','0','1'],
-                           ['0','0','1','1','1','1','1','1','0','0','1'],
-                           ['0','1','0','0','0','1','1','0','0','1','1'],
-                           ['0','1','0','1','1','0','1','1','0','1','1'],
-                           ['0','1','1','0','1','0','1','1','1','1','1'],
-                           ['0','1','1','1','1','1','1','0','0','0','0'],
-                           ['1','0','0','0','1','1','1','1','1','1','1'],
-                           ['1','0','0','1','1','1','1','1','0','1','1']]
-        },
-        {
-            "imgName": "sevenSegmentDisplay.svg",
-            "imgWidth": 0.18,
-            "imgHeight": 0.4,
-            "toolTipText": qsTr("7 Segment Display"),
-            "terminalSize": 0.116,
-            "inputTerminals": [
-                {
-                    "posX": 0.06,
-                    "posY": 0.058
-                },
-                {
-                    "posX": 0.06,
-                    "posY": 0.195
-                },
-                {
-                    "posX": 0.06,
-                    "posY": 0.337
-                },
-                {
-                    "posX": 0.06,
-                    "posY": 0.484
-                },
-                {
-                    "posX": 0.06,
-                    "posY": 0.636
-                },
-                {
-                    "posX": 0.06,
-                    "posY": 0.791
-                },
-                {
-                    "posX": 0.06,
-                    "posY": 0.942
-                }
-            ],
-            "outputTerminals": [],
-            "information": qsTr("7 segment display takes 7 binary inputs in its \
                input terminals. The display " +
-                                "consists of 7 segments and each segment gets \
                lighted according to the input. " +
-                                "By generating different combination of binary \
                inputs, the display can be used to " +
-                                "display various different symbols. The diagram \
                is:"),
-            "truthTable": []
-        },
-        {
-            "imgName": "comparator.svg",
-            "imgWidth": 0.3,
-            "imgHeight": 0.25,
-            "toolTipText": qsTr("Comparator"),
-            "terminalSize": 0.214,
-            "inputTerminals": [
-                {
-                    "posX": 0.039,
-                    "posY": 0.211
-                },
-                {
-                    "posX": 0.039,
-                    "posY": 0.784
-                }
-            ],
-            "outputTerminals": [
-                {
-                    "posX": 0.961,
-                    "posY": 0.128
-                },
-                {
-                    "posX": 0.961,
-                    "posY": 0.481
-                },
-                {
-                    "posX": 0.961,
-                    "posY": 0.88
-                }
-            ],
-            "information": qsTr("Comparator takes 2 numbers as input, A and B. It \
                compares them and outputs 3 " +
-                                "values. First value is true if A < B, else it is \
                false. Second value is true " +
-                                "if A = B, else it is false. Third value is true if \
                A > B, else it is false. " +
-                                "In digital electronics, true value is represented \
                as 1, and false value is " +
-                                "represented as 0"),
-            "truthTable": []
-        },
-        {
-            "imgName": "switchOff.svg",
-            "imgWidth": 0.18,
-            "imgHeight": 0.15,
-            "toolTipText": qsTr("Switch"),
-            "terminalSize": 0.552,
-            "inputTerminals": [
-                {
-                    "posX": 0.065,
-                    "posY": 0.503
-                }
-            ],
-            "outputTerminals": [
-                {
-                    "posX": 0.935,
-                    "posY": 0.497
-                }
-            ],
-            "information": qsTr("Switch is used to maintain easy connection between \
                two terminals. If the switch is " +
-                                "turned on, then the two terminals are connected and \
                current can flow through the " +
-                                "switch. If the switch is turned off, then the \
                connection between terminal is broken, " +
-                                "and current can not flow through it."),
-            "truthTable": []
-        },
-        {
-            "imgName": "gateAnd.svg",
-            "imgWidth": 0.15,
-            "imgHeight": 0.12,
-            "toolTipText": qsTr("AND gate"),
-            "terminalSize": 0.246,
-            "inputTerminals": [
-                {
-                    "posX": 0.045,
-                    "posY": 0.219
-                },
-                {
-                    "posX": 0.045,
-                    "posY": 0.773
-                }
-            ],
-            "outputTerminals": [
-                {
-                    "posX": 0.955,
-                    "posY": 0.5
-                }
-            ],
-            "information": qsTr("AND gate takes 2 or more binary input in its input \
                terminals and outputs a single " +
-                                "value. The output is 0 if any of the input is 0, \
                else it is 1. In this activity, " +
-                                "a 2 input AND gate is shown. Truth table for 2 \
                input AND gate is:"),
-            "truthTable": [['A','B',"A.B"],
-                           ['0','0','0'],
-                           ['0','1','0'],
-                           ['1','0','0'],
-                           ['1','1','1']]
-        },
-        {
-            "imgName": "gateNand.svg",
-            "imgWidth": 0.15,
-            "imgHeight": 0.12,
-            "toolTipText": qsTr("NAND gate"),
-            "terminalSize": 0.273,
-            "inputTerminals": [
-                {
-                    "posX": 0.045,
-                    "posY": 0.174
-                },
-                {
-                    "posX": 0.045,
-                    "posY": 0.786
-                }
-            ],
-            "outputTerminals": [
-                {
-                    "posX": 0.955,
-                    "posY": 0.484
-                }
-            ],
-            "information": qsTr("NAND gate takes 2 or more binary input in its input \
                terminals and outputs a single " +
-                                "value. It is the complement of AND gate. In this \
                activity, a 2 input NAND gate is " +
-                                "shown. Truth table for 2 input NAND gate is:"),
-            "truthTable": [['A','B',"~(A.B)"],
-                           ['0','0','1'],
-                           ['0','1','1'],
-                           ['1','0','1'],
-                           ['1','1','0']]
-        },
-        {
-            "imgName": "gateNor.svg",
-            "imgWidth": 0.15,
-            "imgHeight": 0.12,
-            "toolTipText": qsTr("NOR gate"),
-            "terminalSize": 0.251,
-            "inputTerminals": [
-                {
-                    "posX": 0.045,
-                    "posY": 0.205
-                },
-                {
-                    "posX": 0.045,
-                    "posY": 0.769
-                }
-            ],
-            "outputTerminals": [
-                {
-                    "posX": 0.955,
-                    "posY": 0.491
-                }
-            ],
-            "information": qsTr("NOR gate takes 2 or more binary input in its input \
                terminals and outputs a single " +
-                                "value. It is the complement of OR gate. In this \
                activity, a 2 input NOR gate is " +
-                                "shown. Truth table for 2 input NOR gate is:"),
-            "truthTable": [['A','B',"~(A+B)"],
-                           ['0','0','1'],
-                           ['0','1','0'],
-                           ['1','0','0'],
-                           ['1','1','0']]
-        },
-        {
-            "imgName": "gateNot.svg",
-            "imgWidth": 0.15,
-            "imgHeight": 0.12,
-            "toolTipText": qsTr("Not gate"),
-            "terminalSize": 0.261,
-            "inputTerminals": [
-                {
-                    "posX": 0.046,
-                    "posY": 0.503
-                }
-            ],
-            "outputTerminals": [
-                {
-                    "posX": 0.954,
-                    "posY": 0.492
-                }
-            ],
-            "information": qsTr("Not gate (also known as inverter) takes a binary \
                input in its input terminal and " +
-                                "outputs a single value. The output is the \
                complement of the input value, that is, it " +
-                                "is 0 if input is 1, and 1 if input is 0. Truth \
                table for NOT gate is:"),
-            "truthTable": [['A',"~A"],
-                           ['0','1'],
-                           ['1','0']]
-        },
-        {
-            "imgName": "gateOr.svg",
-            "imgWidth": 0.15,
-            "imgHeight": 0.12,
-            "toolTipText": qsTr("Or gate"),
-            "terminalSize": 0.251,
-            "inputTerminals": [
-                {
-                    "posX": 0.045,
-                    "posY": 0.223
-                },
-                {
-                    "posX": 0.045,
-                    "posY": 0.786
-                }
-            ],
-            "outputTerminals": [
-                {
-                    "posX": 0.955,
-                    "posY": 0.509
-                }
-            ],
-            "information": qsTr("OR gate takes 2 or more binary input in its input \
                terminals and outputs a single " +
-                                "value. The output is 1 if any of the input is 1, \
                else it is 0. In this activity, a " +
-                                "2 input OR gate is shown. Truth table for 2 input \
                OR gate is:"),
-            "truthTable": [['A','B',"A+B"],
-                           ['0','0','0'],
-                           ['0','1','1'],
-                           ['1','0','1'],
-                           ['1','1','1']]
-        },
-        {
-            "imgName": "gateXor.svg",
-            "imgWidth": 0.15,
-            "imgHeight": 0.12,
-            "toolTipText": qsTr("Xor gate"),
-            "terminalSize": 0.229,
-            "inputTerminals": [
-                {
-                    "posX": 0.045,
-                    "posY": 0.248
-                },
-                {
-                    "posX": 0.045,
-                    "posY": 0.762
-                }
-            ],
-            "outputTerminals": [
-                {
-                    "posX": 0.955,
-                    "posY": 0.509
-                }
-            ],
-            "information": qsTr("XOR gate takes 2 or more binary input in its input \
                terminals and outputs a single " +
-                                "value. The output is 1 if number of '1' in input is \
                odd, and 0 if number of '1' in " +
-                                "input is even. In this activity, a 2 input XOR gate \
                is shown. Truth table for " +
-                                "2 input XOR gate is:"),
-            "truthTable": [['A','B',"A^B"],
-                           ['0','0','0'],
-                           ['0','1','1'],
-                           ['1','0','1'],
-                           ['1','1','0']]
-        },
-        {
-            "imgName": "ledOff.svg",
-            "imgWidth": 0.16,
-            "imgHeight": 0.2,
-            "toolTipText": qsTr("LED"),
-            "terminalSize": 0.111,
-            "inputTerminals": [
-                {
-                    "posX": 0.319,
-                    "posY": 0.945
-                },
-                {
-                    "posX": 0.776,
-                    "posY": 0.698
-                }
-            ],
-            "outputTerminals": [],
-            "information": qsTr("LED (Light-emitting diode) is a two-lead \
                semiconductor light source. It emits " +
-                                "light when activated. LED has 2 input terminals, \
                the longer terminal is the " +
-                                "positive terminal (anode) and smaller terminal is \
                the negative terminal (cathode)" +
-                                ". LED is activated when anode has a higher \
                potential than cathode. In digital " +
-                                "electronics LED can be used to check the output of \
                the components. Connect " +
-                                "the cathode of LED to ground ('0') and anode of LED \
                to the output of the " +
-                                "component. If output is 1, the LED will be \
                activated (emit light), and if " +
-                                "output is 0, the LED will be deactivated."),
-            "truthTable": []
-        }
-    ]
-}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic