if button == 1:
if machineCom.machineIsConnected():
printWindow.printFile(self._gcodeFilename)
+ if self._gcodeFilename == self._slicer.getGCodeFilename():
+ self._slicer.submitSliceInfoOnline()
elif len(removableStorage.getPossibleSDcardDrives()) > 0:
drives = removableStorage.getPossibleSDcardDrives()
if len(drives) > 1:
else:
self.notification.message("Saved as %s" % (fileB))
self.printButton.setProgressBar(None)
-
+ if fileA == self._slicer.getGCodeFilename():
+ self._slicer.submitSliceInfoOnline()
def _showSliceLog(self):
dlg = wx.TextEntryDialog(self, "The slicing engine reported the following", "Engine log...", '\n'.join(self._slicer.getSliceLog()), wx.TE_MULTILINE | wx.OK | wx.CENTRE)
import traceback
import platform
import sys
+import urllib
+import urllib2
+import hashlib
from Cura.util import profile
+from Cura.util import version
def getEngineFilename():
if platform.system() == 'Windows':
self._sliceLog = []
self._printTimeSeconds = None
self._filamentMM = None
+ self._modelHash = None
def cleanup(self):
self.abortSlicer()
commandList += ['-b', self._binaryStorageFilename]
self._objCount = 0
with open(self._binaryStorageFilename, "wb") as f:
+ hash = hashlib.sha512()
order = scene.printOrder()
if order is None:
pos = numpy.array(profile.getMachineCenterCoords()) * 1000
vertexes -= obj._drawOffset
vertexes += numpy.array([obj.getPosition()[0], obj.getPosition()[1], 0.0])
f.write(vertexes.tostring())
+ hash.update(mesh.vertexes.tostring())
commandList += ['#']
self._objCount = 1
obj = scene.objects()[n]
for mesh in obj._meshList:
f.write(numpy.array([mesh.vertexCount], numpy.int32).tostring())
- f.write(mesh.vertexes.tostring())
+ s = mesh.vertexes.tostring()
+ f.write(s)
+ hash.update(s)
pos = obj.getPosition() * 1000
pos += numpy.array(profile.getMachineCenterCoords()) * 1000
commandList += ['-m', ','.join(map(str, obj._matrix.getA().flatten()))]
commandList += ['-s', 'posx=%d' % int(pos[0]), '-s', 'posy=%d' % int(pos[1])]
commandList += ['#' * len(obj._meshList)]
self._objCount += 1
+ self._modelHash = hash.hexdigest()
if self._objCount > 0:
try:
self._process = self._runSliceProcess(commandList)
kwargs['startupinfo'] = su
kwargs['creationflags'] = 0x00004000 #BELOW_NORMAL_PRIORITY_CLASS
return subprocess.Popen(cmdList, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
+
+ def submitSliceInfoOnline(self):
+ if profile.getPreference('submit_slice_information') != 'True':
+ return
+ if version.isDevVersion():
+ return
+ data = {
+ 'processor': platform.processor(),
+ 'machine': platform.machine(),
+ 'platform': platform.platform(),
+ 'profile': profile.getGlobalProfileString(),
+ 'preferences': profile.getGlobalPreferencesString(),
+ 'modelhash': self._modelHash,
+ 'version': version.getVersion(),
+ }
+ try:
+ f = urllib2.urlopen("http://www.youmagine.com/curastats/", data = urllib.urlencode(data), timeout = 1)
+ f.read()
+ f.close()
+ except:
+ pass
if [ $BUILD_TARGET = "win32" ]; then
#Check if we have 7zip, needed to extract and packup a bunch of packages for windows.
checkTool 7z "7zip: http://www.7-zip.org/"
+ checkTool mingw32-make "mingw: http://www.mingw.org/"
fi
#For building under MacOS we need gnutar instead of tar
if [ -z `which gnutar` ]; then
rm -rf scripts/darwin/build
rm -rf scripts/darwin/dist
- python setup.py py2app
+ python build_app.py py2app
rc=$?
if [[ $rc != 0 ]]; then
echo "Cannot build app."
#Get the power module for python
rm -rf Power
git clone https://github.com/GreatFruitOmsk/Power
+ rm -rf CuraEngine
+ git clone https://github.com/Ultimaker/CuraEngine
fi
#############################
rm -rf ${TARGET_DIR}/python/Lib/site-packages/wx-2.8-msw-unicode/wx/locale
#Remove the gle files because they require MSVCR71.dll, which is not included. We also don't need gle, so it's safe to remove it.
rm -rf ${TARGET_DIR}/python/Lib/OpenGL/DLLS/gle*
+
+ #Build the C++ engine
+ mingw32-make -C CuraEngine
fi
#add Cura
#add script files
if [ $BUILD_TARGET = "win32" ]; then
cp -a scripts/${BUILD_TARGET}/*.bat $TARGET_DIR/
- cp CuraEngine.exe $TARGET_DIR
+ cp CuraEngine/CuraEngine.exe $TARGET_DIR
else
cp -a scripts/${BUILD_TARGET}/*.sh $TARGET_DIR/
fi