diff --git a/Client/Browser_Tools/BrowserJSObject.cs b/Client/Browser_Tools/BrowserJSObject.cs index 30223b39..da2d9bd7 100644 --- a/Client/Browser_Tools/BrowserJSObject.cs +++ b/Client/Browser_Tools/BrowserJSObject.cs @@ -35,7 +35,8 @@ namespace Active_Client.Browser_Tools // The first letter of All PUBLIC Variables and Methods must be Lower-Case (CEF Settings) private MainForm mainForm; - private static readonly string[] _validExtensions = { "", ".txt", ".cnc", ".cn", ".cno", ".ini", ".mpf", ".spf", ".tap", ".anc", /*".job", ".zip"*/ }; + + private static readonly string[] _validExtensions = { "", ".txt", ".cnc", ".cn", ".cno", ".ini", ".mpf", ".spf", ".tap", ".anc", ".iso", /*".job", ".zip"*/ }; private static readonly string[] _validImages = { ".jpg", ".jpeg", ".png" }; private static readonly string editorPath = @"C:\Windows\System32\notepad.exe"; private static readonly int editorX = 56; @@ -280,7 +281,7 @@ namespace Active_Client.Browser_Tools { if (e.Arguments.Count() == 0) return; - + Thread t = new Thread(new ParameterizedThreadStart(OpenNew)); t.Start(e.Arguments[0].StringValue); } @@ -300,7 +301,7 @@ namespace Active_Client.Browser_Tools { Software sft = Config.ExtSoftwaresConfig.FirstOrDefault(X => X.id == (string)id); - if (sft != null) + if (sft != null && System.IO.File.Exists(sft.path)) { Process[] p = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(sft.path)).OrderByDescending(X => X.StartTime).ToArray(); diff --git a/Client/View/MainForm.Designer.cs b/Client/View/MainForm.Designer.cs index 7420d1ab..7e9932b6 100644 --- a/Client/View/MainForm.Designer.cs +++ b/Client/View/MainForm.Designer.cs @@ -44,6 +44,7 @@ namespace Active_Client.View this.Browser.Size = new System.Drawing.Size(1920, 1080); this.Browser.TabIndex = 1; this.Browser.Text = "chromiumWebBrowser2"; + this.Browser.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Browser_KeyDown); // // MainForm // @@ -55,6 +56,7 @@ namespace Active_Client.View this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.KeyPreview = true; this.MaximizeBox = false; this.MaximumSize = new System.Drawing.Size(1920, 1080); this.MinimizeBox = false; @@ -65,6 +67,7 @@ namespace Active_Client.View this.Text = "CMS-STEP Client"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.Load += new System.EventHandler(this.MainForm_Load); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyDown); this.Resize += new System.EventHandler(this.MainForm_Resize); this.ResumeLayout(false); diff --git a/Client/View/MainForm.cs b/Client/View/MainForm.cs index 9262ae93..97257570 100644 --- a/Client/View/MainForm.cs +++ b/Client/View/MainForm.cs @@ -121,11 +121,11 @@ namespace Active_Client.View if (WindowState == FormWindowState.Minimized) { NcWindow.ShowTaskBar(); - + NcWindow.MinimizeNcWindow(); - NcWindow.HideNcWindow(); + if (Config.VendorHmiConfig.Type == 3) + NcWindow.HideNcWindow(); NcWindow.MinimizeProdWindow(); - NcWindow.HideProdWindow(); } else { @@ -185,7 +185,6 @@ namespace Active_Client.View private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { - } #endregion @@ -769,6 +768,19 @@ namespace Active_Client.View } } + private void MainForm_KeyDown(object sender, KeyEventArgs e) + { + if (e.Alt && e.KeyCode == Keys.F4) + { + e.Handled = true; + } + } + + private void Browser_KeyDown(object sender, KeyEventArgs e) + { + + } + //Windows Keys Handler public void keyPressedHandler(bool altPressed, bool ctrlPressed, bool shiftPressed, int key) diff --git a/Client/View/NcWindow.cs b/Client/View/NcWindow.cs index 70fee18d..8a155d8e 100644 --- a/Client/View/NcWindow.cs +++ b/Client/View/NcWindow.cs @@ -98,7 +98,9 @@ namespace Active_Client.View private static uint KeybPID; private static uint ActualWindowPID; private static int ActiveNCWindowStyle; - private static int ActiveNCWindowBorder; + private static int ActiveNCWindowBorder; + private static int ActiveWindowNCWindowStyle; + private static int ActiveWindowNCWindowBorder; public static MainForm mainFrm; private static string prodEXEname; @@ -206,7 +208,7 @@ namespace Active_Client.View //Start the Process ncprocess.Start(); - ncprocess.WaitForInputIdle(); + ncprocess.WaitForInputIdle(1000); //Wait until the process is started TriedTimes = 1; @@ -283,7 +285,7 @@ namespace Active_Client.View { //Set the first founded process prodprocess = processes[0]; - prodprocess.WaitForInputIdle(); + prodprocess.WaitForInputIdle(1000); //Wait until the process is started TriedTimes = 1; @@ -983,18 +985,20 @@ namespace Active_Client.View if (ActualWindowPID == NcProcessPID && NcProcessPID != 0 && hWinEventHook != ncprocess.MainWindowHandle) { //Read the style of the window - ActiveNCWindowStyle = GetWindowLong(hwnd, GWL_STYLE); + ActiveWindowNCWindowStyle = GetWindowLong(hwnd, GWL_STYLE); //Find if it has the border - ActiveNCWindowBorder = (ActiveNCWindowStyle & WS_BORDER); + ActiveWindowNCWindowBorder = (ActiveWindowNCWindowStyle & WS_BORDER); //if it has the border and a title execute focus - if (ActiveNCWindowStyle != 0 && ActiveNCWindowBorder == WS_BORDER && ReadWindowTitle(hwnd) != "") + if (ActiveWindowNCWindowStyle != 0 && ActiveWindowNCWindowBorder == WS_BORDER && ReadWindowTitle(hwnd) != "") { - if (eventType == EVENT_OBJECT_CREATE && state == NcState.SHOW) + if (eventType == EVENT_OBJECT_CREATE) + { SetForegroundWindow(ncprocess.MainWindowHandle); - else if(eventType == EVENT_OBJECT_DESTROY) - SetForegroundWindow(MainViewHandle); + } + else if (eventType == EVENT_OBJECT_DESTROY) + SetWindowPos(MainViewHandle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW); } } @@ -1014,11 +1018,6 @@ namespace Active_Client.View //Delete the TOPMOST Style of the Window if (NcProcessPID != 0 && ActualPID == NcProcessPID) { - if (state == NcState.SHOW) - { - SetWindowPos(hwnd, ncprocess.MainWindowHandle, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW); - } - //Read the style of the window ActiveNCWindowStyle = GetWindowLong(hwnd, GWL_STYLE); @@ -1029,7 +1028,7 @@ namespace Active_Client.View //if it has the border and a title execute focus if (ActiveNCWindowStyle != 0 && ActiveNCWindowBorder == WS_BORDER && ReadWindowTitle(hwnd) != "" && hwnd != ncprocess.MainWindowHandle) { - SetWindowPos(ncprocess.MainWindowHandle, MainViewHandle, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW); + SetWindowPos(ncprocess.MainWindowHandle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW); } } @@ -1039,10 +1038,6 @@ namespace Active_Client.View { if (!IsIconic(MainViewHandle)) { - //Hide the TaskBar - if (Environment.OSVersion.Version.Major < 10) - HideTaskBar(); - //Show Virtual keyboard if (Config.ClientConfig.ShowVirtualKeyboard && Environment.OSVersion.Version.Major < 10) reOpenVirtualKeyboard(); @@ -1055,9 +1050,6 @@ namespace Active_Client.View if (Environment.OSVersion.Version.Major < 10) HideTaskBar(); - if (LastHookedPID != MainProcessPID && LastHookedPID != NcProcessPID && LastHookedPID != ProdProcessPID) - SetForegroundWindow(MainViewHandle); - } //If the PID is OTHER Process else @@ -1066,6 +1058,8 @@ namespace Active_Client.View if (Environment.OSVersion.Version.Major < 10) ShowTaskBar(); + //SetForegroundWindow(hwnd); + //Hide Virtual keyboard if (Config.ClientConfig.ShowVirtualKeyboard && Environment.OSVersion.Version.Major < 10 && KeyboardPID != 0 && ActualPID != KeyboardPID) closeVirtualKeyboard(); @@ -1406,11 +1400,21 @@ namespace Active_Client.View //NC Following Method public static void FollowNcBehaviour() - { + { + uint process = 0; try { while (true) - { + { + + GetWindowThreadProcessId(GetForegroundWindow(), out process); + if (state != NcState.SHOW && state != NcState.SHOWPROD && (process == NcProcessPID || process == ProdProcessPID)) + mainFrm.HideAUXWindow(); + else if (state == NcState.SHOWPROD && process == NcProcessPID && prodwindowstarted) + mainFrm.ShowProdWindow(); + else if (state == NcState.SHOW && process == ProdProcessPID && windowstarted) + mainFrm.ShowNCWindow(); + if (Process.GetProcessesByName(processname).Length == 0) { //Un-parent the window diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 2a57a932..2e46acbb 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Config/Config/areasConfig.xml b/Step.Config/Config/areasConfig.xml index a789bc84..af278811 100644 --- a/Step.Config/Config/areasConfig.xml +++ b/Step.Config/Config/areasConfig.xml @@ -31,7 +31,7 @@ false - false + true true true diff --git a/Step.Config/Config/customMainProgram.txt b/Step.Config/Config/customMainProgram.txt new file mode 100644 index 00000000..7b587894 --- /dev/null +++ b/Step.Config/Config/customMainProgram.txt @@ -0,0 +1,4 @@ +% + +M30; +% \ No newline at end of file diff --git a/Step.Config/Config/maintenancesConfig.xml b/Step.Config/Config/maintenancesConfig.xml index 605d9f16..2decfae8 100644 --- a/Step.Config/Config/maintenancesConfig.xml +++ b/Step.Config/Config/maintenancesConfig.xml @@ -1,173 +1,180 @@  - - - 1 - - 5-Axis operating-unit management - Gestione gruppo operatore 5 assi - - 2000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Replace air/liquid seals of rotary axis joint - Sostituire tenute aria/liquido giunto assi rotanti - - mm - 0 - + + + CMS + cms@cms.it + 034564111 + + + + 1 + + 5-Axis operating-unit management + Gestione gruppo operatore 5 assi + + 2000 + 15/07/2018 13:00 + MACHINE_INTERVAL + + Replace air/liquid seals of rotary axis joint + Sostituire tenute aria/liquido giunto assi rotanti + + mm + 0 + - - 2 - - Transmission member check - Gestione Organi di trasmissione - - 2000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Transmission members check - Necessary control of all transmission system - - mm - 1 - + + 2 + + Transmission member check + Gestione Organi di trasmissione + + 2000 + 15/07/2018 13:00 + MACHINE_INTERVAL + + Transmission members check + Necessary control of all transmission system + + mm + 1 + - - 3 - - Mechanical/electrical safety systems - Sistemi di sicurezza meccanici/elettrici - - 2000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Necessary control of mechanical/electrical safety systems - Necessario controllo di tutti i sistemi di sicurezza meccanici/elettrici presenti in macchina - - mm - 1 - + + 3 + + Mechanical/electrical safety systems + Sistemi di sicurezza meccanici/elettrici + + 2000 + 15/07/2018 13:00 + MACHINE_INTERVAL + + Necessary control of mechanical/electrical safety systems + Necessario controllo di tutti i sistemi di sicurezza meccanici/elettrici presenti in macchina + + mm + 1 + - - 4 - - Check of axis geometry - Controllo geometria assi - - 2000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Necessary control of axis geometry - Necessario controllo della corretta geometria assi - - mm - 1 - + + 4 + + Check of axis geometry + Controllo geometria assi + + 2000 + 15/07/2018 13:00 + MACHINE_INTERVAL + + Necessary control of axis geometry + Necessario controllo della corretta geometria assi + + mm + 1 + - - 5 - - Machine System check - Controllo impianti macchina necessario - - 2000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Necessary control Electric / Mechanical / Pneumatic Systems - Necessario controllo impianti Elettrico / Meccanico / Pneumatico - - mm - 1 - + + 5 + + Machine System check + Controllo impianti macchina necessario + + 2000 + 15/07/2018 13:00 + MACHINE_INTERVAL + + Necessary control Electric / Mechanical / Pneumatic Systems + Necessario controllo impianti Elettrico / Meccanico / Pneumatico + + mm + 1 + - - 6 - - Tool holder clamps management - Gestione manine portautensili - - 4000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Replace composite material tool holder clamps - Sostituire manine portautensili in materiale composito - - mm - 1 - + + 6 + + Tool holder clamps management + Gestione manine portautensili + + 4000 + 15/07/2018 13:00 + MACHINE_INTERVAL + + Replace composite material tool holder clamps + Sostituire manine portautensili in materiale composito + + mm + 1 + - - 7 - - Balancing cylinders management - Gestione cilindri di bilanciamento - - 4000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Replace seals on balancing cylinders - Sostituire tenute su cilindri di bilanciamento - - mm - 1 - + + 7 + + Balancing cylinders management + Gestione cilindri di bilanciamento + + 4000 + 15/07/2018 13:00 + MACHINE_INTERVAL + + Replace seals on balancing cylinders + Sostituire tenute su cilindri di bilanciamento + + mm + 1 + - - 8 - - Lower-grinder servicing necessary - Revisione mola inferiore necessaria - - 4000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Execute spindle service of Lower-grinder - Eseguire revisione al mandrino della mola inferiore - - mm - 2 - + + 8 + + Lower-grinder servicing necessary + Revisione mola inferiore necessaria + + 4000 + 15/07/2018 13:00 + MACHINE_INTERVAL + + Execute spindle service of Lower-grinder + Eseguire revisione al mandrino della mola inferiore + + mm + 2 + - - 9 - - Upper-grinder servicing necessary - Revisione mola superiore necessaria - - 4000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Execute spindle service of Upper-grinder - Eseguire revisione al mandrino della mola superiore - - mm - 3 - + + 9 + + Upper-grinder servicing necessary + Revisione mola superiore necessaria + + 4000 + 15/07/2018 13:00 + MACHINE_INTERVAL + + Execute spindle service of Upper-grinder + Eseguire revisione al mandrino della mola superiore + + mm + 3 + - - 10 - - Drill servicing necessary - Revisione foratore necessario - - 4000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Execute spindle service of the driller - Eseguire revisione al mandrino del foratore - - mm - 4 - + + 10 + + Drill servicing necessary + Revisione foratore necessario + + 4000 + 15/07/2018 13:00 + MACHINE_INTERVAL + + Execute spindle service of the driller + Eseguire revisione al mandrino del foratore + + mm + 4 + - \ No newline at end of file + + \ No newline at end of file diff --git a/Step.Config/Config/maintenancesConfigValidator.xsd b/Step.Config/Config/maintenancesConfigValidator.xsd index 05891eae..63b4f966 100644 --- a/Step.Config/Config/maintenancesConfigValidator.xsd +++ b/Step.Config/Config/maintenancesConfigValidator.xsd @@ -1,53 +1,71 @@  - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + diff --git a/Step.Config/Config/ncSoftKeyConfig.xml b/Step.Config/Config/ncSoftKeyConfig.xml index 28a5bc11..40eb0990 100644 --- a/Step.Config/Config/ncSoftKeyConfig.xml +++ b/Step.Config/Config/ncSoftKeyConfig.xml @@ -140,4 +140,14 @@ x1000 false + + true + Over Stroke + false + + + true + Feed By Pass + false + \ No newline at end of file diff --git a/Step.Config/Config/ncSoftKeyConfigValidator.xsd b/Step.Config/Config/ncSoftKeyConfigValidator.xsd index 5ef4eea3..4c8fff93 100644 --- a/Step.Config/Config/ncSoftKeyConfigValidator.xsd +++ b/Step.Config/Config/ncSoftKeyConfigValidator.xsd @@ -45,6 +45,7 @@ + \ No newline at end of file diff --git a/Step.Config/Config/scadaValidator.xsd b/Step.Config/Config/scadaValidator.xsd index 80acf530..cdf6b389 100644 --- a/Step.Config/Config/scadaValidator.xsd +++ b/Step.Config/Config/scadaValidator.xsd @@ -58,11 +58,7 @@ - - - - - + @@ -73,7 +69,7 @@ - + diff --git a/Step.Config/Config/serverConfig.xml b/Step.Config/Config/serverConfig.xml index b238e18f..2ae275c9 100644 --- a/Step.Config/Config/serverConfig.xml +++ b/Step.Config/Config/serverConfig.xml @@ -1,17 +1,18 @@ - OSAI - false - 192.168.139.1 + DEMO + true + localhost 8080 Ares 37 OF C:\PartPrg\ //PARTPRG:/ 01/01/2019 + false - true + false C:\Program Files\Notepad++\notepad++.exe @@ -38,7 +39,7 @@ NotePad NP - C:\Windows\System32\notepad.exe + C:\Windows\System32\notepa.exe true diff --git a/Step.Config/Config/serverConfigValidator.xsd b/Step.Config/Config/serverConfigValidator.xsd index 1c7f2eb9..bb2e14ef 100644 --- a/Step.Config/Config/serverConfigValidator.xsd +++ b/Step.Config/Config/serverConfigValidator.xsd @@ -14,6 +14,7 @@ + diff --git a/Step.Config/Config/userSoftKeyConfig.xml b/Step.Config/Config/userSoftKeyConfig.xml index 4049c059..0ecfd008 100644 --- a/Step.Config/Config/userSoftKeyConfig.xml +++ b/Step.Config/Config/userSoftKeyConfig.xml @@ -1,471 +1,501 @@  + - false - false + true 1 - true + false 1 - Test - Ita + Yes + Si + true + + + + true + 2 + false + 2 + + Limitswitch bypass + Bypass extracorsa + + true - + + true - true - 1 + 3 false - 1 + 3 - Test - Ita + Automatic zeroing + Azzeramento automatico degli assi con 2 sec di ritardo - - + true + + + true - true - 1 - true + 4 + false + 5 - Test - Ita + Set limits + Set limiti - - 1 - 1 - - - + true + + + false - true - 2 + 5 false + 6 - Test - Ita - - - 1 - 1 - - - - true - true - 2 - false - - Test - Ita - - - 1 - - - - true - true - 2 - false - - Test - Ita - - - 1 - 1 - - - - true - true - 2 - false - - Test - Ita - - - 1 - 1 - 1 - - - - true - true - 2 - false - - Test - Ita - - - 1 - 2 - 3 - 4 - 5 - 6 - - - - true - true - 3 - false - - Test - Ita - - - 1 - 2 - 3 - 4 - 5 - - - - true - true - 3 - false - - Test - Ita - - - A - B - C - D - E - V - - - - true - true - 3 - true - 1 - - Test - Ita + Light + Illuminazione + true + true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 + 6 false + 7 - Test - Ita + POWER ON + POWER ON - - A - B - C - D - E - V - - - + true + + + true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true - 3 - true - 1 - - Test - Ita - - - - true - true 7 false + 8 - Test - Ita + Tutti mag. ind.+prot. chius. + Tutti mag. ind.+prot. chius. + + true + + + + true + 1 + false + 9 + + POWER OFF + POWER OFF + + true + + + + true + 1 + false + 109 + + START SIEMENS + START SIEMENS + + true + + + + true + 1 + false + 10 + + START FANUC + START FANUC + + true + + + + true + 1 + false + 11 + + Selettore port. disco mob. + Selettore port. disco mob. + + true + + + + true + 1 + false + 12 + + Sbloccaggio UT + Sbloccaggio UT + + true + + + + true + 1 + false + 13 + + Ut. Bloccato in mandr. + Ut. Bloccato in mandr. + + true + + + + false + 4 + false + 14 + + Coupled tables + Tavole accoppiate + + true + + + + false + 4 + false + 15 + + Pendular tables + Tavole pendolare + + true + + + + false + 7 + false + 16 + + Table 1 + Tavola 1 + + true + + + + false + 7 + false + 17 + + Table 2 + Tavola 2 + + true + + + + false + 6 + false + 18 + + Tool magazine protection 1 + Protezione magazzino 1 + + true + + + + false + 6 + false + 19 + + Tool magazine protection 2 + Protezione magazzino 2 + + true + + + + true + 2 + false + + Vacuum pumps: + Pompe vuoto: - A - B - C - D - E - V + 2 + 1 + + + true + + + + false + 2 + false + + Auxiliary vacuum clamps: + Bloccaggi ausiliari vuoto: + + + 2 + 1 + + true + + + + true + 2 + false + + RAPID OVERRIDE: + RAPID OVERRIDE: + + + R 0% + R 50% + R 100% + + true + + + + true + 1 + false + + JOG OVERRIDE: + JOG OVERRIDE: + + + J 0% + J 50% + J 100% + K4 + + true + + + + true + 5 + true + + Set origin G: + Set origini G: + + + 55 + 56 + 57 + 58 + 59 + + true + + + + true + 5 + true + 44 + + Customer 1 + Customer 1 + + true + + + + true + 5 + true + 45 + + Customer 2 + Customer 2 + + true + + + + true + 5 + true + 46 + + Machine parking + Parcheggio macchina + + true + + + + false + 6 + false + 47 + + Tooling stock + Attrezzaggio macchina + + true + + + + true + 5 + false + 48 + + Restore tool change + Ripristino cambio utensile + + true + + + + false + 6 + false + 49 + + Suction + Aspirazione + + true + + + + true + 3 + false + + Brakes ON/FF: + Freni ON/OFF + + + B + C + + true + + true + 3 + false + 52 + + Tool blower + Soffiatore esterno utensile + + true + + + + false + 3 + false + 53 + + Internal tool blower + Soffiatore interno utensile + + true + + + + false + 3 + false + 54 + + Cold air blower + Soffiatore aria fredda + + true + + + + false + 3 + false + 55 + + External tool coolant + Nebulizzatore esterno utensile + + true + + + + false + 3 + false + 56 + + Internal tool coolant + Nebulizzatore interno utensile + + true + + + + false + 3 + false + 57 + + Internal water + Acqua interna + + true + + + + false + 3 + false + 58 + + External water + Acqua esterna + + true + + + + false + 1 + false + + PCP + PCP + + + 2 + 1 + + true + + \ No newline at end of file diff --git a/Step.Config/ServerConfig.cs b/Step.Config/ServerConfig.cs index 9fe1cafe..b7336c29 100644 --- a/Step.Config/ServerConfig.cs +++ b/Step.Config/ServerConfig.cs @@ -14,6 +14,7 @@ namespace Step.Config public static SoftwareProdConfigModel SoftwareProdConfig; public static MachineModel MachineConfig; public static List MaintenancesConfig; + public static ContactModel ContactConfig; public static List FunctionsAccessConfig; public static List AllFunctionalityDisabled; @@ -33,13 +34,14 @@ namespace Step.Config public static AreasConfigModel ScadaConfig; public static AreasConfigModel JobEditorConfig; public static AreasConfigModel UsersConfig; - - + public static List ProductionScadaSchema = new List(); public static List ConfiguredScadaSchema = new List(); public static List SubscribedScada = new List(); public static List MacrosConfig; + + public static string CMSMainProgramContent; } } \ No newline at end of file diff --git a/Step.Config/ServerConfigController.cs b/Step.Config/ServerConfigController.cs index d1c77d33..34cd2e42 100644 --- a/Step.Config/ServerConfigController.cs +++ b/Step.Config/ServerConfigController.cs @@ -35,12 +35,14 @@ namespace Step.Config ReadToolManagerConfig(); ReadMacros(); ReadScadaFile(); + //ReadMainProgram(); } catch (XmlException ex) { ExceptionManager.Manage(ERROR_LEVEL.FATAL, "Error while reading file: " + ex.SourceUri + - "\n Error: " + ex.Message + "\n Error: " + ex.Message, + true ); } catch (Exception ex) @@ -48,7 +50,7 @@ namespace Step.Config var message = ex.Message; if (ex.InnerException != null) message += "\n"+ex.InnerException.Message; - ExceptionManager.Manage(ERROR_LEVEL.FATAL, message); + ExceptionManager.Manage(ERROR_LEVEL.FATAL, message, true); } } @@ -77,7 +79,6 @@ namespace Step.Config return xmlConfigFile; } - private static void validateScada(string configSchemaFilePath, string configFilePath) { // Create new instance @@ -141,8 +142,6 @@ namespace Step.Config case AREAS.USERS_KEY: SetAreaValue(ref UsersConfig, element); break; - - } } @@ -279,7 +278,8 @@ namespace Step.Config NcName = x.Element("machineModel").Value, SharedPath = x.Element("sharedPath").Value, SharedName = x.Element("sharedName").Value, - InstallationDate = x.Element("installationDate").Value + InstallationDate = x.Element("installationDate").Value, + MgiOption = Convert.ToBoolean(x.Element("mgiOption").Value) }).FirstOrDefault(); // Read Prod Software Config with LINQ @@ -345,10 +345,21 @@ namespace Step.Config // Get Maintenances file handler XDocument xmlConfigFile = GetXmlHandlerWithValidator(MAINTENANCES_CONFIG_SCHEMA_PATH, MAINTENANCES_CONFIG_PATH); - MaintenancesConfig = xmlConfigFile - .Root - .Elements() - .ToList() + ContactConfig = xmlConfigFile + .Descendants("contact") + .Select(x => + new ContactModel() + { + Name = x.Element("name").Value, + Email = x.Element("email").Value, + PhoneNumber = x.Element("phoneNumber").Value + }) + .FirstOrDefault(); + + + MaintenancesConfig = xmlConfigFile + .Descendants("maintenances") + .Elements("maintenance") .Select(x => new MaintenanceConfigModel() { @@ -549,6 +560,15 @@ namespace Step.Config .ToList(); } + + public static void ReadMainProgram() + { + if (File.Exists(MAIN_PROGRAM_CONFIG_PATH)) + { + CMSMainProgramContent = File.ReadAllText(MAIN_PROGRAM_CONFIG_PATH); + } + } + #endregion Read config from file from configuration } } \ No newline at end of file diff --git a/Step.Config/Step.Config.csproj b/Step.Config/Step.Config.csproj index 281f49dc..60932e76 100644 --- a/Step.Config/Step.Config.csproj +++ b/Step.Config/Step.Config.csproj @@ -63,6 +63,9 @@ + + Always + PreserveNewest diff --git a/Step.Core/ThreadsFunctions.cs b/Step.Core/ThreadsFunctions.cs index 123c3a6d..074ed7a1 100644 --- a/Step.Core/ThreadsFunctions.cs +++ b/Step.Core/ThreadsFunctions.cs @@ -514,9 +514,9 @@ public static class ThreadsFunctions try { // Try connection - CmsError libraryError = ncHandler.Connect(); + CmsError libraryError = ncHandler.Connect(); if (libraryError.errorCode != 0) - ManageLibraryError(libraryError); + ManageLibraryError(libraryError); while (true) { @@ -978,8 +978,6 @@ public static class ThreadsFunctions Thread.Sleep(1000); } - if (ServerStartupConfig.AutoOpenCmsClient) - StartCMSClient(null); if(NcConfig.NcVendor == NC_VENDOR.FANUC || NcConfig.NcVendor == NC_VENDOR.OSAI) @@ -988,16 +986,21 @@ public static class ThreadsFunctions { toolTable.Connect(); // After reconecction write option - cmsError = toolTable.WriteOption(); - // Check if there are blocked magazines - cmsError = toolTable.RestoreTableLock(); + cmsError = toolTable.SetupNcToolManager(); + if (cmsError.IsError()) + ManageLibraryError(cmsError); + // cmsError = toolTable.RestoreTableLock(); } } - - // Start/Restart NC threads - ThreadsHandler.StartWorkers(); + if (!cmsError.IsError()) + { + if (ServerStartupConfig.AutoOpenCmsClient) + StartCMSClient(); - reconnectionIsRunning = false; + // Start/Restart NC threads + ThreadsHandler.StartWorkers(); + reconnectionIsRunning = false; + } } public static void RestoreConnection() @@ -1043,6 +1046,7 @@ public static class ThreadsFunctions break; case CMS_ERROR_CODES.INTERNAL_ERROR: + case CMS_ERROR_CODES.OPTION_NOT_CONSISTENT: Manage(ERROR_LEVEL.FATAL, cmsError.localizationKey); break; @@ -1161,22 +1165,38 @@ public static class ThreadsFunctions return sleep; } - public static void StartCMSClient(string url) + public static void StartCMSClient() { //Setup the Path Variable - string CMSClientPath = ""; if (!ClientIsRunning()) { - // Check if the system is 64/32 bit - if (Environment.Is64BitOperatingSystem && File.Exists(CLIENT_PATH_64)) - CMSClientPath = CLIENT_PATH_64; - else if (File.Exists(CLIENT_PATH_86)) - CMSClientPath = CLIENT_PATH_86; - if (!String.IsNullOrEmpty(CMSClientPath)) - Process.Start(CMSClientPath, url); + ThreadsHandler.StartClient = new Thread(() => clientProcess()); + ThreadsHandler.StartClient.Start(); } } + + private static void clientProcess() + { + string CMSClientPath = ""; + // Check if the system is 64/32 bit + if (Environment.Is64BitOperatingSystem && File.Exists(CLIENT_PATH_64)) + CMSClientPath = CLIENT_PATH_64; + else if (File.Exists(CLIENT_PATH_86)) + CMSClientPath = CLIENT_PATH_86; + + if (!String.IsNullOrEmpty(CMSClientPath)) + { + Process pr = Process.Start(CMSClientPath, null); + + if (ServerStartupConfig.AutoOpenCmsClient) + { + pr.WaitForExit(); + MessageServices.Current.Publish(SEND_STOP_SERVER); + } + } + } + private static bool ClientIsRunning() { Process[] p = Process.GetProcessesByName(CLIENT_EXE_NAME_NOEXT); diff --git a/Step.Core/ThreadsHandler.cs b/Step.Core/ThreadsHandler.cs index a94a7824..98b01429 100644 --- a/Step.Core/ThreadsHandler.cs +++ b/Step.Core/ThreadsHandler.cs @@ -31,6 +31,8 @@ namespace Step.Core }; private volatile static List RunningThreadsList = new List(); + public static Thread StartClient; + internal volatile static Dictionary RunningThreadStatus = new Dictionary(); public static void Start() @@ -89,10 +91,18 @@ namespace Step.Core RunningThreadsList.ForEach(thread => { thread.Abort(); - }); + }); + + if(ThreadsHandler.StartClient != null) + ThreadsHandler.StartClient.Abort(); //Abort Connect Thread ThreadsFunctions.AbortNcConnection(); } + + public static void StartClientFromUI() + { + ThreadsFunctions.StartCMSClient(); + } } } \ No newline at end of file diff --git a/Step.Database/Controllers/AlarmsController.cs b/Step.Database/Controllers/AlarmsController.cs index 166fe1fa..ad02651d 100644 --- a/Step.Database/Controllers/AlarmsController.cs +++ b/Step.Database/Controllers/AlarmsController.cs @@ -148,6 +148,13 @@ namespace Step.Database.Controllers return dbCtx.AlarmOccurrences.Count(); } + public void EmptyAlarms() + { + int numberOfRows = CountRows(); + + dbCtx.Database.ExecuteSqlCommand("DELETE FROM alarm_occurrence LIMIT {0}", numberOfRows); + } + #region NOTES public List GetNotesByAlarmDescId(int alarmDescriptionId, ALARM_SOURCE source) diff --git a/Step.Database/Controllers/MachinesUsersController.cs b/Step.Database/Controllers/MachinesUsersController.cs index 7e19a5b8..d2f88073 100644 --- a/Step.Database/Controllers/MachinesUsersController.cs +++ b/Step.Database/Controllers/MachinesUsersController.cs @@ -93,6 +93,18 @@ namespace Step.Database.Controllers return false; } + public bool RoleIsAdminOrHigher(int roleId) + { + var tmpRole = dbCtx.Roles + .ToList() + .First(X => X.RoleId == roleId); + + if (tmpRole == null) + return false; + else + return tmpRole.Level >= MIN_ADMIN_ROLE; + } + public int CompareUsersRole(int firstUserId, int secondUserId, int machineId) { MachineUserModel firstUser = FindByUserId(machineId, firstUserId); diff --git a/Step.Database/Controllers/NcToolManagerController.cs b/Step.Database/Controllers/NcToolManagerController.cs index b2d58559..43e116e6 100644 --- a/Step.Database/Controllers/NcToolManagerController.cs +++ b/Step.Database/Controllers/NcToolManagerController.cs @@ -594,6 +594,7 @@ namespace Step.Database.Controllers if (families.FirstOrDefault(x => x.FamilyId == family.FamilyId) == null) { dbCtx.Families.Add(family); + // Set status importStatus.Add(new DTOImportStatusModel() { Id = family.FamilyId, @@ -603,6 +604,7 @@ namespace Step.Database.Controllers } else { + // Set duplicated status importStatus.Add(new DTOImportStatusModel() { Id = family.FamilyId, @@ -669,5 +671,6 @@ namespace Step.Database.Controllers return importStatus; } + } } \ No newline at end of file diff --git a/Step.Database/Controllers/UsersController.cs b/Step.Database/Controllers/UsersController.cs index 5c721386..f30bc14d 100644 --- a/Step.Database/Controllers/UsersController.cs +++ b/Step.Database/Controllers/UsersController.cs @@ -238,10 +238,12 @@ namespace Step.Database.Controllers return GetUserInfo(userId); } - public Boolean isCMSRole(int roleId) + public bool isCMSRole(int roleId) { + var tmpRole = dbCtx.Roles + .ToList() + .First(X => X.RoleId == roleId); - var tmpRole = dbCtx.Roles.ToList().First(X => X.RoleId == roleId); if (tmpRole == null) return true; else diff --git a/Step.Database/DatabaseContext.cs b/Step.Database/DatabaseContext.cs index 8e445abf..4805ff64 100644 --- a/Step.Database/DatabaseContext.cs +++ b/Step.Database/DatabaseContext.cs @@ -9,6 +9,7 @@ using System.Data.Entity.Migrations; using System.Globalization; using System.IO; using System.Linq; +using System.ServiceProcess; using static Step.Config.ServerConfig; using static Step.Model.Constants; using static Step.Utils.ExceptionManager; @@ -58,18 +59,24 @@ namespace Step.Database return new DatabaseContext(); } - public static void SetUpDbConnectionAndDbConfig() + public static bool SetUpDbConnectionAndDbConfig() { try { - System.Data.Entity.Database.SetInitializer(null); - - // Make sure database exists. - using (var db = new DatabaseContext()) + ServiceController service = new ServiceController("MySQL"); + try { - db.Database.Initialize(false); + TimeSpan timeout = TimeSpan.FromSeconds(2); + + service.WaitForStatus(ServiceControllerStatus.Running, timeout); + } + catch + { + Manage(ERROR_LEVEL.FATAL, "Database not started"); + return false; } + System.Data.Entity.Database.SetInitializer(null); var migrator = new DbMigrator(new Configuration()); if (migrator.GetPendingMigrations().Any()) @@ -98,16 +105,10 @@ namespace Step.Database catch (Exception ex) { Manage(ERROR_LEVEL.FATAL, ex); + return false; } - - //catch (MySql.Data.MySqlClient.MySqlException ex) - //{ - // if (ex.Number == 1042) // Can't find MySQLServer - // Manage(ERROR_LEVEL.FATAL, ex); - // else - // Manage(ERROR_LEVEL.ERROR, ex); - //} + return true; } public static void FindOrCreateMachineUniqueId() @@ -163,7 +164,7 @@ namespace Step.Database // Create default CUSTOMER user usersController.CreateCmsDefaultUserIfNotExists(MachineConfig.MachineId, "admin", "admin", "customer", "admin", Config.ServerConfig.ServerStartupConfig.Language, ROLE_IDS.CUSTOMER_ADMIN); usersController.CreateCmsDefaultUserIfNotExists(MachineConfig.MachineId, "operator", "operator", "customer", "operator", Config.ServerConfig.ServerStartupConfig.Language, ROLE_IDS.CUSTOMER_OPERATOR); - usersController.CreateCmsDefaultUserIfNotExists(MachineConfig.MachineId, "mantainer", "mantainer", "customer", "mantainer", Config.ServerConfig.ServerStartupConfig.Language, ROLE_IDS.CUSTOMER_MANTAINER); + usersController.CreateCmsDefaultUserIfNotExists(MachineConfig.MachineId, "maintainer", "maintainer", "customer", "maintainer", Config.ServerConfig.ServerStartupConfig.Language, ROLE_IDS.CUSTOMER_MAINTAINER); } } else diff --git a/Step.Database/Migrations/Configuration.cs b/Step.Database/Migrations/Configuration.cs index 0d69855b..72952d08 100644 --- a/Step.Database/Migrations/Configuration.cs +++ b/Step.Database/Migrations/Configuration.cs @@ -24,7 +24,7 @@ namespace Step.Database.Migrations new RoleModel() { RoleId = (int)ROLE_IDS.CUSTOMER_ADMIN, Level = 30, Name = "Admin" }, new RoleModel() { RoleId = (int)ROLE_IDS.CUSTOMER_OPERATOR, Level = 20, Name = "Operator" }, - new RoleModel() { RoleId = (int)ROLE_IDS.CUSTOMER_MANTAINER, Level = 10, Name = "Mantainer" } + new RoleModel() { RoleId = (int)ROLE_IDS.CUSTOMER_MAINTAINER, Level = 10, Name = "Maintainer" } ); context.FunctionsAccess.AddOrUpdate( diff --git a/Step.Database/Step.Database.csproj b/Step.Database/Step.Database.csproj index 29abce1d..d7aed763 100644 --- a/Step.Database/Step.Database.csproj +++ b/Step.Database/Step.Database.csproj @@ -91,6 +91,7 @@ + ..\packages\System.Threading.Channels.4.5.0\lib\netstandard2.0\System.Threading.Channels.dll diff --git a/Step.Model/ConfigModels/MaintenanceConfigModel.cs b/Step.Model/ConfigModels/MaintenanceConfigModel.cs index 535be5ef..da453b48 100644 --- a/Step.Model/ConfigModels/MaintenanceConfigModel.cs +++ b/Step.Model/ConfigModels/MaintenanceConfigModel.cs @@ -6,7 +6,7 @@ namespace Step.Model.ConfigModels public class MaintenanceConfigModel { public int Id { get; set; } - public Dictionary LocalizedName { get; set; } + public Dictionary LocalizedName { get; set; } public TimeSpan Intervall { get; set; } public DateTime Deadline { get; set; } public string Type { get; set; } @@ -15,4 +15,11 @@ namespace Step.Model.ConfigModels public Dictionary LocalizedDescription { get; set; } public string UnitOfMeasure { get; set; } } + + public class ContactModel + { + public string Name { get; set; } + public string Email { get; set; } + public string PhoneNumber { get; set; } + } } \ No newline at end of file diff --git a/Step.Model/ConfigModels/NcConfigModel.cs b/Step.Model/ConfigModels/NcConfigModel.cs index 9b1692ad..0c607c37 100644 --- a/Step.Model/ConfigModels/NcConfigModel.cs +++ b/Step.Model/ConfigModels/NcConfigModel.cs @@ -17,5 +17,6 @@ namespace Step.Model.ConfigModels public string SharedPath { get; set; } public string SharedName { get; set; } public string InstallationDate { get; set; } + public bool MgiOption { get; set; } } } diff --git a/Step.Model/Constants.cs b/Step.Model/Constants.cs index 03e7462c..4254ac62 100644 --- a/Step.Model/Constants.cs +++ b/Step.Model/Constants.cs @@ -20,13 +20,15 @@ namespace Step.Model } public const int MIN_CMS_ROLE = 100; + public const int MIN_ADMIN_ROLE = 30; + public enum ROLE_IDS { CMS_SERVICE = 1, CMS_UT = 2, CUSTOMER_ADMIN = 3, CUSTOMER_OPERATOR = 4, - CUSTOMER_MANTAINER = 5 + CUSTOMER_MAINTAINER = 5 } public enum ACTIONS @@ -162,12 +164,12 @@ namespace Step.Model public const string AREAS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "areasConfigValidator.xsd"; public const string AREAS_CONFIG_PATH = CONFIG_DIRECTORY + "areasConfig.xml"; - public const string MAINTENANCES_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "maintenancesConfigValidator.xsd"; + public const string MAINTENANCES_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "maintenancesConfigValidator.xsd"; public const string MAINTENANCES_CONFIG_PATH = CONFIG_DIRECTORY + "maintenancesConfig.xml"; - + public const string USER_SOFTKEYS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "userSoftKeyConfigValidator.xsd"; public const string USER_SOFTKEYS_CONFIG_PATH = CONFIG_DIRECTORY + "userSoftKeyConfig.xml"; - + public const string ALARMS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "alarmsConfigValidator.xsd"; public const string ALARMS_CONFIG_PATH = CONFIG_DIRECTORY + "alarmsConfig.xml"; @@ -181,7 +183,9 @@ namespace Step.Model public const string TOOL_MANAGER_CONFIG_PATH = CONFIG_DIRECTORY + "toolManagerConfig.xml"; public const string MACROS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "macrosConfigValidator.xsd"; - public const string MACROS_CONFIG_PATH = CONFIG_DIRECTORY + "macrosConfig.xml"; + public const string MACROS_CONFIG_PATH = CONFIG_DIRECTORY + "macrosConfig.xml"; + + public const string MAIN_PROGRAM_CONFIG_PATH = CONFIG_DIRECTORY + "customMainProgram.txt"; public static string LANGUAGE_PACK_DIRECTORY = BASE_PATH + "\\languages\\"; public static string LANGUAGE_SCHEMA_PATH = BASE_PATH + "\\LanguageValidator.xsd"; @@ -194,6 +198,7 @@ namespace Step.Model public const string SEND_STOP_SERVER = "STOP_SERVER"; public const string SEND_MESSAGE = "SEND_MESSAGE"; + public const string SEND_STOP_THREADS = "SEND_STOP_THREADS"; public const string SEND_NC_STATUS = "NC_STATUS"; public const string SEND_THREADS_STATUS = "THREAD_STATUS"; public const string SHOW_MSG_UI = "SHOW_MSG_UI"; diff --git a/Step.Model/DTOModels/DTOClientConfigurationModel.cs b/Step.Model/DTOModels/DTOClientConfigurationModel.cs index 1e8414ae..ec11a196 100644 --- a/Step.Model/DTOModels/DTOClientConfigurationModel.cs +++ b/Step.Model/DTOModels/DTOClientConfigurationModel.cs @@ -14,6 +14,7 @@ namespace Step.Model.DTOModels public bool ProdEnabled { get; set; } public string ProdPath { get; set; } public bool Autorun { get; set; } + public bool MgiOption { get; set; } public List ExtSoftwares { get; set; } public CultureInfo DefaultLanguage diff --git a/Step.Model/DTOModels/DTONcGenericDataModel.cs b/Step.Model/DTOModels/DTONcGenericDataModel.cs index 9863b2ad..ab088a38 100644 --- a/Step.Model/DTOModels/DTONcGenericDataModel.cs +++ b/Step.Model/DTOModels/DTONcGenericDataModel.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Reflection; namespace Step.Model.DTOModels @@ -17,7 +18,7 @@ namespace Step.Model.DTOModels public string PlcVersion { get; set; } public string UnitOfMeasurement { get; set; } public string ServerVersion { get; set; } - public string CoreLibraryVersion { get; set; } + public string CoreLibraryVersion { get; set; } private DateTime buildDate; private Version v; @@ -29,10 +30,12 @@ namespace Step.Model.DTOModels v = Assembly.GetEntryAssembly()?.GetName().Version; if(v != null) - buildDate = new DateTime(2000, 1, 1).AddDays(v.Build).AddSeconds(v.Revision * 2); + buildDate = new DateTime(2000, 1, 1).AddDays(v.Build).AddSeconds(v.Revision * 2); + // Get first 2 number of the version + var tmp = v.ToString().Split('.').Take(2).ToArray(); // Get Server version - ServerVersion = $"{v} ({buildDate.ToString("d")})"; + ServerVersion = $"{string.Join(".", tmp)} ({buildDate.ToString("d")})"; //Get Library Version CoreLibraryVersion = "2.0.0"; } diff --git a/Step.Model/DTOModels/DTOProcessDataModel.cs b/Step.Model/DTOModels/DTOProcessDataModel.cs index 14c8fb58..e1c4640b 100644 --- a/Step.Model/DTOModels/DTOProcessDataModel.cs +++ b/Step.Model/DTOModels/DTOProcessDataModel.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using CMS_CORE_Library.Models; +using System.Collections.Generic; using System.Linq; using static CMS_CORE_Library.Models.DataStructures; @@ -18,6 +19,12 @@ namespace Step.Model.DTOModels public bool CanLoadProgram; public string ProcessMessage; + public byte RapidOverride; + public byte WorkOverride; + + public OffsetModel offsetData; + + public DTOProcessesDataModel() { ProcessMessage = ""; @@ -59,13 +66,25 @@ namespace Step.Model.DTOModels if (ActiveOrigin != item.ActiveOrigin) return false; - if (ProcessMessage != item.ProcessMessage) + if (ProcessMessage != item.ProcessMessage) return false; if (UnitMeasure != item.UnitMeasure) return false; if (CanLoadProgram != item.CanLoadProgram) + return false; + + if (RapidOverride != item.RapidOverride) + return false; + + if (WorkOverride != item.WorkOverride) + return false; + + if (offsetData.RealLength != item.offsetData.RealLength) + return false; + + if (offsetData.RealRadius != item.offsetData.RealRadius) return false; return true; diff --git a/Step.Model/DTOModels/Scada/ScadaSchemaModel.cs b/Step.Model/DTOModels/Scada/ScadaSchemaModel.cs index 82a11750..4338f1d9 100644 --- a/Step.Model/DTOModels/Scada/ScadaSchemaModel.cs +++ b/Step.Model/DTOModels/Scada/ScadaSchemaModel.cs @@ -104,8 +104,8 @@ namespace Step.Model.DTOModels.Scada //[XmlElement("id")] public int Id { get; set; } - [XmlElement("label")] - public ScadaSchemaLabelDataModel Label { get; set; } + //[XmlElement("label")] + //public ScadaSchemaLabelDataModel Label { get; set; } [XmlElement("position")] public ScadaSchemaPositionModel Position { get; set; } diff --git a/Step.Model/DTOModels/ToolModels/DTONcShankModel.cs b/Step.Model/DTOModels/ToolModels/DTONcShankModel.cs index 5e3c623e..43dad4a4 100644 --- a/Step.Model/DTOModels/ToolModels/DTONcShankModel.cs +++ b/Step.Model/DTOModels/ToolModels/DTONcShankModel.cs @@ -66,7 +66,7 @@ namespace Step.Model.DTOModels.ToolModels return new DTONcShankModel() { Id = obj.ShankId, - Balluf = (ushort)obj.Balluf, + Balluf = (ushort?)obj.Balluf, MagazinePositionType = obj.MagazinePositionType, MagazineId = obj.MagazineId, PositionId = obj.PositionId, diff --git a/Step.Model/DatabaseModels/NcFamilyModel.cs b/Step.Model/DatabaseModels/NcFamilyModel.cs index 6b50ceab..13a95049 100644 --- a/Step.Model/DatabaseModels/NcFamilyModel.cs +++ b/Step.Model/DatabaseModels/NcFamilyModel.cs @@ -97,5 +97,30 @@ namespace Step.Model.DatabaseModels ReviveDelta = (ushort)obj.ReviveDelta }; } + + public static explicit operator DbNcFamilyModel(NcFamilyModel obj) + { + return new DbNcFamilyModel() + { + FamilyId = (short)obj.FamilyId, + ToolType = obj.ToolType, + RightSize = obj.RightSize, + LeftSize = obj.LeftSize, + TcpTable = obj.TcpTable, + Gamma = obj.Gamma, + CoolingByte = obj.CoolingByte, + RotationType = obj.RotationType, + MaxLoad = obj.MaxLoad, + MaxSpeed = obj.MaxSpeed, + MinLoadPctAutoload = obj.MinLoadPctAutoload, + MaxLoadPctAutoload = obj.MaxLoadPctAutoload, + MinLoadDynamicCompensation = obj.MinLoadDynamicCompensation, + MaxLoadDynamicCompensation = obj.MaxLoadDynamicCompensation, + DynamicCompensation = (byte)obj.DynamicCompensation, + LifeType = obj.LifeType, + NominalLife = obj.NominalLife, + ReviveDelta = obj.ReviveDelta + }; + } } } \ No newline at end of file diff --git a/Step.Model/DatabaseModels/NcShankModel.cs b/Step.Model/DatabaseModels/NcShankModel.cs index efbc4534..d962a311 100644 --- a/Step.Model/DatabaseModels/NcShankModel.cs +++ b/Step.Model/DatabaseModels/NcShankModel.cs @@ -57,5 +57,19 @@ namespace Step.Model.DatabaseModels OriginPositionId = obj.OriginPositionId == null ? (ushort)0 : (ushort)obj.OriginPositionId.Value, }; } + + public static explicit operator DbNcShankModel(NcShankModel obj) + { + return new DbNcShankModel() + { + ShankId = (short)obj.ShankId, + Balluf = obj.Balluf == 0 ? null : (ushort?)obj.Balluf, + MagazineId = obj.MagazineId == 0 ? null : (byte?)obj.MagazineId, + PositionId = obj.PositionId == 0 ? null : (ushort?)obj.PositionId, + MagazinePositionType = obj.MagazinePositionType, + OriginMagazineId = obj.OriginMagazineId == 0 ? null : (byte?)obj.OriginMagazineId, + OriginPositionId = obj.OriginPositionId == 0 ? null : (ushort?)obj.OriginPositionId, + }; + } } } \ No newline at end of file diff --git a/Step.Model/DatabaseModels/NcToolModel.cs b/Step.Model/DatabaseModels/NcToolModel.cs index 8f0c496c..45034f91 100644 --- a/Step.Model/DatabaseModels/NcToolModel.cs +++ b/Step.Model/DatabaseModels/NcToolModel.cs @@ -70,5 +70,22 @@ namespace Step.Model.DatabaseModels OffsetId3 = (ushort)(obj.OffsetId3 == null ? 0 : obj.OffsetId3.Value) }; } + + public static explicit operator DbNcToolModel(NcToolModel obj) + { + return new DbNcToolModel() + { + ToolId = obj.ToolId, + FamilyId = obj.FamilyId, + OffsetLength = obj.OffsetLength, + ResidualLife = (ushort)obj.ResidualLife, + Status = obj.Status, + ResidualRevive = (ushort)obj.ResidualRevive, + ShankId = obj.ShankId == 0 ? null : (short?)obj.ShankId, + OffsetId1 = obj.OffsetId1 == 0 ? null : (short?)obj.OffsetId1, + OffsetId2 = obj.OffsetId2 == 0 ? null : (short?)obj.OffsetId2, + OffsetId3 = obj.OffsetId3 == 0 ? null : (short?)obj.OffsetId3 + }; + } } } \ No newline at end of file diff --git a/Step.NC/NcFileHandler.cs b/Step.NC/NcFileHandler.cs index c7eb6c00..11291ee3 100644 --- a/Step.NC/NcFileHandler.cs +++ b/Step.NC/NcFileHandler.cs @@ -13,7 +13,8 @@ using Step.Model.DTOModels.JobModels; using Step.Utils; using Step.Database.Controllers; using static Step.Database.Controllers.QueueController; - +using System.Text.RegularExpressions; + namespace Step.NC { public class NcFileHandler : NcHandler @@ -256,8 +257,15 @@ namespace Step.NC if (cmsError.IsError()) return cmsError; - // Activate updated program + // Custom part program management + //if(String.IsNullOrEmpty(CMSMainProgramContent)) + // Activate directly program return numericalControl.FILES_WSetActiveProgram(selectedProcess, newFilePath, ref programData); + //else + //{ + // // Activate updated program with custom main program + // return numericalControl.FILES_WUploadCustomMainProgramAndActivate(selectedProcess, CMSMainProgramContent, ref programData); + //} } else { diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index 89b3048e..6882d1f6 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -113,7 +113,7 @@ namespace Step.NC return cmsError; } - public CmsError GetAxesPositionsByProcess(ushort processNum, out DTOAxesModel axes) + public CmsError GetAxesPositionsByProcess(ushort processNum, out DTOAxesModel axes) { axes = new DTOAxesModel(); @@ -432,6 +432,12 @@ namespace Step.NC processesData.ActiveOffsetId = selectedData.ActiveOffsetId; processesData.ProcessMessage = selectedData.ProcessMessage; + // Overrides + processesData.RapidOverride = selectedData.RapidOverride; + processesData.WorkOverride = selectedData.WorkOverride; + + processesData.offsetData = selectedData.OffsetData; + // Measure processesData.UnitMeasure = UMeas; @@ -968,9 +974,9 @@ namespace Step.NC scadas.Add(scadaValue); // Add id to read scada alreadyReadScada.Add(schema.Id); - } + } } - + return cmsError; } @@ -1000,7 +1006,7 @@ namespace Step.NC if (cmsError.IsError()) return cmsError; // Populate & add new object into scada model - scadaValue.Buttons.Add(new DTOScadaButtonModel() + scadaValue.Buttons.Add(new DTOScadaButtonModel() { Id = layer.Buttons[i].Id, Enabled = Convert.ToBoolean(val) @@ -1068,7 +1074,7 @@ namespace Step.NC { IsEnabled = false, //Convert.ToBoolean(val), Value = val2 - } + } }); } else diff --git a/Step.NC/NcToolTableHandler.cs b/Step.NC/NcToolTableHandler.cs index 89dc7680..8423e8ea 100644 --- a/Step.NC/NcToolTableHandler.cs +++ b/Step.NC/NcToolTableHandler.cs @@ -8,7 +8,8 @@ using System.Data.Entity; using System.Linq; using static CMS_CORE_Library.Models.DataStructures; using static Step.Config.ServerConfig; - +using static Step.Model.Constants; + namespace Step.NC { public class NcToolTableHandler : NcHandler @@ -112,7 +113,7 @@ namespace Step.NC DTONewNcFamilyModel newFamily = new DTONewNcFamilyModel(); SupportFunctions.CopyProperties(dtoToolWithFamily, newFamily); // Update only family data - newFamily = (DTONcFamilyModel)toolsManager.UpdateFamily(dtoToolWithFamily.FamilyId, newFamily); + newFamily = (DTONcFamilyModel)toolsManager.UpdateFamily(dtoToolWithFamily.FamilyId, newFamily); } // Update database tool Tool @@ -120,7 +121,7 @@ namespace Step.NC // Populate updated tool with offset data cmsError = GetToolData(dbTool, ref toolWithOffsets); - if (cmsError.IsError()) + if (cmsError.IsError()) { dbContextTransaction.Rollback(); return cmsError; @@ -137,20 +138,20 @@ namespace Step.NC { startIsActive = true; // Create backup of data stored on the NC and block memory/files accesses - cmsError = numericalControl.TOOLS_WStartEditData(); + cmsError = numericalControl.TOOLS_WStartEditData(); if (cmsError.IsError()) { ManageErrorAndTransaction(cmsError, dbContextTransaction, startIsActive); return cmsError; - } - - // If family option is not active, update NC data - //if (!ToolManagerConfig.FamilyOpt) - //{ - // Update Nc families - cmsError = UpdateNcFamily(toolsManager); - if (cmsError.IsError()) - ManageErrorAndTransaction(cmsError, dbContextTransaction, true); + } + + // If family option is not active, update NC data + //if (!ToolManagerConfig.FamilyOpt) + //{ + // Update Nc families + cmsError = UpdateNcFamily(toolsManager); + if (cmsError.IsError()) + ManageErrorAndTransaction(cmsError, dbContextTransaction, true); //} // Update tool @@ -181,7 +182,7 @@ namespace Step.NC .FindTools() .Select(x => (NcToolModel)x) .Where(x => shanks.Any(y => y.ShankId == x.ShankId)) // Find only mounted tools - .ToList(); + .ToList(); // Update tools return numericalControl.TOOLS_WUpdateTools(tools); @@ -189,10 +190,10 @@ namespace Step.NC public CmsError UpdateOffset(short offsetId, OffsetModel offsetData) { - return numericalControl.TOOLS_WOffset(offsetId, offsetData); + return numericalControl.TOOLS_WOffset(offsetId, ref offsetData); } - public CmsError UpdateToolOffsetId(int toolId, int positionId, short offsetId, out DTONcToolModel toolWithOffsets) + public CmsError UpdateToolOffsetId(int toolId, int positionId, short offsetId, out DTONcToolModel toolWithOffsets) { toolWithOffsets = new DTONcToolModel(); @@ -273,20 +274,20 @@ namespace Step.NC CmsError cmsError = NO_ERROR; if (tool.ShankId != null && shank != null) - { + { if (shank.MagazineId != null) { - startIsActive = true; + startIsActive = true; // Create backup of data stored on the NC and block file accesses cmsError = numericalControl.TOOLS_WStartEditData(); if (cmsError.IsError()) { - ManageErrorAndTransaction(cmsError, dbContextTransaction, startIsActive); + ManageErrorAndTransaction(cmsError, dbContextTransaction, startIsActive); return cmsError; } // Update Nc data - cmsError = UpdateNcTools(toolsManager); + cmsError = UpdateNcTools(toolsManager); } } @@ -547,286 +548,345 @@ namespace Step.NC public CmsError SetupNcToolManager() { - CmsError cmsError = UpdateMagazinePositionConf(); + CmsError cmsError = UpdateMagazinePositionConf(out bool newDb); if (cmsError.IsError()) return cmsError; cmsError = WriteOption(); if (cmsError.IsError()) - return cmsError; - - return NO_ERROR; - } - - public CmsError UpdateMagazinePositionConf() - { - using (NcToolManagerController toolsManager = new NcToolManagerController()) - { - // Get database configured positions - List dbPositions = toolsManager.FindMagazinesPositions(); - if (dbPositions.Count <= 0) - { - CmsError cmsError = GetMagazineConfiguration(out List config); - if (cmsError.IsError()) - return cmsError; - - // Setup new positions list in order to be saved in the database - List fromConfigPosition = new List(); - foreach (var conf in config) - { - for (byte i = 1; i <= conf.MaxPositions; i++) - { - // Create new position - fromConfigPosition.Add(new DbNcMagazinePositionModel() - { - MagazineId = conf.Id, - PositionId = i, - Disabled = false, - Type = 0 - }); - } - } - - // Update database - toolsManager.SetupMagazinePositions(fromConfigPosition); - - return cmsError; - } - - return NO_ERROR; - } - } - - public CmsError WriteOption() - { - ToolManagerOptionsModel options = new ToolManagerOptionsModel(); - SupportFunctions.CopyProperties(ToolManagerConfig, options); - - return numericalControl.TOOLS_WOptions(options); - } - - public CmsError GetMagazineConfiguration(out List config) - { - config = new List(); - // Read configuration - return numericalControl.TOOLS_RMagazineConfig(ref config); - } - - public CmsError StartEditData() - { - return numericalControl.TOOLS_WStartEditData(); - } - - public CmsError StopEditData() - { - return numericalControl.TOOLS_WStopEditData(); - } - - public CmsError StartEditTooling(int magazineId) - { - return numericalControl.TOOLS_WStartEditTooling(magazineId); - } - - public CmsError StopEditTooling(int magazineId) - { - using (NcToolManagerController toolsManager = new NcToolManagerController()) - { - // Get mounted shanks - List shanks = toolsManager - .FindShanks() - .Where(x => x.MagazineId != null) - .Select(x => (NcShankModel)x) - .ToList(); - // Update shanks - CmsError cmsError = numericalControl.TOOLS_WUpdateShanks(shanks); - if (cmsError.IsError()) - return cmsError; - - // Get magazine positions - List positions = toolsManager.FindMagazinesPositions() - .Select(x => (NcMagazinePositionModel)x) - .ToList(); - // Update positions - cmsError = numericalControl.TOOLS_WUpdateMagazinePositions(positions); - if (cmsError.IsError()) - return cmsError; - - // Get tools - List tools = toolsManager - .FindTools() - .Select(x => (NcToolModel)x) - .Where(x => shanks.Any(y => y.ShankId == x.ShankId)) // Find only mounted tools - .ToList(); - - // Update tools - cmsError = numericalControl.TOOLS_WUpdateTools(tools); - if (cmsError.IsError()) - return cmsError; - - // Get families - List families = toolsManager - .FindFamilies() - .Select(x => (NcFamilyModel)x) - .Where(x => tools.Any(y => y.FamilyId == x.FamilyId)) // Find only families of mounted tools - .ToList(); - - // Update families - cmsError = numericalControl.TOOLS_WUpdateFamilies(families); - if (cmsError.IsError()) - return cmsError; - } - - return numericalControl.TOOLS_WStopEditTooling(magazineId); - } - - public CmsError GetUpdatedToolsData(out Dictionary updatedStatus, out Dictionary updatedLives) - { - updatedStatus = new Dictionary(); - updatedLives = new Dictionary(); - return numericalControl.TOOLS_RUpdatedToolsData(ref updatedStatus, ref updatedLives); - } - - public CmsError CheckIfShankCanFit(int magazineId, int positionId, DbNcShankModel shankToBeLoaded) - { - CmsError cmsError = GetMagazineConfiguration(out List magazinesConfig); - if (cmsError.IsError()) - return cmsError; - - NcMagazineConfigModel magConfig = magazinesConfig.FirstOrDefault(x => x.Id == magazineId);// Get only current magazine config - if (magConfig == null) - return INCORRECT_PARAMETERS_ERROR; - - using (NcToolManagerController toolsManager = new NcToolManagerController()) - { - List magazineMountedTools = toolsManager.GetMountedTools(); - - // Check if there is a tool already mounted in magazineId and positionId - var toolAlreadyMounted = magazineMountedTools.FirstOrDefault(x => x.Shank.MagazineId == magazineId && x.Shank.PositionId == positionId); - if (toolAlreadyMounted != null) - return MAGAZINE_POSITION_OCCUPIED_ERROR; - - // Get shank occupied space - toolsManager.GetShankMaxSpaceOccupied(shankToBeLoaded.ShankId, out int maxRight, out int maxLeft); - - // Check if tool can fit in the position considering other tools - foreach (var mountedTool in magazineMountedTools) - { - // Check if is not the same position && if is different check if the position is on the same magazine - if (mountedTool.Shank.PositionId != positionId && mountedTool.Shank.MagazineId == magazineId) - { - int decPosition, incPosition; - decPosition = incPosition = mountedTool.Shank.PositionId.Value; - // if it is a circular magazine move position before ( for left case ) or after ( right case ) the location you want to mount the tool - if (magConfig.Type != NC_MAGAZINE_TYPE.BOX_MAGAZINE) - { - decPosition = decPosition < positionId ? decPosition + magConfig.MaxPositions : decPosition; - incPosition = incPosition > positionId ? incPosition - magConfig.MaxPositions : incPosition; - } - - // Right check - if (positionId < decPosition) - { - if (!(magConfig.Type == NC_MAGAZINE_TYPE.BOX_MAGAZINE && mountedTool.Shank.PositionId == 1)) - { - // Calculate left space occupied (with mounted shank) - double leftMounted = decPosition - (mountedTool.Family.LeftSize / 2.0); - // Calculate right space needed (with shank to be loaded) - double rightToBeMount = positionId + (maxRight / 2.0); - if (leftMounted < rightToBeMount) - return MAGAZINE_POSITION_OCCUPIED_ERROR; - } - } - - // Left check - if (positionId > incPosition) - { - if (!(magConfig.Type == NC_MAGAZINE_TYPE.BOX_MAGAZINE && mountedTool.Shank.PositionId == magConfig.MaxPositions)) - { - // Calculate right space occupied (with mounted shank) - double rightMounted = incPosition + (mountedTool.Family.RightSize / 2.0); - // Calculate left space needed (with shank to be loaded) - double leftToBeMounted = positionId - (maxLeft / 2.0); - if (rightMounted > leftToBeMounted) - return MAGAZINE_POSITION_OCCUPIED_ERROR; - } - } - } - } - } - - return NO_ERROR; - } - - public CmsError GetNcMagazineStatus(out Dictionary status) - { - status = new Dictionary(); - return numericalControl.TOOLS_RMagazineStatus(ref status); - } - - public CmsError StartAssistedToolingProcedure(ushort toolId, ushort familyId, ushort shankId, ushort magazineId, ushort positionId, ASSISTED_TOOLING_ACTION action) - { - return numericalControl.PLC_WAssistedToolingCmd(toolId, familyId, shankId, magazineId, positionId, action); - } - - public CmsError ReadAssistedToolingProcedure(out DTOAssistedToolingEndValueModel data) - { - data = new DTOAssistedToolingEndValueModel(); - AssistedToolingModel tmpData = new AssistedToolingModel(); - CmsError cmsError = numericalControl.PLC_RAssistedToolingData(ref tmpData); - if (cmsError.IsError()) - return cmsError; - - data = new DTOAssistedToolingEndValueModel(tmpData); - - return cmsError; - } - - public CmsError TerminateAssistedProcedure(int magazineId, bool writeData) - { - if (writeData) - { - CmsError cmsError = StartEditTooling(magazineId); - if (!cmsError.IsError()) - { - // Write tool table new data - cmsError = StopEditTooling(magazineId); - if (!cmsError.IsError()) - { - // Close procedure - return numericalControl.PLC_WTerminateAssistedToolingProcedure(); - } - } - return cmsError; - } - else - { - return numericalControl.PLC_WTerminateAssistedToolingProcedure(); - } - } - - public CmsError GetSelfAdaptiveStep(out DTOSelfAdaptiveModel step) + return cmsError; + + using (NcToolManagerController toolManager = new NcToolManagerController()) + { + // If database was empty read data from NC and update database + if (newDb) + { + List tools = new List(); + List families = new List(); + List shanks = new List(); + + // Read data from Nc memory + cmsError = numericalControl.TOOLS_RStoredData(ref tools, ref families, ref shanks); + if (cmsError.IsError()) + return cmsError; + + // Check if there are data + if (tools.Count() > 0 || families.Count() > 0 || shanks.Count() > 0) + { + // Populate import object + DTOExportToolTableModel exp = new DTOExportToolTableModel() + { + Tools = tools.Select(x => (DbNcToolModel)x).ToList(), + Families = families.Select(x => + { + var fam = (DbNcFamilyModel)x; + fam.Name = "Fam" + fam.FamilyId.ToString(); + return fam; + }).ToList(), + Shanks = shanks.Select(x => (DbNcShankModel)x).ToList() + }; + + // Import + toolManager.ImportData(exp); + } + } + + List databaseTool = toolManager.GetTools(); + bool exist = false; + if (databaseTool != null && databaseTool.Count() > 0) + // Check options consistency with database data + exist = databaseTool.Exists(x => + (!ToolManagerConfig.FamilyOpt && x.FamilyId != x.Id) || // Check family + (!ToolManagerConfig.ShankOpt && x.ShankId != x.Id) || // Check shanks + (!ToolManagerConfig.OffsetOpt && x.OffsetId1 != x.Id && x.OffsetId2 != null && x.OffsetId3 != null) // Check offsets + ); + + if (exist) + return OPTION_NOT_CONSISTENT_ERROR; + + // Check if there are blocked magazines, and release them + cmsError = RestoreTableLock(); + if (cmsError.IsError()) + return cmsError; + + } + + return NO_ERROR; + } + + public CmsError UpdateMagazinePositionConf(out bool newDb) + { + newDb = false; + using (NcToolManagerController toolsManager = new NcToolManagerController()) + { + // Get database configured positions + List dbPositions = toolsManager.FindMagazinesPositions(); + if (dbPositions.Count <= 0) + { + // THe software is using a new database + newDb = true; + + CmsError cmsError = GetMagazineConfiguration(out List config); + if (cmsError.IsError()) + return cmsError; + + // Setup new positions list in order to be saved in the database + List fromConfigPosition = new List(); + foreach (var conf in config) + { + for (byte i = 1; i <= conf.MaxPositions; i++) + { + // Create new position + fromConfigPosition.Add(new DbNcMagazinePositionModel() + { + MagazineId = conf.Id, + PositionId = i, + Disabled = false, + Type = 0 + }); + } + } + + // Update database + toolsManager.SetupMagazinePositions(fromConfigPosition); + + return cmsError; + } + + return NO_ERROR; + } + } + + public CmsError WriteOption() + { + ToolManagerOptionsModel options = new ToolManagerOptionsModel(); + SupportFunctions.CopyProperties(ToolManagerConfig, options); + + return numericalControl.TOOLS_WOptions(options); + } + + public CmsError GetMagazineConfiguration(out List config) + { + config = new List(); + // Read configuration + return numericalControl.TOOLS_RMagazineConfig(ref config); + } + + public CmsError StartEditData() + { + return numericalControl.TOOLS_WStartEditData(); + } + + public CmsError StopEditData() + { + return numericalControl.TOOLS_WStopEditData(); + } + + public CmsError StartEditTooling(int magazineId) + { + return numericalControl.TOOLS_WStartEditTooling(magazineId); + } + + public CmsError StopEditTooling(int magazineId) + { + using (NcToolManagerController toolsManager = new NcToolManagerController()) + { + // Get mounted shanks + List shanks = toolsManager + .FindShanks() + .Where(x => x.MagazineId != null) + .Select(x => (NcShankModel)x) + .ToList(); + // Update shanks + CmsError cmsError = numericalControl.TOOLS_WUpdateShanks(shanks); + if (cmsError.IsError()) + return cmsError; + + // Get magazine positions + List positions = toolsManager.FindMagazinesPositions() + .Select(x => (NcMagazinePositionModel)x) + .ToList(); + // Update positions + cmsError = numericalControl.TOOLS_WUpdateMagazinePositions(positions); + if (cmsError.IsError()) + return cmsError; + + // Get tools + List tools = toolsManager + .FindTools() + .Select(x => (NcToolModel)x) + .Where(x => shanks.Any(y => y.ShankId == x.ShankId)) // Find only mounted tools + .ToList(); + + // Update tools + cmsError = numericalControl.TOOLS_WUpdateTools(tools); + if (cmsError.IsError()) + return cmsError; + + // Get families + List families = toolsManager + .FindFamilies() + .Select(x => (NcFamilyModel)x) + .Where(x => tools.Any(y => y.FamilyId == x.FamilyId)) // Find only families of mounted tools + .ToList(); + + // Update families + cmsError = numericalControl.TOOLS_WUpdateFamilies(families); + if (cmsError.IsError()) + return cmsError; + } + + return numericalControl.TOOLS_WStopEditTooling(magazineId); + } + + public CmsError GetUpdatedToolsData(out Dictionary updatedStatus, out Dictionary updatedLives) + { + updatedStatus = new Dictionary(); + updatedLives = new Dictionary(); + return numericalControl.TOOLS_RUpdatedToolsData(ref updatedStatus, ref updatedLives); + } + + public CmsError CheckIfShankCanFit(int magazineId, int positionId, DbNcShankModel shankToBeLoaded) + { + CmsError cmsError = GetMagazineConfiguration(out List magazinesConfig); + if (cmsError.IsError()) + return cmsError; + + NcMagazineConfigModel magConfig = magazinesConfig.FirstOrDefault(x => x.Id == magazineId);// Get only current magazine config + if (magConfig == null) + return INCORRECT_PARAMETERS_ERROR; + + using (NcToolManagerController toolsManager = new NcToolManagerController()) + { + List magazineMountedTools = toolsManager.GetMountedTools(); + + // Check if there is a tool already mounted in magazineId and positionId + var toolAlreadyMounted = magazineMountedTools.FirstOrDefault(x => x.Shank.MagazineId == magazineId && x.Shank.PositionId == positionId); + if (toolAlreadyMounted != null) + return MAGAZINE_POSITION_OCCUPIED_ERROR; + + // Get shank occupied space + toolsManager.GetShankMaxSpaceOccupied(shankToBeLoaded.ShankId, out int maxRight, out int maxLeft); + + // Check if tool can fit in the position considering other tools + foreach (var mountedTool in magazineMountedTools) + { + // Check if is not the same position && if is different check if the position is on the same magazine + if (mountedTool.Shank.PositionId != positionId && mountedTool.Shank.MagazineId == magazineId) + { + int decPosition, incPosition; + decPosition = incPosition = mountedTool.Shank.PositionId.Value; + // if it is a circular magazine move position before ( for left case ) or after ( right case ) the location you want to mount the tool + if (magConfig.Type != NC_MAGAZINE_TYPE.BOX_MAGAZINE) + { + decPosition = decPosition < positionId ? decPosition + magConfig.MaxPositions : decPosition; + incPosition = incPosition > positionId ? incPosition - magConfig.MaxPositions : incPosition; + } + + // Right check + if (positionId < decPosition) + { + if (!(magConfig.Type == NC_MAGAZINE_TYPE.BOX_MAGAZINE && mountedTool.Shank.PositionId == 1)) + { + // Calculate left space occupied (with mounted shank) + double leftMounted = decPosition - (mountedTool.Family.LeftSize / 2.0); + // Calculate right space needed (with shank to be loaded) + double rightToBeMount = positionId + (maxRight / 2.0); + if (leftMounted < rightToBeMount) + return MAGAZINE_POSITION_OCCUPIED_ERROR; + } + } + + // Left check + if (positionId > incPosition) + { + if (!(magConfig.Type == NC_MAGAZINE_TYPE.BOX_MAGAZINE && mountedTool.Shank.PositionId == magConfig.MaxPositions)) + { + // Calculate right space occupied (with mounted shank) + double rightMounted = incPosition + (mountedTool.Family.RightSize / 2.0); + // Calculate left space needed (with shank to be loaded) + double leftToBeMounted = positionId - (maxLeft / 2.0); + if (rightMounted > leftToBeMounted) + return MAGAZINE_POSITION_OCCUPIED_ERROR; + } + } + } + } + } + + return NO_ERROR; + } + + public CmsError GetNcMagazineStatus(out Dictionary status) + { + status = new Dictionary(); + return numericalControl.TOOLS_RMagazineStatus(ref status); + } + + public CmsError StartAssistedToolingProcedure(ushort toolId, ushort familyId, ushort shankId, ushort magazineId, ushort positionId, ASSISTED_TOOLING_ACTION action) + { + return numericalControl.PLC_WAssistedToolingCmd(toolId, familyId, shankId, magazineId, positionId, action); + } + + public CmsError ReadAssistedToolingProcedure(out DTOAssistedToolingEndValueModel data) + { + data = new DTOAssistedToolingEndValueModel(); + AssistedToolingModel tmpData = new AssistedToolingModel(); + CmsError cmsError = numericalControl.PLC_RAssistedToolingData(ref tmpData); + if (cmsError.IsError()) + return cmsError; + + data = new DTOAssistedToolingEndValueModel(tmpData); + + return cmsError; + } + + public CmsError TerminateAssistedProcedure(int magazineId, bool writeData) + { + if (writeData) + { + CmsError cmsError = StartEditTooling(magazineId); + if (!cmsError.IsError()) + { + // Write tool table new data + cmsError = StopEditTooling(magazineId); + if (!cmsError.IsError()) + { + // Close procedure + return numericalControl.PLC_WTerminateAssistedToolingProcedure(); + } + } + return cmsError; + } + else + { + return numericalControl.PLC_WTerminateAssistedToolingProcedure(); + } + } + + public CmsError GetSelfAdaptiveStep(out DTOSelfAdaptiveModel step) { step = new DTOSelfAdaptiveModel(); - byte intStep = 0; - - //Get the value - CmsError cmsError = numericalControl.TOOLS_RAdatpivePathStep(ref intStep); - step.Step = intStep; - return cmsError; - } - - public CmsError SetSelfAdaptiveStep(DTOSelfAdaptiveModel step) - { - //Limit Value - if (step.Step > 100) - step.Step = 100; - if (step.Step < 0) - step.Step = 0; - - //Set the value - return numericalControl.TOOLS_WAdatpivePathStep(step.Step); - } - + byte intStep = 0; + + //Get the value + CmsError cmsError = numericalControl.TOOLS_RAdatpivePathStep(ref intStep); + step.Step = intStep; + return cmsError; + } + + public CmsError SetSelfAdaptiveStep(DTOSelfAdaptiveModel step) + { + //Limit Value + if (step.Step > 100) + step.Step = 100; + if (step.Step < 0) + step.Step = 0; + + //Set the value + return numericalControl.TOOLS_WAdatpivePathStep(step.Step); + } + public CmsError RestoreTableLock() { List ids = new List(); @@ -834,10 +894,10 @@ namespace Step.NC CmsError cmsError = numericalControl.TOOLS_RMagazineBlock(ref ids); if (cmsError.IsError()) return cmsError; - - if(ids.Count() > 0) + + if (ids.Count() > 0) { - // Update tables + // Update tables cmsError = StopEditTooling(ids.FirstOrDefault()); if (cmsError.IsError()) return cmsError; @@ -846,6 +906,6 @@ namespace Step.NC } return NO_ERROR; - } - } + } + } } \ No newline at end of file diff --git a/Step.UI/ServerControlWindow.cs b/Step.UI/ServerControlWindow.cs index 87d45424..8f156ee5 100644 --- a/Step.UI/ServerControlWindow.cs +++ b/Step.UI/ServerControlWindow.cs @@ -1,4 +1,5 @@ -using Step.Model; +using Step.Core; +using Step.Model; using Step.Model.DTOModels; using Step.NC; using System; @@ -6,6 +7,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; +using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Threading; @@ -56,8 +58,9 @@ namespace Step.UI if (v != null) { DateTime buildDate = new DateTime(2000, 1, 1).AddDays(v.Build).AddSeconds(v.Revision * 2); + var tmp = v.ToString().Split('.').Take(2).ToArray(); this.Text = "Active Control Window"; - TXTVersion.Text = "V" + v + " (" + buildDate.ToString("d") + ")"; + TXTVersion.Text = "V" + String.Join(".", tmp) + " (" + buildDate.ToString("d") + ")"; } PswForm = new PasswordForm(); @@ -132,7 +135,7 @@ namespace Step.UI private void OpenUiButton_Click(object sender, EventArgs e) { //Open CMS Client - StartCMSClient(null); + ThreadsHandler.StartClientFromUI(); } private void StopServerButton_Click(object sender, EventArgs e) @@ -158,25 +161,6 @@ namespace Step.UI MessageServices.Current.Publish(SEND_STOP_SERVER); } - public static void StartCMSClient(string url) - { - //Setup the Path Variable - string CMSClientPath = ""; - if (!ClientIsRunning()) - { - // Check if the system is 64/32 bit - if (Environment.Is64BitOperatingSystem && File.Exists(CLIENT_PATH_64)) - CMSClientPath = CLIENT_PATH_64; - else if (File.Exists(CLIENT_PATH_86)) - CMSClientPath = CLIENT_PATH_86; - - if (!String.IsNullOrEmpty(CMSClientPath)) - Process.Start(CMSClientPath, url); - else - MessageBox.Show("CMS-Active Client not found"); - } - } - private void InitializeMessageListeners() { MVVMListeners = new List @@ -206,15 +190,16 @@ namespace Step.UI if (!this.IsDisposed) this.Invoke((MethodInvoker)delegate () { - // Open BalloonTip with data - StepNotifyIcon.ShowBalloonTip(1000, message.Title, message.Message, (ToolTipIcon.Error)); + // Open BalloonTip with data + StepNotifyIcon.ShowBalloonTip(1000, message.Title, message.Message, (ToolTipIcon.Error)); - //ShowMessage on UI - TXTstatus.Text = "[" + DateTime.Now.ToString("T") + "] " + message.Message; + //ShowMessage on UI + TXTstatus.Text = "[" + DateTime.Now.ToString("T") + "] " + message.Message; + + // Notify user + if(MessageBox.Show(new Form { TopMost = true }, message.Message, message.Title, MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK) + MessageServices.Current.Publish(SEND_STOP_SERVER); }); - // Notify user - if(MessageBox.Show(message.Message, message.Title, MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK) - MessageServices.Current.Publish(SEND_STOP_SERVER); } }), // NC status handler diff --git a/Step.UI/Step.UI.csproj b/Step.UI/Step.UI.csproj index 8eeb14cb..537c3132 100644 --- a/Step.UI/Step.UI.csproj +++ b/Step.UI/Step.UI.csproj @@ -134,6 +134,10 @@ {3f5c2483-fc87-43ef-92a8-66ff7d0e440f} Step.Config + + {de54ff4c-8390-4489-882a-1bc7d99ef185} + Step.Core + {631375DD-06D3-49BB-8130-D9DDB34C429D} Step.Model diff --git a/Step.Utils/ExceptionManager.cs b/Step.Utils/ExceptionManager.cs index 1370da2e..5cc07841 100644 --- a/Step.Utils/ExceptionManager.cs +++ b/Step.Utils/ExceptionManager.cs @@ -66,7 +66,7 @@ namespace Step.Utils case ERROR_LEVEL.ERROR: { LogError(message); - NotifyUsers(CreateMessageModel("Error!", message, ERROR_LEVEL.ERROR)); + NotifyUsersAndClose(CreateMessageModel("Error!", message, ERROR_LEVEL.ERROR)); } break; case ERROR_LEVEL.FATAL: @@ -75,7 +75,7 @@ namespace Step.Utils if (!MessageBoxShow) { MessageBoxShow = true; - NotifyUsers(CreateMessageModel("Fatal Error!", message, ERROR_LEVEL.FATAL), beforeFormReady); + NotifyUsersAndClose(CreateMessageModel("Fatal Error!", message, ERROR_LEVEL.FATAL), beforeFormReady); // Check if the server form is ready (if not i have to close manually) if (beforeFormReady) // Close the application @@ -89,7 +89,7 @@ namespace Step.Utils if (!MessageBoxShow) { MessageBoxShow = true; - NotifyUsers(CreateMessageModel("Generic Error!", message, ERROR_LEVEL.FATAL), beforeFormReady); + NotifyUsersAndClose(CreateMessageModel("Generic Error!", message, ERROR_LEVEL.FATAL), beforeFormReady); } } break; @@ -99,20 +99,35 @@ namespace Step.Utils private static void LogAndNotifyUsers(ErrorMessageModel error) { // Log - LogMessage(error.Message, (ERROR_LEVEL)error.ErrorLevel); - NotifyUsers(error); + LogMessage(error.Message, (ERROR_LEVEL)error.ErrorLevel); + NotifyUsersAndClose(error); } private static void NotifyUsers(ErrorMessageModel error, bool beforeFormReady = false) + { + if (beforeFormReady) + { + MessageBox.Show(new Form { TopMost = true }, error.Message, error.Title, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + else + { + MessageServices.Current.Publish(SEND_MESSAGE, null, error); + } + } + + private static void NotifyUsersAndClose(ErrorMessageModel error, bool beforeFormReady = false) { if (beforeFormReady) { // Notify user - MessageBox.Show(error.Message, error.Title, MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageServices.Current.Publish(SEND_STOP_THREADS); + MessageBox.Show(new Form { TopMost = true }, error.Message, error.Title, MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageServices.Current.Publish(SEND_STOP_SERVER); } else { // Notify user + //MessageServices.Current.Publish(SEND_STOP_THREADS); MessageServices.Current.Publish(SEND_MESSAGE, null, error); } } diff --git a/Step.Utils/LanguageController.cs b/Step.Utils/LanguageController.cs index e88faea9..56b07cb3 100644 --- a/Step.Utils/LanguageController.cs +++ b/Step.Utils/LanguageController.cs @@ -46,7 +46,7 @@ namespace Step.Utils .ToDictionary(x => x.Name.ToString(), x => x.Value); // Populate dictionary } - public static List GetLanguageListFromDirectory() + public static List GetLanguageListFromDirectory() { // Check if directory exists if (Directory.Exists(LANGUAGE_PACK_DIRECTORY)) @@ -64,7 +64,7 @@ namespace Step.Utils DTOLanguageModel language = new DTOLanguageModel() // Create language model { IsoId = info.TwoLetterISOLanguageName, - Name = info.NativeName + Name = char.ToUpper(info.NativeName[0]) + info.NativeName.Substring(1) }; return language; }) diff --git a/Step.Utils/Step.Utils.csproj b/Step.Utils/Step.Utils.csproj index b07f318d..15ec31a2 100644 --- a/Step.Utils/Step.Utils.csproj +++ b/Step.Utils/Step.Utils.csproj @@ -88,13 +88,22 @@ + + PreserveNewest + PreserveNewest + + PreserveNewest + + + PreserveNewest + PreserveNewest - + PreserveNewest diff --git a/Step.Utils/languages/IT.xml b/Step.Utils/languages/IT.xml index ff1171f9..28463eaa 100644 --- a/Step.Utils/languages/IT.xml +++ b/Step.Utils/languages/IT.xml @@ -1,5 +1,5 @@ - + Italiano Effettuare manutenzione @@ -54,6 +54,10 @@ Versione Core Maestro-Active: Versione Client Maestro-Active: Formato delle date Maestro-Active: + Informazioni di contatto + Nome contatto: + Email: + Telefono: Rpm Utensile Carico @@ -106,6 +110,7 @@ Ofst Sys Msg + Mgi Gestore Utensili Magazzino Mandrino @@ -137,7 +142,7 @@ Modifica Offset n. %d Modifica Tagliente n. %d Creazione nuovo Tagliente - Associazionie nuovo Offset + Associazione nuovo Offset Gestione Codoli Seleziona un Codolo: Crea un nuovo Codolo @@ -316,7 +321,7 @@ Gamma Inverter Tipo rotazione Id Tabella-Tcp associata - Velocità massima + Velocità massima Carico Massimo Carico Minimo Carico Massimo @@ -328,6 +333,7 @@ Δ Ravvivatura ut. Id Tagliente Id Offset + Unità di misura Vita Residua Vita Nominale Limite di Pre-Allarme @@ -372,10 +378,13 @@ Angolo di Correzione Lunghezza Braccio Raggio Sfera + Raggio Reale + Lunghezza Reale Nessuna selezione Generico A Tempo A Contatore + A Distanza Ad Usura Rot. Oraria Rot. Antioraria @@ -445,6 +454,26 @@ Radio Probe 2 - Ricevitore 2 Radio Probe 3 - Ricevitore 2 Radio Probe 4 - Ricevitore 2 + Disco ultrasuoni amplitude 10%% + Disco ultrasuoni amplitude 20%% + Disco ultrasuoni amplitude 30%% + Disco ultrasuoni amplitude 40%% + Disco ultrasuoni amplitude 50%% + Disco ultrasuoni amplitude 60%% + Disco ultrasuoni amplitude 70%% + Disco ultrasuoni amplitude 80%% + Disco ultrasuoni amplitude 90%% + Disco ultrasuoni amplitude 100%% + Lama ultrasuoni amplitude 10%% + Lama ultrasuoni amplitude 20%% + Lama ultrasuoni amplitude 30%% + Lama ultrasuoni amplitude 40%% + Lama ultrasuoni amplitude 50%% + Lama ultrasuoni amplitude 60%% + Lama ultrasuoni amplitude 70%% + Lama ultrasuoni amplitude 80%% + Lama ultrasuoni amplitude 90%% + Lama ultrasuoni amplitude 100%% Richiesta di conferma Ok Annulla @@ -457,6 +486,7 @@ Sei sicuro di voler cancellare il multitool? Sei sicuro di voler scaricare l'utensile dal codolo? Sei sicuro di voler scaricare l'utensile dal multitool? + Sei sicuro di voler cancellare tutti gli allarmi? Sei sicuro di aver eseguito questa manutenzione? Sei sicuro di voler cancellare la famiglia? Gestore Manutenzioni @@ -512,16 +542,24 @@ NC Prod Softkey Preferite + Interp. Absol. To-Go Prog. + Rapid: + Work: + Lunghezza reale: + Raggio reale: + Diametro Reale: Origine attiva: Correttore attivo: Tagliente attivo: Linee iso: Messaggio: Seleziona un programma - Seleziona la modalità Auto per eseguire un programma + Seleziona la modalità Auto per eseguire un programma + Selezione in corso + Vai alla selezione Program-Loader Seleziona un programma Carica e attiva diff --git a/Step.Utils/languages/de.xml b/Step.Utils/languages/de.xml new file mode 100644 index 00000000..77d1b0f3 --- /dev/null +++ b/Step.Utils/languages/de.xml @@ -0,0 +1,663 @@ + + + + Deutsch + Wartung ausführen + Fälligkeit: + Eine Prozedur muss ausgeführt werden + %d Alarme sind aktiv + %d Warnungen sind aktiv + Prozess + Benutzereinstellungen + Abmelden + Sprache + Abbrechen + Speichern + Benutzeranmeldung + Benutzername + Passwort + Anmelden + Benutzername falsch + Passwort falsch + Siehe Alarmhistorie + Alle aktualisieren + Siehe + Alarm + Warnung + Status + Wiederherstellungsprozedur + Behebung des Alarms + Starten + Siehe Anleitung + Hilfe anfordern + Aktualisieren + Zur Liste zurückkehren + Aktiv + Gelöscht + Eine Anlage hinzufügen + Maschineninformationen + Seriennummer: + Installationsdatum: + CN-Modell: + Serien- CN-Nr.: + CN-Firmware-Version: + SPS-Version: + Ausgewählte CN-Sprache: + Anzahl der CN-Prozesse: + CN-Zeitstempel: + Cn-Maßeinheit: + Version Server CMS-Active: + Version Core CMS-Active: + Version Client CMS-Active: + Datenformat CMS-Active: + Version Server Maestro-Active: + Version Core Maestro-Active: + Version Client Maestro-Active: + Datenformat Maestro-Active: + Kontaktinformation + Kontaktname: + Email: + Telefonnummer: + 1/min + Werkzeug + Last + MPa + Schleifmittel + 1/min + Leer + bar + Geschwindigkeit + Achse: + Inkr: + Generische Softkeys + Blockierungen / Vakuumbereiche + Aggregate / Kühlgeräte + Betriebsmodi + Starten von Prozeduren / Benutzerprogramme + Ausrüstung und Schutzeinrichtungen + Beladen / Entladen + Sind Sie sicher? + Bestätigen + Abbrechen + ausgewählte Elemente + Auswahl beenden + Fenster ausblenden + Meldung vom Prozess %d + Wert: + Dienstprogramm & Externe Software + Vorgang nicht möglich + Erst alle offenen Vorgänge beenden, bevor andere Anwendungen gestartet werden. + Soll Active wirklich geschlossen werden? + Vorgang nicht möglich + Erst alle offenen Vorgänge beenden, bevor Active geschlossen wird. + NC-Daten + NC-Prozesse + Alarme + Achsen + Byte-Speicher + Programme + Magazine + Familie / Schäfte + Werkzeuge + Maschine + Parameter + Programm + Prog. Manager + Diagnostik + Inbetriebnahme + Pos + Prog + Offset + Sys + Msg + Mgi + Werkzeugverwaltung + Magazin + Spindel + Werkzeuge + Schäfte + Multiwerkzeuge + Halterungskonfiguration + Familien + Werkzeuggruppen + Werkzeugverwaltung + Magazinausrüstung: + Schritt selbstadaptiver Pfad + Werkzeuge exportieren + Werkzeuge Importieren + Werkzeuge & Konfigurationen: + Werkzeug auswählen: + Neues Werkzeug erzeugen + Ändern + Abbrechen + Speichern + Hinzufügen + Offset + Schneide + Neues Offset + Neue Schneide + Parameter + Werkzeug Nr. %d ändern + Erzeugung eines neuen Werkzeugs + Offset Nr. %d ändern + Schneide Nr. %d ändern + Erzeugung einer neuen Schneide + Vereinigung neues Offset + Schaftverwaltung + Schaft wählen: + Neuen Schaft erzeugen + Schaft %d + Verwaltung Multitool + Multitool auswählen: + Neues Multitool erzeugen + Multitool %d + Werkzeug %d + Neues Werkzeug + Schaft Nr. %d ändern + Multitool Nr. %d ändern + Das zum Schaft hinzuzufügende Werkzeug wählen + Das zum Multitool hinzuzufügende Werkzeug wählen + Erzeugung eines neuen Schafts + Erzeugung eines neuen Multitools + Werkzeug %d des Schafts %d ändern + Werkzeug %d des Multitools %d ändern + Verwaltung Magazinhalterungen + Eine Halterung auswählen: + Pos + Magazin + Position Nr. %d des Magazins %s ändern + Familienverwaltung + Verwaltung-Werkzeuggruppen + Eine Familie auswählen: + Eine Gruppe auswählen: + Familie %s ändern + Erzeugung einer neuen Familie + Gruppe %s ändern + Erzeugung einer neuen Gruppe + Werkzeug %d + Duplo %d + Werkzeug %d der Familie %s ändern + Werkzeug %d der Gruppe %s ändern + Ein Werkzeug mit ID suchen + Ein Werkzeug mit Namen suchen + Einen Schaft mit ID suchen + Ein Multitool mit Namen suchen + Eine Halterung mit ID suchen + Eine Familie mit Namen suchen + Eine Werkzeuggruppe mit Namen suchen + MA%d + S%d + T%d + ST%d + M%d + F%d + P%d + Änderungen beenden + Ändern + Werkzeugstatus anzeigen + Ein Werkzeug auswählen und es zur entsprechenden Position ziehen. + Ein Werkzeug mit Namen suchen + Verfügbare Position + Werkzeug laden + Ein Werkzeug zum Laden auswählen + Werkzeug + Abbrechen + Laden + Werkzeug ändern + Zum Ändern des Werkzeugs das Ausrüsten des Magazins beenden + Position + Offset-ID + Offset %d + Eine neue Familie erzeugen + Zu wenig Platz, um dieses Werkzeug zu laden + Laden Werkzeug + Entladen Werkzeug + Transfer Werkzeug + Werkzeugverwaltung beschäftigt + Ein Vorgang blockiert die Werkzeugverwaltung... + Magazin %d + Pos. %d + Allg. Param.: + Gruppe - Werkzeuge: + Familie: + Werkzeugstatus: + Kältemittel: + Magazin: + Spindel: + Lebensdauer: + Geometrie: + Allg. Param.: + Status Schaft: + Status Multitool: + Magazin: + Allg. Param.: + Allg. Param.: + Inverter Palette: + Magazin: + Status Werkzeug: + Offset: + RFID: + Art der gewünschten Position: + Position: + Dynamische Kompensation: + TCP-Tabelle: + Kältemittel: + Grenzen: + Selbstadaptiver Weg: + Lebensdauer: + Abrichtung: + Grenzen: + Abrichtung: + Dynamische Kompensation: + TCP-Tabelle: + Selbstadaptiver Weg: + Werk.-ID + Werk.-Art + Art Lebensdauer + Name + Name + ID Sohn + Multitool Id + Werkz. Zugelassen + Werkz. Aktiv + Werkz. Gesperrt + Werkz. in fester Pos. + Werkz. Gemessen + Werkzeug im Werkzeugwechsel + Werkz. in Gebrauch + Werkz. in Voralarm + Hauptkühlung + Kühlung 1 + Kühlung 2 + Kühlung 3 + Kühlung 4 + Kühlung 5 + Kühlung 6 + Kühlung 7 + Halterungsart + Abmessung links + Abmessung rechts + Art Drehung + Maximalgeschwindigkeit + Maximalbeschleunigung + Mag.-ID + Position + Art + Mech. Art + Deaktiviert + Position + Schaft-ID + Familien-ID + Offset Länge + Restlebensdauer + Werk. deaktiviert + Werk. gestört + Werk. gemessen + Drehung im Uhrzeigersinn + Drehung gegen den Uhrzeigersinn + Offset-ID 1 + Offset-ID 2 + Offset-ID 3 + ID Tabelle - zugeordnete TCP + Inverter Palette + Art Drehung + Mögliche Maximallast + Last-Min. selbstadaptiver Weg + Last-Max. selbstadaptiver Weg + Dynamische Kompensation + Last-Min. dynamische Kompensation + Last-Max. dynamische Kompensation + Nennlebensdauer + Δ Abrichtung Werk. + RFID Werkzeug-ID + Magazin-ID + Position + Auto + Name + Familien-ID + Werk.-Art + Abmessung links + Abmessung rechts + Inverter Palette + Art Drehung + ID Tabelle - zugeordnete TCP + Maximalgeschwindigkeit + Maximallast + Minimallast + Maximallast + Verschleißkoeffizient Werkzeug + Minimallast + Maximallast + Art Lebensdauer + Nennlebensdauer + Δ Abrichtung Werk. + Schneiden-ID + Offset-ID + Maßeinheit + Restlebensdauer + Nennlebensdauer + Grenzen des Voralarms + Schneidenart + Länge + Länge + Radius + Verschleißlänge + Verschleißlänge + Verschleißradius + Verschleißdurchmesser + Zahnanz. + Radius Winkelverbindung + Länge Geometrie Werk. 1 + Länge Geometrie Werk. 2 + Länge Geometrie Werk. 3 + Δ Länge Werk. 1 + Δ Länge Werk. 2 + Δ Länge Werk. 3 + Länge Adapter 1 + Länge Adapter 2 + Länge Adapter 3 + V + Vektor 1 + Vektor 2 + Vektor 3 + Außenradius + Werkzeugwinkel + Breite + Kegelwinkel + Spitzenwinkel + Schritt + Durchmesser + Rillenbreite + Überschuss + Verschleiß Länge 1 + Verschleiß Länge 2 + Verschleiß Länge 3 + Verschleiß Durchmesser + Verschleiß Rillenbreite + Verschleiß Überschuss + Korrekturwinkel + Armlänge + Kugelradius + Wirklicher Radius + Wirkliche Länge + Keine Auswahl + Allgemein + Nach Zeit + Nach Zähler + Nach Entfernung + Nach Verschleiß + Rot. Schaltzeit + Rot. Gegen den Uhrzeigersinn + Alle Drehrichtungen + Verb zum Fräsen + Fr.Zyl.Kopf Kugel + Fr.konisch.Kopf Kugel + Schaftfräse + Schaftfräse, abger.Kan. + Fr.Winkelkopf + Fräse Wink.abger.Kan. + Planfräse + Gewindendefräse + Scheibenfräse + Säge + Fräse Stumpf Kegel + Fr.Stum.Keg, abger.Kan + Konische Fräse f. Gesenke + Fr.bohr./schn. + Helikoidalbohrer + Vollbohr.Spi. + Bohrstange + Zentrierer + Kegelsenker konisch + Kegelsenker eben + Spitze + Spitze Feingew. + Spitze Gew. WW + Reibahle + Säge für Nuten + Tast.Mess. 3D + Tastkopf Kanten + Mono-Tastkopf + L-Tastkopf + Stern-Tastkopf + Kalibrier-Werk. + Anschlag + Hilfswerkzeuge + Eine neue Familie hinzufügen + Verfügbare Familien: + Halterung im Magazin + Spindel + Zange + Belader + Transferposition + Lade-/Entladestation + Lade-/Entladepunkt + Scheibe + Kl. Messer 50%% + Kl. Messer 70%% + Kl. Messer 80%% + Klinge 1 + Klinge 2 + Klinge 3 + Klinge 4 + Klinge 5 + Klinge 6 + Klinge 7 + Klinge ⌀300 + Klinge ⌀400 + Klinge ⌀500 + Radio Probe 1 - Empfänger 1 + Radio Probe 2 - Empfänger 1 + Radio Probe 3 - Empfänger 1 + Radio Probe 4 - Empfänger 1 + Radio Probe 1 - Empfänger 2 + Radio Probe 2 - Empfänger 2 + Radio Probe 3 - Empfänger 2 + Radio Probe 4 - Empfänger 2 + Ultraschallscheibenamplitude 10%% + Ultraschallscheibenamplitude 20%% + Ultraschallscheibenamplitude 30%% + Ultraschallscheibenamplitude 40%% + Ultraschallscheibenamplitude 50%% + Ultraschallscheibenamplitude 60%% + Ultraschallscheibenamplitude 70%% + Ultraschallscheibenamplitude 80%% + Ultraschallscheibenamplitude 90%% + Ultraschallscheibenamplitude 100%% + Ultraschallklingenamplitude 10%% + Ultraschallklingenamplitude 20%% + Ultraschallklingenamplitude 30%% + Ultraschallklingenamplitude 40%% + Ultraschallklingenamplitude 50%% + Ultraschallklingenamplitude 60%% + Ultraschallklingenamplitude 70%% + Ultraschallklingenamplitude 80%% + Ultraschallklingenamplitude 90%% + Ultraschallklingenamplitude 100%% + Bestätigungsanforderung + OK + Abbrechen + Soll das Werkzeug wirklich gelöscht werden? + Soll die ausgewählte Wartung wirklich gelöscht werden? + Soll die Anmerkung wirklich gelöscht werden? + Soll diese Anlage wirklich gelöscht werden? + Soll die Schneide wirklich gelöscht werden? + Soll der Schaft wirklich gelöscht werden? + Soll das Multitool wirklich gelöscht werden? + Soll das Werkzeug wirklich aus dem Schaft entfernt werden? + Soll das Werkzeug wirklich aus dem Multitool entfernt werden? + Möchten Sie wirklich alle Alarme löschen? + Wurde diese Wartung wirklich durchgeführt? + Soll die Familie wirklich gelöscht werden? + Wartungsverwaltung + Speichern + Alle Dateien anzeigen + Nur die neuesten Dateien anzeigen + Eine Datei hinzufügen + Alle Anmerkungen anzeigen + Nur die letzten Anmerkungen anzeigen + Als ausgeführt kennzeichnen + Die Wartung nach Namen suchen + Wartungsname... + Status + Einen Wartungseingriff erzeugen + Eine Wartung auswählen... + Abgelaufen + Geschlossen + Nicht abgelaufen + Läuft ab + Zähler + Fälligkeit + Status + Überschrift + Am %s um %s hinzugefügt + Löschen + Speichern + Kein Wartungseingriff durchgeführt + Der letzte Eingriff erfolgte vor ein paar Minuten durch: %s + Der letzte Eingriff erfolgte vor %d Stunden durch: %s + Der letzte Eingriff erfolgte vor %d Tagen durch: %s + Der letzte Eingriff erfolgte am: %s, von: %s + Wartung erzeugt am %s um %s + Anlagen + Anmerkungen + Erzeugung eines Wartungseingriffs + Überschrift + Abbrechen + Datum + Beschreibung + Stunde + Art + Wiederholen alle + Tage + Stunden + Minuten + Monate + Fixes Datum + Zeitraum + Wartung erzeugen + Wartung ändern + Produktionsverwaltung + Active + NC + Prod. + Bevorzugte Softkeys + Interp. + Absol. + To-Go + Prog. + Rapid: + Work: + Wirkliche Länge + Wirkliche Radius + Wirklicher Durchmesser: + Ursprung aktiv: + Korrekturgerät aktiv: + Schneide aktiv: + Linien ISO: + Meldung: + Programm auswählen + Den Automatikmodus auswählen, um ein Programm auszuführen. + Auswahl läuft + Gehe zur Auswahl + Programm-Lader + Programm auswählen + Laden und aktivieren + Aktivieren + Ein Programm mit Namen suchen + Erzeugungsdatum: + Datum der letzten Änderung: + Vorschau nicht verfügbar + Alle Dateien des ausgewählten Ordners laden + NC + PLC + Verwalter Alarmhistorie + Alarme nach Namen filtern + Überschrift... + Quelle + Datumsbereich + Benutzer + Quelle + Überschrift + Datum + Benutzer + Einen Alarm auswählen... + Kein-Benutzer + Benutzer ändern + Name + Nachname + Passwort + Benutzername + Hinzufügen + Ändern + Abbrechen + Die Passwörter müssen sich unterscheiden + Aktuelles Passwort + Neues Passwort + Passwort ändern: %s + Rolle ändern: %s + Soll der Benutzer wirklich gelöscht werden? + Einen neuen Benutzer hinzufügen + Benutzerverwaltung + Benutzer nach Benutzernamen filtern + Benutzername... + Avatar + Benutzername + Name + Nachname + Sprache + Rolle + Produktionsmanager + Tool Manager + Manager Maschinenwartung + Alarmhistorie + Bericht und Maschinenstatus + Dienstprogramm und externe Software + Seiten Scada + Bereich Unterschicht öffnen/schließen + Job-Editor + Benutzer-Manager + CMS-Schritt schließen + CMS-Schritt minimieren + Help der Maschine anzeigen + Informationen der Maschine anzeigen + Informationen des Benutzers anzeigen + Die Liste der verfallenen Wartungen öffnen/schließen + Bereich unter-dem-Kasten schließen + Bereich unter-dem-Kasten schließen + CN in Error. Die Liste der Alarme öffnen/schließen + CN in Warten auf Befehle + CN in Ausführung von Befehlen + Prozessinformationen + Maschinenvorrichtungen nicht OK + Maschine in Betrieb + Maschine nicht betriebsbereit + Maschine betriebsbereit + Not-Halt-Taster betätigt + Schlüssel nicht eingesteckt + Achsen ohne Leistung + Sicherheitsabdeckungen nicht OK + Einstellmodus aktiviert + Druckluft nicht OK + Nullstellen der Achsen erforderlich + Schleifmittel verwendet + Kopf aktiv + Aktuelle Last + Aktueller Druck + Name des Kopfes + Prozentsatz der Überbrückung + Überbrückung verringern + Überbrückung vergrößern + Aktuelle Geschwindigkeit + ID montiertes Werkzeug + Vakuum am Kopf + CN-Prozess Inhaber des Kopfes + Den Prozess %d auswählen + Teileprogramm + CMS-Makro + Kopf + Pause + Verzögerung + Ursprung + Programmende + diff --git a/Step.Utils/languages/en.xml b/Step.Utils/languages/en.xml index 6c734a12..5f60607b 100644 --- a/Step.Utils/languages/en.xml +++ b/Step.Utils/languages/en.xml @@ -1,5 +1,5 @@ - + English Maintenance request @@ -54,6 +54,10 @@ Maestro-Active Core Version: Maestro-Active Client Version: Maestro-Active Data Format: + Contact Info + Contact Name: + Email: + Phone Number: Rpm Tool Load @@ -106,6 +110,7 @@ Ofst Sys Msg + Mgi Tool-Manager Magazine Spindle @@ -328,6 +333,7 @@ Δ Revive tool Cutting Edge Id Offset Id + Unit of measure Residual Life Nominal Life Pre-Alarm Limit @@ -372,10 +378,13 @@ Angle Correction Boom Lenght Ball Radius + Real Radius + Real Length None Generic Time Count + Distance Wear Clockwhise Rot. Counter Clockwhise Rot. @@ -445,6 +454,26 @@ Radio Probe 2 - Reciever 2 Radio Probe 3 - Reciever 2 Radio Probe 4 - Reciever 2 + Ultrasound disk amplitude 10%% + Ultrasound disk amplitude 20%% + Ultrasound disk amplitude 30%% + Ultrasound disk amplitude 40%% + Ultrasound disk amplitude 50%% + Ultrasound disk amplitude 60%% + Ultrasound disk amplitude 70%% + Ultrasound disk amplitude 80%% + Ultrasound disk amplitude 90%% + Ultrasound disk amplitude 100%% + Ultrasound blade amplitude 10%% + Ultrasound blade amplitude 20%% + Ultrasound blade amplitude 30%% + Ultrasound blade amplitude 40%% + Ultrasound blade amplitude 50%% + Ultrasound blade amplitude 60%% + Ultrasound blade amplitude 70%% + Ultrasound blade amplitude 80%% + Ultrasound blade amplitude 90%% + Ultrasound blade amplitude 100%% Confirm Operation Ok Cancel @@ -457,6 +486,7 @@ Are you sure to delete this multitool? Are you sure to unload this tool from his shank? Are you sure to unload this tool from his multitool? + Are you sure to delete all the alarms? Are you sure you have performed this maintenance? Are you sure to delete this family? Maintenance manager @@ -512,9 +542,15 @@ NC Prod Favorite Softkey + Interp. Absol. To-Go Prog. + Rapid: + Work: + Real length: + Real radius: + Real diameter: Active origin: Active offset: Active Cutting-edge: @@ -522,6 +558,8 @@ Message: Select a program Put the NC in Auto mode for execute a Program + Selection in progress + Go to selection Program-Loader Select a program Load & Activate diff --git a/Step.Utils/languages/fr.xml b/Step.Utils/languages/fr.xml index 7815b00d..8177cff3 100644 --- a/Step.Utils/languages/fr.xml +++ b/Step.Utils/languages/fr.xml @@ -1,5 +1,5 @@ - + Français Procéder à la maintenance @@ -54,6 +54,10 @@ Version Core Maestro-Active : Version Client Maestro-Active : Format des dates Maestro-Active : + Informations de contact + Nom du contact + Email: + Numéro de Téléphone: Tpm Outil Charge @@ -106,6 +110,7 @@ Ofst Sys Msg + Mgi Gestionnaire Outils Magasin Broche @@ -328,6 +333,7 @@ Δ Dressage out. Id Tranchant Id Offset + Unité de mesure Vie Résiduelle Vie Nominale Limite de Préalarme @@ -372,10 +378,13 @@ Angle de Correction Longueur Bras Rayon Sphère + Rayon Réel + Longueur Réelle Aucune sélection Générique À Temps À Compteur + À Distance À Usure Rot. Horaire Rot. Antihoraire @@ -445,6 +454,26 @@ Radio Probe 2 - Récepteur 2 Radio Probe 3 - Récepteur 2 Radio Probe 4 - Récepteur 2 + Disque à ultrasons, amplitude 10%% + Disque à ultrasons, amplitude 20%% + Disque à ultrasons, amplitude 30%% + Disque à ultrasons, amplitude 40%% + Disque à ultrasons, amplitude 50%% + Disque à ultrasons, amplitude 60%% + Disque à ultrasons, amplitude 70%% + Disque à ultrasons, amplitude 80%% + Disque à ultrasons, amplitude 90%% + Disque à ultrasons, amplitude 100%% + Lame à ultrasons, amplitude 10%% + Lame à ultrasons, amplitude 20%% + Lame à ultrasons, amplitude 30%% + Lame à ultrasons, amplitude 40%% + Lame à ultrasons, amplitude 50%% + Lame à ultrasons, amplitude 60%% + Lame à ultrasons, amplitude 70%% + Lame à ultrasons, amplitude 80%% + Lame à ultrasons, amplitude 90%% + Lame à ultrasons, amplitude 100%% Demande de confirmation Ok Annuler @@ -457,6 +486,7 @@ Voulez-vous vraiment éliminer l'outil multifonctionnel ? Voulez-vous vraiment éliminer l'outil de la queue ? Voulez-vous vraiment éliminer l'outil de l'outil multifonctionnel ? + Voulez-vous vraiment éliminer toutes les alarmes? Voulez-vous vraiment éliminer cette intervention de maintenance ? Voulez-vous vraiment éliminer la famille ? Gestionnaire Maintenance @@ -512,9 +542,15 @@ NC Prod. Touches Favorites + Interp. Absol. To-Go Prog. + Rapid: + Work: + Longueur réelle: + Rayon réel: + Diamètre réel: Origine active : Correcteur actif : Tranchant actif : @@ -522,6 +558,8 @@ Message: Sélectionner un programme Sélectionner le mode Auto pour exécuter un programme + Sélection en cours + Aller à la sélection Chargeur de programme Sélectionner un programme Charger et activer @@ -569,7 +607,7 @@ Nom Langue Fonction - Responsable de la 0rpoduction + Responsable de la poduction Gestionnaire d'outils Responsable de la maintenance de la machine Historique des alarmes diff --git a/Step.Utils/languages/hr.xml b/Step.Utils/languages/hr.xml new file mode 100644 index 00000000..572433a9 --- /dev/null +++ b/Step.Utils/languages/hr.xml @@ -0,0 +1,662 @@ + + + + Hrvatski + Izvršiti održavanje + Rok: + Ima neki postupak za izvršiti + Ima %d aktivnih alarma + Ima %d aktivnih warninga + Postupak + Korisničke Postavke + Log out + Jezik + Poništi + Spremi + Login korisnika + Korisničko ime + Lozinka + Log in + Pogrešno korisničko ime + Pogrešna lozinka + Vidi povijest alarma + Refresh sve + Vidi + Alarm + Warning + Stanje + Postupak obnove + Rješenje alarma + Pokreni + Vidi Priručnik + Traži Pomoć + Refresh + Vrati se na listu + Aktivno + Otklonjeno + Dodaj privitak + Informacije o Stroju + Matični br.: + Datum ugradnje: + Cn Model: + Cn Serijski broj: + Verzija Cn firmware: + Verzija Plc: + Cn odabrani jezik: + Broj Cn procesa: + Time-Stamp Cn: + Cn jedinica mjere: + Verzija Server CMS-Active: + Verzija Core CMS-Active: + Verzija Client CMS-Active: + Format datuma CMS-Active: + Verzija Server Maestro-Active: + Verzija Core Maestro-Active: + Verzija Client Maestro-Active: + Format datuma Maestro-Active: + Informacije o kontaktu + Ime kontakta: + E-mail: + Broj telefona: + Rpm + Alat + Opterećenje + Mpa + Brusno sredstvo + o/min + Prazno + bar + Brzina + Os: + Povećanje: + Opće Softkey + Blokiranja / Područja praznine + Agregati / Rashladni uređaji + Načini rada + Lansiranje postupaka / Korisnički programi + Opreme i zaštite + Ukrcaj / Iskrcaj + Jesi li siguran? + Potvrdi + Poništi + odabrani elementi + Završi odabir + Sakri Prozor + Poruka iz procesa %d + Vrijednost: + Vanjski Software & Utility + Nemoguća radnja + Završi viseće radnje prije korištenja drugih aplikacija + Jesi li siguran da želiš zatvoriti Active? + Nemoguća radnja + Završi viseće radnje prije zatvaranja Active + Nc podaci + Nc postupci + Alarmi + Osi + Byte-Memory + Programi + Skladišta + Familije / Dršci + Alati + Stroj + Parametri + Program + Prog. Manager + Dijagnostika + Stavljanje u službu + Pos + Prog + Ofst + Sys + Msg + Mgi + Upravljač Alata + Skladište + Stezna glava + Alati + Dršci + Multitools + Konfiguracija Stezača Alata + Familije + Grupa alata + Upravljanje Alatima + Opreme skladišta: + Step autoadaptivni put + Izvoz alata + Uvoz alata + Alait & Konfiguracije: + Odaberi alat: + Kreiraj novi alat + Izmjena + Poništi + Spremi + Dodaj + Offset + Oštrica + Novi Offset + Nova Oštrica + Parametri + Preinaka alata br. %d + Kreiranje Novog Alata + Izmjena Offset-a br. %d + Izmjena Oštrice br. %d + Kreiranje nove Oštrice + Udruživanje novog Offseta + Upravljanje Dršcima + Odaberi neki Držak: + Kreiraj novi Držak + Držak %d + Upravljanje Multitool-om + Odaberi neki Multitool: + Kreiraj novi Multitool + Multitool %d + Alat %d + Novi Alat + Izmjena drška br. %d + Izmjena multitool-a br. %d + Odabir alata za dodavanje dršku + Odabir alata za dodavanje Multitool-u + Kreiranje novog Drška + Kreiranje novog Multitool-a + Izmjena alata %d Drška %d + Izmjena alata %d Multitool-a %d + Upravljanje Stezačima Alata skladišta + Odaberi stazač alata: + Pos + Skladište + Izmjena položaja br. %d skladišta %s + Upravljanje Familijama + Upravljanje Grupama alata + Odaberi neku familiju: + Odaberi neku grupu: + Izmjena familije %s + Kreiranje nove familije + Izmjena grupe %s + Kreiranje nove grupe + Alat %d + Duplo %d + Izmjena alata %d familije %s + Izmjena alata %d grupe %s + Traženje alata po id-u + Traženje alata po imenu + Traženje drška po id-u + Traženje Multitool-a po imenu + Traženje stezača alata po Id-u + Traženje familije po imenu + Traženje grupe alata po imenu + MA%d + S%d + T%d + ST%d + M%d + F%d + P%d + Završi izmjene + Izmjena + Prikaži stanje alata + Odaberi neki alat i odvuci ga u odgovarajući položaj + Potraži neki alat po imenu + Raspoloživi položaj + Ukrcaj alat + Odaberi alat za ukrcavanje + Alat + Poništi + Ukrcaj + Izmjena Alata + Završi opremanje skladišta radi izmjene alata + Položaj + Id Offset + Offset %d + Kreiraj novu familiju + Premalo prostora za ukrcavanje tog alata + Ukrcavanje Alata + Iskrcavanje Alata + Prijenos Alata + Tool-Manager Zauzet + Neka radnja blokira upravljač alata… + Skladište %d + Pol. %d + Opći podaci: + Grupa - Alati: + Familija: + Stanje Alata: + Rashladno sredstvo: + Skladište: + Stazna glava: + Život: + Geometrija: + Opći: + Stanje Drška: + Stanje Multitoola: + Skladište: + Opći: + Opći: + Gamma Inverter: + Skladište: + Stanje Alata: + Offset: + Rfid: + Zahtjevana vrsta položaja: + Položaj: + Dinačka Kompenzacija: + Tablica TCP: + Rashladno sredstvo: + Granice: + Autoadaptivni put: + Život: + Oživljavanje: + Granice: + Oživljavanje: + Dinačka Kompenzacija: + Tablica TCP: + Autoadaptivni put: + Id Alata + Tip Alata + Tip života + Ime + Ime + Id dijeteta + Multitool Id + Alat Osposobljen + Alat Aktivan + Alat Inhibiran + Alat u fiksnom pol + Alat Izmjeren + Alat u CU + Alat u Upotrebi + Alat u Predalarmu + Glavno Hlađenje + Hlađenje 1 + Hlađenje 2 + Hlađenje 3 + Hlađenje 4 + Hlađenje 5 + Hlađenje 6 + Hlađenje 7 + Tip stezača + Dimnezija Lijevo + Dimnezija Desno + Tip Rotacije + Maksimalna Brzina + Maksimalno Ubrzanje + Id Skl. + Položaj + Tip + Mehanički tip + Onesposobljeno + Položaj + Id Drška + Id Familije + Offset Dužine + Ostatak Života + Alat onesposobljen + Alat slomljen + Alat izmjeren + Rotacija u Smjeru kazaljke na satu + Rotacija Suprotnom smjeru kazaljke na satu + Id Offset 1 + Id Offset 2 + Id Offset 2 + Id Tabela-Tcp udruženo + Gamma Inverter + Tip rotacije + Maksimalno moguće Opterećenje + Opterećenje-Min Autoadaptivnog Puta + Opterećenje-Max Autoadaptivnog Puta + Dinamička Kompenzacija + Opterećenje-Min Dinamičke Kompenzacije + Opterećenje-Max Dinamičke Kompenzacije + Nominalni Život + Δ oživljavanja al. + Rfid Id alata + Id skladišta + Položaj + Auto + Ime + Id Familije + Tip Al. + Dimenzija Lijevo + Dimenzija Desno + Gamma Inverter + Tip rotacije + Id Tabela-Tcp pridružena + Maksimalna brzina + Maksimalno krcanje + Minimalno krcanje + Maksimalno krcanje + Koeficijent Istrošenosti alata + Minimalno krcanje + Maksimalno krcanje + Tip Života + Nominalni Život + Δ Oživljavanja alata + Id Oštrice + Id Offset + Jedinica mjere + Ostatak Života + Nominalni Život + Granica Predalarma + Id Oštrice + Dužina + Dužina + Radijus + Istrošenost Dužine + Istrošenost Dužine + Istrošenost Radijusa + Istrošenost Promjera + Br. Zuba + Radijus Kutnog Priključka + Geometrijska Dužina Al. 1 + Geometrijska Dužina Al. 2 + Geometrijska Dužina Al. 3 + Δ Dužine Al. 1 + Δ Dužine Al. 2 + Δ Dužine Al. 3 + Dužina Adaptera 1 + Dužina Adaptera 2 + Dužina Adaptera 3 + V + Vektor 1 + Vektor 2 + Vektor 3 + Vanjski Radijus + Kut Alata + Širina + Kut Konusa + Kut Vrha + Korak + Promjer + Širina Utora + Višak + Istrošenost Dužine 1 + Istrošenost Dužine 2 + Istrošenost Dužine 3 + Istrošenost Promjera + Istrošenost Širine Utora + Istrošenost Viška + Kut Korekcije + Dužina Kraka + Radijus Kugle + Stvarni radijus + Stvarna duljina + Nema odabira + Opće + Po Vremenu + Po Brojaču + Udaljenost + Po Istrošenosti + Rot. u Smjeru Kazaljke na satu + Rot. Suprotno Smjeru Kazaljke na satu + Svi smjerovi rotacije + Al. za glodanje + Glo. cil. s kugl. glavom + Glo. kon. s kugl. glavom + Glodalo s drškom + Glodalo s drškom, za zaob. rubove + Glodalo s kutnom glavom + Glodalo kutno za zaob. rubove + Glodalo za izravnavanje + Glodalo za narezivanje + Pločasto glodalo + Pila + Konično glodalo + Konično glodalo za zaobljene rubove + Konično glodalo za kalupe + Glodalo za buš./urez. + Zavojno svrdlo + Svrdlo za bušenje na puno + Alat za horizontalno bušenje + Zabušivač + Konični upuštač + Ravni upuštač + Ureznik + Ureznik za fini navoj + Ureznik za WW navoj + Razvrtač + Pila za utore + Mjerni taster 3D + Taster za rubove + Mono taster + Taster na L + Zvjezdasti taster + Alat za kalibriranje + Graničnik + Pomoćni alati + Dodaj novu familiju + Raspoložive familije: + Stezač alata u skladištu + Stezna glava + Kliješta + Punjač + Prijenosni položaj + Ukrcajna postaja + Točka ukrcaja + Disk + Nožić 50%% + Nožić 70%% + Nožić 80%% + List pile 1 + List pile 2 + List pile 3 + List pile 4 + List pile 5 + List pile 6 + List pile 7 + List pile ⌀300 + List pile ⌀400 + List pile ⌀500 + Radio Probe 1 - Prijemnik 1 + Radio Probe 2 - Prijemnik 1 + Radio Probe 3 - Prijemnik 1 + Radio Probe 4 - Prijemnik 1 + Radio Probe 1 - Prijemnik 2 + Radio Probe 2 - Prijemnik 2 + Radio Probe 3 - Prijemnik 2 + Radio Probe 4 - Prijemnik 2 + Amplituda ultrazvučnog diska 10%% + Amplituda ultrazvučnog diska 20%% + Amplituda ultrazvučnog diska 30%% + Amplituda ultrazvučnog diska 40%% + Amplituda ultrazvučnog diska 50%% + Amplituda ultrazvučnog diska 60%% + Amplituda ultrazvučnog diska 70%% + Amplituda ultrazvučnog diska 80%% + Amplituda ultrazvučnog diska 90%% + Amplituda ultrazvučnog diska 100%% + Amplituda ultrazvučne oštrice 10%% + Amplituda ultrazvučne oštrice 20%% + Amplituda ultrazvučne oštrice 30%% + Amplituda ultrazvučne oštrice 40%% + Amplituda ultrazvučne oštrice 50%% + Amplituda ultrazvučne oštrice 60%% + Amplituda ultrazvučne oštrice 70%% + Amplituda ultrazvučne oštrice 80%% + Amplituda ultrazvučne oštrice 90%% + Amplituda ultrazvučne oštrice 100%% + Zahtjev za potvrdom + Ok + Poništi + Jesi li siguran da želiš izbrisati alat? + Jesi li siguran da želiš izbrisati odabrano održavanje? + Jesi li siguran da želiš izbrisati napomenu? + Jesi li siguran da želiš izbrisati ovaj prilog? + Jesi li siguran da želiš izbrisati oštricu? + Jesi li siguran da želiš izbrisati držak? + Jesi li siguran da želiš izbrisati multitool? + Jesi li siguran da želiš iskrcati alat sa drška? + Jesi li siguran da želiš iskrcati alat iz multitool-a? + Jesi li siguran da si izvršio ovo održavanje? + Jesi li siguran da želiš izbrisati familiju? + Upravljač održavanja + Spremi + Prikaži sve datoteke + Prikaži samo zadnje datoteke + Dodaj datoteku + Prikaži sve napomene + Prikaži samo zadnje napomene + Označi kao izvršeno + Potraži održavanje po imenu + Ime održavanja… + Stanje + Kreiraj neku intervenciju održavanja + Odaberi neko održavanje… + Isteklo + Zatvoreno + Nije isteklo + Na isteku + Brojač + Istek + Stanje + Naslov + Dodatak %s u %s + Briši + Spremi + Nema izvršenih intervencija održavanja + Zadnja intervencija izvršena prije nekoliko minuta, od: %s + Zadnja intervencija izvršena prije %d sati, od: %s + Zadnja intervencija izvršena prije %d dana, od: %s + Zadnja intervencija izvršena dana: %s, od: %s + Održavanje kreirano dana %s u %s sati + Prilozi + Napomene + Kreiranje intervencije održavanja + Naslov + Poništi + Datum + Opis + Sat + Tip + Ponavljaj svakih + Dana + Sati + Minuta + Mjeseci + Fiksni Datum + Privremeno + Kreiraj Održavanje + Izmjeni Održavanje + Upravitelj Proizvodnje + Active + NC + Prod + Softkey Preferirani + Interp. + Absol. + To-Go + Prog. + Rapid: + Work: + Stvarna duljina: + Stvarni polumjer: + Stvarni Promjer: + Originalno je aktivno: + Korektor aktivan: + Oštrica aktivna: + Iso linije: + Poruka: + Odaberi neki program + Odaberi Auto način za izvršavanje nekog programa + Odabir je u tijeku + Idite na odabir + Program-Loader + Odaberi neki program + Ukrcaj i aktiviraj + Aktivno + Traži neki program po imenu + Datum kreiranja: + Datum zadnje izmjene: + Preview nije raspoloživ + Pošalji sve datoteke u odabranu mapu + NC + PLC + Upravljač Povijesti Alarma + Filtriraj alarme po naslovu + Naslov… + Izvor + Interval datuma + Korisnici + Izvor + Naslov + Datum + Korisnici + Odaberi neki alarm… + Nema-Korisnik + Izmjeni korisnika + Ime + Prezime + Lozinka + Korisničko ime + Dodaj + Izmjeni + Poništi + Lozinke moraju biti različite + Aktualna lozinka + Nova lozinka + Izmijeni lozinku: %s + Izmijeni ulogu: %s + Jesi li siguran da želiš ukloniti korisnika? + Dodaj novog korisnika + Upravljač Korisnika + Filtriraj korisnike po Korisničkom Imenu + Korisničko Ime… + Avatar + Korisničko Ime + Ime + Prezime + Jezik + Uloga + Upravitelj Proizvodnje + Upravitelj Alata + Upravitelj održavanja stroja + Povijest alarma + Izvješće i stanje stroja + Vanjski software i Utility + Scada stranice + Otvara/zatvara prostor ispod haube + Job Editor + User Manager + Zatvori CMS-Step + Minimiziraj CMS-Step + Predoči Help stroja + Predoči Informacije o Stroju + Predoči Informacije o korisniku + Otvara/zatvara listu isteklih radnji održavanja + Zatvara prostor ispod haube + Zatvara prostor ispod haube + CN u Greški. Otvara/zatvara listu alarma + CN u Čekanju Naredaba + CN u Izvršenju Naredaba + Informacije o postupku + Uređaji stroja nisu ok + Stroj u radu + Stroj Nije spreman za rad + Stroj je spreman za rad + Gumbi za opasnost pritisnuti + Ključ nije umetnut + Osi nemaju pogona + Sigurnosni štitnici nisu ok + Setting modalitet aktivan + Komprimirani zrak nije ok + Potrebno osi svesti na ništicu + Korišteno brusno sredstvo + Glava aktivna + Aktualno opterećenje + Aktualni tlak + Ime glave + Postotak override-a + Smanji override + Povećaj override + Aktualna brzina + Id Montiranog alata + Praznina na glavi + Cn postupak vlasnika glave + Odaberi postupak %d + Part Program + Macro CMS + Tekst + Stanka + Kašnjenje + Originalno + Kraj Programa + diff --git a/Step.Utils/languages/ro.xml b/Step.Utils/languages/ro.xml new file mode 100644 index 00000000..9c682c00 --- /dev/null +++ b/Step.Utils/languages/ro.xml @@ -0,0 +1,663 @@ + + + + Română + Efectuați întreținerea + Termen limită: + Există o procedură care trebuie efectuată + Există %d alarme active + Există %d warning active + Proces + Setări Utilizator + Log out + Limba + Anulați + Salvați + Login utilizator + Nume utilizator + Parola + Long in + Numele de utilizator incorect + Parola incorectă + Consultați istoricul alarmelor + Refresh toate + Vezi + Alarmă + Avertizare + Stare + Procedura de recuperare + Încetarea alarmei + Pornire + Consultați Manualul + Cereți Ajutor + Refresh + Înapoi la listă + Activ + Eliminat + Adăugați un atașament + Informații despre Mașină + Număr de serie: + Data instalării: + Model Cn: + Număr de Serie Cn: + Versiune firmware Cn: + Versiune Plc: + Limbă selectată Cn: + Numărul proceselor Cn: + Time-Stamp Cn: + Unitate de măsură Cn: + Versiunea Serverului CMS-Active: + Versiunea Core CMS-Active: + Versiunea Client Maestro-Active: + Formatul datelor CMS-Active: + Versiunea Serverului Maestro-Active: + Versiunea Core Maestro-Active: + Versiunea Client Maestro-Active: + Formatul datelor Maestro-Active: + Informatii de contact + Nume de contact: + E-mail: + Numar de telefon: + Rpm + Unealtă + Încărcare + Mpa + Abraziv + rot/min + Vacuum + bari + Viteză + Axă + Incr: + Softkey Generale + Blocări / Zone vacuum + Agregate / Dispozitive de răcire + Mod de lucru + Lansare proceduri / Programe de utilizator + Echipare cu Unealtă și protecții + Încărcare / Descărcare + Ești sigur? + Confirmaţi + Anulați + elemente selectate + Terminați selecția + Ascundeți Fereastra + Mesaj din procesul %d + Valoare: + Utility & Software externe + Operația nu este posibilă + Terminați operațiile în așteptare înainte de a utiliza alte aplicații + Sigur doriți să închideți serviciul Activ? + Operația nu este posibilă + Terminați operațiile în așteptare înainte de a închide Active + Date Nc + Procese Nc + Alarme + Axe + Byte-Memory + Programe + Depozite + Familii / Mânere + Unelte + Mașină + Parametrii + Program + Prog. Manager + Diagnosticare + Punere în funcțiune + Poz + Prog + Ofst + Sys + Msg + Mgi + Manager Unelte + Depozit + Mandrină + Unelte + Mânere + Multitools + Configurare Clești + Familii + Grupuri de unelte + Gestionarea Uneltelor + Echipare cu unelte magazii: + Step parcurs auto-adaptiv + Exportați unelte + Importați unelte + Unelte & Configurații: + Selectați o unealtă: + Creați o nouă unealtă + Modificați + Anulați + Salvați + Adaugați + Offset + Tăiș + Offset Nou + Tăiș Nou + Parametrii + Modificați unealtă n. %d + Creare Unealtă Nouă + Modificați Offset nr. %d + Modificați Tăiș n. %d + Creare Tăiș nou + Asociație Offset nou + Gestionare Mânere + Selectați un Mâner: + Creați un nou Mâner + Mâner %d + Gestionare Multitool + Selectați un Multitool: + Creați un nou Multitool (unealtă multifuncțional) + Multitool %d + Unealtă %d + Unealtă Nouă + Modificați mâner nr. %d + Modificați multitool nr. %d + Alegeți unealta pe care doriți să o adăugați la mâner + Alegeți unealta pe care doriți să o adăugați la Multitool + Creare Mâner nou + Creare Multitool nou + Modificați unealtă %d din Mâner %d + Modificați unealtă %d din Multitool %d + Gestionare Cești depozite + Selectați un clește: + Poz + Depozit + Modificarea poziției n. %d din depozit %s + Gestionare Familii + Gestionare Grupuri-unelte + Selectați o familie: + Selectați un grup: + Modificați familia %s + Creare familie nouă + Modificați grup %s + Creare grup nou + Unealtă %d + Duplo %d + Modificați unealtă %d din familia %s + Modificați unealtă %d din grupul %s + Căutați o unealtă după id + Căutați o unealtă după nume + Căutați un mâner după Id + Căutați un Multitool după nume + Căutați un clește după Id + Căutați o familie după nume + Căutați un grup-unelte după nume + MA%d + S%d + T%d + ST%d + M%d + F%d + P%d + Finalizați modificările + Modificați + Vizualizați starea uneltei + Selectați o unealtă și trageți-o în poziția corespunzătoare + Căutați o unealtă după nume + Poziție disponibilă + Încărcați unealtă + Selectați unealta de încărcat + Unealtă + Anulați + Încărcați + Modificați Unealta + Finalizați echiparea cu unelte a depozitului pentru a modifica unealta + Poziție + Id Offset + Offset%d + Creați o nouă familie + Spațiu prea mic pentru a încărca această unealtă + Încărcare Unealtă + Descărcare Unealtă + Transfer Unealtă + Tool-Manager Ocupat + O operație blochează gestionatorul unelte... + Depozit %d + Poz. %d + General: + Grup - Unelte: + Familie: + Starea Uneltei: + Agent frigorific: + Depozit: + Mandrină: + Viață: + Geometrie: + General: + Stare Mâner: + Stare Multitool: + Depozit: + General: + General: + Gamă Invertor + Depozit: + Starea Uneltei: + Offset: + Rfid + Tipul poziției solicitate: + Poziție: + Compensare Dinamică: + Tabel TCP: + Agent frigorific: + Limitări: + Parcurs auto-adaptiv: + Viață: + Rectificare: + Limitări: + Rectificare: + Compensare Dinamică: + Tabel TCP: + Parcurs auto-adaptiv: + Id Ut. + Tip Ut. + Tip viață + Nume + Nume + Id fiu + Multitool Id + Unealtă Activată + Unealtă Activă + Unealtă Blocată + Unealtă În poz. fixă + Unealtă Măsurată + Unealtă în CU + Unealtă în Uz + Unealtă în Prealarmă + Răcire principală + Răcire 1 + Răcire 2 + Răcire 3 + Răcire 4 + Răcire 5 + Răcire 6 + Răcire 7 + Tip Clește + Dimensiune Stânga + Dimensiune Dreapta + Tip Rotație + Viteza Maximă + Accelerare Maximă + Id Mag. + Poziţie + Tip + Tip mecanic + Invalidată + Poziţie + Id Mâner + Id Familie + Offset Lungime + Viața Reziduală + Unealtă invalidă + Unealtă stricată + Unealtă măsurată + Rotire în sensul acelor de ceasornic + Rotire în sens invers acelor de ceasornic + Id Offset 1 + Id Offset 2 + Id Offset 3 + ID Tabel-TCP asociat + Gamă Invertor + Tip rotație + Încărcare Maximă posibilă + Încărcare-Min Parcurs Auto-adaptiv + Încărcare-Max Parcurs Auto-adaptiv + Compensare Dinamică + Încărcare-Min Compensare Dinamică + Încărcare-Max Compensare Dinamică + Viața Nominală + Δ Rectificare unealtă + Rfid Id unealtă + Id depozit + Poziţie + Auto + Nume + Id Familie + Tip Ut. + Dimensiune Stânga + Dimensiune Dreapta + Gamă Invertor + Tip rotație + ID Tabel-Tcp asociat + Viteza maximă + Încărcare Maximă + Încărcare Minimă + Încărcare Maximă + Coeficient de Uzură al uneltei + Încărcare Minimă + Încărcare Maximă + Tip viață + Viața Nominală + Δ rectificare unealtă + Id Tăiș + Id Offset + Unitate de măsură + Viața Reziduală + Viața Nominală + Limită de Pre-Alarmă + Tip Tăiș + Lungime + Lungime + Rază + Uzură Lungime + Uzură Lungime + Uzură Rază + Uzură Diametru + Nr. Dinți + Rază Racord Unghiular + Lungime Geometrie Unealtă 1 + Lungime Geometrie Unealtă 2 + Lungime Geometrie Unealtă 3 + Δ Lungime Unealtă 1 + Δ Lungime Unealtă 2 + Δ Lungime Unealtă 3 + Lungime Adaptor 1 + Lungime Adaptor 2 + Lungime Adaptor 3 + V + Vector 1 + Vector 2 + Vector 3 + Raza externă + Unghi Unealtă + Lățime + Unghi Con + Unghi Vârf + Pas + Diametru + Lățime Gât + Excedent + Uzură Lungime 1 + Uzură Lungime 2 + Uzură Lungime 3 + Uzură Diametru + Uzură Lățime Gât + Uzură Excedent + Unghi de Corecție + Lungime Braț + Raza Sferei + Raza reală + Lungime reală + Nici o selecție + Generic + La Timp + La Contor + La Distanță + La Uzură + Rotire în sensul acelor de ceasornic + Rotire în sens invers acelor de ceasornic + Toate direcțiile de rotație + Unealtă pentru frezare + Fr.cil.cap sfer. + Fr.conic.cap sfer. + Freză cu mâner + Freză cu mâner, margini rotunjite + Freză cap unghiular + Freză unghiul. margini rotunjite + Freză pentru nivelare + Freză pentru filetare + Freză cu disc + Ferăstrău + Freză trunchi con + Fr. tr. con, margini rotunjite + Freză conică pentru matrițe + Fr. burghiu/filetare + Vârf elicoidal + Vârf burghiu de plin + Mașină de alezat + Centrul de foraj + Teșitor conic + Teșitor plan + Moș + Filet moș fin + Filet moș WW + Alezor + Ferăstrău pentru carieră + Palpator măsură 3D + Palpator margini + Mono-palpator + Palpator tip L + Palpator stea + Unealtă de calibrare + Identificare + Unelte auxiliare + Adăugați o nouă familie + Familii disponibile: + Clește în depozit + Mandrină + Clește + Încărcător + Poziție de transfer + Stație de încărcare + Punct de încărcare + Disc + Cuțitaș 50 %% + Cuțitaș 70 %% + Cuțitaș 80 %% + Lama 1 + Lama 2 + Lama 3 + Lama 4 + Lama 5 + Lama 6 + Lama 7 + Lama ⌀300 + Lama ⌀400 + Lama ⌀500 + Probe Radio 1 - Receptor 1 + Probe Radio 2 - Receptor 1 + Probe Radio 3 - Receptor 1 + Probe Radio 4 - Receptor 1 + Probe Radio 1 - Receptor 2 + Probe Radio 2 - Receptor 2 + Probe Radio 3 - Receptor 2 + Probe Radio 4 - Receptor 2 + Disc de ultrasunete, amplitudine 10%% + Disc de ultrasunete, amplitudine 20%% + Disc de ultrasunete, amplitudine 30%% + Disc de ultrasunete, amplitudine 40%% + Disc de ultrasunete, amplitudine 50%% + Disc de ultrasunete, amplitudine 60%% + Disc de ultrasunete, amplitudine 70%% + Disc de ultrasunete, amplitudine 80%% + Disc de ultrasunete, amplitudine 90%% + Disc de ultrasunete, amplitudine 100%% + Lama cu ultrasunete, amplitudine 10%% + Lama cu ultrasunete, amplitudine 20%% + Lama cu ultrasunete, amplitudine 30%% + Lama cu ultrasunete, amplitudine 40%% + Lama cu ultrasunete, amplitudine 50%% + Lama cu ultrasunete, amplitudine 60%% + Lama cu ultrasunete, amplitudine 70%% + Lama cu ultrasunete, amplitudine 80%% + Lama cu ultrasunete, amplitudine 90%% + Lama cu ultrasunete, amplitudine 100%% + Solicitare de confirmare + Ok + Anulați + Sigur doriți să ștergeți unealta? + Sigur doriți să anulați întreținerea selectată? + Sigur doriți să ștergeți nota? + Sigur doriți să ștergeți acest atașament? + Sigur doriți să ștergeți tăișul ? + Sigur doriți să ștergeți mâner? + Sigur doriți să ștergeți multifuncțiunea? + Sigur doriți să descărcați unealta din mâner? + Sigur doriți să descărcați unealta din multifuncțiune? + Sigur doriți să ștergeți toate alarmele? + Sunteți sigur că ați efectuat această întreținere? + Sigur doriți să ștergeți familia? + Manager Întrețineri + Salvați + Afișați toate fișierele + Afișați numai cele mai recente fișiere + Adăugați un fișier + Afișați toate notele + Afișați numai ultimele note + Marcați ca realizată + Căutați întreținerea după nume + Numele întreținerii ... + Stare + Creați o intervenție de întreținere + Selectați o întreținere ... + Expirată + Închis + Neexpirată + În Termen limită + Contor + Termen limită + Stare + Titlu + Adăugat %s la %s + Ștergeți + Salvați + Nu s-a efectuat nicio operațiune de întreținere + Ultima intervenție efectuată acum câteva minute, de la: %s + Ultima intervenție efectuată acum %d ore, de la: %s + Ultima intervenție efectuată %d zile în urmă, de la: %s + Ultima intervenție efectuată în data: %s de la: %s + Întreținere creată la data %s la ora %s + Fișiere atașate + Notă + Crearea intervenției de întreținere + Titlu + Anulați + Data + Descriere + Ora + Tip + Repetați la interval de + Zile + Ore + Minute + Luni + Data Fixă + Timp + Creați Întreținere + Schimbați Întreținerea + Manager de Producție + Active + NC + Prod + Softkey Preferate + Interp. + Absol. + To-Go + Prog. + Rapid: + Work: + Lungime reală: + Raza reală: + Diametrul reală: + Origine activă: + Corector activ: + Tăiș activ: + Linie iso: + Mesaj: + Selectați un program + Selectați modul Auto pentru a executa un program + Selectarea în curs + Mergeți la selecție + Program-Loader + Selectați un program + Încărcați și activați + Activ + Căutați un program după nume + Data creării: + Data unealtă modif: + Previzualizarea nu este disponibilă + Încărcați toate fișierele în dosarul selectat + NC + PLC + Manager Istoric Alarme + Filtrați alarmele după titlu + Titlu ... + Sursă + Interval date + Utilizatori + Sursă + Titlu + Data + Utilizatori + Selectați o alarmă ... + Niciun-Utilizator + Modificați utilizatorul + Nume + Pronume + Parola + Username + Adăugaţi + Modificaţi + Anulați + Parolele trebuie să fie diferite + Parola curentă + Parola nouă + Schimbați parola: %s + Schimbați rolul: %s + Sigur doriți să eliminați utilizatorul? + Adăugați un utilizator nou + Manager Utilizatori + Filtrați utilizatorii după numele de utilizator + Username… + Avatar + Username + Nume + Pronume + Limba + Funcţie + Manager de producție + Tool Manager + Manager de întreținere mașină + Istoricul alarmelor + Raportul și starea mașinii + Utilități și software externe + Pagini Scada + Deschide / Închide zona sub capotă + Job Editor + User Manager + Închideți CMS-Step + Minimizați CMS-Step + Vizualizați Ajutor mașină + Vizualizați informațiile despre mașină + Vizualizați Informațiile utilizator + Deschideți / Închideți lista întrețineri expirate + Închideți zona sub capotă + Închideți zona sub capotă + CN în Eroare. Deschideți / Închideți lista alarmelor + CN în Așteptare de Comenzi + CN în Execuția Comenzilor + Informații despre proces + Dispozitivele mașinii nu sunt în regulă + Mașina în funcțiune + Mașina Nu este pregătită să funcționeze + Mașina este pregătită să lucreze + Butoane de urgență apăsate + Cheia nu a fost introdusă + Axele nu sunt la putere + Protecțiile de siguranță nu sunt în regulă + Modul setting activ + Aerul comprimat nu este în regulă + Este necesară resetarea axei + Utilizat abraziv + Cap activ + Încărcare curentă + Presiunea curentă + Numele capului + Procentaj de suprascriere + Reduceți suprascrierea + Creșteți suprascrierea + Viteza curentă + Id-ul uneltei montate + Vacuum sub cap + Proces Cn Proprietar al capului + Selectați procesul %d + Part Program + Macro CMS + Text + Pauză + Întârziere + Început + Sfârșitul Programului + diff --git a/Step.Utils/languages/zh.xml b/Step.Utils/languages/zh.xml deleted file mode 100644 index e067c596..00000000 --- a/Step.Utils/languages/zh.xml +++ /dev/null @@ -1,336 +0,0 @@ - - - - 中文 - - - 維護請求 - 呼氣: - 有一個程序要執行 - 有許多活動的警報 - 有很多積極的警告 - 處理 - - - 用戶設置 - 註銷 - 語言 - 取消 - 保存 - 用戶登錄 - 用戶名 - 密碼 - 登錄 - 錯誤的用戶名 - 錯誤的密碼 - - - 顯示警報歷史 - 全部刷新 - 顯示 - 報警 - 警告 - 狀態 - 巫師 - 報警解決 - 開始 - 顯示手冊 - 詢問幫助 - 刷新 - 回到報警列表 - 活性 - 刪除 - - - 機器信息 - 機器識別: - 安裝日期: - 數控模型: - 數控系列號: - 數字固件版本: - Plc版本: - 數控選材語言: - 數控配置的過程: - 數控時間戳: - 數量單位測量: - CMS-Active 服務器版本: - CMS-Active 核心版本: - CMS-Active 客戶端版本: - - - - 工具 - 加載 - 兆帕 - 磨料 - 克/分鐘 - 真空 - 酒吧 - - - 軸: - 增量: - - - 通用軟鍵 - 鎖/真空區域 - 頭部和冷卻裝置 - 工作模式 - 裝備和保護 - 加載/卸載 - 用戶子程序 - 你確定? - 確認 - 取消 - - - 公用事业和外部软件 - - - 數據 - Nc過程 - 警報 - - 字節內存 - 程式 - 雜誌 - 家庭/小丑 - 工具 - - - - 參數 - 程序 - 項目經理 - 診斷 - 建立 - - - 波什 - 程式 - 抵消 - 系統 - 信息 - - - 刀具管理 - 雜誌 - 紡錘 - 工具 - 尚克斯 - 多刀 - 雜誌的位置 - 家庭 - 工具組 - - - 工具管理器 - 選擇一個工具: - 創建新工具 - 編輯 - 取消 - 保存 - - 前沿 - 新的尖端 - 參數 - 編輯工具編號%d - %s - 新的工具創建 - 編輯前沿編號。 %d - 新的尖端創作 - Shanks經理 - 選擇一個柄: - 創建新的Shank - Shank no。 %d - 多工具管理器 - 選擇一個Multitool: - 創建新的Multitool - Multitool no。 %d - 工具編號%d - 新工具 - 編輯Shanks沒有。 %d - 編輯Multitool編號。 %d - 選擇一個工具來添加 - 新的Shank創作 - 新的Multitool創作 - 編輯工具編號%d的小腿%d - 編輯工具編號%d的Multitool%d - 泛型: - 工具 - 群組: - 家庭: - 工具狀態: - 冷卻液: - 雜誌: - 主軸: - 生活: - 幾何: - 泛型: - 小腿狀態: - Multitool狀態: - 雜誌: - 工具ID - 工具類型 - 生活類型 - 名稱 - 名稱 - 孩子ID - 工具插入 - 工具活動 - 工具被禁止 - 工具在固定的地方 - 測量工具 - 刀具更換中的工具 - 正在使用的工具 - 預報警中的工具 - 冷卻1 - 冷卻2 - 雜誌位置類型 - 左尺寸 - 合適的尺碼 - 旋轉類型 - 最大速度 - 最大加速度 - 最尖端的ID - 剩餘生活 - 名義壽命 - 預警限制 - 尖端類型 - Lenght - 半徑 - Δ長度 - Δ半徑 - Theeth號 - 角半徑 - 幾何長度1 - 幾何長度2 - 幾何長度3 - 幾何Δ長度1 - 幾何Δ長度2 - 幾何Δ長度3 - 適配器長度1 - 適配器長度2 - 適配器長度3 - V - 矢量1 - 矢量2 - 矢量3 - 外半徑 - 工具角度 - 寬度 - 錐角 - 提示角度 - 瀝青 - 直徑 - 槽寬 - 幾何投影 - 幾何Δ長度1 - 幾何Δ長度1 - 幾何Δ長度1 - Δ直徑 - Δ槽寬 - 幾何磨損投影 - 角度修正 - Boom長度 - 球半徑 - 沒有 - 時間 - 計數 - 穿 - Clockwhise腐爛。 - 計數器Clockwhise腐爛。 - 銑削工具 - 球頭立銑刀 - 錐形球端 - 立銑刀 - 立銑刀圓角 - 角頭銑刀 - Corn.round.ang.hd.cut - 面對工具 - 螺紋刀具 - 側銑刀 - - 斜切刀 - 斜切刀角落 - 點擊。模切刀 - 鑽和螺紋切割。 - 麻花鑽 - 實心鑽 - 無聊的酒吧 - 中心演練 - 埋頭 - - 龍頭 - 細水龍頭 - 龍頭 - 惠氏 - 絞刀 - 開槽鋸 - 3D探測器 - 尋邊器 - 單聲道探頭 - L探頭 - 星探針 - 校準工具 - 停止 - - - - - 產品經理 - 工具管理器 - 維護經理 - 歷史報警 - 報告和機器狀態 - 實用程序和外部軟件 - 斯卡達頁 - 打開/關閉引擎蓋區域 - - - 關閉CMS-Step - 最小化CMS-Step - 顯示機器幫助 - 顯示機器信息 - 顯示用戶信息 - 打開/關閉過期維護清單 - 關閉引擎蓋區域 - 關閉引擎蓋區域 - - - NC處於錯誤狀態。 打開/關閉活動警報列表 - NC在空閒狀態 - NC處於運行狀態 - - - Nc進程信息 - - - 機器設備不好 - 機器運作 - 機器沒有準備好工作 - 機器可以工作 - 按下緊急按鈕 - 未插入安全密鑰 - 軸不處於功率狀態 - 安全保護措施不好 - 設置模式激活 - 氣流壓力不好 - 軸需要調零 - - - 使用磨料 - 頭跑步 - 實際負載 - 實際壓力 - 頭名 - 覆蓋百分比 - 減少覆蓋 - 增加覆蓋 - 實際速度 - 已安裝的工具ID - 頭部真空 - 所有者Nc進程 - - - 選擇進程 - - \ No newline at end of file diff --git a/Step.Utils/supportFunctions.cs b/Step.Utils/supportFunctions.cs index ed30b2d6..725e58d6 100644 --- a/Step.Utils/supportFunctions.cs +++ b/Step.Utils/supportFunctions.cs @@ -67,6 +67,7 @@ namespace Step.Utils case "xHundred": return 27; case "xThousand": return 28; case "overstroke": return 30; + case "feedByPass": return 31; default: return -1; } } diff --git a/Step/App_Start/Startup.cs b/Step/App_Start/Startup.cs index 159ce205..982ae887 100644 --- a/Step/App_Start/Startup.cs +++ b/Step/App_Start/Startup.cs @@ -49,9 +49,7 @@ namespace Step.App_Start SignalRConfig(app); var directoryBrowsing = ConfigurationManager.AppSettings["enableDirectoryBrowsing"] == "true"; - // Create directories if they don't exist - CreateDirectories(); - + // Check if web site directory exists if (!Directory.Exists(WEBSITE_DIRECTORY)) ExceptionManager.Manage(ERROR_LEVEL.FATAL, "Main window directory not found!"); @@ -80,7 +78,7 @@ namespace Step.App_Start TokenEndpointPath = new PathString("/Token"), Provider = new ApplicationOAuthProvider(), // Bearer token expiration time - AccessTokenExpireTimeSpan = TimeSpan.FromDays(14), + AccessTokenExpireTimeSpan = TimeSpan.FromDays(365), //TODO: In modalit di produzione impostare AllowInsecureHttp = false AllowInsecureHttp = true }; @@ -108,7 +106,8 @@ namespace Step.App_Start map.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions() { - Provider = new SignalROAuthBearerProvider() + Provider = new SignalROAuthBearerProvider(), + AuthenticationType = AUTHENTICATION_TYPE }); var hubConfiguration = new HubConfiguration { @@ -138,29 +137,6 @@ namespace Step.App_Start return isAvailable; } - - private void CreateDirectories() - { - if (!Directory.Exists(MAINTENANCE_ATTACHMENT_PATH)) - Directory.CreateDirectory(MAINTENANCE_ATTACHMENT_PATH); - if (!Directory.Exists(ALARM_ATTACHMENT_PATH)) - Directory.CreateDirectory(ALARM_ATTACHMENT_PATH); - - if (!Directory.Exists(TEMP_PP_FOLDER)) - Directory.CreateDirectory(TEMP_PP_FOLDER); - - if (!Directory.Exists(PART_PRG_IMAGES)) - Directory.CreateDirectory(PART_PRG_IMAGES); - - if (!Directory.Exists(JOB_TMP_DIRECTORY)) - Directory.CreateDirectory(JOB_TMP_DIRECTORY); - - if (!Directory.Exists(QUEUE_TMP_FOLDER)) - Directory.CreateDirectory(QUEUE_TMP_FOLDER); - - if (!Directory.Exists(SCADA_DIRECTORY)) - Directory.CreateDirectory(SCADA_DIRECTORY); - } } } //app.Map("/signalr", map => diff --git a/Step/Attributes/SignalRAuthorizeAttribute.cs b/Step/Attributes/SignalRAuthorizeAttribute.cs index 6a79898c..8b78bde2 100644 --- a/Step/Attributes/SignalRAuthorizeAttribute.cs +++ b/Step/Attributes/SignalRAuthorizeAttribute.cs @@ -1,14 +1,18 @@ using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR.Hubs; +using Microsoft.AspNet.SignalR.Owin; +using Step.App_Start; using Step.Config; using Step.Database.Controllers; using Step.Model.DatabaseModels; using System; +using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Security.Principal; using static Step.Config.ServerConfig; using static Step.Model.Constants; +using static Step.Listeners.SignalRStaticObjects; namespace Step.Attributes { @@ -32,75 +36,87 @@ namespace Step.Attributes return base.AuthorizeHubConnection(hubDescriptor, request); } - protected override bool UserAuthorized(IPrincipal user) - { - if (!base.UserAuthorized(user)) - return false; - - // Get Claims from context - ClaimsIdentity identity = user.Identity as ClaimsIdentity; - // Get user id stored in the bearer token - var userId = identity.Claims.FirstOrDefault(c => c.Type == USER_ID_KEY); - - // Get machine unique id stored in the bearer token - var machineId = identity.Claims.FirstOrDefault(c => c.Type == MACHINE_ID_KEY); - - //User data not found -> not authorized - if (userId == null || machineId == null) - return false; - - // User data not found -> not authorized - if (userId == null || machineId == null) - return false; - - // check authorization - if (!CheckAuthorization(Convert.ToInt32(machineId.Value), Convert.ToInt32(userId.Value), FunctionAccess)) - return false; - - return true; - } - public override bool AuthorizeHubMethodInvocation(IHubIncomingInvokerContext hubIncomingInvokerContext, bool appliesToMethod) { - return base.AuthorizeHubMethodInvocation(hubIncomingInvokerContext, appliesToMethod); - } - - private bool CheckAuthorization(int machineId, int userId, string functionName) - { - // Check if the machine is the same where the user logged in - if (machineId != MachineConfig.MachineId) - return false; - - MachineUserModel machineUser = new MachineUserModel(); - using (MachinesUsersController machineUsersController = new MachinesUsersController()) + var connectionId = hubIncomingInvokerContext.Hub.Context.ConnectionId; + var request = hubIncomingInvokerContext.Hub.Context.Request; + var token = request.QueryString.Get("Authorization"); + if (!string.IsNullOrEmpty(token)) { - // Find machineUser data and joined to user data, role data, machine data - machineUser = machineUsersController.FindByUserId(machineId, userId); - } - - using (FunctionsAccessController acController = new FunctionsAccessController()) - { - // Read from db function levels - FunctionAccessModel functionAccess = acController.FindEnabledFunctionByName(functionName); - if (functionAccess != null && ServerConfigController.CheckAreaStatus(functionAccess.Area)) - { - if (Action == ACTIONS.READ) - { // Check read permissions - if (functionAccess.ReadLevelMin > machineUser.Role.Level) - return false; // Not authorized - } - else - { // Check write permissions - if (functionAccess.WriteLevelMin > machineUser.Role.Level) - return false; // Not authorized - } - } - else + // check authorization + if (!CheckAuthorization(FunctionAccess, token, out int machineId, out int userId)) return false; - // Authorized + var claims = new ClaimsIdentity(AUTHENTICATION_TYPE); + claims.AddClaim(new Claim(USER_ID_KEY, userId.ToString())); + claims.AddClaim(new Claim(MACHINE_ID_KEY, machineId.ToString())); + + Dictionary _DCI = new Dictionary(); + _DCI.Add("server.User", claims as IPrincipal); + hubIncomingInvokerContext.Hub.Context = new HubCallerContext(new ServerRequest(_DCI), connectionId); return true; } + return false; + } + + + private bool CheckAuthorization(string functionName, string token, out int machineId, out int userId) + { + machineId = userId = 0; + using (SessionsController sessionsController = new SessionsController()) + { + // Find user session on this machine + SessionModel session = sessionsController.FindSessionByToken(token); + if (session == null) + return false; + + // Check if the machine is the same where the user logged in + if (session.MachineUser.MachineId != MachineConfig.MachineId) + return false; + + machineId = session.MachineUser.MachineId; + userId = session.MachineUser.UserId; + + MachineUserModel machineUser = new MachineUserModel(); + using (MachinesUsersController machineUsersController = new MachinesUsersController()) + { + // Find machineUser data and joined to user data, role data, machine data + machineUser = machineUsersController.FindByIdWithData(session.MachineUserId); + } + + using (FunctionsAccessController acController = new FunctionsAccessController()) + { + // Read from db function levels + FunctionAccessModel functionAccess = acController.FindEnabledFunctionByName(functionName); + if (functionAccess != null && ServerConfigController.CheckAreaStatus(functionAccess.Area)) + { + if (Action == ACTIONS.READ) + { // Check read permissions + if (functionAccess.ReadLevelMin > machineUser.Role.Level) + return false; // Not authorized + } + else + { // Check write permissions + if (functionAccess.WriteLevelMin > machineUser.Role.Level) + return false; // Not authorized + } + + // Check if PLC bit exists + if (functionAccess.PlcId != 0) + { + // Check if functionality is enabled by PLC + var functionalityIsEnabled = LastRuntimeFunctionality.Where(x => x.Name == functionName).FirstOrDefault(); + if (functionalityIsEnabled == null || functionalityIsEnabled.Enabled == false) + return false; + } + } + else + return false; + + // Authorized + return true; + } + } } } } \ No newline at end of file diff --git a/Step/Attributes/WebApiAuthorizeAttribute.cs b/Step/Attributes/WebApiAuthorizeAttribute.cs index 83e511cd..6410d5f9 100644 --- a/Step/Attributes/WebApiAuthorizeAttribute.cs +++ b/Step/Attributes/WebApiAuthorizeAttribute.cs @@ -19,7 +19,7 @@ namespace Step { public string FunctionAccess; public ACTIONS Action; - protected override bool IsAuthorized(HttpActionContext actionContext) + protected override bool IsAuthorized(HttpActionContext actionContext) { // Get token from headers if (actionContext.Request.Headers.Authorization == null) diff --git a/Step/Controllers/SignalR/NcHub.cs b/Step/Controllers/SignalR/NcHub.cs index b8d2532d..41ffaeeb 100644 --- a/Step/Controllers/SignalR/NcHub.cs +++ b/Step/Controllers/SignalR/NcHub.cs @@ -235,11 +235,6 @@ namespace Step.Controllers.SignalR throw new HubException(cmsError.localizationKey); } } - - public void QuitServerApp() - { - if (ServerStartupConfig.AutoOpenCmsClient) - MessageServices.Current.Publish(SEND_STOP_SERVER); - } + } } \ No newline at end of file diff --git a/Step/Controllers/WebApi/ApiAlarmController.cs b/Step/Controllers/WebApi/ApiAlarmController.cs index be03bfd4..151360d2 100644 --- a/Step/Controllers/WebApi/ApiAlarmController.cs +++ b/Step/Controllers/WebApi/ApiAlarmController.cs @@ -5,8 +5,9 @@ using Step.NC; using Step.Provider; using System; using System.Collections.Generic; -using System.IO; -using System.Linq; +using System.Diagnostics; +using System.IO; +using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; @@ -15,6 +16,7 @@ using System.Text; using System.Threading.Tasks; using System.Web.Http; using static Step.Model.Constants; +using static Step.Config.ServerConfig; namespace Step.Controllers.WebApi { @@ -22,11 +24,24 @@ namespace Step.Controllers.WebApi public class ApiAlarmController : ApiController { [Route("paginated"), HttpPost] + [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.ALARM_CMD, Action = ACTIONS.READ)] public IHttpActionResult GetDataPaginated([FromBody]DTOAlarmsFilterModel filter) { if (!ModelState.IsValid) return BadRequest(ModelState); + var identity = User.Identity as ClaimsIdentity; + // Find user id from the bearer token + var userId = identity.Claims.FirstOrDefault(c => c.Type == USER_ID_KEY); + + bool canDelete = false; + using (MachinesUsersController machineUserController = new MachinesUsersController()) + { + RoleModel role = machineUserController.GetUserRole(MachineConfig.MachineId, Convert.ToInt32(userId.Value)); + canDelete = machineUserController.RoleIsAdminOrHigher(role.RoleId); + } + + // Retrieve plc messages Dictionary plcMessages = LanguageController.GetPlcAlarmsTranslations(filter.Language) .ToDictionary( x => Convert.ToInt32(x.Key.Split('_').Last()), // This function return "alarm_id" as id, i need only the id number @@ -40,7 +55,8 @@ namespace Step.Controllers.WebApi return Ok(new DTOPaginatedAlarmsModel() { Alarms = alarms, - Pages = pages + Pages = pages, + CanDelete = canDelete }); } } @@ -63,20 +79,33 @@ namespace Step.Controllers.WebApi List alarms = alarm.GetPaginatedWithFilter(filter.Title, filter.Sources, 0, int.MaxValue, filter.StartDate.Value, filter.EndDate, filter.UserIds, plcMessages, out int pages); Dictionary AlmPLCTras = LanguageController.GetPlcAlarmsTranslations(filter.Language); - - string csv = ""; + StringBuilder csv = new StringBuilder(); + //string csv = ""; foreach (DTOAlarmHistoricModel model in alarms) { var alm = ""; - if(model.Source == ALARM_SOURCE.PLC) + if (model.Source == ALARM_SOURCE.PLC) alm = AlmPLCTras["alarm_" + model.AlarmId]; - csv += model.ToCsvString(alm) + Environment.NewLine; + //csv += model.ToCsvString(alm) + Environment.NewLine; + + csv.Append(model.ToCsvString(alm) + Environment.NewLine); } - + + //Parallel.ForEach(alarms, model => + //{ + // var alm = ""; + // if (model.Source == ALARM_SOURCE.PLC) + // alm = AlmPLCTras["alarm_" + model.AlarmId]; + + // csv.Append(model.ToCsvString(alm) + Environment.NewLine); + //}); + + //Console.WriteLine("CSV string 2 " + st.ElapsedMilliseconds); + //st.Restart(); - var stream = new MemoryStream(Encoding.UTF8.GetBytes(csv),0, Encoding.UTF8.GetBytes(csv).Length, false,true); - + var stream = new MemoryStream(Encoding.UTF8.GetBytes(csv.ToString()),0, Encoding.UTF8.GetBytes(csv.ToString()).Length, false,true); + var result = new HttpResponseMessage(HttpStatusCode.OK) { Content = new ByteArrayContent(stream.GetBuffer()) @@ -86,13 +115,26 @@ namespace Step.Controllers.WebApi FileName = "AlarmExport.csv" }; result.Content.Headers.ContentType = new MediaTypeHeaderValue("text/csv"); - + return ResponseMessage(result); } } + + [Route("delete"), HttpDelete] + public IHttpActionResult DeleteAlarms() + { + using (AlarmsController alarmController = new AlarmsController()) + { + alarmController.EmptyAlarms(); + + return Ok(); + } + } + + [Route("data"), HttpPost] - public IHttpActionResult GetAlarmsData(int pageSize) + public IHttpActionResult GetAlarmsData(int pageSize) { using (AlarmsController alarmController = new AlarmsController()) { @@ -106,6 +148,7 @@ namespace Step.Controllers.WebApi { public List Alarms; public int Pages; + public bool CanDelete; } #region Note diff --git a/Step/Controllers/WebApi/ApiMaintenanceController.cs b/Step/Controllers/WebApi/ApiMaintenanceController.cs index edce3c27..df451e0b 100644 --- a/Step/Controllers/WebApi/ApiMaintenanceController.cs +++ b/Step/Controllers/WebApi/ApiMaintenanceController.cs @@ -13,11 +13,8 @@ using System.IO; using System.Linq; using System.Net; using System.Net.Http; -using System.Net.Http.Headers; using System.Security.Claims; -using System.Threading; using System.Threading.Tasks; -using System.Web; using System.Web.Http; using static Step.Config.ServerConfig; using static Step.Model.Constants; @@ -65,7 +62,7 @@ namespace Step.Controllers.WebApi using (NcHandler ncHandler = new NcHandler()) { ncHandler.Connect(); - CmsError cmsError = ncHandler.GetMaintenanceDataById(dbMaint.MaintenanceId, Convert.ToInt32(userId.Value), out DTOMaintenanceModel maintenance); + CmsError cmsError = ncHandler.GetMaintenanceDataById(dbMaint.MaintenanceId, Convert.ToInt32(userId.Value), out DTOMaintenanceModel maintenance); if (cmsError.IsError()) return BadRequest(cmsError.localizationKey); diff --git a/Step/Controllers/WebApi/ConfigurationController.cs b/Step/Controllers/WebApi/ConfigurationController.cs index 41964d30..84644f68 100644 --- a/Step/Controllers/WebApi/ConfigurationController.cs +++ b/Step/Controllers/WebApi/ConfigurationController.cs @@ -45,7 +45,8 @@ namespace Step.Controllers.WebApi ProdEnabled = SoftwareProdConfig.Enabled, ProdPath = SoftwareProdConfig.Path, ExtSoftwares = ExtSoftwaresConfig, - Autorun = ServerStartupConfig.AutoOpenCmsClient + Autorun = ServerStartupConfig.AutoOpenCmsClient, + MgiOption = NcConfig.MgiOption }; return Ok(clientConfiguration); @@ -106,10 +107,10 @@ namespace Step.Controllers.WebApi { var configuredAlarm = InitialAlarmsConfig.Where(x => x.PlcId == i).FirstOrDefault(); - if (configuredAlarm == null) + if (configuredAlarm == null) restoreIsEnabled = false; else - restoreIsEnabled = configuredAlarm.RestoreIsActive; + restoreIsEnabled = configuredAlarm.RestoreIsActive; alarmsConfig.Add(new DTOAlarmConfigModel { @@ -134,5 +135,11 @@ namespace Step.Controllers.WebApi return Ok(toolTableConfiguration); } } + + [Route("contact"), HttpGet] + public IHttpActionResult GetContact() + { + return Ok(ContactConfig); + } } } \ No newline at end of file diff --git a/Step/Controllers/WebApi/NcFileController.cs b/Step/Controllers/WebApi/NcFileController.cs index e38eda90..8cbb76be 100644 --- a/Step/Controllers/WebApi/NcFileController.cs +++ b/Step/Controllers/WebApi/NcFileController.cs @@ -119,18 +119,19 @@ namespace Step.Controllers.WebApi return BadRequest(cmsError.localizationKey); } - foreach (FormItem item in formItems) + ActiveProgramDataModel programData = new ActiveProgramDataModel(); + foreach (FormItem item in formItems) { if (item.IsAFile) { - if (item.ParameterName == "main") + if (item.ParameterName == "main") { File.WriteAllBytes(TEMP_PP_FOLDER + item.FileName, item.Data); mainPPName = item.FileName; programs.Add(item.FileName); // Upload main program - CmsError cmsError = ncFileHandler.UploadPartProgramAndActivate(TEMP_PP_FOLDER, item.FileName, out ActiveProgramDataModel programData); + CmsError cmsError = ncFileHandler.UploadPartProgramAndActivate(TEMP_PP_FOLDER, item.FileName, out programData); if (cmsError.IsError()) return BadRequest(cmsError.localizationKey); } @@ -147,7 +148,7 @@ namespace Step.Controllers.WebApi else if (item.ParameterName == "image") { // Upload image - File.WriteAllBytes(PART_PRG_IMAGES + item.FileName, item.Data); + File.WriteAllBytes(PART_PRG_IMAGES + Path.GetFileNameWithoutExtension(programData.Path) + Path.GetExtension(item.FileName), item.Data); imageUploaded = true; } } diff --git a/Step/Controllers/WebApi/NcToolManagerController.cs b/Step/Controllers/WebApi/NcToolManagerController.cs index b5161df4..5fcf3dc3 100644 --- a/Step/Controllers/WebApi/NcToolManagerController.cs +++ b/Step/Controllers/WebApi/NcToolManagerController.cs @@ -252,7 +252,8 @@ namespace Step.Controllers.WebApi return BadRequest(cmsError.localizationKey); offsetData.Id = offsetId; - return Ok(offsetData); + + return Ok(offsetData); } } @@ -842,7 +843,6 @@ namespace Step.Controllers.WebApi return Ok(importStatus); } - } [Route("selfadaptivepathstep"), HttpGet] diff --git a/Step/Controllers/WebApi/ScadaController.cs b/Step/Controllers/WebApi/ScadaController.cs index 6c2c28e3..eb483669 100644 --- a/Step/Controllers/WebApi/ScadaController.cs +++ b/Step/Controllers/WebApi/ScadaController.cs @@ -8,14 +8,14 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web.Http; -using static CMS_CORE_Library.Models.DataStructures; +using static CMS_CORE_Library.Models.DataStructures; using static Step.Config.ServerConfig; using static Step.Model.Constants; namespace Step.Controllers.WebApi { [RoutePrefix("api/scada")] - public class ScadaController : ApiController + public class ScadaController : ApiController { [Route("list"), HttpGet] public IHttpActionResult GetScadaList() @@ -29,24 +29,25 @@ namespace Step.Controllers.WebApi [Route("subscribe/{scadaId:int}"), HttpGet] public IHttpActionResult SubscribeScada(int scadaId) { - // Select schema - ScadaSchemaModel selectedScadaSchema = ConfiguredScadaSchema + // Find schema + ScadaSchemaModel selectedScadaSchema = ConfiguredScadaSchema .Where(x => x.Id == scadaId) .FirstOrDefault(); if (selectedScadaSchema == null) return BadRequest(); - // Add to the subscriber list - SubscribedScada.Add(selectedScadaSchema); - using (NcHandler ncHandler = new NcHandler()) + using (NcHandler ncHandler = new NcHandler()) { ncHandler.Connect(); // Read the selected scada data CmsError cmsError = ncHandler.ReadScadaData(selectedScadaSchema, out DTOScadaModel values); if (cmsError.IsError()) return BadRequest(cmsError.localizationKey); - + + // Add to the subscriber list + SubscribedScada.Add(selectedScadaSchema); + return Ok(values); } } @@ -54,7 +55,7 @@ namespace Step.Controllers.WebApi [Route("unsubscribe/{scadaId:int}"), HttpGet] public IHttpActionResult UnsubscribeScada(int scadaId) { - using (NcHandler ncHandler = new NcHandler()) + using (NcHandler ncHandler = new NcHandler()) { // Find scada by id ScadaSchemaModel scadaToRemove = SubscribedScada diff --git a/Step/Controllers/WebApi/UserController.cs b/Step/Controllers/WebApi/UserController.cs index 1859d883..d671f9d5 100644 --- a/Step/Controllers/WebApi/UserController.cs +++ b/Step/Controllers/WebApi/UserController.cs @@ -12,6 +12,7 @@ using System.Web.Http; using System.Web.Helpers; using static Step.Model.Constants; using static Step.Utils.LanguageController; +using Step.Utils; namespace Step.Controllers.WebApi { @@ -40,6 +41,9 @@ namespace Step.Controllers.WebApi // Send to the clients the id of the disconnected user var context = GlobalHost.ConnectionManager.GetHubContext(); context.Clients.All.logout(new { id = userId.Value }); + + StepLogger.LogMessage("Logout: " + userId.Value + "Date:" + DateTime.Now, ERROR_LEVEL.INFO); + return Ok(); } @@ -176,10 +180,7 @@ namespace Step.Controllers.WebApi if (user == null) return NotFound(); - - if (user.Username == "cms") - return BadRequest(); - + usersController.DeleteUser(user); return Ok(); diff --git a/Step/Properties/AssemblyInfo.cs b/Step/Properties/AssemblyInfo.cs index 5705dc51..0c7b60a0 100644 --- a/Step/Properties/AssemblyInfo.cs +++ b/Step/Properties/AssemblyInfo.cs @@ -31,4 +31,4 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.2.*")] diff --git a/Step/Provider/SignalROAuthBearerProvider.cs b/Step/Provider/SignalROAuthBearerProvider.cs index e0a28557..3806cbea 100644 --- a/Step/Provider/SignalROAuthBearerProvider.cs +++ b/Step/Provider/SignalROAuthBearerProvider.cs @@ -5,7 +5,7 @@ namespace Step.Provider { public class SignalROAuthBearerProvider : OAuthBearerAuthenticationProvider { - public override Task RequestToken(OAuthRequestTokenContext context) + public override Task RequestToken(OAuthRequestTokenContext context) { var token = context.Request.Query.Get("Authorization"); diff --git a/Step/SetupActive.iss b/Step/SetupActive.iss index 7631ae03..4f1a7714 100644 --- a/Step/SetupActive.iss +++ b/Step/SetupActive.iss @@ -7,9 +7,10 @@ #define AppName "CMS Active" #define SCMAppName "Maestro Active cnc" -#define FolderName "Active" +#define FolderName "Active" +#define SCMIcoName "SCM.ico" -#define MyAppVersion "1.0" +#define MyAppVersion "1.2" #define MyAppPublisher "CMS" #define MyAppURL "https://www.scmgroup.com/it/cms" #define MyAppExeName "Active.exe" @@ -17,9 +18,9 @@ #define ProjectPath "C:\Workspace\CMS_STEP\Step\" #define MySourcePath "C:\Workspace\CMS_STEP\Step\bin" #define WwwRootPath "C:\Workspace\CMS_STEP\Step\wwwroot" -#define IconsPath "C:\Workspace\CMS_STEP\Step\Desktop_Link\" -#define SCMIcoName "SCM.ico" -#define MyOtherAppPath "C:\CMS" +#define IconsPath "C:\Workspace\CMS_STEP\Step\Desktop_Link\" +#define InvDialPath "C:\Workspace\CMS_INVERTER_DIAGNOSIS\CMSInverterDiagnosis\bin\Release\" + #define SinumerikPath1 "{pf}\Siemens\Sinumerik\HMIsl\siemens\sinumerik\hmi\autostart\" #define SinumerikPath2 "C:\Siemens\Sinumerik\HMIsl\siemens\sinumerik\hmi\autostart\" #define SinumerikPath3 "{pf}\Siemens\MotionControl\siemens\sinumerik\hmi\autostart\" @@ -52,8 +53,6 @@ VersionInfoCompany={#MyAppPublisher} VersionInfoTextVersion={#MyAppVersion} VersionInfoCopyright={#MyAppPublisher} DefaultDirName = C:\CMS\{#FolderName}\{#FolderName} -;WizardImageFile=C:\Programmi\Inno Setup 5\WizModernImage-IS.bmp -;WizardSmallImageFile=C:\Programmi\Inno Setup 5\CMS.bmp WindowVisible=false PrivilegesRequired=admin @@ -63,7 +62,6 @@ Name: custom; Description: CMS installation; Flags: iscustom ; Set NC types, this types are used to configure server config file [Components] -Name: Demo; Description: {#AppName} {cm:ForDemoNC}; Types: custom; Flags: exclusive Name: Fanuc; Description: {#AppName} {cm:ForFanucNC}; Types: custom; Flags: exclusive Name: Osai; Description: {#AppName} {cm:ForOsaiNC}; Types: custom; Flags: exclusive Name: Siemens; Description: {#AppName} {cm:ForSiemensNC}; Types: custom; Flags: exclusive @@ -99,66 +97,69 @@ italian.InstallingDotNet = Installando .Net english.InstallingDotNet = Installing .Net [Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone; Components: Demo Fanuc Osai Siemens -Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Demo Fanuc Osai Siemens -Name: startupicon; Description: {cm:CreateStartupIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Demo Fanuc Osai +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone; Components: Fanuc Osai Siemens +Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Fanuc Osai Siemens +Name: startupicon; Description: {cm:CreateStartupIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Fanuc Osai Name: sinumerikicons; Description: {cm:CreateSinumerikIcons}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Siemens [Files] Source: "{#MySourcePath}\Active.exe"; DestDir: "{app}"; Flags: ignoreversion ; Path to exe resources (dll, xml, config) -Source: "{#MySourcePath}\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens -Source: "{#MySourcePath}\*.xml"; DestDir: "{app}"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens -Source: "{#MySourcePath}\*.config"; DestDir: "{app}"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens +Source: "{#MySourcePath}\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Fanuc Osai Siemens +Source: "{#MySourcePath}\*.xml"; DestDir: "{app}"; Flags: ignoreversion; Components: Fanuc Osai Siemens +Source: "{#MySourcePath}\*.config"; DestDir: "{app}"; Flags: ignoreversion; Components: Fanuc Osai Siemens ; Configuration files -Source: "{#MySourcePath}\Config\*.xml"; DestDir: "{app}\Config\"; Flags: confirmoverwrite ignoreversion; Components: Demo Fanuc Osai Siemens +Source: "{#MySourcePath}\Config\*.xml"; DestDir: "{app}\Config\"; Flags: ignoreversion; Components: Fanuc Osai Siemens; Check: GetOverwriteConfig; ; Osai Library Source: "{#MySourcePath}\CndexLinkDotNet.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Osai ; Languages Source: "{#MySourcePath}\Language\*.*"; DestDir: "{app}\Language\"; Flags: ignoreversion; Components: Osai -Source: "{#MySourcePath}\languages\*.*"; DestDir: "{app}\languages\"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens +Source: "{#MySourcePath}\languages\*.*"; DestDir: "{app}\languages\"; Flags: ignoreversion; Components: Fanuc Osai Siemens ; Client copy -Source: "{#MySourcePath}\Client\x64\*.*"; DestDir: "{app}\Client\"; Flags: recursesubdirs ignoreversion; Components: Demo Fanuc Osai Siemens +Source: "{#MySourcePath}\Client\x64\*.*"; DestDir: "{app}\Client\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens; AfterInstall: DeleteLocalStorage ; WWWRoot Files -Source: "{#WwwRootPath}\favicon.ico"; DestDir: "{app}\view\"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens -Source: "{#WwwRootPath}\index.html"; DestDir: "{app}\view\"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens +Source: "{#WwwRootPath}\favicon.ico"; DestDir: "{app}\view\"; Flags: ignoreversion; Components: Fanuc Osai Siemens +Source: "{#WwwRootPath}\index.html"; DestDir: "{app}\view\"; Flags: ignoreversion; Components: Fanuc Osai Siemens ; WWWRoot Directories -Source: "{#WwwRootPath}\dist\*"; DestDir: "{app}\view\dist\"; Flags: recursesubdirs ignoreversion; Components: Demo Fanuc Osai Siemens -Source: "{#WwwRootPath}\libs\*"; DestDir: "{app}\view\libs\"; Flags: recursesubdirs ignoreversion; Components: Demo Fanuc Osai Siemens -Source: "{#WwwRootPath}\assets\*"; DestDir: "{app}\view\assets\"; Flags: recursesubdirs ignoreversion; Components: Demo Fanuc Osai Siemens -Source: "{#WwwRootPath}\scripts\*"; DestDir: "{app}\view\scripts\"; Flags: recursesubdirs ignoreversion; Components: Demo Fanuc Osai Siemens +Source: "{#WwwRootPath}\dist\*"; DestDir: "{app}\view\dist\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens +Source: "{#WwwRootPath}\libs\*"; DestDir: "{app}\view\libs\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens +Source: "{#WwwRootPath}\assets\*"; DestDir: "{app}\view\assets\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens +Source: "{#WwwRootPath}\scripts\*"; DestDir: "{app}\view\scripts\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens ; SCM Icon -Source: {#IconsPath}{#SCMIcoName}; DestDir: "{app}"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens; Check: GetStyleOption; +Source: {#IconsPath}{#SCMIcoName}; DestDir: "{app}"; Flags: ignoreversion; Components: Fanuc Osai Siemens; Check: GetStyleOption; ;.Net Installer Source: {#DotNetInstallerPath}\{#DotNetInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall; ;Check: FrameworkIsNotInstalled Source: {#MariaDBInstallerPath}\{#MariaDBInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall; -; Fanuc scripts -Source: "{#ProjectPath}Utility\*"; DestDir: "..\{app}\Utility\"; Flags: recursesubdirs ignoreversion; Components: Fanuc - +; --- UTILS +; Fanuc scripts - TEAMVIEWER +Source: "{#ProjectPath}\Utility\*"; DestDir: "{app}\..\Utility\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens + +; Inverter Dialog +Source: "{#InvDialPath}\*"; DestDir: "{app}\..\Utility\Cms_Inverter_Diagnosis\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens + [Icons] ; Default icons -Name: {group}\{#AppName}; Filename: {app}\{#MyAppExeName}; Comment: {#AppName}; Components: Demo Fanuc Osai; Check: NOT GetStyleOption; -Name: {userdesktop}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon; Comment: {#AppName}; Components: Demo Fanuc Osai; Check: NOT GetStyleOption; -Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon; Comment: {#AppName}; Components: Demo Fanuc Osai; Check: NOT GetStyleOption; -Name: {userstartup}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupicon; Comment: {#AppName}; Components: Demo Fanuc Osai; Check: NOT GetStyleOption; +Name: {group}\{#AppName}; Filename: {app}\{#MyAppExeName}; Comment: {#AppName}; Components: Fanuc Osai; Check: NOT GetStyleOption; +Name: {userdesktop}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon; Comment: {#AppName}; Components: Fanuc Osai; Check: NOT GetStyleOption; +Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon; Comment: {#AppName}; Components: Fanuc Osai; Check: NOT GetStyleOption; +Name: {userstartup}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupicon; Comment: {#AppName}; Components: Fanuc Osai; Check: NOT GetStyleOption; ; Siemens startup icon with parameters "-start ..." Name: {group}\{#AppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Comment: {#AppName}; Components: Siemens; Check: NOT GetStyleOption; Name: {userdesktop}\{#AppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; Comment: {#AppName}; Components: Siemens; Check: NOT GetStyleOption; Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon; Comment: {#AppName}; Components: Siemens; Check: NOT GetStyleOption; - ; SCM ICONS ; Default icons -Name: {group}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Comment: {#SCMAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; -Name: {userdesktop}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: desktopicon; Comment: {#SCMAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; -Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: quicklaunchicon; Comment: {#SCMAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; -Name: {userstartup}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: startupicon; Comment: {#SCMAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; +Name: {group}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Comment: {#SCMAppName}; Components: Fanuc Osai; Check: GetStyleOption; +Name: {userdesktop}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: desktopicon; Comment: {#SCMAppName}; Components: Fanuc Osai; Check: GetStyleOption; +Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: quicklaunchicon; Comment: {#SCMAppName}; Components: Fanuc Osai; Check: GetStyleOption; +Name: {userstartup}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: startupicon; Comment: {#SCMAppName}; Components: Fanuc Osai; Check: GetStyleOption; ; SCM Siemens startup icon with parameters "-start ..." Name: {group}\{#SCMAppName}; Filename: {#IconsPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Comment: {#SCMAppName}; Components: Siemens; Check: GetStyleOption; @@ -167,10 +168,10 @@ Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#SCMAppName}; File [Run] ; Install .net -Filename: {tmp}\{#DotNetInstallerName}; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingDotNet}; +Filename: {tmp}\{#DotNetInstallerName}; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingDotNet}; Check: NetFrameworkNeedInstall ;Check: NetFrameworkIsMissing ; Install MariaDb -Filename: "msiexec.exe"; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingMariaDB}; Parameters: "/i {tmp}\{#MariaDBInstallerName}" +Filename: "msiexec.exe"; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingMariaDB}; Parameters: "/i {tmp}\{#MariaDBInstallerName}"; Check: CheckHeidiSQLNeedInstall; [Code] ///////////// SiemensPath /////////////////////////////// @@ -178,6 +179,7 @@ var CheckBoxIni: TCheckBox; CustomInputOptionCMSorSCM: TInputOptionWizardPage; IsSCM: Boolean; + OverwriteConfig: Boolean; function GetStyleOption: Boolean; begin @@ -207,14 +209,9 @@ var Result := sSiemensPath ; end; -///////////////// FrameworkIsNotInstalled //////////////////////////////////// - function FrameworkIsNotInstalled: Boolean; - begin; - Result := not RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\.NETFramework\policy\v4.0'); - end; +///////////////// Check .NET Framework 4.6.2 //////////////////////////////////// - - function NetFrameworkIsMissing(): Boolean; + function NetFrameworkNeedInstall(): Boolean; var bSuccess: Boolean; regVersion: Cardinal; @@ -227,6 +224,17 @@ var end; end; + ///////////// Check heidiSQL ///////////////// + function CheckHeidiSQLNeedInstall: Boolean; + begin + if FileExists(ExpandConstant('C:\Program Files (x86)\Common Files\MariaDBShared\HeidiSQL\heidisql.exe')) + then Result:= false + else + begin + Result:= True + end; + end; + ///////////////// CreateCustomInputOptionCMsorSCM ////////////////////////// procedure CreateCustomInputOptionCMSorSCM; begin @@ -238,10 +246,39 @@ var CustomInputOptionCMSorSCM.Values[0] := True; end; + /////////////////// CheckConfigExistence ///////////////////////////// + function OverwriteConfigModal: Boolean; + begin + if DirExists(ExpandConstant('C:\CMS\Active\Active\Config')) then begin + // Ask the user a Yes/No question, defaulting to No + if not (MsgBox('La cartella "Config" esiste gi. Vuoi sovrascriverla?', mbConfirmation, MB_YESNO) = IDYES) then + begin + // user clicked NO + Result:= false; + Exit; + end; + end; + + Result:= True; + end; + + function GetOverwriteConfig: Boolean; + begin + Result:= OverwriteConfig; + end; + + /////////////////// DeleteLocalStorage ////////////////////// + procedure DeleteLocalStorage; + begin + DelTree(ExpandConstant('{app}\Client\LocalStorage'), True, True, True); + + end; + ///////////// InitializeWizard ////////////////////////// procedure InitializeWizard(); begin CreateCustomInputOptionCMSorSCM; + OverwriteConfig := OverwriteConfigModal; end; procedure CurStepChanged(CurStep: TSetupStep); @@ -250,4 +287,9 @@ var then IsSCM := false else IsSCM := true + + if CurStep = ssPostInstall then + begin + DeleteLocalStorage; + end; end; \ No newline at end of file diff --git a/Step/Step.csproj b/Step/Step.csproj index 65d5dda0..3f2b7250 100644 --- a/Step/Step.csproj +++ b/Step/Step.csproj @@ -51,7 +51,7 @@ true pdbonly - true + false bin\ TRACE prompt diff --git a/Step/Utility/teamviewerqs.exe b/Step/Utility/teamviewerqs.exe new file mode 100644 index 00000000..8f478590 Binary files /dev/null and b/Step/Utility/teamviewerqs.exe differ diff --git a/Step/program.cs b/Step/program.cs index 7900efbe..d6f91afb 100644 --- a/Step/program.cs +++ b/Step/program.cs @@ -3,10 +3,12 @@ using Step.Config; using Step.Core; using Step.Database; using Step.Listeners; +using Step.Model; using Step.NC; using Step.UI; using Step.Utils; using System; +using System.IO; using System.Net; using System.Net.Sockets; using System.Threading; @@ -29,24 +31,26 @@ namespace Step LogInfo("Application started"); //Check if is already running an instance of this application - String AppName = System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location); + string AppName = System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location); if (System.Diagnostics.Process.GetProcessesByName(AppName).Length > 1) { MessageBox.Show("Only one istance of "+ AppName +" can be executed!", AppName, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } - - + // Create unhandled exception handler AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler); + // Create directories if they don't exist + CreateDirectories(); + // Read config ServerConfigController.ReadStartupConfig(); // Start WinForm - ServerControlWindow.Start(); - - DatabaseContext.SetUpDbConnectionAndDbConfig(); + ServerControlWindow.Start(); + + bool databaseStatus = DatabaseContext.SetUpDbConnectionAndDbConfig(); // Register listener to "close application" messages MessageServices.Current.Subscribe(SEND_STOP_SERVER, (a, b) => @@ -54,17 +58,19 @@ namespace Step StopRequest.Set(); if (NcConfig.NcVendor.ToUpper() == NC_VENDOR.SIEMENS) ThreadSiemensHmi.StopThread(); - }); - - if(NcConfig.NcVendor.ToUpper() != NC_VENDOR.SIEMENS) + }); + + // Stop threads and disconnect from NC + MessageServices.Current.Subscribe(SEND_STOP_THREADS, (a, b) => { - // Setup Osai/fanuc toolManager - using (NcToolTableHandler handler = new NcToolTableHandler()) - { - handler.Connect(); - handler.SetupNcToolManager(); - } - } + using (NcHandler ncHandler = new NcHandler()) + ncHandler.Disconnect(); + + // Stop Threads + ThreadsHandler.Close(); + // Stop messageservice listeners + ListenersHandler.Stop(); + }); // Start server services if (!ValidateAddress(ServerStartupConfig.ServerAddress)) @@ -78,13 +84,15 @@ namespace Step opt.Urls.Add("http://" + ServerStartupConfig.ServerAddress.ToString() + ":" + ServerStartupConfig.ServerPort.ToString()); using (WebApp.Start(opt)) - { - // Start Threads - ThreadsHandler.Start(); - // Start listeners - ListenersHandler.Start(); - - + { + if (databaseStatus) + { + // Start Threads + ThreadsHandler.Start(); + // Start listeners + ListenersHandler.Start(); + } + // Wait interrupt from client StopRequest.WaitOne(); @@ -99,7 +107,7 @@ namespace Step // Stop messageservice listeners ListenersHandler.Stop(); // Close WinForm - ServerControlWindow.Stop(); + ServerControlWindow.Stop(); } private static bool ValidateAddress(string Addr) @@ -129,6 +137,29 @@ namespace Step } LogException((Exception)args.ExceptionObject, ERROR_LEVEL.FATAL); + } + + private static void CreateDirectories() + { + if (!Directory.Exists(MAINTENANCE_ATTACHMENT_PATH)) + Directory.CreateDirectory(MAINTENANCE_ATTACHMENT_PATH); + if (!Directory.Exists(ALARM_ATTACHMENT_PATH)) + Directory.CreateDirectory(ALARM_ATTACHMENT_PATH); + + if (!Directory.Exists(TEMP_PP_FOLDER)) + Directory.CreateDirectory(TEMP_PP_FOLDER); + + if (!Directory.Exists(PART_PRG_IMAGES)) + Directory.CreateDirectory(PART_PRG_IMAGES); + + if (!Directory.Exists(JOB_TMP_DIRECTORY)) + Directory.CreateDirectory(JOB_TMP_DIRECTORY); + + if (!Directory.Exists(QUEUE_TMP_FOLDER)) + Directory.CreateDirectory(QUEUE_TMP_FOLDER); + + if (!Directory.Exists(SCADA_DIRECTORY)) + Directory.CreateDirectory(SCADA_DIRECTORY); } } } \ No newline at end of file diff --git a/Step/wwwroot/assets/styles/base/alarms.less b/Step/wwwroot/assets/styles/base/alarms.less index 2cbbe01c..586b7ce4 100644 --- a/Step/wwwroot/assets/styles/base/alarms.less +++ b/Step/wwwroot/assets/styles/base/alarms.less @@ -444,6 +444,7 @@ margin-left: 132px; &.my { + margin-top: 5px; margin-left: 15px; } @@ -934,30 +935,30 @@ th:nth-child(2), td:nth-child(2) { - width: 550px; - max-width: 550px; + width: 500px; + max-width: 500px; text-align: left; } th:nth-child(3), td:nth-child(3) { - width: 150px; - max-width: 150px; + width: 130px; + max-width: 130px; text-align: left; } th:nth-child(4), td:nth-child(4) { - width: 100px; - max-width: 100px; - min-width: 50px; + width: 150px; + max-width: 150px; + min-width: 100px; text-align: left; } th:nth-child(5), td:nth-child(5) { - width: 100px; - max-width: 100px; + width: 150px; + min-width: 150px; } th, @@ -972,11 +973,10 @@ tbody { display: block; - height: 552px; - width: 1200px; - overflow-y: scroll; + height: 559px; + width: 1241px; + overflow-y: hidden; overflow-x: hidden; - padding-right: 20px; &.without-footer { height: 620px @@ -1003,7 +1003,7 @@ tr { cursor: pointer; - height: 64px; + height: 62px; padding: 10px; td { diff --git a/Step/wwwroot/assets/styles/base/buttons.less b/Step/wwwroot/assets/styles/base/buttons.less index dc82b192..46dc89fc 100644 --- a/Step/wwwroot/assets/styles/base/buttons.less +++ b/Step/wwwroot/assets/styles/base/buttons.less @@ -241,8 +241,25 @@ button.soft { } } &.square { - width: 48px; + width: 60px; } + &.incremental { + padding: 0px 2px; + margin-right: 0px; + margin-left: 0px; + } + + &.firstIncr { + margin-left: 4px; + border-radius: 2px 0px 0px 2px !important + } + &.middleIncr { + border-radius: 0px !important + } + &.lastIncr { + border-radius: 0px 2px 2px 0px !important + } + i.fa { font-size: 24px; } diff --git a/Step/wwwroot/assets/styles/base/card.less b/Step/wwwroot/assets/styles/base/card.less index 45ff5c56..c7324507 100644 --- a/Step/wwwroot/assets/styles/base/card.less +++ b/Step/wwwroot/assets/styles/base/card.less @@ -760,21 +760,23 @@ } .card-axes-production { - height: 558px; + height: 562px; width: 232px; - border-radius: 2px; - box-shadow: 0 1px 2px 0 @color-black-40; + //border-radius: 2px; + //box-shadow: 0 1px 2px 0 @color-black-40; background-color: @color-background-white; display: flex; flex-flow: column; - .first-box-axes, - .second-box-axes { - height: 264px; + .first-box-axes { + height: 294px; width: 100%; display: flex; flex-flow: column; overflow: auto; + border-radius: 2px; + box-shadow: 0 1px 2px 0 @color-black-40; + margin-top: 8px; .axes { min-height: 32px; @@ -874,12 +876,7 @@ .axes:last-child { margin-bottom: 16px; } - } - - .second-box-axes { - width: 100%; - height: 294px; - + .tabs { min-height: 30px; width: 100%; @@ -918,6 +915,38 @@ } } +.override-box { + height: 260px; + width: 232px; + display: block; + margin: auto; + border-radius: 2px; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4); + + .label-container{ + display: flex; + justify-content: space-around; + font-weight: 600; + text-align: center; + + .title { + font-size: 14px; + } + + .value { + font-size: 25px; + } + + .rapid { + color: #002680 + } + + .work { + color: #1791ff + } + } +} + .card-folder-path { width: auto; height: 64px; diff --git a/Step/wwwroot/assets/styles/base/job-editor.less b/Step/wwwroot/assets/styles/base/job-editor.less index 3b87d43f..35ff7430 100644 --- a/Step/wwwroot/assets/styles/base/job-editor.less +++ b/Step/wwwroot/assets/styles/base/job-editor.less @@ -313,6 +313,7 @@ height: 14px; margin-left: 132px; &.my{ + margin-top: 5px; margin-left: 15px; } .text-date{ diff --git a/Step/wwwroot/assets/styles/base/layout.less b/Step/wwwroot/assets/styles/base/layout.less index 8e2126b6..cf91fb93 100644 --- a/Step/wwwroot/assets/styles/base/layout.less +++ b/Step/wwwroot/assets/styles/base/layout.less @@ -41,7 +41,7 @@ @background-color: rgb(216, 216, 216); @handle-width: 48px; @handle-height: 32px; -@persona-size: 88px; +@persona-size: 80px; @spinner-loading-height: 200px; @spinner-loading-width: 200px; a, a:visited, a:hover, a:active { @@ -51,8 +51,9 @@ a, a:visited, a:hover, a:active { .persona { height: @persona-size; width: @persona-size; + line-height: @persona-size; border-radius: @persona-size; - font-size: @persona-size; + font-size: 50px; text-align: center; background-color: @color-darkish-blue; color: white; diff --git a/Step/wwwroot/assets/styles/base/maintenance-card.less b/Step/wwwroot/assets/styles/base/maintenance-card.less index 7fbafccf..cc1eca01 100644 --- a/Step/wwwroot/assets/styles/base/maintenance-card.less +++ b/Step/wwwroot/assets/styles/base/maintenance-card.less @@ -299,6 +299,7 @@ height: 14px; margin-left: 132px; &.my{ + margin-top: 5px; margin-left: 15px; } .text-date{ diff --git a/Step/wwwroot/assets/styles/base/modals.less b/Step/wwwroot/assets/styles/base/modals.less index e1a7e13c..e085985f 100644 --- a/Step/wwwroot/assets/styles/base/modals.less +++ b/Step/wwwroot/assets/styles/base/modals.less @@ -33,6 +33,7 @@ @modal-iframe-height: 800px; @modal-iframe-width: 1800px; @modal-user-info-height: 610px; +@modal-concact-info-height: 375px; @modal-login-top: @modal-login-height / 2; @modal-login-left: @modal-login-width / 2; @modal-create-maintenance-width: 896px; @@ -183,6 +184,7 @@ align-items: center; span{ word-wrap: break-word; + max-width: 445px; } input{ margin-left: auto; @@ -343,6 +345,52 @@ } } +.@{modal}.contact-info { + width: @modal-login-width; + height: @modal-concact-info-height; + top: calc(~"50%" - @modal-concact-info-height / 2); + left: calc(~"50%" - @modal-login-width / 2); + header { + background-color: @color-darkish-blue; + color: @color-white; + font-family: @font-family; + font-weight: 600; + font-size: 24px; + text-align: left; + padding: 0px 23px; + } + img { + display: block; + width: 88px; + height: 88px; + margin: auto; + margin-top: 48px; + margin-bottom: 40px; + } + .details { + text-align: center; + color: @color-greyish-brown; + & > * { + display: block; + margin-bottom: 5px; + height: 20px; + line-height: 20px; + } + & > label { + text-align: right; + strong { + display: inline-block; + width: 50%; + text-align: left; + } + } + + & > hr { + border: none; + } + } +} + .@{modal}.self-adaptive { width: @modal-selfadaptivepath-width; height: @modal-selfadaptivepath-height; diff --git a/Step/wwwroot/assets/styles/base/production.less b/Step/wwwroot/assets/styles/base/production.less index bfc1e8b5..8a0d40a8 100644 --- a/Step/wwwroot/assets/styles/base/production.less +++ b/Step/wwwroot/assets/styles/base/production.less @@ -131,7 +131,7 @@ height: 353px; width: 232px; border-radius: 2px; - margin-top: 8px; + margin-top: 12px; margin-bottom: 16px; box-shadow: 0 1px 2px 0 @color-black-40; button:nth-child(odd),button:nth-child(even){ @@ -178,11 +178,28 @@ float: right; border-radius: 2px; box-shadow: 0 1px 2px 0 @color-black-40; + position: relative; &.has-scada{ height: 360px !important; } + .SelectionInProgress{ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + font-size: 2em; + font-weight: 600; + background-color: rgba(217, 217, 217, 0.5); + flex-flow: column; + line-height: 2.5em; + } + .box-softkeys-prefered-header{ display: flex; height: 62px; diff --git a/Step/wwwroot/assets/styles/base/scada.less b/Step/wwwroot/assets/styles/base/scada.less index 3adb8b44..e32c9487 100644 --- a/Step/wwwroot/assets/styles/base/scada.less +++ b/Step/wwwroot/assets/styles/base/scada.less @@ -43,9 +43,41 @@ input[type=number]{ border: solid 1px #ccc; } + input[type=number]:disabled{ border: solid 1px #FFFFFF; } + + .input-group{ + display: flex; + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + /* display: none; <- Crashes Chrome on hover */ + -webkit-appearance: none; + margin: 0; /* <-- Apparently some margin are still there even though it's hidden */ + } + } + + .input-group-append{ + display: flex; + margin-left: 0px; + align-items: center; + justify-content: center; + } + + .appended-btn { + position: relative; + z-index: 2; + background-image: linear-gradient(to bottom, @button-success-color-from, @button-success-color-to); + color: white; + border: #001e48 1px solid; + &:active { + background-image: linear-gradient(to bottom, @button-success-color-to, @button-success-color-from) !important; + box-shadow: inset @button-shadow; + border: #001e48 1px solid !important; + color: #8eb5e2 + } + } } } @@ -136,7 +168,8 @@ input[type=number]{ - border: solid 1px #ccc; + border: solid 1px #ccc; + padding: 0px; } input[type=number]:disabled{ border: solid 1px #FFFFFF; @@ -169,6 +202,37 @@ & >* { position: absolute; } + + .input-group{ + display: flex; + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + /* display: none; <- Crashes Chrome on hover */ + -webkit-appearance: none; + margin: 0; /* <-- Apparently some margin are still there even though it's hidden */ + } + } + + .input-group-append{ + display: flex; + margin-left: 0px; + align-items: center; + justify-content: center; + } + + .appended-btn { + position: relative; + z-index: 2; + background-image: linear-gradient(to bottom, @button-success-color-from, @button-success-color-to); + color: white; + border: #001e48 1px solid; + &:active { + background-image: linear-gradient(to bottom, @button-success-color-to, @button-success-color-from) !important; + box-shadow: inset @button-shadow; + border: #001e48 1px solid !important; + color: #8eb5e2 + } + } } } } diff --git a/Step/wwwroot/assets/styles/style.css b/Step/wwwroot/assets/styles/style.css index 8430094b..b87cc31c 100644 --- a/Step/wwwroot/assets/styles/style.css +++ b/Step/wwwroot/assets/styles/style.css @@ -127,6 +127,7 @@ } .modal.m155 .content-real-showval span { word-wrap: break-word; + max-width: 445px; } .modal.m155 .content-real-showval input { margin-left: auto; @@ -279,6 +280,50 @@ .modal.machine-info .details > hr { border: none; } +.modal.contact-info { + width: 600px; + height: 375px; + top: calc(50% - 187.5px); + left: calc(50% - 300px); +} +.modal.contact-info header { + background-color: #002680; + color: #fff; + font-family: 'Work Sans', sans-serif; + font-weight: 600; + font-size: 24px; + text-align: left; + padding: 0px 23px; +} +.modal.contact-info img { + display: block; + width: 88px; + height: 88px; + margin: auto; + margin-top: 48px; + margin-bottom: 40px; +} +.modal.contact-info .details { + text-align: center; + color: #4b4b4b; +} +.modal.contact-info .details > * { + display: block; + margin-bottom: 5px; + height: 20px; + line-height: 20px; +} +.modal.contact-info .details > label { + text-align: right; +} +.modal.contact-info .details > label strong { + display: inline-block; + width: 50%; + text-align: left; +} +.modal.contact-info .details > hr { + border: none; +} .modal.self-adaptive { width: 750px; height: 350px; @@ -3439,7 +3484,22 @@ button.soft[disabled]:not(.readonly) img { filter: grayscale(100%) invert(44%); } button.soft.square { - width: 48px; + width: 60px; +} +button.soft.incremental { + padding: 0px 2px; + margin-right: 0px; + margin-left: 0px; +} +button.soft.firstIncr { + margin-left: 4px; + border-radius: 2px 0px 0px 2px !important; +} +button.soft.middleIncr { + border-radius: 0px !important; +} +button.soft.lastIncr { + border-radius: 0px 2px 2px 0px !important; } button.soft i.fa { font-size: 24px; @@ -4680,6 +4740,7 @@ footer .container button.big:before { margin-left: 132px; } .accordion section .dropdown .all-message-box .message-box .message-box-body.my { + margin-top: 5px; margin-left: 15px; } .accordion section .dropdown .all-message-box .message-box .message-box-body .text-date { @@ -5108,27 +5169,27 @@ footer .container button.big:before { } .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table th:nth-child(2), .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table td:nth-child(2) { - width: 550px; - max-width: 550px; + width: 500px; + max-width: 500px; text-align: left; } .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table th:nth-child(3), .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table td:nth-child(3) { - width: 150px; - max-width: 150px; + width: 130px; + max-width: 130px; text-align: left; } .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table th:nth-child(4), .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table td:nth-child(4) { - width: 100px; - max-width: 100px; - min-width: 50px; + width: 150px; + max-width: 150px; + min-width: 100px; text-align: left; } .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table th:nth-child(5), .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table td:nth-child(5) { - width: 100px; - max-width: 100px; + width: 150px; + min-width: 150px; } .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table th, .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table td { @@ -5141,11 +5202,10 @@ footer .container button.big:before { } .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table tbody { display: block; - height: 552px; - width: 1200px; - overflow-y: scroll; + height: 559px; + width: 1241px; + overflow-y: hidden; overflow-x: hidden; - padding-right: 20px; } .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table tbody.without-footer { height: 620px; @@ -5167,7 +5227,7 @@ footer .container button.big:before { } .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table tbody tr { cursor: pointer; - height: 64px; + height: 62px; padding: 10px; } .alarm-history-container .alarm-history-body .alarm-history-body-left .alarm-history-table tbody tr td { @@ -7631,24 +7691,23 @@ footer .container button.big:before { color: #002680; } .card-axes-production { - height: 558px; + height: 562px; width: 232px; - border-radius: 2px; - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4); background-color: #fff; display: flex; flex-flow: column; } -.card-axes-production .first-box-axes, -.card-axes-production .second-box-axes { - height: 264px; +.card-axes-production .first-box-axes { + height: 294px; width: 100%; display: flex; flex-flow: column; overflow: auto; + border-radius: 2px; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4); + margin-top: 8px; } -.card-axes-production .first-box-axes .axes, -.card-axes-production .second-box-axes .axes { +.card-axes-production .first-box-axes .axes { min-height: 32px; width: 100%; display: flex; @@ -7657,20 +7716,16 @@ footer .container button.big:before { justify-content: space-between; margin-top: 8px; } -.card-axes-production .first-box-axes .axes._7, -.card-axes-production .second-box-axes .axes._7 { +.card-axes-production .first-box-axes .axes._7 { min-height: 26px; } -.card-axes-production .first-box-axes .axes._8, -.card-axes-production .second-box-axes .axes._8 { +.card-axes-production .first-box-axes .axes._8 { min-height: 22px; } -.card-axes-production .first-box-axes .axes._9, -.card-axes-production .second-box-axes .axes._9 { +.card-axes-production .first-box-axes .axes._9 { min-height: 18px; } -.card-axes-production .first-box-axes .axes .variable, -.card-axes-production .second-box-axes .axes .variable { +.card-axes-production .first-box-axes .axes .variable { font-size: 48px; width: 75px; line-height: 0; @@ -7678,24 +7733,19 @@ footer .container button.big:before { color: #4b4b4b; text-align: right; } -.card-axes-production .first-box-axes .axes .variable._7, -.card-axes-production .second-box-axes .axes .variable._7 { +.card-axes-production .first-box-axes .axes .variable._7 { font-size: 42px; } -.card-axes-production .first-box-axes .axes .variable._8, -.card-axes-production .second-box-axes .axes .variable._8 { +.card-axes-production .first-box-axes .axes .variable._8 { font-size: 36px; } -.card-axes-production .first-box-axes .axes .variable._9, -.card-axes-production .second-box-axes .axes .variable._9 { +.card-axes-production .first-box-axes .axes .variable._9 { font-size: 29px; } -.card-axes-production .first-box-axes .axes .variable.more9, -.card-axes-production .second-box-axes .axes .variable.more9 { +.card-axes-production .first-box-axes .axes .variable.more9 { width: 69px; } -.card-axes-production .first-box-axes .axes .number, -.card-axes-production .second-box-axes .axes .number { +.card-axes-production .first-box-axes .axes .number { width: 135px; height: 32px; border-radius: 2px; @@ -7707,79 +7757,92 @@ footer .container button.big:before { padding-right: 8px; font-size: 20px; } -.card-axes-production .first-box-axes .axes .number._7, -.card-axes-production .second-box-axes .axes .number._7 { +.card-axes-production .first-box-axes .axes .number._7 { height: 26px; } -.card-axes-production .first-box-axes .axes .number._8, -.card-axes-production .second-box-axes .axes .number._8 { +.card-axes-production .first-box-axes .axes .number._8 { height: 22px; } -.card-axes-production .first-box-axes .axes .number._9, -.card-axes-production .second-box-axes .axes .number._9 { +.card-axes-production .first-box-axes .axes .number._9 { height: 18px; font-size: 18px; } -.card-axes-production .first-box-axes .axes .number.more9, -.card-axes-production .second-box-axes .axes .number.more9 { +.card-axes-production .first-box-axes .axes .number.more9 { margin-right: 5px; } -.card-axes-production .first-box-axes .axes .umeasure, -.card-axes-production .second-box-axes .axes .umeasure { +.card-axes-production .first-box-axes .axes .umeasure { width: 32px; margin-left: 5px; text-align: left; } -.card-axes-production .first-box-axes .axes:nth-child(odd) .number, -.card-axes-production .second-box-axes .axes:nth-child(odd) .number { +.card-axes-production .first-box-axes .axes:nth-child(odd) .number { background-color: #f3f3f3; } -.card-axes-production .first-box-axes .axes:nth-child(even) .number, -.card-axes-production .second-box-axes .axes:nth-child(even) .number { +.card-axes-production .first-box-axes .axes:nth-child(even) .number { background-color: rgba(23, 145, 255, 0.3); } -.card-axes-production .first-box-axes .axes:first-child, -.card-axes-production .second-box-axes .axes:first-child { +.card-axes-production .first-box-axes .axes:first-child { margin-top: 16px; } -.card-axes-production .first-box-axes .axes:last-child, -.card-axes-production .second-box-axes .axes:last-child { +.card-axes-production .first-box-axes .axes:last-child { margin-bottom: 16px; } -.card-axes-production .second-box-axes { - width: 100%; - height: 294px; -} -.card-axes-production .second-box-axes .tabs { +.card-axes-production .first-box-axes .tabs { min-height: 30px; width: 100%; background-color: #e7e7e7; display: flex; flex-direction: row; } -.card-axes-production .second-box-axes .tabs button { +.card-axes-production .first-box-axes .tabs button { visibility: hidden; border: none; } -.card-axes-production .second-box-axes .tabs .tab { +.card-axes-production .first-box-axes .tabs .tab { visibility: visible; width: 77px; border-right: solid 1px #979797; } -.card-axes-production .second-box-axes .tabs .tab.active { +.card-axes-production .first-box-axes .tabs .tab.active { background-color: #fff; border-top: solid 2px #1791ff !important; } -.card-axes-production .second-box-axes .tabs .tab:last-child { +.card-axes-production .first-box-axes .tabs .tab:last-child { border: none; } -.card-axes-production .second-box-axes .content-box { +.card-axes-production .first-box-axes .content-box { height: calc(100% - 30px); width: 100%; display: flex; flex-flow: column; overflow: auto; } +.override-box { + height: 260px; + width: 232px; + display: block; + margin: auto; + border-radius: 2px; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4); +} +.override-box .label-container { + display: flex; + justify-content: space-around; + font-weight: 600; + text-align: center; +} +.override-box .label-container .title { + font-size: 14px; +} +.override-box .label-container .value { + font-size: 25px; +} +.override-box .label-container .rapid { + color: #002680; +} +.override-box .label-container .work { + color: #1791ff; +} .card-folder-path { width: auto; height: 64px; @@ -17390,6 +17453,7 @@ footer .container button.big:before { margin-left: 132px; } .accordion-maintenance section .dropdown .all-message-box .message-box .message-box-body.my { + margin-top: 5px; margin-left: 15px; } .accordion-maintenance section .dropdown .all-message-box .message-box .message-box-body .text-date { @@ -18419,7 +18483,7 @@ footer .container button.big:before { height: 353px; width: 232px; border-radius: 2px; - margin-top: 8px; + margin-top: 12px; margin-bottom: 16px; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4); } @@ -18465,10 +18529,26 @@ footer .container button.big:before { float: right; border-radius: 2px; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4); + position: relative; } .production-container .production-box .box-softkeys-prefered.has-scada { height: 360px !important; } +.production-container .production-box .box-softkeys-prefered .SelectionInProgress { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + font-size: 2em; + font-weight: 600; + background-color: rgba(217, 217, 217, 0.5); + flex-flow: column; + line-height: 2.5em; +} .production-container .production-box .box-softkeys-prefered .box-softkeys-prefered-header { display: flex; height: 62px; @@ -19203,6 +19283,7 @@ footer .container button.big:before { margin-left: 132px; } .job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .all-message-box .message-box .message-box-body.my { + margin-top: 5px; margin-left: 15px; } .job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .all-message-box .message-box .message-box-body .text-date { @@ -19591,6 +19672,35 @@ footer .container button.big:before { .card-scada-production .card-scada-prod-body input[type=number]:disabled { border: solid 1px #FFFFFF; } +.card-scada-production .card-scada-prod-body .input-group { + display: flex; +} +.card-scada-production .card-scada-prod-body .input-group input::-webkit-outer-spin-button, +.card-scada-production .card-scada-prod-body .input-group input::-webkit-inner-spin-button { + /* display: none; <- Crashes Chrome on hover */ + -webkit-appearance: none; + margin: 0; + /* <-- Apparently some margin are still there even though it's hidden */ +} +.card-scada-production .card-scada-prod-body .input-group-append { + display: flex; + margin-left: 0px; + align-items: center; + justify-content: center; +} +.card-scada-production .card-scada-prod-body .appended-btn { + position: relative; + z-index: 2; + background-image: linear-gradient(to bottom, #1756ad, #002680); + color: white; + border: #001e48 1px solid; +} +.card-scada-production .card-scada-prod-body .appended-btn:active { + background-image: linear-gradient(to bottom, #002680, #1756ad) !important; + box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.4); + border: #001e48 1px solid !important; + color: #8eb5e2; +} .scada-container { height: 100%; width: 100%; @@ -19675,6 +19785,7 @@ footer .container button.big:before { } .scada-container .scada-box .scada-box-body input[type=number] { border: solid 1px #ccc; + padding: 0px; } .scada-container .scada-box .scada-box-body input[type=number]:disabled { border: solid 1px #FFFFFF; @@ -19704,6 +19815,35 @@ footer .container button.big:before { .scada-container .scada-box .scada-box-body > * { position: absolute; } +.scada-container .scada-box .scada-box-body .input-group { + display: flex; +} +.scada-container .scada-box .scada-box-body .input-group input::-webkit-outer-spin-button, +.scada-container .scada-box .scada-box-body .input-group input::-webkit-inner-spin-button { + /* display: none; <- Crashes Chrome on hover */ + -webkit-appearance: none; + margin: 0; + /* <-- Apparently some margin are still there even though it's hidden */ +} +.scada-container .scada-box .scada-box-body .input-group-append { + display: flex; + margin-left: 0px; + align-items: center; + justify-content: center; +} +.scada-container .scada-box .scada-box-body .appended-btn { + position: relative; + z-index: 2; + background-image: linear-gradient(to bottom, #1756ad, #002680); + color: white; + border: #001e48 1px solid; +} +.scada-container .scada-box .scada-box-body .appended-btn:active { + background-image: linear-gradient(to bottom, #002680, #1756ad) !important; + box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.4); + border: #001e48 1px solid !important; + color: #8eb5e2; +} .event-transparent { pointer-events: none; } @@ -20480,10 +20620,11 @@ a:active { text-decoration: none; } .persona { - height: 88px; - width: 88px; - border-radius: 88px; - font-size: 88px; + height: 80px; + width: 80px; + line-height: 80px; + border-radius: 80px; + font-size: 50px; text-align: center; background-color: #002680; color: white; diff --git a/Step/wwwroot/src/@types/tooling.d.ts b/Step/wwwroot/src/@types/tooling.d.ts index 14668413..6f34d0e1 100644 --- a/Step/wwwroot/src/@types/tooling.d.ts +++ b/Step/wwwroot/src/@types/tooling.d.ts @@ -133,7 +133,10 @@ declare module server { length: number, radius: number, wearLength: number, - wearRadius: number + wearRadius: number, + unitOfMeasure: string, + realRadius: number, + realLength: number } export interface ShankNc{ @@ -209,6 +212,7 @@ declare module server { childId: number, familyName: string, type: number + id: number } export interface MagazinesPositions { diff --git a/Step/wwwroot/src/App.ts b/Step/wwwroot/src/App.ts index 0a239622..79456ff8 100644 --- a/Step/wwwroot/src/App.ts +++ b/Step/wwwroot/src/App.ts @@ -1,11 +1,11 @@ import Vue from "vue"; import { Hub } from "./services/hub"; -import { Header, Footer } from "./app.modules"; +import { Header, Footer, LocalizationService } from "./app.modules"; import { Login } from "src/app_modules/machine"; import { alarmList } from "src/app_modules/alarms"; -import { LoginService } from "src/services/loginService"; +import { loginService } from "src/services/loginService"; import { DataService } from "src/services/dataService"; -import { Factory, MessageService } from "./_base"; +import { Factory, messageService } from "./_base"; import { ModalContainer, ModalNcContainer } from "./modules/base-components"; import { ModalHelper } from "src/components/modals" import { appModelActions } from "src/store"; @@ -15,9 +15,13 @@ import * as iziToast from "izitoast"; import moment from "moment"; import Component from "vue-class-component"; import { Watch } from "vue-property-decorator"; +import { UsersService } from "./services/usersService"; declare var cmsClient; + + + @Component({ name: "app", components: { @@ -48,7 +52,7 @@ export default class app extends Vue { moment.locale((window.navigator as any).userLanguage || window.navigator.language); } mounted() { - let ms = Factory.Get(MessageService); + let ms = messageService; // if cms is connected if (typeof cmsClient != "undefined") @@ -58,6 +62,14 @@ export default class app extends Vue { this.applyBlur = true; }); + ms.subscribeToChannel("show-modal-login", args => { + this.applyBlur = true; + }); + + ms.subscribeToChannel("hide-modal-login", args => { + this.applyBlur = false; + }); + ms.subscribeToChannel("hide-modal", args => { this.applyBlur = false; }); @@ -101,18 +113,17 @@ export default class app extends Vue { }); let $this = this; - Factory.Get(LoginService) - .getUserInfo() + loginService.getUserInfo() .then(() => { if (!$this.isAuthenticated) - $this.$nextTick(() => ModalHelper.ShowModal(Login)); + $this.$nextTick(() => ModalHelper.ShowModalLogin(Login)); }); this.$store.watch( s => s.currentUser, (n, o) => { if (!n) { - this.$nextTick(() => ModalHelper.ShowModal(Login)); + this.$nextTick(() => ModalHelper.ShowModalLogin(Login)); } else new DataService().SetCurrentNcLanguage( this.$store.state.currentUser.language @@ -125,7 +136,7 @@ export default class app extends Vue { window.addEventListener("keyup", function (event) { // If down arrow was pressed... if (event.keyCode == 27) { - Factory.Get(MessageService).publishToChannel("esc_pressed"); + messageService.publishToChannel("esc_pressed"); } }); } @@ -146,24 +157,24 @@ export default class app extends Vue { this.applyViewPosition(-window.innerHeight + 84); //Hide the HMI if is showed (in production) - Factory.Get(MessageService).publishToChannel("HMI-production-hide"); - Factory.Get(MessageService).publishToChannel("PROD-production-hide"); + messageService.publishToChannel("HMI-production-hide"); + messageService.publishToChannel("PROD-production-hide"); //Show the HMI with delay (For the animation) - Factory.Get(MessageService).publishToChannel("HMI-show", 500); + messageService.publishToChannel("HMI-show", 500); } else { //Setup the Position of the View this.applyViewPosition(0); //Hide the HMI - Factory.Get(MessageService).publishToChannel("HMI-hide"); + messageService.publishToChannel("HMI-hide"); //Launche the show in delay if we are in production if (this.showHMIinProduction && this.$route.path.includes("production")) - Factory.Get(MessageService).publishToChannel( + messageService.publishToChannel( "HMI-production-show", 700 ); if (this.showPRODinProduction && this.$route.path.includes("production")) - Factory.Get(MessageService).publishToChannel( + messageService.publishToChannel( "PROD-production-show", 700 ); @@ -199,10 +210,10 @@ export default class app extends Vue { this.hub.Hello(); } onstartdrag() { - Factory.Get(MessageService).publishToChannel("HMI-start-drag"); + messageService.publishToChannel("HMI-start-drag"); } onstopdrag() { - Factory.Get(MessageService).publishToChannel("HMI-stop-drag", 600); + messageService.publishToChannel("HMI-stop-drag", 600); } toggleMainView(direction) { if (!direction || direction == "down" || direction == "none") @@ -212,7 +223,7 @@ export default class app extends Vue { } } sendMessage(name) { - Factory.Get(MessageService).publishToChannel(name); + messageService.publishToChannel(name); } movepanel(e) { if (e && e.touches && e.touches[0]) { diff --git a/Step/wwwroot/src/App.vue b/Step/wwwroot/src/App.vue index e3597905..5c0fc481 100644 --- a/Step/wwwroot/src/App.vue +++ b/Step/wwwroot/src/App.vue @@ -21,6 +21,7 @@ +
diff --git a/Step/wwwroot/src/_base/baseRestService.ts b/Step/wwwroot/src/_base/baseRestService.ts index d8144b6c..de27ec3d 100644 --- a/Step/wwwroot/src/_base/baseRestService.ts +++ b/Step/wwwroot/src/_base/baseRestService.ts @@ -1,7 +1,6 @@ import Axios, { AxiosInstance, AxiosPromise, AxiosResponse, AxiosBasicCredentials, AxiosRequestConfig } from "axios"; import Factory from "./factoryService"; import * as iziToast from "izitoast"; -import { MessageService } from "./messageService"; // import { localizeString } from "../filters/localizeFilter"; import { store, AppModel } from "src/store"; diff --git a/Step/wwwroot/src/_base/index.js b/Step/wwwroot/src/_base/index.js index b2b875e1..3bb74af6 100644 --- a/Step/wwwroot/src/_base/index.js +++ b/Step/wwwroot/src/_base/index.js @@ -1,19 +1,19 @@ import Factory from "./factoryService"; -import { MessageService } from "./messageService"; +import { messageService } from "./messageService"; import { UUID,Utilities } from "./utils"; export function awaiter(promise) { - Factory.Get(MessageService).publishToChannel("show-loading"); + messageService.publishToChannel("show-loading"); return promise.then(data => { - Factory.Get(MessageService).publishToChannel("hide-loading"); + messageService.publishToChannel("hide-loading"); return data }) .catch(err => { - Factory.Get(MessageService).publishToChannel("hide-loading"); + messageService.publishToChannel("hide-loading"); return Promise.reject(err); }); } -export { Factory, MessageService, UUID, Utilities }; \ No newline at end of file +export { Factory, UUID, Utilities, messageService }; \ No newline at end of file diff --git a/Step/wwwroot/src/_base/messageService.ts b/Step/wwwroot/src/_base/messageService.ts index 045efff9..98fd3061 100644 --- a/Step/wwwroot/src/_base/messageService.ts +++ b/Step/wwwroot/src/_base/messageService.ts @@ -4,7 +4,7 @@ import Vue from "vue"; // Message Service Definition // -------------------------------------------------- -export class MessageService { +class MessageService { private _events: Vue = new Vue({}); @@ -28,5 +28,4 @@ export class MessageService { } } -Factory.Register(MessageService); - +export const messageService = new MessageService(); \ No newline at end of file diff --git a/Step/wwwroot/src/app.business-logic.ts b/Step/wwwroot/src/app.business-logic.ts index b0e21b2b..74f548b4 100644 --- a/Step/wwwroot/src/app.business-logic.ts +++ b/Step/wwwroot/src/app.business-logic.ts @@ -1,11 +1,11 @@ -import { MessageService, Factory } from "./_base"; +import { Factory, messageService } from "./_base"; import { machineService } from "src/services/machineService"; -import { LoginService } from "src/services/loginService"; +import { loginService } from "src/services/loginService"; import { store, AppModel, MachineStatusModel, machineStatusActions, localizationModelActions, machineInfoActions } from "src/store"; -import { UserInfoDialog, MachineInfoDialog, AxesCalibration, Login } from "src/app_modules/machine"; +import { UserInfoDialog, MachineInfoDialog, AxesCalibration, ContactInfoDialog, Login } from "src/app_modules/machine"; import { AreaModel } from "src/store/machineStatus.store"; @@ -13,12 +13,16 @@ import { DataService } from "./services/dataService"; import { ToolingService } from "./services/toolingService"; import { DepotService } from "./services/depotService"; import { MaintenanceService } from "./services/maintenanceService"; -import { localizationService } from "./services/localizationService"; +import { localizationService, LocalizationService } from "./services/localizationService"; import { DEBUG_CONFIGURATION, USE_RUNTIME_CONFIGURATION } from "./config"; import { ModalHelper } from "./components/modals"; import Vue from "vue"; import { scadaService } from "./services/scadaService"; import { Hub } from "./services"; +import { UsersService } from "./services/usersService"; + +Factory.Register(UsersService); +Factory.Register(LocalizationService); declare let cmsClient: any; let HMIvisible = false; @@ -39,10 +43,10 @@ let HMIScreenshotInterval; let HMIprodTimeout; let RerenderInterval; -const messageService = Factory.Get(MessageService); messageService.subscribeToChannel("show-user-info", () => { ModalHelper.ShowModal(UserInfoDialog); }); messageService.subscribeToChannel("show-machine-info", () => { ModalHelper.ShowModal(MachineInfoDialog); }); +messageService.subscribeToChannel("show-contact-info", () => { ModalHelper.ShowModal(ContactInfoDialog); }); messageService.subscribeToChannel("show-axes-calibration", () => { ModalHelper.ShowNcModal(AxesCalibration); }); messageService.subscribeToChannel("hide-axes-calibration", () => { ModalHelper.HideNcModal(AxesCalibration); }); messageService.subscribeToChannel("show-m155-questions", () => { ModalHelper.ShowNextM155Modal(); }); @@ -58,12 +62,12 @@ messageService.subscribeToChannel("show-nochange-page", () => { //Loading machine configuration async function loadMachineConfig() { - await Factory.Get(LoginService).getUserInfo(); - try{ - await scadaService.ListScada(); - }catch(err){ + await loginService.getUserInfo(); + // try{ + // await scadaService.ListScada(); + // }catch(err){ - } + // } try { @@ -85,9 +89,9 @@ async function loadMachineConfig() { // set vendor type switch (vendor) { - case "siemens": machineInfoActions.updateMachineInfo(store, { isSiemens: true, isFanuc: false, isOsai: false, defaultLanguage: mcresult.defaultLanguage, isSCMVisualStyle: isSCM }); break; - case "fanuc": machineInfoActions.updateMachineInfo(store, { isSiemens: false, isFanuc: true, isOsai: false, defaultLanguage: mcresult.defaultLanguage, isSCMVisualStyle: isSCM }); break; - case "osai": machineInfoActions.updateMachineInfo(store, { isSiemens: false, isFanuc: false, isOsai: true, defaultLanguage: mcresult.defaultLanguage, isSCMVisualStyle: isSCM }); break; + case "siemens": machineInfoActions.updateMachineInfo(store, { isSiemens: true, isFanuc: false, isOsai: false, defaultLanguage: mcresult.defaultLanguage, isSCMVisualStyle: isSCM, mgiOption : false }); break; + case "fanuc": machineInfoActions.updateMachineInfo(store, { isSiemens: false, isFanuc: true, isOsai: false, defaultLanguage: mcresult.defaultLanguage, isSCMVisualStyle: isSCM, mgiOption: mcresult.mgiOption }); break; + case "osai": machineInfoActions.updateMachineInfo(store, { isSiemens: false, isFanuc: false, isOsai: true, defaultLanguage: mcresult.defaultLanguage, isSCMVisualStyle: isSCM, mgiOption: false }); break; default: machineInfoActions.updateMachineInfo(store, { isSiemens: false, isFanuc: false, isOsai: false, defaultLanguage: mcresult.defaultLanguage, isSCMVisualStyle: isSCM }); break; } @@ -127,7 +131,6 @@ if (typeof cmsClient != "undefined") { Vue.filter('localize')("modal_confirm_close_application", "Sei sicuro di voler chiudere l'applicazione?"), () => { messageService.publishToChannel("close-scada"); - Hub.Current.QuitServerApp(); cmsClient.closeForm(); },null ,'modal'); } @@ -155,7 +158,7 @@ if (typeof cmsClient != "undefined") { cmsClient.setNcWindowState(0); //Events handler - Factory.Get(MessageService).subscribeToChannel("HMI-show", args => { + messageService.subscribeToChannel("HMI-show", args => { clearTimeout(HMIshowTimeout); if (args[0] > 0) HMIshowTimeout = setTimeout(ShowHmi, args[0]); @@ -163,7 +166,7 @@ if (typeof cmsClient != "undefined") { ShowHmi() }); - Factory.Get(MessageService).subscribeToChannel("HMI-hide", args => { + messageService.subscribeToChannel("HMI-hide", args => { clearTimeout(HMIshowTimeout); if (args[0] > 0) HMIshowTimeout = setTimeout(HideHmi, args[0]); @@ -171,7 +174,7 @@ if (typeof cmsClient != "undefined") { HideHmi() }); - Factory.Get(MessageService).subscribeToChannel("HMI-production-show", args => { + messageService.subscribeToChannel("HMI-production-show", args => { clearTimeout(HMIprodTimeout); if (args[0] > 0) HMIprodTimeout = setTimeout(ShowHmiProduction, args[0]); @@ -179,7 +182,7 @@ if (typeof cmsClient != "undefined") { ShowHmiProduction() }); - Factory.Get(MessageService).subscribeToChannel("HMI-production-hide", args => { + messageService.subscribeToChannel("HMI-production-hide", args => { clearTimeout(HMIprodTimeout); if (args[0] > 0) HMIprodTimeout = setTimeout(HideHmiProduction, args[0]); @@ -189,7 +192,7 @@ if (typeof cmsClient != "undefined") { }); - Factory.Get(MessageService).subscribeToChannel("PROD-production-show", args => { + messageService.subscribeToChannel("PROD-production-show", args => { clearTimeout(PRODprodTimeout); if (args[0] > 0) PRODprodTimeout = setTimeout(ShowProdProduction, args[0]); @@ -197,7 +200,7 @@ if (typeof cmsClient != "undefined") { ShowProdProduction() }); - Factory.Get(MessageService).subscribeToChannel("PROD-production-hide", args => { + messageService.subscribeToChannel("PROD-production-hide", args => { clearTimeout(PRODprodTimeout); if (args[0] > 0) PRODprodTimeout = setTimeout(HideProdProduction, args[0]); @@ -206,7 +209,7 @@ if (typeof cmsClient != "undefined") { }); - Factory.Get(MessageService).subscribeToChannel("HMI-show-alarms", args => { + messageService.subscribeToChannel("HMI-show-alarms", args => { clearTimeout(HMIAlarmsTimeout); if (args[0] > 0) HMIAlarmsTimeout = setTimeout(showAlarms, args[0]); @@ -214,7 +217,7 @@ if (typeof cmsClient != "undefined") { showAlarms() }); - Factory.Get(MessageService).subscribeToChannel("HMI-hide-alarms", args => { + messageService.subscribeToChannel("HMI-hide-alarms", args => { clearTimeout(HMIAlarmsTimeout); if (args[0] > 0) HMIAlarmsTimeout = setTimeout(hideAlarms, args[0]); @@ -222,7 +225,7 @@ if (typeof cmsClient != "undefined") { hideAlarms() }); - Factory.Get(MessageService).subscribeToChannel("HMI-show-modal", args => { + messageService.subscribeToChannel("HMI-show-modal", args => { clearTimeout(HMIModalsTimeout); if (args[0] > 0) HMIModalsTimeout = setTimeout(showModal, args[0]); @@ -230,7 +233,7 @@ if (typeof cmsClient != "undefined") { showModal() }); - Factory.Get(MessageService).subscribeToChannel("HMI-show-modal-nc", args => { + messageService.subscribeToChannel("HMI-show-modal-nc", args => { clearTimeout(HMIModalsNcTimeout); if (args[0] > 0) HMIModalsNcTimeout = setTimeout(showNcModal, args[0]); @@ -238,7 +241,7 @@ if (typeof cmsClient != "undefined") { showNcModal() }); - Factory.Get(MessageService).subscribeToChannel("HMI-hide-modal-nc", args => { + messageService.subscribeToChannel("HMI-hide-modal-nc", args => { clearTimeout(HMIModalsNcTimeout); if (args[0] > 0) HMIModalsNcTimeout = setTimeout(hideNcModal, args[0]); @@ -246,7 +249,7 @@ if (typeof cmsClient != "undefined") { hideNcModal() }); - Factory.Get(MessageService).subscribeToChannel("HMI-hide-modal", args => { + messageService.subscribeToChannel("HMI-hide-modal", args => { clearTimeout(HMIModalsTimeout); if (args[0] > 0) HMIModalsTimeout = setTimeout(hideModal, args[0]); @@ -254,7 +257,7 @@ if (typeof cmsClient != "undefined") { hideModal() }); - Factory.Get(MessageService).subscribeToChannel("HMI-start-drag", args => { + messageService.subscribeToChannel("HMI-start-drag", args => { clearTimeout(HMIDraggingTimeout); if (args[0] > 0) HMIDraggingTimeout = setTimeout(startDrag, args[0]); @@ -262,7 +265,7 @@ if (typeof cmsClient != "undefined") { startDrag() }); - Factory.Get(MessageService).subscribeToChannel("HMI-stop-drag", args => { + messageService.subscribeToChannel("HMI-stop-drag", args => { clearTimeout(HMIDraggingTimeout); if (args[0] > 0) HMIDraggingTimeout = setTimeout(stopDrag, args[0]); @@ -365,10 +368,10 @@ function ElaborateHMIStatus() { // Enable/Disable Scrollers -Factory.Get(MessageService).subscribeToChannel("disable-scroll", (args) => { +messageService.subscribeToChannel("disable-scroll", (args) => { disableScroll(args[0]); }); -Factory.Get(MessageService).subscribeToChannel("enable-scroll", (args) => { +messageService.subscribeToChannel("enable-scroll", (args) => { enableScroll(args[0]); }); // Scroll manipulation diff --git a/Step/wwwroot/src/app.modules.ts b/Step/wwwroot/src/app.modules.ts index f4396100..c8ba3362 100644 --- a/Step/wwwroot/src/app.modules.ts +++ b/Step/wwwroot/src/app.modules.ts @@ -1,5 +1,5 @@ // GLobal services -import { LoginService } from "./services/loginService"; +import { loginService } from "./services/loginService"; import { LocalizationService } from "./services/localizationService"; // Page and modules @@ -39,7 +39,7 @@ import ModalReportSelectColumn from './modules/base-components/modal-report-sele export { - LoginService, + loginService, LocalizationService, Header, Footer, diff --git a/Step/wwwroot/src/app_modules/alarms/components/alarm-detail.ts b/Step/wwwroot/src/app_modules/alarms/components/alarm-detail.ts index fc75039a..389ed3c3 100644 --- a/Step/wwwroot/src/app_modules/alarms/components/alarm-detail.ts +++ b/Step/wwwroot/src/app_modules/alarms/components/alarm-detail.ts @@ -97,7 +97,7 @@ export default class AlarmDetail extends Vue { let idx = $this.attaches.indexOf(attach); $this.attaches.splice(idx, 1); }); - }, null); + }, null, "modal"); } } diff --git a/Step/wwwroot/src/app_modules/alarms/components/alarm-history.ts b/Step/wwwroot/src/app_modules/alarms/components/alarm-history.ts index 6d171a4c..975817e7 100644 --- a/Step/wwwroot/src/app_modules/alarms/components/alarm-history.ts +++ b/Step/wwwroot/src/app_modules/alarms/components/alarm-history.ts @@ -11,7 +11,7 @@ import { AlarmModel } from "@/src/store"; import { loginService } from "src/services"; import { alarmsService } from "src/services/alarmsService"; -import { awaiter } from "src/_base"; +import { awaiter, messageService } from "src/_base"; import { getColorFromName, isDarkColor } from "src/_base/utils"; import DatePicker from "vue2-datepicker"; @@ -73,6 +73,7 @@ export default class AlarmHistory extends Vue { currentPage: number = 0; itemsPerPage: number = 9; totalPages: number = 1; + canDelete: boolean = false; get currentUser() { @@ -107,10 +108,11 @@ export default class AlarmHistory extends Vue { arrayUserFilter.push(user.id); }) - let result = await awaiter(alarmsService.getAlarms(this.filter.title, arraySourceFilter, arrayUserFilter, from, to, this.currentPage, this.itemsPerPage)); + let result = await awaiter(alarmsService.getAlarms(this.filter.title, arraySourceFilter, arrayUserFilter, from, to, this.currentPage, this.itemsPerPage, + this.$store.state.currentUser.language)); this.data = result.alarms; this.totalPages = result.pages; - + this.canDelete = result.canDelete; } async mounted() { @@ -125,14 +127,17 @@ export default class AlarmHistory extends Vue { this.filter.multiUser.push(this.users[index].username); } this.onloading = false; + + messageService.subscribeToChannel("login-reload", + () => { + this.filterChanged("","") + }); } async onChange(e) { this.newAttach = e.target.files[0]; let result = await awaiter(alarmsService.postAttachment(this.selectedAlarm.alarmId, this.selectedAlarm.source, this.newAttach)); this.attaches.push(result.data); - - // new MaintenanceService().uploadFile(this.selectedMaintenance, this.state.file); } user(id: number) { @@ -145,6 +150,15 @@ export default class AlarmHistory extends Vue { this.notes = await awaiter(alarmsService.getNote(this.selectedAlarm.alarmId, this.selectedAlarm.source)); } + async deleteAlarms(){ + ModalHelper.AskConfirm(this.$options.filters.localize("modal_confirm_title", "Richiesta di conferma"), + this.$options.filters.localize("modal_confirm_delete_alarms", "Confermi la cancellazione di tutti gli allarmi salvati?"), + async () => { + await awaiter(alarmsService.DeleteAlarms()) + this.filterChanged("","") + }, null); + } + async exportAlarms(){ let $this = this; let from = this.filter.interval && this.filter.interval.length ? this.filter.interval[0] : null; @@ -157,20 +171,12 @@ export default class AlarmHistory extends Vue { arraySourceFilter.push(item.id); }); - /*this.filter.multiUser.forEach(function (item) { - $this.users.forEach(function (items) { - if (items.username == item) { - arrayUserFilter.push(items.id); - } - }) - })*/ - this.filter.multiUser.forEach(function (item) { var user = $this.users.find(x => x.username == item) arrayUserFilter.push(user.id); }) - await awaiter(alarmsService.exportAlarms(this.filter.title, arraySourceFilter, arrayUserFilter, from, to)); + await awaiter(alarmsService.exportAlarms(this.filter.title, arraySourceFilter, arrayUserFilter, from, to, this.$store.state.currentUser.language)); } updateLimitation() { diff --git a/Step/wwwroot/src/app_modules/alarms/components/alarm-history.vue b/Step/wwwroot/src/app_modules/alarms/components/alarm-history.vue index 21eb48b8..32504567 100644 --- a/Step/wwwroot/src/app_modules/alarms/components/alarm-history.vue +++ b/Step/wwwroot/src/app_modules/alarms/components/alarm-history.vue @@ -85,6 +85,9 @@ +
diff --git a/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.ts b/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.ts new file mode 100644 index 00000000..40aad79d --- /dev/null +++ b/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.ts @@ -0,0 +1,31 @@ +import Vue from "vue"; +import { Modal, ModalHelper } from "src/components/modals"; +import { machineService, ContactConfigurationModel } from "src/services/machineService"; +import { Factory, messageService, awaiter } from "src/_base"; +import Component from "vue-class-component"; + +@Component({ components: { modal: Modal } }) +export default class ContactInfoDialog extends Vue { + public contactInfo: ContactConfigurationModel = { + name:"", + phoneNumber: "", + email: "" + }; + + async beforeMount() { + this.contactInfo = await awaiter(new machineService().getContactConfiguration()); + messageService.subscribeToChannel("esc_pressed", args => { + this.close(); + }); + } + + beforeDestroy() { + messageService.deleteChannel("esc_pressed"); + } + + close() { + messageService.deleteChannel("esc_pressed"); + ModalHelper.HideModal(); + } +} + diff --git a/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.vue b/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.vue new file mode 100644 index 00000000..2fde904b --- /dev/null +++ b/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.vue @@ -0,0 +1,18 @@ + + + diff --git a/Step/wwwroot/src/app_modules/machine/components/login.ts b/Step/wwwroot/src/app_modules/machine/components/login.ts index d789a560..0ab9c5ae 100644 --- a/Step/wwwroot/src/app_modules/machine/components/login.ts +++ b/Step/wwwroot/src/app_modules/machine/components/login.ts @@ -2,13 +2,16 @@ import Vue from "vue"; import Component from "vue-class-component"; import { Modal, ModalHelper } from "src/components/modals" -import { Factory, MessageService, awaiter } from "src/_base"; -import { LoginService } from "src/app.modules"; +import { Factory, messageService, awaiter } from "src/_base"; +import { loginService } from "src/app.modules"; import { DataService } from 'src/services/dataService'; import iziToast, { IziToastSettings } from "izitoast"; +import { store, machineStatusActions } from "src/store"; @Component({ name: "login", components: { modal: Modal } }) export default class Login extends Vue { + $route: any; + $router: any; public user: server.loginViewModel = { password: null, username: null }; public hasError: boolean = false; @@ -16,22 +19,33 @@ export default class Login extends Vue { public logginIn: boolean = false; async doLogin() { - var service = Factory.Get(LoginService); - + var service = loginService; + var userNotAuthorized = false; this.logginIn = true; - if (await awaiter(service.doLogin(this.user)).then(() => { - Factory.Get(MessageService).publishToChannel("update-maintenance"); - Factory.Get(MessageService).publishToChannel("update-softkeys-favorite"); - ModalHelper.HideModal(); + await awaiter(service.doLogin(this.user)).then(() => { + // messageService.publishToChannel("update-maintenance"); + messageService.publishToChannel("update-softkeys-favorite"); + messageService.publishToChannel("login-reload"); + + // Check if user can access to current view, else redirect to production + if(!this.checkIfUserIsAuthorized()){ + userNotAuthorized = true; + } }).catch(() => { this.logginIn = false; this.hasError = !service.isAuthenticated; - })) - ModalHelper.HideModal(); + }) + + if(this.logginIn) { + if(userNotAuthorized) + this.$router.push('/production') + + ModalHelper.HideModal("modal-login"); + } } mounted(){ - Factory.Get(MessageService).subscribeToChannel("force-ui-update", args => { + messageService.subscribeToChannel("force-ui-update", args => { this.$forceUpdate(); }); document.body.addEventListener('keydown', function(e) { @@ -40,7 +54,22 @@ export default class Login extends Vue { } return true; }) + } + checkIfUserIsAuthorized(): boolean { + return machineStatusActions.isAreaVisible(store, this.URLS_TO_FUNCTIONS_BINDING[this.$route.path]); + } + + URLS_TO_FUNCTIONS_BINDING = { + "/production": "production", + "/tooling": "tooling", + "/report": "report", + "/alarms": "alarms", + "/maintenance": "maintenance", + "/scada": "scada", + "/users": "users", + "/jobeditor": "job-editor", + "/utilities": "utilities" } } diff --git a/Step/wwwroot/src/app_modules/machine/components/m155-dialog.ts b/Step/wwwroot/src/app_modules/machine/components/m155-dialog.ts index 6d3a03dd..353080a5 100644 --- a/Step/wwwroot/src/app_modules/machine/components/m155-dialog.ts +++ b/Step/wwwroot/src/app_modules/machine/components/m155-dialog.ts @@ -3,7 +3,7 @@ import { Modal, ModalHelper } from "src/components/modals"; import Component from "vue-class-component"; import Vue from "vue"; import { Hub } from "src/services"; -import { Factory, MessageService } from "src/_base"; +import { Factory, messageService } from "src/_base"; import { Watch } from "vue-property-decorator"; @Component({ components: { modal: Modal } }) @@ -19,7 +19,7 @@ export default class M155Dialog extends Vue{ mounted(){ this.data = ModalHelper.M155ModalData.data; this.value = 0; - Factory.Get(MessageService).subscribeToChannel("show-modal-nc", args => { + messageService.subscribeToChannel("show-modal-nc", args => { this.data = ModalHelper.M155ModalData.data; }); } diff --git a/Step/wwwroot/src/app_modules/machine/components/machine-info-dialog.ts b/Step/wwwroot/src/app_modules/machine/components/machine-info-dialog.ts index 81fc1a24..99720c69 100644 --- a/Step/wwwroot/src/app_modules/machine/components/machine-info-dialog.ts +++ b/Step/wwwroot/src/app_modules/machine/components/machine-info-dialog.ts @@ -1,7 +1,7 @@ import Vue from "vue"; import { Modal, ModalHelper } from "src/components/modals"; import { machineService } from "src/services/machineService"; -import { Factory, MessageService } from "src/_base"; +import { Factory, messageService } from "src/_base"; import moment from "moment"; import Component from "vue-class-component"; @@ -12,16 +12,16 @@ export default class MachineInfoDialog extends Vue { beforeMount() { new machineService().getMachineCNInfo(); - Factory.Get(MessageService).subscribeToChannel("esc_pressed", args => { + messageService.subscribeToChannel("esc_pressed", args => { this.close(); }); } beforeDestroy() { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); } close() { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); ModalHelper.HideModal(); } diff --git a/Step/wwwroot/src/app_modules/machine/components/user-info-dialog.ts b/Step/wwwroot/src/app_modules/machine/components/user-info-dialog.ts index edded262..af23a95a 100644 --- a/Step/wwwroot/src/app_modules/machine/components/user-info-dialog.ts +++ b/Step/wwwroot/src/app_modules/machine/components/user-info-dialog.ts @@ -5,8 +5,8 @@ import { Watch } from "vue-property-decorator"; import { Modal, ModalHelper } from "src/components/modals" import { AppModel, localizationModelActions } from "src/store"; -import { Factory, MessageService, awaiter } from "src/_base"; -import { LoginService } from "src/app.modules"; +import { Factory, messageService, awaiter } from "src/_base"; +import { loginService } from "src/app.modules"; import { getColorFromName,isDarkColor } from "src/_base/utils"; import { LocalizationService, localizationService } from "src/services/localizationService"; import { DataService } from "src/services/dataService"; @@ -26,7 +26,7 @@ export default class UserInfo extends Vue { doLogout() { ModalHelper.HideModal(); - Factory.Get(LoginService).Logout(); + loginService.Logout(); } getColor(nome,cognome){ @@ -44,13 +44,13 @@ export default class UserInfo extends Vue { this.currentLanguage = (this.$store.state as AppModel).localization.currentLanguage; this.reloadLanguages(); - Factory.Get(MessageService).subscribeToChannel("esc_pressed", args => { + messageService.subscribeToChannel("esc_pressed", args => { this.close(); }); } beforeDestroy() { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); } async reloadLanguages() { diff --git a/Step/wwwroot/src/app_modules/machine/components/user-info.ts b/Step/wwwroot/src/app_modules/machine/components/user-info.ts index 806de425..93a797b7 100644 --- a/Step/wwwroot/src/app_modules/machine/components/user-info.ts +++ b/Step/wwwroot/src/app_modules/machine/components/user-info.ts @@ -1,6 +1,6 @@ import Vue from "vue"; import Component from "vue-class-component"; -import { Factory, MessageService } from "src/_base"; +import { Factory, messageService } from "src/_base"; import moment from "moment"; import { AppModel } from "src/store"; import { getColorFromName,isDarkColor } from "src/_base/utils"; @@ -58,6 +58,6 @@ export default class UserInfo extends Vue { } public sendMessage(name:string) { - Factory.Get(MessageService).publishToChannel(name); + messageService.publishToChannel(name); } } diff --git a/Step/wwwroot/src/app_modules/machine/components/user-info.vue b/Step/wwwroot/src/app_modules/machine/components/user-info.vue index 5e50dfd1..eb3da213 100644 --- a/Step/wwwroot/src/app_modules/machine/components/user-info.vue +++ b/Step/wwwroot/src/app_modules/machine/components/user-info.vue @@ -5,6 +5,10 @@ --> +
+ :style="{ + top: `${topShift}px`, + left: `${leftShift}px`, + }">
@@ -76,29 +77,56 @@ textAlign: item.label.textAlign, backgroundColor: item.label.backgroundColor, color: item.label.textColor, - fontSize: `${item.label.textSize}px` + fontSize: `${item.label.textSize}px`, + display: 'flex', + alignItems: 'center' }" >{{item.label.textContent}}
- +
- + + + +
+ +
+
diff --git a/Step/wwwroot/src/app_modules/tooling/components/depot-action-transfer.ts b/Step/wwwroot/src/app_modules/tooling/components/depot-action-transfer.ts index 98d8dc84..ea8b49ec 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/depot-action-transfer.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/depot-action-transfer.ts @@ -10,7 +10,6 @@ export default class DepotActionTransfer extends Vue { magazineStatusModel() { - debugger return this.$store.state.depot.magazineStatusModel; } translateId(id, ismultitool) { diff --git a/Step/wwwroot/src/app_modules/tooling/components/info-equipment.ts b/Step/wwwroot/src/app_modules/tooling/components/info-equipment.ts index afb4bb75..dbc1dafc 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/info-equipment.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/info-equipment.ts @@ -5,7 +5,7 @@ import { Watch, Prop } from "vue-property-decorator"; import { store, AppModel } from "src/store"; import { DepotService, ToolingService } from 'src/services'; -import { Factory, MessageService } from 'src/_base'; +import { Factory, messageService } from 'src/_base'; import { Modal, ModalHelper } from "src/components/modals"; @Component({ @@ -25,7 +25,6 @@ export default class InfoEquipment extends Vue { enableModalTool = ModalHelper.infoEquipmentModal.enableModalTool; editEnabled = ModalHelper.infoEquipmentModal.editEnabled; - get shankConfiguration() { return this.$store.state.tooling.shankConfiguration; } @@ -91,7 +90,7 @@ export default class InfoEquipment extends Vue { } } close() { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); ModalHelper.HideModal(); } selectTab(elem) { diff --git a/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts b/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts index 2cd4be56..0944461f 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts @@ -1,7 +1,7 @@ import { ModalHelper, Modal } from "src/components/modals" import { DepotService } from 'src/services/depotService'; -import { Factory, MessageService } from 'src/_base'; +import { Factory, messageService } from 'src/_base'; import { inputBox } from "src/modules/base-components/cards"; import { store, AppModel } from "src/store"; import { ToolingGetters,toolingActions } from "src/store/tooling.store"; @@ -48,7 +48,7 @@ export default { }, methods: { close() { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); ModalHelper.HideModal(); }, isSiemens: function () { @@ -63,7 +63,7 @@ export default { if(this.isSiemens()){ new DepotService().AddToolToDepot(this.magazineId, this.positionId, { toolId: this.toolSelected.id }).then(response => { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); toolingActions.updateBusyStatusPositions(store,this.magInfo.type,(this.$store.state as AppModel).depot.depot); ModalHelper.HideModal(); }); @@ -71,7 +71,7 @@ export default { else{ if (this.action == "LOAD") { new DepotService().AddToolToDepotNc(this.magazineId, this.positionId, { shankId: this.toolSelected.id }).then(response => { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); toolingActions.updateBusyStatusPositions(store,this.magInfo.type,(this.$store.state as AppModel).depot.depotNc); ModalHelper.HideModal(); }) @@ -82,7 +82,7 @@ export default { act = 1; new DepotService().StartAssistedToolingProcedure(this.toolSelected.id, this.magazineId, this.positionId, act).then(response => { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); toolingActions.updateBusyStatusPositions(store, this.magInfo.type, (this.$store.state as AppModel).depot.depotNc); ModalHelper.HideModal(); }) diff --git a/Step/wwwroot/src/app_modules/tooling/components/self-adaptive-path-dialog.ts b/Step/wwwroot/src/app_modules/tooling/components/self-adaptive-path-dialog.ts index 9fc22367..4d46f23c 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/self-adaptive-path-dialog.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/self-adaptive-path-dialog.ts @@ -1,6 +1,6 @@ import Vue from "vue"; import { Modal, ModalHelper } from "src/components/modals"; -import { Factory, MessageService } from "src/_base"; +import { Factory, messageService } from "src/_base"; import moment from "moment"; import Component from "vue-class-component"; import { ToolingService } from "src/services/toolingService"; @@ -27,7 +27,7 @@ export default class SelfAdaptivePathDialog extends Vue { })); - Factory.Get(MessageService).subscribeToChannel("esc_pressed", args => { + messageService.subscribeToChannel("esc_pressed", args => { this.close(); }); @@ -53,11 +53,11 @@ export default class SelfAdaptivePathDialog extends Vue { } beforeDestroy() { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); } close() { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); ModalHelper.HideModal(); } @@ -66,7 +66,7 @@ export default class SelfAdaptivePathDialog extends Vue { let stepModel:any = {step: this.stepValue}; awaiter(new ToolingService().SetSelfAdaptivePathStep(stepModel).then(response => { - Factory.Get(MessageService).deleteChannel("esc_pressed"); + messageService.deleteChannel("esc_pressed"); ModalHelper.HideModal(); })); diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts index 3b6f23e7..20b7a868 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts @@ -10,7 +10,7 @@ import { depotBL } from "src/business-logic/depot-bl"; import { ToolingService } from "src/services/toolingService"; import { ToolingGetters,toolingActions } from "src/store/tooling.store"; import LoadDepot from "./load-depot.vue"; -import { MessageService, Factory, awaiter } from "src/_base"; +import { messageService, Factory, awaiter } from "src/_base"; import { Container, Draggable } from "vue-smooth-dnd"; @@ -31,7 +31,8 @@ export default class depot extends Vue { public isSiemens = (store.state as AppModel).machineInfo.isSiemens; - + public get ncTools(): server.ToolNc[] { return (this.$store.state as AppModel).tooling.ncTools; } + public calcItemName(shank): any { if (!shank.childsTools) @@ -199,8 +200,8 @@ export default class depot extends Vue { public get availableTools(): server.Tools[] { return (this.$store.state as AppModel).depot.availableTool; } public get ncAvailableTools(): server.ToolNc[] { return (this.$store.state as AppModel).depot.ncAvailableTool; } public get ncAvailableShank(): server.AvailableShankNc[] { return (this.$store.state as AppModel).depot.ncAvailableShank; } - - public magazines: server.MagazineModel[] = (this.$store.state as AppModel).tooling.magazines; + public get magazines(): server.MagazineModel[] { return (this.$store.state as AppModel).tooling.magazines;} + public enableModify: any = false; public magazineType: any = 0; public assistedToolingIsActive : boolean = false @@ -219,6 +220,7 @@ export default class depot extends Vue { public typeNc: string = "Osai"; public toolMountedInSpindle = null + public needReload = false @Watch("searchText") public applyFilter(n) { @@ -228,9 +230,22 @@ export default class depot extends Vue { @Watch("magazineStatusModel") - public modalBlockMagazine() { + public async modalBlockMagazine() { if (this.magazineStatusModel.action == 1) { ModalHelper.HideModal("modal-internal"); + + // Load data only if needed + if(this.needReload) { + this.onLoading = true; + await awaiter(this.loadData()); + if(this.isSiemens) + toolingActions.updateBusyStatusPositions(store,this.magazineType,this.depot); + else + toolingActions.updateBusyStatusPositions(store,this.magazineType,this.depotNc); + + this.onLoading = false; + this.needReload = false + } } else if (this.magazineStatusModel.action == 0) { ModalHelper.ShowModal(DepotActionGeneric, "modal-internal"); @@ -250,6 +265,10 @@ export default class depot extends Vue { else if (this.magazineStatusModel.action == 7) { ModalHelper.ShowModal(DepotActionStartNeeded, "modal-internal") } + + // If one action occurred, i need to reload data when action return to 1 + if(this.magazineStatusModel.action != 1 && (this.magazineStatusModel.action != 0 || (this.magazineStatusModel.action == 0 && !this.enableModify))) + this.needReload = true } // Ottengo il tool alla posizione corrente @@ -315,6 +334,11 @@ export default class depot extends Vue { this.onLoading = false; this.setAssistedTooling() + + + messageService.subscribeToChannel("force-ui-update", args => { + this.setAssistedTooling() + }); } private setAssistedTooling(){ @@ -327,24 +351,26 @@ export default class depot extends Vue { } async loadData() { + let ds = new DepotService(); + let ts = new ToolingService(); if (this.isSiemens) { return Promise.all([ - new DepotService().GetMagazine(this.$route.params.id), - new DepotService().GetToolAvailable(), - new ToolingService().GetMagazinePositionDepot(this.$route.params.id), - new ToolingService().GetTools(), - new ToolingService().GetShanks() + ds.GetMagazine(this.$route.params.id), + ds.GetToolAvailable(), + ts.GetMagazinePositionDepot(this.$route.params.id), + ts.GetTools(), + ts.GetShanks() ]); } else { return Promise.all([ - new DepotService().GetNcMagazine(this.$route.params.id), - new DepotService().GetNcToolAvailable(), - new DepotService().GetNcShankAvailable(), - new ToolingService().GetNcMagazinePositionDepot(this.$route.params.id), - new ToolingService().GetNcTools(), - new ToolingService().GetNcShanks(), - new ToolingService().GetNcFamilies() + ds.GetNcMagazine(this.$route.params.id), + ds.GetNcToolAvailable(), + ds.GetNcShankAvailable(), + ts.GetNcMagazinePositionDepot(this.$route.params.id), + ts.GetNcTools(), + ts.GetNcShanks(), + ts.GetNcFamilies() ]); } @@ -533,12 +559,11 @@ export default class depot extends Vue { if (shank.childsTools.length == 1) { ModalHelper.infoEquipmentModal.enableModalShank = false; ModalHelper.infoEquipmentModal.enableModalTool = true; - ModalHelper.infoEquipmentModal.currentEquipment = shank.childsTools[0]; + ModalHelper.infoEquipmentModal.currentEquipment = this.ncTools.find(x => x.id == shank.childsTools[0].id); ModalHelper.infoEquipmentModal.editEnabled = !this.editable; ModalHelper.ShowModal(InfoEquipment); } else { - let shank = (this.$store.state as AppModel).tooling.ncShanks.find(s => s.id == id); ModalHelper.infoEquipmentModal.enableModalShank = true; ModalHelper.infoEquipmentModal.enableModalTool = false; ModalHelper.infoEquipmentModal.currentShank = shank; diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts index 97041e89..d8d5e751 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts @@ -737,8 +737,10 @@ public isEquipmentSelected(offset){ })); } else{ - this.modifyOffsetInTool(tool, model); await awaiter(new ToolingService().UpdateNcEdgeData(tool, model).then(response => { + for(var k in model) model[k] = response[k] + this.modifyOffsetInTool(tool, model); + this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration; this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration; this.disableList = false; diff --git a/Step/wwwroot/src/app_modules/under-the-hood/components/auto-menu.vue b/Step/wwwroot/src/app_modules/under-the-hood/components/auto-menu.vue index 8e8bfffd..92641c93 100644 --- a/Step/wwwroot/src/app_modules/under-the-hood/components/auto-menu.vue +++ b/Step/wwwroot/src/app_modules/under-the-hood/components/auto-menu.vue @@ -9,7 +9,8 @@ - + + + diff --git a/Step/wwwroot/src/components/doughnut-chart/index.js b/Step/wwwroot/src/components/doughnut-chart/index.js index 5befbd2a..559c66cc 100644 --- a/Step/wwwroot/src/components/doughnut-chart/index.js +++ b/Step/wwwroot/src/components/doughnut-chart/index.js @@ -1,5 +1,7 @@ import DoughnutChart from "./doughnut-chart.vue"; +import DoughnutChartAnimated from "./doughnut-chart-animated.vue"; export { - DoughnutChart + DoughnutChart, + DoughnutChartAnimated } \ No newline at end of file diff --git a/Step/wwwroot/src/components/modals/ModalHelper.ts b/Step/wwwroot/src/components/modals/ModalHelper.ts index 29240644..bcb1b7eb 100644 --- a/Step/wwwroot/src/components/modals/ModalHelper.ts +++ b/Step/wwwroot/src/components/modals/ModalHelper.ts @@ -1,5 +1,5 @@ -import { Factory, MessageService } from "src/_base"; +import { Factory, messageService } from "src/_base"; import ConfirmModal from "./modal-confirm.vue"; import { Deferred } from "src/services/Deferred"; import { M155Questions } from "src/app_modules/machine"; @@ -72,7 +72,7 @@ export class ModalHelper { }; public static ShowNcModal(view) { - Factory.Get(MessageService).publishToChannel("show-modal-nc", view); + messageService.publishToChannel("show-modal-nc", view); } public static ShowNextM155Modal() { @@ -84,10 +84,10 @@ export class ModalHelper { } } if(ModalHelper.M155ModalData.data){ - Factory.Get(MessageService).publishToChannel("show-modal-nc", M155Questions); + messageService.publishToChannel("show-modal-nc", M155Questions); } else{ - Factory.Get(MessageService).publishToChannel("hide-modal-nc", M155Questions); + messageService.publishToChannel("hide-modal-nc", M155Questions); } } @@ -101,13 +101,13 @@ export class ModalHelper { let find = processStore.state.m155messages.find(X => X.process== proc) if(find){ ModalHelper.M155ModalData.data = find; - Factory.Get(MessageService).publishToChannel("show-modal-nc", M155Questions); + messageService.publishToChannel("show-modal-nc", M155Questions); } } } public static HideNcModal(view) { - Factory.Get(MessageService).publishToChannel("hide-modal-nc", view); + messageService.publishToChannel("hide-modal-nc", view); } public static ShowMaintenancePassword(view, maintenance, onConfirm: Function){ @@ -120,17 +120,23 @@ export class ModalHelper { public static ShowModal(view, modalname: string = "modal", showHeader: boolean = false) { if (modalname == null) modalname = "modal"; - Factory.Get(MessageService).publishToChannel("show-" + modalname, view, null, null, showHeader); + messageService.publishToChannel("show-" + modalname, view, null, null, showHeader); + } + + public static ShowModalLogin(view, modalname: string = "modal-login", showHeader: boolean = false) { + if (modalname == null) + modalname = "modal-login"; + messageService.publishToChannel("show-" + modalname, view, null, null, showHeader); } public static ShowModalAsync(view, model = null, modalname: string = "modal"): Promise { let deferred = new Deferred(); - Factory.Get(MessageService).publishToChannel("show-" + modalname, view, deferred, model); + messageService.publishToChannel("show-" + modalname, view, deferred, model); return deferred.promise; } public static HideModal(modalname: string = "modal") { - Factory.Get(MessageService).publishToChannel("hide-" + modalname); + messageService.publishToChannel("hide-" + modalname); } public static AskConfirm(title: string, body: string, onConfirm: Function, onCancel: Function, modalcontainer: string = "modal-internal") { diff --git a/Step/wwwroot/src/components/timeline-chart/timeline-chart-header.ts b/Step/wwwroot/src/components/timeline-chart/timeline-chart-header.ts index 32041086..f3d669cd 100644 --- a/Step/wwwroot/src/components/timeline-chart/timeline-chart-header.ts +++ b/Step/wwwroot/src/components/timeline-chart/timeline-chart-header.ts @@ -84,7 +84,6 @@ export default class TimeLineChartRow extends Vue { let diffDays = this.diffDays; let diffHours = this.diffHours; - debugger; if (diffDays <= 1) { step = this.oneHour; let check = Math.ceil(diffHours / this.interval); diff --git a/Step/wwwroot/src/main.js b/Step/wwwroot/src/main.js index 700580fe..885b3aa6 100644 --- a/Step/wwwroot/src/main.js +++ b/Step/wwwroot/src/main.js @@ -17,7 +17,7 @@ import { routes } from "./app.routes"; try{ - debugger + //debugger if(PRODUCTION){ Vue.config.devtools = false; // disabilita i messaggi di debug Vue.config.performance = false; // disabilita i messaggi di tracing delle performance diff --git a/Step/wwwroot/src/modules/app-footer.ts b/Step/wwwroot/src/modules/app-footer.ts index 3dab507b..a7d19f87 100644 --- a/Step/wwwroot/src/modules/app-footer.ts +++ b/Step/wwwroot/src/modules/app-footer.ts @@ -1,7 +1,7 @@ import Vue from "vue"; import Component from "vue-class-component"; import { appModelActions, store, machineStatusActions } from "src/store"; -import { Factory, MessageService } from "src/_base"; +import { Factory, messageService } from "src/_base"; declare let cmsClient: any; @@ -14,7 +14,7 @@ export default class AppFooter extends Vue { get state() { return this.$store.state; } mounted(){ - Factory.Get(MessageService).subscribeToChannel("force-ui-update", args => { + messageService.subscribeToChannel("force-ui-update", args => { this.$forceUpdate(); }); } diff --git a/Step/wwwroot/src/modules/app-header.ts b/Step/wwwroot/src/modules/app-header.ts index 7ec1b9c3..d9f34603 100644 --- a/Step/wwwroot/src/modules/app-header.ts +++ b/Step/wwwroot/src/modules/app-header.ts @@ -2,7 +2,7 @@ import Vue from "vue"; import Component from "vue-class-component"; import { ProcessInfo } from "./base-components"; import { AppModel, buttonStatus } from "src/store"; -import { Factory, MessageService } from "src/_base"; +import { Factory, messageService } from "src/_base"; import { Hub } from "src/services/hub"; import { Watch } from "vue-property-decorator"; import AppRibbon from "src/components/app-ribbon.vue"; @@ -20,7 +20,7 @@ export default class AppHeader extends Vue { public get powerOnStatus() { return this.$store.getters.powerOnAlarms; }; mounted() { - Factory.Get(MessageService).subscribeToChannel("force-ui-update", args => { + messageService.subscribeToChannel("force-ui-update", args => { this.$forceUpdate(); }); $('.process-container').mousewheel(function (e, delta) { @@ -86,7 +86,7 @@ export default class AppHeader extends Vue { } public sendMessage(name: string) { - Factory.Get(MessageService).publishToChannel(name); + messageService.publishToChannel(name); } public manageClick(btn: buttonStatus) { diff --git a/Step/wwwroot/src/modules/axes-softkeys.vue b/Step/wwwroot/src/modules/axes-softkeys.vue index 731b078f..254e8975 100644 --- a/Step/wwwroot/src/modules/axes-softkeys.vue +++ b/Step/wwwroot/src/modules/axes-softkeys.vue @@ -5,7 +5,6 @@ @@ -20,11 +19,10 @@ export default { computed: { axes: function() { - - return this.$store.state.process.axes; + return this.$store.state.process.axes.filter(ax => ax.isSelectable); }, emptySpaces: function() { - let num = this.$store.state.process.axes.length; + let num = this.axes.length; if(num >= this.maxNumVisible) return 0; else diff --git a/Step/wwwroot/src/modules/base-components/cards/softkeys-prefered.vue b/Step/wwwroot/src/modules/base-components/cards/softkeys-prefered.vue index 4f91492f..ffc76c4e 100644 --- a/Step/wwwroot/src/modules/base-components/cards/softkeys-prefered.vue +++ b/Step/wwwroot/src/modules/base-components/cards/softkeys-prefered.vue @@ -39,7 +39,7 @@