diff --git a/OmagOFFICE.vbproj b/OmagOFFICE.vbproj
index ffe78fd..cb486b8 100644
--- a/OmagOFFICE.vbproj
+++ b/OmagOFFICE.vbproj
@@ -293,6 +293,10 @@
SplitModeV.xaml
+
+ ChangeTableV.xaml
+
+ MultiSelectionV.xaml
@@ -499,6 +503,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
@@ -982,6 +990,9 @@
+
+
+ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe
diff --git a/OptionPanel/NestingTab/ChangeTableV.xaml b/OptionPanel/NestingTab/ChangeTableV.xaml
new file mode 100644
index 0000000..5b37181
--- /dev/null
+++ b/OptionPanel/NestingTab/ChangeTableV.xaml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OptionPanel/NestingTab/ChangeTableV.xaml.vb b/OptionPanel/NestingTab/ChangeTableV.xaml.vb
new file mode 100644
index 0000000..44970c4
--- /dev/null
+++ b/OptionPanel/NestingTab/ChangeTableV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class ChangeTableV
+
+End Class
diff --git a/OptionPanel/NestingTab/ChangeTableVM.vb b/OptionPanel/NestingTab/ChangeTableVM.vb
new file mode 100644
index 0000000..814e03c
--- /dev/null
+++ b/OptionPanel/NestingTab/ChangeTableVM.vb
@@ -0,0 +1,140 @@
+Imports System.ComponentModel
+Imports System.Windows.Forms
+Imports EgtUILib
+
+Public Class ChangeTableVM
+ Inherits VMBase
+ Private m_refChanTableV As ChangeTableV
+
+ Public Enum EnumDialogResult
+ OK
+ CANCEL
+ End Enum
+
+ Private m_MyDialogResult As EnumDialogResult
+ Public ReadOnly Property MyDialogResult As EnumDialogResult
+ Get
+ Return m_MyDialogResult
+ End Get
+ End Property
+
+ Private m_sTitle As String = "Seleziona tavola di lavoro"
+ Public ReadOnly Property sTitle As String
+ Get
+ Return m_sTitle
+ End Get
+ End Property
+
+ Private m_nSelectedTable As Integer = 0
+ Public ReadOnly Property nSelectedTable As Integer
+ Get
+ Return m_nSelectedTable
+ End Get
+ End Property
+
+ Private m_cmdOk As ICommand
+ Private m_cmdCancel As ICommand
+
+ Sub New(refV As ChangeTableV)
+ m_refChanTableV = refV
+ ' Procedo alla creazione della lista delle tavole disponibili
+ Initialized()
+ End Sub
+
+ Private m_CurrTableList As New List(Of TableToChange)
+ Public ReadOnly Property CurrTableList As List(Of TableToChange)
+ Get
+ Return m_CurrTableList
+ End Get
+ End Property
+
+ Private Sub Initialized()
+ ' recuepero l'inidce della tavola corrente
+ Dim nIndeXCurrTab As Integer = GetCurrentTable()
+ ' creo la lista delle tavole disponibili (attivo il bottone della tavola attualmente in uso)
+ For nInd As Integer = 0 To GetTableCount() - 1
+ m_CurrTableList.Add(New TableToChange("Tab", (nInd + 1), ((nInd + 1) = nIndeXCurrTab)))
+ Next
+ End Sub
+
+ Public ReadOnly Property OkCommand() As ICommand
+ Get
+ If m_cmdOk Is Nothing Then
+ m_cmdOk = New Command(AddressOf Ok)
+ End If
+ Return m_cmdOk
+ End Get
+ End Property
+
+ Public ReadOnly Property CancelCommand() As ICommand
+ Get
+ If m_cmdCancel Is Nothing Then
+ m_cmdCancel = New Command(AddressOf Cancel)
+ End If
+ Return m_cmdCancel
+ End Get
+ End Property
+
+ Private Sub Ok()
+ ' recupero l'indice della tavola impostata
+ For Each ItemTab As TableToChange In CurrTableList
+ If ItemTab.IsActive Then
+ m_nSelectedTable = ItemTab.nIndex
+ Exit For
+ End If
+ Next
+ m_MyDialogResult = EnumDialogResult.OK
+ ' procedo alla chiusura della finetra
+ m_refChanTableV.Close()
+ End Sub
+
+ Private Sub Cancel()
+ m_MyDialogResult = EnumDialogResult.CANCEL
+ ' procedo alla chiusura della finetra
+ m_refChanTableV.Close()
+ End Sub
+
+End Class
+
+Public Class TableToChange
+ Inherits VMBase
+
+ Private Property m_sName As String = "Tab"
+ Public ReadOnly Property sName As String
+ Get
+ Return m_sName
+ End Get
+ End Property
+
+ Public ReadOnly Property ImgTab As String
+ Get
+ Return "\Resources\NewIcons\table.png"
+ End Get
+ End Property
+
+ Private Property m_nIndex As Integer = 3
+ Public ReadOnly Property nIndex As Integer
+ Get
+ Return m_nIndex
+ End Get
+ End Property
+
+ Private m_bIsActive As Boolean = False
+ Public Property IsActive As Boolean
+ Get
+ Return m_bIsActive
+ End Get
+ Set(value As Boolean)
+ m_bIsActive = value
+ NotifyPropertyChanged("IsActive")
+ End Set
+ End Property
+
+ Public Sub New(Name As String, Ind As Integer, IsCurrent As Boolean)
+ m_sName = Name & " " & Ind.ToString
+ m_nIndex = Ind
+ m_bIsActive = IsCurrent
+ NotifyPropertyChanged("IsActive")
+ End Sub
+
+End Class
\ No newline at end of file
diff --git a/OptionPanel/NestingTab/NestingTabVM.vb b/OptionPanel/NestingTab/NestingTabVM.vb
index 6d8bd8c..a14737c 100644
--- a/OptionPanel/NestingTab/NestingTabVM.vb
+++ b/OptionPanel/NestingTab/NestingTabVM.vb
@@ -1,5 +1,6 @@
Imports EgtWPFLib5
Imports EgtUILib
+Imports OmagOFFICE.ChangeTableVM
Public Class NestingTabVM
Inherits VMBase
@@ -2204,6 +2205,8 @@ Public Class NestingTabVM
While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
+ Dim sNamePartId As String = String.Empty
+ EgtGetName(nPartId, sNamePartId)
Dim bPartInTable As Boolean = (EgtGetParent(nPartId) = GetRawId())
If EgtIsPart(nPartId) Or bPartInTable Then
Dim nStat As Integer = GDB_ST.ON_
@@ -2241,7 +2244,105 @@ Public Class NestingTabVM
' Drag possibile
m_bDrag = True
Exit While
- End If
+
+ Else
+ ' verifico se l'elemento selezionato è il nome della tavola
+ If EgtGetType(nId) = GDB_TY.EXT_TEXT AndAlso (sNamePartId = MAIN_TAB Or
+ sNamePartId = SECOND_TAB Or
+ sNamePartId = THIRD_TAB Or
+ sNamePartId = FORTH_TAB) Then
+
+ ' Apro la finestra per la selezione della tavola da usare
+ Dim ChgTbV As New ChangeTableV
+ Dim ChgTbVM As New ChangeTableVM(ChgTbV)
+ ChgTbV.DataContext = ChgTbVM
+ ChgTbV.ShowDialog()
+
+ ' se non è stata eseguita nessuna scelta esco dal ciclo
+ If ChgTbVM.MyDialogResult = EnumDialogResult.CANCEL Or ChgTbVM.nSelectedTable = 0 Then Exit While
+
+ ' recupero il nome della tavola corrente
+ Dim sOtherTab As String = GetTableName(ChgTbVM.nSelectedTable)
+
+ EgtChangeTable(sOtherTab, True)
+ 'm_CurrProjPage.AdjustAdditionalTable(True)
+ EgtSetMachineLook(MCH_LOOK.TAB)
+ ' aggiorno le lavorazioni
+ UpdateAllMachiningsToolpaths()
+ ' aggiorno i movimenti pezzi tra disposizioni
+ For nI As Integer = 1 To EgtGetPhaseCount()
+ EgtSetCurrPhase(nI)
+ Dim nDispId As Integer = EgtGetPhaseDisposition(nI)
+ SpecialApplyDisposition(nDispId, True)
+ Next
+ ' aggiorno posizionamento ventose per lavorazioni da sotto
+ UpdateVacuumsForDrip()
+ '' dichiaro tutto aggiornato
+ 'm_CurrProjPage.SetOrderMachiningFlag()
+ EgtSetCurrPhase(1)
+ ' aggiorno posizione pezzi in parcheggio
+ Dim nPPId As Integer = EgtGetFirstPart()
+ While nPPId <> GDB_ID.NULL
+ PackPartInStore(nPPId)
+ nPPId = EgtGetNextPart(nPPId)
+ End While
+ '' se prevista rotazione
+ 'If GetPrivateProfileInt(S_TABLE, K_CHANGETABWD, 0, m_MainWindow.GetMachIniFile()) = 2 Then
+ ' ' Dati tavola
+ ' Dim b3Tab As New BBox3d
+ ' EgtGetTableArea(1, b3Tab)
+ ' ' Box lastra
+ ' Dim b3OrigRaw As New BBox3d
+ ' GetRawBox(b3OrigRaw)
+ ' ' Allargo i limiti della tavola in tutte le fasi
+ ' Const TAB_OFFS As Double = 3000
+ ' For nI As Integer = 1 To EgtGetPhaseCount()
+ ' EgtSetCurrPhase(nI)
+ ' EgtSetTableAreaOffset(TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
+ ' Next
+ ' ' aggiorno posizionamento ventose per lavorazioni da sotto
+ ' UpdateVacuumsForDrip()
+ ' ' dichiaro tutto aggiornato
+ ' m_CurrProjPage.SetOrderMachiningFlag()
+ ' EgtSetCurrPhase(1)
+ ' ' Rotazione
+ ' Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
+ ' If Not RotateAllRawParts(dAngRot, False) Then
+ ' m_CurrProjPage.SetWarningMessage(EgtMsg(90339)) 'Rotazione impossibile
+ ' End If
+ ' ' Traslazione per riportare la lastra nella stessa posizione rispetto all'angolo BL che diveta TR e viceversa
+ ' Dim b3Raw As New BBox3d
+ ' GetRawBox(b3Raw)
+ ' Dim vtMove As Vector3d
+ ' If sOtherTab = SECOND_TAB Then
+ ' Dim vtDiffIni As Vector3d = b3OrigRaw.Min() - b3Tab.Min()
+ ' Dim vtDiffFin As Vector3d = b3Tab.Max() - b3Raw.Max()
+ ' vtMove = vtDiffFin - vtDiffIni
+ ' Else
+ ' Dim vtDiffIni As Vector3d = b3Tab.Max() - b3OrigRaw.Max()
+ ' Dim vtDiffFin As Vector3d = b3Raw.Min() - b3Tab.Min()
+ ' vtMove = -(vtDiffFin - vtDiffIni)
+ ' End If
+ ' vtMove.z = 0
+ ' MoveAllRawParts(vtMove)
+ ' ' Ripristino i limiti della tavola in tutte le fasi
+ ' For nI As Integer = 1 To EgtGetPhaseCount()
+ ' EgtSetCurrPhase(nI)
+ ' EgtSetTableAreaOffset(0, 0, 0, 0)
+ ' Next
+ ' EgtSetCurrPhase(1)
+ ' HideAllMachinings()
+ 'End If
+
+ ' visualizzazione
+ EgtZoom(ZM.ALL)
+ ' Elimino il datacontext della finsetra per la selezione della tavola
+ ChgTbVM = Nothing
+ Exit While
+
+ End If
+
+ End If
nId = EgtGetNextObjInSelWin()
End While
' Dati per drag
diff --git a/Resources/NewIcons/table.png b/Resources/NewIcons/table.png
new file mode 100644
index 0000000..54835e2
Binary files /dev/null and b/Resources/NewIcons/table.png differ
diff --git a/Utility/OmagOFFICEDictionary.xaml b/Utility/OmagOFFICEDictionary.xaml
index fd9656a..99bdce7 100644
--- a/Utility/OmagOFFICEDictionary.xaml
+++ b/Utility/OmagOFFICEDictionary.xaml
@@ -595,6 +595,12 @@
+
+