cleanup + fix gestione scale factor moduli
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Thermo.Active.Model.DTOModels.ThModules
|
||||
{
|
||||
public class DTOModule
|
||||
{
|
||||
public int Id { get; set; } = 0;
|
||||
public int ActualDuration { get; set; } = 0;
|
||||
public int ActualDelay { get; set; } = 0;
|
||||
public int EstimDuration { get; set; } = 0;
|
||||
public int EstimDelay { get; set; } = 0;
|
||||
public List<int> PrevModId { get; set; } = new List<int>();
|
||||
public RBStatus Status { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is DTOModule item))
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (ActualDuration != item.ActualDuration)
|
||||
return false;
|
||||
if (ActualDelay != item.ActualDelay)
|
||||
return false;
|
||||
if (PrevModId != item.PrevModId)
|
||||
return false;
|
||||
if (EstimDelay != item.EstimDelay)
|
||||
return false;
|
||||
if (!Status.Equals(item.Status))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public struct RBStatus
|
||||
{
|
||||
public bool Visible { get; set; }
|
||||
public bool Executing { get; set; }
|
||||
public bool HasError { get; set; }
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is RBStatus item))
|
||||
return false;
|
||||
|
||||
if (Visible != item.Visible)
|
||||
return false;
|
||||
if (Executing != item.Executing)
|
||||
return false;
|
||||
if (HasError != item.HasError)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
namespace Thermo.Active.Model.DTOModels.ThModules
|
||||
{
|
||||
public class DTOModuleConfigModel
|
||||
{
|
||||
public int Id;
|
||||
public string Label;
|
||||
public BlockType Type;
|
||||
public BlockSection Section;
|
||||
public int IdMainParam = -1; // -1 = non visibile la parte a DX
|
||||
public bool DelayVisible;
|
||||
public int VisualPriority;
|
||||
}
|
||||
|
||||
public enum BlockType
|
||||
{
|
||||
HEATING,
|
||||
DRAWING,
|
||||
MOVEMENT,
|
||||
VACUUM,
|
||||
COOLING,
|
||||
EXTRACTION
|
||||
}
|
||||
public enum BlockSection
|
||||
{
|
||||
HEATING,
|
||||
FORMING,
|
||||
EXTRACTION
|
||||
}
|
||||
}
|
||||
@@ -106,8 +106,6 @@
|
||||
<Compile Include="DTOModels\DTOAxesModel.cs" />
|
||||
<Compile Include="DTOModels\DTOAxisNameModel.cs" />
|
||||
<Compile Include="DTOModels\DTOClientConfigurationModel.cs" />
|
||||
<Compile Include="DTOModels\ThModules\DTOModule.cs" />
|
||||
<Compile Include="DTOModels\ThModules\DTOModuleConfigModel.cs" />
|
||||
<Compile Include="DTOModels\ThModules\DTOModulesBlock.cs" />
|
||||
<Compile Include="DTOModels\ThProd\DTOThermoProd.cs" />
|
||||
<Compile Include="DTOModels\ThRecipe\LiveData.cs" />
|
||||
|
||||
@@ -2149,10 +2149,12 @@ namespace Thermo.Active.NC
|
||||
IdParam = item.IdParam,
|
||||
ShowDelay = item.ShowDelay,
|
||||
Priority = item.Priority,
|
||||
ActualDelay = currModule.ActualDelay,
|
||||
ActualDuration = currModule.ActualDuration,
|
||||
EstimatedDelay = currModule.EstimatedDelay,
|
||||
EstimatedDuration = currModule.EstimatedDuration,
|
||||
ScaleFactor = item.ScaleFactor,
|
||||
NumDec = item.NumDec,
|
||||
ActualDelay = (double)currModule.ActualDelay / item.ScaleFactor,
|
||||
ActualDuration = (double)currModule.ActualDuration / item.ScaleFactor,
|
||||
EstimatedDelay = (double)currModule.EstimatedDelay / item.ScaleFactor,
|
||||
EstimatedDuration = (double)currModule.EstimatedDuration / item.ScaleFactor,
|
||||
PrecedingId = currModule.PrecedingId,
|
||||
Visible = currModule.Visible,
|
||||
Running = currModule.Running,
|
||||
@@ -2160,10 +2162,8 @@ namespace Thermo.Active.NC
|
||||
};
|
||||
currModules.Add(item.Id, currVal);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
// FIXME TODO...
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
return libraryError;
|
||||
|
||||
Reference in New Issue
Block a user