Commit 893a0ccb authored by Michael Büsch's avatar Michael Büsch

gui: Add more icons

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent 66da8062
......@@ -23,6 +23,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
from awlsim.common.compat import *
from awlsim.gui.util import *
from awlsim.gui.icons import *
import sys
......@@ -33,38 +34,42 @@ class CoreConfigDialog(QDialog):
def __init__(self, parent, simClient):
QDialog.__init__(self, parent)
self.simClient = simClient
self.setWindowTitle("Awlsim core configuration")
self.setWindowTitle("Core server connection configuration")
self.__updateBlocked = 0
self.setLayout(QGridLayout(self))
label = QLabel(self)
label.setPixmap(getIcon("network").pixmap(QSize(48, 48)))
self.layout().addWidget(label, 0, 0)
self.spawnServerCheckBox = QCheckBox("Spawn a new core server on RUN (recommended)",
self)
self.layout().addWidget(self.spawnServerCheckBox, 0, 0, 1, 2)
self.layout().addWidget(self.spawnServerCheckBox, 1, 0, 1, 2)
self.interpreterListLabel = QLabel("Python interpreter for core "
"(semicolon separated list;\n"
"First in list is tried first):", self)
self.layout().addWidget(self.interpreterListLabel, 1, 0)
self.layout().addWidget(self.interpreterListLabel, 2, 0)
self.interpreterList = QLineEdit(self)
self.interpreterList.setText("; ".join(DEFAULT_INTERPRETERS))
self.layout().addWidget(self.interpreterList, 1, 1)
self.layout().addWidget(self.interpreterList, 2, 1)
self.hostLabel = QLabel("Connect to awlsim core server host:", self)
self.layout().addWidget(self.hostLabel, 2, 0)
self.layout().addWidget(self.hostLabel, 3, 0)
self.host = QLineEdit(self)
self.host.setText(AwlSimServer.DEFAULT_HOST)
self.layout().addWidget(self.host, 2, 1)
self.layout().addWidget(self.host, 3, 1)
self.portLabel = QLabel("Connect to awlsim core server port:", self)
self.layout().addWidget(self.portLabel, 3, 0)
self.layout().addWidget(self.portLabel, 4, 0)
self.port = QSpinBox(self)
self.port.setRange(0, 0xFFFF)
self.port.setValue(AwlSimServer.DEFAULT_PORT)
self.layout().addWidget(self.port, 3, 1)
self.layout().addWidget(self.port, 4, 1)
self.portRangeLabel = QLabel("Spawn core server on one of these local ports:", self)
self.layout().addWidget(self.portRangeLabel, 4, 0)
self.layout().addWidget(self.portRangeLabel, 5, 0)
hbox = QHBoxLayout()
self.portRangeStart = QSpinBox(self)
self.portRangeStart.setPrefix("from ")
......@@ -76,10 +81,10 @@ class CoreConfigDialog(QDialog):
self.portRangeEnd.setRange(0, 0xFFFF)
self.portRangeEnd.setValue(AwlSimServer.DEFAULT_PORT + 4095)
hbox.addWidget(self.portRangeEnd)
self.layout().addLayout(hbox, 4, 1)
self.layout().addLayout(hbox, 5, 1)
self.closeButton = QPushButton("Close", self)
self.layout().addWidget(self.closeButton, 5, 1)
self.layout().addWidget(self.closeButton, 6, 1)
self.spawnServerCheckBox.stateChanged.connect(self.__spawnStateChanged)
self.closeButton.released.connect(self.accept)
......
......@@ -23,6 +23,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
from awlsim.common.compat import *
from awlsim.gui.util import *
from awlsim.gui.icons import *
class ClockMemSpinBox(QSpinBox):
......@@ -52,36 +53,40 @@ class CpuConfigDialog(QDialog):
self.setLayout(QGridLayout(self))
label = QLabel("Number of accumulator registers", self)
label = QLabel(self)
label.setPixmap(getIcon("prefs").pixmap(QSize(48, 48)))
self.layout().addWidget(label, 0, 0)
label = QLabel("Number of accumulator registers", self)
self.layout().addWidget(label, 1, 0)
self.accuCombo = QComboBox(self)
self.accuCombo.addItem("2 accus", 2)
self.accuCombo.addItem("4 accus", 4)
self.layout().addWidget(self.accuCombo, 0, 1)
self.layout().addWidget(self.accuCombo, 1, 1)
label = QLabel("Clock memory byte", self)
self.layout().addWidget(label, 1, 0)
self.layout().addWidget(label, 2, 0)
self.clockMemSpin = ClockMemSpinBox(self)
self.layout().addWidget(self.clockMemSpin, 1, 1)
self.layout().addWidget(self.clockMemSpin, 2, 1)
label = QLabel("Mnemonics", self)
self.layout().addWidget(label, 2, 0)
self.layout().addWidget(label, 3, 0)
self.mnemonicsCombo = QComboBox(self)
self.mnemonicsCombo.addItem("Automatic", S7CPUSpecs.MNEMONICS_AUTO)
self.mnemonicsCombo.addItem("English", S7CPUSpecs.MNEMONICS_EN)
self.mnemonicsCombo.addItem("German", S7CPUSpecs.MNEMONICS_DE)
self.layout().addWidget(self.mnemonicsCombo, 2, 1)
self.layout().addWidget(self.mnemonicsCombo, 3, 1)
self.obTempCheckBox = QCheckBox("Enable writing of OB TEMP "
"entry-variables", self)
self.layout().addWidget(self.obTempCheckBox, 3, 0, 1, 2)
self.layout().addWidget(self.obTempCheckBox, 4, 0, 1, 2)
self.extInsnsCheckBox = QCheckBox("Enable extended "
"non-standard instructions", self)
self.layout().addWidget(self.extInsnsCheckBox, 4, 0, 1, 2)
self.layout().addWidget(self.extInsnsCheckBox, 5, 0, 1, 2)
self.closeButton = QPushButton("Close", self)
self.layout().addWidget(self.closeButton, 5, 1)
self.layout().addWidget(self.closeButton, 6, 1)
self.closeButton.released.connect(self.accept)
......
......@@ -33,8 +33,11 @@ media-playback-start-4.svg | gnome | GPLv2
media-playback-stop-4.svg | gnome | GPLv2
memory_bits.png | view-calendar-workweek-2.svg | CC-BY-SA 3.0 or LGPL
network-server.svg | oxygen | CC-BY-SA 3.0 or LGPL
network-wired-4.svg | oxygen | CC-BY-SA 3.0 or LGPL
outputs.png | network-server.svg and | CC-BY-SA 3.0 or LGPL
| go-next-7.svg |
pictograms-protections.svg | open_clip_art_library | PD
preferences-system-3.svg | tango | PD
server-database.svg | oxygen | CC-BY-SA 3.0 or LGPL
text-x-source.svg | tango-harm | CC-BY 3.0
view-calendar-workweek-2.svg | oxygen | CC-BY-SA 3.0 or LGPL
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -39,6 +39,9 @@ from awlsim.gui.icons.open import *
from awlsim.gui.icons.save import *
from awlsim.gui.icons.new import *
from awlsim.gui.icons.stdlib import *
from awlsim.gui.icons.prefs import *
from awlsim.gui.icons.network import *
from awlsim.gui.icons.textsource import *
import base64
......@@ -59,6 +62,9 @@ __icons = {
"save" : icon_save,
"new" : icon_new,
"stdlib" : icon_stdlib,
"prefs" : icon_prefs,
"network" : icon_network,
"textsource" : icon_textsource,
}
def getIcon(iconName):
......
# AUTOMATICALLY GENERATED FILE
# DO NOT EDIT
# Generated from network-wired-4.svg
icon_network = b'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAA'\
b'BHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAA'\
b'B9xJREFUaIHVmG9ME2kex78z02k7lFJLcdtyePYqrBstkJx/'\
b'zngkZjG35s6IqXqrb0z0jQlB1BiJutlEvHvjG194ycVEX+Gf'\
b'240bMFFXUZQIJhKWhSCtEIOUtiwtUO0f/pTpv5l9ITPbwgC3'\
b'Cq3+kifzzMwzv+fzfX7Pb55nBvjEjVhm/2RfX98DhmH4mb5I'\
b'kiQJoU4QBAGAEI4zheN5HgB4nue5maNYF87j8fjdoqKi/8qW'\
b'k37btm1yuVz+VVZWFgiCAEEQIElSrOMdfcr5DPmCJRaLIRQK'\
b'vQYAcjkFCDYwMIC6uroUeJIkQVFUSpHJZGKdJMmUQhAEXr9+'\
b'jbq6OgBALBYLp00ASZJYu3btvPelopBcF4yiqDl+lnUKCWY2'\
b'm7FmzRrwPC+Cza7PPgr15OtmsxkmkwmxWCy9ApJNCryhoQG9'\
b'vb1im8rKSuTm5s4rJNnSIkDoeDb4rVu38OTJE/h8PgwPD4vt'\
b'HQ4HCILAlStXUpJ3tr+0CBA6JwgCPM/DZrPBbreDIAg4HA7Y'\
b'7fZ3ILLfUIRo3LhxQ4Q9cODAHCFpESCY0HFXVxeuXbv2G4BM'\
b'lpLAyXlw9epVsd3+/fslo5G2CAhGEIQ42lLrQjIkx3Fz/GRc'\
b'AEmS4qgLa4EgQmjPcZx4TCQSkgIEcWkXoNVqUxas5IUrWUAi'\
b'kUA8HgdJkigqKpIc/YwICIVCoGlaXHllMpl4LrRNho/H43A4'\
b'HB9HBHieT9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2T4ZeAD4FSh8'\
b'Mvy2tkwwAAAAAElFTkSuQmCC'
# AUTOMATICALLY GENERATED FILE
# DO NOT EDIT
# Generated from preferences-system-3.svg
icon_prefs = b'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAA'\
b'BHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAA'\
b'DXtJREFUaIHtWGl0ldW5fr75O/OUhHNC5pMQQshEwg0y1UrR'\
b'C4hVxHpHy629tV5x4AJmxfbe1LWuFkMYApEl1qoUqo0daL00'\
b'A6FK111KkVlGk0ASMpD5HM78zfcHOekxJCFCW//4rvWufc63'\
b'937e53n3u7+zzwa+sq/sK7sj2717N6NpGvFlxb/twNurt1aK'\
b'krBOVVWCodkASRH9iqps2rCu7M2/FLmXtrzx9R+s/+6Hk425'\
b'LQHbqqueTE5K3bRwwSIzACiKAo/Xg7Nnzwher+fC9594qpgg'\
b'CO12sKNWuePtfzGZrC8EQ/7jG57618cmGkfeDrgQlv/3Slsr'\
b'6/f7oSgKJEmC2WTGknuWcnl5BUVVW18Ra2trdbdLvmrX3pfN'\
b'ZtOO2UV5OUlJKas279p7eKKxd1S7VVtfGV523wqL1WojQ6EQ'\
b'CIKAwWCA1+vF+wf2C2UbX+C/MOar+34T75q2JNPtNqvajUUc'\
b'HOgTWy+1dGx8+tszxo6n7kTAwcZDr2RkpX0vJSnVYDQaSUmS'\
b'IIoiHA4HSIJQC0sK9I31B/8wZfI73z7rzs4sTU1NMyiqOvpc'\
b'bzBSFpvZVlJ697LFS5e//0HD+6Fo322VUKxtWPd80qEPD15W'\
b'VRUMwwAAwuEwklNSWUVWnpgKRkXFe+zm6j3eorklOYmJibys'\
b'KDeNCYVCsiyKwz949vGB2OeTCqioqGCnQkCW5FAoHAJFUaAo'\
b'CoqiwGa1wWGz+19+ueKmZY+1zZt/ZrAlKucX3bPIYjIbKUGU'\
b'oaoqVEWBIstQFBmRSBitF1siG59Zs2Ls/EkF2B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ofaDZgQ8/YiEAqB0FhCcCcnTHDhxunlQk5W1V35f1vIF+RMA'\
b'yP98bsOSo58cOe697pFYloUycjdKEARUVYUkSbBZbWGrVZc6'\
b'HkCsGAYA5V5ZeXX1A4scoqzBwFH47KoHoiRDFMIY7m4BxVtA'\
b'6qywmU0IBQJC6+WW1zvqK34EQIlxaaTVYvCpMS0R0xKVWzb9'\
b'YcG8hXlGo4keGBhAJBJBQkICTCYT6hvq2qq375jV0dEhAVCj'\
b'uBRu3A1xAHQAeAC8LWtxIklyhSajjmjv9UOSZMiyDN9gN0Bx'\
b'oPRWUDSPeLsJZz69gI76Hz42Ip4daelxPNofdW6sNx08VJuT'\
b'MyNblER3enoG6XA4AGg4/McmX09395q6uoZrY8Rr1Ajxz4F6'\
b'Wj48gvjiB5OTE60AEAwLECJhRMIhUDorQHJwxlvQ0nzl+nDX'\
b'+c3B7pNXRkhGwaPOxDg95tl4QvimpkNNM7KzpO6urszLbS2G'\
b'1pbms+fPffZETc2u09GViq0eAoApJnOjWeRtqTbXXU8enn9X'\
b'AUtARWevB5Isg6D1MJuM0DQZF0+futDRWPG9kXIRR9rYz1pM'\
b'GUU/R4WObaOitZESiZaiHNPKY59RI6SJGAACACFHrouSb2C/'\
b'j4y/32ox6+PtRnC8HnFWE2QNuHDmU7Gj/oerRojK4wSQR4SM'\
b'Da6NQzJWeKxHsceLoQCQiTFLfFP96pyFdmfxI3tYikmzOmyS'\
b'3x9gI5FIx5UD//0IIEWB1DEB5DGBo/eb1DhlRuDzpYEYkWPF'\
b'xrYaxkyKLmd0SWOdjM99OJ2xJs6U/L3NA5/+MnrUVXFzNmOX'\
b'OFpGE9l45MeKACbBmOwsFFtW1DiBYrMTbUcz85VN0f4fS9Px'\
b'EZpxb88AAAAASUVORK5CYII='
# AUTOMATICALLY GENERATED FILE
# DO NOT EDIT
# Generated from text-x-source.svg
icon_textsource = b'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAA'\
b'BHNCSV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DcHd0dHQD8AMIARAB5S0UAzADIBaNRuc8Ho8P'\
b'C9kqrb9kMxDDo0cu7lzWxccsy3KdnZ+Nj425zzsL8v8QDIdv'\
b'9fUN/L2vb+DM22+/te7cuQt3APgAzGtNqiQsAAMWstMX/uzf'\
b'/4PSlzqHhayYUv4HbDWksKQNpWoAAAAASUVORK5CYII='
......@@ -256,22 +256,22 @@ class MainWindow(QMainWindow):
self.menuBar().addMenu(menu)
menu = QMenu("&Library", self)
menu.addAction("Insert &OB template...", self.insertOB)
menu.addAction("Insert F&C template...", self.insertFC)
menu.addAction("Insert F&B template...", self.insertFB)
menu.addAction("Insert &instance-DB template...", self.insertInstanceDB)
menu.addAction("Insert &DB template...", self.insertGlobalDB)
menu.addAction("Insert &UDT template...", self.insertUDT)
menu.addAction(getIcon("textsource"), "Insert &OB template...", self.insertOB)
menu.addAction(getIcon("textsource"), "Insert F&C template...", self.insertFC)
menu.addAction(getIcon("textsource"), "Insert F&B template...", self.insertFB)
menu.addAction(getIcon("textsource"), "Insert &instance-DB template...", self.insertInstanceDB)
menu.addAction(getIcon("textsource"), "Insert &DB template...", self.insertGlobalDB)
menu.addAction(getIcon("textsource"), "Insert &UDT template...", self.insertUDT)
menu.addSeparator()
menu.addAction("Insert FC C&ALL template...", self.insertFCcall)
menu.addAction("Insert FB CA&LL template...", self.insertFBcall)
menu.addAction(getIcon("textsource"), "Insert FC C&ALL template...", self.insertFCcall)
menu.addAction(getIcon("textsource"), "Insert FB CA&LL template...", self.insertFBcall)
menu.addSeparator()
menu.addAction(getIcon("stdlib"), "&Standard library...", self.openLibrary)
self.menuBar().addMenu(menu)
menu = QMenu("&PLC", self)
menu.addAction("&Server connection...", self.coreConfig)
menu.addAction("&CPU config...", self.cpuConfig)
menu.addAction(getIcon("network"), "&Server connection...", self.coreConfig)
menu.addAction(getIcon("prefs"), "&CPU config...", self.cpuConfig)
self.menuBar().addMenu(menu)
menu = QMenu("&Help", self)
......
......@@ -27,6 +27,7 @@ from awlsim.common.templates import *
from awlsim.gui.util import *
from awlsim.gui.sourcetabs import *
from awlsim.gui.library import *
from awlsim.gui.icons import *
class TemplateDialog(QDialog):
......@@ -39,34 +40,38 @@ class TemplateDialog(QDialog):
self.setWindowTitle("Insert %s template" % verboseBlockName)
label = QLabel(self)
label.setPixmap(getIcon("textsource").pixmap(QSize(48, 48)))
self.layout().addWidget(label, 0, 0)
label = QLabel("Insert %s template." % verboseBlockName, self)
self.layout().addWidget(label, 0, 0, 1, 2)
self.layout().addWidget(label, 1, 0, 1, 2)
label = QLabel("%s number:" % verboseBlockName, self)
self.layout().addWidget(label, 1, 0)
self.layout().addWidget(label, 2, 0)
self.blockNr = QSpinBox(self)
self.blockNr.setMinimum(1)
self.blockNr.setMaximum(0xFFFF)
self.blockNr.setValue(1)
self.blockNr.setPrefix(blockName + " ")
self.layout().addWidget(self.blockNr, 1, 1)
self.layout().addWidget(self.blockNr, 2, 1)
if extra:
label = QLabel("%s number:" % extra, self)
self.layout().addWidget(label, 2, 0)
self.layout().addWidget(label, 3, 0)
self.extraNr = QSpinBox(self)
self.extraNr.setMinimum(1)
self.extraNr.setMaximum(0xFFFF)
self.extraNr.setValue(1)
self.extraNr.setPrefix(extra + " ")
self.layout().addWidget(self.extraNr, 2, 1)
self.layout().addWidget(self.extraNr, 3, 1)
self.verbose = QCheckBox("Generate verbose code", self)
self.verbose.setCheckState(Qt.Checked)
self.layout().addWidget(self.verbose, 3, 0, 1, 2)
self.layout().addWidget(self.verbose, 4, 0, 1, 2)
self.okButton = QPushButton("&Paste code", self)
self.layout().addWidget(self.okButton, 4, 0, 1, 2)
self.layout().addWidget(self.okButton, 5, 0, 1, 2)
self.okButton.released.connect(self.accept)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment