Compare commits

...

14 Commits

Author SHA1 Message Date
Emmanuele Sassi 121f02fb0c Merge branch 'RawPartLastCreation' into AddBeamPosZ 2022-11-25 15:05:41 +01:00
Emmanuele Sassi 848b6d98a5 - correzione creazione pezzi durante creazione grezzi 2022-11-25 15:02:09 +01:00
Emmanuele Sassi 0589565b8e Merge branch 'AddBeamPosZ' into RawPartLastCreation 2022-11-25 14:46:19 +01:00
Emmanuele Sassi 1109a91dd9 - Aggiunta colonna PosZ per Wall su Gruppo di lavorazione 2022-11-25 13:33:23 +01:00
DarioS 37cb1dbb6a EgtBEAMWALL 2.4k3 :
- correzione gestione spessori per nesting manuale pareti (ora si usano sempre operatori di SectionXMaterial).
2022-11-25 08:04:27 +01:00
Emmanuele Sassi 152788fe1b - modifiche per aggiunta grezzo durante definizione se non definito
- WIP modifiche per salvataggio ultimo usato per sezione
2022-11-24 16:30:56 +01:00
Emmanuele Sassi 534b363a04 Merge branch 'master' of https://gitlab.steamware.net/egaltech/egtbeamwall 2022-11-21 18:33:26 +01:00
DarioS 3f13706b97 EgtBEAMWALL 2.4k2 :
- ricompilazione di tutto con cambio versione.
2022-11-21 12:48:29 +01:00
Emmanuele Sassi 1f804ab6fc Merge branch 'develop' 2022-11-21 11:12:27 +01:00
Emmanuele Sassi 21dd6fbbb1 Merge branch 'RawPartCreation' 2022-11-18 14:15:41 +01:00
Emmanuele Sassi 50d9603598 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-10-06 11:59:19 +02:00
Samuele Locatelli fae8018df9 Merge branch 'DataLayer' into develop 2022-09-19 19:41:46 +02:00
Emmanuele Sassi 7e15ef9dd1 Merge remote-tracking branch 'gitlab.seriate/master' into develop 2022-09-02 11:23:42 +02:00
Emmanuele Sassi 2b4f3d93dc Merge remote-tracking branch 'gitlab.seriate/master' into develop 2022-08-25 21:06:11 +02:00
17 changed files with 330 additions and 347 deletions
+1
View File
@@ -251,6 +251,7 @@
Public Const MGR_RPT_PANELLEN As String = "PANELLEN"
Public Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
Public Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
Public Const MGR_RPT_PANELPOSZ As String = "PANELPOSZ"
Public Const MGR_RPT_PART As String = "PART"
' parametri P per comunicazione con la macchina
@@ -6,6 +6,7 @@
Public Const COL_STARTCUT As String = "colSTARTCUT"
Public Const COL_W As String = "colW"
Public Const COL_L As String = "colL"
Public Const COL_POSZ As String = "colPOSZ"
Public Const COL_ROT As String = "colROT"
Public Const COL_FLIP As String = "colFLIP"
Public Const COL_POSX As String = "colPOSX"
@@ -149,6 +149,16 @@ Public Class MyMachGroupM
End Get
End Property
Protected m_dPosZ As Double = 0
Public Property dPosZ As Double
Get
Return m_dPosZ
End Get
Set(value As Double)
m_dPosZ = value
End Set
End Property
#End Region ' Wall
#Region "Calc"
@@ -311,6 +321,7 @@ Public Class MyMachGroupM
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELPOSZ, NewMachGroupM.m_dPosZ)
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW * NewMachGroupM.m_dH
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
For Each Part In NewMachGroupM.m_PartMList
@@ -343,6 +354,7 @@ Public Class MyMachGroupM
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELPOSZ, NewMachGroupM.m_dPosZ)
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
For Each Part In NewMachGroupM.m_PartMList
+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.4.11.1")>
<Assembly: AssemblyFileVersion("2.4.11.1")>
<Assembly: AssemblyVersion("2.4.11.3")>
<Assembly: AssemblyFileVersion("2.4.11.3")>
@@ -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.4.11.1")]
[assembly: AssemblyFileVersion("2.4.11.1")]
[assembly: AssemblyVersion("2.4.11.3")]
[assembly: AssemblyFileVersion("2.4.11.3")]
@@ -81,6 +81,13 @@
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!--PosZ - Posizione in Z-->
<DataGridTextColumn x:Key="colPOSZ" Binding="{Binding sPosZ}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.PosZ_Msg,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!--MAT - Materiale-->
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
<DataGridTextColumn.Header>
@@ -13,6 +13,13 @@ Public Class RawPartListVM
End Get
End Property
Private m_colRawPart_PosZ As EgtDataGridColumn
Public ReadOnly Property colRawPart_PosZ As EgtDataGridColumn
Get
Return m_colRawPart_PosZ
End Get
End Property
Private m_RawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property RawPartColumns As ObservableCollection(Of EgtDataGridColumn)
Get
@@ -55,6 +62,12 @@ Public Class RawPartListVM
End Get
End Property
Public ReadOnly Property PosZ_Msg As String
Get
Return EgtMsg(61728)
End Get
End Property
Public ReadOnly Property Material_Msg As String
Get
Return EgtMsg(61607)
@@ -84,23 +97,27 @@ Public Class RawPartListVM
Map.SetRefRawPartListVM(Me)
' carico le colonne della datagrid
GetPrivateProfileColumns(S_RAWPARTLIST_SUPERVISOR, RawPartColumns)
' recupero riferimento a colonna StartCut
' recupero riferimento a colonna StartCut e PosZ
m_colRawPart_StartCut = m_RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_STARTCUT)
m_colRawPart_PosZ = m_RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSZ)
End Sub
#End Region ' CONSTRUCTOR
Friend Sub UpdateColumns(nMachType As MachineType)
If nMachType = MachineType.BEAM Then
If Not IsNothing(m_colRawPart_StartCut) Then
m_colRawPart_StartCut.ColumnVisibility = Visibility.Visible
End If
'RawPartColumns.Clear()
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
' aggiorno la visibilità delle colonne
For Each col In RawPartColumns
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
Next
If Not IsNothing(m_colRawPart_StartCut) Then
m_colRawPart_StartCut.ColumnVisibility = Visibility.Visible
End If
If Not IsNothing(m_colRawPart_PosZ) Then
m_colRawPart_PosZ.ColumnVisibility = Visibility.Collapsed
End If
'RawPartColumns.Clear()
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
ElseIf nMachType = MachineType.WALL Then
' aggiorno la visibilità delle colonne
For Each col In RawPartColumns
@@ -109,6 +126,9 @@ Public Class RawPartListVM
If Not IsNothing(m_colRawPart_StartCut) Then
m_colRawPart_StartCut.ColumnVisibility = Visibility.Collapsed
End If
If Not IsNothing(m_colRawPart_PosZ) Then
m_colRawPart_PosZ.ColumnVisibility = Visibility.Visible
End If
'RawPartColumns.Clear()
'GetPrivateProfileColumns(S_RAWPARTLIST_WALL, RawPartColumns)
End If
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.11.1")>
<Assembly: AssemblyFileVersion("2.4.11.1")>
<Assembly: AssemblyVersion("2.4.11.3")>
<Assembly: AssemblyFileVersion("2.4.11.3")>
@@ -131,6 +131,18 @@
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
<!--PosZ - Posizione in Z-->
<DataGridTextColumn x:Key="colPOSZ" Binding="{Binding sPosZ}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.PosZ_Msg,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" />
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
<!--MAT - Materiale-->
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
<DataGridTextColumn.Header>
@@ -69,6 +69,12 @@ Public Class RawPartListVM
End Get
End Property
Public ReadOnly Property PosZ_Msg As String
Get
Return EgtMsg(61728)
End Get
End Property
Public ReadOnly Property Material_Msg As String
Get
Return EgtMsg(61607)
@@ -90,9 +90,9 @@
Style="{StaticResource LeftPanel_Button}">
<Image Source="/Resources/LeftPanel/NewRawPart.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding NewRawPartAuto_Command}"
<Button Command="{Binding NewRawPartLast_Command}"
Visibility="{Binding MachiningPage_Visibility}"
ToolTip="{Binding NewRawPartAuto_ToolTip}"
ToolTip="{Binding NewRawPartLast_ToolTip}"
IsEnabled="{Binding LeftPanel_IsEnabled}"
Style="{StaticResource LeftPanel_Button}">
<Image Source="/Resources/LeftPanel/NewRawPartAuto.png" Stretch="Uniform"/>
@@ -100,7 +100,7 @@ Public Class LeftPanelVM
' Definizione comandi
Private m_cmdNewRawPart As ICommand
Private m_cmdNewRawPartAuto As ICommand
Private m_cmdNewRawPartLast As ICommand
Private m_cmdAddToRawPart As ICommand
Private m_cmdCopyPart As ICommand
Private m_cmdAddPart As ICommand
@@ -156,7 +156,7 @@ Public Class LeftPanelVM
End Get
End Property
Public ReadOnly Property NewRawPartAuto_ToolTip As String
Public ReadOnly Property NewRawPartLast_ToolTip As String
Get
Return EgtMsg(61977)
End Get
@@ -265,7 +265,7 @@ Public Class LeftPanelVM
Public ReadOnly Property NewRawPart_Command As ICommand
Get
If m_cmdNewRawPart Is Nothing Then
m_cmdNewRawPart = New Command(AddressOf NewRawPart)
m_cmdNewRawPart = New Command(AddressOf NewRawPartCmd)
End If
Return m_cmdNewRawPart
End Get
@@ -274,7 +274,11 @@ Public Class LeftPanelVM
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub NewRawPart()
Public Sub NewRawPartCmd()
NewRawPart(False)
End Sub
Public Sub NewRawPart(bLast As Boolean)
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
@@ -348,56 +352,41 @@ Public Class LeftPanelVM
Case WarehouseType.MEDIUM
Dim SectionList As List(Of SParam) = WarehouseHelper.GetSectionList()
Dim SParamlist As List(Of SParam) = SectionList.FindAll(Function(x) x.SectXMat = SelParts(0).Section)
If SParamlist.Count = 0 Then
' apro finestra con solo edit
If AddRawPartWnd(AddRawPartWndVM.EditTypes.ONLY_TEXT, SParamlist, dRawW, dRawL, dStartOffset, dOffset, dKerf) Then
WarehouseHelper.SetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dOffset)
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
WarehouseHelper.SetStartOffset(dStartOffset)
Else
WarehouseHelper.SetKerf(dKerf)
End If
If bLast Then
If SParamlist.Count > 0 Then
dRawL = SParamlist(0).dL
dRawW = SParamlist(0).dW
Else
MessageBox.Show(EgtMsg(61975), EgtMsg(30007))
Return
End If
ElseIf SParamlist.Count > 0 Then
'' se premuto shift
'If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
' imposto finestra con anche edit
If AddRawPartWnd(AddRawPartWndVM.EditTypes.TEXT_AND_COMBO, SParamlist, dRawW, dRawL, dStartOffset, dOffset, dKerf) Then
WarehouseHelper.SetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dOffset)
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
WarehouseHelper.SetStartOffset(dStartOffset)
Else
If SParamlist.Count = 0 Then
' apro finestra con solo edit
If AddRawPartWnd(AddRawPartWndVM.EditTypes.ONLY_TEXT, SParamlist, dRawW, dRawL, dStartOffset, dOffset, dKerf) Then
WarehouseHelper.SetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dOffset)
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
WarehouseHelper.SetStartOffset(dStartOffset)
Else
WarehouseHelper.SetKerf(dKerf)
End If
Else
WarehouseHelper.SetKerf(dKerf)
Return
End If
ElseIf SParamlist.Count > 0 Then
' imposto finestra con anche edit
If AddRawPartWnd(AddRawPartWndVM.EditTypes.TEXT_AND_COMBO, SParamlist, dRawW, dRawL, dStartOffset, dOffset, dKerf) Then
WarehouseHelper.SetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dOffset)
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
WarehouseHelper.SetStartOffset(dStartOffset)
Else
WarehouseHelper.SetKerf(dKerf)
End If
Else
Return
End If
Else
Return
End If
'Else
' ' creo grezzo con l'unico materiale
' dRawL = SParamlist(0).dL
' dRawW = SParamlist(0).dW
End If
'Else
' ' imposto finestra di sola scelta dimensione
' Dim EditType As AddRawPartWndVM.EditTypes = AddRawPartWndVM.EditTypes.ONLY_COMBO
' ' se premuto shift
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
' ' imposto finestra con anche edit
' EditType = AddRawPartWndVM.EditTypes.TEXT_AND_COMBO
' End If
' If AddRawPartWnd(EditType, SParamlist, dRawW, dRawL, dStartOffset, dOffset, dKerf) Then
' WarehouseHelper.SetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dOffset)
' If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
' WarehouseHelper.SetStartOffset(dStartOffset)
' Else
' WarehouseHelper.SetKerf(dKerf)
' End If
' Else
' Return
' End If
'End If
End Select
End If
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
@@ -419,23 +408,23 @@ Public Class LeftPanelVM
Dim nCurrMachGroup As Integer = EgtGetCurrMachGroup()
Dim sCurrMachGroupName As String = ""
EgtGetMachGroupName(nCurrMachGroup, sCurrMachGroupName)
' ordino i pezzi per lunghezza
SelParts = SelParts.OrderBy(Function(x) x.dL).ToList
' creo copie dei pezzi
Dim nPartDuploIdList As New List(Of Integer)
For Each Part In SelParts
Dim nDuploId As Integer = EgtDuploNew(Part.nPartId)
' elimino valori calcolo dell'originale
MyMachGroupPanelVM.DuploRemoveProjCalc(nDuploId)
' lo rendo std
EgtSetMode(nDuploId, GDB_MD.STD)
nPartDuploIdList.Add(nDuploId)
Next
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId)
EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup)
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
' ordino i pezzi per lunghezza
SelParts = SelParts.OrderBy(Function(x) x.dL).ToList
' creo copie dei pezzi
Dim nPartDuploIdList As New List(Of Integer)
For Each Part In SelParts
Dim nDuploId As Integer = EgtDuploNew(Part.nPartId)
' elimino valori calcolo dell'originale
MyMachGroupPanelVM.DuploRemoveProjCalc(nDuploId)
' lo rendo std
EgtSetMode(nDuploId, GDB_MD.STD)
nPartDuploIdList.Add(nDuploId)
Next
' scrivo dati costruzione grezzo in gruppo di lavorazione
EgtSetInfo(nCurrMachGroup, MGR_RPT_BARLEN, dRawL)
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelPart.sMATERIAL)
@@ -553,9 +542,91 @@ Public Class LeftPanelVM
dKerf = AddRawPartWndVM.VariableList(2).dValue
dOffset = AddRawPartWndVM.VariableList(3).dValue
End Select
' verifico se il materiale esiste in magazzino o devo aggiungerlo
Dim CurrSParam As SParam
Select Case EditType
Case AddRawPartWndVM.EditTypes.ONLY_TEXT
' lo aggiungo a lista materiali in magazzino
CurrSParam = AddRawMaterial(dRawW, dRawL)
Case AddRawPartWndVM.EditTypes.ONLY_COMBO
' non faccio nulla
Case AddRawPartWndVM.EditTypes.TEXT_AND_COMBO
' verifico se lunghezza testo corrisponde a materiale
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
CurrSParam = SParamlist.FirstOrDefault(Function(x) x.dL = AddRawPartWndVM.VariableList(0).dValue)
Else
CurrSParam = SParamlist.FirstOrDefault(Function(x) x.dL = AddRawPartWndVM.VariableList(1).dValue AndAlso x.dW = AddRawPartWndVM.VariableList(0).dValue)
End If
If IsNothing(CurrSParam) Then
' lo aggiungo a lista materiali in magazzino
CurrSParam = AddRawMaterial(dRawW, dRawL)
End If
End Select
' imposto il materiale selezionato come ultimo utilizzato
Return True
End Function
Private Function AddRawMaterial(dRawW As Double, ByRef dRawL As Double) As SParam
Dim sWarehousePath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_MEDIUM_INI_FILE_NAME
Dim nQuantity As Integer = GetMainPrivateProfileInt(S_WAREHOUSE, K_DEFAULTQUANTITY, 1)
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
' creo sParam
Dim CurrSParam As New SParam(Map.refProjectVM.BTLStructureVM.SelBTLPart.Section, dRawL, nQuantity, False)
Dim sL As String = String.Empty
sL = LenToString(CurrSParam.dL, 3)
' ricavo l'indice del SecionXMaterial dalla Beam_List
Dim SectXMatIndex As Integer = 1
Dim sSxMValue As String = ""
While EgtUILib.GetPrivateProfileString(S_BEAM_LIST, SectXMatIndex, String.Empty, sSxMValue, sWarehousePath)
If sSxMValue = CurrSParam.sValue Then
' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
Exit While
End If
SectXMatIndex += 1
End While
' ricavo nuovo indice materiale
Dim ParamIndex As Integer = 1
Dim sParam As String = ""
While GetPrivateProfileString(S_BEAM, K_L & ParamIndex, "", sParam, sWarehousePath) > 0
ParamIndex += 1
End While
' lo aggiungo in warehouse
WritePrivateProfileString(S_BEAM, K_L & ParamIndex,
SectXMatIndex & "," & sL & "," & CurrSParam.nQuantity & "," & If(CurrSParam.bActive, 1, 0),
sWarehousePath)
Return CurrSParam
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
' creo sParam
Dim CurrSParam As New SParam(Map.refProjectVM.BTLStructureVM.SelBTLPart.Section, dRawW, dRawL, nQuantity, False)
Dim sW As String = String.Empty
Dim sL As String = String.Empty
sW = LenToString(CurrSParam.dW, 3)
sL = LenToString(CurrSParam.dL, 3)
' ricavo l'indice del SecionXMaterial dalla Wall_List
Dim SectXMatIndex As Integer = 1
Dim sSxMValue As String = ""
While EgtUILib.GetPrivateProfileString(S_WALL_LIST, SectXMatIndex, String.Empty, sSxMValue, sWarehousePath)
If sSxMValue = CurrSParam.sValue Then
' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
Exit While
End If
SectXMatIndex += 1
End While
' ricavo nuovo indice materiale
Dim ParamIndex As Integer = 1
Dim sParam As String = ""
While GetPrivateProfileString(S_WALL, K_S & ParamIndex, "", sParam, sWarehousePath) = 0
ParamIndex += 1
End While
' lo aggiungo in warehouse
WritePrivateProfileString(S_WALL, K_S & ParamIndex,
SectXMatIndex & "," & sW & "," & sL & "," & CurrSParam.nQuantity & "," & If(CurrSParam.bActive, 1, 0),
sWarehousePath)
Return CurrSParam
End If
End Function
Private Function VerifyPartCount(SelParts As List(Of BTLPartVM)) As Boolean
' verifico se ci sono pezzi da aggiungere
Dim ToAddList As New List(Of String)
@@ -585,289 +656,28 @@ Public Class LeftPanelVM
#End Region ' NewRawPart
#Region "NewRawPartAuto"
#Region "NewRawPartLast"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property NewRawPartAuto_Command As ICommand
Public ReadOnly Property NewRawPartLast_Command As ICommand
Get
If m_cmdNewRawPartAuto Is Nothing Then
m_cmdNewRawPartAuto = New Command(AddressOf NewRawPartAuto)
If m_cmdNewRawPartLast Is Nothing Then
m_cmdNewRawPartLast = New Command(AddressOf NewRawPartLast)
End If
Return m_cmdNewRawPartAuto
Return m_cmdNewRawPartLast
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub NewRawPartAuto()
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
If IsNothing(SelParts) OrElse SelParts.Count <= 0 Then Return
' verifico che abbiano tutti la stessa sezione
Dim dHSection As Double = SelParts(0).dH
Dim dWSection As Double = SelParts(0).dW
For PartIndex = 0 To SelParts.Count - 1
Dim Part As BTLPartVM = SelParts(PartIndex)
If Not IsNothing(Part) Then
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
If Part.dH <> dHSection OrElse Part.dW <> dWSection Then
MessageBox.Show(EgtMsg(61970), EgtMsg(30007))
Return
End If
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
If Part.dH <> dHSection Then
MessageBox.Show(EgtMsg(61970), EgtMsg(30007))
Return
End If
End If
Else
SelParts.Remove(Part)
End If
Next
' se pareti e piu' di uno selezionato, esco
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL And SelParts.Count > 1 Then
MessageBox.Show(EgtMsg(61971), EgtMsg(30007))
Return
End If
' se nessun grezzo, rendo tutti i pezzi visibili
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then
Map.refProjectVM.BTLStructureVM.ShowAll(False)
End If
' verifico se sono gia' stati messi tutti i pezzi richiesti
If Not VerifyPartCount(SelParts) Then Return
Dim dRawL As Double = SelParts(0).dL
Dim dRawW As Double = SelParts(0).dW
Dim dStartOffset As Double = 0
Dim dKerf As Double = 0
Dim dOffset As Double = WarehouseHelper.GetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' se tipo di definizione grezzo esplicito
If WarehouseHelper.GetRawPartDef = 1 OrElse ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift AndAlso WarehouseHelper.GetWarehouseType = WarehouseType.BASIC) Then
' chiedo lunghezza grezzo
Dim sWarehouseIniPath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_BASIC_INI_FILE_NAME
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
dStartOffset = WarehouseHelper.GetStartOffset()
dRawL += dStartOffset
Else
dKerf = WarehouseHelper.GetKerf()
dRawL += 2 * dKerf
dRawW += 2 * dKerf
End If
Dim AddRawPartWndVM As New AddRawPartWndVM(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dRawL, dRawW, dStartOffset)
Dim AddRawPartWnd As New AddRawPartWndV(Application.Current.MainWindow, AddRawPartWndVM)
If Not AddRawPartWnd.ShowDialog() Then Return
dRawL = AddRawPartWndVM.VariableList(0).dValue
dRawW = AddRawPartWndVM.VariableList(1).dValue
dStartOffset = AddRawPartWndVM.VariableList(1).dValue
' se altrimenti definizione grezzo da warehouse
Else
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
dStartOffset = WarehouseHelper.GetStartOffset()
Else
dKerf = WarehouseHelper.GetKerf()
End If
' se warehouse basic
Select Case WarehouseHelper.GetWarehouseType()
Case WarehouseType.BASIC
WarehouseHelper.GetCurrentDimensions(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dRawW, dRawL)
Case WarehouseType.MEDIUM
Dim SectionList As List(Of SParam) = WarehouseHelper.GetSectionList()
Dim SParamlist As List(Of SParam) = SectionList.FindAll(Function(x) x.SectXMat = SelParts(0).Section)
'If SParamlist.Count = 0 Then
' ' apro finestra con solo edit
' If AddRawPartWnd(AddRawPartWndVM.EditTypes.ONLY_TEXT, SParamlist, dRawW, dRawL, dStartOffset, dOffset, dKerf) Then
' WarehouseHelper.SetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dOffset)
' If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
' WarehouseHelper.SetStartOffset(dStartOffset)
' Else
' WarehouseHelper.SetKerf(dKerf)
' End If
' Else
' Return
' End If
'ElseIf SParamlist.Count = 1 Then
If SParamlist.Count > 0 Then
'' se premuto shift
'If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
' ' imposto finestra con anche edit
' If AddRawPartWnd(AddRawPartWndVM.EditTypes.TEXT_AND_COMBO, SParamlist, dRawW, dRawL, dStartOffset, dOffset, dKerf) Then
' WarehouseHelper.SetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dOffset)
' If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
' WarehouseHelper.SetStartOffset(dStartOffset)
' Else
' WarehouseHelper.SetKerf(dKerf)
' End If
' Else
' Return
' End If
'Else
' creo grezzo con l'unico materiale
dRawL = SParamlist(0).dL
dRawW = SParamlist(0).dW
'End If
'Else
' ' imposto finestra di sola scelta dimensione
' Dim EditType As AddRawPartWndVM.EditTypes = AddRawPartWndVM.EditTypes.ONLY_COMBO
' ' se premuto shift
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
' ' imposto finestra con anche edit
' EditType = AddRawPartWndVM.EditTypes.TEXT_AND_COMBO
' End If
' If AddRawPartWnd(EditType, SParamlist, dRawW, dRawL, dStartOffset, dOffset, dKerf) Then
' WarehouseHelper.SetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dOffset)
' If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
' WarehouseHelper.SetStartOffset(dStartOffset)
' Else
' WarehouseHelper.SetKerf(dKerf)
' End If
' Else
' Return
' End If
Else
MessageBox.Show(EgtMsg(61975), EgtMsg(30007))
Return
End If
End Select
End If
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
' verifico se lunghezza barra e' maggiore della lunghezza dei pezzi
Dim dTotLen As Double = WarehouseHelper.GetStartOffset()
For PartIndex = 0 To SelParts.Count - 1
If PartIndex <> 0 Then
dTotLen += WarehouseHelper.GetOffset(BWType.BEAM)
End If
dTotLen += SelParts(PartIndex).dL
Next
If dTotLen > dRawL Then
MessageBox.Show(EgtMsg(61972), EgtMsg(30007))
Return
End If
End If
' creo nuovo gruppo di lavorazione
Map.refMachGroupPanelVM.AddMachGroup()
Dim nCurrMachGroup As Integer = EgtGetCurrMachGroup()
Dim sCurrMachGroupName As String = ""
EgtGetMachGroupName(nCurrMachGroup, sCurrMachGroupName)
' ordino i pezzi per lunghezza
SelParts = SelParts.OrderBy(Function(x) x.dL).ToList
' creo copie dei pezzi
Dim nPartDuploIdList As New List(Of Integer)
For Each Part In SelParts
Dim nDuploId As Integer = EgtDuploNew(Part.nPartId)
' elimino valori calcolo dell'originale
MyMachGroupPanelVM.DuploRemoveProjCalc(nDuploId)
' lo rendo std
EgtSetMode(nDuploId, GDB_MD.STD)
nPartDuploIdList.Add(nDuploId)
Next
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId)
EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup)
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
' scrivo dati costruzione grezzo in gruppo di lavorazione
EgtSetInfo(nCurrMachGroup, MGR_RPT_BARLEN, dRawL)
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelPart.sMATERIAL)
' scrivo dati di tutti i pezzi
Dim dPosX As Double = WarehouseHelper.GetStartOffset()
' ciclo sui pezzi
For nIndex = 0 To nPartDuploIdList.Count - 1
' se non è primo, aggiungo offset tra barre standard
If nIndex <> 0 Then
dPosX += WarehouseHelper.GetOffset(BWType.BEAM)
End If
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & nIndex + 1, nPartDuploIdList(nIndex) & "," & DoubleToString(dPosX, 3))
' incremento posizione della sua lunghezza
dPosX += SelParts(nIndex).dL
Next
Dim BeamMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.GetLastMachGroup()
' eseguo script creazione grezzo
Dim nERR As Integer = 0
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
' elimino duplo e gruppo di lavorazione
For Each nDuploId In nPartDuploIdList
EgtErase(nDuploId)
Next
BeamMachGroup.DeleteMachGroup()
If File.Exists(sLogPath) Then
Dim LogFile As String() = File.ReadAllLines(sLogPath)
If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Else
MessageBox.Show(EgtMsg(61973), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
End If
' se nessun grezzo, rimetto tutti i pezzi invisibili
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then
Map.refProjectVM.BTLStructureVM.HideAll()
End If
Return
End If
For nDuploIndex = 0 To SelParts.Count - 1
EgtSetInfo(nPartDuploIdList(nDuploIndex), MGR_PRT_ROT, SelParts(nDuploIndex).nROTATED)
EgtSetInfo(nPartDuploIdList(nDuploIndex), MGR_PRT_FLIP, SelParts(nDuploIndex).nINVERTED)
Next
' aggiorno contatore pezzi usati in Prod
For Each SelPart In SelParts
SelPart.RefreshPartInProd()
Next
'aggiorno lista pezzi
BeamMachGroup.MyMachGroupM.RefreshPartList()
BeamMachGroup.MyMachGroupM.RefreshGroupData()
' aggiorno dati utilizzo barra
BeamMachGroup.UpdateUsage()
Core.ViewPanelVM.BWSetView(VT.ISO_SW, False)
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
Dim nPartDuploId As Integer = EgtDuploNew(SelPart.nPartId)
' scrivo dati in gruppo di lavorazione
Dim dPosX As Double = dKerf
Dim dPosY As Double = dKerf
EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELLEN, dRawL)
EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELWIDTH, dRawW)
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelPart.sMATERIAL)
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & 1,
nPartDuploId & "," & DoubleToString(dPosX, 3) & "," & DoubleToString(dPosY, 3) & ",0,0")
Dim WallMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(Map.refMachGroupPanelVM.MachGroupVMList.Count - 1)
' eseguo script creazione grezzo
If Not ExecWall(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False, False) Then
' elimino duplo e gruppo di lavorazione
EgtErase(nPartDuploId)
WallMachGroup.DeleteMachGroup()
If File.Exists(sLogPath) Then
Dim LogFile As String() = File.ReadAllLines(sLogPath)
If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Else
MessageBox.Show(EgtMsg(61973), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
End If
' se nessun grezzo, rimetto tutti i pezzi invisibili
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then
Map.refProjectVM.BTLStructureVM.HideAll(True)
End If
Return
End If
' scrivo dati pezzo
EgtSetInfo(nPartDuploId, MGR_PRT_POSX, dPosX)
EgtSetInfo(nPartDuploId, MGR_PRT_POSY, dPosY)
EgtSetInfo(nPartDuploId, MGR_PRT_ROT, SelPart.nROTATED)
EgtSetInfo(nPartDuploId, MGR_PRT_FLIP, SelPart.nINVERTED)
' aggiorno contatore pezzi usati in Prod
SelPart.RefreshPartInProd()
' aggiorno lista pezzi
WallMachGroup.MyMachGroupM.RefreshPartList()
WallMachGroup.MyMachGroupM.RefreshGroupData()
' aggiorno dati ultilizzo barra
WallMachGroup.UpdateUsage()
Core.ViewPanelVM.BWSetView(VT.TOP, False)
End If
EgtZoom(ZM.ALL)
Public Sub NewRawPartLast()
NewRawPart(True)
End Sub
#End Region ' NewRawPartAuto
#End Region ' NewRawPartLast
#Region "AddToRawPart"
@@ -943,7 +753,7 @@ Public Class LeftPanelVM
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
Dim WallMachGroup As MyMachGroupVM = SelMachGroup
' verifico spessore
If SelPart.dH < WallMachGroup.dH - EPS_SMALL OrElse SelPart.dH > WallMachGroup.dH + EPS_SMALL Then
If SelPart.Section <> WallMachGroup.Section Then
MessageBox.Show(EgtMsg(61868), EgtMsg(30007))
Return
End If
@@ -241,5 +241,4 @@ Public Class MyMachGroupPanelVM
#End Region ' METHODS
End Class
@@ -278,6 +278,38 @@ Public Class MyMachGroupVM
#End Region ' Beam
#Region "Wall"
Public Property sPosZ As String
Get
Return LenToString(MyMachGroupM.dPosZ, 3)
End Get
Set(value As String)
Dim dValue As Double
If StringToLen(value, dValue) Then
Dim nRawPartId As Integer = EgtGetFirstRawPart()
If dValue <> MyMachGroupM.dPosZ Then
Select Case nType
Case BWType.BEAM
' non utilizzato
Case BWType.WALL
' se operazione di spostamento in z ha successo
If True Then
EgtSetInfo(Id, MGR_RPT_PANELPOSZ, dValue)
EgtDraw()
MyMachGroupM.dPosZ = dValue
Else
NotifyPropertyChanged(NameOf(sPosZ))
End If
End Select
ResetCalcTotalMachGroup()
End If
End If
End Set
End Property
#End Region ' Wall
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTORS"
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.11.1")>
<Assembly: AssemblyFileVersion("2.4.11.1")>
<Assembly: AssemblyVersion("2.4.11.3")>
<Assembly: AssemblyFileVersion("2.4.11.3")>
@@ -250,4 +250,85 @@ Module WarehouseHelper
SectXMat.dW >= 0
End Function
Friend Function GetLastMaterial(SectXMat As SectionXMaterial) As SParam
Dim sWarehousePath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_MEDIUM_INI_FILE_NAME
'If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
' Dim ParamIndex As Integer = 1
' Dim sSxMValue As String = ""
' While EgtUILib.GetPrivateProfileString(S_BEAM_LIST, ParamIndex, String.Empty, sSxMValue, sWarehousePath) > 0
' Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' ' creo parametro
' Dim dW As Double = 0
' Dim dH As Double = 0
' Dim sMaterial As String = sSectXMatValues(2)
' StringToLen(sSectXMatValues(0), dW)
' StringToLen(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 = ""
' If EgtUILib.GetPrivateProfileString(S_BEAM, "L" & sSectXMatValues(3), String.Empty, sValue, sWarehousePath) Then
' End If
' End If
' End While
' If EgtUILib.GetPrivateProfileString(S_BEAM, "L" & ParamIndex, String.Empty, sValue, sWarehousePath) Then
' Dim sParamValues() As String = sValue.Split(","c)
' ' verifico numero minimo di parametri
' If sParamValues.Count < 2 Then Return Nothing
' ' cancello spazi
' For Index = 0 To sParamValues.Count - 1
' sParamValues(Index) = sParamValues(Index).Trim()
' Next
' ' ricavo SectionXMaterial tramite Beam_List
' If EgtUILib.GetPrivateProfileString(S_BEAM_LIST, sParamValues(0), String.Empty, sSxMValue, sWarehousePath) Then
' Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' ' creo parametro
' Dim dW As Double = 0
' Dim dH As Double = 0
' 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)
' 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)
' End If
' End If
'ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
' If EgtUILib.GetPrivateProfileString(S_WALL, "S" & ParamIndex, String.Empty, sValue, sWarehousePath) Then
' Dim sParamValues() As String = sValue.Split(","c)
' ' verifico numero minimo di parametri
' If sParamValues.Count >= 3 Then
' ' cancello spazi
' For Index = 0 To sParamValues.Count - 1
' sParamValues(Index) = sParamValues(Index).Trim()
' Next
' ' ricavo SectionXMaterial tramite Wall_List
' If EgtUILib.GetPrivateProfileString(S_WALL_LIST, sParamValues(0), String.Empty, sSxMValue, sWarehousePath) Then
' Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' ' creo parametro
' Dim dH As Double = 0
' Dim dW As Double = 0
' 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)
' 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)
' End If
' End If
' End If
'End If
End Function
End Module
@@ -1084,7 +1084,9 @@ Public Class WarehouseWndVM
Dim dH As Double = 0
StringToLen(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH)
SectXMatList.Add(New SectionXMaterial(dW, dH, 0, sSectXMatValues(2)))
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
sSectXMatIndex += 1
End While
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then