Merge remote-tracking branch 'CMS/develop' into develop
This commit is contained in:
@@ -13,15 +13,6 @@ 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>
|
||||
@@ -37,7 +28,7 @@ namespace Thermo.Active.Thermocamera
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Private Constructors
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init classe
|
||||
@@ -46,7 +37,7 @@ namespace Thermo.Active.Thermocamera
|
||||
public ThermoCamComunicator(bool isLive)
|
||||
{
|
||||
// init classe controllo camera
|
||||
TCamLive = new TCContr($"{BASE_PATH}\\{Constants.THERMO_DATA_FOLDER}", $"{BASE_PATH}\\{Constants.CONFIG_DIRECTORY}");
|
||||
TCamLive = new TCContr($"{Constants.WEBSITE_DIRECTORY}\\{Constants.THERMO_DATA_FOLDER}", $"{BASE_PATH}\\{Constants.CONFIG_DIRECTORY}");
|
||||
|
||||
// avvio classe gestione thermocamera...
|
||||
TCamLive.tryReloadConf();
|
||||
@@ -58,7 +49,7 @@ namespace Thermo.Active.Thermocamera
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Constructors
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
@@ -83,6 +74,16 @@ namespace Thermo.Active.Thermocamera
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// chiusura metodi legati a ThermoCam (discovery e connessione)
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
TCamLive.stopDiscovery();
|
||||
TCamLive.DisconnectCamera();
|
||||
TCamLive.DisposeCamera();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce lettura di tutti i punti richiesti (es centroidi riscaldi)
|
||||
/// </summary>
|
||||
@@ -90,10 +91,9 @@ namespace Thermo.Active.Thermocamera
|
||||
/// <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)
|
||||
public bool readMultiTemperatures(string setName, Dictionary<int, ThermoPoint> points, out List<MeasurePoint> temp)
|
||||
{
|
||||
temp = new Dictionary<int, double>();
|
||||
List<MeasurePoint> measData = new List<MeasurePoint>();
|
||||
temp = new List<MeasurePoint>();
|
||||
// converto la richiesta in una lista di punti di misura...
|
||||
List<MeasurePoint> reqData = points.Select(item => new MeasurePoint()
|
||||
{
|
||||
@@ -111,12 +111,12 @@ namespace Thermo.Active.Thermocamera
|
||||
// carico file vari...
|
||||
done = TCamLive.fileLoad(setName);
|
||||
}
|
||||
measData = TCamLive.getPointsTemperature(false, reqData);
|
||||
// converto valori nel formato finale
|
||||
foreach (var item in measData)
|
||||
try
|
||||
{
|
||||
temp.Add(item.Id, item.Temperature);
|
||||
temp = TCamLive.getPointsTemperature(false, reqData);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// fatto!
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,10 @@
|
||||
<Project>{cbeb631b-abfa-4042-9779-c0060b0dfefe}</Project>
|
||||
<Name>Thermo.Active.Utils</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>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
|
||||
@@ -352,17 +352,23 @@ public static class ThreadsFunctions
|
||||
// if requested --> give ack!
|
||||
ncAdapter.ManageFlirStrobe();
|
||||
// requesto photo from library
|
||||
ncAdapter.lastThermoImage = TCCom.takePicture();
|
||||
done = !string.IsNullOrEmpty(ncAdapter.lastThermoImage);
|
||||
NcAdapter.lastThermoImage = TCCom.takePicture();
|
||||
done = !string.IsNullOrEmpty(NcAdapter.lastThermoImage);
|
||||
if (done)
|
||||
{
|
||||
// init
|
||||
List<Thermo.Cam.Utils.MeasurePoint> measuredpoints = new List<Thermo.Cam.Utils.MeasurePoint>();
|
||||
Dictionary<int, double> actualTemp = new Dictionary<int, double>();
|
||||
Dictionary<int, ThermoPoint> chPoints = new Dictionary<int, ThermoPoint>();
|
||||
// recupero punti centrali resistenze
|
||||
ncAdapter.GetWarmersChannelCenterPoints(out chPoints);
|
||||
// richiesta temperature per i punti
|
||||
done = TCCom.readMultiTemperatures("", chPoints, out actualTemp);
|
||||
done = TCCom.readMultiTemperatures("", chPoints, out measuredpoints);
|
||||
// converto in actualTemp
|
||||
foreach (var item in measuredpoints)
|
||||
{
|
||||
actualTemp.Add(item.Id, item.Temperature);
|
||||
}
|
||||
// salvo dati temp sul PLC
|
||||
ncAdapter.WriteRecipeWarmChTCamTempAct(actualTemp);
|
||||
// give PLC strobe for uploaded Actual TEMP from image
|
||||
@@ -385,6 +391,11 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
// chiudo thermocam
|
||||
TCCom.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ManageLibraryError(CmsError libraryError)
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace Thermo.Active.Model
|
||||
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_DATA_FOLDER = "thermoprophet\\";
|
||||
public const string THERMO_PROD_PATH = CONFIG_DIRECTORY + "thermoProdConfig.xml";
|
||||
public const string THERMO_PROD_SCHEMA_PATH = RESOURCE_DIRECTORY + "thermoProdConfigValidator.xsd";
|
||||
|
||||
@@ -167,8 +167,6 @@ namespace Thermo.Active.Model
|
||||
// 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";
|
||||
@@ -205,8 +203,6 @@ namespace Thermo.Active.Model
|
||||
|
||||
public static string QUEUE_FILE_NAME = "pp";
|
||||
|
||||
public static string WEBSITE_DIRECTORY = BASE_PATH + "\\view";
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Enums
|
||||
@@ -503,6 +499,9 @@ 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
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ namespace Thermo.Active.NC
|
||||
/// <summary>
|
||||
/// ultima immagine scattata dalla thermocam x salvataggio in PROD
|
||||
/// </summary>
|
||||
public string lastThermoImage = "_last";
|
||||
public static string lastThermoImage = "_last";
|
||||
|
||||
/// <summary>
|
||||
/// Avvio prod lotto
|
||||
|
||||
@@ -12,6 +12,8 @@ using static Thermo.Active.Config.ServerConfig;
|
||||
using static Thermo.Active.Model.Constants;
|
||||
using static CMS_CORE_Library.Models.DataStructures;
|
||||
using System.Web.Http.Description;
|
||||
using Thermo.Active.Thermocamera;
|
||||
using System.Linq;
|
||||
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
@@ -25,6 +27,13 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
|
||||
protected Dictionary<int, ThermoPoint> MeasurePoints = new Dictionary<int, ThermoPoint>();
|
||||
|
||||
/// <summary>
|
||||
/// Libreria x gestione dati thermocamera
|
||||
/// </summary>
|
||||
protected ThermoCamComunicator TCCom = new ThermoCamComunicator(false);
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Methods
|
||||
@@ -89,6 +98,25 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Add point to list for thermo data acquisition
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Route("addMeasurePoint"), HttpPut]
|
||||
public IHttpActionResult AddMeasurePoint(int posX, int posY)
|
||||
{
|
||||
int nextId = MeasurePoints.Count;
|
||||
// aggiungo punto
|
||||
ThermoPoint result = new ThermoPoint()
|
||||
{
|
||||
X = posX,
|
||||
Y = posY
|
||||
};
|
||||
MeasurePoints.Add(nextId, result);
|
||||
// ritorno!
|
||||
return Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cancel recipe modification (parameters: PLC --> HMI)
|
||||
/// </summary>
|
||||
@@ -322,38 +350,28 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
return Ok(currWarmers);
|
||||
}
|
||||
|
||||
[ResponseType(typeof(ThermoPointFlir))]
|
||||
[Route("getTempAtPoint"), HttpGet]
|
||||
public IHttpActionResult GetTempAtPoint(int posX, int posY)
|
||||
[ResponseType(typeof(List<Thermo.Cam.Utils.MeasurePoint>))]
|
||||
[Route("getMeasurePoints"), HttpGet]
|
||||
public IHttpActionResult GetMeasurePoints(string setName)
|
||||
{
|
||||
// Try connection
|
||||
CmsError libraryError = ncAdapter.Connect();
|
||||
if (libraryError.IsError())
|
||||
{
|
||||
ThermoActiveLogger.LogError($"NC Not connected! | GetTempAtPoints | {libraryError.exception}");
|
||||
return BadRequest(libraryError.localizationKey);
|
||||
}
|
||||
|
||||
// fake: genero casualmenteEsegui
|
||||
Random rnd = new Random();
|
||||
ThermoPointFlir result = new ThermoPointFlir()
|
||||
{
|
||||
X = posX,
|
||||
Y = posY,
|
||||
Temperature = ((float)rnd.Next(100, 2000)) / 10
|
||||
};
|
||||
|
||||
#if false
|
||||
// leggo dati gauges
|
||||
libraryError = ncAdapter.ReadValIO(out DTOChannelsIOVal ChannelsIOVal);
|
||||
if (libraryError.IsError())
|
||||
{
|
||||
ThermoActiveLogger.LogError($"GetChannelsIoVal error | {libraryError.exception}");
|
||||
return BadRequest(libraryError.localizationKey);
|
||||
}
|
||||
#endif
|
||||
// init punti...
|
||||
List<Thermo.Cam.Utils.MeasurePoint> resultPoints = new List<Cam.Utils.MeasurePoint>();
|
||||
// Chiamo l'oggetto thermocam x il set richiesto...
|
||||
TCCom.readMultiTemperatures(setName, MeasurePoints, out resultPoints);
|
||||
// ritorno!
|
||||
return Ok(result);
|
||||
return Ok(resultPoints);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Force reset point list for thermo data acquisition
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Route("resetMeasurePoint"), HttpPut]
|
||||
public IHttpActionResult ResetMeasurePoints()
|
||||
{
|
||||
MeasurePoints = new Dictionary<int, ThermoPoint>();
|
||||
// ritorno solo fatto!
|
||||
return Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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.164")]
|
||||
[assembly: AssemblyVersion("1.1.167")]
|
||||
|
||||
@@ -16213,6 +16213,10 @@
|
||||
<Project>{cbeb631b-abfa-4042-9779-c0060b0dfefe}</Project>
|
||||
<Name>Thermo.Active.Utils</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>
|
||||
<ItemGroup>
|
||||
<Service Include="{4A0DDDB5-7A95-4FBF-97CC-616D07737A77}" />
|
||||
|
||||
+3
@@ -1,6 +1,9 @@
|
||||
.main-container .column-page-header {
|
||||
width: 672px;
|
||||
margin: 0 0 0 20px;
|
||||
height: 798px;
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
}
|
||||
.main-container .column-page-header > title {
|
||||
display: flex;
|
||||
|
||||
+5
-1
@@ -1,9 +1,13 @@
|
||||
@import "../../../variable.less";
|
||||
|
||||
.main-container {
|
||||
.column-page-header {
|
||||
.column-page-header {
|
||||
width: 672px;
|
||||
margin: 0 0 0 20px;
|
||||
height: 798px;
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
|
||||
> title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
+2
-2
@@ -45,8 +45,8 @@
|
||||
<td>
|
||||
<div class="do-container">
|
||||
<div class="io-buttons" v-if="group=='do'">
|
||||
<button :class="{forced: item.forceZero}" @click="force( 0)">0</button>
|
||||
<button :class="{forced: item.forceOne}" @click="force( 1)">1</button>
|
||||
<button :class="{forced: item.forceZero && item.isForced}" @click="force( 0)">0</button>
|
||||
<button :class="{forced: item.forceOne && item.isForced}" @click="force( 1)">1</button>
|
||||
</div>
|
||||
<numeric
|
||||
v-model="forcedValue"
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
border-radius: 15px;
|
||||
}
|
||||
.main-container .table-container {
|
||||
height: 700px;
|
||||
height: 100%;
|
||||
}
|
||||
.main-container .table-container tr.group-row {
|
||||
width: 100%;
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
}
|
||||
|
||||
.table-container {
|
||||
height: 700px;
|
||||
height: 100%;
|
||||
|
||||
tr.group-row {
|
||||
width: 100%;
|
||||
|
||||
Generated
+32
-4
@@ -83,6 +83,8 @@
|
||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.timerUI = new System.Windows.Forms.Timer(this.components);
|
||||
this.lblMs = new System.Windows.Forms.Label();
|
||||
this.btnExportConfig = new System.Windows.Forms.Button();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pBoxA)).BeginInit();
|
||||
@@ -97,6 +99,7 @@
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem,
|
||||
this.cameraToolStripMenuItem});
|
||||
@@ -144,6 +147,7 @@
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripConnectionStatus,
|
||||
this.progBar,
|
||||
@@ -186,6 +190,7 @@
|
||||
this.panelCmd.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.panelCmd.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||
this.panelCmd.Controls.Add(this.btnExportConfig);
|
||||
this.panelCmd.Controls.Add(this.groupBox5);
|
||||
this.panelCmd.Controls.Add(this.groupBox4);
|
||||
this.panelCmd.Controls.Add(this.groupBox3);
|
||||
@@ -199,6 +204,7 @@
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this.lblMs);
|
||||
this.groupBox5.Controls.Add(this.txtSPeriod);
|
||||
this.groupBox5.Controls.Add(this.chkSaveAll);
|
||||
this.groupBox5.Controls.Add(this.chkLive);
|
||||
@@ -211,11 +217,11 @@
|
||||
//
|
||||
// txtSPeriod
|
||||
//
|
||||
this.txtSPeriod.Location = new System.Drawing.Point(120, 37);
|
||||
this.txtSPeriod.Location = new System.Drawing.Point(99, 18);
|
||||
this.txtSPeriod.Name = "txtSPeriod";
|
||||
this.txtSPeriod.Size = new System.Drawing.Size(49, 20);
|
||||
this.txtSPeriod.TabIndex = 21;
|
||||
this.txtSPeriod.Text = "100";
|
||||
this.txtSPeriod.Text = "200";
|
||||
this.txtSPeriod.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// chkSaveAll
|
||||
@@ -223,9 +229,9 @@
|
||||
this.chkSaveAll.AutoSize = true;
|
||||
this.chkSaveAll.Location = new System.Drawing.Point(8, 39);
|
||||
this.chkSaveAll.Name = "chkSaveAll";
|
||||
this.chkSaveAll.Size = new System.Drawing.Size(96, 17);
|
||||
this.chkSaveAll.Size = new System.Drawing.Size(51, 17);
|
||||
this.chkSaveAll.TabIndex = 20;
|
||||
this.chkSaveAll.Text = "Save every ms";
|
||||
this.chkSaveAll.Text = "Save";
|
||||
this.chkSaveAll.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkLive
|
||||
@@ -625,6 +631,26 @@
|
||||
//
|
||||
this.timerUI.Tick += new System.EventHandler(this.timerUI_Tick);
|
||||
//
|
||||
// lblMs
|
||||
//
|
||||
this.lblMs.AutoSize = true;
|
||||
this.lblMs.Location = new System.Drawing.Point(149, 21);
|
||||
this.lblMs.Name = "lblMs";
|
||||
this.lblMs.Size = new System.Drawing.Size(20, 13);
|
||||
this.lblMs.TabIndex = 22;
|
||||
this.lblMs.Text = "ms";
|
||||
//
|
||||
// btnExportConfig
|
||||
//
|
||||
this.btnExportConfig.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnExportConfig.Location = new System.Drawing.Point(8, 491);
|
||||
this.btnExportConfig.Name = "btnExportConfig";
|
||||
this.btnExportConfig.Size = new System.Drawing.Size(177, 64);
|
||||
this.btnExportConfig.TabIndex = 20;
|
||||
this.btnExportConfig.Text = "Export Config";
|
||||
this.btnExportConfig.UseVisualStyleBackColor = true;
|
||||
this.btnExportConfig.Click += new System.EventHandler(this.btnExportConfig_Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -725,6 +751,8 @@
|
||||
private System.Windows.Forms.Button btnDeleteOlder;
|
||||
private System.Windows.Forms.TextBox txtMaxHours;
|
||||
private System.Windows.Forms.Timer timerUI;
|
||||
private System.Windows.Forms.Button btnExportConfig;
|
||||
private System.Windows.Forms.Label lblMs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Thermo.Cam.Setup
|
||||
/// <summary>
|
||||
/// Classe gestione ThermoCam (oggetti Image, metodi processing...) x FlirCam
|
||||
/// </summary>
|
||||
protected TCContr TCamCtrl = new TCContr(BASE_PATH, BASE_PATH);
|
||||
protected TCContr TCamCtrl = new TCContr($"{BASE_PATH}images\\", BASE_PATH);
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
@@ -201,6 +201,12 @@ namespace Thermo.Cam.Setup
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public object ConfigurationManager { get; private set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void btnDeleteOlder_Click(object sender, EventArgs e)
|
||||
@@ -210,6 +216,20 @@ namespace Thermo.Cam.Setup
|
||||
TCamCtrl.cleanDataDir(maxHours);
|
||||
}
|
||||
|
||||
private void btnExportConfig_Click(object sender, EventArgs e)
|
||||
{
|
||||
// effettua esportazione config in area ThermoActive
|
||||
string ThermoConfPath = System.Configuration.ConfigurationManager.AppSettings["ThermoConfPath"];
|
||||
if (!Directory.Exists(ThermoConfPath))
|
||||
{
|
||||
Directory.CreateDirectory(ThermoConfPath);
|
||||
}
|
||||
// salvo conf corrente
|
||||
TCamCtrl.saveConf();
|
||||
// salvo in folder target
|
||||
TCamCtrl.saveConf(ThermoConfPath);
|
||||
}
|
||||
|
||||
private void btnLoad_Click(object sender, EventArgs e)
|
||||
{
|
||||
// "" --> carica ultima scattata (altrimenti nome)
|
||||
@@ -350,6 +370,8 @@ namespace Thermo.Cam.Setup
|
||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
timerUI.Stop();
|
||||
TCamCtrl.stopDiscovery();
|
||||
TCamCtrl.DisconnectCamera();
|
||||
TCamCtrl.DisposeCamera();
|
||||
}
|
||||
|
||||
@@ -584,7 +606,7 @@ namespace Thermo.Cam.Setup
|
||||
}
|
||||
}
|
||||
// avanzo prog bar
|
||||
progBar.Increment(3);
|
||||
progBar.Increment(5);
|
||||
if (progBar.Value >= progBar.Maximum)
|
||||
{
|
||||
progBar.Value = 0;
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
||||
+15
-10
@@ -1,12 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /></startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
<appSettings>
|
||||
<add key="ThermoConfPath" value="C:\CMS\ThermoActive\ThermoActive\Config\" />
|
||||
</appSettings>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
+43
-14
@@ -20,13 +20,13 @@ namespace Thermo.Cam.Utils
|
||||
{
|
||||
#region Protected Fields
|
||||
|
||||
protected const string colorPath = "images\\colored";
|
||||
protected const string colorPath = "colored";
|
||||
protected const string confFileName = "ThermoConf.json";
|
||||
protected const string currName = "_last";
|
||||
protected const string dataFormat = "dat";
|
||||
protected const string dataPath = "images\\data";
|
||||
protected const string dataPath = "data";
|
||||
protected const string imgFormat = "jpg";
|
||||
protected const string thermPath = "images\\original";
|
||||
protected const string thermPath = "original";
|
||||
|
||||
protected string _confBasePath = "";
|
||||
protected string _imgBasePath = "";
|
||||
@@ -443,20 +443,21 @@ namespace Thermo.Cam.Utils
|
||||
|
||||
public void discoveryCamera()
|
||||
{
|
||||
try {
|
||||
// se no connesso così prosegue...
|
||||
if (!IRCam.ThermoCamera.IsConnected)
|
||||
try
|
||||
{
|
||||
DiscoThread.CameraAddress = currConf.CameraAddress;
|
||||
DiscoThread.CameraName = currConf.CameraName;
|
||||
if (DiscoThread.doAutoConnect)
|
||||
// se no connesso così prosegue...
|
||||
if (!IRCam.ThermoCamera.IsConnected)
|
||||
{
|
||||
// avvio
|
||||
DiscoThread.Start();
|
||||
DiscoThread.CameraAddress = currConf.CameraAddress;
|
||||
DiscoThread.CameraName = currConf.CameraName;
|
||||
if (DiscoThread.doAutoConnect)
|
||||
{
|
||||
// avvio
|
||||
DiscoThread.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception exc)
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION discoveryCamera: {Environment.NewLine}{exc}");
|
||||
}
|
||||
@@ -769,7 +770,7 @@ namespace Thermo.Cam.Utils
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Salva su file il file di conf corrente
|
||||
/// Salva il file di conf corrente (in path default)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool saveConf()
|
||||
@@ -786,6 +787,34 @@ namespace Thermo.Cam.Utils
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Salva su file nella dir richiesta il file di conf corrente
|
||||
/// </summary>
|
||||
/// <param name="destPath">directory destinazione x conf</param>
|
||||
/// <returns></returns>
|
||||
public bool saveConf(string destPath)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
string rawData = JsonConvert.SerializeObject(currConf, Formatting.Indented);
|
||||
File.WriteAllText($"{destPath}\\{confFileName}", rawData);
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// fermo discovery camera
|
||||
/// </summary>
|
||||
public void stopDiscovery()
|
||||
{
|
||||
// fermo camera discovery
|
||||
DiscoThread.Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Acquisisce immagine da FLIR Cam
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user