Compare commits

...

49 Commits

Author SHA1 Message Date
NicolaP 601471482a Insrite funzioni per la gestione del DragRettangle 2022-02-15 19:14:47 +01:00
NicolaP 8e112dc210 Inserito comando DragRettangle (gestione da configurazione) 2022-02-07 18:42:01 +01:00
NicolaP 007ad8439c Aggiornamento versione 2.4a3 2022-01-24 19:35:21 +01:00
NicolaP 1ffca8b52c Correzione gestiione VeinMatch per assemblato 3D 2022-01-24 19:34:55 +01:00
NicolaP c96251ba99 Nuova gestione SpliAuto, abilitato alzatine e frontalini 2022-01-24 12:18:34 +01:00
NicolaP 19e347412c Modifica visualizzazione comandi "DB WAterJet" 2022-01-24 12:08:07 +01:00
NicolaP 8ff06da714 Coorezione visualizzazione parametri InclinaLati 2022-01-24 12:05:08 +01:00
DarioS a18408724c OmagOFFICE :
- piccole correzioni.
2022-01-24 09:11:49 +01:00
NicolaP 701f1f2b87 Correzione gestione Quality nel file CamAuto, eliminato la qualità "" 2022-01-20 19:27:27 +01:00
NicolaP 2bb53b0b06 Merge commit 'f456c168274c47995a47f4cc3fc414137f27dac6' 2022-01-19 16:21:50 +01:00
NicolaP f456c16827 Aggiornamento di versione 2.4a2 2022-01-19 16:21:30 +01:00
NicolaP 334bfa68f7 Aggiornamento versione 2.4a2 2022-01-19 11:11:48 +01:00
NicolaP 51bbaf0bfe Merge branch 'Features/DB_WaterJet' into Features/Alz_And_Front 2022-01-17 18:39:35 +01:00
NicolaP 57cf143306 Gestioen Modifica Inizio/FIne da comandi 2022-01-17 18:38:28 +01:00
NicolaP a804043d2e Correzione gestione selezione lavorazioni 2022-01-13 19:42:00 +01:00
NicolaP 59865b140e Merge commit '959cbfb28bfec9c9b8013b700fe251a8084b6534' into Features/DB_WaterJet 2022-01-13 18:06:38 +01:00
RenzoL 959cbfb28b Selezione da interfaccia delle lavorazioni 2022-01-13 18:00:27 +01:00
RenzoL 6023318ff4 Gestione parametri macchina Waterjet 2022-01-13 12:32:34 +01:00
RenzoL d39c5bec47 Implementato flag FromDBWaterJet come in OmagCUT 2022-01-13 11:27:36 +01:00
RenzoL 54522e0733 Caricamento Materiali Waterjet riferito a WjMaterialList di EgtWPFLib5 2022-01-11 09:09:01 +01:00
RenzoL 11e3cfc7bc Aggiunta gestione Materiali e Qualità nel caso di macchina con WaterJet 2021-12-21 17:09:33 +01:00
RenzoL 114fc2dfa5 Spostato DB Waterjet in EgtWPFLib5 2021-12-10 12:54:24 +01:00
RenzoL 885495b13d DB Waterjet per OmagOFFICE completato 2021-12-10 12:12:57 +01:00
RenzoL c6c8d62e84 DB Waterjet WIP 2 2021-12-09 17:25:09 +01:00
RenzoL a72259b326 DB WaterJet WIP 1 2021-12-07 17:38:38 +01:00
NicolaP 08cd099947 Inizio gestione Kerf negativo 2021-12-06 18:41:00 +01:00
NicolaP 7dfb843b36 Gestione colori in fase di importazione DXF 2021-12-01 11:03:53 +01:00
NicolaP 108b075e4f Gestione VeinMatch e colore pezzi 2021-11-29 18:29:41 +01:00
DarioS ba0f00413d OmagOFFICE 2.3k5 :
- correzione per scalatura foto al cambio di spessore.
2021-11-17 07:34:09 +01:00
DarioS 2d39dcacc3 OmagOFFICE 2.3k1 :
- modifiche per escludere spessore sovratavola da scalatura foto fatte con CameraMng
- all'esportazione verso la macchina le foto vengono rese non più scalabili per lo spessore pezzo (come gli scan)
- corretta scrittura dati in interfaccia per problema decimali che falsano la posizione del cursore.
2021-11-16 06:37:37 +01:00
NicolaP f4887ab587 Merge branch 'Features/Alz_And_Front' 2021-11-15 18:11:04 +01:00
NicolaP 6cb04a1216 Migliorata visualizzazione dei dati in SideAngle 2021-11-15 18:09:59 +01:00
NicolaP 8dcebea39c Nuova gestioene delle alzatine 2021-11-15 16:23:45 +01:00
NicolaP 5b84a0cefe Correzione pagina SideAngle per modalita SideMode=0 2021-11-15 16:23:06 +01:00
NicolaP f0d08c562e Modifica gestione alzatine 2021-11-11 19:32:15 +01:00
NicolaP 0e77455500 Gestione alzatine e frontalini 2021-11-04 19:49:53 +01:00
NicolaP d1247d5c7e Costruzione delle alette, da gestire la riapertutra della pagina 2021-11-03 19:32:51 +01:00
NicolaP bc06203edd Iniaziata gestione delle CheckBox per le Alette 2021-10-29 17:05:26 +02:00
NicolaP c768b80802 Gestione pulsante Back e visualizzazione dati piano cucina 2021-10-29 15:39:53 +02:00
NicolaP ae204b7ee2 Inizio nuova gestione pulsante Back per compo interni e alzatine 2021-10-28 18:19:31 +02:00
NicolaP d21067988c Aggiornamento veriosne 2.3j3 2021-10-21 14:57:17 +02:00
NicolaP 9c503cdb5c Correzione aggiornamento di versione 2021-10-11 19:14:54 +02:00
NicolaP d20e2bf2ec Correzione gestione nuovi materiali 2021-10-11 19:05:39 +02:00
NicolaP 7ec1ffa529 Fixed comando per salvataggio con nome 2021-09-23 10:57:31 +02:00
NicolaP 4128fd8713 Modificata conversione delle quote in RawPart 2021-09-23 10:51:15 +02:00
NicolaP 87d09b3f19 Correzione gestione dati Kerf e Spessore in Gezzo 2021-09-20 19:32:34 +02:00
NicolaP 216b0a37b6 Corrrezione nome variabilie 2021-09-20 18:32:02 +02:00
NicolaP 0f484d2c46 Gestione lettura licenza 2021-09-17 19:42:45 +02:00
NicolaP faf9b070da Cambio versione per allineare i programmi 2021-09-16 19:05:00 +02:00
42 changed files with 3688 additions and 257 deletions
+20
View File
@@ -0,0 +1,20 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Public Class AlzAndFrontVM
Inherits VMBase
#Region "CONSTRUCTOR"
Sub New()
End Sub
#End Region ' CONSTRUCTOR
End Class
+137
View File
@@ -0,0 +1,137 @@
<UserControl x:Class="AlzAndFrontV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Visibility="{Binding Legenda_Visibility}"
Grid.Row="0"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition Width="0.6*"/>
<ColumnDefinition Width="0.6*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding FirstColumnMsg}" Grid.Column="1" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding SecondColumnMsg}" Grid.Column="2" HorizontalAlignment="Center"/>
</Grid>
<EgtWPFLib5:EgtScrollViewer VerticalScrollBarVisibility="Auto"
Focusable="false"
Padding="3"
Grid.Row="1">
<ItemsControl ItemsSource="{Binding SideEntityList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sEntityName}"
VerticalAlignment="Center"/>
<!--Drip e Engrave-->
<UniformGrid Grid.Column="1" Columns="3" Rows="1">
<CheckBox IsChecked="{Binding bIsChecked}"
Grid.Column="1"
Visibility="{Binding Check_Visibility}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox Text="{Binding GrphShortStart}"
Visibility="{Binding Value_Visibility_DE}"
VerticalAlignment="Center"
Margin="0,0,2.5,0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding GrphShortEnd}"
Visibility="{Binding Value_Visibility_DE}"
VerticalAlignment="Center"
Margin="2.5,0,0,0"/>
</UniformGrid>
<!--SideAngle-->
<UniformGrid Grid.Column="1" Columns="2" Rows="1">
<EgtWPFLib5:EgtTextBox Text="{Binding GrphSideAngle}"
Visibility="{Binding Value_Visibility}"
VerticalAlignment="Center"
Margin="0,0,2.5,0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding GrphSideHeel}"
Visibility="{Binding Value_Visibility}"
VerticalAlignment="Center"
Margin="2.5,0,0,0"/>
</UniformGrid>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</EgtWPFLib5:EgtScrollViewer>
<Grid Visibility="{Binding Parameter1_Visibility}"
Grid.Row="2"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition Width="1.2*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Parameter1Msg}" Grid.Row="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter1}"
Grid.Column="1"/>
</Grid>
<Grid Visibility="{Binding Parameter1_Visibility}"
Grid.Row="3"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition Width="1.2*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Parameter2Msg}" Grid.Row="1"/>
<EgtWPFLib5:EgtTextBox Visibility="{Binding Parameter2_Visibility}"
Text="{Binding Parameter2}"
Grid.Column="1"/>
<UniformGrid Grid.Column="1" Columns="2"
Visibility="{Binding Parameter2ab_Visibility}">
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter2a}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter2b}"/>
</UniformGrid>
</Grid>
<Grid Visibility="{Binding Parameter23_Visibility}"
Grid.Row="4"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition Width="1.2*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Parameter3Msg}" Grid.Row="2"/>
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter3}"
Grid.Column="1"/>
</Grid>
<Grid Visibility="{Binding Parameter4_Visibility}"
Grid.Row="5"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition Width="1.2*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Parameter4Msg}" Grid.Row="2"/>
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter4}"
Grid.Column="1"/>
</Grid>
</Grid>
</UserControl>
+13
View File
@@ -0,0 +1,13 @@
Public Class AlzAndFrontV
Private WithEvents m_AlzAndFrontVM As AlzAndFrontVM
Sub New(AlzAndFrontVM As AlzAndFrontVM)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = AlzAndFrontVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_AlzAndFrontVM = AlzAndFrontVM
End Sub
End Class
+34 -3
View File
@@ -300,9 +300,16 @@ Public Class CompoListPageVM
m_BackVisibility = Visibility.Visible
m_SideEntity_Visibility = Visibility.Collapsed
Else
LoadInternalCompoList()
m_BackVisibility = Visibility.Visible
m_SideEntity_Visibility = Visibility.Visible
' differenzio il caso di AlzAndFront
If CompoWindowMap.refCompoWindowVM.m_bSelAlzAndFront Then
' carico la pagina per la definizione delle componenti Alette
m_BackVisibility = Visibility.Visible
m_SideEntity_Visibility = Visibility.Hidden
Else
LoadInternalCompoList()
m_BackVisibility = Visibility.Visible
m_SideEntity_Visibility = Visibility.Visible
End If
End If
NotifyPropertyChanged("BackVisibility")
NotifyPropertyChanged("SideEntity_Visibility")
@@ -449,8 +456,32 @@ Public Class CompoListPageVM
If IsNothing(CompoWindowMap.refCompoWindowVM.m_SelCompo) Then
CompoWindowMap.refCompoWindowVM.m_SelCompoFamily = Nothing
InitCompoListPage()
ElseIf CompoWindowMap.refCompoWindowVM.m_bSelInternalCompo Then
'CompoWindowMap.refCompoWindowVM.CompoPage = CompoWindowVM.CompoPageOpt.PARAM
CompoWindowMap.refCompoWindowVM.SetCompoPage(CompoWindowVM.CompoPageOpt.PARAM)
CompoWindowMap.refCompoParamPageVM.MyInitCompoParamPage()
Dim PartId As Integer = EgtGetFirstPart()
EgtSetStatus(EgtGetFirstNameInGroup(PartId, CompoParamPageVM.COMPO_LAYER_AUX), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, CompoParamPageVM.COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, CompoParamPageVM.COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
EgtZoom(ZM.ALL)
CompoWindowMap.refCompoWindowVM.m_bSelInternalCompo = False
' aggiorno la lista dei parametri da visualizzare a schermo
CompoWindowMap.refCompoParamPageVM.SetCompoParamList(CompoWindowMap.refCompoParamPageVM.CompoParamOutLoopList)
' disbilito la modifica del componente piano cucicna/bagno corrente
For Each Item In CompoWindowMap.refCompoParamPageVM.CompoParamList
If TypeOf (Item) Is TextParamItem Then
Dim TxtParam As TextParamItem = DirectCast(Item, TextParamItem)
TxtParam.IsEnable = False
ElseIf TypeOf (Item) Is CheckParamItem Then
Dim ChkParam As CheckParamItem = DirectCast(Item, CheckParamItem)
ChkParam.IsEnable = False
End If
Next
CompoWindowMap.refCompoParamPageVM.ListParamIsEnable = False
Else
CompoWindowMap.refCompoWindowVM.m_SelCompo = Nothing
CompoWindowMap.refCompoParamPageVM.ListParamIsEnable = True
InitCompoListPage()
EgtNewFile()
EgtDraw()
+2 -1
View File
@@ -307,7 +307,8 @@ Public Class CompoManagerVM
' Passo al contesto principale
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
' Inserisco il componente nel DB geometrico principale
CompoWindowMap.refCompoWindowVM.MakeInsert(InsNbr, m_PartName)
'CompoWindowMap.refCompoWindowVM.MakeInsert(InsNbr, m_PartName)
CompoWindowMap.refCompoWindowVM.MakeMultipleInsert(InsNbr, m_PartName)
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
' Elimino riferimento con delegato
@@ -89,7 +89,7 @@
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Value}"/>
Text="{Binding Value}" IsEnabled="{Binding IsEnable}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type OmagOFFICE:CheckParamItem}">
@@ -100,7 +100,7 @@
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}"/>
<CheckBox Grid.Column="1"
IsChecked="{Binding Value}"
IsChecked="{Binding Value}" IsEnabled="{Binding IsEnable}"
HorizontalAlignment="Center"/>
</Grid>
</DataTemplate>
@@ -123,6 +123,11 @@
Command="{Binding InternalCommand}"
Visibility="{Binding Internal_Visibility}"
Style="{StaticResource CompoWindow_Button}"/>
<Button Content="{Binding AlzAndFrontMsg}"
Command="{Binding AlzAndFrontCommand}"
Visibility="{Binding AlzAndFront_Visibility}"
Style="{StaticResource CompoWindow_Button}"/>
<UniformGrid Columns="2"
Margin="0,0,0,5"
+280 -16
View File
@@ -23,12 +23,35 @@ Public Class CompoParamPageVM
Friend Const COMPO_LAYER_QUOTATURE As String = "Quotature"
Friend Const COMPO_LAYER_ETICHETTE As String = "Etichette"
' questo parametro diventa False in uscita dalla pagine Alzatine o CompoInterni
Public ListParamIsEnable As Boolean = True
Private m_SideEntityControlVM As SideEntityControlVM
Private m_CompoParamList As New ObservableCollection(Of CompoParamItem)
Public ReadOnly Property CompoParamList As ObservableCollection(Of CompoParamItem)
Get
Return m_CompoParamList
End Get
End Property
Public Sub SetCompoParamList(CurrList As ObservableCollection(Of CompoParamItem))
m_CompoParamList.Clear()
' eseguo una copia dei parametri da una lista all'altra
For Each Item In CurrList
Dim NewCompoItem As CompoParamItem = Item
m_CompoParamList.Add(NewCompoItem)
Next
NotifyPropertyChanged("CompoParamList")
End Sub
' lista dei parametri del piano cucina (da mostrare quando eseguo la funzione Back)
Private m_CompoParamOutLoopList As New ObservableCollection(Of CompoParamItem)
Public ReadOnly Property CompoParamOutLoopList As ObservableCollection(Of CompoParamItem)
Get
Return m_CompoParamOutLoopList
End Get
End Property
Private m_Internal_Visibility As Visibility
Public Property Internal_Visibility As Visibility
@@ -41,6 +64,19 @@ Public Class CompoParamPageVM
End Set
End Property
Private m_AlzAndFront_Visibility As Visibility
Public Property AlzAndFront_Visibility As Visibility
Get
'' !!!! Temporaneamente in attesa di completamento Frontalini e alzatine !!!!
'Return Visibility.Collapsed
Return m_AlzAndFront_Visibility
End Get
Set(value As Visibility)
m_AlzAndFront_Visibility = value
NotifyPropertyChanged("AlzAndFront_Visibility")
End Set
End Property
Private m_AddRemove_Visibility As Visibility
Public Property AddRemove_Visibility As Visibility
Get
@@ -129,7 +165,7 @@ Public Class CompoParamPageVM
End Set
End Property
Private m_SideEntityControlVM As SideEntityControlVM
#Region "SideAngle"
Private m_SideAngle_IsChecked As Boolean
Public Property SideAngle_IsChecked As Boolean
@@ -172,9 +208,17 @@ Public Class CompoParamPageVM
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
' Attivo layer delle misure
Dim PartId As Integer = EgtGetFirstPart()
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
If Not ListParamIsEnable Then
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
Else
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
End If
End If
NotifyPropertyChanged("SideAngle_IsChecked")
EgtZoom(ZM.ALL)
@@ -192,6 +236,10 @@ Public Class CompoParamPageVM
End Set
End Property
#End Region ' SideAngle
#Region "FiloTop"
Private m_FiloTop_IsChecked As Boolean
Public Property FiloTop_IsChecked As Boolean
Get
@@ -233,9 +281,17 @@ Public Class CompoParamPageVM
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
' Attivo layer delle misure
Dim PartId As Integer = EgtGetFirstPart()
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
If Not ListParamIsEnable Then
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
Else
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
End If
End If
NotifyPropertyChanged("FiloTop_IsChecked")
EgtZoom(ZM.ALL)
@@ -253,6 +309,10 @@ Public Class CompoParamPageVM
End Set
End Property
#End Region ' FiloTop
#Region "Drip"
Private m_Drip_IsChecked As Boolean
Public Property Drip_IsChecked As Boolean
Get
@@ -293,9 +353,17 @@ Public Class CompoParamPageVM
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
' Attivo layer delle misure
Dim PartId As Integer = EgtGetFirstPart()
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
If Not ListParamIsEnable Then
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
Else
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
End If
End If
NotifyPropertyChanged("Drip_IsChecked")
EgtZoom(ZM.ALL)
@@ -313,6 +381,10 @@ Public Class CompoParamPageVM
End Set
End Property
#End Region ' Drip
#Region "Engrave"
Private m_Engrave_IsChecked As Boolean
Public Property Engrave_IsChecked As Boolean
Get
@@ -339,8 +411,13 @@ Public Class CompoParamPageVM
CompoWindowMap.refCompoSceneHostV.CompoScene,
SideEntityControlVM.ModeOpt.ENGRAVE)
SideEntityControl = New SideEntityControlV(m_SideEntityControlVM)
If m_SideEntityControlVM.SideEntityList.Count < 1 Then
' eventulmente stamnpare messaggio!
' OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
' OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Lavorazioni non disponibile", MSG_TYPE.WARNING)
End If
Else
SideAngle_IsEnabled = True
SideAngle_IsEnabled = True
Drip_IsEnabled = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(CurrentMachine.sCurrDripSaw)
FiloTop_IsEnabled = True
@@ -354,9 +431,17 @@ Public Class CompoParamPageVM
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
' Attivo layer delle misure
Dim PartId As Integer = EgtGetFirstPart()
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
If Not ListParamIsEnable Then
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
Else
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
End If
End If
NotifyPropertyChanged("Engrave_IsChecked")
EgtZoom(ZM.ALL)
@@ -374,6 +459,8 @@ Public Class CompoParamPageVM
End Set
End Property
#End Region ' Engrave
Private m_SideEntityControl As SideEntityControlV
Public Property SideEntityControl As SideEntityControlV
Get
@@ -385,6 +472,8 @@ Public Class CompoParamPageVM
End Set
End Property
#Region "Messages"
Public ReadOnly Property InternalMsg As String
@@ -392,6 +481,12 @@ Public Class CompoParamPageVM
Return EgtMsg(MSG_COMPONENTPAGEUC + 47)
End Get
End Property
Public ReadOnly Property AlzAndFrontMsg As String
Get
Return "Alzatine e frontalini"
End Get
End Property
Private m_AddMsg As String
Public Property AddMsg As String
Get
@@ -432,6 +527,7 @@ Public Class CompoParamPageVM
' definizione comandi
Private m_cmdInternal As ICommand
Private m_cmdAlzAndFront As ICommand
Private m_cmdAdd As ICommand
Private m_cmdCancel As ICommand
Private m_cmdBack As ICommand
@@ -471,7 +567,7 @@ Public Class CompoParamPageVM
CompoWindowMap.refCompoSceneHostV.CompoScene.ZoomAll()
' Imposto messaggio aggiungi
AddMsg = EgtMsg(MSG_COMPONENTPAGEUC + 48)
' altrimenti se è un compo interno
' altrimenti se è un compo interno
Else
If Not bOk Then
EgtOutLog("Error in Component " & CompoWindowMap.refCompoWindowVM.m_SelInternalCompo.LuaPath)
@@ -480,7 +576,7 @@ Public Class CompoParamPageVM
' Imposto messaggio conferma
AddMsg = EgtMsg(MSG_COMPONENTPAGEUC + 50)
End If
' leggo variabili e aggiorno griglia
' leggo variabili e aggiorno griglia
ReadAndShowVariables()
' visualizzo/nascondo bottoni
If IsNothing(CompoWindowMap.refCompoWindowVM.m_SelInternalCompo) Then
@@ -491,8 +587,60 @@ Public Class CompoParamPageVM
EgtLuaGetGlobBoolVar(LUA_CMP_WITHINT, bHasInternalCompo)
Internal_Visibility = If(bHasInternalCompo, Visibility.Visible, Visibility.Collapsed)
SideEntity_Visibility = Visibility.Visible
' verifico che esista la configurazione per le alzatine e i frontalini
Dim sVariable As String = String.Empty
Dim bEnableAlzAndFront As Boolean = GetMainPrivateProfileString("Alz&Front", "Alz&Front", "", sVariable) <> 0
' verifio se abilitare il bottone per inserire le Alz&Front
Dim sCMPName As String = String.Empty
If EgtLuaGetGlobStringVar("CMP.Nome", sCMPName) Then
If bEnableAlzAndFront And sCMPName.StartsWith("PCucina") Or sCMPName.StartsWith("PBagno") Then
AlzAndFront_Visibility = Visibility.Visible
Else
AlzAndFront_Visibility = Visibility.Collapsed
End If
End If
Else
Internal_Visibility = Visibility.Collapsed
AlzAndFront_Visibility = Visibility.Collapsed
AddRemove_Visibility = Visibility.Visible
Back_Visibility = Visibility.Collapsed
SideEntity_Visibility = Visibility.Collapsed
End If
' porto in CompoParam il CompoManager
CompoWindowMap.refCompoListPageVM.CompoManagerControl = Nothing
CompoManagerControl = CompoWindowMap.refCompoWindowVM.CompoManagerV
' lancio inizializzazione CompoManager
CompoWindowMap.refCompoManagerVM.InitCompoManager()
End Sub
' gestione speciale per componenti piani cucina e piani bagno
Friend Sub MyInitCompoParamPage()
' Pulisco l'ambiente lua
ResetLuaVariables()
' leggo variabili e aggiorno griglia
ReadAndShowVariables()
' visualizzo/nascondo bottoni
If IsNothing(CompoWindowMap.refCompoWindowVM.m_SelInternalCompo) Then
AddRemove_Visibility = Visibility.Collapsed
Back_Visibility = Visibility.Visible
Internal_Visibility = Visibility.Visible
' verifico che esista la configurazione per le alzatine e i frontalini
Dim sVariable As String = String.Empty
Dim bEnableAlzAndFront As Boolean = GetMainPrivateProfileString("Alz&Front", "Alz&Front", "", sVariable) <> 0
AlzAndFront_Visibility = If(bEnableAlzAndFront, Visibility.Visible, Visibility.Collapsed)
SideEntity_Visibility = Visibility.Visible
' verifio se abilitare il bottone per inserire le Alz&Front
Dim sCMPName As String = String.Empty
If EgtLuaGetGlobStringVar("CMP.Nome", sCMPName) Then
If bEnableAlzAndFront And sCMPName.StartsWith("PCucina") Or sCMPName.StartsWith("PBagno") Then
AlzAndFront_Visibility = Visibility.Visible
Else
AlzAndFront_Visibility = Visibility.Collapsed
End If
End If
Else
Internal_Visibility = Visibility.Collapsed
AlzAndFront_Visibility = Visibility.Collapsed
AddRemove_Visibility = Visibility.Visible
Back_Visibility = Visibility.Collapsed
SideEntity_Visibility = Visibility.Collapsed
@@ -620,7 +768,14 @@ Public Class CompoParamPageVM
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Sub Internal(ByVal param As Object)
' creo una copia della lista dei parametri del piano cucina
m_CompoParamOutLoopList.Clear()
For i As Integer = 0 To m_CompoParamList.Count - 1
m_CompoParamOutLoopList.Add(m_CompoParamList(i))
Next
CompoWindowMap.refCompoWindowVM.m_SelInternalCompo = Nothing
CompoWindowMap.refCompoWindowVM.m_bSelInternalCompo = True
CompoWindowMap.refCompoWindowVM.m_bSelAlzAndFront = False
CompoWindowMap.refCompoWindowVM.CompoPage = CompoWindowVM.CompoPageOpt.LIST
' Nascondo layer etichette e quotature
Dim Pz As Integer = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
@@ -632,6 +787,61 @@ Public Class CompoParamPageVM
#End Region ' InternalCommand
#Region "AlzAndFrontCommand"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property AlzAndFrontCommand() As ICommand
Get
If m_cmdAlzAndFront Is Nothing Then
m_cmdAlzAndFront = New Command(AddressOf AlzAndFront)
End If
Return m_cmdAlzAndFront
End Get
End Property
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Sub AlzAndFront(ByVal param As Object)
' creo una copia della lista dei parametri del piano cucina
m_CompoParamOutLoopList.Clear()
For i As Integer = 0 To m_CompoParamList.Count - 1
m_CompoParamOutLoopList.Add(m_CompoParamList(i))
Next
CompoWindowMap.refCompoWindowVM.m_SelInternalCompo = Nothing
CompoWindowMap.refCompoWindowVM.m_bSelInternalCompo = False
CompoWindowMap.refCompoWindowVM.m_bSelAlzAndFront = True
' disabilito i comandi seguenti
m_SideAngle_IsEnabled = False
NotifyPropertyChanged("SideAngle_IsEnabled")
m_Drip_IsEnabled = False
NotifyPropertyChanged("Drip_IsEnabled")
m_Engrave_IsEnabled = False
NotifyPropertyChanged("Engrave_IsEnabled")
m_FiloTop_IsEnabled = False
NotifyPropertyChanged("FiloTop_IsEnabled")
Measure_Visibility = Visibility.Collapsed
CompoManagerControl_Visibility = Visibility.Collapsed
Back_Visibility = Visibility.Visible
' Nascondo layer etichette e quotature del disegno corrente
Dim Pz As Integer = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
EgtSetStatus(EgtGetFirstNameInGroup(Pz, "LayAux"), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(Pz, "Etichette"), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(Pz, "Quotature"), GDB_ST.OFF)
' Imposto il loop interno
CompoWindowMap.refCompoSceneHostV.SelectedLayer = EgtGetFirstNameInGroup(EgtGetFirstPart(), NAME_OUTLOOP)
m_SideEntityControlVM = New SideEntityControlVM(SideEntityControlVM.CallingWindowOpt.COMPO,
CompoWindowMap.refCompoSceneHostV.CompoScene,
SideEntityControlVM.ModeOpt.ALZANDFRONT)
SideEntityControl = New SideEntityControlV(m_SideEntityControlVM)
EgtDraw()
End Sub
#End Region ' AlzAndFrontCommand
#Region "AddCommand"
' Returns a command that manage the MainWindow_Unloaded command
@@ -726,13 +936,54 @@ Public Class CompoParamPageVM
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Sub Back(ByVal param As Object)
' se sto uscendo dalla pagina delle alzatine (rimanendo nel componente del piano cucina/bagno)
If CompoWindowMap.refCompoWindowVM.m_bSelAlzAndFront Then
SideAngle_IsEnabled = True
Engrave_IsEnabled = True
Drip_IsEnabled = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(CurrentMachine.sCurrDripSaw)
If Not IsNothing(m_SideEntityControlVM) Then
m_SideEntityControlVM.Close()
m_SideEntityControlVM = Nothing
SideEntityControl = Nothing
End If
Measure_Visibility = Visibility.Visible
CompoManagerControl_Visibility = Visibility.Visible
Back_Visibility = Visibility.Visible
' Deseleziono tutto
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
' Attivo layer delle misure
Dim PartId As Integer = EgtGetFirstPart()
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
EgtZoom(ZM.ALL)
CompoWindowMap.refCompoWindowVM.m_bSelAlzAndFront = False
' aggiorno la lista dei parametri da visualizzare a schermo
SetCompoParamList(CompoParamOutLoopList)
' disbilito la modifica del componente piano cucicna/bagno corrente
For Each Item In CompoParamList
If TypeOf (Item) Is TextParamItem Then
Dim TxtParam As TextParamItem = DirectCast(Item, TextParamItem)
TxtParam.IsEnable = False
ElseIf TypeOf (Item) Is CheckParamItem Then
Dim ChkParam As CheckParamItem = DirectCast(Item, CheckParamItem)
ChkParam.IsEnable = False
End If
Next
ListParamIsEnable = False
Return
End If
' se sto uscendo dalla pagina dei componenti
If CompoWindowMap.refCompoWindowVM.m_SelCompoFamily Is CompoWindowMap.refCompoWindowVM.m_SelCompo Then
CompoWindowMap.refCompoWindowVM.m_SelCompoFamily = Nothing
End If
ListParamIsEnable = True
CompoWindowMap.refCompoWindowVM.m_SelCompo = Nothing
CompoWindowMap.refCompoWindowVM.CompoPage = CompoWindowVM.CompoPageOpt.LIST
EgtNewFile()
EgtDraw()
End Sub
#End Region ' BackCommand
@@ -742,6 +993,7 @@ Public Class CompoParamPageVM
End Class
Public Class CompoParamItem
Inherits VMBase
Public Enum ParamType As Integer
BOOL = 1
@@ -774,6 +1026,18 @@ Public Class CompoParamItem
End Get
End Property
Public m_IsEnable As Boolean = True
Public Property IsEnable As Boolean
Get
Return m_IsEnable
End Get
Set(value As Boolean)
m_IsEnable = value
NotifyPropertyChanged("IsEnable")
End Set
End Property
Sub New(nInd As Integer, sName As String, nType As ParamType)
m_nInd = nInd
m_sName = sName
+230
View File
@@ -28,6 +28,9 @@ Public Class CompoWindowVM
Friend m_SelCompo As CompoItem = Nothing
Friend m_SelInternalCompo As CompoItem = Nothing
Friend m_bSelAlzAndFront As Boolean = False
Friend m_bSelInternalCompo As Boolean = False
Private m_sCompoDir As String = String.Empty
Friend m_bDrawOk As Boolean = False
@@ -62,6 +65,15 @@ Public Class CompoWindowVM
NotifyPropertyChanged("CompoPageControl")
End Set
End Property
' utilizzato per forzare il cambio pagina senza passare dall'inizializzazione della componente
Public Sub SetCompoPage(PageOpt As CompoPageOpt)
If PageOpt = CompoPageOpt.LIST Then
m_CompoPage = CompoPageOpt.LIST
Else
m_CompoPage = CompoPageOpt.PARAM
End If
NotifyPropertyChanged("CompoPageControl")
End Sub
Private m_CompoListPageV As CompoListPageV
Private m_CompoParamPageV As CompoParamPageV
@@ -340,6 +352,224 @@ Public Class CompoWindowVM
Return True
End Function
Friend Function MakeMultipleInsert(ByVal nNbr As Integer, sName As String) As Boolean
Dim InsertColor As Color3d = CompoColor(IniFile.m_sIniFile)
' Imposto il contesto corrente
EgtSetCurrentContext(CompoWindowMap.refCompoSceneHostV.CompoScene.GetCtx())
Dim Pz As Integer = -1
Dim NxtPz As Integer = -1
' Cancello layer regioni per selezione buchi
Pz = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
While Pz <> -1
' imposto il contesto corrente
EgtSetCurrentContext(CompoWindowMap.refCompoSceneHostV.CompoScene.GetCtx())
' cerco un altro pezzo nell'elenco
NxtPz = EgtGetNextPart(Pz)
Dim SelectRegion As Integer = EgtGetFirstNameInGroup(Pz, "SelectRegion")
EgtErase(SelectRegion)
' Cancello layer etichette, quotatura,ausiliario e box
EgtErase(EgtGetFirstNameInGroup(Pz, "LayAux"))
EgtErase(EgtGetFirstNameInGroup(Pz, "Etichette"))
EgtErase(EgtGetFirstNameInGroup(Pz, "Quotature"))
EgtErase(EgtGetFirstNameInGroup(Pz, "Box"))
' Cancello layer etichette dei componenti interni (buchi)
Dim nHLId As Integer = EgtGetFirstNameInGroup(Pz, "HoleLabels")
While nHLId <> GDB_ID.NULL
EgtErase(nHLId)
nHLId = EgtGetFirstNameInGroup(Pz, "HoleLabels")
End While
' Attivo visualizzazione misura
Dim nRegLayId As Integer = EgtGetFirstNameInGroup(Pz, NAME_REGION)
Dim nId As Integer = EgtGetFirstInGroup(nRegLayId)
While nId <> GDB_ID.NULL
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
EgtSetStatus(nId, GDB_ST.ON_)
End If
nId = EgtGetNext(nId)
End While
' Calcolo dimensione ingombro Pezzo tramite OutLoop
Dim nOutLoopLayer = EgtGetFirstNameInGroup(Pz, NAME_OUTLOOP)
Dim b3Part As New BBox3d
EgtGetBBoxGlob(nOutLoopLayer, GDB_BB.STANDARD, b3Part)
' Muovo la regione in Z per evitare problemi in visualizzazione
EgtMove(nRegLayId, New Vector3d(0, 0, DELTAZ_REG), GDB_RT.GLOB)
' Se pezzo con dati TRF
If m_bTrfData Then
' Nome da dati Trf
Dim nTextId = EgtGetFirstInGroup(nRegLayId)
While nTextId <> GDB_ID.NULL
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
Dim sText As String = CompoWindowMap.refCompoManagerVM.sTrfOrderCode & "-" & CompoWindowMap.refCompoManagerVM.sTrfOrderDesc
Dim sText2 As String = CompoWindowMap.refCompoManagerVM.sTrfMatCode & "-" & CompoWindowMap.refCompoManagerVM.sTrfSurfCode
Dim sText3 As String = LenToString(b3Part.DimX(), 0) & " x " & LenToString(b3Part.DimY(), 0) & " x " & LenToString(CompoWindowMap.refCompoManagerVM.dTrfThickness, 0)
Dim dRatio As Double = Math.Max(b3Part.DimX(), b3Part.DimY()) / Math.Min(b3Part.DimX(), b3Part.DimY())
If dRatio < 5 Then
sText = sText & "<br/>" & sText2 & "<br/>" & sText3
Else
sText = sText & " " & sText2 & " " & sText3
End If
EgtModifyText(nTextId, sText)
Dim ptCen As Point3d
EgtCenterPoint(nTextId, ptCen)
Dim b3Text As New BBox3d
EgtGetBBoxGlob(nTextId, GDB_BB.STANDARD, b3Text)
Dim dCoeff As Double = Math.Min(b3Part.DimX() / b3Text.DimX(), b3Part.DimY() / b3Text.DimY()) / 1.25
If dCoeff < 1 Then EgtScale(nTextId, New Frame3d(ptCen), dCoeff, dCoeff, dCoeff)
Exit While
End If
nTextId = EgtGetNext(nTextId)
End While
' Info di pezzo da dati Trf
EgtSetInfo(Pz, "OC", CompoWindowMap.refCompoManagerVM.sTrfOrderCode)
EgtSetInfo(Pz, "OD", CompoWindowMap.refCompoManagerVM.sTrfOrderDesc)
EgtSetInfo(Pz, "PC", CompoWindowMap.refCompoManagerVM.sTrfPartCode)
EgtSetInfo(Pz, "MT", CompoWindowMap.refCompoManagerVM.sTrfMatCode)
EgtSetInfo(Pz, "SRF", CompoWindowMap.refCompoManagerVM.sTrfSurfCode)
EgtSetInfo(Pz, "L", DoubleToString(b3Part.DimX(), 1))
EgtSetInfo(Pz, "W", DoubleToString(b3Part.DimY(), 1))
EgtSetInfo(Pz, "T", CompoWindowMap.refCompoManagerVM.dTrfThickness)
EgtSetInfo(Pz, "V1", DoubleToString(b3Part.DimX(), 1))
EgtSetInfo(Pz, "V2", DoubleToString(b3Part.DimY(), 1))
' Se altrimenti pezzo con dati Csv
ElseIf m_bCsvData Then
' Nome del pezzo
EgtSetName(Pz, CompoWindowMap.refCompoManagerVM.sCsvName)
' Dati Csv
EgtSetInfo(Pz, INFO_CSV_PART, CompoWindowMap.refCompoManagerVM.sCsvName)
EgtSetInfo(Pz, INFO_CSV_ORD, CompoWindowMap.refCompoManagerVM.sCsvOrder)
EgtSetInfo(Pz, INFO_CSV_DIST, CompoWindowMap.refCompoManagerVM.sCsvList)
EgtSetInfo(Pz, INFO_CSV_MAT, CurrentMachine.CurrMat.sName)
EgtSetInfo(Pz, INFO_CSV_V1, DoubleToString(b3Part.DimX(), 1))
EgtSetInfo(Pz, INFO_CSV_V2, DoubleToString(b3Part.DimY(), 1))
' Se definito nome lo inserisco nel testo
If Not String.IsNullOrWhiteSpace(CompoWindowMap.refCompoManagerVM.sCsvName) Then
Dim nTextId = EgtGetFirstInGroup(nRegLayId)
While nTextId <> GDB_ID.NULL
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
Dim sText As String = String.Empty
EgtTextGetContent(nTextId, sText)
Dim sNewText = CompoWindowMap.refCompoManagerVM.sCsvName & "<br/>" & sText
EgtModifyText(nTextId, sNewText)
Exit While
End If
nTextId = EgtGetNext(nTextId)
End While
End If
' Altrimenti pezzo con dati normali
Else
' Se definito nome lo inserisco nel testo
If Not String.IsNullOrWhiteSpace(sName) Then
Dim nTextId = EgtGetFirstInGroup(nRegLayId)
While nTextId <> GDB_ID.NULL
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
Dim sText As String = String.Empty
EgtTextGetContent(nTextId, sText)
Dim sNewText = sName & "<br/>" & sText
EgtModifyText(nTextId, sNewText)
Exit While
End If
nTextId = EgtGetNext(nTextId)
End While
End If
End If
' Eventuale testo per indicare il sopra (solo nel caso di rettangolo)
If CompoWindowMap.refCompoManagerVM.Top_Visibility = Visibility.Visible And
CompoWindowMap.refCompoManagerVM.TopIsChecked Then
AddTopToPartRegion(nRegLayId)
End If
' Scrivo testi per nesting
SideEntityControlVM.WriteSideAngleForNest(CompoWindowMap.refCompoSceneHostV.CompoScene.GetCtx())
' Imposto colore testi
EstCalc.SetTextColor(nRegLayId)
' Imposto il colore del pezzo inserito nel progetto
EgtSetColor(nRegLayId, InsertColor)
Dim EntId As Integer = EgtGetFirstInGroup(nRegLayId)
While EntId <> GDB_ID.NULL
If EgtGetType(EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, InsertColor)
EntId = EgtGetNext(EntId)
End While
' Esporto il pezzo in un file temporaneo
Dim sTmpFile As String = OmagOFFICEMap.refMainWindowVM.MainWindowM.sTempDir & "\FlatPartCompo.Nge"
If Not EgtSaveObjToFile(Pz, sTmpFile, NGE.BIN) Then
Return False
End If
' Passo al contesto principale
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
' Recupero flag per inserimento diretto in grezzo (altrimenti in parcheggio)
Dim bDirect As Boolean = (GetMainPrivateProfileInt(S_NEST, K_DIRECT, 0) <> 0)
' Elimino eventuali precedenti pezzi vuoti
EgtEraseEmptyParts()
' Area dei nuovi pezzi
Dim dNewArea As Double = 0
' Se esiste il file del pezzo
If My.Computer.FileSystem.FileExists(sTmpFile) Then
' eseguo inserimento
For i As Integer = 1 To nNbr
' Inserisco il pezzo
EgtInsertFile(sTmpFile)
' Ne recupero l'Id
Dim nId2 As Integer = EgtGetLastPart()
' Aggiusto per lavorazioni
EgtAdjustFlatPart(nId2)
' Se dati Trf assegno nome univoco
If m_bTrfData Then EgtSetInfo(nId2, "CsvPart", CompoWindowMap.refCompoManagerVM.sTrfOrderCode & "-" & nId2.ToString())
' Aggiorno l'area dei nuovi pezzi
dNewArea += GeomCalc.GetPartArea(nId2)
' Inserisco in parcheggio
EstCalc.StoreOnePart(nId2, True)
' Aggiungo riferimento e lo inserisco in VeinMatching
VeinMatching.SetRefOnPart(nId2)
VeinMatching.AddPart(nId2, True)
' Se richiesto posizionamento diretto, lo eseguo
If bDirect Then
If EstCalc.InsertOnePart(nId2, CurrentMachine.bAligned, CurrentMachine.bReducedCut) Then
' Eventuale notifica al VeinMatching
VeinMatching.OnInsertPartInRaw(nId2)
End If
End If
'' ------------------------ AGGIUNGO PEZZO NEL VEINMATCH ----------------------------------
'' verifico che il pezzo sia un Piano Cucina o un Piano Bagno o un'Aletta
'Dim sCMP As String = String.Empty
'EgtGetInfo(nId2, "CMP", sCMP)
'If sCMP.StartsWith("PCucina") Or sCMP.StartsWith("PBagno") Or sCMP.StartsWith("AlzFront") Then
' ' Aggiungo riferimento e lo inserisco in VeinMatching
' VeinMatching.SetRefOnPart(nId2)
' VeinMatching.AddPart(nId2, True)
' ' Se richiesto posizionamento diretto, lo eseguo
' If bDirect Then
' If EstCalc.InsertOnePart(nId2, CurrentMachine.bAligned, CurrentMachine.bReducedCut) Then
' ' Eventuale notifica al VeinMatching
' VeinMatching.OnInsertPartInRaw(nId2)
' End If
' End If
'End If
'' ------------------------ AGGIUNGO PEZZO NEL VEINMATCH ----------------------------------
Next
' Cancello il file
My.Computer.FileSystem.DeleteFile(sTmpFile)
End If
' passo al pezzo successivo
Pz = NxtPz
End While
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
Return True
End Function
Friend Sub Close(bDialogResult As Boolean)
RaiseEvent m_CloseWindow(bDialogResult)
End Sub
+6
View File
@@ -86,6 +86,8 @@ Module ConstIni
Public Const K_SIDEMODE As String = "SideMode"
Public Const K_TRFDATA As String = "TrfData"
Public Const K_CSVDATA As String = "CsvData"
Public Const K_LASTCOLOR As String = "LastColor"
Public Const K_COLOR As String = "Color"
Public Const S_FLATPARTS As String = "FlatParts"
Public Const K_FLPCURRDIR As String = "CurrDir"
@@ -119,6 +121,10 @@ Module ConstIni
Public Const K_TEXTCOLOR As String = "TextColor"
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
Public Const K_DRAGRETTANGLE As String = "DragRettangle"
Public Const S_SPLIT As String = "Split"
Public Const K_MOVE_LEV As String = "MoveLevel"
Public Const S_CSV As String = "Csv"
Public Const K_CSVDIRECT As String = "Direct"
+20 -4
View File
@@ -14,9 +14,11 @@
<StackPanel Margin="5,5,5,0">
<!--TAGLIO-->
<TextBlock Text="{Binding CurrSawingMsg}"
Visibility="{Binding CurrSawing_Visibility}"
Margin="0,0,0,5"/>
<ComboBox ItemsSource="{Binding CurrSawingList}"
SelectedItem="{Binding SelCurrSawing}"
Visibility="{Binding CurrSawing_Visibility}"
Margin="0,0,0,5"/>
<!--<TextBlock Text="{Binding AuxMachTypeMsg}"
@@ -56,10 +58,24 @@
<TextBlock Text="{Binding CurrWaterjettingMsg}"
Visibility="{Binding CurrWaterjetting_Visibility}"
Margin="0,0,0,5"/>
<ComboBox ItemsSource="{Binding CurrWaterjettingList}"
SelectedItem="{Binding SelCurrWaterjetting}"
Visibility="{Binding CurrWaterjetting_Visibility}"
Margin="0,0,0,5"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding CurrWaterjettingList}"
SelectedItem="{Binding SelCurrWaterjetting}"
Visibility="{Binding CurrWaterjetting_Visibility}"
Margin="0,0,5,5"/>
<!--Quality-->
<ComboBox ItemsSource="{Binding CurrWaterjettingQualityList}"
SelectedItem="{Binding SelCurrWaterjettingQuality}"
Visibility="{Binding CurrWaterjettingQuality_Visibility}"
Margin="5,0,0,5"
Grid.Column="1">
</ComboBox>
</Grid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
+161 -21
View File
@@ -32,6 +32,16 @@ Public Class CurrMachWindowVM
End Set
End Property
Public ReadOnly Property CurrSawing_Visibility As Visibility
Get
If EgtGetHeadId("H1") = GDB_ID.NULL Then
Return Visibility.Collapsed
Else
Return Visibility.Visible
End If
End Get
End Property
#End Region ' Saw
#Region " AUX MACHINING "
@@ -257,6 +267,29 @@ Public Class CurrMachWindowVM
End Set
End Property
Private m_CurrWaterjettingQualityList As New List(Of String)
Public Property CurrWaterjettingQualityList As List(Of String)
Get
Return m_CurrWaterjettingQualityList
End Get
Set(value As List(Of String))
m_CurrWaterjettingQualityList = value
End Set
End Property
Private m_SelCurrWaterjettingQuality As String
Public Property SelCurrWaterjettingQuality As String
Get
Return m_SelCurrWaterjettingQuality
End Get
Set(value As String)
If value <> m_SelCurrWaterjettingQuality Then
m_SelCurrWaterjettingQuality = value
CurrentMachine.sCurrWaterJettingQuality = m_SelCurrWaterjettingQuality
End If
End Set
End Property
Private m_CurrWaterjetting_Visibility As Visibility
Public Property CurrWaterjetting_Visibility As Visibility
Get
@@ -264,7 +297,18 @@ Public Class CurrMachWindowVM
End Get
Set(value As Visibility)
m_CurrWaterjetting_Visibility = value
NotifyPropertyChanged("CurrWaterjetting_Visibility")
NotifyPropertyChanged(NameOf(CurrWaterjetting_Visibility))
End Set
End Property
Private m_CurrWaterjettingQuality_Visibility As Visibility
Public Property CurrWaterjettingQuality_Visibility As Visibility
Get
Return m_CurrWaterjettingQuality_Visibility
End Get
Set(value As Visibility)
m_CurrWaterjettingQuality_Visibility = value
NotifyPropertyChanged(NameOf(CurrWaterjettingQuality_Visibility))
End Set
End Property
@@ -313,6 +357,13 @@ Public Class CurrMachWindowVM
Return EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 10)
End Get
End Property
Public ReadOnly Property CurrWaterjettingQualityMsg As String
Get
Return "Quality"
End Get
End Property
Public ReadOnly Property OkMsg As String
Get
Return "Ok"
@@ -381,6 +432,7 @@ Public Class CurrMachWindowVM
If m_CurrWaterjettingList.Count = 0 Then
CurrentMachine.sCurrWaterJetting = String.Empty
End If
m_CurrWaterjettingQualityList = New List(Of String)(CurrentMachine.Qualities)
ElseIf CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or
CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
@@ -411,6 +463,7 @@ Public Class CurrMachWindowVM
If m_CurrWaterjettingList.Count = 0 Then
CurrentMachine.sCurrWaterJetting = String.Empty
End If
m_CurrWaterjettingQualityList = New List(Of String)(CurrentMachine.Qualities)
End If
' Nascondo la selezione dell'utensile ausiliario -- DA ELIMINARE? --
@@ -459,11 +512,20 @@ Public Class CurrMachWindowVM
If CurrentMachine.bWaterJetting And CurrWaterjettingList.Count > 1 Then
CurrWaterjetting_Visibility = Visibility.Visible
If CurrentMachine.sCurrWaterJetting <> String.Empty Then
SelCurrWaterjetting = CurrentMachine.sCurrWaterJetting
' se DB WaterJet abilitato avrò anche la CmBx della Quality solo la CmBx del Waterjetting corrente
If CurrentMachine.bFromDBWaterJet Then
If CurrentMachine.sCurrWaterJetting <> String.Empty Then
SelCurrWaterjetting = CurrentMachine.sCurrWaterJetting
End If
If CurrentMachine.sCurrWaterJettingQuality <> String.Empty Then
SelCurrWaterjettingQuality = CurrentMachine.sCurrWaterJettingQuality
End If
CurrWaterjettingQuality_Visibility = Visibility.Visible
Else
CurrWaterjettingQuality_Visibility = Visibility.Collapsed
End If
Else
CurrWaterjetting_Visibility = Visibility.Collapsed
CurrWaterjettingQuality_Visibility = Visibility.Collapsed
End If
' Con le nuove modifiche questa selezione dovrebbe scompaire definitivamente -- DA ELIMINARE? --
@@ -595,26 +657,57 @@ Public Class CurrMachWindowVM
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
If SysNotes <> String.Empty Then
Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
For Each Material In MachiningMaterials
Dim Param() As String = Material.Split(",".ToCharArray)
If Param.Count() < 2 Then Continue For
Dim CurrMatId As String = String.Empty
For Each Mat In CurrentMachine.Materials
If Mat.sName = EstCalc.GetMaterialName Then
CurrMatId = Mat.nId.ToString()
Exit For
If CurrentMachine.bWaterJet And CurrentMachine.bFromDBWaterJet Then
For Each Material As String In MachiningMaterials
Dim Param() As String = Material.Split(",".ToCharArray)
If Param.Count() < 2 Then Continue For
Dim CurrMatId As String = String.Empty
Dim CurrMatSubId As String = String.Empty
For Each Mat In CurrentMachine.Materials
If Mat.sName = EstCalc.GetMaterialName Then
CurrMatId = Mat.nId.ToString()
CurrMatSubId = Mat.SubId.ToString()
Exit For
End If
Next
Dim SubParam() As String = Param(0).Split(".".ToCharArray)
If Not IsNothing( CurrentMachine.CurrMat) AndAlso SubParam(0) = CurrentMachine.CurrMat.nId.ToString() AndAlso
SubParam.Count > 1 AndAlso SubParam(1) = CurrentMachine.CurrMat.SubId.ToString() Then
Dim MatMinH As Double = 0
StringToDouble(Param(1), MatMinH)
Dim MatMaxH As Double = 0
StringToDouble(Param(2), MatMaxH)
If EstCalc.GetRawHeight > MatMinH - EPS_SMALL And EstCalc.GetRawHeight < MatMaxH + EPS_SMALL Then
Return True
End If
End If
Next
If Param(0) = CurrMatId Then
Dim MatMinH As Double = 0
StringToDouble(Param(1), MatMinH)
Dim MatMaxH As Double = 0
StringToDouble(Param(2), MatMaxH)
If EstCalc.GetRawHeight > MatMinH - EPS_SMALL And EstCalc.GetRawHeight < MatMaxH + EPS_SMALL Then
Return True
Else
For Each Material In MachiningMaterials
Dim Param() As String = Material.Split(",".ToCharArray)
If Param.Count() < 2 Then Continue For
Dim CurrMatId As String = String.Empty
For Each Mat In CurrentMachine.Materials
If Mat.sName = EstCalc.GetMaterialName Then
CurrMatId = Mat.nId.ToString()
Exit For
End If
Next
If Param(0) = CurrMatId Then
Dim MatMinH As Double = 0
StringToDouble(Param(1), MatMinH)
Dim MatMaxH As Double = 0
StringToDouble(Param(2), MatMaxH)
If EstCalc.GetRawHeight > MatMinH - EPS_SMALL And EstCalc.GetRawHeight < MatMaxH + EPS_SMALL Then
Return True
End If
End If
End If
Next
Next
End If
Return False
Else
Return True
@@ -624,6 +717,53 @@ Public Class CurrMachWindowVM
End If
End Function
'Private Function VerifyMatThickCompatibility() As Boolean
' If Not IsNothing(m_CurrentMachine.CurrMat) Then
' Dim SysNotes As String = String.Empty
' EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
' If SysNotes <> String.Empty Then
' Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
' SysNotes = String.Empty
' If m_CurrentMachine.bWaterJet Then
' For Each Material As Object In MachiningMaterials
' Dim Param() As String = Material.Split(",".ToCharArray)
' Dim SubParam() As String = Param(0).Split(".".ToCharArray)
' If SubParam(0) = m_CurrentMachine.CurrMat.nId.ToString() AndAlso SubParam.Count > 1 AndAlso SubParam(1) = m_CurrentMachine.CurrMat.SubId.ToString() Then
' Dim dRawHeight = GetRawHeight()
' Dim MatMinH As Double = 0
' StringToDouble(Param(1), MatMinH)
' Dim MatMaxH As Double = 0
' StringToDouble(Param(2), MatMaxH)
' If dRawHeight > MatMinH - EPS_SMALL And dRawHeight < MatMaxH + EPS_SMALL Then
' Return True
' End If
' End If
' Next
' Else
' For Each Material As Object In MachiningMaterials
' Dim Param() As String = Material.Split(",".ToCharArray)
' If Param(0) = m_CurrentMachine.CurrMat.nId.ToString() Then
' Dim dRawHeight = GetRawHeight()
' Dim MatMinH As Double = 0
' StringToDouble(Param(1), MatMinH)
' Dim MatMaxH As Double = 0
' StringToDouble(Param(2), MatMaxH)
' If dRawHeight > MatMinH - EPS_SMALL And dRawHeight < MatMaxH + EPS_SMALL Then
' Return True
' End If
' End If
' Next
' End If
' Return False
' Else
' Return False
' End If
' Else
' Return True
' End If
'End Function
#End Region ' METHODS
End Class
+33
View File
@@ -909,6 +909,36 @@ Public Class DxfImportWindowVM
NotifyPropertyChanged("MsgColor")
End Sub
' metodo utilizzato per definire il colore dei pezzi DXF importati
Private Sub ColorRegion(nCtx As Integer)
' Leggo dati corrispondenza colore
Dim InsertColor As Color3d = CompoColor(IniFile.m_sIniFile)
' Imposto contesto corrente
EgtSetCurrentContext(nCtx)
' Ciclo sui pezzi
Dim PartId As Integer = EgtGetFirstPart()
While PartId <> GDB_ID.NULL
' Ciclo sui layer delle regioni
Dim RegionId As Integer = EgtGetFirstNameInGroup(PartId, NAME_REGION)
While RegionId <> GDB_ID.NULL
EgtSetColor(RegionId, InsertColor)
' Ciclo sulle regioni
Dim EntId As Integer = EgtGetFirstInGroup(RegionId)
While EntId <> GDB_ID.NULL
If EgtGetType(EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, InsertColor)
EntId = EgtGetNext(EntId)
End While
RegionId = EgtGetNextName(PartId, NAME_REGION)
End While
' passo al pezzo successico
PartId = EgtGetNextPart(PartId)
End While
' Aggiorno scritte per angoli sui lati
'WriteSideAngleForNest(nCtx)
End Sub
#End Region ' METHODS
#Region "COMMANDS"
@@ -973,6 +1003,7 @@ Public Class DxfImportWindowVM
If GetPrivateProfileInt(S_COLORTOENGRAVE, K_CTE_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then
SideEntityControlVM.ColorToEngrave(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
End If
ColorRegion(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
' Eseguo zoom
EgtZoom(ZM.ALL)
' disabilito bottoni UseLayer e UseRegion, abilito bottoni Reset e Insert
@@ -1013,6 +1044,7 @@ Public Class DxfImportWindowVM
If GetPrivateProfileInt(S_COLORTOENGRAVE, K_CTE_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then
SideEntityControlVM.ColorToEngrave(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
End If
ColorRegion(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
' Eseguo zoom
EgtZoom(ZM.ALL)
' disabilito bottoni UseLayer. UseRegion e UseClosedCurve, abilito bottoni Reset e Insert
@@ -1053,6 +1085,7 @@ Public Class DxfImportWindowVM
If GetPrivateProfileInt(S_COLORTOENGRAVE, K_CTE_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then
SideEntityControlVM.ColorToEngrave(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
End If
ColorRegion(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
' Eseguo zoom
EgtZoom(ZM.ALL)
' disabilito bottoni UseLayer e UseRegion, abilito bottoni Reset e Insert
+7
View File
@@ -668,6 +668,9 @@ Friend Module CamAuto
End If
' Lo sposto dalla lavorazione al pezzo
Dim nId As Integer = EgtGetFirstInGroup(nMchPvId)
If nId = GDB_ID.NULL Then Return False
While nId <> GDB_ID.NULL
EgtRelocateGlob(nId, nPartPvId)
nId = EgtGetFirstInGroup(nMchPvId)
@@ -714,10 +717,12 @@ Friend Module CamAuto
Private Function SetLuaStandardCamParams(Optional bDripOk As Boolean = True) As Boolean
Dim sMaterial As String = CurrentMachine.CurrMat.sName
Dim sSawMch As String = CurrentMachine.sCurrSawing
Dim sMillMch As String = CurrentMachine.sCurrMilling
Dim sDrillMch As String = CurrentMachine.sCurrDrilling
Dim sWaterJetMch As String = CurrentMachine.sCurrWaterJetting
Dim sWaterJetQual As String = CurrentMachine.sCurrWaterJettingQuality
Dim sDripSawMch As String = If(bDripOk, CurrentMachine.sCurrDripSawing, "")
Dim sDripDrillMch As String = If(bDripOk, CurrentMachine.sCurrDripDrilling, "")
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, CurrentMachine.sMachIniFile)
@@ -729,10 +734,12 @@ Friend Module CamAuto
Dim bMillingOnCorners As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, 1, CurrentMachine.sMachIniFile) <> 0)
Dim bMillingOnSinks As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, CurrentMachine.sMachIniFile) <> 0)
Dim dMillingShort As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, CurrentMachine.sMachIniFile)
EgtLuaSetGlobStringVar("CAM.MATERIAL", sMaterial)
EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch)
EgtLuaSetGlobStringVar("CAM.MILLMCH", sMillMch)
EgtLuaSetGlobStringVar("CAM.DRILLMCH", sDrillMch)
EgtLuaSetGlobStringVar("CAM.WATERJETMCH", sWaterJetMch)
EgtLuaSetGlobStringVar("CAM.WATERJETQLTY", sWaterJetQual)
EgtLuaSetGlobStringVar("CAM.DRIPSAWMCH", sDripSawMch)
EgtLuaSetGlobStringVar("CAM.DRIPDRILLMCH", sDripDrillMch)
EgtLuaSetGlobNumVar("CAM.REDUCEDDEPTH", dReducedDepth)
+2
View File
@@ -280,6 +280,8 @@ Module ConstMach
' Nome di pezzo temporaneo che serve per copia dime
Public Const NAME_COPYTEMPLATE As String = "CopyTemplate"
' Nome layer solidi per VM
Public Const NAME_VM_SOLID As String = "Solid"
' Chiave per Id originale del pezzo per VeinMatch
Public Const KEY_ORI_ID As String = "OriId"
+2
View File
@@ -253,11 +253,13 @@
Public Const K_CURRDRIPSAWING As String = "CurrDripSawing"
Public Const K_CURRDRIPDRILLING As String = "CurrDripDrilling"
Public Const K_CURRWATERJETTING As String = "CurrWaterJetting"
Public Const K_CURRWATERJETTINGQUALITY As String = "CurrWaterJettingQuality"
Public Const S_MATERIALS As String = "Materials"
Public Const K_CURRMATERIAL As String = "CurrMaterial"
Public Const K_CURROFFICEMATERIAL As String = "CurrOfficeMaterial"
Public Const K_MATERIAL As String = "Material"
Public Const K_FROMDBWATERJET As String = "FromDBWaterJet"
Public Const S_SETUP As String = "SetUp"
Public Const K_DEFAULT As String = "Default"
+121 -12
View File
@@ -86,6 +86,9 @@ Public Module CurrentMachine
Private m_bPolishingWheel As Boolean = False
Private m_bWaterJet As Boolean = False
' Abilitazione DB WaterJet
Private m_bFromDBWaterJet As Boolean = False
' Flag per visualizzazione TcPos, Testa/uscita e Note utente
Private m_nShowToolChanger As Integer = 0 ' 0=no, 1=tutti utensili, 2=solo lame
Private m_bShowHeadExit As Boolean = False
@@ -123,6 +126,7 @@ Public Module CurrentMachine
Private m_sCurrDripSawing As String = String.Empty
Private m_sCurrDripDrilling As String = String.Empty
Private m_sCurrWaterJetting As String = String.Empty
Private m_sCurrWaterJettingQuality As String = String.Empty
' Spessore sottopezzo
Private m_dAdditionalTable As Double = 0
@@ -162,6 +166,9 @@ Public Module CurrentMachine
' Lista dei materiali
Private m_Materials As New ObservableCollection(Of Material)
' Lista delle qualità di lavorazioni disponibili nel WaterJet
Private m_Qualities As New ObservableCollection(Of String)
' Massimo id della lista materiali nel file ini
Private m_MaxIdMat As Integer = 0
@@ -559,6 +566,12 @@ Public Module CurrentMachine
End Get
End Property
Friend ReadOnly Property bFromDBWaterJet As Boolean
Get
Return m_bFromDBWaterJet
End Get
End Property
Friend ReadOnly Property ShowToolChanger As Integer
Get
Return m_nShowToolChanger
@@ -828,6 +841,17 @@ Friend Property sCurrMillNoTip As String
End Set
End Property
Friend Property sCurrWaterJettingQuality As String
Get
Return m_sCurrWaterJettingQuality
End Get
Set(value As String)
If WritePrivateProfileString(S_MACH_MACH, K_CURRWATERJETTINGQUALITY, value, sMachIniFile) Then
m_sCurrWaterJettingQuality = value
End If
End Set
End Property
Friend ReadOnly Property WaterJettingActive As Boolean
Get
Return m_bWaterJetting AndAlso Not String.IsNullOrWhiteSpace(m_sCurrWaterJetting)
@@ -1006,6 +1030,12 @@ Friend Property sCurrMillNoTip As String
End Get
End Property
Friend ReadOnly Property Qualities As ObservableCollection(Of String)
Get
Return m_Qualities
End Get
End Property
Friend Sub AddMaterial(value As Material)
For Each Material In Materials
If Material.nId = value.nId Then
@@ -1089,9 +1119,13 @@ Friend Property sCurrMillNoTip As String
If Not IsNothing(value) Then
Dim CurrMatId As String = value.nId.ToString
Dim sKey As String = If(m_bOffice, K_CURROFFICEMATERIAL, K_CURRMATERIAL)
WritePrivateProfileString(S_MATERIALS, sKey, CurrMatId, sMachIniFile)
If bWaterJet And bFromDBWaterJet Then
WritePrivateProfileString(S_MATERIALS, sKey, CurrMatId & "." & value.SubId, sMachIniFile)
Else
WritePrivateProfileString(S_MATERIALS, sKey, CurrMatId, sMachIniFile)
End If
m_CurrMat = value
End If
m_CurrMat = value
End Set
End Property
@@ -1200,6 +1234,8 @@ Friend Property sCurrMillNoTip As String
m_bPolishingWheel = (GetPrivateProfileInt(S_TOOLS, K_POLISHINGWHEEL, 0, sMachIniFile) > 0) And bKeyPolish
' waterjet
m_bWaterJet = (GetPrivateProfileInt(S_TOOLS, K_WATERJET, 0, sMachIniFile) > 0) And bKeyWJ
' Leggo abilitazione DB WaterJet
m_bFromDBWaterJet = (GetPrivateProfileInt(S_MATERIALS, K_FROMDBWATERJET, 0, sMachIniFile) > 0)
' Leggo abilitazione visualizzazione TcPos e Head/exit
m_nShowToolChanger = GetPrivateProfileInt(S_TOOLS, K_SHOWTOOLCHANGER, 0, sMachIniFile)
m_bShowHeadExit = (GetPrivateProfileInt(S_TOOLS, K_SHOWHEADEXIT, 0, sMachIniFile) > 0)
@@ -1272,6 +1308,8 @@ Friend Property sCurrMillNoTip As String
GetPrivateProfileString(S_MACH_MACH, K_CURRDRIPDRILLING, Nothing, m_sCurrDripDrilling, sMachIniFile)
' waterjetting
GetPrivateProfileString(S_MACH_MACH, K_CURRWATERJETTING, Nothing, m_sCurrWaterJetting, sMachIniFile)
' waterjettingquality
GetPrivateProfileString(S_MACH_MACH, K_CURRWATERJETTINGQUALITY, Nothing, m_sCurrWaterJettingQuality, sMachIniFile)
' Leggo numero di portautensili
m_ToolChangerNbr = GetPrivateProfileInt(S_TOOLCHANGER, K_NUMBER, 0, sMachIniFile)
@@ -1330,24 +1368,79 @@ Friend Property sCurrMillNoTip As String
' Leggo la lista dei materiali
Dim Material As Material = Nothing
Dim nIndex As Integer = 1
While (GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & nIndex, Material, sMachIniFile))
m_Materials.Add(Material)
nIndex += 1
End While
If m_bWaterJet And m_bFromDBWaterJet Then
LoadWJMaterial(True)
Else
While (GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & nIndex, Material, sMachIniFile))
m_Materials.Add(Material)
nIndex += 1
End While
End If
' Salvo massimo indice a cui sono arrivato per usarlo quando devo aggiungere nuovi elementi alla lista
m_MaxIdMat = nIndex - 1
' Leggo materiale correntemente attivo
Dim sCurrMatId As String = String.Empty
Dim sKey As String = If(m_bOffice, K_CURROFFICEMATERIAL, K_CURRMATERIAL)
Dim CurrMatId As Integer = GetPrivateProfileInt(S_MATERIALS, sKey, 0, sMachIniFile)
For Each Material In Materials
If Material.nId = CurrMatId Then
m_CurrMat = Material
Exit For
EgtUILib.GetPrivateProfileString(S_MATERIALS, sKey, "0", sCurrMatId, sMachIniFile)
If bWaterJet And bFromDBWaterJet Then
Dim sCurrMatIds As String()
sCurrMatIds = sCurrMatId.Split("."c)
If sCurrMatIds.Length > 1 Then
Dim nCurrMatId As Integer
Dim nCurrSubMatId As Integer
If Not Integer.TryParse(sCurrMatIds(0), nCurrMatId) Then nCurrMatId = 0
If Not Integer.TryParse(sCurrMatIds(1), nCurrSubMatId) Then nCurrSubMatId = 0
For Each Material In Materials
If Material.nId = nCurrMatId AndAlso Material.SubId = nCurrSubMatId Then
m_CurrMat = Material
Exit For
End If
Next
End If
Next
Else
Dim nCurrMatId As Integer
If Not Integer.TryParse(sCurrMatId, nCurrMatId) Then nCurrMatId = 0
For Each Material In Materials
If Material.nId = nCurrMatId Then
m_CurrMat = Material
Exit For
End If
Next
End If
' Leggo se la macchina ha il tastatore dello spessore lastra
m_HasRawProbe = (GetPrivateProfileInt(S_MACH_PROBING, K_ENABLERAWPROBE, 1, sMachIniFile) <> 0)
' Se macchina ha Waterjet mostro il bottone per DB Waterjet
OmagOFFICEMap.refMachinePanelVM.NotifyPropertyChanged(NameOf(OmagOFFICEMap.refMachinePanelVM.WjDb_Visibility))
End Sub
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
Dim TempCurrMat As Material = CurrMat
' Svuoto l'attuale lista di materiali e delle qualità
m_Materials.Clear()
m_Qualities.Clear()
' Leggo valori da file .data e li carico nelle proprietà
Dim sFilePath As String = sMachDir & EgtWPFLib5.WaterjetDbWindowVM.WATERJETDB_PATH
WjMaterialList = EgtWPFLib5.WaterjetDbWindowVM.LoadWjMaterials(sFilePath)
' definisco la lista delle qualità
m_Qualities.Add("Q1")
m_Qualities.Add("Q2")
m_Qualities.Add("Q3")
m_Qualities.Add("Q4")
m_Qualities.Add("Q5")
m_Qualities.Add("QExtra")
' costruisco la lista
Dim i As Integer = 0
Dim sName As String = String.Empty
For i = 0 To WjMaterialList.Count - 1
sName = WjMaterialList(i).Name
Dim j As Integer = 0
For j = 0 To WjMaterialList(i).SubMaterialList.Count - 1
m_Materials.Add(New Material(i + 1, sName & "." & WjMaterialList(i).SubMaterialList(j).Name, j + 1))
Next
Next
If Not bIsStart Then CurrMat = TempCurrMat
End Sub
Friend Function IsVacuumMovePossible() As Boolean
@@ -1456,6 +1549,7 @@ Public Class Material
Private m_nId As Integer
Private m_sName As String
Private m_SubId As Integer = 0
Public ReadOnly Property nId As Integer
Get
@@ -1472,6 +1566,15 @@ Public Class Material
End Set
End Property
Public Property SubId As Integer
Get
Return m_SubId
End Get
Set(value As Integer)
m_SubId = value
End Set
End Property
Sub New(sName As String, MaterialList As ObservableCollection(Of Material))
Dim nMaxId As Integer = 0
For Each Material In MaterialList
@@ -1488,4 +1591,10 @@ Public Class Material
m_sName = sName
End Sub
Sub New(nId As Integer, sName As String, nSubId As Integer)
m_nId = nId
m_sName = sName
m_SubId = nSubId
End Sub
End Class
+12
View File
@@ -3,6 +3,16 @@ Imports EgtUILib
Imports EgtWPFLib5
Module EstCalc
Friend Function CompoColor(sIniFile As String) As Color3d
Dim InsertColor As New Color3d(89, 210, 210, 25)
Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, K_LASTCOLOR, 1, sIniFile)
If Not GetPrivateProfileColor(S_COMPO, K_COLOR & IndexColor.ToString, InsertColor, sIniFile) Then
IndexColor = 1
GetPrivateProfileColor(S_COMPO, K_COLOR & IndexColor.ToString, InsertColor, sIniFile)
End If
WritePrivateProfileString(S_COMPO, K_LASTCOLOR, (IndexColor + 1).ToString, sIniFile)
Return InsertColor
End Function
'--------------------------------------------------------------------------------------------------
Friend Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
@@ -67,6 +77,8 @@ Module EstCalc
End Function
Public Function UpdateRawPart() As Boolean
' Passo al contesto principale
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
' determino il grezzo (è il primo con fase 1)
m_nRawId = CamAuto.GetCurrentRaw()
If Not EgtGetRawPartBBox(m_nRawId, m_b3Raw) Then
+27 -15
View File
@@ -1,13 +1,13 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2017
' EgalTech 2015-2021
'----------------------------------------------------------------------------
' File : GenPhoto.vb Data : 12.04.17 Versione : 1.8d1
' File : GenPhoto.vb Data : 15.11.21 Versione : 2.3k1
' Contenuto : Modulo gestione fotografie.
' Ogni gruppo di lavoro può avere una sua foto della lastra.
'
'
' Modifiche : 12.04.17 DS Creazione modulo.
'
' 15.11.21 PS Correzioni per scalatura foto da CameraMng senza sovratavola.
'
'----------------------------------------------------------------------------
@@ -35,12 +35,12 @@ Module EstPhoto
If dThick > EPS_SMALL Then
OmagOFFICEMap.refRawPartTabVM.Height = DoubleToString( dThick, 3)
End If
' Altezza eventuale tavola aggiuntiva
' Altezza della eventuale tavola aggiuntiva per solo posizionamento in Z
Dim dAddTable As Double = CurrentMachine.dAdditionalTable
' Aggiusto dati per spessore grezzo
If Math.Abs(EstCalc.GetRawHeight() + dAddTable) > EPS_SMALL Then
' Coefficiente di scalatura
Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight() - dAddTable) / (ptCen.z - ptOri.z)
' Coefficiente di scalatura (non va considerata la sovratavola)
Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight()) / (ptCen.z - ptOri.z)
dMMxPixel *= dFsca
ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca
ptOri.y = ptCen.y + (ptOri.y - ptCen.y) * dFsca
@@ -67,7 +67,11 @@ Module EstPhoto
End If
EgtSetLevel(nPhGrpId, GDB_LV.SYSTEM)
' Carico la fotografia
Return EgtAddPhoto(GetPhotoName(), sPath, ptOri, ptCen, dMMxPixel, nPhGrpId, b3Tab.Min(), b3Tab.Max()) <> GDB_ID.NULL
Dim nPhotoId As Integer = EgtAddPhoto(GetPhotoName(), sPath, ptOri, ptCen, dMMxPixel, nPhGrpId, b3Tab.Min(), b3Tab.Max())
If nPhotoId = GDB_ID.NULL Then Return False
' Salvo spessore sovratavola usato per posizionamento in Z
EgtSetInfo( nPhotoId, "OvTab", dAddTable)
Return True
End Function
Friend Function LoadContour(sPath As String) As Boolean
@@ -92,12 +96,12 @@ Module EstPhoto
Dim nPixelX As Integer = 0
Dim nPixelY As Integer = 0
If Not EgtGetPhotoImagePixels(GetPhoto(), nPixelX, nPixelY) Then Return False
' Altezza eventuale tavola aggiuntiva
' Altezza della eventuale tavola aggiuntiva per solo posizionamento in Z
Dim dAddTable As Double = CurrentMachine.dAdditionalTable
' Aggiusto dati per spessore grezzo
If Math.Abs(EstCalc.GetRawHeight() + dAddTable) > EPS_SMALL Then
' Coefficiente di scalatura
Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight() - dAddTable) / (ptCen.z - ptOri.z)
' Coefficiente di scalatura (non va considerata la sovratavola)
Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight()) / (ptCen.z - ptOri.z)
dMMxPixel *= dFsca
ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca
ptOri.y = ptCen.y + (ptOri.y - ptCen.y) * dFsca
@@ -385,10 +389,13 @@ Module EstPhoto
' Porto i punti in locale
ptOri.ToLoc(New Frame3d(ptTab))
ptCen.ToLoc(New Frame3d(ptTab))
' Altezza eventuale tavola aggiuntiva
' Altezza della eventuale tavola aggiuntiva originaria
Dim dOrigAddTable As Double = 0
EgtGetInfo( nPhotoId, "OvTab", dOrigAddTable)
' Altezza della eventuale tavola aggiuntiva per solo posizionamento in Z
Dim dAddTable As Double = CurrentMachine.dAdditionalTable
' Aggiusto dati per spessore grezzo (Coefficiente di scalatura)
Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight() - dAddTable) / (ptCen.z - ptOri.z)
Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight()) / (ptCen.z - ptOri.z + dOrigAddTable)
dDimX *= dFsca
dDimY *= dFsca
ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca
@@ -426,6 +433,8 @@ Module EstPhoto
EgtSetInfo(nNewPhotoId, "OffsX", dOffsetX)
EgtSetInfo(nNewPhotoId, "OffsY", dOffsetY)
EgtSetInfo(nNewPhotoId, "Rot", dRot)
' Salvo sovratavola attuale
EgtSetInfo( nNewPhotoId, "OvTab", dAddTable)
Return True
End Function
@@ -482,17 +491,20 @@ Module EstPhoto
' Recupero origine della tavola
Dim ptTab As Point3d
If Not EgtGetTableRef(1, ptTab) Then Return False
' Altezza eventuale tavola aggiuntiva
' Altezza della eventuale tavola aggiuntiva originaria
Dim dOrigAddTable As Double = 0
EgtGetInfo( nPhotoId, "OvTab", dOrigAddTable)
' Altezza della eventuale tavola aggiuntiva per solo posizionamento in Z
Dim dAddTable As Double = CurrentMachine.dAdditionalTable
' Recupero inizio contorno
Dim ptStart As Point3d
EgtStartPoint(nCrvId, GDB_ID.ROOT, ptStart)
' Calcolo coefficiente di scalatura
Dim dFsca As Double = (ptCen.z - ptTab.z - EstCalc.GetRawHeight() - dAddTable) / (ptCen.z - ptStart.z)
Dim dFsca As Double = (ptCen.z - ptTab.z - EstCalc.GetRawHeight()) / (ptCen.z - ptStart.z + dOrigAddTable)
' Scalo opportunamente
EgtScale(nCrvId, New Frame3d(ptCen), dFsca, dFsca, 1, GDB_RT.GLOB)
' Sposto in Z
Dim vtMove As New Vector3d(0, 0, ptTab.z + EstCalc.GetRawHeight() + dAddTable - ptStart.z)
Dim vtMove As New Vector3d(0, 0, ptTab.z + EstCalc.GetRawHeight() + CurrentMachine.dAdditionalTable - ptStart.z)
EgtMove(nCrvId, vtMove, GDB_RT.GLOB)
Return True
End Function
+43 -12
View File
@@ -160,6 +160,17 @@ Public Module SplitAuto
End Function
'-----------------------------------------------------------------------------------------------
' calcolo il numero di tipi di lavorazioni
Friend Sub CountMachiningType(MachSplit As SplitMach, ByRef nCountSawing As Integer, ByRef nCountWaterjetting As Integer, ByRef nCountOtherMachining As Integer)
If MachSplit.m_nType = MCH_OY.SAWING Then
nCountSawing += 1
ElseIf MachSplit.m_nType = MCH_OY.WATERJETTING Then
nCountWaterjetting += 1
Else
nCountOtherMachining += 1
End If
End Sub
Friend Sub ColorMachining(MachSplit As SplitMach, Optional bReset As Boolean = False)
EgtDisableModified()
' Assegno stato
@@ -736,35 +747,55 @@ Public Module SplitAuto
End Function
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
' Spostamento originale
Dim vtOriMove As New Vector3d(vtMove)
' Livello di movimento
Dim nMoveLevel As Integer = GetPrivateProfileInt(S_SPLIT, K_MOVE_LEV, 5, IniFile.m_sIniFile)
Dim nMove As Integer = 1
' Se esce dalla tavola, movimento già annullato ed esco con errore
If Not EgtMoveRawPart(nRawId, vtMove) Then Return False
If Not EgtMoveRawPart(nRawId, vtOriMove) Then Return False
' Se interferisce con altri grezzi, annullo movimento ed esco con errore
If Not VerifyRawWithOtherRaws(nRawId, dMindist) Then
EgtMoveRawPart(nRawId, -vtMove)
EgtMoveRawPart(nRawId, -vtOriMove)
Return False
End If
If nMoveLevel < 2 Then Return True
' Provo ad aggiungere un altro movimento
If EgtMoveRawPart(nRawId, vtMove) Then
If EgtMoveRawPart(nRawId, vtOriMove) Then
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
vtMove += vtMove
vtMove += vtOriMove
nMove += 1
If nMoveLevel = nMove Then Return True
Else
EgtMoveRawPart(nRawId, -vtMove)
EgtMoveRawPart(nRawId, -vtOriMove)
End If
End If
' Provo ad aggiungere un altro movimento
If EgtMoveRawPart(nRawId, vtOriMove) Then
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
vtMove += vtOriMove
nMove += 1
If nMoveLevel = nMove Then Return True
Else
EgtMoveRawPart(nRawId, -vtOriMove)
End If
End If
' Provo ad aggiungere un movimento dimezzato
If EgtMoveRawPart(nRawId, 0.5 * vtMove) Then
If EgtMoveRawPart(nRawId, 0.5 * vtOriMove) Then
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
vtMove += 0.5 * vtMove
vtMove += 0.5 * vtOriMove
nMove += 1
If nMoveLevel = nMove Then Return True
Else
EgtMoveRawPart(nRawId, -0.5 * vtMove)
EgtMoveRawPart(nRawId, -0.5 * vtOriMove)
End If
End If
' Provo ad aggiunger un movimento 1/4
If EgtMoveRawPart(nRawId, 0.25 * vtMove) Then
' Provo ad aggiungere un movimento 1/4
If EgtMoveRawPart(nRawId, 0.25 * vtOriMove) Then
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
vtMove += 0.25 * vtMove
vtMove += 0.25 * vtOriMove
Else
EgtMoveRawPart(nRawId, -0.25 * vtMove)
EgtMoveRawPart(nRawId, -0.25 * vtOriMove)
End If
End If
Return True
+4 -1
View File
@@ -25,7 +25,10 @@
<Button Name="ExportBtn" Height="40" Width="80"
Margin="0,5,0,0"
Content="Export"/>
</StackPanel>
<Button Name="AssemblyBtn" Height="40" Width="80"
Margin="0,5,0,0"
Content="3D"/>
</StackPanel>
</Grid>
+567 -2
View File
@@ -1,5 +1,6 @@
Imports System.IO
Imports System.Windows.Interop
Imports System.Collections.ObjectModel
Imports System.Runtime.InteropServices
Imports EgtUILib
Imports EgtWPFLib5
@@ -316,6 +317,7 @@ Public Class VeinMatchingWindow
MessageBox.Show(Me, EgtMsg(91607) & " " & sMachGrpName, EgtMsg(91122), MessageBoxButton.OK, MessageBoxImage.Exclamation)
End If
End If
End If
EgtSetCurrentContext(VeinMatchingScene.GetCtx())
' Se selezione riuscita, la eseguo anche in VME
@@ -378,6 +380,13 @@ Public Class VeinMatchingWindow
VeinMatching.Export(SaveFileDialog.FileName)
End Sub
Private Sub AssemblyBtn_Click(sender As Object, e As RoutedEventArgs) Handles AssemblyBtn.Click
EstCalc.UpdateRawPart()
' lo spessore deve essere aggiornato per ogni lastra! (devo cicolare sull'elenco delle "macchinate"
Dim ThicknessRaw As Double = EstCalc.GetRawHeight
VeinMatching.AssemblyParts(ThicknessRaw)
End Sub
Private Sub Scene_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles VeinMatchingScene.KeyDown
' Con DEL eseguo cancellazione dei pezzi selezionati
If e.KeyData = System.Windows.Forms.Keys.Delete Then
@@ -401,6 +410,8 @@ Friend Module VeinMatching
' Dimensioni immagine da esportare
Private m_nImgWidth As Integer = 1600
Private m_nImgHeight As Integer = 1200
' Lista delle alzatine
Private m_ListAlzFront As New ObservableCollection(Of Aletta)
' Flag visualizzazione testi
Private m_bShowText As Boolean = True
Friend ReadOnly Property bShowText As Boolean
@@ -672,6 +683,15 @@ Friend Module VeinMatching
' Sistemo il colore
Dim colWhite As New Color3d(255, 255, 255, 100)
EgtSetColor(nRegId, colWhite)
' Ripeto le stesse operazioni con il solido del pezzo, se esiste
Dim nSolidId As Integer = GetVeinPartSolidId(nId)
If nSolidId <> GDB_ID.NULL Then
EgtSetTextureName(nSolidId, GetVeinPhotoName(nInd))
EgtSetTextureFrame(nSolidId, refTxr, GDB_RT.GLOB)
EgtSetColor(nSolidId, colWhite)
End If
' Se richiesto, eseguo deselezione
If bDeselect Then EgtDeselectObj(nId)
End If
@@ -698,10 +718,14 @@ Friend Module VeinMatching
If nId <> GDB_ID.NULL Then
' Recupero la regione del pezzo
Dim nRegId As Integer = GetVeinPartRegionId(nId)
Dim nSolidId As Integer = GetVeinPartSolidId(nId)
' Sistemo il riferimento della texture
Dim refTxr As New Frame3d
GetVeinRefPhoto(nMainCtx, nPartId, nId, refTxr)
EgtSetTextureFrame(nRegId, refTxr, GDB_RT.GLOB)
If nSolidId <> GDB_ID.NULL Then
EgtSetTextureFrame(nSolidId, refTxr, GDB_RT.GLOB)
End If
EgtDraw()
End If
EgtSetCurrentContext(nMainCtx)
@@ -728,8 +752,15 @@ Friend Module VeinMatching
' Gli tolgo la texture
EgtRemoveTextureData(nRegId)
' Sistemo il colore
Dim colAqua As New Color3d(0, 255, 255, 25)
EgtSetColor(nRegId, colAqua)
Dim colRegion As Color3d
EgtGetColor(EgtGetParent(nRegId), colRegion)
EgtSetColor(nRegId, colRegion)
' ripeto per il solido
Dim nSolidId As Integer = GetVeinPartSolidId(nId)
If nSolidId <> GDB_ID.NULL Then
EgtRemoveTextureData(nSolidId)
EgtSetColor(nSolidId, colRegion)
End If
' Se richiesto, eseguo deselezione
If bDeselect Then EgtDeselectObj(nId)
EgtDraw()
@@ -1240,4 +1271,538 @@ Friend Module VeinMatching
Return nRegId
End Function
Private Function GetVeinPartSolidId(nVeinPartId As Integer) As Integer
' Imposto VeinMatching context
Dim nCurrCtx = SetVeinContext()
If nCurrCtx = 0 Then Return GDB_ID.NULL
' Gruppo regione
Dim nRegLayId As Integer = EgtGetFirstNameInGroup(nVeinPartId, NAME_VM_SOLID)
' Entità superficie regione piatta
Dim nRegId As Integer = EgtGetFirstInGroup(nRegLayId)
While nRegId <> GDB_ID.NULL
If EgtGetType(nRegId) = GDB_TY.SRF_MESH Then
Exit While
End If
nRegId = EgtGetNext(nRegId)
End While
' Se necessario, ripristino il contesto originale
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
Return nRegId
End Function
' ------------------- FUNZIONI PER GESTIONE ALZATINE E FRONTALINI -------------------
Friend Function CreateListAlzAndFront() As Boolean
m_ListAlzFront.Clear()
EgtSetCurrentContext(m_nVeinCtx)
Dim nId As Integer = EgtGetFirstPart()
While nId <> GDB_ID.NULL
' verifico che il pezzo sia una alzatina
Dim sInfoName As String = String.Empty
EgtGetInfo(nId, "CMP", sInfoName)
If sInfoName = "AlzFront" Then
Dim AlzFront As New Aletta(nId)
m_ListAlzFront.Add(AlzFront)
End If
' Passo al pezzo successivo
nId = EgtGetNextPart(nId)
End While
Return True
End Function
Friend Function LinkReferencesOnAlette() As Boolean
Dim x As Integer = EgtGetCurrentContext()
' forzo il DB geometrico corrente
EgtSetCurrentContext(m_nVeinCtx)
Dim nId As Integer = EgtGetFirstPart()
While nId <> GDB_ID.NULL
' escludo dalla ricerca le alette
Dim sCMP As String = String.Empty
EgtGetInfo(nId, "CMP", sCMP)
If sCMP = "AlzFront" Then
' Passo al pezzo successivo
nId = EgtGetNextPart(nId)
Continue While
End If
' Recupero gruppo regione
Dim nOutLoopLayId As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP)
' Entità lato
Dim nSideId As Integer = EgtGetFirstInGroup(nOutLoopLayId)
While nSideId <> GDB_ID.NULL
Dim sInfoGUID As String = String.Empty
EgtGetInfo(nSideId, "RefAF", sInfoGUID)
If Not String.IsNullOrEmpty(sInfoGUID) Then
Dim Item As Aletta
For Each Item In m_ListAlzFront
If Item.RefGUID = sInfoGUID Then
Item.IdSideRef = nSideId
End If
Next
' ricerco nella lista delle alette il suo
End If
nSideId = EgtGetNext(nSideId)
End While
' Passo al pezzo successivo
nId = EgtGetNextPart(nId)
End While
Return True
End Function
Friend Function AssemblyParts(ByVal ThicknessRaw As Double) As Boolean
Dim CurrContext As Integer = EgtGetCurrentContext()
' per definizione un piano cucicina deve avere lo stesso spessore delle alette
'(abbiamo dato per scontato che le alette siano realizate sullo stesso grezzo del pinao cucina...)
CreateListAlzAndFront()
LinkReferencesOnAlette()
EgtSetCurrentContext(m_nVeinCtx)
' costruisco tutti i piani cucina (recupero l'Id geometrico del VeinMatch)
Dim nId As Integer = EgtGetFirstPart()
While nId <> GDB_ID.NULL
Dim sInfoName As String = String.Empty
EgtGetInfo(nId, "CMP", sInfoName)
' recuoer
Dim sNominalThickness As String = String.Empty
EgtGetInfo(nId, "RawTN", sNominalThickness)
' verifico che il pezzo sia una piano cucina
If sInfoName.Contains("PCucina") Or sInfoName.Contains("PBagno") Then
If Not CreateKitchenTop(nId, ThicknessRaw) Then Return False
End If
' altrimenti passo al pezzo successivo
nId = EgtGetNextPart(nId)
End While
' costruisco alzatine e frontalini
Dim Item As Aletta
For Each Item In m_ListAlzFront
' verifico che il disegno 3D non sia già stato fatto
Dim nInfo3D As Integer = 0
EgtGetInfo(Item.SideId, "Info3D", nInfo3D)
If nInfo3D <> 1 Then
' EgtSetInfo(Item.SideId, "Info3D", 1)
' creo il solido
If Not CreateAlettaSolid(Item, ThicknessRaw) Then Return False
'' posiziono il solido
'If Not MoveAlettaSolid(Item, ThicknessRaw) Then Return False
End If
' posiziono il solido
If Not MoveAlettaSolid(Item, ThicknessRaw) Then Return False
' solo se arrivo fino a qui allora imposto l'info
EgtSetInfo(Item.SideId, "Info3D", 1)
Next
Draw()
Return True
End Function
Friend Function CreateKitchenTop(ByRef nId As Integer, ByRef ThicknessRaw As Double) As Boolean
' creo o svuoto layer per facce del solido
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_VM_SOLID)
If nSolidGrp <> GDB_ID.NULL Then
EgtEmptyGroup(nSolidGrp)
Else
nSolidGrp = EgtCreateGroup(nId)
EgtSetName(nSolidGrp, NAME_VM_SOLID)
End If
' recupero faccia top
Dim nRegGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_REGION)
Dim nTopFr As Integer = EgtGetFirstInGroup(nRegGrp)
While nTopFr <> GDB_ID.NULL
If EgtGetType(nTopFr) = GDB_TY.SRF_FRGN Then Exit While
nTopFr = EgtGetNext(nTopFr)
End While
If nTopFr = GDB_ID.NULL Then Return False
EgtSetStatus(nTopFr, 0)
' setto colore per il solido
Dim cCol As New Color3d
EgtGetColor(nTopFr, cCol)
EgtSetColor(nSolidGrp, cCol)
' creo il solido
Dim bSameLoopsNbr As Boolean
Dim nSolidId As Integer
If Not CreateKitchenBaseSolid(nTopFr, nSolidGrp, ThicknessRaw, nSolidId, bSameLoopsNbr) Then Return False
' aggiungo componenti interni
If Not AddInternalComponents(nSolidId, nTopFr, bSameLoopsNbr, ThicknessRaw) Then Return False
' setto eventuale texture
Dim sTextName As String = String.Empty
EgtGetTextureName(nTopFr, sTextName)
If sTextName <> String.Empty Then
Dim frText As New Frame3d
EgtGetTextureFrame(nTopFr, nRegGrp, frText)
EgtSetTextureName(nSolidId, sTextName)
EgtSetTextureFrame(nSolidId, frText)
End If
' elimino curve ausiliarie
Dim nIdx As Integer = EgtGetFirstInGroup(nSolidGrp)
While nIdx <> GDB_ID.NULL
Dim newId As Integer = EgtGetNext(nIdx)
If EgtGetType(nIdx) <> GDB_TY.SRF_MESH Then
EgtErase(nIdx)
End If
nIdx = newId
End While
'Dim nOutloopGrpOrig As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP & ".orig")
'If nOutloopGrpOrig <> GDB_ID.NULL Then
' EgtSetStatus(nOutloopGrpOrig, 1)
' Dim nOutloopGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP)
' EgtSetStatus(nOutloopGrp, 0)
'End If
Return True
End Function
Friend Function CreateKitchenBaseSolid(ByRef nTopFr As Integer, ByRef nSolidGrp As Integer, ByRef ThicknessRaw As Double,
ByRef nSolidStm As Integer, ByRef bSameLoopsNbr As Boolean) As Boolean
' creo la faccia bottom
Dim nBottomFr As Integer
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nTopFr))
If Not EgtCalcFlatPartDownRegion(nPartId, ThicknessRaw) Then Return False
Dim nDwnRegGrp As Integer = EgtGetFirstNameInGroup(nPartId, "DwnReg")
If nDwnRegGrp <> GDB_ID.NULL Then
EgtSetStatus(nDwnRegGrp, 0)
nBottomFr = EgtGetFirstInGroup(nDwnRegGrp)
If nBottomFr = GDB_ID.NULL Then Return False
Else
nBottomFr = EgtCopy(nTopFr, nSolidGrp)
End If
Dim vtMove As Vector3d = -ThicknessRaw * Vector3d.Z_AX()
EgtMove(nBottomFr, vtMove)
EgtSetStatus(nBottomFr, 0)
' superficie laterale
Dim nTopCrvCount, nBottomCrvCount As Integer
Dim nTopCrv, nBottomCrv As Integer
nTopCrv = EgtExtractSurfFrChunkLoops(nTopFr, 0, nSolidGrp, nTopCrvCount)
nBottomCrv = EgtExtractSurfFrChunkLoops(nBottomFr, 0, nSolidGrp, nBottomCrvCount)
' modifico il punto iniziale della curva bottom per ottenere una buona superficie rigata
Dim ptStartTop As Point3d
EgtStartPoint(nTopCrv, ptStartTop)
EgtChangeClosedCurveStartPoint(nBottomCrv, ptStartTop - vtMove)
Dim nLateralStm As Integer = EgtCreateSurfTmRuled(nSolidGrp, nBottomCrv, nTopCrv, 0, EPS_STM)
' superfici trimesh per faccia top e bottom
Dim nTopStm, nBottomStm As Integer
bSameLoopsNbr = (nTopCrvCount = nBottomCrvCount)
If bSameLoopsNbr Then
If Not GetSrfTmFromFlatRegion(nTopFr, nSolidGrp, nTopStm) Then Return False
If Not GetSrfTmFromFlatRegion(nBottomFr, nSolidGrp, nBottomStm) Then Return False
Else
' creo le facce top e bottom dimenticando eventuali aperture
nTopStm = EgtCreateSurfTmByFlatContour(nSolidGrp, nTopCrv, EPS_STM)
nBottomStm = EgtCreateSurfTmByFlatContour(nSolidGrp, nBottomCrv, EPS_STM)
End If
EgtInvertSurface(nBottomStm)
nSolidStm = EgtCreateSurfTmBySewing(nSolidGrp, 3, {nTopStm, nBottomStm, nLateralStm}, True)
' elimino il layer generato dalla funzione "EgtCalcFlatPartDownRegion" e rinomino quello acceso
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup(nPartId, NAME_OUTLOOP & ".orig")
If nOutLoopOrig <> GDB_ID.NULL Then
Dim nCurrOutLoop As Integer = EgtGetFirstNameInGroup(nPartId, NAME_OUTLOOP)
EgtErase(nCurrOutLoop)
EgtSetName(nOutLoopOrig, NAME_OUTLOOP)
EgtSetStatus(nOutLoopOrig, GDB_ST.ON_)
End If
Return nSolidStm <> GDB_ID.NULL
End Function
Friend Function AddInternalComponents(ByRef nSolidStm As Integer, ByRef nTopFr As Integer, ByRef bSameLoopsNbr As Boolean,
ByRef ThicknessRaw As Double) As Boolean
Dim nSolidGrp = EgtGetParent(nSolidStm)
' aperture interne
Dim nTopCrvCount As Integer
Dim nTopCrv As Integer = EgtExtractSurfFrChunkLoops(nTopFr, 0, nSolidGrp, nTopCrvCount)
If bSameLoopsNbr Then
Dim FacesStm(nTopCrvCount - 1) As Integer
FacesStm(0) = nSolidStm
' creo le superfici laterali definite dalle aperture
For i As Integer = 1 To nTopCrvCount - 1
FacesStm(i) = EgtCreateSurfTmByExtrusion(nSolidGrp, 1, {nTopCrv + i}, -ThicknessRaw * Vector3d.Z_AX(), EPS_STM)
EgtInvertSurface(FacesStm(i))
Next
nSolidStm = EgtCreateSurfTmBySewing(nSolidGrp, nTopCrvCount, FacesStm, True)
Else
' creo le aperture per sottrazione di solidi
For i As Integer = 1 To nTopCrvCount - 1
Dim nComponentSrf As Integer = EgtCreateSurfTmByRegionExtrusion(nSolidGrp, 1, {nTopCrv + i}, -(ThicknessRaw + 10) * Vector3d.Z_AX(), EPS_STM)
EgtSurfTmSubtract(nSolidStm, nComponentSrf)
EgtErase(nComponentSrf)
Next
End If
' ribassi
Dim nId As Integer = EgtGetFirstGroupInGroup(EgtGetParent(nSolidGrp))
While nId <> GDB_ID.NULL
Dim sName As String = ""
EgtGetName(nId, sName)
If sName <> "Pocket" Then
nId = EgtGetNextGroup(nId)
Continue While
End If
' cerco curva composita che definisce il ribasso
Dim nCrvCompoId As Integer = EgtGetFirstInGroup(nId)
While nCrvCompoId <> GDB_ID.NULL
If EgtGetType(nCrvCompoId) = GDB_TY.CRV_COMPO Then Exit While
nCrvCompoId = EgtGetNext(nCrvCompoId)
End While
Dim dThick As Double
EgtCurveThickness(nCrvCompoId, dThick)
Dim vtExtr As Vector3d
EgtCurveExtrusion(nCrvCompoId, vtExtr)
Dim nRecessSrf As Integer = EgtCreateSurfTmByRegionExtrusion(nId, 1, {nCrvCompoId}, (dThick + 100) * vtExtr, EPS_STM)
EgtSurfTmSubtract(nSolidStm, nRecessSrf)
EgtErase(nRecessSrf)
' Passo al pezzo successivo
nId = EgtGetNextGroup(nId)
End While
Return True
End Function
Friend Function GetSrfTmFromFlatRegion(ByRef nFlatRegion As Integer, ByRef nSolidGrp As Integer, ByRef nSrfTmId As Integer) As Boolean
If nFlatRegion = GDB_ID.NULL Then Return False
' curve che delimitano la superficie
Dim nCrvCount As Integer
Dim nCrv As Integer = EgtExtractSurfFrChunkLoops(nFlatRegion, 0, nSolidGrp, nCrvCount)
If nCrv = GDB_ID.NULL Then Return False
' creo array con gli indici delle curve
Dim CrvList(nCrvCount - 1) As Integer
For i As Integer = 0 To nCrvCount - 1
CrvList(i) = nCrv + i
Next
nSrfTmId = EgtCreateSurfTmByRegion(nSolidGrp, CrvList, EPS_STM)
' cancello le curve create
For i As Integer = 0 To nCrvCount - 1
EgtErase(CrvList(i))
Next
Return nSrfTmId <> GDB_ID.NULL
End Function
Friend Function CreateAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
' angoli per i tagli
Dim dAngL, dAngR, dAng As Double
EgtGetInfo(Item.SideId + 1, INFO_SIDE_ANGLE, dAngR)
EgtGetInfo(Item.SideId + 3, INFO_SIDE_ANGLE, dAngL)
EgtGetInfo(Item.SideId, INFO_SIDE_ANGLE, dAng)
If Math.Abs(dAngL - 90) < EPS_SMALL Or Math.Abs(dAngL + 90) < EPS_SMALL Then dAngL = 0
If Math.Abs(dAngR - 90) < EPS_SMALL Or Math.Abs(dAngR + 90) < EPS_SMALL Then dAngR = 0
If Math.Abs(dAng - 90) < EPS_SMALL Or Math.Abs(dAng + 90) < EPS_SMALL Then dAng = 0
' punti che delimitano la front face (faccia adiacente a top lungo il lato di riferimento)
Dim pt1, pt2, pt3, pt4 As Point3d
EgtStartPoint(Item.SideId, pt4)
EgtEndPoint(Item.SideId, pt3)
pt2 = pt3 - ThicknessRaw * Vector3d.Z_AX()
pt1 = pt4 - ThicknessRaw * Vector3d.Z_AX()
' aggiungo tagli inclinati
pt2 = pt2 + ThicknessRaw * Math.Tan(dAngR * Math.PI / 180) * Vector3d.X_AX()
pt1 = pt1 - ThicknessRaw * Math.Tan(dAngL * Math.PI / 180) * Vector3d.X_AX()
' aggiungo eventuale taglio sul lato superiore
pt2 = pt2 - ThicknessRaw * Math.Tan(dAng * Math.PI / 180) * Vector3d.Y_AX()
pt1 = pt1 - ThicknessRaw * Math.Tan(dAng * Math.PI / 180) * Vector3d.Y_AX()
' punti che delimitano back face
Dim HeightTop As Double
EgtCurveLength(Item.SideId + 1, HeightTop)
Dim HeightBottom As Double = HeightTop + ThicknessRaw * Math.Tan(dAng * Math.PI / 180)
Dim ptB1 As Point3d = pt1 + HeightBottom * Vector3d.Y_AX()
Dim ptB2 As Point3d = pt2 + HeightBottom * Vector3d.Y_AX()
Dim ptB3 As Point3d = pt3 + HeightTop * Vector3d.Y_AX()
Dim ptB4 As Point3d = pt4 + HeightTop * Vector3d.Y_AX()
' Creo o svuoto layer per facce del solido
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
If nSolidGrp <> GDB_ID.NULL Then
EgtEmptyGroup(nSolidGrp)
Else
nSolidGrp = EgtCreateGroup(Item.PartId)
EgtSetName(nSolidGrp, NAME_VM_SOLID)
End If
Dim nRegionGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_REGION)
Dim cCol As New Color3d
EgtGetColor(EgtGetFirstInGroup(nRegionGrp), cCol)
EgtSetColor(nSolidGrp, cCol)
' Top Face
Dim nTopSrfFR As Integer = EgtGetFirstInGroup(nRegionGrp)
Dim tmp As Integer
Dim nTopCrv As Integer = EgtExtractSurfFrChunkLoops(nTopSrfFR, 0, nRegionGrp, tmp)
If nTopCrv = GDB_ID.NULL Then Return False
Dim nTopSrf As Integer = EgtCreateSurfTmByRegion(nSolidGrp, {nTopCrv}, EPS_SMALL)
EgtErase(nTopCrv)
EgtSetStatus(nTopSrfFR, 0)
Dim nFrontSrf, nBackSrf, nBottomSrf, nRightSrf, nLeftSrf As Integer
' Front Face
If Not CreateSolidFace(nSolidGrp, {pt1, pt2, pt3, pt4}, nFrontSrf, False) Then Return False
' Back Face
If Not CreateSolidFace(nSolidGrp, {ptB1, ptB4, ptB3, ptB2}, nBackSrf) Then Return False
' Bottom face
If Not CreateSolidFace(nSolidGrp, {pt2, pt1, ptB1, ptB2}, nBottomSrf) Then Return False
' Right face
If Not CreateSolidFace(nSolidGrp, {ptB1, pt1, pt4, ptB4}, nRightSrf) Then Return False
' Left face
If Not CreateSolidFace(nSolidGrp, {ptB2, ptB3, pt3, pt2}, nLeftSrf) Then Return False
' creo il solido
Dim nSolidSrf As Integer = EgtCreateSurfTmBySewing(nSolidGrp, 6, {nTopSrf, nFrontSrf, nBackSrf, nBottomSrf, nRightSrf, nLeftSrf}, True)
' setto eventuale texture
Dim sTextName As String = String.Empty
EgtGetTextureName(nTopSrfFR, sTextName)
If sTextName <> String.Empty Then
Dim frText As New Frame3d
EgtGetTextureFrame(nTopSrfFR, nRegionGrp, frText)
EgtSetTextureName(nSolidSrf, sTextName)
EgtSetTextureFrame(nSolidSrf, frText)
End If
Dim nOutloopGrp As Integer = EgtGetParent(Item.SideId)
EgtSetStatus(nOutloopGrp, 0)
Return True
End Function
Friend Function CreateSolidFace(ByRef nSrfGrp As Integer, ByRef Points As Point3d(), ByRef nSrfId As Integer,
Optional ByRef bDeleteCrv As Boolean = True) As Boolean
If Points.Count() <> 4 Then Return False
Dim nCrvId As Integer = EgtCreateCurveCompo(nSrfGrp, {EgtCreateLine(nSrfGrp, Points(0), Points(1)),
EgtCreateLine(nSrfGrp, Points(1), Points(2)),
EgtCreateLine(nSrfGrp, Points(2), Points(3)),
EgtCreateLine(nSrfGrp, Points(3), Points(0))}, True)
If nCrvId = GDB_ID.NULL Then Return False
nSrfId = EgtCreateSurfTmByRegion(nSrfGrp, {nCrvId}, EPS_SMALL)
If bDeleteCrv Then
EgtErase(nCrvId)
Else
EgtSetStatus(nCrvId, GDB_ST.OFF)
End If
Return nSrfId <> GDB_ID.NULL
End Function
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
Dim nType As Integer
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
Dim ptSRef, ptERef, ptE As Point3d
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
' verifco che sia già stato ruotato
Dim nInfo3D As Integer = 0
EgtGetInfo(Item.SideId, "Info3D", nInfo3D)
If nInfo3D <> 1 Then
' ruoto il solido intorno al lato di riferimento
Dim vtRot As Vector3d = ptERef - ptSRef
If nType = 1 Then
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
ElseIf nType = 2 Then
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
End If
End If
' punto di riferimento per la traslazione sul solido
Dim ptSolid As Point3d
If nType = 1 Then
' cerco id della curva che definisce la front face
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
EgtStartPoint(nFrontCrvId, ptSolid)
ElseIf nType = 2 Then
EgtStartPoint(Item.SideId, ptSolid)
End If
Dim ItemFrame As New Frame3d
If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
ptSolid.ToGlob(ItemFrame)
'punto di riferimento per la traslazione sul piano cucina
Dim ptKitchen As Point3d = ptERef
' traslazione
Dim vtMove As Vector3d = ptKitchen - ptSolid
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
Return True
End Function
End Module
Public Class Aletta
Private m_PartId As Integer = -1
Public ReadOnly Property PartId As Integer
Get
Return m_PartId
End Get
End Property
Private m_SideId As Integer = -1
Public ReadOnly Property SideId As Integer
Get
Return m_SideId
End Get
End Property
Private m_RefGUID As String = String.Empty
Public ReadOnly Property RefGUID As String
Get
Return m_RefGUID
End Get
End Property
Private m_IdSideRef As Integer = -1
Public Property IdSideRef As Integer
Get
Return m_IdSideRef
End Get
Set(value As Integer)
m_IdSideRef = value
End Set
End Property
Sub New(nId As Integer)
m_PartId = nId
' Recupero l'info legata al lato che contiene iil riferiemnto
Dim nOutLoopLayId As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP)
' Entità lato
Dim nSideId As Integer = EgtGetFirstInGroup(nOutLoopLayId)
While nSideId <> GDB_ID.NULL
Dim sInfoGUID As String = String.Empty
EgtGetInfo(nSideId, "RefAF", sInfoGUID)
If Not String.IsNullOrEmpty(sInfoGUID) Then
m_RefGUID = sInfoGUID
m_SideId = nSideId
Exit While
End If
nSideId = EgtGetNext(nSideId)
End While
End Sub
End Class
+28 -9
View File
@@ -75,7 +75,7 @@
<!--Prima Colonna quarta riga - Lista Materiali-->
<GroupBox Header="{Binding MaterialsMsg}" Grid.Column="0"
Grid.Row="3" Grid.RowSpan="5">
Grid.Row="3" Grid.RowSpan="5" Visibility="{Binding Materials_Visibility}">
<DockPanel>
@@ -91,12 +91,31 @@
Margin="2.5,0,0,0"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox Text="{Binding NewMatName}"
<!--<EgtWPFLib5:EgtTextBox Text="{Binding NewMatName}"
DockPanel.Dock="Bottom" Width="240"
Visibility="{Binding NewMatName_Visibility}"
Margin="0,0,0,5"/>
<ListBox ItemsSource="{Binding MaterialList}"
Margin="0,0,0,5"/>-->
<Grid DockPanel.Dock="Bottom" Visibility="{Binding NewMatName_Visibility}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<EgtWPFLib5:EgtTextBox Text="{Binding NewMatName}"
DockPanel.Dock="Bottom"
Margin="0,0,0,5"/>
<Button Content="{Binding OkMsg}" Grid.Column="1"
Command="{Binding OkCommand}"
IsEnabled="{Binding EnableOkNewMat}"
Style="{StaticResource OptionPanel_TextButton}"
Margin="2.5,0,0,2.5"/>
<Button Content="{Binding CancelMsg}" Grid.Column="2"
Command="{Binding CamcelCommand}"
Style="{StaticResource OptionPanel_TextButton}"
Margin="2.5,0,0,2.5"/>
</Grid>
<ListBox ItemsSource="{Binding MaterialList}"
SelectedItem="{Binding SelMaterial}"
DisplayMemberPath="sName"
Grid.RowSpan="2"
@@ -107,7 +126,7 @@
</GroupBox>
<!--Parametri taglio lama-->
<GroupBox Header="{Binding SawParamMsg}">
<GroupBox Header="{Binding SawParamMsg}" Visibility="{Binding SawParam_Visibility}">
<UniformGrid Columns="2" >
<TextBlock Text="{Binding CutExtraLenMsg}"
@@ -152,7 +171,7 @@
<GroupBox Header="{Binding MillingParamMsg}" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2">
<UniformGrid Rows="3">
<Grid>
<Grid Visibility="{Binding MillingParam_Visibility}">
<TextBlock Text="{Binding CornerCutsMsg}"
Style="{StaticResource OptionTextBlock}"/>
<CheckBox IsChecked="{Binding CornerCuts}"
@@ -164,7 +183,7 @@
<CheckBox IsChecked="{Binding InternalCuts}"
Style="{StaticResource OptionCheckBox}"/>
</Grid>
<UniformGrid Columns="2">
<UniformGrid Columns="2" Visibility="{Binding MillingParam_Visibility}">
<TextBlock Text="{Binding ShortMsg}"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding ShortCut}"/>
@@ -174,7 +193,7 @@
</GroupBox>
<!--Nesting-->
<!--Nesting-->
<GroupBox Header="{Binding NestingParamMsg}" Grid.Column="1" Grid.Row="3" Grid.RowSpan="2">
<UniformGrid Columns="2" >
+148 -25
View File
@@ -33,7 +33,7 @@ Public Class MachOptionWindowVM
Public Property HolesOffset As String
Get
Return LenToString(CurrentMachine.dHolesOffset, -2)
Return LenToString(CurrentMachine.dHolesOffset, 2)
End Get
Set(value As String)
Dim dHolesOffset As Double = 0
@@ -45,7 +45,7 @@ Public Class MachOptionWindowVM
Public Property HolesOverlap As String
Get
Return LenToString(CurrentMachine.dHolesOverlap, -2)
Return LenToString(CurrentMachine.dHolesOverlap, 2)
End Get
Set(value As String)
Dim dHolesOverlap As Double = 0
@@ -57,7 +57,7 @@ Public Class MachOptionWindowVM
Public Property HolesTolerance As String
Get
Return LenToString(CurrentMachine.dHolesTolerance, -2)
Return LenToString(CurrentMachine.dHolesTolerance, 2)
End Get
Set(value As String)
Dim dHolesTolerance As Double = 0
@@ -82,7 +82,7 @@ Public Class MachOptionWindowVM
Public Property CutExtraLen As String
Get
Return LenToString(CurrentMachine.dCutExtraLen, -2)
Return LenToString(CurrentMachine.dCutExtraLen, 2)
End Get
Set(value As String)
Dim dCutExtraLen As Double = 0
@@ -94,7 +94,7 @@ Public Class MachOptionWindowVM
Public Property AngleCutExtraLen As String
Get
Return LenToString(CurrentMachine.dAngleCutExtraLen, -2)
Return LenToString(CurrentMachine.dAngleCutExtraLen, 2)
End Get
Set(value As String)
Dim dAngleCutExtraLen As Double = 0
@@ -106,7 +106,7 @@ Public Class MachOptionWindowVM
Public Property ExtArcMinRad As String
Get
Return LenToString(CurrentMachine.dExtArcMinRad, -2)
Return LenToString(CurrentMachine.dExtArcMinRad, 2)
End Get
Set(value As String)
Dim dExtArcMinRad As Double = 0
@@ -118,7 +118,7 @@ Public Class MachOptionWindowVM
Public Property IntArcMaxSideAng As String
Get
Return DoubleToString(CurrentMachine.dIntArcMaxSideAng, -2)
Return DoubleToString(CurrentMachine.dIntArcMaxSideAng, 2)
End Get
Set(value As String)
Dim dIntArcMaxSideAng As Double = 0
@@ -144,13 +144,24 @@ Public Class MachOptionWindowVM
End Set
End Property
Public ReadOnly Property SawParam_Visibility As Visibility
Get
' in assenza dell'uscita H1 nascondo i parametri lama
If EgtGetHeadId("H1") = GDB_ID.NULL Then
Return Visibility.Hidden
Else
Return Visibility.Visible
End If
End Get
End Property
#End Region ' Saw Param
#Region "Machine Param"
Public Property SafeZ As String
Get
Return LenToString(CurrentMachine.dSafeZ, -2)
Return LenToString(CurrentMachine.dSafeZ, 2)
End Get
Set(value As String)
Dim dSafeZ As Double = 0
@@ -184,7 +195,7 @@ Public Class MachOptionWindowVM
Public Property ShortCut As String
Get
Return LenToString(CurrentMachine.dShortCut, -2)
Return LenToString(CurrentMachine.dShortCut, 2)
End Get
Set(value As String)
Dim dShortCut As Double = 0
@@ -194,6 +205,16 @@ Public Class MachOptionWindowVM
End Set
End Property
Public ReadOnly Property MillingParam_Visibility As Visibility
Get
If bWaterJet Then
Return Visibility.Hidden
Else
Return Visibility.Visible
End If
End Get
End Property
#End Region ' Milling Param
#Region "Nesting Param"
@@ -264,7 +285,7 @@ Public Class MachOptionWindowVM
Public Property AdditionalTable As String
Get
Return LenToString(CurrentMachine.dAdditionalTable, -2)
Return LenToString(CurrentMachine.dAdditionalTable, 2)
End Get
Set(value As String)
Dim dAdditionalTable As Double = 0
@@ -333,22 +354,41 @@ Public Class MachOptionWindowVM
Set(value As String)
m_NewMatName = value
' Verifico che il nome non sia vuoto
If Not String.IsNullOrWhiteSpace(m_NewMatName) Then
' Verifico che il nome non sia già utilizzato
Dim bNameExist As Boolean = False
For Each Material In CurrentMachine.Materials
If Material.sName = m_NewMatName Then
bNameExist = True
Exit For
End If
Next
If Not bNameExist Then
CurrentMachine.AddMaterial(New Material(m_NewMatName, CurrentMachine.Materials))
AddNewMaterial()
NotifyPropertyChanged("EnableOkNewMat")
End Set
End Property
Private Function AddNewMaterial() As Boolean
If Not String.IsNullOrWhiteSpace(m_NewMatName) Then
' Verifico che il nome non sia già utilizzato
Dim bNameExist As Boolean = False
For Each Material In MaterialList
If Material.sName = m_NewMatName Then
bNameExist = True
Exit For
End If
Next
If Not bNameExist Then
'm_MaterialList.Add(m_NewMatName)
m_EnableOkNewMat = True
Return True
End If
' Nascondo textbox per il nome
NewMatName_Visibility = Visibility.Collapsed
m_NewMatName = String.Empty
End If
' ' Nascondo textbox per il nome
' NewMatName_Visibility = Visibility.Collapsed
' m_NewMatName = String.Empty
m_EnableOkNewMat = False
Return False
End Function
Private m_EnableOkNewMat As Boolean = False
Public Property EnableOkNewMat As Boolean
Get
Return m_EnableOkNewMat
End Get
Set(value As Boolean)
m_EnableOkNewMat = value
End Set
End Property
@@ -363,11 +403,19 @@ Public Class MachOptionWindowVM
End Set
End Property
Public ReadOnly Property Materials_Visibility As Visibility
Get
Return If(CurrentMachine.bWaterJet, Visibility.Collapsed, Visibility.Visible)
End Get
End Property
#End Region ' Material
' Definizione comandi
Private m_cmdNewMat As ICommand
Private m_cmdRemoveMat As ICommand
Private m_cmdOk As ICommand
Private m_cmdCanel As ICommand
#Region "Messages"
@@ -448,7 +496,11 @@ Public Class MachOptionWindowVM
End Property
Public ReadOnly Property MillingParamMsg As String
Get
Return EgtMsg(MSG_ALARMSPAGEUC + 29)
If bWaterJet Then
Return EgtMsg(91058)
Else
Return EgtMsg(MSG_ALARMSPAGEUC + 29)
End If
End Get
End Property
Public ReadOnly Property CornerCutsMsg As String
@@ -521,6 +573,19 @@ Public Class MachOptionWindowVM
Return EgtMsg(91065)
End Get
End Property
Public ReadOnly Property OkMsg As String
Get
Return "Ok"
End Get
End Property
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
End Get
End Property
#End Region ' Messages
#Region "ToolTip"
@@ -622,6 +687,64 @@ Public Class MachOptionWindowVM
#End Region ' RemoveMatCommand
#Region "OkCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property OkCommand As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf OkMat)
End If
Return m_cmdOk
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub OkMat(ByVal param As Object)
' aggiungo il materiale alla lista
Dim objNewMat As New Material(m_NewMatName, CurrentMachine.Materials)
If Not IsNothing(objNewMat) Then
CurrentMachine.Materials.Add(objNewMat)
End If
' Nascondo textbox per il nome
NewMatName_Visibility = Visibility.Collapsed
m_NewMatName = String.Empty
NotifyPropertyChanged("NewMatName")
End Sub
#End Region ' OkCommand
#Region "CancelCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property CamcelCommand As ICommand
Get
If m_cmdCanel Is Nothing Then
m_cmdCanel = New Command(AddressOf CancelMat)
End If
Return m_cmdCanel
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub CancelMat(ByVal param As Object)
' Nascondo textbox per il nome
NewMatName_Visibility = Visibility.Collapsed
m_NewMatName = String.Empty
NotifyPropertyChanged("NewMatName")
End Sub
#End Region ' CancelCommand
#End Region ' COMMANDS
End Class
+6 -3
View File
@@ -13,14 +13,17 @@
Height="20" Width="150"/>-->
<Button Command="{Binding ToolDbCommand}" ToolTip="{Binding ToolDBToolTip}"
Style="{StaticResource ToolBar_TextButton}" Width="55" Content="{Binding ToolDBMsg}"/>
Style="{StaticResource ToolBar_TextButton}" Width="70" Content="{Binding ToolDBMsg}"/>
<Button Command="{Binding MachDbCommand}" ToolTip="{Binding MachiningDbToolTip}"
Style="{StaticResource ToolBar_TextButton}" Width="55" Content="{Binding MachiningDbMsg}"/>
Style="{StaticResource ToolBar_TextButton}" Width="70" Content="{Binding MachiningDbMsg}"/>
<Button Command="{Binding SetUpCommand}" ToolTip="{Binding SetUpToolTip}"
Style="{StaticResource ToolBar_TextButton}" Width="55" Content="{Binding SetUpMsg}"
Style="{StaticResource ToolBar_TextButton}" Width="70" Content="{Binding SetUpMsg}"
Background="{Binding SetUp_Background}"/>
<Button Command="{Binding WaterjetDbCommand}" ToolTip="{Binding WaterjetDbToolTip}"
Style="{StaticResource ToolBar_Button}" Width="70" Content="{Binding WaterjetDbMsg}" Visibility="{Binding WjDb_Visibility}"/>
<Button Command="{Binding MachOptionsCommand}" ToolTip="{Binding OptionsToolTip}">
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
</Button>
</EgtFloating:EgtFloatingPanel>
+44
View File
@@ -22,6 +22,12 @@ Public Class MyMachinePanelVM
End Set
End Property
Public ReadOnly Property WjDb_Visibility As Visibility
Get
Return If(CurrentMachine.bWaterJet And CurrentMachine.bFromDBWaterJet, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
#Region "Messages"
Public ReadOnly Property ToolDBMsg As String
@@ -39,6 +45,11 @@ Public Class MyMachinePanelVM
Return EgtMsg(MSG_ALARMSPAGEUC + 33)
End Get
End Property
Public ReadOnly Property WaterjetDbMsg As String
Get
Return "DB WaterJet" 'EgtMsg(MSG_MACHINEPAGEUC + 7)
End Get
End Property
#End Region ' Messages
@@ -59,6 +70,11 @@ Public Class MyMachinePanelVM
Return "SetUp"
End Get
End Property
Public ReadOnly Property WaterjetDbToolTip As String
Get
Return "Waterjet DB"
End Get
End Property
#End Region ' ToolTip
@@ -67,6 +83,7 @@ Public Class MyMachinePanelVM
Private m_cmdMachDb As ICommand
Private m_cmdSetUp As ICommand
Private m_cmdMachOptions As ICommand
Private m_cmdWaterjetDb As ICommand
#End Region 'FIELDS & PROPERTIES
@@ -300,6 +317,33 @@ Public Class MyMachinePanelVM
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
End Sub
#Region "WaterjetDbCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property WaterjetDbCommand As ICommand
Get
If m_cmdWaterjetDb Is Nothing Then
m_cmdWaterjetDb = New Command(AddressOf WaterjetDb)
End If
Return m_cmdWaterjetDb
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub WaterjetDb(ByVal param As Object)
Dim WaterjetDbWindow As New WaterjetDbWindowV(Application.Current.MainWindow, New WaterjetDbWindowVM(CurrentMachine.sMachDir))
WaterjetDbWindow.Height = 546
WaterjetDbWindow.Width = 846
WaterjetDbWindow.ShowDialog()
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
End Sub
#End Region ' SpeedDbCommand
#End Region ' METHODS
End Class
+2 -2
View File
@@ -195,8 +195,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(9423, 2309, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2309, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2401, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2401, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
' Inizializzazione generale di EgtInterface
+4 -4
View File
@@ -28,9 +28,9 @@ Imports System.Windows
<Assembly: AssemblyDescription("OmagOFFICE 32 bit")>
#End If
#End If
<Assembly: AssemblyCompany("EgalTech s.r.l.")>
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("OmagOFFICE")>
<Assembly: AssemblyCopyright("Copyright © 2017-2021 by EgalTech s.r.l.")>
<Assembly: AssemblyCopyright("Copyright © 2017-2022 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
'In order to begin building localizable applications, set
@@ -69,6 +69,6 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.3.9.1")>
<Assembly: AssemblyFileVersion("2.3.9.1")>
<Assembly: AssemblyVersion("2.4.1.3")>
<Assembly: AssemblyFileVersion("2.4.1.3")>
+3
View File
@@ -285,6 +285,7 @@ Public Class MySceneHostVM
EgtOutLog( "Slab image not found :" & sOriPath)
End Try
EgtSetName(nPhotoId, PHOTO_NAME)
EgtChangePhotoCenterAsFlatScan( nPhotoId)
End If
' Elimino gli altri gruppi di lavorazioni
For Each nMGrpId As Integer In vMchGrps
@@ -743,6 +744,7 @@ Public Class MySceneHostVM
Case OptionPanelVM.Tabs.NESTING
OmagOFFICEMap.refNestingTabVM.OnMouseMoveScene(sender, e)
Case OptionPanelVM.Tabs.MACHINING
OmagOFFICEMap.refSplitModeVM.OnMyMouseMoveScene(sender, e)
Case OptionPanelVM.Tabs.SIMUL
End Select
End Sub
@@ -755,6 +757,7 @@ Public Class MySceneHostVM
Case OptionPanelVM.Tabs.NESTING
OmagOFFICEMap.refNestingTabVM.OnMouseUpScene(sender, e)
Case OptionPanelVM.Tabs.MACHINING
OmagOFFICEMap.refSplitModeVM.OnMyMouseUpScene(sender, e)
Case OptionPanelVM.Tabs.SIMUL
End Select
End Sub
+8
View File
@@ -151,6 +151,10 @@
<Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb">
<DependentUpon>AboutBoxV.xaml</DependentUpon>
</Compile>
<Compile Include="AlzAndFront\AlzAndFront.xaml.vb">
<DependentUpon>AlzAndFront.xaml</DependentUpon>
</Compile>
<Compile Include="AlzAndFront\AlzAndFront.vb" />
<Compile Include="CompoCsvTrfDataWindow\CompoCsvDataWindowV.xaml.vb">
<DependentUpon>CompoCsvDataWindowV.xaml</DependentUpon>
</Compile>
@@ -333,6 +337,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="AlzAndFront\AlzAndFront.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="CompoCsvTrfDataWindow\CompoCsvDataWindowV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -322,6 +322,8 @@ Public Class MachiningTabVM
Friend Sub OnMouseDownScene(sender As Object, e As Windows.Forms.MouseEventArgs)
If m_MachiningMode = MachiningModeOpt.MOVERAWPART Then
OmagOFFICEMap.refMoveRawModeVM.OnMouseDownScene(sender, e)
ElseIf m_MachiningMode = MachiningModeOpt.SPLIT Then
OmagOFFICEMap.refSplitModeVM.OnMouseDownScene(sender, e)
End If
End Sub
+13
View File
@@ -71,14 +71,17 @@
<Button Content="{Binding CutMsg}"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding CutCommand}"
Visibility="{Binding CutBtnVisibility}"
Margin="0,0,2.5,0"/>
<Button Content="{Binding CutStartMsg}"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding CutStartCommand}"
Visibility="{Binding CutStartBtnVisibility}"
Margin="2.5,0,2.5,0"/>
<Button Content="{Binding CutEndMsg}"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding CutEndCommand}"
Visibility="{Binding CutEndBtnVisibility}"
Margin="2.5,0,0,0"/>
</UniformGrid>
@@ -94,10 +97,12 @@
<Button Content="{Binding AllExtendMsg}" Grid.Column="1"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding AllExtendCommand}"
Visibility="{Binding AllExtendBtnVisibility}"
Margin="0,0,2.5,0"/>
<Button Content="{Binding AllReduceMsg}" Grid.Column="2"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding AllReduceCommand}"
Visibility="{Binding AllReduceBtnVisibility}"
Margin="2.5,0,0,0"/>
</Grid>
@@ -115,14 +120,17 @@
<Button Content="{Binding OutCenStartMsg}"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding OutCenStartCommand}"
Visibility="{Binding OutCenStartBtnVisibility}"
Margin="0,0,2.5,0" Padding="0"/>
<Button Content="{Binding AllOutStartMsg}"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding AllOutStartCommand}"
Visibility="{Binding AllOutStartBtnVisibility}"
Margin="2.5,0,2.5,0"/>
<Button Content="{Binding AllCenStartMsg}"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding AllCenStartCommand}"
Visibility="{Binding AllCenStartBtnVisibility}"
Margin="2.5,0,0,0"/>
</UniformGrid>
@@ -132,14 +140,17 @@
<Button Content="{Binding OutCenEndMsg}"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding OutCenEndCommand}"
Visibility="{Binding OutCenEndBtnVisibility}"
Margin="0,0,2.5,0" Padding="0"/>
<Button Content="{Binding AllOutEndMsg}"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding AllOutEndCommand}"
Visibility="{Binding AllOutEndBtnVisibility}"
Margin="2.5,0,2.5,0"/>
<Button Content="{Binding AllCenEndMsg}"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding AllCenEndCommand}"
Visibility="{Binding AllCenEndBtnVisibility}"
Margin="2.5,0,0,0"/>
</UniformGrid>
@@ -159,6 +170,7 @@
<Button Content="{Binding PauseMsg}" Grid.Column="2"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding PauseCommand}"
Visibility="{Binding PauseBtnVisibility}"
Margin="2.5,0,2.5,0"/>
</UniformGrid>
@@ -174,6 +186,7 @@
<Button Content="{Binding InvertMsg}" Grid.Column="0"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding InvertCommand}"
Visibility="{Binding InvertBtnVisibility}"
Margin="2.5,0,2.5,0"/>
</UniformGrid>
+540 -27
View File
@@ -16,6 +16,25 @@ Public Class SplitModeVM
Private m_CurrLastInd As Integer = -1
Private m_SelectedItemsList As New ObservableCollection(Of NameIdLsBxItem)
' numero di lavorazioni di tipo lama
Private m_nCountSawing As Integer = 0
' numero di lavprazioni di tipo waterjet
Private m_nCountWaterjetting As Integer = 0
' altri tipi di lavorazioni (Foro/Fresa)
Private m_nCountOtherMachining As Integer = 0
' verifico che le lavorazioni selezionate siano omogenee (con lo stesso utensile)
Private m_bAreHomogeneous As Boolean = False
' Flag di pagina attiva
Private m_bActive As Boolean = False
' Drag
Private m_nDragInd As Integer = -1
Private m_nDragType As Integer = 0 '0=niente, 1=attacco, 2=uscita
Private m_ptDragPrev As Point3d
Private m_bDragging As Boolean = False
' Selected cut
Private m_nSelected As Integer = GDB_ID.NULL
Private m_ItemList As New ObservableCollection(Of NameIdLsBxItem)
Public ReadOnly Property ItemList As ObservableCollection(Of NameIdLsBxItem)
Get
@@ -45,6 +64,149 @@ Public Class SplitModeVM
End Set
End Property
Private m_CutBtnVisibility As Visibility
Public Property CutBtnVisibility As Visibility
Get
Return m_CutBtnVisibility
End Get
Set(value As Visibility)
m_CutBtnVisibility = value
NotifyPropertyChanged(NameOf(CutBtnVisibility))
End Set
End Property
Private m_CutStartBtnVisibility As Visibility
Public Property CutStartBtnVisibility As Visibility
Get
Return m_CutStartBtnVisibility
End Get
Set(value As Visibility)
m_CutStartBtnVisibility = value
NotifyPropertyChanged(NameOf(CutStartBtnVisibility))
End Set
End Property
Private m_CutEndBtnVisibility As Visibility
Public Property CutEndBtnVisibility As Visibility
Get
Return m_CutEndBtnVisibility
End Get
Set(value As Visibility)
m_CutEndBtnVisibility = value
NotifyPropertyChanged(NameOf(CutEndBtnVisibility))
End Set
End Property
Private m_OutCenStartBtnVisibility As Visibility
Public Property OutCenStartBtnVisibility As Visibility
Get
Return m_OutCenStartBtnVisibility
End Get
Set(value As Visibility)
m_OutCenStartBtnVisibility = value
NotifyPropertyChanged(NameOf(OutCenStartBtnVisibility))
End Set
End Property
Private m_OutCenEndBtnVisibility As Visibility
Public Property OutCenEndBtnVisibility As Visibility
Get
Return m_OutCenEndBtnVisibility
End Get
Set(value As Visibility)
m_OutCenEndBtnVisibility = value
NotifyPropertyChanged(NameOf(OutCenEndBtnVisibility))
End Set
End Property
Private m_InvertBtnVisibility As Visibility
Public Property InvertBtnVisibility As Visibility
Get
Return m_InvertBtnVisibility
End Get
Set(value As Visibility)
m_InvertBtnVisibility = value
NotifyPropertyChanged(NameOf(InvertBtnVisibility))
End Set
End Property
Private m_PauseBtnVisibility As Visibility
Public Property PauseBtnVisibility As Visibility
Get
Return m_PauseBtnVisibility
End Get
Set(value As Visibility)
m_PauseBtnVisibility = value
NotifyPropertyChanged(NameOf(PauseBtnVisibility))
End Set
End Property
Private m_AllOutStartBtnVisibility As Visibility
Public Property AllOutStartBtnVisibility As Visibility
Get
Return m_AllOutStartBtnVisibility
End Get
Set(value As Visibility)
m_AllOutStartBtnVisibility = value
NotifyPropertyChanged(NameOf(AllOutStartBtnVisibility))
End Set
End Property
Private m_AllCenStartBtnVisibility As Visibility
Public Property AllCenStartBtnVisibility As Visibility
Get
Return m_AllCenStartBtnVisibility
End Get
Set(value As Visibility)
m_AllCenStartBtnVisibility = value
NotifyPropertyChanged(NameOf(AllCenStartBtnVisibility))
End Set
End Property
Private m_AllOutEndBtnVisibility As Visibility
Public Property AllOutEndBtnVisibility As Visibility
Get
Return m_AllOutEndBtnVisibility
End Get
Set(value As Visibility)
m_AllOutEndBtnVisibility = value
NotifyPropertyChanged(NameOf(AllOutEndBtnVisibility))
End Set
End Property
Private m_AllCenEndBtnVisibility As Visibility
Public Property AllCenEndBtnVisibility As Visibility
Get
Return m_AllCenEndBtnVisibility
End Get
Set(value As Visibility)
m_AllCenEndBtnVisibility = value
NotifyPropertyChanged(NameOf(AllCenEndBtnVisibility))
End Set
End Property
Private m_AllExtendBtnVisibility As Visibility
Public Property AllExtendBtnVisibility As Visibility
Get
Return m_AllExtendBtnVisibility
End Get
Set(value As Visibility)
m_AllExtendBtnVisibility = value
NotifyPropertyChanged(NameOf(AllExtendBtnVisibility))
End Set
End Property
Private m_AllReduceBtnVisibility As Visibility
Public Property AllReduceBtnVisibility As Visibility
Get
Return m_AllReduceBtnVisibility
End Get
Set(value As Visibility)
m_AllReduceBtnVisibility = value
NotifyPropertyChanged(NameOf(AllReduceBtnVisibility))
End Set
End Property
#Region "Messages"
Public ReadOnly Property OnOffMsg As String
@@ -193,6 +355,10 @@ Public Class SplitModeVM
#Region "METHODS"
Friend Function InitSplitRaw() As Boolean
m_bActive = True
'm_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
m_nDragInd = -1
m_nDragType = 0
' Nascondo eventuali pezzi in parcheggio
EstCalc.HideParkedParts()
' Nascondo eventuale contorno da foto
@@ -207,7 +373,7 @@ Public Class SplitModeVM
If Not OmagOFFICEMap.refMachiningTabVM.IsShow Then
If CurrentMachine.WaterJettingActive Then ResetAllMachinings()
If SortAllMachinings() Then EstCalc.SetOrderMachiningFlag()
If CurrentMachine.WaterJettingActive Then
If CurrentMachine.WaterJettingActive Then
Dim bModif As Boolean = TestAllMachiningsForStrict()
If bModif Then OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(90321), 3, MSG_TYPE.WARNING) 'Ridotte alcune lavorazioni per evitare interferenze
End If
@@ -225,12 +391,18 @@ Public Class SplitModeVM
ShowOnePhaseMachiningPreview(m_nCurrPhase)
' Preparo la lista delle lavorazioni
CalculateSplitMachList(m_nCurrPhase, m_MachiningList)
' azzero i contatori delle lavorazioni
m_nCountSawing = 0
m_nCountWaterjetting = 0
m_nCountOtherMachining = 0
' Aggiorno visualizzazione delle lavorazioni
For nI As Integer = 0 To m_MachiningList.Count() - 1
' sistemo colore
ColorMachining(m_MachiningList(nI))
' assegno numerazione
NumberDirectionMachining(nI)
' conto il numero di tipi di lavorazioni
CountMachiningType(m_MachiningList(nI), m_nCountSawing, m_nCountWaterjetting, m_nCountOtherMachining)
Next
' Preparo la lista degli Item
ShowMachiningList()
@@ -249,6 +421,7 @@ Public Class SplitModeVM
End Function
Friend Function ExitSplitRaw(Optional bTrueExit As Boolean = True) As Boolean
m_bActive = False
' Rimuovo evidenziazione e numeri
RemoveMarkAndNumbers()
' Ripristino colori lavorazioni
@@ -394,8 +567,14 @@ Public Class SplitModeVM
HideAllMachinings()
' Preparo la lista delle lavorazioni e le disabilito
CalculateSplitMachList(m_nCurrPhase, m_MachiningList)
' azzero i contatori delle lavorazioni
m_nCountSawing = 0
m_nCountWaterjetting = 0
m_nCountOtherMachining = 0
For nI As Integer = 0 To m_MachiningList.Count() - 1
m_MachiningList(nI).m_bEnabled = False
' conto il numero di tipi di lavorazioni
CountMachiningType(m_MachiningList(nI), m_nCountSawing, m_nCountWaterjetting, m_nCountOtherMachining)
Next
' Aggiorno visualizzazione delle lavorazioni
EgtEmptyGroup(m_nNbrGrpId)
@@ -421,24 +600,28 @@ Public Class SplitModeVM
Dim sText As String = String.Empty
If Math.Abs(Mach.m_dSideAng) < EPS_ANG_SMALL Then
sText = EgtMsg(90791) & " " & i.ToString()
If Mach.m_sLay = NAME_ONPATH Then AddTopText( sText)
If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText)
Else
sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°"
End If
If Mach.m_bPause Then AddPauseText(sText)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled))
ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING))
ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura
Dim sText As String = EgtMsg(90792) & " " & i.ToString()
If Mach.m_bPause Then AddPauseText(sText)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled))
ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING))
ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura
Dim sText As String = EgtMsg(90793) & " " & i.ToString()
If Mach.m_sLay = NAME_ONPATH Then AddTopText( sText)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled))
If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING))
ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura
Dim sText As String = EgtMsg(90796) & " " & i.ToString()
If Mach.m_bPause Then AddPauseText(sText)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING))
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet
Dim sText As String = EgtMsg(90797) & " " & i.ToString()
If Mach.m_bPause Then AddPauseText(sText)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled))
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING))
End If
Next
End Sub
@@ -478,6 +661,87 @@ Public Class SplitModeVM
Not OmagOFFICEMap.refMachiningTabVM.ByHand)
' Altri bottoni
SplitModeIsEnabled = Not OmagOFFICEMap.refMachiningTabVM.IsShow
' nascondo i comandi che non devono essere visualizzati in funzione delle lavorazioni attive
If m_nCountSawing = 0 And (m_nCountWaterjetting > 0 Or m_nCountOtherMachining > 0) Then
VisibilityButtonFromMachining(MCH_OY.WATERJETTING)
Else
VisibilityButtonFromMachining(MCH_OY.SAWING)
End If
End Sub
Private Sub VerifyHomogenousMachining(ItemList As List(Of NameIdLsBxItem))
If IsNothing(ItemList) OrElse ItemList.Count = 0 Then
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
Return
End If
Dim nSawing As Integer = 0
Dim nWaterjetting As Integer = 0
Dim nOtherMachining As Integer = 0
' conto il numero di tipi di lavprazioni
For Each Item As NameIdLsBxItem In ItemList
If Item.Type = MCH_OY.SAWING Then
nSawing += 1
ElseIf Item.Type = MCH_OY.WATERJETTING Then
nWaterjetting += 1
Else
nOtherMachining += 1
End If
Next
' verifico se le lavorazioni sono omeogenee
If nSawing > 0 And (nWaterjetting > 0 Or nOtherMachining > 0) Then
m_bAreHomogeneous = False
VisibilityButtonFromMachining(MCH_OY.SAWING)
ElseIf nSawing = 0 And nOtherMachining > 0 And nWaterjetting > 0 Then
m_bAreHomogeneous = False
VisibilityButtonFromMachining(MCH_OY.WATERJETTING)
Else
VisibilityButtonFromMachining(ItemList(0).Type)
m_bAreHomogeneous = True
End If
' eventualmente stampo messaggio
If Not m_bAreHomogeneous Then
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Lavorazioni non omogenee", MSG_TYPE.WARNING)
Else
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
End If
End Sub
Private Sub VisibilityButtonFromMachining(ByVal Type As Integer)
If Type <> MCH_OY.SAWING Then
CutBtnVisibility = Visibility.Hidden
CutStartBtnVisibility = Visibility.Hidden
CutEndBtnVisibility = Visibility.Hidden
OutCenStartBtnVisibility = Visibility.Hidden
OutCenEndBtnVisibility = Visibility.Hidden
InvertBtnVisibility = Visibility.Hidden
PauseBtnVisibility = Visibility.Hidden
AllOutStartBtnVisibility = Visibility.Hidden
AllCenStartBtnVisibility = Visibility.Hidden
AllOutEndBtnVisibility = Visibility.Hidden
AllCenEndBtnVisibility = Visibility.Hidden
AllExtendBtnVisibility = Visibility.Hidden
AllReduceBtnVisibility = Visibility.Hidden
Else
CutBtnVisibility = Visibility.Visible
CutStartBtnVisibility = Visibility.Visible
CutEndBtnVisibility = Visibility.Visible
OutCenStartBtnVisibility = Visibility.Visible
OutCenEndBtnVisibility = Visibility.Visible
InvertBtnVisibility = Visibility.Visible
PauseBtnVisibility = Visibility.Visible
AllOutStartBtnVisibility = Visibility.Visible
AllCenStartBtnVisibility = Visibility.Visible
AllOutEndBtnVisibility = Visibility.Visible
AllCenEndBtnVisibility = Visibility.Visible
AllExtendBtnVisibility = Visibility.Visible
AllReduceBtnVisibility = Visibility.Visible
End If
End Sub
Private Function ModifyOtherLeadIn(nI As Integer, nLiOthType As Integer) As Boolean
@@ -805,7 +1069,16 @@ Public Class SplitModeVM
' Imposto flag di modifica
m_bModified = True
' Abilitazione bottone Next
EnableButtons()
' EnableButtons()
' recupero l'elenco degli elementi selezionati
Dim ItemList As New List(Of NameIdLsBxItem)
For Each Item As NameIdLsBxItem In m_SelectedItemsList ' MachiningLsBx.SelectedItems
ItemList.Add(Item)
Next
'For Each Item As NameIdLsBxItem In m_ItemList
' If Item.bIsActive Then ItemList.Add(Item)
'Next
VerifyHomogenousMachining(ItemList)
End Sub
#End Region ' OnOffCommand
@@ -1445,13 +1718,22 @@ Public Class SplitModeVM
If Not ModifStartWindow.ShowDialog() Then Return
' Modifica della lavorazione
Dim dUsal As Double = ModifStartWindowVM.GetVal()
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
If dAddLen - dOrigUsal < -10 * EPS_SMALL Then Return
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
Dim bRepeat As Boolean = False
Do
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
If dAddLen - dOrigUsal < -10 * EPS_SMALL Then Return
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
bRepeat = Not UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
If bRepeat Then
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dOrigUsal)
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
dUsal = dOrigUsal
End If
Loop Until Not bRepeat
' verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ColorMachining(m_MachiningList(nI))
@@ -1540,14 +1822,25 @@ Public Class SplitModeVM
ModifStartWindowVM.SetVal(dOrigUeal)
If Not ModifStartWindow.ShowDialog() Then Return
' Modifica della lavorazione
Dim dUsal As Double = ModifStartWindowVM.GetVal()
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
If dAddLen - dOrigUeal < -10 * EPS_SMALL Then Return
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUsal - dOrigUeal)
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUsal)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
Dim dUeal As Double = ModifStartWindowVM.GetVal()
Dim bRepeat As Boolean = False
Do
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
If dAddLen - dOrigUeal < -10 * EPS_SMALL Then
Return
End If
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUeal)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
bRepeat = Not UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
If bRepeat Then
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dOrigUeal)
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
dUeal = dOrigUeal
End If
Loop Until Not bRepeat
' verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ColorMachining(m_MachiningList(nI))
@@ -1690,6 +1983,200 @@ Public Class SplitModeVM
#End Region ' COMMANDS
#Region "EVENTS"
Friend Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse OmagOFFICEMap.refMachiningTabVM.IsShow Then Return
' Si può selezionare solo con il tasto sinistro e se stato NULL
If e.Button <> Windows.Forms.MouseButtons.Left Or
Not OmagOFFICEMap.refSceneHostVM.MainScene.IsStatusNull() Then
Return
End If
' Reset drag
m_nDragInd = -1
m_nDragType = 0
' Reset selection interface
m_nSelected = GDB_ID.NULL
' Verifico se selezionato estremo di taglio con lama
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSel As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
Dim nId As Integer = EgtGetFirstObjInSelWin()
While nId <> GDB_ID.NULL
' Verifico sia un attacco o uscita di taglio con lama
Dim nType As Integer = 0
Dim sName As String = ""
EgtGetName(nId, sName)
If String.Compare(sName, NAME_PV_PRECUT) = 0 Then
nType = 1
ElseIf String.Compare(sName, NAME_PV_POSTCUT) = 0 Then
nType = 2
ElseIf String.Compare(sName, NAME_PV_CUT) = 0 Then
nType = 3
End If
If nType = 1 Or nType = 2 Then
Dim nPvId As Integer = EgtGetParent(EgtGetParent(nId))
Dim nMchId As Integer = GDB_ID.NULL
If EgtGetInfo(nPvId, "MId", nMchId) Then
For nInd As Integer = 0 To m_MachiningList.Count() - 1
If m_MachiningList(nInd).m_nId = nMchId Then
m_nDragInd = nInd
m_nDragType = nType
End If
For nJ As Integer = 0 To m_MachiningList(nInd).m_vOthId.Count() - 1
If m_MachiningList(nInd).m_vOthId(nJ) = nMchId Then
m_nDragInd = nInd
m_nDragType = nType
Exit For
End If
Next
If m_nDragInd >= 0 Then
' Assegno l'id dell'elemento selezionato
m_nSelected = m_nDragInd
Exit For
End If
Next
End If
If m_nDragInd >= 0 Then
' Assegno l'id dell'elemento selezionato
m_nSelected = m_nDragInd
Exit While
End If
ElseIf nType = 3 Then
Dim nPvId As Integer = EgtGetParent(EgtGetParent(nId))
Dim nMchId As Integer = GDB_ID.NULL
If EgtGetInfo(nPvId, "MId", nMchId) Then
For nInd As Integer = 0 To m_MachiningList.Count() - 1
If m_MachiningList(nInd).m_nId = nMchId Then
m_nSelected = nInd
End If
For nJ As Integer = 0 To m_MachiningList(nInd).m_vOthId.Count() - 1
If m_MachiningList(nInd).m_vOthId(nJ) = nMchId Then
m_nSelected = nInd
Exit For
End If
Next
If m_nSelected >= 0 Then Exit For
Next
End If
If m_nSelected >= 0 Then Exit While
End If
nId = EgtGetNextObjInSelWin()
End While
' Sistemazioni per drag
If m_nSelected >= 0 AndAlso EgtUnProjectPoint(e.Location, m_ptDragPrev) Then
Dim nItemIndex = 0
For Each Item In ItemList
Item.IsSelected = (nItemIndex = m_nSelected)
nItemIndex += 1
Next
Else
m_nDragInd = -1
m_nDragType = 0
m_nSelected = GDB_ID.NULL
End If
End Sub
Friend Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse OmagOFFICEMap.refMachiningTabVM.IsShow Then Return
' Se drag non abilitato o in corso
If m_nDragInd = -1L Or m_bDragging Then Return
m_bDragging = True
Dim nOperId As Integer = m_MachiningList(m_nDragInd).m_nId
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' Ricavo il vettore di movimento e la variazione di lunghezza
Dim vtMove As Vector3d = ptCurr - m_ptDragPrev
Dim dDelta = vtMove * m_MachiningList(m_nDragInd).m_vtDir
If m_nDragType = 1 Then
Dim dOrigUsal As Double = 0
Dim dUsal As Double
' ----------------------- REPEAT -----------------------
Do
dDelta = -dDelta
' Leggo il valore salvato nella geometria
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
dUsal = dOrigUsal + dDelta
' Se c'è limite alla lunghezza libera
If m_MachiningList(m_nDragInd).m_dStartFreeLen < FREELEN_INF Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, CurrentMachine.sMachIniFile), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUsal = Math.Min(dUsal, m_MachiningList(m_nDragInd).m_dStartFreeLen - dDT - dCornerSafety)
End If
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
If dAddLen - dOrigUsal < -10 * EPS_SMALL Then
m_bDragging = False
Return
End If
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
Loop Until UpdateMachiningPreview(m_MachiningList(m_nDragInd).m_nId, True)
' ----------------------- REPEAT (solo se il segmento scompare) -----------------------
Else
Dim dOrigUeal As Double = 0
Dim dUeal As Double
dDelta = -dDelta
Do
dDelta = -dDelta
' Leggo il valore salvato nella geometria
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
dUeal = dOrigUeal + dDelta
' Se c'è limite alla lunghezza libera
If m_MachiningList(m_nDragInd).m_dEndFreeLen < FREELEN_INF Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, CurrentMachine.sMachIniFile), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUeal = Math.Min(dUeal, m_MachiningList(m_nDragInd).m_dEndFreeLen - dDT - dCornerSafety)
End If
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
If dAddLen - dOrigUeal < -10 * EPS_SMALL Then
m_bDragging = False
Return
End If
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUeal)
Loop Until UpdateMachiningPreview(m_MachiningList(m_nDragInd).m_nId, True)
End If
' verifico interferenza
EgtVerifyMachining(m_MachiningList(m_nDragInd).m_nId, m_MachiningList(m_nDragInd).m_nInterf)
ColorMachining(m_MachiningList(m_nDragInd))
ColorNumberArrow(m_nDragInd)
' Aggiorno visualizzazione
EgtDraw()
m_bModified = True
' Aggiorno punto e stato di drag
m_ptDragPrev = ptCurr
m_bDragging = False
End Sub
Friend Sub OnMyMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse OmagOFFICEMap.refMachiningTabVM.IsShow Then Return
' Se drag in corso
If m_nDragInd >= 0 Then
m_nDragInd = -1
End If
End Sub
#End Region ' EVENTS
'-----------------------------------------------------------------------------------------------
Public Class NameIdLsBxItem
@@ -1698,6 +2185,7 @@ Public Class SplitModeVM
Private m_nInd As Integer
Private m_sName As String
Private m_bIsActive As Boolean
Private m_nType As Integer
Public Property Ind As Integer
Get
@@ -1740,16 +2228,31 @@ Public Class SplitModeVM
Set(value As Boolean)
If Not IsNothing(value) Then
m_IsSelected = value
If value Then
If value AndAlso Not OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Contains(Me) Then
OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Add(Me)
Else
OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Remove(Me)
End If
' se non è stato aggiunto nessun nuovo elemento alla lista dei selezionati allora esco
If OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count = 0 Then
EgtDraw()
NotifyPropertyChanged("IsSelected")
Return
End If
' se ho un solo elemento allora so che è coerrente con se stesso come lavorazione
If OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count = 1 Then
OmagOFFICEMap.refSplitModeVM.m_bAreHomogeneous = True
End If
' creo lista ordinata dei selezionati
Dim ItemList As New List(Of NameIdLsBxItem)
For Each Item In OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList
ItemList.Add(Item)
Next
' ------------------------ verifico che le lavorazioni siano dello stesso tipo ------------------------
OmagOFFICEMap.refSplitModeVM.VerifyHomogenousMachining(ItemList)
' -----------------------------------------------------------------------------------------------------
ItemList.Sort(Function(x, y) Comparer(Of Integer).Default.Compare(OmagOFFICEMap.refSplitModeVM.m_ItemList.IndexOf(x),
OmagOFFICEMap.refSplitModeVM.m_ItemList.IndexOf(y)))
If Not My.Computer.Keyboard.ShiftKeyDown And (My.Computer.Keyboard.CtrlKeyDown And value) Then
@@ -1795,10 +2298,20 @@ Public Class SplitModeVM
End Set
End Property
Sub New(Name As String, Ind As Integer, bIsActive As Boolean)
Public Property Type As Integer
Get
Return m_nType
End Get
Set(value As Integer)
m_nType = value
End Set
End Property
Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer)
Me.m_sName = Name
Me.m_nInd = Ind
Me.m_bIsActive = bIsActive
Me.m_nType = nType
End Sub
End Class
+18 -5
View File
@@ -24,7 +24,7 @@
Command="{Binding ImportDxfCommand}">
<Image Source="/Resources/NestingTab/ImportDxf.png" Stretch="Uniform"/>
</Button>
<ToggleButton Grid.Column="4" Grid.Row="0"
<ToggleButton Grid.Column="4" Grid.Row="0"
Style="{StaticResource OptionPanel_NestingToggleButton}"
IsChecked="{Binding CsvImport_IsChecked}">
<Image Source="/Resources/NestingTab/ImportCsv.png" Stretch="Uniform"/>
@@ -148,11 +148,24 @@
Margin="2.5,0,0,0"/>
</UniformGrid>
<Button Content="{Binding RemovePartMsg}"
Style="{StaticResource OptionPanel_TextButton}"
Command="{Binding RemovePartCommand}"
Margin="0,0,0,5"/>
<Grid Margin="0,0,-2.5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Content="{Binding RemovePartMsg}"
Grid.ColumnSpan="{Binding DragRettangle_Cl_Span}"
Style="{StaticResource OptionPanel_TextButton}"
Command="{Binding RemovePartCommand}"
Margin="0,0,2.5,0"/>
<ToggleButton Content="{Binding DragRettangleMsg}" Grid.Column="1"
Visibility="{Binding DragRettangle_Visibility}"
Style="{StaticResource OptionPanel_ToggleButton}"
IsChecked="{Binding bDragRettangle}"
Margin="2.5,0,2.5,0"/>
</Grid>
<UniformGrid Columns="2" Margin="0,0,0,5">
<Button Content="{Binding SelectAllMsg}"
Style="{StaticResource OptionPanel_TextButton}"
+362 -3
View File
@@ -35,6 +35,18 @@ Public Class NestingTabVM
Private m_bTrfData As Boolean = False
Private m_bCsvData As Boolean = False
' Id del rettangolo, del traglio e della curva da modificare tramite Drag
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedRegionRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedSawRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedCurvRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedTextRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedTextTopRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedFlatSurfRettangle As Integer = GDB_ID.NULL
Private m_SideListRettangle(4) As Integer
Private m_sTextContent As String = String.Empty
Private m_CsvImportWindow As CsvWindowV
Friend ReadOnly Property CsvImportWindow As CsvWindowV
Get
@@ -161,6 +173,12 @@ Public Class NestingTabVM
End Get
End Property
Public ReadOnly Property DragRettangleMsg As String
Get
Return "Drag Rettangle"
End Get
End Property
Public ReadOnly Property SelectAllMsg As String
Get
Return EgtMsg(MSG_NESTPAGEUC + 4)
@@ -211,6 +229,13 @@ Public Class NestingTabVM
#Region "CONSTRUCTOR"
Sub New()
If (GetMainPrivateProfileInt(S_NEST, K_DRAGRETTANGLE, 1) <> 0) Then
m_DragRettangle_Visibility = Visibility.Visible
Else
m_DragRettangle_Visibility = Visibility.Collapsed
End If
NotifyPropertyChanged("DragRettangle_Visibility")
NotifyPropertyChanged("DragRettangle_Cl_Span")
' Creo riferimento a questa classe in OmagOFFICEMap
OmagOFFICEMap.SetRefNestingTabVM(Me)
End Sub
@@ -506,8 +531,318 @@ Public Class NestingTabVM
Return True
End Function
#Region "DRAG RETTANGLE"
' funzione chiamata da OnMyMouseMoveScene: verifica che la selezione sia corretta (deve essere il lato di una figura rettangolare)
Private Sub OnMyMouseDownSceneSelSideRettangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
If e.Button <> Windows.Forms.MouseButtons.Left Then
Return
End If
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim sLayer As String = String.Empty
' layer di origine
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sLayer)
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
If sLayer = NAME_OUTLOOP Then
If EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
' -------------------------------- INIZIO VERIFICHE --------------------------------
m_nIdSelectedOutLoopRettangle = nIdParent
If Not IsRettangle(m_SideListRettangle) Then
'm_CurrProjPage.ClearMessage()
'm_CurrProjPage.SetWarningMessage("Non è un rettangolo (0)")
Return
End If
' recupero il gruppo della lavorazione associata
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
' se non esiste un gruppo di lavorazione associato allora esco
If nIdPV = GDB_ID.NULL Then
'm_CurrProjPage.ClearMessage()
'm_CurrProjPage.SetWarningMessage("Pezzo in parcheggio (1)")
Return
End If
' se esiste ma è vuoto (pezzo scaricato da tavola)
If EgtGetFirstInGroup(nIdPV) = GDB_ID.NULL Then
'm_CurrProjPage.ClearMessage()
'm_CurrProjPage.SetWarningMessage("Pezzo in parcheggio (2)")
Return
End If
' Devo verificare che sia una lavorazione solo di lama?
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
' -------------------------------- FINE VERIFICHE --------------------------------
If Not EgtGetGroupObjs(nIdSaw) Then
m_nIdSelectedSawRettangle = nIdSaw
m_nIdSelectedCurvRettangle = nIdMy
m_nIdSelectedRegionRettangle = EgtGetFirstNameInGroup(nIdParentPart, NAME_REGION)
' recupero i testi cintenuti nel layer Region
If m_nIdSelectedRegionRettangle <> GDB_ID.NULL Then
Dim nCurrId As Integer = EgtGetFirstInGroup(m_nIdSelectedRegionRettangle)
While nCurrId <> GDB_ID.NULL
If EgtGetType(nCurrId) = GDB_TY.EXT_TEXT Then
Dim sVal As String = String.Empty
EgtTextGetContent(nCurrId, sVal)
If sVal = "*TOP*" Then
m_nIdSelectedTextTopRettangle = nCurrId
Else
m_nIdSelectedTextRettangle = nCurrId
m_sTextContent = GetMyRettangleText(sVal)
End If
ElseIf EgtGetType(nCurrId) = GDB_TY.SRF_FRGN Then
m_nIdSelectedFlatSurfRettangle = nCurrId
End If
nCurrId = EgtGetNext(nCurrId)
End While
End If
' seleziono ed evidenzio il lato selezionato
EgtSelectObj(nIdSaw)
EgtSetMark(nIdSaw)
EgtSelectObj(nIdMy)
EgtDraw()
Exit While
End If
End If
' se le'elemto corrente non è una linea
End If
' se le'elemto corrente non appartiene al layer OutLoop passo al prossimo elemento dell'elenco
nIdMy = EgtGetNextObjInSelWin()
End While
End Sub
' restituisce il valore del Text ripulito dalle dimensioni
Private Function GetMyRettangleText(sTextPz As String) As String
' da DrawPageUC.xaml.vb/MultipleInsert
Dim sText As String = String.Empty
If sTextPz.Contains("<br/>") Then
Dim nLastIndex As Integer = sTextPz.LastIndexOf(">")
sText = sTextPz.Remove(nLastIndex + 1)
Return sText
End If
If sTextPz.Contains(" ") Then
Dim sInfo() As String = sTextPz.Split(" "c)
If sInfo.Count > 3 Then
Return sText = sInfo(0) & " " & sInfo(1) & " "
End If
End If
Return sText
End Function
' verifico che la figura selezionata sia realmente un rettangolo
Private Function IsRettangle(ByRef IdSideList() As Integer) As Boolean
' creo una lista con i lati del rettangolo
Dim nCounter As Integer = 0
' recupero i lati dal leyer "OutLoop"
Dim IdSideRettangle As Integer = EgtGetFirstInGroup(m_nIdSelectedOutLoopRettangle)
While IdSideRettangle <> GDB_ID.NULL And nCounter < 4
Dim sVal As String = String.Empty
Dim dPrevAng As Double = 0
EgtGetInfo(IdSideRettangle, "PrevAng", sVal)
StringToDouble(sVal, dPrevAng)
Dim dNextAng As Double = 0
EgtGetInfo(IdSideRettangle, "NextAng", sVal)
StringToDouble(sVal, dNextAng)
' se gli angoli non sono retti allora esco senza caricare il lato corrente
If Math.Abs(dPrevAng - 90) > EPS_ANG_SMALL OrElse Math.Abs(dNextAng - 90) > EPS_ANG_SMALL Then
Exit While
End If
IdSideList(nCounter) = IdSideRettangle
nCounter += 1
IdSideRettangle = EgtGetNext(IdSideRettangle)
End While
' verifico che siano solo quattro lati
If IdSideRettangle = GDB_ID.NULL And nCounter = 4 Then
' solo se la figura ha 4 lati ortogonali
Return True
End If
m_nIdSelectedOutLoopRettangle = GDB_ID.NULL
' la figura presenta più/meno di 4 lati
Return False
End Function
' recupero le informazioni correnti per sapere se la figura è mdificabile
Private Function GetRettangleInfoScale(ByRef frFixed As Frame3d, ByRef MaxLen As Double, ByRef MinLen As Double) As Vector3d
' determino la direzione del lato selezionato
Dim vtDirSelectedCurv As New Vector3d
EgtStartVector(m_nIdSelectedCurvRettangle, GDB_ID.ROOT, vtDirSelectedCurv)
' recupero il lato successivo a quello selezionato
Dim Index As Integer = 0
Dim Len As Double = 0
For Ind As Integer = 0 To 3
If m_SideListRettangle(Ind) = m_nIdSelectedCurvRettangle Then
' verifico se esiste un lato Precedente altrimenti recupero l'ultimo della lista
If Ind = 0 Then
Index = 3
Else
Index = Ind - 1
End If
End If
Next
' recupero la dimensione del lato
EgtCurveLength(m_SideListRettangle(Index), MaxLen)
EgtCurveLength(m_nIdSelectedCurvRettangle, MinLen)
' verifico che il lato selezionato sia il maggiore
If MinLen > MaxLen Then Return Nothing
' determimo il versore dal lato appena calcolato
Dim vtDir As New Vector3d
EgtStartVector(m_SideListRettangle(Index), GDB_ID.ROOT, vtDir)
vtDir.Normalize()
Dim dProjectionBaseX As Double = vtDir * Vector3d.X_AX
Dim ptFixed As New Point3d
EgtStartPoint(m_SideListRettangle(Index), GDB_ID.ROOT, ptFixed)
Dim vtPerp As New Vector3d(vtDir.x, vtDir.y, vtDir.z)
vtPerp.Rotate(Vector3d.Z_AX, 90)
' determino il Frame corrente
frFixed = New Frame3d(ptFixed, vtDir, vtPerp, Vector3d.Z_AX)
Return vtDir
End Function
' funzione chiamata da OnMyMouseMoveScene: gestisce la modifica lungo una dimensione del rettangolo selezionato
Private Sub OnMyMouseMoveSawRettangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Se drag non abilitato o già in esecuzione, esco
If Not m_bDrag Or m_bDragging Then Return
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
If m_bDragToStart Then
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Return
End If
m_bDragToStart = False
End If
' riferiemento che deve rimanere fisso del rettangolo
Dim frFixed As Frame3d = Nothing
' lunghezza del lato da modificare
Dim MaxLen As Double = 0
Dim MinLen As Double = 0
' recupero info sul rettangolo selezionato
Dim vtDir As Vector3d = GetRettangleInfoScale(frFixed, MaxLen, MinLen)
If vtDir.Equals(Vector3d.NULL) Then
Return
End If
' Inizio esecuzione di drag
m_bDragging = True
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' Ricavo il vettore di movimento
Dim vtMove As Vector3d = ptCurr - m_ptPrev
' ricavo il valore efficace di allungamento (la proiezione)
Dim dProjection As Double = vtMove * vtDir
vtMove = vtDir * dProjection
' recupero il valore di scalatura
Dim dScalefactor = dProjection / MaxLen + 1
' Modifico dimensione figura
If Math.Abs(dScalefactor) > EPS_SMALL * EPS_SMALL Then
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, dScalefactor, 1, 1, GDB_ID.ROOT)
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, dScalefactor, 1, 1, GDB_ID.ROOT)
Dim ptCen As Point3d
EgtCenterPoint(m_nIdSelectedTextRettangle, ptCen)
EgtModifyText(m_nIdSelectedTextRettangle, m_sTextContent & LenToString(MaxLen + dProjection, 2) & " x " & LenToString(MinLen, 2))
EgtMove(m_nIdSelectedTextRettangle, vtMove * 0.5)
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
EgtMove(m_nIdSelectedTextTopRettangle, vtMove * 0.5)
End If
End If
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
EnableReferenceRegion(False)
' se la modifica genera un errore allora ripristino la figura prima della defomrazione
If Not EgtVerifyPart(EgtGetParent(m_nIdSelectedOutLoopRettangle), True) Then
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
Dim ptCen As Point3d
EgtCenterPoint(m_nIdSelectedTextRettangle, ptCen)
EgtModifyText(m_nIdSelectedTextRettangle, m_sTextContent & LenToString(MaxLen, 2) & " x " & LenToString(MinLen, 2))
EgtMove(m_nIdSelectedTextRettangle, -vtMove * 0.5)
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
EgtMove(m_nIdSelectedTextTopRettangle, -vtMove * 0.5)
End If
End If
EgtDraw()
' Aggiorno il punto precedente
m_ptPrev = ptCurr
' Terminata esecuzione di drag
m_bDragging = False
End Sub
' funzione chiamata da OnMyMouseUp: gestisce il reset di tutti gli indici in uso
Public Sub ResetDragRettangleParam()
' deseleziono l'elemento corrente
EgtDeselectObj(m_nIdSelectedSawRettangle)
EgtDeselectObj(m_nIdSelectedCurvRettangle)
EgtResetMark(m_nIdSelectedSawRettangle)
' resetto gli indici
m_nIdSelectedOutLoopRettangle = GDB_ID.NULL
m_nIdSelectedRegionRettangle = GDB_ID.NULL
m_nIdSelectedSawRettangle = GDB_ID.NULL
m_nIdSelectedCurvRettangle = GDB_ID.NULL
m_nIdSelectedTextRettangle = GDB_ID.NULL
m_nIdSelectedTextTopRettangle = GDB_ID.NULL
m_nIdSelectedFlatSurfRettangle = GDB_ID.NULL
m_SideListRettangle = {GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL}
m_sTextContent = String.Empty
' disattivo il drag
m_bDrag = False
' aggiorno le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
EgtDraw()
End Sub
#End Region ' Drag Rettangolo
#End Region ' METHODS
Private m_bDragRettangle As Boolean
Public Property bDragRettangle As Boolean
Get
Return m_bDragRettangle
End Get
Set(value As Boolean)
m_bDragRettangle = value
End Set
End Property
Private m_DragRettangle_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property DragRettangle_Visibility As Visibility
Get
Return m_DragRettangle_Visibility
End Get
End Property
Public ReadOnly Property DragRettangle_Cl_Span As Integer
Get
If m_DragRettangle_Visibility = Visibility.Visible Then
Return 1
End If
Return 2
End Get
End Property
#Region "COMMANDS"
#Region "DrawCommand"
@@ -523,6 +858,7 @@ Public Class NestingTabVM
Public Sub Draw(ByVal param As Object)
Dim CompoWindow As New CompoWindowV(Application.Current.MainWindow, New CompoWindowVM)
CompoWindow.Height = 700
CompoWindow.ShowDialog()
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
End Sub
@@ -1168,6 +1504,17 @@ Public Class NestingTabVM
#Region "EVENTS"
Friend Sub OnMouseDownScene(sender As Object, e As Windows.Forms.MouseEventArgs)
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
If m_bDragRettangle Then
OnMyMouseDownSceneSelSideRettangle(sender, e)
' Dati per drag (abilito il Drag)
m_locPrev = e.Location
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRettangle <> GDB_ID.NULL
m_bDragToStart = m_bDrag
m_bVerify = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) > 0
m_vtTotMove = Vector3d.NULL()
Return
End If
' Per default no drag
m_bDrag = False
' Verifico se selezionato indicativo di pezzo
@@ -1215,6 +1562,13 @@ Public Class NestingTabVM
End If
m_bDragToStart = False
End If
' se devo muovere un lato del rettangolo
If m_bDragRettangle Then
OnMyMouseMoveSawRettangle(sender, e)
Return
End If
' Determino cosa muovere
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
' Verifico se in tavola o in parcheggio
@@ -1303,6 +1657,11 @@ Public Class NestingTabVM
End Sub
Friend Sub OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
If m_bDragRettangle Then
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
ResetDragRettangleParam()
Return
End If
' Se eseguito drag
If Not m_bDragToStart Then
' Se movimento con sola verifica finale
@@ -1336,11 +1695,11 @@ Public Class NestingTabVM
End If
End If
m_bFromParking = False
' altrimenti caso con verifica durante il movimento
' altrimenti caso con verifica durante il movimento
Else
' Basta reset alla fine
End If
' Se selezione da eseguire
' Se selezione da eseguire
ElseIf m_nIdToSel <> GDB_ID.NULL Then
' Determino se pezzo in tavola o in parcheggio
Dim bPartInTable As Boolean = (EgtGetParent(m_nIdToSel) = GetRawId())
@@ -1357,7 +1716,7 @@ Public Class NestingTabVM
VeinMatching.OnSelectPart(m_nIdToSel)
' Set flag posizione selezionati
m_nPartPos = If(bPartInTable, PART_POS.IN_TABLE, PART_POS.OUT_TABLE)
' Se deselezione da eseguire
' Se deselezione da eseguire
ElseIf m_nIdToDesel <> GDB_ID.NULL Then
EgtDeselectObj(m_nIdToDesel)
' Eventuale aggiornamento VeinMatching
+1 -1
View File
@@ -129,7 +129,7 @@
Margin="13,0,0,5"
IsEnabled="{Binding OffsetYIsEnabled}" TextAlignment="Right"/>
<TextBlock Text="{Binding KerfMsg}"/>
<EgtWpfLib5:EgtTextBox Text="{Binding Kerf}"
<EgtWpfLib5:EgtTextBox Text="{Binding Kerf, UpdateSourceTrigger=PropertyChanged}"
Margin="13,0,0,5"
IsEnabled="{Binding KerfIsEnabled}" TextAlignment="Right"/>
+138 -26
View File
@@ -108,7 +108,7 @@ Public Class RawPartTabVM
Private m_dPhotoOffsetX As Double
Public Property PhotoOffsetX As String
Get
Return LenToString(m_dPhotoOffsetX, -2)
Return LenToString(m_dPhotoOffsetX, 2)
End Get
Set(value As String)
Dim dVal As Double = 0
@@ -125,7 +125,7 @@ Public Class RawPartTabVM
Private m_dPhotoOffsetY As Double
Public Property PhotoOffsetY As String
Get
Return LenToString(m_dPhotoOffsetY, -2)
Return LenToString(m_dPhotoOffsetY, 2)
End Get
Set(value As String)
Dim dVal As Double = 0
@@ -142,7 +142,7 @@ Public Class RawPartTabVM
Private m_dPhotoRot As Double
Public Property PhotoRot As String
Get
Return LenToString(m_dPhotoRot, -2)
Return LenToString(m_dPhotoRot, 2)
End Get
Set(value As String)
Dim dVal As Double = 0
@@ -223,15 +223,17 @@ Public Class RawPartTabVM
End Set
End Property
#Region "Parametri Grezzo"
Private m_dLength As Double
Public Property Length As String
Get
If m_InvertKerf < 0 Then
Return LenToString(m_dLength + 2 * m_dKerf, -2)
Return LenToString(m_dLength + 2 * m_dKerf, 2)
Else
Return LenToString(m_dLength, -2)
Return LenToString(m_dLength, 2)
End If
'Return LenToString(m_dLength, -2)
'Return LenToString(m_dLength, 2)
End Get
Set(value As String)
Dim dLength As Double = 0
@@ -279,9 +281,9 @@ Public Class RawPartTabVM
Public Property Width As String
Get
If m_InvertKerf < 0 Then
Return LenToString(m_dWidth + 2 * m_dKerf, -2)
Return LenToString(m_dWidth + 2 * m_dKerf, 2)
Else
Return LenToString(m_dWidth, -2)
Return LenToString(m_dWidth, 2)
End If
End Get
Set(value As String)
@@ -329,7 +331,7 @@ Public Class RawPartTabVM
Private m_dHeight As Double
Public Property Height As String
Get
Return LenToString(m_dHeight, -2)
Return LenToString(m_dHeight, 2)
End Get
Set(value As String)
Dim dHeight As Double = 0
@@ -370,9 +372,9 @@ Public Class RawPartTabVM
Public Property OffsetX As String
Get
If m_InvertKerf < 0 Then
Return LenToString(m_dOffsetX - m_dKerf, -2)
Return LenToString(m_dOffsetX - m_dKerf, 2)
Else
Return LenToString(m_dOffsetX, -2)
Return LenToString(m_dOffsetX, 2)
End If
End Get
Set(value As String)
@@ -388,7 +390,7 @@ Public Class RawPartTabVM
RecalcRawPart()
ElseIf m_InvertKerf < 0 And dOffsetX >= 0 And dOffsetX < dMaxOffsetX + m_dKerf Then
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
m_dOffsetX = dOffsetX + m_dKerf
m_dOffsetX = dOffsetX
RecalcRawPart()
ElseIf dOffsetX <= dMinOffsetX - EPS_SMALL Then
NotifyPropertyChanged("OffsetX")
@@ -435,9 +437,9 @@ Public Class RawPartTabVM
Public Property OffsetY As String
Get
If m_InvertKerf < 0 Then
Return LenToString(m_dOffsetY - m_dKerf, -2)
Return LenToString(m_dOffsetY - m_dKerf, 2)
Else
Return LenToString(m_dOffsetY, -2)
Return LenToString(m_dOffsetY, 2)
End If
End Get
Set(value As String)
@@ -453,7 +455,7 @@ Public Class RawPartTabVM
RecalcRawPart()
ElseIf m_InvertKerf < 0 And dOffsetY >= 0 And dOffsetY < dMaxOffsetY + m_dKerf Then
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
m_dOffsetY = dOffsetY + m_dKerf
m_dOffsetY = dOffsetY
RecalcRawPart()
ElseIf dOffsetY <= dMinOffsetY - EPS_SMALL Then
NotifyPropertyChanged("OffsetY")
@@ -496,6 +498,7 @@ Public Class RawPartTabVM
End Set
End Property
Private m_PrecKerf As Double = 1
Private m_InvertKerf As Double = 1
Public ReadOnly Property InvertKerf As Double
Get
@@ -510,12 +513,18 @@ Public Class RawPartTabVM
Private m_dKerf As Double
Public Property Kerf As String
Get
Return LenToString(m_dKerf * m_InvertKerf, -2)
Return LenToString(m_dKerf * m_InvertKerf, 2)
End Get
Set(value As String)
Dim dKerf As Double = 0
Dim dMaxKerf As Double = Math.Min(Math.Min(m_dOffsetX, m_dOffsetY),
Math.Min(m_dTableLength - m_dLength - m_dOffsetX, m_dTableWidth - m_dWidth - m_dOffsetY))
' recuper il segno del valore del Kerf precedente
Dim dInvertKerf As Double = 1
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf)
m_PrecKerf = Math.Abs(m_dKerf)
m_PrecKerf = m_PrecKerf * dInvertKerf
' carcio di dati della lastra letti da intrfaccia
Dim dRawLength, dRawWidth, dRawOffsetX, dRawOffsetY As Double
If Not StringToLen(Length, dRawLength) Then Return
@@ -526,9 +535,22 @@ Public Class RawPartTabVM
If Not StringToLen(value, dKerf) Then
Return
End If
' interrompo il processo di caricamento dati se il valore della TexBox è lo stesso della calsse
If dKerf * dInvertKerf = m_dKerf Then Return
If dKerf >= 0 And dKerf < dMaxKerf + EPS_SMALL Then
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
If GetRawMode() <> RAWMODE.FROM_PHOTO Then
If m_PrecKerf < 0 Then
' definsco la dimensione del grezzo pari a quella del kerf
m_dKerf = 0
AdjustRawPartNegativeKerf()
UpdateCircles()
UpdateRawPartKerf()
m_dKerf = dKerf
m_PrecKerf = 0
End If
' Specifico che si tratta di un Kerf negativo (per interfaccia grafica)
EgtSetInfo(EstCalc.GetRawId(), KEY_INVERT_KERF, 1)
SetInvertKerf(1)
@@ -538,7 +560,7 @@ Public Class RawPartTabVM
m_dOffsetX = dRawOffsetX
m_dOffsetY = dRawOffsetY
m_dKerf = dKerf
RecalcRawPart()
' RecalcRawPart()
UpdateRawPartKerf()
' Recupero id contorno kerf
Dim nKerfId As Integer = EgtGetFirstNameInGroup(EstCalc.GetRawId(), NAME_KERF)
@@ -554,14 +576,37 @@ Public Class RawPartTabVM
EgtSetInfo(EstCalc.GetRawId(), KEY_INVERT_KERF, -1)
SetInvertKerf(-1)
' aggiorno dati grezzo (partendo dalle dimensioni esterne del grezzo)
m_dLength = dRawLength + 2 * dKerf
m_dWidth = dRawWidth + 2 * dKerf
m_dOffsetX = dRawOffsetX - dKerf
m_dOffsetY = dRawOffsetY - dKerf
If m_PrecKerf >= 0 Then
m_dLength = dRawLength + 2 * dKerf
m_dWidth = dRawWidth + 2 * dKerf
m_dOffsetX = dRawOffsetX - dKerf
m_dOffsetY = dRawOffsetY - dKerf
End If
m_dKerf = -dKerf
RecalcRawPart()
If m_PrecKerf >= 0 Then
' definsco la dimensione del grezzo pari a quella del kerf
m_dKerf = 0
AdjustRawPartNegativeKerf(False)
EgtDraw()
UpdateCircles()
EgtDraw()
UpdateRawPartKerf()
EgtDraw()
m_dKerf = -dKerf
m_PrecKerf = 0
End If
If Not AdjustRawPartNegativeKerf() Then
' se fallisce la generazione (TEMPORANEAMENTE) ripristino l'ultimo valore inserito (vedi riga sopra)!
m_dKerf = 0
NotifyPropertyChanged("Kerf")
End If
EgtDraw()
UpdateCircles()
EgtDraw()
' RecalcRawPart()
'EstCalc.UpdateRawPart()
UpdateRawPartKerf()
'UpdateRawPartKerf()
' Recupero id contorno kerf
Dim nKerfId As Integer = EgtGetFirstNameInGroup(EstCalc.GetRawId(), NAME_KERF)
' Modifico il colore
@@ -601,6 +646,8 @@ Public Class RawPartTabVM
End Set
End Property
#End Region ' Parametri Grezzo
Public ReadOnly Property MaterialList As ObservableCollection(Of Material)
Get
Return CurrentMachine.Materials
@@ -942,6 +989,7 @@ Public Class RawPartTabVM
If OmagOFFICEMap.refMainWindowVM.MainWindowM.m_SlabDB Then
'Me.OmagPhoto = New OmagPhotoV(Application.Current.MainWindow(), New OmagPhotoVM)
Me.OmagPhoto = New OmagPhotoV
If Not PhotoMap.ContinueApplication Then End
End If
' Aggiungo voci alla lista di tipi di definizione grezzo
m_TypeList.Add(EgtMsg(MSG_RAWPARTPAGEUC + 1))
@@ -1013,6 +1061,7 @@ Public Class RawPartTabVM
NotifyPropertyChanged("Width")
NotifyPropertyChanged("OffsetX")
NotifyPropertyChanged("OffsetY")
NotifyPropertyChanged("Height")
NotifyPropertyChanged("Kerf")
' aggiorno offset e rotazione foto
Dim dPhotoOffsetX, dPhotoOffsetY, dPhotoRot As Double
@@ -1077,6 +1126,8 @@ Public Class RawPartTabVM
ElseIf dRawKerf > Math.Min(m_dTableLength, m_dTableWidth) / 5 Then
dRawKerf = Math.Min(m_dTableLength, m_dTableWidth) / 5
End If
' assegno il valore del Kerf corrente
m_PrecKerf = dRawKerf
If dRawLen < 0 Then
dRawLen = 100
ElseIf dRawLen > m_dTableLength - 2 * dRawKerf Then
@@ -1305,12 +1356,58 @@ Public Class RawPartTabVM
Return True
End Function
' -------------------------------- INIZIO Nuove funzioni per la gestione del Kerf negativo --------------------------------
Private Function AdjustRawPartNegativeKerf(Optional NegativeOffset As Boolean = True) As Boolean
' Se non c'è il grezzo, esco
If EstCalc.GetRawId() = GDB_ID.NULL Then Return False
' Cancello eventuale vecchio contorno di kerf
Dim nKerfId As Integer = EgtGetFirstNameInGroup(EstCalc.GetRawId(), NAME_KERF)
Dim nInvert As Double = 1
If Not NegativeOffset Then
nInvert = -1
End If
Dim dOffset As Double = (-m_dKerf - m_PrecKerf) * nInvert
EgtSaveFile("c:\EgtData\OmagOFFICE\Temp\Error.nge", NGE.TEXT)
Dim nCount As Integer = 0
Dim bOK As Boolean = EgtOffsetCurve(nKerfId, dOffset, OFF_TYPE.EXTEND)
EgtSetColor(nKerfId, m_KerfCol)
' ------ Gestione corretta dei kerf ------
'Dim nNewKerfId As Integer = EgtOffsetCurveAdv(nKerfId, dOffset, OFF_TYPE.EXTEND, nCount)
'EgtSetColor(nNewKerfId, m_KerfCol)
'EgtSetName(nNewKerfId, "Kerf")
'EgtErase(nKerfId)
'-----------------------------------------
' Salvo il valore del kerf (sempre in mm)
EgtSetInfo(EstCalc.GetRawId(), KEY_KERF, m_dKerf)
Return bOK
End Function
Private Function AdjustRawPartPositionNegativeKerf() As Boolean
' Sistemo la posizione
Dim ptRef As New Point3d(m_dOffsetX, m_dOffsetY, CurrentMachine.dAdditionalTable)
If EgtMoveToCornerRawPart(EstCalc.GetRawId(), ptRef, MCH_CR.BL) Then
' Parametro ereditato da OmagCUT
' OkBtn.IsEnabled = True
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
Else
' OkBtn.IsEnabled = False
Dim sMsg As String = EgtMsg(MSG_RAWPARTPAGEUC + 47)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(sMsg, 3, MSG_TYPE.ERROR_) ' Errore nella posizione o dimensione del grezzo
End If
' Aggiorno visualizzazione
EgtZoom(ZM.ALL)
Return True
End Function
' -------------------------------- FINE Nuove funzioni per la gestione del Kerf negativo --------------------------------
Private Sub UpdateRawPartHeight()
' Se da creare
If EstCalc.GetRawId() = GDB_ID.NULL Then
RecalcRawPart(True)
Return
' se da cancellare
' se da cancellare
ElseIf m_dHeight < EPS_SMALL Then
' Se ci sono pezzi
If EgtGetFirstPartInRawPart(EstCalc.GetRawId()) <> GDB_ID.NULL Then
@@ -1331,7 +1428,7 @@ Public Class RawPartTabVM
End If
' Elimino il grezzo
EgtRemoveRawPart(EstCalc.GetRawId())
' altrimenti da aggiornare
' altrimenti da aggiornare
Else
' Salvo vecchia altezza
Dim dOldHeight As Double = EstCalc.GetRawHeight()
@@ -1350,7 +1447,12 @@ Public Class RawPartTabVM
EgtMovePartInRawPart(nPartId, vtMove)
nPartId = EgtGetNextPartInRawPart(nPartId)
End While
' aggiorno la posizione dei cerchi del Kerf
UpdateCircles()
' Aggiorno la posizione della zona rovinata
UpdateDemageArea(vtMove)
End If
' aggiorno l'Id del grezzo
EstCalc.UpdateRawPart()
' Se c'è foto, aggiorno quota fotografia
If GetPhoto() <> GDB_ID.NULL Then
@@ -1374,7 +1476,7 @@ Public Class RawPartTabVM
Dim Col = m_RawCol
If GetPhoto() <> GDB_ID.NULL Then Col.A = 20
' Aggiorno il grezzo
EgtModifyRawPart(EstCalc.GetRawId(), nKerfId, m_dKerf, m_ptTableMin.z, m_dHeight, Col)
Dim x As Boolean = EgtModifyRawPart(EstCalc.GetRawId(), nKerfId, m_dKerf, m_ptTableMin.z, m_dHeight, Col)
' Salvo il nuovo valore (sempre in mm)
EgtSetInfo(EstCalc.GetRawId(), KEY_KERF, m_dKerf)
' Aggiorno dimensioni e posizione grezzo
@@ -1425,6 +1527,16 @@ Public Class RawPartTabVM
End If
End Sub
Private Sub UpdateDemageArea(vtMove As Vector3d)
Dim nId As Integer = GDB_ID.NULL
nId = EgtGetFirstNameInGroup(EstCalc.GetRawId(), NAME_DAMAGED)
While nId <> GDB_ID.NULL
EgtMove(nId, vtMove)
nId = EgtGetNext(nId)
End While
End Sub
Private Sub ModifyPhoto(vtMove As Vector3d)
' Non ci deve essere movimento in Z
vtMove.z = 0
+2 -2
View File
@@ -101,9 +101,9 @@ Public Class MachineAxis
EgtSetAxisPos(m_Name, dVal)
EgtGetAxisPos(m_Name, dVal)
If m_Linear Then
Value = LenToString(dVal, -3)
Value = LenToString(dVal, 3)
Else
Value = DoubleToString(dVal, -3)
Value = DoubleToString(dVal, 3)
End If
EgtDraw()
End Sub
+50 -10
View File
@@ -13,17 +13,19 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Visibility="{Binding Legenda_Visibility}"
<!--Titolo delle colonne-->
<Grid Visibility="{Binding Legenda_Visibility}"
Grid.Row="0"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition Width="0.6*"/>
<ColumnDefinition Width="0.6*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding FirstColumnMsg}" Grid.Column="1" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding SecondColumnMsg}" Grid.Column="2" HorizontalAlignment="Center"/>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition Width="0.6*"/>
<ColumnDefinition Width="0.6*"/>
</Grid.ColumnDefinitions>
<!--Prima colonna-->
<TextBlock Text="{Binding FirstColumnMsg}" Grid.Column="1" HorizontalAlignment="Center"/>
<!--Seconda colonna-->
<TextBlock Text="{Binding SecondColumnMsg}" Grid.Column="2" HorizontalAlignment="Center"/>
</Grid>
<EgtWPFLib5:EgtScrollViewer VerticalScrollBarVisibility="Auto"
@@ -38,8 +40,10 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<!--Nome della riga ("An")-->
<TextBlock Text="{Binding sEntityName}"
VerticalAlignment="Center"/>
<!--Drip e Engrave-->
<UniformGrid Grid.Column="1" Columns="3" Rows="1">
<CheckBox IsChecked="{Binding bIsChecked}"
@@ -56,6 +60,7 @@
VerticalAlignment="Center"
Margin="2.5,0,0,0"/>
</UniformGrid>
<!--SideAngle-->
<UniformGrid Grid.Column="1" Columns="2" Rows="1">
<EgtWPFLib5:EgtTextBox Text="{Binding GrphSideAngle}"
@@ -67,6 +72,41 @@
VerticalAlignment="Center"
Margin="2.5,0,0,0"/>
</UniformGrid>
<!--Alz&Front-->
<Grid Grid.ColumnSpan="2"
Grid.Row="2"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition Width="0.6*"/>
<ColumnDefinition Width="0.6*"/>
</Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding bIsCheckedAlz}"
Grid.Column="1"
Visibility="{Binding CheckAlz_Visibility}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding bIsCheckedFront}"
Grid.Column="2"
Visibility="{Binding CheckFront_Visibility}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
<!--<UniformGrid Grid.Column="1" Columns="2" Rows="1">
<CheckBox IsChecked="{Binding bIsCheckedAlz}"
Grid.Column="1"
Visibility="{Binding CheckAlz_Visibility}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding bIsCheckedFront}"
Grid.Column="1"
Visibility="{Binding CheckFront_Visibility}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</UniformGrid>-->
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
@@ -104,7 +144,7 @@
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter2a}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter2b}"/>
</UniformGrid>
</Grid>
</Grid>
<Grid Visibility="{Binding Parameter23_Visibility}"
Grid.Row="4"
+582 -39
View File
@@ -5,11 +5,20 @@ Imports EgtWPFLib5
Public Class SideEntityControlVM
Inherits VMBase
Private Const INFO_ALZFRONT As String = "AF"
Public Enum ModeOpt As Integer
SIDEANGLE = 0 ' inclina lato
DRIP = 1 ' incidi da sotto
ENGRAVE = 2 ' incidi da sopra
FILOTOP = 3 ' filo top
ALZANDFRONT = 4 ' alzatine e frontalini
End Enum
Public Enum ModeAlzAndFront
ALZATINA = 0
FRONTALINO = 1
NONE = 2
End Enum
Public Enum CallingWindowOpt As Integer
@@ -33,11 +42,14 @@ Public Class SideEntityControlVM
End Set
End Property
#Region "Titolo colonne"
' stampa il nome delle colonne
Public ReadOnly Property Legenda_Visibility As Visibility
Get
If m_Mode = SideEntityControlVM.ModeOpt.FILOTOP OrElse
m_SideEntityList.Count() = 0 Then
If m_Mode = SideEntityControlVM.ModeOpt.FILOTOP OrElse m_SideEntityList.Count() = 0 Then
Return Visibility.Collapsed
ElseIf m_Mode = SideEntityControlVM.ModeOpt.SIDEANGLE And m_SideAngleCheck Then
Return Visibility.Collapsed
Else
Return Visibility.Visible
@@ -54,6 +66,9 @@ Public Class SideEntityControlVM
ElseIf m_Mode = SideEntityControlVM.ModeOpt.SIDEANGLE Then
' A°
sMsg = EgtMsg(91653)
ElseIf m_Mode = SideEntityControlVM.ModeOpt.ALZANDFRONT Then
' Alz
sMsg = "Alz."
End If
Return sMsg
End Get
@@ -68,32 +83,17 @@ Public Class SideEntityControlVM
ElseIf m_Mode = SideEntityControlVM.ModeOpt.SIDEANGLE Then
' T
sMsg = EgtMsg(91654)
ElseIf m_Mode = SideEntityControlVM.ModeOpt.ALZANDFRONT Then
' Front
sMsg = "Front."
End If
Return sMsg
End Get
End Property
Private m_Parameter23_Visibility As Visibility
Public Property Parameter23_Visibility As Visibility
Get
Return m_Parameter23_Visibility
End Get
Set(value As Visibility)
m_Parameter23_Visibility = value
NotifyPropertyChanged("Parameter23_Visibility")
End Set
End Property
#End Region 'Titolo colonne
Private m_Parameter4_Visibility As Visibility
Public Property Parameter4_Visibility As Visibility
Get
Return m_Parameter4_Visibility
End Get
Set(value As Visibility)
m_Parameter4_Visibility = value
NotifyPropertyChanged(NameOf(Parameter4_Visibility))
End Set
End Property
#Region "Parameter 1"
Private m_Parameter1_Visibility As Visibility
Public ReadOnly Property Parameter1_Visibility As Visibility
@@ -116,7 +116,7 @@ Public Class SideEntityControlVM
If m_Mode = ModeOpt.SIDEANGLE Then
Return DoubleToString(m_Parameter1, 2)
Else
Return LenToString(m_Parameter1, -2)
Return LenToString(m_Parameter1, 2)
End If
End Get
Set(value As String)
@@ -145,15 +145,22 @@ Public Class SideEntityControlVM
StringToLen(value, m_dDripOffset)
' Creo le geometrie dei gocciolatoi
RefreshSideAngleText()
' Aggiorno i dati delle alette
RefreshDataAlzAndFront()
End If
End Set
End Property
Private Sub SetParameter1(value As Double)
m_Parameter1 = value
SideAngleEntity.m_Parameter1 = value
AlzAndFrontEntity.m_Parameter1 = value
NotifyPropertyChanged("Parameter1")
End Sub
#End Region 'Parameter 1
#Region "Parameter 2"
Private m_Parameter2_Visibility As Visibility = Visibility.Visible
Public Property Parameter2_Visibility As Visibility
Get
@@ -171,7 +178,7 @@ Public Class SideEntityControlVM
If m_Mode = ModeOpt.SIDEANGLE Then
Return LenToString(m_Parameter2, 2)
Else
Return LenToString(m_Parameter2, -2)
Return LenToString(m_Parameter2, 2)
End If
End Get
Set(value As String)
@@ -225,23 +232,40 @@ Public Class SideEntityControlVM
End Property
Private m_Parameter2a As Integer
Private m_dParameter2a As Double
Public Property Parameter2a As String
Get
If m_Mode = ModeOpt.ALZANDFRONT Then
Return DoubleToString(m_dParameter2a, 2)
End If
Return DoubleToString(m_Parameter2a, 2)
End Get
Set(value As String)
' recupero il valore passato come intero
StringToInt(value, m_Parameter2a)
' recupero il valore passato come double
StringToDouble(value, m_dParameter2a)
' Recupero il valore
StringToInt(value, m_nEngrNbr2)
' Creo le geometrie dei gocciolatoi
RefreshSideAngleText()
' Aggiorno i dati delle alette
RefreshDataAlzAndFront()
End Set
End Property
' Gestione del dato intero (Incisioni)
Private Sub SetParameter2a(value As Integer)
m_Parameter2a = value
SideAngleEntity.m_Parameter2a = value
NotifyPropertyChanged("Parameter2a")
End Sub
' Gestione del dato Double (Alette)
Private Sub SetdParameter2a(value As Double)
m_dParameter2a = value
SideAngleEntity.m_dParameter2a = value
AlzAndFrontEntity.m_dParameter2a = value
NotifyPropertyChanged("Parameter2a")
End Sub
Private m_Parameter2b As Double
Public Property Parameter2b As String
@@ -254,18 +278,36 @@ Public Class SideEntityControlVM
StringToLen(value, m_dDripOffset2)
' Creo le geometrie dei gocciolatoi
RefreshSideAngleText()
' Aggiorno i dati delle alette
RefreshDataAlzAndFront()
End Set
End Property
Private Sub SetParameter2b(value As Double)
m_Parameter2b = value
SideAngleEntity.m_Parameter2b = value
AlzAndFrontEntity.m_Parameter2b = value
NotifyPropertyChanged("Parameter2b")
End Sub
#End Region 'Parameter 2
#Region "Parameter 3"
Private m_Parameter23_Visibility As Visibility
Public Property Parameter23_Visibility As Visibility
Get
Return m_Parameter23_Visibility
End Get
Set(value As Visibility)
m_Parameter23_Visibility = value
NotifyPropertyChanged("Parameter23_Visibility")
End Set
End Property
Private m_Parameter3 As Double
Public Property Parameter3 As String
Get
Return LenToString(m_Parameter3, -2)
Return LenToString(m_Parameter3, 2)
End Get
Set(value As String)
If m_Mode <> ModeOpt.SIDEANGLE Then
@@ -273,18 +315,36 @@ Public Class SideEntityControlVM
m_dDripDepth = m_Parameter3
' Creo le geometrie dei gocciolatoi
RefreshSideAngleText()
' Aggiorno i dati delle alette
RefreshDataAlzAndFront()
End If
End Set
End Property
Private Sub SetParameter3(value As Double)
m_Parameter3 = value
AlzAndFrontEntity.m_Parameter3 = value
NotifyPropertyChanged("Parameter3")
End Sub
#End Region 'Parameter 3
#Region "Parameter 4"
Private m_Parameter4_Visibility As Visibility
Public Property Parameter4_Visibility As Visibility
Get
Return m_Parameter4_Visibility
End Get
Set(value As Visibility)
m_Parameter4_Visibility = value
NotifyPropertyChanged(NameOf(Parameter4_Visibility))
End Set
End Property
Private m_Parameter4 As Double
Public Property Parameter4 As String
Get
Return LenToString(m_Parameter4, -2)
Return LenToString(m_Parameter4, 2)
End Get
Set(value As String)
If m_Mode <> ModeOpt.SIDEANGLE Then
@@ -300,8 +360,15 @@ Public Class SideEntityControlVM
NotifyPropertyChanged("Parameter4")
End Sub
#End Region 'Parameter 4
Private m_dSideAngle As Double = 0
Private m_HeightA As Double = 0
Private m_HeightF As Double = 0
Private m_DeltaAngF As Double = 0
Private m_DeltaAngA As Double = 0
Private m_dOffsetFiloTop As Double = 5
Private m_dDepthFiloTop As Double = 5
@@ -338,15 +405,24 @@ Public Class SideEntityControlVM
End Set
End Property
Public ReadOnly Property Parameter3Msg As String
Private m_Parameter3Msg As String = EgtMsg(MSG_IMPORTPAGEUC + 11)
Public Property Parameter3Msg As String
Get
Return EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
Return m_Parameter3Msg ' Affondamento
End Get
Set(value As String)
m_Parameter3Msg = value
End Set
End Property
Public ReadOnly Property Parameter4Msg As String
Private m_Parameter4Msg As String = EgtMsg(MSG_IMPORTPAGEUC + 12)
Public Property Parameter4Msg As String
Get
Return EgtMsg(MSG_IMPORTPAGEUC + 12) ' Accorciamento
Return m_Parameter4Msg ' Accorciamento
End Get
Set(value As String)
m_Parameter4Msg = value
End Set
End Property
#End Region ' Messages
@@ -368,11 +444,14 @@ Public Class SideEntityControlVM
m_SideAngleCheck = If(GetMainPrivateProfileInt(S_COMPO, K_SIDEMODE, 0) = 0, True, False)
SideAngleEntity.dMaxSideAng = GetMainPrivateProfileDouble(S_SIDES, K_MAXSIDEANGLE, SideAngleEntity.STD_MAXSIDEANG)
'------------------ DEFINIZIONE LISTA LATI
' creo la lista dei parametri
If CallingWindow = CallingWindowOpt.COMPO Then
' Imposto contesto corrente
EgtSetCurrentContext(CallingWndScene.GetCtx())
' Inizializzo lati per angoli (ne compilo la lista e aggiungo la scritta nel disegno)
InitSides()
' aggiorno i testi sui lati della figura
RefreshSideAngleText()
ElseIf CallingWindow = CallingWindowOpt.DXFIMPORT Then
@@ -380,14 +459,26 @@ Public Class SideEntityControlVM
EgtSetCurrentContext(CallingWndScene.GetCtx())
' Inizializzo lati per angoli (ne compilo la lista e aggiungo la scritta nel disegno)
InitSides()
' aggiorno i testi sui lati della figura
RefreshSideAngleText()
End If
' Gestisco visualizzazione dei parametri
If m_Mode = ModeOpt.SIDEANGLE Or m_Mode = ModeOpt.FILOTOP Then
'------------------ VISIBILITA' PARAMETRI
' Gestisco visualizzazione dei parametri (sotto l'elenco dei parametri)
If m_Mode = ModeOpt.SIDEANGLE Then
Parameter23_Visibility = Windows.Visibility.Hidden
Parameter2_Visibility = Visibility.Visible
Parameter2ab_Visibility = Visibility.Hidden
Parameter4_Visibility = Visibility.Hidden
ElseIf m_Mode = ModeOpt.FILOTOP Then
Parameter23_Visibility = Windows.Visibility.Hidden
Parameter2_Visibility = Visibility.Visible
Parameter2ab_Visibility = Visibility.Hidden
ElseIf m_Mode = ModeOpt.ALZANDFRONT Then
Parameter2_Visibility = Visibility.Hidden
Parameter23_Visibility = Windows.Visibility.Visible
Parameter2ab_Visibility = Visibility.Visible
Parameter4_Visibility = Visibility.Hidden
Else
' Temporaneamente lo disabilito
Parameter23_Visibility = Windows.Visibility.Visible
@@ -396,12 +487,14 @@ Public Class SideEntityControlVM
Parameter2_Visibility = Visibility.Hidden
End If
'------------------ VALORI E TITOLI PARAMETRI
' Aggiorno valori delle TextBlock che indicano i titoli delle colonne
If m_Mode = ModeOpt.SIDEANGLE Then
Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 9) ' Angolo
Parameter2Msg = EgtMsg(91002) ' Tallone
m_dSideAngle = GetMainPrivateProfileDouble(S_SIDES, K_SIDEANGLE, 45)
SetParameter1(m_dSideAngle)
ElseIf m_Mode = ModeOpt.FILOTOP Then
Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
Dim x As String = EgtMsg(MSG_IMPORTPAGEUC + 11)
@@ -410,7 +503,8 @@ Public Class SideEntityControlVM
m_dDepthFiloTop = GetMainPrivateProfileDouble(S_SIDES, K_FILOTOPDEPTH, 5)
SetParameter1(m_dOffsetFiloTop)
SetParameter2(m_dDepthFiloTop)
Else
ElseIf m_Mode = ModeOpt.ENGRAVE Or m_Mode = ModeOpt.DRIP Then
Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
Parameter2Msg = EgtMsg(MSG_IMPORTPAGEUC + 16) ' Offset 2
m_dDripOffset = GetMainPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20)
@@ -424,6 +518,22 @@ Public Class SideEntityControlVM
SetParameter2b(m_dDripOffset2)
SetParameter3(m_dDripDepth)
SetParameter4(m_dDripShort)
ElseIf m_Mode = ModeOpt.ALZANDFRONT Then
' definisco i nomi dei campi
Parameter1Msg = "Spessore"
Parameter2Msg = "Altezza"
Parameter3Msg = "Delta Ang."
' carico i valori letti da file ini
m_HeightA = GetMainPrivateProfileDouble("Alz&Front", "A_Height", 0)
m_HeightF = GetMainPrivateProfileDouble("Alz&Front", "F_Height", 0)
m_DeltaAngF = GetMainPrivateProfileDouble("Alz&Front", "F_DeltaAng", 0)
SetParameter1(EstCalc.GetRawHeight)
SetdParameter2a(m_HeightA)
SetParameter2b(m_HeightF)
SetParameter3(m_DeltaAngF)
' ricalcolo le alette della figura
LoadCurrentCompo()
End If
' Aggiorno visualizzazione
@@ -437,12 +547,13 @@ Public Class SideEntityControlVM
#End Region ' CONSTRUCTOR
#Region "METHODS"
' aggiorno i messaggi scritti sui lati della figura (anche per le alette)
Private Sub RefreshSideAngleText()
' Imposto contesto corrente
EgtSetCurrentContext(m_CallingWndScene.GetCtx())
Dim PartId As Integer = GDB_ID.NULL
Dim LoopId As Integer = GDB_ID.NULL
If m_CallingWindow = CallingWindowOpt.COMPO Then
' Ricavo nome primo pezzo
PartId = If(CompoWindowMap.refCompoSceneHostV.SelectedLayer <> GDB_ID.NULL, EgtGetFirstInGroup(GDB_ID.ROOT), GDB_ID.NULL)
@@ -479,14 +590,26 @@ Public Class SideEntityControlVM
If SideEntity.dSideHeel > 10 * EPS_SMALL Then sText += "; " & LenToString(SideEntity.dSideHeel, 1)
AddTextToLine(sText, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True)
Next
' Altrimenti modalità gocciolatoio
Else
ElseIf m_Mode = ModeOpt.ALZANDFRONT Then
' ---------------- ATTENZIONE ----------------
' tutta le gestione dei mesaggi è eseguita dal file lua della componente!
' Per ogni entità, creo testo con nome e angolo di inclinazione
For Each Entity In m_SideEntityList
Dim SideEntity As AlzAndFrontEntity = TryCast(Entity, AlzAndFrontEntity)
Dim sText As String = Entity.sEntityName '& " = " & DoubleToString(SideEntity.dSideAngle, 1) & "°"
'If SideEntity.dSideHeel > 10 * EPS_SMALL Then sText += "; " & LenToString(SideEntity.dSideHeel, 1)
'AddTextToLine(sText, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True)
Next
' Altrimenti modalità gocciolatoio
ElseIf m_Mode = ModeOpt.DRIP Or m_Mode = ModeOpt.ENGRAVE Then
' Per ogni entità creo testo con nome
For Each Entity In m_SideEntityList
AddTextToLine(Entity.sEntityName, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True)
Next
' Creo le geometrie dei gocciolatoi
CreateDripGeom(PartId)
ElseIf m_Mode = ModeOpt.ENGRAVE Then
'--- ??? ---
End If
' Aggiorno visualizzazione
EgtDraw()
@@ -544,7 +667,16 @@ Public Class SideEntityControlVM
nOtherIndex += 1
End If
ElseIf m_Mode = ModeOpt.FILOTOP Then
' --- NON FARE NIENTE ---
ElseIf m_Mode = ModeOpt.ALZANDFRONT Then
If VerifySideAnglePossible(PrevLine, CurrLine, NextLine, bOutLoop) And ApprovedSideToAlzFront(CurrLine) Then
' Aggiungo il lato alla lista di quelli inclinabili e ne azzero l'inclinazione
AddAlzAndFront(CurrLine, TextLayer, dBBoxRad, nEntityIndex)
nEntityIndex += 1
Else
EgtSetName(CurrLine, "B" & nOtherIndex.ToString())
nOtherIndex += 1
End If
Else
If VerifyIsSideDripPossible(PrevLine, CurrLine, NextLine) Then
' Aggiungo il lato alla lista di quelli su cui è possibile mettere il gocciolatoio
@@ -646,6 +778,37 @@ Public Class SideEntityControlVM
AddTextToLine(sText, TextLayer, CurrLine, 20, dBBoxRad, True)
End Sub
' Funzione che gestisce l'aggiunta delle alzatine nella lista
Private Sub AddAlzAndFront(CurrLine As Integer, TextLayer As Integer, dBBoxRad As Double, nEntityIndex As Integer)
' Imposto nome del lato
EgtSetName(CurrLine, "A" & nEntityIndex.ToString())
Dim sEntityName As String = String.Empty
EgtGetName(CurrLine, sEntityName)
Dim NewEntity As AlzAndFrontEntity = Nothing
NewEntity = New AlzAndFrontEntity(CurrLine, sEntityName, TextLayer, ModeOpt.ALZANDFRONT)
Dim sInfo As String = "0"
EgtGetInfo(CurrLine, "AF", sInfo)
If sInfo = "1" Then
NewEntity.SetbIsCheckedAlz(True)
ElseIf sInfo = "2" Then
NewEntity.SetbIsCheckedFront(True)
Else
NewEntity.SetbIsCheckedAlz(False)
NewEntity.SetbIsCheckedFront(False)
End If
' inserisco riferimento univoco al lato (solo se non esiste)
Dim sInfoRef As String = String.Empty
EgtGetInfo(CurrLine, "RefAF", sInfoRef)
If String.IsNullOrEmpty(sInfoRef) Then
Dim sRefGUID As String = System.Guid.NewGuid().ToString()
EgtSetInfo(CurrLine, "RefAF", sRefGUID)
End If
EgtSetInfo(NewEntity.nGeomId, "IsModify", 0)
m_SideEntityList.Add(NewEntity)
NotifyPropertyChanged("Legenda_Visibility")
'AddTextToLine("A" & CurrLine.ToString, TextLayer, CurrLine, 20, dBBoxRad, True)
End Sub
' Funzione che gestisce le operazioni sull'entità con gocciolatoio
Private Sub AddDripSide(CurrLine As Integer, TextLayer As Integer, dBBoxRad As Double, nEntityIndex As Integer)
' Imposto nome del lato
@@ -837,6 +1000,7 @@ Public Class SideEntityControlVM
End Sub
Friend Sub CreateDripGeom(nPartId As Integer)
If nPartId = GDB_ID.NULL Then Return
' Recupero Id layer di contorno esterno
Dim nOutLoopId = EgtGetFirstNameInGroup(nPartId, NAME_OUTLOOP)
' Preparo layer con geometria gocciolatoi (svuotandolo o creandolo)
@@ -864,6 +1028,8 @@ Public Class SideEntityControlVM
End If
Next
If vJoint.Count < 1 Then Return
If vJoint(0) And vJoint(vJoint.Count - 1) Then
bJointStart = True
End If
@@ -1416,6 +1582,160 @@ Public Class SideEntityControlVM
End While
End Sub
'---------------------- GESTIONE ALZATIENE E FRONTALINI ----------------------
' eseguo compo
Shared Sub LoadCurrentCompo()
Dim m_dBBoxRad As Double = 0.5 * Point3d.DistXY(EstCalc.GetRawPtMin, EstCalc.GetRawPtMax)
Dim m_dH As Double = 0.05 * m_dBBoxRad
' !! ATTENZIONE !! : per problemi di spazio è stata spenta la text per stampare i messaggi (ma potrebbe servire?)
' Pulisco l'ambiente lua
EgtLuaResetGlobVar("CMP")
EgtLuaResetGlobVar("CMP_Draw")
Dim nCompoName As Integer
Dim sCompoFile As String = ""
Dim sCompoImage As String = ""
' recupero il nome del direttorio
Dim sCompoDir As String = String.Empty
GetMainPrivateProfileString("Alz&Front", K_COMPODIR, "", sCompoDir)
' leggo le info inserite nel campo "Alz&Front"
Dim CItem As CompoItem = CompoWindowMap.refCompoListPageVM.GetPrivateProfileCompo("Alz&Front", "Alz&Front")
nCompoName = CItem.Index
sCompoFile = CItem.LuaPath
sCompoImage = CItem.ImagePath
'Dim sCompoImageSource As ImageSource
' Costruisco path completa del componente
Dim sPath = sCompoDir & "\" & sCompoFile
' Carico il file
EgtLuaExecFile(sPath)
' carico la lista di variabili
Dim dVal As Double
If StringToLen(AlzAndFrontEntity.m_dParameter2a.ToString, dVal) Then
EgtLuaSetGlobNumVar("CMP.A_Height", dVal)
End If
If StringToLen(AlzAndFrontEntity.m_Parameter2b.ToString, dVal) Then
EgtLuaSetGlobNumVar("CMP.F_Height", dVal)
End If
If StringToLen("0", dVal) Then
EgtLuaSetGlobNumVar("CMP.A_DeltaAng", dVal)
End If
If StringToLen("0", dVal) Then
EgtLuaSetGlobNumVar("CMP.F_DeltaAng", dVal)
End If
' deve essere imposta sempre la dimensione della lastra
If StringToLen(AlzAndFrontEntity.m_Parameter1.ToString, dVal) Then
EgtLuaSetGlobNumVar("CMP.ThicknessRaw", dVal)
End If
' parametri per la scrittura dei caratteri
EgtLuaSetGlobNumVar("CMP.BBoxRad", m_dBBoxRad)
EgtLuaSetGlobNumVar("CMP.HeightText", m_dH)
Dim sMsg As String = String.Empty
' eseguo la funzione per il disegno della componente (CMP_Draw)
If Not EgtLuaExecLine("CMP_Draw" & "(true)") Then
sMsg = "Error in component execution"
'm_bDrawOk = False
Else
EgtLuaGetGlobStringVar("CMP" & ".MSG", sMsg)
Dim nErr As Integer = 0
EgtLuaGetGlobIntVar("CMP" & ".ERR", nErr)
'm_bDrawOk = (nErr = 0)
End If
' aggiorno la grafica
EgtZoom(ZM.ALL)
End Sub
' restituisce vero se il lato possiede delle info legate al sideangle
Private Function VerifyIsThereSideAngle(nCurrLine As Integer) As Boolean
Dim sInfoSideAngle As String = String.Empty
EgtGetInfo(nCurrLine, INFO_SIDE_ANGLE, sInfoSideAngle)
If Not String.IsNullOrWhiteSpace(sInfoSideAngle) Or Not String.IsNullOrEmpty(sInfoSideAngle) Then
' verifico che il dato salvato sia un double
Try
Dim dSideAngle As Double = 0
StringToDouble(sInfoSideAngle, dSideAngle)
If dSideAngle <> 0 Then
Return True
End If
Catch ex As Exception
End Try
End If
Return False
End Function
' restituisce vero se il lato possiede delle info legate alle alette
Private Function VerifyIsThereAlzFront(nCurrLine As Integer) As Boolean
Dim sInfoAlzFront As String = String.Empty
EgtGetInfo(nCurrLine, INFO_ALZFRONT, sInfoAlzFront)
If Not String.IsNullOrWhiteSpace(sInfoAlzFront) Or Not String.IsNullOrEmpty(sInfoAlzFront) Then
If sInfoAlzFront.Trim <> "0" Then
Return True
End If
End If
Return False
End Function
' approvo la costruzione dell'aletta sul lato indicato
Private Function ApprovedSideToAlzFront(nCurrLine As Integer) As Boolean
If VerifyIsThereSideAngle(nCurrLine) And Not VerifyIsThereAlzFront(nCurrLine) Then
' se esiste SideAngle e un'aletta allora NON approvo
Return False
End If
Return True
End Function
Shared Sub RefreshEntity(bIsAlz As Boolean, bIsChecked As Boolean, GeneralSideEntity As SideEntity, Optional DrawCompo As Boolean = True)
Dim Loacl_AlzFrontEntity As AlzAndFrontEntity = Nothing
Try
Loacl_AlzFrontEntity = DirectCast(GeneralSideEntity, AlzAndFrontEntity)
Catch ex As Exception
Return
End Try
If bIsAlz Then
If bIsChecked Then
Loacl_AlzFrontEntity.Type = ModeAlzAndFront.ALZATINA
Else
Loacl_AlzFrontEntity.Type = ModeAlzAndFront.NONE
End If
Else
If bIsChecked Then
Loacl_AlzFrontEntity.Type = ModeAlzAndFront.FRONTALINO
Else
Loacl_AlzFrontEntity.Type = ModeAlzAndFront.NONE
End If
End If
Select Case Loacl_AlzFrontEntity.Type
Case SideEntityControlVM.ModeAlzAndFront.NONE
EgtSetInfo(Loacl_AlzFrontEntity.nGeomId, INFO_ALZFRONT, 0)
Case SideEntityControlVM.ModeAlzAndFront.ALZATINA
EgtSetInfo(Loacl_AlzFrontEntity.nGeomId, INFO_ALZFRONT, 1)
Case SideEntityControlVM.ModeAlzAndFront.FRONTALINO
EgtSetInfo(Loacl_AlzFrontEntity.nGeomId, INFO_ALZFRONT, 2)
End Select
EgtSetInfo(Loacl_AlzFrontEntity.nGeomId, "IsModify", 1)
' di default viene ricostruito tutto il disegno
If DrawCompo Then LoadCurrentCompo()
End Sub
Private Sub RefreshDataAlzAndFront()
If m_Mode = ModeOpt.ALZANDFRONT Then
AlzAndFrontEntity.m_Parameter1 = m_Parameter1
AlzAndFrontEntity.m_dParameter2a = m_dParameter2a
AlzAndFrontEntity.m_Parameter2b = m_Parameter2b
AlzAndFrontEntity.m_Parameter3 = m_Parameter3
LoadCurrentCompo()
WriteMainPrivateProfileString("Alz&Front", "A_Height", LenToString(AlzAndFrontEntity.m_dParameter2a, 2))
WriteMainPrivateProfileString("Alz&Front", "F_Height", LenToString(AlzAndFrontEntity.m_Parameter2b, 2))
WriteMainPrivateProfileString("Alz&Front", "F_DeltaAng", LenToString(AlzAndFrontEntity.m_Parameter3, 2))
End If
End Sub
#End Region ' METHODS
End Class
@@ -1456,6 +1776,8 @@ Public MustInherit Class SideEntity
Else
Return Visibility.Visible
End If
ElseIf m_Mode = SideEntityControlVM.ModeOpt.ALZANDFRONT Then
Return Visibility.Collapsed
Else
Return Visibility.Collapsed
End If
@@ -1469,6 +1791,8 @@ Public MustInherit Class SideEntity
Else
Return Visibility.Collapsed
End If
ElseIf m_Mode = SideEntityControlVM.ModeOpt.ALZANDFRONT Then
Return Visibility.Collapsed
Else
Return Visibility.Visible
End If
@@ -1478,10 +1802,85 @@ Public MustInherit Class SideEntity
' imposto la visibilità delle TextBox per Drip ed Engrave
Public ReadOnly Property Value_Visibility_DE As Visibility
Get
Return Visibility.Visible
If m_Mode = SideEntityControlVM.ModeOpt.ALZANDFRONT Then
Return Visibility.Collapsed
ElseIf m_Mode = SideEntityControlVM.ModeOpt.SIDEANGLE Then
Return Visibility.Collapsed
Else
Return Visibility.Visible
End If
End Get
End Property
'--------------------------ALZ AND FRONT -----------------------------
Public ReadOnly Property CheckAlz_Visibility As Visibility
Get
If m_Mode = SideEntityControlVM.ModeOpt.ALZANDFRONT Then
Return Visibility.Visible
Else
Return Visibility.Collapsed
End If
End Get
End Property
Public ReadOnly Property CheckFront_Visibility As Visibility
Get
If m_Mode = SideEntityControlVM.ModeOpt.ALZANDFRONT Then
Return Visibility.Visible
Else
Return Visibility.Collapsed
End If
End Get
End Property
Private m_bIsCheckedAlz As Boolean = False
Public Property bIsCheckedAlz As Boolean
Get
Return m_bIsCheckedAlz
End Get
Set(value As Boolean)
If value Then
m_bIsCheckedAlz = True
m_bIsCheckedFront = False
Else
m_bIsCheckedAlz = False
End If
SideEntityControlVM.RefreshEntity(True, value, Me)
NotifyPropertyChanged("bIsCheckedAlz")
NotifyPropertyChanged("bIsCheckedFront")
End Set
End Property
Public Sub SetbIsCheckedAlz(value As Boolean)
' con questa funzione evito di ridisegnare la pagina delle alzatine per ognilato
m_bIsCheckedAlz = value
NotifyPropertyChanged("bIsCheckedAlz")
NotifyPropertyChanged("bIsCheckedFront")
End Sub
Private m_bIsCheckedFront As Boolean = False
Public Property bIsCheckedFront As Boolean
Get
Return m_bIsCheckedFront
End Get
Set(value As Boolean)
If value Then
m_bIsCheckedAlz = False
m_bIsCheckedFront = True
Else
m_bIsCheckedFront = False
End If
SideEntityControlVM.RefreshEntity(False, value, Me)
NotifyPropertyChanged("bIsCheckedAlz")
NotifyPropertyChanged("bIsCheckedFront")
End Set
End Property
Public Sub SetbIsCheckedFront(value As Boolean)
' con questa funzione evito di ridisegnare la pagina delle alzatine per ognilato
m_bIsCheckedFront = value
NotifyPropertyChanged("bIsCheckedAlz")
NotifyPropertyChanged("bIsCheckedFront")
End Sub
'--------------------------ALZ AND FRONT -----------------------------
Public MustOverride Property bIsChecked As Boolean
Sub New(nId As Integer, sEntityName As String, nTextId As Integer, Mode As SideEntityControlVM.ModeOpt)
@@ -1508,6 +1907,7 @@ Friend Class SideAngleEntity
Friend Shared m_Parameter1 As Double
Friend Shared m_Parameter2 As Double
Friend Shared m_Parameter2a As Integer
Friend Shared m_dParameter2a As Double
Friend Shared m_Parameter2b As Double
Friend Shared m_ModifySideAngle As Action(Of String, Double)
Friend Shared m_ModifySideHeel As Action(Of String, Double)
@@ -1906,4 +2306,147 @@ Friend Class ColorEngrave
Return False
End Function
End Class
End Class
Friend Class AlzAndFrontEntity
Inherits SideEntity
Public Const STD_MAXSIDEANG As Double = 50.0
Public Const MAX_MAXSIDEANG As Double = 75.0
Private Shared m_dMaxSideAng As Double = STD_MAXSIDEANG
Friend Shared WriteOnly Property dMaxSideAng As Double
Set(value As Double)
m_dMaxSideAng = Math.Max(Math.Min(value, MAX_MAXSIDEANG), 0)
End Set
End Property
Friend Shared m_Parameter1 As Double
Friend Shared m_Parameter2 As Double
Friend Shared m_Parameter2a As Integer
Friend Shared m_dParameter2a As Double
Friend Shared m_Parameter2b As Double
Friend Shared m_Parameter3 As Double
Friend Shared m_ModifySideAngle As Action(Of String, Double)
Friend Shared m_ModifySideHeel As Action(Of String, Double)
Friend Shared m_RefreshSideAngleText As Action
'Private m_dSideAngle As Double
'Public Property GrphSideAngle As String
' Get
' Return DoubleToString(m_dSideAngle, 2)
' End Get
' Set(value As String)
' Dim dVal As Double = 0
' If Not String.IsNullOrWhiteSpace(value) Then StringToDouble(value, dVal)
' If dVal <> m_dSideAngle Then
' ' Assegno controllando i limiti
' If dVal < -m_dMaxSideAng Then
' m_dSideAngle = -m_dMaxSideAng
' NotifyPropertyChanged("GrphSideAngle")
' ElseIf dVal > m_dMaxSideAng Then
' m_dSideAngle = m_dMaxSideAng
' NotifyPropertyChanged("GrphSideAngle")
' Else
' m_dSideAngle = dVal
' End If
' ' Lo modifico nella geometria e nella lista inclinazioni
' m_ModifySideAngle(sEntityName, dSideAngle)
' ' Aggiorno tutti i testi
' m_RefreshSideAngleText()
' End If
' End Set
'End Property
'Public Property dSideAngle As Double
' Get
' Return m_dSideAngle
' End Get
' Set(value As Double)
' ' Assegno controllando i limiti
' If value < -m_dMaxSideAng Then
' m_dSideAngle = -m_dMaxSideAng
' ElseIf value > m_dMaxSideAng Then
' m_dSideAngle = m_dMaxSideAng
' Else
' m_dSideAngle = value
' End If
' End Set
'End Property
'Private m_dSideHeel As Double
'Public Property GrphSideHeel As String
' Get
' Return LenToString(m_dSideHeel, 2)
' End Get
' Set(value As String)
' Dim dVal As Double = 0
' If Not String.IsNullOrWhiteSpace(value) Then StringToLen(value, dVal)
' If Math.Abs(dVal - m_dSideHeel) > EPS_SMALL Then
' ' Verifico stia nei limiti
' If dVal < 0 Then
' m_dSideHeel = 0
' NotifyPropertyChanged("GrphSideHeel")
' Else
' m_dSideHeel = dVal
' End If
' ' Lo modifico nella geometria e nella lista inclinazioni
' m_ModifySideHeel(sEntityName, dSideHeel)
' ' Aggiorno tutti i testi
' m_RefreshSideAngleText()
' End If
' End Set
'End Property
'Public Property dSideHeel As Double
' Get
' Return m_dSideHeel
' End Get
' Set(value As Double)
' ' Verifico stia nei limiti
' If value < 0 Then
' m_dSideHeel = 0
' Else
' m_dSideHeel = value
' End If
' End Set
'End Property
Public Overrides Property bIsChecked As Boolean
Get
Return False
End Get
Set(value As Boolean)
'If value Then
' m_dSideAngle = m_Parameter1
' m_dSideHeel = m_Parameter2
'Else
' m_dSideAngle = 0
' m_dSideHeel = 0
'End If
'' '' Converto nome checkbox in nome elemento tenendo conto dello slittamento verso il basso
'''Dim nCurrSide As Integer = m_SideAngleEntityList.Count() - (10 - CInt(CurrCheckBox.Name.Substring(1)))
'''Dim sCurrSide As String = "A" & nCurrSide.ToString()
'' Lo modifico nella geometria e nella lista inclinazioni
'm_ModifySideAngle(sEntityName, m_dSideAngle)
'm_ModifySideHeel(sEntityName, m_dSideHeel)
'' Aggiorno tutti i testi
'm_RefreshSideAngleText()
NotifyPropertyChanged("bIsChecked")
End Set
End Property
Private m_Type As SideEntityControlVM.ModeAlzAndFront = SideEntityControlVM.ModeAlzAndFront.NONE
Public Property Type As SideEntityControlVM.ModeAlzAndFront
Get
Return m_Type
End Get
Set(value As SideEntityControlVM.ModeAlzAndFront)
m_Type = value
End Set
End Property
Sub New(nId As Integer, sEntityName As String, nTextId As Integer, Mode As SideEntityControlVM.ModeOpt)
MyBase.New(nId, sEntityName, nTextId, Mode)
'm_dSideAngle = dSideAngle
'm_dSideHeel = dSideHeel
End Sub
End Class
+7 -10
View File
@@ -215,22 +215,19 @@ Public Class TopCommandBarVM
''' Returns a command that do SaveAs.
''' </summary>
Public ReadOnly Property SaveAsCommand As ICommand
Get
If m_cmdSaveAs Is Nothing Then
m_cmdSaveAs = New Command(AddressOf SaveAs)
End If
Return m_cmdSaveAs
End Get
Get
If m_cmdSaveAs Is Nothing Then
m_cmdSaveAs = New Command(AddressOf SaveAs)
End If
Return m_cmdSaveAs
End Get
End Property
''' <summary>
''' Execute the SaveAs. This method is invoked by the SaveAsCommand.
''' </summary>
Public Sub SaveAs(ByVal param As Object)
' non posso avere la stessa lastra in due progetti
If OmagOFFICEMap.refMainWindowVM.MainWindowM.m_SlabDB Then
Return
End If
' non posso avere la stessa lastra in due progetti -> gestita da DataBase
OmagOFFICEMap.refSceneHostVM.SaveAsProject()
End Sub
+1 -1
View File
@@ -7,7 +7,7 @@ Public Class UnderDrillControlVM
Private m_dDrillDepth As Double
Public Property dDrillDepth As String
Get
Return LenToString(m_dDrillDepth, -2)
Return LenToString(m_dDrillDepth, 2)
End Get
Set(value As String)
StringToLen(value, m_dDrillDepth)
+1 -1
View File
@@ -248,7 +248,7 @@ Module OmagOFFICEMap
Not IsNothing(m_refOptionPanelVM) AndAlso Not IsNothing(m_refRawPartTabVM) AndAlso
Not IsNothing(m_refNestingTabVM) AndAlso Not IsNothing(m_refSimulTabVM) AndAlso
Not IsNothing(m_refMachiningTabVM) AndAlso
LibMap.EndInit() AndAlso PhotoMap.ContninueApplication
LibMap.EndInit() AndAlso PhotoMap.ContinueApplication
End Function
#End Region ' Init