configBase.TitleRow(left, 'Filament settings')\r
c = configBase.SettingRow(left, 'Filament density (kg/m3)', 'filament_density', '1300', 'Weight of the filament per m3. Around 1300 for PLA. And around 1040 for ABS. This value is used to estimate the weight if the filament used for the print.', type = 'preference')\r
validators.validFloat(c, 500.0, 3000.0)\r
+ c = configBase.SettingRow(left, 'Filament cost (price/kg)', 'filament_cost_kg', '0', 'Cost of your filament per kg, to estimate the cost of the final print.', type = 'preference')\r
+ validators.validFloat(c, 0.0)\r
+ c = configBase.SettingRow(left, 'Filament cost (price/m)', 'filament_cost_meter', '0', 'Cost of your filament per meter, to estimate the cost of the final print.', type = 'preference')\r
+ validators.validFloat(c, 0.0)\r
\r
configBase.TitleRow(left, 'Communication settings')\r
c = configBase.SettingRow(left, 'Serial port', 'serial_port', ['AUTO'] + machineCom.serialList(), 'Serial port to use for communication with the printer', type = 'preference')\r
\r
from gui import machineCom\r
from gui import icon\r
+from util import profile\r
from util import gcodeInterpreter\r
\r
printWindowHandle = None\r
status = ""\r
if self.gcode != None:\r
status += "Filament: %.2fm %.2fg\n" % (self.gcode.extrusionAmount / 1000, self.gcode.calculateWeight() * 1000)\r
+ cost_kg = float(profile.getPreference('filament_cost_kg'))\r
+ cost_meter = float(profile.getPreference('filament_cost_meter'))\r
+ if cost_kg > 0.0 and cost_meter > 0.0:\r
+ status += "Filament cost: %.2f / %.2f\n" % (self.gcode.calculateWeight() * cost_kg, self.gcode.extrusionAmount / 1000 * cost_meter)\r
+ elif cost_kg > 0.0:\r
+ status += "Filament cost: %.2f\n" % (self.gcode.calculateWeight() * cost_kg)\r
+ elif cost_meter > 0.0:\r
+ status += "Filament cost: %.2f\n" % (self.gcode.extrusionAmount / 1000 * cost_meter)\r
status += "Print time: %02d:%02d\n" % (int(self.gcode.totalMoveTimeMinute / 60), int(self.gcode.totalMoveTimeMinute % 60))\r
if self.printIdx == None:\r
self.progress.SetValue(0)\r
'serial_baud': '250000',\r
'slicer': 'Cura (Skeinforge based)',\r
'save_profile': 'False',\r
+ 'filament_cost_kg': '0',\r
+ 'filament_cost_meter': '0',\r
}\r
\r
def getDefaultProfilePath():\r