def about(self): popupText = 'Ground Control v' + str(self.data.version) + ' allows you to control the Maslow machine. ' + \ 'From within Ground Control, you can move the machine to where you want to begin a cut, calibrate the machine, ' + \ 'open and run a g-code file, or monitor the progress of an ongoing cut. For more details see the Maslow website ' + \ 'at http://www.maslowcnc.com/. The source code can be downloaded at https://github.com/MaslowCNC. ' + \ '\n\n' + \ 'GroundControl is part of the of the Maslow Control Software Copyright (C) 2014-2017 Bar Smith. ' + \ 'This program is free software: you can redistribute it and/or modify ' + \ 'it under the terms of the GNU General Public License as published by ' + \ 'the Free Software Foundation, either version 3 of the License, or ' + \ '(at your option) any later version. ' + \ '\n\n' + \ 'This program is distributed in the hope that it will be useful, ' + \ 'but WITHOUT ANY WARRANTY; without even the implied warranty of ' + \ 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' + \ 'GNU General Public License for more details. ' + \ '\n\n' + \ 'You should have received a copy of the GNU General Public License ' + \ 'along with the Maslow Control Software. If not, see <http://www.gnu.org/licenses/>.' content = ScrollableTextPopup(cancel=self.dismiss_popup, text=popupText, markup=True) self._popup = Popup(title="About GroundControl", content=content, size_hint=(0.5, 0.5)) self._popup.open()
def show_gcode(self): ''' Display the currently loaded gcode in a popup It would be cool if you could run the program stepping through using this popup ''' popupText = "" if len(self.data.gcode) is 0: popupText = "No gcode to display" else: for gcodeLine in self.data.gcode: popupText = popupText + gcodeLine + "\n" content = ScrollableTextPopup(cancel=self.dismiss_popup, text=popupText) self._popup = Popup(title="Gcode", content=content, size_hint=(0.9, 0.9)) self._popup.open()
def show_gcode(self): ''' Display the currently loaded gcode in a popup It would be cool if you could run the program stepping through using this popup ''' popupText = "" if len(self.data.gcode) is 0: popupText = "No gcode to display" else: if self.page<=1: line = 0 else: line = (self.page-1)*447 popupText = "...\n...\n...\n" if line>len(self.data.gcode): line = len(self.data.gcode)-447 for lineNum, gcodeLine in enumerate(self.data.gcode): if lineNum>=line and lineNum<line+447: popupText = popupText + str(lineNum+1) + ': ' + gcodeLine + "\n" elif lineNum>=line+447: popupText = popupText + "...\n...\n...\n" break content = ScrollableTextPopup(cancel = self.dismiss_popup, prev = self.show_gcode_prev, next = self.show_gcode_next, text = popupText) titleString = 'Gcode File: ' + self.data.gcodeFile +'\nLines: '+str(line+1)+' - '+str(lineNum)+' of '+str(len(self.data.gcode)) self._popup = Popup(title=titleString, content=content, size_hint=(0.9, 0.9)) self._popup.open()