Compare commits
162 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 753ff7b4f1 | |||
| 1edfe486cb | |||
| 7190993f11 | |||
| 249289144f | |||
| 36ee5e4352 | |||
| 147099b702 | |||
| dd81384bb8 | |||
| 9cf61d691d | |||
| 358c5df390 | |||
| ccaec9af5a | |||
| 1dbecd0083 | |||
| 11c6f95378 | |||
| 3604a85cc1 | |||
| 3aaaa0fcb6 | |||
| 52da2bc2c9 | |||
| 4de476907f | |||
| 07bcb7479b | |||
| 92818aafd4 | |||
| f4326b27b7 | |||
| 1f4a0afd75 | |||
| 565ba3c756 | |||
| 7ab4e56594 | |||
| 697fb4c730 | |||
| 4f5804206d | |||
| 58828cf846 | |||
| 36138ec459 | |||
| 7fc49b0d1d | |||
| cf9379272c | |||
| cd6714752e | |||
| 4c62410c20 | |||
| b017fef2b9 | |||
| 17785afc20 | |||
| 62953c981e | |||
| c3a3057420 | |||
| 8fa7b6188c | |||
| f3770dfc7c | |||
| 1358cef04a | |||
| e0fe4d9444 | |||
| 05186db728 | |||
| 5b21559e56 | |||
| 13a774429e | |||
| bde6c38733 | |||
| e3beaf2aa3 | |||
| deb8b34402 | |||
| 49311579ec | |||
| 589b7211ab | |||
| 892806d32a | |||
| 914a89014e | |||
| 3043a717d3 | |||
| 8a3b52e082 | |||
| f4126dba7a | |||
| 6009db35cd | |||
| 4a42374891 | |||
| 64c6a6cf9b | |||
| d1a8f033db | |||
| a6be019b32 | |||
| c343b18571 | |||
| f2a777a226 | |||
| 2e0979a618 | |||
| bd33450bb0 | |||
| fa0ebe1503 | |||
| d33a976d3b | |||
| ebe0c84e1f | |||
| 090e930a0f | |||
| f319409261 | |||
| ad7634f52d | |||
| c95fb50006 | |||
| a788f207af | |||
| f4a8edd421 | |||
| 601f66187a | |||
| a92822bb87 | |||
| 1a9045a23f | |||
| fb0d35eddf | |||
| c367f1bfe9 | |||
| d789be4547 | |||
| 20e1e9b41c | |||
| b25f065f3c | |||
| 83cf2646cf | |||
| 11bc92bb10 | |||
| 953083e429 | |||
| 132990d705 | |||
| 0477c42208 | |||
| c11925e90f | |||
| d745119195 | |||
| aa283fd190 | |||
| 243125cbb4 | |||
| 2789051005 | |||
| 0b13379731 | |||
| 6cc7ba8ccd | |||
| 36674aeb65 | |||
| 9aa9b51710 | |||
| 15b87d7911 | |||
| c8bf133113 | |||
| faba640eee | |||
| e9ff1c198b | |||
| abc304e25c | |||
| 80f4dc6b83 | |||
| 8f5ef91890 | |||
| 2cef4e6fd8 | |||
| f2fce7a653 | |||
| 7581ae0bdb | |||
| 661ae9f09c | |||
| 44d411819f | |||
| 46134c10b6 | |||
| 36b7ae4843 | |||
| 63b4977c39 | |||
| ae927719c6 | |||
| 8944a8d191 | |||
| 5cdfc79aca | |||
| 2f24604fa8 | |||
| 2889e30386 | |||
| a9458620c1 | |||
| 7fe03cbbb4 | |||
| d0646eb922 | |||
| 83f37dc628 | |||
| 568d7c109d | |||
| 1c36907b47 | |||
| d2e45a937e | |||
| 13f9fc9bd2 | |||
| 614756e1bb | |||
| 601471482a | |||
| 8e112dc210 | |||
| 007ad8439c | |||
| 1ffca8b52c | |||
| c96251ba99 | |||
| 19e347412c | |||
| 8ff06da714 | |||
| a18408724c | |||
| 701f1f2b87 | |||
| 2bb53b0b06 | |||
| f456c16827 | |||
| 334bfa68f7 | |||
| 51bbaf0bfe | |||
| 57cf143306 | |||
| a804043d2e | |||
| 59865b140e | |||
| 959cbfb28b | |||
| 6023318ff4 | |||
| d39c5bec47 | |||
| 54522e0733 | |||
| 11e3cfc7bc | |||
| 114fc2dfa5 | |||
| 885495b13d | |||
| c6c8d62e84 | |||
| a72259b326 | |||
| 08cd099947 | |||
| 7dfb843b36 | |||
| 108b075e4f | |||
| ba0f00413d | |||
| 2d39dcacc3 | |||
| f4887ab587 | |||
| 6cb04a1216 | |||
| 8dcebea39c | |||
| 5b84a0cefe | |||
| f0d08c562e | |||
| 0e77455500 | |||
| d1247d5c7e | |||
| bc06203edd | |||
| c768b80802 | |||
| ae204b7ee2 | |||
| d21067988c | |||
| 9c503cdb5c |
@@ -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
|
||||||
|
|
||||||
|
|
||||||
@@ -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>
|
||||||
@@ -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
|
||||||
@@ -108,6 +108,8 @@ Public Class CompoListPageVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As Boolean)
|
Set(value As Boolean)
|
||||||
If m_SideAngle_IsChecked OrElse m_Drip_IsChecked Then Return
|
If m_SideAngle_IsChecked OrElse m_Drip_IsChecked Then Return
|
||||||
|
CompoWindowMap.refCompoSceneHostV.m_SelListHole.Clear()
|
||||||
|
CompoWindowMap.refCompoSceneHostV.m_DeselectListHole.Clear()
|
||||||
m_FiloTop_IsChecked = value
|
m_FiloTop_IsChecked = value
|
||||||
If value Then
|
If value Then
|
||||||
' Se non ci sono loop interni, imposto quello esterno
|
' Se non ci sono loop interni, imposto quello esterno
|
||||||
@@ -122,6 +124,7 @@ Public Class CompoListPageVM
|
|||||||
SideEntityControl = New SideEntityControlV(m_SideEntityControlVM)
|
SideEntityControl = New SideEntityControlV(m_SideEntityControlVM)
|
||||||
m_CompoListVisibility = Visibility.Collapsed
|
m_CompoListVisibility = Visibility.Collapsed
|
||||||
m_CompoBackVisibility = Visibility.Collapsed
|
m_CompoBackVisibility = Visibility.Collapsed
|
||||||
|
CompoWindowMap.refCompoSceneHostV.SetRefSideEntityControlVM(m_SideEntityControlVM)
|
||||||
Else
|
Else
|
||||||
m_SideEntityControlVM.Close()
|
m_SideEntityControlVM.Close()
|
||||||
m_SideEntityControlVM = Nothing
|
m_SideEntityControlVM = Nothing
|
||||||
@@ -300,9 +303,16 @@ Public Class CompoListPageVM
|
|||||||
m_BackVisibility = Visibility.Visible
|
m_BackVisibility = Visibility.Visible
|
||||||
m_SideEntity_Visibility = Visibility.Collapsed
|
m_SideEntity_Visibility = Visibility.Collapsed
|
||||||
Else
|
Else
|
||||||
LoadInternalCompoList()
|
' differenzio il caso di AlzAndFront
|
||||||
m_BackVisibility = Visibility.Visible
|
If CompoWindowMap.refCompoWindowVM.m_bSelAlzAndFront Then
|
||||||
m_SideEntity_Visibility = Visibility.Visible
|
' 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
|
End If
|
||||||
NotifyPropertyChanged("BackVisibility")
|
NotifyPropertyChanged("BackVisibility")
|
||||||
NotifyPropertyChanged("SideEntity_Visibility")
|
NotifyPropertyChanged("SideEntity_Visibility")
|
||||||
@@ -449,8 +459,32 @@ Public Class CompoListPageVM
|
|||||||
If IsNothing(CompoWindowMap.refCompoWindowVM.m_SelCompo) Then
|
If IsNothing(CompoWindowMap.refCompoWindowVM.m_SelCompo) Then
|
||||||
CompoWindowMap.refCompoWindowVM.m_SelCompoFamily = Nothing
|
CompoWindowMap.refCompoWindowVM.m_SelCompoFamily = Nothing
|
||||||
InitCompoListPage()
|
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
|
Else
|
||||||
CompoWindowMap.refCompoWindowVM.m_SelCompo = Nothing
|
CompoWindowMap.refCompoWindowVM.m_SelCompo = Nothing
|
||||||
|
CompoWindowMap.refCompoParamPageVM.ListParamIsEnable = True
|
||||||
InitCompoListPage()
|
InitCompoListPage()
|
||||||
EgtNewFile()
|
EgtNewFile()
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
|||||||
@@ -307,7 +307,8 @@ Public Class CompoManagerVM
|
|||||||
' Passo al contesto principale
|
' Passo al contesto principale
|
||||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||||
' Inserisco il componente nel DB geometrico principale
|
' 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
|
' Aggiorno ambiente principale
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
' Elimino riferimento con delegato
|
' Elimino riferimento con delegato
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
</ToggleButton.Content>
|
</ToggleButton.Content>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|
||||||
<!--FiloTop--><!--
|
<!--FiloTop-->
|
||||||
<ToggleButton Padding="0"
|
<!--<ToggleButton Padding="0"
|
||||||
IsChecked="{Binding FiloTop_IsChecked}"
|
IsChecked="{Binding FiloTop_IsChecked}"
|
||||||
Style="{StaticResource CompoWindow_ToggleButton}"
|
Style="{StaticResource CompoWindow_ToggleButton}"
|
||||||
Margin="0,0,1.75,0"
|
Margin="0,0,1.75,0"
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"/>
|
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"/>
|
||||||
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
||||||
Text="{Binding Value}"/>
|
Text="{Binding Value}" IsEnabled="{Binding IsEnable}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type OmagOFFICE:CheckParamItem}">
|
<DataTemplate DataType="{x:Type OmagOFFICE:CheckParamItem}">
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="{Binding Name}"/>
|
<TextBlock Text="{Binding Name}"/>
|
||||||
<CheckBox Grid.Column="1"
|
<CheckBox Grid.Column="1"
|
||||||
IsChecked="{Binding Value}"
|
IsChecked="{Binding Value}" IsEnabled="{Binding IsEnable}"
|
||||||
HorizontalAlignment="Center"/>
|
HorizontalAlignment="Center"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
@@ -124,6 +124,11 @@
|
|||||||
Visibility="{Binding Internal_Visibility}"
|
Visibility="{Binding Internal_Visibility}"
|
||||||
Style="{StaticResource CompoWindow_Button}"/>
|
Style="{StaticResource CompoWindow_Button}"/>
|
||||||
|
|
||||||
|
<Button Content="{Binding AlzAndFrontMsg}"
|
||||||
|
Command="{Binding AlzAndFrontCommand}"
|
||||||
|
Visibility="{Binding AlzAndFront_Visibility}"
|
||||||
|
Style="{StaticResource CompoWindow_Button}"/>
|
||||||
|
|
||||||
<UniformGrid Columns="2"
|
<UniformGrid Columns="2"
|
||||||
Margin="0,0,0,5"
|
Margin="0,0,0,5"
|
||||||
Visibility="{Binding AddRemove_Visibility}">
|
Visibility="{Binding AddRemove_Visibility}">
|
||||||
|
|||||||
@@ -23,12 +23,35 @@ Public Class CompoParamPageVM
|
|||||||
Friend Const COMPO_LAYER_QUOTATURE As String = "Quotature"
|
Friend Const COMPO_LAYER_QUOTATURE As String = "Quotature"
|
||||||
Friend Const COMPO_LAYER_ETICHETTE As String = "Etichette"
|
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)
|
Private m_CompoParamList As New ObservableCollection(Of CompoParamItem)
|
||||||
Public ReadOnly Property CompoParamList As ObservableCollection(Of CompoParamItem)
|
Public ReadOnly Property CompoParamList As ObservableCollection(Of CompoParamItem)
|
||||||
Get
|
Get
|
||||||
Return m_CompoParamList
|
Return m_CompoParamList
|
||||||
End Get
|
End Get
|
||||||
End Property
|
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
|
Private m_Internal_Visibility As Visibility
|
||||||
Public Property Internal_Visibility As Visibility
|
Public Property Internal_Visibility As Visibility
|
||||||
@@ -41,6 +64,17 @@ Public Class CompoParamPageVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private m_AlzAndFront_Visibility As Visibility
|
||||||
|
Public Property AlzAndFront_Visibility As Visibility
|
||||||
|
Get
|
||||||
|
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
|
Private m_AddRemove_Visibility As Visibility
|
||||||
Public Property AddRemove_Visibility As Visibility
|
Public Property AddRemove_Visibility As Visibility
|
||||||
Get
|
Get
|
||||||
@@ -129,7 +163,7 @@ Public Class CompoParamPageVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private m_SideEntityControlVM As SideEntityControlVM
|
#Region "SideAngle"
|
||||||
|
|
||||||
Private m_SideAngle_IsChecked As Boolean
|
Private m_SideAngle_IsChecked As Boolean
|
||||||
Public Property SideAngle_IsChecked As Boolean
|
Public Property SideAngle_IsChecked As Boolean
|
||||||
@@ -172,9 +206,17 @@ Public Class CompoParamPageVM
|
|||||||
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
|
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
|
||||||
' Attivo layer delle misure
|
' Attivo layer delle misure
|
||||||
Dim PartId As Integer = EgtGetFirstPart()
|
Dim PartId As Integer = EgtGetFirstPart()
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
|
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
|
If Not ListParamIsEnable Then
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
|
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
|
End If
|
||||||
NotifyPropertyChanged("SideAngle_IsChecked")
|
NotifyPropertyChanged("SideAngle_IsChecked")
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
@@ -192,6 +234,10 @@ Public Class CompoParamPageVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
#End Region ' SideAngle
|
||||||
|
|
||||||
|
#Region "FiloTop"
|
||||||
|
|
||||||
Private m_FiloTop_IsChecked As Boolean
|
Private m_FiloTop_IsChecked As Boolean
|
||||||
Public Property FiloTop_IsChecked As Boolean
|
Public Property FiloTop_IsChecked As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -233,9 +279,17 @@ Public Class CompoParamPageVM
|
|||||||
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
|
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
|
||||||
' Attivo layer delle misure
|
' Attivo layer delle misure
|
||||||
Dim PartId As Integer = EgtGetFirstPart()
|
Dim PartId As Integer = EgtGetFirstPart()
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
|
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
|
If Not ListParamIsEnable Then
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
|
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
|
End If
|
||||||
NotifyPropertyChanged("FiloTop_IsChecked")
|
NotifyPropertyChanged("FiloTop_IsChecked")
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
@@ -253,6 +307,10 @@ Public Class CompoParamPageVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
#End Region ' FiloTop
|
||||||
|
|
||||||
|
#Region "Drip"
|
||||||
|
|
||||||
Private m_Drip_IsChecked As Boolean
|
Private m_Drip_IsChecked As Boolean
|
||||||
Public Property Drip_IsChecked As Boolean
|
Public Property Drip_IsChecked As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -293,9 +351,17 @@ Public Class CompoParamPageVM
|
|||||||
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
|
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
|
||||||
' Attivo layer delle misure
|
' Attivo layer delle misure
|
||||||
Dim PartId As Integer = EgtGetFirstPart()
|
Dim PartId As Integer = EgtGetFirstPart()
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
|
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
|
If Not ListParamIsEnable Then
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
|
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
|
End If
|
||||||
NotifyPropertyChanged("Drip_IsChecked")
|
NotifyPropertyChanged("Drip_IsChecked")
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
@@ -313,6 +379,10 @@ Public Class CompoParamPageVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
#End Region ' Drip
|
||||||
|
|
||||||
|
#Region "Engrave"
|
||||||
|
|
||||||
Private m_Engrave_IsChecked As Boolean
|
Private m_Engrave_IsChecked As Boolean
|
||||||
Public Property Engrave_IsChecked As Boolean
|
Public Property Engrave_IsChecked As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -339,8 +409,13 @@ Public Class CompoParamPageVM
|
|||||||
CompoWindowMap.refCompoSceneHostV.CompoScene,
|
CompoWindowMap.refCompoSceneHostV.CompoScene,
|
||||||
SideEntityControlVM.ModeOpt.ENGRAVE)
|
SideEntityControlVM.ModeOpt.ENGRAVE)
|
||||||
SideEntityControl = New SideEntityControlV(m_SideEntityControlVM)
|
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
|
Else
|
||||||
SideAngle_IsEnabled = True
|
SideAngle_IsEnabled = True
|
||||||
Drip_IsEnabled = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.UNDER_CUT) And
|
Drip_IsEnabled = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(CurrentMachine.sCurrDripSaw)
|
Not String.IsNullOrWhiteSpace(CurrentMachine.sCurrDripSaw)
|
||||||
FiloTop_IsEnabled = True
|
FiloTop_IsEnabled = True
|
||||||
@@ -354,9 +429,17 @@ Public Class CompoParamPageVM
|
|||||||
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
|
CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL
|
||||||
' Attivo layer delle misure
|
' Attivo layer delle misure
|
||||||
Dim PartId As Integer = EgtGetFirstPart()
|
Dim PartId As Integer = EgtGetFirstPart()
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_)
|
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
|
If Not ListParamIsEnable Then
|
||||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
|
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
|
End If
|
||||||
NotifyPropertyChanged("Engrave_IsChecked")
|
NotifyPropertyChanged("Engrave_IsChecked")
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
@@ -374,6 +457,8 @@ Public Class CompoParamPageVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
#End Region ' Engrave
|
||||||
|
|
||||||
Private m_SideEntityControl As SideEntityControlV
|
Private m_SideEntityControl As SideEntityControlV
|
||||||
Public Property SideEntityControl As SideEntityControlV
|
Public Property SideEntityControl As SideEntityControlV
|
||||||
Get
|
Get
|
||||||
@@ -385,6 +470,8 @@ Public Class CompoParamPageVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Region "Messages"
|
#Region "Messages"
|
||||||
|
|
||||||
Public ReadOnly Property InternalMsg As String
|
Public ReadOnly Property InternalMsg As String
|
||||||
@@ -392,6 +479,12 @@ Public Class CompoParamPageVM
|
|||||||
Return EgtMsg(MSG_COMPONENTPAGEUC + 47)
|
Return EgtMsg(MSG_COMPONENTPAGEUC + 47)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Public ReadOnly Property AlzAndFrontMsg As String
|
||||||
|
Get
|
||||||
|
Return "Alzatine e frontalini"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Private m_AddMsg As String
|
Private m_AddMsg As String
|
||||||
Public Property AddMsg As String
|
Public Property AddMsg As String
|
||||||
Get
|
Get
|
||||||
@@ -432,6 +525,7 @@ Public Class CompoParamPageVM
|
|||||||
|
|
||||||
' definizione comandi
|
' definizione comandi
|
||||||
Private m_cmdInternal As ICommand
|
Private m_cmdInternal As ICommand
|
||||||
|
Private m_cmdAlzAndFront As ICommand
|
||||||
Private m_cmdAdd As ICommand
|
Private m_cmdAdd As ICommand
|
||||||
Private m_cmdCancel As ICommand
|
Private m_cmdCancel As ICommand
|
||||||
Private m_cmdBack As ICommand
|
Private m_cmdBack As ICommand
|
||||||
@@ -471,7 +565,7 @@ Public Class CompoParamPageVM
|
|||||||
CompoWindowMap.refCompoSceneHostV.CompoScene.ZoomAll()
|
CompoWindowMap.refCompoSceneHostV.CompoScene.ZoomAll()
|
||||||
' Imposto messaggio aggiungi
|
' Imposto messaggio aggiungi
|
||||||
AddMsg = EgtMsg(MSG_COMPONENTPAGEUC + 48)
|
AddMsg = EgtMsg(MSG_COMPONENTPAGEUC + 48)
|
||||||
' altrimenti se è un compo interno
|
' altrimenti se è un compo interno
|
||||||
Else
|
Else
|
||||||
If Not bOk Then
|
If Not bOk Then
|
||||||
EgtOutLog("Error in Component " & CompoWindowMap.refCompoWindowVM.m_SelInternalCompo.LuaPath)
|
EgtOutLog("Error in Component " & CompoWindowMap.refCompoWindowVM.m_SelInternalCompo.LuaPath)
|
||||||
@@ -491,8 +585,60 @@ Public Class CompoParamPageVM
|
|||||||
EgtLuaGetGlobBoolVar(LUA_CMP_WITHINT, bHasInternalCompo)
|
EgtLuaGetGlobBoolVar(LUA_CMP_WITHINT, bHasInternalCompo)
|
||||||
Internal_Visibility = If(bHasInternalCompo, Visibility.Visible, Visibility.Collapsed)
|
Internal_Visibility = If(bHasInternalCompo, Visibility.Visible, Visibility.Collapsed)
|
||||||
SideEntity_Visibility = Visibility.Visible
|
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
|
Else
|
||||||
Internal_Visibility = Visibility.Collapsed
|
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
|
AddRemove_Visibility = Visibility.Visible
|
||||||
Back_Visibility = Visibility.Collapsed
|
Back_Visibility = Visibility.Collapsed
|
||||||
SideEntity_Visibility = Visibility.Collapsed
|
SideEntity_Visibility = Visibility.Collapsed
|
||||||
@@ -602,6 +748,50 @@ Public Class CompoParamPageVM
|
|||||||
NotifyPropertyChanged("MsgColor")
|
NotifyPropertyChanged("MsgColor")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub UpdateInLoopReference(nCmp As Integer)
|
||||||
|
' aggiorno il layer "FiloTop"
|
||||||
|
Dim nIdInLoop As Integer = EgtGetFirstNameInGroup(EgtGetFirstGroupInGroup(GDB_ID.ROOT), "InLoop")
|
||||||
|
While nIdInLoop <> GDB_ID.NULL
|
||||||
|
Dim nCmpInfoIL As Integer = 0
|
||||||
|
If EgtGetInfo(nIdInLoop, "ID", nCmpInfoIL) AndAlso nCmp = nCmpInfoIL Then
|
||||||
|
Dim nLayFiloTop As Integer = GDB_ID.NULL
|
||||||
|
EgtGetInfo(nIdInLoop, "FiloTopRef", nLayFiloTop)
|
||||||
|
If nLayFiloTop <> GDB_ID.NULL Then
|
||||||
|
Dim LocalList As New List(Of Integer) From {nIdInLoop}
|
||||||
|
If IsNothing(m_SideEntityControlVM) Then
|
||||||
|
m_SideEntityControlVM = New SideEntityControlVM(SideEntityControlVM.CallingWindowOpt.COMPO,
|
||||||
|
CompoWindowMap.refCompoSceneHostV.CompoScene,
|
||||||
|
SideEntityControlVM.ModeOpt.FILOTOP)
|
||||||
|
m_SideEntityControlVM.CreateFiloTopPreView(LocalList)
|
||||||
|
Else
|
||||||
|
m_SideEntityControlVM.CreateFiloTopPreView(LocalList)
|
||||||
|
End If
|
||||||
|
EgtSetStatus(nLayFiloTop, GDB_ST.ON_)
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nIdInLoop = EgtGetNextName(nIdInLoop, "InLoop")
|
||||||
|
End While
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' riceve la info "ID" della componente
|
||||||
|
Public Sub SetStatusVisibilityInLoopReference(nCmp As Integer, Status As GDB_ST)
|
||||||
|
' aggiorno il layer "FiloTop"
|
||||||
|
Dim nIdInLoop As Integer = EgtGetFirstNameInGroup(EgtGetFirstGroupInGroup(GDB_ID.ROOT), "InLoop")
|
||||||
|
While nIdInLoop <> GDB_ID.NULL
|
||||||
|
Dim nCmpInfoIL As Integer = 0
|
||||||
|
If EgtGetInfo(nIdInLoop, "ID", nCmpInfoIL) AndAlso nCmp = nCmpInfoIL Then
|
||||||
|
Dim nLayFiloTop As Integer = GDB_ID.NULL
|
||||||
|
EgtGetInfo(nIdInLoop, "FiloTopRef", nLayFiloTop)
|
||||||
|
If nLayFiloTop <> GDB_ID.NULL Then
|
||||||
|
EgtSetStatus(nLayFiloTop, Status)
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nIdInLoop = EgtGetNextName(nIdInLoop, "InLoop")
|
||||||
|
End While
|
||||||
|
End Sub
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|
||||||
#Region "COMMANDS"
|
#Region "COMMANDS"
|
||||||
@@ -620,7 +810,14 @@ Public Class CompoParamPageVM
|
|||||||
|
|
||||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||||
Public Sub Internal(ByVal param As Object)
|
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_SelInternalCompo = Nothing
|
||||||
|
CompoWindowMap.refCompoWindowVM.m_bSelInternalCompo = True
|
||||||
|
CompoWindowMap.refCompoWindowVM.m_bSelAlzAndFront = False
|
||||||
CompoWindowMap.refCompoWindowVM.CompoPage = CompoWindowVM.CompoPageOpt.LIST
|
CompoWindowMap.refCompoWindowVM.CompoPage = CompoWindowVM.CompoPageOpt.LIST
|
||||||
' Nascondo layer etichette e quotature
|
' Nascondo layer etichette e quotature
|
||||||
Dim Pz As Integer = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
|
Dim Pz As Integer = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
|
||||||
@@ -632,6 +829,61 @@ Public Class CompoParamPageVM
|
|||||||
|
|
||||||
#End Region ' InternalCommand
|
#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"
|
#Region "AddCommand"
|
||||||
|
|
||||||
' Returns a command that manage the MainWindow_Unloaded command
|
' Returns a command that manage the MainWindow_Unloaded command
|
||||||
@@ -657,6 +909,7 @@ Public Class CompoParamPageVM
|
|||||||
Dim nCmpInfo As Integer = 0
|
Dim nCmpInfo As Integer = 0
|
||||||
If EgtGetInfo(nId, "ID", nCmpInfo) AndAlso nCmp = nCmpInfo Then
|
If EgtGetInfo(nId, "ID", nCmpInfo) AndAlso nCmp = nCmpInfo Then
|
||||||
EgtSetStatus(nId, GDB_ST.OFF)
|
EgtSetStatus(nId, GDB_ST.OFF)
|
||||||
|
UpdateInLoopReference(nCmp)
|
||||||
Exit While
|
Exit While
|
||||||
End If
|
End If
|
||||||
nId = EgtGetNextName(nId, "HoleLabels")
|
nId = EgtGetNextName(nId, "HoleLabels")
|
||||||
@@ -726,13 +979,54 @@ Public Class CompoParamPageVM
|
|||||||
|
|
||||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||||
Public Sub Back(ByVal param As Object)
|
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
|
If CompoWindowMap.refCompoWindowVM.m_SelCompoFamily Is CompoWindowMap.refCompoWindowVM.m_SelCompo Then
|
||||||
CompoWindowMap.refCompoWindowVM.m_SelCompoFamily = Nothing
|
CompoWindowMap.refCompoWindowVM.m_SelCompoFamily = Nothing
|
||||||
End If
|
End If
|
||||||
|
ListParamIsEnable = True
|
||||||
CompoWindowMap.refCompoWindowVM.m_SelCompo = Nothing
|
CompoWindowMap.refCompoWindowVM.m_SelCompo = Nothing
|
||||||
CompoWindowMap.refCompoWindowVM.CompoPage = CompoWindowVM.CompoPageOpt.LIST
|
CompoWindowMap.refCompoWindowVM.CompoPage = CompoWindowVM.CompoPageOpt.LIST
|
||||||
EgtNewFile()
|
EgtNewFile()
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' BackCommand
|
#End Region ' BackCommand
|
||||||
@@ -742,6 +1036,7 @@ Public Class CompoParamPageVM
|
|||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Class CompoParamItem
|
Public Class CompoParamItem
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
Public Enum ParamType As Integer
|
Public Enum ParamType As Integer
|
||||||
BOOL = 1
|
BOOL = 1
|
||||||
@@ -774,6 +1069,18 @@ Public Class CompoParamItem
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
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)
|
Sub New(nInd As Integer, sName As String, nType As ParamType)
|
||||||
m_nInd = nInd
|
m_nInd = nInd
|
||||||
m_sName = sName
|
m_sName = sName
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ Imports EgtWPFLib5
|
|||||||
|
|
||||||
Public Class CompoSceneHostV
|
Public Class CompoSceneHostV
|
||||||
|
|
||||||
|
Public m_SelListHole As New List(Of Integer)
|
||||||
|
Public m_DeselectListHole As New List(Of Integer)
|
||||||
|
|
||||||
|
Private m_refSideEntityControlVM As SideEntityControlVM
|
||||||
|
|
||||||
Private m_SelFromScene As Boolean = False
|
Private m_SelFromScene As Boolean = False
|
||||||
Friend ReadOnly Property SelFromScene As Boolean
|
Friend ReadOnly Property SelFromScene As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -36,6 +41,10 @@ Public Class CompoSceneHostV
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Sub SetRefSideEntityControlVM(refSideEntityControl As SideEntityControlVM)
|
||||||
|
m_refSideEntityControlVM = refSideEntityControl
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub PreInitializeScene()
|
Private Sub PreInitializeScene()
|
||||||
' imposto colore di default
|
' imposto colore di default
|
||||||
Dim DefColor As New Color3d(0, 0, 0)
|
Dim DefColor As New Color3d(0, 0, 0)
|
||||||
@@ -156,6 +165,8 @@ Public Class CompoSceneHostV
|
|||||||
Dim nCmpInfo As Integer = 0
|
Dim nCmpInfo As Integer = 0
|
||||||
If EgtGetInfo(nHLId, "ID", nCmpInfo) AndAlso nCmp = nCmpInfo Then
|
If EgtGetInfo(nHLId, "ID", nCmpInfo) AndAlso nCmp = nCmpInfo Then
|
||||||
EgtSetStatus(nHLId, GDB_ST.ON_)
|
EgtSetStatus(nHLId, GDB_ST.ON_)
|
||||||
|
' nascondo eventuali FiloTop
|
||||||
|
CompoWindowMap.refCompoParamPageVM.SetStatusVisibilityInLoopReference(nCmp, GDB_ST.OFF)
|
||||||
Exit While
|
Exit While
|
||||||
End If
|
End If
|
||||||
nHLId = EgtGetNextName(nHLId, "HoleLabels")
|
nHLId = EgtGetNextName(nHLId, "HoleLabels")
|
||||||
@@ -262,6 +273,8 @@ Public Class CompoSceneHostV
|
|||||||
EgtRemoveInfo(nLayId, INFO_DEPTH)
|
EgtRemoveInfo(nLayId, INFO_DEPTH)
|
||||||
EgtResetColor(nLayId)
|
EgtResetColor(nLayId)
|
||||||
End If
|
End If
|
||||||
|
m_DeselectListHole.Add(nLayId)
|
||||||
|
m_SelListHole.Remove(nLayId)
|
||||||
Else
|
Else
|
||||||
Dim sLayName As String = ""
|
Dim sLayName As String = ""
|
||||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then
|
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then
|
||||||
@@ -272,12 +285,18 @@ Public Class CompoSceneHostV
|
|||||||
EgtSetInfo(nLayId, INFO_DEPTH, SideAngleEntity.m_Parameter2)
|
EgtSetInfo(nLayId, INFO_DEPTH, SideAngleEntity.m_Parameter2)
|
||||||
EgtSetColor(nLayId, New Color3d(255, 255, 255))
|
EgtSetColor(nLayId, New Color3d(255, 255, 255))
|
||||||
End If
|
End If
|
||||||
|
m_SelListHole.Add(nLayId)
|
||||||
|
m_DeselectListHole.Remove(nLayId)
|
||||||
End If
|
End If
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
nId = EgtGetNextObjInSelWin()
|
nId = EgtGetNextObjInSelWin()
|
||||||
End While
|
End While
|
||||||
|
If Not IsNothing(m_refSideEntityControlVM) Then
|
||||||
|
m_refSideEntityControlVM.CreateFiloTopPreView(m_SelListHole)
|
||||||
|
m_refSideEntityControlVM.EraseFiloTopPreview(m_DeselectListHole)
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' Events
|
#End Region ' Events
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ Public Class CompoWindowVM
|
|||||||
Friend m_SelCompo As CompoItem = Nothing
|
Friend m_SelCompo As CompoItem = Nothing
|
||||||
Friend m_SelInternalCompo 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
|
Private m_sCompoDir As String = String.Empty
|
||||||
Friend m_bDrawOk As Boolean = False
|
Friend m_bDrawOk As Boolean = False
|
||||||
|
|
||||||
@@ -62,6 +65,15 @@ Public Class CompoWindowVM
|
|||||||
NotifyPropertyChanged("CompoPageControl")
|
NotifyPropertyChanged("CompoPageControl")
|
||||||
End Set
|
End Set
|
||||||
End Property
|
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_CompoListPageV As CompoListPageV
|
||||||
Private m_CompoParamPageV As CompoParamPageV
|
Private m_CompoParamPageV As CompoParamPageV
|
||||||
@@ -340,6 +352,237 @@ Public Class CompoWindowVM
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
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)
|
||||||
|
|
||||||
|
' identificativo univoico del gruppo di pezzi, se più di un pezzo
|
||||||
|
Dim sGUICode As String = String.Empty
|
||||||
|
|
||||||
|
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
|
||||||
|
If nNbr > 1 Then
|
||||||
|
sGUICode = System.Guid.NewGuid.ToString
|
||||||
|
End If
|
||||||
|
' 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)
|
||||||
|
|
||||||
|
' assegno l'identificatico del pezzo, se esiste
|
||||||
|
If Not String.IsNullOrEmpty(sGUICode) Then
|
||||||
|
Dim sPreGuid As String = EstCalc.CreatePreGuidCode(nId2)
|
||||||
|
EgtSetInfo(nId2, INFO_REFGROUP, sPreGuid & sGUICode)
|
||||||
|
End If
|
||||||
|
' muovo il pezzo nella prima posizione di parcheggio libera
|
||||||
|
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)
|
Friend Sub Close(bDialogResult As Boolean)
|
||||||
RaiseEvent m_CloseWindow(bDialogResult)
|
RaiseEvent m_CloseWindow(bDialogResult)
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ Module ConstIni
|
|||||||
Public Const S_GENERAL As String = "General"
|
Public Const S_GENERAL As String = "General"
|
||||||
Public Const K_DEBUG As String = "Debug"
|
Public Const K_DEBUG As String = "Debug"
|
||||||
Public Const K_LICENCE As String = "Licence"
|
Public Const K_LICENCE As String = "Licence"
|
||||||
|
Public Const K_NETKEY As String = "NetKey"
|
||||||
Public Const K_USERLEVEL As String = "UserLevel"
|
Public Const K_USERLEVEL As String = "UserLevel"
|
||||||
Public Const K_MAXINST As String = "MaxInstances"
|
Public Const K_MAXINST As String = "MaxInstances"
|
||||||
Public Const K_INSTANCES As String = "Instances"
|
Public Const K_INSTANCES As String = "Instances"
|
||||||
@@ -86,6 +87,8 @@ Module ConstIni
|
|||||||
Public Const K_SIDEMODE As String = "SideMode"
|
Public Const K_SIDEMODE As String = "SideMode"
|
||||||
Public Const K_TRFDATA As String = "TrfData"
|
Public Const K_TRFDATA As String = "TrfData"
|
||||||
Public Const K_CSVDATA As String = "CsvData"
|
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 S_FLATPARTS As String = "FlatParts"
|
||||||
Public Const K_FLPCURRDIR As String = "CurrDir"
|
Public Const K_FLPCURRDIR As String = "CurrDir"
|
||||||
@@ -101,6 +104,8 @@ Module ConstIni
|
|||||||
Public Const K_ENGRAVENUMBER2 As String = "EngraveNumber2"
|
Public Const K_ENGRAVENUMBER2 As String = "EngraveNumber2"
|
||||||
Public Const K_ENGRAVEDEPTH As String = "EngraveDepth"
|
Public Const K_ENGRAVEDEPTH As String = "EngraveDepth"
|
||||||
Public Const K_ENGRAVESHORT As String = "EngraveShort"
|
Public Const K_ENGRAVESHORT As String = "EngraveShort"
|
||||||
|
Public Const K_ENGRAVEANGLE As String = "EngraveAngle"
|
||||||
|
Public Const K_ENGRAVEDEPTH2 As String = "EngraveDepth2"
|
||||||
Public Const K_DRIPOFFSET As String = "DripOffset"
|
Public Const K_DRIPOFFSET As String = "DripOffset"
|
||||||
Public Const K_DRIPOFFSET2 As String = "DripOffset2"
|
Public Const K_DRIPOFFSET2 As String = "DripOffset2"
|
||||||
Public Const K_DRIPDEPTH As String = "DripDepth"
|
Public Const K_DRIPDEPTH As String = "DripDepth"
|
||||||
@@ -108,6 +113,7 @@ Module ConstIni
|
|||||||
Public Const K_UNDERDRILLDEPTH As String = "UnderDrillDepth"
|
Public Const K_UNDERDRILLDEPTH As String = "UnderDrillDepth"
|
||||||
Public Const K_FILOTOPOFFSET As String = "FiloTopOffset"
|
Public Const K_FILOTOPOFFSET As String = "FiloTopOffset"
|
||||||
Public Const K_FILOTOPDEPTH As String = "FiloTopDepth"
|
Public Const K_FILOTOPDEPTH As String = "FiloTopDepth"
|
||||||
|
Public Const K_FILOTOPROUNDOFF As String = "FiloTopRoundOff"
|
||||||
|
|
||||||
Public Const S_NEST As String = "Nest"
|
Public Const S_NEST As String = "Nest"
|
||||||
Public Const K_DIRECT As String = "Direct"
|
Public Const K_DIRECT As String = "Direct"
|
||||||
@@ -119,6 +125,11 @@ Module ConstIni
|
|||||||
Public Const K_TEXTCOLOR As String = "TextColor"
|
Public Const K_TEXTCOLOR As String = "TextColor"
|
||||||
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
|
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
|
||||||
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
|
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
|
||||||
|
Public Const K_DRAGRECTANGLE As String = "DragRectangle"
|
||||||
|
Public Const K_STARTENDMODIFYONINTCORNER As String = "StartEndModifyOnIntCorner"
|
||||||
|
|
||||||
|
Public Const S_SPLIT As String = "Split"
|
||||||
|
Public Const K_MOVE_LEV As String = "MoveLevel"
|
||||||
|
|
||||||
Public Const S_CSV As String = "Csv"
|
Public Const S_CSV As String = "Csv"
|
||||||
Public Const K_CSVDIRECT As String = "Direct"
|
Public Const K_CSVDIRECT As String = "Direct"
|
||||||
@@ -127,6 +138,7 @@ Module ConstIni
|
|||||||
Public Const K_CSVCURRDIR As String = "CurrDir"
|
Public Const K_CSVCURRDIR As String = "CurrDir"
|
||||||
Public Const K_CSVLASTFILE As String = "LastFile"
|
Public Const K_CSVLASTFILE As String = "LastFile"
|
||||||
Public Const K_THICKTOLERANCE As String = "ThickTolerance"
|
Public Const K_THICKTOLERANCE As String = "ThickTolerance"
|
||||||
|
Public Const K_FULL As String = "Full"
|
||||||
|
|
||||||
Public Const S_COLORTOSIDEANG As String = "ColorToSideAng"
|
Public Const S_COLORTOSIDEANG As String = "ColorToSideAng"
|
||||||
Public Const K_CTSA_ENABLE As String = "Enable"
|
Public Const K_CTSA_ENABLE As String = "Enable"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
MinWidth="270" MinHeight="250"
|
MinWidth="270" MinHeight="250"
|
||||||
|
MaxWidth="500"
|
||||||
ResizeMode="NoResize">
|
ResizeMode="NoResize">
|
||||||
|
|
||||||
<DockPanel Margin="5,5,5,0">
|
<DockPanel Margin="5,5,5,0">
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports System.IO
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
@@ -110,6 +111,8 @@ Public Class CsvWindowVM
|
|||||||
#Region "METHODS"
|
#Region "METHODS"
|
||||||
|
|
||||||
Private Sub ShowTreeView()
|
Private Sub ShowTreeView()
|
||||||
|
Dim bFull = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.CSV_AUTO) And
|
||||||
|
(GetMainPrivateProfileInt(S_CSV, K_FULL, 1) <> 0)
|
||||||
' Path del file Csv
|
' Path del file Csv
|
||||||
Dim TempPath As New Text.StringBuilder(260)
|
Dim TempPath As New Text.StringBuilder(260)
|
||||||
PathCompactPathEx(TempPath, CsvM.CsvPath, 56, 0)
|
PathCompactPathEx(TempPath, CsvM.CsvPath, 56, 0)
|
||||||
@@ -118,6 +121,7 @@ Public Class CsvWindowVM
|
|||||||
m_CsvTypeList.Clear()
|
m_CsvTypeList.Clear()
|
||||||
Dim sCurrMat As String = String.Empty
|
Dim sCurrMat As String = String.Empty
|
||||||
Dim dCurrTh As Double = 0
|
Dim dCurrTh As Double = 0
|
||||||
|
Dim sCurrPath As String = String.Empty
|
||||||
Dim nCatToNest As Integer = 0
|
Dim nCatToNest As Integer = 0
|
||||||
Dim nCatCount As Integer = 0
|
Dim nCatCount As Integer = 0
|
||||||
Dim PartCathegory As New CsvPartType("", 0)
|
Dim PartCathegory As New CsvPartType("", 0)
|
||||||
@@ -128,15 +132,29 @@ Public Class CsvWindowVM
|
|||||||
If i = 1 Then
|
If i = 1 Then
|
||||||
sCurrMat = CurrPart.m_sMaterial
|
sCurrMat = CurrPart.m_sMaterial
|
||||||
dCurrTh = CurrPart.m_dTh
|
dCurrTh = CurrPart.m_dTh
|
||||||
|
sCurrPath = CurrPart.m_sPath
|
||||||
ElseIf String.Compare(sCurrMat, CurrPart.m_sMaterial, True) <> 0 Or
|
ElseIf String.Compare(sCurrMat, CurrPart.m_sMaterial, True) <> 0 Or
|
||||||
|
String.Compare(sCurrPath, CurrPart.m_sPath, True) <> 0 Or
|
||||||
Math.Abs(dCurrTh - CurrPart.m_dTh) > 10 * EPS_SMALL Then
|
Math.Abs(dCurrTh - CurrPart.m_dTh) > 10 * EPS_SMALL Then
|
||||||
PartCathegory.Name = If(String.IsNullOrWhiteSpace(sCurrMat), "***", sCurrMat) &
|
|
||||||
" - " & LenToString(dCurrTh, 2) &
|
If bFull Then
|
||||||
" - " & nCatToNest.ToString() & "/" & nCatCount.ToString()
|
PartCathegory.Name = If(String.IsNullOrWhiteSpace(sCurrMat), "***", sCurrMat) &
|
||||||
|
" - " & LenToString(dCurrTh, 2) &
|
||||||
|
" - " & nCatToNest.ToString() & "/" & nCatCount.ToString()
|
||||||
|
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
|
||||||
|
PartCathegory.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
PartCathegory.Name = nCatToNest.ToString() & "/" & nCatCount.ToString()
|
||||||
|
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
|
||||||
|
PartCathegory.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
PartCathegory.IsExpanded = True
|
PartCathegory.IsExpanded = True
|
||||||
CsvTypeList.Add(PartCathegory)
|
CsvTypeList.Add(PartCathegory)
|
||||||
sCurrMat = CurrPart.m_sMaterial
|
sCurrMat = CurrPart.m_sMaterial
|
||||||
dCurrTh = CurrPart.m_dTh
|
dCurrTh = CurrPart.m_dTh
|
||||||
|
sCurrPath = CurrPart.m_sPath
|
||||||
PartCathegory = New CsvPartType("", 0)
|
PartCathegory = New CsvPartType("", 0)
|
||||||
nCatToNest = 0
|
nCatToNest = 0
|
||||||
nCatCount = 0
|
nCatCount = 0
|
||||||
@@ -150,18 +168,31 @@ Public Class CsvWindowVM
|
|||||||
PartCathegory.CsvPartList.Add(New CsvPartItem(CurrPart.m_sName, i, sCount, sDim, CurrPart.m_bActive))
|
PartCathegory.CsvPartList.Add(New CsvPartItem(CurrPart.m_sName, i, sCount, sDim, CurrPart.m_bActive))
|
||||||
Next
|
Next
|
||||||
' Inserisco ultima categoria
|
' Inserisco ultima categoria
|
||||||
PartCathegory.Name = If(String.IsNullOrWhiteSpace(sCurrMat), "***", sCurrMat) &
|
If bFull Then
|
||||||
" - " & LenToString(dCurrTh, 2) &
|
PartCathegory.Name = If(String.IsNullOrWhiteSpace(sCurrMat), "***", sCurrMat) &
|
||||||
" - " & nCatToNest.ToString() & "/" & nCatCount.ToString()
|
" - " & LenToString(dCurrTh, 2) &
|
||||||
|
" - " & nCatToNest.ToString() & "/" & nCatCount.ToString()
|
||||||
|
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
|
||||||
|
PartCathegory.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
PartCathegory.Name = nCatToNest.ToString() & "/" & nCatCount.ToString()
|
||||||
|
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
|
||||||
|
PartCathegory.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
PartCathegory.IsExpanded = True
|
PartCathegory.IsExpanded = True
|
||||||
CsvTypeList.Add(PartCathegory)
|
CsvTypeList.Add(PartCathegory)
|
||||||
NotifyPropertyChanged("CsvTypeList")
|
NotifyPropertyChanged("CsvTypeList")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub UpdateTreeView()
|
Private Sub UpdateTreeView()
|
||||||
|
Dim bFull = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.CSV_AUTO) And
|
||||||
|
(GetMainPrivateProfileInt(S_CSV, K_FULL, 1) <> 0)
|
||||||
For Each CatItem As CsvPartType In m_CsvTypeList
|
For Each CatItem As CsvPartType In m_CsvTypeList
|
||||||
Dim sCurrMat As String = String.Empty
|
Dim sCurrMat As String = String.Empty
|
||||||
Dim dCurrTh As Double = 0
|
Dim dCurrTh As Double = 0
|
||||||
|
Dim sCurrPath As String = String.Empty
|
||||||
Dim nCatToNest As Integer = 0
|
Dim nCatToNest As Integer = 0
|
||||||
Dim nCatCount As Integer = 0
|
Dim nCatCount As Integer = 0
|
||||||
For Each PrtItem As CsvPartItem In CatItem.CsvPartList
|
For Each PrtItem As CsvPartItem In CatItem.CsvPartList
|
||||||
@@ -171,12 +202,23 @@ Public Class CsvWindowVM
|
|||||||
PrtItem.sText1 = sCount
|
PrtItem.sText1 = sCount
|
||||||
sCurrMat = PartData.m_sMaterial
|
sCurrMat = PartData.m_sMaterial
|
||||||
dCurrTh = PartData.m_dTh
|
dCurrTh = PartData.m_dTh
|
||||||
|
sCurrPath = PartData.m_sPath
|
||||||
nCatToNest += PartData.m_nToNest
|
nCatToNest += PartData.m_nToNest
|
||||||
nCatCount += PartData.m_nCount + PartData.m_nAdd
|
nCatCount += PartData.m_nCount + PartData.m_nAdd
|
||||||
Next
|
Next
|
||||||
CatItem.Name = If(String.IsNullOrWhiteSpace(sCurrMat), "***", sCurrMat) &
|
If bFull Then
|
||||||
" - " & LenToString(dCurrTh, 2) &
|
CatItem.Name = If(String.IsNullOrWhiteSpace(sCurrMat), "***", sCurrMat) &
|
||||||
" - " & nCatToNest.ToString() & "/" & nCatCount.ToString()
|
" - " & LenToString(dCurrTh, 2) &
|
||||||
|
" - " & nCatToNest.ToString() & "/" & nCatCount.ToString()
|
||||||
|
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
|
||||||
|
CatItem.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
CatItem.Name = nCatToNest.ToString() & "/" & nCatCount.ToString()
|
||||||
|
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
|
||||||
|
CatItem.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,11 @@
|
|||||||
<StackPanel Margin="5,5,5,0">
|
<StackPanel Margin="5,5,5,0">
|
||||||
<!--TAGLIO-->
|
<!--TAGLIO-->
|
||||||
<TextBlock Text="{Binding CurrSawingMsg}"
|
<TextBlock Text="{Binding CurrSawingMsg}"
|
||||||
|
Visibility="{Binding CurrSawing_Visibility}"
|
||||||
Margin="0,0,0,5"/>
|
Margin="0,0,0,5"/>
|
||||||
<ComboBox ItemsSource="{Binding CurrSawingList}"
|
<ComboBox ItemsSource="{Binding CurrSawingList}"
|
||||||
SelectedItem="{Binding SelCurrSawing}"
|
SelectedItem="{Binding SelCurrSawing}"
|
||||||
|
Visibility="{Binding CurrSawing_Visibility}"
|
||||||
Margin="0,0,0,5"/>
|
Margin="0,0,0,5"/>
|
||||||
|
|
||||||
<!--<TextBlock Text="{Binding AuxMachTypeMsg}"
|
<!--<TextBlock Text="{Binding AuxMachTypeMsg}"
|
||||||
@@ -56,10 +58,24 @@
|
|||||||
<TextBlock Text="{Binding CurrWaterjettingMsg}"
|
<TextBlock Text="{Binding CurrWaterjettingMsg}"
|
||||||
Visibility="{Binding CurrWaterjetting_Visibility}"
|
Visibility="{Binding CurrWaterjetting_Visibility}"
|
||||||
Margin="0,0,0,5"/>
|
Margin="0,0,0,5"/>
|
||||||
<ComboBox ItemsSource="{Binding CurrWaterjettingList}"
|
<Grid>
|
||||||
SelectedItem="{Binding SelCurrWaterjetting}"
|
<Grid.ColumnDefinitions>
|
||||||
Visibility="{Binding CurrWaterjetting_Visibility}"
|
<ColumnDefinition Width="2*"/>
|
||||||
Margin="0,0,0,5"/>
|
<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 CurrWaterjetting_Visibility}"
|
||||||
|
Margin="5,0,0,5"
|
||||||
|
Grid.Column="1">
|
||||||
|
</ComboBox>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<UniformGrid Columns="2"
|
<UniformGrid Columns="2"
|
||||||
Margin="0,0,0,5">
|
Margin="0,0,0,5">
|
||||||
|
|||||||
@@ -32,6 +32,16 @@ Public Class CurrMachWindowVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
#End Region ' Saw
|
||||||
|
|
||||||
#Region " AUX MACHINING "
|
#Region " AUX MACHINING "
|
||||||
@@ -257,14 +267,48 @@ Public Class CurrMachWindowVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private m_CurrWaterjetting_Visibility As Visibility
|
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 = Visibility.Collapsed
|
||||||
Public Property CurrWaterjetting_Visibility As Visibility
|
Public Property CurrWaterjetting_Visibility As Visibility
|
||||||
Get
|
Get
|
||||||
Return m_CurrWaterjetting_Visibility
|
Return m_CurrWaterjetting_Visibility
|
||||||
End Get
|
End Get
|
||||||
Set(value As Visibility)
|
Set(value As Visibility)
|
||||||
m_CurrWaterjetting_Visibility = value
|
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 Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -313,6 +357,13 @@ Public Class CurrMachWindowVM
|
|||||||
Return EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 10)
|
Return EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 10)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property CurrWaterjettingQualityMsg As String
|
||||||
|
Get
|
||||||
|
Return "Quality"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property OkMsg As String
|
Public ReadOnly Property OkMsg As String
|
||||||
Get
|
Get
|
||||||
Return "Ok"
|
Return "Ok"
|
||||||
@@ -381,6 +432,7 @@ Public Class CurrMachWindowVM
|
|||||||
If m_CurrWaterjettingList.Count = 0 Then
|
If m_CurrWaterjettingList.Count = 0 Then
|
||||||
CurrentMachine.sCurrWaterJetting = String.Empty
|
CurrentMachine.sCurrWaterJetting = String.Empty
|
||||||
End If
|
End If
|
||||||
|
m_CurrWaterjettingQualityList = New List(Of String)(CurrentMachine.Qualities)
|
||||||
|
|
||||||
ElseIf CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or
|
ElseIf CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or
|
||||||
CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
|
CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
|
||||||
@@ -411,6 +463,7 @@ Public Class CurrMachWindowVM
|
|||||||
If m_CurrWaterjettingList.Count = 0 Then
|
If m_CurrWaterjettingList.Count = 0 Then
|
||||||
CurrentMachine.sCurrWaterJetting = String.Empty
|
CurrentMachine.sCurrWaterJetting = String.Empty
|
||||||
End If
|
End If
|
||||||
|
m_CurrWaterjettingQualityList = New List(Of String)(CurrentMachine.Qualities)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Nascondo la selezione dell'utensile ausiliario -- DA ELIMINARE? --
|
' Nascondo la selezione dell'utensile ausiliario -- DA ELIMINARE? --
|
||||||
@@ -459,11 +512,20 @@ Public Class CurrMachWindowVM
|
|||||||
|
|
||||||
If CurrentMachine.bWaterJetting And CurrWaterjettingList.Count > 1 Then
|
If CurrentMachine.bWaterJetting And CurrWaterjettingList.Count > 1 Then
|
||||||
CurrWaterjetting_Visibility = Visibility.Visible
|
CurrWaterjetting_Visibility = Visibility.Visible
|
||||||
If CurrentMachine.sCurrWaterJetting <> String.Empty Then
|
' se DB WaterJet abilitato avrò anche la CmBx della Quality solo la CmBx del Waterjetting corrente
|
||||||
SelCurrWaterjetting = CurrentMachine.sCurrWaterJetting
|
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
|
End If
|
||||||
Else
|
Else
|
||||||
CurrWaterjetting_Visibility = Visibility.Collapsed
|
CurrWaterjettingQuality_Visibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Con le nuove modifiche questa selezione dovrebbe scompaire definitivamente -- DA ELIMINARE? --
|
' Con le nuove modifiche questa selezione dovrebbe scompaire definitivamente -- DA ELIMINARE? --
|
||||||
@@ -595,26 +657,57 @@ Public Class CurrMachWindowVM
|
|||||||
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
|
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
|
||||||
If SysNotes <> String.Empty Then
|
If SysNotes <> String.Empty Then
|
||||||
Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
|
Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
|
||||||
For Each Material In MachiningMaterials
|
|
||||||
Dim Param() As String = Material.Split(",".ToCharArray)
|
If CurrentMachine.bWaterJet And CurrentMachine.bFromDBWaterJet Then
|
||||||
If Param.Count() < 2 Then Continue For
|
For Each Material As String In MachiningMaterials
|
||||||
Dim CurrMatId As String = String.Empty
|
Dim Param() As String = Material.Split(",".ToCharArray)
|
||||||
For Each Mat In CurrentMachine.Materials
|
If Param.Count() < 2 Then Continue For
|
||||||
If Mat.sName = EstCalc.GetMaterialName Then
|
Dim CurrMatId As String = String.Empty
|
||||||
CurrMatId = Mat.nId.ToString()
|
Dim CurrMatSubId As String = String.Empty
|
||||||
Exit For
|
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
|
End If
|
||||||
Next
|
Next
|
||||||
If Param(0) = CurrMatId Then
|
Else
|
||||||
Dim MatMinH As Double = 0
|
|
||||||
StringToDouble(Param(1), MatMinH)
|
For Each Material In MachiningMaterials
|
||||||
Dim MatMaxH As Double = 0
|
Dim Param() As String = Material.Split(",".ToCharArray)
|
||||||
StringToDouble(Param(2), MatMaxH)
|
If Param.Count() < 2 Then Continue For
|
||||||
If EstCalc.GetRawHeight > MatMinH - EPS_SMALL And EstCalc.GetRawHeight < MatMaxH + EPS_SMALL Then
|
Dim CurrMatId As String = String.Empty
|
||||||
Return True
|
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
|
||||||
End If
|
Next
|
||||||
Next
|
|
||||||
|
End If
|
||||||
|
|
||||||
Return False
|
Return False
|
||||||
Else
|
Else
|
||||||
Return True
|
Return True
|
||||||
@@ -624,6 +717,53 @@ Public Class CurrMachWindowVM
|
|||||||
End If
|
End If
|
||||||
End Function
|
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 Region ' METHODS
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -710,6 +710,8 @@ Public Class DxfImportWindowVM
|
|||||||
EgtErase(EgtGetFirstNameInGroup(PartId, SELECT_REGION_LAYER))
|
EgtErase(EgtGetFirstNameInGroup(PartId, SELECT_REGION_LAYER))
|
||||||
PartId = EgtGetNextPart(PartId)
|
PartId = EgtGetNextPart(PartId)
|
||||||
End While
|
End While
|
||||||
|
' identificativo univoico del gruppo di pezzi, se più di un pezzo
|
||||||
|
Dim sGUICode As New List(Of String)
|
||||||
' Scrivo testi per nesting
|
' Scrivo testi per nesting
|
||||||
SideEntityControlVM.WriteSideAngleForNest(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
SideEntityControlVM.WriteSideAngleForNest(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
||||||
' Imposto riferimento sul centro geometrico di ogni pezzo
|
' Imposto riferimento sul centro geometrico di ogni pezzo
|
||||||
@@ -732,10 +734,33 @@ Public Class DxfImportWindowVM
|
|||||||
Dim bDirect As Boolean = (GetMainPrivateProfileInt(S_NEST, K_DIRECT, 0) <> 0)
|
Dim bDirect As Boolean = (GetMainPrivateProfileInt(S_NEST, K_DIRECT, 0) <> 0)
|
||||||
' Elimino eventuali precedenti pezzi vuoti
|
' Elimino eventuali precedenti pezzi vuoti
|
||||||
EgtEraseEmptyParts()
|
EgtEraseEmptyParts()
|
||||||
|
' creo il riferimento
|
||||||
|
If m_PartNum > 1 Then
|
||||||
|
' per ogni pezze del file DXF creo un gruppo
|
||||||
|
Dim nIdTemp As Integer = EgtGetFirstPart()
|
||||||
|
While nIdTemp <> GDB_ID.NULL
|
||||||
|
Dim sPreGuid As String = CreatePreGuidCode(nIdTemp)
|
||||||
|
sGUICode.Add(sPreGuid & System.Guid.NewGuid.ToString)
|
||||||
|
nIdTemp = EgtGetNextPart(nIdTemp)
|
||||||
|
End While
|
||||||
|
End If
|
||||||
' Inserisco i pezzi nell'ambiente principale e recupero Id primo pezzo inserito
|
' Inserisco i pezzi nell'ambiente principale e recupero Id primo pezzo inserito
|
||||||
Dim nFirstId As Integer = EgtGetLastPart()
|
Dim nFirstId As Integer = EgtGetLastPart()
|
||||||
For nInd As Integer = 1 To m_PartNum
|
For nInd As Integer = 1 To m_PartNum
|
||||||
|
Dim nFirst2Id As Integer = EgtGetLastPart()
|
||||||
EgtInsertFile(sTmpFile)
|
EgtInsertFile(sTmpFile)
|
||||||
|
Dim FirstOfImport As Integer = EgtGetNextPart(nFirst2Id)
|
||||||
|
Dim Index As Integer = 1
|
||||||
|
While FirstOfImport <> GDB_ID.NULL And Index <= sGUICode.Count
|
||||||
|
If Not String.IsNullOrEmpty(sGUICode(Index - 1)) Then
|
||||||
|
EgtSetInfo(FirstOfImport, INFO_REFGROUP, sGUICode(Index - 1))
|
||||||
|
Index += 1
|
||||||
|
Else
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
FirstOfImport = EgtGetNextPart(FirstOfImport)
|
||||||
|
End While
|
||||||
|
nFirst2Id = If(nFirst2Id <> GDB_ID.NULL, EgtGetNextPart(nFirst2Id), EgtGetFirstPart())
|
||||||
Next
|
Next
|
||||||
nFirstId = If(nFirstId <> GDB_ID.NULL, EgtGetNextPart(nFirstId), EgtGetFirstPart())
|
nFirstId = If(nFirstId <> GDB_ID.NULL, EgtGetNextPart(nFirstId), EgtGetFirstPart())
|
||||||
' Cancello il file
|
' Cancello il file
|
||||||
@@ -909,6 +934,36 @@ Public Class DxfImportWindowVM
|
|||||||
NotifyPropertyChanged("MsgColor")
|
NotifyPropertyChanged("MsgColor")
|
||||||
End Sub
|
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
|
#End Region ' METHODS
|
||||||
|
|
||||||
#Region "COMMANDS"
|
#Region "COMMANDS"
|
||||||
@@ -973,6 +1028,7 @@ Public Class DxfImportWindowVM
|
|||||||
If GetPrivateProfileInt(S_COLORTOENGRAVE, K_CTE_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then
|
If GetPrivateProfileInt(S_COLORTOENGRAVE, K_CTE_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then
|
||||||
SideEntityControlVM.ColorToEngrave(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
SideEntityControlVM.ColorToEngrave(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
||||||
End If
|
End If
|
||||||
|
ColorRegion(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
||||||
' Eseguo zoom
|
' Eseguo zoom
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
' disabilito bottoni UseLayer e UseRegion, abilito bottoni Reset e Insert
|
' disabilito bottoni UseLayer e UseRegion, abilito bottoni Reset e Insert
|
||||||
@@ -1013,6 +1069,7 @@ Public Class DxfImportWindowVM
|
|||||||
If GetPrivateProfileInt(S_COLORTOENGRAVE, K_CTE_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then
|
If GetPrivateProfileInt(S_COLORTOENGRAVE, K_CTE_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then
|
||||||
SideEntityControlVM.ColorToEngrave(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
SideEntityControlVM.ColorToEngrave(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
||||||
End If
|
End If
|
||||||
|
ColorRegion(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
||||||
' Eseguo zoom
|
' Eseguo zoom
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
' disabilito bottoni UseLayer. UseRegion e UseClosedCurve, abilito bottoni Reset e Insert
|
' disabilito bottoni UseLayer. UseRegion e UseClosedCurve, abilito bottoni Reset e Insert
|
||||||
@@ -1053,6 +1110,7 @@ Public Class DxfImportWindowVM
|
|||||||
If GetPrivateProfileInt(S_COLORTOENGRAVE, K_CTE_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then
|
If GetPrivateProfileInt(S_COLORTOENGRAVE, K_CTE_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then
|
||||||
SideEntityControlVM.ColorToEngrave(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
SideEntityControlVM.ColorToEngrave(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
||||||
End If
|
End If
|
||||||
|
ColorRegion(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
||||||
' Eseguo zoom
|
' Eseguo zoom
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
' disabilito bottoni UseLayer e UseRegion, abilito bottoni Reset e Insert
|
' disabilito bottoni UseLayer e UseRegion, abilito bottoni Reset e Insert
|
||||||
|
|||||||
@@ -95,6 +95,82 @@ Friend Module CamAuto
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function ResetAllSplitCurv() As Boolean
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
Dim nIdPart As Integer = EgtGetFirstPart()
|
||||||
|
While nIdPart <> GDB_ID.NULL
|
||||||
|
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
|
||||||
|
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, "AUX_SPLIT_WJ")
|
||||||
|
EgtErase(IdAuxLayer)
|
||||||
|
' accedo al Layer OutLoop
|
||||||
|
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||||
|
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||||
|
While nIdMy <> GDB_ID.NULL
|
||||||
|
EgtRemoveInfo(nIdMy, "JoinEntity")
|
||||||
|
nIdMy = EgtGetNext(nIdMy)
|
||||||
|
End While
|
||||||
|
nIdPart = EgtGetNextPart(nIdPart)
|
||||||
|
End While
|
||||||
|
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
|
||||||
|
nIdPart = EgtGetFirstPartInRawPart(nRawId)
|
||||||
|
While nIdPart <> GDB_ID.NULL
|
||||||
|
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
|
||||||
|
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, "AUX_SPLIT_WJ")
|
||||||
|
EgtErase(IdAuxLayer)
|
||||||
|
' accedo al Layer OutLoop
|
||||||
|
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||||
|
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||||
|
While nIdMy <> GDB_ID.NULL
|
||||||
|
EgtRemoveInfo(nIdMy, "JoinEntity")
|
||||||
|
nIdMy = EgtGetNext(nIdMy)
|
||||||
|
End While
|
||||||
|
nIdPart = EgtGetNextPartInRawPart(nIdPart)
|
||||||
|
End While
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Function ResetAllStartCurv() As Boolean
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
Dim nIdPart As Integer = EgtGetFirstPart()
|
||||||
|
While nIdPart <> GDB_ID.NULL
|
||||||
|
' accedo al Layer OutLoop
|
||||||
|
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||||
|
EgtRemoveInfo(nIdLayerOutLoop, "Start")
|
||||||
|
nIdPart = EgtGetNextPart(nIdPart)
|
||||||
|
End While
|
||||||
|
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
|
||||||
|
nIdPart = EgtGetFirstPartInRawPart(nRawId)
|
||||||
|
While nIdPart <> GDB_ID.NULL
|
||||||
|
' accedo al Layer OutLoop
|
||||||
|
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||||
|
EgtRemoveInfo(nIdLayerOutLoop, "Start")
|
||||||
|
nIdPart = EgtGetNextPartInRawPart(nIdPart)
|
||||||
|
End While
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Function ResetAllBridges() As Boolean
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
Dim nMachGroup As Integer = EgtGetCurrMachGroup()
|
||||||
|
Dim nBridgesGroup As Integer = EgtGetFirstNameInGroup(nMachGroup, "Bridges")
|
||||||
|
bOk = EgtErase(nBridgesGroup)
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' verifico che il contorno passato non sia stato separato
|
||||||
|
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer) As Boolean
|
||||||
|
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||||
|
While nIdMy <> GDB_ID.NULL
|
||||||
|
Dim nValInfo As Integer = 1
|
||||||
|
If EgtGetInfo(nIdMy, "JoinEntity", nValInfo) Then
|
||||||
|
If nValInfo = 0 Then Return False
|
||||||
|
End If
|
||||||
|
EgtRemoveInfo(nIdMy, "JoinEntity")
|
||||||
|
nIdMy = EgtGetNext(nIdMy)
|
||||||
|
End While
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
Friend Function RemoveFinalEmptyPhases() As Boolean
|
Friend Function RemoveFinalEmptyPhases() As Boolean
|
||||||
Dim nOpeId As Integer = EgtGetLastOperation()
|
Dim nOpeId As Integer = EgtGetLastOperation()
|
||||||
While nOpeId <> GDB_ID.NULL
|
While nOpeId <> GDB_ID.NULL
|
||||||
@@ -668,6 +744,9 @@ Friend Module CamAuto
|
|||||||
End If
|
End If
|
||||||
' Lo sposto dalla lavorazione al pezzo
|
' Lo sposto dalla lavorazione al pezzo
|
||||||
Dim nId As Integer = EgtGetFirstInGroup(nMchPvId)
|
Dim nId As Integer = EgtGetFirstInGroup(nMchPvId)
|
||||||
|
|
||||||
|
If nId = GDB_ID.NULL Then Return False
|
||||||
|
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
EgtRelocateGlob(nId, nPartPvId)
|
EgtRelocateGlob(nId, nPartPvId)
|
||||||
nId = EgtGetFirstInGroup(nMchPvId)
|
nId = EgtGetFirstInGroup(nMchPvId)
|
||||||
@@ -714,10 +793,12 @@ Friend Module CamAuto
|
|||||||
|
|
||||||
|
|
||||||
Private Function SetLuaStandardCamParams(Optional bDripOk As Boolean = True) As Boolean
|
Private Function SetLuaStandardCamParams(Optional bDripOk As Boolean = True) As Boolean
|
||||||
|
Dim sMaterial As String = CurrentMachine.CurrMat.sName
|
||||||
Dim sSawMch As String = CurrentMachine.sCurrSawing
|
Dim sSawMch As String = CurrentMachine.sCurrSawing
|
||||||
Dim sMillMch As String = CurrentMachine.sCurrMilling
|
Dim sMillMch As String = CurrentMachine.sCurrMilling
|
||||||
Dim sDrillMch As String = CurrentMachine.sCurrDrilling
|
Dim sDrillMch As String = CurrentMachine.sCurrDrilling
|
||||||
Dim sWaterJetMch As String = CurrentMachine.sCurrWaterJetting
|
Dim sWaterJetMch As String = CurrentMachine.sCurrWaterJetting
|
||||||
|
Dim sWaterJetQual As String = CurrentMachine.sCurrWaterJettingQuality
|
||||||
Dim sDripSawMch As String = If(bDripOk, CurrentMachine.sCurrDripSawing, "")
|
Dim sDripSawMch As String = If(bDripOk, CurrentMachine.sCurrDripSawing, "")
|
||||||
Dim sDripDrillMch As String = If(bDripOk, CurrentMachine.sCurrDripDrilling, "")
|
Dim sDripDrillMch As String = If(bDripOk, CurrentMachine.sCurrDripDrilling, "")
|
||||||
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, CurrentMachine.sMachIniFile)
|
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, CurrentMachine.sMachIniFile)
|
||||||
@@ -729,10 +810,12 @@ Friend Module CamAuto
|
|||||||
Dim bMillingOnCorners As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, 1, CurrentMachine.sMachIniFile) <> 0)
|
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 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)
|
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.SAWMCH", sSawMch)
|
||||||
EgtLuaSetGlobStringVar("CAM.MILLMCH", sMillMch)
|
EgtLuaSetGlobStringVar("CAM.MILLMCH", sMillMch)
|
||||||
EgtLuaSetGlobStringVar("CAM.DRILLMCH", sDrillMch)
|
EgtLuaSetGlobStringVar("CAM.DRILLMCH", sDrillMch)
|
||||||
EgtLuaSetGlobStringVar("CAM.WATERJETMCH", sWaterJetMch)
|
EgtLuaSetGlobStringVar("CAM.WATERJETMCH", sWaterJetMch)
|
||||||
|
EgtLuaSetGlobStringVar("CAM.WATERJETQLTY", sWaterJetQual)
|
||||||
EgtLuaSetGlobStringVar("CAM.DRIPSAWMCH", sDripSawMch)
|
EgtLuaSetGlobStringVar("CAM.DRIPSAWMCH", sDripSawMch)
|
||||||
EgtLuaSetGlobStringVar("CAM.DRIPDRILLMCH", sDripDrillMch)
|
EgtLuaSetGlobStringVar("CAM.DRIPDRILLMCH", sDripDrillMch)
|
||||||
EgtLuaSetGlobNumVar("CAM.REDUCEDDEPTH", dReducedDepth)
|
EgtLuaSetGlobNumVar("CAM.REDUCEDDEPTH", dReducedDepth)
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ Module ConstMach
|
|||||||
Public Const KEY_VACLAY_SEL As String = "Sel"
|
Public Const KEY_VACLAY_SEL As String = "Sel"
|
||||||
' Info in gruppo layout per angolo di rotazione preferito
|
' Info in gruppo layout per angolo di rotazione preferito
|
||||||
Public Const KEY_VACLAY_PREFROT As String = "PreferredRot"
|
Public Const KEY_VACLAY_PREFROT As String = "PreferredRot"
|
||||||
|
Public Const KEY_VACLAY_PREFVROTXMINUS As String = "PrefVertRotXMinus"
|
||||||
|
Public Const KEY_VACLAY_PREFVROTXPLUS As String = "PrefVertRotXPlus"
|
||||||
|
Public Const KEY_VACLAY_PREFVROTYMINUS As String = "PrefVertRotYMinus"
|
||||||
|
Public Const KEY_VACLAY_PREFVROTYPLUS As String = "PrefVertRotYPlus"
|
||||||
' Info in gruppo layout per direzione di riferimento ventose per tagli da sotto
|
' Info in gruppo layout per direzione di riferimento ventose per tagli da sotto
|
||||||
Public Const KEY_VACLAY_DRIPREFDIR As String = "DripRefDir"
|
Public Const KEY_VACLAY_DRIPREFDIR As String = "DripRefDir"
|
||||||
' Info in asse rotante ventosa per step discreti
|
' Info in asse rotante ventosa per step discreti
|
||||||
@@ -91,6 +95,9 @@ Module ConstMach
|
|||||||
Public Const INFO_RAW_BLOCK = "Block"
|
Public Const INFO_RAW_BLOCK = "Block"
|
||||||
' Info per numero lastra nel blocco
|
' Info per numero lastra nel blocco
|
||||||
Public Const INFO_RAW_SLABNBR = "SlabNbr"
|
Public Const INFO_RAW_SLABNBR = "SlabNbr"
|
||||||
|
' Info per identificazione gruppo pezzi
|
||||||
|
Public Const INFO_REFGROUP As String = "RefGroup"
|
||||||
|
Public Const INFO_COUNTERLY As String = "CounterPz"
|
||||||
|
|
||||||
' Contrassegno di progetto OmagCut
|
' Contrassegno di progetto OmagCut
|
||||||
Public Const NAME_PROJMARK As String = "OmagCut"
|
Public Const NAME_PROJMARK As String = "OmagCut"
|
||||||
@@ -151,8 +158,11 @@ Module ConstMach
|
|||||||
Public Const NAME_UNDERDRILL As String = "UnderDrill"
|
Public Const NAME_UNDERDRILL As String = "UnderDrill"
|
||||||
' Nome layer preview
|
' Nome layer preview
|
||||||
Public Const NAME_PREVIEW As String = "PV"
|
Public Const NAME_PREVIEW As String = "PV"
|
||||||
|
Public Const NAME_BRIDGES As String = "Bridges"
|
||||||
|
Public Const NAME_BRIDGESLINE As String = "BridgeLine"
|
||||||
' Info in layer contorno interno per FiloTop
|
' Info in layer contorno interno per FiloTop
|
||||||
Public Const INFO_FILOTOP As String = "FiloTop"
|
Public Const INFO_FILOTOP As String = "FiloTop"
|
||||||
|
Public Const INFO_ROUNDOFF As String = "RoundOff"
|
||||||
' Info in entità da tagliare per affondamento
|
' Info in entità da tagliare per affondamento
|
||||||
Public Const INFO_DEPTH As String = "Depth"
|
Public Const INFO_DEPTH As String = "Depth"
|
||||||
Public Const INFO_DEPTH2 As String = "Depth2"
|
Public Const INFO_DEPTH2 As String = "Depth2"
|
||||||
@@ -244,6 +254,12 @@ Module ConstMach
|
|||||||
Public Const SELECT_REGION_LAYER As String = "SelectRegion"
|
Public Const SELECT_REGION_LAYER As String = "SelectRegion"
|
||||||
' Info in pezzo per stato rotazione
|
' Info in pezzo per stato rotazione
|
||||||
Public Const INFO_PARTROT As String = "ROT"
|
Public Const INFO_PARTROT As String = "ROT"
|
||||||
|
' Info in entità in OutLoop per indicare se è separata WaterJet
|
||||||
|
Public Const INFO_JOINTENTITY As String = "JoinEntity"
|
||||||
|
' Nome layer per "*" inidcanti un lato separato nel taglio WaterJet
|
||||||
|
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
|
||||||
|
' Info in OutLoop per punto inzio lavorazione WaterJet
|
||||||
|
Public Const INFO_START As String = "Start"
|
||||||
|
|
||||||
' Nome di pezzo che è una cornice
|
' Nome di pezzo che è una cornice
|
||||||
Public Const NAME_FRAME As String = "Frame"
|
Public Const NAME_FRAME As String = "Frame"
|
||||||
@@ -280,6 +296,8 @@ Module ConstMach
|
|||||||
' Nome di pezzo temporaneo che serve per copia dime
|
' Nome di pezzo temporaneo che serve per copia dime
|
||||||
Public Const NAME_COPYTEMPLATE As String = "CopyTemplate"
|
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
|
' Chiave per Id originale del pezzo per VeinMatch
|
||||||
Public Const KEY_ORI_ID As String = "OriId"
|
Public Const KEY_ORI_ID As String = "OriId"
|
||||||
|
|
||||||
@@ -308,6 +326,9 @@ Module ConstMach
|
|||||||
Public Function COL_MCH_DRIPCUT() As Color3d
|
Public Function COL_MCH_DRIPCUT() As Color3d
|
||||||
Return New Color3d(255, 0, 165)
|
Return New Color3d(255, 0, 165)
|
||||||
End Function
|
End Function
|
||||||
|
Public Function COL_MCH_ONENGRAVE_ANG() As Color3d
|
||||||
|
Return New Color3d(255, 255, 100)
|
||||||
|
End Function
|
||||||
Public Function COL_MCH_DRIPFREE() As Color3d
|
Public Function COL_MCH_DRIPFREE() As Color3d
|
||||||
Return New Color3d(192, 0, 128)
|
Return New Color3d(192, 0, 128)
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -198,6 +198,10 @@
|
|||||||
Public Const S_MACH_RAWMOVE As String = "RawMove"
|
Public Const S_MACH_RAWMOVE As String = "RawMove"
|
||||||
Public Const K_MACH_RM_ROTATE As String = "Rotate"
|
Public Const K_MACH_RM_ROTATE As String = "Rotate"
|
||||||
Public Const K_MACH_RM_FINALMOVE As String = "FinalMove"
|
Public Const K_MACH_RM_FINALMOVE As String = "FinalMove"
|
||||||
|
Public Const K_MACH_WEIGHT_SINGLEPLUGGER As String = "MaxWeightSinglePlugger"
|
||||||
|
Public Const K_MACH_WEIGHT_DOUBLEPLUGGER As String = "MaxWeightDoublePlugger"
|
||||||
|
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEY As String = "RotateVacuumForExtraStrokeY"
|
||||||
|
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEX As String = "RotateVacuumForExtraStrokeX"
|
||||||
|
|
||||||
Public Const S_MACH_REG As String = "Reg"
|
Public Const S_MACH_REG As String = "Reg"
|
||||||
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
|
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
|
||||||
@@ -253,11 +257,14 @@
|
|||||||
Public Const K_CURRDRIPSAWING As String = "CurrDripSawing"
|
Public Const K_CURRDRIPSAWING As String = "CurrDripSawing"
|
||||||
Public Const K_CURRDRIPDRILLING As String = "CurrDripDrilling"
|
Public Const K_CURRDRIPDRILLING As String = "CurrDripDrilling"
|
||||||
Public Const K_CURRWATERJETTING As String = "CurrWaterJetting"
|
Public Const K_CURRWATERJETTING As String = "CurrWaterJetting"
|
||||||
|
Public Const K_CURRWATERJETTINGQUALITY As String = "CurrWaterJettingQuality"
|
||||||
|
|
||||||
Public Const S_MATERIALS As String = "Materials"
|
Public Const S_MATERIALS As String = "Materials"
|
||||||
Public Const K_CURRMATERIAL As String = "CurrMaterial"
|
Public Const K_CURRMATERIAL As String = "CurrMaterial"
|
||||||
Public Const K_CURROFFICEMATERIAL As String = "CurrOfficeMaterial"
|
Public Const K_CURROFFICEMATERIAL As String = "CurrOfficeMaterial"
|
||||||
Public Const K_MATERIAL As String = "Material"
|
Public Const K_MATERIAL As String = "Material"
|
||||||
|
Public Const K_FROMDBWATERJET As String = "FromDBWaterJet"
|
||||||
|
Public Const K_AVERAGEDENSITY As String = "AverageDensity"
|
||||||
|
|
||||||
Public Const S_SETUP As String = "SetUp"
|
Public Const S_SETUP As String = "SetUp"
|
||||||
Public Const K_DEFAULT As String = "Default"
|
Public Const K_DEFAULT As String = "Default"
|
||||||
|
|||||||
+321
-74
@@ -12,12 +12,19 @@ Module CsvM
|
|||||||
Return m_sCsvPath
|
Return m_sCsvPath
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Private m_sFilePath As String = String.Empty
|
||||||
|
Public ReadOnly Property FilePath As String
|
||||||
|
Get
|
||||||
|
Return m_sFilePath
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
Private m_CsvPartList As New List(Of CsvPart)
|
Private m_CsvPartList As New List(Of CsvPart)
|
||||||
Public ReadOnly Property CsvPartList As List(Of CsvPart)
|
Public ReadOnly Property CsvPartList As List(Of CsvPart)
|
||||||
Get
|
Get
|
||||||
Return m_CsvPartList
|
Return m_CsvPartList
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private m_bCsvPartListModified As Boolean = False
|
Private m_bCsvPartListModified As Boolean = False
|
||||||
Private m_sCompoDir As String = String.Empty
|
Private m_sCompoDir As String = String.Empty
|
||||||
|
|
||||||
@@ -36,12 +43,7 @@ Module CsvM
|
|||||||
|
|
||||||
Public Sub NewCmd()
|
Public Sub NewCmd()
|
||||||
' Salvo lista dei pezzi attuale (se modificata)
|
' Salvo lista dei pezzi attuale (se modificata)
|
||||||
If Not SaveCsvPartList() Then
|
SaveCsvPartList()
|
||||||
' Errore nel salvataggio del file CSV, vuoi continuare lo stesso ? - Errore
|
|
||||||
If MessageBox.Show(EgtMsg(MSG_CSVPAGEUC + 5), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) <> MessageBoxResult.Yes Then
|
|
||||||
Return
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
' Pulisco path e lista dei pezzi Csv
|
' Pulisco path e lista dei pezzi Csv
|
||||||
m_sCsvPath = String.Empty
|
m_sCsvPath = String.Empty
|
||||||
m_CsvPartList.Clear()
|
m_CsvPartList.Clear()
|
||||||
@@ -51,25 +53,33 @@ Module CsvM
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub Open()
|
Public Sub Open()
|
||||||
' Salvo lista dei pezzi attuale (se modificata)
|
|
||||||
If Not SaveCsvPartList() Then
|
|
||||||
' Errore nel salvataggio del file CSV, vuoi continuare lo stesso ? - Errore
|
|
||||||
If MessageBox.Show(EgtMsg(MSG_CSVPAGEUC + 5), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) <> MessageBoxResult.Yes Then
|
|
||||||
Return
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
' Leggo direttorio corrente dei file CSV
|
' Leggo direttorio corrente dei file CSV
|
||||||
Dim sCurrDir As String = ""
|
Dim sCurrDir As String = ""
|
||||||
GetMainPrivateProfileString(S_CSV, K_CSVCURRDIR, "C:\", sCurrDir)
|
GetMainPrivateProfileString(S_CSV, K_CSVCURRDIR, "C:\", sCurrDir)
|
||||||
' Apro dialogo scelta file
|
' Apro dialogo scelta file
|
||||||
Dim CsvFileDlg As New Microsoft.Win32.OpenFileDialog()
|
Dim CsvFileDlg As New Microsoft.Win32.OpenFileDialog()
|
||||||
If Directory.Exists(sCurrDir) Then CsvFileDlg.InitialDirectory = sCurrDir
|
If Directory.Exists(sCurrDir) Then CsvFileDlg.InitialDirectory = sCurrDir
|
||||||
CsvFileDlg.Filter = "Csv file (*.csv;*.epl)|*.csv;*.epl"
|
Dim bFull = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.CSV_AUTO) And
|
||||||
|
(GetMainPrivateProfileInt(S_CSV, K_FULL, 1) <> 0)
|
||||||
|
Dim sFilterDialog As String = String.Empty
|
||||||
|
Dim sDeniedFiles As List(Of String) = CreateListOfDeniedFiles()
|
||||||
|
If bFull Then
|
||||||
|
sFilterDialog = "Csv file (*.csv;*.epl)|*.csv;*.epl;Merge.epl"
|
||||||
|
Else
|
||||||
|
sFilterDialog = "Csv file (*.csv)|*.csv"
|
||||||
|
End If
|
||||||
|
CsvFileDlg.Filter = sFilterDialog
|
||||||
|
|
||||||
If Not CsvFileDlg.ShowDialog() Then Return
|
If Not CsvFileDlg.ShowDialog() Then Return
|
||||||
|
|
||||||
|
' Salvo lista dei pezzi attuale
|
||||||
|
SaveCsvPartList()
|
||||||
|
|
||||||
' Salvo direttorio corrente
|
' Salvo direttorio corrente
|
||||||
WriteMainPrivateProfileString(S_CSV, K_CSVCURRDIR, Path.GetDirectoryName(CsvFileDlg.FileName))
|
WriteMainPrivateProfileString(S_CSV, K_CSVCURRDIR, Path.GetDirectoryName(CsvFileDlg.FileName))
|
||||||
' Apertura file
|
' Apertura file
|
||||||
Dim sPath = CsvFileDlg.FileName
|
Dim sPath = CsvFileDlg.FileName
|
||||||
|
' se necessario cambio estensione del file
|
||||||
If String.Compare(Path.GetExtension(sPath), ".CSV", True) = 0 Then
|
If String.Compare(Path.GetExtension(sPath), ".CSV", True) = 0 Then
|
||||||
LoadCsvFile(sPath)
|
LoadCsvFile(sPath)
|
||||||
Else
|
Else
|
||||||
@@ -77,6 +87,93 @@ Module CsvM
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function CreateListOfDeniedFiles() As List(Of String)
|
||||||
|
Dim LocalList As New List(Of String)
|
||||||
|
LocalList.Add("MERGE")
|
||||||
|
Dim Index1 As Integer = 0
|
||||||
|
Dim Index2 As Integer = 0
|
||||||
|
For Index1 = 0 To m_CsvPartList.Count - 1
|
||||||
|
Dim sFileName As String = m_CsvPartList(Index1).m_sPath
|
||||||
|
sFileName = Path.GetFileNameWithoutExtension(sFileName).ToUpper.Trim()
|
||||||
|
Dim bNewFile As Boolean = True
|
||||||
|
For Index2 = 0 To LocalList.Count - 1
|
||||||
|
If sFileName = LocalList(Index2) Then
|
||||||
|
bNewFile = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If bNewFile Then
|
||||||
|
LocalList.Add(Path.GetFileNameWithoutExtension(sFileName).ToUpper.Trim)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return LocalList
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function LoadCsvFile(sCsvPath As String) As Boolean
|
||||||
|
Dim bFull = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.CSV_AUTO) And
|
||||||
|
(GetMainPrivateProfileInt(S_CSV, K_FULL, 1) <> 0)
|
||||||
|
' aggiungo i pezzi su una lista temporanea
|
||||||
|
Dim LocalPartList As New List(Of CsvPart)
|
||||||
|
' Eseguo la lettura del file Csv
|
||||||
|
If Not ReadCsvFile(sCsvPath, LocalPartList) Then
|
||||||
|
'Errore nella lettura del file CSV
|
||||||
|
MessageBox.Show(EgtMsg(91206), "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Creo un nuovo file che ospitarà il merge de
|
||||||
|
Dim sNewMergeFile As String = Path.GetDirectoryName(m_sCsvPath) & "\Merge.csv"
|
||||||
|
m_sCsvPath = sNewMergeFile
|
||||||
|
m_sFilePath = m_sCsvPath
|
||||||
|
|
||||||
|
' Elimino pezzi nulli
|
||||||
|
RemoveWrongParts(LocalPartList)
|
||||||
|
' Aggiorno
|
||||||
|
If bFull Then
|
||||||
|
MySaveCsvPartList(LocalPartList)
|
||||||
|
' Salvo come epl
|
||||||
|
SaveCsvPartList()
|
||||||
|
' Rinomino file originale
|
||||||
|
Dim sBakPath As String = sCsvPath & ".bak"
|
||||||
|
Dim sBakName As String = Path.GetFileName(sBakPath)
|
||||||
|
' cancello eventuale vecchio backup
|
||||||
|
If My.Computer.FileSystem.FileExists(sBakPath) Then
|
||||||
|
My.Computer.FileSystem.DeleteFile(sBakPath)
|
||||||
|
End If
|
||||||
|
' eseguo rinomina
|
||||||
|
My.Computer.FileSystem.RenameFile(sCsvPath, sBakName)
|
||||||
|
End If
|
||||||
|
' attacco i nuovi pezzi alla lista corrente
|
||||||
|
For Each Item As CsvPart In LocalPartList
|
||||||
|
m_CsvPartList.Add(Item)
|
||||||
|
Next
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Sub LoadCsvPartList(sFile As String)
|
||||||
|
Dim bFull = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.CSV_AUTO) And
|
||||||
|
(GetMainPrivateProfileInt(S_CSV, K_FULL, 1) <> 0)
|
||||||
|
' Se Csv semplificato non va letta
|
||||||
|
If Not bFull Then Return
|
||||||
|
|
||||||
|
' aggiungo i pezzi su una lista temporanea
|
||||||
|
Dim LocalPartList As New List(Of CsvPart)
|
||||||
|
|
||||||
|
' Lettura del file
|
||||||
|
If ReadCsvPartList(sFile, LocalPartList) Then
|
||||||
|
' Creo un nuovo file che ospitarà il merge de
|
||||||
|
Dim sNewMergeFile As String = Path.GetDirectoryName(m_sCsvPath) & "\Merge.csv"
|
||||||
|
m_sCsvPath = sNewMergeFile
|
||||||
|
m_sFilePath = m_sCsvPath
|
||||||
|
End If
|
||||||
|
' Elimino pezzi nulli
|
||||||
|
RemoveWrongParts(LocalPartList)
|
||||||
|
' attacco i nuovi pezzi alla lista corrente
|
||||||
|
For Each Item As CsvPart In LocalPartList
|
||||||
|
m_CsvPartList.Add(Item)
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
Public Sub Insert()
|
Public Sub Insert()
|
||||||
' Recupero lo spessore della lastra corrente
|
' Recupero lo spessore della lastra corrente
|
||||||
Dim dRawHeight As Double = EstCalc.GetRawHeight()
|
Dim dRawHeight As Double = EstCalc.GetRawHeight()
|
||||||
@@ -88,7 +185,7 @@ Module CsvM
|
|||||||
End If
|
End If
|
||||||
' Recupero la tolleranza sullo spessore
|
' Recupero la tolleranza sullo spessore
|
||||||
Dim dToler As Double = GetMainPrivateProfileDouble(S_CSV, K_THICKTOLERANCE, 100 * EPS_SMALL)
|
Dim dToler As Double = GetMainPrivateProfileDouble(S_CSV, K_THICKTOLERANCE, 100 * EPS_SMALL)
|
||||||
dToler = Math.Max( dToler, 100 * EPS_SMALL)
|
dToler = Math.Max(dToler, 100 * EPS_SMALL)
|
||||||
' Creo la lista dei pezzi inseribili nella lastra corrente
|
' Creo la lista dei pezzi inseribili nella lastra corrente
|
||||||
Dim InsPartList As New List(Of CsvPart)
|
Dim InsPartList As New List(Of CsvPart)
|
||||||
For i As Integer = 1 To m_CsvPartList.Count()
|
For i As Integer = 1 To m_CsvPartList.Count()
|
||||||
@@ -174,25 +271,46 @@ Module CsvM
|
|||||||
If Not bMaxDimOnX Then
|
If Not bMaxDimOnX Then
|
||||||
Dim dH As Double = Math.Min(0.1 * dDimY, 30)
|
Dim dH As Double = Math.Min(0.1 * dDimY, 30)
|
||||||
Dim nText As Integer = EgtCreateTextAdv(nRegId, New Point3d(dDimX / 2, dDimY - 0.6 * dH, 0), 0, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC)
|
Dim nText As Integer = EgtCreateTextAdv(nRegId, New Point3d(dDimX / 2, dDimY - 0.6 * dH, 0), 0, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC)
|
||||||
EgtSetColor(nText, New Color3d( 0, 0, 0))
|
EgtSetColor(nText, New Color3d(0, 0, 0))
|
||||||
End If
|
End If
|
||||||
' Aggiusto per lavorazioni
|
' Aggiusto per lavorazioni
|
||||||
AdjustFlatPart(nId)
|
AdjustFlatPart(nId)
|
||||||
' Aggiungo info su CSV di origine
|
' Aggiungo info su CSV di origine
|
||||||
EgtSetInfo(nId, INFO_CSV_PATH, m_sCsvPath)
|
EgtSetInfo(nId, INFO_CSV_PATH, CurrPart.m_sPath)
|
||||||
EgtSetInfo(nId, INFO_CSV_PART, CurrPart.m_sName)
|
EgtSetInfo(nId, INFO_CSV_PART, CurrPart.m_sName)
|
||||||
EgtSetInfo(nId, INFO_CSV_ORD, CurrPart.m_sOrd)
|
EgtSetInfo(nId, INFO_CSV_ORD, CurrPart.m_sOrd)
|
||||||
EgtSetInfo(nId, INFO_CSV_DIST, CurrPart.m_sDist)
|
EgtSetInfo(nId, INFO_CSV_DIST, CurrPart.m_sDist)
|
||||||
EgtSetInfo(nId, INFO_CSV_MAT, CurrPart.m_sMaterial)
|
EgtSetInfo(nId, INFO_CSV_MAT, CurrPart.m_sMaterial)
|
||||||
' Imposto colore testi
|
' Imposto colore testi
|
||||||
EstCalc.SetTextColor( nRegId)
|
EstCalc.SetTextColor(nRegId)
|
||||||
' Lo sposto nel gruppo speciale
|
' Lo sposto nel gruppo speciale
|
||||||
EgtRelocate(nId, nIpGrp)
|
EgtRelocate(nId, nIpGrp)
|
||||||
|
|
||||||
|
' assegno l'identificatico del pezzo, se esiste
|
||||||
|
If Not String.IsNullOrEmpty(CurrPart.m_sRefGuid) Then
|
||||||
|
' GuidCode dovrebbe contenere 36 caratteri, il precode 5: tot = 41
|
||||||
|
If CurrPart.m_sRefGuid.Count <= 36 Then
|
||||||
|
Dim sPreGuid As String = CreatePreGuidCode(CurrPart.m_nId)
|
||||||
|
CurrPart.m_sRefGuid = sPreGuid & CurrPart.m_sRefGuid
|
||||||
|
End If
|
||||||
|
EgtSetInfo(CurrPart.m_nId, INFO_REFGROUP, CurrPart.m_sRefGuid)
|
||||||
|
End If
|
||||||
|
Dim nRegLayId As Integer = EgtGetFirstNameInGroup(CurrPart.m_nId, NAME_REGION)
|
||||||
|
' Imposto il colore del pezzo inserito nel progetto
|
||||||
|
EgtSetColor(nRegLayId, CurrPart.m_cColor)
|
||||||
|
Dim EntId As Integer = EgtGetFirstInGroup(nRegLayId)
|
||||||
|
While EntId <> GDB_ID.NULL
|
||||||
|
If EgtGetType(EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, CurrPart.m_cColor)
|
||||||
|
EntId = EgtGetNext(EntId)
|
||||||
|
End While
|
||||||
|
|
||||||
Next
|
Next
|
||||||
EgtLuaResetGlobVar("CMP")
|
EgtLuaResetGlobVar("CMP")
|
||||||
EgtLuaResetGlobVar("CMP_Draw")
|
EgtLuaResetGlobVar("CMP_Draw")
|
||||||
' Provo ad inserire i pezzi
|
' Provo ad inserire i pezzi
|
||||||
Dim bDirect As Boolean = (GetMainPrivateProfileInt(S_CSV, K_CSVDIRECT, 1) <> 0)
|
Dim bFull = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.CSV_AUTO) And
|
||||||
|
(GetMainPrivateProfileInt(S_CSV, K_FULL, 1) <> 0)
|
||||||
|
Dim bDirect As Boolean = bFull And (GetMainPrivateProfileInt(S_CSV, K_CSVDIRECT, 1) <> 0)
|
||||||
For i As Integer = 1 To InsPartList.Count()
|
For i As Integer = 1 To InsPartList.Count()
|
||||||
Dim CurrPart As CsvPart = InsPartList(i - 1)
|
Dim CurrPart As CsvPart = InsPartList(i - 1)
|
||||||
While CurrPart.m_nToNest > 0
|
While CurrPart.m_nToNest > 0
|
||||||
@@ -229,7 +347,7 @@ Module CsvM
|
|||||||
EgtErase(nId2)
|
EgtErase(nId2)
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' altrimenti lo metto in parcheggio
|
' altrimenti lo metto in parcheggio
|
||||||
Else
|
Else
|
||||||
' Aggiungo riferimento e lo inserisco in VeinMatching
|
' Aggiungo riferimento e lo inserisco in VeinMatching
|
||||||
VeinMatching.SetRefOnPart(nId2)
|
VeinMatching.SetRefOnPart(nId2)
|
||||||
@@ -270,11 +388,11 @@ Module CsvM
|
|||||||
Dim sName As String = String.Empty
|
Dim sName As String = String.Empty
|
||||||
EgtGetInfo(nId, INFO_CSV_PART, sName)
|
EgtGetInfo(nId, INFO_CSV_PART, sName)
|
||||||
' Verifico che il pezzo appartenga a questo Csv
|
' Verifico che il pezzo appartenga a questo Csv
|
||||||
If String.Compare(sCsvPath, m_sCsvPath, True) = 0 Then
|
If SearchCurrCSV(sCsvPath) Then
|
||||||
' Cerco il pezzo nella lista dei pezzi
|
' Cerco il pezzo nella lista dei pezzi
|
||||||
For i = 1 To m_CsvPartList.Count()
|
For i = 1 To m_CsvPartList.Count()
|
||||||
Dim CurrPart As CsvPart = m_CsvPartList(i - 1)
|
Dim CurrPart As CsvPart = m_CsvPartList(i - 1)
|
||||||
If String.Compare(sName, CurrPart.m_sName, True) = 0 Then
|
If String.Compare(sName, CurrPart.m_sName, True) = 0 And String.Compare(sCsvPath, CurrPart.m_sPath, True) = 0 Then
|
||||||
' Se era nel grezzo
|
' Se era nel grezzo
|
||||||
If EgtGetParent(nId) = EstCalc.GetRawId() Then
|
If EgtGetParent(nId) = EstCalc.GetRawId() Then
|
||||||
' Rimuovo le lavorazioni
|
' Rimuovo le lavorazioni
|
||||||
@@ -282,12 +400,19 @@ Module CsvM
|
|||||||
' Rimuovo dal grezzo
|
' Rimuovo dal grezzo
|
||||||
EgtRemovePartFromRawPart(nId)
|
EgtRemovePartFromRawPart(nId)
|
||||||
End If
|
End If
|
||||||
|
' recupero il Guid del pezzo corrente (potrebbe essere stato modificato a causa di rotazioni quando il pezzo è passato in parcheggio)
|
||||||
|
Dim sCurrRefGuid As String = String.Empty
|
||||||
|
EgtGetInfo(nId, INFO_REFGROUP, sCurrRefGuid)
|
||||||
' Eventuale cancellazione per VM
|
' Eventuale cancellazione per VM
|
||||||
VeinMatching.OnRemovePart(nId)
|
VeinMatching.OnRemovePart(nId)
|
||||||
' Cancello il pezzo
|
' Cancello il pezzo
|
||||||
EgtErase(nId)
|
EgtErase(nId)
|
||||||
|
' aggiorno il layer che indica il numero di pezzi in parcheggio (se sRefGroup<>"")
|
||||||
|
EstCalc.CountPartInFamily(sCurrRefGuid)
|
||||||
' Aggiorno il contatore
|
' Aggiorno il contatore
|
||||||
CurrPart.m_nToNest += 1
|
CurrPart.m_nToNest += 1
|
||||||
|
' ricreo la lista delle famiglie di pezzi presenti in parcheggio
|
||||||
|
GetFamilyGroupInPark()
|
||||||
' Esco
|
' Esco
|
||||||
Return True
|
Return True
|
||||||
End If
|
End If
|
||||||
@@ -297,10 +422,19 @@ Module CsvM
|
|||||||
Return False
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function LoadCsvFile(sCsvPath As String) As Boolean
|
Private Function SearchCurrCSV(ByVal sCSVFile As String) As Boolean
|
||||||
|
For i As Integer = 1 To m_CsvPartList.Count()
|
||||||
|
Dim CurrPart As CsvPart = m_CsvPartList(i - 1)
|
||||||
|
If String.Compare(sCSVFile, CurrPart.m_sPath, True) = 0 Then
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function ReadCsvFile(sCsvPath As String, ByRef LocalCsvPartList As List(Of CsvPart)) As Boolean
|
||||||
' Pulisco path e lista dei pezzi Csv
|
' Pulisco path e lista dei pezzi Csv
|
||||||
m_sCsvPath = String.Empty
|
m_sCsvPath = String.Empty
|
||||||
m_CsvPartList.Clear()
|
|
||||||
' Definizione variabili
|
' Definizione variabili
|
||||||
EgtLuaCreateGlobTable("CSV")
|
EgtLuaCreateGlobTable("CSV")
|
||||||
EgtLuaSetGlobStringVar("CSV.FILE", sCsvPath)
|
EgtLuaSetGlobStringVar("CSV.FILE", sCsvPath)
|
||||||
@@ -308,7 +442,10 @@ Module CsvM
|
|||||||
Dim nErr As Integer = 999
|
Dim nErr As Integer = 999
|
||||||
Dim sReader As String = String.Empty
|
Dim sReader As String = String.Empty
|
||||||
GetMainPrivateProfileString(S_CSV, K_READER, "CsvRead.lua", sReader)
|
GetMainPrivateProfileString(S_CSV, K_READER, "CsvRead.lua", sReader)
|
||||||
If EgtLuaExecFile(OmagOFFICEMap.refMainWindowVM.MainWindowM.sCsvAutoDir & "\" & sReader) AndAlso
|
Dim bFull = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.CSV_AUTO) And
|
||||||
|
(GetMainPrivateProfileInt(S_CSV, K_FULL, 1) <> 0)
|
||||||
|
Dim sLuaScript As String = OmagOFFICEMap.refMainWindowVM.MainWindowM.sCsvAutoDir & If(bFull, "\" & sReader, "\CsvSimplRead.lua")
|
||||||
|
If EgtLuaExecFile(sLuaScript) AndAlso
|
||||||
EgtLuaCallFunction("CSV.Read") Then
|
EgtLuaCallFunction("CSV.Read") Then
|
||||||
' Verifica stato di errore
|
' Verifica stato di errore
|
||||||
EgtLuaGetGlobIntVar("CSV.ERR", nErr)
|
EgtLuaGetGlobIntVar("CSV.ERR", nErr)
|
||||||
@@ -325,6 +462,7 @@ Module CsvM
|
|||||||
For i As Integer = 1 To nNbr
|
For i As Integer = 1 To nNbr
|
||||||
Dim OnePart As New CsvPart
|
Dim OnePart As New CsvPart
|
||||||
Dim sN As String = i.ToString()
|
Dim sN As String = i.ToString()
|
||||||
|
OnePart.m_sPath = sCsvPath
|
||||||
EgtLuaGetGlobStringVar("CSV.NAME" & sN, OnePart.m_sName)
|
EgtLuaGetGlobStringVar("CSV.NAME" & sN, OnePart.m_sName)
|
||||||
OnePart.m_bActive = True
|
OnePart.m_bActive = True
|
||||||
EgtLuaGetGlobStringVar("CSV.ORD" & sN, OnePart.m_sOrd)
|
EgtLuaGetGlobStringVar("CSV.ORD" & sN, OnePart.m_sOrd)
|
||||||
@@ -336,63 +474,50 @@ Module CsvM
|
|||||||
EgtLuaGetGlobNumVar("CSV.DIMX" & sN, OnePart.m_dDimX)
|
EgtLuaGetGlobNumVar("CSV.DIMX" & sN, OnePart.m_dDimX)
|
||||||
EgtLuaGetGlobNumVar("CSV.DIMY" & sN, OnePart.m_dDimY)
|
EgtLuaGetGlobNumVar("CSV.DIMY" & sN, OnePart.m_dDimY)
|
||||||
EgtLuaGetGlobNumVar("CSV.TH" & sN, OnePart.m_dTh)
|
EgtLuaGetGlobNumVar("CSV.TH" & sN, OnePart.m_dTh)
|
||||||
|
EgtLuaGetGlobNumVar("CSV.A1_" & sN, OnePart.m_dAng1)
|
||||||
|
EgtLuaGetGlobNumVar("CSV.H1_" & sN, OnePart.m_dHeel1)
|
||||||
|
EgtLuaGetGlobNumVar("CSV.A2_" & sN, OnePart.m_dAng2)
|
||||||
|
EgtLuaGetGlobNumVar("CSV.H2_" & sN, OnePart.m_dHeel2)
|
||||||
|
EgtLuaGetGlobNumVar("CSV.A3_" & sN, OnePart.m_dAng3)
|
||||||
|
EgtLuaGetGlobNumVar("CSV.H3_" & sN, OnePart.m_dHeel3)
|
||||||
|
EgtLuaGetGlobNumVar("CSV.A4_" & sN, OnePart.m_dAng4)
|
||||||
|
EgtLuaGetGlobNumVar("CSV.H4_" & sN, OnePart.m_dHeel4)
|
||||||
OnePart.m_nOriInd = i
|
OnePart.m_nOriInd = i
|
||||||
|
If OnePart.m_nCount > 1 Then
|
||||||
|
OnePart.m_sRefGuid = System.Guid.NewGuid.ToString
|
||||||
|
End If
|
||||||
' inserisco in lista
|
' inserisco in lista
|
||||||
m_CsvPartList.Add(OnePart)
|
LocalCsvPartList.Add(OnePart)
|
||||||
Next
|
Next
|
||||||
EgtLuaResetGlobVar("CSV")
|
EgtLuaResetGlobVar("CSV")
|
||||||
' Ordinamento lista dei pezzi (ordine crescente su materiale e spessore)
|
' Ordinamento lista dei pezzi (ordine crescente su materiale e spessore)
|
||||||
m_CsvPartList.Sort(Function(x, y)
|
LocalCsvPartList.Sort(Function(x, y)
|
||||||
Dim nComp As Integer = String.Compare(x.m_sMaterial, y.m_sMaterial, True)
|
Dim nComp As Integer = String.Compare(x.m_sMaterial, y.m_sMaterial, True)
|
||||||
If nComp = 0 Then
|
If nComp = 0 Then
|
||||||
If Math.Abs(x.m_dTh - y.m_dTh) < EPS_SMALL Then
|
If Math.Abs(x.m_dTh - y.m_dTh) < EPS_SMALL Then
|
||||||
Return (x.m_nOriInd - y.m_nOriInd)
|
Return (x.m_nOriInd - y.m_nOriInd)
|
||||||
|
Else
|
||||||
|
Return CInt(Math.Ceiling(x.m_dTh - y.m_dTh))
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
Return CInt(Math.Ceiling(x.m_dTh - y.m_dTh))
|
Return nComp
|
||||||
End If
|
End If
|
||||||
Else
|
End Function)
|
||||||
Return nComp
|
|
||||||
End If
|
|
||||||
End Function)
|
|
||||||
' Salvo come epl
|
|
||||||
m_bCsvPartListModified = True
|
|
||||||
SaveCsvPartList()
|
|
||||||
' Rinomino file originale
|
|
||||||
Dim sBakPath As String = sCsvPath & ".bak"
|
|
||||||
Dim sBakName As String = Path.GetFileName(sBakPath)
|
|
||||||
' cancello eventuale vecchio backup
|
|
||||||
If My.Computer.FileSystem.FileExists(sBakPath) Then
|
|
||||||
My.Computer.FileSystem.DeleteFile(sBakPath)
|
|
||||||
End If
|
|
||||||
' eseguo rinomina
|
|
||||||
My.Computer.FileSystem.RenameFile(sCsvPath, sBakName)
|
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function SaveCsvPartList() As Boolean
|
Public Function WriteCsvPartList(sFile As String, sCsvPath As String, LocalCsvPartList As List(Of CsvPart)) As Boolean
|
||||||
' Se non c'è nulla di attivo, non faccio alcunché
|
|
||||||
If String.IsNullOrEmpty(m_sCsvPath) Then
|
|
||||||
EgtOutLog("CSV List Save Skipped : missing")
|
|
||||||
Return True
|
|
||||||
End If
|
|
||||||
' Se lista non modificata, non faccio alcunchhé
|
|
||||||
If Not m_bCsvPartListModified Then
|
|
||||||
EgtOutLog("CSV List Save Skipped : not modified")
|
|
||||||
Return True
|
|
||||||
End If
|
|
||||||
' Path del file
|
|
||||||
Dim sFile As String = Path.ChangeExtension(m_sCsvPath, ".epl")
|
|
||||||
' Gestione file
|
|
||||||
Try
|
Try
|
||||||
' Apro file
|
' Apro file
|
||||||
Dim Writer As New IO.StreamWriter(sFile, False)
|
Dim Writer As New IO.StreamWriter(sFile, False)
|
||||||
' Intestazione
|
' Intestazione
|
||||||
Writer.WriteLine("[General]")
|
Writer.WriteLine("[General]")
|
||||||
Writer.WriteLine("Path=" & m_sCsvPath)
|
Writer.WriteLine("Path=" & sCsvPath)
|
||||||
' Ciclo sui pezzi
|
' Ciclo sui pezzi
|
||||||
For i As Integer = 1 To m_CsvPartList.Count()
|
For i As Integer = 1 To LocalCsvPartList.Count()
|
||||||
Dim CurrPart As CsvPart = m_CsvPartList(i - 1)
|
Dim CurrPart As CsvPart = LocalCsvPartList(i - 1)
|
||||||
Writer.WriteLine("[P" & i.ToString() & "]")
|
Writer.WriteLine("[P" & i.ToString() & "]")
|
||||||
|
Writer.WriteLine("Path=" & CurrPart.m_sPath)
|
||||||
Writer.WriteLine("Nam=" & CurrPart.m_sName)
|
Writer.WriteLine("Nam=" & CurrPart.m_sName)
|
||||||
Writer.WriteLine("Ord=" & CurrPart.m_sOrd)
|
Writer.WriteLine("Ord=" & CurrPart.m_sOrd)
|
||||||
Writer.WriteLine("Dist=" & CurrPart.m_sDist)
|
Writer.WriteLine("Dist=" & CurrPart.m_sDist)
|
||||||
@@ -405,7 +530,16 @@ Module CsvM
|
|||||||
Writer.WriteLine("DX=" & DoubleToString(CurrPart.m_dDimX, 4))
|
Writer.WriteLine("DX=" & DoubleToString(CurrPart.m_dDimX, 4))
|
||||||
Writer.WriteLine("DY=" & DoubleToString(CurrPart.m_dDimY, 4))
|
Writer.WriteLine("DY=" & DoubleToString(CurrPart.m_dDimY, 4))
|
||||||
Writer.WriteLine("Th=" & DoubleToString(CurrPart.m_dTh, 4))
|
Writer.WriteLine("Th=" & DoubleToString(CurrPart.m_dTh, 4))
|
||||||
|
Writer.WriteLine("A1=" & DoubleToString(CurrPart.m_dAng1, 4))
|
||||||
|
Writer.WriteLine("H1=" & DoubleToString(CurrPart.m_dHeel1, 4))
|
||||||
|
Writer.WriteLine("A2=" & DoubleToString(CurrPart.m_dAng2, 4))
|
||||||
|
Writer.WriteLine("H2=" & DoubleToString(CurrPart.m_dHeel2, 4))
|
||||||
|
Writer.WriteLine("A3=" & DoubleToString(CurrPart.m_dAng3, 4))
|
||||||
|
Writer.WriteLine("H3=" & DoubleToString(CurrPart.m_dHeel3, 4))
|
||||||
|
Writer.WriteLine("A4=" & DoubleToString(CurrPart.m_dAng4, 4))
|
||||||
|
Writer.WriteLine("H4=" & DoubleToString(CurrPart.m_dHeel4, 4))
|
||||||
Writer.WriteLine("OIn=" & CurrPart.m_nOriInd.ToString())
|
Writer.WriteLine("OIn=" & CurrPart.m_nOriInd.ToString())
|
||||||
|
Writer.WriteLine("Guid=" & CurrPart.m_sRefGuid)
|
||||||
Next
|
Next
|
||||||
' Terminatore
|
' Terminatore
|
||||||
Writer.WriteLine("[END]")
|
Writer.WriteLine("[END]")
|
||||||
@@ -416,18 +550,80 @@ Module CsvM
|
|||||||
' Registro in ini path
|
' Registro in ini path
|
||||||
WriteMainPrivateProfileString(S_CSV, K_CSVLASTFILE, sFile)
|
WriteMainPrivateProfileString(S_CSV, K_CSVLASTFILE, sFile)
|
||||||
Return True
|
Return True
|
||||||
' Errore
|
' Errore
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
EgtOutLog("CSV List error writing " & sFile)
|
EgtOutLog("CSV List error writing " & sFile)
|
||||||
Return False
|
Return False
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function LoadCsvPartList(sFile As String) As Boolean
|
' dato l'elenco completo dei file salvo ogni singolo epl
|
||||||
' Pulisco path e lista dei pezzi Csv
|
Friend Function WriteCsvMergePartList(CsvPartList As List(Of CsvPart)) As Boolean
|
||||||
m_sCsvPath = String.Empty
|
Dim bOk As Boolean = True
|
||||||
m_CsvPartList.Clear()
|
Dim LocalPartList As New List(Of CsvPart)
|
||||||
' Gestione file
|
Dim Index As Integer = 0
|
||||||
|
' devo dividere la lista in tante parti quanti sono i file che lo costituiscono
|
||||||
|
While Index < CsvPartList.Count
|
||||||
|
Dim CurrFile As String = CsvPartList(Index).m_sPath
|
||||||
|
Dim sFile As String = Path.ChangeExtension(CurrFile, ".epl")
|
||||||
|
LocalPartList.Clear()
|
||||||
|
While CurrFile = CsvPartList(Index).m_sPath
|
||||||
|
LocalPartList.Add(CsvPartList(Index))
|
||||||
|
Index += 1
|
||||||
|
' se terminata la lista
|
||||||
|
If Index = CsvPartList.Count Then
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
End While
|
||||||
|
' salvo l'elenco corrente
|
||||||
|
bOk = WriteCsvPartList(sFile, CurrFile, LocalPartList) And bOk
|
||||||
|
End While
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Sub SaveCsvPartList()
|
||||||
|
Dim bFull = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.CSV_AUTO) And
|
||||||
|
(GetMainPrivateProfileInt(S_CSV, K_FULL, 1) <> 0)
|
||||||
|
' Se Csv semplificato non va salvata
|
||||||
|
If Not bFull Then Return
|
||||||
|
' Se non c'è nulla di attivo, non faccio alcunché
|
||||||
|
If String.IsNullOrEmpty(m_sCsvPath) Then
|
||||||
|
EgtOutLog("CSV List missing")
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' Path del file
|
||||||
|
Dim sFile As String = Path.ChangeExtension(m_sFilePath, ".epl")
|
||||||
|
' Scrittura dei file
|
||||||
|
If WriteCsvMergePartList(m_CsvPartList) Then
|
||||||
|
' Scrittura dei file Merge
|
||||||
|
If WriteCsvPartList(sFile, m_sCsvPath, m_CsvPartList) Then
|
||||||
|
WriteMainPrivateProfileString(S_CSV, K_CSVLASTFILE, sFile)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub MySaveCsvPartList(ByVal CurrPartList As List(Of CsvPart))
|
||||||
|
Dim bFull = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.CSV_AUTO) And
|
||||||
|
(GetMainPrivateProfileInt(S_CSV, K_FULL, 1) <> 0)
|
||||||
|
' Se Csv semplificato non va salvata
|
||||||
|
If Not bFull Then Return
|
||||||
|
Dim sCurrPath As String = String.Empty
|
||||||
|
' recupero dalla lista il nome del file corrente
|
||||||
|
For Each Item As CsvPart In CurrPartList
|
||||||
|
sCurrPath = Item.m_sPath
|
||||||
|
Next
|
||||||
|
' se non trov il nome del file assocciato all'elenco di pezzi esco
|
||||||
|
If String.IsNullOrEmpty(sCurrPath) Then
|
||||||
|
EgtOutLog("CSV Curr list missing")
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' Path del file
|
||||||
|
Dim sFile As String = Path.ChangeExtension(sCurrPath, ".epl")
|
||||||
|
' Scrittura del file
|
||||||
|
WriteCsvPartList(sFile, sCurrPath, CurrPartList)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function ReadCsvPartList(sFile As String, LocalCsvPartList As List(Of CsvPart)) As Boolean
|
||||||
Try
|
Try
|
||||||
' Apro file
|
' Apro file
|
||||||
Dim Reader As New IO.StreamReader(sFile, False)
|
Dim Reader As New IO.StreamReader(sFile, False)
|
||||||
@@ -456,7 +652,7 @@ Module CsvM
|
|||||||
' se esiste pezzo precedente, lo salvo
|
' se esiste pezzo precedente, lo salvo
|
||||||
If nI > 1 Then
|
If nI > 1 Then
|
||||||
' inserisco in lista
|
' inserisco in lista
|
||||||
m_CsvPartList.Add(OnePart)
|
LocalCsvPartList.Add(OnePart)
|
||||||
End If
|
End If
|
||||||
' predisposizioni per prossimo pezzo
|
' predisposizioni per prossimo pezzo
|
||||||
nI += 1
|
nI += 1
|
||||||
@@ -466,7 +662,9 @@ Module CsvM
|
|||||||
Else
|
Else
|
||||||
Dim sItems() As String = sLine.Split("=".ToCharArray)
|
Dim sItems() As String = sLine.Split("=".ToCharArray)
|
||||||
If sItems.Count() >= 2 Then
|
If sItems.Count() >= 2 Then
|
||||||
If sItems(0) = "Nam" Then
|
If sItems(0) = "Path" Then
|
||||||
|
OnePart.m_sPath = sItems(1)
|
||||||
|
ElseIf sItems(0) = "Nam" Then
|
||||||
OnePart.m_sName = sItems(1)
|
OnePart.m_sName = sItems(1)
|
||||||
ElseIf sItems(0) = "Ord" Then
|
ElseIf sItems(0) = "Ord" Then
|
||||||
OnePart.m_sOrd = sItems(1)
|
OnePart.m_sOrd = sItems(1)
|
||||||
@@ -490,8 +688,26 @@ Module CsvM
|
|||||||
StringToDouble(sItems(1), OnePart.m_dDimY)
|
StringToDouble(sItems(1), OnePart.m_dDimY)
|
||||||
ElseIf sItems(0) = "Th" Then
|
ElseIf sItems(0) = "Th" Then
|
||||||
StringToDouble(sItems(1), OnePart.m_dTh)
|
StringToDouble(sItems(1), OnePart.m_dTh)
|
||||||
|
ElseIf sItems(0) = "A1" Then
|
||||||
|
StringToDouble(sItems(1), OnePart.m_dAng1)
|
||||||
|
ElseIf sItems(0) = "H1" Then
|
||||||
|
StringToDouble(sItems(1), OnePart.m_dHeel1)
|
||||||
|
ElseIf sItems(0) = "A2" Then
|
||||||
|
StringToDouble(sItems(1), OnePart.m_dAng2)
|
||||||
|
ElseIf sItems(0) = "H2" Then
|
||||||
|
StringToDouble(sItems(1), OnePart.m_dHeel2)
|
||||||
|
ElseIf sItems(0) = "A3" Then
|
||||||
|
StringToDouble(sItems(1), OnePart.m_dAng3)
|
||||||
|
ElseIf sItems(0) = "H3" Then
|
||||||
|
StringToDouble(sItems(1), OnePart.m_dHeel3)
|
||||||
|
ElseIf sItems(0) = "A4" Then
|
||||||
|
StringToDouble(sItems(1), OnePart.m_dAng4)
|
||||||
|
ElseIf sItems(0) = "H4" Then
|
||||||
|
StringToDouble(sItems(1), OnePart.m_dHeel4)
|
||||||
ElseIf sItems(0) = "OIn" Then
|
ElseIf sItems(0) = "OIn" Then
|
||||||
StringToInt(sItems(1), OnePart.m_nOriInd)
|
StringToInt(sItems(1), OnePart.m_nOriInd)
|
||||||
|
ElseIf sItems(0) = "Guid" Then
|
||||||
|
OnePart.m_sRefGuid = sItems(1).Trim
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -502,18 +718,37 @@ Module CsvM
|
|||||||
' Dichiaro lista non modificata
|
' Dichiaro lista non modificata
|
||||||
m_bCsvPartListModified = False
|
m_bCsvPartListModified = False
|
||||||
Return True
|
Return True
|
||||||
' Errore
|
' Errore
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
EgtOutLog("Error reading " & sFile)
|
EgtOutLog("Error reading " & sFile)
|
||||||
Return False
|
Return False
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function RemoveNotToNestParts(ByRef CsvPartList As List(Of CsvPart)) As Boolean
|
||||||
|
For i As Integer = CsvPartList.Count() - 1 To 0 Step -1
|
||||||
|
If CsvPartList(i).m_nToNest = 0 Then
|
||||||
|
CsvPartList.RemoveAt(i)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Function RemoveWrongParts(ByRef CsvPartList As List(Of CsvPart)) As Boolean
|
||||||
|
For i As Integer = CsvPartList.Count() - 1 To 0 Step -1
|
||||||
|
If Not CsvPartList(i).m_bIsRect Or CsvPartList(i).m_dDimX < EPS_SMALL Or CsvPartList(i).m_dDimY < EPS_SMALL Then
|
||||||
|
CsvPartList.RemoveAt(i)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|
||||||
Public Class CsvPart
|
Public Class CsvPart
|
||||||
|
Public m_sPath As String = String.Empty
|
||||||
Public m_sName As String = String.Empty
|
Public m_sName As String = String.Empty
|
||||||
Public m_sOrd As String = String.Empty
|
Public m_sOrd As String = String.Empty
|
||||||
Public m_sDist As String = String.Empty
|
Public m_sDist As String = String.Empty
|
||||||
@@ -526,6 +761,18 @@ Public Class CsvPart
|
|||||||
Public m_dDimX As Double = 0
|
Public m_dDimX As Double = 0
|
||||||
Public m_dDimY As Double = 0
|
Public m_dDimY As Double = 0
|
||||||
Public m_dTh As Double = 0
|
Public m_dTh As Double = 0
|
||||||
|
Public m_dAng1 As Double = 0
|
||||||
|
Public m_dHeel1 As Double = 0
|
||||||
|
Public m_dAng2 As Double = 0
|
||||||
|
Public m_dHeel2 As Double = 0
|
||||||
|
Public m_dAng3 As Double = 0
|
||||||
|
Public m_dHeel3 As Double = 0
|
||||||
|
Public m_dAng4 As Double = 0
|
||||||
|
Public m_dHeel4 As Double = 0
|
||||||
Public m_nOriInd As Integer = 0
|
Public m_nOriInd As Integer = 0
|
||||||
Public m_nId As Integer = GDB_ID.NULL
|
Public m_nId As Integer = GDB_ID.NULL
|
||||||
|
' definsco il riferimento al gruppo
|
||||||
|
Public m_sRefGuid As String = System.Guid.NewGuid.ToString
|
||||||
|
' definisco il colore del gruppo che sto inserendo
|
||||||
|
Public m_cColor As Color3d = CompoColor(IniFile.m_sIniFile)
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
+131
-12
@@ -86,6 +86,9 @@ Public Module CurrentMachine
|
|||||||
Private m_bPolishingWheel As Boolean = False
|
Private m_bPolishingWheel As Boolean = False
|
||||||
Private m_bWaterJet 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
|
' 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_nShowToolChanger As Integer = 0 ' 0=no, 1=tutti utensili, 2=solo lame
|
||||||
Private m_bShowHeadExit As Boolean = False
|
Private m_bShowHeadExit As Boolean = False
|
||||||
@@ -123,6 +126,7 @@ Public Module CurrentMachine
|
|||||||
Private m_sCurrDripSawing As String = String.Empty
|
Private m_sCurrDripSawing As String = String.Empty
|
||||||
Private m_sCurrDripDrilling As String = String.Empty
|
Private m_sCurrDripDrilling As String = String.Empty
|
||||||
Private m_sCurrWaterJetting As String = String.Empty
|
Private m_sCurrWaterJetting As String = String.Empty
|
||||||
|
Private m_sCurrWaterJettingQuality As String = String.Empty
|
||||||
|
|
||||||
' Spessore sottopezzo
|
' Spessore sottopezzo
|
||||||
Private m_dAdditionalTable As Double = 0
|
Private m_dAdditionalTable As Double = 0
|
||||||
@@ -162,6 +166,9 @@ Public Module CurrentMachine
|
|||||||
' Lista dei materiali
|
' Lista dei materiali
|
||||||
Private m_Materials As New ObservableCollection(Of Material)
|
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
|
' Massimo id della lista materiali nel file ini
|
||||||
Private m_MaxIdMat As Integer = 0
|
Private m_MaxIdMat As Integer = 0
|
||||||
|
|
||||||
@@ -559,6 +566,12 @@ Public Module CurrentMachine
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Friend ReadOnly Property bFromDBWaterJet As Boolean
|
||||||
|
Get
|
||||||
|
Return m_bFromDBWaterJet
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Friend ReadOnly Property ShowToolChanger As Integer
|
Friend ReadOnly Property ShowToolChanger As Integer
|
||||||
Get
|
Get
|
||||||
Return m_nShowToolChanger
|
Return m_nShowToolChanger
|
||||||
@@ -828,6 +841,17 @@ Friend Property sCurrMillNoTip As String
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
Friend ReadOnly Property WaterJettingActive As Boolean
|
||||||
Get
|
Get
|
||||||
Return m_bWaterJetting AndAlso Not String.IsNullOrWhiteSpace(m_sCurrWaterJetting)
|
Return m_bWaterJetting AndAlso Not String.IsNullOrWhiteSpace(m_sCurrWaterJetting)
|
||||||
@@ -1006,6 +1030,12 @@ Friend Property sCurrMillNoTip As String
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Friend ReadOnly Property Qualities As ObservableCollection(Of String)
|
||||||
|
Get
|
||||||
|
Return m_Qualities
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Friend Sub AddMaterial(value As Material)
|
Friend Sub AddMaterial(value As Material)
|
||||||
For Each Material In Materials
|
For Each Material In Materials
|
||||||
If Material.nId = value.nId Then
|
If Material.nId = value.nId Then
|
||||||
@@ -1089,9 +1119,13 @@ Friend Property sCurrMillNoTip As String
|
|||||||
If Not IsNothing(value) Then
|
If Not IsNothing(value) Then
|
||||||
Dim CurrMatId As String = value.nId.ToString
|
Dim CurrMatId As String = value.nId.ToString
|
||||||
Dim sKey As String = If(m_bOffice, K_CURROFFICEMATERIAL, K_CURRMATERIAL)
|
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
|
End If
|
||||||
m_CurrMat = value
|
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -1200,6 +1234,8 @@ Friend Property sCurrMillNoTip As String
|
|||||||
m_bPolishingWheel = (GetPrivateProfileInt(S_TOOLS, K_POLISHINGWHEEL, 0, sMachIniFile) > 0) And bKeyPolish
|
m_bPolishingWheel = (GetPrivateProfileInt(S_TOOLS, K_POLISHINGWHEEL, 0, sMachIniFile) > 0) And bKeyPolish
|
||||||
' waterjet
|
' waterjet
|
||||||
m_bWaterJet = (GetPrivateProfileInt(S_TOOLS, K_WATERJET, 0, sMachIniFile) > 0) And bKeyWJ
|
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
|
' Leggo abilitazione visualizzazione TcPos e Head/exit
|
||||||
m_nShowToolChanger = GetPrivateProfileInt(S_TOOLS, K_SHOWTOOLCHANGER, 0, sMachIniFile)
|
m_nShowToolChanger = GetPrivateProfileInt(S_TOOLS, K_SHOWTOOLCHANGER, 0, sMachIniFile)
|
||||||
m_bShowHeadExit = (GetPrivateProfileInt(S_TOOLS, K_SHOWHEADEXIT, 0, sMachIniFile) > 0)
|
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)
|
GetPrivateProfileString(S_MACH_MACH, K_CURRDRIPDRILLING, Nothing, m_sCurrDripDrilling, sMachIniFile)
|
||||||
' waterjetting
|
' waterjetting
|
||||||
GetPrivateProfileString(S_MACH_MACH, K_CURRWATERJETTING, Nothing, m_sCurrWaterJetting, sMachIniFile)
|
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
|
' Leggo numero di portautensili
|
||||||
m_ToolChangerNbr = GetPrivateProfileInt(S_TOOLCHANGER, K_NUMBER, 0, sMachIniFile)
|
m_ToolChangerNbr = GetPrivateProfileInt(S_TOOLCHANGER, K_NUMBER, 0, sMachIniFile)
|
||||||
@@ -1330,24 +1368,89 @@ Friend Property sCurrMillNoTip As String
|
|||||||
' Leggo la lista dei materiali
|
' Leggo la lista dei materiali
|
||||||
Dim Material As Material = Nothing
|
Dim Material As Material = Nothing
|
||||||
Dim nIndex As Integer = 1
|
Dim nIndex As Integer = 1
|
||||||
While (GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & nIndex, Material, sMachIniFile))
|
If m_bWaterJet And m_bFromDBWaterJet Then
|
||||||
m_Materials.Add(Material)
|
LoadWJMaterial(True)
|
||||||
nIndex += 1
|
Else
|
||||||
End While
|
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
|
' Salvo massimo indice a cui sono arrivato per usarlo quando devo aggiungere nuovi elementi alla lista
|
||||||
m_MaxIdMat = nIndex - 1
|
m_MaxIdMat = nIndex - 1
|
||||||
|
|
||||||
' Leggo materiale correntemente attivo
|
' Leggo materiale correntemente attivo
|
||||||
|
Dim sCurrMatId As String = String.Empty
|
||||||
Dim sKey As String = If(m_bOffice, K_CURROFFICEMATERIAL, K_CURRMATERIAL)
|
Dim sKey As String = If(m_bOffice, K_CURROFFICEMATERIAL, K_CURRMATERIAL)
|
||||||
Dim CurrMatId As Integer = GetPrivateProfileInt(S_MATERIALS, sKey, 0, sMachIniFile)
|
EgtUILib.GetPrivateProfileString(S_MATERIALS, sKey, "0", sCurrMatId, sMachIniFile)
|
||||||
For Each Material In Materials
|
If bWaterJet And bFromDBWaterJet Then
|
||||||
If Material.nId = CurrMatId Then
|
Dim sCurrMatIds As String()
|
||||||
m_CurrMat = Material
|
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
|
||||||
|
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
|
||||||
|
|
||||||
|
' recupro dalla lista delle macchine l'oggetto associato al nome indicato
|
||||||
|
Public Sub GetMachineClass(sMachineName As String)
|
||||||
|
For Each Item In OmagOFFICEMap.refMachinePanelVM.MachineList
|
||||||
|
If string.Compare(Item.Name, sMachineName, True) = 0 Then
|
||||||
|
OmagOFFICEMap.refMachinePanelVM.SelectedMachine = Item
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
' Leggo se la macchina ha il tastatore dello spessore lastra
|
End Sub
|
||||||
m_HasRawProbe = (GetPrivateProfileInt(S_MACH_PROBING, K_ENABLERAWPROBE, 1, sMachIniFile) <> 0)
|
|
||||||
|
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
|
End Sub
|
||||||
|
|
||||||
Friend Function IsVacuumMovePossible() As Boolean
|
Friend Function IsVacuumMovePossible() As Boolean
|
||||||
@@ -1456,6 +1559,7 @@ Public Class Material
|
|||||||
|
|
||||||
Private m_nId As Integer
|
Private m_nId As Integer
|
||||||
Private m_sName As String
|
Private m_sName As String
|
||||||
|
Private m_SubId As Integer = 0
|
||||||
|
|
||||||
Public ReadOnly Property nId As Integer
|
Public ReadOnly Property nId As Integer
|
||||||
Get
|
Get
|
||||||
@@ -1472,6 +1576,15 @@ Public Class Material
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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))
|
Sub New(sName As String, MaterialList As ObservableCollection(Of Material))
|
||||||
Dim nMaxId As Integer = 0
|
Dim nMaxId As Integer = 0
|
||||||
For Each Material In MaterialList
|
For Each Material In MaterialList
|
||||||
@@ -1488,4 +1601,10 @@ Public Class Material
|
|||||||
m_sName = sName
|
m_sName = sName
|
||||||
End Sub
|
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
|
End Class
|
||||||
|
|||||||
+274
-2
@@ -3,6 +3,16 @@ Imports EgtUILib
|
|||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
Module EstCalc
|
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
|
Friend Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
|
||||||
@@ -41,6 +51,68 @@ Module EstCalc
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
#Region "PreGuidCode"
|
||||||
|
|
||||||
|
' recupero i primi 5 caratteri della stringa
|
||||||
|
Friend Function GetPreGuidCode(sGuidCode As String) As String
|
||||||
|
If sGuidCode.Count > 5 Then
|
||||||
|
Return sGuidCode(0) & sGuidCode(1) & sGuidCode(2) & sGuidCode(3) & sGuidCode(4)
|
||||||
|
End If
|
||||||
|
Return String.Empty
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' sostituisce i primi 5 caratteri della stringa con qualle passata
|
||||||
|
Friend Function UppDateGuidCode(ByRef sGuidCode As String, sPreGuidCode As String) As Boolean
|
||||||
|
If sPreGuidCode.Count = 5 Then
|
||||||
|
sGuidCode = sGuidCode.Remove(0, 5)
|
||||||
|
sGuidCode = sPreGuidCode & sGuidCode
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' restituisce 5 caratteri
|
||||||
|
Friend Function CreatePreGuidCode(nId As Integer) As String
|
||||||
|
' recupero il frame dell'oggetto
|
||||||
|
Dim frGlobFrame As New Frame3d
|
||||||
|
If Not EgtGetGroupGlobFrame(nId, frGlobFrame) Then
|
||||||
|
Return String.Empty
|
||||||
|
End If
|
||||||
|
' recupero il suo versore
|
||||||
|
Dim vtX As Vector3d = frGlobFrame.VersX
|
||||||
|
Dim Len As Double
|
||||||
|
Dim AngV As Double
|
||||||
|
Dim AngH As Double
|
||||||
|
vtX.ToSpherical(Len, AngV, AngH)
|
||||||
|
' costruisco il codice (6 caratteri!) che identifica la posizione del pezzo in parcheggio
|
||||||
|
Dim sPreGuid As String = GetDirectionCode(AngH)
|
||||||
|
Return sPreGuid
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Function GetDirectionCode(dVal As Double) As String
|
||||||
|
Dim bIsNegative As Boolean = False
|
||||||
|
If dVal < 0 Then
|
||||||
|
dVal = dVal + (-1)
|
||||||
|
bIsNegative = True
|
||||||
|
End If
|
||||||
|
Dim sVal As String = DoubleToString(dVal * 1000, 0)
|
||||||
|
Dim nCount As Integer = sVal.Count
|
||||||
|
For Index As Integer = 1 To 4 - nCount
|
||||||
|
sVal = "0" & sVal
|
||||||
|
Next
|
||||||
|
Dim vVal As Char() = {"+"c, "1"c, "0"c, "0"c, "0"c}
|
||||||
|
If bIsNegative Then
|
||||||
|
vVal = {"-"c, sVal(0), sVal(1), sVal(2), sVal(3)}
|
||||||
|
Else
|
||||||
|
vVal = {"+"c, sVal(0), sVal(1), sVal(2), sVal(3)}
|
||||||
|
End If
|
||||||
|
' ricostruisco la stringa dotata di segno
|
||||||
|
sVal = vVal(0) & vVal(1) & vVal(2) & vVal(3) & vVal(4)
|
||||||
|
Return sVal
|
||||||
|
End Function
|
||||||
|
|
||||||
|
#End Region ' PreGiudCode
|
||||||
|
|
||||||
'--------------------------------------------------------------------------------------------------
|
'--------------------------------------------------------------------------------------------------
|
||||||
Private m_nRawId As Integer = GDB_ID.NULL
|
Private m_nRawId As Integer = GDB_ID.NULL
|
||||||
Public Function GetRawId() As Integer
|
Public Function GetRawId() As Integer
|
||||||
@@ -67,6 +139,8 @@ Module EstCalc
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function UpdateRawPart() As Boolean
|
Public Function UpdateRawPart() As Boolean
|
||||||
|
' Passo al contesto principale
|
||||||
|
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||||
' determino il grezzo (è il primo con fase 1)
|
' determino il grezzo (è il primo con fase 1)
|
||||||
m_nRawId = CamAuto.GetCurrentRaw()
|
m_nRawId = CamAuto.GetCurrentRaw()
|
||||||
If Not EgtGetRawPartBBox(m_nRawId, m_b3Raw) Then
|
If Not EgtGetRawPartBBox(m_nRawId, m_b3Raw) Then
|
||||||
@@ -614,6 +688,16 @@ Module EstCalc
|
|||||||
End If
|
End If
|
||||||
' Gestione risultato nesting
|
' Gestione risultato nesting
|
||||||
If bFit Then
|
If bFit Then
|
||||||
|
'---------------------- COUNTER PART ----------------------
|
||||||
|
Dim sRefGroup As String = String.Empty
|
||||||
|
If EgtGetInfo(nId, INFO_REFGROUP, sRefGroup) Then
|
||||||
|
' spengo il layer che contiene il contatore
|
||||||
|
Dim nCounterLayer As Integer = EgtGetFirstNameInGroup(nId, INFO_COUNTERLY)
|
||||||
|
EgtSetStatus(nCounterLayer, GDB_ST.OFF)
|
||||||
|
' aggiorno il layer che indica il numero di pezzi in parcheggio
|
||||||
|
CountPartInFamily(sRefGroup)
|
||||||
|
End If
|
||||||
|
'---------------------- COUNTER PART ----------------------
|
||||||
' Eventuale aggiunta solido per taglio da sotto
|
' Eventuale aggiunta solido per taglio da sotto
|
||||||
UpdateSolidForDrip(nId)
|
UpdateSolidForDrip(nId)
|
||||||
Return True
|
Return True
|
||||||
@@ -690,12 +774,198 @@ Module EstCalc
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
#Region "Manager Counter Part"
|
||||||
|
|
||||||
|
' lista delle famiglie di pezzi in parcheggio
|
||||||
|
Public m_ListOfGroupInPark As New List(Of FamilyPart)
|
||||||
|
' se seleniozato il layer CounterPz
|
||||||
|
Public m_bIsCounterLy As Boolean = False
|
||||||
|
Public m_nCurrNubrOfParts As Integer = 0
|
||||||
|
|
||||||
|
' creo la lista delle famiglie che popolano il parcheggio
|
||||||
|
Public Sub GetFamilyGroupInPark()
|
||||||
|
m_ListOfGroupInPark.Clear()
|
||||||
|
Dim nIdInPark As Integer = EgtGetFirstPart()
|
||||||
|
While nIdInPark <> GDB_ID.NULL
|
||||||
|
If IsInRaw(nIdInPark) Then
|
||||||
|
nIdInPark = EgtGetNextPart(nIdInPark)
|
||||||
|
Continue While
|
||||||
|
End If
|
||||||
|
Dim sRefGroup As String = String.Empty
|
||||||
|
If EgtGetInfo(nIdInPark, INFO_REFGROUP, sRefGroup) Then
|
||||||
|
Dim bExists As Boolean = False
|
||||||
|
For Each sItem As FamilyPart In m_ListOfGroupInPark
|
||||||
|
If sRefGroup = sItem.sRefGuid Then
|
||||||
|
bExists = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If Not bExists Then
|
||||||
|
m_ListOfGroupInPark.Add(New FamilyPart(sRefGroup, nIdInPark))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nIdInPark = EgtGetNextPart(nIdInPark)
|
||||||
|
End While
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub CountPartInFamily(sRefGuid As String)
|
||||||
|
If String.IsNullOrEmpty(sRefGuid) Then Return
|
||||||
|
Dim nCount As Integer = 0
|
||||||
|
Dim nIdInPark As Integer = EgtGetFirstPart()
|
||||||
|
' conto il nuero di pezzi del gruppo inidcato
|
||||||
|
While nIdInPark <> GDB_ID.NULL
|
||||||
|
If IsInRaw(nIdInPark) Then
|
||||||
|
nIdInPark = EgtGetNextPart(nIdInPark)
|
||||||
|
Continue While
|
||||||
|
End If
|
||||||
|
Dim sRefGroup As String = String.Empty
|
||||||
|
EgtGetInfo(nIdInPark, INFO_REFGROUP, sRefGroup)
|
||||||
|
If sRefGroup = sRefGuid Then
|
||||||
|
nCount += 1
|
||||||
|
End If
|
||||||
|
nIdInPark = EgtGetNextPart(nIdInPark)
|
||||||
|
End While
|
||||||
|
' aggiorno il contatore dei pezzi del gruppo
|
||||||
|
nIdInPark = EgtGetFirstPart()
|
||||||
|
While nIdInPark <> GDB_ID.NULL
|
||||||
|
If IsInRaw(nIdInPark) Then
|
||||||
|
nIdInPark = EgtGetNextPart(nIdInPark)
|
||||||
|
Continue While
|
||||||
|
End If
|
||||||
|
Dim sRefGroup As String = String.Empty
|
||||||
|
EgtGetInfo(nIdInPark, INFO_REFGROUP, sRefGroup)
|
||||||
|
If sRefGroup = sRefGuid Then
|
||||||
|
Dim nId As Integer = EgtGetFirstNameInGroup(nIdInPark, INFO_COUNTERLY)
|
||||||
|
If nId <> GDB_ID.NULL Then
|
||||||
|
Dim m_IdCounterTextas As Integer = EgtGetFirstInGroup(nId)
|
||||||
|
EgtModifyText(m_IdCounterTextas, "# " & nCount.ToString)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nIdInPark = EgtGetNextPart(nIdInPark)
|
||||||
|
End While
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub SelectPartInFaimily(sRefGuid As String, nNbrOfSelection As Integer)
|
||||||
|
' aggiorno il contatore dei pezzi del gruppo
|
||||||
|
Dim nIdInPark As Integer = EgtGetFirstPart()
|
||||||
|
Dim nCounter As Integer = 0
|
||||||
|
While nIdInPark <> GDB_ID.NULL And nCounter < nNbrOfSelection
|
||||||
|
If IsInRaw(nIdInPark) Then
|
||||||
|
nIdInPark = EgtGetNextPart(nIdInPark)
|
||||||
|
Continue While
|
||||||
|
End If
|
||||||
|
Dim sRefGroup As String = String.Empty
|
||||||
|
EgtGetInfo(nIdInPark, INFO_REFGROUP, sRefGroup)
|
||||||
|
If sRefGroup = sRefGuid Then
|
||||||
|
EgtSelectObj(nIdInPark)
|
||||||
|
nCounter += 1
|
||||||
|
End If
|
||||||
|
nIdInPark = EgtGetNextPart(nIdInPark)
|
||||||
|
End While
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub DeselectPartInFaimily(sRefGuid As String)
|
||||||
|
' aggiorno il contatore dei pezzi del gruppo
|
||||||
|
Dim nIdInPark As Integer = EgtGetFirstPart()
|
||||||
|
While nIdInPark <> GDB_ID.NULL
|
||||||
|
If IsInRaw(nIdInPark) Then
|
||||||
|
nIdInPark = EgtGetNextPart(nIdInPark)
|
||||||
|
Continue While
|
||||||
|
End If
|
||||||
|
Dim sRefGroup As String = String.Empty
|
||||||
|
EgtGetInfo(nIdInPark, INFO_REFGROUP, sRefGroup)
|
||||||
|
If sRefGroup = sRefGuid Then
|
||||||
|
EgtDeselectObj(nIdInPark)
|
||||||
|
End If
|
||||||
|
nIdInPark = EgtGetNextPart(nIdInPark)
|
||||||
|
End While
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Function ParkInGroupFamily(nId As Integer) As Boolean
|
||||||
|
' se pezzo appartenente ad un gruppo
|
||||||
|
Dim sRefGroup As String = String.Empty
|
||||||
|
Dim Element As FamilyPart
|
||||||
|
If EgtGetInfo(nId, INFO_REFGROUP, sRefGroup) Then
|
||||||
|
' verifico se esiste un pezzo dello stesso gruppo in parcheggio
|
||||||
|
Dim nNewLayer As Integer
|
||||||
|
Dim ptMin As Point3d
|
||||||
|
Dim ptMax As Point3d
|
||||||
|
For Each sItem As FamilyPart In m_ListOfGroupInPark
|
||||||
|
If sRefGroup = sItem.sRefGuid Then
|
||||||
|
' creo un nuovo layer per contenere l'informazione del numero di pezzi da inserire
|
||||||
|
If EgtGetFirstNameInGroup(nId, INFO_COUNTERLY) = GDB_ID.NULL Then
|
||||||
|
nNewLayer = EgtCreateGroup(nId)
|
||||||
|
EgtSetName(nNewLayer, INFO_COUNTERLY)
|
||||||
|
EgtSetColor(nNewLayer, New Color3d(0, 0, 0))
|
||||||
|
EgtGetBBox(nId, GDB_BB.STANDARD, ptMin, ptMax)
|
||||||
|
EgtCreateText(nNewLayer, New Point3d((ptMin.x + ptMax.x) / 2, ptMin.y - sItem.nHText - 20, ptMin.z), "# ???", sItem.nHText, GDB_RT.LOC)
|
||||||
|
Else
|
||||||
|
' Accendo il layer che contiene il contatore
|
||||||
|
Dim nCounterLayer As Integer = EgtGetFirstNameInGroup(nId, INFO_COUNTERLY)
|
||||||
|
EgtSetStatus(nCounterLayer, GDB_ST.ON_)
|
||||||
|
End If
|
||||||
|
|
||||||
|
' calcolo lo spostamento del pezzo
|
||||||
|
Dim PtMinInRaw As Point3d
|
||||||
|
Dim PtMaxInRaw As Point3d
|
||||||
|
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, PtMinInRaw, PtMaxInRaw)
|
||||||
|
Dim vtMoveToStorage As New Vector3d
|
||||||
|
vtMoveToStorage = sItem.PtStorage() - PtMinInRaw
|
||||||
|
EgtMove(nId, vtMoveToStorage, GDB_RT.GLOB)
|
||||||
|
|
||||||
|
' aggiorno il layer che indica il numero di pezzi in parcheggio
|
||||||
|
CountPartInFamily(sRefGroup)
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
' inserisco il primo pezzo del gruppo nel parcheggio
|
||||||
|
Element = New FamilyPart(sRefGroup, nId)
|
||||||
|
m_ListOfGroupInPark.Add(Element)
|
||||||
|
' creo un nuovo layer per contenere l'informazione del numero di pezzi da inserire
|
||||||
|
If EgtGetFirstNameInGroup(nId, INFO_COUNTERLY) = GDB_ID.NULL Then
|
||||||
|
nNewLayer = EgtCreateGroup(nId)
|
||||||
|
EgtSetName(nNewLayer, INFO_COUNTERLY)
|
||||||
|
EgtSetColor(nNewLayer, New Color3d(0, 0, 0))
|
||||||
|
EgtGetBBox(nId, GDB_BB.STANDARD, ptMin, ptMax)
|
||||||
|
' posso migliorarei lposizioanamento in funzione della dimensione della scritta...
|
||||||
|
EgtCreateText(nNewLayer, New Point3d((ptMin.x + ptMax.x) / 2, ptMin.y - Element.nHText - 20, ptMin.z), "# 1", Element.nHText, GDB_RT.LOC)
|
||||||
|
Else
|
||||||
|
' Accendo il layer che contiene il contatore
|
||||||
|
Dim nCounterLayer As Integer = EgtGetFirstNameInGroup(nId, INFO_COUNTERLY)
|
||||||
|
EgtSetStatus(nCounterLayer, GDB_ST.ON_)
|
||||||
|
' aggiorno il layer che indica il numero di pezzi in parcheggio
|
||||||
|
CountPartInFamily(sRefGroup)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' verifico se il pezzo ha un gruppo che contiene le informazioni per il taglio
|
||||||
|
Public Function IsInRaw(nIdGroup As Integer) As Boolean
|
||||||
|
' verifico che il pezzo sia veramente uin parcheggio
|
||||||
|
Dim nPV As Integer = EgtGetFirstNameInGroup(nIdGroup, "PV")
|
||||||
|
If nPV <> GDB_ID.NULL Then
|
||||||
|
' verifico che non ci siano delle lavorazioni
|
||||||
|
If EgtGetFirstInGroup(nPV) <> GDB_ID.NULL Then
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
#End Region ' Manager Counter Part
|
||||||
|
|
||||||
Public Function StoreOnePart(ByVal nId As Integer, Optional ByVal bForced As Boolean = False) As Boolean
|
Public Function StoreOnePart(ByVal nId As Integer, Optional ByVal bForced As Boolean = False) As Boolean
|
||||||
' Se pezzo in grezzo, metto in parcheggio (sempre possibile)
|
' Se pezzo in grezzo, metto in parcheggio (sempre possibile)
|
||||||
If bForced OrElse
|
If bForced OrElse
|
||||||
(m_nRawId <> GDB_ID.NULL AndAlso EgtGetParent(nId) = m_nRawId) Then
|
(m_nRawId <> GDB_ID.NULL AndAlso EgtGetParent(nId) = m_nRawId) Then
|
||||||
' Ripristino lo stato originale
|
' Ripristino lo stato originale
|
||||||
PreRemoveOnePart( nId)
|
PreRemoveOnePart(nId)
|
||||||
|
|
||||||
|
'---------------------- COUNTER PART ----------------------
|
||||||
|
' se esiste almento un pezzo del gruppo in parcheggio esco
|
||||||
|
If ParkInGroupFamily(nId) Then Return True
|
||||||
|
'---------------------- COUNTER PART ----------------------
|
||||||
|
|
||||||
' Parcheggio
|
' Parcheggio
|
||||||
PackPartInStore(nId)
|
PackPartInStore(nId)
|
||||||
' Aggiusto la posizione in Z
|
' Aggiusto la posizione in Z
|
||||||
@@ -718,7 +988,8 @@ Module EstCalc
|
|||||||
' Parcheggio
|
' Parcheggio
|
||||||
Const STORE_LARGH As Double = 6000
|
Const STORE_LARGH As Double = 6000
|
||||||
Const STORE_DIST As Double = 200
|
Const STORE_DIST As Double = 200
|
||||||
Const STORE_OFFS As Double = 20
|
' 40 il Font usato per indicare il numero di pezzi in parcheggio "# N"
|
||||||
|
Const STORE_OFFS As Double = 20 + 40 + 20
|
||||||
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (STORE_LARGH - b3Tab.DimX())
|
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (STORE_LARGH - b3Tab.DimX())
|
||||||
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + STORE_LARGH, b3Tab.Min().y - STORE_DIST, STORE_OFFS, False)
|
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + STORE_LARGH, b3Tab.Min().y - STORE_DIST, STORE_OFFS, False)
|
||||||
End Function
|
End Function
|
||||||
@@ -819,3 +1090,4 @@ Module EstCalc
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|
||||||
|
|||||||
+27
-15
@@ -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.
|
' Contenuto : Modulo gestione fotografie.
|
||||||
' Ogni gruppo di lavoro può avere una sua foto della lastra.
|
' Ogni gruppo di lavoro può avere una sua foto della lastra.
|
||||||
'
|
'
|
||||||
'
|
'
|
||||||
' Modifiche : 12.04.17 DS Creazione modulo.
|
' 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
|
If dThick > EPS_SMALL Then
|
||||||
OmagOFFICEMap.refRawPartTabVM.Height = DoubleToString( dThick, 3)
|
OmagOFFICEMap.refRawPartTabVM.Height = DoubleToString( dThick, 3)
|
||||||
End If
|
End If
|
||||||
' Altezza eventuale tavola aggiuntiva
|
' Altezza della eventuale tavola aggiuntiva per solo posizionamento in Z
|
||||||
Dim dAddTable As Double = CurrentMachine.dAdditionalTable
|
Dim dAddTable As Double = CurrentMachine.dAdditionalTable
|
||||||
' Aggiusto dati per spessore grezzo
|
' Aggiusto dati per spessore grezzo
|
||||||
If Math.Abs(EstCalc.GetRawHeight() + dAddTable) > EPS_SMALL Then
|
If Math.Abs(EstCalc.GetRawHeight() + dAddTable) > EPS_SMALL Then
|
||||||
' Coefficiente di scalatura
|
' Coefficiente di scalatura (non va considerata la sovratavola)
|
||||||
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)
|
||||||
dMMxPixel *= dFsca
|
dMMxPixel *= dFsca
|
||||||
ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca
|
ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca
|
||||||
ptOri.y = ptCen.y + (ptOri.y - ptCen.y) * dFsca
|
ptOri.y = ptCen.y + (ptOri.y - ptCen.y) * dFsca
|
||||||
@@ -67,7 +67,11 @@ Module EstPhoto
|
|||||||
End If
|
End If
|
||||||
EgtSetLevel(nPhGrpId, GDB_LV.SYSTEM)
|
EgtSetLevel(nPhGrpId, GDB_LV.SYSTEM)
|
||||||
' Carico la fotografia
|
' 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
|
End Function
|
||||||
|
|
||||||
Friend Function LoadContour(sPath As String) As Boolean
|
Friend Function LoadContour(sPath As String) As Boolean
|
||||||
@@ -92,12 +96,12 @@ Module EstPhoto
|
|||||||
Dim nPixelX As Integer = 0
|
Dim nPixelX As Integer = 0
|
||||||
Dim nPixelY As Integer = 0
|
Dim nPixelY As Integer = 0
|
||||||
If Not EgtGetPhotoImagePixels(GetPhoto(), nPixelX, nPixelY) Then Return False
|
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
|
Dim dAddTable As Double = CurrentMachine.dAdditionalTable
|
||||||
' Aggiusto dati per spessore grezzo
|
' Aggiusto dati per spessore grezzo
|
||||||
If Math.Abs(EstCalc.GetRawHeight() + dAddTable) > EPS_SMALL Then
|
If Math.Abs(EstCalc.GetRawHeight() + dAddTable) > EPS_SMALL Then
|
||||||
' Coefficiente di scalatura
|
' Coefficiente di scalatura (non va considerata la sovratavola)
|
||||||
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)
|
||||||
dMMxPixel *= dFsca
|
dMMxPixel *= dFsca
|
||||||
ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca
|
ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca
|
||||||
ptOri.y = ptCen.y + (ptOri.y - ptCen.y) * dFsca
|
ptOri.y = ptCen.y + (ptOri.y - ptCen.y) * dFsca
|
||||||
@@ -385,10 +389,13 @@ Module EstPhoto
|
|||||||
' Porto i punti in locale
|
' Porto i punti in locale
|
||||||
ptOri.ToLoc(New Frame3d(ptTab))
|
ptOri.ToLoc(New Frame3d(ptTab))
|
||||||
ptCen.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
|
Dim dAddTable As Double = CurrentMachine.dAdditionalTable
|
||||||
' Aggiusto dati per spessore grezzo (Coefficiente di scalatura)
|
' 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
|
dDimX *= dFsca
|
||||||
dDimY *= dFsca
|
dDimY *= dFsca
|
||||||
ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca
|
ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca
|
||||||
@@ -426,6 +433,8 @@ Module EstPhoto
|
|||||||
EgtSetInfo(nNewPhotoId, "OffsX", dOffsetX)
|
EgtSetInfo(nNewPhotoId, "OffsX", dOffsetX)
|
||||||
EgtSetInfo(nNewPhotoId, "OffsY", dOffsetY)
|
EgtSetInfo(nNewPhotoId, "OffsY", dOffsetY)
|
||||||
EgtSetInfo(nNewPhotoId, "Rot", dRot)
|
EgtSetInfo(nNewPhotoId, "Rot", dRot)
|
||||||
|
' Salvo sovratavola attuale
|
||||||
|
EgtSetInfo( nNewPhotoId, "OvTab", dAddTable)
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -482,17 +491,20 @@ Module EstPhoto
|
|||||||
' Recupero origine della tavola
|
' Recupero origine della tavola
|
||||||
Dim ptTab As Point3d
|
Dim ptTab As Point3d
|
||||||
If Not EgtGetTableRef(1, ptTab) Then Return False
|
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
|
Dim dAddTable As Double = CurrentMachine.dAdditionalTable
|
||||||
' Recupero inizio contorno
|
' Recupero inizio contorno
|
||||||
Dim ptStart As Point3d
|
Dim ptStart As Point3d
|
||||||
EgtStartPoint(nCrvId, GDB_ID.ROOT, ptStart)
|
EgtStartPoint(nCrvId, GDB_ID.ROOT, ptStart)
|
||||||
' Calcolo coefficiente di scalatura
|
' 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
|
' Scalo opportunamente
|
||||||
EgtScale(nCrvId, New Frame3d(ptCen), dFsca, dFsca, 1, GDB_RT.GLOB)
|
EgtScale(nCrvId, New Frame3d(ptCen), dFsca, dFsca, 1, GDB_RT.GLOB)
|
||||||
' Sposto in Z
|
' 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)
|
EgtMove(nCrvId, vtMove, GDB_RT.GLOB)
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
+49
-17
@@ -92,11 +92,12 @@ Public Module SplitAuto
|
|||||||
Mach.m_dStartFreeLen = FREELEN_INF + 1
|
Mach.m_dStartFreeLen = FREELEN_INF + 1
|
||||||
Mach.m_dEndFreeLen = FREELEN_INF + 1
|
Mach.m_dEndFreeLen = FREELEN_INF + 1
|
||||||
Dim nEntId, nSub As Integer
|
Dim nEntId, nSub As Integer
|
||||||
If EgtGetMachiningGeometry( 0, nEntId, nSub) Then
|
If EgtGetMachiningGeometry(0, nEntId, nSub) Then
|
||||||
If EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse EgtGetType( nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False
|
' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse
|
||||||
EgtGetInfo( nEntId, If( Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng)
|
If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False
|
||||||
EgtGetInfo( nEntId, If( Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng)
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng)
|
||||||
EgtGetInfo( nEntId, If( Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng)
|
||||||
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
|
||||||
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen)
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen)
|
||||||
Mach.m_bEnableInvert = GetEnableInvert(nEntId)
|
Mach.m_bEnableInvert = GetEnableInvert(nEntId)
|
||||||
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
|
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
|
||||||
@@ -160,6 +161,17 @@ Public Module SplitAuto
|
|||||||
End Function
|
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)
|
Friend Sub ColorMachining(MachSplit As SplitMach, Optional bReset As Boolean = False)
|
||||||
EgtDisableModified()
|
EgtDisableModified()
|
||||||
' Assegno stato
|
' Assegno stato
|
||||||
@@ -736,35 +748,55 @@ Public Module SplitAuto
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
|
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
|
' 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
|
' Se interferisce con altri grezzi, annullo movimento ed esco con errore
|
||||||
If Not VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
If Not VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||||
EgtMoveRawPart(nRawId, -vtMove)
|
EgtMoveRawPart(nRawId, -vtOriMove)
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
If nMoveLevel < 2 Then Return True
|
||||||
' Provo ad aggiungere un altro movimento
|
' Provo ad aggiungere un altro movimento
|
||||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
If EgtMoveRawPart(nRawId, vtOriMove) Then
|
||||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||||
vtMove += vtMove
|
vtMove += vtOriMove
|
||||||
|
nMove += 1
|
||||||
|
If nMoveLevel = nMove Then Return True
|
||||||
Else
|
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
|
||||||
End If
|
End If
|
||||||
' Provo ad aggiungere un movimento dimezzato
|
' 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
|
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||||
vtMove += 0.5 * vtMove
|
vtMove += 0.5 * vtOriMove
|
||||||
|
nMove += 1
|
||||||
|
If nMoveLevel = nMove Then Return True
|
||||||
Else
|
Else
|
||||||
EgtMoveRawPart(nRawId, -0.5 * vtMove)
|
EgtMoveRawPart(nRawId, -0.5 * vtOriMove)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' Provo ad aggiunger un movimento 1/4
|
' Provo ad aggiungere un movimento 1/4
|
||||||
If EgtMoveRawPart(nRawId, 0.25 * vtMove) Then
|
If EgtMoveRawPart(nRawId, 0.25 * vtOriMove) Then
|
||||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||||
vtMove += 0.25 * vtMove
|
vtMove += 0.25 * vtOriMove
|
||||||
Else
|
Else
|
||||||
EgtMoveRawPart(nRawId, -0.25 * vtMove)
|
EgtMoveRawPart(nRawId, -0.25 * vtOriMove)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Return True
|
Return True
|
||||||
|
|||||||
+159
-5
@@ -8,7 +8,24 @@ Module VacuumCups
|
|||||||
Private m_nVacId As Integer = GDB_ID.NULL
|
Private m_nVacId As Integer = GDB_ID.NULL
|
||||||
Private m_nRefId As Integer = GDB_ID.NULL
|
Private m_nRefId As Integer = GDB_ID.NULL
|
||||||
Private m_dPreferredRot As Double = 0
|
Private m_dPreferredRot As Double = 0
|
||||||
|
Private m_dPrefVertRotXMinus As Double = 0
|
||||||
|
Private m_dPrefVertRotXPlus As Double = 0
|
||||||
|
Private m_dPrefVertRotYMinus As Double = 0
|
||||||
|
Private m_dPrefVertRotYPlus As Double = 0
|
||||||
Private m_dDripRefAng As Double = 0
|
Private m_dDripRefAng As Double = 0
|
||||||
|
' dati carico massimo manipolatore
|
||||||
|
Private m_RawDensity As Double = 2500
|
||||||
|
Private m_RawWeight As Double = 0
|
||||||
|
Private m_MaxWeightSinglePlugger As Double = 250
|
||||||
|
Private m_MaxWeightDoublePlugger As Double = 750
|
||||||
|
Public bOverWeight As Boolean = False
|
||||||
|
' dati per rotazione ventose vicono al fine corsa Y e X
|
||||||
|
Private bRotateVacuumNearExtraStrokeY As Boolean = False
|
||||||
|
Private bRotateVacuumNearExtraStrokeX As Boolean = False
|
||||||
|
' dati stroke
|
||||||
|
Public bExtraStroke As Boolean = False
|
||||||
|
Public ptStartPointLift As Point3d
|
||||||
|
Public dDegRotStartAng As Double
|
||||||
|
|
||||||
' Nome del gruppo temporaneo per le ventose
|
' Nome del gruppo temporaneo per le ventose
|
||||||
Private Const VACTMP_GRP As String = "VacTmp"
|
Private Const VACTMP_GRP As String = "VacTmp"
|
||||||
@@ -48,6 +65,20 @@ Module VacuumCups
|
|||||||
Return m_nVacType
|
Return m_nVacType
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Sub GetWeightInformation(Density As Double, MaxSingle As Double, MaxDouble As Double)
|
||||||
|
m_RawDensity = Density
|
||||||
|
m_MaxWeightSinglePlugger = MaxSingle
|
||||||
|
m_MaxWeightDoublePlugger = MaxDouble
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub GetRotationForExtraStrokeY(Rotate As Boolean)
|
||||||
|
bRotateVacuumNearExtraStrokeY = Rotate
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub GetRotationForExtraStrokeX(Rotate As Boolean)
|
||||||
|
bRotateVacuumNearExtraStrokeX = Rotate
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Function GetVacuumId() As Integer
|
Friend Function GetVacuumId() As Integer
|
||||||
Return m_nVacId
|
Return m_nVacId
|
||||||
End Function
|
End Function
|
||||||
@@ -64,6 +95,8 @@ Module VacuumCups
|
|||||||
' Identificativo riferimento della testa nella macchina
|
' Identificativo riferimento della testa nella macchina
|
||||||
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
|
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
|
||||||
If nT1Id = GDB_ID.NULL Then Return False
|
If nT1Id = GDB_ID.NULL Then Return False
|
||||||
|
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
||||||
|
EgtSetCalcTool("", "H4", 1)
|
||||||
' Creo gruppo temporaneo in cui copiarli
|
' Creo gruppo temporaneo in cui copiarli
|
||||||
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
|
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
If m_nTempId = GDB_ID.NULL Then Return False
|
If m_nTempId = GDB_ID.NULL Then Return False
|
||||||
@@ -73,7 +106,12 @@ Module VacuumCups
|
|||||||
m_nVacId = EgtCopyGlob(nLayId, m_nTempId)
|
m_nVacId = EgtCopyGlob(nLayId, m_nTempId)
|
||||||
If m_nVacId = GDB_ID.NULL Then Return False
|
If m_nVacId = GDB_ID.NULL Then Return False
|
||||||
' Angolo di rotazione preferito
|
' Angolo di rotazione preferito
|
||||||
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
|
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
|
||||||
|
' Angoli di rotazione preferiti per ventosa in verticale (lungo Y) a sinistra e a destra del centro tavola
|
||||||
|
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXMINUS, m_dPrefVertRotXMinus)
|
||||||
|
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
|
||||||
|
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYMINUS, m_dPrefVertRotYMinus)
|
||||||
|
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYPLUS, m_dPrefVertRotYPlus)
|
||||||
' Direzione di riferimento per tagli Drip
|
' Direzione di riferimento per tagli Drip
|
||||||
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
|
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
|
||||||
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
|
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
|
||||||
@@ -160,6 +198,18 @@ Module VacuumCups
|
|||||||
EgtGetBBoxGlob(nRKerfId, GDB_BB.STANDARD, b3Kerf)
|
EgtGetBBoxGlob(nRKerfId, GDB_BB.STANDARD, b3Kerf)
|
||||||
Dim ptKerfCen As Point3d
|
Dim ptKerfCen As Point3d
|
||||||
EgtCentroid(nRKerfId, GDB_ID.ROOT, ptKerfCen)
|
EgtCentroid(nRKerfId, GDB_ID.ROOT, ptKerfCen)
|
||||||
|
|
||||||
|
'-------------------- INIZIO CALCOLO PESO --------------------
|
||||||
|
' recupero l'area del grezzo da muovere
|
||||||
|
Dim RawArea As Double = 0
|
||||||
|
' superficie del grezzo senza considerare eventuali fori
|
||||||
|
EgtSurfFrGrossArea(nRKerfId, RawArea)
|
||||||
|
' volume calcolato in mmc
|
||||||
|
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
|
||||||
|
' peso calolato in kg
|
||||||
|
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
|
||||||
|
'-------------------- FINE CALCOLO PESO --------------------
|
||||||
|
|
||||||
' Eseguo ricerca
|
' Eseguo ricerca
|
||||||
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
|
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
|
||||||
Return True
|
Return True
|
||||||
@@ -261,6 +311,7 @@ Module VacuumCups
|
|||||||
Dim sCups() As String = Nothing
|
Dim sCups() As String = Nothing
|
||||||
Dim sCups2() As String = Nothing
|
Dim sCups2() As String = Nothing
|
||||||
If Not GetVacuumCupSelection(nI, sCups, sCups2) Then Return False
|
If Not GetVacuumCupSelection(nI, sCups, sCups2) Then Return False
|
||||||
|
bExtraStroke = False
|
||||||
' Determino validità soluzioni della configurazione
|
' Determino validità soluzioni della configurazione
|
||||||
Dim vtMove As New Vector3d
|
Dim vtMove As New Vector3d
|
||||||
Dim ptRotCen As New Point3d
|
Dim ptRotCen As New Point3d
|
||||||
@@ -363,6 +414,26 @@ Module VacuumCups
|
|||||||
If b3Vac.IsEmpty() Then Return INFINITO
|
If b3Vac.IsEmpty() Then Return INFINITO
|
||||||
' Se box maggiore di quello del pezzo, scarto soluzione
|
' Se box maggiore di quello del pezzo, scarto soluzione
|
||||||
If b3Vac.Radius() > b3Raw.Radius() Then Return INFINITO
|
If b3Vac.Radius() > b3Raw.Radius() Then Return INFINITO
|
||||||
|
'-------------------- INIZIO VERIFICA PESO --------------------
|
||||||
|
bOverWeight = False
|
||||||
|
Select Case GetPluggerFromCameras(sCups)
|
||||||
|
Case 2
|
||||||
|
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
|
||||||
|
If m_RawWeight > m_MaxWeightDoublePlugger Then
|
||||||
|
bOverWeight = True
|
||||||
|
Return INFINITO
|
||||||
|
End If
|
||||||
|
Case 1
|
||||||
|
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
|
||||||
|
If m_RawWeight > m_MaxWeightSinglePlugger Then
|
||||||
|
bOverWeight = True
|
||||||
|
Return INFINITO
|
||||||
|
End If
|
||||||
|
End Select
|
||||||
|
'-------------------- FINE VERIFICA PESO --------------------
|
||||||
|
' Recupero l'area della tavola
|
||||||
|
Dim b3Tab As New BBox3d
|
||||||
|
EgtGetTableArea(1, b3Tab)
|
||||||
' Determino il movimento
|
' Determino il movimento
|
||||||
vtMove = ptRawCen - b3Vac.Center()
|
vtMove = ptRawCen - b3Vac.Center()
|
||||||
b3Vac.Move(vtMove)
|
b3Vac.Move(vtMove)
|
||||||
@@ -373,12 +444,27 @@ Module VacuumCups
|
|||||||
Dim dLen, dAngVertDeg, dAngOrizzDeg As Double
|
Dim dLen, dAngVertDeg, dAngOrizzDeg As Double
|
||||||
frMinRect.VersX().ToSpherical(dLen, dAngVertDeg, dAngOrizzDeg)
|
frMinRect.VersX().ToSpherical(dLen, dAngVertDeg, dAngOrizzDeg)
|
||||||
dRotAngDeg = dAngOrizzDeg
|
dRotAngDeg = dAngOrizzDeg
|
||||||
|
Dim dPreferredRot As Double = m_dPreferredRot
|
||||||
|
If bRotateVacuumNearExtraStrokeX And Not IsHorizontal(dAngOrizzDeg) Then
|
||||||
|
If frMinRect.Orig().x < b3Tab.Center().x Then
|
||||||
|
dPreferredRot = m_dPrefVertRotXMinus
|
||||||
|
Else
|
||||||
|
dPreferredRot = m_dPrefVertRotXPlus
|
||||||
|
End If
|
||||||
|
ElseIf bRotateVacuumNearExtraStrokeY And IsHorizontal(dAngOrizzDeg) Then
|
||||||
|
' se l'orientemanto è orizzontale e la macchina è stata abilitata
|
||||||
|
If frMinRect.Orig().y < b3Tab.Center().y Then
|
||||||
|
dPreferredRot = m_dPrefVertRotYPlus
|
||||||
|
Else
|
||||||
|
dPreferredRot = m_dPrefVertRotYMinus
|
||||||
|
End If
|
||||||
|
End If
|
||||||
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
|
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
|
||||||
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
|
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
|
||||||
While dRotAngDeg - m_dPreferredRot >= dAngDelta / 2
|
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
|
||||||
dRotAngDeg -= dAngDelta
|
dRotAngDeg -= dAngDelta
|
||||||
End While
|
End While
|
||||||
While dRotAngDeg - m_dPreferredRot <= -dAngDelta / 2
|
While dRotAngDeg - dPreferredRot <= -dAngDelta / 2
|
||||||
dRotAngDeg += dAngDelta
|
dRotAngDeg += dAngDelta
|
||||||
End While
|
End While
|
||||||
Else
|
Else
|
||||||
@@ -430,13 +516,60 @@ Module VacuumCups
|
|||||||
' Applico movimento e rotazione al punto
|
' Applico movimento e rotazione al punto
|
||||||
ptRef.Move(vtMove)
|
ptRef.Move(vtMove)
|
||||||
ptRef.Rotate(ptRotCen, Vector3d.Z_AX(), dRotAngDeg)
|
ptRef.Rotate(ptRotCen, Vector3d.Z_AX(), dRotAngDeg)
|
||||||
|
' -------------- INIZIO verifica di essere nel limite delle corse macchina --------------
|
||||||
|
If VerifyOutOfStrokes(ptRef, dRotAngDeg) <> 0 Then
|
||||||
|
bExtraStroke = True
|
||||||
|
Return INFINITO
|
||||||
|
End If
|
||||||
|
' se la posizione è accettbaile allora salvo i dati
|
||||||
|
ptStartPointLift = ptRef
|
||||||
|
dDegRotStartAng = dRotAngDeg
|
||||||
|
' -------------- FINE verifica di essere nel limite delle corse macchina --------------
|
||||||
' Ne calcolo la distanza dal centro della tavola
|
' Ne calcolo la distanza dal centro della tavola
|
||||||
Dim b3Tab As New BBox3d
|
|
||||||
EgtGetTableArea(1, b3Tab)
|
|
||||||
Dim dDist As Double = Point3d.DistXY(ptRef, b3Tab.Center())
|
Dim dDist As Double = Point3d.DistXY(ptRef, b3Tab.Center())
|
||||||
Return dDist
|
Return dDist
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function IsHorizontal(dDegAng As Double) As Boolean
|
||||||
|
If (Math.Abs(dDegAng) > 45 And Math.Abs(dDegAng) < 135) Or (Math.Abs(dDegAng) > 225 And Math.Abs(dDegAng) < 315) Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
|
||||||
|
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
|
||||||
|
Dim dX, dY, dZ As Double
|
||||||
|
Dim nStat As Integer
|
||||||
|
Dim dCHome As Double
|
||||||
|
EgtGetAxisHomePos("C", dCHome)
|
||||||
|
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
||||||
|
EgtSetCalcTool("", "H4", 1)
|
||||||
|
EgtGetCalcPositions(ptRef, dRotAngDeg + dCHome, 0, nStat, dX, dY, dZ)
|
||||||
|
EgtVerifyOutstroke(dX, dY, dZ, dRotAngDeg + dCHome, 0, nStat)
|
||||||
|
Return nStat
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' dall'informazione di extra corsa recupera il valore indicato
|
||||||
|
Public Function GetExtraStrokeValue(sInfo As String) As Double
|
||||||
|
Dim dExtraStroke As Double = 0
|
||||||
|
Dim sItems As String() = sInfo.Split("="c)
|
||||||
|
If sItems.Count = 2 Then
|
||||||
|
Dim nStartIndex As Integer = 0
|
||||||
|
For Each ItemChar As Char In sItems(1)
|
||||||
|
If ItemChar = "("c Then
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
nStartIndex += 1
|
||||||
|
Next
|
||||||
|
If nStartIndex > 0 Then
|
||||||
|
Dim sValue As String = sItems(1).Remove(nStartIndex, sItems(1).Count - nStartIndex)
|
||||||
|
StringToLen(sValue, dExtraStroke)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return dExtraStroke
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function TestVacuumCups(nCups() As Integer, nRawRegId As Integer,
|
Private Function TestVacuumCups(nCups() As Integer, nRawRegId As Integer,
|
||||||
vtMove As Vector3d, ptRotCen As Point3d, dRotAngDeg As Double) As Boolean
|
vtMove As Vector3d, ptRotCen As Point3d, dRotAngDeg As Double) As Boolean
|
||||||
' Eseguo verifica delle ventose rispetto al grezzo
|
' Eseguo verifica delle ventose rispetto al grezzo
|
||||||
@@ -457,6 +590,27 @@ Module VacuumCups
|
|||||||
Return bVacOk
|
Return bVacOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function GetPluggerFromCameras(sCups() As String) As Integer
|
||||||
|
Dim nCountPlunger As Integer = 1
|
||||||
|
Dim bPlugger1 As Boolean = False
|
||||||
|
Dim bPlugger2 As Boolean = False
|
||||||
|
For Each Camera As String In sCups
|
||||||
|
If (Camera.Contains("1") Or Camera.Contains("2") Or Camera.Contains("3")) Then
|
||||||
|
bPlugger1 = True
|
||||||
|
Else
|
||||||
|
bPlugger2 = True
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
' verifico quali sono le camere attive
|
||||||
|
If bPlugger1 And bPlugger2 Then
|
||||||
|
nCountPlunger = 2
|
||||||
|
ElseIf Not bPlugger1 And Not bPlugger2 Then
|
||||||
|
nCountPlunger = 0
|
||||||
|
End If
|
||||||
|
' restituisco il numero di Plugger in uso
|
||||||
|
Return nCountPlunger
|
||||||
|
End Function
|
||||||
|
|
||||||
Friend Function SaveOneMoveInfo(nId As Integer, rmData As RawMoveData) As Boolean
|
Friend Function SaveOneMoveInfo(nId As Integer, rmData As RawMoveData) As Boolean
|
||||||
' Assegno le informazioni
|
' Assegno le informazioni
|
||||||
EgtSetInfo(nId, "Id", rmData.m_nId)
|
EgtSetInfo(nId, "Id", rmData.m_nId)
|
||||||
|
|||||||
@@ -25,7 +25,10 @@
|
|||||||
<Button Name="ExportBtn" Height="40" Width="80"
|
<Button Name="ExportBtn" Height="40" Width="80"
|
||||||
Margin="0,5,0,0"
|
Margin="0,5,0,0"
|
||||||
Content="Export"/>
|
Content="Export"/>
|
||||||
</StackPanel>
|
<Button Name="AssemblyBtn" Height="40" Width="80"
|
||||||
|
Margin="0,5,0,0"
|
||||||
|
Content="3D"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Windows.Interop
|
Imports System.Windows.Interop
|
||||||
|
Imports System.Collections.ObjectModel
|
||||||
Imports System.Runtime.InteropServices
|
Imports System.Runtime.InteropServices
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
@@ -28,6 +29,13 @@ Public Class VeinMatchingWindow
|
|||||||
Private m_locPrev As System.Drawing.Point
|
Private m_locPrev As System.Drawing.Point
|
||||||
Private m_ptPrev As Point3d
|
Private m_ptPrev As Point3d
|
||||||
Private m_ptCen As Point3d
|
Private m_ptCen As Point3d
|
||||||
|
' Gestione rotazione pezzi in fase di Drag
|
||||||
|
Private m_bKeyCtrlPressed As Boolean = False
|
||||||
|
Private m_bKeyLeftShiftPressed As Boolean = False
|
||||||
|
Private m_dAngTotal As Double = 0
|
||||||
|
Private m_dStartAng As Double = 0
|
||||||
|
Private m_bStartRot As Boolean = False
|
||||||
|
Private m_bStartMove As Boolean = False
|
||||||
|
|
||||||
Private Sub Window_Initialized(sender As Object, e As EventArgs)
|
Private Sub Window_Initialized(sender As Object, e As EventArgs)
|
||||||
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
||||||
@@ -316,6 +324,7 @@ Public Class VeinMatchingWindow
|
|||||||
MessageBox.Show(Me, EgtMsg(91607) & " " & sMachGrpName, EgtMsg(91122), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
MessageBox.Show(Me, EgtMsg(91607) & " " & sMachGrpName, EgtMsg(91122), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
EgtSetCurrentContext(VeinMatchingScene.GetCtx())
|
EgtSetCurrentContext(VeinMatchingScene.GetCtx())
|
||||||
' Se selezione riuscita, la eseguo anche in VME
|
' Se selezione riuscita, la eseguo anche in VME
|
||||||
@@ -378,6 +387,13 @@ Public Class VeinMatchingWindow
|
|||||||
VeinMatching.Export(SaveFileDialog.FileName)
|
VeinMatching.Export(SaveFileDialog.FileName)
|
||||||
End Sub
|
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
|
Private Sub Scene_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles VeinMatchingScene.KeyDown
|
||||||
' Con DEL eseguo cancellazione dei pezzi selezionati
|
' Con DEL eseguo cancellazione dei pezzi selezionati
|
||||||
If e.KeyData = System.Windows.Forms.Keys.Delete Then
|
If e.KeyData = System.Windows.Forms.Keys.Delete Then
|
||||||
@@ -401,6 +417,8 @@ Friend Module VeinMatching
|
|||||||
' Dimensioni immagine da esportare
|
' Dimensioni immagine da esportare
|
||||||
Private m_nImgWidth As Integer = 1600
|
Private m_nImgWidth As Integer = 1600
|
||||||
Private m_nImgHeight As Integer = 1200
|
Private m_nImgHeight As Integer = 1200
|
||||||
|
' Lista delle alzatine
|
||||||
|
Private m_ListAlzFront As New ObservableCollection(Of Aletta)
|
||||||
' Flag visualizzazione testi
|
' Flag visualizzazione testi
|
||||||
Private m_bShowText As Boolean = True
|
Private m_bShowText As Boolean = True
|
||||||
Friend ReadOnly Property bShowText As Boolean
|
Friend ReadOnly Property bShowText As Boolean
|
||||||
@@ -672,6 +690,15 @@ Friend Module VeinMatching
|
|||||||
' Sistemo il colore
|
' Sistemo il colore
|
||||||
Dim colWhite As New Color3d(255, 255, 255, 100)
|
Dim colWhite As New Color3d(255, 255, 255, 100)
|
||||||
EgtSetColor(nRegId, colWhite)
|
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
|
' Se richiesto, eseguo deselezione
|
||||||
If bDeselect Then EgtDeselectObj(nId)
|
If bDeselect Then EgtDeselectObj(nId)
|
||||||
End If
|
End If
|
||||||
@@ -698,10 +725,14 @@ Friend Module VeinMatching
|
|||||||
If nId <> GDB_ID.NULL Then
|
If nId <> GDB_ID.NULL Then
|
||||||
' Recupero la regione del pezzo
|
' Recupero la regione del pezzo
|
||||||
Dim nRegId As Integer = GetVeinPartRegionId(nId)
|
Dim nRegId As Integer = GetVeinPartRegionId(nId)
|
||||||
|
Dim nSolidId As Integer = GetVeinPartSolidId(nId)
|
||||||
' Sistemo il riferimento della texture
|
' Sistemo il riferimento della texture
|
||||||
Dim refTxr As New Frame3d
|
Dim refTxr As New Frame3d
|
||||||
GetVeinRefPhoto(nMainCtx, nPartId, nId, refTxr)
|
GetVeinRefPhoto(nMainCtx, nPartId, nId, refTxr)
|
||||||
EgtSetTextureFrame(nRegId, refTxr, GDB_RT.GLOB)
|
EgtSetTextureFrame(nRegId, refTxr, GDB_RT.GLOB)
|
||||||
|
If nSolidId <> GDB_ID.NULL Then
|
||||||
|
EgtSetTextureFrame(nSolidId, refTxr, GDB_RT.GLOB)
|
||||||
|
End If
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
EgtSetCurrentContext(nMainCtx)
|
EgtSetCurrentContext(nMainCtx)
|
||||||
@@ -728,8 +759,15 @@ Friend Module VeinMatching
|
|||||||
' Gli tolgo la texture
|
' Gli tolgo la texture
|
||||||
EgtRemoveTextureData(nRegId)
|
EgtRemoveTextureData(nRegId)
|
||||||
' Sistemo il colore
|
' Sistemo il colore
|
||||||
Dim colAqua As New Color3d(0, 255, 255, 25)
|
Dim colRegion As Color3d
|
||||||
EgtSetColor(nRegId, colAqua)
|
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
|
' Se richiesto, eseguo deselezione
|
||||||
If bDeselect Then EgtDeselectObj(nId)
|
If bDeselect Then EgtDeselectObj(nId)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -953,7 +991,8 @@ Friend Module VeinMatching
|
|||||||
' Esporto il file come immagine
|
' Esporto il file come immagine
|
||||||
EgtSetCurrentContext(m_nVeinCtx)
|
EgtSetCurrentContext(m_nVeinCtx)
|
||||||
Dim bOk As Boolean = (EgtGetFileType(sFilePath) = FT.IMG)
|
Dim bOk As Boolean = (EgtGetFileType(sFilePath) = FT.IMG)
|
||||||
bOk = bOk AndAlso EgtGetImage(EgtGetShowMode(), New Color3d(255, 255, 255), New Color3d(255, 255, 255),
|
bOk = bOk AndAlso EgtGetImage(DirectCast( EgtGetShowMode(), EgtInterface.SM),
|
||||||
|
New Color3d(255, 255, 255), New Color3d(255, 255, 255),
|
||||||
m_nImgWidth, m_nImgHeight, sFilePath)
|
m_nImgWidth, m_nImgHeight, sFilePath)
|
||||||
' Ripristino il contesto originale
|
' Ripristino il contesto originale
|
||||||
EgtSetCurrentContext(nMainCtx)
|
EgtSetCurrentContext(nMainCtx)
|
||||||
@@ -1240,4 +1279,538 @@ Friend Module VeinMatching
|
|||||||
Return nRegId
|
Return nRegId
|
||||||
End Function
|
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
|
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
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<EgtFloating:EgtFloatingPanel x:Class="PrintPanelV"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||||
|
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
|
||||||
|
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||||
|
|
||||||
|
<Button ToolTip="{Binding PrintToolTip}"
|
||||||
|
Style="{StaticResource ToolBar_Button}"
|
||||||
|
Command="{Binding PrintCommand}">
|
||||||
|
<Image Source="/Resources/InstrumentPanel/Print.png" Stretch="Uniform"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</EgtFloating:EgtFloatingPanel>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Public Class PrintPanelV
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
Public Class PrintPanelVM
|
||||||
|
|
||||||
|
' Definizione comandi
|
||||||
|
Private m_cmdPrint As ICommand
|
||||||
|
|
||||||
|
Public ReadOnly Property PrintToolTip As String
|
||||||
|
Get
|
||||||
|
Return "Print shading" & vbCrLf & "Print hidden line (Shift)"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
#Region "PrintCommand"
|
||||||
|
|
||||||
|
Public ReadOnly Property PrintCommand As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdPrint Is Nothing Then
|
||||||
|
m_cmdPrint = New Command(AddressOf Print)
|
||||||
|
End If
|
||||||
|
Return m_cmdPrint
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub Print(ByVal param As Object)
|
||||||
|
Dim SM_Select As SM = SM.SHADING
|
||||||
|
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then
|
||||||
|
SM_Select = SM.HIDDENLINE
|
||||||
|
EgtSetLineAttribs(3)
|
||||||
|
End If
|
||||||
|
Dim printDlg As New PrintDialog
|
||||||
|
Dim sPath = OmagOFFICEMap.refMainWindowVM.MainWindowM.sTempDir & "\Image.png"
|
||||||
|
If printDlg.ShowDialog() Then
|
||||||
|
' Recupero le dimensioni dell'area di stampa
|
||||||
|
Dim dW As Double = printDlg.PrintableAreaWidth
|
||||||
|
Dim dH As Double = printDlg.PrintableAreaHeight
|
||||||
|
Try
|
||||||
|
' Creo l'immagine da allegare
|
||||||
|
' EgtZoom(ZM.ALL, True)
|
||||||
|
' Prendo l'immagine per la stampa
|
||||||
|
Dim colWhite As New Color3d(255, 255, 255)
|
||||||
|
Dim nImgW As Integer = GetWidthDimProjectV()
|
||||||
|
Dim nImgH As Integer = GetHeightDimProjectV()
|
||||||
|
If Not EgtGetImage(SM_Select, colWhite, colWhite, nImgW, nImgH, sPath) Then
|
||||||
|
' Error in creating the print image
|
||||||
|
EgtOutLog(EgtMsg(50181))
|
||||||
|
EgtSetLineAttribs(1)
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
EgtSetLineAttribs(1)
|
||||||
|
'Metodo complesso di stampa che permette di rilasciare il file :
|
||||||
|
'carico la bitmap e la metto in uno stream in memoria
|
||||||
|
Dim stream As System.IO.Stream = New System.IO.MemoryStream()
|
||||||
|
Dim bitmap As System.Drawing.Bitmap = New System.Drawing.Bitmap(sPath)
|
||||||
|
bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png)
|
||||||
|
bitmap.Dispose()
|
||||||
|
' la sposto in una BitmapImage
|
||||||
|
Dim bitImage As New System.Windows.Media.Imaging.BitmapImage()
|
||||||
|
bitImage.BeginInit()
|
||||||
|
bitImage.StreamSource = stream
|
||||||
|
bitImage.EndInit()
|
||||||
|
' la sposto in un Visual Control
|
||||||
|
Dim tmpImg As New Image
|
||||||
|
tmpImg.BeginInit()
|
||||||
|
tmpImg.Source = bitImage
|
||||||
|
'tmpImg.Margin = New Thickness(-100)
|
||||||
|
tmpImg.Stretch = Stretch.Uniform
|
||||||
|
' ruoto a seconda dell'aspetto della pagina
|
||||||
|
'If (dH > dW And nImgH < nImgW) Or (dH < dW And nImgH > nImgW) Then
|
||||||
|
' tmpImg.LayoutTransform = New RotateTransform(-90)
|
||||||
|
'End If
|
||||||
|
tmpImg.EndInit()
|
||||||
|
' eseguo la stampa
|
||||||
|
printDlg.PrintVisual(tmpImg, "Parts Layout")
|
||||||
|
Catch
|
||||||
|
' Rrror in executing print
|
||||||
|
EgtOutLog(EgtMsg(50182))
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' PrintCommand
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
<!--Prima Colonna quarta riga - Lista Materiali-->
|
<!--Prima Colonna quarta riga - Lista Materiali-->
|
||||||
<GroupBox Header="{Binding MaterialsMsg}" Grid.Column="0"
|
<GroupBox Header="{Binding MaterialsMsg}" Grid.Column="0"
|
||||||
Grid.Row="3" Grid.RowSpan="5">
|
Grid.Row="3" Grid.RowSpan="5" Visibility="{Binding Materials_Visibility}">
|
||||||
|
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<!--Parametri taglio lama-->
|
<!--Parametri taglio lama-->
|
||||||
<GroupBox Header="{Binding SawParamMsg}">
|
<GroupBox Header="{Binding SawParamMsg}" Visibility="{Binding SawParam_Visibility}">
|
||||||
<UniformGrid Columns="2" >
|
<UniformGrid Columns="2" >
|
||||||
|
|
||||||
<TextBlock Text="{Binding CutExtraLenMsg}"
|
<TextBlock Text="{Binding CutExtraLenMsg}"
|
||||||
@@ -171,7 +171,7 @@
|
|||||||
<GroupBox Header="{Binding MillingParamMsg}" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2">
|
<GroupBox Header="{Binding MillingParamMsg}" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2">
|
||||||
<UniformGrid Rows="3">
|
<UniformGrid Rows="3">
|
||||||
|
|
||||||
<Grid>
|
<Grid Visibility="{Binding MillingParam_Visibility}">
|
||||||
<TextBlock Text="{Binding CornerCutsMsg}"
|
<TextBlock Text="{Binding CornerCutsMsg}"
|
||||||
Style="{StaticResource OptionTextBlock}"/>
|
Style="{StaticResource OptionTextBlock}"/>
|
||||||
<CheckBox IsChecked="{Binding CornerCuts}"
|
<CheckBox IsChecked="{Binding CornerCuts}"
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
<CheckBox IsChecked="{Binding InternalCuts}"
|
<CheckBox IsChecked="{Binding InternalCuts}"
|
||||||
Style="{StaticResource OptionCheckBox}"/>
|
Style="{StaticResource OptionCheckBox}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<UniformGrid Columns="2">
|
<UniformGrid Columns="2" Visibility="{Binding MillingParam_Visibility}">
|
||||||
<TextBlock Text="{Binding ShortMsg}"
|
<TextBlock Text="{Binding ShortMsg}"
|
||||||
Style="{StaticResource OptionTextBlock}"/>
|
Style="{StaticResource OptionTextBlock}"/>
|
||||||
<EgtWPFLib5:EgtTextBox Text="{Binding ShortCut}"/>
|
<EgtWPFLib5:EgtTextBox Text="{Binding ShortCut}"/>
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<!--Nesting-->
|
<!--Nesting-->
|
||||||
<GroupBox Header="{Binding NestingParamMsg}" Grid.Column="1" Grid.Row="3" Grid.RowSpan="2">
|
<GroupBox Header="{Binding NestingParamMsg}" Grid.Column="1" Grid.Row="3" Grid.RowSpan="2">
|
||||||
<UniformGrid Columns="2" >
|
<UniformGrid Columns="2" >
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Public Class MachOptionWindowVM
|
|||||||
|
|
||||||
Public Property HolesOffset As String
|
Public Property HolesOffset As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(CurrentMachine.dHolesOffset, -2)
|
Return LenToString(CurrentMachine.dHolesOffset, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dHolesOffset As Double = 0
|
Dim dHolesOffset As Double = 0
|
||||||
@@ -45,7 +45,7 @@ Public Class MachOptionWindowVM
|
|||||||
|
|
||||||
Public Property HolesOverlap As String
|
Public Property HolesOverlap As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(CurrentMachine.dHolesOverlap, -2)
|
Return LenToString(CurrentMachine.dHolesOverlap, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dHolesOverlap As Double = 0
|
Dim dHolesOverlap As Double = 0
|
||||||
@@ -57,7 +57,7 @@ Public Class MachOptionWindowVM
|
|||||||
|
|
||||||
Public Property HolesTolerance As String
|
Public Property HolesTolerance As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(CurrentMachine.dHolesTolerance, -2)
|
Return LenToString(CurrentMachine.dHolesTolerance, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dHolesTolerance As Double = 0
|
Dim dHolesTolerance As Double = 0
|
||||||
@@ -82,7 +82,7 @@ Public Class MachOptionWindowVM
|
|||||||
|
|
||||||
Public Property CutExtraLen As String
|
Public Property CutExtraLen As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(CurrentMachine.dCutExtraLen, -2)
|
Return LenToString(CurrentMachine.dCutExtraLen, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dCutExtraLen As Double = 0
|
Dim dCutExtraLen As Double = 0
|
||||||
@@ -94,7 +94,7 @@ Public Class MachOptionWindowVM
|
|||||||
|
|
||||||
Public Property AngleCutExtraLen As String
|
Public Property AngleCutExtraLen As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(CurrentMachine.dAngleCutExtraLen, -2)
|
Return LenToString(CurrentMachine.dAngleCutExtraLen, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dAngleCutExtraLen As Double = 0
|
Dim dAngleCutExtraLen As Double = 0
|
||||||
@@ -106,7 +106,7 @@ Public Class MachOptionWindowVM
|
|||||||
|
|
||||||
Public Property ExtArcMinRad As String
|
Public Property ExtArcMinRad As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(CurrentMachine.dExtArcMinRad, -2)
|
Return LenToString(CurrentMachine.dExtArcMinRad, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dExtArcMinRad As Double = 0
|
Dim dExtArcMinRad As Double = 0
|
||||||
@@ -118,7 +118,7 @@ Public Class MachOptionWindowVM
|
|||||||
|
|
||||||
Public Property IntArcMaxSideAng As String
|
Public Property IntArcMaxSideAng As String
|
||||||
Get
|
Get
|
||||||
Return DoubleToString(CurrentMachine.dIntArcMaxSideAng, -2)
|
Return DoubleToString(CurrentMachine.dIntArcMaxSideAng, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dIntArcMaxSideAng As Double = 0
|
Dim dIntArcMaxSideAng As Double = 0
|
||||||
@@ -144,13 +144,24 @@ Public Class MachOptionWindowVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
#End Region ' Saw Param
|
||||||
|
|
||||||
#Region "Machine Param"
|
#Region "Machine Param"
|
||||||
|
|
||||||
Public Property SafeZ As String
|
Public Property SafeZ As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(CurrentMachine.dSafeZ, -2)
|
Return LenToString(CurrentMachine.dSafeZ, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dSafeZ As Double = 0
|
Dim dSafeZ As Double = 0
|
||||||
@@ -184,7 +195,7 @@ Public Class MachOptionWindowVM
|
|||||||
|
|
||||||
Public Property ShortCut As String
|
Public Property ShortCut As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(CurrentMachine.dShortCut, -2)
|
Return LenToString(CurrentMachine.dShortCut, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dShortCut As Double = 0
|
Dim dShortCut As Double = 0
|
||||||
@@ -194,6 +205,16 @@ Public Class MachOptionWindowVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
#End Region ' Milling Param
|
||||||
|
|
||||||
#Region "Nesting Param"
|
#Region "Nesting Param"
|
||||||
@@ -264,7 +285,7 @@ Public Class MachOptionWindowVM
|
|||||||
|
|
||||||
Public Property AdditionalTable As String
|
Public Property AdditionalTable As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(CurrentMachine.dAdditionalTable, -2)
|
Return LenToString(CurrentMachine.dAdditionalTable, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dAdditionalTable As Double = 0
|
Dim dAdditionalTable As Double = 0
|
||||||
@@ -382,6 +403,12 @@ Public Class MachOptionWindowVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
#End Region ' Material
|
||||||
|
|
||||||
' Definizione comandi
|
' Definizione comandi
|
||||||
@@ -469,7 +496,11 @@ Public Class MachOptionWindowVM
|
|||||||
End Property
|
End Property
|
||||||
Public ReadOnly Property MillingParamMsg As String
|
Public ReadOnly Property MillingParamMsg As String
|
||||||
Get
|
Get
|
||||||
Return EgtMsg(MSG_ALARMSPAGEUC + 29)
|
If bWaterJet Then
|
||||||
|
Return EgtMsg(91058)
|
||||||
|
Else
|
||||||
|
Return EgtMsg(MSG_ALARMSPAGEUC + 29)
|
||||||
|
End If
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Public ReadOnly Property CornerCutsMsg As String
|
Public ReadOnly Property CornerCutsMsg As String
|
||||||
|
|||||||
@@ -13,14 +13,17 @@
|
|||||||
Height="20" Width="150"/>-->
|
Height="20" Width="150"/>-->
|
||||||
|
|
||||||
<Button Command="{Binding ToolDbCommand}" ToolTip="{Binding ToolDBToolTip}"
|
<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}"
|
<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}"
|
<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}"/>
|
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}">
|
<Button Command="{Binding MachOptionsCommand}" ToolTip="{Binding OptionsToolTip}">
|
||||||
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
|
||||||
</EgtFloating:EgtFloatingPanel>
|
</EgtFloating:EgtFloatingPanel>
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ Public Class MyMachinePanelVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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"
|
#Region "Messages"
|
||||||
|
|
||||||
Public ReadOnly Property ToolDBMsg As String
|
Public ReadOnly Property ToolDBMsg As String
|
||||||
@@ -39,6 +45,11 @@ Public Class MyMachinePanelVM
|
|||||||
Return EgtMsg(MSG_ALARMSPAGEUC + 33)
|
Return EgtMsg(MSG_ALARMSPAGEUC + 33)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Public ReadOnly Property WaterjetDbMsg As String
|
||||||
|
Get
|
||||||
|
Return "DB WaterJet" 'EgtMsg(MSG_MACHINEPAGEUC + 7)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
#End Region ' Messages
|
#End Region ' Messages
|
||||||
|
|
||||||
@@ -59,6 +70,11 @@ Public Class MyMachinePanelVM
|
|||||||
Return "SetUp"
|
Return "SetUp"
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Public ReadOnly Property WaterjetDbToolTip As String
|
||||||
|
Get
|
||||||
|
Return "Waterjet DB"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
#End Region ' ToolTip
|
#End Region ' ToolTip
|
||||||
|
|
||||||
@@ -67,6 +83,7 @@ Public Class MyMachinePanelVM
|
|||||||
Private m_cmdMachDb As ICommand
|
Private m_cmdMachDb As ICommand
|
||||||
Private m_cmdSetUp As ICommand
|
Private m_cmdSetUp As ICommand
|
||||||
Private m_cmdMachOptions As ICommand
|
Private m_cmdMachOptions As ICommand
|
||||||
|
Private m_cmdWaterjetDb As ICommand
|
||||||
|
|
||||||
#End Region 'FIELDS & PROPERTIES
|
#End Region 'FIELDS & PROPERTIES
|
||||||
|
|
||||||
@@ -78,16 +95,19 @@ Public Class MyMachinePanelVM
|
|||||||
OmagOFFICEMap.SetRefMachinePanelVM(Me)
|
OmagOFFICEMap.SetRefMachinePanelVM(Me)
|
||||||
' recupero cartella radice delle macchine
|
' recupero cartella radice delle macchine
|
||||||
m_sMachinesRoot = OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot
|
m_sMachinesRoot = OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot
|
||||||
' Carica macchine da cartella delle macchine
|
|
||||||
Machine.MachineListInit(m_sMachinesRoot, MachineList)
|
|
||||||
' Inizializzo valori visibilità parametri Db utensili e lavorazioni
|
|
||||||
OmagOFFICETMDbParamVisibility.Init()
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
|
|
||||||
#Region "METHODS"
|
#Region "METHODS"
|
||||||
|
|
||||||
|
Public Sub Init( sMchRoots As String)
|
||||||
|
' procedo ad inizializzare la classe → carico la lista "MachineList" che visualizzo per l'inserimento di nuovi MachGroup
|
||||||
|
Machine.MachineListInit(sMchRoots, MachineList)
|
||||||
|
' Inizializzo valori visibilità parametri Db utensili e lavorazioni
|
||||||
|
OmagOFFICETMDbParamVisibility.Init()
|
||||||
|
End Sub
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
@@ -300,6 +320,33 @@ Public Class MyMachinePanelVM
|
|||||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||||
End Sub
|
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 Region ' METHODS
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -86,13 +86,29 @@ Public Class MainWindowM
|
|||||||
Return m_sTempDir
|
Return m_sTempDir
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'------------------INIZIO Gestione elenco direttori macchine ------------------
|
||||||
|
|
||||||
|
Private m_sMachinesRootList As New List(Of String)
|
||||||
|
Friend ReadOnly Property sMachinesRootList As List(Of String)
|
||||||
|
Get
|
||||||
|
Return m_sMachinesRootList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
'------------------FINE Gestione elenco direttori macchine ------------------
|
||||||
|
|
||||||
Private m_sMachinesRoot As String
|
Private m_sMachinesRoot As String
|
||||||
Friend ReadOnly Property sMachinesRoot As String
|
Friend Property sMachinesRoot As String
|
||||||
Get
|
Get
|
||||||
Return m_sMachinesRoot
|
Return m_sMachinesRoot
|
||||||
End Get
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sMachinesRoot = value
|
||||||
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Private m_sToolMakersDir As String
|
Private m_sToolMakersDir As String
|
||||||
|
|
||||||
Friend ReadOnly Property sToolMakersDir As String
|
Friend ReadOnly Property sToolMakersDir As String
|
||||||
Get
|
Get
|
||||||
Return m_sToolMakersDir
|
Return m_sToolMakersDir
|
||||||
@@ -168,10 +184,20 @@ Public Class MainWindowM
|
|||||||
Directory.CreateDirectory(m_sBackUpDir)
|
Directory.CreateDirectory(m_sBackUpDir)
|
||||||
' Impostazione path resources dir
|
' Impostazione path resources dir
|
||||||
m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
|
m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
|
||||||
' Impostazione direttorio per le macchine
|
Dim nIndexDir As Integer = 1
|
||||||
|
Dim sCurrMachineDir As String = String.Empty
|
||||||
|
While GetMainPrivateProfileString(S_MACH, K_MACHINESDIR & nIndexDir.ToString, "", sCurrMachineDir) <> 0
|
||||||
|
If VerifyMachineIsUnique(sCurrMachineDir) Then
|
||||||
|
m_sMachinesRootList.Add(sCurrMachineDir)
|
||||||
|
End If
|
||||||
|
nIndexDir += 1
|
||||||
|
End While
|
||||||
|
' Impostazione direttorio (versioni precedenti 2.4i2) per le macchine
|
||||||
If GetMainPrivateProfileString(S_MACH, K_MACHINESDIR, "", m_sMachinesRoot) = 0 Then
|
If GetMainPrivateProfileString(S_MACH, K_MACHINESDIR, "", m_sMachinesRoot) = 0 Then
|
||||||
m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
|
m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
|
||||||
End If
|
End If
|
||||||
|
' Carico il direttorio nell'elenco dei direttori macchina
|
||||||
|
If Not String.IsNullOrEmpty(m_sMachinesRoot) Then m_sMachinesRootList.Add(m_sMachinesRoot)
|
||||||
' Impostazione direttorio per toolmakers
|
' Impostazione direttorio per toolmakers
|
||||||
If GetMainPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", m_sToolMakersDir) = 0 Then
|
If GetMainPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", m_sToolMakersDir) = 0 Then
|
||||||
m_sToolMakersDir = m_sDataRoot & "\" & TOOLMAKERS_DFL_DIR
|
m_sToolMakersDir = m_sDataRoot & "\" & TOOLMAKERS_DFL_DIR
|
||||||
@@ -192,11 +218,13 @@ Public Class MainWindowM
|
|||||||
Dim sNestKey As String = ""
|
Dim sNestKey As String = ""
|
||||||
EgtUILib.GetPrivateProfileString( S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
EgtUILib.GetPrivateProfileString( S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
||||||
EgtSetNestKey( sNestKey)
|
EgtSetNestKey( sNestKey)
|
||||||
|
Dim bNetHwKey As Boolean = ( GetMainPrivateProfileInt(S_GENERAL, K_NETKEY, 0) = 1)
|
||||||
|
EgtSetNetHwKey( bNetHwKey)
|
||||||
' Verifico abilitazione nesting automatico
|
' Verifico abilitazione nesting automatico
|
||||||
m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey)
|
m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey)
|
||||||
' Recupero livello e opzioni della chiave
|
' Recupero livello e opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2309, 1, m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2502, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(9423, 2309, 1, m_nKeyOptions)
|
EgtGetKeyOptions(9423, 2502, 1, m_nKeyOptions)
|
||||||
' Verifico abilitazione prodotto
|
' Verifico abilitazione prodotto
|
||||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
|
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
|
||||||
' Inizializzazione generale di EgtInterface
|
' Inizializzazione generale di EgtInterface
|
||||||
@@ -267,12 +295,26 @@ Public Class MainWindowM
|
|||||||
EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString() & " " & bProd.ToString())
|
EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString() & " " & bProd.ToString())
|
||||||
EgtPHOTOLib.MainData.SetConfigDir(m_sConfigDir)
|
EgtPHOTOLib.MainData.SetConfigDir(m_sConfigDir)
|
||||||
EgtPHOTOLib.MainData.SetKeyLevel(m_nKeyLevel)
|
EgtPHOTOLib.MainData.SetKeyLevel(m_nKeyLevel)
|
||||||
EgtPHOTOLib.MainData.SetKeyOptions( CInt( m_nKeyOptions))
|
EgtPHOTOLib.MainData.SetKeyOptions(CInt(m_nKeyOptions))
|
||||||
EgtPHOTOLib.MainData.SetPhotoDir(m_sPhotoDir)
|
EgtPHOTOLib.MainData.SetPhotoDir(m_sPhotoDir)
|
||||||
EgtPHOTOLib.MainData.SetBackUpDir(m_sBackUpDir)
|
EgtPHOTOLib.MainData.SetBackUpDir(m_sBackUpDir)
|
||||||
EgtPHOTOLib.MainData.SetIsOmagOFFICE(True)
|
EgtPHOTOLib.MainData.SetIsOmagOFFICE(True)
|
||||||
|
EgtPHOTOLib.MainData.SetUser(Environment.MachineName & "\" & Environment.UserName & " (" & nInstance.ToString() & ")")
|
||||||
|
Dim sIdKey As String = String.Empty
|
||||||
|
EgtGetKeyInfo(sIdKey)
|
||||||
|
EgtPHOTOLib.MainData.SetKey(sIdKey)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' verifico che il nome da inserire non esista già in elenco
|
||||||
|
Private Function VerifyMachineIsUnique(sMachDir As String) As Boolean
|
||||||
|
For Each sDir As String In m_sMachinesRootList
|
||||||
|
If String.Compare( sDir.Trim().TrimEnd("\"c), sMachDir.Trim().TrimEnd("\"c), True) = 0 Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Sub ManageInstance()
|
Private Sub ManageInstance()
|
||||||
Dim bCreated As Boolean
|
Dim bCreated As Boolean
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ Imports System.Windows
|
|||||||
<Assembly: AssemblyDescription("OmagOFFICE 32 bit")>
|
<Assembly: AssemblyDescription("OmagOFFICE 32 bit")>
|
||||||
#End If
|
#End If
|
||||||
#End If
|
#End If
|
||||||
<Assembly: AssemblyCompany("EgalTech s.r.l.")>
|
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyProduct("OmagOFFICE")>
|
<Assembly: AssemblyProduct("OmagOFFICE")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2017-2021 by EgalTech s.r.l.")>
|
<Assembly: AssemblyCopyright("Copyright © 2017-2023 by Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("")>
|
||||||
<Assembly: ComVisible(false)>
|
<Assembly: ComVisible(false)>
|
||||||
'In order to begin building localizable applications, set
|
'In order to begin building localizable applications, set
|
||||||
@@ -69,6 +69,6 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.3.10.1")>
|
<Assembly: AssemblyVersion("2.5.2.1")>
|
||||||
<Assembly: AssemblyFileVersion("2.3.10.1")>
|
<Assembly: AssemblyFileVersion("2.5.2.1")>
|
||||||
|
|
||||||
|
|||||||
@@ -33,19 +33,22 @@ Public Class MyMachGroupPanelVM
|
|||||||
|
|
||||||
Sub New()
|
Sub New()
|
||||||
MyBase.New()
|
MyBase.New()
|
||||||
' Recupero la macchina di default
|
|
||||||
Dim sDefaultMachine As String = String.Empty
|
|
||||||
GetMainPrivateProfileString(S_MACH, K_CURRMACH, "", sDefaultMachine)
|
|
||||||
' Creo riferimento a questa classe in OmagOFFICEMap
|
' Creo riferimento a questa classe in OmagOFFICEMap
|
||||||
OmagOFFICEMap.SetRefMachGroupPanelVM(Me)
|
OmagOFFICEMap.SetRefMachGroupPanelVM(Me)
|
||||||
InitMachGroupPanel(True, OmagOFFICEMap.refMachinePanelVM.MachineList.ToList(),
|
|
||||||
sDefaultMachine, BASE_MACH_GROUP & "1")
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
|
|
||||||
#Region "METHODS"
|
#Region "METHODS"
|
||||||
|
|
||||||
|
Public Sub Init()
|
||||||
|
' Recupero la macchina di default
|
||||||
|
Dim sDefaultMachine As String = String.Empty
|
||||||
|
GetMainPrivateProfileString(S_MACH, K_CURRMACH, "", sDefaultMachine)
|
||||||
|
EgtSetCurrMachine(sDefaultMachine)
|
||||||
|
InitMachGroupPanel(True, OmagOFFICEMap.refMachinePanelVM.MachineList.ToList(), sDefaultMachine, BASE_MACH_GROUP & "1")
|
||||||
|
End Sub
|
||||||
|
|
||||||
Public Overrides Sub AddMachGroup()
|
Public Overrides Sub AddMachGroup()
|
||||||
If NewMachGroup() Then
|
If NewMachGroup() Then
|
||||||
' creo oggetto gruppo creato
|
' creo oggetto gruppo creato
|
||||||
@@ -71,7 +74,9 @@ Public Class MyMachGroupPanelVM
|
|||||||
Dim sMachine As String = String.Empty
|
Dim sMachine As String = String.Empty
|
||||||
EgtGetMachGroupName(nId, sName)
|
EgtGetMachGroupName(nId, sName)
|
||||||
EgtGetMachGroupMachineName(nId, sMachine)
|
EgtGetMachGroupMachineName(nId, sMachine)
|
||||||
MachGroupList.Add(New MyMachGroup(nId, sName, sMachine, EgtGetFirstNameInGroup(nId, "Opers")))
|
Dim NewMyMachGoup As MyMachGroup = New MyMachGroup(nId, sName, sMachine, EgtGetFirstNameInGroup(nId, "Opers"))
|
||||||
|
NewMyMachGoup.IsValid = VerifyMachExists(sMachine)
|
||||||
|
MachGroupList.Add(NewMyMachGoup)
|
||||||
If OmagOFFICEMap.refMainWindowVM.MainWindowM.m_SlabDB Then
|
If OmagOFFICEMap.refMainWindowVM.MainWindowM.m_SlabDB Then
|
||||||
Dim sSlabNameDB As String = String.Empty
|
Dim sSlabNameDB As String = String.Empty
|
||||||
EgtGetInfo(nId, INFO_SLABNAME, sSlabNameDB)
|
EgtGetInfo(nId, INFO_SLABNAME, sSlabNameDB)
|
||||||
@@ -99,6 +104,8 @@ Public Class MyMachGroupPanelVM
|
|||||||
' Salvo macchina del gruppo come nuovo default
|
' Salvo macchina del gruppo come nuovo default
|
||||||
Dim sCurrMachName As String = String.Empty
|
Dim sCurrMachName As String = String.Empty
|
||||||
EgtGetCurrMachineName(sCurrMachName)
|
EgtGetCurrMachineName(sCurrMachName)
|
||||||
|
CurrentMachine.GetMachineClass(sCurrMachName)
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
|
||||||
WriteMainPrivateProfileString(S_MACH, K_CURRMACH, sCurrMachName)
|
WriteMainPrivateProfileString(S_MACH, K_CURRMACH, sCurrMachName)
|
||||||
' Ricarico la macchina corrente
|
' Ricarico la macchina corrente
|
||||||
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, sCurrMachName,
|
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, sCurrMachName,
|
||||||
@@ -111,7 +118,7 @@ Public Class MyMachGroupPanelVM
|
|||||||
Dim nTabInd As Integer = 1
|
Dim nTabInd As Integer = 1
|
||||||
Dim nTabCnt As Integer = CamAuto.GetTableCount()
|
Dim nTabCnt As Integer = CamAuto.GetTableCount()
|
||||||
If nTabCnt > 1 And nTabCnt <= 3 Then
|
If nTabCnt > 1 And nTabCnt <= 3 Then
|
||||||
Dim dlg As New SelectTableWindowV(Application.Current.MainWindow, New SelectTableWindowVM(nTabCnt))
|
Dim dlg As New SelectTableWindowV(Application.Current.MainWindow, New SelectTableWindowVM(DirectCast(nTabCnt, SelectTableWindowVM.TableNumOpt)))
|
||||||
dlg.ShowDialog()
|
dlg.ShowDialog()
|
||||||
nTabInd = dlg.m_SelTable
|
nTabInd = dlg.m_SelTable
|
||||||
End If
|
End If
|
||||||
@@ -152,6 +159,9 @@ Public Class MyMachGroupPanelVM
|
|||||||
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
|
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
|
||||||
' Imposto vista solo tavola
|
' Imposto vista solo tavola
|
||||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||||
|
CurrentMachine.GetMachineClass(SelectedMachGroup.Machine)
|
||||||
|
If IsNothing(OmagOFFICEMap.refMachinePanelVM.SelectedMachine) Then Return False
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
|
||||||
' Ricarico la macchina corrente
|
' Ricarico la macchina corrente
|
||||||
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, SelectedMachGroup.Machine,
|
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, SelectedMachGroup.Machine,
|
||||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
|
||||||
@@ -248,6 +258,10 @@ Public Class MyMachGroupPanelVM
|
|||||||
' aggiungo alla lista delle lastre correnti/orig
|
' aggiungo alla lista delle lastre correnti/orig
|
||||||
Dim sSlabNameDB As String = GetSlabName()
|
Dim sSlabNameDB As String = GetSlabName()
|
||||||
LoadSlabsList(sSlabNameDB)
|
LoadSlabsList(sSlabNameDB)
|
||||||
|
|
||||||
|
' imposto la visibilità dei comandi per il waterjet
|
||||||
|
OmagOFFICEMap.refNestingTabVM.Set_WJ_Cmd_Visibility()
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,15 @@ Public Class MySceneHostVM
|
|||||||
' Recupero e imposto handle finestra principale
|
' Recupero e imposto handle finestra principale
|
||||||
Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
|
Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
|
||||||
EgtSetMainWindowHandle(hMainWnd)
|
EgtSetMainWindowHandle(hMainWnd)
|
||||||
|
' Recupero l'elenco dei direttori radice macchina come stringa del tipo "..\Dir1\Example01|..\Dir2\|Example02"
|
||||||
|
Dim sMchRoots As String = GetMachineBaseDirs()
|
||||||
' inizializzo gestore lavorazioni
|
' inizializzo gestore lavorazioni
|
||||||
EgtInitMachMgr(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
|
If Not EgtInitMachMgr(sMchRoots, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir) Then
|
||||||
|
EgtOutLog("Error on loading machines roots: " & sMchRoots)
|
||||||
|
End If
|
||||||
|
' inizializzo gestione più macchine
|
||||||
|
OmagOFFICEMap.refMachinePanelVM.Init(sMchRoots)
|
||||||
|
OmagOFFICEMap.refMachGroupPanelVM.Init()
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' Problemi
|
' Problemi
|
||||||
@@ -157,6 +164,21 @@ Public Class MySceneHostVM
|
|||||||
MainScene.SetStatusNull()
|
MainScene.SetStatusNull()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function GetMachineBaseDirs() As String
|
||||||
|
' Trasformo l'elenco dei direttori radice macchina in una stringa del tipo "..\Dir1\Example01|..\Dir2\|Example02"
|
||||||
|
Dim sMchRoots As String = ""
|
||||||
|
' Pulisco eventuali caratteri nascosti: origString.Replace(vbCr, "").Replace(vbLf, "")
|
||||||
|
For Each MachDir In OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRootList
|
||||||
|
MachDir = MachDir.Replace(vbCr, "").Replace(vbLf, "")
|
||||||
|
sMchRoots &= MachDir & "|"
|
||||||
|
Next
|
||||||
|
' rimuovo dalla stringa l'ultimo carattere "|" inserito
|
||||||
|
sMchRoots = sMchRoots.Remove(sMchRoots.Length - 1, 1)
|
||||||
|
If String.IsNullOrEmpty(sMchRoots) Then sMchRoots = OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot
|
||||||
|
EgtOutLog("Machine root list: " & sMchRoots)
|
||||||
|
Return sMchRoots
|
||||||
|
End Function
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|
||||||
#Region "ProjectManager"
|
#Region "ProjectManager"
|
||||||
@@ -223,6 +245,8 @@ Public Class MySceneHostVM
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ExecExport(sDirDest As String) As Boolean
|
Private Function ExecExport(sDirDest As String) As Boolean
|
||||||
|
' salvo il nome della macchina correntemente selezionata
|
||||||
|
Dim CurrentSelectedMachGroup As String = OmagOFFICEMap.refMachGroupPanelVM.SelectedMachGroup.Machine
|
||||||
' Path completa del progetto corrente
|
' Path completa del progetto corrente
|
||||||
Dim sFilePath As String = String.Empty
|
Dim sFilePath As String = String.Empty
|
||||||
EgtGetCurrFilePath(sFilePath)
|
EgtGetCurrFilePath(sFilePath)
|
||||||
@@ -238,7 +262,9 @@ Public Class MySceneHostVM
|
|||||||
' Creo un contesto separato con gestore lavorazioni per poter spezzettare il progetto
|
' Creo un contesto separato con gestore lavorazioni per poter spezzettare il progetto
|
||||||
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
||||||
Dim nCtx As Integer = EgtInitContext()
|
Dim nCtx As Integer = EgtInitContext()
|
||||||
EgtInitMachMgr(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
|
' Recupero l'elenco dei direttori radice macchina come stringa del tipo "..\Dir1\Example01|..\Dir2\|Example02"
|
||||||
|
Dim sMchRoots As String = GetMachineBaseDirs()
|
||||||
|
EgtInitMachMgr(sMchRoots, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
|
||||||
' Per ogni gruppo di lavoro
|
' Per ogni gruppo di lavoro
|
||||||
For Each nMchGrpId As Integer In vMchGrps
|
For Each nMchGrpId As Integer In vMchGrps
|
||||||
' Carico il progetto
|
' Carico il progetto
|
||||||
@@ -282,9 +308,10 @@ Public Class MySceneHostVM
|
|||||||
File.Copy(sOriPath, sNewPath, True)
|
File.Copy(sOriPath, sNewPath, True)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
bOk = False
|
bOk = False
|
||||||
EgtOutLog( "Slab image not found :" & sOriPath)
|
EgtOutLog("Slab image not found :" & sOriPath)
|
||||||
End Try
|
End Try
|
||||||
EgtSetName(nPhotoId, PHOTO_NAME)
|
EgtSetName(nPhotoId, PHOTO_NAME)
|
||||||
|
EgtChangePhotoCenterAsFlatScan(nPhotoId)
|
||||||
End If
|
End If
|
||||||
' Elimino gli altri gruppi di lavorazioni
|
' Elimino gli altri gruppi di lavorazioni
|
||||||
For Each nMGrpId As Integer In vMchGrps
|
For Each nMGrpId As Integer In vMchGrps
|
||||||
@@ -307,6 +334,27 @@ Public Class MySceneHostVM
|
|||||||
Dim nMarkId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
Dim nMarkId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
EgtSetName(nMarkId, NAME_PROJMARK)
|
EgtSetName(nMarkId, NAME_PROJMARK)
|
||||||
EgtSetLevel(nMarkId, GDB_LV.SYSTEM)
|
EgtSetLevel(nMarkId, GDB_LV.SYSTEM)
|
||||||
|
' Imposto la macchina: salvo l'altezza della sovratavola
|
||||||
|
Dim sMachine As String = String.Empty
|
||||||
|
EgtGetInfo(nMchGrpId, "Machine", sMachine)
|
||||||
|
If Not String.IsNullOrEmpty(sMachine) Then
|
||||||
|
CurrentMachine.GetMachineClass(sMachine)
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
|
||||||
|
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, sMachine,
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_MILL),
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_POLISHING),
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_WJ),
|
||||||
|
True)
|
||||||
|
Select Case GetCurrentTable()
|
||||||
|
Case 3
|
||||||
|
EgtSetInfo(nMarkId, K_TAB3_ADDITIONALTABLE, CurrentMachine.dAdditionalTable)
|
||||||
|
Case 2
|
||||||
|
EgtSetInfo(nMarkId, K_TAB2_ADDITIONALTABLE, CurrentMachine.dAdditionalTable)
|
||||||
|
Case Else
|
||||||
|
EgtSetInfo(nMarkId, K_ADDITIONALTABLE, CurrentMachine.dAdditionalTable)
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
Dim nReducedCut As Integer = 1
|
Dim nReducedCut As Integer = 1
|
||||||
EgtGetInfo(nMchGrpId, INFO_REDUCEDCUT, nReducedCut)
|
EgtGetInfo(nMchGrpId, INFO_REDUCEDCUT, nReducedCut)
|
||||||
EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut)
|
EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut)
|
||||||
@@ -325,6 +373,15 @@ Public Class MySceneHostVM
|
|||||||
' Salvo il file
|
' Salvo il file
|
||||||
If Not EgtSaveFile(sFileDest, NGE.CMPTEXT) Then bOk = False
|
If Not EgtSaveFile(sFileDest, NGE.CMPTEXT) Then bOk = False
|
||||||
Next
|
Next
|
||||||
|
CurrentMachine.GetMachineClass(CurrentSelectedMachGroup)
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
|
||||||
|
' reimposto la macchina corrente
|
||||||
|
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, CurrentSelectedMachGroup,
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_MILL),
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_POLISHING),
|
||||||
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_WJ),
|
||||||
|
True)
|
||||||
' Distruggo il contesto corrente e ripristino quello originale
|
' Distruggo il contesto corrente e ripristino quello originale
|
||||||
EgtSetCurrentContext(nCurrCtx)
|
EgtSetCurrentContext(nCurrCtx)
|
||||||
EgtDeleteContext(nCtx)
|
EgtDeleteContext(nCtx)
|
||||||
@@ -375,7 +432,9 @@ Public Class MySceneHostVM
|
|||||||
' Creo un contesto separato con gestore lavorazioni per poter spezzettare il progetto
|
' Creo un contesto separato con gestore lavorazioni per poter spezzettare il progetto
|
||||||
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
||||||
Dim nCtx As Integer = EgtInitContext()
|
Dim nCtx As Integer = EgtInitContext()
|
||||||
EgtInitMachMgr(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
|
' Recupero l'elenco dei direttori radice macchina come stringa del tipo "..\Dir1\Example01|..\Dir2\|Example02"
|
||||||
|
Dim sMchRoots As String = GetMachineBaseDirs()
|
||||||
|
EgtInitMachMgr(sMchRoots, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
|
||||||
' Per ogni gruppo di lavoro
|
' Per ogni gruppo di lavoro
|
||||||
For Each nMchGrpId As Integer In vMchGrps
|
For Each nMchGrpId As Integer In vMchGrps
|
||||||
' Carico il progetto
|
' Carico il progetto
|
||||||
@@ -743,6 +802,7 @@ Public Class MySceneHostVM
|
|||||||
Case OptionPanelVM.Tabs.NESTING
|
Case OptionPanelVM.Tabs.NESTING
|
||||||
OmagOFFICEMap.refNestingTabVM.OnMouseMoveScene(sender, e)
|
OmagOFFICEMap.refNestingTabVM.OnMouseMoveScene(sender, e)
|
||||||
Case OptionPanelVM.Tabs.MACHINING
|
Case OptionPanelVM.Tabs.MACHINING
|
||||||
|
OmagOFFICEMap.refSplitModeVM.OnMyMouseMoveScene(sender, e)
|
||||||
Case OptionPanelVM.Tabs.SIMUL
|
Case OptionPanelVM.Tabs.SIMUL
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
@@ -755,6 +815,7 @@ Public Class MySceneHostVM
|
|||||||
Case OptionPanelVM.Tabs.NESTING
|
Case OptionPanelVM.Tabs.NESTING
|
||||||
OmagOFFICEMap.refNestingTabVM.OnMouseUpScene(sender, e)
|
OmagOFFICEMap.refNestingTabVM.OnMouseUpScene(sender, e)
|
||||||
Case OptionPanelVM.Tabs.MACHINING
|
Case OptionPanelVM.Tabs.MACHINING
|
||||||
|
OmagOFFICEMap.refSplitModeVM.OnMyMouseUpScene(sender, e)
|
||||||
Case OptionPanelVM.Tabs.SIMUL
|
Case OptionPanelVM.Tabs.SIMUL
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
@@ -766,6 +827,7 @@ Public Class MySceneHostVM
|
|||||||
Case OptionPanelVM.Tabs.NESTING
|
Case OptionPanelVM.Tabs.NESTING
|
||||||
OmagOFFICEMap.refNestingTabVM.OnKeyDownScene(sender, e)
|
OmagOFFICEMap.refNestingTabVM.OnKeyDownScene(sender, e)
|
||||||
Case OptionPanelVM.Tabs.MACHINING
|
Case OptionPanelVM.Tabs.MACHINING
|
||||||
|
OmagOFFICEMap.refSplitModeVM.OnKeyDownScene(sender, e)
|
||||||
Case OptionPanelVM.Tabs.SIMUL
|
Case OptionPanelVM.Tabs.SIMUL
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -151,6 +151,10 @@
|
|||||||
<Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb">
|
<Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb">
|
||||||
<DependentUpon>AboutBoxV.xaml</DependentUpon>
|
<DependentUpon>AboutBoxV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="AlzAndFront\AlzAndFront.xaml.vb">
|
||||||
|
<DependentUpon>AlzAndFront.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="AlzAndFront\AlzAndFront.vb" />
|
||||||
<Compile Include="CompoCsvTrfDataWindow\CompoCsvDataWindowV.xaml.vb">
|
<Compile Include="CompoCsvTrfDataWindow\CompoCsvDataWindowV.xaml.vb">
|
||||||
<DependentUpon>CompoCsvDataWindowV.xaml</DependentUpon>
|
<DependentUpon>CompoCsvDataWindowV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -209,7 +213,11 @@
|
|||||||
<Compile Include="EgtStoneLib\VeinMatchingWindow.xaml.vb">
|
<Compile Include="EgtStoneLib\VeinMatchingWindow.xaml.vb">
|
||||||
<DependentUpon>VeinMatchingWindow.xaml</DependentUpon>
|
<DependentUpon>VeinMatchingWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="InstrumentPanel\PrintPanelV.xaml.vb">
|
||||||
|
<DependentUpon>PrintPanelV.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="InstrumentPanel\MyInstrumentPanelVM.vb" />
|
<Compile Include="InstrumentPanel\MyInstrumentPanelVM.vb" />
|
||||||
|
<Compile Include="InstrumentPanel\PrintPanelVM.vb" />
|
||||||
<Compile Include="MachinePanel\MyMachinePanelVM.vb" />
|
<Compile Include="MachinePanel\MyMachinePanelVM.vb" />
|
||||||
<Compile Include="MyMachGroupPanel\MyMachGroupPanelVM.vb" />
|
<Compile Include="MyMachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||||
<Compile Include="MachinePanel\MachinePanelV.xaml.vb">
|
<Compile Include="MachinePanel\MachinePanelV.xaml.vb">
|
||||||
@@ -251,6 +259,10 @@
|
|||||||
<DependentUpon>SplitModeV.xaml</DependentUpon>
|
<DependentUpon>SplitModeV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="OptionPanel\MachiningTab\SplitModeVM.vb" />
|
<Compile Include="OptionPanel\MachiningTab\SplitModeVM.vb" />
|
||||||
|
<Compile Include="OptionPanel\NestingTab\MultiSelectionV.xaml.vb">
|
||||||
|
<DependentUpon>MultiSelectionV.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OptionPanel\NestingTab\MultiSelectionVM.vb" />
|
||||||
<Compile Include="OptionPanel\NestingTab\NestingTabV.xaml.vb">
|
<Compile Include="OptionPanel\NestingTab\NestingTabV.xaml.vb">
|
||||||
<DependentUpon>NestingTabV.xaml</DependentUpon>
|
<DependentUpon>NestingTabV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -333,6 +345,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="AlzAndFront\AlzAndFront.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="CompoCsvTrfDataWindow\CompoCsvDataWindowV.xaml">
|
<Page Include="CompoCsvTrfDataWindow\CompoCsvDataWindowV.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -377,6 +393,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="InstrumentPanel\PrintPanelV.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="MachinePanel\MachinePanelV.xaml">
|
<Page Include="MachinePanel\MachinePanelV.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -429,6 +449,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="OptionPanel\NestingTab\MultiSelectionV.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="OptionPanel\NestingTab\NestingTabV.xaml">
|
<Page Include="OptionPanel\NestingTab\NestingTabV.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -675,6 +699,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\TopCommandBar\DxfOut.png" />
|
<Resource Include="Resources\TopCommandBar\DxfOut.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\InstrumentPanel\Print.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe
|
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe
|
||||||
|
|||||||
@@ -224,13 +224,17 @@ Public Class MachiningTabVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub Prev(ByVal param As Object)
|
Public Sub Prev(ByVal param As Object)
|
||||||
|
Dim bOk As Boolean = True
|
||||||
' Dichiaro solo visualizzazione
|
' Dichiaro solo visualizzazione
|
||||||
m_bIsShow = True
|
m_bIsShow = True
|
||||||
If m_MachiningMode = MachiningModeOpt.SPLIT Then
|
If m_MachiningMode = MachiningModeOpt.SPLIT Then
|
||||||
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
|
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
|
||||||
Else
|
Else
|
||||||
OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
|
' verifico collisione dei pezzi in fase di scarico
|
||||||
|
bOk = OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
|
||||||
End If
|
End If
|
||||||
|
' se trovata interferenza tra grezzi (dopo movimentazione) esco
|
||||||
|
If Not bOk Then Return
|
||||||
' Torno alla fase precedente
|
' Torno alla fase precedente
|
||||||
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
|
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
|
||||||
' Si va sempre in Split
|
' Si va sempre in Split
|
||||||
@@ -255,19 +259,22 @@ Public Class MachiningTabVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub NextCmd(ByVal param As Object)
|
Public Sub NextCmd(ByVal param As Object)
|
||||||
|
Dim bOk As Boolean = True
|
||||||
If m_MachiningMode = MachiningModeOpt.SPLIT Then
|
If m_MachiningMode = MachiningModeOpt.SPLIT Then
|
||||||
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
|
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
|
||||||
MachiningMode = MachiningModeOpt.MOVERAWPART
|
MachiningMode = MachiningModeOpt.MOVERAWPART
|
||||||
AutoVisibility = Visibility.Hidden
|
AutoVisibility = Visibility.Hidden
|
||||||
OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
|
bOk = OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
|
||||||
Else
|
Else
|
||||||
OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
|
' se verificata una interferenza allora esco
|
||||||
|
bOk = OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
|
||||||
|
If Not bOk Then Return
|
||||||
MachiningMode = MachiningModeOpt.SPLIT
|
MachiningMode = MachiningModeOpt.SPLIT
|
||||||
AutoVisibility = Visibility.Visible
|
AutoVisibility = Visibility.Visible
|
||||||
OmagOFFICEMap.refSplitModeVM.InitSplitRaw()
|
OmagOFFICEMap.refSplitModeVM.InitSplitRaw()
|
||||||
End If
|
End If
|
||||||
' Aggiorno possibilità di uscire
|
' Se non ci sono interferenze tra i grezzi -> aggiorno possibilità di uscire
|
||||||
ManageExit()
|
If bOk Then ManageExit()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' NextCommand
|
#End Region ' NextCommand
|
||||||
@@ -322,6 +329,8 @@ Public Class MachiningTabVM
|
|||||||
Friend Sub OnMouseDownScene(sender As Object, e As Windows.Forms.MouseEventArgs)
|
Friend Sub OnMouseDownScene(sender As Object, e As Windows.Forms.MouseEventArgs)
|
||||||
If m_MachiningMode = MachiningModeOpt.MOVERAWPART Then
|
If m_MachiningMode = MachiningModeOpt.MOVERAWPART Then
|
||||||
OmagOFFICEMap.refMoveRawModeVM.OnMouseDownScene(sender, e)
|
OmagOFFICEMap.refMoveRawModeVM.OnMouseDownScene(sender, e)
|
||||||
|
ElseIf m_MachiningMode = MachiningModeOpt.SPLIT Then
|
||||||
|
OmagOFFICEMap.refSplitModeVM.OnMouseDownScene(sender, e)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||||
IsMinimizable="False"
|
IsMinimizable="False"
|
||||||
ShowInTaskbar="False"
|
ShowInTaskbar="False"
|
||||||
|
Title="{Binding Title}"
|
||||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||||
Height="200" Width="400"
|
Height="200" Width="400"
|
||||||
WindowStartupLocation="CenterOwner">
|
WindowStartupLocation="CenterOwner">
|
||||||
|
|||||||
@@ -3,6 +3,15 @@ Imports EgtUILib
|
|||||||
|
|
||||||
Public Class ModifStartEndCutWindowVM
|
Public Class ModifStartEndCutWindowVM
|
||||||
|
|
||||||
|
Private m_Title As String = String.Empty
|
||||||
|
Public Property Title As String
|
||||||
|
Get
|
||||||
|
Return m_Title
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_Title = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
Public ReadOnly Property ValueMsg As String
|
Public ReadOnly Property ValueMsg As String
|
||||||
Get
|
Get
|
||||||
Return EgtMsg(MSG_SPLITPAGEUC + 35)
|
Return EgtMsg(MSG_SPLITPAGEUC + 35)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||||
IsMinimizable="False"
|
IsMinimizable="False"
|
||||||
ShowInTaskbar="False"
|
ShowInTaskbar="False"
|
||||||
|
Title="{Binding Title}"
|
||||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||||
Height="400" Width="400"
|
Height="400" Width="400"
|
||||||
WindowStartupLocation="CenterOwner">
|
WindowStartupLocation="CenterOwner">
|
||||||
|
|||||||
@@ -6,6 +6,15 @@ Imports EgtWPFLib5
|
|||||||
Public Class ModifStartEndWjWindowVM
|
Public Class ModifStartEndWjWindowVM
|
||||||
Inherits VMBase
|
Inherits VMBase
|
||||||
|
|
||||||
|
Private m_Title As String = String.Empty
|
||||||
|
Public Property Title As String
|
||||||
|
Get
|
||||||
|
Return m_Title
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_Title = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
Public ReadOnly Property ValueMsg As String
|
Public ReadOnly Property ValueMsg As String
|
||||||
Get
|
Get
|
||||||
Return EgtMsg(MSG_SPLITPAGEUC + 35)
|
Return EgtMsg(MSG_SPLITPAGEUC + 35)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ Public Class MoveRawModeVM
|
|||||||
Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi
|
Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi
|
||||||
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
|
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
|
||||||
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
|
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
|
||||||
|
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL ' identificativo pezzo correntemente attaccato alle ventose
|
||||||
|
|
||||||
Private m_dMoveStep As Double
|
Private m_dMoveStep As Double
|
||||||
Public Property MoveStep As String
|
Public Property MoveStep As String
|
||||||
@@ -108,6 +109,17 @@ Public Class MoveRawModeVM
|
|||||||
#Region "METHODS"
|
#Region "METHODS"
|
||||||
|
|
||||||
Friend Function InitMoveRaw() As Boolean
|
Friend Function InitMoveRaw() As Boolean
|
||||||
|
'' verifico che il pezzo sia depositabile
|
||||||
|
'If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||||
|
' ' mantengo la selezione del pezzo
|
||||||
|
' EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||||
|
' OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
||||||
|
' EgtDraw()
|
||||||
|
' ' non cambio pagina
|
||||||
|
' Return False
|
||||||
|
'End If
|
||||||
|
' resetto l'inidice del pezzo da mnovimentare
|
||||||
|
m_CurrRawOnVacuum = GDB_ID.NULL
|
||||||
' Deseleziono tutto
|
' Deseleziono tutto
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
' Recupero i tagli allungati prima definiti
|
' Recupero i tagli allungati prima definiti
|
||||||
@@ -158,14 +170,14 @@ Public Class MoveRawModeVM
|
|||||||
' Distanza iniziale
|
' Distanza iniziale
|
||||||
m_dCurrDist = 0
|
m_dCurrDist = 0
|
||||||
End If
|
End If
|
||||||
' Non dovrebbe mai accadere, ma inizializzo con default
|
' Non dovrebbe mai accadere, ma inizializzo con default
|
||||||
Else
|
Else
|
||||||
m_vtDir = Vector3d.Y_AX()
|
m_vtDir = Vector3d.Y_AX()
|
||||||
m_ptMid = Point3d.ORIG()
|
m_ptMid = Point3d.ORIG()
|
||||||
m_dOrigDist = 0
|
m_dOrigDist = 0
|
||||||
m_dCurrDist = 0
|
m_dCurrDist = 0
|
||||||
End If
|
End If
|
||||||
' Altrimenti movimento con ventose
|
' Altrimenti movimento con ventose
|
||||||
Else
|
Else
|
||||||
m_bRemovedRaw = False
|
m_bRemovedRaw = False
|
||||||
m_bRawWithCups = False
|
m_bRawWithCups = False
|
||||||
@@ -182,7 +194,7 @@ Public Class MoveRawModeVM
|
|||||||
If OmagOFFICEMap.refMachiningTabVM.ByHand Then
|
If OmagOFFICEMap.refMachiningTabVM.ByHand Then
|
||||||
LRArrowVisibility = Visibility.Hidden
|
LRArrowVisibility = Visibility.Hidden
|
||||||
RotationVisibility = Visibility.Hidden
|
RotationVisibility = Visibility.Hidden
|
||||||
' Altrimenti per movimento con ventose
|
' Altrimenti per movimento con ventose
|
||||||
Else
|
Else
|
||||||
LRArrowVisibility = Visibility.Visible
|
LRArrowVisibility = Visibility.Visible
|
||||||
RotationVisibility = If(CurrentMachine.bRawSplMovRotate, Visibility.Visible, Visibility.Hidden)
|
RotationVisibility = If(CurrentMachine.bRawSplMovRotate, Visibility.Visible, Visibility.Hidden)
|
||||||
@@ -195,6 +207,17 @@ Public Class MoveRawModeVM
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function ExitMoveRaw() As Boolean
|
Friend Function ExitMoveRaw() As Boolean
|
||||||
|
' verifico che il pezzo sia depositabile
|
||||||
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||||
|
' mantengo la selezione del pezzo
|
||||||
|
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
||||||
|
EgtDraw()
|
||||||
|
' non cambio pagina
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
' resetto l'inidice del pezzo da mnovimentare
|
||||||
|
m_CurrRawOnVacuum = GDB_ID.NULL
|
||||||
' Deseleziono tutto
|
' Deseleziono tutto
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
' Se movimento con ventose
|
' Se movimento con ventose
|
||||||
@@ -249,6 +272,141 @@ Public Class MoveRawModeVM
|
|||||||
NotifyPropertyChanged("MoveStep")
|
NotifyPropertyChanged("MoveStep")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' verifica che la posizione di rialascio sia corretta, altrimenti coreggo il vettore di posizione
|
||||||
|
Private Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
' determino il punto finale dello spostamento
|
||||||
|
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
|
||||||
|
ptEndPointLift.x += vtMove.x
|
||||||
|
ptEndPointLift.y += vtMove.y
|
||||||
|
Dim sInfo As String = String.Empty
|
||||||
|
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, VacuumCups.dDegRotStartAng)
|
||||||
|
Case 1
|
||||||
|
' extra corsa sulla x-: devo ridurre del valore di extra corsa
|
||||||
|
EgtGetOutstrokeInfo(sInfo)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||||
|
ptEndPointLift.x -= vtMove.x
|
||||||
|
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
|
||||||
|
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
|
||||||
|
vtMove.x = 0
|
||||||
|
Else
|
||||||
|
vtMove.x -= dMaxMove - EPS_SMALL * 100
|
||||||
|
End If
|
||||||
|
ptEndPointLift.x += vtMove.x
|
||||||
|
bOk = False
|
||||||
|
Case 2
|
||||||
|
' extra corsa sulla x+: devo ridurre del valore di extra corsa
|
||||||
|
EgtGetOutstrokeInfo(sInfo)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||||
|
ptEndPointLift.x -= vtMove.x
|
||||||
|
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
|
||||||
|
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
|
||||||
|
vtMove.x = 0
|
||||||
|
Else
|
||||||
|
vtMove.x -= dMaxMove + EPS_SMALL * 100
|
||||||
|
End If
|
||||||
|
ptEndPointLift.x += vtMove.x
|
||||||
|
bOk = False
|
||||||
|
Case 4
|
||||||
|
' extra corsa sulla y-
|
||||||
|
EgtGetOutstrokeInfo(sInfo)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||||
|
ptEndPointLift.y -= vtMove.y
|
||||||
|
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
|
||||||
|
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
|
||||||
|
vtMove.y = 0
|
||||||
|
Else
|
||||||
|
vtMove.y -= dMaxMove - EPS_SMALL * 100
|
||||||
|
End If
|
||||||
|
ptEndPointLift.y += vtMove.y
|
||||||
|
bOk = False
|
||||||
|
Case 8
|
||||||
|
' extra corsa sulla y+
|
||||||
|
EgtGetOutstrokeInfo(sInfo)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||||
|
ptEndPointLift.y -= vtMove.y
|
||||||
|
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
|
||||||
|
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
|
||||||
|
vtMove.y = 0
|
||||||
|
Else
|
||||||
|
vtMove.y -= dMaxMove + EPS_SMALL * 100
|
||||||
|
End If
|
||||||
|
ptEndPointLift.y += vtMove.y
|
||||||
|
bOk = False
|
||||||
|
End Select
|
||||||
|
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
|
||||||
|
VacuumCups.ptStartPointLift = ptEndPointLift
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
' verifica che la posizione di rialascio sia corretta, altrimenti coreggo l'angolo di posizione
|
||||||
|
Private Function VerifyReleasdAngleIsValid(ByRef dAngDeg As Double, ByVal ptCenter As Point3d) As Boolean
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
' determino il punto finale dello spostamento
|
||||||
|
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
|
||||||
|
Dim dDegRotEndAng As Double = VacuumCups.dDegRotStartAng + dAngDeg
|
||||||
|
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
|
||||||
|
Dim sInfo As String = String.Empty
|
||||||
|
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, dDegRotEndAng)
|
||||||
|
Case 16
|
||||||
|
' extra corsa sulla c-
|
||||||
|
EgtGetOutstrokeInfo(sInfo)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||||
|
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
|
||||||
|
dDegRotEndAng -= dAngDeg
|
||||||
|
dAngDeg += VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
|
||||||
|
dDegRotEndAng += dAngDeg
|
||||||
|
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
|
||||||
|
bOk = False
|
||||||
|
Case 34
|
||||||
|
' extra corsa sulla c+
|
||||||
|
EgtGetOutstrokeInfo(sInfo)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||||
|
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
|
||||||
|
dDegRotEndAng -= dAngDeg
|
||||||
|
dAngDeg -= VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
|
||||||
|
dDegRotEndAng += dAngDeg
|
||||||
|
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
|
||||||
|
bOk = False
|
||||||
|
End Select
|
||||||
|
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
|
||||||
|
VacuumCups.ptStartPointLift = ptEndPointLift
|
||||||
|
VacuumCups.dDegRotStartAng = dDegRotEndAng
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Veririfica che il grezzo non entri in colliosione con altri pezzi
|
||||||
|
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
|
||||||
|
If nIdOnVacumm = GDB_ID.NULL Then Return False
|
||||||
|
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
|
||||||
|
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
|
If m_nTempId = GDB_ID.NULL Then Return False
|
||||||
|
EgtSetName(m_nTempId, "RawTemp")
|
||||||
|
Dim nIdActualRawOutLine As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawOutline")
|
||||||
|
Dim ActualRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdActualRawOutLine)
|
||||||
|
Dim nCurrPhase As Integer = EgtGetCurrPhase()
|
||||||
|
Dim nRawGroupId = EgtGetParent(EgtGetFirstRawPart())
|
||||||
|
Dim nIdRaw As Integer = EgtGetFirstRawPart()
|
||||||
|
' ciclo su tutti i grezzi per veririficare eventuali collisioni
|
||||||
|
While nIdRaw <> GDB_ID.NULL
|
||||||
|
' verifico la fase del grezzo
|
||||||
|
If EgtVerifyRawPartCurrPhase(nIdRaw) And nIdOnVacumm <> nIdRaw Then
|
||||||
|
' recupero il contorno del pezzo
|
||||||
|
Dim nIdRawOutLine As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawOutline")
|
||||||
|
Dim nIdRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdRawOutLine)
|
||||||
|
If EgtSurfFrIntersect(nIdRawFlatRegion, ActualRawFlatRegion) Then
|
||||||
|
If EgtExistsObj(nIdRawFlatRegion) Then
|
||||||
|
EgtErase(m_nTempId)
|
||||||
|
' esiste una intersezione delle superfici
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nIdRaw = EgtGetNextRawPart(nIdRaw)
|
||||||
|
End While
|
||||||
|
EgtErase(m_nTempId)
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|
||||||
#Region "COMMANDS"
|
#Region "COMMANDS"
|
||||||
@@ -286,9 +444,15 @@ Public Class MoveRawModeVM
|
|||||||
Else
|
Else
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim vtMove As New Vector3d(0, m_dMoveStep, 0)
|
Dim vtMove As New Vector3d(0, m_dMoveStep, 0)
|
||||||
|
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||||
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||||
|
VerifyReleasdPositionIsValid(vtMove)
|
||||||
|
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.y -= vtMove.y
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
' Pezzo troppo piccolo : non si può muovere
|
' Pezzo troppo piccolo : non si può muovere
|
||||||
@@ -320,9 +484,15 @@ Public Class MoveRawModeVM
|
|||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim vtMove As New Vector3d(-m_dMoveStep, 0, 0)
|
Dim vtMove As New Vector3d(-m_dMoveStep, 0, 0)
|
||||||
|
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||||
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||||
|
VerifyReleasdPositionIsValid(vtMove)
|
||||||
|
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.x -= vtMove.x
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
' Pezzo troppo piccolo : non si può muovere
|
' Pezzo troppo piccolo : non si può muovere
|
||||||
@@ -353,9 +523,15 @@ Public Class MoveRawModeVM
|
|||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim vtMove As New Vector3d(m_dMoveStep, 0, 0)
|
Dim vtMove As New Vector3d(m_dMoveStep, 0, 0)
|
||||||
|
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||||
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||||
|
VerifyReleasdPositionIsValid(vtMove)
|
||||||
|
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.x -= vtMove.x
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
' Pezzo troppo piccolo : non si può muovere
|
' Pezzo troppo piccolo : non si può muovere
|
||||||
@@ -403,9 +579,15 @@ Public Class MoveRawModeVM
|
|||||||
Else
|
Else
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim vtMove As New Vector3d(0, -m_dMoveStep, 0)
|
Dim vtMove As New Vector3d(0, -m_dMoveStep, 0)
|
||||||
|
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||||
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||||
|
VerifyReleasdPositionIsValid(vtMove)
|
||||||
|
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.y -= vtMove.y
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
' Pezzo troppo piccolo : non si può muovere
|
' Pezzo troppo piccolo : non si può muovere
|
||||||
@@ -437,12 +619,19 @@ Public Class MoveRawModeVM
|
|||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim dAng As Double = m_dRotationStep
|
Dim dAng As Double = m_dRotationStep
|
||||||
|
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||||
|
' Recupero il centro del grezzo
|
||||||
|
Dim ptRawCen As Point3d
|
||||||
|
EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||||
|
VerifyReleasdAngleIsValid(dAng, ptRawCen)
|
||||||
|
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||||
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
|
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
|
||||||
' Recupero il centro del grezzo
|
|
||||||
Dim ptRawCen As Point3d
|
|
||||||
EgtGetRawPartCenter(nRawId, ptRawCen)
|
|
||||||
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
||||||
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
|
||||||
|
VacuumCups.dDegRotStartAng -= dAng
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
||||||
@@ -472,12 +661,19 @@ Public Class MoveRawModeVM
|
|||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim dAng As Double = -m_dRotationStep
|
Dim dAng As Double = -m_dRotationStep
|
||||||
|
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||||
|
' Recupero il centro del grezzo
|
||||||
|
Dim ptRawCen As Point3d
|
||||||
|
EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||||
|
VerifyReleasdAngleIsValid(dAng, ptRawCen)
|
||||||
|
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||||
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
|
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
|
||||||
' Recupero il centro del grezzo
|
|
||||||
Dim ptRawCen As Point3d
|
|
||||||
EgtGetRawPartCenter(nRawId, ptRawCen)
|
|
||||||
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
||||||
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
|
||||||
|
VacuumCups.dDegRotStartAng -= dAng
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
||||||
@@ -545,17 +741,49 @@ Public Class MoveRawModeVM
|
|||||||
' Se trovato il grezzo
|
' Se trovato il grezzo
|
||||||
If nParentId = nRawGroupId Then
|
If nParentId = nRawGroupId Then
|
||||||
Dim nStat As Integer = GDB_ST.ON_
|
Dim nStat As Integer = GDB_ST.ON_
|
||||||
|
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
|
||||||
EgtGetStatus(nId, nStat)
|
EgtGetStatus(nId, nStat)
|
||||||
If nStat = GDB_ST.SEL Then
|
If nStat = GDB_ST.SEL Then
|
||||||
EgtSetStatus(nId, GDB_ST.ON_)
|
EgtSetStatus(nId, GDB_ST.ON_)
|
||||||
' Se con ventose, le nascondo
|
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola
|
||||||
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
If VerifyCollisionWithOtherRawPart(nId) Then
|
||||||
|
' mantengo la selezione del pezzo
|
||||||
|
EgtSetStatus(nId, GDB_ST.SEL)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
||||||
|
Else
|
||||||
|
' Se con ventose, le nascondo
|
||||||
|
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||||
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
|
' verifico che il pezzo precedente possa essere depositato correttamente
|
||||||
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||||
|
' mantengo la selezione del pezzo
|
||||||
|
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
||||||
|
EgtDraw()
|
||||||
|
' esco dal ciclo, prima devo depositare correttamente il pezzo
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
' salvo l'indice del pezzo correntemente attaccato alle ventose
|
||||||
|
m_CurrRawOnVacuum = nId
|
||||||
|
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
EgtSetStatus(nId, GDB_ST.SEL)
|
EgtSetStatus(nId, GDB_ST.SEL)
|
||||||
' Se con ventose, le posiziono sul grezzo
|
' Se con ventose, le posiziono sul grezzo
|
||||||
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then
|
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then
|
||||||
Dim rmData As New RawMoveData
|
Dim rmData As New RawMoveData
|
||||||
|
' inizializzo i dati del grezzo per il cacolo del peso
|
||||||
|
Dim MaxSinglePlugger As Double = 250
|
||||||
|
MaxSinglePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_SINGLEPLUGGER, MaxSinglePlugger, sMachIniFile)
|
||||||
|
Dim MaxDoublePlugger As Double = 750
|
||||||
|
MaxDoublePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_DOUBLEPLUGGER, MaxDoublePlugger, sMachIniFile)
|
||||||
|
Dim AverageDensity As Double = 2700
|
||||||
|
AverageDensity = GetPrivateProfileDouble(S_MATERIALS, K_AVERAGEDENSITY, AverageDensity, sMachIniFile)
|
||||||
|
VacuumCups.GetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
|
||||||
|
VacuumCups.GetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, sMachIniFile) <> 0)
|
||||||
|
VacuumCups.GetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, sMachIniFile) <> 0)
|
||||||
If PutVacuumCupsOnRaw(nId, rmData) Then
|
If PutVacuumCupsOnRaw(nId, rmData) Then
|
||||||
' Visualizzo le ventose
|
' Visualizzo le ventose
|
||||||
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
||||||
@@ -565,10 +793,19 @@ Public Class MoveRawModeVM
|
|||||||
' Reset eventuale messaggio
|
' Reset eventuale messaggio
|
||||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||||
Else
|
Else
|
||||||
|
' Visualizzo le ventose
|
||||||
|
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||||
' Aggiorno i dati
|
' Aggiorno i dati
|
||||||
m_bRawWithCups = False
|
m_bRawWithCups = False
|
||||||
' Messaggio di avvertimento (Pezzo troppo piccolo : non si può muovere)
|
If VacuumCups.bOverWeight Then
|
||||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
' Messaggio di avvertimento (Pezzo troppo piccolo : non si può muovere)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 4), 3, MSG_TYPE.WARNING)
|
||||||
|
ElseIf VacuumCups.bExtraStroke Then
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 5), 3, MSG_TYPE.WARNING) 'Pezzo oltre le corse : non si può muovere
|
||||||
|
Else
|
||||||
|
' Messaggio di avvertimento (Pezzo troppo piccolo : non si può muovere)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -577,6 +814,15 @@ Public Class MoveRawModeVM
|
|||||||
End If
|
End If
|
||||||
nId = EgtGetNextObjInSelWin()
|
nId = EgtGetNextObjInSelWin()
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
' clicco su un oggetto che non è un grezzo -> verifico che il pezzo precedente possa essere depositato correttamente
|
||||||
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||||
|
' mantengo la selezione del pezzo
|
||||||
|
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||||
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' EVENTS
|
#End Region ' EVENTS
|
||||||
|
|||||||
@@ -29,11 +29,13 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Grid.Column="1"
|
<Button Grid.Column="1"
|
||||||
|
IsEnabled="{Binding bEnabledCommandMove}"
|
||||||
Style="{StaticResource OptionPanel_Button}"
|
Style="{StaticResource OptionPanel_Button}"
|
||||||
Command="{Binding MoveUpCommand}">
|
Command="{Binding MoveUpCommand}">
|
||||||
<Image Source="/Resources/MachiningTab/UpArrow.png"/>
|
<Image Source="/Resources/MachiningTab/UpArrow.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="2"
|
<Button Grid.Column="2"
|
||||||
|
IsEnabled="{Binding bEnabledCommandMove}"
|
||||||
Style="{StaticResource OptionPanel_Button}"
|
Style="{StaticResource OptionPanel_Button}"
|
||||||
Command="{Binding MoveDownCommand}">
|
Command="{Binding MoveDownCommand}">
|
||||||
<Image Source="/Resources/MachiningTab/DownArrow.png"/>
|
<Image Source="/Resources/MachiningTab/DownArrow.png"/>
|
||||||
@@ -67,20 +69,38 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|
||||||
<UniformGrid Columns="3" Margin="0,0,0,5">
|
<UniformGrid Columns="3" Margin="0,0,0,5">
|
||||||
|
<Grid>
|
||||||
|
<Button Content="{Binding CutMsg}"
|
||||||
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
|
Command="{Binding CutCommand}"
|
||||||
|
Visibility="{Binding CutBtnVisibility}"
|
||||||
|
Margin="0,0,2.5,0"/>
|
||||||
|
<ToggleButton Grid.Row="0"
|
||||||
|
Content="{Binding BridgeMsg}"
|
||||||
|
Style="{StaticResource OptionPanel_ToggleWrapButton}"
|
||||||
|
IsChecked="{Binding BridgeBtn_IsChecked}"
|
||||||
|
Visibility="{Binding BridgeBtnVisibility}"
|
||||||
|
Margin="0,0,2.5,0" Padding="0"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Button Content="{Binding CutMsg}"
|
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
|
||||||
Command="{Binding CutCommand}"
|
|
||||||
Margin="0,0,2.5,0"/>
|
|
||||||
<Button Content="{Binding CutStartMsg}"
|
<Button Content="{Binding CutStartMsg}"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding CutStartCommand}"
|
Command="{Binding CutStartCommand}"
|
||||||
|
Visibility="{Binding CutStartBtnVisibility}"
|
||||||
Margin="2.5,0,2.5,0"/>
|
Margin="2.5,0,2.5,0"/>
|
||||||
<Button Content="{Binding CutEndMsg}"
|
<Grid>
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
<Button Content="{Binding CutEndMsg}"
|
||||||
Command="{Binding CutEndCommand}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Margin="2.5,0,0,0"/>
|
Command="{Binding CutEndCommand}"
|
||||||
|
Visibility="{Binding CutEndBtnVisibility}"
|
||||||
|
Margin="2.5,0,0,0"/>
|
||||||
|
<ToggleButton Grid.Row="0"
|
||||||
|
Content="{Binding BridgeDeleteMsg}"
|
||||||
|
Style="{StaticResource OptionPanel_ToggleWrapButton}"
|
||||||
|
IsChecked="{Binding BridgeDeleteBtn_IsChecked}"
|
||||||
|
Visibility="{Binding BridgeDeleteBtnVisibility}"
|
||||||
|
Margin="2.5,0,0,0" Padding="0"/>
|
||||||
|
</Grid>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
<Grid Visibility="{Binding AllExtRedVisibility}">
|
<Grid Visibility="{Binding AllExtRedVisibility}">
|
||||||
@@ -94,10 +114,12 @@
|
|||||||
<Button Content="{Binding AllExtendMsg}" Grid.Column="1"
|
<Button Content="{Binding AllExtendMsg}" Grid.Column="1"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding AllExtendCommand}"
|
Command="{Binding AllExtendCommand}"
|
||||||
|
Visibility="{Binding AllExtendBtnVisibility}"
|
||||||
Margin="0,0,2.5,0"/>
|
Margin="0,0,2.5,0"/>
|
||||||
<Button Content="{Binding AllReduceMsg}" Grid.Column="2"
|
<Button Content="{Binding AllReduceMsg}" Grid.Column="2"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding AllReduceCommand}"
|
Command="{Binding AllReduceCommand}"
|
||||||
|
Visibility="{Binding AllReduceBtnVisibility}"
|
||||||
Margin="2.5,0,0,0"/>
|
Margin="2.5,0,0,0"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -115,14 +137,17 @@
|
|||||||
<Button Content="{Binding OutCenStartMsg}"
|
<Button Content="{Binding OutCenStartMsg}"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding OutCenStartCommand}"
|
Command="{Binding OutCenStartCommand}"
|
||||||
|
Visibility="{Binding OutCenStartBtnVisibility}"
|
||||||
Margin="0,0,2.5,0" Padding="0"/>
|
Margin="0,0,2.5,0" Padding="0"/>
|
||||||
<Button Content="{Binding AllOutStartMsg}"
|
<Button Content="{Binding AllOutStartMsg}"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding AllOutStartCommand}"
|
Command="{Binding AllOutStartCommand}"
|
||||||
|
Visibility="{Binding AllOutStartBtnVisibility}"
|
||||||
Margin="2.5,0,2.5,0"/>
|
Margin="2.5,0,2.5,0"/>
|
||||||
<Button Content="{Binding AllCenStartMsg}"
|
<Button Content="{Binding AllCenStartMsg}"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding AllCenStartCommand}"
|
Command="{Binding AllCenStartCommand}"
|
||||||
|
Visibility="{Binding AllCenStartBtnVisibility}"
|
||||||
Margin="2.5,0,0,0"/>
|
Margin="2.5,0,0,0"/>
|
||||||
|
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
@@ -132,14 +157,19 @@
|
|||||||
<Button Content="{Binding OutCenEndMsg}"
|
<Button Content="{Binding OutCenEndMsg}"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding OutCenEndCommand}"
|
Command="{Binding OutCenEndCommand}"
|
||||||
|
Visibility="{Binding OutCenEndBtnVisibility}"
|
||||||
Margin="0,0,2.5,0" Padding="0"/>
|
Margin="0,0,2.5,0" Padding="0"/>
|
||||||
|
|
||||||
<Button Content="{Binding AllOutEndMsg}"
|
<Button Content="{Binding AllOutEndMsg}"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding AllOutEndCommand}"
|
Command="{Binding AllOutEndCommand}"
|
||||||
Margin="2.5,0,2.5,0"/>
|
Visibility="{Binding AllOutEndBtnVisibility}"
|
||||||
|
Margin="2.5,0,2.5,0"/>
|
||||||
|
|
||||||
<Button Content="{Binding AllCenEndMsg}"
|
<Button Content="{Binding AllCenEndMsg}"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding AllCenEndCommand}"
|
Command="{Binding AllCenEndCommand}"
|
||||||
|
Visibility="{Binding AllCenEndBtnVisibility}"
|
||||||
Margin="2.5,0,0,0"/>
|
Margin="2.5,0,0,0"/>
|
||||||
|
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
@@ -159,6 +189,7 @@
|
|||||||
<Button Content="{Binding PauseMsg}" Grid.Column="2"
|
<Button Content="{Binding PauseMsg}" Grid.Column="2"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding PauseCommand}"
|
Command="{Binding PauseCommand}"
|
||||||
|
Visibility="{Binding PauseBtnVisibility}"
|
||||||
Margin="2.5,0,2.5,0"/>
|
Margin="2.5,0,2.5,0"/>
|
||||||
|
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
@@ -174,6 +205,7 @@
|
|||||||
<Button Content="{Binding InvertMsg}" Grid.Column="0"
|
<Button Content="{Binding InvertMsg}" Grid.Column="0"
|
||||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||||
Command="{Binding InvertCommand}"
|
Command="{Binding InvertCommand}"
|
||||||
|
Visibility="{Binding InvertBtnVisibility}"
|
||||||
Margin="2.5,0,2.5,0"/>
|
Margin="2.5,0,2.5,0"/>
|
||||||
|
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|||||||
+1325
-133
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
|||||||
|
<EgtWPFLib5:EgtCustomWindow x:Class="MultiSelectionV"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:OmagOFFICE="clr-namespace:OmagOFFICE"
|
||||||
|
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||||
|
Title="{Binding TitleMsg}"
|
||||||
|
IsMinimizable="False"
|
||||||
|
IsClosable="False"
|
||||||
|
ShowInTaskbar="False"
|
||||||
|
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||||
|
WindowStartupLocation="CenterOwner"
|
||||||
|
Width="270" Height="150"
|
||||||
|
ResizeMode="NoResize">
|
||||||
|
|
||||||
|
<DockPanel Margin="5,5,5,0">
|
||||||
|
|
||||||
|
<UniformGrid Columns="2"
|
||||||
|
DockPanel.Dock="Top"
|
||||||
|
Margin="0,15,0,15">
|
||||||
|
<TextBlock Text="{Binding SelectionMsg}"/>
|
||||||
|
<TextBox Text="{Binding nNbrOfParts}"/>
|
||||||
|
</UniformGrid>
|
||||||
|
|
||||||
|
<UniformGrid Columns="4"
|
||||||
|
DockPanel.Dock="Bottom"
|
||||||
|
Margin="25,0,25,5">
|
||||||
|
<Button Command="{Binding OkCommand}"
|
||||||
|
Style="{StaticResource OptionPanel_TextButton}"
|
||||||
|
Content="{Binding OkMsg}">
|
||||||
|
</Button>
|
||||||
|
<ToggleButton Visibility="Hidden" />
|
||||||
|
<ToggleButton Visibility="Hidden" />
|
||||||
|
<Button Command="{Binding CancelCommand}"
|
||||||
|
Style="{StaticResource OptionPanel_TextButton}"
|
||||||
|
Content="{Binding CancelMsg}">
|
||||||
|
</Button>
|
||||||
|
</UniformGrid>
|
||||||
|
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
|
</EgtWPFLib5:EgtCustomWindow>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
Public Class MultiSelectionV
|
||||||
|
|
||||||
|
Private WithEvents m_MultiSelectionVM As MultiSelectionVM
|
||||||
|
|
||||||
|
Sub New(Owner As Window, MultiSelVM As MultiSelectionVM)
|
||||||
|
MyBase.New(Owner)
|
||||||
|
' This call is required by the designer.
|
||||||
|
InitializeComponent()
|
||||||
|
Me.DataContext = MultiSelVM
|
||||||
|
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||||
|
m_MultiSelectionVM = MultiSelVM
|
||||||
|
Me.Show()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
|
Public Class MultiSelectionVM
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
|
Private m_sRefGuidOfPart As String = String.Empty
|
||||||
|
|
||||||
|
Public ReadOnly Property TitleMsg As String
|
||||||
|
Get
|
||||||
|
Return "Multiple selection"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Public ReadOnly Property SelectionMsg As String
|
||||||
|
Get
|
||||||
|
Return "Number of Parts"
|
||||||
|
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
|
||||||
|
|
||||||
|
Private m_MultiSelectionV As MultiSelectionV
|
||||||
|
Public Sub SetMultiSelectionV(MultiSel As MultiSelectionV)
|
||||||
|
m_MultiSelectionV = MultiSel
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private m_nNbrOfParts As Integer
|
||||||
|
Public Property nNbrOfParts As String
|
||||||
|
Get
|
||||||
|
Return m_nNbrOfParts.ToString
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
Dim nVal As Integer = 0
|
||||||
|
StringToInt(value, nVal)
|
||||||
|
m_nNbrOfParts = nVal
|
||||||
|
NotifyPropertyChanged("nNbrOfParts")
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_cmdOk As ICommand
|
||||||
|
Private m_cmdCancel As ICommand
|
||||||
|
|
||||||
|
Public ReadOnly Property OkCommand As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdOk Is Nothing Then
|
||||||
|
m_cmdOk = New Command(AddressOf OkCmd)
|
||||||
|
End If
|
||||||
|
Return m_cmdOk
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub OkCmd(ByVal param As Object)
|
||||||
|
' il numero di elementi indicato è corretto
|
||||||
|
' deseleziono il pezzo corrente
|
||||||
|
DeselectPartInFaimily(m_sRefGuidOfPart)
|
||||||
|
Select Case m_nNbrOfParts
|
||||||
|
Case 0 ' Annulla
|
||||||
|
' continuo senza eseguire niente
|
||||||
|
Case Else
|
||||||
|
' seleziono il numero di pezzi indicati
|
||||||
|
SelectPartInFaimily(m_sRefGuidOfPart, m_nNbrOfParts)
|
||||||
|
End Select
|
||||||
|
' chiudo la finestra
|
||||||
|
m_MultiSelectionV.Close()
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public ReadOnly Property CancelCommand As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdCancel Is Nothing Then
|
||||||
|
m_cmdCancel = New Command(AddressOf CancelCmd)
|
||||||
|
End If
|
||||||
|
Return m_cmdCancel
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub CancelCmd(ByVal param As Object)
|
||||||
|
' chiudo la fiestra senza eseguire niente
|
||||||
|
m_MultiSelectionV.Close()
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub New(CurrNumberOfParts As Integer, sRefGuid As String)
|
||||||
|
m_nNbrOfParts = CurrNumberOfParts
|
||||||
|
m_sRefGuidOfPart = sRefGuid
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
@@ -137,21 +137,49 @@
|
|||||||
|
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<UniformGrid Grid.Column="0" Columns="2" Margin="0,0,0,5">
|
<UniformGrid Grid.Column="0" Columns="2" Margin="0,0,0,5">
|
||||||
<Button Content="{Binding InsertPartMsg}"
|
<Button Content="{Binding InsertPartMsg}"
|
||||||
Style="{StaticResource OptionPanel_TextButton}"
|
Style="{StaticResource OptionPanel_TextButton}"
|
||||||
Command="{Binding InsertPartCommand}"
|
Command="{Binding InsertPartCommand}"
|
||||||
Margin="0,0,2.5,0"/>
|
Margin="0,0,2.5,0"/>
|
||||||
<Button Content="{Binding StorePartMsg}"
|
<Button Content="{Binding StorePartMsg}" Grid.Column="1"
|
||||||
Style="{StaticResource OptionPanel_TextButton}"
|
Style="{StaticResource OptionPanel_TextButton}"
|
||||||
Command="{Binding StorePartCommand}"
|
Command="{Binding StorePartCommand}"
|
||||||
Margin="2.5,0,0,0"/>
|
Margin="2.5,0,0,0"/>
|
||||||
|
<!--<ToggleButton Content="{Binding StartCurvWJMsg}" Grid.Column="2"
|
||||||
|
Visibility="{Binding StartCurvWJ_Visibility}"
|
||||||
|
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||||
|
IsChecked="{Binding bStartCurvWJ}"
|
||||||
|
Margin="2.5,0,2.5,0"/>-->
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
<Button Content="{Binding RemovePartMsg}"
|
<UniformGrid Grid.Column="0" Columns="{Binding CountColumn}" Margin="0,0,0,5">
|
||||||
Style="{StaticResource OptionPanel_TextButton}"
|
<Button Content="{Binding RemovePartMsg}"
|
||||||
Command="{Binding RemovePartCommand}"
|
Style="{StaticResource OptionPanel_TextButton}"
|
||||||
Margin="0,0,0,5"/>
|
Command="{Binding RemovePartCommand}"
|
||||||
|
Margin="0,0,2.5,0"/>
|
||||||
|
<ToggleButton Content="{Binding DragRectangleMsg}" Grid.Column="1"
|
||||||
|
Visibility="{Binding DragRectangle_Visibility}"
|
||||||
|
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||||
|
IsChecked="{Binding bDragRectangle}"
|
||||||
|
Margin="2.5,0,2.5,0"/>
|
||||||
|
<!--<ToggleButton Content="{Binding SplitCurvWJMsg}" Grid.Column="2"
|
||||||
|
Visibility="{Binding SplitCurvWJ_Visibility}"
|
||||||
|
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||||
|
IsChecked="{Binding bSplitCurvWJ}"
|
||||||
|
Margin="2.5,0,2.5,0"/>-->
|
||||||
|
</UniformGrid>
|
||||||
|
|
||||||
|
<UniformGrid Grid.Column="0" Columns="2" Margin="0,0,0,5" Visibility="{Binding WJ_Cmd_Visibility}">
|
||||||
|
<ToggleButton Content="{Binding SplitCurvWJMsg}" Grid.Column="2"
|
||||||
|
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||||
|
IsChecked="{Binding bSplitCurvWJ}"
|
||||||
|
Margin="2.5,0,2.5,0"/>
|
||||||
|
<ToggleButton Content="{Binding StartCurvWJMsg}" Grid.Column="2"
|
||||||
|
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||||
|
IsChecked="{Binding bStartCurvWJ}"
|
||||||
|
Margin="2.5,0,2.5,0"/>
|
||||||
|
</UniformGrid>
|
||||||
|
|
||||||
<UniformGrid Columns="2" Margin="0,0,0,5">
|
<UniformGrid Columns="2" Margin="0,0,0,5">
|
||||||
<Button Content="{Binding SelectAllMsg}"
|
<Button Content="{Binding SelectAllMsg}"
|
||||||
|
|||||||
+1279
-170
File diff suppressed because it is too large
Load Diff
@@ -129,7 +129,7 @@
|
|||||||
Margin="13,0,0,5"
|
Margin="13,0,0,5"
|
||||||
IsEnabled="{Binding OffsetYIsEnabled}" TextAlignment="Right"/>
|
IsEnabled="{Binding OffsetYIsEnabled}" TextAlignment="Right"/>
|
||||||
<TextBlock Text="{Binding KerfMsg}"/>
|
<TextBlock Text="{Binding KerfMsg}"/>
|
||||||
<EgtWpfLib5:EgtTextBox Text="{Binding Kerf}"
|
<EgtWpfLib5:EgtTextBox Text="{Binding Kerf, UpdateSourceTrigger=PropertyChanged}"
|
||||||
Margin="13,0,0,5"
|
Margin="13,0,0,5"
|
||||||
IsEnabled="{Binding KerfIsEnabled}" TextAlignment="Right"/>
|
IsEnabled="{Binding KerfIsEnabled}" TextAlignment="Right"/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Imports System.IO
|
Imports System.Threading
|
||||||
|
Imports System.Windows.Threading
|
||||||
|
Imports System.IO
|
||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
Imports EgtPHOTOLib
|
Imports EgtPHOTOLib
|
||||||
@@ -7,6 +9,10 @@ Imports EgtUILib
|
|||||||
Public Class RawPartTabVM
|
Public Class RawPartTabVM
|
||||||
Inherits VMBase
|
Inherits VMBase
|
||||||
|
|
||||||
|
' Timer
|
||||||
|
Private m_TimerIsBusy As Boolean = False
|
||||||
|
Private m_RefreshTimer As New DispatcherTimer
|
||||||
|
|
||||||
Friend OmagPhoto As OmagPhotoV
|
Friend OmagPhoto As OmagPhotoV
|
||||||
|
|
||||||
Private m_OmagPhotoVM As OmagPhotoVM
|
Private m_OmagPhotoVM As OmagPhotoVM
|
||||||
@@ -223,6 +229,8 @@ Public Class RawPartTabVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
#Region "Parametri Grezzo"
|
||||||
|
|
||||||
Private m_dLength As Double
|
Private m_dLength As Double
|
||||||
Public Property Length As String
|
Public Property Length As String
|
||||||
Get
|
Get
|
||||||
@@ -231,7 +239,7 @@ Public Class RawPartTabVM
|
|||||||
Else
|
Else
|
||||||
Return LenToString(m_dLength, 2)
|
Return LenToString(m_dLength, 2)
|
||||||
End If
|
End If
|
||||||
'Return LenToString(m_dLength, -2)
|
'Return LenToString(m_dLength, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dLength As Double = 0
|
Dim dLength As Double = 0
|
||||||
@@ -388,7 +396,7 @@ Public Class RawPartTabVM
|
|||||||
RecalcRawPart()
|
RecalcRawPart()
|
||||||
ElseIf m_InvertKerf < 0 And dOffsetX >= 0 And dOffsetX < dMaxOffsetX + m_dKerf Then
|
ElseIf m_InvertKerf < 0 And dOffsetX >= 0 And dOffsetX < dMaxOffsetX + m_dKerf Then
|
||||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||||
m_dOffsetX = dOffsetX + m_dKerf
|
m_dOffsetX = dOffsetX
|
||||||
RecalcRawPart()
|
RecalcRawPart()
|
||||||
ElseIf dOffsetX <= dMinOffsetX - EPS_SMALL Then
|
ElseIf dOffsetX <= dMinOffsetX - EPS_SMALL Then
|
||||||
NotifyPropertyChanged("OffsetX")
|
NotifyPropertyChanged("OffsetX")
|
||||||
@@ -453,7 +461,7 @@ Public Class RawPartTabVM
|
|||||||
RecalcRawPart()
|
RecalcRawPart()
|
||||||
ElseIf m_InvertKerf < 0 And dOffsetY >= 0 And dOffsetY < dMaxOffsetY + m_dKerf Then
|
ElseIf m_InvertKerf < 0 And dOffsetY >= 0 And dOffsetY < dMaxOffsetY + m_dKerf Then
|
||||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||||
m_dOffsetY = dOffsetY + m_dKerf
|
m_dOffsetY = dOffsetY
|
||||||
RecalcRawPart()
|
RecalcRawPart()
|
||||||
ElseIf dOffsetY <= dMinOffsetY - EPS_SMALL Then
|
ElseIf dOffsetY <= dMinOffsetY - EPS_SMALL Then
|
||||||
NotifyPropertyChanged("OffsetY")
|
NotifyPropertyChanged("OffsetY")
|
||||||
@@ -496,6 +504,7 @@ Public Class RawPartTabVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private m_PrecKerf As Double = 1
|
||||||
Private m_InvertKerf As Double = 1
|
Private m_InvertKerf As Double = 1
|
||||||
Public ReadOnly Property InvertKerf As Double
|
Public ReadOnly Property InvertKerf As Double
|
||||||
Get
|
Get
|
||||||
@@ -516,6 +525,12 @@ Public Class RawPartTabVM
|
|||||||
Dim dKerf As Double = 0
|
Dim dKerf As Double = 0
|
||||||
Dim dMaxKerf As Double = Math.Min(Math.Min(m_dOffsetX, m_dOffsetY),
|
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))
|
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
|
' carcio di dati della lastra letti da intrfaccia
|
||||||
Dim dRawLength, dRawWidth, dRawOffsetX, dRawOffsetY As Double
|
Dim dRawLength, dRawWidth, dRawOffsetX, dRawOffsetY As Double
|
||||||
If Not StringToLen(Length, dRawLength) Then Return
|
If Not StringToLen(Length, dRawLength) Then Return
|
||||||
@@ -526,9 +541,22 @@ Public Class RawPartTabVM
|
|||||||
If Not StringToLen(value, dKerf) Then
|
If Not StringToLen(value, dKerf) Then
|
||||||
Return
|
Return
|
||||||
End If
|
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
|
If dKerf >= 0 And dKerf < dMaxKerf + EPS_SMALL Then
|
||||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||||
If GetRawMode() <> RAWMODE.FROM_PHOTO Then
|
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)
|
' Specifico che si tratta di un Kerf negativo (per interfaccia grafica)
|
||||||
EgtSetInfo(EstCalc.GetRawId(), KEY_INVERT_KERF, 1)
|
EgtSetInfo(EstCalc.GetRawId(), KEY_INVERT_KERF, 1)
|
||||||
SetInvertKerf(1)
|
SetInvertKerf(1)
|
||||||
@@ -554,14 +582,37 @@ Public Class RawPartTabVM
|
|||||||
EgtSetInfo(EstCalc.GetRawId(), KEY_INVERT_KERF, -1)
|
EgtSetInfo(EstCalc.GetRawId(), KEY_INVERT_KERF, -1)
|
||||||
SetInvertKerf(-1)
|
SetInvertKerf(-1)
|
||||||
' aggiorno dati grezzo (partendo dalle dimensioni esterne del grezzo)
|
' aggiorno dati grezzo (partendo dalle dimensioni esterne del grezzo)
|
||||||
m_dLength = dRawLength + 2 * dKerf
|
If m_PrecKerf >= 0 Then
|
||||||
m_dWidth = dRawWidth + 2 * dKerf
|
m_dLength = dRawLength + 2 * dKerf
|
||||||
m_dOffsetX = dRawOffsetX - dKerf
|
m_dWidth = dRawWidth + 2 * dKerf
|
||||||
m_dOffsetY = dRawOffsetY - dKerf
|
m_dOffsetX = dRawOffsetX - dKerf
|
||||||
|
m_dOffsetY = dRawOffsetY - dKerf
|
||||||
|
End If
|
||||||
m_dKerf = -dKerf
|
m_dKerf = -dKerf
|
||||||
|
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()
|
' RecalcRawPart()
|
||||||
'EstCalc.UpdateRawPart()
|
'EstCalc.UpdateRawPart()
|
||||||
UpdateRawPartKerf()
|
'UpdateRawPartKerf()
|
||||||
|
|
||||||
' Recupero id contorno kerf
|
' Recupero id contorno kerf
|
||||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(EstCalc.GetRawId(), NAME_KERF)
|
Dim nKerfId As Integer = EgtGetFirstNameInGroup(EstCalc.GetRawId(), NAME_KERF)
|
||||||
' Modifico il colore
|
' Modifico il colore
|
||||||
@@ -601,6 +652,8 @@ Public Class RawPartTabVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
#End Region ' Parametri Grezzo
|
||||||
|
|
||||||
Public ReadOnly Property MaterialList As ObservableCollection(Of Material)
|
Public ReadOnly Property MaterialList As ObservableCollection(Of Material)
|
||||||
Get
|
Get
|
||||||
Return CurrentMachine.Materials
|
Return CurrentMachine.Materials
|
||||||
@@ -1079,6 +1132,8 @@ Public Class RawPartTabVM
|
|||||||
ElseIf dRawKerf > Math.Min(m_dTableLength, m_dTableWidth) / 5 Then
|
ElseIf dRawKerf > Math.Min(m_dTableLength, m_dTableWidth) / 5 Then
|
||||||
dRawKerf = Math.Min(m_dTableLength, m_dTableWidth) / 5
|
dRawKerf = Math.Min(m_dTableLength, m_dTableWidth) / 5
|
||||||
End If
|
End If
|
||||||
|
' assegno il valore del Kerf corrente
|
||||||
|
m_PrecKerf = dRawKerf
|
||||||
If dRawLen < 0 Then
|
If dRawLen < 0 Then
|
||||||
dRawLen = 100
|
dRawLen = 100
|
||||||
ElseIf dRawLen > m_dTableLength - 2 * dRawKerf Then
|
ElseIf dRawLen > m_dTableLength - 2 * dRawKerf Then
|
||||||
@@ -1090,14 +1145,14 @@ Public Class RawPartTabVM
|
|||||||
dRawWidth = m_dTableWidth - 2 * dRawKerf
|
dRawWidth = m_dTableWidth - 2 * dRawKerf
|
||||||
End If
|
End If
|
||||||
If dRawOffsX < dRawKerf Then dRawOffsX = dRawKerf
|
If dRawOffsX < dRawKerf Then dRawOffsX = dRawKerf
|
||||||
If dRawOffsX + dRawLen + dRawKerf > m_dTableLength Then
|
If dRawOffsX + dRawLen + 2 * dRawKerf > m_dTableLength Then
|
||||||
dRawOffsX = Math.Max(dRawKerf, m_dTableLength - dRawLen - dRawKerf)
|
dRawOffsX = Math.Max(dRawKerf, m_dTableLength - dRawLen - 2 * dRawKerf)
|
||||||
dRawLen = Math.Min(dRawLen, m_dTableLength - dRawOffsX - dRawKerf)
|
dRawLen = Math.Min(dRawLen, m_dTableLength - dRawOffsX - 2 * dRawKerf)
|
||||||
End If
|
End If
|
||||||
If dRawOffsY < dRawKerf Then dRawOffsY = dRawKerf
|
If dRawOffsY < dRawKerf Then dRawOffsY = dRawKerf
|
||||||
If dRawOffsY + dRawWidth + dRawKerf > m_dTableWidth Then
|
If dRawOffsY + dRawWidth + 2 * dRawKerf > m_dTableWidth Then
|
||||||
dRawOffsY = Math.Max(dRawKerf, m_dTableWidth - dRawWidth - dRawKerf)
|
dRawOffsY = Math.Max(dRawKerf, m_dTableWidth - dRawWidth - 2 * dRawKerf)
|
||||||
dRawWidth = Math.Min(dRawWidth, m_dTableWidth - dRawOffsY - dRawKerf)
|
dRawWidth = Math.Min(dRawWidth, m_dTableWidth - dRawOffsY - 2 * dRawKerf)
|
||||||
End If
|
End If
|
||||||
' Assegno i dati
|
' Assegno i dati
|
||||||
SetLength(dRawLen)
|
SetLength(dRawLen)
|
||||||
@@ -1307,12 +1362,58 @@ Public Class RawPartTabVM
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
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()
|
Private Sub UpdateRawPartHeight()
|
||||||
' Se da creare
|
' Se da creare
|
||||||
If EstCalc.GetRawId() = GDB_ID.NULL Then
|
If EstCalc.GetRawId() = GDB_ID.NULL Then
|
||||||
RecalcRawPart(True)
|
RecalcRawPart(True)
|
||||||
Return
|
Return
|
||||||
' se da cancellare
|
' se da cancellare
|
||||||
ElseIf m_dHeight < EPS_SMALL Then
|
ElseIf m_dHeight < EPS_SMALL Then
|
||||||
' Se ci sono pezzi
|
' Se ci sono pezzi
|
||||||
If EgtGetFirstPartInRawPart(EstCalc.GetRawId()) <> GDB_ID.NULL Then
|
If EgtGetFirstPartInRawPart(EstCalc.GetRawId()) <> GDB_ID.NULL Then
|
||||||
@@ -1333,7 +1434,7 @@ Public Class RawPartTabVM
|
|||||||
End If
|
End If
|
||||||
' Elimino il grezzo
|
' Elimino il grezzo
|
||||||
EgtRemoveRawPart(EstCalc.GetRawId())
|
EgtRemoveRawPart(EstCalc.GetRawId())
|
||||||
' altrimenti da aggiornare
|
' altrimenti da aggiornare
|
||||||
Else
|
Else
|
||||||
' Salvo vecchia altezza
|
' Salvo vecchia altezza
|
||||||
Dim dOldHeight As Double = EstCalc.GetRawHeight()
|
Dim dOldHeight As Double = EstCalc.GetRawHeight()
|
||||||
@@ -1583,8 +1684,11 @@ Public Class RawPartTabVM
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub AdjustRawPartOnExit()
|
Private Sub AdjustRawPartOnExit()
|
||||||
' Se non c'è il grezzo, esco
|
' Se non c'è il grezzo, esco dopo aver nascosto eventuale foto
|
||||||
If EstCalc.GetRawId() = GDB_ID.NULL Then Return
|
If EstCalc.GetRawId() = GDB_ID.NULL Then
|
||||||
|
ShowPhoto(False)
|
||||||
|
Return
|
||||||
|
End If
|
||||||
' Disabilito impostazione modificato
|
' Disabilito impostazione modificato
|
||||||
Dim bOldEnMod = EgtGetEnableModified()
|
Dim bOldEnMod = EgtGetEnableModified()
|
||||||
If bOldEnMod Then EgtDisableModified()
|
If bOldEnMod Then EgtDisableModified()
|
||||||
@@ -1936,11 +2040,17 @@ Public Class RawPartTabVM
|
|||||||
' inserisco in elenco solo i materiali della macchina corrente
|
' inserisco in elenco solo i materiali della macchina corrente
|
||||||
AddHandler PhotoMap.refOptionPanelVM.SlabIsSelectedOFFICE, AddressOf OmagOFFICEMap.refRawPartTabVM.ClosePhotoWnd
|
AddHandler PhotoMap.refOptionPanelVM.SlabIsSelectedOFFICE, AddressOf OmagOFFICEMap.refRawPartTabVM.ClosePhotoWnd
|
||||||
|
|
||||||
' Dim OmagPhotoWnd As New OmagPhotoV(Application.Current.MainWindow(), New OmagPhotoVM)
|
' lancio il timer di aggiornamento dell'interfaccia, per la gestione di due OmagPHOTO che accedono allo stesso SQL
|
||||||
'OmagPhotoWnd.ShowDialog()
|
AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_Tick
|
||||||
|
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(2000)
|
||||||
|
m_RefreshTimer.Start()
|
||||||
|
|
||||||
|
' apro la finestra per accedere al DB delle lastre
|
||||||
Me.OmagPhoto = New OmagPhotoV
|
Me.OmagPhoto = New OmagPhotoV
|
||||||
OmagPhoto.ShowDialog()
|
OmagPhoto.ShowDialog()
|
||||||
|
|
||||||
|
m_RefreshTimer.Stop()
|
||||||
|
|
||||||
EgtSetCurrentContext(EgtPHOTOLib.MainData.PreviousContext)
|
EgtSetCurrentContext(EgtPHOTOLib.MainData.PreviousContext)
|
||||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||||
|
|
||||||
@@ -2058,6 +2168,17 @@ Public Class RawPartTabVM
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' per la gestione di due OmagPHOTO che accedono allo stesso SQL
|
||||||
|
Private Sub RefreshTimer_Tick()
|
||||||
|
If Not m_TimerIsBusy And PhotoMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.LIST Then
|
||||||
|
m_TimerIsBusy = True
|
||||||
|
m_RefreshTimer.Stop()
|
||||||
|
EgtPHOTOLib.PhotoMap.refListPageVM.RefreshLisPage()
|
||||||
|
m_TimerIsBusy = False
|
||||||
|
m_RefreshTimer.Start()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
#End Region ' PhotoCommand
|
#End Region ' PhotoCommand
|
||||||
|
|
||||||
#Region "ConfirmPhotoCommand"
|
#Region "ConfirmPhotoCommand"
|
||||||
@@ -2268,6 +2389,8 @@ Public Class RawPartTabVM
|
|||||||
End If
|
End If
|
||||||
' Aggiorno il punto precedente
|
' Aggiorno il punto precedente
|
||||||
m_ptPrev = ptCurr
|
m_ptPrev = ptCurr
|
||||||
|
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
|
||||||
|
ResetAllBridges()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ModifyPhoto(ptCurr As Point3d)
|
Private Sub ModifyPhoto(ptCurr As Point3d)
|
||||||
|
|||||||
@@ -101,9 +101,9 @@ Public Class MachineAxis
|
|||||||
EgtSetAxisPos(m_Name, dVal)
|
EgtSetAxisPos(m_Name, dVal)
|
||||||
EgtGetAxisPos(m_Name, dVal)
|
EgtGetAxisPos(m_Name, dVal)
|
||||||
If m_Linear Then
|
If m_Linear Then
|
||||||
Value = LenToString(dVal, -3)
|
Value = LenToString(dVal, 3)
|
||||||
Else
|
Else
|
||||||
Value = DoubleToString(dVal, -3)
|
Value = DoubleToString(dVal, 3)
|
||||||
End If
|
End If
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ Public Class OptionWindowVM
|
|||||||
OmagOFFICEMap.refRawPartTabVM.Refresh(PrevMeasureUnit)
|
OmagOFFICEMap.refRawPartTabVM.Refresh(PrevMeasureUnit)
|
||||||
OmagOFFICEMap.refNestingTabVM.Refresh(PrevMeasureUnit)
|
OmagOFFICEMap.refNestingTabVM.Refresh(PrevMeasureUnit)
|
||||||
OmagOFFICEMap.refMoveRawModeVM.Refresh(PrevMeasureUnit)
|
OmagOFFICEMap.refMoveRawModeVM.Refresh(PrevMeasureUnit)
|
||||||
OmagOFFICEMap.refSimulTabVM.MySimul.Refresh(PrevMeasureUnit)
|
If Not IsNothing(OmagOFFICEMap.refSimulTabVM.MySimul) Then OmagOFFICEMap.refSimulTabVM.MySimul.Refresh(PrevMeasureUnit)
|
||||||
End If
|
End If
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<OmagOFFICE:ShowPanelV DataContext="{StaticResource ShowPanelVM}"/>
|
<OmagOFFICE:ShowPanelV DataContext="{StaticResource ShowPanelVM}"/>
|
||||||
<OmagOFFICE:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
|
<OmagOFFICE:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
|
||||||
<OmagOFFICE:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
|
<OmagOFFICE:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
|
||||||
|
<OmagOFFICE:PrintPanelV DataContext="{StaticResource PrintPanelVM}"/>
|
||||||
<OmagOFFICE:VeinMatchPanelV DataContext="{StaticResource VeinMatchPanelVM}"/>
|
<OmagOFFICE:VeinMatchPanelV DataContext="{StaticResource VeinMatchPanelVM}"/>
|
||||||
<OmagOFFICE:MachinePanelV DataContext="{StaticResource MachinePanelVM}"/>
|
<OmagOFFICE:MachinePanelV DataContext="{StaticResource MachinePanelVM}"/>
|
||||||
</EgtFloating:EgtFloatingTray>
|
</EgtFloating:EgtFloatingTray>
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
Public Class ProjectV
|
Public Class ProjectV
|
||||||
|
|
||||||
|
Private Sub LoadPage() Handles Me.Loaded
|
||||||
|
OmagOFFICEMap.SetRefProjectV(Me)
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 637 B |
@@ -11,19 +11,22 @@
|
|||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid Visibility="{Binding Legenda_Visibility}"
|
<!--Titolo delle colonne-->
|
||||||
|
<Grid Visibility="{Binding Legenda_Visibility}"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Margin="0,0,0,5">
|
Margin="0,0,0,5">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1.8*"/>
|
<ColumnDefinition Width="1.8*"/>
|
||||||
<ColumnDefinition Width="0.6*"/>
|
<ColumnDefinition Width="0.6*"/>
|
||||||
<ColumnDefinition Width="0.6*"/>
|
<ColumnDefinition Width="0.6*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<!--Prima colonna-->
|
||||||
<TextBlock Text="{Binding FirstColumnMsg}" Grid.Column="1" HorizontalAlignment="Center"/>
|
<TextBlock Text="{Binding FirstColumnMsg}" Grid.Column="1" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="{Binding SecondColumnMsg}" Grid.Column="2" HorizontalAlignment="Center"/>
|
<!--Seconda colonna-->
|
||||||
|
<TextBlock Text="{Binding SecondColumnMsg}" Grid.Column="2" HorizontalAlignment="Center"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<EgtWPFLib5:EgtScrollViewer VerticalScrollBarVisibility="Auto"
|
<EgtWPFLib5:EgtScrollViewer VerticalScrollBarVisibility="Auto"
|
||||||
@@ -38,8 +41,10 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<!--Nome della riga ("An")-->
|
||||||
<TextBlock Text="{Binding sEntityName}"
|
<TextBlock Text="{Binding sEntityName}"
|
||||||
VerticalAlignment="Center"/>
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<!--Drip e Engrave-->
|
<!--Drip e Engrave-->
|
||||||
<UniformGrid Grid.Column="1" Columns="3" Rows="1">
|
<UniformGrid Grid.Column="1" Columns="3" Rows="1">
|
||||||
<CheckBox IsChecked="{Binding bIsChecked}"
|
<CheckBox IsChecked="{Binding bIsChecked}"
|
||||||
@@ -56,6 +61,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="2.5,0,0,0"/>
|
Margin="2.5,0,0,0"/>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
<!--SideAngle-->
|
<!--SideAngle-->
|
||||||
<UniformGrid Grid.Column="1" Columns="2" Rows="1">
|
<UniformGrid Grid.Column="1" Columns="2" Rows="1">
|
||||||
<EgtWPFLib5:EgtTextBox Text="{Binding GrphSideAngle}"
|
<EgtWPFLib5:EgtTextBox Text="{Binding GrphSideAngle}"
|
||||||
@@ -67,6 +73,41 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="2.5,0,0,0"/>
|
Margin="2.5,0,0,0"/>
|
||||||
</UniformGrid>
|
</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>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
@@ -104,7 +145,7 @@
|
|||||||
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter2a}"/>
|
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter2a}"/>
|
||||||
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter2b}"/>
|
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter2b}"/>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid Visibility="{Binding Parameter23_Visibility}"
|
<Grid Visibility="{Binding Parameter23_Visibility}"
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
@@ -132,6 +173,32 @@
|
|||||||
Grid.Column="1"/>
|
Grid.Column="1"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
<Grid Visibility="{Binding Parameter5_Visibility}"
|
||||||
|
Grid.Row="5"
|
||||||
|
Margin="0,0,0,5">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1.8*"/>
|
||||||
|
<ColumnDefinition Width="1.2*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding Parameter5Msg}" Grid.Row="2"/>
|
||||||
|
<CheckBox IsChecked="{Binding Parameter5ChBx}" HorizontalAlignment="Center"
|
||||||
|
Grid.Column="1"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid Visibility="{Binding Parameter6_Visibility}"
|
||||||
|
Grid.Row="6"
|
||||||
|
Margin="0,0,0,5">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1.8*"/>
|
||||||
|
<ColumnDefinition Width="1.2*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding Parameter6Msg}" Grid.Row="2"/>
|
||||||
|
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter6}"
|
||||||
|
Grid.Column="1"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -128,9 +128,9 @@ Public Class TopCommandBarVM
|
|||||||
''' <summary>
|
''' <summary>
|
||||||
''' Execute the New. This method is invoked by the NewCommand.
|
''' Execute the New. This method is invoked by the NewCommand.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Friend Sub NewCmd(Optional bUseDefaults As Boolean = False)
|
Friend Sub NewCmd()
|
||||||
OmagOFFICEMap.refSceneHostVM.NewProject()
|
OmagOFFICEMap.refSceneHostVM.NewProject()
|
||||||
OmagOFFICEMap.refMachGroupPanelVM.InitMachGroupList(bUseDefaults)
|
OmagOFFICEMap.refMachGroupPanelVM.InitMachGroupList(False)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' NewCommand
|
#End Region ' NewCommand
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Public Class UnderDrillControlVM
|
|||||||
Private m_dDrillDepth As Double
|
Private m_dDrillDepth As Double
|
||||||
Public Property dDrillDepth As String
|
Public Property dDrillDepth As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(m_dDrillDepth, -2)
|
Return LenToString(m_dDrillDepth, 2)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLen(value, m_dDrillDepth)
|
StringToLen(value, m_dDrillDepth)
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<EgtWPFLib5:ShowPanelVM x:Key="ShowPanelVM"/>
|
<EgtWPFLib5:ShowPanelVM x:Key="ShowPanelVM"/>
|
||||||
<EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/>
|
<EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/>
|
||||||
<EgtWPFLib5:InstrumentPanelVM x:Key="InstrumentPanelVM"/>
|
<EgtWPFLib5:InstrumentPanelVM x:Key="InstrumentPanelVM"/>
|
||||||
|
<OmagOFFICE:PrintPanelVM x:Key="PrintPanelVM"/>
|
||||||
<OmagOFFICE:MyMachinePanelVM x:Key="MachinePanelVM"/>
|
<OmagOFFICE:MyMachinePanelVM x:Key="MachinePanelVM"/>
|
||||||
<OmagOFFICE:VeinMatchPanelVM x:Key="VeinMatchPanelVM"/>
|
<OmagOFFICE:VeinMatchPanelVM x:Key="VeinMatchPanelVM"/>
|
||||||
<OmagOFFICE:OptionPanelVM x:Key="OptionPanelVM"/>
|
<OmagOFFICE:OptionPanelVM x:Key="OptionPanelVM"/>
|
||||||
@@ -223,7 +224,11 @@
|
|||||||
<Setter Property="Height" Value="30"/>
|
<Setter Property="Height" Value="30"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="OptionPanel_NestingToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
<Style x:Key="OptionPanel_ToggleWrapButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||||
|
<Setter Property="Height" Value="45"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="OptionPanel_NestingToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||||
<Setter Property="Height" Value="60"/>
|
<Setter Property="Height" Value="60"/>
|
||||||
<Setter Property="Width" Value="60"/>
|
<Setter Property="Width" Value="60"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
Imports EgtPHOTOLib
|
Imports EgtPHOTOLib
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Module OmagOFFICEMap
|
Module OmagOFFICEMap
|
||||||
|
|
||||||
@@ -120,7 +121,6 @@ Module OmagOFFICEMap
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
'Public ReadOnly Property refProjectVM As ProjectLibVM
|
'Public ReadOnly Property refProjectVM As ProjectLibVM
|
||||||
' Get
|
' Get
|
||||||
' Return PhotoMap.refProjectVM
|
' Return PhotoMap.refProjectVM
|
||||||
@@ -230,6 +230,43 @@ Module OmagOFFICEMap
|
|||||||
Return Not IsNothing(m_refSimulTabVM)
|
Return Not IsNothing(m_refSimulTabVM)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Private m_refProjectV As ProjectV
|
||||||
|
Friend Sub SetRefProjectV(ProjectV As ProjectV)
|
||||||
|
m_refProjectV = ProjectV
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private m_WidthProjectV As Integer = 2000
|
||||||
|
Friend Sub SetWidthDimProjectV(Width As Integer)
|
||||||
|
m_WidthProjectV = Width
|
||||||
|
End Sub
|
||||||
|
Friend Function GetWidthDimProjectV() As Integer
|
||||||
|
If Not IsNothing(m_refProjectV) Then
|
||||||
|
Try
|
||||||
|
m_WidthProjectV = CInt(m_refProjectV.ActualWidth)
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog(ex.Message)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
Return m_WidthProjectV
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private m_HeightProjectV As Integer = 1000
|
||||||
|
Friend Sub SetHeightDimProjectV(Eight As Integer)
|
||||||
|
m_HeightProjectV = Eight
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Function GetHeightDimProjectV() As Integer
|
||||||
|
If Not IsNothing(m_refProjectV) Then
|
||||||
|
Try
|
||||||
|
m_HeightProjectV = CInt(m_refProjectV.ActualHeight)
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog(ex.Message)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
Return m_HeightProjectV
|
||||||
|
End Function
|
||||||
|
|
||||||
#End Region ' Set
|
#End Region ' Set
|
||||||
|
|
||||||
#Region "Init"
|
#Region "Init"
|
||||||
|
|||||||
Reference in New Issue
Block a user