Compare commits

...

112 Commits

Author SHA1 Message Date
Samuele Locatelli a0d4e0e2e1 refresh localhost 4 prod pack 2020-06-30 15:46:35 +02:00
Samuele Locatelli cc9f87d079 Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into feature/recipe 2020-06-30 15:30:43 +02:00
= 4f6f5ab867 light orange 2020-06-30 15:29:16 +02:00
= d272ff5e02 Merge remote-tracking branch 'CMS/develop' into develop 2020-06-30 15:25:42 +02:00
= 8c48b2c714 fix alarms 2020-06-30 15:25:05 +02:00
Samuele Locatelli ee924dce19 Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-30 15:24:38 +02:00
Samuele Locatelli 79874f92c1 update language controller 2020-06-30 15:23:04 +02:00
= 846ae78de7 fix date picker 2020-06-30 15:12:48 +02:00
= bc51324ed0 fix grafici 2020-06-30 15:00:00 +02:00
= d92d0e8b3e Merge remote-tracking branch 'CMS/develop' into develop 2020-06-30 14:02:31 +02:00
= a98de74f19 options.. 2020-06-30 14:01:47 +02:00
Samuele Locatelli df0532dbed moved messaggi position (inside project) 2020-06-30 13:56:39 +02:00
Samuele Locatelli d7fc81b460 fix localhost stack 2020-06-30 12:06:05 +02:00
= 65543fc44d inserimento combo in luogo delle select 2020-06-30 11:45:54 +02:00
Samuele Locatelli e77f4f2900 Merge branch 'feature/alarms' into develop 2020-06-30 11:34:34 +02:00
Samuele Locatelli 1b0432babe Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-30 11:34:16 +02:00
Samuele Locatelli 8579511e95 FixAdded strobe/ack for start/end prod pz 2020-06-30 11:33:57 +02:00
Samuele Locatelli 9a4bb57ddb ranaming translation files 2020-06-30 11:33:25 +02:00
= 9e08721ebc Merge remote-tracking branch 'CMS/develop' into develop 2020-06-30 10:22:51 +02:00
= a48c986086 fix binding scheda 2020-06-30 10:22:27 +02:00
= c820e98403 fix portata durata su vuoto 2020-06-30 10:17:09 +02:00
= 8c9c2614ff fix modifica riscaldi 2020-06-30 10:12:12 +02:00
Samuele Locatelli 8798a2a00f Merge branch 'feature/alarms' into develop 2020-06-29 19:42:25 +02:00
Samuele Locatelli f5d9ef2dd9 Completed review of translations file 2020-06-29 19:40:54 +02:00
Samuele Locatelli 3c29a47fc9 start new language translators 2020-06-29 18:58:13 +02:00
Samuele Locatelli 488add201e Review of recipe config models and xml/xsd valid 2020-06-29 18:57:49 +02:00
Samuele Locatelli a552ab5cae Added translation files for modules & recipe param 2020-06-29 18:57:19 +02:00
Samuele Locatelli fad81cfb47 added json animations on wwwroot 2020-06-29 18:56:57 +02:00
Samuele Locatelli ce150ed3c7 Start alarm decoding 2020-06-29 15:02:15 +02:00
= 5831936b24 Merge remote-tracking branch 'CMS/develop' into develop 2020-06-29 13:53:28 +02:00
= 1b31f05fb2 selezione riscaldi con touch 2020-06-29 13:53:16 +02:00
Samuele Locatelli e2b07ff9ca Merge branch 'feature/recipe' into develop 2020-06-29 13:05:30 +02:00
Samuele Locatelli 6066c7155b Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-29 13:05:19 +02:00
Samuele Locatelli 07719b3fde force rewrite od osd files 2020-06-29 13:04:03 +02:00
= 59051dc908 primo binding dati dashboard.. 2020-06-26 18:18:09 +02:00
= a3b73742c2 fix selezione riscaldi 2020-06-26 17:32:03 +02:00
Samuele Locatelli b732d1d024 Fix for local deploy 2020-06-26 16:15:48 +02:00
= 71955744f6 rimozione pieces dalla dashboard.. vanno rifattorizzati 2020-06-26 16:09:44 +02:00
Samuele Locatelli 807e225de8 Confirm recipe post PLC request 2020-06-26 12:19:30 +02:00
= 26000cffd1 Merge remote-tracking branch 'CMS/develop' into develop 2020-06-26 11:46:57 +02:00
= 99a6af2491 pulizia dal vecchio progetto 2020-06-26 11:45:17 +02:00
Samuele Locatelli 251795ad19 Merge branch 'feature/recipe' into develop 2020-06-26 11:38:35 +02:00
Samuele Locatelli 002310dcb4 FIx visible/enabled/error status from PLC 2020-06-26 11:37:31 +02:00
= 8db88e9ca6 fix annulla ricetta 2020-06-26 10:13:24 +02:00
Samuele Locatelli 956b9ad191 started vers 0.9.14 with XML cleanup for ModBlock 2020-06-26 08:56:43 +02:00
Samuele Locatelli 02cf47426c Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-25 18:12:51 +02:00
Samuele Locatelli e2e190cf8f Merge branch 'develop' into feature/recipe 2020-06-25 18:08:51 +02:00
Samuele Locatelli 23f2299de2 Fix XML from M.Carissoni in modBlock 2020-06-25 18:08:40 +02:00
= e3f376bf51 fix finte eccezioni della direttiva di focus. 2020-06-25 17:04:50 +02:00
= 06e3345d2b Merge remote-tracking branch 'CMS/develop' into develop 2020-06-25 16:47:27 +02:00
= cf6fdeaa79 commenti 2020-06-25 16:47:11 +02:00
Samuele Locatelli 3b823cec89 Removed pattern of using (ncAdapter) from WebAPI 2020-06-25 16:46:01 +02:00
= b0684fa03f algoritmo di posizionamento verticale gantt con ottimizzazione delle posizioni in riga. 2020-06-25 16:44:32 +02:00
Samuele Locatelli b48c18ac12 Merge branch 'develop' into feature/recipe 2020-06-25 16:08:32 +02:00
Samuele Locatelli d452e69a52 update vers number! 2020-06-25 16:08:04 +02:00
Samuele Locatelli f9c354acf5 Fix NC info (static data) retrieval 2020-06-25 16:07:13 +02:00
Samuele Locatelli d0ee6d33d1 fix develop conf for local testing 2020-06-25 14:04:14 +02:00
Samuele Locatelli 91df9b99d4 fix vers 0.9.11 on testing overview 2020-06-25 13:49:31 +02:00
Samuele Locatelli 6cd224d6ce Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-25 12:48:45 +02:00
Samuele Locatelli 192722d10e Merge branch 'feature/recipe' into develop 2020-06-25 12:47:36 +02:00
Samuele Locatelli 6095f02b2a Forced send on recipeOverview 2020-06-25 12:47:23 +02:00
Samuele Locatelli eae5ecdf31 more fix on XML example 2020-06-25 12:47:11 +02:00
Samuele Locatelli ceccfca48a Fixed recipe config (validator & example) 2020-06-25 12:45:24 +02:00
= 2dc5ca8ebe fix footer menu size & buttons 2020-06-25 12:29:17 +02:00
= f71c03186e primo dimensionamento corretto delle barre gantt 2020-06-25 12:12:47 +02:00
Samuele Locatelli 9f7b60234a Merge branch 'feature/recipe' into develop 2020-06-25 11:59:34 +02:00
Samuele Locatelli 5a209dc1ff Merge branch 'develop' into feature/recipe 2020-06-25 11:59:24 +02:00
Samuele Locatelli 0a47e22987 Change model for recipe config (enums parameters) 2020-06-25 11:58:47 +02:00
= 6811c29f01 Merge remote-tracking branch 'CMS/develop' into develop 2020-06-25 11:54:09 +02:00
= f168f6a9d0 layout 2020-06-25 11:52:09 +02:00
= 4343386cce fix overview & confirm 2020-06-25 11:49:32 +02:00
Samuele Locatelli 1a97ad094f Merge branch 'feature/recipe' into develop 2020-06-25 10:56:36 +02:00
Samuele Locatelli e550a386ec removed forced sends... 2020-06-25 10:56:23 +02:00
Samuele Locatelli 66865d8e98 forced send of overview data 2020-06-25 10:54:39 +02:00
= 245844a243 processo primo commit 2020-06-25 10:42:33 +02:00
Samuele Locatelli de48382f3d Merge branch 'feature/recipe' into develop 2020-06-25 10:09:45 +02:00
Samuele Locatelli bc75c29f80 Fix overview for recipe template/init 2020-06-25 10:09:31 +02:00
Samuele Locatelli e7e2601a8d updated ModBLock controllers for new datamodel 2020-06-25 09:58:10 +02:00
Samuele Locatelli 4ea2cebfeb Draft for new overview calculation (to be checked) 2020-06-24 19:14:59 +02:00
Samuele Locatelli 1dd83f4e17 Refactoring methods for File persistance 2020-06-24 18:45:22 +02:00
= ab2abc7c2e Merge remote-tracking branch 'CMS/develop' into develop 2020-06-24 11:26:08 +02:00
= 8ac729f9bf Merge remote-tracking branch 'refs/remotes/teamdev/develop'
Conflicts:
	Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/processo.ts
	Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/processo.vue
2020-06-24 11:25:37 +02:00
= 6cabb05270 fix produzione e selezione riscaldi 2020-06-24 11:23:55 +02:00
Samuele Locatelli 9515269f39 Fix contention on ncAdapter (high level) maybe? 2020-06-23 18:46:49 +02:00
Samuele Locatelli 821f91b318 Merge branch 'feature/check/alarms' into cleanup 2020-06-23 18:22:38 +02:00
Samuele Locatelli 6c96d8f259 update vers number 2020-06-23 18:18:17 +02:00
Samuele Locatelli ed946dcd33 forced visible for status bit on recipe parameters 2020-06-23 18:18:07 +02:00
Samuele Locatelli 684ccab8a0 Fix path for Active CLient in Release 2020-06-23 18:17:44 +02:00
Samuele Locatelli d88f3f3d47 Prod controller: single NC object + fix naming prod/prod 2020-06-23 18:17:27 +02:00
Samuele Locatelli ce02165197 Warmers controller: single NC object 2020-06-23 18:17:12 +02:00
Samuele Locatelli e53f233f42 Recipe controller: single NC object 2020-06-23 18:17:04 +02:00
Alessio 6789f9162b fix gantt component 2020-06-23 16:44:11 +02:00
Samuele Locatelli aa78101506 change config prod x vue.js UI 2020-06-23 16:09:18 +02:00
Samuele Locatelli fe4f91d4ae only siemens HMI doesn't really disconnect 2020-06-23 15:08:13 +02:00
Samuele Locatelli fcc404f048 fix connect return value 2020-06-23 15:07:30 +02:00
Alessio aefad3422c fix component for the gantt graphic 2020-06-22 17:08:39 +02:00
Alessio 04f67ac97c fix component for the gantt graphic 2020-06-22 17:00:39 +02:00
Alessio 9eefbe43cc fix processo modal 2020-06-22 15:50:43 +02:00
Samuele Locatelli c5bb2f5658 Merge branch 'feature/check/alarms' into develop 2020-06-22 15:22:44 +02:00
Samuele Locatelli 7424af263f Server: with Paolo Possanzini for fixing stsatic json/ttf 2020-06-22 15:22:09 +02:00
Alessio 8e5d1f82cb add component for the gantt graphic 2020-06-22 15:14:31 +02:00
Samuele Locatelli 3bd3c5e516 change on wwwroot data for ActiveClient 2020-06-22 14:20:42 +02:00
Samuele Locatelli f6182aa622 fix path for active client & prettybin 2020-06-22 13:19:58 +02:00
Samuele Locatelli d7590f46fe developer mode for testing client 2020-06-22 13:19:13 +02:00
Samuele Locatelli ed8f87c6d3 Pretty bin for active client! 2020-06-22 13:19:01 +02:00
Alessio d315eaeca2 fix clock 2020-06-22 11:48:17 +02:00
Alessio ee4356105a fix preriscaldo dashboard 2020-06-22 11:19:42 +02:00
Alessio e921177b38 fix preriscaldo dashboard 2020-06-22 11:11:15 +02:00
Alessio a133b5d49a fix preriscaldo dashboard 2020-06-22 10:53:08 +02:00
Alessio de271c10af fix point 7 and 12 2020-06-22 10:20:18 +02:00
Samuele Locatelli a82fc98348 Merge branch 'cleanup' into develop 2020-06-19 19:28:22 +02:00
Samuele Locatelli 5b2841c01b Executed code-cleanup on solution 2020-06-19 19:28:07 +02:00
438 changed files with 8433 additions and 16141 deletions
+6 -12
View File
@@ -1,21 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Config
namespace Client.Config
{
public static class Config
{
public static SubModels.Client ClientConfig;
public static SubModels.Connection ConnectionConfig;
public static SubModels.VendorHmi VendorHmiConfig;
public static SubModels.Client ClientConfig;
public static SubModels.Connection ConnectionConfig;
public static SubModels.VendorHmi VendorHmiConfig;
public static SubModels.ProdSoftware ProdSoftwareConfig { get; set; }
public static string TextEditorPath { get; set; }
public static SubModels.Software[] ExtSoftwaresConfig { get; set; }
public static SubModels.Software[] ExtSoftwaresConfig { get; set; }
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
<RenderingMethod>GPU</RenderingMethod> <!-- GPU/CPU -->
<ShowVirtualKeyboard>false</ShowVirtualKeyboard>
<RunningOnSecondaryScreen>false</RunningOnSecondaryScreen>
<DeveloperMode>false</DeveloperMode>
<DeveloperMode>true</DeveloperMode>
</Client>
<Connection>
<ServerUrl>localhost</ServerUrl>
+270 -274
View File
@@ -1,280 +1,276 @@
using Client.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using System.Xml.Schema;
namespace Client.Config
{
public class ConfigController
{
const String ChromeScheme = "chrome";
public static void ReadStartupConfig()
{
// Read validation file
XmlSchemaSet readerSettings = new XmlSchemaSet();
// Add Schema
readerSettings.Add(null, Constants.STARTUP_CONFIG_SCHEMA_PATH);
// Open file reader
XDocument xmlConfigFile = XDocument.Load(Constants.STARTUP_CONFIG_PATH);
// Validate file
xmlConfigFile.Validate(readerSettings, ValidationHandler);
// Read XML Config
Config.ClientConfig = xmlConfigFile
.Descendants(Constants.CLIENT_CONFIG_KEY)
.Select(x => new SubModels.Client()
{
TranspColor = ValidateTranspColor(x.Element("TranspColor").Value),
RenderingMethod = ValidateRendering(x.Element("RenderingMethod").Value),
RunningOnSecondaryScreen = ValidateSecScreen(x.Element("RunningOnSecondaryScreen").Value),
ShowVirtualKeyboard = ValidateVirtualKeyboard(x.Element("ShowVirtualKeyboard").Value),
DeveloperMode = ValidateDeveloperMode(x.Element("DeveloperMode").Value),
IsSCM = ValidateIsSCM(x.Element("IsSCM").Value)
}).FirstOrDefault();
Config.ConnectionConfig = xmlConfigFile
.Descendants(Constants.CONNECTION_CONFIG_KEY)
.Select(x => new SubModels.Connection()
{
ServerUrl = ValidateServerUrl(x.Element("ServerUrl").Value),
ServerPort = ValidateServerPort(x.Element("ServerPort").Value),
Id = ValidateClientID(x.Element("Id").Value),
DeleteCahceFolderOnStartup = ValidateDelCache(x.Element("DeleteCahceFolderOnStartup").Value),
}).FirstOrDefault();
Config.VendorHmiConfig = xmlConfigFile
.Descendants(Constants.VENDORHMI_CONFIG_KEY)
.Select(x => new SubModels.VendorHmi()
{
FollowNcWindow = ValidateFollowNcWin(x.Element("FollowNcWindow").Value)
}).FirstOrDefault();
Config.ProdSoftwareConfig = new SubModels.ProdSoftware();
Config.ExtSoftwaresConfig = new SubModels.Software[] { };
//ReadConfig Url compositing
Config.ConnectionConfig.ReadConfigUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.ConfigPage;
Config.ConnectionConfig.StartingUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.StartingPage;
//ErrorPage content
if (File.Exists(Constants.errorPageFile))
Config.ConnectionConfig.ErrorPage = File.ReadAllText(Constants.errorPageFile);
else
throw new Exception(@"File Error: """ + Constants.errorPageFile + @""" not found");
}
private static void ValidationHandler(object sender, ValidationEventArgs e)
{
throw new Exception(@"Configuration Error: " + e.Message);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region PROPERTIES_VALIDATOR
private static String ValidateServerUrl(String value)
{
if (!String.IsNullOrWhiteSpace(value))
return value;
else
throw new Exception(@"Configuration Error: ""Connection - ServerUrl"" is not a valid URL");
}
private static ushort ValidateServerPort(String value)
{
if (ushort.TryParse(value, out ushort Port))
return Port;
else
throw new Exception(@"Configuration Error: ""Connection - ServerPort"" is not a valid Id of CMS-Client");
}
private static String ValidateArgumentUrl(String value)
{
Uri NewUrl;
if (Uri.TryCreate(value, UriKind.Absolute, out NewUrl) && (NewUrl.Scheme == Uri.UriSchemeHttp || NewUrl.Scheme == Uri.UriSchemeHttps || NewUrl.Scheme == Uri.UriSchemeFile || NewUrl.Scheme == ChromeScheme))
return value;
else
throw new Exception(@"Argument Url Error: is not a valid URL");
}
private static Color ValidateTranspColor(String value)
{
Color color;
try
{
color = ColorTranslator.FromHtml(value);
return color;
}
catch (Exception)
{
throw new Exception(@"Configuration Error: ""Client - TranspColor"" is not a valid Hex Color");
}
}
private static Constants.Rendering ValidateRendering(string value)
{
if (value.ToUpper().Equals("CPU"))
return Constants.Rendering.CPU;
else if (value.ToUpper().Equals("GPU"))
return Constants.Rendering.GPU;
else
throw new Exception(@"Configuration Error: ""Client - RenderingMethod"" is not a valid Rendering Method");
}
private static bool ValidateSecScreen(string value)
{
Boolean secScreen;
if (Boolean.TryParse(value, out secScreen))
return secScreen;
else
throw new Exception(@"Configuration Error: ""Client - RunningOnSecondaryScreen"" is not a valid Boolean Type");
}
private static bool ValidateIsSCM(string value)
{
Boolean IsSCM;
if (Boolean.TryParse(value, out IsSCM))
return IsSCM;
using Client.Utils;
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using System.Xml.Schema;
namespace Client.Config
{
public class ConfigController
{
const String ChromeScheme = "chrome";
public static void ReadStartupConfig()
{
// Read validation file
XmlSchemaSet readerSettings = new XmlSchemaSet();
// Add Schema
readerSettings.Add(null, Constants.STARTUP_CONFIG_SCHEMA_PATH);
// Open file reader
XDocument xmlConfigFile = XDocument.Load(Constants.STARTUP_CONFIG_PATH);
// Validate file
xmlConfigFile.Validate(readerSettings, ValidationHandler);
// Read XML Config
Config.ClientConfig = xmlConfigFile
.Descendants(Constants.CLIENT_CONFIG_KEY)
.Select(x => new SubModels.Client()
{
TranspColor = ValidateTranspColor(x.Element("TranspColor").Value),
RenderingMethod = ValidateRendering(x.Element("RenderingMethod").Value),
RunningOnSecondaryScreen = ValidateSecScreen(x.Element("RunningOnSecondaryScreen").Value),
ShowVirtualKeyboard = ValidateVirtualKeyboard(x.Element("ShowVirtualKeyboard").Value),
DeveloperMode = ValidateDeveloperMode(x.Element("DeveloperMode").Value),
IsSCM = ValidateIsSCM(x.Element("IsSCM").Value)
}).FirstOrDefault();
Config.ConnectionConfig = xmlConfigFile
.Descendants(Constants.CONNECTION_CONFIG_KEY)
.Select(x => new SubModels.Connection()
{
ServerUrl = ValidateServerUrl(x.Element("ServerUrl").Value),
ServerPort = ValidateServerPort(x.Element("ServerPort").Value),
Id = ValidateClientID(x.Element("Id").Value),
DeleteCahceFolderOnStartup = ValidateDelCache(x.Element("DeleteCahceFolderOnStartup").Value),
}).FirstOrDefault();
Config.VendorHmiConfig = xmlConfigFile
.Descendants(Constants.VENDORHMI_CONFIG_KEY)
.Select(x => new SubModels.VendorHmi()
{
FollowNcWindow = ValidateFollowNcWin(x.Element("FollowNcWindow").Value)
}).FirstOrDefault();
Config.ProdSoftwareConfig = new SubModels.ProdSoftware();
Config.ExtSoftwaresConfig = new SubModels.Software[] { };
//ReadConfig Url compositing
Config.ConnectionConfig.ReadConfigUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.ConfigPage;
Config.ConnectionConfig.StartingUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.StartingPage;
//ErrorPage content
if (File.Exists(Constants.errorPageFile))
Config.ConnectionConfig.ErrorPage = File.ReadAllText(Constants.errorPageFile);
else
throw new Exception(@"File Error: """ + Constants.errorPageFile + @""" not found");
}
private static void ValidationHandler(object sender, ValidationEventArgs e)
{
throw new Exception(@"Configuration Error: " + e.Message);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region PROPERTIES_VALIDATOR
private static String ValidateServerUrl(String value)
{
if (!String.IsNullOrWhiteSpace(value))
return value;
else
throw new Exception(@"Configuration Error: ""Connection - ServerUrl"" is not a valid URL");
}
private static ushort ValidateServerPort(String value)
{
if (ushort.TryParse(value, out ushort Port))
return Port;
else
throw new Exception(@"Configuration Error: ""Connection - ServerPort"" is not a valid Id of CMS-Client");
}
private static String ValidateArgumentUrl(String value)
{
Uri NewUrl;
if (Uri.TryCreate(value, UriKind.Absolute, out NewUrl) && (NewUrl.Scheme == Uri.UriSchemeHttp || NewUrl.Scheme == Uri.UriSchemeHttps || NewUrl.Scheme == Uri.UriSchemeFile || NewUrl.Scheme == ChromeScheme))
return value;
else
throw new Exception(@"Argument Url Error: is not a valid URL");
}
private static Color ValidateTranspColor(String value)
{
Color color;
try
{
color = ColorTranslator.FromHtml(value);
return color;
}
catch (Exception)
{
throw new Exception(@"Configuration Error: ""Client - TranspColor"" is not a valid Hex Color");
}
}
private static Constants.Rendering ValidateRendering(string value)
{
if (value.ToUpper().Equals("CPU"))
return Constants.Rendering.CPU;
else if (value.ToUpper().Equals("GPU"))
return Constants.Rendering.GPU;
else
throw new Exception(@"Configuration Error: ""Client - RenderingMethod"" is not a valid Rendering Method");
}
private static bool ValidateSecScreen(string value)
{
Boolean secScreen;
if (Boolean.TryParse(value, out secScreen))
return secScreen;
else
throw new Exception(@"Configuration Error: ""Client - RunningOnSecondaryScreen"" is not a valid Boolean Type");
}
private static bool ValidateIsSCM(string value)
{
Boolean IsSCM;
if (Boolean.TryParse(value, out IsSCM))
return IsSCM;
else
throw new Exception(@"Configuration Error: ""Client - IsSCM"" is not a valid Boolean Type");
}
private static bool ValidateVirtualKeyboard(string value)
{
Boolean keyboard;
if (Boolean.TryParse(value, out keyboard))
return keyboard;
else
throw new Exception(@"Configuration Error: ""Client - ShowVirtualKeyboard"" is not a valid Boolean Type");
}
private static bool ValidateDeveloperMode(string value)
{
Boolean DeveloperMode;
if (Boolean.TryParse(value, out DeveloperMode))
return DeveloperMode;
else
throw new Exception(@"Configuration Error: ""Client - DeveloperMode"" is not a valid Boolean Type");
}
private static Boolean ValidateFollowNcWin(String value)
{
Boolean FollowNc;
if (Boolean.TryParse(value, out FollowNc))
return FollowNc;
else
throw new Exception(@"Configuration Error: ""VendorHmi - FollowNcWindow"" is not a valid Boolean Type");
}
private static ushort ValidateClientID(String value)
{
ushort Client;
if (ushort.TryParse(value, out Client))
return Client;
else
throw new Exception(@"Configuration Error: ""Connection - Id"" is not a valid Id of CMS-Client");
}
private static Boolean ValidateDelCache(String value)
{
Boolean DelCache;
if (Boolean.TryParse(value, out DelCache))
return DelCache;
else
throw new Exception(@"Configuration Error: ""Connection - DeleteCahceFolderOnStartup"" is not a valid Boolean Type");
}
private static String ValidateSFTPath(String value)
{
if (File.Exists(value))
return value;
else
throw new Exception(@"Configuration Error: File """ + value + @""" not found");
}
private static String ValidateSFTSName(String value)
{
if (!String.IsNullOrEmpty(value))
{
if (value.Count() <= 3)
return value;
else
throw new Exception(@"Configuration Error: Short Name """ + value + @""" cannot be over 3 Letters");
}
else
throw new Exception(@"Configuration Error: ""Client - IsSCM"" is not a valid Boolean Type");
}
private static bool ValidateVirtualKeyboard(string value)
{
Boolean keyboard;
if (Boolean.TryParse(value, out keyboard))
return keyboard;
else
throw new Exception(@"Configuration Error: ""Client - ShowVirtualKeyboard"" is not a valid Boolean Type");
}
private static bool ValidateDeveloperMode(string value)
{
Boolean DeveloperMode;
if (Boolean.TryParse(value, out DeveloperMode))
return DeveloperMode;
else
throw new Exception(@"Configuration Error: ""Client - DeveloperMode"" is not a valid Boolean Type");
}
private static Boolean ValidateFollowNcWin(String value)
{
Boolean FollowNc;
if (Boolean.TryParse(value, out FollowNc))
return FollowNc;
else
throw new Exception(@"Configuration Error: ""VendorHmi - FollowNcWindow"" is not a valid Boolean Type");
}
private static ushort ValidateClientID(String value)
{
ushort Client;
if (ushort.TryParse(value, out Client))
return Client;
else
throw new Exception(@"Configuration Error: ""Connection - Id"" is not a valid Id of CMS-Client");
}
private static Boolean ValidateDelCache(String value)
{
Boolean DelCache;
if (Boolean.TryParse(value, out DelCache))
return DelCache;
else
throw new Exception(@"Configuration Error: ""Connection - DeleteCahceFolderOnStartup"" is not a valid Boolean Type");
}
private static String ValidateSFTPath(String value)
{
if(File.Exists(value))
return value;
else
throw new Exception(@"Configuration Error: File """+ value + @""" not found");
}
private static String ValidateSFTSName(String value)
{
if (!String.IsNullOrEmpty(value))
{
if (value.Count() <= 3)
return value;
else
throw new Exception(@"Configuration Error: Short Name """ + value + @""" cannot be over 3 Letters");
}
else
throw new Exception(@"Configuration Error: Software Short Name Must be setted");
}
private static bool ValidateInMainMenuBar(String value)
{
if (!String.IsNullOrEmpty(value))
{
return Boolean.Parse(value);
}
else
}
private static bool ValidateInMainMenuBar(String value)
{
if (!String.IsNullOrEmpty(value))
{
return Boolean.Parse(value);
}
else
throw new Exception(@"Configuration Error: In-Main-Menu-Bar Must be setted");
}
private static String ValidateSFTLName(String value)
{
if (!String.IsNullOrEmpty(value))
return value;
else
throw new Exception(@"Configuration Error: Software Long Name Must be setted");
}
private static String ExtractBase64Icon(String value)
{
Image im = Icon.ExtractAssociatedIcon(value).ToBitmap();
MemoryStream m = new MemoryStream();
im.Save(m, ImageFormat.Png);
return "data:image/png;base64," + Convert.ToBase64String(m.ToArray());
}
#endregion
}
}
private static String ValidateSFTLName(String value)
{
if (!String.IsNullOrEmpty(value))
return value;
else
throw new Exception(@"Configuration Error: Software Long Name Must be setted");
}
private static String ExtractBase64Icon(String value)
{
Image im = Icon.ExtractAssociatedIcon(value).ToBitmap();
MemoryStream m = new MemoryStream();
im.Save(m, ImageFormat.Png);
return "data:image/png;base64," + Convert.ToBase64String(m.ToArray());
}
#endregion
}
}
-1
View File
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
-4
View File
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Client.Utils.Constants;
namespace Client.Config.SubModels
+1 -5
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Config.SubModels
{
@@ -15,6 +11,6 @@ namespace Client.Config.SubModels
public string ReadConfigUrl { get; set; }
public Boolean DeleteCahceFolderOnStartup { get; set; }
public Boolean BypassReadConfiguration { get; set; }
public string ErrorPage { get; set; }
public string ErrorPage { get; set; }
}
}
+1 -7
View File
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Config.SubModels
namespace Client.Config.SubModels
{
public class ProdSoftware
{
+3 -7
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Client.Config.SubModels
{
@@ -15,8 +11,8 @@ namespace Client.Config.SubModels
public string ProdEnabled { get; set; }
public string ProdPath { get; set; }
public string Autorun { get; set; }
public string EditorPath { get; set; }
public string EditorPath { get; set; }
public List<Software> ExtSoftwares { get; set; }
}
}
+2 -7
View File
@@ -1,15 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
namespace Client.Config.SubModels
{
[DataContract]
public class Software
{
{
[DataMember]
public string id { get; set; }
[DataMember]
-4
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Config.SubModels
{
+25 -30
View File
@@ -1,44 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Utils
namespace Client.Utils
{
public static class Constants
{
//Folders
public static string BASE_PATH = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\";
public static string BROWSER_CACHE_FOLDER = BASE_PATH + "LocalStorage";
public static string BASE_PATH = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\";
//public static string BASE_PATH = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\";
public static string BROWSER_CACHE_FOLDER = BASE_PATH + "LocalStorage";
public static string STARTUP_CONFIG_SCHEMA_PATH = BASE_PATH + "ClientValidator.xsd";
public static string STARTUP_CONFIG_PATH = BASE_PATH + "Config.xml";
public static string CEF_PATH = BASE_PATH + "CEF";
public static string CEF_X86_PATH = BASE_PATH + "CEF\\Release_X86";
public static string CEF_X64_PATH = BASE_PATH + "CEF\\Release_X64";
public static string CEF_LOCALES_PATH = BASE_PATH + "CEF\\Resources\\locales";
public static string CEF_EXCEPTIONLOG_PATH = BASE_PATH + "ExceptionLog";
public static string errorPageFile = BASE_PATH + "error.pg";
public static string JOB_OPENING_PATH = "C:\\CMS\\ACTIVE\\TMP\\clientTmpJob\\";
public static string PART_PRG_FOLDER = "C:\\PartPrg";
public static string STARTUP_CONFIG_PATH = BASE_PATH + "lib\\Config.xml";
public static string CEF_PATH = BASE_PATH + "CEF";
public static string CEF_X86_PATH = BASE_PATH + "CEF\\Release_X86";
public static string CEF_X64_PATH = BASE_PATH + "CEF\\Release_X64";
public static string CEF_LOCALES_PATH = BASE_PATH + "CEF\\Resources\\locales";
public static string CEF_EXCEPTIONLOG_PATH = BASE_PATH + "ExceptionLog";
public static string errorPageFile = BASE_PATH + "error.pg";
public static string JOB_OPENING_PATH = "C:\\CMS\\ThermoActive\\TMP\\clientTmpJob\\";
public static string PART_PRG_FOLDER = "C:\\PartPrg";
//Config Names
public const string CONFIG_KEY = "Config";
public const string CLIENT_CONFIG_KEY = "Client";
public const string CONNECTION_CONFIG_KEY = "Connection";
public const string VENDORHMI_CONFIG_KEY = "VendorHmi";
public const string EXTSFT_CONFIG_KEY = "ExtSoftwares";
public const string SFT_CONFIG_KEY = "Software";
public const string JOB_MAIN_FILENAME = "main.cnc";
public const string JOB_METADATA_FILENAME = "metadata.json";
public enum Rendering {GPU = 0, CPU = 1 };
public const string CONFIG_KEY = "Config";
public const string CLIENT_CONFIG_KEY = "Client";
public const string CONNECTION_CONFIG_KEY = "Connection";
public const string VENDORHMI_CONFIG_KEY = "VendorHmi";
public const string EXTSFT_CONFIG_KEY = "ExtSoftwares";
public const string SFT_CONFIG_KEY = "Software";
public const string JOB_MAIN_FILENAME = "main.cnc";
public const string JOB_METADATA_FILENAME = "metadata.json";
public enum Rendering { GPU = 0, CPU = 1 };
//BROWSER OBJECT NAME -> The first letter must be Lower-Case (CEF Settings)
public const string BROWSER_JS_OBJ_NAME = "cmsClient";
//Nc States
public enum NcState { HIDE = 0, SHOW = 1, SHOWPROD = 2 };
@@ -68,13 +63,13 @@ namespace Client.Utils
//KEYBOARD Constants
public const int KEYB_HEIGHT = 377;
public const int KEYB_WIDTH = 1134;
public const int KEYB_WIDTH = 1134;
public const int KEYB_Y_OFFSET = 15;
public const string KEYB_EXE_NAME = "OSK.EXE";
public const string KEYB_PROC_NAME = "OSK";
public const string StartingPage = "index.html";
public const string UPLOAD_PAGE = "/api/file_manager/upload";
public const string UPLOAD_PAGE = "/api/file_manager/upload";
public const string UPLOAD_ADD_QUEUE = "/api/file_manager/queue/add";
public const string ConfigPage = "api/configuration/client";
public const string errorPageUrl = @"error://error/";
-1
View File
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
+8 -3
View File
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
</configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;libs" />
</assemblyBinding>
</runtime>
</configuration>
+22 -23
View File
@@ -1,13 +1,13 @@
using Chromium;
using Active_Client.Browser_Tools.Models;
using Active_Client.Browser_Tools.Models.Errors;
using Active_Client.Browser_Tools.Models.Metadata;
using Active_Client.View;
using Chromium;
using Chromium.Remote;
using Chromium.Remote.Event;
using Chromium.WebBrowser;
using Client.Config;
using Client.Config.SubModels;
using Client.Utils;
using Active_Client.Browser_Tools.Models;
using Active_Client.Browser_Tools.Models.Errors;
using Active_Client.Browser_Tools.Models.Metadata;
using Active_Client.View;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -15,13 +15,12 @@ using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Management;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using static Client.Utils.Constants;
using System.Management;
using Chromium.Remote;
using System.Text;
namespace Active_Client.Browser_Tools
{
@@ -56,7 +55,7 @@ namespace Active_Client.Browser_Tools
{
mainForm = f;
AddDynamicProperty("RECENT_FOLDER_KEY").PropertyGet += getProp;
AddDynamicProperty("RECENT_FOLDER_KEY").PropertyGet += getProp;
AddFunction("minimizeForm").Execute += minimizeForm;
AddFunction("maximizeForm").Execute += maximizeForm;
@@ -383,7 +382,7 @@ namespace Active_Client.Browser_Tools
Path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\",
Type = "SPFO"
});
try
{
// Network Folders
@@ -429,7 +428,7 @@ namespace Active_Client.Browser_Tools
try
{
if(p == RECENT_FOLDER_KEY)
if (p == RECENT_FOLDER_KEY)
{
filelist = GetLastUploadedFiles();
}
@@ -556,9 +555,9 @@ namespace Active_Client.Browser_Tools
// }
//}
foreach(FileModel file in files)
foreach (FileModel file in files)
{
if(!file.IsMain)
if (!file.IsMain)
form.Add(new ByteArrayContent(File.ReadAllBytes(file.AbsolutePath)), "file", Path.GetFileName(file.AbsolutePath));
}
@@ -745,13 +744,13 @@ namespace Active_Client.Browser_Tools
func = e.Arguments[1],
file = p
};
Thread t = new Thread(startNewEditor);
t.Start();
}
public void startNewEditor()
{
{
Process proc = new Process
{
StartInfo = new ProcessStartInfo()
@@ -769,7 +768,7 @@ namespace Active_Client.Browser_Tools
public void cleanFileWatcher(object sender, CfrV8HandlerExecuteEventArgs e)
{
if(watcher != null)
if (watcher != null)
{
watcher.EnableRaisingEvents = false;
@@ -832,7 +831,7 @@ namespace Active_Client.Browser_Tools
else
isFirst = false;
stringBuilder.Append(stringVal);
stringBuilder.Append(stringVal);
}
File.WriteAllLines(RECENT_FILE_PATH, stringBuilder.ToString()
@@ -865,7 +864,7 @@ namespace Active_Client.Browser_Tools
{
if (file.FileExist && !file.IsMain)
files.Add(file);
}
}
// Check if software need to upload all the files
@@ -881,7 +880,7 @@ namespace Active_Client.Browser_Tools
files.Add(new FileModel()
{
AbsolutePath = subfileName,
FileExist = true,
FileExist = true,
IsDirectory = false,
IsMain = false,
Name = Path.GetFileName(subfileName),
@@ -969,7 +968,7 @@ namespace Active_Client.Browser_Tools
//Task to execute
var task = new CfrTask();
task.Execute += (s, e) =>
{
{
context.Enter();
var args = new CfrV8Value[] { arguments };
functionIstance.ExecuteFunction(null, args); //execute callback, nothing happens here
@@ -1176,7 +1175,7 @@ namespace Active_Client.Browser_Tools
{
// Find metadata.json file
var file = zipArchive.Entries.Where(x => x.FullName == JOB_METADATA_FILENAME).FirstOrDefault();
if(file == null)
if (file == null)
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_corrupted_model")));
return;
@@ -1342,7 +1341,7 @@ namespace Active_Client.Browser_Tools
{
ZipFile.CreateFromDirectory(JOB_OPENING_PATH, jobPath);
}
catch(Exception ex)
catch (Exception ex)
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_save_file")));
return;
-4
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models.Errors
{
+1 -7
View File
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models
namespace Active_Client.Browser_Tools.Models
{
public class FileModel
{
-3
View File
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models
{
-3
View File
@@ -1,9 +1,6 @@
using Active_Client.Browser_Tools.Models.Metadata;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Active_Client.Browser_Tools.Models.Metadata
{
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models.Metadata
{
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models.Metadata
namespace Active_Client.Browser_Tools.Models.Metadata
{
public class ImageParam
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Active_Client.Browser_Tools.Models.Metadata
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models.Metadata
{
@@ -1,9 +1,6 @@
using Active_Client.Browser_Tools.Models.Metadata;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models
{
+6
View File
@@ -288,4 +288,10 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Target Name="AfterBuild">
<ItemGroup>
<MoveToLibFolder Exclude="Config.xml" Include="$(OutputPath)*.dll ; $(OutputPath)*.pdb ; $(OutputPath)*.xml" />
</ItemGroup>
<Move SourceFiles="@(MoveToLibFolder)" DestinationFolder="$(OutputPath)lib" OverwriteReadOnlyFiles="true" />
</Target>
</Project>
+28 -31
View File
@@ -1,21 +1,17 @@
using Chromium;
using Active_Client.View;
using Chromium;
using Chromium.Event;
using Chromium.WebBrowser;
using Chromium.WebBrowser.Event;
using Client.Config;
using Client.Utils;
using Active_Client.View;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Management;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Active_Client
@@ -37,8 +33,8 @@ namespace Active_Client
//Crate General Exception Handler
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(GeneralExMethod);
//Read App Configuration
//Read App Configuration
readConfiguration();
//Initialize Chromium
@@ -66,9 +62,9 @@ namespace Active_Client
Application.SetCompatibleTextRenderingDefault(false);
//Check Graphic Card in Energy Saving mode
checkGraphicCard();
//Run the Loading Form
checkGraphicCard();
//Run the Loading Form
Application.Run(new OpeningForm());
//Run the Main-Browser Form
@@ -76,14 +72,14 @@ namespace Active_Client
//Force show Taskbar
NcWindow.ShowTaskBar();
}
}
#endregion
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region CONFIG_METHODS
//Sub-Method used to read the configuration
//Sub-Method used to read the configuration
static private void readConfiguration()
{
//Read the Config
@@ -107,7 +103,8 @@ namespace Active_Client
{
//Prepare List of Cards
String Cardlist = "";
foreach (ManagementObject card in VideoCards){
foreach (ManagementObject card in VideoCards)
{
Cardlist = Cardlist + " - " + card["Name"] + "\n";
}
@@ -121,7 +118,7 @@ namespace Active_Client
{
//code if key Not Exist add it and restart
Registry.SetValue(keyName, valueName, "GpuPreference=1;");
MessageBox.Show("Active has foundthis Graphic Cards:\n\n" + Cardlist +"\nThe graphic configuration has been setted. Press Ok to restart the Application",Application.ProductName);
MessageBox.Show("Active has foundthis Graphic Cards:\n\n" + Cardlist + "\nThe graphic configuration has been setted. Press Ok to restart the Application", Application.ProductName);
Application.Restart();
Environment.Exit(0);
}
@@ -143,10 +140,10 @@ namespace Active_Client
if (CfxRuntime.PlatformArch == CfxPlatformArch.x64)
CfxRuntime.LibCefDirPath = Constants.CEF_X64_PATH;
else
CfxRuntime.LibCefDirPath = Constants.CEF_X86_PATH;
//Add the event variables
CfxRuntime.LibCefDirPath = Constants.CEF_X86_PATH;
//Add the event variables
ChromiumWebBrowser.OnBeforeCfxInitialize += Chromium_OnBeforeCfxInitialize;
ChromiumWebBrowser.OnBeforeCommandLineProcessing += Chromium_OnBeforeCommandLineProcessing;
@@ -167,11 +164,11 @@ namespace Active_Client
static void Chromium_OnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
{
if (Config.ClientConfig.RenderingMethod == Constants.Rendering.CPU)
e.CommandLine.AppendSwitch("--disable-gpu");
e.CommandLine.AppendSwitch("--disable-gpu");
e.CommandLine.AppendSwitch("--enable-transparent-visuals");
e.CommandLine.AppendSwitch("--disable-pinch");
e.CommandLine.AppendSwitch("--enable-media-stream");
e.CommandLine.AppendSwitch("--enable-media-stream");
e.CommandLine.AppendSwitch("--enable-usermedia-screen-capture");
e.CommandLine.AppendSwitch("--no-proxy-server");
@@ -188,7 +185,7 @@ namespace Active_Client
e.Settings.CachePath = Constants.BROWSER_CACHE_FOLDER;
e.Settings.LocalesDirPath = Constants.CEF_LOCALES_PATH;
e.Settings.ResourcesDirPath = CfxRuntime.LibCefDirPath;
e.Settings.Locale = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName ;
e.Settings.Locale = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
}
@@ -218,10 +215,10 @@ namespace Active_Client
MessageBoxDefaultButton.Button1
);
Environment.Exit(-1);
}
}
private static void GeneralExMethod(object sender, UnhandledExceptionEventArgs args)
{
Exception e = (Exception)args.ExceptionObject;
-1
View File
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
+5 -17
View File
@@ -1,26 +1,14 @@
using Microsoft.WindowsAPICodePack.Taskbar;
using Client.Config;
using Client.Config;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Client.Utils;
using System.IO;
namespace Active_Client.View
{
public partial class LoadingForm : MetroFramework.Forms.MetroForm
{
//Constructor
{
//Constructor
public LoadingForm()
{
InitializeComponent();
@@ -37,7 +25,7 @@ namespace Active_Client.View
}
//Set window Position
this.Location = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (this.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2));
this.Location = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (this.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2));
}
+21 -22
View File
@@ -1,16 +1,15 @@
using Chromium;
using Active_Client.Browser_Tools;
using Chromium;
using Chromium.Event;
using Chromium.Remote.Event;
using Chromium.WebBrowser;
using Client.Config;
using Client.Utils;
using Active_Client.Browser_Tools;
using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using static Client.Utils.Constants;
using System.Diagnostics;
namespace Active_Client.View
{
@@ -31,7 +30,7 @@ namespace Active_Client.View
private LoadingForm LdFrm;
private static IntPtr MainHandle;
private static IntPtr NcHandle;
private static IntPtr ProdHandle;
private static IntPtr ProdHandle;
private int X = 0, Y = 0;
private string BrokenUrl;
private Boolean closeRight = false;
@@ -54,7 +53,7 @@ namespace Active_Client.View
//Setup the Icon
if (Config.ClientConfig.IsSCM)
this.Icon = Properties.Resources.MAESTRO_ACTIVE_ICON;
//Start Client Setting
InitializeClientSettings();
@@ -83,7 +82,7 @@ namespace Active_Client.View
{
var candidate = Screen.PrimaryScreen;
// If primary screen is not full HD find another screen
if(candidate.WorkingArea.Width != 1920)
if (candidate.WorkingArea.Width != 1920)
{
foreach (var s in Screen.AllScreens)
{
@@ -125,7 +124,7 @@ namespace Active_Client.View
if (Config.VendorHmiConfig.Type == 3)
NcWindow.MinimizeNcWindow();
if (Config.VendorHmiConfig.Enabled)
NcFrm.Hide();
if (Config.ProdSoftwareConfig.Enabled)
@@ -148,7 +147,7 @@ namespace Active_Client.View
{
ShowNCWindow();
}
else if(NcWindow.State == NcState.SHOWPROD)
else if (NcWindow.State == NcState.SHOWPROD)
{
ShowProdWindow();
}
@@ -172,7 +171,7 @@ namespace Active_Client.View
//Close the NC HMI && Stop Following Nc
if (Config.VendorHmiConfig.Enabled)
NcWindow.CloseNcWindow(false);
if (Config.ProdSoftwareConfig.Enabled)
NcWindow.CloseProdWindow(false);
@@ -186,7 +185,7 @@ namespace Active_Client.View
try
{
CfxRuntime.Shutdown();
}
catch (Exception)
{
@@ -197,7 +196,7 @@ namespace Active_Client.View
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
if(!closeRight)
if (!closeRight)
e.Cancel = true;
}
@@ -272,7 +271,7 @@ namespace Active_Client.View
private void BeforeDownload(object sender, CfxOnBeforeDownloadEventArgs e)
{
e.Callback.Continue("",true);
e.Callback.Continue("", true);
}
//On browser Load-Error. Event Handler called by Browser
@@ -478,7 +477,7 @@ namespace Active_Client.View
private void ShowWindow()
{
if(Config.ClientConfig.DeveloperMode && Width < 1920 && Height < 1080)
if (Config.ClientConfig.DeveloperMode && Width < 1920 && Height < 1080)
{
double ratio = (((double)Width) / 1920.0) * 100.0;
//Funzione sperimentale presa da Forum CEF
@@ -513,7 +512,7 @@ namespace Active_Client.View
w = NcFrm.Width;
h = NcFrm.Height;
}
else if(Config.ProdSoftwareConfig.Enabled)
else if (Config.ProdSoftwareConfig.Enabled)
{
w = ProdFrm.Width;
h = ProdFrm.Height;
@@ -560,8 +559,8 @@ namespace Active_Client.View
if (InvokeRequired)
Invoke((MethodInvoker)delegate ()
{
//Set Message Status
LdFrm.Show(Message);
//Set Message Status
LdFrm.Show(Message);
LdFrm.Focus();
});
else
@@ -705,7 +704,7 @@ namespace Active_Client.View
//Hide NC Method
public void HideAUXWindow()
{
if ((!Config.VendorHmiConfig.Enabled && !Config.ProdSoftwareConfig.Enabled) || (NcFrm==null && ProdFrm == null))
if ((!Config.VendorHmiConfig.Enabled && !Config.ProdSoftwareConfig.Enabled) || (NcFrm == null && ProdFrm == null))
return;
//Invoke method if is needed or call the method in STD mode
@@ -728,7 +727,7 @@ namespace Active_Client.View
else
{
if (NcFrm != null && NcFrm.Owner != null)
if (NcFrm != null && NcFrm.Owner != null)
NcFrm.Owner = null;
if (ProdFrm != null && ProdFrm.Owner != null)
ProdFrm.Owner = null;
@@ -770,7 +769,7 @@ namespace Active_Client.View
if (ss.Bounds.Width != 1920 && ss.Bounds.Height != 1080)
{
HideLoadingWindow();
if(Config.VendorHmiConfig.Enabled)
if (Config.VendorHmiConfig.Enabled)
NcWindow.CloseNcWindow(false);
if (Config.ProdSoftwareConfig.Enabled)
NcWindow.CloseProdWindow(false);
@@ -778,8 +777,8 @@ namespace Active_Client.View
}
}
}
else
{
else
{
if (Config.ClientConfig.DeveloperMode)
{
//Set the Prymary screen Size
@@ -789,7 +788,7 @@ namespace Active_Client.View
this.Height = ps.Bounds.Height;
}
}
}
else
{
if (ps.Bounds.Width != 1920 && ps.Bounds.Height != 1080)
+3 -10
View File
@@ -1,18 +1,11 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Windows.Forms;
namespace Active_Client.View
{
public partial class NcForm : Form
{
public NcForm(Color TranspColor,int PosX,int PosY)
public NcForm(Color TranspColor, int PosX, int PosY)
{
InitializeComponent();
@@ -37,7 +30,7 @@ namespace Active_Client.View
private void NcForm_FormClosing(object sender, FormClosingEventArgs e)
{
if(e.CloseReason == CloseReason.UserClosing)
if (e.CloseReason == CloseReason.UserClosing)
e.Cancel = true;
}
}
+30 -31
View File
@@ -1,9 +1,8 @@
using Chromium.Remote;
using Active_Client.Properties;
using Chromium.Remote;
using Client.Config;
using Client.Utils;
using Active_Client.Properties;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
@@ -60,7 +59,7 @@ namespace Active_Client.View
private static int LastX, LastY;
private static int LastWidth = 1024, LastHeight = 768;
private static IntPtr hhook;
private static IntPtr hhookWindow;
private static IntPtr hhookWindow;
private static IntPtr keybhook;
private static IntPtr MainViewHandle;
private static IntPtr TaskBarHandle;
@@ -70,7 +69,7 @@ namespace Active_Client.View
private static uint ProdProcessPID;
private static uint ActualPID;
private static WinEventDelegate procDelegate;
private static WinEventDelegate procDelegateWindow;
private static WinEventDelegate procDelegateWindow;
private static keyboardHookProc keybDelegate;
private static uint LastdwmsEventTime;
private static uint LastHookedPID;
@@ -102,13 +101,13 @@ namespace Active_Client.View
private static int ActiveWindowNCWindowStyle;
private static int ActiveWindowNCWindowBorder;
private static uint ActiveWindowNCPopUp;
private static uint ActiveNCWindowNCPopUp;
private static uint ActiveNCWindowNCPopUp;
public static MainForm mainFrm;
private static string prodEXEname;
private static string prodEXEname;
public static NcState State { get { return state; } }
private static NcState state;
@@ -263,8 +262,8 @@ namespace Active_Client.View
//Maximize Window if is Osai
if (Config.VendorHmiConfig.Type == 3)
ShowWindow(ncprocess.MainWindowHandle, SW_SHOWMAXIMIZED);
ShowWindow(ncprocess.MainWindowHandle, SW_SHOWMAXIMIZED);
return 0;
}
@@ -681,8 +680,8 @@ namespace Active_Client.View
//Stop following Nc Window (bring-to-font the main window) -> ONLY FOR OSAI System!
public static void StopNcFollowing()
{
//Detach the hook
{
//Detach the hook
if (hhook != IntPtr.Zero)
UnhookWinEvent(hhook);
@@ -984,9 +983,9 @@ namespace Active_Client.View
#region WINDOWS_EVENT_OVERRIDE
private static void WinEventProcWindow(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
{
//Read the actual ID of the Process
{
//Read the actual ID of the Process
GetWindowThreadProcessId(hwnd, out ActualWindowPID);
if (ActualWindowPID == NcProcessPID && NcProcessPID != 0 && hWinEventHook != ncprocess.MainWindowHandle)
{
@@ -998,7 +997,7 @@ namespace Active_Client.View
ActiveWindowNCPopUp = ((uint)ActiveWindowNCWindowStyle & WS_POPUP);
//if it has the border and a title execute focus
if (ActiveWindowNCWindowStyle != 0 && (((ActiveWindowNCWindowBorder == WS_BORDER) && ReadWindowTitle(hwnd) != "") || (ActiveWindowNCPopUp == WS_POPUP) ))
if (ActiveWindowNCWindowStyle != 0 && (((ActiveWindowNCWindowBorder == WS_BORDER) && ReadWindowTitle(hwnd) != "") || (ActiveWindowNCPopUp == WS_POPUP)))
{
if (eventType == EVENT_OBJECT_CREATE)
{
@@ -1006,8 +1005,8 @@ namespace Active_Client.View
}
else if (eventType == EVENT_OBJECT_DESTROY)
SetWindowPos(MainViewHandle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
}
}
}
}
@@ -1036,13 +1035,13 @@ namespace Active_Client.View
//if it has the border and a title execute focus
if (ActiveNCWindowStyle != 0 && ((ActiveNCWindowBorder == WS_BORDER && ReadWindowTitle(hwnd) != "") || (ActiveNCWindowNCPopUp == WS_POPUP)) && hwnd != ncprocess.MainWindowHandle)
{
Console.WriteLine("Handle: " + hwnd + " MainWindowHandle" + ncprocess.MainWindowHandle);
SetWindowPos(ncprocess.MainWindowHandle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
Console.WriteLine("Handle: " + hwnd + " MainWindowHandle" + ncprocess.MainWindowHandle);
SetWindowPos(ncprocess.MainWindowHandle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
}
}
//If the PID is the STEP-HMI Process
}
//If the PID is the STEP-HMI Process
if (ActualPID == MainProcessPID)
{
if (!IsIconic(MainViewHandle))
@@ -1088,9 +1087,9 @@ namespace Active_Client.View
//Hook Keyboard Handle
private static void KeybEventProc(int nCode, IntPtr wParam, IntPtr lParam)
{
int Key = Marshal.ReadInt32(lParam);
//Elaborate Hotkey
int Key = Marshal.ReadInt32(lParam);
//Elaborate Hotkey
if (wParam == HWND_KEYDOWN || wParam == HWND_SYSKEYDOWN)
{
if (Key == 0xA4 || Key == 0xA5)
@@ -1120,7 +1119,7 @@ namespace Active_Client.View
if (wParam == HWND_SYSKEYDOWN || wParam == HWND_KEYDOWN)
mainFrm.keyPressedHandler(altPressed, ctrlPressed, shiftPressed, Key);
}
if((wParam == HWND_SYSKEYDOWN || wParam == HWND_KEYDOWN) && !altPressed && (KeybPID == MainProcessPID || KeybPID == ProdProcessPID) && state == NcState.SHOW)
if ((wParam == HWND_SYSKEYDOWN || wParam == HWND_KEYDOWN) && !altPressed && (KeybPID == MainProcessPID || KeybPID == ProdProcessPID) && state == NcState.SHOW)
{
//IF Siemens
if (Config.VendorHmiConfig.Type == 2)
+49 -54
View File
@@ -1,22 +1,15 @@
using Microsoft.WindowsAPICodePack.Taskbar;
using Client.Config;
using Client.Config;
using Client.Config.SubModels;
using Client.Utils;
using Microsoft.WindowsAPICodePack.Taskbar;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.IO;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Client.Utils;
using System.IO;
using MetroFramework;
using Newtonsoft.Json;
using Client.Config.SubModels;
namespace Active_Client.View
{
@@ -27,7 +20,7 @@ namespace Active_Client.View
private HttpWebResponse ConnTestResponse;
private String ConnTestError;
private Task ConnTask;
private ushort WaitDot=1;
private ushort WaitDot = 1;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region WINDOW_START_&_BEHAVIOUR_METHOD
@@ -63,9 +56,9 @@ namespace Active_Client.View
private void LoadingForm_Load(object sender, EventArgs e)
{
//Force on Desktop 1
this.DesktopLocation = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (this.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2));
//Start Backgroud Task
this.DesktopLocation = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (this.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2));
//Start Backgroud Task
ConnTask = Task.Run(() => BagroundWorker());
}
@@ -126,28 +119,29 @@ namespace Active_Client.View
setOpacity(1);
//Show the loading state on the app ICON
this.Invoke((MethodInvoker)delegate () {TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Indeterminate, this.Handle); });
//try to Request
if(!Config.ConnectionConfig.BypassReadConfiguration)
this.Invoke((MethodInvoker)delegate () { TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Indeterminate, this.Handle); });
//try to Request
if (!Config.ConnectionConfig.BypassReadConfiguration)
{
setStatus("Connecting to " + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort, "");
Boolean error=false;
do {
Boolean error = false;
do
{
if (error == true)
return;
} while (!testConnection(new Uri(Config.ConnectionConfig.ReadConfigUrl),out error));
} while (!testConnection(new Uri(Config.ConnectionConfig.ReadConfigUrl), out error));
}
//Set App Opacity (Only Siemens)
if(Config.VendorHmiConfig.Type == 2)
if (Config.VendorHmiConfig.Type == 2)
setOpacity(0.85);
//Open Nc Window
setStatus("Opening NC Window... ", "");
setStatus("Opening NC Window... ", "");
if (Config.VendorHmiConfig.Enabled)
if (!OpenNcWindow())
return;
@@ -160,13 +154,13 @@ namespace Active_Client.View
var exename = Path.GetFileNameWithoutExtension(Config.ProdSoftwareConfig.Path);
if (!OpenProdWindow(Config.ProdSoftwareConfig.Path, exename))
return;
}
//Set App Opacity
}
//Set App Opacity
setOpacity(1);
//Close the Window
closeWindow();
closeWindow();
}
@@ -195,7 +189,7 @@ namespace Active_Client.View
//Sub-Method used to test the connection
private bool testConnection(Uri url,out Boolean error)
private bool testConnection(Uri url, out Boolean error)
{
Boolean Connected = false;
error = false;
@@ -224,8 +218,8 @@ namespace Active_Client.View
//Check if it's connected
if (Connected)
{
// var jsonDefinition = new { ncVendor = "", showHMI = "", ncIp = "", ncPort = "", prodEnabled = "", prodPath = "", extPrograms = "" };
{
// var jsonDefinition = new { ncVendor = "", showHMI = "", ncIp = "", ncPort = "", prodEnabled = "", prodPath = "", extPrograms = "" };
var jsonDefinition = new ServerConfigModel();
setStatus("Connected!", "");
@@ -237,20 +231,20 @@ namespace Active_Client.View
{
var ConfigResponse = JsonConvert.DeserializeAnonymousType(reader.ReadToEnd(), jsonDefinition);
if(!String.IsNullOrWhiteSpace(ConfigResponse.NcVendor) && !String.IsNullOrWhiteSpace(ConfigResponse.ShowHMI))
if (!String.IsNullOrWhiteSpace(ConfigResponse.NcVendor) && !String.IsNullOrWhiteSpace(ConfigResponse.ShowHMI))
{
string ncVendorName = ConfigResponse.NcVendor.ToUpper();
string ncVendorHMI = ConfigResponse.ShowHMI.ToUpper();
Config.VendorHmiConfig.IpAddress = ConfigResponse.NcIp.ToUpper();
Config.VendorHmiConfig.Port = ConfigResponse.NcPort.ToUpper();
string ProdEnabled = ConfigResponse.ProdEnabled.ToUpper();
Config.VendorHmiConfig.IpAddress = ConfigResponse.NcIp.ToUpper();
Config.VendorHmiConfig.Port = ConfigResponse.NcPort.ToUpper();
string ProdEnabled = ConfigResponse.ProdEnabled.ToUpper();
string ProdPath = ConfigResponse.ProdPath.ToUpper();
string Autorun = ConfigResponse.Autorun.ToUpper();
//Read the Server Type
if (ncVendorName.Equals("DEMO"))
Config.VendorHmiConfig.Type = 0;
Config.VendorHmiConfig.Type = 0;
else if (ncVendorName.Equals("FANUC"))
Config.VendorHmiConfig.Type = 1;
else if (ncVendorName.Equals("SIEMENS"))
@@ -271,8 +265,8 @@ namespace Active_Client.View
Config.VendorHmiConfig.Enabled = true;
else
Config.VendorHmiConfig.Enabled = false;
//Autorun
//Autorun
if (Autorun.ToUpper().Equals("TRUE"))
Config.ClientConfig.Autorun = true;
else
@@ -290,9 +284,9 @@ namespace Active_Client.View
Config.TextEditorPath = ConfigResponse.EditorPath;
if (ConfigResponse.ExtSoftwares != null)
Config.ExtSoftwaresConfig = ConfigResponse.ExtSoftwares.ToArray();
return true;
Config.ExtSoftwaresConfig = ConfigResponse.ExtSoftwares.ToArray();
return true;
}
}
@@ -303,8 +297,8 @@ namespace Active_Client.View
setStatus("Error!", "Error While loading the configuration");
return false;
}
}
}
else
{
@@ -331,29 +325,30 @@ namespace Active_Client.View
//Sub-Method used to open the NC Window
private bool OpenNcWindow()
{
switch(NcWindow.StartNcWindow())
switch (NcWindow.StartNcWindow())
{
case 0: return true;
case 1: {
case 1:
{
setStatus("Close the application!", "NC Path not found: " + NcWindow.ProcessPath);
return false;
};
return false;
};
case 2:
{
setStatus("Close the application!", "Unable to start the NC application: ");
return false;
};
}
}
return false;
}
//Sub-Method used to open the NC Window
private bool OpenProdWindow(string ExePath,string ExeName)
private bool OpenProdWindow(string ExePath, string ExeName)
{
switch (NcWindow.StartProdWindow(ExePath, ExeName))
{
+1 -8
View File
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Windows.Forms;
namespace Active_Client.View
@@ -1,10 +1,7 @@
using Thermo.Active.CmsConnectGateway.Builders;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Thermo.Active.CmsConnectGateway.Builders;
namespace Thermo.Active.CmsConnectGateway
{
@@ -52,7 +49,7 @@ namespace Thermo.Active.CmsConnectGateway
config.dnsPrefixes = dnsPrefixes;
return this;
}
public GatewayNetworkConfiguration GenerateConfiguration()
{
@@ -93,7 +90,7 @@ namespace Thermo.Active.CmsConnectGateway
return config;
}
}
}
@@ -1,10 +1,7 @@
using Thermo.Active.CmsConnectGateway.Builders;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Thermo.Active.CmsConnectGateway.Builders;
namespace Thermo.Active.CmsConnectGateway
{
@@ -79,7 +76,7 @@ namespace Thermo.Active.CmsConnectGateway
//Controls empty spaces
CheckNoEmptySpaces(config.address, "Address");
if(config.username != null)
if (config.username != null)
CheckNoEmptySpaces(config.username, "Username");
if (config.password != null)
CheckNoEmptySpaces(config.password, "Password");
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Thermo.Active.CmsConnectGateway.Builders
{
@@ -51,13 +47,13 @@ namespace Thermo.Active.CmsConnectGateway.Builders
}
internal void CheckNoEmptySpaces(string strToCheck,string paramName)
internal void CheckNoEmptySpaces(string strToCheck, string paramName)
{
if (strToCheck.Contains(" "))
throw new FormatException("BAD FORMAT - param \"" + paramName + "\" must be without empty spaces");
}
private bool EvaluateIPV4(string stringValue, out IPAddress address)
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.CmsConnectGateway.Events
{
@@ -1,14 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.CmsConnectGateway.Exceptions
{
public class GatewayException: Exception
public class GatewayException : Exception
{
public GatewayException(string message): base(message)
public GatewayException(string message) : base(message)
{
}
}
@@ -1,7 +1,5 @@
using Renci.SshNet;
using Renci.SshNet.Common;
using Thermo.Active.CmsConnectGateway.Events;
using Thermo.Active.CmsConnectGateway.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -11,6 +9,8 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Thermo.Active.CmsConnectGateway.Events;
using Thermo.Active.CmsConnectGateway.Exceptions;
namespace Thermo.Active.CmsConnectGateway
{
@@ -127,7 +127,7 @@ namespace Thermo.Active.CmsConnectGateway
/// <exception cref="GatewayException"></exception>
public GatewayNetworkConfiguration ReadGatewayNetworkConfiguration()
{
return ElaborateConfigFromSshNetworkCommand( SendSSHCommand(SSH_GET_NETWORK_COMMAND) );
return ElaborateConfigFromSshNetworkCommand(SendSSHCommand(SSH_GET_NETWORK_COMMAND));
}
@@ -184,9 +184,9 @@ namespace Thermo.Active.CmsConnectGateway
}
hand(this, ev);
};
// Create a task and not start it.
Task t = new Task (() => action(delay, handler));
Task t = new Task(() => action(delay, handler));
t.Start();
}
@@ -217,7 +217,7 @@ namespace Thermo.Active.CmsConnectGateway
}
#endregion
//---------------------------------------------------------------------------------------------------
#region SSH_commands_preparations_sub_methods
@@ -255,7 +255,7 @@ namespace Thermo.Active.CmsConnectGateway
return command.ToString();
}
//SSH command generator for Network setting
private string GenerateSshNetworkCommand(GatewayNetworkConfiguration configuration)
@@ -272,7 +272,7 @@ namespace Thermo.Active.CmsConnectGateway
IPNetwork tempIpNetw = IPNetwork.Parse(configuration.ipAddress, configuration.netMaskAddress);
command.Append(configuration.ipAddress).Append("/").Append(tempIpNetw.Cidr).Append(" ");
if(configuration.defaultGatewayAddress != null)
if (configuration.defaultGatewayAddress != null)
command.Append(configuration.defaultGatewayAddress);
}
@@ -298,7 +298,7 @@ namespace Thermo.Active.CmsConnectGateway
{
StringBuilder command = new StringBuilder(SSH_SET_DNSSUFFIX_COMMAND);
if(configuration.dnsPrefixes != null)
if (configuration.dnsPrefixes != null)
command.Append(string.Join(",", configuration.dnsPrefixes));
return command.ToString();
@@ -368,7 +368,7 @@ namespace Thermo.Active.CmsConnectGateway
if (!stringValue.Contains('/'))
throw new GatewayException("Internal Gateway Error during read (bad format): " + IP_ADDR_LABEL + stringValue);
string [] tempAddr = stringValue.Split('/');
string[] tempAddr = stringValue.Split('/');
//Check if has lenght == 2
if (tempAddr.Length != 2)
throw new GatewayException("Internal Gateway Error during read (bad format): " + IP_ADDR_LABEL + stringValue);
@@ -445,7 +445,7 @@ namespace Thermo.Active.CmsConnectGateway
if (tempStr.Length == 0)
configuration.dnsPrefixes = null;
else
configuration.dnsPrefixes = tempStr.Where(X=> !String.IsNullOrEmpty(X)).ToList();
configuration.dnsPrefixes = tempStr.Where(X => !String.IsNullOrEmpty(X)).ToList();
}
}
@@ -473,7 +473,7 @@ namespace Thermo.Active.CmsConnectGateway
if (!stringValue.Contains(':'))
throw new GatewayException("Internal Gateway Error during read (bad format): " + PROXY_ADDR_LABEL + stringValue);
string[] tempAddr = stringValue.Split(':');
//Check if has lenght == 2
if (tempAddr.Length != 2)
throw new GatewayException("Internal Gateway Error during read (bad format): " + PROXY_ADDR_LABEL + stringValue);
@@ -510,7 +510,7 @@ namespace Thermo.Active.CmsConnectGateway
throw new GatewayException("Internal Gateway Error during read (bad format): " + PROXY_ADDR_LABEL + stringValue);
if (tempAddr.Length != 2)
throw new GatewayException("Internal Gateway Error during read (bad format): " + PROXY_ADDR_LABEL + stringValue);
//Set the username
configuration.username = tempLogin[0];
//Set the password
@@ -524,7 +524,7 @@ namespace Thermo.Active.CmsConnectGateway
throw new GatewayException("Internal Gateway Error during read (bad format): " + PROXY_ADDR_LABEL + stringValue);
configuration.port = tempPort;
}
}
}
@@ -538,7 +538,7 @@ namespace Thermo.Active.CmsConnectGateway
{
string[] tempStr = stringValue.Trim('"').Split(',');
for (int i=0;i<tempStr.Length;i++)
for (int i = 0; i < tempStr.Length; i++)
tempStr[i] = tempStr[i].Trim();
if (tempStr.Length == 0)
@@ -562,7 +562,7 @@ namespace Thermo.Active.CmsConnectGateway
}
private bool EvaluateIPV4(string stringValue,out IPAddress address)
private bool EvaluateIPV4(string stringValue, out IPAddress address)
{
Regex rgx = new Regex(@"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");
@@ -583,7 +583,7 @@ namespace Thermo.Active.CmsConnectGateway
//Override sendCommand for single command
private List<string> SendSSHCommand(string command)
{
return SendSSHCommand(new List<string> {command});
return SendSSHCommand(new List<string> { command });
}
@@ -594,12 +594,12 @@ namespace Thermo.Active.CmsConnectGateway
List<string> returnedValues = new List<string>();
//Create the SSH Gateway
SshClient _sshGateway = new SshClient(this.host, this.username, this.password);
SshClient _sshGateway = new SshClient(this.host, this.username, this.password);
try
{
//Connect
_sshGateway.Connect();
foreach(string cmd in command)
foreach (string cmd in command)
{
//Run command
sshCmd = _sshGateway.RunCommand(cmd);
@@ -655,7 +655,7 @@ namespace Thermo.Active.CmsConnectGateway
private void SendSSHReboot(int seconds)
{
//Send SSH Command
SendSSHCommand(SSH_GW_REBOOT_COMMAND + seconds);
SendSSHCommand(SSH_GW_REBOOT_COMMAND + seconds);
//Wait the time for reboot
Thread.Sleep((seconds + 5) * 1000);
@@ -708,7 +708,7 @@ namespace Thermo.Active.CmsConnectGateway
}
} while (!disconnected);
//Phase 2 Wait Re-connection Cycle
bool connected = false;
do
@@ -716,7 +716,7 @@ namespace Thermo.Active.CmsConnectGateway
try
{
//If TimeSpan > TOT MIN -> Exception
if((DateTime.Now - nowAfterReboot) > TimeSpan.FromMinutes(REBOOT_MINUTES_MAX))
if ((DateTime.Now - nowAfterReboot) > TimeSpan.FromMinutes(REBOOT_MINUTES_MAX))
throw new GatewayException("Timeout Error during reboot - Gateway not found during reboot");
//Try Connection
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Thermo.Active.CmsConnectGateway
@@ -13,8 +10,8 @@ namespace Thermo.Active.CmsConnectGateway
public class GatewayNetworkConfiguration
{
internal GatewayNetworkConfiguration() {}
public Boolean hasDhcp { get; internal set;}
internal GatewayNetworkConfiguration() { }
public Boolean hasDhcp { get; internal set; }
public IPAddress ipAddress { get; internal set; }
public IPAddress netMaskAddress { get; internal set; }
public IPAddress defaultGatewayAddress { get; internal set; }
@@ -23,18 +20,18 @@ namespace Thermo.Active.CmsConnectGateway
public override string ToString()
{
return "hasDhcp: " + hasDhcp + Environment.NewLine +
"ipAddress: " + (ipAddress != null ? ipAddress.ToString() : "null") + Environment.NewLine +
"netMaskAddress: " + (netMaskAddress != null ? netMaskAddress.ToString() : "null") + Environment.NewLine +
"defaultGatewayAddress: " + (defaultGatewayAddress != null ? defaultGatewayAddress.ToString() : "null") + Environment.NewLine +
"dnsAddresses: " + (dnsAddresses != null ? string.Join(",", dnsAddresses) : "null") + Environment.NewLine +
"dnsPrefixes: " + (dnsPrefixes != null ? string.Join(",", dnsPrefixes) : "null");
return "hasDhcp: " + hasDhcp + Environment.NewLine +
"ipAddress: " + (ipAddress != null ? ipAddress.ToString() : "null") + Environment.NewLine +
"netMaskAddress: " + (netMaskAddress != null ? netMaskAddress.ToString() : "null") + Environment.NewLine +
"defaultGatewayAddress: " + (defaultGatewayAddress != null ? defaultGatewayAddress.ToString() : "null") + Environment.NewLine +
"dnsAddresses: " + (dnsAddresses != null ? string.Join(",", dnsAddresses) : "null") + Environment.NewLine +
"dnsPrefixes: " + (dnsPrefixes != null ? string.Join(",", dnsPrefixes) : "null");
}
}
public class GatewayProxyConfiguration
{
internal GatewayProxyConfiguration(){}
internal GatewayProxyConfiguration() { }
public Boolean hasProxy { get; internal set; }
public string address { get; internal set; }
public uint port { get; internal set; }
@@ -45,12 +42,12 @@ namespace Thermo.Active.CmsConnectGateway
public override string ToString()
{
return "hasProxy: " + hasProxy + Environment.NewLine +
"address: " + (address != null ? address.ToString() : "null") + Environment.NewLine +
"port: " + (port != 0 ? port.ToString() : "null") + Environment.NewLine +
"username: " + (username != null ? username : "null") + Environment.NewLine +
"password: " + (password != null ? password : "null") + Environment.NewLine +
"noproxyAddresses: " + (noproxyAddresses != null ? string.Join(",", noproxyAddresses) : "null");
return "hasProxy: " + hasProxy + Environment.NewLine +
"address: " + (address != null ? address.ToString() : "null") + Environment.NewLine +
"port: " + (port != 0 ? port.ToString() : "null") + Environment.NewLine +
"username: " + (username != null ? username : "null") + Environment.NewLine +
"password: " + (password != null ? password : "null") + Environment.NewLine +
"noproxyAddresses: " + (noproxyAddresses != null ? string.Join(",", noproxyAddresses) : "null");
}
}
}
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
+262 -82
View File
@@ -2,184 +2,364 @@
<modules>
<block>
<id>1</id>
<localizedLabels>
<lang langKey="en">DiscesaCZ ENG</lang>
<lang langKey="it">DiscesaCZ ITA</lang>
</localizedLabels>
<label>MB_DiscesaCZ</label>
<type>MOVEMENT</type>
<section>HEATING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<showStatus>false</showStatus>
<priority>1</priority>
</block>
<block>
<id>2</id>
<localizedLabels>
<lang langKey="en">MembDiscesaZ ENG</lang>
<lang langKey="it">MembDiscesaZ ITA</lang>
</localizedLabels>
<label>MB_MembDiscesaZ</label>
<type>MOVEMENT</type>
<section>HEATING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<showStatus>false</showStatus>
<priority>1</priority>
</block>
<block>
<id>3</id>
<localizedLabels>
<lang langKey="en">MembZ ENG</lang>
<lang langKey="it">MembZ ITA</lang>
</localizedLabels>
<label>MB_MembZ</label>
<type>MOVEMENT</type>
<section>HEATING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<showStatus>false</showStatus>
<priority>1</priority>
</block>
<block>
<id>4</id>
<localizedLabels>
<lang langKey="en">Mod_MembSalitaZ ENG</lang>
<lang langKey="it">Mod_MembSalitaZ ITA</lang>
</localizedLabels>
<label>MB_Mod_MembSalitaZ</label>
<type>MOVEMENT</type>
<section>HEATING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>1</priority>
</block>
<block>
<id>5</id>
<label>MB_Mod_AppoggioDiscesaW</label>
<type>MOVEMENT</type>
<section>HEATING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<showStatus>false</showStatus>
<priority>1</priority>
</block>
<block>
<id>6</id>
<localizedLabels>
<lang langKey="en">Mod_RiscaldoInf ENG</lang>
<lang langKey="it">Mod_RiscaldoInf ITA</lang>
</localizedLabels>
<label>MB_Mod_RiscaldoInf</label>
<type>HEATING</type>
<section>HEATING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<showStatus>false</showStatus>
<priority>1</priority>
</block>
<block>
<id>7</id>
<localizedLabels>
<lang langKey="en">Mod_RiscaldoSup ENG</lang>
<lang langKey="it">Mod_RiscaldoSup ITA</lang>
</localizedLabels>
<label>MB_Mod_RiscaldoSup</label>
<type>HEATING</type>
<section>HEATING</section>
<idParam>0</idParam>
<showDelay>false</showDelay>
<showStatus>false</showStatus>
<priority>2</priority>
</block>
<block>
<id>8</id>
<localizedLabels>
<lang langKey="en">Mod_PirometroRisc ENG</lang>
<lang langKey="it">Mod_PirometroRisc ITA</lang>
</localizedLabels>
<label>MB_Mod_PirometroRisc</label>
<type>HEATING</type>
<section>HEATING</section>
<idParam>80</idParam>
<showDelay>true</showDelay>
<showStatus>true</showStatus>
<priority>3</priority>
</block>
<block>
<id>9</id>
<label>MB_Mod_DecompSustain</label>
<type>HEATING</type>
<section>HEATING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>4</priority>
</block>
<block>
<id>10</id>
<label>MB_Mod_Acrilico</label>
<type>HEATING</type>
<section>HEATING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>5</priority>
</block>
<block>
<id>11</id>
<label>MB_Mod_RiscaldiIndietro</label>
<type>MOVEMENT</type>
<section>HEATING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>1</priority>
</block>
<block>
<id>12</id>
<label>MB_Mod_ExtraR</label>
<type>HEATING</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>1</priority>
</block>
<block>
<id>13</id>
<localizedLabels>
<lang langKey="en">Mod_Imbutitura ENG</lang>
<lang langKey="it">Mod_Imbutitura ITA</lang>
</localizedLabels>
<label>MB_Mod_Imbutitura</label>
<type>DRAWING</type>
<section>FORMING</section>
<idParam>99</idParam>
<showDelay>true</showDelay>
<showStatus>true</showStatus>
<priority>2</priority>
</block>
<block>
<id>14</id>
<label>MB_Mod_SalitaW</label>
<type>MOVEMENT</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>1</priority>
</block>
<block>
<id>15</id>
<label>MB_Mod_AttesaStampo</label>
<type>MOVEMENT</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>3</priority>
</block>
<block>
<id>16</id>
<localizedLabels>
<lang langKey="en">Mod_Raffreddamento ENG</lang>
<lang langKey="it">Mod_Raffreddamento ITA</lang>
</localizedLabels>
<label>MB_Mod_Raffreddamento</label>
<type>COOLING</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<showStatus>false</showStatus>
<priority>2</priority>
<priority>3</priority>
</block>
<block>
<id>17</id>
<localizedLabels>
<lang langKey="en">Mod_PirometroRaffr ENG</lang>
<lang langKey="it">Mod_PirometroRaffr ITA</lang>
</localizedLabels>
<label>MB_Mod_PirometroRaffr</label>
<type>COOLING</type>
<section>FORMING</section>
<idParam>139</idParam>
<showDelay>true</showDelay>
<showStatus>true</showStatus>
<priority>3</priority>
</block>
<block>
<id>19</id>
<localizedLabels>
<lang langKey="en">Mod_Vuoto ENG</lang>
<lang langKey="it">Mod_Vuoto ITA</lang>
</localizedLabels>
<type>VACUUM</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<showStatus>false</showStatus>
<priority>4</priority>
</block>
<block>
<id>21</id>
<localizedLabels>
<lang langKey="en">Mod_VuotoDiretto ENG</lang>
<lang langKey="it">Mod_VuotoDiretto ITA</lang>
</localizedLabels>
<id>19</id>
<label>MB_Mod_Vuoto</label>
<type>VACUUM</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<showStatus>false</showStatus>
<priority>5</priority>
</block>
<block>
<id>21</id>
<label>MB_Mod_VuotoDiretto</label>
<type>VACUUM</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>6</priority>
</block>
<block>
<id>23</id>
<label>MB_Mod_VuotoAux</label>
<type>VACUUM</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>7</priority>
</block>
<block>
<id>25</id>
<label>MB_Mod_Nebulizz</label>
<type>COOLING</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>8</priority>
</block>
<block>
<id>26</id>
<label>MB_Mod_AttesaPartenzaZ</label>
<type>MOVEMENT</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>9</priority>
</block>
<block>
<id>28</id>
<label>MB_Mod_DiscesaZ</label>
<type>MOVEMENT</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>9</priority>
</block>
<block>
<id>29</id>
<label>MB_Mod_Z</label>
<type>MOVEMENT</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>9</priority>
</block>
<block>
<id>30</id>
<label>MB_Mod_SalitaZ</label>
<type>MOVEMENT</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>9</priority>
</block>
<block>
<id>31</id>
<label>MB_Mod_AriaZ</label>
<type>VACUUM</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>10</priority>
</block>
<block>
<id>33</id>
<label>MB_Mod_VuotoZ</label>
<type>VACUUM</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>11</priority>
</block>
<block>
<id>34</id>
<label>MB_Mod_ScaricoVuotoZ</label>
<type>VACUUM</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>9</priority>
</block>
<block>
<id>35</id>
<label>MB_Mod_ScaricoVuoto</label>
<type>VACUUM</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>9</priority>
</block>
<block>
<id>36</id>
<localizedLabels>
<lang langKey="en">Mod_EstrazioneZ ENG</lang>
<lang langKey="it">Mod_EstrazioneZ ITA</lang>
</localizedLabels>
<label>MB_Mod_EstrazioneZ</label>
<type>EXTRACTION</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<showStatus>false</showStatus>
<priority>2</priority>
<priority>10</priority>
</block>
<block>
<id>42</id>
<localizedLabels>
<lang langKey="en">Mod_SalitaCZ ENG</lang>
<lang langKey="it">Mod_SalitaCZ ITA</lang>
</localizedLabels>
<id>38</id>
<label>MB_Mod_DiscesaAssistZ</label>
<type>MOVEMENT</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<showStatus>false</showStatus>
<priority>4</priority>
</block>
<block>
<id>39</id>
<label>MB_Mod_Estrazione</label>
<type>EXTRACTION</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>2</priority>
</block>
<block>
<id>40</id>
<label>MB_Mod_DiscesaW</label>
<type>MOVEMENT</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>1</priority>
</block>
<block>
<id>41</id>
<label>MB_Mod_RiscaldiIndietro2</label>
<type>MOVEMENT</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>1</priority>
</block>
<block>
<id>42</id>
<label>MB_Mod_SalitaCZ</label>
<type>MOVEMENT</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>1</priority>
</block>
<block>
<id>43</id>
<label>MB_Mod_Riscaldi2</label>
<type>HEATING</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>1</priority>
</block>
<block>
<id>44</id>
<label>MB_Mod_Estrazione_Aux_W</label>
<type>EXTRACTION</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>3</priority>
</block>
<block>
<id>45</id>
<label>MB_Mod_Attesa_Pirometro</label>
<type>COOLING</type>
<section>FORMING</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>4</priority>
</block>
<block>
<id>46</id>
<label>MB_Mod_Prevuoto</label>
<type>VACUUM</type>
<section>HEATING</section>
<idParam>-1</idParam>
<showDelay>true</showDelay>
<priority>6</priority>
</block>
<block>
<id>47</id>
<label>MB_Mod_SalitaAssistZ</label>
<type>MOVEMENT</type>
<section>EXTRACTION</section>
<idParam>-1</idParam>
<showDelay>false</showDelay>
<priority>4</priority>
</block>
</modules>
@@ -8,19 +8,11 @@
<xs:complexType>
<xs:all>
<xs:element name="id" type="xs:int"/>
<xs:element name="localizedLabels">
<xs:complexType>
<xs:sequence>
<xs:element name="lang" type="langType" minOccurs="0" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="label" type="xs:string" />
<xs:element name="type" type="mblockType" />
<xs:element name="section" type="mblockSection" />
<xs:element name="idParam" type="xs:int" />
<xs:element name="showDelay" type="xs:boolean" />
<xs:element name="showStatus" type="xs:boolean" />
<xs:element name="priority" type="xs:int" />
</xs:all>
</xs:complexType>
File diff suppressed because it is too large Load Diff
@@ -15,6 +15,22 @@
<xs:element name="description" type="xs:string" />
<xs:element name="format" type="xs:string" />
<xs:element name="scaleFactor" type="xs:int" default="1"/>
<xs:element name="numDec" type="xs:int" default="0"/>
<xs:element name="enumList" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="enumVal" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="label" type="xs:string" />
<xs:element name="value" type="xs:string" />
<xs:element name="anim" type="xs:string" minOccurs="0" />
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
@@ -38,4 +54,5 @@
<xs:enumeration value="Options"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
+2 -2
View File
@@ -5,10 +5,10 @@
<showNcHMI>false</showNcHMI>
<ncIpAddress>192.168.0.102</ncIpAddress>
<ncPort>102</ncPort>
<machineModel>Ares 37 OF</machineModel>
<machineModel>Thermo 2020</machineModel>
<sharedPath>C:\PartPrg\</sharedPath>
<sharedName>//PARTPRG:/</sharedName>
<installationDate>01/01/2019</installationDate>
<installationDate>01/06/2020</installationDate>
<mgiOption>false</mgiOption>
<siemensKeyboardOption>false</siemensKeyboardOption>
<machineNumberHasLetters>false</machineNumberHasLetters>
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
+4 -5
View File
@@ -1,8 +1,8 @@
using Thermo.Active.Model.ConfigModels;
using System.Collections.Generic;
using Thermo.Active.Model.ConfigModels;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.Scada;
using System.Collections.Generic;
namespace Thermo.Active.Config
{
@@ -11,7 +11,7 @@ namespace Thermo.Active.Config
public static ServerConfigModel ServerStartupConfig;
public static NcConfigModel NcConfig;
public static List<ExtSoftwareModel> ExtSoftwaresConfig;
public static SoftwareProdConfigModel SoftwareProdConfig;
public static SoftwareProdConfigModel SoftwareProdConfig;
public static MachineModel MachineConfig;
public static List<MaintenanceConfigModel> MaintenancesConfig;
public static ContactModel CmsContactConfig;
@@ -44,7 +44,7 @@ namespace Thermo.Active.Config
public static AreasConfigModel ScadaConfig;
public static AreasConfigModel JobEditorConfig;
public static AreasConfigModel UsersConfig;
public static List<ScadaSchemaModel> ProductionScadaSchema = new List<ScadaSchemaModel>();
public static List<ScadaSchemaModel> ConfiguredScadaSchema = new List<ScadaSchemaModel>();
@@ -62,7 +62,6 @@ namespace Thermo.Active.Config
public static List<RiskChannelModel> RiskChannelConfig;
public static List<RiskBoardModel> RiskBoardConfig;
public static LiveData RecipeLiveData = new LiveData();
}
}
+17 -204
View File
@@ -1,6 +1,4 @@
using Thermo.Active.Model.ConfigModels;
using Thermo.Active.Model.DTOModels.Scada;
using Thermo.Active.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -12,10 +10,12 @@ using System.Xml;
using System.Xml.Linq;
using System.Xml.Schema;
using System.Xml.Serialization;
using Thermo.Active.Model.ConfigModels;
using Thermo.Active.Model.DTOModels.Scada;
using Thermo.Active.Utils;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Utils.SupportFunctions;
using Newtonsoft.Json;
namespace Thermo.Active.Config
{
@@ -57,28 +57,6 @@ namespace Thermo.Active.Config
ExceptionManager.ManageError(ERROR_LEVEL.FATAL, message, true);
}
}
public static void ReadLastRecipe()
{
try
{
ReadLiveData();
}
catch (XmlException ex)
{
ExceptionManager.ManageError(ERROR_LEVEL.FATAL,
"Error while reading file: " + ex.SourceUri +
"\n Error: " + ex.Message,
true
);
}
catch (Exception ex)
{
var message = ex.Message;
if (ex.InnerException != null)
message += "\n" + ex.InnerException.Message;
ExceptionManager.ManageError(ERROR_LEVEL.FATAL, message, true);
}
}
private static XDocument GetXmlHandlerWithValidator(string configSchemaFilePath, string configFilePath, bool isFullPath = false)
{
@@ -615,10 +593,18 @@ namespace Thermo.Active.Config
Name = x.Element("name").Value,
Description = x.Element("description").Value,
Format = x.Element("format").Value,
ScaleFactor = Convert.ToInt16(x.Element("scaleFactor").Value)
ScaleFactor = Convert.ToInt16(x.Element("scaleFactor").Value),
NumDec = Convert.ToInt16(x.Element("numDec").Value),
//EnumVal = new Dictionary<string, string>()
EnumVal = x.Element("enumList") != null ? x.Element("enumList").Elements().ToDictionary(
y => y.Element("value").Value,
y => new EnumDetail(y.Element("label").Value, y.Element("anim") != null ? y.Element("anim").Value : "")
) : new Dictionary<string, EnumDetail>()
})
.ToList();
}
/// <summary>
/// Module config setup from file
/// </summary>
@@ -633,9 +619,10 @@ namespace Thermo.Active.Config
.Select(x => new ModBlockConfigModel()
{
Id = Convert.ToInt16(x.Element("id").Value),
LocalizedLabels = x.Element("localizedLabels").Elements().ToDictionary(
y => y.Attribute("langKey").Value, y => y.Value
),
Label = x.Element("label").Value,
//LocalizedLabels = x.Element("localizedLabels").Elements().ToDictionary(
// y => y.Attribute("langKey").Value, y => y.Value
// ),
Type = GetTActMB_Type(x.Element("type").Value),
Section = GetTActMB_Section(x.Element("section").Value),
IdParam = Convert.ToInt16(x.Element("idParam").Value),
@@ -846,180 +833,6 @@ namespace Thermo.Active.Config
.Select(x => x.Value)
.ToList();
}
/// <summary>
/// Try to load live data from json persistence file
/// </summary>
public static bool ReadLiveData()
{
bool answ = false;
if (File.Exists(LIVE_RECIPE_PATH))
{
// load all text data
var rawData = File.ReadAllText(LIVE_RECIPE_PATH);
try
{
// deserialize to object
RecipeLiveData = JsonConvert.DeserializeObject<LiveData>(rawData);
}
catch
{ }
answ = true;
}
else
{
// reload from template...
var rawData = File.ReadAllText(RECIPE_TEMPLATE_PATH);
try
{
// deserialize to object
RecipeLiveData = JsonConvert.DeserializeObject<LiveData>(rawData);
}
catch
{ }
// salva current
SaveRecipeCurrent();
answ = true;
}
// rendo se fatto
return answ;
}
/// <summary>
/// Try to load selected recipe to live data (memory and json persistence file)
/// </summary>
public static bool LoadRecipe(string filePath)
{
bool answ = false;
// check file extension
string fileName = Path.GetFileName(filePath);
if (!fileName.EndsWith(".json"))
{
fileName += ".json";
filePath += ".json";
}
// check filePath...
if (!filePath.Contains(RECIPE_DIRECTORY) && filePath != RECIPE_TEMPLATE_PATH)
{
// aggiungo base path!
filePath = RECIPE_DIRECTORY + filePath;
}
if (File.Exists(filePath))
{
answ = true;
// load all text data
var rawData = File.ReadAllText(filePath);
try
{
// deserialize to object
RecipeLiveData = JsonConvert.DeserializeObject<LiveData>(rawData);
}
catch
{ }
// update current live data!
SaveRecipeCurrent();
}
// rendo se fatto
return answ;
}
/// <summary>
/// Try to load template recipe
/// </summary>
public static bool LoadTemplate()
{
bool answ = false;
// check filePath...
if (File.Exists(RECIPE_TEMPLATE_PATH))
{
answ = true;
// load all text data
var rawData = File.ReadAllText(RECIPE_TEMPLATE_PATH);
try
{
// deserialize to object
RecipeLiveData = JsonConvert.DeserializeObject<LiveData>(rawData);
// update NAME
RecipeLiveData.RecipeName = $"{DateTime.Now:yyyyMMss_HHmmss}.json";
}
catch
{ }
// update current live data!
SaveRecipeCurrent();
}
// rendo se fatto
return answ;
}
/// <summary>
/// Try to write live data to json persistence file
/// </summary>
public static bool SaveRecipeCurrent()
{
bool answ = false;
try
{
answ = true;
// serialize
string rawData = JsonConvert.SerializeObject(RecipeLiveData);
// save live!
var dir = Path.GetDirectoryName(LIVE_RECIPE_PATH);
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
File.WriteAllText(LIVE_RECIPE_PATH, rawData);
}
catch
{ }
// rendo se fatto
return answ;
}
/// <summary>
/// Try to save live recipe as NEW template
/// </summary>
public static bool SaveRecipeTemplate()
{
RecipeLiveData.RecipeName = "template.json";
return SaveRecipe(RECIPE_TEMPLATE_PATH);
}
/// <summary>
/// Try to save live recipe to selected filePath
/// </summary>
public static bool SaveRecipe(string filePath)
{
bool answ = false;
try
{
answ = true;
string fileName = Path.GetFileName(filePath);
if (!fileName.EndsWith(".json"))
{
fileName += ".json";
filePath += ".json";
}
// fix name!
RecipeLiveData.RecipeName = fileName;
// serialize
string rawData = JsonConvert.SerializeObject(RecipeLiveData);
// save live!
File.WriteAllText(LIVE_RECIPE_PATH, rawData);
// check filePath...
if (!filePath.Contains(RECIPE_DIRECTORY) && filePath != RECIPE_TEMPLATE_PATH)
{
// aggiungo base path!
filePath = RECIPE_DIRECTORY + filePath;
}
// save!
File.WriteAllText(filePath, rawData);
}
catch
{ }
// rendo se fatto
return answ;
}
public static string CalculateHash(string filename)
{
using (var sha = SHA1.Create())
@@ -55,7 +55,6 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Compile Include="LiveData.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServerConfig.cs" />
<Compile Include="ServerConfigController.cs" />
@@ -91,6 +90,7 @@
</Content>
<EmbeddedResource Include="Config\userSoftKeyConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<Content Include="Config\areasConfig.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -101,9 +101,11 @@
</Content>
<EmbeddedResource Include="Config\recipeConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Config\maintenancesConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<Content Include="Config\alarmsConfig.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -118,12 +120,15 @@
</Content>
<EmbeddedResource Include="Config\serverConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Config\alarmsConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Config\ncSoftKeyConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
@@ -145,41 +150,49 @@
<ItemGroup>
<EmbeddedResource Include="Config\areasConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Config\macrosConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Config\scadaValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Config\cmsConnectConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Config\customerContactConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Config\headsConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Config\moduleBlockConfigValidator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Config\risk2007Validator.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
+21 -13
View File
@@ -1,12 +1,4 @@
using CMS_CORE_Library.Models;
using Thermo.Active.Config;
using Thermo.Active.Core;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.Scada;
using Thermo.Active.NC;
using Thermo.Active.Utils;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -18,14 +10,20 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using TeamDev.SDK.MVVM;
using Thermo.Active.Core;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.Scada;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThRecipe;
using Thermo.Active.Model.DTOModels.ThWarmers;
using Thermo.Active.NC;
using Thermo.Active.Utils;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Utils.ExceptionManager;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThProd;
using Thermo.Active.Model.DTOModels.ThRecipe;
using Thermo.Active.Model.DTOModels.ThWarmers;
public static class ThreadsFunctions
{
@@ -124,7 +122,7 @@ public static class ThreadsFunctions
catch (ThreadAbortException ex)
{
ncAdapter.Dispose();
}
}
}
/// <summary>
@@ -794,6 +792,16 @@ public static class ThreadsFunctions
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_THERMO_RECIPE_FULL, null, currRecipe);
// FIXME TODO verificare come ridurre chiamate
// ora gestisco la overview!
libraryError = ncAdapter.GetRecipeOverview(out Dictionary<RecipeSection, RecipeCatStatus> currOverview);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_THERMO_RECIPE_OVERWIEW, null, currOverview);
}
else
RestoreConnection();
+5 -5
View File
@@ -1,12 +1,12 @@
using Thermo.Active.Core.Properties;
using Thermo.Active.Model;
using Thermo.Active.Utils;
using System;
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using TeamDev.SDK.MVVM;
using Thermo.Active.Core.Properties;
using Thermo.Active.Model;
using Thermo.Active.Utils;
namespace Thermo.Active.Core
{
@@ -125,7 +125,7 @@ namespace Thermo.Active.Core
public static void StopThread()
{
if (SiemensHmi!= null && SiemensHmi.IsAlive)
if (SiemensHmi != null && SiemensHmi.IsAlive)
SiemensHmi.Abort();
}
@@ -1,15 +1,13 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using System;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.IO;
using System.Linq;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using static Thermo.Active.Config.ServerConfig;
using System.Diagnostics;
using Thermo.Active.Config;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Database.Controllers
{
@@ -37,7 +35,7 @@ namespace Thermo.Active.Database.Controllers
var index = userIds.IndexOf(-1);
if (userIds.IndexOf(-1) != -1)
ifNoUser = true;
List<int> ncAlarmDescIds = dbCtx
.AlarmDescriptions
.Where(x => x.Title.Contains(title))
@@ -45,7 +43,7 @@ namespace Thermo.Active.Database.Controllers
.ToList();
// Get Plc messages ids
List<int> plcAlarmDescIds =
List<int> plcAlarmDescIds =
plcMessages
.Where(x => x.Value.IndexOf(title, StringComparison.OrdinalIgnoreCase) >= 0)
//.Where(x => x.Value.Contains(title))
@@ -60,8 +58,8 @@ namespace Thermo.Active.Database.Controllers
.Where(x =>
x.TimeStamp >= startDate && x.TimeStamp <= endDate // Filter by date
&& sources.Contains(x.Source) // Check source
&& ( (ifNoUser && x.Users.Count() == 0) || x.Users.Any(y => userIds.Any(z => z == y.UserId))) // Check user
&&
&& ((ifNoUser && x.Users.Count() == 0) || x.Users.Any(y => userIds.Any(z => z == y.UserId))) // Check user
&&
((x.Source == ALARM_SOURCE.NC && ncAlarmDescIds.Contains(x.AlarmDescriptionId.Value)) // Check if message is contained in NC messages
|| (x.Source == ALARM_SOURCE.PLC && plcAlarmDescIds.Contains(x.AlarmId))) // Check if message is contained in PLC messages
).OrderByDescending(t => t.AlarmOccurrenceId);
@@ -137,7 +135,7 @@ namespace Thermo.Active.Database.Controllers
{
int numberOfRows = CountRows();
if(numberOfRows >= ServerStartupConfig.MaxAlarmsRows)
if (numberOfRows >= ServerStartupConfig.MaxAlarmsRows)
{
dbCtx.Database.ExecuteSqlCommand("DELETE FROM alarm_occurrence LIMIT {0}", ServerStartupConfig.AlarmToDelete);
}
@@ -151,7 +149,7 @@ namespace Thermo.Active.Database.Controllers
public void EmptyAlarms()
{
int numberOfRows = CountRows();
dbCtx.Database.ExecuteSqlCommand("DELETE FROM alarm_occurrence LIMIT {0}", numberOfRows);
}
@@ -1,8 +1,8 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
@@ -59,8 +59,8 @@ namespace Thermo.Active.Database.Controllers
{
return dbCtx
.FunctionsAccess
.Select( x => new DTORuntimeFunctionalityModel()
{
.Select(x => new DTORuntimeFunctionalityModel()
{
Id = x.FunctionAccessId,
Area = x.Area,
Name = x.Name,
@@ -1,6 +1,6 @@
using Thermo.Active.Model.DatabaseModels;
using System;
using System;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using static Thermo.Active.Config.ServerConfig;
namespace Thermo.Active.Database.Controllers
@@ -1,8 +1,8 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Database.Controllers
@@ -1,13 +1,13 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.MaintenanceModels;
using Thermo.Active.Utils;
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Entity;
using System.IO;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.MaintenanceModels;
using Thermo.Active.Utils;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
@@ -42,7 +42,7 @@ namespace Thermo.Active.Database.Controllers
foreach (PerformedMaintenanceModel maintenance in maintList)
{
if(maintenance.ControlWord != -2)
if (maintenance.ControlWord != -2)
valRet.Add(new DTOPerformModel()
{
Date = maintenance.Date,
@@ -64,7 +64,7 @@ namespace Thermo.Active.Database.Controllers
where m1.MaintenanceId == maintenances.MaintenanceId
select m1.Date
).Max()
select maintenances)
select maintenances)
.Include("Maintainer")
.ToList();
@@ -78,7 +78,7 @@ namespace Thermo.Active.Database.Controllers
CounterValue = (int)counterValue,
Date = DateTime.Now,
MaintenanceId = maintenanceId,
MaintainerId = userId,
MaintainerId = userId,
ControlWord = controlWord
};
@@ -204,7 +204,7 @@ namespace Thermo.Active.Database.Controllers
// find maintenances to be updated into db
var old = dbCtx.Maintenances.FirstOrDefault(x => x.MaintenanceId == item.MaintenanceId);
if(old != null)
if (old != null)
// Update model
old = MaintenancesConfig.Where(x => x.Id == item.MaintenanceId).Select(x =>
{
@@ -397,14 +397,14 @@ namespace Thermo.Active.Database.Controllers
cw = -1;
SupportFunctions.ConvertStringMachineNumberIntoNumber(machineNumber, out bool containsLetters, out int intMachineVal);
if (!GetDataFromMaintenancePassword(password, containsLetters, out int pwdMachineNumber, out int pwdHours, out cw))
if (!GetDataFromMaintenancePassword(password, containsLetters, out int pwdMachineNumber, out int pwdHours, out cw))
return false;
// Check machine number
if(intMachineVal == pwdMachineNumber)
if (intMachineVal == pwdMachineNumber)
{
// Convert plcCounter in hours and check if password is expired
if(((plcCounter/3600) - pwdHours) <= 50)
if (((plcCounter / 3600) - pwdHours) <= 50)
{
return true; // Ok
}
@@ -458,10 +458,10 @@ namespace Thermo.Active.Database.Controllers
tmpPassword4 = tmpPassword5.Remove(tmpPassword5.Length - 1);
// Create tmpPassoword3
foreach(char c in tmpPassword4)
foreach (char c in tmpPassword4)
{
// If tmpPassword is empty copy the first character
if(tmpPassword3.Length == 0)
if (tmpPassword3.Length == 0)
{
tmpPassword3 = c.ToString();
}
@@ -1,9 +1,7 @@
using Thermo.Active.Model.DatabaseModels;
using System;
using System.Linq;
using static Thermo.Active.Config.ServerConfig;
using System;
using System.Collections.Generic;
using CMS_CORE_Library.Models;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
namespace Thermo.Active.Database.Controllers
{
@@ -1,10 +1,8 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Database.Controllers
@@ -30,12 +28,12 @@ namespace Thermo.Active.Database.Controllers
public void UpdateQueue()
{
dbCtx.Queue.RemoveRange(dbCtx.Queue);
var dbRows = new List<QueueItemsModel>();
foreach (var item in PartProgramQueue)
{
// Create database model
dbRows =item.Value.Select(x => new QueueItemsModel()
dbRows = item.Value.Select(x => new QueueItemsModel()
{
Id = x.Id,
AbsolutePath = x.AbsolutePath,
@@ -49,7 +47,7 @@ namespace Thermo.Active.Database.Controllers
// Add to db
dbCtx.Queue.AddRange(dbRows);
}
dbCtx.SaveChanges();
}
@@ -65,14 +63,14 @@ namespace Thermo.Active.Database.Controllers
item.RemainingReps = reps;
dbCtx.SaveChanges();
}
public void DeleteItem(int processId, int id)
{
QueueItemsModel item = dbCtx.Queue.FirstOrDefault(x => x.Id == id && x.Process == processId);
if(item == null)
if (item == null)
return;
dbCtx.Queue.Remove(item);
@@ -84,7 +82,7 @@ namespace Thermo.Active.Database.Controllers
{
var dbQueue = dbCtx.Queue.ToList();
bool foundData = false;
foreach(var entity in dbQueue)
foreach (var entity in dbQueue)
{
// Check if process queue exists
if (!PartProgramQueue.ContainsKey(entity.Process))
@@ -111,13 +109,13 @@ namespace Thermo.Active.Database.Controllers
QueueRunningIndexes[entity.Process] = entity.Id - 1;
}
}
public void UpdateQueueIdsAndSave(int processId)
{
// Fix new ids
for (int i = 0; i < PartProgramQueue[processId].Count(); i++)
PartProgramQueue[processId][i].Id = i + 1;
UpdateQueue();
}
}
@@ -1,9 +1,5 @@
using Thermo.Active.Database.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using Thermo.Active.Database.Redis;
namespace Thermo.Active.Database.Controllers
{
@@ -41,7 +37,7 @@ namespace Thermo.Active.Database.Controllers
redUtil.man.setRSV(redisHash, RepsDone);
}
public static bool WriteAlarmsConfigCurr(Dictionary<string,string> alarms)
public static bool WriteAlarmsConfigCurr(Dictionary<string, string> alarms)
{
string redisHash = redUtil.man.redHash(redisAlmCurr);
return redUtil.man.redSaveHashDict(redisHash, alarms);
@@ -1,7 +1,7 @@
using Thermo.Active.Model.DatabaseModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
namespace Thermo.Active.Database.Controllers
{
@@ -1,10 +1,10 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Database.Controllers
{
@@ -1,10 +1,10 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web.Helpers;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
@@ -34,7 +34,7 @@ namespace Thermo.Active.Database.Controllers
// Commit changes
dbCtx.SaveChanges();
using(MachinesUsersController machController = new MachinesUsersController())
using (MachinesUsersController machController = new MachinesUsersController())
{
machController.Create(MachineConfig.MachineId, user.UserId, 3);
}
@@ -166,13 +166,13 @@ namespace Thermo.Active.Database.Controllers
var tmpUser = dbCtx
.Users
.Where(x => x.Deleted == false) // Get not deleted users
.Join( dbCtx.MachinesUsers,
.Join(dbCtx.MachinesUsers,
u => u.UserId,
m => m.UserId,
m => m.UserId,
(u, m) => new { Users = u, MachinesUsers = m }
)
.Where(x => x.MachinesUsers.Role.Level < MIN_CMS_ROLE)
.ToList();
.ToList();
return tmpUser
.Select(x => new DTOMessageUserModel() // Return DTOUserModel
@@ -184,7 +184,7 @@ namespace Thermo.Active.Database.Controllers
})
.GroupBy(elem => elem.Id).Select(group => group.First())
.ToList();
}
}
}
#region User Manager
@@ -210,7 +210,7 @@ namespace Thermo.Active.Database.Controllers
Language = x.Language,
Role = machineController.GetUserRoleData(MachineConfig.MachineId, x.UserId)
}).Where(
x=> x.Role.Level < MIN_CMS_ROLE)
x => x.Role.Level < MIN_CMS_ROLE)
.ToList();
}
}
+4 -5
View File
@@ -1,16 +1,15 @@
using Microsoft.Win32;
using MySql.Data.Entity;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Database.Migrations;
using Thermo.Active.Model.DatabaseModels;
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Globalization;
using System.IO;
using System.Linq;
using System.ServiceProcess;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Database.Migrations;
using Thermo.Active.Model.DatabaseModels;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Utils.ExceptionManager;
@@ -86,7 +85,7 @@ namespace Thermo.Active.Database
{
// Run migrations and seed.
migrator.Update();
}
}
FindOrCreateMachineUniqueId();
@@ -1,8 +1,7 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class ThermoStart : DbMigration
{
public override void Up()
@@ -10,268 +9,268 @@ namespace Thermo.Active.Database.Migrations
CreateTable(
"dbo.alarm_description",
c => new
{
id = c.Int(nullable: false),
title = c.String(unicode: false),
})
{
id = c.Int(nullable: false),
title = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.alarm_file",
c => new
{
id = c.Int(nullable: false, identity: true),
file_name = c.String(unicode: false),
local_file_name = c.String(unicode: false),
alarm_desc_id = c.Int(nullable: false),
source = c.Int(nullable: false),
user_id = c.Int(),
})
{
id = c.Int(nullable: false, identity: true),
file_name = c.String(unicode: false),
local_file_name = c.String(unicode: false),
alarm_desc_id = c.Int(nullable: false),
source = c.Int(nullable: false),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.user_id);
CreateTable(
"dbo.user",
c => new
{
id = c.Int(nullable: false, identity: true),
username = c.String(nullable: false, unicode: false),
first_name = c.String(unicode: false),
last_name = c.String(unicode: false),
password = c.String(unicode: false),
security_stamp = c.String(unicode: false),
language = c.String(unicode: false),
deleted = c.Boolean(nullable: false),
})
{
id = c.Int(nullable: false, identity: true),
username = c.String(nullable: false, unicode: false),
first_name = c.String(unicode: false),
last_name = c.String(unicode: false),
password = c.String(unicode: false),
security_stamp = c.String(unicode: false),
language = c.String(unicode: false),
deleted = c.Boolean(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.alarm_occurrence",
c => new
{
id = c.Int(nullable: false, identity: true),
alarm_id = c.Int(nullable: false),
alarm_description_id = c.Int(),
source = c.Int(nullable: false),
type = c.Int(nullable: false),
processes = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
{
id = c.Int(nullable: false, identity: true),
alarm_id = c.Int(nullable: false),
alarm_description_id = c.Int(),
source = c.Int(nullable: false),
type = c.Int(nullable: false),
processes = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.alarm_description", t => t.alarm_description_id)
.Index(t => t.alarm_description_id);
CreateTable(
"dbo.alarm_user",
c => new
{
user_id = c.Int(nullable: false),
alarm_occurence_id = c.Int(nullable: false),
})
{
user_id = c.Int(nullable: false),
alarm_occurence_id = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.user_id, t.alarm_occurence_id })
.ForeignKey("dbo.alarm_occurrence", t => t.alarm_occurence_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => t.user_id)
.Index(t => t.alarm_occurence_id);
CreateTable(
"dbo.alarm_note",
c => new
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
user_id = c.Int(nullable: false),
alarm_desc_id = c.Int(nullable: false),
source = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
user_id = c.Int(nullable: false),
alarm_desc_id = c.Int(nullable: false),
source = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => t.user_id);
CreateTable(
"dbo.family",
c => new
{
id = c.Short(nullable: false),
name = c.String(unicode: false),
right_size = c.Byte(nullable: false),
left_size = c.Byte(nullable: false),
tcp_table = c.Byte(nullable: false),
gamma = c.Byte(nullable: false),
rotation_type = c.Byte(nullable: false),
cooling_byte = c.Byte(nullable: false),
max_speed = c.Int(nullable: false),
max_load = c.Byte(nullable: false),
min_load_pct_autoload = c.Byte(nullable: false),
max_load_pct_autoload = c.Byte(nullable: false),
dynamic_compensation = c.Byte(nullable: false),
min_load_dynamic_comp = c.Byte(nullable: false),
max_load_dynamic_comp = c.Byte(nullable: false),
life_type = c.Byte(nullable: false),
nominal_life = c.Int(nullable: false),
revive_delta = c.Int(nullable: false),
})
{
id = c.Short(nullable: false),
name = c.String(unicode: false),
right_size = c.Byte(nullable: false),
left_size = c.Byte(nullable: false),
tcp_table = c.Byte(nullable: false),
gamma = c.Byte(nullable: false),
rotation_type = c.Byte(nullable: false),
cooling_byte = c.Byte(nullable: false),
max_speed = c.Int(nullable: false),
max_load = c.Byte(nullable: false),
min_load_pct_autoload = c.Byte(nullable: false),
max_load_pct_autoload = c.Byte(nullable: false),
dynamic_compensation = c.Byte(nullable: false),
min_load_dynamic_comp = c.Byte(nullable: false),
max_load_dynamic_comp = c.Byte(nullable: false),
life_type = c.Byte(nullable: false),
nominal_life = c.Int(nullable: false),
revive_delta = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.favorite_user_softkey",
c => new
{
user_softkey_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
})
{
user_softkey_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.user_softkey_id, t.user_id });
CreateTable(
"dbo.function_access",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
write_level_min = c.Int(nullable: false),
read_level_min = c.Int(nullable: false),
area = c.String(unicode: false),
enabled = c.Boolean(nullable: false),
plc_id = c.Int(nullable: false),
})
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
write_level_min = c.Int(nullable: false),
read_level_min = c.Int(nullable: false),
area = c.String(unicode: false),
enabled = c.Boolean(nullable: false),
plc_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.machine",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
unique_id = c.String(unicode: false),
})
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
unique_id = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.machine_user",
c => new
{
id = c.Int(nullable: false, identity: true),
machine_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
role_id = c.Int(nullable: false),
})
{
id = c.Int(nullable: false, identity: true),
machine_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
role_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.machine", t => t.machine_id, cascadeDelete: true)
.ForeignKey("dbo.role", t => t.role_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => new { t.machine_id, t.user_id }, unique: true, clustered: true, name: "unique_machine_user")
.Index(t => t.role_id);
CreateTable(
"dbo.role",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
level = c.Int(nullable: false),
})
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
level = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.maintenance_file",
c => new
{
id = c.Int(nullable: false, identity: true),
file_name = c.String(unicode: false),
local_file_name = c.String(unicode: false),
maintenance_id = c.Int(nullable: false),
user_id = c.Int(),
})
{
id = c.Int(nullable: false, identity: true),
file_name = c.String(unicode: false),
local_file_name = c.String(unicode: false),
maintenance_id = c.Int(nullable: false),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.maintenance_id)
.Index(t => t.user_id);
CreateTable(
"dbo.maintenance",
c => new
{
id = c.Int(nullable: false),
intervall = c.Double(),
deadline = c.DateTime(nullable: false, precision: 0),
type = c.Int(nullable: false),
counter_id = c.Int(nullable: false),
title = c.String(unicode: false),
description = c.String(unicode: false),
unit_of_measure = c.Int(),
creation_date = c.DateTime(nullable: false, precision: 0),
last_expiration_date = c.DateTime(precision: 0),
user_id = c.Int(),
})
{
id = c.Int(nullable: false),
intervall = c.Double(),
deadline = c.DateTime(nullable: false, precision: 0),
type = c.Int(nullable: false),
counter_id = c.Int(nullable: false),
title = c.String(unicode: false),
description = c.String(unicode: false),
unit_of_measure = c.Int(),
creation_date = c.DateTime(nullable: false, precision: 0),
last_expiration_date = c.DateTime(precision: 0),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.user_id);
CreateTable(
"dbo.maintenance_note",
c => new
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
user_id = c.Int(nullable: false),
maintenance_id = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
user_id = c.Int(nullable: false),
maintenance_id = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => t.user_id)
.Index(t => t.maintenance_id);
CreateTable(
"dbo.performed_maintenance",
c => new
{
id = c.Int(nullable: false, identity: true),
date = c.DateTime(nullable: false, precision: 0),
counter_value = c.Int(nullable: false),
control_word = c.Int(nullable: false),
maintenance = c.Int(nullable: false),
maintainers_id = c.Int(),
})
{
id = c.Int(nullable: false, identity: true),
date = c.DateTime(nullable: false, precision: 0),
counter_value = c.Int(nullable: false),
control_word = c.Int(nullable: false),
maintenance = c.Int(nullable: false),
maintainers_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.maintainers_id)
.ForeignKey("dbo.maintenance", t => t.maintenance, cascadeDelete: true)
.Index(t => t.maintenance)
.Index(t => t.maintainers_id);
CreateTable(
"dbo.queue",
c => new
{
id = c.Int(nullable: false),
process = c.Int(nullable: false),
part_program_name = c.String(unicode: false),
reps = c.Int(nullable: false),
remaining_reps = c.Int(nullable: false),
absolute_path = c.String(unicode: false),
status = c.Int(nullable: false),
})
{
id = c.Int(nullable: false),
process = c.Int(nullable: false),
part_program_name = c.String(unicode: false),
reps = c.Int(nullable: false),
remaining_reps = c.Int(nullable: false),
absolute_path = c.String(unicode: false),
status = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.id, t.process });
CreateTable(
"dbo.session",
c => new
{
id = c.Int(nullable: false, identity: true),
token = c.String(unicode: false),
machine_user_id = c.Int(nullable: false),
first_login = c.DateTime(nullable: false, precision: 0),
})
{
id = c.Int(nullable: false, identity: true),
token = c.String(unicode: false),
machine_user_id = c.Int(nullable: false),
first_login = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.machine_user", t => t.machine_user_id, cascadeDelete: true)
.Index(t => t.machine_user_id);
}
public override void Down()
{
DropForeignKey("dbo.session", "machine_user_id", "dbo.machine_user");
@@ -1,8 +1,7 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class AddedProdInfoModel : DbMigration
{
public override void Up()
@@ -10,26 +9,26 @@ namespace Thermo.Active.Database.Migrations
CreateTable(
"dbo.ProdInfo",
c => new
{
DtEvent = c.DateTime(nullable: false, precision: 0),
NumTarget = c.Short(nullable: false),
NumDone = c.Short(nullable: false),
TimeWarm = c.Int(nullable: false),
TimeVent = c.Int(nullable: false),
TimeVacuum = c.Int(nullable: false),
TimeCycleGross = c.Int(nullable: false),
TimeCycleNet = c.Int(nullable: false),
MaterialTempEndWarm = c.Double(nullable: false),
MaterialTempEndVent = c.Double(nullable: false),
MoldTemp = c.Double(nullable: false),
VacuumReadVal = c.Double(nullable: false),
MouldEnergyOUT = c.Double(nullable: false),
MouldEnergyIN = c.Double(nullable: false),
})
{
DtEvent = c.DateTime(nullable: false, precision: 0),
NumTarget = c.Short(nullable: false),
NumDone = c.Short(nullable: false),
TimeWarm = c.Int(nullable: false),
TimeVent = c.Int(nullable: false),
TimeVacuum = c.Int(nullable: false),
TimeCycleGross = c.Int(nullable: false),
TimeCycleNet = c.Int(nullable: false),
MaterialTempEndWarm = c.Double(nullable: false),
MaterialTempEndVent = c.Double(nullable: false),
MoldTemp = c.Double(nullable: false),
VacuumReadVal = c.Double(nullable: false),
MouldEnergyOUT = c.Double(nullable: false),
MouldEnergyIN = c.Double(nullable: false),
})
.PrimaryKey(t => t.DtEvent);
}
public override void Down()
{
DropTable("dbo.ProdInfo");
@@ -1,13 +1,10 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using System.Data.Entity.Migrations;
using static Thermo.Active.Model.Constants.FUNCTIONALITY_NAMES;
using static Thermo.Active.Model.Constants.AREAS;
using Thermo.Active.Model.DatabaseModels;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Model.Constants.AREAS;
using static Thermo.Active.Model.Constants.FUNCTIONALITY_NAMES;
internal sealed class Configuration : DbMigrationsConfiguration<Thermo.Active.Database.DatabaseContext>
{
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
File diff suppressed because it is too large Load Diff
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.ConfigModels
namespace Thermo.Active.Model.ConfigModels
{
public class AlarmsConfigModel
{
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.ConfigModels
namespace Thermo.Active.Model.ConfigModels
{
public class AreasConfigModel
{
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.ConfigModels
namespace Thermo.Active.Model.ConfigModels
{
public class CmsConnectConfigModel
{
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
namespace Thermo.Active.Model.ConfigModels
{
@@ -6,7 +6,7 @@ namespace Thermo.Active.Model.ConfigModels
public class MaintenanceConfigModel
{
public int Id { get; set; }
public Dictionary<string, string> LocalizedName { get; set; }
public Dictionary<string, string> LocalizedName { get; set; }
public TimeSpan Intervall { get; set; }
public DateTime Deadline { get; set; }
public string Type { get; set; }
@@ -20,7 +20,7 @@ namespace Thermo.Active.Model.ConfigModels
{
public Boolean Visible { get; set; }
public string Name { get; set; }
public string Company { get; set; }
public string Company { get; set; }
public string Email { get; set; }
public string PhoneNumber { get; set; }
public string WebSite { get; set; }
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model
{
@@ -11,6 +6,6 @@ namespace Thermo.Active.Model
{
public string Title { get; set; }
public string Message { get; set; }
public ERROR_LEVEL ErrorLevel { get; set; }
public ERROR_LEVEL ErrorLevel { get; set; }
}
}
@@ -6,10 +6,10 @@ namespace Thermo.Active.Model.ConfigModels
public class ModBlockConfigModel
{
public int Id;
public Dictionary<string,string> LocalizedLabels { get; set; }
public string Label { get; set; }
public TACT_MBLOCK_TYPE Type { get; set; }
public TACT_MBLOCK_SECTION Section { get; set; }
public int IdParam{ get; set; }
public int IdParam { get; set; }
public bool ShowDelay { get; set; }
public int Priority { get; set; }
}
@@ -1,18 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.ConfigModels
namespace Thermo.Active.Model.ConfigModels
{
public class NcConfigModel
public class NcConfigModel
{
public string NcVendor { get; set; }
public bool ShowNcHMI { get; set; }
public string NcIpAddress { get; set; }
public ushort NcPort { get; set; }
public string NcUniqueId { get; set; }
public string NcUniqueId { get; set; }
public string NcName { get; set; }
public string SharedPath { get; set; }
public string SharedName { get; set; }
@@ -13,5 +13,38 @@ namespace Thermo.Active.Model.ConfigModels
public string Description { get; set; }
public string Format { get; set; }
public int ScaleFactor { get; set; }
public int NumDec { get; set; }
public Dictionary<string, EnumDetail> EnumVal { get; set; }
public string Anim { get; set; }
}
public class EnumDetail
{
public string text { get; set; } = "";
public string anim { get; set; } = "";
public EnumDetail(string text, string anim)
{
this.text = text;
this.anim = anim;
}
public override bool Equals(object obj)
{
if (!(obj is EnumDetail item))
return false;
if (text != item.text)
return false;
if (anim != item.anim)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
}
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model.ConfigModels
{
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
namespace Thermo.Active.Model.ConfigModels
{
@@ -11,7 +6,7 @@ namespace Thermo.Active.Model.ConfigModels
{
public CultureInfo Language { get; set; }
public int ServerPort { get; set; }
public string ServerAddress { get; set; }
public string ServerAddress { get; set; }
public bool EnableDirectoryBrowsing { get; set; }
public string DatabaseAddress { get; set; }
public bool AutoOpenCmsClient { get; set; }
@@ -19,7 +14,7 @@ namespace Thermo.Active.Model.ConfigModels
public string MTCFolderPath { get; set; }
public string MTCApplicationName { get; set; }
public bool CmsConnectReady { get; set; }
public bool CmsConnectReady { get; set; }
public int MaxAlarmsRows { get; set; }
public int AlarmToDelete { get; set; }
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.ConfigModels
namespace Thermo.Active.Model.ConfigModels
{
public class SoftwareProdConfigModel
{
@@ -9,7 +9,7 @@ namespace Thermo.Active.Model.ConfigModels
public Dictionary<string, string> LocalizedNames { get; set; }
public int Category { get; set; }
public bool IsActive { get; set; }
public bool IsVisible { get; set; }
public bool IsVisible { get; set; }
public bool OperatorConfirmationNeeded { get; set; }
public List<SubKeysModel> SubKeys { get; set; }
public int PlcId { get; set; }
+3 -3
View File
@@ -203,11 +203,11 @@ namespace Thermo.Active.Model
#if DEBUG
public static readonly string CLIENT_PATH_64 = BASE_PATH + @"\Client_Debug\x64\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_86 = BASE_PATH + @"\Client_Debug\x84\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_86 = BASE_PATH + @"\Client_Debug\x86\" + CLIENT_EXE_NAME;
public static string WEBSITE_DIRECTORY = Path.Combine(BASE_PATH, "..", "wwwroot");
#else
public static readonly string CLIENT_PATH_64 = BASE_PATH + @"\Client\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_86 = BASE_PATH + @"\Client\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_64 = BASE_PATH + @"\Client\x64\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_86 = BASE_PATH + @"\Client\x86\" + CLIENT_EXE_NAME;
public static string WEBSITE_DIRECTORY = BASE_PATH + "\\view";
#endif
public const string CONFIG_DIRECTORY = "Config\\";
@@ -1,10 +1,9 @@
using CMS_CORE_Library.Utils;
using Thermo.Active.Model.DatabaseModels;
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model.DTOModels.AlarmModels
@@ -46,7 +46,7 @@ namespace Thermo.Active.Model.DTOModels.AlarmModels
listAreEquals = item.PlcAlarms.All(PlcAlarms.Contains);
if (!listAreEquals)
return false;
// Check list's elements
listAreEquals = item.ProcessAlarms.All(ProcessAlarms.Contains);
if (!listAreEquals)
@@ -160,7 +160,7 @@ namespace Thermo.Active.Model.DTOModels.AlarmModels
{
public DateTime DateTime;
public bool RestorationIsEnabled;
public override bool Equals(object obj)
{
if (!(obj is DTOPlcAlarmModel item))
@@ -1,10 +1,6 @@
using Thermo.Active.Model.DatabaseModels;
using System;
using System.Collections.Generic;
using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Thermo.Active.Model.DatabaseModels;
namespace Thermo.Active.Model.DTOModels.AlarmModels
{
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Thermo.Active.Model.DTOModels
{
@@ -35,11 +34,11 @@ namespace Thermo.Active.Model.DTOModels
return false;
if (!CheckAxesDictionaries(machine, item.machine))
return false;
if (!CheckAxesDictionaries(programmePos , item.programmePos))
if (!CheckAxesDictionaries(programmePos, item.programmePos))
return false;
if (!CheckAxesDictionaries(toGo, item.toGo))
return false;
return true;
}
@@ -1,6 +1,6 @@
using Thermo.Active.Model.ConfigModels;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Globalization;
using Thermo.Active.Model.ConfigModels;
namespace Thermo.Active.Model.DTOModels
{
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels
{
@@ -1,7 +1,4 @@
using CMS_CORE_Library.Models;
using System.Linq;
using static CMS_CORE_Library.Models.DataStructures;
using static CMS_CORE_Library.Models.ThermoModels;
using static CMS_CORE_Library.Models.ThermoModels;
namespace Thermo.Active.Model.DTOModels
{
@@ -1,6 +1,4 @@
using System;
using System.Linq;
using System.Reflection;
namespace Thermo.Active.Model.DTOModels
{
@@ -18,7 +16,7 @@ namespace Thermo.Active.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;
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels
namespace Thermo.Active.Model.DTOModels
{
public class DTONcSoftKeyModel
{
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels
namespace Thermo.Active.Model.DTOModels
{
public class DTONetworkMonitorModel
{
@@ -42,7 +42,7 @@ namespace Thermo.Active.Model.DTOModels
if (IsRunning != item.IsRunning)
return false;
if (SelectedProcess != item.SelectedProcess)
if (SelectedProcess != item.SelectedProcess)
return false;
if (SelectedAxis != item.SelectedAxis)
return false;
@@ -50,7 +50,7 @@ namespace Thermo.Active.Model.DTOModels
if (item.processes.Count != processes.Count)
return false;
// Check list's elements
bool listAreEquals = item.processes.All(processes.Contains);
bool listAreEquals = item.processes.All(processes.Contains);
if (!listAreEquals)
return false;
@@ -67,15 +67,15 @@ namespace Thermo.Active.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;
@@ -84,7 +84,7 @@ namespace Thermo.Active.Model.DTOModels
if (offsetData.RealLength != item.offsetData.RealLength)
return false;
if (offsetData.RealRadius != item.offsetData.RealRadius)
return false;
@@ -94,7 +94,7 @@ namespace Thermo.Active.Model.DTOModels
return true;
}
public override int GetHashCode()
public override int GetHashCode()
{
return base.GetHashCode();
}
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels
namespace Thermo.Active.Model.DTOModels
{
public class DTORoleModel
{
@@ -1,9 +1,4 @@
using Thermo.Active.Model.ConfigModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels
{
@@ -16,6 +11,6 @@ namespace Thermo.Active.Model.DTOModels
public AreasConfigModel UtilitiesConfig;
public AreasConfigModel ScadaConfig;
public AreasConfigModel JobEditorConfig;
public AreasConfigModel UsersConfig;
public AreasConfigModel UsersConfig;
}
}
@@ -1,10 +1,5 @@
using Thermo.Active.Model.DatabaseModels;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Thermo.Active.Model.DatabaseModels;
namespace Thermo.Active.Model.DTOModels
{
@@ -36,7 +31,7 @@ namespace Thermo.Active.Model.DTOModels
}
}
public class DTOUserModel : DTOMessageUserModel
public class DTOUserModel : DTOMessageUserModel
{
public CultureInfo Language { get; set; }
public DTORoleModel Role { get; set; }
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model.DTOModels

Some files were not shown because too many files have changed in this diff Show More