You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
2.2 KiB

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Dialogs 1.1
import QtQuick.Layouts 1.1
import Qt.labs.settings 1.0
import "js/Debugger.js" as Debugger
import "js/ErrorLocationFormater.js" as ErrorLocationFormater
import "."
Rectangle {
10 years ago
color: "#ededed"
property alias bc: blockChain
10 years ago
Connections
{
target: projectModel
onProjectLoaded: {
loader.init()
}
}
ScrollView
10 years ago
{
anchors.fill: parent
onWidthChanged: {
columnExe.width = width - 40
10 years ago
}
ColumnLayout
{
id: columnExe
Layout.preferredWidth: parent.width
width: parent.width - 40
anchors.left: parent.left
anchors.leftMargin: 15
ColumnLayout
{
id: scenarioColumn
width: parent.width
spacing: 10
ScenarioLoader
{
anchors.horizontalCenter: parent.horizontalCenter
height: 100
Layout.preferredWidth: 400
width: 400
id: loader
}
Connections
{
target: blockChain
onChainChanged:
{
loader.needSaveOrReload()
}
}
Rectangle
{
Layout.preferredWidth: parent.width
height: 1
color: "#cccccc"
}
Connections
{
target: loader
onLoaded:
{
watchers.clear()
blockChain.load(scenario)
}
}
BlockChain
{
id: blockChain
width: parent.width
}
Connections
{
target: blockChain
10 years ago
property var currentSelectedBlock
property var currentSelectedTx
onTxSelected: {
10 years ago
currentSelectedBlock = blockIndex
currentSelectedTx = txIndex
updateWatchers(blockIndex, txIndex)
}
function updateWatchers(blockIndex, txIndex){
var tx = blockChain.model.blocks[blockIndex].transactions[txIndex]
var state = blockChain.getState(tx.recordIndex)
watchers.updateWidthTx(tx, state, blockIndex, txIndex)
}
10 years ago
onRebuilding: {
watchers.clear()
}
10 years ago
onAccountAdded: {
watchers.addAccount(address, "0 wei")
}
}
}
Watchers
{
id: watchers
bc: blockChain
Layout.fillWidth: true
Layout.preferredHeight: 740
}
Rectangle
{
color: "transparent"
Layout.preferredHeight: 50
Layout.fillWidth: true
}
}
10 years ago
}
}