diff options
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | Cura/gui/printWindow.py | 12 | ||||
m--------- | Cura/util/Power | 0 | ||||
-rw-r--r-- | Cura/util/__init__.py | 7 |
4 files changed, 22 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..be8ca409c0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Cura/util/Power"] + path = Cura/util/Power + url = git://github.com/GreatFruitOmsk/Power.git diff --git a/Cura/gui/printWindow.py b/Cura/gui/printWindow.py index 646992d550..a1671e3f92 100644 --- a/Cura/gui/printWindow.py +++ b/Cura/gui/printWindow.py @@ -11,6 +11,7 @@ from gui import taskbar from util import machineCom
from util import profile
from util import gcodeInterpreter
+from util import power
printWindowMonitorHandle = None
@@ -116,6 +117,17 @@ class printWindow(wx.Frame): sb = wx.StaticBox(self.panel, label="Statistics")
boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL)
+
+ p = power.PowerManagement()
+ if p.get_providing_power_source_type() != power.POWER_TYPE_AC:
+ self.powerWarningText = wx.StaticText(parent=self.panel,
+ id=-1,
+ label="Connect your computer to AC power\nIf it shuts down during printing, the product will be lost.",
+ style=wx.ALIGN_CENTER)
+ self.powerWarningText.SetBackgroundColour('red')
+ self.powerWarningText.SetForegroundColour('white')
+ boxsizer.AddF(self.powerWarningText, flags=wx.SizerFlags().Expand().Border(wx.BOTTOM, 10))
+
self.statsText = wx.StaticText(self.panel, -1, "Filament: ####.##m #.##g\nEstimated print time: #####:##\nMachine state:\nDetecting baudrateXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
boxsizer.Add(self.statsText, flag=wx.LEFT, border=5)
diff --git a/Cura/util/Power b/Cura/util/Power new file mode 160000 +Subproject 9630adf08ee2de90cb3a49af53d85693060ccbf diff --git a/Cura/util/__init__.py b/Cura/util/__init__.py index e69de29bb2..c343c1b470 100644 --- a/Cura/util/__init__.py +++ b/Cura/util/__init__.py @@ -0,0 +1,7 @@ +import sys +import os + + +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'Power')) + +import power |