From d9515f90f384f92d8a6c8ce245d3a77771c2cc81 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Tue, 28 Jul 2020 20:39:49 +0200 Subject: [PATCH] Fix conf code di stampa + aggiunte altre conf x reports --- AppData/reportPrinter.cs | 8 +- NKC_SDK/Enums.cs | 525 +++++++++--------- .../Controllers/PrintQueueConfController.cs | 10 +- NKC_WF/Controllers/PrintQueueController.cs | 27 +- NKC_WF/Reports/queueConf.json | 148 +++-- 5 files changed, 374 insertions(+), 344 deletions(-) diff --git a/AppData/reportPrinter.cs b/AppData/reportPrinter.cs index 2b8f1ba..dddadb1 100644 --- a/AppData/reportPrinter.cs +++ b/AppData/reportPrinter.cs @@ -161,7 +161,7 @@ namespace AppData int.TryParse(keyParam, out intIdx); tab = (DataTable)DataLayer.man.taIL.getByKey(intIdx); break; - case reportRichiesto.stackLabel: + case reportRichiesto.bunkLabel: int.TryParse(keyParam, out intIdx); tab = (DataTable)DataLayer.man.taRepStack.GetData(intIdx); break; @@ -202,7 +202,7 @@ namespace AppData report.ReportPath = string.Format(@"{0}\PartLabel.rdlc", repoBasePath); report.DataSources.Add(new ReportDataSource(memLayer.ML.cdv("ReportDS_DocPart"), caricaDati(tipoReport, keyParam))); break; - case reportRichiesto.stackLabel: + case reportRichiesto.bunkLabel: report.ReportPath = string.Format(@"{0}\StackLabel.rdlc", repoBasePath); report.DataSources.Add(new ReportDataSource(memLayer.ML.cdv("ReportDS_DocStack"), caricaDati(tipoReport, keyParam))); break; @@ -351,7 +351,7 @@ namespace AppData string pagWidth = ""; string pagHeigth = ""; string margin = ""; - reportRichiesto report = reportRichiesto.stackLabel; + reportRichiesto report = reportRichiesto.bunkLabel; string tipo = ""; switch (documento) @@ -374,7 +374,7 @@ namespace AppData break; case tipoDocumento.docStack: tipo = "DocStack"; - report = reportRichiesto.stackLabel; + report = reportRichiesto.bunkLabel; break; default: break; diff --git a/NKC_SDK/Enums.cs b/NKC_SDK/Enums.cs index 46557a8..1c2a57e 100644 --- a/NKC_SDK/Enums.cs +++ b/NKC_SDK/Enums.cs @@ -1,294 +1,295 @@ namespace NKC_SDK { - /// - /// Stati degli oggetti TAKT e Stack - /// - public enum CStatus - { /// - /// Programmato + /// Stati degli oggetti TAKT e Stack /// - Programmed = 0, - /// - /// In corso - /// - Running, - /// - /// Completato - /// - Done - } + public enum CStatus + { + /// + /// Programmato + /// + Programmed = 0, + /// + /// In corso + /// + Running, + /// + /// Completato + /// + Done + } - /// - /// Tipologia di macchina - /// - public enum mType - { - Multiax = 0, - Offline - } - /// - /// TIpologia di ordine - /// - public enum oType - { - BatchRequest = 0, - OfflineOrder - } - /// - /// modalità funzionamento batch list - /// - public enum BatchListMode - { /// - /// Modalità normale (stima/nesting) + /// Tipologia di macchina /// - Standard, + public enum mType + { + Multiax = 0, + Offline + } /// - /// MOdalità validazione aprticolari + /// TIpologia di ordine /// - PartsEval - } - /// - /// Stati degli oggetti Batch - /// - public enum BatchStatus - { + public enum oType + { + BatchRequest = 0, + OfflineOrder + } /// - /// CSV importato + /// modalità funzionamento batch list /// - Imported = 0, + public enum BatchListMode + { + /// + /// Modalità normale (stima/nesting) + /// + Standard, + /// + /// MOdalità validazione aprticolari + /// + PartsEval + } /// - /// Nesting richiesto (In corso) + /// Stati degli oggetti Batch /// - EstimationRequested, + public enum BatchStatus + { + /// + /// CSV importato + /// + Imported = 0, + /// + /// Nesting richiesto (In corso) + /// + EstimationRequested, + /// + /// Nesting Completato + /// + EstimationDone, + /// + /// Nesting richiesto (In corso) + /// + NestRequested, + /// + /// Nesting Completato + /// + NestDone, + /// + /// Nesting approvato + /// + Approved, + /// + /// Nesting scartato + /// + Discarded, + /// + /// Errori in fase di import o calcolo + /// + Errors, + /// + /// Impiegato per effettuare un test di validazione di un SINGOLO ITEM/PART + /// + PartEval, + /// + /// Test di validazione KO per un SINGOLO ITEM/PART + /// + PartKo, + /// + /// Test di validazione OK per un SINGOLO ITEM/PART + /// + PartOk + } /// - /// Nesting Completato + /// Posizione / Activity degli oggetti Batch /// - EstimationDone, - /// - /// Nesting richiesto (In corso) - /// - NestRequested, - /// - /// Nesting Completato - /// - NestDone, - /// - /// Nesting approvato - /// - Approved, - /// - /// Nesting scartato - /// - Discarded, - /// - /// Errori in fase di import o calcolo - /// - Errors, - /// - /// Impiegato per effettuare un test di validazione di un SINGOLO ITEM/PART - /// - PartEval, - /// - /// Test di validazione KO per un SINGOLO ITEM/PART - /// - PartKo, - /// - /// Test di validazione OK per un SINGOLO ITEM/PART - /// - PartOk - } - /// - /// Posizione / Activity degli oggetti Batch - /// - public enum BatchPosition - { - /// - /// Non iniziato - /// - NotStarted = 0, - /// - /// Stack In corso - /// - StackStarted, - /// - /// Stack Completato - /// - StackDone, - /// - /// Stack currently in LOAD - /// - Current, - /// - /// Stack completed - /// - Completed - } + public enum BatchPosition + { + /// + /// Non iniziato + /// + NotStarted = 0, + /// + /// Stack In corso + /// + StackStarted, + /// + /// Stack Completato + /// + StackDone, + /// + /// Stack currently in LOAD + /// + Current, + /// + /// Stack completed + /// + Completed + } - /// - /// Stati degli oggetti PANEL/SHEET - /// - public enum PStatus - { /// - /// Programmato + /// Stati degli oggetti PANEL/SHEET /// - Programmed = 0, + public enum PStatus + { + /// + /// Programmato + /// + Programmed = 0, + /// + /// Stampa in corso + /// + Printing, + /// + /// Stampa completata + /// + Printed, + /// + /// Lavorazione in corso + /// + Machining, + /// + /// Lavorazione completata + /// + Machined, + /// + /// In fase di scaricamento + /// + Unloading, + /// + /// Completato / scaricato da macchina (anche su tavola di scarico) + /// + Unloaded, + /// + /// Presente / letto su PROD e pronto su scissor lift + /// + Present, + /// + /// Da rilavorare + /// + ToBeRedone + } /// - /// Stampa in corso + /// Destinazioni per ITEM post CNC WORK /// - Printing, + public enum ItemDest + { + /// + /// Destinato a BIN (painting) + /// + Bin, + /// + /// Destinato a Cart (KIT) + /// + Cart, + /// + /// Indefinito + /// + Undef + } /// - /// Stampa completata + /// Stati ammessi per ITEM /// - Printed, - /// - /// Lavorazione in corso - /// - Machining, - /// - /// Lavorazione completata - /// - Machined, - /// - /// In fase di scaricamento - /// - Unloading, - /// - /// Completato / scaricato da macchina (anche su tavola di scarico) - /// - Unloaded, - /// - /// Presente / letto su PROD e pronto su scissor lift - /// - Present, - /// - /// Da rilavorare - /// - ToBeRedone - } - /// - /// Destinazioni per ITEM post CNC WORK - /// - public enum ItemDest - { - /// - /// Destinato a BIN (painting) - /// - Bin, - /// - /// Destinato a Cart (KIT) - /// - Cart, - /// - /// Indefinito - /// - Undef - } - /// - /// Stati ammessi per ITEM - /// - public enum ItemStatus - { - /// - /// Programmato - /// - Programmed, - /// - /// Completato/Fatto/tagliato - /// - Made, - /// - /// Preso da operatore - /// - PickUp, - /// - /// Depositato su Bin/Cesta - /// - Removed, - /// - /// Indefinito - /// - Undef - } + public enum ItemStatus + { + /// + /// Programmato + /// + Programmed, + /// + /// Completato/Fatto/tagliato + /// + Made, + /// + /// Preso da operatore + /// + PickUp, + /// + /// Depositato su Bin/Cesta + /// + Removed, + /// + /// Indefinito + /// + Undef + } - /// - /// Tipi di barcode gestiti - /// - public enum codeType - { - UNK = 0, - Item, - ItemGeneric, - OtherItem, - Material, - Sheet, - Stack, - Batch, - Cart, - Bin, - BinProcessed, - SecScreen - } - /// - /// tipologia di report (FILE rdlc) gestito in stampa... - /// - public enum reportRichiesto - { - cartLabel, - paintLabelPre, - paintLabelPost, - partLabel, - stackLabel - } - /// - /// tipologia di DOCUMENTO gestito in stampa... - /// - public enum tipoDocumento - { /// - /// Etichetta per un BIN (pre esecuzione compito, es verniciatura) + /// Tipi di barcode gestiti /// - docBinPre, + public enum codeType + { + UNK = 0, + Item, + ItemGeneric, + OtherItem, + Material, + Sheet, + Stack, + Batch, + Cart, + Bin, + BinProcessed, + SecScreen + } /// - /// Etichetta per un BIN (POST esecuzione compito, es verniciatura) + /// tipologia di report (FILE rdlc) gestito in stampa... /// - docBinPost, + public enum reportRichiesto + { + bunkLabel, + cartLabel, + offlineLabel, + paintLabelPre, + paintLabelPost, + partLabel + } /// - /// Etichetta per un CART + /// tipologia di DOCUMENTO gestito in stampa... /// - docCart, - /// - /// Docuemtno per singolo ITEM: - /// - QR code - /// - num cart/bin - /// - T/P/* (se va fatto qualcosa di speciale) - /// - codice dmtx leggibile (es IT000023) su NUOVA riga - /// - docPart, - /// - /// doc per STACK - /// - docStack, - /// - /// NON DEFINITO - /// - docND - } + public enum tipoDocumento + { + /// + /// Etichetta per un BIN (pre esecuzione compito, es verniciatura) + /// + docBinPre, + /// + /// Etichetta per un BIN (POST esecuzione compito, es verniciatura) + /// + docBinPost, + /// + /// Etichetta per un CART + /// + docCart, + /// + /// Docuemtno per singolo ITEM: + /// - QR code + /// - num cart/bin + /// - T/P/* (se va fatto qualcosa di speciale) + /// - codice dmtx leggibile (es IT000023) su NUOVA riga + /// + docPart, + /// + /// doc per STACK + /// + docStack, + /// + /// NON DEFINITO + /// + docND + } - /// - /// Enum degli stati ammessi per il Nesting - /// - public enum procStatus - { - waiting = 0, - running, - error, - completed, - aborted, - accepted, - refused - } + /// + /// Enum degli stati ammessi per il Nesting + /// + public enum procStatus + { + waiting = 0, + running, + error, + completed, + aborted, + accepted, + refused + } } diff --git a/NKC_WF/Controllers/PrintQueueConfController.cs b/NKC_WF/Controllers/PrintQueueConfController.cs index 3a7da8f..bd38303 100644 --- a/NKC_WF/Controllers/PrintQueueConfController.cs +++ b/NKC_WF/Controllers/PrintQueueConfController.cs @@ -12,7 +12,7 @@ namespace NKC_WF.Controllers { /// /// Restituisce un array JSon x le conf delle code di stampa - /// GET: api/PrintQueue + /// GET: api/PrintQueueConf /// /// lista oggetto Json in formato SteamwareSDK.queueConf public List Get() @@ -57,13 +57,5 @@ namespace NKC_WF.Controllers return answ; } -#if false - // GET: api/PrintQueue/5 - public string Get(int id) - { - return "value"; - } -#endif - } } diff --git a/NKC_WF/Controllers/PrintQueueController.cs b/NKC_WF/Controllers/PrintQueueController.cs index c3f613e..3b6f843 100644 --- a/NKC_WF/Controllers/PrintQueueController.cs +++ b/NKC_WF/Controllers/PrintQueueController.cs @@ -47,10 +47,19 @@ namespace NKC_WF.Controllers DataTable tab = new DataTable(); switch (tipoReport) { + case reportRichiesto.bunkLabel: + int.TryParse(keyParam, out intIdx); + tab = (DataTable)DataLayer.man.taRepStack.GetData(intIdx); + answ.Add("stp_prt_StackLabel", tab); + break; case reportRichiesto.cartLabel: // int.TryParse(keyParam, out intIdx); // tab = (DataTable)DataLayer.man.taRepStack.GetData(intIdx); break; + case reportRichiesto.offlineLabel: + // int.TryParse(keyParam, out intIdx); + // tab = (DataTable)DataLayer.man.taRepStack.GetData(intIdx); + break; case reportRichiesto.paintLabelPre: // int.TryParse(keyParam, out intIdx); // tab = (DataTable)DataLayer.man.taRepStack.GetData(intIdx); @@ -64,11 +73,6 @@ namespace NKC_WF.Controllers tab = (DataTable)DataLayer.man.taIL.getByKey(intIdx); answ.Add("stp_prt_PartLabel", tab); break; - case reportRichiesto.stackLabel: - int.TryParse(keyParam, out intIdx); - tab = (DataTable)DataLayer.man.taRepStack.GetData(intIdx); - answ.Add("stp_prt_StackLabel", tab); - break; default: break; } @@ -79,13 +83,16 @@ namespace NKC_WF.Controllers protected reportRichiesto reportByTipo(string tipo) { - reportRichiesto report = reportRichiesto.stackLabel; + reportRichiesto report = reportRichiesto.bunkLabel; switch (tipo) { - case "docPaint": + case "docStack": + report = reportRichiesto.bunkLabel; + break; + case "docBinPre": report = reportRichiesto.paintLabelPre; break; - case "docPaintPost": + case "docBinPost": report = reportRichiesto.paintLabelPost; break; case "docCart": @@ -94,8 +101,8 @@ namespace NKC_WF.Controllers case "docPart": report = reportRichiesto.partLabel; break; - case "docStack": - report = reportRichiesto.stackLabel; + case "docOffline": + report = reportRichiesto.offlineLabel; break; default: break; diff --git a/NKC_WF/Reports/queueConf.json b/NKC_WF/Reports/queueConf.json index 2132686..6c5e34f 100644 --- a/NKC_WF/Reports/queueConf.json +++ b/NKC_WF/Reports/queueConf.json @@ -1,62 +1,92 @@ [ - { - "name": "queueBin", - "template": "BinLabel.rdlc", - "printerName": "Microsoft Print to PDF", - "deviceInfoParam": { - "OutputFormat": "EMF", - "PageHeight": "11in", - "PageWidth": "8.5in", - "MarginLeft": "0.5in", - "MarginRight": "0.5in", - "MarginTop": "0.5in", - "MarginBottom": "0.5in", - "xmlParam": "EMF8.5in11in0.5in0.5in0.5in0.5in" + { + "name": "queueUnloadBin", + "template": "BinLabel.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "11in", + "PageWidth": "8.5in", + "MarginLeft": "0.5in", + "MarginRight": "0.5in", + "MarginTop": "0.5in", + "MarginBottom": "0.5in", + "xmlParam": "EMF8.5in11in0.5in0.5in0.5in0.5in" + } + }, + { + "name": "queueUnloadCart", + "template": "CartLabel.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "11in", + "PageWidth": "8.5in", + "MarginLeft": "0.5in", + "MarginRight": "0.5in", + "MarginTop": "0.5in", + "MarginBottom": "0.5in", + "xmlParam": "EMF8.5in11in0.5in0.5in0.5in0.5in" + } + }, + { + "name": "queueBunk", + "template": "StackLabel.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "11in", + "PageWidth": "8.5in", + "MarginLeft": "0.5in", + "MarginRight": "0.5in", + "MarginTop": "0.5in", + "MarginBottom": "0.5in", + "xmlParam": "EMF8.5in11in0.5in0.5in0.5in0.5in" + } + }, + { + "name": "queuePaint", + "template": "BinLabel.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "11in", + "PageWidth": "8.5in", + "MarginLeft": "0.5in", + "MarginRight": "0.5in", + "MarginTop": "0.5in", + "MarginBottom": "0.5in", + "xmlParam": "EMF8.5in11in0.5in0.5in0.5in0.5in" + } + }, + { + "name": "queuePart", + "template": "PartLabel.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "11in", + "PageWidth": "8.5in", + "MarginLeft": "0.5in", + "MarginRight": "0.5in", + "MarginTop": "0.5in", + "MarginBottom": "0.5in", + "xmlParam": "EMF8.5in11in0.5in0.5in0.5in0.5in" + } + }, + { + "name": "queueOffline", + "template": "OfflineLabel.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "11in", + "PageWidth": "8.5in", + "MarginLeft": "0.5in", + "MarginRight": "0.5in", + "MarginTop": "0.5in", + "MarginBottom": "0.5in", + "xmlParam": "EMF8.5in11in0.5in0.5in0.5in0.5in" + } } - }, - { - "name": "queueBunk", - "template": "StackLabel.rdlc", - "printerName": "Microsoft Print to PDF", - "deviceInfoParam": { - "OutputFormat": "EMF", - "PageHeight": "11in", - "PageWidth": "8.5in", - "MarginLeft": "0.5in", - "MarginRight": "0.5in", - "MarginTop": "0.5in", - "MarginBottom": "0.5in", - "xmlParam": "EMF8.5in11in0.5in0.5in0.5in0.5in" - } - }, - { - "name": "queueCart", - "template": "CartLabel.rdlc", - "printerName": "Microsoft Print to PDF", - "deviceInfoParam": { - "OutputFormat": "EMF", - "PageHeight": "11in", - "PageWidth": "8.5in", - "MarginLeft": "0.5in", - "MarginRight": "0.5in", - "MarginTop": "0.5in", - "MarginBottom": "0.5in", - "xmlParam": "EMF8.5in11in0.5in0.5in0.5in0.5in" - } - }, - { - "name": "queuePart", - "template": "PartLabel.rdlc", - "printerName": "Microsoft Print to PDF", - "deviceInfoParam": { - "OutputFormat": "EMF", - "PageHeight": "11in", - "PageWidth": "8.5in", - "MarginLeft": "0.5in", - "MarginRight": "0.5in", - "MarginTop": "0.5in", - "MarginBottom": "0.5in", - "xmlParam": "EMF8.5in11in0.5in0.5in0.5in0.5in" - } - } ] \ No newline at end of file