Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Thermo_SIM
2021-02-23 15:43:30 +01:00
43 changed files with 1235 additions and 1175 deletions
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("THermo.Active.Thermocamera")]
[assembly: AssemblyTitle("Thermo.Active.Thermocamera")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("THermo.Active.Thermocamera")]
[assembly: AssemblyProduct("Thermo.Active.Thermocamera")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -7,8 +7,8 @@
<ProjectGuid>{8D8EC91A-3A15-4A1D-951B-A35E7068DEBD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>THermo.Active.Thermocamera</RootNamespace>
<AssemblyName>THermo.Active.Thermocamera</AssemblyName>
<RootNamespace>Thermo.Active.Thermocamera</RootNamespace>
<AssemblyName>Thermo.Active.Thermocamera</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
@@ -30,10 +30,31 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -43,7 +64,7 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="ThermocameraComunicator.cs" />
<Compile Include="ThermoCamComunicator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
@@ -51,6 +72,10 @@
<Project>{631375DD-06D3-49BB-8130-D9DDB34C429D}</Project>
<Name>Thermo.Active.Model</Name>
</ProjectReference>
<ProjectReference Include="..\Thermo.Cam.Utils\Thermo.Cam.Utils.csproj">
<Project>{e4587942-498b-4aa7-9cc9-9304eb2d05c8}</Project>
<Name>Thermo.Cam.Utils</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
@@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Thermo.Active.Model;
using Thermo.Active.Model.DTOModels.ThWarmers;
using Thermo.Cam.Utils;
namespace Thermo.Active.Thermocamera
{
public class ThermoCamComunicator
{
#region Private Fields
/// <summary>
/// Nome file da caricare (per istanza file-based)
/// </summary>
private string fileName = "";
#endregion Private Fields
#region Protected Fields
/// <summary>
/// Classe gestione ThermoCam (oggetti Image, metodi processing...)
/// </summary>
protected TCContr TCamLive = new TCContr(BASE_PATH, BASE_PATH);
#endregion Protected Fields
#region Public Fields
public static readonly string BASE_PATH = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
#endregion Public Fields
#region Private Constructors
/// <summary>
/// Init classe
/// </summary>
/// <param name="isLive">Indica aabilitazione alive straming vs load dati storici</param>
public ThermoCamComunicator(bool isLive)
{
// init classe controllo camera
TCamLive = new TCContr($"{BASE_PATH}\\{Constants.THERMO_DATA_FOLDER}", $"{BASE_PATH}\\{Constants.CONFIG_DIRECTORY}");
// avvio classe gestione thermocamera...
TCamLive.tryReloadConf();
if (isLive)
{
// SOLO PER IL LIVE --> cerco camera
TCamLive.discoveryCamera();
}
}
#endregion Private Constructors
#region Protected Methods
/// <summary>
/// Rilettura da file di tutti i dati
/// </summary>
/// <param name="fileName">Nome set file (originale + colorized + dati temperatura)</param>
/// <returns></returns>
protected bool loadData(string fileName)
{
bool done = false;
try
{
done = TCamLive.fileLoad(fileName);
}
catch
{ }
return done;
}
#endregion Protected Methods
#region Public Methods
/// <summary>
/// Restituisce lettura di tutti i punti richiesti (es centroidi riscaldi)
/// </summary>
/// <param name="setName">Nome dei dati da leggere, se "" --> live</param>
/// <param name="points">Dictionary id richiesta + punto (es canali + relativi punti medi come centro calcolato della resistenza di riferimento del canale)</param>
/// <param name="temp">Dizionario temperature come id + valore double in °C</param>
/// <returns></returns>
public bool readMultiTemperatures(string setName, Dictionary<int, ThermoPoint> points, out Dictionary<int, double> temp)
{
temp = new Dictionary<int, double>();
List<MeasurePoint> measData = new List<MeasurePoint>();
// converto la richiesta in una lista di punti di misura...
List<MeasurePoint> reqData = points.Select(item => new MeasurePoint()
{
Id = item.Key,
Coords = new System.Drawing.Point(item.Value.X, item.Value.Y),
Temperature = 0
}).ToList();
bool done = false;
if (string.IsNullOrEmpty(setName) || setName == "_live")
{
done = true;
}
else
{
// carico file vari...
done = TCamLive.fileLoad(setName);
}
measData = TCamLive.getPointsTemperature(false, reqData);
// converto valori nel formato finale
foreach (var item in measData)
{
temp.Add(item.Id, item.Temperature);
}
// fatto!
return true;
}
/// <summary>
/// Richiesta di acquisizione immagine FLIR (restituisce nome con cui sono stati salvati file)
/// </summary>
/// <returns></returns>
public string takePicture()
{
string imgName = "";
try
{
// effettua chiamata x scattare immagine e SALVARE
TCamLive.takePicture();
TCamLive.calculateTarget();
imgName = TCamLive.fileSave();
}
catch
{ }
return imgName;
}
#endregion Public Methods
}
}
@@ -1,308 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
using System.Globalization;
using System.IO.MemoryMappedFiles;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using Thermo.Active.Model.DTOModels.ThWarmers;
namespace Thermo.Active.Thermocamera
{
public class ThermocameraComunicator
{
#region Private Fields
private const int DIM_MMF = NUM_CHAR_MSG * 2 + 2;
private const string MMF_REQ = "CMS_MMF_REQ";
private const string MMF_RES = "CMS_MMF_RES";
private const int NUM_CHAR_MSG = 5000;
private const int REQ = 1;
private const int RES = 2;
private static ThermocameraComunicator _instance;
private MemoryMappedViewAccessor accessor;
private MemoryMappedViewAccessor accessorResp;
private MemoryMappedFile mmf;
private MemoryMappedFile mmfRes;
#endregion Private Fields
#region Protected Fields
/// <summary>
/// Generatore random
/// </summary>
protected Random rnd = new Random();
/// <summary>
/// Booleana dell'uso sw ext: true = Utilizzo vero sw lettura FLIR / false = simulazione SW RAND
/// </summary>
protected bool useTCamSw = true;
#endregion Protected Fields
#region Private Constructors
private ThermocameraComunicator()
{
mmf = MemoryMappedFile.CreateOrOpen(MMF_REQ, DIM_MMF);
mmfRes = MemoryMappedFile.CreateOrOpen(MMF_RES, DIM_MMF);
accessor = mmf.CreateViewAccessor();
accessorResp = mmfRes.CreateViewAccessor();
}
#endregion Private Constructors
#region Private Properties
/// <summary>
/// Simulazione valore tra 100 e 300 °C
/// </summary>
private float simVal
{
get
{
float answ = 100 + 200 * (float)rnd.NextDouble();
return answ;
}
}
#endregion Private Properties
#region Private Methods
private bool readCommand(MemoryMappedViewAccessor accessor, string command, int timeoutMS, out string resp)
{
resp = "";
byte response = 0;
int totalCycle = 0;
int sleepTime = 500;
byte[] bytesToRead = new byte[NUM_CHAR_MSG];
if (!accessor.CanRead)
return false;
//Read Pre-Command
while (response != RES)
{
totalCycle++;
accessor.Read(0, out response);
if (response != RES)
Thread.Sleep(sleepTime);
if (totalCycle * sleepTime > timeoutMS)
return false;
}
//Read Command
accessor.ReadArray(1, bytesToRead, 0, bytesToRead.Length);
//Elaborate String
string textRecieved = Encoding.UTF8.GetString(bytesToRead);
if (textRecieved == null)
return false;
string[] textSplitted = textRecieved.Replace("\0", string.Empty).Split(';');
if (textSplitted.Length < 2)
return false;
if (textSplitted[0] != command)
return false;
char[] bufferToClean = Enumerable.Repeat('\0', NUM_CHAR_MSG).ToArray();
accessor.WriteArray(0, bufferToClean, 0, bufferToClean.Length);
//Output
textSplitted = textSplitted.Skip(1).ToArray();
resp = String.Join(";", textSplitted);
return true;
}
private bool writeCommand(MemoryMappedViewAccessor accessor, string command)
{
char[] bufferToClean = Enumerable.Repeat('\0', NUM_CHAR_MSG).ToArray();
accessor.WriteArray(0, bufferToClean, 0, bufferToClean.Length);
char[] bufferToWrite = command.ToCharArray();
//Write Pre-Command
accessor.Write(0, REQ);
//Write Command
accessor.WriteArray(1, bufferToWrite, 0, bufferToWrite.Length);
return true;
}
#endregion Private Methods
#region Public Methods
/// <summary>
/// Swap x/y requesto from FLIR camera
/// </summary>
public bool flirSwapXY
{
get
{
bool answ = false;
bool.TryParse(ConfigurationManager.AppSettings["flirSwapXY"], out answ);
return answ;
}
}
public static ThermocameraComunicator getInstance()
{
if (_instance == null)
_instance = new ThermocameraComunicator();
return _instance;
}
/// <summary>
/// Restituisce lettura di tutti i punti (cetroidi) richeisti
/// </summary>
/// <param name="points">Dictionary dei canali e relativi punti medi (centro calcolato della resistenza di riferimento del canale)</param>
/// <param name="timeoutMS">Timeout in ms, 10000 std, da conf</param>
/// <param name="temp">°C</param>
/// <returns></returns>
public bool readMultiTemperatures(Dictionary<int, ThermoPoint> points, int timeoutMS, out Dictionary<int, double> temp)
{
temp = new Dictionary<int, double>();
// modalità impiego vero sw esterno
if (useTCamSw)
{
const string tempCommand = "GetTemperature";
string response;
string cmdRead = "";
foreach (var point in points)
{
if (flirSwapXY)
{
cmdRead += point.Value.Y + ";" + point.Value.X + ";";
}
else
{
cmdRead += point.Value.X + ";" + point.Value.Y + ";";
}
}
if (!writeCommand(accessor, tempCommand + ";" + cmdRead))
return false;
if (!readCommand(accessorResp, tempCommand, timeoutMS, out response))
return false;
string[] respSplitted = response.Replace(",", ".").Split(';');
int idxResp = 0;
foreach (var item in points)
{
string str = respSplitted[idxResp];
double tmp;
if (str.Trim() != "")
{
if (double.TryParse(str.Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out tmp))
temp.Add(item.Key, tmp);
else
return false;
}
idxResp++;
}
}
else
{
// simulo!
foreach (var item in points)
{
temp.Add(item.Key, simVal);
}
// attende 5 sec
Thread.Sleep(5000);
}
return true;
}
/// <summary>
/// Lettura temp singolo punto
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="timeoutMS"></param>
/// <param name="temp"></param>
/// <returns></returns>
public bool readTemperature(int x, int y, int timeoutMS, out float temp)
{
temp = 0f;
// modalità impiego vero sw esterno
if (useTCamSw)
{
const string tempCommand = "GetTemperature";
string response;
if (!writeCommand(accessor, tempCommand + ";" + x + ";" + y + ";"))
return false;
if (!readCommand(accessorResp, tempCommand, timeoutMS, out response))
return false;
response = response.TrimEnd(';');
if (!float.TryParse(response, NumberStyles.Float, CultureInfo.InvariantCulture, out temp))
return false;
}
else
{
// simulo!
temp = simVal;
// attende 5 sec
Thread.Sleep(5000);
}
return true;
}
public bool showWindow(int x, int y, int dimX, int dimY, int timeoutMS)
{
const string tempCommand = "ShowWindow";
string response;
if (!writeCommand(accessor, tempCommand + ";" + x + ";" + y + ";" + dimX + ";" + dimY + ";"))
return false;
if (!readCommand(accessorResp, tempCommand, timeoutMS, out response))
return false;
if (!response.StartsWith("1;"))
return false;
return true;
}
/// <summary>
/// Richiesta di scattare fotografia
/// </summary>
/// <param name="timeoutMS">attesa in ms, 10000 std, da conf</param>
/// <returns></returns>
public bool takePicture(int timeoutMS)
{
// modalità impiego vero sw esterno
if (useTCamSw)
{
const string tempCommand = "SetParameter_Integer";
string response;
if (!writeCommand(accessor, tempCommand + ";TAKE_IMAGE;"))
return false;
if (!readCommand(accessorResp, tempCommand, timeoutMS, out response))
return false;
if (!response.StartsWith("True;"))
return false;
}
else
{
// attende 5 sec
Thread.Sleep(5000);
}
return true;
}
#endregion Public Methods
}
}
@@ -79,8 +79,8 @@
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
+1 -1
View File
@@ -8,7 +8,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
@@ -14,7 +14,7 @@
<package id="System.IO.Pipelines" version="4.7.3" targetFramework="net462" />
<package id="System.Memory" version="4.5.4" targetFramework="net462" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net462" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net462" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net462" />
<package id="System.Threading.Channels" version="4.7.1" targetFramework="net462" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
@@ -0,0 +1,31 @@
{
"MeasPoints": [],
"CameraName": "FLIR AX5",
"CameraAddress": "",
"DestPoints": {
"Coords": [
"0, 0",
"1500, 0",
"1500, 1200",
"0, 1200"
],
"curr": 0
},
"OrigPoints": {
"Coords": [
"55, 214",
"49, 68",
"218, 80",
"197, 226"
],
"curr": 4
},
"TargetRange": {
"Max": 60.0,
"Min": 0.0
},
"TargetSize": {
"X": 1500,
"Y": 1200
}
}
+2 -2
View File
@@ -4,7 +4,7 @@
<ncVendor>S7NET</ncVendor>
<!-- NO_NC/DEMO/FANUC/SIEMENS/OSAI/S7NET -->
<showNcHMI>false</showNcHMI>
<ncIpAddress>192.168.214.1</ncIpAddress>
<ncIpAddress>192.168.0.102</ncIpAddress>
<ncPort>102</ncPort>
<machineModel>Thermo 2020</machineModel>
<sharedPath>C:\CMS\Recipes\</sharedPath>
@@ -141,7 +141,7 @@
<thread name="prodInfo" value="1000" />
<thread name="prodPanel" value="500" />
<thread name="modules" value="200" />
<thread name="recipe" value="400" />
<thread name="recipe" value="4000" />
<thread name="scada" value="1000" />
<thread name="statusCommand" value="250" />
<thread name="FlirCamera" value="500" />
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<toolTable>
<options>
<family>true</family>
<multiTool>true</multiTool>
<magazinePosition>false</magazinePosition>
</options>
<fields>
<familyName>true</familyName>
<childId>true</childId>
<magazinePositionType>true</magazinePositionType>
</fields>
</toolTable>
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="toolTable">
<xs:complexType>
<xs:all>
<xs:element name="options">
<xs:complexType>
<xs:all>
<xs:element name="family" type="xs:boolean"></xs:element>
<xs:element name="multiTool" type="xs:boolean"></xs:element>
<xs:element name="magazinePosition" type="xs:boolean"></xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="fields">
<xs:complexType>
<xs:all>
<xs:element name="familyName" type="xs:boolean"></xs:element>
<xs:element name="childId" type="xs:boolean"></xs:element>
<xs:element name="magazinePositionType" type="xs:boolean"></xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
@@ -229,6 +229,7 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<None Include="Config\ThermoConf.json" />
<None Include="packages.config" />
<None Include="Recipes\testa.rcp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -31,6 +31,27 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
+253 -248
View File
@@ -21,7 +21,6 @@ using Thermo.Active.Model.DTOModels.ThProd;
using Thermo.Active.Model.DTOModels.ThRecipe;
using Thermo.Active.Model.DTOModels.ThWarmers;
using Thermo.Active.NC;
using Thermo.Active.Thermocamera;
using Thermo.Active.Utils;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
@@ -31,6 +30,7 @@ using System.Windows;
using System.Drawing;
using System.Configuration;
using Thermo.Active.Model.DTOModels.ThIO;
using Thermo.Active.Thermocamera;
public static class ThreadsFunctions
{
@@ -51,8 +51,109 @@ public static class ThreadsFunctions
#endregion Public Fields
#region Internal Properties
/// <summary>
/// Swap x/y requesto from FLIR camera
/// </summary>
internal static bool cacheWarmers
{
get
{
bool answ = false;
bool.TryParse(ConfigurationManager.AppSettings["cacheWarmers"], out answ);
return answ;
}
}
#endregion Internal Properties
#region Private Methods
private static int CalcSleepTime(int maxSleep, int execTime)
{
int sleep = 0;
// Check if the execution time is greater than the half of the max sleep time
if (maxSleep - execTime < maxSleep / 2)
{
sleep = maxSleep;
}
else
{
sleep = maxSleep - execTime;
}
return sleep;
}
private static bool ClientIsRunning()
{
Process[] p = Process.GetProcessesByName(CLIENT_EXE_NAME_NOEXT);
foreach (Process pr in p)
{
if (pr.MainWindowHandle != IntPtr.Zero)
{
ShowWindow(pr.MainWindowHandle, 9);
SetForegroundWindow(pr.MainWindowHandle);
return true;
}
}
return false;
}
private static void clientProcess()
{
string CMSClientPath = "";
// Check if the system is 64/32 bit
if (Environment.Is64BitOperatingSystem && File.Exists(CLIENT_PATH_64))
CMSClientPath = CLIENT_PATH_64;
else if (File.Exists(CLIENT_PATH_86))
CMSClientPath = CLIENT_PATH_86;
if (!String.IsNullOrEmpty(CMSClientPath))
{
Process pr = Process.Start(CMSClientPath, null);
if (ServerStartupConfig.AutoOpenCmsClient)
{
pr.WaitForExit();
MessageServices.Current.Publish(SEND_STOP_SERVER);
}
}
}
private static Dictionary<string, string> GetPlcAlarmsTranslations(string language)
{
using (NcAdapter ncAdapter = new NcAdapter())
{
Dictionary<string, string> returnValue = new Dictionary<string, string>();
Dictionary<int, string> messages = new Dictionary<int, string>();
// Read data from CN
ncAdapter.numericalControl.NC_GetTranslatedPlcMessages(language, ref messages); // Avoid checking error because in the worst case "messages" is empty
// Id start from 1
for (int i = 1; i <= 1024; i++)
{
// Get configurated alarms
var tmpAlarmConfig = InitialAlarmsConfig.Where(x => x.PlcId == i).FirstOrDefault();
// Default string
string message = string.Format(NOT_CONFIGURATED_ALARM_MESSAGE, i);
// If is configurated
if (tmpAlarmConfig != null)
{
// Find translated string
message = messages.Where(x => x.Key == tmpAlarmConfig.AlarmId).FirstOrDefault().Value;
if (message == null)
message = string.Format(NOT_FOUND_ALARM_MESSAGE, i);
}
// Add to dictionary
returnValue.Add(i.ToString("D6") + "|900", message);
}
return returnValue;
}
}
/// <summary>
/// restituisce il periodo di campionamento SE configurato, altrimenti 1000 ms
/// </summary>
@@ -68,9 +169,106 @@ public static class ThreadsFunctions
return answ;
}
[DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
private static void StatReset()
{
foreach (var value in Counter)
{
Timers[value.Key] = 0;
Counter[value.Key] = 0;
}
}
private static void TryNcConnection()
{
// Stop all the NC threads
ThreadsHandler.Stop();
StatReset();
NcAdapter ncAdapter = new NcAdapter();
CmsError libraryError = NO_ERROR;
// Run loop until NC is connected
while (!ncAdapter.numericalControl.NC_IsConnected())
{
// Try reconnection
libraryError = ncAdapter.Connect();
if (libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING || libraryError.errorCode == CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND)
ManageLibraryError(libraryError);
else if (libraryError.errorCode != CMS_ERROR_CODES.OK)
{
ncAdapter.Dispose();
}
// Send status to UI
MessageServices.Current.Publish(SEND_NC_STATUS_UI, null, ncAdapter.numericalControl.NC_IsConnected());
// Send status to signalr
MessageServices.Current.Publish(SEND_NC_STATUS, null, ncAdapter.numericalControl.NC_IsConnected());
Thread.Sleep(1000);
}
if (!libraryError.IsError())
{
if (ServerStartupConfig.AutoOpenCmsClient)
StartCMSClient();
// Start/Restart NC threads
ThreadsHandler.StartWorkers();
reconnectionIsRunning = false;
}
}
#endregion Private Methods
#region Functions
#region Internal Methods
internal static void StatThread()
{
while (true)
{
foreach (var value in Counter)
{
if (ThreadsHandler.RunningThreadStatus.ContainsKey(value.Key) && Counter[value.Key] != 0)
{
ThreadsHandler.RunningThreadStatus[value.Key] = $"{(Timers[value.Key] / Counter[value.Key])} ms x {Counter[value.Key]}";
Timers[value.Key] = 0;
Counter[value.Key] = 0;
}
}
MessageServices.Current.Publish(SEND_THREADS_STATUS, null, ThreadsHandler.RunningThreadStatus);
Thread.Sleep(2000);
}
}
internal static void UpdateStat(string functionName, long timer)
{
if (!Timers.ContainsKey(functionName))
Timers.TryAdd(functionName, timer);
else
Timers[functionName] += timer;
if (!Counter.ContainsKey(functionName))
Counter.TryAdd(functionName, 1);
else
Counter[functionName]++;
}
#endregion Internal Methods
#region Public Methods
public static void AbortNcConnection()
{
if (ConnThread != null && ConnThread.IsAlive)
ConnThread.Abort();
}
/// <summary>
/// Manage action for conf request
@@ -126,6 +324,7 @@ public static class ThreadsFunctions
public static void ManageFlirCamera()
{
NcAdapter ncAdapter = new NcAdapter();
ThermoCamComunicator TCCom = new ThermoCamComunicator(true);
Stopwatch sw = new Stopwatch();
try
{
@@ -138,7 +337,6 @@ public static class ThreadsFunctions
{
bool flirImageReq = false;
sw.Restart();
int tOut = 30000;
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
@@ -154,7 +352,8 @@ public static class ThreadsFunctions
// if requested --> give ack!
ncAdapter.ManageFlirStrobe();
// requesto photo from library
done = ThermocameraComunicator.getInstance().takePicture(tOut);
ncAdapter.lastThermoImage = TCCom.takePicture();
done = !string.IsNullOrEmpty(ncAdapter.lastThermoImage);
if (done)
{
// init
@@ -163,7 +362,7 @@ public static class ThreadsFunctions
// recupero punti centrali resistenze
ncAdapter.GetWarmersChannelCenterPoints(out chPoints);
// richiesta temperature per i punti
done = ThermocameraComunicator.getInstance().readMultiTemperatures(chPoints, tOut, out actualTemp);
done = TCCom.readMultiTemperatures("", chPoints, out actualTemp);
// salvo dati temp sul PLC
ncAdapter.WriteRecipeWarmChTCamTempAct(actualTemp);
// give PLC strobe for uploaded Actual TEMP from image
@@ -188,6 +387,38 @@ public static class ThreadsFunctions
}
}
public static void ManageLibraryError(CmsError libraryError)
{
switch (libraryError.errorCode)
{
case CMS_ERROR_CODES.NC_PROD_ERROR:
ManageError(ERROR_LEVEL.WARNING, libraryError.localizationKey);
break;
case CMS_ERROR_CODES.NOT_CONNECTED:
RestoreConnection(); // If not connected try reconnection
break;
case CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND:
case CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND:
case CMS_ERROR_CODES.OPTION_NOT_CONSISTENT:
ManageError(ERROR_LEVEL.FATAL, libraryError.localizationKey);
break;
case CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING:
ManageError(ERROR_LEVEL.FATAL, "SIEMENS HMI NOT RUNNING");
break;
case CMS_ERROR_CODES.SELECTED_PROCESS:
ManageError(ERROR_LEVEL.WARNING, libraryError.localizationKey);
break;
case CMS_ERROR_CODES.INTERNAL_ERROR:
ManageException(ERROR_LEVEL.FATAL, libraryError.exception);
break;
}
}
/// <summary>
/// Manage status/command words for actions
/// </summary>
@@ -413,6 +644,7 @@ public static class ThreadsFunctions
ncAdapter.Dispose();
}
}
/// <summary>
/// Lettura valorichannelsIO
/// </summary>
@@ -430,7 +662,6 @@ public static class ThreadsFunctions
while (true)
{
sw.Restart();
if (ncAdapter.numericalControl.NC_IsConnected())
@@ -1247,19 +1478,6 @@ public static class ThreadsFunctions
ncAdapter.Dispose();
}
}
/// <summary>
/// Swap x/y requesto from FLIR camera
/// </summary>
internal static bool cacheWarmers
{
get
{
bool answ = false;
bool.TryParse(ConfigurationManager.AppSettings["cacheWarmers"], out answ);
return answ;
}
}
public static void ReadWarmersData()
{
@@ -1313,6 +1531,21 @@ public static class ThreadsFunctions
}
}
public static void RestoreConnection()
{
if (reconnectionIsRunning == false)
{ // Set thread as running state
reconnectionIsRunning = true;
// Start reconnection thread
ConnThread = new Thread(() =>
TryNcConnection()
);
ConnThread.Start();
}
}
public static void SetupCmsConnect()
{
NcAdapter ncAdapter = new NcAdapter();
@@ -1391,234 +1624,6 @@ public static class ThreadsFunctions
}
}
#endregion Functions
#region SupportFunctions
private static int CalcSleepTime(int maxSleep, int execTime)
{
int sleep = 0;
// Check if the execution time is greater than the half of the max sleep time
if (maxSleep - execTime < maxSleep / 2)
{
sleep = maxSleep;
}
else
{
sleep = maxSleep - execTime;
}
return sleep;
}
private static bool ClientIsRunning()
{
Process[] p = Process.GetProcessesByName(CLIENT_EXE_NAME_NOEXT);
foreach (Process pr in p)
{
if (pr.MainWindowHandle != IntPtr.Zero)
{
ShowWindow(pr.MainWindowHandle, 9);
SetForegroundWindow(pr.MainWindowHandle);
return true;
}
}
return false;
}
private static void clientProcess()
{
string CMSClientPath = "";
// Check if the system is 64/32 bit
if (Environment.Is64BitOperatingSystem && File.Exists(CLIENT_PATH_64))
CMSClientPath = CLIENT_PATH_64;
else if (File.Exists(CLIENT_PATH_86))
CMSClientPath = CLIENT_PATH_86;
if (!String.IsNullOrEmpty(CMSClientPath))
{
Process pr = Process.Start(CMSClientPath, null);
if (ServerStartupConfig.AutoOpenCmsClient)
{
pr.WaitForExit();
MessageServices.Current.Publish(SEND_STOP_SERVER);
}
}
}
private static Dictionary<string, string> GetPlcAlarmsTranslations(string language)
{
using (NcAdapter ncAdapter = new NcAdapter())
{
Dictionary<string, string> returnValue = new Dictionary<string, string>();
Dictionary<int, string> messages = new Dictionary<int, string>();
// Read data from CN
ncAdapter.numericalControl.NC_GetTranslatedPlcMessages(language, ref messages); // Avoid checking error because in the worst case "messages" is empty
// Id start from 1
for (int i = 1; i <= 1024; i++)
{
// Get configurated alarms
var tmpAlarmConfig = InitialAlarmsConfig.Where(x => x.PlcId == i).FirstOrDefault();
// Default string
string message = string.Format(NOT_CONFIGURATED_ALARM_MESSAGE, i);
// If is configurated
if (tmpAlarmConfig != null)
{
// Find translated string
message = messages.Where(x => x.Key == tmpAlarmConfig.AlarmId).FirstOrDefault().Value;
if (message == null)
message = string.Format(NOT_FOUND_ALARM_MESSAGE, i);
}
// Add to dictionary
returnValue.Add(i.ToString("D6") + "|900", message);
}
return returnValue;
}
}
[DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
private static void StatReset()
{
foreach (var value in Counter)
{
Timers[value.Key] = 0;
Counter[value.Key] = 0;
}
}
private static void TryNcConnection()
{
// Stop all the NC threads
ThreadsHandler.Stop();
StatReset();
NcAdapter ncAdapter = new NcAdapter();
CmsError libraryError = NO_ERROR;
// Run loop until NC is connected
while (!ncAdapter.numericalControl.NC_IsConnected())
{
// Try reconnection
libraryError = ncAdapter.Connect();
if (libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING || libraryError.errorCode == CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND)
ManageLibraryError(libraryError);
else if (libraryError.errorCode != CMS_ERROR_CODES.OK)
{
ncAdapter.Dispose();
}
// Send status to UI
MessageServices.Current.Publish(SEND_NC_STATUS_UI, null, ncAdapter.numericalControl.NC_IsConnected());
// Send status to signalr
MessageServices.Current.Publish(SEND_NC_STATUS, null, ncAdapter.numericalControl.NC_IsConnected());
Thread.Sleep(1000);
}
if (!libraryError.IsError())
{
if (ServerStartupConfig.AutoOpenCmsClient)
StartCMSClient();
// Start/Restart NC threads
ThreadsHandler.StartWorkers();
reconnectionIsRunning = false;
}
}
internal static void StatThread()
{
while (true)
{
foreach (var value in Counter)
{
if (ThreadsHandler.RunningThreadStatus.ContainsKey(value.Key) && Counter[value.Key] != 0)
{
ThreadsHandler.RunningThreadStatus[value.Key] = $"{(Timers[value.Key] / Counter[value.Key])} ms x {Counter[value.Key]}";
Timers[value.Key] = 0;
Counter[value.Key] = 0;
}
}
MessageServices.Current.Publish(SEND_THREADS_STATUS, null, ThreadsHandler.RunningThreadStatus);
Thread.Sleep(2000);
}
}
internal static void UpdateStat(string functionName, long timer)
{
if (!Timers.ContainsKey(functionName))
Timers.TryAdd(functionName, timer);
else
Timers[functionName] += timer;
if (!Counter.ContainsKey(functionName))
Counter.TryAdd(functionName, 1);
else
Counter[functionName]++;
}
public static void AbortNcConnection()
{
if (ConnThread != null && ConnThread.IsAlive)
ConnThread.Abort();
}
public static void ManageLibraryError(CmsError libraryError)
{
switch (libraryError.errorCode)
{
case CMS_ERROR_CODES.NC_PROD_ERROR:
ManageError(ERROR_LEVEL.WARNING, libraryError.localizationKey);
break;
case CMS_ERROR_CODES.NOT_CONNECTED:
RestoreConnection(); // If not connected try reconnection
break;
case CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND:
case CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND:
case CMS_ERROR_CODES.OPTION_NOT_CONSISTENT:
ManageError(ERROR_LEVEL.FATAL, libraryError.localizationKey);
break;
case CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING:
ManageError(ERROR_LEVEL.FATAL, "SIEMENS HMI NOT RUNNING");
break;
case CMS_ERROR_CODES.SELECTED_PROCESS:
ManageError(ERROR_LEVEL.WARNING, libraryError.localizationKey);
break;
case CMS_ERROR_CODES.INTERNAL_ERROR:
ManageException(ERROR_LEVEL.FATAL, libraryError.exception);
break;
}
}
public static void RestoreConnection()
{
if (reconnectionIsRunning == false)
{ // Set thread as running state
reconnectionIsRunning = true;
// Start reconnection thread
ConnThread = new Thread(() =>
TryNcConnection()
);
ConnThread.Start();
}
}
public static void StartCMSClient()
{
//Setup the Path Variable
@@ -1629,5 +1634,5 @@ public static class ThreadsFunctions
}
}
#endregion SupportFunctions
#endregion Public Methods
}
+5 -1
View File
@@ -28,7 +28,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@@ -38,6 +38,10 @@
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="S7.Net" publicKeyToken="d5812d469e84c693" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+5 -1
View File
@@ -47,7 +47,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@@ -57,6 +57,10 @@
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="S7.Net" publicKeyToken="d5812d469e84c693" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -95,8 +95,8 @@
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
+1 -1
View File
@@ -16,7 +16,7 @@
<package id="System.IO.Pipelines" version="4.7.3" targetFramework="net462" />
<package id="System.Memory" version="4.5.4" targetFramework="net462" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net462" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net462" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net462" />
<package id="System.Threading.Channels" version="4.7.1" targetFramework="net462" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
+394 -369
View File
@@ -7,17 +7,276 @@ namespace Thermo.Active.Model
{
public static class Constants
{
public static bool IS_BETA = false;
public static string NOT_FOUND_ALARM_MESSAGE = "Alarm_id_{0} : Message not found";
public static string NOT_CONFIGURATED_ALARM_MESSAGE = "Alarm_id_{0} : Message not configurated";
public static string CMS_CONNECT_SETUP_ALARM_MESSAGE = "Error during CMS-Connect setup: Redis Db Not Found";
public static int DATABASE_PROCESS_TIMEOUT = 5;
#region Public Fields
public const string ALARM_ATTACHMENT_PATH = @"C:\CMS\Active\attachment\alarm\";
public const string ALARM_PREFIX = "alarm_";
public const string ALARMS_CONFIG_PATH = CONFIG_DIRECTORY + "alarmsConfig.xml";
public const string ALARMS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "alarmsConfigValidator.xsd";
public const string AREAS_CONFIG_KEY = "areasConfig";
public const string AREAS_CONFIG_PATH = CONFIG_DIRECTORY + "areasConfig.xml";
public const string AREAS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "areasConfigValidator.xsd";
// Token fields Keys
public const string AUTHENTICATION_TYPE = "Bearer";
public const string AXES_CONFIG_PATH = CONFIG_DIRECTORY + "axesConfig.xml";
public const string AXES_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + @"axesConfigValidator.xsd";
public const string BROADCAST_DATA = "BROADCAST_DATA";
// File paths
public const string CLIENT_EXE_NAME = @"Active_Client.exe";
public const string CLIENT_EXE_NAME_NOEXT = @"Active_Client";
public const string CMS_CONNECT_CONFIG_PATH = CONFIG_DIRECTORY + "cmsConnectConfig.xml";
public const string CMS_CONNECT_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "cmsConnectConfigValidator.xsd";
public const string CMS_FOLDER_PATH = @"C:\CMS\";
public const string CONFIG_DIRECTORY = "Config\\";
public const string CONNECT_DATAMODEL_CONFIG_PATH = CONFIG_DIRECTORY + "DataModel.xml";
public const string CONNECT_DATAMODEL_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "dataModelConfigValidator.xsd";
public const string CUSTOMER_CONTACTS = CMS_FOLDER_PATH + "ContactInfo.xml";
public const string CUSTOMER_CONTACTS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "customerContactConfigValidator.xsd";
public const string DATABASE_NAME = "ThermoActive";
public const string DATABASE_PWD = "root";
// Database config
public const string DATABASE_USER = "root";
public const string DEFAULT_FAM_NAME = "Family";
public const string DIAM_METRIC = "DIAMETER";
public const double EPSILON = 0.1;
public const string HEADS_CONFIG_PATH = CONFIG_DIRECTORY + "headsConfig.xml";
public const string HEADS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "headsConfigValidator.xsd";
public const string IO_CONFIG_PATH = CONFIG_DIRECTORY + "IOConfig.xml";
public const string IO_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "IOConfigValidator.xsd";
public const string JOB_MAIN_FILENAME = "main.cnc";
public const string JOB_METADATA_FILENAME = "metadata.json";
public const string JOB_TMP_DIRECTORY = TEMP_PP_FOLDER + @"job\";
public const string LIVE_RECIPE_PATH = TEMP_FOLDER + "Recipes\\current.rcp";
public const string LIVE_SCHED_TASK_PATH = TEMP_FOLDER + "Recipes\\sched.tsk";
public const string M156_CONFIG_PATH = CONFIG_DIRECTORY + "inputOperatorConfig.xml";
public const string M156_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "inputOperatorConfigValidator.xsd";
public const string MACHINE_ID_KEY = "machineId";
public const string MACROS_CONFIG_PATH = CONFIG_DIRECTORY + "macrosConfig.xml";
public const string MACROS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "macrosConfigValidator.xsd";
public const string MAIN_PROGRAM_CONFIG_PATH = CONFIG_DIRECTORY + "customMainProgram.txt";
public const string MAINTENANCE_ATTACHMENT_PATH = @"C:\CMS\Active\attachment\maintenance\";
public const string MAINTENANCE_DESC_PREFIX_ID = "maint_desc_";
// ID prefix
public const string MAINTENANCE_PREFIX_ID = "maint_";
public const string MAINTENANCES_CONFIG_PATH = CONFIG_DIRECTORY + "maintenancesConfig.xml";
public const string MAINTENANCES_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "maintenancesConfigValidator.xsd";
public const int MAX_NUM_OF_WATCHDOG_ERROR = 4;
public const int MIN_ADMIN_ROLE = 30;
public const int MIN_CMS_ROLE = 100;
public const string MODBLOCK_CONFIG_PATH = CONFIG_DIRECTORY + "moduleBlockConfig.xml";
public const string MODBLOCK_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "moduleBlockConfigValidator.xsd";
public const string NC_CONFIG_KEY = "ncConfig";
public const string NC_SOFTKEYS_CONFIG_PATH = CONFIG_DIRECTORY + "ncSoftKeyConfig.xml";
public const string NC_SOFTKEYS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "ncSoftKeyConfigValidator.xsd";
public const int numRecProdPanelGraph = 30;
public const string PART_PRG_IMAGES = TEMP_FOLDER + @"pp_img\";
public const string PROD_SFT_CONFIG_KEY = "softwareProdConfig";
public const string QUEUE_TMP_FOLDER = TEMP_PP_FOLDER + @"queue\";
//Costanti Tipo metreica utensili
public const string RADIUS_METRIC = "RADIUS";
public const string DIAM_METRIC = "DIAMETER";
public const string DEFAULT_FAM_NAME = "Family";
public const string RECIPE_CONFIG_PATH = CONFIG_DIRECTORY + "recipeConfig.xml";
public const string RECIPE_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "recipeConfigValidator.xsd";
public const string RECIPE_TEMPLATE_PATH = CONFIG_DIRECTORY + "Recipes\\template.tpl";
// Registry key
public const string REGISTER_MACHINE_ID_KEY_NAME = "MachineUniqueId";
public const string RESOURCE_DIRECTORY = @"Thermo.Active.Config.Config.";
public const string RISK_CONFIG_PATH = CONFIG_DIRECTORY + "risk2007.xml";
public const string RISK_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "risk2007Validator.xsd";
public const string ROLE_LEVEL_KEY = "roleLevel";
public const string SCADA_DIRECTORY = @"C:\CMS\Active\scada\";
public const string SCADA_PAGES_SCHEMA_PATH = RESOURCE_DIRECTORY + "scadaValidator.xsd";
public const string SEND_ACTIVE_PROGRAM_DATA = "SEND_ACTIVE_PROGRAM_DATA";
// MVVM Messages to signalR tasks
public const string SEND_ALARMS = "SEND_ALARMS";
public const string SEND_AXIS_INFO = "SEND_AXIS_INFO";
public const string SEND_CHANNELS_IO_DATA = "SEND_CHANNELS_IO_DATA";
public const string SEND_CMSCONNECT_GW_REBOOT_STATUS = "SEND_CMSCONNECT_GW_REBOOT_STATUS";
public const string SEND_ERROR_TO_UI = "SEND_ERROR_TO_UI";
public const string SEND_EXPIRED_MAINTENANCES_DATA = "SEND_EXPIRED_MAINTENANCES_DATA";
public const string SEND_FUNCTIONALITY_DATA = "SEND_FUNCTION_DATA";
public const string SEND_GENERIC_DATA = "SEND_GENERIC_DATA";
public const string SEND_HEADS_DATA = "SEND_HEADS_DATA";
public const string SEND_M155_DATA = "SEND_M155_DATA";
public const string SEND_M156_DATA = "SEND_M156_DATA";
public const string SEND_MESSAGE = "SEND_MESSAGE";
public const string SEND_NC_SOFTKEYS_DATA = "SEND_NC_SOFTKEYS_DATA";
public const string SEND_NC_STATUS = "NC_STATUS";
public const string SEND_NC_STATUS_UI = "NC_STATUS_UI";
public const string SEND_POWER_ON_DATA = "SEND_POWER_ON_DATA";
public const string SEND_PROCESSES_DATA = "SEND_PROCESSES_STATUS";
public const string SEND_QUEUE_DATA = "SEND_QUEUE_DATA";
public const string SEND_SCADA_DATA = "SEND_SCADA_DATA";
// MVVM Messages to server UI
public const string SEND_STOP_SERVER = "STOP_SERVER";
public const string SEND_STOP_THREADS = "SEND_STOP_THREADS";
public const string SEND_THERMO_AREA_DATA = "SEND_THERMO_AREA_DATA";
public const string SEND_THERMO_GAUGE_DATA = "SEND_THERMO_GAUGE_DATA";
public const string SEND_THERMO_MODULE_DATA = "SEND_THERMO_MODULE_DATA";
public const string SEND_THERMO_PROD_CYCLE_DATA = "SEND_THERMO_PROD_CYCLE_DATA";
public const string SEND_THERMO_PROD_INFO_DATA = "SEND_THERMO_PROD_INFO_DATA";
public const string SEND_THERMO_PROD_PANEL_DATA = "SEND_THERMO_PROD_PANEL_DATA";
public const string SEND_THERMO_RECIPE_CHANGED = "SEND_THERMO_RECIPE_CHANGED";
// MVVM Messages for Thermo active specs
public const string SEND_THERMO_RECIPE_FULL = "SEND_THERMO_RECIPE_FULL";
public const string SEND_THERMO_RECIPE_OVERWIEW = "SEND_THERMO_RECIPE_OVERWIEW";
public const string SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED = "SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED";
public const string SEND_THERMO_WARMERS_DATA = "SEND_THERMO_WARMERS_DATA";
public const string SEND_THREADS_STATUS = "THREAD_STATUS";
public const string SEND_USER_SOFTKEYS_DATA = "SEND_USER_SOFTKEYS_DATA";
// Names in the xml file
public const string SERVER_CONFIG_KEY = "serverConfig";
public const string SERVER_CONFIG_PATH = CONFIG_DIRECTORY + "serverConfig.xml";
public const string SERVER_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + @"serverConfigValidator.xsd";
public const string SHOW_MSG_UI = "SHOW_MSG_UI";
public const string SOFTKEY_HEAD_ID = "Head_";
public const string SOFTKEY_PREFIX_ID = "softkey_";
public const string TEMP_FOLDER = @"C:\CMS\ThermoActive\TMP\";
public const string TEMP_PP_FOLDER = TEMP_FOLDER + @"pp\";
public const string THERMO_DATA_FOLDER = "wwwroot\\thermoprophet\\";
public const string THERMO_PROD_PATH = CONFIG_DIRECTORY + "thermoProdConfig.xml";
public const string THERMO_PROD_SCHEMA_PATH = RESOURCE_DIRECTORY + "thermoProdConfigValidator.xsd";
// THERMO SPEC
public const string THERMOCAM_CONFIG_PATH = CONFIG_DIRECTORY + "ThermoConf.json";
public const string USER_ID_KEY = "id";
public const string USER_SOFTKEYS_CONFIG_PATH = CONFIG_DIRECTORY + "userSoftKeyConfig.xml";
public const string USER_SOFTKEYS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "userSoftKeyConfigValidator.xsd";
public const string USERNAME_KEY = "username";
// Config File Names
public static readonly string BASE_PATH = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
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 readonly string[] VALID_FILE_EXTENSIONS = { "", ".txt", ".cnc", ".ini", ".mpf", ".spf" };
public static readonly string[] VALID_IMAGE_EXTENSIONS = { ".jpg", ".jpeg", ".png", ".bmp", ".gif" };
public static string CANDY_DUMMYFILE_PATH = BASE_PATH + "\\dll.dll";
public static string CMS_CONNECT_SETUP_ALARM_MESSAGE = "Error during CMS-Connect setup: Redis Db Not Found";
public static int DATABASE_PROCESS_TIMEOUT = 5;
public static string[] DATE_FORMATS = new[] {
"M-d-yyyy",
"dd-MM-yyyy",
"MM-dd-yyyy",
"M/d/yyyy",
"dd/MM/yyyy",
"MM/dd/yyyy",
"dd.MM.yyyy",
"MM.dd.yyyy"
};
public static string[] DATE_TIME_FORMATS = new[] {
"M-d-yyyy HH:mm",
"dd-MM-yyyy HH:mm",
"MM-dd-yyyy HH:mm",
"M/d/yyyy HH:mm",
"dd/MM/yyyy HH:mm",
"MM/dd/yyyy HH:mm"
};
public static bool IS_BETA = false;
public static string[] JOB_EXTENSIONS = { ".job", ".zip" };
public static string LANGUAGE_PACK_DIRECTORY = BASE_PATH + "\\languages\\";
public static string LANGUAGE_SCHEMA_PATH = BASE_PATH + "\\LanguageValidator.xsd";
public static string NOT_CONFIGURATED_ALARM_MESSAGE = "Alarm_id_{0} : Message not configurated";
public static string NOT_FOUND_ALARM_MESSAGE = "Alarm_id_{0} : Message not found";
public static string PARTPRG_LIST_FILE = "activePP.list";
public static string QUEUE_FILE_NAME = "pp";
public static string WEBSITE_DIRECTORY = BASE_PATH + "\\view";
#endregion Public Fields
#region Public Enums
public enum ACTIONS
{
READ,
WRITE
}
public enum ALARM_SOURCE
{
NC = 0,
PLC = 1
}
public enum ALARM_TYPE
{
ERROR = 0,
WARNING = 1
}
public enum ERROR_LEVEL
{
INFO = 1,
WARNING = 2,
ERROR = 3,
FATAL = 4
}
public enum HEAD_TYPE
{
SPINDLE = 0,
WJ = 1,
AWJ = 2,
LASER = 3
}
// Maintenances types
public enum MAINTENANCE_TYPE
{
EXP_DATE = 0,
MACHINE_INTERVAL = 1,
TIME_INTERVAL = 2
}
public enum MAINTENANCE_UNIT_OF_MEASURE
{
mm = 0,
D = 1,
H = 2,
M = 3
}
public enum QUEUE_ITEM_STATUS
{
NOT_ACTIVE = 0,
RUNNING = 1,
WAITING_OPERATOR = 2,
FINISHED = 3
}
public enum ROLE_IDS
{
CMS_SERVICE = 1,
CMS_UT = 2,
CUSTOMER_ADMIN = 3,
CUSTOMER_OPERATOR = 4,
CUSTOMER_MAINTAINER = 5
}
public enum SCADA_ELEMENT_TYPE
{
@@ -29,36 +288,10 @@ namespace Thermo.Active.Model
NEGATE_IMAGE = 5
}
public struct SCADA_ACTION
public enum SOFTKEY_PLACE : int
{
public static string READ = "read";
public static string WRITE = "write";
}
public const int MIN_CMS_ROLE = 100;
public const int MIN_ADMIN_ROLE = 30;
public enum ROLE_IDS
{
CMS_SERVICE = 1,
CMS_UT = 2,
CUSTOMER_ADMIN = 3,
CUSTOMER_OPERATOR = 4,
CUSTOMER_MAINTAINER = 5
}
public enum ACTIONS
{
READ,
WRITE
}
public enum ERROR_LEVEL
{
INFO = 1,
WARNING = 2,
ERROR = 3,
FATAL = 4
PADDLE = 0,
GANT = 1,
}
public enum SOFTKEY_TYPE
@@ -68,18 +301,67 @@ namespace Thermo.Active.Model
GROUP = 2
}
public enum SOFTKEY_PLACE : int
public enum TACT_AXES_TYPE
{
PADDLE = 0,
GANT = 1,
NA = 0,
LINEAR,
ROTATIONAL
}
public enum HEAD_TYPE
[JsonConverter(typeof(StringEnumConverter))]
public enum TACT_DOW
{
SPINDLE = 0,
WJ = 1,
AWJ = 2,
LASER = 3
Sunday = 0,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
}
public enum TACT_IO_TYPE
{
ND = 0,
/// <summary>
/// Digital IN
/// </summary>
DI,
/// <summary>
/// Digital OUT
/// </summary>
DO,
/// <summary>
/// Analog IN
/// </summary>
AI,
/// <summary>
/// Analog OUT
/// </summary>
AO
}
public enum TACT_MBLOCK_SECTION
{
ND = 0,
HEATING,
FORMING,
EXTRACTION
}
public enum TACT_MBLOCK_TYPE
{
ND = 0,
HEATING,
DRAWING,
MOVEMENT,
VACUUM,
COOLING,
EXTRACTION
}
public enum TACT_PARAM_TYPE
@@ -98,43 +380,6 @@ namespace Thermo.Active.Model
Options
}
public enum TACT_IO_TYPE
{
ND = 0,
/// <summary>
/// Digital IN
/// </summary>
DI,
/// <summary>
/// Digital OUT
/// </summary>
DO,
/// <summary>
/// Analog IN
/// </summary>
AI,
/// <summary>
/// Analog OUT
/// </summary>
AO
}
public enum TACT_MBLOCK_TYPE
{
ND = 0,
HEATING,
DRAWING,
MOVEMENT,
VACUUM,
COOLING,
EXTRACTION
}
public enum TACT_AXES_TYPE
{
NA = 0,
LINEAR,
ROTATIONAL
}
[JsonConverter(typeof(StringEnumConverter))]
public enum TACT_PROD_CATEGORY
{
@@ -142,20 +387,6 @@ namespace Thermo.Active.Model
GAUGE
}
public enum TACT_MBLOCK_SECTION
{
ND = 0,
HEATING,
FORMING,
EXTRACTION
}
[JsonConverter(typeof(StringEnumConverter))]
public enum TACT_SCHED_TASK
{
ND = 0,
PRE_HEAT
}
[JsonConverter(typeof(StringEnumConverter))]
public enum TACT_SCHED_PERIOD
{
@@ -165,109 +396,106 @@ namespace Thermo.Active.Model
MONTH,
YEAR
}
[JsonConverter(typeof(StringEnumConverter))]
public enum TACT_DOW
public enum TACT_SCHED_TASK
{
Sunday = 0,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
ND = 0,
PRE_HEAT
}
public enum MAINTENANCE_UNIT_OF_MEASURE
#endregion Public Enums
#region Public Structs
public struct SCADA_ACTION
{
mm = 0,
D = 1,
H = 2,
M = 3
#region Public Fields
public static string READ = "read";
public static string WRITE = "write";
#endregion Public Fields
}
public enum ALARM_SOURCE
#endregion Public Structs
#region Public Classes
public static class API_ERROR_KEYS
{
NC = 0,
PLC = 1
#region Public Fields
public const string CUSTOMER_FILE_INVALID = "contactinfo_error_customer_configfile";
public const string DUPLICATED_USERNAME = "error_duplicated_username";
public const string ID_ALREADY_EXIST = "error_id_already_exist";
public const string IMPORT_FILE_NOT_VALID = "error_import_file_not_valid";
public const string INCORRECT_PARAMETERS = "error_incorrect_parameters";
public const string OPTION_NOT_ACTIVE = "error_option_not_active";
public const string PASSWORD_IS_INVALID = "error_password_is_invalid";
#endregion Public Fields
}
public enum ALARM_TYPE
public static class FUNCTIONALITY_NAMES
{
ERROR = 0,
WARNING = 1
}
#region Public Fields
// Maintenances types
public enum MAINTENANCE_TYPE
{
EXP_DATE = 0,
MACHINE_INTERVAL = 1,
TIME_INTERVAL = 2
}
public const string ALARM_CMD = "alarmCmd";
public const string AXES_SELECTION = "axesSoftkeys";
public const string GENERAL = "general";
public const string HEADS_CMD = "headsCmd";
public const string MAINTENANCE = "maintenance";
public const string NC_DATA = "ncData";
public const string NC_SOFTKEY = "ncSoftkeys";
public const string PROCESS_CMD = "processCmd";
public const string RECIPE_MANAGER = "thermoRecipeManager";
public const string RISC_MANAGER = "riscManager";
public const string STARTUP_ICONS = "startupIcons";
public const string THERMO_MANAGER = "thermoManager";
public const string USER_FUNCTIONS = "userFunctions";
public const string USER_SOFTKEY = "userSoftkeys";
public enum QUEUE_ITEM_STATUS
{
NOT_ACTIVE = 0,
RUNNING = 1,
WAITING_OPERATOR = 2,
FINISHED = 3
#endregion Public Fields
}
public const int MAX_NUM_OF_WATCHDOG_ERROR = 4;
public static class NC_VENDOR
{
#region Public Fields
public const string DEMO = "DEMO";
public const string FANUC = "FANUC";
public const string SIEMENS = "SIEMENS";
public const string OSAI = "OSAI";
public const string S7NET = "S7NET";
public const string SIEMENS = "SIEMENS";
#endregion Public Fields
}
// Database config
public const string DATABASE_USER = "root";
public const string DATABASE_PWD = "root";
public const string DATABASE_NAME = "ThermoActive";
// Registry key
public const string REGISTER_MACHINE_ID_KEY_NAME = "MachineUniqueId";
// Token fields Keys
public const string AUTHENTICATION_TYPE = "Bearer";
public const string MACHINE_ID_KEY = "machineId";
public const string ROLE_LEVEL_KEY = "roleLevel";
public const string USERNAME_KEY = "username";
public const string USER_ID_KEY = "id";
// Names in the xml file
public const string SERVER_CONFIG_KEY = "serverConfig";
public const string NC_CONFIG_KEY = "ncConfig";
public const string PROD_SFT_CONFIG_KEY = "softwareProdConfig";
public const string AREAS_CONFIG_KEY = "areasConfig";
// Active Areas
public class AREAS
{
#region Public Fields
public const string ALARMS_KEY = "alarms";
public const string GENERAL_KEY = "general";
public const string JOBEDITOR_KEY = "jobeditor";
public const string MAINTENANCE_KEY = "maintenance";
public const string PRODUCTION_KEY = "production";
public const string REPORT_KEY = "report";
public const string ALARMS_KEY = "alarms";
public const string MAINTENANCE_KEY = "maintenance";
public const string UTILITIES_KEY = "utilities";
public const string SCADA_KEY = "scada";
public const string GENERAL_KEY = "general";
public const string UNDER_HOOD = "underHood";
public const string JOBEDITOR_KEY = "jobeditor";
public const string USERS_KEY = "users";
public const string THERMO_KEY = "thermo";
public const string RISC_KEY = "risc";
public const string SCADA_KEY = "scada";
public const string THERMO_HOOD_KEY = "thermoHood";
public const string THERMO_KEY = "thermo";
public const string UNDER_HOOD = "underHood";
public const string USERS_KEY = "users";
public const string UTILITIES_KEY = "utilities";
#endregion Public Fields
}
// Config File Names
public static readonly string BASE_PATH = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
#endregion Public Classes
//public static readonly string BASE_PATH = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).Replace("\\lib", "");
#if DEBUG
@@ -275,209 +503,6 @@ namespace Thermo.Active.Model
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\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 int numRecProdPanelGraph = 30;
public const string CONFIG_DIRECTORY = "Config\\";
public const string RECIPE_TEMPLATE_PATH = CONFIG_DIRECTORY + "Recipes\\template.tpl";
public const string LIVE_RECIPE_PATH = TEMP_FOLDER + "Recipes\\current.rcp";
public const string LIVE_SCHED_TASK_PATH = TEMP_FOLDER + "Recipes\\sched.tsk";
public const string RESOURCE_DIRECTORY = @"Thermo.Active.Config.Config.";
public const string SERVER_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + @"serverConfigValidator.xsd";
public const string SERVER_CONFIG_PATH = CONFIG_DIRECTORY + "serverConfig.xml";
public const string AREAS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "areasConfigValidator.xsd";
public const string AREAS_CONFIG_PATH = CONFIG_DIRECTORY + "areasConfig.xml";
public const string M156_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "inputOperatorConfigValidator.xsd";
public const string M156_CONFIG_PATH = CONFIG_DIRECTORY + "inputOperatorConfig.xml";
public const string CONNECT_DATAMODEL_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "dataModelConfigValidator.xsd";
public const string CONNECT_DATAMODEL_CONFIG_PATH = CONFIG_DIRECTORY + "DataModel.xml";
public const string MAINTENANCES_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "maintenancesConfigValidator.xsd";
public const string CUSTOMER_CONTACTS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "customerContactConfigValidator.xsd";
public const string MAINTENANCES_CONFIG_PATH = CONFIG_DIRECTORY + "maintenancesConfig.xml";
public const string CUSTOMER_CONTACTS = CMS_FOLDER_PATH + "ContactInfo.xml";
public const string USER_SOFTKEYS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "userSoftKeyConfigValidator.xsd";
public const string USER_SOFTKEYS_CONFIG_PATH = CONFIG_DIRECTORY + "userSoftKeyConfig.xml";
public const string ALARMS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "alarmsConfigValidator.xsd";
public const string ALARMS_CONFIG_PATH = CONFIG_DIRECTORY + "alarmsConfig.xml";
public const string HEADS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "headsConfigValidator.xsd";
public const string HEADS_CONFIG_PATH = CONFIG_DIRECTORY + "headsConfig.xml";
// THERMO SPEC
public const string THERMO_PROD_SCHEMA_PATH = RESOURCE_DIRECTORY + "thermoProdConfigValidator.xsd";
public const string THERMO_PROD_PATH = CONFIG_DIRECTORY + "thermoProdConfig.xml";
public const string RECIPE_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "recipeConfigValidator.xsd";
public const string RECIPE_CONFIG_PATH = CONFIG_DIRECTORY + "recipeConfig.xml";
public const string MODBLOCK_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "moduleBlockConfigValidator.xsd";
public const string MODBLOCK_CONFIG_PATH = CONFIG_DIRECTORY + "moduleBlockConfig.xml";
public const string IO_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "IOConfigValidator.xsd";
public const string IO_CONFIG_PATH = CONFIG_DIRECTORY + "IOConfig.xml";
public const string RISK_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "risk2007Validator.xsd";
public const string RISK_CONFIG_PATH = CONFIG_DIRECTORY + "risk2007.xml";
public const string NC_SOFTKEYS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "ncSoftKeyConfigValidator.xsd";
public const string NC_SOFTKEYS_CONFIG_PATH = CONFIG_DIRECTORY + "ncSoftKeyConfig.xml";
public const string CMS_CONNECT_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "cmsConnectConfigValidator.xsd";
public const string CMS_CONNECT_CONFIG_PATH = CONFIG_DIRECTORY + "cmsConnectConfig.xml";
public const string MACROS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "macrosConfigValidator.xsd";
public const string MACROS_CONFIG_PATH = CONFIG_DIRECTORY + "macrosConfig.xml";
public const string AXES_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + @"axesConfigValidator.xsd";
public const string AXES_CONFIG_PATH = CONFIG_DIRECTORY + "axesConfig.xml";
public const string MAIN_PROGRAM_CONFIG_PATH = CONFIG_DIRECTORY + "customMainProgram.txt";
public static string LANGUAGE_PACK_DIRECTORY = BASE_PATH + "\\languages\\";
public static string LANGUAGE_SCHEMA_PATH = BASE_PATH + "\\LanguageValidator.xsd";
public const string SCADA_PAGES_SCHEMA_PATH = RESOURCE_DIRECTORY + "scadaValidator.xsd";
public static string CANDY_DUMMYFILE_PATH = BASE_PATH + "\\dll.dll";
public static string PARTPRG_LIST_FILE = "activePP.list";
// MVVM Messages to server UI
public const string SEND_STOP_SERVER = "STOP_SERVER";
public const string SEND_MESSAGE = "SEND_MESSAGE";
public const string SEND_STOP_THREADS = "SEND_STOP_THREADS";
public const string SEND_NC_STATUS = "NC_STATUS";
public const string SEND_NC_STATUS_UI = "NC_STATUS_UI";
public const string SEND_THREADS_STATUS = "THREAD_STATUS";
public const string SEND_CMSCONNECT_GW_REBOOT_STATUS = "SEND_CMSCONNECT_GW_REBOOT_STATUS";
public const string SHOW_MSG_UI = "SHOW_MSG_UI";
public const string SEND_ERROR_TO_UI = "SEND_ERROR_TO_UI";
// MVVM Messages to signalR tasks
public const string SEND_ALARMS = "SEND_ALARMS";
public const string SEND_POWER_ON_DATA = "SEND_POWER_ON_DATA";
public const string SEND_GENERIC_DATA = "SEND_GENERIC_DATA";
public const string SEND_PROCESSES_DATA = "SEND_PROCESSES_STATUS";
public const string SEND_FUNCTIONALITY_DATA = "SEND_FUNCTION_DATA";
public const string SEND_EXPIRED_MAINTENANCES_DATA = "SEND_EXPIRED_MAINTENANCES_DATA";
public const string SEND_USER_SOFTKEYS_DATA = "SEND_USER_SOFTKEYS_DATA";
public const string SEND_NC_SOFTKEYS_DATA = "SEND_NC_SOFTKEYS_DATA";
public const string SEND_HEADS_DATA = "SEND_HEADS_DATA";
public const string SEND_AXIS_INFO = "SEND_AXIS_INFO";
public const string SEND_CHANNELS_IO_DATA = "SEND_CHANNELS_IO_DATA";
public const string SEND_ACTIVE_PROGRAM_DATA = "SEND_ACTIVE_PROGRAM_DATA";
public const string SEND_QUEUE_DATA = "SEND_QUEUE_DATA";
public const string SEND_M155_DATA = "SEND_M155_DATA";
public const string SEND_M156_DATA = "SEND_M156_DATA";
public const string SEND_SCADA_DATA = "SEND_SCADA_DATA";
// MVVM Messages for Thermo active specs
public const string SEND_THERMO_RECIPE_FULL = "SEND_THERMO_RECIPE_FULL";
public const string SEND_THERMO_RECIPE_OVERWIEW = "SEND_THERMO_RECIPE_OVERWIEW";
public const string SEND_THERMO_RECIPE_CHANGED = "SEND_THERMO_RECIPE_CHANGED";
public const string SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED = "SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED";
public const string SEND_THERMO_MODULE_DATA = "SEND_THERMO_MODULE_DATA";
public const string SEND_THERMO_WARMERS_DATA = "SEND_THERMO_WARMERS_DATA";
public const string SEND_THERMO_AREA_DATA = "SEND_THERMO_AREA_DATA";
public const string SEND_THERMO_GAUGE_DATA = "SEND_THERMO_GAUGE_DATA";
public const string SEND_THERMO_PROD_PANEL_DATA = "SEND_THERMO_PROD_PANEL_DATA";
public const string SEND_THERMO_PROD_INFO_DATA = "SEND_THERMO_PROD_INFO_DATA";
public const string SEND_THERMO_PROD_CYCLE_DATA = "SEND_THERMO_PROD_CYCLE_DATA";
public const string BROADCAST_DATA = "BROADCAST_DATA";
// ID prefix
public const string MAINTENANCE_PREFIX_ID = "maint_";
public const string MAINTENANCE_DESC_PREFIX_ID = "maint_desc_";
public const string SOFTKEY_PREFIX_ID = "softkey_";
public const string SOFTKEY_HEAD_ID = "Head_";
public const string ALARM_PREFIX = "alarm_";
public static class FUNCTIONALITY_NAMES
{
public const string GENERAL = "general";
public const string USER_FUNCTIONS = "userFunctions";
public const string NC_DATA = "ncData";
public const string ALARM_CMD = "alarmCmd";
public const string STARTUP_ICONS = "startupIcons";
public const string PROCESS_CMD = "processCmd";
public const string NC_SOFTKEY = "ncSoftkeys";
public const string USER_SOFTKEY = "userSoftkeys";
public const string HEADS_CMD = "headsCmd";
public const string MAINTENANCE = "maintenance";
public const string AXES_SELECTION = "axesSoftkeys";
public const string THERMO_MANAGER = "thermoManager";
public const string RISC_MANAGER = "riscManager";
public const string RECIPE_MANAGER = "thermoRecipeManager";
}
public static class API_ERROR_KEYS
{
public const string INCORRECT_PARAMETERS = "error_incorrect_parameters";
public const string OPTION_NOT_ACTIVE = "error_option_not_active";
public const string ID_ALREADY_EXIST = "error_id_already_exist";
public const string PASSWORD_IS_INVALID = "error_password_is_invalid";
public const string IMPORT_FILE_NOT_VALID = "error_import_file_not_valid";
public const string DUPLICATED_USERNAME = "error_duplicated_username";
public const string CUSTOMER_FILE_INVALID = "contactinfo_error_customer_configfile";
}
// File paths
public const string CLIENT_EXE_NAME = @"Active_Client.exe";
public const string CLIENT_EXE_NAME_NOEXT = @"Active_Client";
public const string MAINTENANCE_ATTACHMENT_PATH = @"C:\CMS\Active\attachment\maintenance\";
public const string CMS_FOLDER_PATH = @"C:\CMS\";
public const string ALARM_ATTACHMENT_PATH = @"C:\CMS\Active\attachment\alarm\";
public const string TEMP_FOLDER = @"C:\CMS\ThermoActive\TMP\";
public const string TEMP_PP_FOLDER = TEMP_FOLDER + @"pp\";
public const string JOB_TMP_DIRECTORY = TEMP_PP_FOLDER + @"job\";
public const string QUEUE_TMP_FOLDER = TEMP_PP_FOLDER + @"queue\";
public const string PART_PRG_IMAGES = TEMP_FOLDER + @"pp_img\";
public const string SCADA_DIRECTORY = @"C:\CMS\Active\scada\";
public static readonly string[] VALID_FILE_EXTENSIONS = { "", ".txt", ".cnc", ".ini", ".mpf", ".spf" };
public static readonly string[] VALID_IMAGE_EXTENSIONS = { ".jpg", ".jpeg", ".png", ".bmp", ".gif" };
public const double EPSILON = 0.1;
public static string QUEUE_FILE_NAME = "pp";
public const string JOB_MAIN_FILENAME = "main.cnc";
public const string JOB_METADATA_FILENAME = "metadata.json";
public static string[] JOB_EXTENSIONS = { ".job", ".zip" };
public static string[] DATE_TIME_FORMATS = new[] {
"M-d-yyyy HH:mm",
"dd-MM-yyyy HH:mm",
"MM-dd-yyyy HH:mm",
"M/d/yyyy HH:mm",
"dd/MM/yyyy HH:mm",
"MM/dd/yyyy HH:mm"
};
public static string[] DATE_FORMATS = new[] {
"M-d-yyyy",
"dd-MM-yyyy",
"MM-dd-yyyy",
"M/d/yyyy",
"dd/MM/yyyy",
"MM/dd/yyyy",
"dd.MM.yyyy",
"MM.dd.yyyy"
};
}
}
+5 -5
View File
@@ -100,11 +100,6 @@ namespace Thermo.Active.NC
/// </summary>
protected DateTime lastProdStart;
/// <summary>
/// ultima immagine scattata dalla thermocam x salvataggio in PROD
/// </summary>
protected string lastThermoImage = "_last.jpg";
#endregion Protected Fields
#region Public Fields
@@ -119,6 +114,11 @@ namespace Thermo.Active.NC
/// </summary>
public static LiveData RecipeLiveData = new LiveData();
/// <summary>
/// ultima immagine scattata dalla thermocam x salvataggio in PROD
/// </summary>
public string lastThermoImage = "_last";
/// <summary>
/// Avvio prod lotto
/// </summary>
+5 -1
View File
@@ -28,7 +28,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@@ -38,6 +38,10 @@
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="S7.Net" publicKeyToken="d5812d469e84c693" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+5 -1
View File
@@ -28,7 +28,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@@ -38,6 +38,10 @@
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="S7.Net" publicKeyToken="d5812d469e84c693" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+5 -5
View File
@@ -44,7 +44,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CMS_CORE_Library", "..\cms_
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client2020", "Client2020\Client2020.csproj", "{0780047F-12E4-4FCC-9748-6B23F0FD3711}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thermo.Active.Thermocamera", "THermo.Active.Thermocamera\Thermo.Active.Thermocamera.csproj", "{8D8EC91A-3A15-4A1D-951B-A35E7068DEBD}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thermo.Active.Thermocamera", "Thermo.Active.Thermocamera\Thermo.Active.Thermocamera.csproj", "{8D8EC91A-3A15-4A1D-951B-A35E7068DEBD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thermo.Cam.Utils", "Thermo.Cam.Utils\Thermo.Cam.Utils.csproj", "{E4587942-498B-4AA7-9CC9-9304EB2D05C8}"
EndProject
@@ -204,14 +204,14 @@ Global
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Release|x86.Build.0 = Release|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|x64.ActiveCfg = Debug|x64
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|x64.Build.0 = Debug|x64
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|x64.ActiveCfg = Debug|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|x64.Build.0 = Debug|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|x86.ActiveCfg = Debug|x86
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|x86.Build.0 = Debug|x86
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|Any CPU.Build.0 = Release|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|x64.ActiveCfg = Release|x64
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|x64.Build.0 = Release|x64
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|x64.ActiveCfg = Release|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|x64.Build.0 = Release|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|x86.ActiveCfg = Release|x86
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|x86.Build.0 = Release|x86
{0780047F-12E4-4FCC-9748-6B23F0FD3711}.Debug|Any CPU.ActiveCfg = Debug|x64
+12 -2
View File
@@ -85,7 +85,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
@@ -115,6 +115,10 @@
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="S7.Net" publicKeyToken="d5812d469e84c693" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<connectionStrings>
@@ -195,4 +199,10 @@
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
</configuration>
<system.codedom>
<compilers>
<compiler extension=".cs" language="c#;cs;csharp" warningLevel="4" compilerOptions="/langversion:7.0 /nowarn:1659;1699;1701;612;618" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<compiler extension=".vb" language="vb;vbs;visualbasic;vbscript" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008,40000,40008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</compilers>
</system.codedom>
</configuration>
@@ -1,42 +0,0 @@
using CMS_CORE_Library.Models;
using System;
using System.Collections.Generic;
using System.Web.Http;
using System.Web.Http.Description;
using Thermo.Active.Model.DTOModels.ThWarmers;
using Thermo.Active.NC;
using Thermo.Active.Provider;
using Thermo.Active.Thermocamera;
using Thermo.Active.Utils;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Controllers.WebApi
{
// FIXME TODO ELIMINARE CLASSE!!!
[RoutePrefix("api/thermocamera")]
public class ThermocameraController : ApiController
{
#region Public Methods
[Route("show"), HttpPost]
public IHttpActionResult showCamera()
{
String ThermoCameraXpos = AdditionalParametersConfig["ThermoCameraXpos"];
String ThermoCameraYpos = AdditionalParametersConfig["ThermoCameraYpos"];
String ThermoCameraXdim = AdditionalParametersConfig["ThermoCameraXdim"];
String ThermoCameraYdim = AdditionalParametersConfig["ThermoCameraYdim"];
if (ThermoCameraXpos != null && ThermoCameraYpos != null && ThermoCameraXdim != null && ThermoCameraYdim != null)
{
if (ThermocameraComunicator.getInstance().showWindow(Int32.Parse(ThermoCameraXpos), Int32.Parse(ThermoCameraYpos), Int32.Parse(ThermoCameraXdim), Int32.Parse(ThermoCameraYdim), 3000))
return Ok();
else
return BadRequest();
}
return BadRequest();
}
#endregion Public Methods
}
}
+2
View File
@@ -0,0 +1,2 @@
@echo of
xcopy "%FLIR_Atlas6%bin\x64\*.dll" %1 /Y /E /D
+2
View File
@@ -0,0 +1,2 @@
@echo of
xcopy "%FLIR_Atlas6%bin\x86\*.dll" %1 /Y /E /D
+1 -1
View File
@@ -30,4 +30,4 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.162")]
[assembly: AssemblyVersion("1.1.164")]
+44 -13
View File
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Net.Compilers.3.8.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.3.8.0\build\Microsoft.Net.Compilers.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -36,6 +35,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -79,8 +79,8 @@
<Reference Include="Microsoft.AspNet.SignalR.SystemWeb, Version=2.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.SignalR.SystemWeb.2.2.2\lib\net45\Microsoft.AspNet.SignalR.SystemWeb.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -228,7 +228,6 @@
<Compile Include="Controllers\WebApi\ModulesController.cs" />
<Compile Include="Controllers\WebApi\ProdController.cs" />
<Compile Include="Controllers\WebApi\StarredUserSoftKeyController.cs" />
<Compile Include="Controllers\WebApi\ThermocameraController.cs" />
<Compile Include="Controllers\WebApi\WarmersController.cs" />
<Compile Include="Controllers\WebApi\RecipeController.cs" />
<Compile Include="Controllers\WebApi\AuthorizationController.cs" />
@@ -11757,6 +11756,8 @@
<Content Include="wwwroot\src\modules\heads\index.js" />
<Content Include="wwwroot\src\_base\gestures.js" />
<Content Include="wwwroot\src\_base\index.js" />
<Content Include="wwwroot\thermoprophet\colored\_last.jpg" />
<Content Include="wwwroot\thermoprophet\original\_last.jpg" />
<Content Include="wwwroot\webpack.config.js" />
<None Include="Desktop_Link\CMS.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@@ -11777,6 +11778,8 @@
<None Include="Desktop_Link\Maestro Active.lnk">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="FLIR.Atlas.x64.bat" />
<None Include="FLIR.Atlas.x86.bat" />
<None Include="wwwroot\.babelrc" />
<None Include="wwwroot\.bowerrc" />
<None Include="wwwroot\.editorconfig" />
@@ -16151,6 +16154,7 @@
<None Include="wwwroot\src\modules\heads\head.vue" />
<None Include="wwwroot\src\modules\mheads.vue" />
<None Include="wwwroot\src\modules\program-management.vue" />
<None Include="wwwroot\thermoprophet\data\_last.dat" />
<None Include="wwwroot\tsconfig.json" />
</ItemGroup>
<ItemGroup>
@@ -16497,6 +16501,29 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
@@ -16505,23 +16532,27 @@
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
<ProjectExtensions />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target> -->
<Target Name="AfterBuild">
<!-- <Target Name="AfterBuild">
<ItemGroup>
<MoveToLibFolder Include="$(OutputPath)*.dll ; $(OutputPath)*.pdb ; $(OutputPath)*.xml" />
</ItemGroup>
<Move SourceFiles="@(MoveToLibFolder)" DestinationFolder="$(OutputPath)lib" OverwriteReadOnlyFiles="true" />
</Target> -->
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.targets" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.3.8.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.3.8.0\build\Microsoft.Net.Compilers.props'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>call "$(ProjectDir)\FLIR.Atlas.x86.bat" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
+2 -2
View File
@@ -18,8 +18,8 @@
<package id="Microsoft.AspNet.WebPages" version="2.0.20505.0" targetFramework="net462" />
<package id="Microsoft.AspNet.WebPages.Data" version="2.0.20505.0" targetFramework="net462" />
<package id="Microsoft.AspNet.WebPages.WebData" version="2.0.20505.0" targetFramework="net462" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.8" targetFramework="net462" />
<package id="Microsoft.Net.Compilers" version="2.4.0" targetFramework="net462" developmentDependency="true" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="3.6.0" targetFramework="net462" />
<package id="Microsoft.Net.Compilers" version="3.8.0" targetFramework="net462" developmentDependency="true" />
<package id="Microsoft.Owin" version="3.1.0" targetFramework="net462" />
<package id="Microsoft.Owin.Cors" version="3.1.0" targetFramework="net462" />
<package id="Microsoft.Owin.FileSystems" version="3.1.0" targetFramework="net462" />
@@ -1,4 +1,3 @@
import { TimeLineChartHeader } from "@/components/timeline-chart";
import { debounce } from "@/_base/debounce";
import Vue from "vue";
import Component from "vue-class-component";
@@ -25,7 +25,6 @@ export class RecipeService extends baseRestService {
}
async Update(model: { [id: string]: Recipe.IValue }) {
let payload = {}
let needsUpdate = false;
@@ -47,6 +46,8 @@ export class RecipeService extends baseRestService {
}
async UpdateChanges(newmodel: { [id: string]: Recipe.IValue }, oldmodel: { [id: string]: Recipe.IValue }) {
console.log("UpdateChanges");
let toupdate: { [id: string]: Recipe.IValue } = {};
let needsUpdate: boolean = false
for (const key in newmodel) {
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 KiB

+12 -12
View File
@@ -17,18 +17,18 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|Any CPU.ActiveCfg = Debug|x86
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|Any CPU.Build.0 = Debug|x86
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|x64.ActiveCfg = Debug|x64
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|x64.Build.0 = Debug|x64
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|x86.ActiveCfg = Debug|x86
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|x86.Build.0 = Debug|x86
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|Any CPU.ActiveCfg = Release|x86
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|Any CPU.Build.0 = Release|x86
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|x64.ActiveCfg = Release|x64
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|x64.Build.0 = Release|x64
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|x86.ActiveCfg = Release|x86
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|x86.Build.0 = Release|x86
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|Any CPU.Build.0 = Debug|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|x64.ActiveCfg = Debug|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|x64.Build.0 = Debug|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|x86.ActiveCfg = Debug|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Debug|x86.Build.0 = Debug|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|Any CPU.ActiveCfg = Release|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|Any CPU.Build.0 = Release|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|x64.ActiveCfg = Release|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|x64.Build.0 = Release|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|x86.ActiveCfg = Release|Any CPU
{009978D9-A2D0-4354-A4C1-E181D7F34919}.Release|x86.Build.0 = Release|Any CPU
{E4587942-498B-4AA7-9CC9-9304EB2D05C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E4587942-498B-4AA7-9CC9-9304EB2D05C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4587942-498B-4AA7-9CC9-9304EB2D05C8}.Debug|x64.ActiveCfg = Debug|Any CPU
+10 -3
View File
@@ -233,9 +233,11 @@ namespace Thermo.Cam.Setup
private void btnSave_Click(object sender, EventArgs e)
{
TCamCtrl.takePicture(true);
TCamCtrl.takePicture();
processImage();
refreshDisplay();
// salvo immagini
TCamCtrl.fileSave();
}
private void checkLive_CheckedChanged(object sender, EventArgs e)
@@ -429,7 +431,7 @@ namespace Thermo.Cam.Setup
else if (readTemp)
{
// accodo!
TCamCtrl.saveMeasurePoint(true);
TCamCtrl.addMeasurePoint(true);
// aggiorno visualizzazione
processImage();
refreshDisplay();
@@ -572,9 +574,14 @@ namespace Thermo.Cam.Setup
// se è in live view --> continuo
if (liveView)
{
TCamCtrl.takePicture(saveEnabled);
TCamCtrl.takePicture();
processImage();
refreshDisplay();
// salvo immagini
if (saveEnabled)
{
TCamCtrl.fileSave();
}
}
// avanzo prog bar
progBar.Increment(3);
+50 -40
View File
@@ -16,55 +16,50 @@
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\win32\Debug\</OutputPath>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\win32\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\x64\Release\</OutputPath>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Flir.Atlas.Image">
<HintPath>$(FLIR_Atlas4)bin\$(Platform)\Flir.Atlas.Image.dll</HintPath>
<Reference Include="Flir.Atlas.Image, Version=2.0.14266.1000, Culture=neutral, PublicKeyToken=caa391fd8e07c76b, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\FLIR Systems\FLIR Atlas SDK 6\bin\x86\Flir.Atlas.Image.dll</HintPath>
</Reference>
<Reference Include="Flir.Atlas.Live">
<HintPath>$(FLIR_Atlas4)bin\$(Platform)\Flir.Atlas.Live.dll</HintPath>
<Reference Include="Flir.Atlas.Live, Version=2.0.14266.1000, Culture=neutral, PublicKeyToken=caa391fd8e07c76b, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\FLIR Systems\FLIR Atlas SDK 6\bin\x86\Flir.Atlas.Live.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
@@ -136,11 +131,26 @@
<Name>Thermo.Cam.Utils</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<PropertyGroup>
<PostBuildEvent>call "$(ProjectDir)\FLIR.Atlas.x86.bat" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
<!-- <Target Name="AfterBuild">
<Exec Command="call &quot;$(ProjectDir)\FLIR.Atlas.x86.bat&quot; &quot;$(TargetDir)&quot;" Condition="$(Platform) == x86" />
<Exec Command="call &quot;$(ProjectDir)\FLIR.Atlas.x64.bat&quot; &quot;$(TargetDir)&quot;" Condition="$(Platform) == x64" />
</Target>
</Target> -->
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>
+116 -61
View File
@@ -4,6 +4,7 @@ using Flir.Atlas.Live.Discovery;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
@@ -319,12 +320,58 @@ namespace Thermo.Cam.Utils
return answ;
}
/// <summary>
/// Effettua la lettura della temperatura di tutti i punti dell'immagine e le salva nell'oggetto in memoria
/// </summary>
protected void persistTemperatureData()
{
sw.Restart();
// richiedo tutte!
var allData = Thermal.GetValues(getReticolo());
/// riduco info a 1 decimale
double[] floatData = Array.ConvertAll(allData, x => Math.Round(x, 2));
// salvo oggetto unico
lastFlirData = new TemperatureData()
{
ArraySize = new Size()
{
X = Thermal.Size.Width,
Y = Thermal.Size.Height
},
ScanOrder = "YX",
Values = floatData
};
sw.Stop();
ExTime.recordData("GetAllTemperatures", sw.ElapsedMilliseconds);
}
#endregion Protected Methods
#region Public Methods
/// <summary>
/// Effettua calcolo immagini target
/// Salvo l'ultimo punto di misura selezionato
/// </summary>
/// <param name="addOnEnd"></param>
public void addMeasurePoint(bool addOnEnd)
{
// se NO devo accodare resetto...
if (!addOnEnd)
{
currConf.MeasPoints = new List<MeasurePoint>();
}
MeasurePoint newPoint = new MeasurePoint()
{
Id = currConf.MeasPoints.Count,
Coords = lastPoint,
Temperature = 0
};
currConf.MeasPoints.Add(newPoint);
}
/// <summary>
/// Effettua calcolo immagine target finale (colorata, riscalata)
/// </summary>
public void calculateTarget()
{
@@ -396,6 +443,7 @@ namespace Thermo.Cam.Utils
public void discoveryCamera()
{
try {
// se no connesso così prosegue...
if (!IRCam.ThermoCamera.IsConnected)
{
@@ -407,6 +455,11 @@ namespace Thermo.Cam.Utils
DiscoThread.Start();
}
}
}
catch(Exception exc)
{
Console.WriteLine($"EXCEPTION discoveryCamera: {Environment.NewLine}{exc}");
}
}
public void DisposeCamera()
@@ -563,14 +616,48 @@ namespace Thermo.Cam.Utils
}
/// <summary>
/// Recupera temperature con classe nativa
/// Recupera temperature: lista di punti --> lista di MeasurePoints
/// </summary>
/// <param name="readTemp"></param>
public void getTemperatures(bool readTemp)
/// <param name="isOrigCoord">Indica se le coordinate siano nello spazio originale (FLIR) = true o nello spazio trasformato = false</param>
/// <param name="pointReq">Lista Point con coordinate dei punti da leggere</param>
public List<MeasurePoint> getPointsTemperature(bool isOrigCoord, List<MeasurePoint> pointReq)
{
// parto dall'oggetto punti richiesti
List<MeasurePoint> answ = pointReq;
if (Thermal != null)
{
// se non è spazio originale --> faccio trasformazione
try
{
// se non è nelle coord originali --> trasformo!
if (!isOrigCoord)
{
answ = reverseMeasurePoint(pointReq);
}
// ciclo e calcolo valori...
foreach (var item in answ)
{
item.Temperature = lastFlirData.Values[item.Coords.X + Thermal.Size.Width * item.Coords.Y];
}
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION: {exc}");
}
}
return answ;
}
/// <summary>
/// Recupera temperature (elenco MeasPoints)
/// </summary>
/// <param name="forceUpdate">Aggiorna valore (MeasPoints) di tutte le temperature acquisite con ultima lettura</param>
public void getTemperatures(bool forceUpdate)
{
if (Thermal != null)
{
if (readTemp)
if (forceUpdate)
{
try
{
@@ -640,32 +727,6 @@ namespace Thermo.Cam.Utils
return answ;
}
/// <summary>
/// Effettua al lettura di tutte el temperature e le salva nell'oggetto in memoria
/// </summary>
public void readAllTemperatures()
{
sw.Restart();
// richiedo tutte!
var allData = Thermal.GetValues(getReticolo());
/// riduco info a 1 decimale
double[] floatData = Array.ConvertAll(allData, x => Math.Round(x, 2));
// salvo oggetto unico
lastFlirData = new TemperatureData()
{
ArraySize = new Size()
{
X = Thermal.Size.Width,
Y = Thermal.Size.Height
},
ScanOrder = "YX",
Values = floatData
};
sw.Stop();
ExTime.recordData("GetAllTemperatures", sw.ElapsedMilliseconds);
}
/// <summary>
/// Resetta i punti di misura
/// </summary>
@@ -674,6 +735,26 @@ namespace Thermo.Cam.Utils
currConf.MeasPoints = new List<MeasurePoint>();
}
/// <summary>
/// Calcola punti con antitrasformata prospettica
/// </summary>
/// <param name="trasfPoints">Elenco punti trasformati da invertire in formato MeasurePoint</param>
/// <returns></returns>
public List<MeasurePoint> reverseMeasurePoint(List<MeasurePoint> trasfMPoints)
{
List<MeasurePoint> answ = trasfMPoints;
// trasformo measurepoint --> point
List<Point> trasfPoints = trasfMPoints.Select(item => new Point() { X = item.Coords.X, Y = item.Coords.Y }).ToList();
// reverse
List<Point> fixPoints = reversePoint(trasfPoints);
// sostituisco le coordinate...
for (int i = 0; i < trasfMPoints.Count; i++)
{
answ[i].Coords = fixPoints[i];
}
return answ;
}
/// <summary>
/// Calcola punti con antitrasformata prospettica
/// </summary>
@@ -706,30 +787,9 @@ namespace Thermo.Cam.Utils
}
/// <summary>
/// Salvo il punto di misura selezionato
/// Acquisisce immagine da FLIR Cam
/// </summary>
/// <param name="addOnEnd"></param>
public void saveMeasurePoint(bool addOnEnd)
{
// se NO devo accodare resetto...
if (!addOnEnd)
{
currConf.MeasPoints = new List<MeasurePoint>();
}
MeasurePoint newPoint = new MeasurePoint()
{
Id = currConf.MeasPoints.Count,
Coords = lastPoint,
Temperature = 0
};
currConf.MeasPoints.Add(newPoint);
}
/// <summary>
/// recupera immagine effettuando eventuale salvataggio
/// </summary>
/// <param name="doSave"></param>
public string takePicture(bool doSave)
public string takePicture()
{
string answ = "";
sw.Restart();
@@ -747,13 +807,8 @@ namespace Thermo.Cam.Utils
// salvo img locale
Origin = Thermal.Image;
Decorated = Thermal.Image;
// recupero le temperature...
readAllTemperatures();
//verifico se devo salvare...
if (doSave)
{
answ = fileSave();
}
// recupero TUTTE le temperature...
persistTemperatureData();
}
catch (Exception exception)
{
+10 -4
View File
@@ -39,12 +39,13 @@
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Flir.Atlas.Image, Version=2.0.14266.1000, Culture=neutral, PublicKeyToken=caa391fd8e07c76b, processorArchitecture=AMD64">
<Reference Include="Flir.Atlas.Image, Version=2.0.14266.1000, Culture=neutral, PublicKeyToken=caa391fd8e07c76b, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\FLIR Systems\FLIR Atlas SDK 4\bin\x64\Flir.Atlas.Image.dll</HintPath>
<HintPath>..\..\..\..\..\..\Program Files (x86)\FLIR Systems\FLIR Atlas SDK 6\bin\x86\Flir.Atlas.Image.dll</HintPath>
</Reference>
<Reference Include="Flir.Atlas.Live">
<HintPath>..\..\..\..\..\..\Program Files (x86)\FLIR Systems\FLIR Atlas SDK 4\bin\x64\Flir.Atlas.Live.dll</HintPath>
<Reference Include="Flir.Atlas.Live, Version=2.0.14266.1000, Culture=neutral, PublicKeyToken=caa391fd8e07c76b, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\FLIR Systems\FLIR Atlas SDK 6\bin\x86\Flir.Atlas.Live.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
@@ -102,6 +103,7 @@
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="ThermoConf.json" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
@@ -110,4 +112,8 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\OpenCvSharp4.runtime.win.4.5.1.20210208\build\net\OpenCvSharp4.runtime.win.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\OpenCvSharp4.runtime.win.4.5.1.20210208\build\net\OpenCvSharp4.runtime.win.props'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
+31
View File
@@ -0,0 +1,31 @@
{
"MeasPoints": [],
"CameraName": "FLIR AX5",
"CameraAddress": "",
"DestPoints": {
"Coords": [
"0, 0",
"1500, 0",
"1500, 1200",
"0, 1200"
],
"curr": 0
},
"OrigPoints": {
"Coords": [
"55, 214",
"49, 68",
"218, 80",
"197, 226"
],
"curr": 4
},
"TargetRange": {
"Max": 60.0,
"Min": 0.0
},
"TargetSize": {
"X": 1500,
"Y": 1200
}
}