diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index b042ff73..4b636e10 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.NC/NcFileHandler.cs b/Step.NC/NcFileHandler.cs index 8768ea13..8d55fdfa 100644 --- a/Step.NC/NcFileHandler.cs +++ b/Step.NC/NcFileHandler.cs @@ -503,5 +503,10 @@ namespace Step.NC return numericalControl.FILES_WStopQueue(); } + public CmsError CleanUploadFolder() + { + return numericalControl.FILES_WCleanUploadFolder(); + } + } } diff --git a/Step/Controllers/WebApi/NcFileController.cs b/Step/Controllers/WebApi/NcFileController.cs index 36711f18..468eb57b 100644 --- a/Step/Controllers/WebApi/NcFileController.cs +++ b/Step/Controllers/WebApi/NcFileController.cs @@ -1,11 +1,10 @@ using CMS_CORE_Library.Models; using Step.Model.DTOModels; using Step.NC; -using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net; +using System.Net; using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; @@ -102,40 +101,43 @@ namespace Step.Controllers.WebApi } List formItems = await MultipartHandler.ManageMultiPartFileAsync(Request); - - foreach (FormItem item in formItems) + using (NcFileHandler ncFileHandler = new NcFileHandler()) { - if (item.IsAFile) + ncFileHandler.Connect(); + + if(NcConfig.NcVendor == NC_VENDOR.OSAI) { - if (item.ParameterName == "main") + // Clean upload folder only OSAI + CmsError cmsError = ncFileHandler.CleanUploadFolder(); + if (cmsError.IsError() && cmsError.errorCode != CMS_ERROR_CODES.FILE_NOT_FOUND) + return BadRequest(cmsError.localizationKey); + } + + foreach (FormItem item in formItems) + { + if (item.IsAFile) { - using (NcFileHandler ncHandler = new NcFileHandler()) + if (item.ParameterName == "main") { - ncHandler.Connect(); - File.WriteAllBytes(TEMP_PP_FOLDER + item.FileName, item.Data); - - CmsError cmsError = ncHandler.UploadPartProgramAndActivate(TEMP_PP_FOLDER, item.FileName, out ActiveProgramDataModel programData); + // Upload main program + CmsError cmsError = ncFileHandler.UploadPartProgramAndActivate(TEMP_PP_FOLDER, item.FileName, out ActiveProgramDataModel programData); if (cmsError.IsError()) return BadRequest(cmsError.localizationKey); } - } - else if (item.ParameterName == "file") - { - using (NcFileHandler ncHandler = new NcFileHandler()) + else if (item.ParameterName == "file") { - ncHandler.Connect(); - File.WriteAllBytes(TEMP_PP_FOLDER + item.FileName, item.Data); - - CmsError cmsError = ncHandler.UploadPartProgram(TEMP_PP_FOLDER, item.FileName, out string programPath); + // Upload files + CmsError cmsError = ncFileHandler.UploadPartProgram(TEMP_PP_FOLDER, item.FileName, out string programPath); if (cmsError.IsError()) return BadRequest(cmsError.localizationKey); } - } - else if (item.ParameterName == "image") - { - File.WriteAllBytes(PART_PRG_IMAGES + item.FileName, item.Data); + else if (item.ParameterName == "image") + { + // Upload image + File.WriteAllBytes(PART_PRG_IMAGES + item.FileName, item.Data); + } } } } diff --git a/Step/SetupActive.iss b/Step/SetupActive.iss index 2e819a92..5865e9bd 100644 --- a/Step/SetupActive.iss +++ b/Step/SetupActive.iss @@ -128,6 +128,9 @@ Source: "{#WwwRootPath}\libs\*"; DestDir: "{app}\view\libs\"; Flags: recursesubd 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 +; SCM Icon +Source: {#IconsPath}{#SCMIcoName}; DestDir: "{app}"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens; Check: GetStyleOption; + ;.Net Installer Source: {#DotNetInstallerPath}\{#DotNetInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall; ;Check: FrameworkIsNotInstalled @@ -141,22 +144,22 @@ Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filenam Name: {userstartup}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupicon; Comment: {#AppName}; Components: Demo Fanuc Osai; Check: NOT GetStyleOption; ; Siemens startup icon with parameters "-start ..." -Name: {group}\{#SCMAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Comment: {#AppName}; Components: Siemens; Check: NOT GetStyleOption; -Name: {userdesktop}\{#SCMAppName}; 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\{#SCMAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon; Comment: {#AppName}; Components: Siemens; Check: NOT GetStyleOption; +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: {#IconsPath}{#SCMIcoName}; Comment: {#SCMAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; -Name: {userdesktop}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {#IconsPath}{#SCMIcoName}; Tasks: desktopicon; Comment: {#SCMAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; -Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {#IconsPath}{#SCMIcoName}; Tasks: quicklaunchicon; Comment: {#SCMAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; -Name: {userstartup}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {#IconsPath}{#SCMIcoName}; Tasks: startupicon; Comment: {#SCMAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; +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; ; SCM Siemens startup icon with parameters "-start ..." -Name: {group}\{#SCMAppName}; Filename: {#IconsPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {#IconsPath}{#SCMIcoName}; Comment: {#SCMAppName}; Components: Siemens; Check: GetStyleOption; -Name: {userdesktop}\{#SCMAppName}; Filename: {#IconsPath}{#SCMIcoName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {#IconsPath}{#SCMIcoName}; Tasks: desktopicon; Comment: {#SCMAppName}; Components: Siemens; Check: GetStyleOption; -Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#SCMAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {#IconsPath}{#SCMIcoName};Tasks: quicklaunchicon; Comment: {#SCMAppName}; Components: Siemens; Check: GetStyleOption; +Name: {group}\{#SCMAppName}; Filename: {#IconsPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Comment: {#SCMAppName}; Components: Siemens; Check: GetStyleOption; +Name: {userdesktop}\{#SCMAppName}; Filename: {#IconsPath}{#SCMIcoName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: desktopicon; Comment: {#SCMAppName}; Components: Siemens; Check: GetStyleOption; +Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#SCMAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName};Tasks: quicklaunchicon; Comment: {#SCMAppName}; Components: Siemens; Check: GetStyleOption; [Run] ; Install .net diff --git a/Step/wwwroot/assets/styles/base/card.less b/Step/wwwroot/assets/styles/base/card.less index c247b77a..45ff5c56 100644 --- a/Step/wwwroot/assets/styles/base/card.less +++ b/Step/wwwroot/assets/styles/base/card.less @@ -1511,6 +1511,8 @@ color: @color-greyish-brown; padding-right: 8px; font-size: 20px; + text-align: left; + padding-left: 8px; } } diff --git a/Step/wwwroot/assets/styles/style.css b/Step/wwwroot/assets/styles/style.css index 23388c8c..55b0737a 100644 --- a/Step/wwwroot/assets/styles/style.css +++ b/Step/wwwroot/assets/styles/style.css @@ -8258,6 +8258,8 @@ footer .container button.big:before { color: #4b4b4b; padding-right: 8px; font-size: 20px; + text-align: left; + padding-left: 8px; } .card-job-production .card-job-production-body .card-job-production-body-top .var:nth-child(odd) .elm { background-color: #f3f3f3; diff --git a/Step/wwwroot/src/store/machineStatus.store.ts b/Step/wwwroot/src/store/machineStatus.store.ts index d5d544ad..002ce968 100644 --- a/Step/wwwroot/src/store/machineStatus.store.ts +++ b/Step/wwwroot/src/store/machineStatus.store.ts @@ -163,9 +163,9 @@ export const machineStatusStore = { store.functions = Array.from(store._functions.values()); Factory.Get(MessageService).publishToChannel("force-ui-update"); }, - UpdateSecurityFunction(store, func: signalr_security.securityFunction) { - if (!store._functions.has(func.id) || store._functions.get(func.name).Enabled != func.enabled) { - store._functions.get(func.name).Enabled = func.enabled; + UpdateSecurityFunction(store, func: signalr_security.securityFunction) { + if (!store._functions.has(func.id) || store._functions.get(func.name).enabled != func.enabled) { + store._functions.get(func.name).enabled = func.enabled; store.functions = Array.from(store._functions.values()); Factory.Get(MessageService).publishToChannel("force-ui-update"); } @@ -247,7 +247,8 @@ export const machineStatusStore = { if (config && config.name && config.name == areaname) { // console.debug("IsArea Enabled:", config, areaname, "In browser: ", inBrowser, "NC ready: ", context.state.machineStatus.ncReady); - if (!context.state.machineStatus.ncReady && config.ncNeeded) return false; + if (!context.state.machineStatus.ncReady && config.ncNeeded) + return false; if (inBrowser) return config.allowExternalBrowser && config.enabled; return config.enabled; @@ -265,7 +266,7 @@ export const machineStatusStore = { for (const key in machconfig) { if(machconfig.hasOwnProperty(key)){ - if(machconfig[key].name == areaname+"Area"){ + if(machconfig[key].name == areaname + "Area"){ areaUserEnabled = machconfig[key].canWrite; break; }