\r
from gui import firmwareInstall\r
from gui import toolbarUtil\r
+from gui import printWindow\r
from util import machineCom\r
from util import profile\r
\r
\r
self.bitmap = wx.StaticBitmap(self, -1, wx.EmptyBitmapRGBA(24, 24, red=255, green=255, blue=255, alpha=1))\r
self.text = wx.StaticText(self, -1, '')\r
+ self.extraInfoButton = wx.Button(self, -1, 'i', style=wx.BU_EXACTFIT)\r
self.sizer.Add(self.bitmap, pos=(0,0), flag=wx.ALL, border=5)\r
self.sizer.Add(self.text, pos=(0,1), flag=wx.TOP|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL, border=5)\r
+ self.sizer.Add(self.extraInfoButton, pos=(0,2), flag=wx.ALL|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, border=5)\r
+ self.sizer.AddGrowableCol(1)\r
\r
+ self.extraInfoButton.Show(False)\r
+ \r
+ self.extraInfoUrl = ''\r
self.busyState = None\r
self.timer = wx.Timer(self)\r
self.Bind(wx.EVT_TIMER, self.doBusyUpdate, self.timer)\r
+ self.Bind(wx.EVT_BUTTON, self.doExtraInfo, self.extraInfoButton)\r
self.timer.Start(100)\r
\r
def SetInfo(self, info):\r
self.SetBackgroundColour('#FFFF80')\r
self.text.SetLabel(info)\r
+ self.extraInfoButton.Show(False)\r
self.Refresh()\r
\r
- def SetError(self, info):\r
+ def SetError(self, info, extraInfoUrl):\r
+ self.extraInfoUrl = extraInfoUrl\r
self.SetBackgroundColour('#FF8080')\r
self.text.SetLabel(info)\r
+ self.extraInfoButton.Show(True)\r
+ self.Layout()\r
self.SetErrorIndicator()\r
self.Refresh()\r
\r
def SetAttention(self, info):\r
self.SetBackgroundColour('#FFFF80')\r
self.text.SetLabel(info)\r
+ self.extraInfoButton.Show(False)\r
self.SetAttentionIndicator()\r
self.Refresh()\r
\r
self.busyState = 0\r
self.bitmap.SetBitmap(self.busyBitmap[self.busyState])\r
\r
+ def doExtraInfo(self, e):\r
+ webbrowser.open(self.extraInfoUrl)\r
+ \r
def SetReadyIndicator(self):\r
self.busyState = None\r
self.bitmap.SetBitmap(self.readyBitmap)\r
self.infoBox = self.AddInfoBox()\r
self.machineState = self.AddText('')\r
self.temperatureLabel = self.AddText('')\r
+ self.errorLogButton = self.AddButton('Show error log')\r
+ self.errorLogButton.Show(False)\r
self.AddSeperator()\r
self.endstopBitmap = self.AddBitmap(self.endStopNoneBitmap)\r
self.comm = None\r
self.yMaxStop = False\r
self.zMinStop = False\r
self.zMaxStop = False\r
+ \r
+ self.Bind(wx.EVT_BUTTON, self.OnErrorLog, self.errorLogButton)\r
\r
def __del__(self):\r
if self.comm != None:\r
self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()\r
\r
def OnCheckClick(self, e = None):\r
+ self.errorLogButton.Show(False)\r
if self.comm != None:\r
self.comm.close()\r
del self.comm\r
self.stopState.SetBitmap(self.unknownBitmap)\r
self.checkupState = 0\r
self.comm = machineCom.MachineCom(callbackObject=self)\r
+ \r
+ def OnErrorLog(self, e):\r
+ printWindow.LogWindow('\n'.join(self.comm.getLog()))\r
\r
def mcLog(self, message):\r
pass\r
if self.tempCheckTimeout < 1:\r
self.checkupState = -1\r
wx.CallAfter(self.tempState.SetBitmap, self.crossBitmap)\r
- wx.CallAfter(self.infoBox.SetError, 'Temperature measurement FAILED!')\r
+ wx.CallAfter(self.infoBox.SetError, 'Temperature measurement FAILED!', 'http://wiki.ultimaker.com/Cura/Temperature_measurement_problems')\r
self.comm.sendCommand('M104 S0')\r
self.comm.sendCommand('M104 S0')\r
wx.CallAfter(self.temperatureLabel.SetLabel, 'Head temperature: %d' % (temp))\r
return\r
if self.comm.isOperational():\r
wx.CallAfter(self.commState.SetBitmap, self.checkBitmap)\r
+ wx.CallAfter(self.machineState.SetLabel, 'Communication State: %s' % (self.comm.getStateString()))\r
elif self.comm.isError():\r
wx.CallAfter(self.commState.SetBitmap, self.crossBitmap)\r
- wx.CallAfter(self.infoBox.SetError, 'Failed to establish connection with the printer.')\r
+ wx.CallAfter(self.infoBox.SetError, 'Failed to establish connection with the printer.', 'http://wiki.ultimaker.com/Cura/Connection_problems')\r
wx.CallAfter(self.endstopBitmap.Show, False)\r
- wx.CallAfter(self.machineState.SetLabel, 'Communication State: %s' % (self.comm.getStateString()))\r
+ wx.CallAfter(self.machineState.SetLabel, '%s' % (self.comm.getErrorString()))\r
+ wx.CallAfter(self.errorLogButton.Show, True)\r
+ wx.CallAfter(self.Layout)\r
+ else:\r
+ wx.CallAfter(self.machineState.SetLabel, 'Communication State: %s' % (self.comm.getStateString()))\r
\r
def mcMessage(self, message):\r
if self.checkupState >= 3 and self.checkupState < 10 and 'x_min' in message:\r