imageSlicer.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  1. rectID = 0;
  2. colors = ["#edd400","#73d216","#cc0000","#f57900","#3465a4","#c17d11","#75507b","#fce94f","#8ae234","#ef2929","#fcaf3e","#729fcf","#eeeeec","#e9b96e","#ad7fa8","#888a85","#c4a000","#4e9a06","#a40000","#ce5c00","#204a87","#babdb6","#8f5902","#5c3566","#2e3436"].map(i => i + "70"); //Tango Colors with opacity
  3. abk = [];
  4. fullpattern = [];
  5. function addRectangle(){
  6. addRectangle1("", 0,0,1000,100)
  7. }
  8. function scalefactor(){
  9. return $('#sliceImg').innerWidth() / $('#sliceImg').prop('naturalWidth');
  10. }
  11. function refitRect(id){
  12. $('#Rect' + id).css('transform', 'scale(' + scalefactor() + ')');
  13. }
  14. function resizeAllRect() {
  15. console.log("resizing");
  16. for (var i = 0; i < rectID; i++) {
  17. refitRect(i);
  18. $('#Rect' + i).css("top", $('#Rect' + i).attr("y") * scalefactor() + "px");
  19. $('#Rect' + i).css("left", $('#Rect' + i).attr("x") * scalefactor() + "px");
  20. }
  21. }
  22. function changeRectPosition(id, style, amount){
  23. $('#Rect' + id).css(style, amount + "px");
  24. refitRect(id);
  25. }
  26. function addRectangle1(id,x,y,w,h,pattern,idtext,assignmentsstation,assignments){
  27. //Show input fields
  28. var clone = document.importNode(document.querySelector('#RectanglesSetup').content,true);
  29. var localID = rectID
  30. if(id != "")
  31. localID = id;
  32. $('[data-class=RectID]',clone).text("" + localID);
  33. $('[data-class=mainDiv]',clone).hover(function(){
  34. $('#Rect' + localID).css("background", colors[localID % colors.length]);
  35. $('#FormRect' + localID).css("background", colors[localID % colors.length]);
  36. },
  37. function(){
  38. $('#Rect' + localID).css("background", "none");
  39. $('#FormRect' + localID).css("background", "none");
  40. });
  41. $('[data-class=mainDiv]',clone).attr('id', 'FormRect' + localID);
  42. $('[data-class=x]',clone).val(x);
  43. $('[data-class=x]',clone).on('input', function(e) {
  44. changeRectPosition(localID, "left", this.value * scalefactor() );
  45. });
  46. $('[data-class=y',clone).val(y);
  47. $('[data-class=y]',clone).on('input', function(e) {
  48. changeRectPosition(localID, "top", this.value * scalefactor());
  49. });
  50. $('[data-class=w',clone).val(w);
  51. $('[data-class=w]',clone).on('input', function(e) {
  52. changeRectPosition(localID, "width", this.value );
  53. });
  54. $('[data-class=h',clone).val(h);
  55. $('[data-class=h]',clone).on('input', function(e) {
  56. changeRectPosition(localID, "height", this.value );
  57. });
  58. //Alle Abkürzungen einfügen und prüfen ob im pattern angegeben
  59. abk.forEach(function(item){
  60. var clonepattern = document.importNode(document.querySelector('#RectanglePattern').content,true);
  61. $('[data-class=abk]',clonepattern).text(item);
  62. $('[data-class=input]',clonepattern).prop('name', item);
  63. if(typeof pattern !== 'undefined' && pattern[item]){
  64. $('[data-class=input]',clonepattern).prop('checked', true);
  65. }
  66. $('[data-class=RectanglePattern',clone).append(clonepattern);
  67. });
  68. var clonepatternidtext = document.importNode(document.querySelector('#RectanglePatternText').content,true);
  69. if(typeof idtext !== 'undefined'){
  70. $('[data-class=input]',clonepatternidtext).val(idtext);
  71. }
  72. $('[data-class=RectanglePattern',clone).append(clonepatternidtext);
  73. //add Assignment Station
  74. var clonepattern = document.importNode(document.querySelector('#RectanglesAssignment').content,true);
  75. $('[data-class=Assignment]',clonepattern).attr("name", "Station");
  76. $('[data-class=AssignmentAbk]',clonepattern).text("Station");
  77. //Stationen einfügen
  78. $.ajax({
  79. type: "GET",
  80. url: "../server/",
  81. dataType: "xml",
  82. success: function(xml) {
  83. $(xml).find('station').each(function(index){
  84. console.log($(this).attr('id'));
  85. $('[data-class=AssignmentOptionen]',clonepattern).append('<option value="' + $(this).attr('id') +'">' + $(this).attr('id') +'</option>');
  86. });
  87. },
  88. async: false
  89. });
  90. //station hinzufügen/löschen
  91. $('[data-class=AssignmentAdd]',clonepattern).on('click', function(e) {
  92. var clonepatternvalue = document.importNode(document.querySelector('#RectanglesAssignmentValue').content,true);
  93. $('[data-class=AssignmentText]',clonepatternvalue).text(e.target.previousElementSibling.value);
  94. //löschen
  95. $('[data-class=AssignmentDelete]',clonepatternvalue).on('click', function(e) {
  96. e.target.parentNode.remove();
  97. });
  98. e.target.nextElementSibling.append(clonepatternvalue)
  99. });
  100. //Station Ausfüllen
  101. if(typeof assignmentsstation !== 'undefined' && assignmentsstation){
  102. $.each(assignmentsstation, function(i, item){
  103. var clonepatternvalue = document.importNode(document.querySelector('#RectanglesAssignmentValue').content,true);
  104. $('[data-class=AssignmentText]',clonepatternvalue).text(item);
  105. //löschen
  106. $('[data-class=AssignmentDelete]',clonepatternvalue).on('click', function(e) {
  107. e.target.parentNode.remove();
  108. });
  109. $('[data-class=AllAssignments]',clonepattern).append(clonepatternvalue)
  110. });
  111. }
  112. $('[data-class=RectangleAssignmentStation]',clone).append(clonepattern);
  113. //add assignments
  114. $.each( fullpattern["pattern"], function(i, item){
  115. var clonepattern = document.importNode(document.querySelector('#RectanglesAssignment').content,true);
  116. $('[data-class=Assignment]',clonepattern).attr("name", item["abk"]);
  117. $('[data-class=AssignmentAbk]',clonepattern).text(item["abk"]);
  118. $.each( item["types"], function(i, item){
  119. if(item != "")
  120. $('[data-class=AssignmentOptionen]',clonepattern).append('<option value="' + item +'">' + item +'</option>');
  121. });
  122. //einfügen
  123. $('[data-class=AssignmentAdd]',clonepattern).on('click', function(e) {
  124. var clonepatternvalue = document.importNode(document.querySelector('#RectanglesAssignmentValue').content,true);
  125. $('[data-class=AssignmentText]',clonepatternvalue).text(e.target.previousElementSibling.value);
  126. //löschen
  127. $('[data-class=AssignmentDelete]',clonepatternvalue).on('click', function(e) {
  128. e.target.parentNode.remove();
  129. });
  130. e.target.nextElementSibling.append(clonepatternvalue)
  131. });
  132. //Assignment Ausfüllen
  133. if(typeof assignments !== 'undefined' && assignments[item["abk"]]){
  134. $.each(assignments[item["abk"]], function(i, item){
  135. var clonepatternvalue = document.importNode(document.querySelector('#RectanglesAssignmentValue').content,true);
  136. $('[data-class=AssignmentText]',clonepatternvalue).text(item);
  137. //löschen
  138. $('[data-class=AssignmentDelete]',clonepatternvalue).on('click', function(e) {
  139. e.target.parentNode.remove();
  140. });
  141. $('[data-class=AllAssignments]',clonepattern).append(clonepatternvalue)
  142. });
  143. }
  144. $('[data-class=RectangleAssignment]',clone).append(clonepattern);
  145. });
  146. $('#imgRectangles').append(clone);
  147. //add rectangle to image
  148. var clone = document.importNode(document.querySelector('#RectanglesImage').content,true);
  149. $('[data-class=RectID]',clone).attr("id","Rect" + localID);
  150. $('[data-class=RectID]',clone).attr("y",y);
  151. $('[data-class=RectID]',clone).text("Rect" + localID);
  152. $('[data-class=RectID]',clone).css("top", y * scalefactor() + "px");
  153. $('[data-class=RectID]',clone).css("left", x * scalefactor() + "px");
  154. $('[data-class=RectID]',clone).css("width", w + "px");
  155. $('[data-class=RectID]',clone).css("height", h + "px");
  156. $('[data-class=RectID]',clone).hover(function(){
  157. $('#FormRect' + localID).css("background", colors[localID % colors.length]);
  158. $('#Rect' + localID).css("background", colors[localID % colors.length]);
  159. $('#detailcolumn2').scrollTop( 0 );
  160. $('#detailcolumn2').scrollTop($('#FormRect' + localID).position().top - 50 );
  161. },
  162. function(){
  163. $("#detailcolumn2").stop();
  164. $('#FormRect' + localID).css("background", "none");
  165. $('#Rect' + localID).css("background", "none");
  166. });
  167. $('#imgrect').append(clone);
  168. refitRect(localID);
  169. ++rectID;
  170. new Sortable(document.getElementById('imgRectangles'),{
  171. handle: '.handle3',
  172. animation: 150
  173. });
  174. }
  175. function createPatternForm(){
  176. /* Load pattern config */
  177. //Create form for WAS/Stations/Pattern and WAS/Slicer
  178. var populate = ["FormPattern","FormPattern2","FormPatternAssignment"]
  179. var first = true;
  180. populate.forEach(function(populate2){
  181. $.getJSON( "../server/json/ProductCode.json", function( data ) {
  182. fullpattern = data;
  183. $.each( data["pattern"], function(i, item){
  184. var clone = document.importNode(document.querySelector('#PatternFormInit').content,true);
  185. $('[data-class=Name]',clone).text(item["name"]);
  186. $('[data-class=Abkürzung]',clone).text(item["abk"]);
  187. if(first)
  188. abk.push(item["abk"])
  189. $.each( item["types"], function(i, item){
  190. $('[data-class=Optionen]',clone).append('<option value="' + item +'">' + item +'</option>');
  191. });
  192. $('[data-class=Optionen]',clone).attr("id", populate2 + "_Form_" + item["abk"]);
  193. $('#' + populate2).append(clone);
  194. });
  195. //Add "Text" to abk to show it within rects
  196. first = false;
  197. });
  198. });
  199. abk.length = 0;
  200. //get Save locations
  201. $.getJSON( "../server/json/SlicerConfig.json", function( data ) {
  202. $.each( data["saveLocation"], function(i, item){
  203. $("#savelocation").append('<option value="' + item +'">' + item +'</option>');
  204. });
  205. });
  206. }
  207. function updateSlicerPatternForm(){
  208. }
  209. function createRectForm(station){
  210. var imgsrc = $("#sliceImg").attr("src")
  211. rectID = 0;
  212. $('#imgRectangles').text("");
  213. $('#imgrect').html('<img class="image" id="sliceImg" src=' + imgsrc +' alt="Alt text" />');
  214. $.getJSON( "../server/json/Rectangle.json", function( data ) {
  215. $.each( data["Configs"], function(i, item){
  216. if(item["name"] == station){
  217. $.each( item["rects"], function(i, item){
  218. addRectangle1(item["id"],item["X"],item["Y"],item["W"],item["H"],item["pattern"],item["idtext"],item["assignmentsstation"], item["assignments"]);
  219. });
  220. }
  221. });
  222. });
  223. }
  224. function loadStationsForm(){
  225. $.getJSON( "../server/json/Rectangle.json", function( data ) {
  226. $.each( data["Configs"], function(i, item){
  227. $("#loadconfig").append('<option value="' + item["name"] +'">' + item["name"] +'</option>');
  228. });
  229. $("#loadconfig").on('change', function() {
  230. createRectForm(this.value);
  231. });
  232. });
  233. }
  234. function createJson(){
  235. rects = []
  236. $(".singleRect").each(function() {
  237. var pats = {}
  238. $(this).find(".patternPart3").each(function() {
  239. $(this).find('.patternPart3Input:checked').each(function() {
  240. pats[$(this).attr('name')] = true;
  241. });
  242. });
  243. var txt;
  244. $(this).find(".patternPart3Text").each(function() {
  245. txt = $(this).children("input").val();
  246. });
  247. //get All stations
  248. var assignmentstation = assignmentGetAllStatios($(this));
  249. //get all assignments of current Rectangle
  250. var assignments = assignmentGetAllAssignments($(this));
  251. rect = {id: $( this ).find(".RectID").text(), X:$( this ).find('input[data-class="x"]').val(), Y:$( this ).find('input[data-class="y"]').val(), W:$( this ).find('input[data-class="w"]').val(), H:$( this ).find('input[data-class="h"]').val(), pattern: pats, idtext: txt, assignmentsstation: assignmentstation, assignments: assignments};
  252. rects.push(rect);
  253. });
  254. allrects = {name: $("#loadconfig").val(), rects: rects};
  255. return allrects;
  256. }
  257. function createJsonCutting(){
  258. var rects = createJson();
  259. rects.rects.forEach(function(value) {
  260. pattern = value.pattern;
  261. abk.forEach(function(item){
  262. if(typeof $("#FormPattern2_Form_" + item).val() !== 'undefined' && typeof $("#FormPattern2_Form_" + item).val() !== 'undefined'){
  263. if(pattern[item]){
  264. //if rectangle is checked but nothing has been selected
  265. if($("#FormPattern2_Form_" + item).find(":selected").text() == ""){
  266. pattern[item] = "NoSelection";
  267. }
  268. else{
  269. pattern[item] = $("#FormPattern2_Form_" + item).find(":selected").text();
  270. }
  271. }
  272. }
  273. });
  274. });
  275. return rects;
  276. }
  277. function recCombi(data, currindex, result, cur) {
  278. var Keys = Object.keys(data);
  279. var optionKey = Keys[currindex];
  280. var vals = data[optionKey];
  281. for (var i = 0; i < vals.length; i++) {
  282. cur[optionKey] = vals[i];
  283. if (currindex + 1 < Keys.length) {
  284. recCombi(data, currindex + 1, result, cur);
  285. }
  286. else {
  287. var res = JSON.parse(JSON.stringify(cur));
  288. result.push(res);
  289. }
  290. }
  291. return result;
  292. }
  293. //gets assignment station for current rectangle
  294. function assignmentGetAllStatios(cur) {
  295. var assignmentstation = []
  296. cur.find(".RectangleAssignmentStation div").each(function() {
  297. var allass = new Set();
  298. $(this).find(".RectanglesAssignmentValue").each(function() {
  299. allass.add($(this).text());
  300. });
  301. if(allass.size)
  302. assignmentstation = Array.from(allass);
  303. });
  304. return assignmentstation;
  305. }
  306. //gets assignments for current rectangle
  307. function assignmentGetAllAssignments(cur) {
  308. var assignments = {};
  309. cur.find(".RectangleAssignment div").each(function() {
  310. assname = cur.attr('name')
  311. var allass = new Set();
  312. $(this).find(".RectanglesAssignmentValue").each(function() {
  313. allass.add($(this).text());
  314. });
  315. if(allass.size){
  316. assignments[assname] = Array.from(allass);
  317. }
  318. });
  319. return assignments;
  320. }
  321. function submitSlices(skip = false){
  322. //createJsonCutting();
  323. //check if selected options are also selected in drop down menus
  324. var skippall = false;
  325. if(!skip){
  326. var checkedoptions = new Set();
  327. $("#imgRectangles input[type=checkbox]:checked").each(function(index, data){
  328. checkedoptions.add($(data).attr("name"))
  329. });
  330. var allskips = [];
  331. checkedoptions.forEach(function(item){
  332. if($("#FormPattern2_Form_" + item).find(":selected").text() == ""){
  333. allskips.push(item);
  334. }
  335. });
  336. if (Array.isArray(allskips) && allskips.length) {
  337. if(!confirm("Achtung: [" + allskips + "] nicht ausgefüllt, fortfahren?")){
  338. skippall = true;
  339. }
  340. }
  341. }
  342. if(!skippall){
  343. request = $.ajax({
  344. type: "POST",
  345. url: "imageSlicer.php",
  346. async: false,
  347. data: { url: $("#sliceImg").attr("src"), savelocation: $("#savelocation").val(), alldata: JSON.stringify(createJsonCutting()) },
  348. success: function(data){
  349. console.log(Object.keys(data).length);
  350. if ( Object.keys(data).length == 1) {
  351. //clearFormFull();
  352. if(!skip){
  353. alert("Saved Images");
  354. }
  355. }
  356. else if(data.hasOwnProperty('error')){
  357. alert("Achtung Fehler: \n" + data.error)
  358. console.log(data);
  359. }
  360. else{
  361. if(!skip){
  362. overlayOnDupliImages(data);
  363. }
  364. }
  365. //Create Assignments (first returned url == first rectangle)
  366. if(data.hasOwnProperty('url')){
  367. var counter = 0;
  368. $(".singleRect").each(function() {
  369. var txt = "";
  370. $(this).find(".patternPart3Text").each(function() {
  371. txt = $(this).children("input").val();
  372. });
  373. //get All stations
  374. var assignmentstation = assignmentGetAllStatios($(this));
  375. //get all assignments of current Rectangle
  376. var assignments = assignmentGetAllAssignments($(this));
  377. //get all combinations of assignments
  378. var result = recCombi(assignments, 0, [], {});
  379. //Save assignments
  380. $.each(assignmentstation, function(i, station) {
  381. $.each(result, function(i, item) {
  382. var obj = new Object();
  383. obj.img = data.url[counter];
  384. obj.station = station;
  385. obj.parts = item;
  386. obj.assignmentText = txt;
  387. //use storage function from assignment.js
  388. submitAssignment(obj);
  389. });
  390. });
  391. ++counter;
  392. });
  393. }
  394. },
  395. error: function(xhr, status, error){
  396. console.error(xhr);
  397. }
  398. });
  399. }
  400. }
  401. function overlayOnDupliImages(data) {
  402. document.getElementById("overlayNotClickable").style.display = "block";
  403. var clone = document.importNode(document.querySelector('#SlicerDupliOverlay').content,true);
  404. $.each( data, function(i, item){
  405. var clone2 = document.importNode(document.querySelector('#SlicerDupliImageRow').content,true);
  406. $('[data-class=oldimg]',clone2).attr("src", item["old"] + '?rand=' + Math.random());
  407. $('[data-class=newimg]',clone2).attr("src", item["new"] + '?rand=' + Math.random());
  408. $('[data-class=changebutton]',clone2).attr("onclick", "javascript:changeimg(\"" + item["old"] + "\", \"" + item["new"] +"\", this )");
  409. $('[data-class=ImgList]',clone).append(clone2);
  410. });
  411. $('#overlaycontentsizeNotClickable').append(clone)
  412. }
  413. function changeimg(oldimg, newimg, buttonelement) {
  414. $.get( "imageOverride.php?overridden=" + oldimg + "&new=" + newimg , function( data ) {
  415. //hide button
  416. $(buttonelement).hide(200);
  417. });
  418. }
  419. function showJson(){
  420. copy2Clipboard(JSON.stringify(createJson()))
  421. }
  422. function copy2Clipboard(datalink) {
  423. const el = document.createElement('textarea');
  424. el.value = datalink;
  425. document.body.appendChild(el);
  426. el.select();
  427. document.execCommand('copy');
  428. document.body.removeChild(el);
  429. }
  430. function clearFormFull(){
  431. clearForm();
  432. $('#slicerpatterninput').val("");
  433. }
  434. function clearForm(){
  435. $('#FormPattern2').find("select").prop("selectedIndex",0);
  436. }
  437. function fillFormName(value){
  438. $("#slicerpatterninput").val(value);
  439. fillslicerpattern();
  440. }
  441. function fillpatternForm(e) {
  442. var code = (e.keyCode ? e.keyCode : e.which);
  443. if (code == 13) { //Enter keycode
  444. fillslicerpattern();
  445. }
  446. };
  447. function fillslicerpattern(){
  448. clearForm();
  449. jQuery.ajax({
  450. url: "TransformProductCode.php?ProductCode=" + $("#slicerpatterninput").val(),
  451. success: function (data) {
  452. $.each( data, function(i, item){
  453. $("#FormPattern2_Form_" + i).val(item);
  454. });
  455. },
  456. async: false
  457. });
  458. }
  459. function getAllFolders(folder = ""){ //Get DB 2 HTML //has to be synchronus in order to update before loading the rest
  460. $('#selectfolders').find('option').remove()
  461. $('#selectfolders').append("<option></option>")
  462. $.ajax({
  463. type: "GET",
  464. url: urlUniversalStorage + "server/allfolders/" + folder,
  465. async: false,
  466. dataType: "json",
  467. success: function(data) {
  468. $.each( data, function( key, value ) {
  469. $('#selectfolders').append("<option>" + value.slice(0,-1) +"</option>")
  470. });
  471. }
  472. });
  473. }
  474. function getAllFiles(folder = ""){ //Get DB 2 HTML //has to be synchronus in order to update before loading the rest
  475. $.ajax({
  476. type: "GET",
  477. url: urlUniversalStorage + "server/images/" + folder,
  478. dataType: "json",
  479. success: function(data) {
  480. $.each( data, function( key, value ) {
  481. console.log(value);
  482. console.log(urlUniversalStorage + "storage/" + folder + "/" + value);
  483. $("#sliceImg").attr("src", urlUniversalStorage + "storage/" + folder + "/" + value)
  484. fillFormName(value);
  485. submitSlices(true);
  486. /*
  487. $("#slicerpatterninput").val(value);
  488. fillslicerpattern();
  489. */
  490. });
  491. }
  492. });
  493. }
  494. function togglenext(currelement){
  495. currelement.next().slideToggle();
  496. }
  497. $(document).ready(function() {
  498. createPatternForm();
  499. updateSlicerPatternForm();
  500. loadStationsForm();
  501. getAllFolders();
  502. //press enter to fill out patternform
  503. $("#slicerpatterninput").bind("keypress", {}, fillpatternForm);
  504. /*
  505. $("#sliceImg").bind('load', function() {
  506. resizeAllRect();
  507. });*/
  508. /*
  509. $("#sliceImg").on('load', function () {
  510. resizeAllRect();
  511. });
  512. */
  513. /*
  514. $('#sliceImg').on('load',function(){
  515. resizeAllRect();
  516. });
  517. */
  518. $.getJSON( "../server/json/SlicerConfig.json", function( data ) {
  519. if(!data["SlicerRectForm"]){
  520. $("#addRectanglesGroup").hide();
  521. $("#imgRectangles").hide();
  522. $("#Json2ClipboardGroup").hide();
  523. }
  524. });
  525. $(document).on('submit', '#sliceform', function() { //prevent page reload on form submit
  526. return false;
  527. });
  528. $("#showJson").click(function() {
  529. showJson();
  530. });
  531. $("#multiCut").click(function() {
  532. getAllFiles($('#selectfolders').val());
  533. });
  534. $('#pattern2').text("");
  535. var clone = document.importNode(document.querySelector('#patternClone').content,true);
  536. $('[data-class=part]',clone).limitkeypress({rexp: keypressRegex()});
  537. $("#pattern2").append(clone);
  538. //handle zoom event in order to fix rectangle position
  539. window.addEventListener("resize", resizeAllRect, false);
  540. });