@centreparcs
This commit is contained in:
parent
bbed8e12b8
commit
e1a4e6b4bf
|
@ -12,4 +12,8 @@ function SketchAPI() {
|
|||
API.get('sketch/?id='+id,success,fail);
|
||||
}
|
||||
|
||||
this.save = function(data,success,fail) {
|
||||
API.post('sketch',{data:data},success,fail);
|
||||
}
|
||||
|
||||
}
|
|
@ -483,6 +483,7 @@ function initLimitedInterface() {
|
|||
btnPrint.hide();
|
||||
btnStop.hide();
|
||||
btnInfo.hide();
|
||||
$("#btnManager").hide();
|
||||
$("#btnsPrevNext").hide();
|
||||
$("#thermometerContainer").hide();
|
||||
$("#progressbarCanvasContainerParent").hide();
|
||||
|
|
Binary file not shown.
|
@ -13,7 +13,7 @@
|
|||
<button id="btnDeselectAll">Deselect all</button>
|
||||
<button id="btnDelete">Delete</button>
|
||||
<button id="btnDownload">Download</button> <!-- <a id="link" href="#">Download</a> -->
|
||||
<button id="btnPrint">Print...</button>
|
||||
<button id="btnCombine">Combine...</button>
|
||||
<button id="btnRefresh">Refresh</button>
|
||||
<form id="frmUpload"><button id="btnUpload">Upload</button><input id="uploads" type="file" accept="image/svg+xml" multiple/></form>
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ $("#btnDeselectAll").click(deselectAll);
|
|||
$("#uploads").change(upload);
|
||||
$("#btnDownload").click(download);
|
||||
$("#btnRefresh").click(refresh);
|
||||
$("#btnPrint").click(print);
|
||||
$("#btnCombine").click(combine);
|
||||
|
||||
$("#btnUpload").click(function(e) {
|
||||
e.preventDefault();
|
||||
|
@ -175,7 +175,7 @@ function updateButtonStates() {
|
|||
$("#btnDeselectAll").attr("disabled",isBusy || noSelection);
|
||||
$("#btnSelectAll").attr("disabled",isBusy || numItems==0);
|
||||
$("#btnUpload").attr("disabled",isBusy || !noSelection);
|
||||
$("#btnPrint").attr("disabled",isBusy || noSelection);
|
||||
$("#btnCombine").attr("disabled",isBusy || noSelection);
|
||||
// $("#btnDelete").text("Delete" + (noSelection ? "" : " ("+numSelected+")"));
|
||||
// $("#btnDownload").text("Download" + (noSelection ? "" : " ("+numSelected+")"));
|
||||
// $("#btnPrint").text("Print" + (noSelection ? "..." : " ("+numSelected+")..."));
|
||||
|
@ -273,11 +273,11 @@ function refresh() {
|
|||
location.reload();
|
||||
}
|
||||
|
||||
function print() {
|
||||
function combine() {
|
||||
var ids = [];
|
||||
$('.item.selected').each(function() {
|
||||
ids.push($(this).attr('data'));
|
||||
});
|
||||
location.href = '/printmanager/' + location.search + "&ids=" + ids.join();
|
||||
location.href = '/printmanager/?ids=' + ids.join(); //+ location.search +
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id="btnsSettingsInfo">
|
||||
<button id="btnManager" style="font-size:18px" onclick="location.href='/filemanager/'">Manager</button><br><br>
|
||||
<img id="btnSettings" class="btn" src="img/buttons/btnSettings.png">
|
||||
<img id="btnInfo" class="btn" src="img/buttons/btnInfo.png">
|
||||
</div>
|
||||
|
@ -182,8 +183,8 @@
|
|||
<script src="js/libs/jquery-coolfieldset.min.js"></script>
|
||||
<script src="js/libs/FileSaver.min.js"></script>
|
||||
<script src="js/libs/jquery-fastclick.min.js"></script>
|
||||
<script src="js/doodle3d-api.js"></script>
|
||||
<script src="js/doodle3d-client.js"></script>
|
||||
<script src="js/doodle3d-api.min.js"></script>
|
||||
<script src="js/doodle3d-client.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
Binary file not shown.
|
@ -16,6 +16,7 @@ button {
|
|||
#toolbar {
|
||||
padding-top: 10px;
|
||||
padding-left: 10px;
|
||||
margin-right: 20px;
|
||||
float: left;
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
|
@ -38,18 +39,23 @@ button {
|
|||
float: right;
|
||||
}
|
||||
|
||||
#btnNext {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#toolbar button {
|
||||
display: block;
|
||||
/*display: block;*/
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#svgContainer {
|
||||
/*margin-top: 10px;*/
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
background-color: #000;
|
||||
width: 640px;
|
||||
height: 640px;
|
||||
border: 1px solid black;
|
||||
border: 2px solid black;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
@ -59,6 +65,7 @@ button {
|
|||
#svgContainer svg {
|
||||
border: 1px solid lightgrey;
|
||||
position: absolute;
|
||||
/*background-color: rgba(255,255,255,.5);*/
|
||||
}
|
||||
|
||||
#printPreview {
|
||||
|
|
|
@ -9,20 +9,25 @@
|
|||
|
||||
<div id="toolbar">
|
||||
<img id="logo" src="../img/logo/doodle3d.png" alt="Doodle3D">
|
||||
<h1>Management App</h1>
|
||||
<h1>Print Management</h1>
|
||||
You can combine multiple doodles to print them at once. Just move and scale these doodles on your tablet. When done, press Next.
|
||||
<br><br>
|
||||
<hr>
|
||||
<button id="btnRefresh">Refresh</button>
|
||||
<button id="btnPrevious">Previous</button>
|
||||
<button id="btnNext">Next</button>
|
||||
|
||||
<!-- <button id="btnRefresh">Refresh</button>
|
||||
<button id="btnDownload">Download</button>
|
||||
<button id="btnPrint">Print</button>
|
||||
<button id="btnStop">Stop</button>
|
||||
<button id="btnExtrude">Extrude 10mm</button>
|
||||
<span class="statusvar" id="lblState"></span>
|
||||
<button id="btnExtrude">Extrude 10mm</button> -->
|
||||
<!-- <span class="statusvar" id="lblState"></span>
|
||||
<span class="statusvar" id="lblNozzle"></span>
|
||||
<span class="statusvar" id="lblBed"></span>
|
||||
<span class="statusvar" id="txtInfo"></span>
|
||||
<span class="statusvar" id="lblBufferProgress"></span>
|
||||
<span class="statusvar" id="lblPrintProgress"></span>
|
||||
<hr>
|
||||
<span class="statusvar" id="lblPrintProgress"></span> -->
|
||||
<!-- <hr> -->
|
||||
</div>
|
||||
|
||||
<div id="svgContainer"></div>
|
||||
|
@ -33,7 +38,7 @@
|
|||
<!-- <canvas id="printPreview" id="canvas" width="400" height="400"></canvas> -->
|
||||
|
||||
<script src="../js/libs/jquery-1-9-1.min.js"></script>
|
||||
<script src="../js/doodle3d-api.js"></script>
|
||||
<script src="../js/doodle3d-api.min.js"></script>
|
||||
<script src="js/Point.js"></script>
|
||||
<script src="js/Rectangle.js"></script>
|
||||
<script src="js/Polyline.js"></script>
|
||||
|
|
|
@ -6,6 +6,7 @@ var Doodle = function(svgData,settings) {
|
|||
var scale = 1;
|
||||
var rotation = 0;
|
||||
var twist = .1;
|
||||
var id;
|
||||
|
||||
if (settings!=undefined) {
|
||||
if (settings.height!=undefined) height = settings.height;
|
||||
|
@ -15,27 +16,30 @@ var Doodle = function(svgData,settings) {
|
|||
}
|
||||
|
||||
if (svgData!=undefined) {
|
||||
setFromSvgPathDescription(svgData);
|
||||
removeShortPaths(); //move this to main.js?
|
||||
|
||||
// offset.x += path.getBoundingBox().getX();
|
||||
// offset.y += path.getBoundingBox().getY();
|
||||
|
||||
path.alignCorner(); //set left-top corner of path boundingbox to 0,0
|
||||
|
||||
// scale = 1;
|
||||
|
||||
// console.log(path.getBoundingBox().getX(),offset);
|
||||
if (svgData.charAt(0)=='<') {
|
||||
setFromSvgFileData(svgData);
|
||||
} else {
|
||||
setFromSvgPathDescription(svgData);
|
||||
}
|
||||
removeShortPaths();
|
||||
path.alignCorner();
|
||||
}
|
||||
|
||||
function setFromSvgFileData(svgData) {
|
||||
if (!svgData) svgData = "";
|
||||
else if (typeof(svgData)!='string') svgData = "";
|
||||
// else if (svgData.indexOf("CDATA")==-1) svgData = ""; //only accept doodles with CDATA inside containing transforms
|
||||
else svgData = svgData.split('d="')[1].split('"')[0];
|
||||
setFromSvgPathDescription(svgData);
|
||||
}
|
||||
|
||||
function getSvgFileData() {
|
||||
return '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 640 540">' +
|
||||
'<path fill="none" stroke="black" stroke-width="2" d="' + getSvgPathDescription() +
|
||||
'"></path><!--<![CD'+'ATA[d3d-keys {"height":5,"outlineShape":"none","twist":0}]]>--></svg>';
|
||||
}
|
||||
|
||||
function setFromSvgPathDescription(svgData) {
|
||||
// if (!svgData) svgData = "";
|
||||
// else if (typeof(svgData)!='string') svgData = "";
|
||||
// // else if (svgData.indexOf("CDATA")==-1) svgData = "";
|
||||
// else svgData = svgData.split('d="')[1].split('"')[0];
|
||||
// console.log('svgData',svgData);
|
||||
|
||||
svgData+=' '; //add a trailing space
|
||||
|
||||
//Parse Path Description
|
||||
|
@ -98,9 +102,10 @@ var Doodle = function(svgData,settings) {
|
|||
setPath(path);
|
||||
}
|
||||
|
||||
function getSvgPathDescription() {
|
||||
function getSvgPathDescription(p) {
|
||||
if (!p) p = path;
|
||||
var d = "";
|
||||
var polylines = path.getPolylines();
|
||||
var polylines = p.getPolylines();
|
||||
for (var i=0; i<polylines.length; i++) {
|
||||
var points = polylines[i].getPoints();
|
||||
for (var j=0; j<points.length; j++) {
|
||||
|
@ -109,7 +114,15 @@ var Doodle = function(svgData,settings) {
|
|||
}
|
||||
}
|
||||
return d;
|
||||
// return '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="640" height="540"><path xmlns="http://www.w3.org/2000/svg" fill="none" stroke="black" stroke-width="2" d="'+d+'"></path></svg>';
|
||||
}
|
||||
|
||||
function getTransformedPath() {
|
||||
var p = path.clone();
|
||||
//var box = p.getBoundingBox();
|
||||
p.scale(scale);
|
||||
p.alignCorner();
|
||||
p.translate(offset.x,offset.y);
|
||||
return p;
|
||||
}
|
||||
|
||||
function removeShortPaths(minLength,minPoints) {
|
||||
|
@ -164,13 +177,23 @@ var Doodle = function(svgData,settings) {
|
|||
function getScaleFunction(f) {
|
||||
return 1; //Math.sin(f*2*Math.PI)/4+1;
|
||||
}
|
||||
|
||||
function setId(_id) {
|
||||
id = _id;
|
||||
}
|
||||
|
||||
function getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
return {
|
||||
getPath: getPath,
|
||||
setPath: setPath,
|
||||
getTransformedPath: getTransformedPath,
|
||||
getSettings: getSettings,
|
||||
setFromSvgPathDescription: setFromSvgPathDescription,
|
||||
getSvgPathDescription: getSvgPathDescription,
|
||||
getSvgFileData: getSvgFileData,
|
||||
getHeight: getHeight,
|
||||
getRotation: getRotation,
|
||||
getTwist: getTwist,
|
||||
|
@ -179,6 +202,8 @@ var Doodle = function(svgData,settings) {
|
|||
setScale: setScale,
|
||||
getOffset: getOffset,
|
||||
setOffset: setOffset,
|
||||
setId: setId,
|
||||
getId: getId,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -52,8 +52,6 @@ var Doodle2gcode = function() {
|
|||
// var org = path.getOffset();
|
||||
var box = path.getBoundingBox();
|
||||
|
||||
|
||||
|
||||
//center object on origin to apply transformations
|
||||
path.translate(-box.getX(),-box.getY());
|
||||
path.translate(-box.getWidth()/2,-box.getHeight()/2);
|
||||
|
@ -82,15 +80,6 @@ var Doodle2gcode = function() {
|
|||
path.scale(px2mm);
|
||||
path.translate(0,-dimensions.y);
|
||||
|
||||
// G1 X95.054 Y95.154 E4.83242
|
||||
// G1 F2400 E0.33242 ;retract voor travel
|
||||
// G0 F9000 X98.641 Y93.617
|
||||
// ;TYPE:WALL-INNER
|
||||
// G1 F2400 E4.83242 ;unretract na een travel en voor
|
||||
// G1 F1200 X98.621 Y93.596 E4.83297
|
||||
|
||||
|
||||
|
||||
for (var i=0; i<polylines.length; i++) {
|
||||
var points = polylines[i].getPoints();
|
||||
for (var j=0; j<points.length; j++) {
|
||||
|
|
|
@ -1,18 +1,26 @@
|
|||
var Viewer = function(viewer) {
|
||||
var Viewer = function(_viewer) {
|
||||
var className = "Viewer";
|
||||
var viewer = _viewer;
|
||||
var items = [];
|
||||
var colors = ['#FF00BF','#FFBF00','#00FFFF','#0040FF','#00FF40','#7F00FF','#FF0000','#80FF00','#FF00BF','#FF0000'];
|
||||
|
||||
function setDoodles(_doodles) {
|
||||
doodles = _doodles;
|
||||
function setDoodles(doodles) {
|
||||
for (var i=0; i<doodles.length; i++) {
|
||||
var item = new ViewerItem(doodles[i]);
|
||||
items.push(item);
|
||||
var svg = item.getSvg();
|
||||
viewer.append(svg);
|
||||
item.setColor(colors[i % doodles.length]);
|
||||
}
|
||||
}
|
||||
|
||||
function clear() {
|
||||
viewer.empty();
|
||||
items.length = 0;
|
||||
}
|
||||
|
||||
return {
|
||||
setDoodles: setDoodles,
|
||||
clear: clear,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ var ViewerItem = function(doodle) {
|
|||
var path = doodle.getPath();
|
||||
var svgData = doodle.getSvgPathDescription();
|
||||
var box = path.getBoundingBox();
|
||||
var svg = $('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="640" height="540"><path xmlns="http://www.w3.org/2000/svg" fill="none" stroke="black" d="'+svgData+'"></path></svg>');
|
||||
var svg = $('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="640" height="540"><path xmlns="http://www.w3.org/2000/svg" fill="none" d="'+svgData+'"></path></svg>');
|
||||
var viewbox = box.getX() + " " + box.getY() + " " + box.getWidth() + " " + box.getHeight();
|
||||
var xDown = 0, yDown = 0;
|
||||
var xCur = 0, yCur = 0;
|
||||
|
@ -20,7 +20,7 @@ var ViewerItem = function(doodle) {
|
|||
var box = path.getBoundingBox();
|
||||
var scaledCenterX = box.getCenter().x * (1-doodle.getScale());
|
||||
var scaledCenterY = box.getCenter().y * (1-doodle.getScale());
|
||||
svg[0].setAttribute("stroke-width", 1/doodle.getScale());
|
||||
svg[0].setAttribute("stroke-width", 2/doodle.getScale());
|
||||
svg.css({
|
||||
transform: "scale(" + doodle.getScale() + ")",
|
||||
left: doodle.getOffset().x - scaledCenterX + xCur - xDown,
|
||||
|
@ -28,6 +28,11 @@ var ViewerItem = function(doodle) {
|
|||
});
|
||||
}
|
||||
|
||||
function setColor(c) {
|
||||
console.log('setColor',c);
|
||||
svg[0].setAttribute("stroke", c);
|
||||
}
|
||||
|
||||
function getDoodle() {
|
||||
return doodle;
|
||||
}
|
||||
|
@ -88,7 +93,7 @@ var ViewerItem = function(doodle) {
|
|||
updateDrag(e.originalEvent.pageX,e.originalEvent.pageY);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
svg.on("mouseup", function (e) {
|
||||
stopDrag();
|
||||
});
|
||||
|
@ -96,6 +101,13 @@ var ViewerItem = function(doodle) {
|
|||
$(document).on("mouseup", function (e) {
|
||||
stopDrag();
|
||||
});
|
||||
|
||||
$(document).on("keydown", function (e) {
|
||||
if (dragging) {
|
||||
if (e.keyCode==189) zoomBy(-.01);
|
||||
if (e.keyCode==187) zoomBy(+.01);
|
||||
}
|
||||
});
|
||||
|
||||
svg.on("touchstart", function (e) {
|
||||
var event = e.originalEvent;
|
||||
|
@ -132,5 +144,6 @@ var ViewerItem = function(doodle) {
|
|||
return {
|
||||
getDoodle: getDoodle,
|
||||
getSvg: getSvg,
|
||||
setColor: setColor,
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -1,11 +0,0 @@
|
|||
/*!
|
||||
* jQuery UI Touch Punch 0.2.3
|
||||
*
|
||||
* Copyright 2011–2014, Dave Furfero
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.widget.js
|
||||
* jquery.ui.mouse.js
|
||||
*/
|
||||
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue