diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index c9fb1a3f..171010e5 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Config/Config/serverConfig.xml b/Step.Config/Config/serverConfig.xml index 4bbb0610..5e174ed6 100644 --- a/Step.Config/Config/serverConfig.xml +++ b/Step.Config/Config/serverConfig.xml @@ -1,7 +1,7 @@ - DEMO + SIEMENS false localhost 8080 diff --git a/Step.Core/ThreadsFunctions.cs b/Step.Core/ThreadsFunctions.cs index b0ec927f..9d934a58 100644 --- a/Step.Core/ThreadsFunctions.cs +++ b/Step.Core/ThreadsFunctions.cs @@ -843,7 +843,7 @@ public static class ThreadsFunctions break; case CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING: - Manage(ERROR_LEVEL.WARNING, cmsError.localizationKey); + Manage(ERROR_LEVEL.FATAL, cmsError.localizationKey); RestoreConnection(); // If not connected try reconnection break; } diff --git a/Step.Core/ThreadsSiemensHmi.cs b/Step.Core/ThreadsSiemensHmi.cs index 81a8c471..c04db148 100644 --- a/Step.Core/ThreadsSiemensHmi.cs +++ b/Step.Core/ThreadsSiemensHmi.cs @@ -123,7 +123,7 @@ namespace Step.Core return 0; } - public static void StopWindow() + public static void StopThread() { if (SiemensHmi!= null && SiemensHmi.IsAlive) SiemensHmi.Abort(); @@ -132,7 +132,7 @@ namespace Step.Core private static void CheckRunningHmi() { Process[] processes; - Boolean isRunning = true; + bool isRunning = true; while (isRunning) { processes = Process.GetProcessesByName(ProcessName); diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index a813b9d5..c5123ac6 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -15,7 +15,6 @@ using Step.Utils; using System; using System.Collections.Generic; using System.Data.Entity; -using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; @@ -31,8 +30,8 @@ namespace Step.NC public Nc numericalControl; public NcHandler() => - // Choose NC - numericalControl = SetNumericalControl(); + // Choose NC + numericalControl = SetNumericalControl(); public void Dispose() { @@ -86,9 +85,9 @@ namespace Step.NC { fileInfo = new InfoFile(); CmsError cmsError = NO_ERROR; - - if(FileExistWithNc(path)) - cmsError = LocalPartProgramFileInfo(path, out fileInfo); + + if (FileExistWithNc(path)) + cmsError = LocalPartProgramFileInfo(path, out fileInfo); else cmsError = numericalControl.FILES_RGetFileInfo(path, ref fileInfo); @@ -111,7 +110,6 @@ namespace Step.NC } } - public CmsError GetActiveFileInfo(string path, out DTOActiveImageAndNameDataModel fileInfo) { fileInfo = new DTOActiveImageAndNameDataModel(); @@ -163,7 +161,7 @@ namespace Step.NC } return NO_ERROR; - } + } public CmsError LocalPartProgramFileInfo(string path, out InfoFile fileInfo) { @@ -268,7 +266,7 @@ namespace Step.NC }; return cmsError; - } + } public CmsError UploadPartProgram(string localPath, string fileName, out string newFilePath) { @@ -661,7 +659,7 @@ namespace Step.NC return cmsError; } - #endregion + #endregion Axes public CmsError ManageWatchdog() { @@ -814,7 +812,7 @@ namespace Step.NC return cmsError; } - + public CmsError GetPowerOnData(out DTOPowerOnDataModel resultPowerOnData) { resultPowerOnData = new DTOPowerOnDataModel(); @@ -1353,7 +1351,7 @@ namespace Step.NC return cmsError; } - + public CmsError GetM155Data(out List data) { data = new List(); @@ -1455,7 +1453,7 @@ namespace Step.NC #endregion Write data #region Siemens Tools - + public CmsError GetToolTableConfiguration(out ToolTableConfiguration config) { config = new ToolTableConfiguration(); @@ -1676,6 +1674,7 @@ namespace Step.NC #endregion Siemens Tools // OSAI FANUC + #region Osai/Fanuc Tools public CmsError GetToolsData(out List dtoTools) @@ -2162,16 +2161,13 @@ namespace Step.NC public CmsError SetupNcToolManager() { - if (NcConfig.NcVendor != NC_VENDOR.SIEMENS) - { - CmsError cmsError = UpdateMagazinePositionConf(); - if (cmsError.IsError()) - return cmsError; + CmsError cmsError = UpdateMagazinePositionConf(); + if (cmsError.IsError()) + return cmsError; - cmsError = WriteOption(); - if (cmsError.IsError()) - return cmsError; - } + cmsError = WriteOption(); + if (cmsError.IsError()) + return cmsError; return NO_ERROR; } @@ -2277,7 +2273,7 @@ namespace Step.NC .ToList(); // Update tools - cmsError = numericalControl.TOOLS_WUpdateTools(tools); + cmsError = numericalControl.TOOLS_WUpdateTools(tools); if (cmsError.IsError()) return cmsError; diff --git a/Step.UI/Step.UI.csproj b/Step.UI/Step.UI.csproj index ddc757dc..3be98fb7 100644 --- a/Step.UI/Step.UI.csproj +++ b/Step.UI/Step.UI.csproj @@ -75,6 +75,12 @@ ServerControlWindow.cs + + UserControl + + + OpeningLayer.cs + @@ -88,6 +94,9 @@ ServerControlWindow.cs + + OpeningLayer.cs + diff --git a/Step.UI/Views/OpeningLayer.Designer.cs b/Step.UI/Views/OpeningLayer.Designer.cs new file mode 100644 index 00000000..48655ead --- /dev/null +++ b/Step.UI/Views/OpeningLayer.Designer.cs @@ -0,0 +1,74 @@ +namespace Step.UI.Views +{ + partial class OpeningLayer + { + /// + /// Variabile di progettazione necessaria. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Pulire le risorse in uso. + /// + /// ha valore true se le risorse gestite devono essere eliminate, false in caso contrario. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Codice generato da Progettazione componenti + + /// + /// Metodo necessario per il supporto della finestra di progettazione. Non modificare + /// il contenuto del metodo con l'editor di codice. + /// + private void InitializeComponent() + { + this.metroProgressSpinner = new MetroFramework.Controls.MetroProgressSpinner(); + this.statusLabel = new MetroFramework.Controls.MetroLabel(); + this.SuspendLayout(); + // + // metroProgressSpinner + // + this.metroProgressSpinner.Location = new System.Drawing.Point(120, 224); + this.metroProgressSpinner.Maximum = 100; + this.metroProgressSpinner.Name = "metroProgressSpinner"; + this.metroProgressSpinner.Size = new System.Drawing.Size(110, 110); + this.metroProgressSpinner.TabIndex = 0; + this.metroProgressSpinner.UseSelectable = true; + // + // statusLabel + // + this.statusLabel.AutoSize = true; + this.statusLabel.Location = new System.Drawing.Point(132, 362); + this.statusLabel.Name = "statusLabel"; + this.statusLabel.Size = new System.Drawing.Size(83, 19); + this.statusLabel.TabIndex = 1; + this.statusLabel.Text = "metroLabel1"; + // + // OpeningLayer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.BackColor = System.Drawing.Color.Black; + this.Controls.Add(this.statusLabel); + this.Controls.Add(this.metroProgressSpinner); + this.Name = "OpeningLayer"; + this.Size = new System.Drawing.Size(350, 565); + this.Load += new System.EventHandler(this.OpeningLayer_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private MetroFramework.Controls.MetroProgressSpinner metroProgressSpinner; + private MetroFramework.Controls.MetroLabel statusLabel; + } +} diff --git a/Step.UI/Views/OpeningLayer.cs b/Step.UI/Views/OpeningLayer.cs new file mode 100644 index 00000000..e854901e --- /dev/null +++ b/Step.UI/Views/OpeningLayer.cs @@ -0,0 +1,29 @@ +using System; +using System.Windows.Forms; +using System.Threading; + +namespace Step.UI.Views +{ + public partial class OpeningLayer : UserControl + { + public OpeningLayer() + { + InitializeComponent(); + } + + private void OpeningLayer_Load(object sender, EventArgs e) + { + statusLabel.Text = ""; + Thread th = new Thread(() => + { + for (int i = 0; i <= 100; i++) + { + metroProgressSpinner.Value = i; + + if (i == 100) + i = 0; + } + }); + } + } +} diff --git a/Step.UI/Views/OpeningLayer.resx b/Step.UI/Views/OpeningLayer.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/Step.UI/Views/OpeningLayer.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Step/App_Start/Startup.cs b/Step/App_Start/Startup.cs index e0c9e94d..52ba6334 100644 --- a/Step/App_Start/Startup.cs +++ b/Step/App_Start/Startup.cs @@ -28,7 +28,7 @@ namespace Step.App_Start public void Configuration(IAppBuilder app) { - if (NcConfig.NcVendor.ToUpper() == NC_VENDOR.SIEMENS) + if (NcConfig.NcVendor.ToUpper() == NC_VENDOR.SIEMENS && NcConfig.ShowNcHMI) ThreadSiemensHmi.InitWindow(); // Configure HTTP diff --git a/Step/Listeners/ListenersHandler.cs b/Step/Listeners/ListenersHandler.cs index 498292b4..336c2757 100644 --- a/Step/Listeners/ListenersHandler.cs +++ b/Step/Listeners/ListenersHandler.cs @@ -104,7 +104,6 @@ namespace Step.Listeners })); } - public static void Stop() { MessageServices.Current.UnSubscribe(infos.ToArray()); diff --git a/Step/program.cs b/Step/program.cs index 9765ae6c..533b3172 100644 --- a/Step/program.cs +++ b/Step/program.cs @@ -50,14 +50,17 @@ namespace Step { StopRequest.Set(); if (NcConfig.NcVendor.ToUpper() == NC_VENDOR.SIEMENS) - ThreadSiemensHmi.StopWindow(); + ThreadSiemensHmi.StopThread(); }); - // Setup Osai/fanuc toolManager - using (NcHandler handler = new NcHandler()) + if(NcConfig.NcVendor.ToUpper() != NC_VENDOR.SIEMENS) { - handler.Connect(); - handler.SetupNcToolManager(); + // Setup Osai/fanuc toolManager + using (NcHandler handler = new NcHandler()) + { + handler.Connect(); + handler.SetupNcToolManager(); + } } // Start server services diff --git a/Step/wwwroot/assets/styles/style.css b/Step/wwwroot/assets/styles/style.css index 895d009e..5b2980d6 100644 --- a/Step/wwwroot/assets/styles/style.css +++ b/Step/wwwroot/assets/styles/style.css @@ -7744,6 +7744,7 @@ footer .container button.big:before { font-size: 5em; color: #000; justify-content: center; + z-index: 100; } .depot-container .depot-box { width: 1808px; 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 283ee534..2214a68b 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts @@ -360,14 +360,16 @@ export default class depot extends Vue { } public toolIsInError(model) { - if (model) { + if (model) { if (this.isSiemens) { - this.toolIsInWarning(model) + return this.toolIsInWarning(model) } else { - this.ncShankgIsInWarning(model); + return this.ncShankgIsInWarning(model); } } + + return false; } public returnChild(elem) {