24 changed files with 290 additions and 292565 deletions
@ -0,0 +1,114 @@
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> |
||||
<storageModule moduleId="org.eclipse.cdt.core.settings"> |
||||
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.debug.1405866861"> |
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.debug.1405866861" moduleId="org.eclipse.cdt.core.settings" name="Debug"> |
||||
<externalSettings/> |
||||
<extensions> |
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> |
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> |
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
||||
</extensions> |
||||
</storageModule> |
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.debug.1405866861" name="Debug" parent="cdt.managedbuild.config.gnu.cross.exe.debug"> |
||||
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.1405866861." name="/" resourcePath=""> |
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.1644046727" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug"> |
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1303766094" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/> |
||||
<builder buildPath="${workspace_loc:/Web4Rail}/Debug" id="cdt.managedbuild.builder.gnu.cross.672807853" managedBuildOn="true" name="Gnu Make Builder.Debug" superClass="cdt.managedbuild.builder.gnu.cross"/> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.694485957" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler"> |
||||
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1374057072" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/> |
||||
<option id="gnu.c.compiler.option.debugging.level.918458422" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/> |
||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1047272473" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> |
||||
</tool> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.712082266" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler"> |
||||
<option id="gnu.cpp.compiler.option.optimization.level.1000432263" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> |
||||
<option id="gnu.cpp.compiler.option.debugging.level.1101437688" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> |
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1451312963" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> |
||||
</tool> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.69818503" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.589676943" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker"> |
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.561428176" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> |
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> |
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/> |
||||
</inputType> |
||||
</tool> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.1740643252" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1601436733" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler"> |
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.248950993" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> |
||||
</tool> |
||||
</toolChain> |
||||
</folderInfo> |
||||
</configuration> |
||||
</storageModule> |
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> |
||||
</cconfiguration> |
||||
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.release.508243853"> |
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.release.508243853" moduleId="org.eclipse.cdt.core.settings" name="Release"> |
||||
<externalSettings/> |
||||
<extensions> |
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> |
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> |
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
||||
</extensions> |
||||
</storageModule> |
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.release.508243853" name="Release" parent="cdt.managedbuild.config.gnu.cross.exe.release"> |
||||
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.release.508243853." name="/" resourcePath=""> |
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.release.656568956" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.release"> |
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1320265402" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/> |
||||
<builder buildPath="${workspace_loc:/Web4Rail}/Release" id="cdt.managedbuild.builder.gnu.cross.901795139" managedBuildOn="true" name="Gnu Make Builder.Release" superClass="cdt.managedbuild.builder.gnu.cross"/> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1625123960" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler"> |
||||
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.683944520" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/> |
||||
<option id="gnu.c.compiler.option.debugging.level.195702395" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/> |
||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.621693658" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> |
||||
</tool> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.964533540" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler"> |
||||
<option id="gnu.cpp.compiler.option.optimization.level.595512828" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> |
||||
<option id="gnu.cpp.compiler.option.debugging.level.1810402969" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/> |
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1870972976" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> |
||||
</tool> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.2023937626" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1050043689" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker"> |
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1373475507" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> |
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> |
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/> |
||||
</inputType> |
||||
</tool> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.959963102" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/> |
||||
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.685015797" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler"> |
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1734534501" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> |
||||
</tool> |
||||
</toolChain> |
||||
</folderInfo> |
||||
</configuration> |
||||
</storageModule> |
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> |
||||
</cconfiguration> |
||||
</storageModule> |
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
||||
<project id="Web4Rail.cdt.managedbuild.target.gnu.cross.exe.1280646856" name="Executable" projectType="cdt.managedbuild.target.gnu.cross.exe"/> |
||||
</storageModule> |
||||
<storageModule moduleId="scannerConfiguration"> |
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> |
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1405866861;cdt.managedbuild.config.gnu.cross.exe.debug.1405866861.;cdt.managedbuild.tool.gnu.cross.c.compiler.694485957;cdt.managedbuild.tool.gnu.c.compiler.input.1047272473"> |
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> |
||||
</scannerConfigBuildInfo> |
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.508243853;cdt.managedbuild.config.gnu.cross.exe.release.508243853.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.964533540;cdt.managedbuild.tool.gnu.cpp.compiler.input.1870972976"> |
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> |
||||
</scannerConfigBuildInfo> |
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1405866861;cdt.managedbuild.config.gnu.cross.exe.debug.1405866861.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.712082266;cdt.managedbuild.tool.gnu.cpp.compiler.input.1451312963"> |
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> |
||||
</scannerConfigBuildInfo> |
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.508243853;cdt.managedbuild.config.gnu.cross.exe.release.508243853.;cdt.managedbuild.tool.gnu.cross.c.compiler.1625123960;cdt.managedbuild.tool.gnu.c.compiler.input.621693658"> |
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> |
||||
</scannerConfigBuildInfo> |
||||
</storageModule> |
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> |
||||
</cproject> |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE UserProject SYSTEM "UserProject-4.0.dtd"> |
||||
<!-- eric6 user project file for project Web4Rail --> |
||||
<!-- Saved: 2018-03-23, 10:04:21 --> |
||||
<!-- Copyright (C) 2018 Stephan Richter, s.richter@keawe.de --> |
||||
<UserProject version="4.0"/> |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE Tasks SYSTEM "Tasks-5.1.dtd"> |
||||
<!-- eric6 tasks file for project Web4Rail --> |
||||
<!-- Saved: 2018-03-23, 10:04:21 --> |
||||
<Tasks version="5.1"> |
||||
<ProjectScanFilter></ProjectScanFilter> |
||||
</Tasks> |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>Web4Rail</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> |
||||
<triggers>clean,full,incremental,</triggers> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
<buildCommand> |
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> |
||||
<triggers>full,incremental,</triggers> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.eclipse.cdt.core.cnature</nature> |
||||
<nature>org.eclipse.cdt.core.ccnature</nature> |
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> |
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> |
||||
</natures> |
||||
</projectDescription> |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<project> |
||||
<configuration id="cdt.managedbuild.config.gnu.cross.exe.debug.1405866861" name="Debug"> |
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> |
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> |
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> |
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> |
||||
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1044391501587018433" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> |
||||
<language-scope id="org.eclipse.cdt.core.gcc"/> |
||||
<language-scope id="org.eclipse.cdt.core.g++"/> |
||||
</provider> |
||||
</extension> |
||||
</configuration> |
||||
<configuration id="cdt.managedbuild.config.gnu.cross.exe.release.508243853" name="Release"> |
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> |
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> |
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> |
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> |
||||
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1044391501587018433" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> |
||||
<language-scope id="org.eclipse.cdt.core.gcc"/> |
||||
<language-scope id="org.eclipse.cdt.core.g++"/> |
||||
</provider> |
||||
</extension> |
||||
</configuration> |
||||
</project> |
Binary file not shown.
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE Project SYSTEM "Project-5.1.dtd"> |
||||
<!-- eric project file for project Web4Rail --> |
||||
<!-- Saved: 2018-03-23, 10:01:18 --> |
||||
<!-- Copyright (C) 2018 Stephan Richter, s.richter@keawe.de --> |
||||
<Project version="5.1"> |
||||
<Language>en_US</Language> |
||||
<Hash>592977616a6db25bc13c494da577efc597388eed</Hash> |
||||
<ProgLanguage mixed="0">Python3</ProgLanguage> |
||||
<ProjectType>PyQt5</ProjectType> |
||||
<Description></Description> |
||||
<Version>0.1</Version> |
||||
<Author>Stephan Richter</Author> |
||||
<Email>s.richter@keawe.de</Email> |
||||
<Sources> |
||||
<Source>src/web4rail.client.py</Source> |
||||
<Source>src/ConnectDialog.py</Source> |
||||
<Source>src/__init__.py</Source> |
||||
<Source>src/TrackPlan.py</Source> |
||||
<Source>src/web4rail.server.py</Source> |
||||
<Source>src/TileSelector.py</Source> |
||||
<Source>src/YesNoDialog.py</Source> |
||||
<Source>src/Tiles.py</Source> |
||||
<Source>src/server.py</Source> |
||||
<Source>src/FileDialog.py</Source> |
||||
<Source>__init__.py</Source> |
||||
</Sources> |
||||
<Forms/> |
||||
<Translations/> |
||||
<Resources/> |
||||
<Interfaces/> |
||||
<Others/> |
||||
<MainScript>src/web4rail.client.py</MainScript> |
||||
<Vcs> |
||||
<VcsType>None</VcsType> |
||||
</Vcs> |
||||
<FiletypeAssociations> |
||||
<FiletypeAssociation pattern="*.idl" type="INTERFACES"/> |
||||
<FiletypeAssociation pattern="*.py" type="SOURCES"/> |
||||
<FiletypeAssociation pattern="*.py3" type="SOURCES"/> |
||||
<FiletypeAssociation pattern="*.pyw" type="SOURCES"/> |
||||
<FiletypeAssociation pattern="*.pyw3" type="SOURCES"/> |
||||
<FiletypeAssociation pattern="*.qm" type="TRANSLATIONS"/> |
||||
<FiletypeAssociation pattern="*.qrc" type="RESOURCES"/> |
||||
<FiletypeAssociation pattern="*.ts" type="TRANSLATIONS"/> |
||||
<FiletypeAssociation pattern="*.ui" type="FORMS"/> |
||||
</FiletypeAssociations> |
||||
</Project> |
@ -1,4 +1,4 @@
@@ -1,4 +1,4 @@
|
||||
# Dateiaufbau für Anlagenplan: |
||||
|
||||
plan.layout: Textdatei mit Einbuchstabencodes für Tiles, siehe tiles.dia |
||||
plan.config: Textdatei im Format `xxx yyy block-num config-string` |
||||
`plan.layout`: Textdatei mit Einbuchstabencodes für Tiles, siehe tiles.dia |
||||
`plan.config`: Textdatei im Format `xxx yyy block-num config-string` |
||||
|
@ -1,52 +0,0 @@
@@ -1,52 +0,0 @@
|
||||
#!/usr/bin/python |
||||
import gi |
||||
gi.require_version('Gtk', '3.0') |
||||
from gi.repository import Gtk |
||||
|
||||
|
||||
class ConnectDialog(Gtk.Window): |
||||
|
||||
host = None |
||||
port = None |
||||
|
||||
def __init__(self): |
||||
Gtk.Window.__init__(self, title="Connect to server") |
||||
self.connect("delete-event", Gtk.main_quit) |
||||
|
||||
grid = Gtk.Grid() |
||||
self.add(grid) |
||||
|
||||
self.host_label = Gtk.Label('Hostname or IP') |
||||
|
||||
self.host_input = Gtk.Entry() |
||||
self.host_input.set_text('localhost') |
||||
|
||||
self.port_label = Gtk.Label('Port') |
||||
self.port_input = Gtk.Entry() |
||||
self.port_input.set_text('7668') |
||||
|
||||
self.connect_btn = Gtk.Button(label="Connect") |
||||
self.connect_btn.connect("clicked", self.finish) |
||||
|
||||
self.abort_btn = Gtk.Button(label="Abort") |
||||
self.abort_btn.connect("clicked", self.abort) |
||||
|
||||
grid.attach(self.host_label, 0, 0, 1, 1) |
||||
grid.attach(self.host_input, 1, 0, 1, 1) |
||||
grid.attach(self.port_label, 0, 1, 1, 1) |
||||
grid.attach(self.port_input, 1, 1, 1, 1) |
||||
grid.attach(self.abort_btn, 0, 2, 1, 1) |
||||
grid.attach(self.connect_btn, 1, 2, 1, 1) |
||||
|
||||
def abort(self, widget): |
||||
Gtk.main_quit() |
||||
|
||||
def run(self): |
||||
self.show_all() |
||||
Gtk.main() |
||||
|
||||
def finish(self, widget): |
||||
self.host = self.host_input.get_text() |
||||
self.port = int(self.port_input.get_text()) |
||||
self.hide() |
||||
Gtk.main_quit() |
@ -1,52 +0,0 @@
@@ -1,52 +0,0 @@
|
||||
#!/usr/bin/python |
||||
import gi |
||||
gi.require_version('Gtk', '3.0') |
||||
from gi.repository import Gtk |
||||
|
||||
class FileDialog(Gtk.Window): |
||||
|
||||
def __init__(self,title,hint): |
||||
Gtk.Window.__init__(self, title=title) |
||||
self.connect("delete-event", Gtk.main_quit) |
||||
|
||||
self.hint = Gtk.Label(hint); |
||||
self.dir_grid = Gtk.Grid() |
||||
self.dir_input = Gtk.Entry(); |
||||
self.new_btn = Gtk.Button('Create') |
||||
self.new_btn.connect('clicked',self.new_btn_clck) |
||||
|
||||
self.y = 0 |
||||
|
||||
|
||||
def add_dir(self,name): |
||||
btn = Gtk.Button(label=name) |
||||
btn.connect("clicked",self.select_dir) |
||||
self.dir_grid.attach(btn,0,self.y,1,1) |
||||
self.y+=1 |
||||
|
||||
def new_btn_clck(self,widget): |
||||
self.dir = self.dir_input.get_text() |
||||
self.hide() |
||||
Gtk.main_quit() |
||||
|
||||
def run(self): |
||||
scroll = Gtk.ScrolledWindow(hexpand=True, vexpand=True) |
||||
|
||||
|
||||
grid = Gtk.Grid() |
||||
scroll.add(self.dir_grid) |
||||
|
||||
grid.attach(self.hint, 0,0,2,1) |
||||
grid.attach(scroll, 0,1,2,1) |
||||
grid.attach(self.dir_input, 0,2,1,1) |
||||
grid.attach(self.new_btn, 1,2,1,1) |
||||
|
||||
self.add(grid) |
||||
self.set_size_request( 300, 900) |
||||
self.show_all() |
||||
Gtk.main() |
||||
|
||||
def select_dir(self,widget): |
||||
self.dir = widget.get_label() |
||||
self.hide() |
||||
Gtk.main_quit() |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*- |
||||
import gtk |
||||
|
||||
|
||||
class Plan(): |
||||
def load(self,filename): |
||||
file = open(filename,'r') |
||||
lines = file.readlines() |
||||
print(lines) |
||||
|
||||
|
||||
dialog = gtk.FileChooserDialog("Open...", |
||||
None, |
||||
gtk.FILE_CHOOSER_ACTION_OPEN, |
||||
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK)) |
||||
|
||||
response = dialog.run(); |
||||
|
||||
if response == gtk.RESPONSE_OK: |
||||
plan = Plan(); |
||||
plan.load(dialog.get_filename()) |
||||
dialog.destroy() |
@ -1,63 +0,0 @@
@@ -1,63 +0,0 @@
|
||||
#!/usr/bin/python |
||||
import gi |
||||
gi.require_version('Gtk', '3.0') |
||||
from gi.repository import Gtk |
||||
from Tiles import * |
||||
|
||||
class TileSelector(Gtk.Window): |
||||
def __init__(self,connection): |
||||
Gtk.Window.__init__(self) |
||||
self.connect("destroy", Gtk.main_quit) |
||||
|
||||
self.grid = Gtk.Grid() |
||||
|
||||
x0=0 |
||||
x1=0 |
||||
x2=0 |
||||
|
||||
if connection in {Tile.LEFT,Tile.RIGHT,None}: |
||||
self.add_tile(StraightH,x0,0) |
||||
x0+=1 |
||||
|
||||
if connection in {Tile.TOP,Tile.BOTTOM,None}: |
||||
self.add_tile(StraightV,x0,0) |
||||
x0+=1 |
||||
|
||||
if connection in {Tile.TOP,Tile.LEFT,None}: |
||||
self.add_tile(Diag_TL,x1,1) |
||||
x1+=1 |
||||
|
||||
if connection in {Tile.TOP,Tile.RIGHT,None}: |
||||
self.add_tile(Diag_TR,x1,1) |
||||
x1+=1 |
||||
|
||||
if connection in {Tile.BOTTOM,Tile.RIGHT,None}: |
||||
self.add_tile(Diag_BR,x1,1) |
||||
x1+=1 |
||||
|
||||
if connection in {Tile.BOTTOM,Tile.LEFT,None}: |
||||
self.add_tile(Diag_BL,x1,1) |
||||
x1+=1 |
||||
|
||||
if connection in {Tile.BOTTOM,Tile.LEFT,Tile.RIGHT,None}: |
||||
self.add_tile(TO_BRL,0,2) |
||||
self.add_tile(TO_BLR,1,2) |
||||
|
||||
if connection in {Tile.TOP,Tile.LEFT,Tile.RIGHT,None}: |
||||
self.add_tile(TO_TRL,0,3) |
||||
self.add_tile(TO_TLR,1,3) |
||||
|
||||
self.add(self.grid) |
||||
|
||||
self.show_all() |
||||
Gtk.main() |
||||
|
||||
def add_tile(self,tile_class,x,y): |
||||
tile = tile_class() |
||||
tile.connect('button-press-event',self.select) |
||||
self.grid.attach(tile,x,y,1,1) |
||||
|
||||
def select(self,btn,evt): |
||||
self.tile = btn.__class__ |
||||
self.hide() |
||||
Gtk.main_quit() |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
# -*- coding: utf-8 -*- |
||||
|
||||
class Tile(): |
||||
def x(self): |
||||
raise NotImplementedError('Tile.x') |
||||
|
||||
def y(self): |
||||
raise NotImplementedError('Tile.x') |
@ -1,87 +0,0 @@
@@ -1,87 +0,0 @@
|
||||
#!/usr/bin/python |
||||
import gi |
||||
gi.require_version('Gtk', '3.0') |
||||
from gi.repository import Gtk |
||||
from TileSelector import * |
||||
import os |
||||
|
||||
def dump_obj(obj, key='', level = 0): |
||||
for key, value in obj.__dict__.items(): |
||||
if isinstance(value, (int, float, str, unicode, list, dict, set)): |
||||
print(" " * level + "%s -> %s" % (key, value)) |
||||
else: |
||||
print(" " * level + "%s -> %s:" % (key, value.__class__.__name__)) |
||||
dump_obj(value, key, level + 2) |
||||
|
||||
class TrackPlan(Gtk.Window): |
||||
def __init__(self,json,server_sock): |
||||
Gtk.Window.__init__(self) |
||||
|
||||
print(json) |
||||
self.server_sock = server_sock |
||||
self.connect("delete-event", Gtk.main_quit) |
||||
self.grid = Gtk.Grid() |
||||
self.putButton(0,0,None,None) |
||||
self.add(self.grid) |
||||
|
||||
def select_tile(self,widget,origin,connection): |
||||
#print 'Button at ({},{}) pressed'.format(widget.x, widget.y) |
||||
tileSelector = TileSelector(connection) |
||||
tile = tileSelector.tile() |
||||
if origin != None: |
||||
if connection == Tile.TOP: |
||||
origin.bottom = tile |
||||
if connection == Tile.RIGHT: |
||||
origin.left = tile |
||||
if connection == Tile.BOTTOM: |
||||
origin.top = tile |
||||
if connection == Tile.LEFT: |
||||
origin.right = tile |
||||
self.putTile(tile,widget.x,widget.y) |
||||
widget.destroy() |
||||
|
||||
def putButton(self,x,y,origin,connection): |
||||
#print 'putButton({},{})'.format(x,y) |
||||
btn = Gtk.Button('?') |
||||
btn.x = x |
||||
btn.y = y |
||||
btn.connect('clicked',self.select_tile,origin,connection) |
||||
self.grid.attach(btn,x,y,1,1) |
||||
btn.show() |
||||
|
||||
def putTile(self,tile,x,y): |
||||
#print 'putTile({},{})'.format(x,y) |
||||
tile.x = x |
||||
tile.y = y |
||||
self.grid.attach(tile,x,y,1,1) |
||||
tile.show() |
||||
|
||||
if tile.connects_left(): |
||||
left = self.grid.get_child_at(x-1,y) |
||||
if left == None: |
||||
self.putButton(x-1,y,tile,Tile.RIGHT) |
||||
if tile.connects_right(): |
||||
right = self.grid.get_child_at(x+1,y) |
||||
if right == None: |
||||
self.putButton(x+1,y,tile,Tile.LEFT) |
||||
if tile.connects_up(): |
||||
top = self.grid.get_child_at(x,y-1) |
||||
if top == None: |
||||
self.putButton(x,y-1,tile,Tile.BOTTOM) |
||||
if tile.connects_down(): |
||||
bottom = self.grid.get_child_at(x,y+1) |
||||
if bottom == None: |
||||
self.putButton(x,y+1,tile,Tile.TOP) |
||||
|
||||
self.save() |
||||
|
||||
def run(self): |
||||
self.show_all() |
||||
Gtk.main() |
||||
|
||||
def save(self): |
||||
seed_tile = self.grid.get_child_at(0,0) |
||||
os.system('clear') |
||||
self.server_sock.send('UPDATE PLAN') |
||||
self.server_sock.send(seed_tile.json()) |
||||
print('Sent plan') |
@ -1,32 +0,0 @@
@@ -1,32 +0,0 @@
|
||||
#!/usr/bin/python |
||||
import gi |
||||
gi.require_version('Gtk', '3.0') |
||||
from gi.repository import Gtk |
||||
|
||||
class YesNoDialog(Gtk.Window): |
||||
def __init__(self,question): |
||||
Gtk.Window.__init__(self) |
||||
self.connect("delete-event", Gtk.main_quit) |
||||
|
||||
grid = Gtk.Grid() |
||||
|
||||
question = Gtk.Label(question); |
||||
yes = Gtk.Button('Yes') |
||||
yes.connect('clicked',self.evaluate) |
||||
no = Gtk.Button('No') |
||||
no.connect('clicked',self.evaluate) |
||||
|
||||
grid.attach(question,0,0,2,1) |
||||
grid.attach(yes,0,1,1,1) |
||||
grid.attach(no,1,1,1,1) |
||||
self.add(grid) |
||||
|
||||
self.answer = None |
||||
|
||||
self.show_all() |
||||
Gtk.main() |
||||
|
||||
def evaluate(self,widget): |
||||
self.answer=widget.get_label() == 'Yes' |
||||
self.hide() |
||||
Gtk.main_quit() |
@ -1,59 +0,0 @@
@@ -1,59 +0,0 @@
|
||||
''' |
||||
Simple socket server using threads |
||||
''' |
||||
|
||||
import socket |
||||
import sys |
||||
from thread import * |
||||
|
||||
HOST = '' # Symbolic name meaning all available interfaces |
||||
PORT = 8888 # Arbitrary non-privileged port |
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
||||
print 'Socket created' |
||||
|
||||
#Bind socket to local host and port |
||||
try: |
||||
s.bind((HOST, PORT)) |
||||
except socket.error as msg: |
||||
print 'Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1] |
||||
sys.exit() |
||||
|
||||
print 'Socket bind complete' |
||||
|
||||
#Start listening on socket |
||||
s.listen(10) |
||||
print 'Socket now listening' |
||||
|
||||
#Function for handling connections. This will be used to create threads |
||||
def clientthread(conn): |
||||
#Sending message to connected client |
||||
conn.send('Welcome to the server. Type something and hit enter\n') #send only takes string |
||||
|
||||
#infinite loop so that function do not terminate and thread do not end. |
||||
while True: |
||||
|
||||
#Receiving from client |
||||
data = conn.recv(1024).strip() |
||||
if data == 'exit': |
||||
conn.sendall('Bye!') |
||||
break |
||||
reply = 'OK...' + data |
||||
if not data: |
||||
break |
||||
|
||||
conn.sendall(reply) |
||||
|
||||
#came out of loop |
||||
conn.close() |
||||
|
||||
#now keep talking with the client |
||||
while 1: |
||||
#wait to accept a connection - blocking call |
||||
conn, addr = s.accept() |
||||
print 'Connected with ' + addr[0] + ':' + str(addr[1]) |
||||
|
||||
#start new thread takes 1st argument as a function name to be run, second is the tuple of arguments to the function. |
||||
start_new_thread(clientthread ,(conn,)) |
||||
|
||||
s.close() |
@ -1,72 +0,0 @@
@@ -1,72 +0,0 @@
|
||||
#!/usr/bin/python |
||||
import socket |
||||
from ConnectDialog import * |
||||
from FileDialog import * |
||||
from TrackPlan import * |
||||
from YesNoDialog import * |
||||
|
||||
|
||||
def readline(socket): |
||||
buff = socket.recv(4096) |
||||
buffering = True |
||||
while buffering: |
||||
if "\n" in buff: |
||||
(line, buff) = buff.split("\n", 1) |
||||
yield line |
||||
else: |
||||
more = socket.recv(4096) |
||||
if not more: |
||||
buffering = False |
||||
else: |
||||
buff += more |
||||
if buff: |
||||
yield buff |
||||
|
||||
print ('starting') |
||||
conn_dlg = ConnectDialog() |
||||
conn_dlg.run() |
||||
|
||||
if conn_dlg.port is not None: |
||||
client_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
||||
client_sock.connect((conn_dlg.host, conn_dlg.port)) |
||||
client = readline(client_sock) |
||||
current_dir = '' |
||||
|
||||
while True: |
||||
line = client.next() |
||||
|
||||
if line.startswith('current dir'): |
||||
current_dir = line |
||||
continue |
||||
|
||||
if line.startswith('select one'): |
||||
file_dialog = FileDialog(line, current_dir) |
||||
while True: |
||||
line = client.next() |
||||
if line.startswith('--'): |
||||
break |
||||
file_dialog.add_dir(line.strip()) |
||||
file_dialog.run() |
||||
|
||||
client_sock.send(file_dialog.dir + "\n") |
||||
continue |
||||
|
||||
if line == 'PLAN:': |
||||
json = client.next() |
||||
plan = TrackPlan(json, client_sock) |
||||
plan.run() |
||||
client_sock.send('EXIT') |
||||
break |
||||
continue |
||||
|
||||
if 'does not exist. Create' in line: |
||||
directory = line.split('does not exist')[0].strip() |
||||
dialog = YesNoDialog(line) |
||||
if dialog.answer: |
||||
client_sock.send("yes\n") |
||||
else: |
||||
client_sock.send("no\n") |
||||
continue |
||||
|
||||
print(line) |
||||
print "Test" |
@ -1,107 +0,0 @@
@@ -1,107 +0,0 @@
|
||||
#!/usr/bin/python |
||||
|
||||
import socket |
||||
import sys |
||||
import os |
||||
from thread import * |
||||
|
||||
class web4rail_server: |
||||
system = None |
||||
halt = False |
||||
|
||||
def __init__(self, port): |
||||
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
||||
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) |
||||
print('Socket created.') |
||||
|
||||
try: |
||||
self.socket.bind(('', port)) |
||||
except socket.error as msg: |
||||
print('Bind failed. Error (' + str(msg[0]) + '): ' + str(msg[1])) |
||||
sys.exit(-1) |
||||
|
||||
print('Bound to socket at port ' + str(port)) |
||||
|
||||
def client(self, conn): |
||||
if self.system is None: |
||||
self.system = self.select_system(conn) |
||||
self.load_system(conn) |
||||
while True: |
||||
response = conn.recv(1024).strip() |
||||
if response == 'UPDATE PLAN': |
||||
self.update_plan(conn) |
||||
elif response == 'EXIT': |
||||
break |
||||
else: |
||||
print(response) |
||||
os._exit(0) |
||||
|
||||
# creates a new json file at the selected dir |
||||
def create_system(self, path): |
||||
print('creating new system at ' + path) |
||||
os.mkdir(path, 0o755) |
||||
json_file = open(path + '/plan.json', 'w+') |
||||
json_file.close() |
||||
|
||||
def load_system(self, conn): |
||||
print('loading system from ' + self.system) |
||||
with open(self.system + '/plan.json', 'r') as plan_file: |
||||
plan = plan_file.read() |
||||
conn.send("PLAN:\n") |
||||
conn.send(plan + "\n") |
||||
|
||||
def select_system(self, conn): |
||||
path = '/home/srichter/workspace/Web4Rail/' |
||||
conn.send("Welcome to the Web2Rail server. Please select a SYSTEM first:\n") |
||||
while True: |
||||
conn.send('current dir: ' + path + "\n") |
||||
contents = sorted(os.listdir(path)) |
||||
|
||||
conn.send("select one from\n") |
||||
for entry in contents: |
||||
conn.send(' ' + entry + "\n") |
||||
conn.send("--\n") |
||||
entry = conn.recv(1024).strip() |
||||
if entry in contents: |
||||
if os.path.isfile(path + entry): |
||||
break |
||||
path += entry + '/' |
||||
else: |
||||
conn.send(path + entry + ' does not exist. Create (yes/no/abort)?\n') |
||||
response = conn.recv(1024).strip() |
||||
if response == 'yes': |
||||
path += entry |
||||
self.create_system(path) |
||||
break |
||||
if response == 'abort': |
||||
path = None |
||||
break |
||||
path = '/' |
||||
|
||||
if path is None: |
||||
return |
||||
|
||||
return path |
||||
|
||||
def start(self): |
||||
self.socket.listen(10) |
||||
print('Server started.') |
||||
|
||||
while True: |
||||
conn, add = self.socket.accept() |
||||
start_new_thread(self.client, (conn,)) |
||||
print('Closing server') |
||||
|
||||
def update_plan(self,conn): |
||||
json = conn.recv(32768).strip() |
||||
json_file = open(self.system + '/plan.json', 'w') |
||||
json_file.write(json) |
||||
json_file.close() |
||||
|
||||
if len(sys.argv) == 2: |
||||
port = int(sys.argv[1]) |
||||
else: |
||||
port = 7668 |
||||
|
||||
server = web4rail_server(port) |
||||
server.start() |
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
{ |
||||
"mainFile": "src/web4rail.client.py", |
||||
"use-tabs": false, |
||||
"venv": "", |
||||
"relatedProjects": [], |
||||
"name": "Web4Rail", |
||||
"license": "GNU General Public License v3", |
||||
"url": "", |
||||
"pythonPath": "python", |
||||
"preExecScript": "", |
||||
"additional_builtins": [], |
||||
"programParams": "", |
||||
"indentation": 4, |
||||
"PYTHONPATH": "", |
||||
"supported-extensions": [ |
||||
".py", |
||||
".html", |
||||
".jpg", |
||||
".png", |
||||
".ui", |
||||
".css", |
||||
".json", |
||||
".js", |
||||
".ini" |
||||
], |
||||
"project-type": "Import from sources", |
||||
"postExecScript": "", |
||||
"description": "Model Rail Control Application" |
||||
} |
Loading…
Reference in new issue