Browse Source

I'm not sure but I'm guessing it has to do with the settings menu?

curiousmuch 7 years ago
parent
commit
2580d1f4fd

+ 0 - 178
IdeasXWorkstationClient.py

@@ -1,178 +0,0 @@
-'''
-Title: IdeasXWorkstationClient Class 
-Author: Tyler Berezowsky 
-Description: 
-'''
-import sys
-import os
-import getopt
-
-try:
-    import paho.mqtt.client as mqtt
-    import paho.mqtt.publish as mqtt_pub
-except ImportError:
-    # This part is only required to run the example from within the examples
-    # directory when the module itself is not installed.
-    #
-    # If you have the module installed, just use "import paho.mqtt.client"
-    import os
-    import inspect
-    cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"../src")))
-    if cmd_subfolder not in sys.path:
-        sys.path.insert(0, cmd_subfolder)
-    import paho.mqtt.client as mqtt
-
-try:     
-    from protocolbuffers import IdeasXMessages_pb2 as IdeasXMessages
-    import IdeasXDatabaseManager 
-except ImportError: 
-    print("The python classes for IdeasX are missing. Try running the Makefile in" +
-            "ideasX-messages.")
-            
-data = []
-
-#------------------------------------------------------------------------------
-# Sniffer Client Class
-
-class IdeasXWorkstationClient(): 
-    def __init__(self):
-        self.command_topic = "/encoder/+/command"
-        self.data_topic = "/encoder/+/data"
-        self.health_topic = "/encoder/+/health"
-        self.mqttdebug = False 
-        self.debug = False
-        
-        self.dmb = IdeasXDatabaseManager.IdeasXDatabaseManager()
-        
-        self._mqttc = mqtt.Client(clean_session=True, userdata=None,
-                protocol='MQTTv311')
-        
-        self._mqttc.message_callback_add(self.health_topic, self.mqtt_on_health)
-        #self._mqttc.message_callback_add(self.data_topic, self.mqtt_on_data)
-        #self._mqttc.message_callback_add(self.command_topic, self.mqtt_on_command)       
-        self._mqttc.on_connect = self.mqtt_on_connect
-        self._mqttc.on_disconnect = self.mqtt_on_disconnect 
-        
-        if self.mqttdebug: 
-            self._mqttc.on_log = self.mqtt_on_log 
-
-#------------------------------------------------------------------------------
-# callback functions
-
-    def mqtt_on_connect(self, mqttc, backend_data, flags, rc): 
-        if rc == 0: 
-            print('Connected to %s: %s' % (mqttc._host, mqttc._port))
-        else: 
-            print('rc: ' + str(rc))
-        print('-'*70)
-
-    def mqtt_on_disconnect(self, mqttc, backend_data, rc):
-        if self.debug: 
-            if rc != 0: 
-                print("Client disconnected and its a mystery why!")
-            else: 
-                print("Client successfully disconnected.") 
-            self.print_line()            
-
-    def mqtt_on_health(self, mqttc, backend_data, msg):
-        '''
-        try: 
-            self.dmb.parseHealthMessage(msg.payload)
-        except: 
-            print("Error: Failure to parse message")
-            if self.debug:
-                print("Raw Message: %s\n" %msg.payload)
-        '''
-        self.dmb.parseHealthMessage(msg.payload)
-        self.print_line()
-        
-
-    def mqtt_on_log(self, mqttc, backend_data, level, string):
-        print(string)
-        self.print_line()
-
-
-#------------------------------------------------------------------------------
-# General API Calls 
-        
-    def startWorkstationClient(self, ip="server.ideasX.tech", port=1883, keepalive=60):     
-        self.ip = ip 
-        self.port = port 
-        self.keepalive = keepalive 
-        self._mqttc.connect(ip, port, keepalive)      # connect to broker
-        #self._mqttc.subscribe(self.command_topic, 2)
-        self._mqttc.subscribe(self.health_topic, 1)
-        #self._mqttc.subscribe(self.data_topic, 2)                              
-        self._mqttc.loop_forever() # need to use blocking loop otherwise python will kill process
-    
-            
-    def print_line(self):
-        print('-'*70)
-        
-
-    
-if __name__ == "__main__": 
-    argv = sys.argv[1:] 
-    wsc = IdeasXWorkstationClient()
-    Host = "ideasx.duckdns.org"
-    Port = 1883 
-    KeepAlive = 30
-    msgFlag = False;     
-    deviceID = None; 
-    cmdPayload = None; 
-    cmdArg = None;
-    
-    try: 
-        opts, args = getopt.getopt(argv, "d:h:k:p:t:c:o:",
-                                  ['device-id','host', 'keepalive',
-                                  'port', 'topic(s)','command', 'payload'])
-    except getopt.GetoptError as s: 
-        sys.exit(2)
-    for opt, arg in opts: 
-        if opt in ("-h", "--host", "--hostname"):
-            Host = arg
-        elif opt in ("-d", "--device-id"):
-            deviceID = arg
-        elif opt in ("-k", "--keepalive"):
-            KeepAlive = arg 
-        elif opt in ("-p", "--port"):
-            Port = arg
-        elif opt in ("-o", "--payload"):
-            cmdPayload = arg.encode('utf-8')
-        elif opt in ("-c", "--command"):
-            msgFlag = True
-            cmdArg = arg
-   
-            
-    if msgFlag:
-        if cmdArg in IdeasXMessages._COMMANDMESSAGE_COMMAND.values_by_name.keys():
-            msg = IdeasXMessages.CommandMessage(); 
-            msg.command = IdeasXMessages.CommandMessage.Command.Value(cmdArg)
-            if cmdPayload != None:
-                msg.payload = cmdPayload
-            if deviceID != None:
-                pubTopic = "/modules/"+deviceID+"/command"
-            else:
-                sys.exit(2)
-#            sc.print_line()                
-#            print("Preparing Message...")
-#            sc.print_line()
-#            print("Device ID: "+str(deviceID))            
-#            sc.print_line()            
-#            print(msg.__str__()[:-1])
-         
-            mqtt_pub.single(topic=pubTopic,
-                        payload=msg.SerializeToString().decode('utf-8'),
-                        retain = False, 
-                        qos=2,
-                        hostname=Host,
-                        port=Port)
-            wsc.print_line()
-            print("Message Sent")
-            wsc.print_line()
-            sys.exit(0)
-        else:
-            sys.exit(2)
-    else:
-        wsc.startWorkstationClient(ip = Host, port = Port, keepalive = KeepAlive)
-     

+ 0 - 346
Qt/ideasxdevice.ui.autosave

@@ -1,346 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>IdeasXDevice</class>
- <widget class="QWidget" name="IdeasXDevice">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>452</width>
-    <height>84</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <property name="minimumSize">
-   <size>
-    <width>452</width>
-    <height>84</height>
-   </size>
-  </property>
-  <property name="maximumSize">
-   <size>
-    <width>16777215</width>
-    <height>84</height>
-   </size>
-  </property>
-  <property name="acceptDrops">
-   <bool>false</bool>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <property name="autoFillBackground">
-   <bool>false</bool>
-  </property>
-  <layout class="QHBoxLayout" name="horizontalLayout">
-   <property name="spacing">
-    <number>0</number>
-   </property>
-   <property name="leftMargin">
-    <number>9</number>
-   </property>
-   <property name="topMargin">
-    <number>3</number>
-   </property>
-   <property name="rightMargin">
-    <number>9</number>
-   </property>
-   <property name="bottomMargin">
-    <number>3</number>
-   </property>
-   <item>
-    <widget class="QWidget" name="widgetInfo" native="true">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Ignored">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>290</width>
-       <height>70</height>
-      </size>
-     </property>
-     <widget class="QLabel" name="labelDeviceType">
-      <property name="geometry">
-       <rect>
-        <x>5</x>
-        <y>0</y>
-        <width>101</width>
-        <height>76</height>
-       </rect>
-      </property>
-      <property name="toolTip">
-       <string extracomment="RSSI: -20 dBm"/>
-      </property>
-      <property name="statusTip">
-       <string/>
-      </property>
-      <property name="pixmap">
-       <pixmap>../icon/devicetype/modulev3b.png</pixmap>
-      </property>
-      <property name="scaledContents">
-       <bool>false</bool>
-      </property>
-     </widget>
-     <widget class="QLabel" name="labelModuleID">
-      <property name="geometry">
-       <rect>
-        <x>119</x>
-        <y>5</y>
-        <width>311</width>
-        <height>36</height>
-       </rect>
-      </property>
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-      <property name="font">
-       <font>
-        <family>TakaoPGothic</family>
-        <pointsize>20</pointsize>
-        <weight>50</weight>
-        <italic>false</italic>
-        <bold>false</bold>
-       </font>
-      </property>
-      <property name="frameShape">
-       <enum>QFrame::NoFrame</enum>
-      </property>
-      <property name="text">
-       <string>Sarah Stanton</string>
-      </property>
-      <property name="scaledContents">
-       <bool>true</bool>
-      </property>
-     </widget>
-     <widget class="QLabel" name="labelSignal">
-      <property name="geometry">
-       <rect>
-        <x>117</x>
-        <y>43</y>
-        <width>31</width>
-        <height>31</height>
-       </rect>
-      </property>
-      <property name="toolTip">
-       <string extracomment="-40 dBm"/>
-      </property>
-      <property name="pixmap">
-       <pixmap>../icon/network/network-wireless-signal-ok-symbolic.png</pixmap>
-      </property>
-      <property name="scaledContents">
-       <bool>false</bool>
-      </property>
-     </widget>
-     <widget class="QLabel" name="labelBattery">
-      <property name="geometry">
-       <rect>
-        <x>157</x>
-        <y>43</y>
-        <width>31</width>
-        <height>31</height>
-       </rect>
-      </property>
-      <property name="toolTip">
-       <string extracomment="50%"/>
-      </property>
-      <property name="statusTip">
-       <string extracomment="50%"/>
-      </property>
-      <property name="pixmap">
-       <pixmap>../icon/battery/battery-good-charging-symbolic.png</pixmap>
-      </property>
-      <property name="scaledContents">
-       <bool>false</bool>
-      </property>
-     </widget>
-     <widget class="QToolButton" name="buttonSwitchOne">
-      <property name="geometry">
-       <rect>
-        <x>197</x>
-        <y>43</y>
-        <width>25</width>
-        <height>31</height>
-       </rect>
-      </property>
-      <property name="inputMethodHints">
-       <set>Qt::ImhNone</set>
-      </property>
-      <property name="text">
-       <string>...</string>
-      </property>
-      <property name="icon">
-       <iconset>
-        <normaloff>../icon/switch/switch-one-enabled.png</normaloff>../icon/switch/switch-one-enabled.png</iconset>
-      </property>
-      <property name="iconSize">
-       <size>
-        <width>30</width>
-        <height>30</height>
-       </size>
-      </property>
-      <property name="autoRaise">
-       <bool>true</bool>
-      </property>
-     </widget>
-     <widget class="QToolButton" name="buttonSwitchTwo">
-      <property name="geometry">
-       <rect>
-        <x>219</x>
-        <y>43</y>
-        <width>21</width>
-        <height>31</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>...</string>
-      </property>
-      <property name="icon">
-       <iconset>
-        <normaloff>../icon/switch/switch-two-enabled.png</normaloff>../icon/switch/switch-two-enabled.png</iconset>
-      </property>
-      <property name="iconSize">
-       <size>
-        <width>30</width>
-        <height>30</height>
-       </size>
-      </property>
-      <property name="autoRaise">
-       <bool>true</bool>
-      </property>
-     </widget>
-     <widget class="QToolButton" name="buttonSwitchAdaptive">
-      <property name="geometry">
-       <rect>
-        <x>238</x>
-        <y>43</y>
-        <width>25</width>
-        <height>31</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>...</string>
-      </property>
-      <property name="icon">
-       <iconset>
-        <normaloff>../icon/switch/switch-adaptive-disabled.png</normaloff>../icon/switch/switch-adaptive-disabled.png</iconset>
-      </property>
-      <property name="iconSize">
-       <size>
-        <width>30</width>
-        <height>30</height>
-       </size>
-      </property>
-      <property name="autoRaise">
-       <bool>true</bool>
-      </property>
-     </widget>
-     <zorder>labelDeviceType</zorder>
-     <zorder>labelSignal</zorder>
-     <zorder>labelBattery</zorder>
-     <zorder>buttonSwitchOne</zorder>
-     <zorder>buttonSwitchTwo</zorder>
-     <zorder>buttonSwitchAdaptive</zorder>
-     <zorder>labelModuleID</zorder>
-    </widget>
-   </item>
-   <item>
-    <widget class="QWidget" name="widgetControls" native="true">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>160</width>
-       <height>75</height>
-      </size>
-     </property>
-     <property name="maximumSize">
-      <size>
-       <width>120</width>
-       <height>66</height>
-      </size>
-     </property>
-     <widget class="QLabel" name="labelStatus">
-      <property name="geometry">
-       <rect>
-        <x>-26</x>
-        <y>44</y>
-        <width>181</width>
-        <height>31</height>
-       </rect>
-      </property>
-      <property name="font">
-       <font>
-        <pointsize>10</pointsize>
-        <italic>true</italic>
-       </font>
-      </property>
-      <property name="text">
-       <string>Last Update: 2:30AM</string>
-      </property>
-      <property name="alignment">
-       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-      </property>
-     </widget>
-     <widget class="QToolButton" name="buttonMenu">
-      <property name="geometry">
-       <rect>
-        <x>131</x>
-        <y>10</y>
-        <width>21</width>
-        <height>36</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>Activate </string>
-      </property>
-      <property name="autoRaise">
-       <bool>false</bool>
-      </property>
-      <property name="arrowType">
-       <enum>Qt::DownArrow</enum>
-      </property>
-     </widget>
-     <widget class="QToolButton" name="buttonActivate">
-      <property name="geometry">
-       <rect>
-        <x>41</x>
-        <y>10</y>
-        <width>91</width>
-        <height>36</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>Activate</string>
-      </property>
-      <property name="checkable">
-       <bool>true</bool>
-      </property>
-      <property name="popupMode">
-       <enum>QToolButton::DelayedPopup</enum>
-      </property>
-      <property name="toolButtonStyle">
-       <enum>Qt::ToolButtonTextOnly</enum>
-      </property>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 0
protocolbuffers/IdeasXMessages_pb2.py → ideasxprotobuff/IdeasXMessages_pb2.py


+ 0 - 0
IdeasXWSCBackend.py → ideasxwscbackend/py.py


+ 0 - 0
devicedialog.py → pyqt/devicedialog.py


+ 0 - 0
encoderconfigurationdialog.py → pyqt/encoderconfigurationdialog.py


+ 0 - 0
ideasxdevice.py → pyqt/ideasxdevice.py


+ 0 - 0
mainwindow.py → pyqt/mainwindow.py


+ 0 - 0
mainwindow2.py → pyqt/mainwindow2.py


+ 0 - 0
Qt/about.ui → qt/about.ui


+ 19 - 0
qt/adaptiveswitchconfigdialog.ui

@@ -0,0 +1,19 @@
+<ui version="4.0" >
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Dialog</string>
+  </property>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
+

+ 0 - 0
Qt/devicedialog.ui → qt/devicedialog.ui


+ 0 - 0
Qt/encoderconfigurationdialog.ui → qt/encoderconfigurationdialog.ui


+ 0 - 0
Qt/ideasxdevice.ui → qt/ideasxdevice.ui


+ 0 - 0
Qt/mainwindow.ui → qt/mainwindow.ui


+ 0 - 0
Qt/mainwindow.ui.autosave → qt/mainwindow.ui.autosave


+ 0 - 1
start.sh

@@ -1 +0,0 @@
-python3 /home/tyler/ideasX-repositories/ideasX-workstation-client-v2/IdeasXWSCView.py

+ 0 - 8
wsc.desktop

@@ -1,8 +0,0 @@
-[Desktop Entry]
-Name=IdeasX Workstation Client
-Comment=
-Path=/home/tyler/ideasX-repositories/ideasX-workstation-client-v2/
-Exec=/home/tyler/ideasX-repositories/ideasX-workstation-client-v2/start.sh
-Icon=/home/tyler/ideasX-repositories/ideasX-workstation-client-v2/icon/logo/ideasx.png
-Terminal=false
-Type=Application