Bläddra i källkod

Productcode transformation updated, added WA-NR check slides

Juergen 'eTM' Mangler 2 år sedan
förälder
incheckning
8682942943

+ 222 - 69
server/json/LaserUI.json

@@ -2,182 +2,335 @@
   "Row1": [
     {
       "Label": "RP 31",
-      "File": "File1",
-      "Image": "ImageTest.JPG"
+      "File": "CE_SerNr_SlotT1_RP.31.rotiert",
+      "Image": "Positionierbild_RP31.jpg"
     },
     {
       "Label": "RP 36",
-      "File": "File2",
-      "Image": "Image2.jpg"
+      "File": "CE_SerNr_SlotT1_RP.36.rotiert",
+      "Image": "Positionierbild_RP36.jpg"
     },
     {
       "Label": "RP 41",
-      "File": "File3",
-      "Image": "Image3.jpg"
+      "File": "CE_SerNr_SlotT1_RP.41.rotiert",
+      "Image": "Positionierbild_RP41.jpg"
     },
     {
       "Label": "RP 46",
-      "File": "File4",
-      "Image": "Image4.jpg"
+      "File": "CE_SerNr_SlotT1_RP.46.rotiert",
+      "Image": "Positionierbild_RP46.jpg"
     },
     {
       "Label": "RP 51",
-      "File": "File5",
-      "Image": "Image5.jpg"
+      "File": "CE_SerNr_SlotT1_RP.51.rotiert",
+      "Image": "Positionierbild_RP51.jpg"
     },
     {
       "Label": "RP 56",
-      "File": "File6",
-      "Image": "Image6.jpg"
+      "File": "CE_SerNr_SlotT1_RP.56.rotiert",
+      "Image": "Positionierbild_RP56.jpg"
     },
     {
       "Label": "RP 61",
-      "File": "File6",
-      "Image": "Image6.jpg"
+      "File": "CE_SerNr_SlotT1_RP.61.rotiert",
+      "Image": "Positionierbild_RP61.jpg"
     },
     {
       "Label": "RP 66",
-      "File": "File6",
-      "Image": "Image6.jpg"
+      "File": "CE_SerNr_SlotT1_RP.66.rotiert",
+      "Image": "Positionierbild_RP66.jpg"
     },
     {
       "Label": "RP 71",
-      "File": "File6",
-      "Image": "Image6.jpg"
+      "File": "CE_SerNr_SlotT1_RP.71.rotiert",
+      "Image": "Positionierbild_RP71.jpg"
     },
     {
       "Label": "RP 76",
-      "File": "File6",
-      "Image": "Image6.jpg"
+      "File": "CE_SerNr_SlotT1_RP.76.rotiert",
+      "Image": "Positionierbild_RP76.jpg"
     },
     {
       "Label": "RP 81",
-      "File": "File6",
-      "Image": "Image6.jpg"
+      "File": "CE_SerNr_SlotT1_RP.81.rotiert",
+      "Image": "Positionierbild_RP81.jpg"
     },
     {
       "Label": "RP 86",
-      "File": "File6",
-      "Image": "Image6.jpg"
+      "File": "CE_SerNr_SlotT1_RP.86.rotiert",
+      "Image": "Positionierbild_RP86.jpg"
     },
     {
       "Label": "RP 91",
-      "File": "File6",
-      "Image": "Image6.jpg"
+      "File": "CE_SerNr_SlotT1_RP.91.rotiert",
+      "Image": "Positionierbild_RP91.jpg"
     }
   ],
   "Row2": [
     {
       "Label": "EP 31",
-      "File": "File8",
-      "Image": "Image8.jpg"
+      "File": "CE_SerNr_SlotT1_EP.31.rotiert",
+      "Image": "Positionierbild_EP31.jpg"
     },
     {
       "Label": "EP 36",
-      "File": "File9",
-      "Image": "Image9.jpg"
+      "File": "CE_SerNr_SlotT1_EP.36.rotiert",
+      "Image": "Positionierbild_EP36.jpg"
     },
     {
       "Label": "EP 41",
-      "File": "File10",
-      "Image": "Image10.jpg"
+      "File": "CE_SerNr_SlotT1_EP.41.rotiert",
+      "Image": "Positionierbild_EP41.jpg"
     },
     {
       "Label": "EP 46",
-      "File": "File11",
-      "Image": "Image11.jpg"
+      "File": "CE_SerNr_SlotT1_EP.46.rotiert",
+      "Image": "Positionierbild_EP46.jpg"
     },
     {
       "Label": "EP 51",
-      "File": "File12",
-      "Image": "Image12.jpg"
+      "File": "CE_SerNr_SlotT1_EP.51.rotiert",
+      "Image": "Positionierbild_EP51.jpg"
     },
     {
       "Label": "EP 56",
-      "File": "File11",
-      "Image": "Image11.jpg"
+      "File": "CE_SerNr_SlotT1_EP.56.rotiert",
+      "Image": "Positionierbild_EP56.jpg"
     },
     {
       "Label": "EP 61",
-      "File": "File11",
-      "Image": "Image11.jpg"
+      "File": "CE_SerNr_SlotT1_EP.61.rotiert",
+      "Image": "Positionierbild_EP61.jpg"
     },
     {
       "Label": "EP 66",
-      "File": "File11",
-      "Image": "Image11.jpg"
+      "File": "CE_SerNr_SlotT1_EP.66.rotiert",
+      "Image": "Positionierbild_EP66.jpg"
     },
     {
       "Label": "EP 71",
-      "File": "File11",
-      "Image": "Image11.jpg"
+      "File": "CE_SerNr_SlotT1_EP.71.rotiert",
+      "Image": "Positionierbild_EP71.jpg"
     },
     {
       "Label": "EP 76",
-      "File": "File11",
-      "Image": "Image11.jpg"
+      "File": "CE_SerNr_SlotT1_EP.76.rotiert",
+      "Image": "Positionierbild_EP76.jpg"
     },
     {
       "Label": "EP 81",
-      "File": "File11",
-      "Image": "Image11.jpg"
+      "File": "CE_SerNr_SlotT1_EP.81.rotiert",
+      "Image": "Positionierbild_EP81.jpg"
     },
     {
       "Label": "EP 86",
-      "File": "File11",
-      "Image": "Image11.jpg"
+      "File": "CE_SerNr_SlotT1_EP.86.rotiert",
+      "Image": "Positionierbild_EP86.jpg"
     },
     {
       "Label": "EP 91",
-      "File": "File11",
-      "Image": "Image11.jpg"
+      "File": "CE_SerNr_SlotT1_EP.91.rotiert",
+      "Image": "Positionierbild_EP91.jpg"
     }
   ],
   "SpecialButtons": [
+     {
+      "Label": "EP 31 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.31.rotiert",
+      "Image": "Positionierbild_EP31.jpg",
+      "PositionX": 48,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+     },
+    {
+      "Label": "EP 36 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.36.rotiert",
+      "Image": "Positionierbild_EP36.jpg",
+      "PositionX": 176,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 41 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.41.rotiert",
+      "Image": "Positionierbild_EP41.jpg",
+      "PositionX": 304,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 46 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.46.rotiert",
+      "Image": "Positionierbild_EP46.jpg",
+      "PositionX": 432,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 51 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.51.rotiert",
+      "Image": "Positionierbild_EP51.jpg",
+      "PositionX": 560,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 56 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.56.rotiert",
+      "Image": "Positionierbild_EP56.jpg",
+      "PositionX": 688,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 61 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.61.rotiert",
+      "Image": "Positionierbild_EP61.jpg",
+      "PositionX": 816,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 66 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.66.rotiert",
+      "Image": "Positionierbild_EP66.jpg",
+      "PositionX": 944,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 71 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.71.rotiert",
+      "Image": "Positionierbild_EP71.jpg",
+      "PositionX": 1072,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 76 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.76.rotiert",
+      "Image": "Positionierbild_EP76.jpg",
+      "PositionX": 1200,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 81 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.81.rotiert",
+      "Image": "Positionierbild_EP81.jpg",
+      "PositionX": 1328,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 86 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.86.rotiert",
+      "Image": "Positionierbild_EP86.jpg",
+      "PositionX": 1456,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
+    {
+      "Label": "EP 91 FLU",
+      "File": "CE_SerNr_FLU_SlotT1_EP.91.rotiert",
+      "Image": "Positionierbild_EP91.jpg",
+      "PositionX": 1584,
+      "PositionY": 350,
+      "SizeX": 97,
+      "SizeY": 80
+    },
     {
       "Label": "HPM",
-      "File": "File1",
-      "Image": "ImageTest.JPG",
+      "File": "CE_SerNr_SlotT1_HPM",
+      "Image": "Positionierbild_HPM_MB19_MB27.jpg",
       "PositionX": 400,
-      "PositionY": 400,
+      "PositionY": 500,
       "SizeX": 300,
       "SizeY": 100
     },
     {
       "Label": "MB19",
-      "File": "File1",
-      "Image": "ImageTest.JPG",
+      "File": "CE_SerNr_SlotT1_MB19",
+      "Image": "Positionierbild_HPM_MB19_MB27.jpg",
       "PositionX": 400,
-      "PositionY": 525,
+      "PositionY": 625,
       "SizeX": 150,
       "SizeY": 50
     },
     {
       "Label": "MB22",
-      "File": "File1",
-      "Image": "ImageTest.JPG",
-      "PositionX": 400,
-      "PositionY": 600,
-      "SizeX": 150,
+      "File": "CE_SerNr_SlotT1_MB22",
+      "Image": "Positionierbild_SKA-SKI_MB22.jpg",
+      "PositionX": 600,
+      "PositionY": 650,
+      "SizeX": 100,
       "SizeY": 50
     },
     {
       "Label": "MB27",
-      "File": "File1",
-      "Image": "ImageTest.JPG",
+      "File": "CE_SerNr_SlotT1_MB27",
+      "Image": "Positionierbild_HPM_MB19_MB27.jpg",
       "PositionX": 600,
-      "PositionY": 650,
+      "PositionY": 720,
       "SizeX": 100,
       "SizeY": 100
     },
     {
       "Label": "SKA-SKI",
-      "File": "File1",
-      "Image": "ImageTest.JPG",
+      "File": "CE_SerNr_SlotT1_SKA-SKI",
+      "Image": "Positionierbild_SKA-SKI_MB22.jpg",
       "PositionX": 1400,
-      "PositionY": 400,
+      "PositionY": 500,
       "SizeX": 150,
       "SizeY": 150
+    },
+    {
+      "Label": "A0",
+      "File": "CE_SerNr_SlotT1_A0",
+      "Image": "Positionierbild_A0_AZ29_AZ37_AZ38.jpg",
+      "PositionX": 200,
+      "PositionY": 850,
+      "SizeX": 75,
+      "SizeY": 75
+    },
+    {
+      "Label": "AZ29",
+      "File": "CE_SerNr_SlotT1_AZ29",
+      "Image": "Positionierbild_A0_AZ29_AZ37_AZ38.jpg",
+      "PositionX": 350,
+      "PositionY": 850,
+      "SizeX": 75,
+      "SizeY": 75
+    },
+    {
+      "Label": "AZ37",
+      "File": "CE_SerNr_SlotT1_AZ37",
+      "Image": "Positionierbild_A0_AZ29_AZ37_AZ38.jpg",
+      "PositionX": 500,
+      "PositionY": 850,
+      "SizeX": 75,
+      "SizeY": 75
+    },
+    {
+      "Label": "AZ38",
+      "File": "CE_SerNr_SlotT1_AZ38",
+      "Image": "Positionierbild_A0_AZ29_AZ37_AZ38.jpg",
+      "PositionX": 650,
+      "PositionY": 850,
+      "SizeX": 75,
+      "SizeY": 75
     }
   ]
 }

+ 2 - 1
server/json/ProductCode.json

@@ -168,7 +168,8 @@
       "types": [
         "",
         "*",
-        "SKG"
+        "SKG",
+        "SET1"
       ]
     }
   ]

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 945
server/json/Rectangle.json


+ 1 - 1
server/json/SlicerConfig.json

@@ -1,7 +1,7 @@
 {
   "saveLocation": [
     "../../universal-storage/storage/Stationsbilder/Einzelbilder/Station3/",
-    "../../universal-storage/storage/Stationsbilder/Einzelbilder/Stationtmp/",
+    "../../universal-storage/storage/Stationsbilder/Einzelbilder/Station3/Stationtmp/",
     "../../universal-storage/storage/Stationsbilder/Einzelbilder/Station99/"
   ],
   "SlicerRectForm": true

+ 1 - 1
server/was.conf

@@ -1,5 +1,5 @@
 :port: 9323
 :appconf:
   wizurl: https://centurio.evva.com/wiz/wiztest/
-  wasurl: https://centurio.work/customers/evva/was/
+  wasurl: https://centurio.evva.com/departments/emontage/WAS/
   stations: [ 1, 2, 3, 8, 99]

+ 16 - 12
server/was.rb

@@ -62,7 +62,7 @@ end
 
 class GetStations < Riddl::Implementation
   def response
-    result = $db.execute "SELECT * FROM stations"
+    result = $db.execute "SELECT * FROM stations ORDER BY station ASC"
     builder = Nokogiri::XML::Builder.new do |xml|
       xml.stations {
         result.each do |row|
@@ -102,7 +102,7 @@ class CreateStation < Riddl::Implementation
   end
   
   def response
-    GetStation::createDB
+    CreateStation::createDB(7)
   end
 end
 
@@ -803,16 +803,20 @@ class SaveNewAssignment < Riddl::Implementation
     checkimage = $db.execute "SELECT * FROM assignments WHERE image = '#{form["img"]}'"
     #if image not stored create new assignment with pattern, otherwise only add pattern
     if(checkimage[0] == nil)    
-      $db.execute("INSERT INTO assignments (ID, image) VALUES (?,?)", [id, form["img"]])
-      form["parts"].each{ |key,val|
-          $db.execute("INSERT INTO patternassignments (ID, AssID, type, value) VALUES (?,?,?,?)", [id, 0, key, val])
-      }
-      $db.execute("INSERT INTO patternassignments (ID, AssID, type, value) VALUES (?,?,?,?)", [id, 0, "STATION", form["station"]])
-      $db.execute("INSERT INTO patternassignments (ID, AssID, type, value) VALUES (?,?,?,?)", [id, 0, "TEXT", form["assignmentText"]])
-      
-      ret = {:id => id}
+      #check if assignment would overlap
+      if (!ListAssignmentSearch::prepare(@a[0][:appconf]["wasurl"], pattern.join('.'), form["station"], form["assignmentText"]).any?)   
+        $db.execute("INSERT INTO assignments (ID, image) VALUES (?,?)", [id, form["img"]])
+        form["parts"].each{ |key,val|
+            $db.execute("INSERT INTO patternassignments (ID, AssID, type, value) VALUES (?,?,?,?)", [id, 0, key, val])
+        }
+        $db.execute("INSERT INTO patternassignments (ID, AssID, type, value) VALUES (?,?,?,?)", [id, 0, "STATION", form["station"]])
+        $db.execute("INSERT INTO patternassignments (ID, AssID, type, value) VALUES (?,?,?,?)", [id, 0, "TEXT", form["assignmentText"]])
+        
+        ret = {:id => id}
+      end
       Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(ret))
     else
+      #pp "Im Else"
       maxID = $db.execute "SELECT MAX(AssID) FROM patternassignments WHERE ID ='#{checkimage[0][0]}'"
       
       if(maxID[0][0] == nil)
@@ -829,7 +833,7 @@ class SaveNewAssignment < Riddl::Implementation
         }
         $db.execute("INSERT INTO patternassignments (ID, AssID, type, value) VALUES (?,?,?,?)", [checkimage[0][0], maxID, "STATION", form["station"]])
         $db.execute("INSERT INTO patternassignments (ID, AssID, type, value) VALUES (?,?,?,?)", [checkimage[0][0], maxID, "TEXT", form["assignmentText"]])
-        
+        #pp "Added Assignment"
         ret = {:id => checkimage[0][0]}
       end
       Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(ret))
@@ -917,7 +921,7 @@ class ListAssignmentSearch < Riddl::Implementation
     
     emptypatternparts = []
     #fullcode = JSON.parse( File.read(File.join("json" , "ProductCode.json")))
-    puts File.join(File.dirname(__dir__),"server/json/ProductCode.json")
+    #puts File.join(File.dirname(__dir__),"server/json/ProductCode.json")
     fullcode = JSON.parse( File.read(File.join(File.dirname(__dir__),"server/json/ProductCode.json")))
     
     fullcode["pattern"].each do |key|

+ 79 - 19
ui/LaserUI/index.html

@@ -39,30 +39,36 @@ function createButtons(i, item){
 function createSpecialButtons(i, item){
   var clone = document.importNode(document.querySelector('#Buttonentryspecial').content,true);
   
-  
   $('[data-class=entryitem]',clone).text(item["Label"]);
   $('[data-class=entryitem]',clone).attr('onclick', "buttonclick('" + item["File"] + "','" + item["Image"] + "','" + item["Label"] + "')");
   
-  
-  
   $('[data-class=entrydiv]',clone).css({"left": item["PositionX"], "top": item["PositionY"] });
   $('[data-class=entryitem]',clone).css({"width": item["SizeX"], "height": item["SizeY"]});
   
-   
-  
-  
   $('#ButtonRows').append(clone);
 }
 
 function buttonclick(imgfile, imgimg, buttontext){
   //alert(imgimg);
-  $("#actualbuttonImage").attr("src","https://centurio.work/customers/evva/universal-storage/storage/Laser/VorschauBilder/" + imgimg)
+  $("#actualbuttonImage").attr("src","https://centurio.evva.com/departments/emontage/universal-storage/storage/Laser/VorschauBilder/" + imgimg)
   
   $("#currentFile").text("Current Selection: " + buttontext);
   
   $("#ButtonRows").hide(); 
   $("#buttonImage").show();
   
+  breakmarking();
+  
+  LoadNewFile(imgfile)
+  
+  
+  
+  
+  
+  
+  
+  
+  
 }
 
 function showallbuttons(){
@@ -70,13 +76,14 @@ function showallbuttons(){
   $("#ButtonRows").show();
 }
 
+
 function updateloadfiledropdown(){
   $('#loadfiledropdown')
     .find('option')
     .remove()
   $.ajax({
     type: "GET",
-    url: "/listfiles",
+    url: "http://172.16.14.236:9337/listfiles",
     datatype: "json",
     success: function(data){
       $(data).each(function(item, val){
@@ -91,8 +98,9 @@ function ListFiles() {
   updateloadfiledropdown()
   $.ajax({
     type: "GET",
-    url: "/listfiles",
+    url: "http://172.16.14.236:9337/listfiles",
     datatype: "json",
+    async: false,
     success: function(data){
       $("#loadedfiles").text(JSON.stringify(data, undefined, 2))
     }
@@ -100,11 +108,12 @@ function ListFiles() {
 }
 
 
-function LoadNewFile() {
+function LoadNewFile(filename) {
   $.ajax({
     type: "GET",
-    url: "/setfile?filename=" + $("#loadfiledropdown :selected").text(),
+    url: "http://172.16.14.236:9337/setfile?filename=" + filename,
     datatype: "json",
+    async: false,
     success: function(data){
     
     }
@@ -115,8 +124,9 @@ function LoadNewFile() {
 function ShowLoadedFile() {
   $.ajax({
     type: "GET",
-    url: "/getfile",
+    url: "http://172.16.14.236:9337/getfile",
     datatype: "json",
+    async: false,
     success: function(data){
       $("#loadedfile").text(JSON.stringify(data, undefined, 2))
     }
@@ -126,8 +136,9 @@ function ShowLoadedFile() {
 function ShowStats() {
   $.ajax({
     type: "GET",
-    url: "/statistics",
+    url: "http://172.16.14.236:9337/statistics",
     datatype: "json",
+    async: false,
     success: function(data){
     	$("#stats").text(JSON.stringify(data, undefined, 2))
     }
@@ -137,8 +148,9 @@ function ShowStats() {
 function ShowInputstates() {
   $.ajax({
     type: "GET",
-    url: "/getinputstate",
+    url: "http://172.16.14.236:9337/getinputstate",
     datatype: "json",
+    async: false,
     success: function(data){
     	$("#inputstates").text(JSON.stringify(data, undefined, 2))
     }
@@ -148,8 +160,9 @@ function ShowInputstates() {
 function SetText() {
   $.ajax({
     type: "GET",
-    url: "/settext?t=0&val=" + $("#seriennummber").val(),
+    url: "http://172.16.14.236:9337/settext?t=0&val=" + $("#seriennummber").val(),
     datatype: "json",
+    async: false,
     success: function(data){
     	$("#inputstates").text(JSON.stringify(data, undefined, 2))
     }
@@ -160,8 +173,9 @@ function SetText() {
 function SetSlot(slot) {
   $.ajax({
     type: "GET",
-    url: "/setslot?t=" + slot +"&val=" + $("#slotvalue").val(),
+    url: "http://172.16.14.236:9337/setslot?t=" + slot +"&val=" + $("#slotvalue").val(),
     datatype: "json",
+    async: false,
     success: function(data){
       $("#laserwrite").text("Seriennummer: " + $("#slotvalue").val() + " geschrieben.")    
     }
@@ -172,14 +186,39 @@ function SetSlot(slot) {
 function GetSlot(slot) {
   $.ajax({
     type: "GET",
-    url: "/getslot?t=" + slot,
+    url: "http://172.16.14.236:9337/getslot?t=" + slot,
     datatype: "json",
+    async: false,
     success: function(data){
       $("#getSlot").text(JSON.stringify(data, undefined, 2))
     }
   });
 }
 
+
+function breakmarking() {
+  $.ajax({
+    type: "GET",
+    url: "http://172.16.14.236:9337/breakmarking",
+    datatype: "json",
+    async: false,
+    success: function(data){
+    
+    }
+  });
+}
+
+function resumemarking() {
+  $.ajax({
+    type: "GET",
+    url: "http://172.16.14.236:9337/resumemarking",
+    datatype: "json",
+    async: false,
+    success: function(data){
+    
+    }
+  });
+}
 function ShowOutputStates() {
   alert("Not yet implemented");
 }
@@ -188,7 +227,7 @@ function ShowOutputStates() {
 function StartLaser() {
   $.ajax({
     type: "GET",
-    url: "/startlaser",
+    url: "http://172.16.14.236:9337/startlaser",
     datatype: "json",
     success: function(data){
       $("#startlaser").text("Laser gestartet.")
@@ -196,6 +235,19 @@ function StartLaser() {
   });
 }
 
+
+function GetSerialFromServer() {
+  $.ajax({
+    type: "GET",
+    url: "http://172.16.14.236:9337/getSerialnumber",
+    datatype: "json",
+    success: function(data){
+      $("#slotvalue").val(data["sn"])
+    }
+  });
+}
+
+
 </script>
   <body>
     <div id="LogoTop">
@@ -225,7 +277,15 @@ function StartLaser() {
       <div id="buttonImage" class="paddingleft3" >
         <img id="actualbuttonImage" style="max-height:700px" src="" alt=""><br>
 			  <button onclick="showallbuttons()" style="margin-top:3em; padding:2em;">Zurück zur File auswahl</button>
-        <span id="currentFile"></span>
+        <span id="currentFile"></span><br>
+        
+        <div class="paddingtop3">
+			    Seriennummer: <input id="slotvalue"></input>
+			  </div>
+        
+        <button onclick="GetSerialFromServer()" style="margin-top:3em; padding:2em;">GetSerialNumber</button><br>
+
+
         <br>
         
       </div>

+ 24 - 2
ui/TransformProductCode.php

@@ -33,7 +33,12 @@
       foreach($json->pattern as $node){
         foreach($node->types as $type){
           if($productarray[$i] == $type && $type != "*"){
-            $asocarray[$node->abk] = $productarray[$i];
+            if(!array_key_exists($node->abk, $asocarray)){ //Add entry when not set
+              $asocarray[$node->abk] = $productarray[$i];
+            }
+            else if($asocarray[$node->abk] == ""){ //allow to update entry when "empty"
+              $asocarray[$node->abk] = $productarray[$i];
+            }
           }
         }
       }
@@ -50,6 +55,8 @@
     
   }
   
+  
+  
   if(!array_key_exists("Pf", $asocarray)){
     $asocarray["Pf"] = "KeineAngabePf";
   }
@@ -72,9 +79,24 @@
   if($asocarray["Kf"] == ""){
     $asocarray["Kf"] = "KeineAngabeKf";
   }
+  if($asocarray["Zi"] != ""){ //Replace zylinder innen K with nothing    
+    $asocarray["Zi"] = str_replace("K", "", $asocarray["Zi"]);
+  }
   if($asocarray["Zi"] == ""){
     $asocarray["Zi"] = "KeineAngabeZi";
   }
   
-  echo json_encode($asocarray);
+  
+  //reorder 4 same ordering
+  foreach($json->pattern as $node){
+    if(array_key_exists($node->abk, $asocarray)){
+        $asocarray2[$node->abk] = $asocarray[$node->abk];
+    }
+    else{
+        $asocarray2[$node->abk] = "";
+      
+    }
+  }
+  
+  echo json_encode($asocarray2);
 ?>

+ 33 - 0
ui/WaNrCheck/CreateImage.php

@@ -0,0 +1,33 @@
+<?php
+
+
+
+
+header("Content-type: image/png");
+$string = htmlspecialchars($_GET["WaNr"]);
+$posi = htmlspecialchars($_GET["Posi"]);
+//$stringposi = htmlspecialchars($_GET["Position"]);
+
+$im     = imagecreatefrompng("background_klein.png");
+//$im = imagecreate( 1920, 1080 );
+$background = imagecolorallocate( $im, 255, 255, 255 );
+$grey = imagecolorallocate( $im, 30, 30, 30 );
+
+
+
+$font = './OpenSans.ttf';
+
+
+imagettftext($im, 40, 0, 20, 50, $grey, $font, "Bitte eine Seriennummer zu diesen Daten scannen:");
+imagettftext($im, 40, 0, 20, 180, $grey, $font, "WA-NR:      " . $string);
+imagettftext($im, 40, 0, 20, 250, $grey, $font, "Position:    " . $posi);
+//imagettftext($im, 50, 0, 200, 630, $grey, $font, "Stimmt die Position:  " . $stringposi);
+
+imagepng($im);
+imagedestroy($im);
+
+
+
+
+
+?>

+ 47 - 0
ui/WaNrCheck/CreateImageAll.php

@@ -0,0 +1,47 @@
+<?php
+
+
+
+
+header("Content-type: image/png");
+$wanr = htmlspecialchars($_GET["WaNr"]);
+$posi = htmlspecialchars($_GET["Posi"]);
+$prcode = htmlspecialchars($_GET["Produktcode"]);
+$scan1 = htmlspecialchars($_GET["ScanInnen"]);
+$scan2 = htmlspecialchars($_GET["ScanAussen"]);
+//$stringposi = htmlspecialchars($_GET["Position"]);
+
+$im     = imagecreatefrompng("background.png");
+//$im = imagecreate( 1920, 1080 );
+$background = imagecolorallocate( $im, 255, 255, 255 );
+$grey = imagecolorallocate( $im, 30, 30, 30 );
+
+
+
+$font = './OpenSans.ttf';
+
+if(isset($_GET['WaNr']) && !empty($_GET['WaNr'])){
+  imagettftext($im, 50, 0, 200, 550, $grey, $font, "WA-NR:   " . $wanr);
+}
+if(isset($_GET['Posi']) && !empty($_GET['Posi'])){
+  imagettftext($im, 50, 0, 200, 650, $grey, $font, "Posi:   " . $posi);
+}
+if(isset($_GET['Produktcode']) && !empty($_GET['Produktcode'])){
+  imagettftext($im, 50, 0, 200, 750, $grey, $font, "Produktcode:   " . $prcode);
+}
+if(isset($_GET['ScanInnen']) && !empty($_GET['ScanInnen'])){ 
+  imagettftext($im, 50, 0, 200, 850, $grey, $font, "Scan Innen:   " . $scan1);
+}
+if(isset($_GET['ScanAussen']) && !empty($_GET['ScanAussen'])){
+  imagettftext($im, 50, 0, 200, 950, $grey, $font, "Scan Außen:   " . $scan2);
+}
+//imagettftext($im, 50, 0, 200, 630, $grey, $font, "Stimmt die Position:  " . $stringposi);
+
+imagepng($im);
+imagedestroy($im);
+
+
+
+
+
+?>

+ 10 - 0
ui/WaNrCheck/ImageXML.php

@@ -0,0 +1,10 @@
+<?php
+
+
+header('Content-Type: application/xml; charset=utf-8');
+
+$string = htmlspecialchars($_GET["WaNr"]);
+
+
+echo '<image id="1"> <variant lang="de" label="ShowWANumber">https://centurio.evva.com/departments/emontage/WAS/ui/WaNrCheck/CreateImage.php?WaNr='. json_decode($string) . '</variant></image>';
+?>

BIN
ui/WaNrCheck/OpenSans.ttf


BIN
ui/WaNrCheck/background.jpg


BIN
ui/WaNrCheck/background.png


BIN
ui/WaNrCheck/background_klein.png


+ 3 - 3
ui/config.php

@@ -1,5 +1,5 @@
 <?php
-  $wasUrl ="https://centurio.work/customers/evva/was/";
-  $transformCodeUrl ="https://centurio.work/customers/evva/was/";
-  $universalStorageEinzelbilder = "https://centurio.work/customers/evva/universal-storage/storage/Stationsbilder/Einzelbilder/";
+  $wasUrl ="https://centurio.evva.com/departments/emontage/WAS/";
+  $transformCodeUrl ="https://centurio.evva.com/departments/emontage/WAS/";
+  $universalStorageEinzelbilder = "https://centurio.evva.com/departments/emontage/universal-storage/storage/Stationsbilder/Einzelbilder/";
 ?>

+ 21 - 0
ui/css/evvaButton.css

@@ -0,0 +1,21 @@
+.formbutton{
+ display:inline;
+ height: 5em;
+ width: 7em;
+ border: 0.3em solid black;
+ border-radius: 50%;
+ background-color: #FCE500;
+ font-weight: bold;
+ font-size: 1.3em;
+ bottom: 0.3em;
+ padding: 1.5em;
+ margin-top: 1em;
+ text-decoration: none;
+ text-align: center;
+ color:black;
+ margin-right: 2em;
+}
+html{
+  font-size: 40px;
+  background-color: #333333;
+}

+ 11 - 3
ui/index.html

@@ -141,7 +141,7 @@
             <div class="wasGroup">
               <div class="wasLeft">Preview</div>
               <div class="wasRight">
-                <a href="https://centurio.work/out/frames/WAS_Test/">WIZ-Preview</a>
+                <a href="https://centurio.evva.com/out/frames/WAS_Test/">WIZ-Preview</a>
               </div>
             </div>
             
@@ -359,7 +359,11 @@
           <select id="selectfolders" class="width100">
           </select>
           
-          <button class="width100" type="button" id="multiCut">Cut Folder</button>
+          <button class="width100" type="button" id="multiCut">Cut Folder</button><br>
+          
+          
+          <span id="cuttingProgress" >
+          </span>
       
       </div>
       
@@ -652,7 +656,10 @@
       <a href="javascript:searchAssignmentForm();">Search</a><br>
     
     
-    
+      <a class="showremoveitems" href="javascript:removeSelectedItems();" style="display: inline;">[Remove Selected Items]</a>
+      <a class="showremoveitems" href="javascript:selectAll();" style="display: inline;">[Select All]</a> 
+      <a class="showremoveitems" href="javascript:unselectAll();" style="display: inline;">[De-Select All]</a> 
+      <br>
     
       List of all Images
       
@@ -666,6 +673,7 @@
           </td>
           <td data-class='item'><a href=''></a></td>
           <!--<td data-class='duplicate' class="stationAction"><a href=''>⎘</a></td>-->
+          <td><input data-class="multiRemovelink" class="showremoveitems" type="checkbox" name="" value=""></td>
           <td data-class='delete' class="assignmentAction"><a href=''>[⨯]</a></td>
         </tr>
       </template>

+ 46 - 6
ui/js/assignment.js

@@ -104,7 +104,7 @@ function getImgText(imgtext){
 }
 
 function submitAssignment(newassignment){
-  
+  //console.log("Submiting Assignment")
   var obj = new Object();
   var skipasscreationform = false;
   if(typeof newassignment !== "undefined"){
@@ -125,13 +125,17 @@ function submitAssignment(newassignment){
     obj.assignmentText = $('#assignmentText').val();
   }
   
+  //console.log(obj)
+  
   $.ajax({
     type: "Post",
 		data: JSON.stringify(obj),
 		headers: {"content-id": "list"},
     contentType: "application/json",
     url: "../server/assignments/",
-    success: function(res) {     
+    async: false,
+    success: function(res) {  
+      //console.log("Posted")   
       if(!skipasscreationform){
         createAssignmentForm(res.id, $('#addExternalImageAssignment').val())
       }
@@ -142,13 +146,29 @@ function submitAssignment(newassignment){
   });
 }
 
-function deleteAssignment(assignmentID) { //Delete From DB
-  if (confirm('Are you really, really, REALLY sure!')) {
+
+function removeSelectedItems(){
+  var removedItems = [];
+  $("#assignmentslist input[type=checkbox]:checked").each(function(index, data){
+    removedItems.push($(data).attr("name"));
+  });
+  
+  if (confirm('Deleting: ' + removedItems)) {
+    $("#assignmentslist input[type=checkbox]:checked").each(function(index, data){
+      //only refresh item list when last item is removed
+      deleteAssignment($(data).attr("name"), false, index === ($("#assignmentslist input[type=checkbox]:checked").length -1))
+    });
+  }
+}
+
+function deleteAssignment(assignmentID, ask = true, refresh = true) { //Delete From DB
+  if (!ask || confirm('Are you really, really, REALLY sure!')) {
     $.ajax({
       type: "DELETE",
       url: "../server/assignments/" + assignmentID,
       success: function(res) { 
-        initAssignment();
+        if(refresh)
+          initAssignment();
       }
     });
   }
@@ -160,7 +180,7 @@ function deleteSingleAssignment(assignmentID, patternID) { //Delete From DB
       type: "DELETE",
       url: "../server/assignments/" + assignmentID + "/" + patternID,
       success: function(res) {
-        initAssignment();
+        //initAssignment();
         createAssignmentForm(assignmentID, $('#addExternalImageAssignment').val())
       }
     });
@@ -199,6 +219,11 @@ function initAssignment(){
           $('[data-class=item] a',clonePattern).text(item);
           $('[data-class=item] a',clonePattern).attr('href','javascript:createAssignmentForm(' + i + ',"' + item + '");');
           //$('[data-class=duplicate] a',clonePattern).attr('href','javascript:duplicatePattern(' + curstation + ','+ $(this).attr('id') + ');');
+          
+          
+          $('[data-class=multiRemovelink]',clonePattern).attr('name', i );
+
+          
           $('[data-class=delete] a',clonePattern).attr('href','javascript:deleteAssignment(' + i + ');');
           $('#assignmentslist').append(clonePattern);
       });
@@ -219,6 +244,21 @@ function initAssignment(){
 }
 
 
+function selectAll(){
+  $(':input','#assignmentslist')
+  .not(':button, :submit, :reset, :hidden')
+  .val('')
+  .prop('checked', true)
+  .prop('selected', true);
+}
+
+function unselectAll(){
+  $(':input','#assignmentslist')
+  .not(':button, :submit, :reset, :hidden')
+  .val('')
+  .prop('checked', false)
+  .prop('selected', false);
+}
 
 function initAssignmentTable(){
   $('#assignmentdetaillist').text("");

+ 1 - 1
ui/js/config.js

@@ -1,2 +1,2 @@
 
-var urlUniversalStorage = "https://centurio.work/customers/evva/universal-storage/";
+var urlUniversalStorage = "https://centurio.evva.com/departments/emontage/universal-storage/";

+ 10 - 4
ui/js/imageSlicer.js

@@ -112,7 +112,7 @@ function addRectangle1(id,x,y,w,h,pattern,idtext,assignmentsstation,assignments)
 	  dataType: "xml",
     success: function(xml) {
       $(xml).find('station').each(function(index){
-        console.log($(this).attr('id'));
+        //console.log($(this).attr('id'));
         $('[data-class=AssignmentOptionen]',clonepattern).append('<option value="' + $(this).attr('id') +'">' + $(this).attr('id') +'</option>');
       });
     },
@@ -490,7 +490,7 @@ function submitSlices(skip = false){
             //get all assignments of current Rectangle
             var assignments = assignmentGetAllAssignments($(this), true);
             //in case no assignments are found do next rect
-            console.log(assignments);
+            //console.log(assignments);
             if(Object.keys(assignments).length === 0){
               ++counter;
               return true;
@@ -504,9 +504,10 @@ function submitSlices(skip = false){
             
             
             //Save assignments
-            
+            //console.log("Save Assignemnts")
             $.each(assignmentstation, function(i, station) {
               $.each(result, function(i, item) {
+                //console.log("saving " + i);
                 var obj = new Object();
                 obj.img = data.url[counter];
                 obj.station = station;
@@ -515,7 +516,11 @@ function submitSlices(skip = false){
 
                 obj.parts = item;
                 obj.assignmentText = txt;
-                console.log(obj);
+                //console.log(obj);
+                
+                $("#cuttingProgress").text("Saving: " + JSON.stringify(obj))
+
+                
                 //use storage function from assignment.js
                 submitAssignment(obj);
               });
@@ -655,6 +660,7 @@ function getAllFiles(folder = ""){ //Get DB 2 HTML //has to be synchronus in ord
         console.log(urlUniversalStorage + "storage/" + folder + "/" + value);
         $("#sliceImg").attr("src", urlUniversalStorage + "storage/" + folder + "/" + value)
         fillFormName(value);
+        refreshassignments();
         
         submitSlices(true);
         /*