diff --git a/gui_test.py b/gui_test.py index 4bdaaa5..e27e9f8 100644 --- a/gui_test.py +++ b/gui_test.py @@ -92,6 +92,29 @@ class ChangeRobot(juce.Component, juce.Timer): self.updateRobot(self.robots[i]) +class Status(juce.Component, juce.Timer): + backgroundColour = juce.Colours.lightgrey + textColour = juce.Colours.black + + def __init__(self, status): + super().__init__() + juce.Timer.__init__(self) + + self.status = status + + self.statusLabel = juce.Label(self.status()) + self.addAndMakeVisible(self.statusLabel) + + def paint(self, g: juce.Graphics): + g.fillAll(self.backgroundColour) + self.statusLabel.setColour(self.statusLabel.textColourId, self.textColour) + self.statusLabel.setBounds(10, 0, self.getWidth() - 10, 20) + + def timerCallback(self): + # self.setConnectText() + pass + + class RightPanel(juce.Component): def __init__(self, panels): super().__init__() @@ -127,7 +150,9 @@ class MainContentComponent(juce.Component): robotArgs = kwargs.get("robotPanel") robotPanel = ChangeRobot(**robotArgs) - self.rightPanel = RightPanel(panels=[robotPanel]) + statusArgs = kwargs.get("statusPanel") + statusPanel = Status(**statusArgs) + self.rightPanel = RightPanel(panels=[robotPanel, statusPanel]) self.mainPanel = MainPanel() self.addAndMakeVisible(self.rightPanel) diff --git a/main.py b/main.py index 9a7a015..cfa13ca 100644 --- a/main.py +++ b/main.py @@ -22,6 +22,9 @@ class MyApp: "updateRobot": self.updateRobot, "status": self.robot_app.get_status, }, + statusPanel={ + "status": self.robot_app.get_status, + } ) def startRobot(self): diff --git a/poetry.lock b/poetry.lock index d9e0b1d..b49bdca 100644 --- a/poetry.lock +++ b/poetry.lock @@ -104,6 +104,67 @@ repl = ["pymodbus-repl (>=2.0.4)"] serial = ["pyserial (>=3.5)"] simulator = ["aiohttp (>=3.8.6)", "aiohttp (>=3.9.5)"] +[[package]] +name = "pyqt5" +version = "5.15.11" +description = "Python bindings for the Qt cross platform application toolkit" +optional = false +python-versions = ">=3.8" +files = [ + {file = "PyQt5-5.15.11-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:c8b03dd9380bb13c804f0bdb0f4956067f281785b5e12303d529f0462f9afdc2"}, + {file = "PyQt5-5.15.11-cp38-abi3-macosx_11_0_x86_64.whl", hash = "sha256:6cd75628f6e732b1ffcfe709ab833a0716c0445d7aec8046a48d5843352becb6"}, + {file = "PyQt5-5.15.11-cp38-abi3-manylinux_2_17_x86_64.whl", hash = "sha256:cd672a6738d1ae33ef7d9efa8e6cb0a1525ecf53ec86da80a9e1b6ec38c8d0f1"}, + {file = "PyQt5-5.15.11-cp38-abi3-win32.whl", hash = "sha256:76be0322ceda5deecd1708a8d628e698089a1cea80d1a49d242a6d579a40babd"}, + {file = "PyQt5-5.15.11-cp38-abi3-win_amd64.whl", hash = "sha256:bdde598a3bb95022131a5c9ea62e0a96bd6fb28932cc1619fd7ba211531b7517"}, + {file = "PyQt5-5.15.11.tar.gz", hash = "sha256:fda45743ebb4a27b4b1a51c6d8ef455c4c1b5d610c90d2934c7802b5c1557c52"}, +] + +[package.dependencies] +PyQt5-Qt5 = ">=5.15.2,<5.16.0" +PyQt5-sip = ">=12.15,<13" + +[[package]] +name = "pyqt5-qt5" +version = "5.15.15" +description = "The subset of a Qt installation needed by PyQt5." +optional = false +python-versions = "*" +files = [ + {file = "PyQt5_Qt5-5.15.15-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:eb74072935958a830887115b1de1ff26341fc2d5881b28129de39612b10a260e"}, + {file = "PyQt5_Qt5-5.15.15-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f8b174725fbe29c1a22f8acce5798933a65c8a083f1d9833ff212479ec2b3c14"}, + {file = "PyQt5_Qt5-5.15.15-py3-none-manylinux2014_x86_64.whl", hash = "sha256:611505d04ffb06a5e5bcf98f5ff0e4e15ba7785565ccbe7bd3b2e40642ea3bdd"}, +] + +[[package]] +name = "pyqt5-sip" +version = "12.15.0" +description = "The sip module support for PyQt5" +optional = false +python-versions = ">=3.8" +files = [ + {file = "PyQt5_sip-12.15.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:749f7a3ffd6e3d2d5db65ed92c95cbd14490631595c61f0c0672c9238bfb17de"}, + {file = "PyQt5_sip-12.15.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b4adc529fa4ec05728e14ea55194d907cc51f18d6f2ac5cc9f6eb52ac038aa0f"}, + {file = "PyQt5_sip-12.15.0-cp310-cp310-win32.whl", hash = "sha256:83d247cdc43ef224410b14c97413067ea26356dfa39e9ed0fe702a31e25710b0"}, + {file = "PyQt5_sip-12.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:13f0c6a78e781255863e3e160304648efaf62276b7102741af637b63a6e96930"}, + {file = "PyQt5_sip-12.15.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:855563d4d3b59ce7438bbf2dd32fed2707787defa40f3efe94f204a19ef92b25"}, + {file = "PyQt5_sip-12.15.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:0b718a362f4392430903bbb2a4b9bbff9841a16a52f0cfdd5b5bbd9d11457980"}, + {file = "PyQt5_sip-12.15.0-cp311-cp311-win32.whl", hash = "sha256:2575f428de584a12009fd29d00c89df16ed101a3b38beba818dfdcbc4a10709c"}, + {file = "PyQt5_sip-12.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c85be433fbafcb3d417581c0e1b67c8198d23858166e4f938e971c2262c13cdb"}, + {file = "PyQt5_sip-12.15.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:852b75cf208825602480e95ab63314108f872d0da251e9ad3deaaff5a183a6f5"}, + {file = "PyQt5_sip-12.15.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:0cd21c3215e3c47fdd5fa7a2dc3dd1e07a7230b0626e905a7217925068c788b9"}, + {file = "PyQt5_sip-12.15.0-cp312-cp312-win32.whl", hash = "sha256:b58eeedc9b2a3037b136bf96915196c391a33be470ed1c0723d7163ef0b727a2"}, + {file = "PyQt5_sip-12.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:24a1d4937332bf0a38dd95bb2ce4d89723df449f6e912b52ef0e107e11fefac1"}, + {file = "PyQt5_sip-12.15.0-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:91b9538458a3a23e033c213bc879ce64f3d0a33d5a49cbd03e1e584efe307a35"}, + {file = "PyQt5_sip-12.15.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:0c1c727ede7fdc464a1fe2e46109ba836509b2d7187a46fdeae443148ce51d1c"}, + {file = "PyQt5_sip-12.15.0-cp38-cp38-win32.whl", hash = "sha256:dd241de9c569c07bbba62bff1049996e5b52478164f61f430073a87bf6d26d33"}, + {file = "PyQt5_sip-12.15.0-cp38-cp38-win_amd64.whl", hash = "sha256:f600ae6f03e4bff91153c0dc7ebe52f90bd2b6afda58fd580e6990b3b951adc0"}, + {file = "PyQt5_sip-12.15.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c0c543d604116af26694a8a5ba90f510551ff9124d503ae5ee14bb73a61363a3"}, + {file = "PyQt5_sip-12.15.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:97f2d6e8d9b7b3d3e795d576d7f56e6257f524221f6383b33ded7287763e9f06"}, + {file = "PyQt5_sip-12.15.0-cp39-cp39-win32.whl", hash = "sha256:ed5221c6241981bd98d39504823efb9cbe36841bf8917288f8fe8fc1d5569a41"}, + {file = "PyQt5_sip-12.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:7f88c85702dce80ac2e1a162054f688ed394811d6dd03a5574b3fa8111b0a6db"}, + {file = "PyQt5_sip-12.15.0.tar.gz", hash = "sha256:d23fdfcf363b5cedd9d39f8a9c5710e7d52804f5b08a58e91c638b36eafcb702"}, +] + [[package]] name = "tk" version = "0.1.0" @@ -118,4 +179,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "3.10.12" -content-hash = "7bff17d98584d2b65789f0713e4ac29f8948fc013c65a192ab11ef9e3bfcd9d6" +content-hash = "674afa8962f34256e63f5d5af6be94013e2c39e9880191eb3caecc9f70dcf704" diff --git a/pyproject.toml b/pyproject.toml index e9abd16..7cfbcec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ tk = "^0.1.0" pybullet = "^3.2.6" numpy = "^1.20" popsicle = "^0.9.6" +pyqt5 = "^5.15.11" [build-system]