Source program Back-to-back
Program written for the phone N8 Nokia in the QT environment for Symbian^3.
import QtQuick 1.0
import com.nokia.symbian 1.0
Window {
id: window
StatusBar {
id: statusBar
anchors.top: window.top
}
PageStack {
id: pageStack
x: 0
y: 0
width: 360
height: 640
visible: true
smooth: false
z: 8
anchors.rightMargin: 0
anchors.leftMargin: 0
anchors.topMargin: -26
anchors { left: parent.left; right: parent.right; top: statusBar.bottom; bottom: toolBar.top }
Text {
id: textSwitch
x: 282
y: 494
width: 57
height: 24
color: „#dbc6c6”
// text: qsTr(„text”)
text: qsTr(„Mbps”)
clip: false
opacity: 1
visible: true
smooth: false
z: 3
font.family: „Bookman Old Style”
font.pixelSize: 18
}
Button {
id: button1
x: 252
y: 586
text: „change”
z: 4
pressed: true
onClicked: {
if (textFrame.text == qsTr(„Frame/Burst”))
{ textFrame.text=qsTr(„Mbps”)
ramka1.text=”1000″
b2bm1.text=”*******”
textMbps.text=qsTr(„Frame/Burst”)
textSwitch.text=qsTr(„Frames”)
} else { textFrame.text=qsTr(„Frame/Burst”)
ramka1.text=”2976191″
b2bm1.text=”****.***”
textMbps.text=qsTr(„Mbps”)
textSwitch.text=qsTr(„Mbps”)}
}
}
}
Text {
id: textFrame
x: 21
y: 69
width: 157
height: 28
color: „#db3a3a”
text: qsTr(„Frame/Burst”)
style: Text.Normal
font.family: „Bookman Old Style”
font.bold: true
font.pixelSize: 23
}
Text {
id: text4
x: 31
y: 26
color: „#a7ec1b”
text: qsTr(„Calculator Back to Back”)
font.bold: true
font.family: „GungsuhChe”
font.pixelSize: 23
}
Text {
id: text5
x: 109
y: 308
width: 142
height: 24
color: „#5e48c0”
text: qsTr(„Back to Back”)
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.bold: true
font.family: „Bookman Old Style”
font.pixelSize: 20
}
Text {
id: textMbps
x: 238
y: 342
width: 74
height: 25
color: „#5e48c0”
text: qsTr(„[Mbps]”)
verticalAlignment: Text.AlignTop
horizontalAlignment: Text.AlignHCenter
smooth: false
styleColor: „#000000”
clip: false
wrapMode: Text.WordWrap
font.bold: true
font.family: „Bookman Old Style”
font.pixelSize: 20
}
Text {
id: text8
x: 21
y: 430
width: 104
height: 26
color: „#5e48c0”
text: qsTr(„bufor [B]”)
font.bold: true
font.family: „Bookman Old Style”
font.pixelSize: 22
}
TextField {
id: ramka1
x: 186
y: 54
width: 150
height: 50
text: „2976191”
scale: 1
clip: true
visible: true
smooth: false
opacity: 1
}
TextField {
id: mtu1
x: 230
y: 117
width: 106
height: 50
text: „64”
clip: true
scale: 1
}
TextField {
id: czas1
x: 230
y: 180
width: 106
height: 50
text: „2”
clip: true
}
Button {
id: oblicz1
x: 77
y: 484
width: 190
height: 42
text: „Calculate”
pressed: true
onClicked: {
if ( wybraneMTU1.selectedIndex !== -1 )
{ mtu1.text = qsTr(wybraneMTU1.model.get(wybraneMTU1.selectedIndex).name)
wybraneMTU1.selectedIndex=-1
}
if (textSwitch.text == qsTr(„Mbps”))
{ // oblicz Mbps
var b1=0;
b1 = qsTr(ramka1.text)*qsTr(mtu1.text)*qsTr(czas1.text);
bufor1.text=b1.toString();
var b2=0;
b2=((qsTr(ramka1.text)*8*8/(1000000*qsTr(pasmo1.text))/qsTr(czas1.text))+(qsTr(ramka1.text)*12*8/(1000000*qsTr(pasmo1.text))/qsTr(czas1.text))+(qsTr(ramka1.text)*qsTr(mtu1.text)*8/(1000000*qsTr(pasmo1.text))/qsTr(czas1.text)))*100;
b2bpr1.text=b2.toFixed(3).toString();
var b3=0;
b3=qsTr(pasmo1.text)*qsTr(b2bpr1.text)/100;
b2bm1.text=b3.toFixed(3).toString();
} else
{
// oblicz famki
var b4=0;
b4=100*qsTr(ramka1.text)/qsTr(pasmo1.text);
b2bpr1.text=b4.toFixed(3).toString();
var b5=0;
b5=((qsTr(ramka1.text)/qsTr(pasmo1.text))/((qsTr(mtu1.text)*8/qsTr(pasmo1.text)/1000000/qsTr(czas1.text))+(8*8/qsTr(pasmo1.text)/1000000/qsTr(czas1.text))+(12*8/qsTr(pasmo1.text)/1000000/qsTr(czas1.text))));
b2bm1.text=(b5).toFixed(0).toString();
var b6=0;
b6=qsTr(b2bm1.text);
b2bm1.text=(b5).toFixed(1).toString();
var b7=0;
b7=qsTr(b2bm1.text);
if ((b7-b6) >= 0.1) { b2bm1.text=(b5+1).toFixed(0).toString() } else
{ b2bm1.text=(b5).toFixed(0).toString() };
var b8=0;
b8=qsTr(b2bm1.text)*qsTr(mtu1.text)*qsTr(czas1.text);
bufor1.text=b8.toString();
}
}
}
TextInput {
id: bufor1
x: 147
y: 427
width: 189
height: 33
color: „#f9f4f4”
text: qsTr(„***********”)
horizontalAlignment: TextInput.AlignHCenter
clip: false
opacity: 0.380
cursorVisible: false
readOnly: true
font.bold: false
font.family: „Arial Black”
font.pixelSize: 24
}
TextField {
id: pasmo1
x: 230
y: 243
width: 106
height: 50
text: „1000”
clip: true
}
Text {
id: text9
x: 14
y: 553
width: 172
height: 17
color: „#4aaf0f”
text: qsTr(„© Leszek Gorzelnik , Kraków 2011”)
font.family: „Nyala”
font.italic: true
font.pixelSize: 14
}
Rectangle {
id: rectangle1
x: 11
y: 305
width: 339
height: 112
color: „#00aa1010”
radius: 22
z: 0
border.width: 8
smooth: false
visible: true
border.color: „#1719b7”
opacity: 0.380
clip: false
}
Text {
id: text10
x: 67
y: 342
width: 34
height: 27
color: „#5e48c0”
text: qsTr(„[%]”)
font.bold: true
font.family: „Bookman Old Style”
font.pixelSize: 20
}
Text {
id: text11
x: 31
y: 4
color: „#ee1818”
text: qsTr(„RFC2544”)
font.family: „Bookman Old Style”
font.pixelSize: 19
}
ToolBar {
id: toolBar
anchors.bottom: window.bottom
tools: ToolBarLayout {
id: toolBarLayout
ToolButton {
flat: true
iconSource: „toolbar-back”
onClicked: pageStack.depth <= 1 ? Qt.quit() : pageStack.pop()
}
}
}
Text {
id: text3
x: 22
y: 195
width: 207
height: 30
color: „#db3a3a”
text: qsTr(„time measur [s]”)
font.bold: true
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.family: „Bookman Old Style”
font.pixelSize: 23
}
Text {
id: text6
x: 22
y: 256
width: 167
height: 28
color: „#db3a3a”
text: qsTr(„band [Mbps]”)
font.family: „Bookman Old Style”
font.bold: true
font.pixelSize: 23
}
TextInput {
id: b2bm1
x: 209
y: 371
width: 129
height: 33
color: „#fdfbfb”
text: qsTr(„****.***”)
z: 0
horizontalAlignment: TextInput.AlignHCenter
font.family: „Arial Black”
readOnly: true
opacity: 0.380
font.pixelSize: 24
}
TextInput {
id: b2bpr1
x: 30
y: 372
width: 108
height: 32
color: „#fffdfd”
text: qsTr(„***.***”)
z: 0
horizontalAlignment: TextInput.AlignHCenter
font.family: „Arial Black”
readOnly: true
opacity: 0.380
font.pixelSize: 24
}
SelectionListItem {
id: wyborMTU1
x: 22
y: 108
width: 209
height: 72
z: 6
subItemIndicator: true
opacity: 1
smooth: false
clip: false
title: „MTU”
subTitle: wybraneMTU1.selectedIndex >= 0
? wybraneMTU1.model.get(wybraneMTU1.selectedIndex).name
: „wybierz”
onClicked: { wybraneMTU1.open()
if ( wybraneMTU1.selectedIndex > -1) { mtu1.text = qsTr(wybraneMTU1.model.get(wybraneMTU1.selectedIndex).name)
}
}
SelectionDialog {
id: wybraneMTU1
x: 57
y: -37
clip: false
transformOrigin: Item.TopLeft
scale: 0.500
anchors.top: parent.top
anchors.topMargin: -37
smooth: false
status: 3
opacity: 1
visible: true
titleText: „Choose MTU”
selectedIndex: -1
model: ListModel {
ListElement { name: „64” }
ListElement { name: „68” }
ListElement { name: „72” }
ListElement { name: „128” }
ListElement { name: „256” }
ListElement { name: „512” }
ListElement { name: „578” }
ListElement { name: „1024” }
ListElement { name: „1280” }
ListElement { name: „1518” }
ListElement { name: „1522” }
ListElement { name: „1526” }
ListElement { name: „1550” }
ListElement { name: „1600” }
ListElement { name: „2000” }
ListElement { name: „9000” }
ListElement { name: „9212” }
ListElement { name: „9600” }
}
}
}
Component.onCompleted: {
pageStack.push(Qt.resolvedUrl(„MainPage.qml”))
}
}
I blog also and I’m crafting something very close to this specific blog
post, “Source program Back-to-back Obszar użytkownika Leszek”.
Would you care if perhaps I personallyutilize some of your tips?
Many thanks ,Xavier
No problem, regards Leszek
Hello my loved one! I wish to say that this article is awesome, nice written and include almost all vital infos.
I’d like to peer extra posts like this .
Hi there colleagues, its impressive article on the topic of
cultureand fully explained, keep it up all the time.
Article writing is also a fun, if you be acquainted with then you can write
if not it is difficult to write.
Great blog here! Also your web site loads up fast!
What host are you using? Can I get your affiliate
link to your host? I wish my site loaded up as quickly as yours lol
Thanks to my father who stated to me about this webpage, this blog is really awesome.
Howdy superb website! Does running a blog like this take a large amount of work?
I’ve absolutely no expertise in programming but I had been hoping to start my own blog soon. Anyways, if you
have any recommendations or techniques for new blog
owners please share. I know this is off subject but I simply wanted to ask.
Thank you!
Hello, I think your website might be having browser compatibility issues.
When I look at your blog site in Safari, it looks
fine but when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up! Other then that, wonderful
blog!