From 91fefe6bdd41dd46bb00fc4b71adb96d80a3082e Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Sat, 15 Feb 2020 12:31:18 +0100 Subject: [PATCH] Completato review comandi x demo mode --- LPA/LPA.csproj | 3 ++ LPA/MainForm.Designer.cs | 62 +++++++++++++++--------------------- LPA/MainForm.cs | 17 +++++----- LPA/conf/queueSetupDemo.json | 1 + 4 files changed, 39 insertions(+), 44 deletions(-) create mode 100644 LPA/conf/queueSetupDemo.json diff --git a/LPA/LPA.csproj b/LPA/LPA.csproj index 44c95bc..62fb744 100644 --- a/LPA/LPA.csproj +++ b/LPA/LPA.csproj @@ -191,6 +191,9 @@ Always + + Always + Always diff --git a/LPA/MainForm.Designer.cs b/LPA/MainForm.Designer.cs index 9f87c4c..7f09b04 100644 --- a/LPA/MainForm.Designer.cs +++ b/LPA/MainForm.Designer.cs @@ -49,14 +49,13 @@ this.label1 = new System.Windows.Forms.Label(); this.lblQueueCount = new System.Windows.Forms.Label(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.btnDemoPrint = new System.Windows.Forms.Button(); this.longTimer = new System.Windows.Forms.Timer(this.components); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.backupConfToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.getServerConfToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.menuTestDemo = new System.Windows.Forms.ToolStripMenuItem(); - this.printDemoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.btnDemo = new System.Windows.Forms.Button(); + this.menuEnableDemo = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabStatus.SuspendLayout(); @@ -192,7 +191,7 @@ this.tabSetup.Location = new System.Drawing.Point(4, 22); this.tabSetup.Name = "tabSetup"; this.tabSetup.Padding = new System.Windows.Forms.Padding(3); - this.tabSetup.Size = new System.Drawing.Size(753, 399); + this.tabSetup.Size = new System.Drawing.Size(753, 373); this.tabSetup.TabIndex = 1; this.tabSetup.Text = "Setup"; this.tabSetup.UseVisualStyleBackColor = true; @@ -258,7 +257,7 @@ this.tableLayoutPanel1.Controls.Add(this.label1, 4, 0); this.tableLayoutPanel1.Controls.Add(this.lblQueueCount, 5, 0); this.tableLayoutPanel1.Controls.Add(this.btnStop, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.btnDemo, 3, 0); + this.tableLayoutPanel1.Controls.Add(this.btnDemoPrint, 3, 0); this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 35); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; @@ -266,6 +265,18 @@ this.tableLayoutPanel1.Size = new System.Drawing.Size(761, 44); this.tableLayoutPanel1.TabIndex = 15; // + // btnDemoPrint + // + this.btnDemoPrint.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnDemoPrint.Location = new System.Drawing.Point(514, 3); + this.btnDemoPrint.Name = "btnDemoPrint"; + this.btnDemoPrint.Size = new System.Drawing.Size(94, 38); + this.btnDemoPrint.TabIndex = 15; + this.btnDemoPrint.Text = "Print Demo"; + this.btnDemoPrint.UseVisualStyleBackColor = true; + this.btnDemoPrint.Visible = false; + this.btnDemoPrint.Click += new System.EventHandler(this.btnDemoPrint_Click); + // // longTimer // this.longTimer.Interval = 60000; @@ -273,8 +284,7 @@ // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.menuTestDemo}); + this.fileToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(785, 24); @@ -285,7 +295,8 @@ // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.backupConfToolStripMenuItem, - this.getServerConfToolStripMenuItem}); + this.getServerConfToolStripMenuItem, + this.menuEnableDemo}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "&File"; @@ -302,32 +313,12 @@ this.getServerConfToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.getServerConfToolStripMenuItem.Text = "&Get server --> conf"; // - // menuTestDemo + // menuEnableDemo // - this.menuTestDemo.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.printDemoToolStripMenuItem}); - this.menuTestDemo.Name = "menuTestDemo"; - this.menuTestDemo.Size = new System.Drawing.Size(116, 20); - this.menuTestDemo.Text = "&Test - Demo mode"; - this.menuTestDemo.Visible = false; - // - // printDemoToolStripMenuItem - // - this.printDemoToolStripMenuItem.Name = "printDemoToolStripMenuItem"; - this.printDemoToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.printDemoToolStripMenuItem.Text = "&Print Demo"; - this.printDemoToolStripMenuItem.Click += new System.EventHandler(this.printDemoToolStripMenuItem_Click); - // - // btnDemo - // - this.btnDemo.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnDemo.Location = new System.Drawing.Point(514, 3); - this.btnDemo.Name = "btnDemo"; - this.btnDemo.Size = new System.Drawing.Size(94, 38); - this.btnDemo.TabIndex = 15; - this.btnDemo.Text = "Demo"; - this.btnDemo.UseVisualStyleBackColor = true; - this.btnDemo.Click += new System.EventHandler(this.btnDemo_Click); + this.menuEnableDemo.Name = "menuEnableDemo"; + this.menuEnableDemo.Size = new System.Drawing.Size(195, 22); + this.menuEnableDemo.Text = "&Enter Test Mode"; + this.menuEnableDemo.Click += new System.EventHandler(this.enableTestDemoModeToolStripMenuItem_Click); // // MainForm // @@ -382,9 +373,8 @@ private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem backupConfToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem getServerConfToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem menuTestDemo; - private System.Windows.Forms.ToolStripMenuItem printDemoToolStripMenuItem; - private System.Windows.Forms.Button btnDemo; + private System.Windows.Forms.ToolStripMenuItem menuEnableDemo; + private System.Windows.Forms.Button btnDemoPrint; } } diff --git a/LPA/MainForm.cs b/LPA/MainForm.cs index 83b5fb8..c71d48d 100644 --- a/LPA/MainForm.cs +++ b/LPA/MainForm.cs @@ -151,7 +151,7 @@ namespace LPA { lblStatus.Text += " TEST/DEMO MODE"; } - menuTestDemo.Visible = demoMode; + btnDemoPrint.Visible = demoMode; } /// /// Setup oggetto DGV @@ -467,7 +467,7 @@ namespace LPA /// /// /// - private void printDemoToolStripMenuItem_Click(object sender, EventArgs e) + private void btnDemoPrint_Click(object sender, EventArgs e) { string rawData = ""; string filePath = ""; @@ -505,6 +505,11 @@ namespace LPA if (confCoda != null) { fatto = rPrint.printReport(confCoda.template, confCoda.rdsName, localReportPath, coda.Value.Printer, item.rdsTable, confCoda.deviceInfoParam, true); + if(fatto) + { + coda.Value.NumWaiting--; + coda.Value.NumDone++; + } } } vetoPrint = adesso; @@ -513,14 +518,10 @@ namespace LPA } } } - - } - - } - private void btnDemo_Click(object sender, EventArgs e) + private void enableTestDemoModeToolStripMenuItem_Click(object sender, EventArgs e) { string message = demoMode ? "Confermi di voler abbandonare la modalità test/Demo?" : "Attenzione! sei sicuro di voler attivare la modalità Test/Demo? il sistema funzionerà in modalità offline e configurate le code di stampa effettuerà test di stampa locale"; string title = "Test / Demo mode"; @@ -532,7 +533,7 @@ namespace LPA // ricarico dati code e conf... // update buttons... - btnDemo.Text = demoMode ? "Exit Demo" : "Demo"; + menuEnableDemo.Text = demoMode ? "&Exit Test Mode" : "&Enter Test Mode"; setupButtons(); // aggiorno code... setupQueuePrinter(); diff --git a/LPA/conf/queueSetupDemo.json b/LPA/conf/queueSetupDemo.json new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/LPA/conf/queueSetupDemo.json @@ -0,0 +1 @@ + \ No newline at end of file