Compare commits

...

30 Commits

Author SHA1 Message Date
DarioS 79c7e3e536 EgtBEAMWALL 2.5e1 :
- ricompilazione con cambio versione.
2023-05-04 17:50:59 +02:00
Emmanuele Sassi e4eb264abb EgtBEAMWALL 2.5d2 :
- aggiunto bottone per aggiungere piu' Proj alle stesso Prod
- reso AddProj attivabile da ini
2023-04-20 10:58:34 +02:00
DarioS 500aa2eacf EgtBEAMWALL :
- corretto posizionamenti pezzi aggiunti a progetto da BTL.
2023-04-17 17:19:50 +02:00
Emmanuele Sassi b55810f235 - modificate funzioni di gestione progetto da sub a function 2023-04-11 10:14:20 +02:00
DarioS b898346efb EgtBEAMWALL 2.5d1 :
- ricompilazione con cambio versione.
2023-04-07 18:48:43 +02:00
DarioS 586e4689ae Merge branch 'DataLayer' of https://gitlab.steamware.net/egaltech/egtbeamwall 2023-04-07 18:42:06 +02:00
DarioS 7668aa5766 Merge remote-tracking branch 'origin/develop' 2023-04-07 18:24:03 +02:00
Samuele Locatelli e64090bfaf MachGroupController: update x check errori su record missing 2023-04-06 16:32:42 +02:00
Samuele Locatelli 7c71fd4842 Update prod controller come prec 2023-04-06 16:20:33 +02:00
Samuele Locatelli 888bf0fcf8 Update partcontroller 2023-04-06 16:10:40 +02:00
Samuele Locatelli 009f22e146 ProjController
- modifica metodi update x evitare eccezioni quando il dato manca
2023-04-06 16:08:52 +02:00
Samuele Locatelli ef14b08737 Merge branch 'develop' into DataLayer 2023-04-06 15:18:35 +02:00
Emmanuele Sassi 8f9bd3ecb7 - correzioni per eccezioni nullRerference
- introdotte StringToDoubleAdv e StringToLenAdv per evitare conflitti tra thread sulla valutazione espressioni
2023-04-06 15:15:32 +02:00
Samuele Locatelli 3eb6518ea4 Merge branch 'develop' into DataLayer 2023-04-06 15:10:59 +02:00
Emmanuele Sassi b15eb92785 - eliminata conversione inutile in StringToDouble delle variabili lette da controllo
- aggiornate librerie
2023-04-05 12:30:50 +02:00
Emmanuele Sassi 96511ca335 Merge branch 'develop' 2023-03-31 15:12:12 +02:00
Emmanuele Sassi 974dee54da - correzione a scrittura file ini DataGrid con valore originale di ReadOnly 2023-03-31 15:11:43 +02:00
DarioS 7e52ce986f Merge remote-tracking branch 'origin/develop' 2023-03-31 15:00:39 +02:00
Emmanuele Sassi 4fc4875b91 Merge branch 'NestingParetiDaBtl' into develop 2023-03-31 13:00:14 +02:00
Emmanuele Sassi b3138d1982 - nella scrittura file ini DataGrid scrivo sempre valore originale di ReadOnly 2023-03-31 12:59:19 +02:00
DarioS e87622ef5d - Corretta lettura abilitazione stampa da Ini 2023-03-31 11:41:11 +02:00
DarioS aafe52d2da Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall 2023-03-31 11:05:46 +02:00
Emmanuele Sassi ffe53bf725 - aggiunto flag di stampa etichetta in configurazione 2023-03-31 11:03:13 +02:00
Emmanuele Sassi 832ea7aec5 Merge branch 'TestLmLegno' into develop 2023-03-31 10:41:41 +02:00
DarioS 71afc6554e EgtBEAMWALL :
- altre correzioni a nesting da BTL (interpretazione vari casi sulla base di esempi).
2023-03-30 10:40:27 +02:00
DarioS bc40da74ab EgtBEAMWALL :
- modifiche per nesting da BTL (per pannelli da HsbCAD nel piano BTL XY anzichè ZX)
- aggiunto flag da INI ( [Import] WallOppositeSideNesting=0/1) per ribaltare faccia sopra del nesting da BTL.
2023-03-28 11:19:51 +02:00
Emmanuele Sassi 785792d63b - correzione per interrompere nesting in caso di errore 2023-03-07 10:39:34 +01:00
Emmanuele Sassi 330e501277 - gestione fallimento salvataggio 2022-12-19 19:31:25 +01:00
Samuele Locatelli c6f353ec35 Modifica controller Prod
- salvataggio machGroup con controllo duplicati per ID
2022-12-17 12:17:10 +01:00
Samuele Locatelli 0b7bdd6ade Merge branch 'master' into DataLayer 2022-12-17 12:07:08 +01:00
57 changed files with 1578 additions and 1012 deletions
+40 -40
View File
@@ -797,15 +797,15 @@ Public Class BTLPartM
Dim vtVersY As New Vector3d
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 9 Then
StringToLen(sValArray(0), ptOri.x)
StringToLen(sValArray(1), ptOri.y)
StringToLen(sValArray(2), ptOri.z)
StringToDouble(sValArray(3), vtVersX.x)
StringToDouble(sValArray(4), vtVersX.y)
StringToDouble(sValArray(5), vtVersX.z)
StringToDouble(sValArray(6), vtVersY.x)
StringToDouble(sValArray(7), vtVersY.y)
StringToDouble(sValArray(8), vtVersY.z)
StringToLenAdv(sValArray(0), ptOri.x)
StringToLenAdv(sValArray(1), ptOri.y)
StringToLenAdv(sValArray(2), ptOri.z)
StringToDoubleAdv(sValArray(3), vtVersX.x)
StringToDoubleAdv(sValArray(4), vtVersX.y)
StringToDoubleAdv(sValArray(5), vtVersX.z)
StringToDoubleAdv(sValArray(6), vtVersY.x)
StringToDoubleAdv(sValArray(7), vtVersY.y)
StringToDoubleAdv(sValArray(8), vtVersY.z)
NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
End If
@@ -815,10 +815,10 @@ Public Class BTLPartM
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 10 Then
StringToLen(sValArray(3), NewBTLPart.m_dCamberLen1)
StringToLen(sValArray(5), NewBTLPart.m_dCamberLen2)
StringToLen(sValArray(7), NewBTLPart.m_dCamberLen3)
StringToLen(sValArray(9), NewBTLPart.m_dCamberCross3)
StringToLenAdv(sValArray(3), NewBTLPart.m_dCamberLen1)
StringToLenAdv(sValArray(5), NewBTLPart.m_dCamberLen2)
StringToLenAdv(sValArray(7), NewBTLPart.m_dCamberLen3)
StringToLenAdv(sValArray(9), NewBTLPart.m_dCamberCross3)
End If
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
Dim pTo As Integer = sValue.LastIndexOf(" P01")
@@ -830,10 +830,10 @@ Public Class BTLPartM
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 10 Then
StringToLen(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
StringToLen(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
StringToLen(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
StringToLen(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
StringToLenAdv(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
StringToLenAdv(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
StringToLenAdv(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
StringToLenAdv(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
End If
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
pTo = sValue.LastIndexOf(" P11")
@@ -883,9 +883,9 @@ Public Class BTLPartM
NewBTLPart.m_refGrainDir = New Vector3d
sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 4 Then
StringToDouble(sValArray(0), NewBTLPart.m_refGrainDir.x)
StringToDouble(sValArray(1), NewBTLPart.m_refGrainDir.y)
StringToDouble(sValArray(2), NewBTLPart.m_refGrainDir.z)
StringToDoubleAdv(sValArray(0), NewBTLPart.m_refGrainDir.x)
StringToDoubleAdv(sValArray(1), NewBTLPart.m_refGrainDir.y)
StringToDoubleAdv(sValArray(2), NewBTLPart.m_refGrainDir.z)
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
End If
@@ -1044,15 +1044,15 @@ Public Class BTLPartM
' Dim vtVersY As New Vector3d
' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 9 Then
' StringToLen(sValArray(0), ptOri.x)
' StringToLen(sValArray(1), ptOri.y)
' StringToLen(sValArray(2), ptOri.z)
' StringToDouble(sValArray(3), vtVersX.x)
' StringToDouble(sValArray(4), vtVersX.y)
' StringToDouble(sValArray(5), vtVersX.z)
' StringToDouble(sValArray(6), vtVersY.x)
' StringToDouble(sValArray(7), vtVersY.y)
' StringToDouble(sValArray(8), vtVersY.z)
' StringToLenAdv(sValArray(0), ptOri.x)
' StringToLenAdv(sValArray(1), ptOri.y)
' StringToLenAdv(sValArray(2), ptOri.z)
' StringToDoubleAdv(sValArray(3), vtVersX.x)
' StringToDoubleAdv(sValArray(4), vtVersX.y)
' StringToDoubleAdv(sValArray(5), vtVersX.z)
' StringToDoubleAdv(sValArray(6), vtVersY.x)
' StringToDoubleAdv(sValArray(7), vtVersY.y)
' StringToDoubleAdv(sValArray(8), vtVersY.z)
' m_refTransf.ChangeOrigin(ptOri)
' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
' End If
@@ -1063,10 +1063,10 @@ Public Class BTLPartM
' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 5 Then
' StringToLen(sValArray(3), m_dCamberLen1)
' StringToLen(sValArray(5), m_dCamberLen2)
' StringToLen(sValArray(7), m_dCamberLen3)
' StringToLen(sValArray(9), m_dCamberCross3)
' StringToLenAdv(sValArray(3), m_dCamberLen1)
' StringToLenAdv(sValArray(5), m_dCamberLen2)
' StringToLenAdv(sValArray(7), m_dCamberLen3)
' StringToLenAdv(sValArray(9), m_dCamberCross3)
' End If
' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
' Dim pTo As Integer = sValue.LastIndexOf(" P01")
@@ -1078,10 +1078,10 @@ Public Class BTLPartM
' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 5 Then
' StringToLen(sValArray(3), m_dPartOffsetSide1)
' StringToLen(sValArray(5), m_dPartOffsetSide2)
' StringToLen(sValArray(7), m_dPartOffsetSide3)
' StringToLen(sValArray(9), m_dPartOffsetSide4)
' StringToLenAdv(sValArray(3), m_dPartOffsetSide1)
' StringToLenAdv(sValArray(5), m_dPartOffsetSide2)
' StringToLenAdv(sValArray(7), m_dPartOffsetSide3)
' StringToLenAdv(sValArray(9), m_dPartOffsetSide4)
' End If
' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
' pTo = sValue.LastIndexOf(" P11")
@@ -1105,9 +1105,9 @@ Public Class BTLPartM
' m_refGrainDir = New Vector3d
' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 4 Then
' StringToDouble(sValArray(0), m_refGrainDir.x)
' StringToDouble(sValArray(1), m_refGrainDir.y)
' StringToDouble(sValArray(2), m_refGrainDir.z)
' StringToDoubleAdv(sValArray(0), m_refGrainDir.x)
' StringToDoubleAdv(sValArray(1), m_refGrainDir.y)
' StringToDoubleAdv(sValArray(2), m_refGrainDir.z)
' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
' End If
+2
View File
@@ -44,6 +44,7 @@ Public Module ConstIni
Public Const K_DATADIR As String = "DataDir"
Public Const K_ENABLEEDIT As String = "EnableEdit"
Public Const K_FASTPRODUCE As String = "FastProduce"
Public Const K_ADDPROJ As String = "AddProj"
'Public Const S_LANGUAGES As String = "Languages"
'Public Const K_LANGUAGE As String = "Language"
@@ -94,6 +95,7 @@ Public Module ConstIni
Public Const S_IMPORT As String = "Import"
Public Const K_BTLFLAG As String = "BtlFlag"
Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
Public Const K_WALLOPPOSITESIDENESTING As String = "WallOppositeSideNesting"
'Public Const S_MACH As String = "Mach"
'Public Const K_MACHINESDIR As String = "MachinesDir"
@@ -28,7 +28,7 @@ Public Module DataGridColumnsIniFile
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
Dim Width As Double
Dim WidthType As DataGridLengthUnitType
StringToDouble(sColumnParams(5), Width)
StringToDoubleAdv(sColumnParams(5), Width)
Integer.TryParse(sColumnParams(6), WidthType)
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
@@ -65,7 +65,7 @@ Public Module DataGridColumnsIniFile
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
Dim Width As Double
Dim WidthType As DataGridLengthUnitType
StringToDouble(sColumnParams(5), Width)
StringToDoubleAdv(sColumnParams(5), Width)
Integer.TryParse(sColumnParams(6), WidthType)
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
@@ -424,6 +424,7 @@ Public Class EgtDataGridColumn
End Set
End Property
Private Property m_OrigIsReadOnly As Boolean = True
Private Property m_IsReadOnly As Boolean = True
Public Property IsReadOnly As Boolean
Get
@@ -561,6 +562,7 @@ Public Class EgtDataGridColumn
m_CanUserReorder = bCanUserReorder
m_CanUserResize = bCanUserResize
m_CanUserSort = bCanUserSort
m_OrigIsReadOnly = bIsReadOnly
m_IsReadOnly = bIsReadOnly
m_Width = Width
m_Visible = bVisible
@@ -588,7 +590,7 @@ Public Class EgtDataGridColumn
Public Function SaveDataGridColumn() As Boolean
Dim bOk As Boolean
Dim sColumnParams = String.Empty
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(m_OrigIsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
Return bOk
End Function
@@ -420,7 +420,7 @@ Public Class MyMachGroupM
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
StringToDouble(sSplitInfo(1), m_dStartCut)
StringToDoubleAdv(sSplitInfo(1), m_dStartCut)
Else
m_dStartCut = 0
End If
+1 -1
View File
@@ -508,7 +508,7 @@ Public Class PartM
Index += 1
End While
If bFound Then
StringToDouble(sSplitInfo(1), NewPartM.m_dPOSX)
StringToDoubleAdv(sSplitInfo(1), NewPartM.m_dPOSX)
End If
Else
' leggo PosX, PosY, Rot e Flip
@@ -169,7 +169,7 @@ Public MustInherit Class MyMachGroupVM
Return LenToString(MyMachGroupM.dStartCut, 3)
End Get
Set(value As String)
StringToLen(value, MyMachGroupM.dStartCut)
StringToLenAdv(value, MyMachGroupM.dStartCut, True)
End Set
End Property
Public Property dStartCut As Double
+4 -4
View File
@@ -107,7 +107,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dPOSX, 3)
End Get
Set(value As String)
StringToLen(value, m_PartM.dPOSX)
StringToLenAdv(value, m_PartM.dPOSX, True)
End Set
End Property
Public Property dPOSX As Double
@@ -217,7 +217,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dOffset, 3)
End Get
Set(value As String)
StringToLen(value, m_PartM.dOffset)
StringToLenAdv(value, m_PartM.dOffset, True)
End Set
End Property
Public ReadOnly Property dOffset As Double
@@ -235,7 +235,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dPOSY, 3)
End Get
Set(value As String)
StringToLen(value, m_PartM.dPOSY)
StringToLenAdv(value, m_PartM.dPOSY, True)
End Set
End Property
@@ -250,7 +250,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dROT, 3) & "°"
End Get
Set(value As String)
StringToLen(value, m_PartM.dROT)
StringToLenAdv(value, m_PartM.dROT, True)
End Set
End Property
+2 -2
View File
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.3.2")>
<Assembly: AssemblyFileVersion("2.5.3.2")>
<Assembly: AssemblyVersion("2.5.5.1")>
<Assembly: AssemblyFileVersion("2.5.5.1")>
@@ -10,6 +10,9 @@ Public Class ProdFileM
Return m_nProjIdList
End Get
End Property
Public Sub SetProjIdList(value As List(Of Integer))
m_nProjIdList = value
End Sub
Protected m_sName As String
Public ReadOnly Property sName As String
+6 -6
View File
@@ -147,9 +147,9 @@ Public Module BTLIniFile
Dim dMin As Double
Dim dMax As Double
Dim dDefault As Double
StringToDouble(sBTLParamParams(2), dMin)
StringToDouble(sBTLParamParams(3), dMax)
StringToDouble(sBTLParamParams(4), dDefault)
StringToDoubleAdv(sBTLParamParams(2), dMin)
StringToDoubleAdv(sBTLParamParams(3), dMax)
StringToDoubleAdv(sBTLParamParams(4), dDefault)
Dim ParamType As BTLParamType
If sBTLParamParams(0) = "d" Then
ParamType = BTLParamType.DOUBLE_
@@ -200,9 +200,9 @@ Public Module BTLIniFile
Dim dMin As Double
Dim dMax As Double
Dim dDefault As Double
StringToDouble(sBTLParamParams(2), dMin)
StringToDouble(sBTLParamParams(3), dMax)
StringToDouble(sBTLParamParams(4), dDefault)
StringToDoubleAdv(sBTLParamParams(2), dMin)
StringToDoubleAdv(sBTLParamParams(3), dMax)
StringToDoubleAdv(sBTLParamParams(4), dDefault)
Dim ParamType As BTLParamType
If sBTLParamParams(0) = "d" Then
ParamType = BTLParamType.DOUBLE_
@@ -27,7 +27,7 @@ Public Module DimensionsIniFile
Dim GridLenType As GridUnitType
Integer.TryParse(sValueParams(0), nDimIndex)
Integer.TryParse(sValueParams(1), nDimType)
StringToDouble(sValueParams(2), GridLenValue)
StringToDoubleAdv(sValueParams(2), GridLenValue)
Integer.TryParse(sValueParams(3), GridLenType)
GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType)))
End If
@@ -405,13 +405,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
currRecord.State = Core.ItemState.ND;
currRecord.SupervisorId = "";
currRecord.ProdIndex = 0;
}
// Commit changes
localDbCtx.SaveChanges();
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
// Commit changes
localDbCtx.SaveChanges();
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
done = true;
done = true;
}
else
{
string errMessage = $"ERROR on MachGroup.RemoveFromSupervisor: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -438,20 +444,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try
{
// aggiorno
localDbCtx
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault()
.State = newState;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
.FirstOrDefault();
if (item2upd != null)
{
item2upd.State = newState;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
}
else
{
string errMessage = $"ERROR on MachGroup.SetNeedRedo: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newState {newState} | Value {Value}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on MachGroup.UpdateStatus: {Environment.NewLine}{exc}";
string errMessage = $"EXCEPTION on MachGroup.SetNeedRedo: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
@@ -469,20 +484,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2update = localDbCtx
.MachGroupList
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
.SingleOrDefault();
try
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
var item2update = localDbCtx
.MachGroupList
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
.SingleOrDefault();
if (item2update != null)
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
else
{
string errMessage = $"ERROR on MachGroup.Update: req item was not found | ProdDbId {updItem.ProdDbId} | MachGroupId {updItem.MachGroupId} | ProdIndex {updItem.ProdIndex}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -513,15 +537,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
currRecord.DtEnd = DtEnd;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
if (currRecord != null)
{
currRecord.DtEnd = DtEnd;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
}
else
{
string errMessage = $"ERROR on MachGroup.UpdateEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtEnd {DtEnd}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -548,15 +578,23 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try
{
// aggiorno
localDbCtx
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault()
.ProdIndex = newProdIndex;
// Commit changes
localDbCtx.SaveChanges();
done = true;
.FirstOrDefault();
if (item2upd != null)
{
item2upd.ProdIndex = newProdIndex;
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
else
{
string errMessage = $"ERROR on MachGroup.UpdateOrder: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newProdIndex {newProdIndex}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -588,15 +626,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
currRecord.DtStart = DtStart;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
if (currRecord != null)
{
currRecord.DtStart = DtStart;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
}
else
{
string errMessage = $"ERROR on MachGroup.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtStart {DtStart}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -628,15 +672,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
currRecord.DtStart = DtStart;
currRecord.DtEnd = DtEnd;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
if (currRecord != null)
{
currRecord.DtStart = DtStart;
currRecord.DtEnd = DtEnd;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
else
{
string errMessage = $"ERROR on MachGroup.UpdateStartEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtStart {DtStart} | DtEnd {DtEnd}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -662,17 +713,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try
{
// aggiorno
localDbCtx
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault()
.State = newState;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
.FirstOrDefault();
if (item2upd != null)
{
item2upd.State = newState;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
else
{
string errMessage = $"ERROR on MachGroup.UpdateStatus: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newState {newState}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -694,20 +753,28 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try
{
// aggiorno
var currRecord = localDbCtx
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
if (item2upd != null)
{
item2upd.SupervisorId = SupervisorId;
item2upd.State = Core.ItemState.Assigned;
currRecord.SupervisorId = SupervisorId;
currRecord.State = Core.ItemState.Assigned;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
}
else
{
string errMessage = $"ERROR on MachGroup.UpdateSupervisor: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | SupervisorId {SupervisorId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -78,19 +78,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.SingleOrDefault();
try
if (item2del != null)
{
// Remove from database
localDbCtx.PartList.Remove(item2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
try
{
// Remove from database
localDbCtx.PartList.Remove(item2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId} | PartId: {PartId}{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
else
{
string errMessage = $"EXCEPTION on Part.Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId} | PartId: {PartId}{Environment.NewLine}{exc}";
string errMessage = $"ERROR on Part.Delete (01): req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
@@ -112,17 +122,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.PartList
.Where(x => x.PartDbId == PartDbId)
.SingleOrDefault();
try
if (item2del != null)
{
// Add to database
localDbCtx.PartList.Remove(item2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
try
{
// Add to database
localDbCtx.PartList.Remove(item2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.Delete: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
else
{
string errMessage = $"EXCEPTION on Part.Delete: {Environment.NewLine}{exc}";
string errMessage = $"ERROR on Part.Delete (02): req item was not found | PartDbId {PartDbId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
@@ -209,28 +229,37 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2update = locallocalDbCtx
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.PartDbId == updItem.PartDbId)
.SingleOrDefault();
try
if (item2upd != null)
{
// update, vers 1...
locallocalDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
try
{
// update, vers 1...
locallocalDbCtx.Entry(item2upd).CurrentValues.SetValues(updItem);
//// update, vers 2
//localDbCtx.PartList.Remove(item2del);
//localDbCtx.PartList.Add(updItem);
//// update, vers 2
//localDbCtx.PartList.Remove(item2del);
//localDbCtx.PartList.Add(updItem);
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.Update: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
else
{
string errMessage = $"EXCEPTION on Part.Update: {Environment.NewLine}{exc}";
string errMessage = $"ERROR on Part.Update (01): req item was not found | PartId {updItem.PartId} | PartDbId {updItem.PartDbId} | BTLPartDbId {updItem.BTLPartDbId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
@@ -252,16 +281,26 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try
{
// aggiorno
locallocalDbCtx
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.FirstOrDefault()
.DtEnd = DtEnd;
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
.FirstOrDefault();
if (item2upd != null)
{
item2upd.DtEnd = DtEnd;
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
}
else
{
string errMessage = $"ERROR on Part.UpdateEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | DtEnd {DtEnd}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -287,16 +326,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try
{
// aggiorno
locallocalDbCtx
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.FirstOrDefault()
.DtStart = DtStart;
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
.FirstOrDefault();
if (item2upd != null)
{
item2upd.DtStart = DtStart;
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
}
else
{
string errMessage = $"ERROR on Part.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | DtStart {DtStart}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -323,16 +371,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try
{
// aggiorno
locallocalDbCtx
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.FirstOrDefault()
.State = newState;
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
.FirstOrDefault();
if (item2upd != null)
{
item2upd.State = newState;
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
}
else
{
string errMessage = $"ERROR on Part.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | newState {newState}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
@@ -19,7 +19,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
public ProdController()
{
Log.Info("ProdController istance Started");
Log.Info("ProdController instance Started");
}
#endregion Public Constructors
@@ -353,25 +353,39 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2update = localDbCtx
.ProdList
.Where(x => x.ProdDbId == updItem.ProdDbId)
.SingleOrDefault();
try
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
var item2update = localDbCtx
.ProdList
.Where(x => x.ProdDbId == updItem.ProdDbId)
.SingleOrDefault();
//// update, vers 2
//localDbCtx.PartList.Remove(item2del);
//localDbCtx.PartList.Add(updItem);
if (item2update != null)
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
// Commit changes
localDbCtx.SaveChanges();
done = true;
//// update, vers 2
//localDbCtx.PartList.Remove(item2del);
//localDbCtx.PartList.Add(updItem);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
else
{
string errMessage = $"ERROR on Prod.Update: req item was not found | ProdId {updItem.ProdId} | ProdDbId {updItem.ProdDbId} | Description {updItem.Description}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Prod.Update: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
catch
{ }
}
return done;
}
@@ -384,137 +398,163 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// </summary>
/// <param name="ProdId">Id del Prod</param>
/// <param name="MachGroupList">Elenco MachGroup da associare</param>
/// <returns></returns>
public ProdModel UpdateMachGroup(int ProdId, List<Core.MyMachGroupM> MachGroupList)
/// <returns>Bool esecuzione con successo o meno</returns>
public bool UpdateMachGroup(int ProdId, List<Core.MyMachGroupM> MachGroupList)
{
ProdModel currData = new ProdModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
bool testOk = false;
// calcolo occorrenze x ogni ID della barra...
var listaCheck = MachGroupList
.GroupBy(x => x.Id)
.Select(n => new
{
PartId = n.Key,
PartCount = n.Count()
})
.OrderBy(n => n.PartCount);
// controllo: nell'elenco delle barre MachGroupList NON devono esserci duplicati per
// l'ID (esterno) che deve essere univoco...
testOk = listaCheck.Where(x => x.PartCount > 1).Count() == 0;
if (testOk)
{
// Recupero il PROD nel contesto DB attuale
currData = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
try
ProdModel currData = new ProdModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// preparo elenco
List<MachGroupModel> itemsMG2Add = new List<MachGroupModel>();
List<Core.MyMachGroupM> MachGroupList2Add = new List<Core.MyMachGroupM>();
List<PartModel> PartList2Add = new List<PartModel>();
// cerco le MG esistenti --> aggiorno
foreach (var item in MachGroupList)
try
{
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id);
var convCurrMG = MachGroupController.ConvertFromCore(item, currData.ProdDbId);
if (currMG != null)
// Recupero il PROD nel contesto DB attuale
currData = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
if (currData != null)
{
// se non identico x equality limitata a ViewOptim...
if (!currMG.ViewOptimEquals(convCurrMG))
// preparo elenco
List<MachGroupModel> itemsMG2Add = new List<MachGroupModel>();
List<Core.MyMachGroupM> MachGroupList2Add = new List<Core.MyMachGroupM>();
List<PartModel> PartList2Add = new List<PartModel>();
// cerco le MG esistenti --> aggiorno
foreach (var item in MachGroupList)
{
// aggiorno con nuovi valori ricevuti
currMG.H = convCurrMG.H;
currMG.L = convCurrMG.L;
currMG.W = convCurrMG.W;
currMG.Material = convCurrMG.Material;
currMG.Name = convCurrMG.Name;
// salvo
localDbCtx.SaveChanges();
// registro modifica StatusMap
StatusMapController.man.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id);
var convCurrMG = MachGroupController.ConvertFromCore(item, currData.ProdDbId);
if (currMG != null)
{
// se non identico x equality limitata a ViewOptim...
if (!currMG.ViewOptimEquals(convCurrMG))
{
// aggiorno con nuovi valori ricevuti
currMG.H = convCurrMG.H;
currMG.L = convCurrMG.L;
currMG.W = convCurrMG.W;
currMG.Material = convCurrMG.Material;
currMG.Name = convCurrMG.Name;
// salvo
localDbCtx.SaveChanges();
// registro modifica StatusMap
StatusMapController.man.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
}
else
{
itemsMG2Add.Add(convCurrMG);
// registro modifica StatusMap
StatusMapController.man.UpdateAction("", ProdId, item.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
}
}
// aggiungo MachGroup
localDbCtx.MachGroupList.AddRange(itemsMG2Add);
// Commit changes
localDbCtx.SaveChanges();
// verifico di nuovo l'elenco delle MG x le relative PART...
foreach (var item in MachGroupList)
{
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id);
int MachGroupDbId = currMG.MachGroupDbId;
bool modMg = false;
// verifico se uguali o meno...
foreach (var currPartM in item.PartMList)
{
var currPart = localDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == item.Id && x.PartId == currPartM.nPartId)
.SingleOrDefault();
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
if (currPart != null)
{
// se non identico x equality limitata a ViewOptim...
if (!currPart.ViewOptimEquals(convCurrPartM))
{
// aggiorno con nuovi valori ricevuti
currPart.H = convCurrPartM.H;
currPart.L = convCurrPartM.L;
currPart.W = convCurrPartM.W;
currPart.Material = convCurrPartM.Material;
currPart.CALC_State = convCurrPartM.CALC_State;
currPart.ROT = convCurrPartM.ROT;
currPart.PDN = convCurrPartM.PDN;
currPart.NAM = convCurrPartM.NAM;
// salvo
localDbCtx.SaveChanges();
modMg = true;
}
}
else
{
PartList2Add.Add(convCurrPartM);
modMg = true;
}
}
// verifico se salvare...
if (modMg)
{
StatusMapController.man.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
}
// aggiungo PartList
localDbCtx.PartList.AddRange(PartList2Add);
// Commit changes
localDbCtx.SaveChanges();
// sel dei MachGroup da prod OLD
List<MachGroupModel> itemsMGOld = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId)
.ToList();
// elenco degli ID del MachGroup NON trovati
List<int> MgId2rem = itemsMGOld.Select(x => x.MachGroupId).Except(MachGroupList.Select(y => y.Id)).ToList();
// processo i MachGroup eliminati
foreach (var item in MgId2rem)
{
MachGroupController.man.Delete(ProdId, item);
}
// aggiorno valore isNew a false x PROD
currData.IsNew = false;
// Commit changes
localDbCtx.SaveChanges();
}
else
{
itemsMG2Add.Add(convCurrMG);
// registro modifica StatusMap
StatusMapController.man.UpdateAction("", ProdId, item.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
string errMessage = $"ERROR on Prod.UpdateMachGroup: req item was not found | ProdId {ProdId} | MachGroupList {MachGroupList.Count} rec";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
// aggiungo MachGroup
localDbCtx.MachGroupList.AddRange(itemsMG2Add);
// Commit changes
localDbCtx.SaveChanges();
// verifico di nuovo l'elenco delle MG x le relative PART...
foreach (var item in MachGroupList)
catch (Exception exc)
{
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id);
int MachGroupDbId = currMG.MachGroupDbId;
bool modMg = false;
// verifico se uguali o meno...
foreach (var currPartM in item.PartMList)
{
var currPart = localDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == item.Id && x.PartId == currPartM.nPartId)
.SingleOrDefault();
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
if (currPart != null)
{
// se non identico x equality limitata a ViewOptim...
if (!currPart.ViewOptimEquals(convCurrPartM))
{
// aggiorno con nuovi valori ricevuti
currPart.H = convCurrPartM.H;
currPart.L = convCurrPartM.L;
currPart.W = convCurrPartM.W;
currPart.Material = convCurrPartM.Material;
currPart.CALC_State = convCurrPartM.CALC_State;
currPart.ROT = convCurrPartM.ROT;
currPart.PDN = convCurrPartM.PDN;
currPart.NAM = convCurrPartM.NAM;
// salvo
localDbCtx.SaveChanges();
modMg = true;
}
}
else
{
PartList2Add.Add(convCurrPartM);
modMg = true;
}
}
// verifico se salvare...
if (modMg)
{
StatusMapController.man.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
string errMessage = $"EXCEPTION on Prod.UpdateMachGroup: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
// aggiungo PartList
localDbCtx.PartList.AddRange(PartList2Add);
// Commit changes
localDbCtx.SaveChanges();
// sel dei MachGroup da prod OLD
List<MachGroupModel> itemsMGOld = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId)
.ToList();
// elenco degli ID del MachGroup NON trovati
List<int> MgId2rem = itemsMGOld.Select(x => x.MachGroupId).Except(MachGroupList.Select(y => y.Id)).ToList();
// processo i MachGroup eliminati
foreach (var item in MgId2rem)
{
MachGroupController.man.Delete(ProdId, item);
}
// aggiorno valore isNew a false x PROD
currData.IsNew = false;
// Commit changes
localDbCtx.SaveChanges();
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Prod.UpdateMachGroup: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return currData;
return testOk;
}
/// <summary>
@@ -525,18 +565,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public Core.ProdFileM UpdateMachine(int ProdId, String Machine)
{
ProdModel currData;
ProdModel currData = new ProdModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
currData = localDbCtx
try
{
currData = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
// aggiorno valore BTL
currData.Machine = Machine;
if (currData != null)
{
// aggiorno valore BTL
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
// Commit changes
localDbCtx.SaveChanges();
}
else
{
string errMessage = $"ERROR on Prod.UpdateMachine: req item was not found | ProdId {ProdId} | Machine {Machine}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Prod.UpdateMachine: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return coreConv(currData);
}
@@ -549,18 +607,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public Core.ProdFileM UpdatePType(int ProdId, BWType PType)
{
ProdModel currData;
ProdModel currData = new ProdModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
currData = localDbCtx
try
{
currData = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
// aggiorno valore BTL
currData.PType = PType;
if (currData != null)
{
// aggiorno valore BTL
currData.PType = PType;
// Commit changes
localDbCtx.SaveChanges();
// Commit changes
localDbCtx.SaveChanges();
}
else
{
string errMessage = $"ERROR on Prod.UpdatePType: req item was not found | ProdId {ProdId} | PType {PType}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Prod.UpdatePType: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return coreConv(currData);
}
@@ -572,25 +648,40 @@ namespace EgtBEAMWALL.DataLayer.Controllers
string LockBy = "";
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// seleziono il prod...
var currProd = localDbCtx
try
{
// seleziono il prod...
var currProd = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.FirstOrDefault();
if (currProd != null)
{
LockBy = currProd.LockedBy;
var currProj = localDbCtx
.ProjList
.Where(x => x.ProdDbId == currProd.ProdDbId)
.ToList();
if (currProj != null && string.IsNullOrEmpty(LockBy))
if (currProd != null)
{
LockBy = currProj.FirstOrDefault(x => !string.IsNullOrEmpty(x.LockedBy)).LockedBy;
LockBy = currProd.LockedBy;
var currProj = localDbCtx
.ProjList
.Where(x => x.ProdDbId == currProd.ProdDbId)
.ToList();
if (currProj != null && string.IsNullOrEmpty(LockBy))
{
LockBy = currProj.FirstOrDefault(x => !string.IsNullOrEmpty(x.LockedBy)).LockedBy;
}
}
else
{
string errMessage = $"ERROR on Prod.UserLockByProdId: req item was not found | ProdId {ProdId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Prod.UserLockByProdId: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return LockBy;
@@ -452,22 +452,35 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.ProjList
.Where(x => x.ProjId == updItem.ProjId)
.SingleOrDefault();
try
if (item2update != null)
{
updItem.ProjDbId = item2update.ProjDbId;
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
try
{
updItem.ProjDbId = item2update.ProjDbId;
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
//// update, vers 2
//dbCtx.PartList.Remove(item2del);
//dbCtx.PartList.Add(updItem);
//// update, vers 2
//dbCtx.PartList.Remove(item2del);
//dbCtx.PartList.Add(updItem);
// Commit changes
localDbCtx.SaveChanges();
done = true;
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.Update{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
else
{
string errMessage = $"ERROR on Proj.Update: req item was not found | ProjId {updItem.ProjId} | ProjDbId {updItem.ProjDbId} | ProdDbId {updItem.ProdDbId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
catch (Exception)
{ }
}
return done;
}
@@ -493,64 +506,72 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.BTLPartList
.Where(x => x.ProjDbId == currData.ProjDbId)
.ToList();
// converto le BtlParts da core --> DB
List<BTLPartModel> newBtlParts = BtlPartList.Select(x => BTLPartController.ConvertFromCore(x, currData.ProjDbId)).ToList();
try
if (oldBtlParts != null)
{
// elementi BtlPartId NON + presenti da eliminare
List<int> bpi2rem = oldBtlParts.Select(x => x.PartId).Except(newBtlParts.Select(y => y.PartId)).ToList();
List<int> bpi2add = newBtlParts.Select(x => x.PartId).Except(oldBtlParts.Select(y => y.PartId)).ToList();
List<int> bpiExis = newBtlParts.Select(x => x.PartId).Intersect(oldBtlParts.Select(y => y.PartId)).ToList();
// converto le BtlParts da core --> DB
List<BTLPartModel> newBtlParts = BtlPartList.Select(x => BTLPartController.ConvertFromCore(x, currData.ProjDbId)).ToList();
// aggiorno existing...
foreach (var currPartId in bpiExis)
try
{
// recupero item da aggiornare...
var oldItem = oldBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
// dati nuovo item
var newItem = newBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
if (newItem != null && oldItem != null)
// elementi BtlPartId NON + presenti da eliminare
List<int> bpi2rem = oldBtlParts.Select(x => x.PartId).Except(newBtlParts.Select(y => y.PartId)).ToList();
List<int> bpi2add = newBtlParts.Select(x => x.PartId).Except(oldBtlParts.Select(y => y.PartId)).ToList();
List<int> bpiExis = newBtlParts.Select(x => x.PartId).Intersect(oldBtlParts.Select(y => y.PartId)).ToList();
// aggiorno existing...
foreach (var currPartId in bpiExis)
{
oldItem.CALC_State = newItem.CALC_State;
oldItem.CNT = newItem.CNT;
oldItem.DO = newItem.DO;
oldItem.H = newItem.H;
oldItem.L = newItem.L;
oldItem.W = newItem.W;
oldItem.Material = newItem.Material;
oldItem.NAM = newItem.NAM;
oldItem.PDN = newItem.PDN;
// recupero item da aggiornare...
var oldItem = oldBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
// dati nuovo item
var newItem = newBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
if (newItem != null && oldItem != null)
{
oldItem.CALC_State = newItem.CALC_State;
oldItem.CNT = newItem.CNT;
oldItem.DO = newItem.DO;
oldItem.H = newItem.H;
oldItem.L = newItem.L;
oldItem.W = newItem.W;
oldItem.Material = newItem.Material;
oldItem.NAM = newItem.NAM;
oldItem.PDN = newItem.PDN;
}
}
// aggiungo le nuove part
foreach (var newPartId in bpi2add)
{
var newItem = newBtlParts.Where(x => x.PartId == newPartId).FirstOrDefault();
localDbCtx.BTLPartList.Add(newItem);
}
// elimino dal DB i non + esistenti
foreach (var oldPartId in bpi2rem)
{
// elimino parts nei MachGroup
var oldIstPartList = localDbCtx.PartList.Where(x => x.BTLPart.PartId == oldPartId).ToList();
localDbCtx.PartList.RemoveRange(oldIstPartList);
// elimino BtlParts
var oldItem = oldBtlParts.Where(x => x.PartId == oldPartId).FirstOrDefault();
localDbCtx.BTLPartList.Remove(oldItem);
}
}
catch
{ }
// aggiungo le nuove part
foreach (var newPartId in bpi2add)
{
var newItem = newBtlParts.Where(x => x.PartId == newPartId).FirstOrDefault();
localDbCtx.BTLPartList.Add(newItem);
}
// aggiorno valore isNew a false
currData.IsNew = false;
// elimino dal DB i non + esistenti
foreach (var oldPartId in bpi2rem)
{
// elimino parts nei MachGroup
var oldIstPartList = localDbCtx.PartList.Where(x => x.BTLPart.PartId == oldPartId).ToList();
localDbCtx.PartList.RemoveRange(oldIstPartList);
// elimino BtlParts
var oldItem = oldBtlParts.Where(x => x.PartId == oldPartId).FirstOrDefault();
localDbCtx.BTLPartList.Remove(oldItem);
}
// Commit changes
localDbCtx.SaveChanges();
}
else
{
string errMessage = $"ERROR on Proj.UpdateBtlParts: req item was not found | ProjId {ProjId} | BtlPartList {BtlPartList.Count} items";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
catch
{ }
// aggiorno valore isNew a false
currData.IsNew = false;
// Commit changes
localDbCtx.SaveChanges();
}
return currData;
}
@@ -573,50 +594,67 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.ProjList
.Where(x => x.ProjId == ProjId)
.SingleOrDefault();
// 2022.01.24: verifico UNIVOCITA' nel nome del file: SE fosse duplicato --> nuovo
// nome, nel formato nomeOriginale_idx, dove idx è il contatore libero successivo
var duplicateList = FindByBtlFileName(BTLFileName);
// devo verificare SOLO SE la lista non è vuota
if (duplicateList != null && duplicateList.Count > 0)
if (currData != null)
{
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
if (duplicateList.Count == 1)
try
{
// verifico se ProjId variato
if (!duplicateList[0].ProjId.Equals(currData.ProjId))
// 2022.01.24: verifico UNIVOCITA' nel nome del file: SE fosse duplicato -->
// nuovo nome, nel formato nomeOriginale_idx, dove idx è il contatore libero successivo
var duplicateList = FindByBtlFileName(BTLFileName);
// devo verificare SOLO SE la lista non è vuota
if (duplicateList != null && duplicateList.Count > 0)
{
// in questo caso ho il PRIMO duplicato
BTLFileName = $"{BTLFileName}_1";
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
if (duplicateList.Count == 1)
{
// verifico se ProjId variato
if (!duplicateList[0].ProjId.Equals(currData.ProjId))
{
// in questo caso ho il PRIMO duplicato
BTLFileName = $"{BTLFileName}_1";
}
}
// se ne ho + di 1 --> so che il maxId interno avrò il valore ULTIMO x
// prendere il successivo
else
{
var lastRec = duplicateList.OrderByDescending(x => x.ProjDbId).FirstOrDefault();
// cerco indice
string maybeNumber = lastRec.BTLFileName.Replace($"{BTLFileName}_", "");
int index = 0;
bool isNumber = int.TryParse(maybeNumber, out index);
// fasccio comunque verifica sia numerico
if (isNumber)
{
// in questo caso ho il l'ULTIMO duplicato e faccio +1
BTLFileName = $"{BTLFileName}_{index + 1}";
}
}
}
// aggiorno valore BTL
currData.BTLFileName = BTLFileName;
currData.DtExported = DtExported;
currData.ListName = ListName;
currData.PType = PType;
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
}
// se ne ho + di 1 --> so che il maxId interno avrò il valore ULTIMO x prendere
// il successivo
else
catch (Exception exc)
{
var lastRec = duplicateList.OrderByDescending(x => x.ProjDbId).FirstOrDefault();
// cerco indice
string maybeNumber = lastRec.BTLFileName.Replace($"{BTLFileName}_", "");
int index = 0;
bool isNumber = int.TryParse(maybeNumber, out index);
// fasccio comunque verifica sia numerico
if (isNumber)
{
// in questo caso ho il l'ULTIMO duplicato e faccio +1
BTLFileName = $"{BTLFileName}_{index + 1}";
}
string errMessage = $"EXCEPTION on Part.UpdateInfo:{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
// aggiorno valore BTL
currData.BTLFileName = BTLFileName;
currData.DtExported = DtExported;
currData.ListName = ListName;
currData.PType = PType;
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
else
{
string errMessage = $"ERROR on Proj.UpdateInfo: req item was not found | ProjId {ProjId} | BTLFileName {BTLFileName} | ListName {ListName} | DtExported {DtExported} | PType {PType} | Machine {Machine}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return coreConv(currData);
@@ -630,18 +668,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public Core.ProjFileM UpdateListName(int ProjId, string ListName)
{
ProjModel currData;
ProjModel currData = new ProjModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
currData = localDbCtx
.ProjList
.Where(x => x.ProjId == ProjId)
.SingleOrDefault();
// aggiorno valore BTL
currData.ListName = ListName;
try
{
currData = localDbCtx
.ProjList
.Where(x => x.ProjId == ProjId)
.SingleOrDefault();
if (currData != null)
{
// aggiorno valore BTL
currData.ListName = ListName;
// Commit changes
localDbCtx.SaveChanges();
// Commit changes
localDbCtx.SaveChanges();
}
else
{
string errMessage = $"ERROR on Proj.UpdateListName: req item was not found | ProjId {ProjId} | ListName {ListName}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.UpdateListName:{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return coreConv(currData);
}
@@ -654,18 +710,37 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public Core.ProjFileM UpdateMachine(int ProjId, String Machine)
{
ProjModel currData;
ProjModel currData = new ProjModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
currData = localDbCtx
try
{
currData = localDbCtx
.ProjList
.Where(x => x.ProjId == ProjId)
.SingleOrDefault();
// aggiorno valore BTL
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
if (currData != null)
{
// aggiorno valore BTL
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
}
else
{
string errMessage = $"ERROR on Proj.UpdateMachine: req item was not found | ProjId {ProjId} | Machine {Machine}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.UpdateMachine:{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return coreConv(currData);
}
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.3.2")]
[assembly: AssemblyFileVersion("2.5.3.2")]
[assembly: AssemblyVersion("2.5.5.1")]
[assembly: AssemblyFileVersion("2.5.5.1")]
+18 -15
View File
@@ -118,6 +118,7 @@ Public Class CALCPanelVM
End Sub
Private Shared Sub ProcessResults(Bar As Bar)
If IsNothing(Bar) Then Return
' disabilito impostazione modificato
Dim DisableMgr As New DisableModifiedMgr
@@ -148,7 +149,7 @@ Public Class CALCPanelVM
If line.StartsWith("ERR=") Then
Dim nVal As Integer? = GetVal(line, "ERR")
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
sMsg = ""
dRot = 0
nFall = 0
@@ -156,24 +157,24 @@ Public Class CALCPanelVM
taskId = 0
ElseIf line.StartsWith("ROT=") Then
Dim nVal As Integer? = GetVal(line, "ROT")
Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0))
Dim nRot As Integer = (If(Not IsNothing(nVal), nVal.Value, 0))
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
dPartRot = Math.Max(dPartRot, dRot)
dTotRot = Math.Max(dTotRot, dRot)
ElseIf line.StartsWith("CUTID=") Then
Dim nVal As Integer? = GetVal(line, "CUTID")
cutId = If(nVal IsNot Nothing, nVal.Value, 0)
cutId = If(Not IsNothing(nVal), nVal.Value, 0)
ElseIf line.StartsWith("TASKID=") Then
Dim nVal As Integer? = GetVal(line, "TASKID")
taskId = (If(nVal IsNot Nothing, nVal.Value, 0))
taskId = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), Bar)
ElseIf line.StartsWith("FALL=") Then
Dim nVal As Integer? = GetVal(line, "FALL")
nFall = (If(nVal IsNot Nothing, nVal.Value, 0))
nFall = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
ElseIf line.StartsWith("TIME=") Then
Dim nVal As Integer? = GetVal(line, "TIME")
nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0))
nTotTime = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
@@ -216,23 +217,25 @@ Public Class CALCPanelVM
End If
Select Case Line.Type
Case ProcessResult.ProcessResultTypes.BAR
CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG)
If Not IsNothing(CurrMachgroupVM) Then CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.PART
CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
If Not IsNothing(CurrPartVM) Then CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.TASKID
CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
If Not IsNothing(CurrBTLFeatureVM) Then CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.FALL
CurrPartVM.CalcFallUpdate(Line.nFALL)
If Not IsNothing(CurrPartVM) Then CurrPartVM.CalcFallUpdate(Line.nFALL)
Case ProcessResult.ProcessResultTypes.TIME
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
If Not IsNothing(CurrMachgroupVM) Then CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
End Select
Next
Machgroup = GetMachgroupVMFromMachgroupId(Bar.nBarId)
For Each Part In Machgroup.PartVMList
Part.CalcGlobalUpdate()
Next
Machgroup.CalcGlobalUpdate()
If Not IsNothing(Machgroup) Then
For Each Part In Machgroup.PartVMList
Part.CalcGlobalUpdate()
Next
Machgroup.CalcGlobalUpdate()
End If
End If
+1 -1
View File
@@ -474,7 +474,7 @@ Public Class NUMAxiumComm
Friend Sub WriteNCVariables(Address As String, value As String)
Try
Dim dValue As Double = 0
StringToDouble(value, dValue)
StringToDoubleAdv(value, dValue)
Dim rc As Short = objDVariables.WriteVariables(objDGroupManager.Handle, Address, value)
'If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
@@ -467,7 +467,7 @@ Public Class NUMAxiumPcToolkitComm
Friend Sub WritePlcVariables(Address As String, value As String)
Try
Dim dValue As Double = 0
StringToDouble(value, dValue)
StringToDoubleAdv(value, dValue)
Select Case Address
Case "E30099" ' in realta' per scrivere si usa la %RD0C.L
Dim nRes = WriteLadderVar(m_nPortWVariables, RL, &HD0C, 1, dValue)
@@ -641,7 +641,6 @@ Public Class NUMAxiumPcToolkitComm
Dim FileTransferThread As New Thread(Sub()
' leggo variabile E30099
Dim SendPermissionVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = SENDPERMISSION)
Dim dTemp As Double = 0
Dim nSendPermission As Integer = 0
EgtOutLog("Inizio invio programma")
While nSendPermission <> 2
@@ -649,8 +648,7 @@ Public Class NUMAxiumPcToolkitComm
EgtOutLog("Inizio ciclo verifica diverso da 2")
' leggo valore
If Not IsNothing(SendPermissionVariable.sValue) Then
StringToDouble(SendPermissionVariable.sValue, dTemp)
Integer.TryParse(dTemp, nSendPermission)
Integer.TryParse(SendPermissionVariable.sValue, nSendPermission)
EgtOutLog("Lettura variabile E30099: " & nSendPermission)
Else
EgtOutLog("nSendPermission = -1")
@@ -798,7 +796,7 @@ Public Class NUMAxiumPcToolkitComm
Friend Sub WriteNCVariables(Address As String, value As String)
Try
Dim dValue As Double = 0
StringToDouble(value, dValue)
StringToDoubleAdv(value, dValue)
Dim nType As eVarious4
Dim nValue As Integer = 0
Dim MyData As New My_data_struct
@@ -378,7 +378,7 @@ Public Class NUMFlexiumComm
' EgtOutLog("Inizio ciclo verifica diverso da 2")
' ' leggo valore
' If Not IsNothing(SendPermissionVariable.sValue) Then
' StringToDouble(SendPermissionVariable.sValue, dTemp)
' StringToDoubleAdv(SendPermissionVariable.sValue, dTemp)
' Integer.TryParse(dTemp, nSendPermission)
' EgtOutLog("Lettura variabile E30099: " & nSendPermission)
' Else
@@ -449,7 +449,7 @@ Public Class NUMFlexiumComm
Friend Sub WriteNCVariables(Address As String, value As String)
Try
Dim dValue As Double = 0
StringToDouble(value, dValue)
StringToDoubleAdv(value, dValue)
Dim rc As Short = objDVariables.WriteVariables2(2, objDGroupManager.Handle, Address, dValue)
If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
@@ -132,7 +132,7 @@ Public Class MyMachGroupVM
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut)
StringToDoubleAdv(sSplitInfo(1), MyMachGroupM.dStartCut)
Else
MyMachGroupM.dStartCut = 0
End If
@@ -286,70 +286,59 @@ Public Class MachManaging
Dim dTemp As Double = 0
Dim nTemp As Integer = 0
If Not IsNothing(ResetVariable.sValue) Then
StringToDouble(ResetVariable.sValue, dTemp)
Integer.TryParse(dTemp, nReset_State)
Integer.TryParse(ResetVariable.sValue, nReset_State)
Else
nReset_State = 1
End If
If Not IsNothing(StartVariable.sValue) Then
StringToDouble(StartVariable.sValue, dTemp)
Integer.TryParse(dTemp, nTemp)
Integer.TryParse(StartVariable.sValue, nTemp)
nStart_State = (nTemp = 1)
Else
nStart_State = -1
End If
If Not IsNothing(StopVariable.sValue) Then
StringToDouble(StopVariable.sValue, dTemp)
Integer.TryParse(dTemp, nTemp)
Integer.TryParse(StopVariable.sValue, nTemp)
nStop_State = (nTemp = 1)
Else
nStop_State = -1
End If
If Not IsNothing(ProdVariable.sValue) Then
StringToDouble(ProdVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Prod)
Integer.TryParse(ProdVariable.sValue, nP_Prod)
Else
nP_Prod = -1
End If
If Not IsNothing(MachGroupVariable.sValue) Then
StringToDouble(MachGroupVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Machgroup)
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
Else
nP_Machgroup = -1
End If
If Not IsNothing(PartVariable.sValue) Then
StringToDouble(PartVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Part)
Integer.TryParse(PartVariable.sValue, nP_Part)
Else
nP_Part = -1
End If
If Not IsNothing(StateVariable.sValue) Then
StringToDouble(StateVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_State)
Integer.TryParse(StateVariable.sValue, nP_State)
Else
nP_State = -1
End If
If Not IsNothing(ISONumVariable.sValue) Then
StringToDouble(ISONumVariable.sValue, dTemp)
Integer.TryParse(dTemp, nISO_Num)
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
Else
nISO_Num = -1
End If
If Not IsNothing(ISOSentVariable.sValue) Then
StringToDouble(ISOSentVariable.sValue, dTemp)
Integer.TryParse(dTemp, nISO_Sent)
Integer.TryParse(ISOSentVariable.sValue, nISO_Sent)
Else
nISO_Sent = -1
End If
If Not IsNothing(RunningVariable.sValue) Then
StringToDouble(RunningVariable.sValue, dTemp)
Integer.TryParse(dTemp, nRunning)
Integer.TryParse(RunningVariable.sValue, nRunning)
Else
nRunning = -1
End If
If Not IsNothing(MachIndexVariable.sValue) Then
StringToDouble(MachIndexVariable.sValue, dTemp)
Integer.TryParse(dTemp, nCurrMachIndex)
Integer.TryParse(MachIndexVariable.sValue, nCurrMachIndex)
Else
nCurrMachIndex = -1
End If
@@ -366,70 +355,59 @@ Public Class MachManaging
Dim dTemp As Double = 0
Dim nTemp As Integer = 0
If Not IsNothing(ResetVariable.sValue) Then
StringToDouble(ResetVariable.sValue, dTemp)
Integer.TryParse(dTemp, nReset_State)
Integer.TryParse(ResetVariable.sValue, nReset_State)
Else
nReset_State = 1
End If
If Not IsNothing(StartVariable.sValue) Then
StringToDouble(StartVariable.sValue, dTemp)
Integer.TryParse(dTemp, nTemp)
Integer.TryParse(StartVariable.sValue, nTemp)
nStart_State = (nTemp = 1)
Else
nStart_State = -1
End If
If Not IsNothing(StopVariable.sValue) Then
StringToDouble(StopVariable.sValue, dTemp)
Integer.TryParse(dTemp, nTemp)
Integer.TryParse(StopVariable.sValue, nTemp)
nStop_State = (nTemp = 1)
Else
nStop_State = -1
End If
If Not IsNothing(ProdVariable.sValue) Then
StringToDouble(ProdVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Prod)
Integer.TryParse(ProdVariable.sValue, nP_Prod)
Else
nP_Prod = -1
End If
If Not IsNothing(MachGroupVariable.sValue) Then
StringToDouble(MachGroupVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Machgroup)
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
Else
nP_Machgroup = -1
End If
If Not IsNothing(PartVariable.sValue) Then
StringToDouble(PartVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Part)
Integer.TryParse(PartVariable.sValue, nP_Part)
Else
nP_Part = -1
End If
If Not IsNothing(StateVariable.sValue) Then
StringToDouble(StateVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_State)
Integer.TryParse(StateVariable.sValue, nP_State)
Else
nP_State = -1
End If
If Not IsNothing(ISONumVariable.sValue) Then
StringToDouble(ISONumVariable.sValue, dTemp)
Integer.TryParse(dTemp, nISO_Num)
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
Else
nISO_Num = -1
End If
If Not IsNothing(ISOSentVariable.sValue) Then
StringToDouble(ISOSentVariable.sValue, dTemp)
Integer.TryParse(dTemp, nISO_Sent)
Integer.TryParse(ISOSentVariable.sValue, nISO_Sent)
Else
nISO_Sent = -1
End If
If Not IsNothing(RunningVariable.sValue) Then
StringToDouble(RunningVariable.sValue, dTemp)
Integer.TryParse(dTemp, nRunning)
Integer.TryParse(RunningVariable.sValue, nRunning)
Else
nRunning = -1
End If
If Not IsNothing(MachIndexVariable.sValue) Then
StringToDouble(MachIndexVariable.sValue, dTemp)
Integer.TryParse(dTemp, nCurrMachIndex)
Integer.TryParse(MachIndexVariable.sValue, nCurrMachIndex)
Else
nCurrMachIndex = -1
End If
@@ -469,7 +447,7 @@ Public Class MachManaging
Else
OpState = OPStates.End
End If
If OpState <> Map.refLeftPanelVM.SelOPState.Id Then
If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
m_OpStateCallbackDlg(OpState)
End If
End If
@@ -540,27 +518,33 @@ Public Class MachManaging
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
' se pezzo = -1 devo dare start a tutti i pezzi del MachGroup
If nP_Part = -1 Then
For Each Part In MachGroup.PartVMList
' scrivo data start su Db pezzo
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.WIP)
' scrivo stato start
Part.nProduction_State = ItemState.WIP
Part.dtStartTime = dtStart
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' scrivo evento inizio pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
Next
If Not IsNothing(MachGroup) Then
For Each Part In MachGroup.PartVMList
' scrivo data start su Db pezzo
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.WIP)
' scrivo stato start
Part.nProduction_State = ItemState.WIP
Part.dtStartTime = dtStart
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' scrivo evento inizio pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
Next
End If
Else
' scrivo data start su Db pezzo
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, nP_Part, dtStart)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.WIP)
' recupero pezzo
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
' scrivo stato start
Part.nProduction_State = ItemState.WIP
Part.dtStartTime = dtStart
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
If Not IsNothing(MachGroup) Then
' recupero pezzo
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
If Not IsNothing(Part) Then
' scrivo stato start
Part.nProduction_State = ItemState.WIP
Part.dtStartTime = dtStart
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
End If
End If
' scrivo evento inizio pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
End If
@@ -577,9 +561,11 @@ Public Class MachManaging
DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.WIP)
' scrivo stato start
MachGroup.MyMachGroupM.SetProductionState(ItemState.WIP)
MachGroup.dtStartTime = dtStart
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
If Not IsNothing(MachGroup) Then
MachGroup.MyMachGroupM.SetProductionState(ItemState.WIP)
MachGroup.dtStartTime = dtStart
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
End If
' scrivo evento inizio MachGroup su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(dtStart, nP_Prod, nP_Machgroup, nP_State, DbControllers.SupervisorId))
End If
@@ -591,44 +577,50 @@ Public Class MachManaging
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
' se pezzo = -1 devo dare end a tutti i pezzi del MachGroup
If nP_Part = -1 Then
For Each Part In MachGroup.PartVMList
' scrivo data end su Db pezzo
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, Part.nPartId, dtEnd)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.Produced)
' scrivo stato end
Part.nProduction_State = ItemState.Produced
Part.dtEndTime = dtEnd
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' resetto stato redo
Part.bRedo = False
' se non impostata data start
If Part.dtStartTime = DateTime.MinValue Then
' scrivo data start su Db pezzo
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
Part.dtStartTime = dtStart
End If
' scrivo evento fine pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
Next
If Not IsNothing(MachGroup) Then
For Each Part In MachGroup.PartVMList
' scrivo data end su Db pezzo
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, Part.nPartId, dtEnd)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.Produced)
' scrivo stato end
Part.nProduction_State = ItemState.Produced
Part.dtEndTime = dtEnd
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' resetto stato redo
Part.bRedo = False
' se non impostata data start
If Part.dtStartTime = DateTime.MinValue Then
' scrivo data start su Db pezzo
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
Part.dtStartTime = dtStart
End If
' scrivo evento fine pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
Next
End If
Else
' scrivo data end su Db pezzo
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, dtEnd)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Produced)
' recupero pezzo
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
' scrivo stato end
Part.nProduction_State = ItemState.Produced
Part.dtEndTime = dtEnd
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' resetto stato redo
Part.bRedo = False
If Not IsNothing(MachGroup) Then
' recupero pezzo
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
If Not IsNothing(Part) Then
' scrivo stato end
Part.nProduction_State = ItemState.Produced
Part.dtEndTime = dtEnd
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' resetto stato redo
Part.bRedo = False
End If
End If
' scrivo evento fine pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
End If
' se tutti i pezzi della barra sono in end
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= 2) Then
If Not IsNothing(MachGroup) AndAlso MachGroup.PartVMList.All(Function(x) x.nProduction_State >= 2) Then
' scrivo data end su Db barra
DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, dtEnd)
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced)
@@ -674,13 +666,17 @@ Public Class MachManaging
End If
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
If nP_Part = -1 Then
For Each Part In MachGroup.PartVMList
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
Next
If Not IsNothing(MachGroup) Then
For Each Part In MachGroup.PartVMList
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
Next
End If
Else
' recupero pezzo
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
If Not IsNothing(Part) Then
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
End If
End If
' attesa per essere sicuro che abbia scritto e riletto variabili
Threading.Thread.Sleep(300)
@@ -706,7 +702,7 @@ Public Class MachManaging
For VParIndex = 1 To sVs.Length - 1
Dim VPar() As String = sVs(VParIndex).Split("="c)
VPar(1) = VPar(1).Trim
StringToDouble(VPar(1), dVPars(VParIndex - 1))
StringToDoubleAdv(VPar(1), dVPars(VParIndex - 1))
Next
' li scrivo nel CN
For Index As Integer = 1 To 10
@@ -1228,10 +1224,8 @@ Public Class MachManaging
Dim nIndex As Integer = Index
Dim PLCMessagesVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = PLC_MESSAGES & nIndex)
If IsNothing(PLCMessagesVariable) OrElse IsNothing(PLCMessagesVariable.sValue) Then Return
Dim dTemp As Double = 0
Dim nTemp As Integer = 0
StringToDouble(PLCMessagesVariable.sValue, dTemp)
Integer.TryParse(dTemp, nTemp)
Integer.TryParse(PLCMessagesVariable.sValue, nTemp)
Dim Bytes As Byte() = BitConverter.GetBytes(nTemp)
Dim NewBytes As Byte() = BitConverter.GetBytes(nTemp)
For nBIndex = Bytes.Count - 1 To 0 Step -1
@@ -148,7 +148,7 @@ Public Class RWVariableManager
Public Sub ReadVar(Name As String, ByRef Value As Double)
Dim nIndex As Integer = GetIndexFromName(Name)
If nIndex >= 0 Then
Value = StringToDouble(m_ReadedVars(nIndex), 5)
Value = StringToDoubleAdv(m_ReadedVars(nIndex), 5)
Else
Value = -999999999
End If
@@ -240,8 +240,8 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2503, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2503, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2504, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2504, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.3.2")>
<Assembly: AssemblyFileVersion("2.5.3.2")>
<Assembly: AssemblyVersion("2.5.5.1")>
<Assembly: AssemblyFileVersion("2.5.5.1")>
@@ -178,13 +178,14 @@ Public Class MySceneHostVM
#Region "ProjectManager"
Public Overrides Sub NewProject()
Public Overrides Function NewProject() As Boolean
EgtSetCurrentContext(MainScene.GetCtx())
Dim bOk As Boolean = MainController.NewProject()
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub OpenProject(sFilePath As String)
Public Overrides Function OpenProject(sFilePath As String) As Boolean
EgtSetCurrentContext(MainScene.GetCtx())
Dim bOk As Boolean = False
If String.IsNullOrEmpty(sFilePath) Then
@@ -201,29 +202,32 @@ Public Class MySceneHostVM
bOk = MainController.OpenProject(sFilePath, False)
End If
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub SaveProject()
MyBase.SaveProject()
Public Overrides Function SaveProject() As Boolean
Dim bOk As Boolean = MyBase.SaveProject()
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub SaveAsProject()
MyBase.SaveAsProject()
Public Overrides Function SaveAsProject() As Boolean
Dim bOk As Boolean = MyBase.SaveAsProject()
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub ImportProject()
Public Overrides Function ImportProject() As Boolean
Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
If Not String.IsNullOrWhiteSpace(sDir) Then
sDir = Path.GetDirectoryName(sDir)
End If
sDir.TrimEnd("\"c)
MainController.ImportProject(sDir)
End Sub
Return MainController.ImportProject(sDir)
End Function
#End Region ' ProjectManager
@@ -40,7 +40,7 @@ Public Class AddPartWndVM
End Get
Set(value As String)
Dim dTempL As Double
If StringToLen(value, dTempL) AndAlso dTempL > 0 Then
If StringToLenAdv(value, dTempL, True) AndAlso dTempL > 0 Then
m_dL = dTempL
Else
NotifyPropertyChanged("sL")
@@ -60,7 +60,7 @@ Public Class AddPartWndVM
End Get
Set(value As String)
Dim dTempW As Double
If StringToLen(value, dTempW) AndAlso dTempW > 0 Then
If StringToLenAdv(value, dTempW, True) AndAlso dTempW > 0 Then
EgtDraw()
m_dW = dTempW
Else
@@ -81,7 +81,7 @@ Public Class AddPartWndVM
End Get
Set(value As String)
Dim dTempH As Double
If StringToLen(value, dTempH) AndAlso dTempH > 0 Then
If StringToLenAdv(value, dTempH, True) AndAlso dTempH > 0 Then
EgtDraw()
m_dH = dTempH
Else
@@ -232,14 +232,14 @@ Public Class Variable
m_sValue = value
Case VariableType.LENGTH
Dim dTempValue As Double
If StringToLen(value, dTempValue) Then
If StringToLenAdv(value, dTempValue, True) Then
m_dValue = dTempValue
Else
NotifyPropertyChanged("sValue")
End If
Case Else ' VariableType.DOUBLE_
Dim dTempValue As Double
If StringToDouble(value, dTempValue) Then
If StringToDoubleAdv(value, dTempValue, True) Then
m_dValue = dTempValue
Else
NotifyPropertyChanged("sValue")
@@ -121,9 +121,9 @@ Public Class BTLParamVM
' trasformo valori
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, dNewValue)
StringToDoubleAdv(value, dNewValue, True)
Case BTLParamType.LENGTH
StringToLen(value, dNewValue)
StringToLenAdv(value, dNewValue, True)
Case Else
' per string non faccio nulla
End Select
@@ -168,9 +168,9 @@ Public Class BTLParamVM
' trasformo valori
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, dNewValue)
StringToDoubleAdv(value, dNewValue, True)
Case BTLParamType.LENGTH
StringToLen(value, dNewValue)
StringToLenAdv(value, dNewValue, True)
Case Else
' per string non faccio nulla
End Select
@@ -171,7 +171,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
Dim dVal As Double
If StringToLen(value, dVal) Then
If StringToLenAdv(value, dVal, True) Then
Dim dBtlL = m_BTLPartM.dBtlL
Dim dBtlW = m_BTLPartM.dBtlW
Dim dBtlH = m_BTLPartM.dBtlH
@@ -229,7 +229,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
Dim dVal As Double
If StringToLen(value, dVal) Then
If StringToLenAdv(value, dVal, True) Then
Dim dBtlL = m_BTLPartM.dBtlL
Dim dBtlW = m_BTLPartM.dBtlW
Dim dBtlH = m_BTLPartM.dBtlH
@@ -287,7 +287,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
Dim dVal As Double
If StringToLen(value, dVal) Then
If StringToLenAdv(value, dVal, True) Then
Dim dBtlL = m_BTLPartM.dBtlL
Dim dBtlW = m_BTLPartM.dBtlW
Dim dBtlH = m_BTLPartM.dBtlH
@@ -550,7 +550,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
Dim dTempPlaningLen As Double
If StringToLen(value, dTempPlaningLen) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PLANINGLENGTH, dTempPlaningLen) Then
If StringToLenAdv(value, dTempPlaningLen, True) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PLANINGLENGTH, dTempPlaningLen) Then
m_BTLPartM.dPLANINGLEN = dTempPlaningLen
Else
NotifyPropertyChanged("dPLANINGLEN")
@@ -564,7 +564,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
Dim dTempStartOffset As Double
If StringToLen(value, dTempStartOffset) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_STARTOFFSET, dTempStartOffset) Then
If StringToLenAdv(value, dTempStartOffset, True) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_STARTOFFSET, dTempStartOffset) Then
m_BTLPartM.dSTARTOFFSET = dTempStartOffset
Else
NotifyPropertyChanged("dSTARTOFFSET")
@@ -578,7 +578,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
Dim dTempEndOffset As Double
If StringToLen(value, dTempEndOffset) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_ENDOFFSET, dTempEndOffset) Then
If StringToLenAdv(value, dTempEndOffset, True) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_ENDOFFSET, dTempEndOffset) Then
m_BTLPartM.dENDOFFSET = dTempEndOffset
Else
NotifyPropertyChanged("dENDOFFSET")
@@ -625,9 +625,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",")
Dim ptOri As New Point3d
If sValArray.Count() >= 3 AndAlso
StringToLen(sValArray(0), ptOri.x) AndAlso
StringToLen(sValArray(1), ptOri.y) AndAlso
StringToLen(sValArray(2), ptOri.z) AndAlso
StringToLenAdv(sValArray(0), ptOri.x, True) AndAlso
StringToLenAdv(sValArray(1), ptOri.y, True) AndAlso
StringToLenAdv(sValArray(2), ptOri.z, True) AndAlso
m_BTLPartM.refTransf.ChangeOrigin(ptOri) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
@@ -661,9 +661,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",")
Dim vtVersX As New Vector3d
If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), vtVersX.x) AndAlso
StringToDouble(sValArray(1), vtVersX.y) AndAlso
StringToDouble(sValArray(2), vtVersX.z) AndAlso
StringToDoubleAdv(sValArray(0), vtVersX.x, True) AndAlso
StringToDoubleAdv(sValArray(1), vtVersX.y, True) AndAlso
StringToDoubleAdv(sValArray(2), vtVersX.z, True) AndAlso
m_BTLPartM.refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
@@ -699,9 +699,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",")
Dim vtVersY As New Vector3d
If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), vtVersY.x) AndAlso
StringToDouble(sValArray(1), vtVersY.y) AndAlso
StringToDouble(sValArray(2), vtVersY.z) AndAlso
StringToDoubleAdv(sValArray(0), vtVersY.x, True) AndAlso
StringToDoubleAdv(sValArray(1), vtVersY.y, True) AndAlso
StringToDoubleAdv(sValArray(2), vtVersY.z, True) AndAlso
m_BTLPartM.refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
@@ -733,10 +733,10 @@ Public Class BTLPartVM
Set(value As Integer)
Dim sValArray() As String = CamberParams.Split(",")
If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dCamberLen1) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dCamberLen2) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dCamberLen3) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dCamberCross3) AndAlso
StringToLenAdv(sValArray(0), m_BTLPartM.m_dCamberLen1, True) AndAlso
StringToLenAdv(sValArray(1), m_BTLPartM.m_dCamberLen2, True) AndAlso
StringToLenAdv(sValArray(2), m_BTLPartM.m_dCamberLen3, True) AndAlso
StringToLenAdv(sValArray(3), m_BTLPartM.m_dCamberCross3, True) AndAlso
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, "SIDE: " & (value + 1) &
" P01: " & sValArray(0) &
" P02: " & sValArray(1) &
@@ -759,10 +759,10 @@ Public Class BTLPartVM
Set(value As String)
Dim sValArray() As String = value.Split(",")
If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dCamberLen1) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dCamberLen2) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dCamberLen3) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dCamberCross3) Then
StringToLenAdv(sValArray(0), m_BTLPartM.m_dCamberLen1, True) AndAlso
StringToLenAdv(sValArray(1), m_BTLPartM.m_dCamberLen2, True) AndAlso
StringToLenAdv(sValArray(2), m_BTLPartM.m_dCamberLen3, True) AndAlso
StringToLenAdv(sValArray(3), m_BTLPartM.m_dCamberCross3, True) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, " SIDE: " & (SelCAMBERSIDE + 1) &
" P01: " & sValArray(0) &
" P02: " & sValArray(1) &
@@ -790,10 +790,10 @@ Public Class BTLPartVM
Dim sValArray() As String = PartOffsetParams.Split(",")
If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dPartOffsetSide1) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dPartOffsetSide2) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dPartOffsetSide3) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dPartOffsetSide4) AndAlso
StringToLenAdv(sValArray(0), m_BTLPartM.m_dPartOffsetSide1, True) AndAlso
StringToLenAdv(sValArray(1), m_BTLPartM.m_dPartOffsetSide2, True) AndAlso
StringToLenAdv(sValArray(2), m_BTLPartM.m_dPartOffsetSide3, True) AndAlso
StringToLenAdv(sValArray(3), m_BTLPartM.m_dPartOffsetSide4, True) AndAlso
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
" P11: " & sValArray(0) &
" P12: " & sValArray(1) &
@@ -819,10 +819,10 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",")
If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dPartOffsetSide1) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dPartOffsetSide2) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dPartOffsetSide3) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dPartOffsetSide4) Then
StringToLenAdv(sValArray(0), m_BTLPartM.m_dPartOffsetSide1, True) AndAlso
StringToLenAdv(sValArray(1), m_BTLPartM.m_dPartOffsetSide2, True) AndAlso
StringToLenAdv(sValArray(2), m_BTLPartM.m_dPartOffsetSide3, True) AndAlso
StringToLenAdv(sValArray(3), m_BTLPartM.m_dPartOffsetSide4, True) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
" P11: " & sValArray(0) &
" P12: " & sValArray(1) &
@@ -973,9 +973,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",")
Dim dX, dY, dZ As Double
If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), dX) AndAlso
StringToDouble(sValArray(1), dY) AndAlso
StringToDouble(sValArray(2), dZ) Then
StringToDoubleAdv(sValArray(0), dX, True) AndAlso
StringToDoubleAdv(sValArray(1), dY, True) AndAlso
StringToDoubleAdv(sValArray(2), dZ, True) Then
m_BTLPartM.refGrainDir = New Vector3d(dX, dY, dZ)
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
sValArray(1) & "," &
@@ -994,9 +994,9 @@ Public Class BTLPartVM
Set(value As Boolean)
Dim sValArray() As String = GrainDirection.Split(",")
If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), m_BTLPartM.refGrainDir.x) AndAlso
StringToDouble(sValArray(1), m_BTLPartM.refGrainDir.y) AndAlso
StringToDouble(sValArray(2), m_BTLPartM.refGrainDir.z) AndAlso
StringToDoubleAdv(sValArray(0), m_BTLPartM.refGrainDir.x, True) AndAlso
StringToDoubleAdv(sValArray(1), m_BTLPartM.refGrainDir.y, True) AndAlso
StringToDoubleAdv(sValArray(2), m_BTLPartM.refGrainDir.z, True) AndAlso
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
sValArray(1) & "," &
sValArray(2) & ";" &
@@ -280,8 +280,8 @@ Public Class CALCPanelVM
End Sub
Private Shared Sub ProcessResults(Bar As Bar)
If IsNothing(Bar) Then Return
ProcessResults(Bar.sBarPath, Bar.nProgramPage, Bar.nBarId)
End Sub
Private Shared Sub ProcessResults(BtlPath As String, nProgramPage As ProjectType, nBarId As Integer)
@@ -312,7 +312,7 @@ Public Class CALCPanelVM
If line.StartsWith("ERR=") Then
Dim nVal As Integer? = GetVal(line, "ERR")
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
sMsg = ""
dRot = 0
nFall = 0
@@ -320,24 +320,24 @@ Public Class CALCPanelVM
taskId = 0
ElseIf line.StartsWith("ROT=") Then
Dim nVal As Integer? = GetVal(line, "ROT")
Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0))
Dim nRot As Integer = (If(Not IsNothing(nVal), nVal.Value, 0))
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
dPartRot = Math.Max(dPartRot, dRot)
dTotRot = Math.Max(dTotRot, dRot)
ElseIf line.StartsWith("CUTID=") Then
Dim nVal As Integer? = GetVal(line, "CUTID")
cutId = If(nVal IsNot Nothing, nVal.Value, 0)
cutId = If(Not IsNothing(nVal), nVal.Value, 0)
ElseIf line.StartsWith("TASKID=") Then
Dim nVal As Integer? = GetVal(line, "TASKID")
taskId = (If(nVal IsNot Nothing, nVal.Value, 0))
taskId = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), nProgramPage)
ElseIf line.StartsWith("FALL=") Then
Dim nVal As Integer? = GetVal(line, "FALL")
nFall = (If(nVal IsNot Nothing, nVal.Value, 0))
nFall = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
ElseIf line.StartsWith("TIME=") Then
Dim nVal As Integer? = GetVal(line, "TIME")
nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0))
nTotTime = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
@@ -142,9 +142,9 @@ Public Class Parameters
Set(value As String)
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, m_dActualValue)
StringToDoubleAdv(value, m_dActualValue, True)
Case BTLParamType.LENGTH
StringToLen(value, m_dActualValue)
StringToLenAdv(value, m_dActualValue, True)
Case Else ' BTLParamType.STRING_
m_sActualValue = value
End Select
@@ -172,9 +172,9 @@ Public Class Parameters
Set(value As String)
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, m_dNewValue)
StringToDoubleAdv(value, m_dNewValue, True)
Case BTLParamType.LENGTH
StringToLen(value, m_dNewValue)
StringToLenAdv(value, m_dNewValue, True)
Case Else ' BTLParamType.STRING_
m_sNewValue = value
End Select
@@ -5,226 +5,232 @@
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
SelectedIndex="{Binding SelConfigSubPage}">
<TabItem Header="General">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
<GroupBox Header="{Binding CurrentLanguage_Msg}"
<TabItem Header="General">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
<GroupBox Header="{Binding CurrentLanguage_Msg}"
Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>
<UniformGrid Columns="2"
</UniformGrid>
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
SelectedIndex="{Binding SelMeasureUnit}" Height="25"
Margin="0,5,0,0"/>
</UniformGrid>
<GroupBox Header="{Binding Nesting_Msg}"
</UniformGrid>
<GroupBox Header="{Binding Nesting_Msg}"
Margin="0,0,0,5">
<StackPanel>
<UniformGrid Columns="2"
<StackPanel>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding SectionTime_Msg}"
<TextBlock Text="{Binding SectionTime_Msg}"
Grid.Row="0" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}"
<EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}"
Grid.Row="0" Grid.Column="1"/>
</UniformGrid>
<UniformGrid Columns="2"
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PartTime_Msg}"
<TextBlock Text="{Binding PartTime_Msg}"
Grid.Row="1" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}"
<EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}"
Grid.Row="1" Grid.Column="1"/>
</UniformGrid>
</StackPanel>
</GroupBox>
</UniformGrid>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Parametri Q">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PrintLabel_Msg}" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding bPrintLabel_IsChecked}"
Margin="0,5,0,0"/>
</UniformGrid>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Parametri Q">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
ItemsSource="{Binding QBTLParamVMList}"
SelectedItem="{Binding SelQParam}"
Grid.Column="0"
Margin="5">
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Macchina">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
</GroupBox>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Macchina">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
</GroupBox>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
TextWrapping="WrapWithOverflow"
Width="100"
Style="{StaticResource MachParamTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Width="70"/>
<TextBlock Text="{Binding sDescription}"
<TextBlock Text="{Binding sDescription}"
TextWrapping="WrapWithOverflow"
Width="200"
Style="{StaticResource MachParamTextBlock}"
Grid.Column="2"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
</TabControl>
<Button Command="{Binding SaveCommand}"
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
</TabControl>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</Grid>
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</Grid>
</DockPanel>
@@ -131,7 +131,7 @@ Public Class ConfigurationPageVM
End Get
Set(value As String)
Dim dVal As Double = 0
If StringToDouble(value, dVal) AndAlso dVal > 0 Then
If StringToDoubleAdv(value, dVal, True) AndAlso dVal > 0 Then
m_SectionTime = dVal
End If
End Set
@@ -144,12 +144,22 @@ Public Class ConfigurationPageVM
End Get
Set(value As String)
Dim dVal As Double = 0
If StringToDouble(value, dVal) AndAlso dVal > 0 Then
If StringToDoubleAdv(value, dVal, True) AndAlso dVal > 0 Then
m_PartTime = dVal
End If
End Set
End Property
Private m_bPrintLabel_IsChecked As Boolean
Public Property bPrintLabel_IsChecked As String
Get
Return m_bPrintLabel_IsChecked
End Get
Set(value As String)
m_bPrintLabel_IsChecked = value
End Set
End Property
#Region "Messages"
Public ReadOnly Property L_Msg As String
@@ -277,6 +287,12 @@ Public Class ConfigurationPageVM
End Get
End Property
Public ReadOnly Property PrintLabel_Msg As String
Get
Return EgtMsg(61894)
End Get
End Property
#End Region ' Messages
#Region "Constructor"
@@ -311,6 +327,7 @@ Public Class ConfigurationPageVM
' leggo SectionTime e PartTime
GetMainPrivateProfileString(S_NEST, K_SECTIONTIME, "", SectionTime)
GetMainPrivateProfileString(S_NEST, K_PARTTIME, "", PartTime)
m_bPrintLabel_IsChecked = ( GetMainPrivateProfileInt(S_PRINTER, K_ENABLE, 0) <> 0)
' assegno le liste dei parametri della macchina corrente alla ConfigMachTableList alla pagina di Configurazione
ConfigMachTableList = CurrentMachine.MachTableList
' carico i parametri Q dei Process letti dall'ini
@@ -352,18 +369,6 @@ Public Class ConfigurationPageVM
''' </summary>
Public Sub Save()
VerifyConfigPageModification()
'Select Case SelConfigSubPage
' Case ConfigSubPages.GENERAL
' WriteMachParams()
' WriteMachParamsLua()
' Case ConfigSubPages.QPARAMETERS
' WriteProcessParams(PRCList.ToList())
' Case ConfigSubPages.MACHINE
' WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
' WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
' WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
' WriteMainPrivateProfileString(S_NEST, K_PARTTIME, DoubleToString(m_PartTime, 5))
'End Select
End Sub
#End Region ' SaveCommand
@@ -455,6 +460,7 @@ Public Class ConfigurationPageVM
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
WriteMainPrivateProfileString(S_NEST, K_PARTTIME, DoubleToString(m_PartTime, 5))
WriteMainPrivateProfileString(S_PRINTER, K_ENABLE, If(m_bPrintLabel_IsChecked, 1, 0))
Case ConfigSubPages.QPARAMETERS
' ciclo sui parametri Q
Dim bAskToSaveDefaultValues As Boolean = False
@@ -680,11 +686,11 @@ Public Class MachParam
' trasformo valori
Select Case nType
Case MachParamType.DOUBLE_
StringToDouble(value, dNewValue)
StringToDouble(sOrigValue, dOrigValue)
StringToDoubleAdv(value, dNewValue, True)
StringToDoubleAdv(sOrigValue, dOrigValue, True)
Case MachParamType.LENGTH
StringToLen(value, dNewValue)
StringToLen(sOrigValue, dOrigValue)
StringToLenAdv(value, dNewValue, True)
StringToLenAdv(sOrigValue, dOrigValue, True)
Case Else
' per string non faccio nulla
End Select
@@ -955,6 +955,9 @@
<ItemGroup>
<Resource Include="Resources\TopPanel\RemoveAllRawPart.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ProjectManager\AddProj.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe
@@ -650,7 +650,7 @@ Public Class FreeContourManagerVM
EgtAtParamPoint(m_nNewPathId, Index + 0.5, ptText)
Dim dSideAng As Double = 0
If sSideAngSplit.Count - 1 >= Index Then
StringToDouble(sSideAngSplit(Index), dSideAng)
StringToDoubleAdv(sSideAngSplit(Index), dSideAng, True)
End If
Dim sSideAng As String = DoubleToString( dSideAng, 2) & "°"
Dim TextId As Integer = EgtCreateText(nSideAngTextLayer, ptText, sSideAng, 20)
@@ -898,7 +898,7 @@ Public Class FreeContourManagerVM
If bResult Then
' scrivo info con nuova inclinazione
Dim dAng As Double
StringToDouble(Map.refFreeContourInputVM.Text, dAng)
StringToDoubleAdv(Map.refFreeContourInputVM.Text, dAng, True)
EgtSetInfo(m_nSelTextId, "SideAng", dAng)
Dim sAng As String = DoubleToString( dAng, 2) & "°"
EgtModifyText(m_nSelTextId, sAng)
@@ -46,7 +46,7 @@ Public Class MyMachGroupVM
End Get
Set(value As String)
Dim dValue As Double
If StringToLen(value, dValue) Then
If StringToLenAdv(value, dValue, True) Then
Dim nRawPartId As Integer = EgtGetFirstRawPart()
If dValue <> MyMachGroupM.dL Then
Select Case nType
@@ -140,7 +140,7 @@ Public Class MyMachGroupVM
End Get
Set(value As String)
Dim dValue As Double
If StringToLen(value, dValue) Then
If StringToLenAdv(value, dValue, True) Then
If nType = BWType.WALL Then
Dim nRawPartId As Integer = EgtGetFirstRawPart()
If dValue <> MyMachGroupM.dW Then
@@ -211,7 +211,7 @@ Public Class MyMachGroupVM
End Get
Set(value As String)
Dim dValue As Double
If StringToLen(value, dValue) Then
If StringToLenAdv(value, dValue, True) Then
MyMachGroupM.dH = value
End If
End Set
@@ -248,7 +248,7 @@ Public Class MyMachGroupVM
End Get
Set(value As String)
Dim dValue As Double
If StringToLen(value, dValue) Then
If StringToLenAdv(value, dValue, True) Then
Dim dOldValue As Double = MyMachGroupM.dStartCut
' verifico se con il nuovo StartCut tutti i pezzi stanno nella barra
Dim dTotLength As Double = 0
@@ -300,15 +300,15 @@ Public Class MyMachGroupVM
End Get
Set(value As String)
Dim dValue As Double
If StringToLen(value, dValue) Then
If StringToLenAdv(value, dValue, True) Then
Dim nRawPartId As Integer = EgtGetFirstRawPart()
If Math.Abs( dValue - MyMachGroupM.dPosZ) > EPS_SMALL Then
If Math.Abs(dValue - MyMachGroupM.dPosZ) > EPS_SMALL Then
Select Case nType
Case BWType.BEAM
' non utilizzato
Case BWType.WALL
' se operazione di spostamento in z ha successo
If dValue >= 0 AndAlso EgtMoveRawPart( nRawPartId, New Vector3d(0, 0, dValue - MyMachGroupM.dPosZ)) Then
If dValue >= 0 AndAlso EgtMoveRawPart(nRawPartId, New Vector3d(0, 0, dValue - MyMachGroupM.dPosZ)) Then
EgtSetInfo(Id, MGR_RPT_PANELPOSZ, dValue)
EgtDraw()
MyMachGroupM.dPosZ = dValue
@@ -806,7 +806,7 @@ Public Class MyMachGroupVM
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut)
StringToDoubleAdv(sSplitInfo(1), MyMachGroupM.dStartCut)
Else
MyMachGroupM.dStartCut = 0
End If
@@ -54,14 +54,14 @@ Public Class PartVM
End Get
Set(value As String)
Dim dValue As Double
If StringToLen(value, dValue) Then
If StringToLenAdv(value, dValue, True) Then
Dim dOldValue As Double = m_PartM.dOffset
Dim BeamMachGroup As MyMachGroupVM = DirectCast(ParentMachGroupVM, MyMachGroupVM)
' se prima trave della barra sostituisco valore anche a startoffset
If ParentMachGroupVM.PartVMList(0) Is Me Then
m_PartM.dOffset = dValue
BeamMachGroup.dStartCut = dValue
ElseIf value > CurrentMachine.dMinOffset Then
ElseIf dValue > CurrentMachine.dMinOffset Then
m_PartM.dOffset = dValue
Else
m_PartM.dOffset = CurrentMachine.dMinOffset
@@ -103,7 +103,7 @@ Public Class PartVM
End Get
Set(value As String)
Dim dValue As Double
If StringToLen(value, dValue) Then
If StringToLenAdv(value, dValue, True) Then
Dim dOldValue As Double = m_PartM.dPOSX
Dim dNewValue As Double = dValue
Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE
@@ -151,7 +151,7 @@ Public Class PartVM
End Get
Set(value As String)
Dim dValue As Double
If StringToLen(value, dValue) Then
If StringToLenAdv(value, dValue, True) Then
Dim dOldValue As Double = m_PartM.dPOSY
Dim dNewValue As Double = dValue
' valuto angolo di posizionamento
@@ -373,6 +373,12 @@ Public Class MainMenuVM
Map.refProdManagerVM.CurrProd.SetReloadProject(True)
End If
'DbControllers.m_ProdController.ResetController()
' se Warehouse di tipo Medium e piu' di un progetto collegato
Dim nDefault As Integer = 2
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM AndAlso Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
' confronto le Sezioni del BTL importato con quelle in Warehouse
WarehouseWndVM.UpdateSectionXMaterial()
End If
' aggiorno titolo
Map.refMainWindowVM.UpdateTitle()
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
@@ -150,7 +150,7 @@ Public Class MainWindowM
End Get
End Property
Private m_sWarehouseDir As String
Private m_sWarehouseDir As String = ""
Friend ReadOnly Property sWarehouseDir As String
Get
Return m_sWarehouseDir
@@ -227,8 +227,8 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2503, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2503, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2504, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2504, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & VWOPTGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -20,7 +20,7 @@ Public Class MovePartInRawPartWndVM
End Get
Set(value As String)
Dim dTempMoveLen As Double
If StringToLen(value, dTempMoveLen) AndAlso dTempMoveLen > 0 Then
If StringToLenAdv(value, dTempMoveLen, True) AndAlso dTempMoveLen > 0 Then
m_dMoveLen = dTempMoveLen
Else
m_dMoveLen = 0
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.3.2")>
<Assembly: AssemblyFileVersion("2.5.3.2")>
<Assembly: AssemblyVersion("2.5.4.2")>
<Assembly: AssemblyFileVersion("2.5.5.1")>
@@ -366,6 +366,12 @@ Public Class NestingRunningWndVM
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
' verifico se nesting XZ tipo BTL o XY standar
Dim dRawPartBtlH As Double
EgtGetInfo( nRawPartId, "H", dRawPartBtlH)
Dim dRawPartBtlW As Double
EgtGetInfo( nRawPartId, "W", dRawPartBtlW)
Dim bRefBtl As Boolean = ( Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso dRawPartBtlW > dRawPartBtlH)
' recupero i pezzi con frame
Dim PartList As New List(Of NestPartWithFrame)
Dim nPartPlaceHolderId As Integer = EgtGetFirstInGroup(nRawPartId)
@@ -392,7 +398,12 @@ Public Class NestingRunningWndVM
' calcolo riferimento
Dim frPlaceHolder As New Frame3d
EgtFrame(nPartPlaceHolderId, nRawPartId, frPlaceHolder)
Dim p3Origin As Point3d = New Point3d(frPlaceHolder.Orig.x, frPlaceHolder.Orig.z, 0)
Dim p3Origin As Point3d
If bRefBtl Then
p3Origin = New Point3d(frPlaceHolder.Orig.x, frPlaceHolder.Orig.z, 0)
Else
p3Origin = New Point3d(frPlaceHolder.Orig.x, frPlaceHolder.Orig.y, 0)
End If
' lo rendo std
EgtSetMode(nPartDuploId, GDB_MD.STD)
PartList.Add(New NestPartWithFrame(nPartPlaceHolderId, p3Origin, frPlaceHolder, nPartDuploId, nSourceId))
@@ -424,7 +435,8 @@ Public Class NestingRunningWndVM
Dim dPosX As Double = NestPart.p3Orig.x
Dim dPosY As Double = NestPart.p3Orig.y
Dim b3Duplo As New BBox3d
EgtGetBBoxGlob(NestPart.nPartDuploId, GDB_BB.STANDARD, b3Duplo)
Dim nBoxLayId As Integer = EgtGetFirstNameInGroup( NestPart.nPartDuploId, "Box")
EgtGetBBoxGlob(nBoxLayId, GDB_BB.STANDARD, b3Duplo)
' calcolo rot ed invert da frame
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
If AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) Then
@@ -442,30 +454,138 @@ Public Class NestingRunningWndVM
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.X_AX, dRot)
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.Z_AX, dFlip)
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
'Dim frPlaceHolder As New Frame3d
'EgtFrame(NestPart.nPartId, GDB_ID.ROOT, frPlaceHolder)
'Dim frDuplo As New Frame3d
'EgtFrame(NestPart.nPartDuploId, GDB_ID.ROOT, frDuplo)
'Dim dDuploRot As Double = GetAngle(frDuplo.VersX, frPlaceHolder.VersX)
'Dim dDuploFlip As Double = GetAngle(frDuplo.VersY, frPlaceHolder.VersY)
'If dDuploFlip > 180 - 10 * EPS_SMALL AndAlso dDuploFlip < 180 + 10 * EPS_SMALL Then
' dDuploRot -= 180
'End If
If NestPart.frFrame.GetEgtType() = Frame3d.TYPE.TOP Then
dFlip = 180
dRot = 180
dPosX = b3Box.DimX() - b3Duplo.DimX() - dPosX
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.X_AX) AndAlso AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.Y_AX) Then
dFlip = 180
dRot = 0
dPosX = b3Box.DimX() - dPosX
dPosY -= b3Duplo.DimY()
If bRefBtl Then
Dim vtFrVersX As Vector3d = NestPart.frFrame.VersX
Dim vtFrVersY As Vector3d = NestPart.frFrame.VersY
If Math.Abs( vtFrVersX.z) > EPS_SMALL Or
Math.Abs( vtFrVersX.z) > EPS_SMALL Then
vtFrVersX = New Vector3d( vtFrVersX.y, vtFrVersX.z, 0)
vtFrVersY = New Vector3d( vtFrVersY.y, vtFrVersY.z, 0)
End If
If AreSameVectorApprox(vtFrVersX, Vector3d.X_AX) AndAlso
AreSameVectorApprox(vtFrVersY, Vector3d.Y_AX) Then
dFlip = 0
dRot = 0
dPosX = dPosX
dPosY = dPosY
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.X_AX) AndAlso
AreSameVectorApprox(vtFrVersY, Vector3d.Y_AX) Then
dFlip = 0
dRot = 180
dPosX = dPosX - b3Duplo.DimX()
dPosY = dPosY - b3Duplo.DimY()
ElseIf AreSameVectorApprox(vtFrVersX, Vector3d.X_AX) AndAlso
AreSameVectorApprox(vtFrVersY, -Vector3d.Y_AX) Then
dFlip = 180
dRot = 0
dPosX = dPosX
dPosY = dPosY - b3Duplo.DimY()
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.X_AX) AndAlso
AreSameVectorApprox(vtFrVersY, -Vector3d.Y_AX) Then
dFlip = 180
dRot = 180
dPosX = dPosX - b3Duplo.DimX()
dPosY = dPosY
ElseIf AreSameVectorApprox(vtFrVersX, Vector3d.Y_AX) AndAlso
AreSameVectorApprox(vtFrVersY, Vector3d.X_AX) Then
dFlip = 0
dRot = -90
dPosX = dPosX - b3Duplo.DimY()
dPosY = dPosY
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.Y_AX) AndAlso
AreSameVectorApprox(vtFrVersY, Vector3d.X_AX) Then
dFlip = 0
dRot = 90
dPosX = dPosX
dPosY = dPosY - b3Duplo.DimX()
ElseIf AreSameVectorApprox(vtFrVersX, Vector3d.Y_AX) AndAlso
AreSameVectorApprox(vtFrVersY, -Vector3d.X_AX) Then
dFlip = 180
dRot = -90
dPosX = dPosX
dPosY = dPosY
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.Y_AX) AndAlso
AreSameVectorApprox(vtFrVersY, -Vector3d.X_AX) Then
dFlip = 180
dRot = 90
dPosX = dPosX - b3Duplo.DimY()
dPosY = dPosY - b3Duplo.DimX()
Else
' errore, la parete deve stare nel piano del grezzo
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non giace nel piano XY ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersZ))
Continue For
End If
Else
' errore, la parete deve stare nel piano del grezzo
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non giace nel piano XY ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersZ))
Continue For
If AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.Y_AX) Then
dFlip = 0
dRot = 0
dPosX = dPosX
dPosY = dPosY
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.X_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.Y_AX) Then
dFlip = 180
dRot = 180
dPosX = dPosX - b3Duplo.DimX()
dPosY = dPosY
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.Y_AX) Then
dFlip = 180
dRot = 0
dPosX = dPosX
dPosY = dPosY - b3Duplo.DimY()
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.X_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.Y_AX) Then
dFlip = 0
dRot = 180
dPosX = dPosX - b3Duplo.DimX()
dPosY = dPosY - b3Duplo.DimY()
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.Y_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.X_AX) Then
dFlip = 180
dRot = -90
dPosX = dPosX
dPosY = dPosY
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.Y_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.X_AX) Then
dFlip = 0
dRot = 90
dPosX = dPosX
dPosY = dPosY - b3Duplo.DimX()
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.Y_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.X_AX) Then
dFlip = 0
dRot = -90
dPosX = dPosX - b3Duplo.DimY()
dPosY = dPosY
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.Y_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.X_AX) Then
dFlip = 180
dRot = 90
dPosX = dPosX - b3Duplo.DimY()
dPosY = dPosY - b3Duplo.DimX()
Else
' errore, la parete deve stare nel piano del grezzo
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non giace nel piano XY ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersZ))
Continue For
End If
End If
' faccio rotazioni
' Se pannello ribaltato
Dim bSideOppo As Boolean = (GetMainPrivateProfileInt(S_IMPORT, K_WALLOPPOSITESIDENESTING, 0) <> 0)
If bSideOppo Then
dFlip = ( dFlip + 180) Mod 360
Dim bUseX As Boolean
If Math.Abs( dRot Mod 180) < EPS_ANG_SMALL Then
dRot = ( dRot + 180) Mod 360
bUseX = True
Else
dRot = dRot
bUseX = False
End If
dPosX = -dPosX - If( bUseX, b3Duplo.DimX(), b3Duplo.DimY()) + b3Box.DimX()
dPosY = dPosY
End If
' Applico le rotazioni
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.X_AX, dFlip)
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, -Vector3d.Z_AX, dRot)
End If
@@ -126,28 +126,40 @@ Public Class OpenProjectFileDialogVM
If nTempCtx <> 0 Then
' inizializzo gestore lavorazioni
EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir)
EgtOpenFile(SelProject.sProdPath)
' cancello tutti i gruppi di lavorazione
Dim nMachGroupId As Integer = EgtGetFirstMachGroup()
While nMachGroupId <> GDB_ID.NULL
EgtSetCurrMachGroup(nMachGroupId)
Dim nRawPartId As Integer = EgtGetFirstRawPart()
While nRawPartId <> GDB_ID.NULL
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
While nPartId <> GDB_ID.NULL
EgtRemovePartFromRawPart(nPartId)
' elimino pezzo copia
EgtErase(nPartId)
nPartId = EgtGetFirstPartInRawPart(nRawPartId)
End While
nRawPartId = EgtGetNextRawPart(nRawPartId)
End While
EgtRemoveMachGroup(nMachGroupId)
nMachGroupId = EgtGetFirstMachGroup()
End While
' lo salvo in tutti i proj correlati
' apro, ripulisco e salvo il progetto in tutti i proj correlati
Dim ProdFile As ProdFileVM = DirectCast(SelProject, ProdFileVM)
For Each nProjId In ProdFile.nProjIdList
EgtOpenFile(SelProject.sProdPath)
' cancello tutti i gruppi di lavorazione
Dim nMachGroupId As Integer = EgtGetFirstMachGroup()
While nMachGroupId <> GDB_ID.NULL
EgtSetCurrMachGroup(nMachGroupId)
Dim nRawPartId As Integer = EgtGetFirstRawPart()
While nRawPartId <> GDB_ID.NULL
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
While nPartId <> GDB_ID.NULL
EgtRemovePartFromRawPart(nPartId)
' elimino pezzo copia
EgtErase(nPartId)
nPartId = EgtGetFirstPartInRawPart(nRawPartId)
End While
nRawPartId = EgtGetNextRawPart(nRawPartId)
End While
EgtRemoveMachGroup(nMachGroupId)
nMachGroupId = EgtGetFirstMachGroup()
End While
' cancello tutti i gruppi che sono di un progetto diverso da questo
Dim nGroupId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
While nGroupId <> GDB_ID.NULL
Dim nGroupProjId As Integer = GDB_ID.NULL
Dim nNextGroupId As Integer = EgtGetNext(nGroupId)
If EgtGetInfo(nGroupId, BTL_PRT_PROJ, nGroupProjId) Then
If nGroupProjId <> nProjId Then
EgtErase(nGroupId)
End If
End If
nGroupId = nNextGroupId
End While
EgtSaveFile(ProdFile.GetProjPath(nProjId), NGE.CMPTEXT)
Next
' torno sul contesto corrente
@@ -39,9 +39,9 @@
</Button>-->
<Button Command="{Binding AddProj_Command}"
ToolTip="{Binding AddProj_ToolTip}"
Visibility="Collapsed"
Visibility="{Binding AddProj_Visibility}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
<Image Source="/Resources/ProjectManager/AddProj.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding GoToProj_Command}"
ToolTip="{Binding GoToProj_ToolTip}"
@@ -84,10 +84,18 @@ Public Class ProdManagerVM
End Get
End Property
Private m_AddProj_Visibility As Visibility
Public ReadOnly Property AddProj_Visibility As Visibility
Get
Return m_AddProj_Visibility
End Get
End Property
' Definizione comandi
Private m_cmdOpen As ICommand
Private m_cmdOpenMruFile As ICommand
Private m_cmdSave As ICommand
Private m_cmdAddProj As ICommand
Private m_cmdGoToProj As ICommand
Private m_cmdGoToSupervisor As ICommand
@@ -135,6 +143,12 @@ Public Class ProdManagerVM
Else
m_GoToSupervisor_Visibility = Visibility.Collapsed
End If
' attivo bottone AddProj
If GetMainPrivateProfileInt(S_GENERAL, K_ADDPROJ, 0) = 1 Then
m_AddProj_Visibility = Visibility.Visible
Else
m_AddProj_Visibility = Visibility.Collapsed
End If
' Leggo ultimo indice di progetto
m_nLastProdId = GetMainPrivateProfileInt(S_GENERAL, K_PRODSINDEX, 1)
' Impostazioni MruLists
@@ -372,10 +386,10 @@ Public Class ProdManagerVM
Save(True)
End Sub
Public Sub Save(Optional bShowLoading As Boolean = False)
If IsNothing(m_CurrProd) Then Return
Public Function Save(Optional bShowLoading As Boolean = False) As Boolean
If IsNothing(m_CurrProd) Then Return False
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63007), EgtMsg(63012), 70) ' Project saving ' Saving geometry
Map.refSceneHostVM.SaveProject()
Dim bOk As Boolean = Map.refSceneHostVM.SaveProject()
If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63013), 70, 100) ' Saving data on Db
Dim MyMachGroupList As New List(Of MyMachGroupM)
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
@@ -384,7 +398,10 @@ Public Class ProdManagerVM
Next
End If
' aggiorno pezzi su Db
DbControllers.m_ProdController.UpdateMachGroup(CurrProd.nProdId, MyMachGroupList)
If Not DbControllers.m_ProdController.UpdateMachGroup(CurrProd.nProdId, MyMachGroupList) And bShowLoading Then
LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD)
Return False
End If
' verifico se Reset Macchina modificato e nel caso aggiorno DB e CurrProj
If Map.refCALCPanelVM.IsMachineModified() Then
DbControllers.m_ProdController.UpdateMachine(Map.refProdManagerVM.CurrProd.nProdId, Map.refCALCPanelVM.SelectedMachine.Name)
@@ -408,10 +425,103 @@ Public Class ProdManagerVM
Map.refMainWindowVM.UpdateTitle()
NotifyPropertyChanged(NameOf(MruFileNames))
If bShowLoading Then LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD)
End Sub
Return bOk
End Function
#End Region ' SaveCommand
#Region "AddProj"
''' <summary>
''' Returns a command that do Save.
''' </summary>
Public ReadOnly Property AddProj_Command As ICommand
Get
If m_cmdAddProj Is Nothing Then
m_cmdAddProj = New Command(AddressOf AddProj)
End If
Return m_cmdAddProj
End Get
End Property
''' <summary>
''' Execute the Save. This method is invoked by the SaveCommand.
''' </summary>
Public Sub AddProj()
' verifico se progetto modificato, e chiedo se salvare
If IsNothing(CurrProd) Then Return
Dim bNewProject As Boolean = False
Dim sProjectDirPath As String = ""
sProjectDirPath = CurrProd.sProdDirPath
Dim VerifyResult As MessageBoxResult = MessageBoxResult.None
' verifico se progetto modificato, e chiedo se salvare
If EgtGetModified() OrElse CurrProd.bIsNew OrElse Map.refCALCPanelVM.IsMachineModified() Then
VerifyResult = MessageBox.Show(EgtMsg(61875), "", If(CurrProd.bIsNew, MessageBoxButton.OKCancel, MessageBoxButton.YesNoCancel), MessageBoxImage.Question)
Select Case VerifyResult
Case MessageBoxResult.Yes, MessageBoxResult.OK
' salvo proj
Map.refProdManagerVM.Save()
Case MessageBoxResult.Cancel
Return
Case Else ' No
EgtResetModified()
OpenProject(CurrProd)
End Select
Else
EgtResetModified()
End If
' faccio scegliere proj da aggiungere
Dim OpenProjectFileDialogVM As New OpenProjectFileDialogVM
Dim ChooseProdFileDialog As New OpenProjectFileDialogV(Application.Current.MainWindow, OpenProjectFileDialogVM)
Dim DialogResult As Boolean? = ChooseProdFileDialog.EgtShowDialog(ProjectType.PROJ, True)
If IsNothing(DialogResult) OrElse Not DialogResult Then Return
If IsNothing(OpenProjectFileDialogVM.SelProject.nProjId) OrElse OpenProjectFileDialogVM.SelProject.nProjId <= 0 Then Return
' verifico che il proj selezionato non abbia prod
If Not IsNothing(OpenProjectFileDialogVM.SelProject.nProdId) AndAlso OpenProjectFileDialogVM.SelProject.nProdId > 0 Then
' verifico che non sia uno di quelli gia' collegati a questo Prod
Dim bFound As Boolean = False
For Each nProjId As Integer In CurrProd.nProjIdList
If nProjId = OpenProjectFileDialogVM.SelProject.nProjId Then
bFound = True
Exit For
End If
Next
If bFound Then
MessageBox.Show("Selezionato progetto che fa gia' parte di questa produzione!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
Else
MessageBox.Show("Progetto gia' collegato ad una produzione!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
End If
Return
End If
' verifico che sia associato alla stessa macchina
If OpenProjectFileDialogVM.SelProject.sMachine <> CurrProd.sMachine Then
MessageBox.Show("Progetto per una macchina diversa da quella del progetto corrente!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' inserisco proj nel prod corrente
Dim bOk As Boolean = EgtInsertFile(OpenProjectFileDialogVM.SelProject.sProjPath)
' lo salvo
bOk = bOk AndAlso Save(False)
If bOk Then
' riporto aggiunta proj a prod su Db
DbControllers.m_ProdController.AddProj(CurrProd.nProdId, OpenProjectFileDialogVM.SelProject.nProjId)
End If
' Ricavo il tipo di Warehouse settato nell'INI
Dim nDefault As Integer = 2
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM Then
' Se di tipo Medium confronto le Sezioni del BTL importato con quelle in Warehouse
WarehouseWndVM.UpdateSectionXMaterial()
End If
' aggiorno CurrProd
Dim PdFileM = DbControllers.m_ProdController.FindCoreByProdId(CurrProd.nProdId)
CurrProd.ProdFileM.SetProjIdList(PdFileM.nProjIdList)
' ricarico BTLPartList
OpenProject(CurrProd)
End Sub
#End Region ' AddProj
#Region "GoToProj"
''' <summary>
@@ -1039,7 +1039,7 @@ Public Class ProjManagerVM
Dim b3Part As New BBox3d
EgtGetBBoxGlob(nAddedPartId, 1, b3Part)
' sposto il pezzo per distanziarlo dall'ultimo di un offset pari a 500
bOk = bOk AndAlso EgtMove(nAddedPartId, New Vector3d(0, If(bFirstLoop, b3Parts.DimY(), LastPartMaxY - b3Part.Min.y) + 500, 0))
bOk = bOk AndAlso EgtMove(nAddedPartId, New Vector3d(0, If(bFirstLoop, b3Parts.Max.y, LastPartMaxY - b3Part.Min.y) + 500, 0))
bFirstLoop = False
' ricaviamo il box globale del part appena spostato, salviamo la sua Y massima e lo aggiungiamo al box globale di tutti i part
EgtGetBBoxGlob(nAddedPartId, 1, b3Part)
@@ -139,7 +139,10 @@ Public Class ProdFileVM
Map.refCALCPanelVM.RevertToOriginalMachine()
If CurrProject.bIsNew Then
' lo elimino
Directory.Delete(sProjectDirPath, True)
Try
Directory.Delete(sProjectDirPath, True)
Catch ex As Exception
End Try
Map.refProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath)
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId)
Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

@@ -202,13 +202,14 @@ Public Class MySceneHostVM
#Region "ProjectManager"
Public Overrides Sub NewProject()
Public Overrides Function NewProject() As Boolean
EgtSetCurrentContext(MainScene.GetCtx())
Dim bOk As Boolean = MainController.NewProject()
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub OpenProject(sFilePath As String)
Public Overrides Function OpenProject(sFilePath As String) As Boolean
EgtSetCurrentContext(MainScene.GetCtx())
Dim bOk As Boolean = False
If String.IsNullOrEmpty(sFilePath) Then
@@ -225,29 +226,32 @@ Public Class MySceneHostVM
bOk = MainController.OpenProject(sFilePath, False)
End If
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub SaveProject()
MyBase.SaveProject()
Public Overrides Function SaveProject() As Boolean
Dim bOk As Boolean = MyBase.SaveProject()
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub SaveAsProject()
MyBase.SaveAsProject()
Public Overrides Function SaveAsProject() As Boolean
Dim bOk As Boolean = MyBase.SaveAsProject()
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub ImportProject()
Public Overrides Function ImportProject() As Boolean
Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
If Not String.IsNullOrWhiteSpace(sDir) Then
sDir = Path.GetDirectoryName(sDir)
End If
sDir.TrimEnd("\"c)
MainController.ImportProject(sDir)
End Sub
Return MainController.ImportProject(sDir)
End Function
#End Region ' ProjectManager
@@ -17,7 +17,7 @@ Friend Module MachParamIniFile
' creo parametro
If sMachParamParams(0) = "d" OrElse sMachParamParams(0) = "l" Then
Dim dDefault As Double
StringToDouble(sMachParamParams(2), dDefault)
StringToDoubleAdv(sMachParamParams(2), dDefault)
Dim ParamType As MachParamType
If sMachParamParams(0) = "d" Then
ParamType = MachParamType.DOUBLE_
@@ -41,7 +41,7 @@ Public Class SectionXMaterialToBeAdded
End Get
Set(value As String)
Dim dTempNewW As Double
If StringToLen(value, dTempNewW) AndAlso dTempNewW > 0 Then
If StringToLenAdv(value, dTempNewW, True) AndAlso dTempNewW > 0 Then
dNewW = dTempNewW
Else
NotifyPropertyChanged(NameOf(sNewW))
@@ -55,7 +55,7 @@ Public Class SectionXMaterialToBeAdded
End Get
Set(value As String)
Dim dTempNewL As Double
If StringToLen(value, dTempNewL) AndAlso dTempNewL > 0 Then
If StringToLenAdv(value, dTempNewL, True) AndAlso dTempNewL > 0 Then
dNewL = dTempNewL
Else
NotifyPropertyChanged(NameOf(sNewL))
@@ -52,9 +52,9 @@ Module WarehouseHelper
Dim sRanges() As String = sRange.Split(","c)
If sRanges.Count() >= 2 Then
Dim dMaxThickness As Double = 0
StringToDouble(sRanges(1), dMaxThickness)
StringToDoubleAdv(sRanges(1), dMaxThickness)
If dHeight <= dMaxThickness Then
If StringToDouble(sRanges(0), dOffset) Then Return dOffset
If StringToDoubleAdv(sRanges(0), dOffset) Then Return dOffset
End If
End If
nRangeIndex += 1
@@ -106,7 +106,7 @@ Module WarehouseHelper
GenInterface.GetPrivateProfileString(WRH_WALL, WRH_S & nCurrentS, "", sPanelDim, GetWarehouseIniPath())
If String.IsNullOrWhiteSpace(sPanelDim) Then Return False
sPanelDims = sPanelDim.Split(","c)
If Not sPanelDims.Count = 2 OrElse Not StringToDouble(sPanelDims(0), dW) OrElse Not StringToDouble(sPanelDims(1), dL) Then Return False
If Not sPanelDims.Count = 2 OrElse Not StringToDoubleAdv(sPanelDims(0), dW) OrElse Not StringToDoubleAdv(sPanelDims(1), dL) Then Return False
Return True
End If
End Function
@@ -128,14 +128,14 @@ Module WarehouseHelper
Select Case Type
Case BWType.BEAM
If dW = sSectionValues(0) AndAlso dH = sSectionValues(1) AndAlso Material = sSectionValues(2) Then
If Not StringToDouble(sSectionValues(3), dL) Then Return False
If Not StringToDoubleAdv(sSectionValues(3), dL) Then Return False
If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False
Return True
End If
Case BWType.WALL
If dH = sSectionValues(0) AndAlso Material = sSectionValues(1) Then
If Not StringToDouble(sSectionValues(2), dW) Then Return False
If Not StringToDouble(sSectionValues(3), dL) Then Return False
If Not StringToDoubleAdv(sSectionValues(2), dW) Then Return False
If Not StringToDoubleAdv(sSectionValues(3), dL) Then Return False
If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False
Return True
End If
@@ -162,12 +162,12 @@ Module WarehouseHelper
Dim SectionData() As String = sSectionData.Split(","c)
Select Case Type
Case BWType.BEAM
Dim dSectionW As Double = 0 : StringToDouble( SectionData(0), dSectionW)
Dim dSectionH As Double = 0 : StringToDouble( SectionData(1), dSectionH)
Dim dSectionW As Double = 0 : StringToDoubleAdv( SectionData(0), dSectionW)
Dim dSectionH As Double = 0 : StringToDoubleAdv( SectionData(1), dSectionH)
For Each SectionProgress In SectionList
If Math.Abs( SectionProgress.Section.dW - dSectionW) < 0.1 AndAlso
Math.Abs( SectionProgress.Section.dH - dSectionH) < 0.1 AndAlso SectionProgress.Section.sMaterial.Contains(SectionData(2)) Then
If Not StringToDouble(sSectionValues(1), dL) Then Continue While
If Not StringToDoubleAdv(sSectionValues(1), dL) Then Continue While
If Not Integer.TryParse(sSectionValues(2), nQty) Then Continue While
If sSectionValues.Count >= 4 AndAlso Integer.TryParse(sSectionValues(3), nActive) Then
If nActive > 0 Then SectionProgress.SParamList.Add(New SParam(SectionProgress.Section, dL, nQty, nActive > 0))
@@ -179,11 +179,11 @@ Module WarehouseHelper
End If
Next
Case BWType.WALL
Dim dSectionH As Double = 0 : StringToDouble( SectionData(0), dSectionH)
Dim dSectionH As Double = 0 : StringToDoubleAdv( SectionData(0), dSectionH)
For Each SectionProgress In SectionList
If Math.Abs( SectionProgress.Section.dH - dSectionH) < 0.1 AndAlso SectionProgress.Section.sMaterial.Contains(SectionData(1)) Then
If Not StringToDouble(sSectionValues(1), dW) Then Continue While
If Not StringToDouble(sSectionValues(2), dL) Then Continue While
If Not StringToDoubleAdv(sSectionValues(1), dW) Then Continue While
If Not StringToDoubleAdv(sSectionValues(2), dL) Then Continue While
If Not Integer.TryParse(sSectionValues(3), nQty) Then Continue While
If Not Integer.TryParse(sSectionValues(4), nActive) Then Continue While
If nActive > 0 Then SectionProgress.SParamList.Add(New SParam(SectionProgress.Section, dW, dL, nQty, nActive > 0))
@@ -222,14 +222,14 @@ Module WarehouseHelper
' Sectionlist.Add(New SectionXMaterial(sSectionValues(0), sSectionValues(1), sSectionValues(3), sSectionValues(2)))
' End If
' If dW = sSectionValues(0) AndAlso dH = sSectionValues(1) AndAlso Material = sSectionValues(2) Then
' If Not StringToDouble(sSectionValues(3), dL) Then Return False
' If Not StringToDoubleAdv(sSectionValues(3), dL) Then Return False
' If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False
' Return True
' End If
' Case BWType.WALL
' If dH = sSectionValues(1) AndAlso Material = sSectionValues(2) Then
' If Not StringToDouble(sSectionValues(2), dW) Then Return False
' If Not StringToDouble(sSectionValues(3), dL) Then Return False
' If Not StringToDoubleAdv(sSectionValues(2), dW) Then Return False
' If Not StringToDoubleAdv(sSectionValues(3), dL) Then Return False
' If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False
' Return True
' End If
@@ -261,8 +261,8 @@ Module WarehouseHelper
Dim dW As Double = 0
Dim dH As Double = 0
Dim sMaterial As String = sSectXMatValues(2)
StringToLen(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH)
StringToLenAdv(sSectXMatValues(0), dW)
StringToLenAdv(sSectXMatValues(1), dH)
If SectXMat.dW = dW AndAlso SectXMat.dH = dH AndAlso SectXMat.sMaterial(0) = sMaterial Then
If sSectXMatValues.Length <= 3 Then Return Nothing
Dim sValue As String = ""
@@ -277,7 +277,7 @@ Module WarehouseHelper
Dim dL As Double = 0
Dim nQty As Integer = 0
Dim nActive As Integer = 1
StringToLen(sParamValues(1), dL)
StringToLenAdv(sParamValues(1), dL)
If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(2), nQty)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nActive)
Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(2)), dL, nQty, nActive > 0)
@@ -302,8 +302,8 @@ Module WarehouseHelper
Dim dW As Double = 0
Dim dH As Double = 0
Dim sMaterial As String = sSectXMatValues(2)
StringToLen(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH)
StringToLenAdv(sSectXMatValues(0), dW)
StringToLenAdv(sSectXMatValues(1), dH)
If SectXMat.dW = dW AndAlso SectXMat.dH = dH AndAlso SectXMat.sMaterial(0) = sMaterial Then
' recupero indice di SParam
Dim SParamIndex As Integer = 1
@@ -320,7 +320,7 @@ Module WarehouseHelper
Dim nSectIndex As Integer = sParamValues(0)
Dim nQty As Integer = 0
Dim nActive As Integer = 1
StringToLen(sParamValues(1), dL)
StringToLenAdv(sParamValues(1), dL)
If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(2), nQty)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nActive)
Dim bActive As Boolean = nActive = 1
@@ -350,8 +350,8 @@ Module WarehouseHelper
Dim dW As Double = 0
Dim dH As Double = 0
Dim sMaterial As String = sSectionValues(2)
StringToLen(sSectionValues(0), dW)
StringToLen(sSectionValues(1), dH)
StringToLenAdv(sSectionValues(0), dW)
StringToLenAdv(sSectionValues(1), dH)
If Section.dW = dW AndAlso Section.dH = dH AndAlso Section.sMaterial(0) = sMaterial Then
' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
Return nIndex
@@ -359,7 +359,7 @@ Module WarehouseHelper
Case BWType.WALL
Dim dH As Double = 0
Dim sMaterial As String = sSectionValues(1)
StringToLen(sSectionValues(0), dH)
StringToLenAdv(sSectionValues(0), dH)
If Section.dH = dH AndAlso Section.sMaterial(0) = sMaterial Then
' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
Return nIndex
@@ -462,9 +462,9 @@ Public Class WarehouseWndVM
Offset_Visibility = Visibility.Visible
EgtUILib.GetPrivateProfileString(S_BEAM, K_STARTOFFSET, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dStartOffset)
StringToLenAdv(sValue, dStartOffset)
EgtUILib.GetPrivateProfileString(S_BEAM, K_OFFSET, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dOffset)
StringToLenAdv(sValue, dOffset)
EgtUILib.GetPrivateProfileString(S_BEAM, K_QUANTITY, String.Empty, sValue, sWarehousePath)
Integer.TryParse(sValue, nQuantity)
@@ -482,9 +482,9 @@ Public Class WarehouseWndVM
Offset_Visibility = Visibility.Visible
EgtUILib.GetPrivateProfileString(S_WALL, K_KERF, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dKerf)
StringToLenAdv(sValue, dKerf)
EgtUILib.GetPrivateProfileString(S_WALL, K_OFFSET, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dOffset)
StringToLenAdv(sValue, dOffset)
EgtUILib.GetPrivateProfileString(S_WALL, K_QUANTITY, String.Empty, sValue, sWarehousePath)
Integer.TryParse(sValue, nQuantity)
@@ -511,9 +511,9 @@ Public Class WarehouseWndVM
Offset_Visibility = Visibility.Visible
EgtUILib.GetPrivateProfileString(S_BEAM, K_STARTOFFSET, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dStartOffset)
StringToLenAdv(sValue, dStartOffset)
EgtUILib.GetPrivateProfileString(S_BEAM, K_OFFSET, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dOffset)
StringToLenAdv(sValue, dOffset)
SParamList = New ObservableCollection(Of SParam)
SectionXMaterialList = New ObservableCollection(Of SectionXMaterial)(GetSectionXMaterialsFromWarehouse())
@@ -542,7 +542,7 @@ Public Class WarehouseWndVM
MediumWall_Visibility = Visibility.Visible
EgtUILib.GetPrivateProfileString(S_WALL, K_KERF, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dKerf)
StringToLenAdv(sValue, dKerf)
' carico la lista degli Spessori Min/Max e Offset compresi tra di essi
While EgtUILib.GetPrivateProfileString(S_WALL, K_RANGE & ParamIndex, String.Empty, sValue, sWarehousePath)
@@ -692,8 +692,8 @@ Public Class WarehouseWndVM
' Dim dW As Double = 0
' Dim dH As Double = 0
' Dim sMaterial As String = sSectXMatValues(2)
' StringToLen(sSectXMatValues(0), dW)
' StringToLen(sSectXMatValues(1), dH)
' StringToLenAdv(sSectXMatValues(0), dW)
' StringToLenAdv(sSectXMatValues(1), dH)
' If SParamList(ParamIndex - 1).SectXMat.dW = dW AndAlso SParamList(ParamIndex - 1).SectXMat.dH = dH AndAlso SParamList(ParamIndex - 1).SectXMat.sMaterial(0) = sMaterial Then
' ' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
' Exit While
@@ -839,7 +839,7 @@ Public Class WarehouseWndVM
Dim dLValue As Double = 0
Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE
Case MachineType.BEAM
If Not IsNothing(sNewL) Then StringToLen(sNewL, dLValue)
If Not IsNothing(sNewL) Then StringToLenAdv(sNewL, dLValue, True)
If dLValue > 0 Then
' controllo il valore immesso non sia già presente
Dim bExist As Boolean = False
@@ -860,8 +860,8 @@ Public Class WarehouseWndVM
MessageBox.Show(IncorrectValue_Msg, Error_Msg)
End If
Case MachineType.WALL
If Not IsNothing(sNewW) Then StringToLen(sNewW, dWValue)
If Not IsNothing(sNewL) Then StringToLen(sNewL, dLValue)
If Not IsNothing(sNewW) Then StringToLenAdv(sNewW, dWValue, True)
If Not IsNothing(sNewL) Then StringToLenAdv(sNewL, dLValue, True)
If dWValue > 0 AndAlso dLValue > 0 Then
' controllo che la coppia di valori immessa non sia già presente
Dim bExist As Boolean = False
@@ -1099,8 +1099,8 @@ Public Class WarehouseWndVM
' creo parametro
Dim dW As Double = 0
Dim dH As Double = 0
StringToLen(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH)
StringToLenAdv(sSectXMatValues(0), dW)
StringToLenAdv(sSectXMatValues(1), dH)
If Not SectXMatList.Any(Function(x) x.dW = dW AndAlso x.dH = dH AndAlso x.sMaterial(0) = sSectXMatValues(2)) Then
SectXMatList.Add(New SectionXMaterial(dW, dH, 0, sSectXMatValues(2)))
End If
@@ -1114,7 +1114,7 @@ Public Class WarehouseWndVM
Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' creo parametro
Dim dH As Double = 0
StringToLen(sSectXMatValues(0), dH)
StringToLenAdv(sSectXMatValues(0), dH)
If Not SectXMatList.Any(Function(x) x.dH = dH AndAlso x.sMaterial(0) = sSectXMatValues(1)) Then
SectXMatList.Add(New SectionXMaterial(0, dH, 0, sSectXMatValues(1)))
End If
@@ -1138,8 +1138,8 @@ Public Class WarehouseWndVM
' creo parametro
Dim dW As Double = 0
Dim dH As Double = 0
StringToLen(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH)
StringToLenAdv(sSectXMatValues(0), dW)
StringToLenAdv(sSectXMatValues(1), dH)
Dim ReadSection As New SectionXMaterial(dW, dH, 0, sSectXMatValues(2))
If ReadSection = SectionXMaterial Then Return False
sSectXMatIndex += 1
@@ -1153,7 +1153,7 @@ Public Class WarehouseWndVM
Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' creo parametro
Dim dH As Double = 0
StringToLen(sSectXMatValues(0), dH)
StringToLenAdv(sSectXMatValues(0), dH)
Dim ReadSection As New SectionXMaterial(0, dH, 0, sSectXMatValues(1))
If ReadSection = SectionXMaterial Then Return False
sSectXMatIndex += 1
@@ -1175,7 +1175,7 @@ Public Class WarehouseWndVM
Dim sWarehousePath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_BASIC_INI_FILE_NAME
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
If EgtUILib.GetPrivateProfileString(S_BEAM, "L" & ParamIndex, String.Empty, sValue, sWarehousePath) Then
StringToLen(sValue, dValue)
StringToLenAdv(sValue, dValue)
Return New SParam(dValue)
End If
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
@@ -1190,8 +1190,8 @@ Public Class WarehouseWndVM
' creo parametro
Dim dW As Double = 0
Dim dL As Double = 0
StringToLen(sParamValues(0), dW)
StringToLen(sParamValues(1), dL)
StringToLenAdv(sParamValues(0), dW)
StringToLenAdv(sParamValues(1), dL)
Return New SParam(dW, dL)
End If
End If
@@ -1216,9 +1216,9 @@ Public Class WarehouseWndVM
Dim dL As Double = 0
Dim nQty As Integer = 0
Dim nActive As Integer = 1
StringToLen(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH)
StringToLen(sParamValues(1), dL)
StringToLenAdv(sSectXMatValues(0), dW)
StringToLenAdv(sSectXMatValues(1), dH)
StringToLenAdv(sParamValues(1), dL)
If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(2), nQty)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nActive)
Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(2)), dL, nQty, nActive > 0)
@@ -1243,9 +1243,9 @@ Public Class WarehouseWndVM
Dim dL As Double = 0
Dim nQty As Integer = 0
Dim nActive As Integer = 1
StringToLen(sSectXMatValues(0), dH)
StringToLen(sParamValues(1), dW)
StringToLen(sParamValues(2), dL)
StringToLenAdv(sSectXMatValues(0), dH)
StringToLenAdv(sParamValues(1), dW)
StringToLenAdv(sParamValues(2), dL)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nQty)
If sParamValues.Count >= 5 Then Integer.TryParse(sParamValues(4), nActive)
Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(1)), dW, dL, nQty, nActive > 0)
@@ -1284,8 +1284,8 @@ Public Class WarehouseWndVM
' creo parametro
Dim dOffset As Double = 0
Dim dMaxThickness As Double = 0
StringToLen(sParamValues(0), dOffset)
StringToLen(sParamValues(1), dMaxThickness)
StringToLenAdv(sParamValues(0), dOffset)
StringToLenAdv(sParamValues(1), dMaxThickness)
Return New WhWallParam(dOffset, dMaxThickness)
End If
End If
Binary file not shown.
Binary file not shown.