Compare commits

...

15 Commits

Author SHA1 Message Date
Samuele E. Locatelli 9bbea90d6f Merge remote-tracking branch 'origin/new/ThermoCamManager' into new/ThermoCamManager 2021-03-30 10:27:29 +02:00
Samuele E. Locatelli 53df674ae5 Fix setup x import conf 1.1.192 2021-03-30 10:27:22 +02:00
Samuele E. Locatelli efe5c73ea9 import in 2 step 2021-03-30 08:44:33 +02:00
Samuele E. Locatelli 0d78722593 Start setup fix 2021-03-30 08:29:48 +02:00
Thermo_SIM a1403ed5c1 Merge branch 'NewRecipe' into new/ThermoCamManager 2021-03-29 15:19:53 +02:00
Thermo_SIM 98504569b0 Fix 2021-03-29 15:19:21 +02:00
Thermo_SIM 91791b4aca Fix Setup procedure 2021-03-29 10:52:18 +02:00
Thermo_SIM 30e78e7a65 Merge branch 'develop' into new/ThermoCamManager 2021-03-29 10:09:21 +02:00
Thermo_SIM 3072618f25 First Friday evening commit 2021-03-26 18:37:44 +01:00
Thermo_SIM 2feb30bef6 Fix load Recipe 2021-03-26 18:10:32 +01:00
Thermo_SIM 44415f41ee Merge branch 'edited_asterisk' into develop 2021-03-26 14:53:34 +01:00
Thermo_SIM 1ff528006d Working version 2021-03-26 14:41:26 +01:00
Thermo_SIM bcd65da7cd First commit not working 2021-03-26 09:12:35 +01:00
Thermo_SIM 13cc5f66a3 Fix setup procedure 2021-03-25 13:11:49 +01:00
Thermo_SIM 07d1df9220 Fix sheets 2021-03-25 09:25:00 +01:00
40 changed files with 587 additions and 386 deletions
@@ -29,6 +29,7 @@ namespace Client2020.BrowserTools
private const string THERMO_RECIPE_FOLDER_NAME = @"Recipes";
private const string THERMO_SCREENSHOT_PATH = @"C:\CMS\Screenshots";
private const string CMS_PATH = @"C:\CMS";
private string RUNNING_PATH = AppDomain.CurrentDomain.BaseDirectory;
#region CONSTRUCTOR_METHOD
public BrowserJSObject(Form f)
@@ -339,6 +340,29 @@ namespace Client2020.BrowserTools
return JsonConvert.SerializeObject("");
}
public string createRecipe(String p)
{
if (File.Exists(p))
{
return (JsonConvert.SerializeObject(new ErrorContainer("path_already_exists")));
}
try
{
string path = RUNNING_PATH.Replace("Client_Debug\\x64\\", "").Replace("Client\\x64\\", "") + "Config\\Recipes\\template.tpl";
FileInfo file = new FileInfo(path);
file.CopyTo(p);
}
catch (Exception e)
{
return (JsonConvert.SerializeObject(new ErrorContainer("error_during_file_creation")));
}
return JsonConvert.SerializeObject("");
}
// Read all files in directory
public string getFileList(string p)
@@ -307,7 +307,7 @@
"options_thermoregulator_9_enabled": 0.0,
"options_thermoregulator_9_setpoint": 0.0,
"options_thermoregulator_10_enabled": 0.0,
"options_thermoregulator_10_setpoint": 0.0
"options_thermoregulator_10_setpoint": 0.0,
"extraction_main_drawing_enabled": 0.0
},
"ChannelSetpoints": {
+13
View File
@@ -50,6 +50,7 @@ public static class ThreadsFunctions
public static int recipeRtCounter = 0;
public static bool reconnectionIsRunning = false;
public static bool forcetakeSnapshot = false;
public static bool ReloadAfterLoad = false;
#endregion Public Fields
@@ -1466,6 +1467,13 @@ public static class ThreadsFunctions
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
MessageServices.Current.Subscribe(RECIPE_LOADED, (a, b) =>
{
ReloadAfterLoad = true;
recipeRtCounter = 0;
});
while (true)
{
// ogni n counter leggo anche dati NON RT
@@ -1513,6 +1521,11 @@ public static class ThreadsFunctions
// ora gestisco l'ack della richiesta
libraryError = ncAdapter.doAckSetpointInvalidated();
}
if(ReloadAfterLoad)
{
ReloadAfterLoad = false;
setpointHmiInvalidated = true;
}
// pubblico booleana dei setpointHMI invalidati
MessageServices.Current.Publish(SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED, null, setpointHmiInvalidated);
}
+1
View File
@@ -143,6 +143,7 @@ namespace Thermo.Active.Model
public const string SEND_THERMO_WARMERS_DATA = "SEND_THERMO_WARMERS_DATA";
public const string SEND_THREADS_STATUS = "THREAD_STATUS";
public const string SEND_USER_SOFTKEYS_DATA = "SEND_USER_SOFTKEYS_DATA";
public const string RECIPE_LOADED = "RECIPE_LOADED";
// Names in the xml file
public const string SERVER_CONFIG_KEY = "serverConfig";
+7 -6
View File
@@ -724,7 +724,6 @@ namespace Thermo.Active.NC
// check filePath...
if (File.Exists(RECIPE_TEMPLATE_PATH))
{
answ = true;
// load all text data
var rawData = File.ReadAllText(RECIPE_TEMPLATE_PATH);
@@ -737,18 +736,20 @@ namespace Thermo.Active.NC
// fix Modifica dati
RecipeLiveData.hasChanged = false;
// from template --> reset (if present) overview data...
if (RecipeLiveData.RecipeOverview != null)
/*if (RecipeLiveData.RecipeOverview != null)
{
foreach (var item in RecipeLiveData.RecipeOverview)
{
RecipeLiveData.RecipeOverview[item.Key] = RecipeCatStatus.Unchanged;
}
}
}*/
// update NAME
RecipeLiveData.RecipeName = $"{DateTime.Now:yyyyMMss_HHmmss}.json";
RecipeLiveData.RecipeName = $"NEW_RECIPE_{DateTime.Now:HH_mm_ss}";
answ = true;
}
catch
{ }
catch(Exception e)
{ return answ; }
// update current live data!
SaveRecipeCurrent();
}
+13 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Automatically generated by nicola.carminati: 2021-03-10 -->
<!-- Automatically generated by nicola.carminati: 2021-03-29 -->
<root>
<language_it>Italiano</language_it>
<header_maintainance_request>Effettuare manutenzione</header_maintainance_request>
@@ -432,4 +432,16 @@
<axis_info_brakealm>Allarme test freno:</axis_info_brakealm>
<bitselect_select_none>Nessuno</bitselect_select_none>
<bitselect_select_all>Tutti</bitselect_select_all>
<underthehood_label_recipe>RIcetta</underthehood_label_recipe>
<underthehood_label_numpiece>Lastra</underthehood_label_numpiece>
<underthehood_label_type>Tipo</underthehood_label_type>
<tem_fix>Fissa Temperature</tem_fix>
<warmers_thermoprophet_enabled>Thermoprophet</warmers_thermoprophet_enabled>
<modal_image_thermo>Immagini termocamera</modal_image_thermo>
<thermo-long-tap-info>Tocca a lungo sull&#39;immagine per leggere la temperatura</thermo-long-tap-info>
<last-image>Ultimo scatto</last-image>
<first-image>Primo scatto</first-image>
<new_folder_name>Nome della Cartella:</new_folder_name>
<new_recipe_name>Nome della nuova ricetta:</new_recipe_name>
<recipe_create>Nuova ricetta</recipe_create>
</root>
+14 -2
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Automatically generated by nicola.carminati: 2021-03-10 -->
<!-- Automatically generated by nicola.carminati: 2021-03-29 -->
<root>
<language_it>English</language_it>
<header_maintainance_request>Maintenance request</header_maintainance_request>
@@ -211,7 +211,7 @@
<confirm>Confirm</confirm>
<modal_load_program_lbl_sheet_x>Sheet size X:</modal_load_program_lbl_sheet_x>
<modal_load_program_lbl_sheet_y>Sheet size Y:</modal_load_program_lbl_sheet_y>
<modal_load_program_lbl_sheet_z>Sheet tickness:</modal_load_program_lbl_sheet_z>
<modal_load_program_lbl_sheet_z>Sheet thickness:</modal_load_program_lbl_sheet_z>
<modal_load_program_lbl_notes>Notes:</modal_load_program_lbl_notes>
<modal_confirm_delete_recipe>Do you confirm that you want to delete the recipe?</modal_confirm_delete_recipe>
<modal_load_program_lbl_box_selected_folder>Selected folder:</modal_load_program_lbl_box_selected_folder>
@@ -432,4 +432,16 @@
<axis_info_brakealm>Brake Test Alarm:</axis_info_brakealm>
<bitselect_select_none>None</bitselect_select_none>
<bitselect_select_all>All</bitselect_select_all>
<underthehood_label_recipe>Recipe</underthehood_label_recipe>
<underthehood_label_numpiece>Sheet</underthehood_label_numpiece>
<underthehood_label_type>Type</underthehood_label_type>
<tem_fix>Fix temperatures</tem_fix>
<warmers_thermoprophet_enabled>Thermoprophet</warmers_thermoprophet_enabled>
<modal_image_thermo>Thermocamera Images</modal_image_thermo>
<thermo-long-tap-info>Long tap on image to add temperature inspectors</thermo-long-tap-info>
<last-image>Last Image</last-image>
<first-image>First Image</first-image>
<new_folder_name>Name of the folder:</new_folder_name>
<new_recipe_name>Name of the new recipe:</new_recipe_name>
<recipe_create>New Recipe</recipe_create>
</root>
@@ -7,6 +7,7 @@ using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
@@ -142,7 +143,8 @@ namespace Thermo.Active.Controllers.WebApi
var originalRecipe = NcFileAdapter.LoadRecipe($"{NcAdapter.RecipeLiveData.RecipeDir}{NcAdapter.RecipeLiveData.RecipeName}");
// comparazione parametri...
bool isEqual = false;
ncAdapter.paramsComparer(originalRecipe.RecipeParameters, NcAdapter.RecipeLiveData.RecipeParameters, out isEqual);
if(originalRecipe != null)
ncAdapter.paramsComparer(originalRecipe.RecipeParameters, NcAdapter.RecipeLiveData.RecipeParameters, out isEqual);
// salvo se la ricetta SIA cambiata
NcAdapter.RecipeLiveData.hasChanged = !isEqual;
@@ -325,6 +327,7 @@ namespace Thermo.Active.Controllers.WebApi
notifyHmi();
// Get new data from PLC
/*
libraryError = ncAdapter.ReadWarmers(false, out Dictionary<int, DTOWarmers> currWarmers);
if (libraryError.IsError())
{
@@ -333,6 +336,8 @@ namespace Thermo.Active.Controllers.WebApi
}
// pubblico
MessageServices.Current.Publish(SEND_THERMO_WARMERS_DATA, null, currWarmers);
*/
MessageServices.Current.Publish(RECIPE_LOADED, null);
// ritorno solo fatto!
return Ok();
-305
View File
@@ -1,305 +0,0 @@
;================================= 09-04-2019 =====
; CMS S.p.A. - UX-HMI Office
;
; Setup for Active
; Inno Setup Compiler version 5.6.0
;==================================================
#define AppName "CMS Active"
#define SCMAppName "Maestro Active cnc"
#define FolderName "Active"
#define SCMIcoName "SCM.ico"
#define MyAppVersion "1.5.5"
#define MyAppPublisher "CMS"
#define MyAppURL "https://www.scmgroup.com/it/cms"
#define MyAppExeName "Active.exe"
#define ProjectPath "C:\Users\ext_lmascherone\Documents\cms_step\Step\"
#define MySourcePath "C:\Users\ext_lmascherone\Documents\cms_step\Step\bin"
#define WwwRootPath "C:\Users\ext_lmascherone\Documents\cms_step\Step\wwwroot"
#define IconsPath "C:\Users\ext_lmascherone\Documents\cms_step\Step\Desktop_Link\"
#define InvDialPath "C:\Users\ext_lmascherone\Documents\cms_inverterdiagnosis\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\"
#define SinumerikAppName "Sinumerik HMI"
#define SinumerikAppExeName "run_hmi.exe"
; Support installers
; .Net
#define DotNetInstallerPath "C:\Users\ext_lmascherone\Documents\Per installazioni Active\"
#define DotNetInstallerName "NDP462-KB3151800-x86-x64-AllOS-ENU.exe"
; MariaDb
#define MariaDBInstallerPath "C:\Users\ext_lmascherone\Documents\Per installazioni Active\"
#define MariaDBInstallerName "mariadb-10.3.13-winx64.msi"
[Setup]
AppName={#AppName}
AppVersion={#MyAppVersion}
AppVerName={#AppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DisableDirPage=true
DisableProgramGroupPage=yes
Compression=lzma
SolidCompression=true
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany={#MyAppPublisher}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoCopyright={#MyAppPublisher}
DefaultDirName = C:\CMS\{#FolderName}\{#FolderName}
WindowVisible=false
PrivilegesRequired=admin
; Setup installation type
[Types]
Name: custom; Description: CMS installation; Flags: iscustom
; Set NC types, this types are used to configure server config file
[Components]
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
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
[CustomMessages]
english.CreateStartupIcon=Create Startup &icon
english.CreateSinumerikIcons=Create &Sinumerik HMI icons
english.ForDemoNC=for DEMO NC
english.ForFanucNC=for FANUC NC
english.ForOsaiNC=for OSAI NC
english.ForSiemensNC=for SIEMENS NC
italian.CreateStartupIcon = Crea il collegamento in &Esecuzione Automatica
italian.CreateSinumerikIcons = Crea le icone di &Sinumerik HMI
italian.ForDemoNC=per CN DEMO
italian.ForFanucNC=per CN FANUC
italian.ForOsaiNC=per CN OSAI
italian.ForSiemensNC=per CN SIEMENS
english.InstallDotNet = Install .Net 4.6.2
english.InstallMariaDB = Install MariaDB
italian.InstallDotNet = Installa .Net 4.6.2
italian.InstallMariaDB = Installa MariaDB
italian.InstallingMariaDB = Installando MariaDB
english.InstallingMariaDB = Installing MariaDB
italian.InstallingDotNet = Installando .Net
english.InstallingDotNet = Installing .Net
[Tasks]
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 Siemens
Name: sinumerikicons; Description: {cm:CreateSinumerikIcons}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Siemens
[Files]
Source: "{#MySourcePath}\Thermo.Active.exe"; DestDir: "{app}"; Flags: ignoreversion
; Path to exe resources (dll, xml, config)
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: 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: Fanuc Osai Siemens
; Client copy
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: 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: 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: Fanuc Osai Siemens; Check: GetStyleOption;
;.Net Installer
Source: {#DotNetInstallerPath}\{#DotNetInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
;Check: FrameworkIsNotInstalled
Source: {#MariaDBInstallerPath}\{#MariaDBInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
; --- 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
; Client SCM Style
Source: {#ProjectPath}\SCM_Client_Config.xml; DestDir:"{app}\Client\"; DestName: "Config.xml"; Flags: ignoreversion; Components: Fanuc Osai Siemens; Check: GetStyleOption;
[Icons]
; Default icons
Name: {group}\{#AppName}; Filename: {app}\{#MyAppExeName}; Components: Fanuc Osai; Check: NOT GetStyleOption;
Name: {userdesktop}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon; Components: Fanuc Osai; Check: NOT GetStyleOption;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon; Components: Fanuc Osai; Check: NOT GetStyleOption;
Name: {userstartup}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupicon; 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}"; Components: Siemens; Check: NOT GetStyleOption;
Name: {userdesktop}\{#AppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; 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;
Name: {userstartup}\{#AppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Tasks: startupicon; IconFilename: "{app}\{#MyAppExeName}"; Parameters: -start {app}\{#MyAppExeName}; Components: Siemens; Check: NOT GetStyleOption;
; SCM ICONS
; Default icons
Name: {group}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Components: Fanuc Osai; Check: GetStyleOption;
Name: {userdesktop}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: desktopicon; Components: Fanuc Osai; Check: GetStyleOption;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: quicklaunchicon; Components: Fanuc Osai; Check: GetStyleOption;
Name: {userstartup}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Parameters: -start {app}\{#MyAppExeName}; Tasks: startupicon; 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}; Components: Siemens; Check: GetStyleOption;
Name: {userdesktop}\{#SCMAppName}; Filename: {#IconsPath}{#SCMIcoName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: desktopicon; 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; Components: Siemens; Check: GetStyleOption;
Name: {userstartup}\{#SCMAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: startupicon; Components: Siemens; Check: GetStyleOption;
[Run]
; Install .net
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}"; Check: CheckHeidiSQLNeedInstall;
/// MinVersion: 10
[Registry]
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Active"; ValueData: "C:\CMS\ACTIVE\Active\Active.exe"; Components: Fanuc Osai; MinVersion: 10;
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Active"; ValueData: "C:\Program Files (x86)\Siemens\MotionControl\siemens\sinumerik\hmi\autostart\run_hmi.exe -start C:\CMS\Active\Active\Active.exe"; Components: Siemens; MinVersion: 10;
[Code]
///////////// SiemensPath ///////////////////////////////
var
CheckBoxIni: TCheckBox;
CustomInputOptionCMSorSCM: TInputOptionWizardPage;
IsSCM: Boolean;
OverwriteConfig: Boolean;
function GetStyleOption: Boolean;
begin
Result := IsSCM;
end;
////////////////// GetSiemens Path ///////////////////
function SiemensPath(S: String): string;
var
sSiemensPath: string;
sSelectedSinumerikDir: string;
begin
if DirExists(ExpandConstant('{#SinumerikPath3}')) then
sSiemensPath := ExpandConstant('{#SinumerikPath3}')
else if DirExists(ExpandConstant('{#SinumerikPath2}')) then
sSiemensPath := ExpandConstant('{#SinumerikPath2}')
else if DirExists(ExpandConstant('{#SinumerikPath1}')) then
sSiemensPath := ExpandConstant('{#SinumerikPath1}')
else
begin
if (sSelectedSinumerikDir = '') then
BrowseForFolder('Sinumerik folder not found!'#13#10'Select Sinumerik folder containing run_hmi.exe'#13#10'ex: '+ExpandConstant('{#SinumerikPath1}'), sSelectedSinumerikDir, False);
sSiemensPath := sSelectedSinumerikDir + '\' ;
end;
Result := sSiemensPath ;
end;
///////////////// Check .NET Framework 4.6.2 ////////////////////////////////////
function NetFrameworkNeedInstall(): Boolean;
var
bSuccess: Boolean;
regVersion: Cardinal;
begin
Result := True;
bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', regVersion);
if (True = bSuccess) and (regVersion >= 394802) then begin
Result := False;
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
CustomInputOptionCMSorSCM := CreateInputOptionPage(wpSelectComponents, 'Seleziona lo stile:', '', '', True, False);
//Add Fields
CustomInputOptionCMSorSCM.Add('CMS');
CustomInputOptionCMSorSCM.Add('SCM');
// Set initial values (optional)
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);
begin
if CustomInputOptionCMSorSCM.Values[0]
then IsSCM := false
else
IsSCM := true;
if CurStep = ssPostInstall then
begin
DeleteLocalStorage;
end;
end;
+47 -15
View File
@@ -5,8 +5,8 @@
; Inno Setup Compiler version 5.6.0
;==================================================
#define AppName "CMS Active"
#define FolderName "Thermo.Active"
#define AppName "CMS ThermoActive"
#define FolderName "ThermoActive"
#define MyAppPublisher "CMS"
#define MyAppURL "https://www.scmgroup.com/it/cms"
@@ -26,10 +26,10 @@
; .Net
; MariaDb
; cms_inv_diag
#define DotNetInstallerName "NDP462-KB3151800-x86-x64-AllOS-ENU.exe"
#define MariaDBInstallerName "mariadb-10.3.13-winx64.msi"
#define CmsInvDiagPath "cms_inv_diag"
#define DotNetInstallerName "NDP472-KB4054530-x86-x64-AllOS-ENU.exe"
#define MariaDBInstallerName "mariadb-10.3.13-winx64.msi"
#define VCppInstallerName "VC_redist.x64.exe"
[Setup]
AppName={#AppName}
@@ -51,7 +51,7 @@ VersionInfoVersion={#MyAppVersion}
VersionInfoCompany={#MyAppPublisher}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoCopyright={#MyAppPublisher}
DefaultDirName = C:\CMS\{#FolderName}\{#FolderName}
DefaultDirName = C:\CMS\{#FolderName}
WindowVisible=false
PrivilegesRequired=admin
@@ -71,17 +71,21 @@ Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
english.CreateStartupIcon=Create Startup &icon
italian.CreateStartupIcon = Crea il collegamento in &Esecuzione Automatica
english.InstallDotNet = Install .Net 4.6.2
english.InstallDotNet = Install .Net 4.7.2
english.InstallMariaDB = Install MariaDB
english.InstallVCpp = Install VC++ 2017
italian.InstallDotNet = Installa .Net 4.6.2
italian.InstallMariaDB = Installa MariaDB
italian.InstallMariaDB = Installa MariaDB
italian.InstallVCpp = Installa VC++ 2017
italian.InstallingMariaDB = Installando MariaDB
english.InstallingMariaDB = Installing MariaDB
english.InstallingVCpp = Installing VC++ 2017
italian.InstallingDotNet = Installando .Net
english.InstallingDotNet = Installing .Net
italian.InstallingMariaDB = Installando MariaDB
italian.InstallingVCpp = Installando VC++ 2017
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone;
@@ -91,10 +95,12 @@ Name: startupicon; Description: {cm:CreateStartupIcon}; GroupDescription: {cm:Ad
[Files]
Source: "{#MySourcePath}\Thermo.Active.exe"; DestDir: "{app}"; Flags: ignoreversion
; Path to exe resources (dll, xml, config)
; Path to exe resources (dll, xml, config)
Source: "{#MySourcePath}\*.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "{#MySourcePath}\*.xml"; DestDir: "{app}"; Flags: ignoreversion;
Source: "{#MySourcePath}\*.config"; DestDir: "{app}"; Flags: ignoreversion;
; Configuration files
Source: "{#MySourcePath}\Config\*.xml"; DestDir: "{app}\Config\"; Flags: ignoreversion;
Source: "{#MySourcePath}\Config\*.xml"; DestDir: "{app}\Config\"; Flags: ignoreversion; Check: GetOverwriteConfig;
; Languages
Source: "{#MySourcePath}\languages\*.*"; DestDir: "{app}\languages\"; Flags: ignoreversion;
; dll
@@ -104,16 +110,19 @@ Source: "{#MySourcePath}\Client\*.*"; DestDir: "{app}\Client\"; Flags: recursesu
; WWWRoot Files
Source: "{#WwwRootPath}\favicon.ico"; DestDir: "{app}\view\"; Flags: ignoreversion;
Source: "{#WwwRootPath}\index.html"; DestDir: "{app}\view\"; Flags: ignoreversion;
Source: "{#WwwRootPath}\config.production.json"; DestDir: "{app}\view\"; Flags: ignoreversion;
; WWWRoot Directories
Source: "{#WwwRootPath}\dist\*"; DestDir: "{app}\view\dist\"; Flags: recursesubdirs ignoreversion;
Source: "{#WwwRootPath}\libs\*"; DestDir: "{app}\view\libs\"; Flags: recursesubdirs ignoreversion;
Source: "{#WwwRootPath}\assets\*"; DestDir: "{app}\view\assets\"; Flags: recursesubdirs ignoreversion;
Source: "{#WwwRootPath}\scripts\*"; DestDir: "{app}\view\scripts\"; Flags: recursesubdirs ignoreversion;
;.Net Installer
Source: {#ToolInstallerPath}\{#DotNetInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
;Check: FrameworkIsNotInstalled
Source: {#ToolInstallerPath}\{#VCppInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
;Check: FrameworkIsNotInstalled
Source: {#ToolInstallerPath}\{#MariaDBInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
; --- UTILS
@@ -131,6 +140,8 @@ Name: {userstartup}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupi
[Run]
; Install .net
Filename: {tmp}\{#DotNetInstallerName}; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingDotNet}; Check: NetFrameworkNeedInstall
Filename: {tmp}\{#VCppInstallerName}; Description: {cm:InstallVCpp}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingVCpp}; Check: VCPPNeedInstall
;Check: NetFrameworkIsMissing
; Install MariaDb
Filename: "msiexec.exe"; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingMariaDB}; Parameters: "/i {tmp}\{#MariaDBInstallerName}"; Check: CheckHeidiSQLNeedInstall;
@@ -157,11 +168,32 @@ var
Result := True;
bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', regVersion);
if (True = bSuccess) and (regVersion >= 394802) then begin
if (True = bSuccess) and (regVersion >= 461808) then begin
Result := False;
end;
end;
///////////////// Check .NET Framework 4.6.2 ////////////////////////////////////
function VCPPNeedInstall(): Boolean;
var
bSuccess: Boolean;
bSuccessM: Boolean;
regVersion: Cardinal;
regMinor: Cardinal;
begin
Result := True;
bSuccess := RegQueryDWordValue(HKLM, 'Software\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Major', regVersion);
bSuccessM := RegQueryDWordValue(HKLM, 'Software\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Minor', regMinor);
if (True = bSuccess) and (True = bSuccessM) and ((regVersion >14) or ((regVersion = 14) and (regMinor >13))) then begin
Result := False;
end;
end;
///////////// Check heidiSQL /////////////////
function CheckHeidiSQLNeedInstall: Boolean;
begin
@@ -177,7 +209,7 @@ var
/////////////////// CheckConfigExistence /////////////////////////////
function OverwriteConfigModal: Boolean;
begin
if DirExists(ExpandConstant('C:\CMS\Thermo.Active\Thermo.Active\Config')) then begin
if DirExists(ExpandConstant('C:\CMS\ThermoActive\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
Binary file not shown.
@@ -426,6 +426,10 @@
&.fa-check-circle.undone-step {
color: #1791ff;
}
&.edit{
left: 80px;
color: #1791ff;
}
}
span,
@@ -534,6 +538,10 @@
&.fa-check-circle.undone-step {
color: #1791ff;
}
&.edit{
left: 133px;
color: #1791ff;
}
}
position: relative;
@@ -382,6 +382,10 @@
.setup .modal-footer-navigator .setup-button i.fa-check-circle.undone-step {
color: #1791ff;
}
.setup .modal-footer-navigator .setup-button i.edit {
left: 80px;
color: #1791ff;
}
.setup .modal-footer-navigator .setup-button span,
.setup .modal-footer-navigator .setup-button label {
grid-row-start: 1;
@@ -473,6 +477,10 @@
.setup-button i.fa-check-circle.undone-step {
color: #1791ff;
}
.setup-button i.edit {
left: 133px;
color: #1791ff;
}
.setup-button .background-top,
.setup-button .background-bottom {
position: absolute;
@@ -97,6 +97,19 @@ export default class ShowCicloInfo extends Vue {
}
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 2,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 2,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -17,6 +17,7 @@ import ShowImbutituraInfo from "@/app_modules_thermo/setup/imbutitura/show-imbut
import ShowOpzioniInfo from "@/app_modules_thermo/setup/opzioni/show-opzioni-info.vue";
// import AvvioProduzione from "@/app_modules_thermo/setup/avvio-produzione/avvio-produzione.vue";
import { store } from '@/store';
import { RecipeGetters } from '@/store/recipe.store';
@Component({
@@ -27,7 +28,7 @@ import { store } from '@/store';
})
export default class Setup extends Vue {
async showModalAtStep(step: number) {
try {
let next = await this.showModalStep(step);
@@ -41,6 +42,10 @@ export default class Setup extends Vue {
return store.state.recipe.overview;
}
getIntChanges(val) {
return (this.$store.getters as RecipeGetters).getIntStates(val);
}
showModalStep(step: number): Promise<number> {
switch (step) {
case 0: return ModalHelper.ShowModalAsync(ShowFormatoInfo, null);
@@ -60,6 +65,7 @@ export default class Setup extends Vue {
return null;
}
mounted() {
messageService.subscribeToChannel('show-setup-modal', (m) => this.showModalAtStep(m));
}
@@ -7,6 +7,7 @@
:phase="1"
:title="'lbl_recipe_overview_general' | localize('Formato')"
:status="overview.general"
:haschanges="getIntChanges(0)"
></setup-button>
<setup-button
@@ -14,6 +15,7 @@
:phase="2"
:title="'lbl_recipe_overview_positions' | localize('Quota e velocità')"
:status="overview.positions"
:haschanges="getIntChanges(1)"
></setup-button>
<setup-button
@@ -21,6 +23,7 @@
:phase="3"
:title="'lbl_recipe_overview_cycle' | localize('Ciclo')"
:status="overview.cycle"
:haschanges="getIntChanges(2)"
></setup-button>
<setup-button
@@ -28,6 +31,7 @@
:phase="4"
:title="'lbl_recipe_overview_heats' | localize('Riscaldi')"
:status="overview.heats"
:haschanges="getIntChanges(3)"
></setup-button>
<setup-button
@@ -35,6 +39,7 @@
:phase="5"
:title="'lbl_recipe_overview_pyrometer' | localize('Pirometro')"
:status="overview.pyrometer"
:haschanges="getIntChanges(4)"
></setup-button>
<setup-button
@@ -42,6 +47,7 @@
:phase="6"
:title="'lbl_recipe_overview_drawing' | localize('Imbutitura')"
:status="overview.drawing"
:haschanges="getIntChanges(5)"
></setup-button>
<setup-button
@@ -49,6 +55,7 @@
:phase="7"
:title="'lbl_recipe_overview_upperPlate' | localize('Controstampo')"
:status="overview.upperPlate"
:haschanges="getIntChanges(6)"
></setup-button>
<setup-button
@@ -56,6 +63,7 @@
:phase="8"
:title="'lbl_recipe_overview_cooling' | localize('Raffreddamento')"
:status="overview.cooling"
:haschanges="getIntChanges(7)"
></setup-button>
<setup-button
@@ -63,6 +71,7 @@
:phase="9"
:title="'lbl_recipe_overview_vacuum' | localize('Vuoto')"
:status="overview.vacuum"
:haschanges="getIntChanges(8)"
></setup-button>
<setup-button
@@ -70,6 +79,7 @@
:phase="10"
:title="'lbl_recipe_overview_extraction' | localize('Estrazione')"
:status="overview.extraction"
:haschanges="getIntChanges(9)"
></setup-button>
<setup-button
@@ -77,6 +87,7 @@
:phase="11"
:title="'lbl_recipe_overview_options' | localize('Opzioni di lavorazione')"
:status="overview.options"
:haschanges="getIntChanges(10)"
></setup-button>
<!-- <div class="setup-play" @click="showModalAtStep(11);">
@@ -17,4 +17,9 @@ export default class setupButton extends Vue {
@Prop()
status: string;
@Prop()
haschanges: boolean;
}
@@ -7,6 +7,7 @@
<i v-if="status == 'Unchanged'" class="fa fa-check-circle undone-step"></i>
<i v-if="status == 'ChangedOk'" class="fa fa-check-circle"></i>
<i v-if="status == 'HasError'" class="fa fa-exclamation-triangle warning"></i>
<i v-if="haschanges" class="fa fa-pencil-square undone-step edit"></i>
</div>
</template>
<script src="./setupButton.ts" lang="ts"></script>
@@ -4,6 +4,7 @@ import { messageService } from "@/_base/messageService";
import setupButton from "./setupButton.vue";
import { Prop } from 'vue-property-decorator';
import { store } from '@/store';
import { RecipeGetters } from '@/store/recipe.store';
@Component({ name: 'stepfooter', components: { setupButton } })
export default class StepFooter extends Vue {
@@ -15,8 +16,18 @@ export default class StepFooter extends Vue {
this.$emit('click', step - this.current)
}
getIntChanges(val) {
return (this.$store.getters as RecipeGetters).getIntStates(val);
}
get overview() {
return store.state.recipe.overview;
}
mounted() {
messageService.subscribeToChannel('show-setup-modal', (m) => this.showModalAtStep(m));
}
}
@@ -6,6 +6,7 @@
:phase="1"
:title="'lbl_recipe_overview_general' | localize('Formato')"
:status="overview.general"
:haschanges="getIntChanges(0)"
></setup-button>
<setup-button
@@ -14,6 +15,7 @@
:phase="2"
:title="'lbl_recipe_overview_positions' | localize('Quota e velocità')"
:status="overview.positions"
:haschanges="getIntChanges(1)"
></setup-button>
<setup-button
@@ -22,6 +24,7 @@
:phase="3"
:title="'lbl_recipe_overview_cycle' | localize('Ciclo')"
:status="overview.cycle"
:haschanges="getIntChanges(2)"
></setup-button>
<setup-button
@@ -30,6 +33,7 @@
:phase="4"
:title="'lbl_recipe_overview_heats' | localize('Riscaldi')"
:status="overview.heats"
:haschanges="getIntChanges(3)"
></setup-button>
<setup-button
@@ -38,22 +42,25 @@
:phase="5"
:title="'lbl_recipe_overview_pyrometer' | localize('Pirometro')"
:status="overview.pyrometer"
:haschanges="getIntChanges(4)"
></setup-button>
<setup-button
@click="showModalAtStep(5)"
:class="{'current': current== 5}"
:phase="6"
:title="'lbl_recipe_overview_drawing' | localize('Imbutitura')"
:status="overview.drawing"
:title="'lbl_recipe_overview_drawing' | localize('Imbutitura')"
:status="overview.drawing"
:haschanges="getIntChanges(5)"
></setup-button>
<setup-button
@click="showModalAtStep(6)"
:class="{'current': current== 6}"
:phase="7"
:title="'lbl_recipe_overview_upperPlate' | localize('Controstampo')"
:status="overview.upperPlate"
:title="'lbl_recipe_overview_upperPlate' | localize('Controstampo')"
:status="overview.upperPlate"
:haschanges="getIntChanges(6)"
></setup-button>
<setup-button
@@ -62,6 +69,7 @@
:phase="8"
:title="'lbl_recipe_overview_cooling' | localize('Raffreddamento')"
:status="overview.cooling"
:haschanges="getIntChanges(7)"
></setup-button>
<setup-button
@@ -70,6 +78,7 @@
:phase="9"
:title="'lbl_recipe_overview_vacuum' | localize('Vuoto')"
:status="overview.vacuum"
:haschanges="getIntChanges(8)"
></setup-button>
<setup-button
@@ -78,6 +87,7 @@
:phase="10"
:title="'lbl_recipe_overview_extraction' | localize('Estrazione')"
:status="overview.extraction"
:haschanges="getIntChanges(9)"
></setup-button>
<setup-button
@@ -86,6 +96,7 @@
:phase="11"
:title="'lbl_recipe_overview_options' | localize('Opzioni di lavorazione')"
:status="overview.options"
:haschanges="getIntChanges(10)"
></setup-button>
</div>
</template>
@@ -49,6 +49,20 @@ export default class ShowControstampoInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 6,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 6,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -38,6 +38,20 @@ export default class ShowEstrazioneInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 9,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 9,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -60,6 +60,20 @@ export default class ShowFormatoInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 0,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 0,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -49,6 +49,19 @@ export default class ShowImbutituraInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 5,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 5,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -41,6 +41,19 @@ export default class ShowOpzioniInfo extends Vue {
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 10,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 10,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -39,6 +39,20 @@ export default class ShowPirometroInfo extends Vue {
// ModalHelper.HideModal();
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 4,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 4,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
@@ -82,6 +82,20 @@ export default class ShowQuoteVelocitaInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 1,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 1,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -53,6 +53,20 @@ export default class Raffreddamento extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 7,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 7,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -52,11 +52,25 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 3,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 3,value: false});
};
async warmersChanged() {
this.warmersEdited = true;
};
@@ -135,11 +149,6 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue {
if (el.status.visible && el.status.enabled)
if (el.setpointHMI != el.setpointPLC) result = true;
}
/*
for (const key in store.state.warmers.channels) {
const el = store.state.warmers.channels[key];
if (el.setpointHMI != el.setpointPLC) result = true;
}*/
return result;
}
@@ -45,6 +45,19 @@ export default class ShowVuotoInfo extends Vue {
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 8,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 8,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -25,7 +25,7 @@ export default class LogMisurazioniTable extends Vue {
return "PALLET HEIGHT"
else if (item == 2)
return "SHEET THICKNESS"
else if (item == 2)
else if (item == 3)
return "SHEET LENGTH"
else
return "ND"
@@ -1,13 +1,13 @@
<template>
<div class="setup">
<modal type="save-as" :title="'modal_folder_create_name' | localize('Crea nuova cartella')">
<modal type="save-as" :title="value.title | localize('Crea nuova cartella')">
<div slot="header-buttons">
<button class="modal-close" @click="close()">
<i class="fa fa-remove"></i>
</button>
</div>
<div class="form-group">
<label>{{'modal_folder_create_name' | localize("Nome della cartella:")}}</label>
<label>{{value.message | localize("Nome della cartella:")}}</label>
<input v-model="FinalName" @keyup.enter="save()" />
</div>
<footer>
@@ -370,7 +370,7 @@ export default class ModalLoadProgram extends Vue {
}
async createFolder() {
let result = await ModalHelper.ShowModalAsync(askNameModal, { title: 'folder_create', message: 'new_folder_name', name: "", isFolder:true });
let result = await ModalHelper.ShowModalAsync(askNameModal, { title: 'folder_name', message: 'new_folder_name', name: "", isFolder:true });
if(result){
var folder = this.currentPath + "\\" + result;
var res = cmsClient.createFolder(folder);
@@ -394,6 +394,18 @@ export default class ModalLoadProgram extends Vue {
}
}
async createRecipe() {
let result = await ModalHelper.ShowModalAsync(askNameModal, { title: 'recipe_create', message: 'new_recipe_name', name: "", isFolder:false });
if(result){
var folder = this.currentPath + "\\" + result;
this.NewRecipe(folder);
}
else {
this.relaodFiles();
}
}
getDate(date) {
return moment(date).format("L");
}
@@ -413,6 +425,37 @@ export default class ModalLoadProgram extends Vue {
this.loadClicked = false
}
async NewRecipe(namenew){
if (!this.thereAreFileEliminated || this.askConfirmLayer) {
this.loadClicked = true
var res = cmsClient.createRecipe(namenew);
if (res) {
var obj = JSON.parse(res);
if (obj.error) {
(iziToast as any).error({
title: "error",
message: obj.error,
theme: "dark",
timeout: 10000,
class: "t-error",
transitionOut: "fadeOut",
})
}
else {
await this.loadProgram(namenew);
}
}
else {
await this.loadProgram(namenew);
}
this.askConfirmLayer = false
}
else {
this.askConfirmLayer = true
}
this.loadClicked = false
}
async loadProgram(path: string) {
if (typeof cmsClient != "undefined") {
if(!this.recipe.changed)
@@ -433,6 +476,27 @@ export default class ModalLoadProgram extends Vue {
}
}
async newProgram() {
if (typeof cmsClient != "undefined") {
if(!this.recipe.changed)
{
await awaiter (recipeService.New());
this.close();
this.$router.push({ name: 'setup' })
}
else{
ModalHelper.AskConfirm(this.$options.filters.localize("modal_confirm_title", "Richiesta di conferma"),
this.$options.filters.localize("modal_confirm_load_recipe", "Vuoi continuare senza salvare la ricetta precedente?"),
async () => {
await awaiter (recipeService.New());
this.close();
this.$router.push({ name: 'setup' })
}, () => void (0))
}
}
}
selectNumberImage(value) {
this.selectedNumberImage = value;
}
@@ -192,7 +192,10 @@
<div class="label">{{'modal_load_program_lbl_box_selected_folder' | localize('Cartella selezionata:')}}</div>
<div class="path">{{currentPath}}</div>
<div class="label">{{'modal_load_program_lbl_box_operations' | localize('Operazioni possibili:')}}</div>
<div>
<div>
<button class="btn" @click="createRecipe" :disabled="!canLoadProgram">
<i class="fa fa-file-text-o"></i>
</button>
<button class="btn" @click="createFolder">
<i class="fa fa-folder-o"></i>
</button>
@@ -207,6 +207,7 @@ export class Hub {
public static recipeFullDataInvalidSetpoint(data) {
recipeActions.setCurrent(store, data, false);
recipeActions.resetAllIntState(store);
}
public static warmersData(data) {
@@ -5,6 +5,12 @@ export interface RecipeStoreModel {
current: Recipe.IRecipe;
overview: Overview.IOverview;
changed: boolean;
intChanges: Map<number,editedStoreModel>;
}
export interface editedStoreModel {
id: number;
value: boolean;
}
@@ -14,16 +20,18 @@ export interface RecipeActions {
setCurrent(context, model: Recipe.IRecipe, avoidSetpointHMI: boolean);
setOverview(context, model: Overview.IOverview);
resetCheckPoint(context);
setIntState(context,model: { id: number, value: boolean });
resetAllIntState(context);
}
export interface RecipeGetters {
getCurrent: () => Recipe.IRecipe;
getOverview: () => Overview.IOverview;
getRecipeItem: (id: number) => Recipe.IValue;
getIntStates: (id: number) => boolean;
}
export const recipeStore = {
state: {
current: {},
overview: {
@@ -39,6 +47,8 @@ export const recipeStore = {
upperPlate: "",
vacuum: ""
},
intChanges: new Map<number, editedStoreModel>(),
_intChanges: Array<editedStoreModel>(),
changed: false,
canUpdateRecipe: true,
_map: new Map<number, Recipe.IValue>()
@@ -47,7 +57,15 @@ export const recipeStore = {
getters: {
getCurrent: (state) => (): Recipe.IRecipe => (state as RecipeStoreModel).current,
getOverview: (state) => (): Overview.IOverview => (state as RecipeStoreModel).overview,
getRecipeItem: (state) => (id): Recipe.IValue => (state._map as Map<number, Recipe.IValue>).get(id)
getRecipeItem: (state) => (id): Recipe.IValue => (state._map as Map<number, Recipe.IValue>).get(id),
getIntStates: state => (id): boolean => {
let vals = state._intChanges.filter(x => x.id == id);
if(vals.length > 0)
return vals[0].value
else
return false;
}
},
mutations: {
@@ -91,6 +109,21 @@ export const recipeStore = {
m.checkpointHMI = m.setpointHMI;
}
},
SetIntState(state,model: { id: number, value: boolean }) {
if ((state.intChanges as Map<number, editedStoreModel>).has(model.id)) {
let val = (state.intChanges as Map<number, editedStoreModel>).get(model.id);
val.value = model.value;
}else {
(state.intChanges as Map<number, editedStoreModel>).set(model.id, { id: model.id, value: model.value})
}
state._intChanges = Array.from(state.intChanges.values());
},
ResetAllIntState(state){
(state.intChanges as Map<number, editedStoreModel>).forEach(function(part, index, theArray) {
(state.intChanges as Map<number, editedStoreModel>).get(index).value = false;
});
state._intChanges = Array.from(state.intChanges.values());
},
SetOverview(state, model: Overview.IOverview) {
for (const key in model) {
if (model.hasOwnProperty(key)) {
@@ -112,12 +145,18 @@ export const recipeStore = {
setChanged(context, value) {
context.commit("SetChanged", value)
},
resetAllIntState(context) {
context.commit("ResetAllIntState")
},
reset(context) {
context.commit("Reset")
},
resetCheckPoint(context) {
context.commit("ResetCheckpoint");
},
setIntState(context,model: { id: number, value: boolean }) {
context.commit("SetIntState",model);
},
async setCurrent(context, model: Recipe.IRecipe, avoidSetpointHMI: boolean = false) {
context.commit("SetCurrent", { avoidSetpoint: avoidSetpointHMI, recipe: model });
+27 -13
View File
@@ -40,6 +40,7 @@
this.lblStats = new System.Windows.Forms.ToolStripStatusLabel();
this.pBoxA = new System.Windows.Forms.PictureBox();
this.panelCmd = new System.Windows.Forms.Panel();
this.lblExportInfo = new System.Windows.Forms.Label();
this.btnExportConfig = new System.Windows.Forms.Button();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.lblMs = new System.Windows.Forms.Label();
@@ -84,11 +85,11 @@
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.timerUI = new System.Windows.Forms.Timer(this.components);
this.lblExportInfo = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.btnImportConfig = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pBoxA)).BeginInit();
@@ -188,6 +189,7 @@
this.panelCmd.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.panelCmd.BackColor = System.Drawing.SystemColors.ControlDark;
this.panelCmd.Controls.Add(this.btnImportConfig);
this.panelCmd.Controls.Add(this.lblExportInfo);
this.panelCmd.Controls.Add(this.btnExportConfig);
this.panelCmd.Controls.Add(this.groupBox5);
@@ -201,12 +203,23 @@
this.panelCmd.Size = new System.Drawing.Size(192, 622);
this.panelCmd.TabIndex = 6;
//
// lblExportInfo
//
this.lblExportInfo.AutoSize = true;
this.lblExportInfo.Location = new System.Drawing.Point(9, 589);
this.lblExportInfo.MaximumSize = new System.Drawing.Size(100, 0);
this.lblExportInfo.MinimumSize = new System.Drawing.Size(175, 0);
this.lblExportInfo.Name = "lblExportInfo";
this.lblExportInfo.Size = new System.Drawing.Size(175, 13);
this.lblExportInfo.TabIndex = 21;
this.lblExportInfo.Text = "---";
//
// btnExportConfig
//
this.btnExportConfig.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnExportConfig.Location = new System.Drawing.Point(8, 491);
this.btnExportConfig.Name = "btnExportConfig";
this.btnExportConfig.Size = new System.Drawing.Size(177, 64);
this.btnExportConfig.Size = new System.Drawing.Size(177, 42);
this.btnExportConfig.TabIndex = 20;
this.btnExportConfig.Text = "Export Config";
this.btnExportConfig.UseVisualStyleBackColor = true;
@@ -650,17 +663,6 @@
//
this.timerUI.Tick += new System.EventHandler(this.timerUI_Tick);
//
// lblExportInfo
//
this.lblExportInfo.AutoSize = true;
this.lblExportInfo.Location = new System.Drawing.Point(9, 574);
this.lblExportInfo.MaximumSize = new System.Drawing.Size(100, 0);
this.lblExportInfo.MinimumSize = new System.Drawing.Size(175, 0);
this.lblExportInfo.Name = "lblExportInfo";
this.lblExportInfo.Size = new System.Drawing.Size(175, 13);
this.lblExportInfo.TabIndex = 21;
this.lblExportInfo.Text = "---";
//
// label3
//
this.label3.AutoSize = true;
@@ -701,6 +703,17 @@
this.label9.TabIndex = 17;
this.label9.Text = "C";
//
// btnImportConfig
//
this.btnImportConfig.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnImportConfig.Location = new System.Drawing.Point(8, 539);
this.btnImportConfig.Name = "btnImportConfig";
this.btnImportConfig.Size = new System.Drawing.Size(177, 42);
this.btnImportConfig.TabIndex = 22;
this.btnImportConfig.Text = "Import Config";
this.btnImportConfig.UseVisualStyleBackColor = true;
this.btnImportConfig.Click += new System.EventHandler(this.btnImportConfig_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -811,6 +824,7 @@
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Button btnImportConfig;
}
}
+72 -25
View File
@@ -25,6 +25,8 @@ namespace Thermo.Cam.Setup
/// Classe gestione ThermoCam (oggetti Image, metodi processing...) x FlirCam
/// </summary>
protected TCContr TCamCtrl = new TCContr($"{BASE_PATH}\\images\\", BASE_PATH);
protected string ThermoConfPath = System.Configuration.ConfigurationManager.AppSettings["ThermoConfPath"];
protected bool initRun = false;
#endregion Protected Fields
@@ -45,6 +47,8 @@ namespace Thermo.Cam.Setup
TCamCtrl.eh_CameraConnStatusChanged += ImgData_eh_CameraConnStatusChanged;
// cerco se ho un set di parametri già impostati...
TCamCtrl.tryReloadConf();
// fix button x reload da conf esportata
btnImportConfig.Enabled = TCamCtrl.confFileExists(ThermoConfPath);
// sistemo le conf temp
setRangeTemp();
// calcolo i currConf.destPoints
@@ -83,12 +87,10 @@ namespace Thermo.Cam.Setup
{
int answ = 100;
int.TryParse(txtAB.Text, out answ);
TCamCtrl.currConf.TargetSize.X = answ;
return answ;
}
set
{
TCamCtrl.currConf.TargetSize.X = value;
txtAB.Text = $"{value}";
}
}
@@ -99,12 +101,10 @@ namespace Thermo.Cam.Setup
{
int answ = 100;
int.TryParse(txtBC.Text, out answ);
TCamCtrl.currConf.TargetSize.Y = answ;
return answ;
}
set
{
TCamCtrl.currConf.TargetSize.Y = value;
txtBC.Text = $"{value}";
}
}
@@ -218,8 +218,6 @@ namespace Thermo.Cam.Setup
private void btnExportConfig_Click(object sender, EventArgs e)
{
// effettua esportazione config in area ThermoActive
string ThermoConfPath = System.Configuration.ConfigurationManager.AppSettings["ThermoConfPath"];
if (!Directory.Exists(ThermoConfPath))
{
Directory.CreateDirectory(ThermoConfPath);
@@ -486,10 +484,12 @@ namespace Thermo.Cam.Setup
/// </summary>
private void setRangeTemp()
{
TCamCtrl.currConf.TargetRange.Min = minRangeTemp;
TCamCtrl.currConf.TargetRange.Max = maxRangeTemp;
if (!initRun)
{
TCamCtrl.currConf.TargetRange.Min = minRangeTemp;
TCamCtrl.currConf.TargetRange.Max = maxRangeTemp;
}
}
private void setTimerInterval()
{
// cambio periodo timer!
@@ -530,18 +530,24 @@ namespace Thermo.Cam.Setup
private void txtAB_TextChanged(object sender, EventArgs e)
{
// ricalcolo in proporzione altro valore...
dimY = (int)((double)dimX * 256 / 320);
// aggiorno punti dest
updateDestPt();
if (!initRun)
{
// ricalcolo in proporzione altro valore...
dimY = (int)((double)dimX * 256 / 320);
// aggiorno punti dest
updateDestPt();
}
}
private void txtBC_TextChanged(object sender, EventArgs e)
{
// ricalcolo in proporzione altro valore...
dimX = (int)((double)dimY * 320 / 256);
// aggiorno punti dest
updateDestPt();
if (!initRun)
{
// ricalcolo in proporzione altro valore...
dimX = (int)((double)dimY * 320 / 256);
// aggiorno punti dest
updateDestPt();
}
}
private void txtMaxScale_TextChanged(object sender, EventArgs e)
@@ -556,14 +562,19 @@ namespace Thermo.Cam.Setup
private void updateDestPt()
{
TCamCtrl.currConf.DestPoints.Coords = new List<Point>();
// ciclo i punti A-B-C-D...
TCamCtrl.currConf.DestPoints.Coords.Add(new Point() { X = 0, Y = 0 });
TCamCtrl.currConf.DestPoints.Coords.Add(new Point() { X = dimX, Y = 0 });
TCamCtrl.currConf.DestPoints.Coords.Add(new Point() { X = dimX, Y = dimY });
TCamCtrl.currConf.DestPoints.Coords.Add(new Point() { X = 0, Y = dimY });
// salvo conf
TCamCtrl.saveConf();
if (!initRun)
{
TCamCtrl.currConf.TargetSize.X = dimX;
TCamCtrl.currConf.TargetSize.Y = dimY;
TCamCtrl.currConf.DestPoints.Coords = new List<Point>();
// ciclo i punti A-B-C-D...
TCamCtrl.currConf.DestPoints.Coords.Add(new Point() { X = 0, Y = 0 });
TCamCtrl.currConf.DestPoints.Coords.Add(new Point() { X = dimX, Y = 0 });
TCamCtrl.currConf.DestPoints.Coords.Add(new Point() { X = dimX, Y = dimY });
TCamCtrl.currConf.DestPoints.Coords.Add(new Point() { X = 0, Y = dimY });
// salvo conf
TCamCtrl.saveConf();
}
}
private void updateDisplay()
@@ -664,5 +675,41 @@ namespace Thermo.Cam.Setup
}
#endregion Private Methods
private void btnImportConfig_Click(object sender, EventArgs e)
{
string messageOut = "-";
if (!Directory.Exists(ThermoConfPath))
{
Directory.CreateDirectory(ThermoConfPath);
}
// verifico se file esiste
if (TCamCtrl.confFileExists(ThermoConfPath))
{
initRun = true;
bool fatto = TCamCtrl.loadConf(ThermoConfPath);
if (fatto)
{
// fix valori
minRangeTemp = TCamCtrl.currConf.TargetRange.Min;
maxRangeTemp = TCamCtrl.currConf.TargetRange.Max;
dimX = TCamCtrl.currConf.TargetSize.X;
dimY = TCamCtrl.currConf.TargetSize.Y;
// messaggio
messageOut = $"{DateTime.Now} Configuration imported!";
}
else
{
messageOut = $"{DateTime.Now} Import error!";
}
initRun = false;
}
else
{
messageOut = $"{DateTime.Now} Conf File not found!";
}
// info export fatto
lblExportInfo.Text = messageOut;
}
}
}
+32
View File
@@ -816,6 +816,38 @@ namespace Thermo.Cam.Utils
return answ;
}
/// <summary>
/// Carica da file dalla dir richiesta nella conf corrente
/// </summary>
/// <param name="destPath">directory destinazione x conf</param>
/// <returns></returns>
public bool loadConf(string destPath)
{
bool answ = false;
string fileName = $"{destPath}\\{confFileName}";
try
{
string rawData = File.ReadAllText(fileName);
currConf = JsonConvert.DeserializeObject<TConfig>(rawData);
answ = true;
}
catch
{ }
return answ;
}
/// <summary>
/// Verifica esistenza file di conf
/// </summary>
/// <param name="destPath"></param>
/// <returns></returns>
public bool confFileExists(string destPath)
{
bool answ = false;
string fileName = $"{destPath}\\{confFileName}";
answ = File.Exists(fileName);
return answ;
}
/// <summary>
/// fermo discovery camera
/// </summary>