Compare commits

..

2 Commits

Author SHA1 Message Date
Demetrio Cassarino 7558449b06 Merge remote-tracking branch 'origin/master' into feature/Note_Utensile 2024-07-30 10:21:32 +02:00
Demetrio Cassarino c727e98f8f Merge remote-tracking branch 'origin/master' into feature/Note_Utensile 2024-07-23 10:06:55 +02:00
23 changed files with 199 additions and 751 deletions
+3 -25
View File
@@ -1,7 +1,5 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports EgtUILib
Imports EgtUILib.EgtInterface
' Classe che definisce un elemento di base del TreeView
Public Class TreeViewItemBase
@@ -33,7 +31,7 @@ Public Class TreeViewItemBase
End Set
End Property
Friend m_isExpanded As Boolean
Private m_isExpanded As Boolean
Public Property IsExpanded As Boolean
Get
Return m_isExpanded
@@ -41,25 +39,6 @@ Public Class TreeViewItemBase
Set(value As Boolean)
If (value <> m_isExpanded) Then
m_isExpanded = value
If Not Map.refProjectVM.bSelObjOnScene Then
Dim m_onldObjTreeOldId As Integer = Map.refManageLayerExpanderVM.m_nObjTreeOldId
If Not m_isExpanded Then
Else
For Each Item As LayerTreeViewItem In Map.refManageLayerExpanderVM.LayerList
For Each LayerItem As LayerTreeViewItem In Item.Items
If m_isExpanded = LayerItem.m_isExpanded Then
If m_onldObjTreeOldId = LayerItem.Id Then
Map.refProjectVM.SetLastInteger(LayerItem.Id)
Map.refProjectVM.ExecuteCommand(Controller.CMD.DESELECTPARTLAYEROBJ)
Else
Map.refManageLayerExpanderVM.SelectIdInObjTree(LayerItem.Id)
'Map.refProjectVM.ExecuteCommand(Controller.CMD.SETCURRPARTLAYER)
End If
End If
Next
Next
End If
End If
NotifyPropertyChanged("IsExpanded")
End If
End Set
@@ -113,7 +92,6 @@ Public Class InheritableTreeViewItem
Implements INotifyPropertyChanged
Friend m_Name As String
Public Property Name As String
Get
Return m_Name
@@ -217,6 +195,7 @@ Public Class ParentItem
Inherits TreeViewItemBase
Private m_sPictureString As String
Private m_Items As ObservableCollection(Of ChildItem)
Public Property PictureString As String
Get
@@ -230,7 +209,6 @@ Public Class ParentItem
End Set
End Property
Private m_Items As ObservableCollection(Of ChildItem)
Public Property Items As ObservableCollection(Of ChildItem)
Get
Return m_Items
@@ -277,4 +255,4 @@ Public Class ChildItem
MyBase.New(Name, IsSelected, IsExpanded, IsActive)
End Sub
End Class
End Class
-2
View File
@@ -69,7 +69,6 @@ Module ConstIni
Public Const K_SHOWGFRAME As String = "ShowGFrame"
Public Const K_LINEWIDTH As String = "LineWidth"
Public Const K_MARK As String = "Mark"
Public Const K_MARK2 As String = "Mark2"
Public Const K_SELSURF As String = "SelSurf"
Public Const K_SHOWMODE As String = "ShowMode"
Public Const K_CURVEDIR As String = "CurveDir"
@@ -184,7 +183,6 @@ Module ConstIni
Public Const K_SELGEOMSURFFINISHING As String = "SelGeomSurfFinishing"
Public Const K_SELGEOMSURFROUGHING As String = "SelGeomSurfRoughing"
Public Const K_SELGEOMFIVEAXMILLING As String = "SelGeomFiveAxMilling"
Public Const K_SELVMILLQUALITY As String = "VMillQuality"
Public Const K_MACHININGGROUP As String = "MachiningGroup"
Public Const K_SHOWONLYTABLE As String = "ShowOnlyTable"
Public Const K_MOVETHROUGHDISPS As String = "MoveThroughDisps"
+3 -6
View File
@@ -385,8 +385,8 @@ Public Class MainWindowVM
EgtSetLockId(sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2609, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2609, 1, IniFile.m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2607, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2607, 1, IniFile.m_nKeyOptions)
' Leggo e imposto livello utilizzatore
IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
' Imposto abilitazione lavorazioni avanzate
@@ -597,11 +597,8 @@ Public Class MainWindowVM
' pulisco output
Map.refStatusBarVM.NotifyStatusOutput("")
Map.refInputExpanderVM.ResetInputBox()
ElseIf e.Key = Key.Left OrElse e.Key = Key.Right OrElse e.Key = Key.Up OrElse e.Key = Key.Down AndAlso
Map.refTopCommandBarVM.MachiningIsChecked AndAlso Map.refOperationParametersExpanderVM.OperationParameters.IsEnabled Then
ElseIf e.Key = Key.Left OrElse e.Key = Key.Right OrElse e.Key = Key.Up OrElse e.Key = Key.Down AndAlso Map.refTopCommandBarVM.MachiningIsChecked AndAlso Map.refOperationParametersExpanderVM.OperationParameters.IsEnabled Then
Map.refMachiningParameterExpanderVM.FocusSlider()
Dim nStep As Integer = If( e.Key = Key.Right OrElse e.Key = Key.Up, 1, -1)
Map.refMachiningParameterExpanderVM.SetSliderValue(nStep)
e.Handled = True
End If
End Sub
+2 -2
View File
@@ -70,6 +70,6 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.6.9.1")>
<Assembly: AssemblyFileVersion("2.6.9.1")>
<Assembly: AssemblyVersion("2.6.7.6")>
<Assembly: AssemblyFileVersion("2.6.7.6")>
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Expander IsExpanded="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ExpanderStyle}">
Style="{StaticResource ExpanderStyle}">
<Expander.Header>
<TextBlock Text="{Binding PropertiesMsg}"/>
</Expander.Header>
@@ -1,11 +1,9 @@
<UserControl x:Class="InputExpanderV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Expander Header="{Binding Title}" IsExpanded="{Binding IsExpanded}" IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ExpanderStyle}">
Style="{StaticResource ExpanderStyle}">
<StackPanel>
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
@@ -18,75 +16,26 @@
</StackPanel.Style>
<TextBlock Text="{Binding TextBlock}"
Visibility="{Binding TextVisibility}" Margin="5,5,0,5"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="Txt" Text="{Binding TextBox,UpdateSourceTrigger=PropertyChanged}"
PreviewKeyDown="TextBox_PreviewKeyDown" Height="Auto"
Visibility="{Binding TextVisibility}" Margin="5,0,5,5" >
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding DoneCommand}"/>
<KeyBinding Key="S" Modifiers="Control" Command="{Binding ShowCommand}"/>
</TextBox.InputBindings>
</TextBox>
<Button Grid.Column="1"
Content="+"
Command="{Binding ShowInfoItemCommand}"
Visibility="Collapsed"
Width="20"
Height="20"
Margin="5,-1,5,0"
VerticalAlignment="Top"/>
<!--Visibility="{Binding ShowInfoItemVisibility}"-->
</Grid>
<TextBox Text="{Binding TextBox,UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding TextVisibility}" Margin="5,0,5,5">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding DoneCommand}"/>
<KeyBinding Key="S" Modifiers="Control" Command="{Binding ShowCommand}"/>
</TextBox.InputBindings>
</TextBox>
<CheckBox Content="{Binding CheckBoxText}" IsChecked="{Binding IsChecked}"
Visibility="{Binding CheckVisibility}" Margin="5,0,5,5"/>
<ComboBox ItemsSource="{Binding ComboItemsList}" SelectedIndex="{Binding ComboSelectedIndex}"
Visibility="{Binding ComboVisibility}" Margin="5,5,5,5"/>
<ItemsControl ItemsSource="{Binding InfoList}"
Visibility="{Binding InfoVisibility}"
Margin="5,5,0,10">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Key}"
Width="70"
Margin="0,6,-15,0"/>
<TextBox Grid.Column="1"
Text="{Binding Valour, UpdateSourceTrigger=PropertyChanged}"
Margin="0,5,5,10">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding DoneInfoCommand}"/>
</TextBox.InputBindings>
</TextBox>
<Button Grid.Column="2"
Content="-"
Command="{Binding RemoveInfoItemCommand}"
Width="20"
Height="20"
Margin="5,-2,5,5"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Visibility="{Binding ComboVisibility}" Margin="5,0,5,5"/>
<Grid Margin="5,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Command="{Binding ShowCommand}" Visibility="{Binding ShowBtnVisibility}"
Content="{Binding ShowMsg}" Style="{StaticResource EgtCAM5_InputButton}"/>
Content="{Binding ShowMsg}" Style="{StaticResource EgtCAM5_InputButton}"/>
<Button Command="{Binding DoneCommand}" Grid.Column="1"
Content="{Binding OkMsg}" Style="{StaticResource EgtCAM5_InputButton}"/>
Content="{Binding OkMsg}" Style="{StaticResource EgtCAM5_InputButton}"/>
</Grid>
</StackPanel>
</Expander>
@@ -1,11 +1,3 @@
Public Class InputExpanderV
Private Sub TextBox_PreviewKeyDown(sender As Object, e As KeyEventArgs)
If e.Key = Key.Enter And Keyboard.Modifiers = ModifierKeys.Shift Then
Txt.AcceptsReturn = True
Txt.TextWrapping = TextWrapping.Wrap
Txt.AppendText(Environment.NewLine)
End If
End Sub
End Class
@@ -1,29 +1,11 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports MS.Internal
Public Class InputExpanderVM
Inherits ViewModelBase
#Region "FIELDS & PROPERTIES"
' Variabile temporanea per salvare bShow
Private m_tmpbShow As Boolean
Private m_tmpInfoList As New ObservableCollection(Of InfoItem)
''' <summary>
''' Lista temporanea delle info
''' </summary>
Private Property tmpInfoList As ObservableCollection(Of InfoItem)
Get
Return m_tmpInfoList
End Get
Set(value As ObservableCollection(Of InfoItem))
m_tmpInfoList = value
OnPropertyChanged("tmpInfoList")
End Set
End Property
' Expander fields
Private m_IsExpanded As Boolean
Public Property IsExpanded As Boolean
@@ -158,47 +140,15 @@ Public Class InputExpanderVM
End Set
End Property
Private m_InfoList As New ObservableCollection(Of InfoItem)
''' <summary>
''' Lista delle info modificate
''' </summary>
Public Property InfoList As ObservableCollection(Of InfoItem)
Get
Return m_InfoList
End Get
Set(value As ObservableCollection(Of InfoItem))
m_InfoList = value
OnPropertyChanged("InfoList")
End Set
End Property
Private m_ComboSelectedIndex As Integer
Public Property ComboSelectedIndex As Integer
Get
Return m_ComboSelectedIndex
End Get
Set(value As Integer)
If m_tmpbShow Then Map.refProjectVM.SetLastInteger(value)
Map.refProjectVM.SetLastInteger(value)
m_ComboSelectedIndex = value
' Assegno l'indice selezionato ad una variabile temporanea per utilizzarlo quando rimuovo l'info dalla lista
Dim tmpComboSelectedIndex As Integer = ComboSelectedIndex
' Controllo se l'indice è maggiore o uguale a zero e la lista tmp contiene valori
If m_ComboSelectedIndex >= 0 AndAlso tmpInfoList.Count > 0 Then
' Controllo se la info è contenuta nella lista ComboItemsList
If ComboItemsList.Contains(tmpInfoList(m_ComboSelectedIndex).sKey) Then
' Aggiungo la info alla lista per visualizzarla
InfoList.Add(New InfoItem(tmpInfoList(m_ComboSelectedIndex).nId, tmpInfoList(m_ComboSelectedIndex).sKey, m_tmpInfoList(m_ComboSelectedIndex).sValour))
' Nascondo la combobox
ComboVisibility = Visibility.Collapsed
' Rimuovo la info dalla ComboItemsList
ComboItemsList.Remove(tmpInfoList(m_ComboSelectedIndex).sKey)
End If
' Rimuovo la info dalla tmpInfoList
tmpInfoList.Remove(tmpInfoList(tmpComboSelectedIndex))
End If
OnPropertyChanged("ComboSelectedIndex")
OnPropertyChanged("ComboItemsList")
OnPropertyChanged("InfoList")
End Set
End Property
@@ -227,43 +177,9 @@ Public Class InputExpanderVM
End Set
End Property
Private m_ShowInfoItemVisibility As Visibility
''' <summary>
''' Propietà visibilità bottone +
''' </summary>
Public Property ShowInfoItemVisibility As Visibility
Get
Return m_ShowInfoItemVisibility
End Get
Set(value As Visibility)
If value <> m_ShowInfoItemVisibility Then
m_ShowInfoItemVisibility = value
OnPropertyChanged("ShowInfoItemVisibility")
End If
End Set
End Property
Private m_InfoVisibility As Visibility
''' <summary>
''' Propietà visibilità lista info modificate
''' </summary>
Public Property InfoVisibility As Visibility
Get
Return m_InfoVisibility
End Get
Set(value As Visibility)
If value <> m_InfoVisibility Then
m_InfoVisibility = value
OnPropertyChanged("InfoVisibility")
End If
End Set
End Property
' Commands definition
Private m_cmdShow As ICommand
Private m_cmdDone As ICommand
Private m_cmdShowInfoItem As ICommand
Private m_cmdRemoveInfoItem As ICommand
#Region "Messages"
@@ -341,15 +257,6 @@ Public Class InputExpanderVM
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub Done(ByVal param As Object)
' Controllo se la lista contenente la info modificata sia presente
If InfoList.Count > 0 Then
' Ciclo sulla lista
For Each Item As InfoItem In InfoList
Map.refProjectVM.NotifyInputText((Item.Key & "=" & Item.Valour).Trim())
' Assegno a m_TextBox la info modificata
m_TextBox &= vbCrLf & (Item.Key & "=" & Item.Valour).Trim() & vbCrLf
Next
End If
Map.refProjectVM.Done(m_TextBox)
End Sub
@@ -362,30 +269,6 @@ Public Class InputExpanderVM
#End Region ' DoneCommand
#Region "ShowInfoItemCommand"
''' <summary>
''' Comando per la visualizzazione della combobox
''' </summary>
Public ReadOnly Property ShowInfoItemCommand As ICommand
Get
If m_cmdShowInfoItem Is Nothing Then
m_cmdShowInfoItem = New Command(AddressOf ShowInfoItem)
End If
Return m_cmdShowInfoItem
End Get
End Property
''' <summary>
''' Funzione per la visualizzazione della combobox
''' </summary>
''' <param name="param"></param>
Public Sub ShowInfoItem(ByVal param As Object)
ComboVisibility = Visibility.Visible
End Sub
#End Region ' ShowInfoItemCommand
#End Region
#Region "METHODS"
@@ -396,37 +279,13 @@ Public Class InputExpanderVM
TextBlock = PrepareInputBoxParam.sLabel
TextBox = ""
TextVisibility = Visibility.Visible
' Controllo se il titolo è uguale a INFO se si
If Title = EgtMsg(5359).ToUpper() Then
' Metto tmpbShow a false
m_tmpbShow = False
' Rendo visibile il pulsante che mostra la lista delle info
ShowInfoItemVisibility = Visibility.Visible
' Rendo visibile la lista delle info selezionate
InfoVisibility = Visibility.Visible
' Pulisco la lista tmpInfoList
tmpInfoList.Clear()
' Pulisco la lista InfoList
InfoList.Clear()
' Pulisco la lista ComboItemsList
ComboItemsList.Clear()
' Popolo la lista ComboItemsList
ComboInfo()
End If
End If
If PrepareInputBoxParam.sCheckLabel <> "" Then
CheckBoxText = PrepareInputBoxParam.sCheckLabel
CheckVisibility = Visibility.Visible
End If
If PrepareInputBoxParam.bShowCombo Then
' Assegno a tmpbShow PrepareInputBoxParam.bShowCombo
m_tmpbShow = PrepareInputBoxParam.bShowCombo
' Pulisco la lista ComboItemsList
ComboItemsList.Clear()
' Pulisco la lista tmpInfoList
tmpInfoList.Clear()
' Pulisco la lista InfoList
InfoList.Clear()
ComboVisibility = Visibility.Visible
End If
If PrepareInputBoxParam.bShowBtn Then
@@ -443,8 +302,6 @@ Public Class InputExpanderVM
CheckVisibility = Visibility.Collapsed
ComboVisibility = Visibility.Collapsed
ShowBtnVisibility = Visibility.Collapsed
ShowInfoItemVisibility = Visibility.Collapsed
InfoVisibility = Visibility.Collapsed
IsExpanded = False
IsEnabled = False
End Sub
@@ -472,44 +329,12 @@ Public Class InputExpanderVM
Private Function AddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean) As Boolean
ComboItemsList.Add(sText)
If bSelected Then
ComboSelectedIndex = ComboItemsList.Count - 1
End If
Return True
End Function
''' <summary>
''' Rimovi nota da info lista
''' </summary>
''' <param name="InfoItem">Informazione da eliminare</param>
Friend Sub RemoveItemInfo(InfoItem As InfoItem)
' Rimuovo info da lista modifica
InfoList.Remove(InfoItem)
' Riaggiungo la info eliminata
ComboItemsList.Add(InfoItem.sKey)
' Riaggiungo la info eliminata
tmpInfoList.Add(InfoItem)
End Sub
''' <summary>
''' Funzione che popola la lista ComboItemsList
''' </summary>
Private Sub ComboInfo()
'''''''''''''''''''''''''''''' Recuperare funzione egtgetallinfo quando sarà pronta
Dim val As Integer
If Not m_tmpbShow Then
For Ind As Integer = 0 To 6
val += Ind
tmpInfoList.Add(New InfoItem(Ind, "A" & +Ind, val.ToString()))
Next
For Each InfoItem As InfoItem In tmpInfoList
ComboItemsList.Add(InfoItem.sKey)
Next
End If
End Sub
#End Region ' Methods
End Class
@@ -69,7 +69,7 @@ Public Class LayerTreeViewItem
Return m_bOnOff
End Get
Set(value As Boolean)
'If Map.refProjectVM.GetController().GetStep() <> 0 Then Return
If Map.refProjectVM.GetController().GetStep() <> 0 Then Return
If m_bOnOff <> value Then
m_bOnOff = value
' se abilitato, eseguo operazione
@@ -1,9 +1,9 @@
<UserControl x:Class="ManageLayerExpanderV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:expression="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
xmlns:local="clr-namespace:EgtCAM5">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:expression="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
xmlns:local="clr-namespace:EgtCAM5">
<Expander IsExpanded="True" Style="{StaticResource ExpanderStyle}">
<Expander.Header>
@@ -20,11 +20,11 @@
<Button Content="{Binding NewLayerMsg}" Command="{Binding NewLayerCommand}" Height="30"/>
<Button Content="{Binding ColorMsg}" Command="{Binding LayerColorCommand}" Height="30"/>
</UniformGrid>
<TreeView x:Name="LayerTreeView" MinHeight="150" MaxHeight="250"
ItemsSource="{Binding Path=LayerList}"
VirtualizingStackPanel.IsVirtualizing = "True"
VirtualizingStackPanel.VirtualizationMode = "Recycling">
<TreeView Name="LayerTreeView" MinHeight="150" MaxHeight="250"
ItemsSource="{Binding Path=LayerList}"
VirtualizingStackPanel.IsVirtualizing = "True"
VirtualizingStackPanel.VirtualizationMode = "Recycling">
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="MouseDoubleClick">
<interactivity:InvokeCommandAction Command="{Binding TreeViewDoubleClickCommand}"/>
@@ -50,8 +50,8 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="0"
IsChecked="{Binding OnOff}" Visibility="{Binding IsHidden}" Focusable="True" Height="15" Width="15" Margin="0,0,5,0"/>
<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="0"
IsChecked="{Binding OnOff}" Visibility="{Binding IsHidden}" Focusable="False" Height="15" Width="15" Margin="0,0,5,0"/>
<Image Grid.Column="1" Source="{Binding PictureString}" Height="15" Margin="0,0,5,0"/>
<TextBlock Grid.Column="2" Text="{Binding Name}" Margin="0,0,5,0"/>
<Ellipse Grid.Column="3" Height="10" Width="10" Fill="{Binding LayerColor}" />
@@ -61,7 +61,7 @@
</TreeView.Resources>
<!--Style dei nodi CathegoryItem che li riquadra di azzurro quando clicckati ed elimina l'ombra grigia
che si presenta quando la categoria rimane vuota (ombra causata dal multibinding).-->
che si presenta quando la categoria rimane vuota (ombra causata dal multibinding).-->
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
@@ -528,7 +528,7 @@ Public Class ManageLayerExpanderVM
#Region "METHODS"
Private WithEvents ObjTreeTimer As New System.Windows.Threading.DispatcherTimer
Friend m_nObjTreeOldId As Integer = GDB_ID.NULL
Private m_nObjTreeOldId As Integer = GDB_ID.NULL
Private m_nObjTreeMenuId As Integer = GDB_ID.NULL
Private m_bEnableUpdateObjInObjTree As Boolean = True
@@ -177,17 +177,12 @@ Public Class EstimationsExpanderVM
If Not bOk Then Return False
' Calcolo della stima
If Not EgtEstimate(sEstFile, sInfo) Then
Dim nErr As Integer = EgtGetLastMachMgrErrorId()
If nErr = 1000 Then
MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr = 1001 Then
MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr <> 0 Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
sErr = sErr.Replace("Cnc", "Est")
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
MessageBox.Show(EgtMsg(5317), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error)
MessageBox.Show(EgtMsg(MSG_SIMULATION + 17), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
End If
bOk = False
End If
@@ -126,16 +126,6 @@ Public Class MachiningParameterExpanderVM
m_SliderValue = 1
NotifyPropertyChanged(NameOf(SliderValue))
End Sub
Friend Sub SetSliderValue(value As Integer)
Dim nOldSliderValue As Integer = m_SliderValue
m_SliderValue = Math.Min( Math.Max( m_SliderValue + value, 1), m_SliderScale)
Dim nStep As Integer = m_SliderValue - nOldSliderValue
If nStep = 0 Then Return
Dim nId As Integer = EgtPreviewMachiningTool(m_nPtEntId, nStep)
If nId <> GDB_ID.NULL Then m_nPtEntId = nId
EgtDraw()
NotifyPropertyChanged(NameOf(SliderValue))
End Sub
Dim WoodDrillParamExpanderV As WoodDrillingParameterExpanderV
Dim WoodSawParamExpanderV As WoodSawingParameterExpanderV
@@ -106,32 +106,26 @@ Public Class OperationListBoxItem
Dim EntityIndex As Integer = 0
Dim SubEntityIndex As Integer = 0
While EgtGetMachiningGeometry(CountIndex, EntityIndex, SubEntityIndex)
EgtSelectObj(EntityIndex)
If EgtGetType(EntityIndex) = GDB_TY.SRF_MESH Or EgtGetType(EntityIndex) = GDB_TY.SRF_FRGN Then
EgtSelectObj( EntityIndex)
If EgtGetType( EntityIndex) = GDB_TY.SRF_MESH Or EgtGetType( EntityIndex) = GDB_TY.SRF_FRGN Then
SelData.AddIdSub(EntityIndex, SubEntityIndex)
End If
CountIndex += 1
End While
End If
' Notifico al contentcontrol OperationParameter di aggiornarsi
If Not IsNothing(Map.refOperationParametersExpanderVM) Then
If Not IsNothing( Map.refOperationParametersExpanderVM) Then
Map.refOperationParametersExpanderVM.OnPropertyChanged("OperationParameters")
End If
Map.refOperationsListExpanderVM.OnPropertyChanged("MoveUp_IsEnabled")
Map.refOperationsListExpanderVM.OnPropertyChanged("MoveDown_IsEnabled")
' Notifico l'operazione selezionata all'expander con l'albero delle lavorazioni aggiungibili
If Not IsNothing(Map.refMachiningTreeExpanderVM) Then
If Not IsNothing( Map.refMachiningTreeExpanderVM) Then
Map.refMachiningTreeExpanderVM.nSelectedOperationId = Me.Id
End If
' Aggiorno visualizzazione
EgtDraw()
End If
' Resetto valori slider
If Not IsNothing(Map.refMachiningParameterExpanderVM) Then
Map.refMachiningParameterExpanderVM.SetSliderScale(EgtGetPreviewMachiningToolStepCount())
Map.refMachiningParameterExpanderVM.ResetSliderValue()
End If
'OnPropertyChanged("ToolExpanderHeader")
Map.refOperationsListExpanderVM.OnPropertyChanged("DuplicateCmd_IsEnabled")
Map.refOperationsListExpanderVM.OnPropertyChanged("MachToDb_IsEnabled")
@@ -101,11 +101,9 @@ Public Class SimulationExpanderVM
If Not GetCncFileName(True, sCncFile, sInfo) Then Return
' Eseguo
If Not EgtGenerate(sCncFile, sInfo) Then
Dim nErr As Integer = EgtGetLastMachMgrErrorId()
Dim nErr = EgtGetLastMachMgrErrorId()
If nErr = 1000 Then
MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr = 1001 Then
MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
@@ -227,16 +225,11 @@ Public Class SimulationExpanderVM
UpdateUI()
' Messaggio in caso di errore
If Not bOk Then
Dim nErr As Integer = EgtGetLastMachMgrErrorId()
If nErr = 1000 Then
MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr = 1001 Then
MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr <> 0 Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
Else
MessageBox.Show(EgtMsg(15010), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
End If
End If
' Imposto stato corrente
@@ -274,16 +267,11 @@ Public Class SimulationExpanderVM
Map.refEstimationsExpanderVM.NotifyPropertyChanged("Estimation_IsEnabled")
m_bStopOnNextCollision = True
If Not EgtSimStart(False) Then
Dim nErr As Integer = EgtGetLastMachMgrErrorId()
If nErr = 1000 Then
MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr = 1001 Then
MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr <> 0 Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
Else
MessageBox.Show(EgtMsg(15010), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
End If
SetSimulationStatus(MCH_SIM_ST.UI_STOP)
End If
-3
View File
@@ -56,7 +56,6 @@ Friend Module OptionModule
Friend m_SelGeomSurfRoughing As SceneSelModeOpt
Friend m_SelGeomWaterJetting As SceneSelModeOpt
Friend m_SelGeomFiveAxMilling As SceneSelModeOpt
Friend m_SelVMillQuality As VMillSelTypeOpt
' Flag per aggiungere una nuova lavorazione alla fine della fase o subito dopo la lavorazione selezionata
Friend m_bNewMachiningIsLastOne As Boolean
' Variabile che indica se usare lo script per calcolare automaticamente la disposizione quando si passa in lavorazione
@@ -148,8 +147,6 @@ Friend Module OptionModule
m_SelGeomSurfRoughing = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
Temp = GetPrivateProfileInt(S_MACH, K_SELGEOMFIVEAXMILLING, -1)
m_SelGeomFiveAxMilling = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
Temp = GetPrivateProfileInt(S_MACH, K_SELVMILLQUALITY, 0)
m_SelVMillQuality = If(Temp < -2 Or Temp > 2, VMillSelTypeOpt.HIGHER, DirectCast(Temp, VMillSelTypeOpt))
m_SelGeomWaterJetting = SceneSelModeOpt.PARTCURVES
' Inizializzo variabile che indica posizione nuova operazione di lavorazione
m_bNewMachiningIsLastOne = (GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0)
+20 -32
View File
@@ -9,12 +9,11 @@
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
MinWidth="400" MinHeight="382"
Width="400" Height="575"
Width="400" Height="520"
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<EgtWPFLib5:EgtCustomWindow.Resources>
<local:GeomTypeConverter x:Key="GeomTypeConverter"/>
<local:VMillTypeConverter x:Key="VMillTypeConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources>
<TabControl Margin="5,5,5,5">
@@ -317,41 +316,30 @@
</UniformGrid>
</GroupBox>
<Grid Margin="10,5,10,0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Margin="5,5,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<UniformGrid Columns="2" Grid.ColumnSpan="2" Margin="0,5,0,0">
<TextBlock Text="{Binding VMillQualityMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding VMillTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedVMillTypeType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource VMillTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</UniformGrid>
<TextBlock Grid.Row="1" Text="{Binding NewMachiningPosMsg}" VerticalAlignment="Center"
Margin="0,8,0,5"/>
<CheckBox Grid.Row="1" Grid.Column="1" IsChecked="{Binding NewMachiningIsLastOne}"
Margin="4,8,0,0" VerticalAlignment="Center"/>
<TextBlock Grid.Row="2" Text="{Binding UseDispositionScriptMsg}"
VerticalAlignment="Center" Margin="0,5,0,5"/>
<CheckBox Grid.Row="2" Grid.Column="1" IsChecked="{Binding UseDispositionScript}"
Margin="4,5,0,0" VerticalAlignment="Center"/>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding NewMachiningPosMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,0,0,5"/>
<CheckBox IsChecked="{Binding NewMachiningIsLastOne}"
Grid.Column="1" Grid.Row="0" Margin="4,0,0,0" VerticalAlignment="Center"/>
<TextBlock Text="{Binding UseDispositionScriptMsg}" VerticalAlignment="Center"
Grid.Row="1" Margin="0,0,0,5"/>
<CheckBox IsChecked="{Binding UseDispositionScript}"
Grid.Column="1" Grid.Row="1" Margin="4,0,0,0" VerticalAlignment="Center"/>
</Grid>
<Grid Margin="5,5,5,0">
<Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
<Grid Margin="5,5,5,0">
<Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
<UniformGrid Rows="2">
<Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,10,100,5"/>
<Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/>
</UniformGrid>
</StackPanel>
</TabItem>
+113 -164
View File
@@ -2,7 +2,6 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports System.Globalization
Public Class OptionWindowVM
Inherits VMBase
@@ -20,13 +19,6 @@ Public Class OptionWindowVM
End Get
End Property
Private m_VMillTypeList As ObservableCollection(Of VMillSelTypeOpt) = New ObservableCollection(Of VMillSelTypeOpt)({VMillSelTypeOpt.LOWER, VMillSelTypeOpt.LOW, VMillSelTypeOpt.STANDARD, VMillSelTypeOpt.HIGH, VMillSelTypeOpt.HIGHER})
Public ReadOnly Property VMillTypeList As ObservableCollection(Of VMillSelTypeOpt)
Get
Return m_VMillTypeList
End Get
End Property
Private m_UnitMeasureList As List(Of String) = New List(Of String)({"mm", "inch", EgtMsg(MSG_OPTIONPAGE + 45)})
Public ReadOnly Property UnitMeasureList As List(Of String)
Get
@@ -200,17 +192,6 @@ Public Class OptionWindowVM
End Set
End Property
Public Property SelectedVMillTypeType As VMillSelTypeOpt
Get
Return OptionModule.m_SelVMillQuality
End Get
Set(value As VMillSelTypeOpt)
If WritePrivateProfileString(S_MACH, K_SELVMILLQUALITY, CInt(value).ToString()) Then
OptionModule.m_SelVMillQuality = value
End If
End Set
End Property
Public Property GeometryTolerance As String
Get
Return LenToString(OptionModule.m_dGeometryTolerance, 5)
@@ -287,8 +268,8 @@ Public Class OptionWindowVM
End Get
Set(value As Boolean)
OptionModule.m_bThickLine = value
WritePrivateProfileString(S_SCENE, K_LINEWIDTH, If(value, "2", "1"))
EgtSetLineAttribs(If(value, 2, 1))
WritePrivateProfileString(S_SCENE, K_LINEWIDTH, If( value, "2", "1"))
EgtSetLineAttribs( If( value, 2, 1))
End Set
End Property
@@ -608,7 +589,7 @@ Public Class OptionWindowVM
End Get
Set(value As Boolean)
OptionModule.m_bSpecialOn = value
WritePrivateProfileString(S_SPECIAL, K_SPECIALENABLE, If(value, "1", "0"))
WritePrivateProfileString(S_SPECIAL, K_SPECIALENABLE, If( value, "1", "0"))
End Set
End Property
@@ -628,7 +609,7 @@ Public Class OptionWindowVM
End Get
Set(value As Boolean)
OptionModule.m_bBeamOn = value
WritePrivateProfileString(S_BEAM, K_BEAMENABLE, If(value, "1", "0"))
WritePrivateProfileString(S_BEAM, K_BEAMENABLE, If( value, "1", "0"))
End Set
End Property
@@ -648,7 +629,7 @@ Public Class OptionWindowVM
End Get
Set(value As Boolean)
OptionModule.m_bWallOn = value
WritePrivateProfileString(S_WALL, K_WALLENABLE, If(value, "1", "0"))
WritePrivateProfileString(S_WALL, K_WALLENABLE, If( value, "1", "0"))
End Set
End Property
@@ -663,7 +644,7 @@ Public Class OptionWindowVM
End Get
Set(value As Boolean)
OptionModule.m_bDoorsOn = value
WritePrivateProfileString(S_DOORS, K_DDFENABLE, If(value, "1", "0"))
WritePrivateProfileString(S_DOORS, K_DDFENABLE, If( value, "1", "0"))
End Set
End Property
@@ -678,7 +659,7 @@ Public Class OptionWindowVM
End Get
Set(value As Boolean)
OptionModule.m_bGunstockOn = value
WritePrivateProfileString(S_GUNSTOCK, K_GUNSTOCKENABLE, If(value, "1", "0"))
WritePrivateProfileString(S_GUNSTOCK, K_GUNSTOCKENABLE, If( value, "1", "0"))
End Set
End Property
@@ -736,17 +717,17 @@ Public Class OptionWindowVM
End Property
Public ReadOnly Property ThickLineMsg As String
Get
Return EgtMsg(6536) ' Linee spesse
Return EgtMsg( 6536) ' Linee spesse
End Get
End Property
Public ReadOnly Property SmoothTriMeshMsg As String
Get
Return EgtMsg(6518) ' Superfici smussate
Return EgtMsg( 6518) ' Superfici smussate
End Get
End Property
Public ReadOnly Property UpdateLicenceMsg As String
Get
Return EgtMsg(6553) ' Aggiorna licenza
Return EgtMsg( 6553) ' Aggiorna licenza
End Get
End Property
@@ -985,13 +966,6 @@ Public Class OptionWindowVM
End Get
End Property
Public ReadOnly Property VMillQualityMsg As String
Get
Return EgtMsg(31214)
End Get
End Property
#End Region
#Region "COMMANDS"
@@ -1205,135 +1179,135 @@ Public Class OptionWindowVM
Dim sMachDir As String = Path.Combine(IniFile.m_sMachinesRoot, sMachName)
' Preparo direttorio temporaneo
Dim sTempDir As String = Path.Combine(IniFile.m_sMachinesRoot, "Temp")
If My.Computer.FileSystem.DirectoryExists(sTempDir) Then
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CreateDirectory(sTempDir)
My.Computer.FileSystem.CreateDirectory( sTempDir)
' Unzip nel direttorio temporaneo
Using zip As New Ionic.Zip.ZipFile(sMachZip)
zip.ExtractAll(sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
End Using
' Se non è una macchina segnalo il problema ed esco
If Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".ini")) Or
Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".mlde")) Then
If Not My.Computer.FileSystem.FileExists( Path.Combine( sTempDir, sMachName, sMachName & ".ini")) Or
Not My.Computer.FileSystem.FileExists( Path.Combine( sTempDir, sMachName, sMachName & ".mlde")) Then
' Il file {0} non contiene una macchina - Avviso
Dim sOut As String = String.Format(EgtMsg(MSG_OPTIONPAGE + 29), sMachZip)
MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Imposto data e ora correnti al file mlde della macchina
Try
File.SetLastWriteTime(Path.Combine(sTempDir, sMachName, sMachName & ".mlde"), System.DateTime.Now)
File.SetLastWriteTime( Path.Combine( sTempDir, sMachName, sMachName & ".mlde"), System.DateTime.Now)
Catch ex As Exception
End Try
' Verifico esistenza di una macchina con lo stesso nome
Dim bOldExists As Boolean = My.Computer.FileSystem.DirectoryExists(sMachDir)
Dim bOldExists As Boolean = My.Computer.FileSystem.DirectoryExists( sMachDir)
Dim bUpdate As Boolean = True
If bOldExists Then
Dim MachBox As New MachineBox(Application.Current.MainWindow, sMachName)
Select Case MachBox.ShowDialog()
Case MessageBoxResult.Yes
bUpdate = False
Case MessageBoxResult.No
bUpdate = True
Case MessageBoxResult.Cancel
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
Dim MachBox As New MachineBox( Application.Current.MainWindow, sMachName)
Select MachBox.ShowDialog()
Case MessageBoxResult.Yes
bUpdate = False
Case MessageBoxResult.No
bUpdate = True
Case MessageBoxResult.Cancel
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End Select
' Faccio una copia di backup della macchina corrente
Dim sBackupDir As String = sMachDir & ".old"
If My.Computer.FileSystem.DirectoryExists(sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory(sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
Try
My.Computer.FileSystem.MoveDirectory(sMachDir, sBackupDir, True)
My.Computer.FileSystem.MoveDirectory( sMachDir, sBackupDir, True)
Catch ex As Exception
' Ripristino lo stato originale ed esco
My.Computer.FileSystem.MoveDirectory(sBackupDir, sMachDir, True)
My.Computer.FileSystem.MoveDirectory( sBackupDir, sMachDir, True)
' L'aggiornamento della macchina "{0}" non è riuscito.
Dim sKo As String = String.Format(EgtMsg(MSG_OPTIONPAGE + 35), sMachName)
EgtOutLog(sKo)
EgtOutLog( sKo)
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
Return
End Try
End If
' Installo la macchina
My.Computer.FileSystem.MoveDirectory(Path.Combine(sTempDir, sMachName), sMachDir, True)
My.Computer.FileSystem.MoveDirectory( Path.Combine( sTempDir, sMachName), sMachDir, True)
' Se è un aggiornamento, recupero utensili, lavorazioni, attrezzaggi e dati per travi
If bOldExists And bUpdate Then
Dim sBackupDir As String = sMachDir & ".old"
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Tools") Then
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Tools") Then
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\Tools", FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Tools") Then
If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Tools") Then
My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Tools", FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\Tools", sMachDir & "\Tools", True)
My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Tools", sMachDir & "\Tools", True)
End If
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Machinings") Then
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Machinings") Then
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\Machinings", FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Machinings") Then
If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Machinings") Then
My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Machinings", FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\Machinings", sMachDir & "\Machinings", True)
My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Machinings", sMachDir & "\Machinings", True)
End If
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\SetUp") Then
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\SetUp") Then
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\SetUp", FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\SetUp") Then
If My.Computer.FileSystem.DirectoryExists( sMachDir & "\SetUp") Then
My.Computer.FileSystem.DeleteDirectory( sMachDir & "\SetUp", FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\SetUp", sMachDir & "\SetUp", True)
My.Computer.FileSystem.CopyDirectory( sBackupDir & "\SetUp", sMachDir & "\SetUp", True)
End If
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Beam") Then
If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Beam") Then
' Flag per sovrascrivere vecchio file BeamData.lua con nuovo
Dim bBeamDataExists As Boolean = False
Const sBeamData As String = "\BeamData.lua"
' Flag per sovrascrivere vecchio file MachiningTypes.ini
Dim bMchgTypesExists As Boolean = False
Const sMchgTypes As String = "\MachiningTypes.ini"
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Beam") Then
If My.Computer.FileSystem.FileExists(sMachDir & "\Beam" & sBeamData) Then
If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Beam") Then
If My.Computer.FileSystem.FileExists( sMachDir & "\Beam" & sBeamData) Then
bBeamDataExists = True
My.Computer.FileSystem.MoveFile(sMachDir & "\Beam" & sBeamData, sMachDir & sBeamData, True)
My.Computer.FileSystem.MoveFile( sMachDir & "\Beam" & sBeamData, sMachDir & sBeamData, True)
End If
If My.Computer.FileSystem.FileExists(sMachDir & "\Beam" & sMchgTypes) Then
If My.Computer.FileSystem.FileExists( sMachDir & "\Beam" & sMchgTypes) Then
bMchgTypesExists = True
My.Computer.FileSystem.MoveFile(sMachDir & "\Beam" & sMchgTypes, sMachDir & sMchgTypes, True)
My.Computer.FileSystem.MoveFile( sMachDir & "\Beam" & sMchgTypes, sMachDir & sMchgTypes, True)
End If
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\Beam", FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Beam", FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\Beam", sMachDir & "\Beam", True)
If bBeamDataExists Then My.Computer.FileSystem.MoveFile(sMachDir & sBeamData, sMachDir & "\Beam" & sBeamData, True)
If bMchgTypesExists Then My.Computer.FileSystem.MoveFile(sMachDir & sMchgTypes, sMachDir & "\Beam" & sMchgTypes, True)
My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Beam", sMachDir & "\Beam", True)
If bBeamDataExists Then My.Computer.FileSystem.MoveFile( sMachDir & sBeamData, sMachDir & "\Beam" & sBeamData, True)
If bMchgTypesExists Then My.Computer.FileSystem.MoveFile( sMachDir & sMchgTypes, sMachDir & "\Beam" & sMchgTypes, True)
End If
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Wall") Then
If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Wall") Then
' Flag per sovrascrittura vecchio file WallData.lua con nuovo
Dim bWallDataExists As Boolean = False
Const sWallData As String = "\WallData.lua"
' Flag per sovrascrivere vecchio file MachiningTypes.ini
Dim bMchgTypesExists As Boolean = False
Const sMchgTypes As String = "\MachiningTypes.ini"
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Wall") Then
If My.Computer.FileSystem.FileExists(sMachDir & "\Wall" & sWallData) Then
If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Wall") Then
If My.Computer.FileSystem.FileExists( sMachDir & "\Wall" & sWallData) Then
bWallDataExists = True
My.Computer.FileSystem.MoveFile(sMachDir & "\Wall" & sWallData, sMachDir & sWallData, True)
My.Computer.FileSystem.MoveFile( sMachDir & "\Wall" & sWallData, sMachDir & sWallData, True)
End If
If My.Computer.FileSystem.FileExists(sMachDir & "\Wall" & sMchgTypes) Then
If My.Computer.FileSystem.FileExists( sMachDir & "\Wall" & sMchgTypes) Then
bMchgTypesExists = True
My.Computer.FileSystem.MoveFile(sMachDir & "\Wall" & sMchgTypes, sMachDir & sMchgTypes, True)
My.Computer.FileSystem.MoveFile( sMachDir & "\Wall" & sMchgTypes, sMachDir & sMchgTypes, True)
End If
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\Wall", FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Wall", FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\Wall", sMachDir & "\Wall", True)
If bWallDataExists Then My.Computer.FileSystem.MoveFile(sMachDir & sWallData, sMachDir & "\Wall" & sWallData, True)
If bMchgTypesExists Then My.Computer.FileSystem.MoveFile(sMachDir & sMchgTypes, sMachDir & "\Wall" & sMchgTypes, True)
My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Wall", sMachDir & "\Wall", True)
If bWallDataExists Then My.Computer.FileSystem.MoveFile( sMachDir & sWallData, sMachDir & "\Wall" & sWallData, True)
If bMchgTypesExists Then My.Computer.FileSystem.MoveFile( sMachDir & sMchgTypes, sMachDir & "\Wall" & sMchgTypes, True)
End If
End If
'La macchina "{0}" è stata aggiornata con successo.
Dim sOk As String = String.Format(EgtMsg(MSG_OPTIONPAGE + 30), sMachName)
EgtOutLog(sOk)
EgtOutLog( sOk)
MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
' Rimuovo il direttorio temporaneo
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
' Aggiorno la lista delle macchina
Map.refMachinePanelVM.InsertMachine(sMachDir)
End Sub
@@ -1381,7 +1355,7 @@ Public Class OptionWindowVM
' aggiungo i file della Macchina
Dim sMachineDir As String = IniFile.m_sMachinesRoot & "\" & sCurrMachineName
If Directory.Exists(sMachineDir) Then
zip.AddSelectedFiles("name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True)
zip.AddSelectedFiles( "name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True)
End If
' salvo lo zip
zip.Save()
@@ -1392,7 +1366,7 @@ Public Class OptionWindowVM
Dim sKo As String = String.Format(EgtMsg(6551), sCurrMachineName)
EgtOutLog(sKo)
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
Return
return
End Try
'La macchina "{0}" è stata esportata con successo.
Dim sOk As String = String.Format(EgtMsg(6552), sCurrMachineName)
@@ -1417,10 +1391,10 @@ Public Class OptionWindowVM
Dim sExeVer As String = IniFile.GetProgramVersion()
' Verifico presenza di una precedente installazione del Beam
Dim sBeamVer As String = ""
IniFile.GetSpecialLuaVersion(IniFile.m_sBeamDirPath, sBeamVer)
If String.IsNullOrEmpty(sBeamVer) Then
IniFile.GetSpecialLuaVersion( IniFile.m_sBeamDirPath, sBeamVer)
If String.IsNullOrEmpty( sBeamVer) Then
' Il modulo "{0}" non è stato trovato, impossibile aggiornare. - Avviso
Dim sOut As String = String.Format(EgtMsg(6555), "Beam")
Dim sOut As String = String.Format(EgtMsg(6555), "Beam")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Esco
Return
@@ -1436,26 +1410,26 @@ Public Class OptionWindowVM
Dim sBeamZip As String = BeamDlg.FileName
' Preparo direttorio temporaneo
Dim sTempDir As String = Path.Combine(IniFile.m_sTempDir, "Beam")
If My.Computer.FileSystem.DirectoryExists(sTempDir) Then
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CreateDirectory(sTempDir)
My.Computer.FileSystem.CreateDirectory( sTempDir)
' Unzip nel direttorio temporaneo
Using zip As New Ionic.Zip.ZipFile(sBeamZip)
zip.ExtractAll(sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
End Using
' Recupero i dati del nuovo Beam
Dim sNewName = ""
Dim sNewVer = ""
Dim sNewMinExe = ""
IniFile.GetSpecialLuaData(sTempDir, sNewName, sNewVer, sNewMinExe)
IniFile.GetSpecialLuaData( sTempDir, sNewName, sNewVer, sNewMinExe)
' Verifico che sia veramente il Beam
If String.Compare(sNewName, "Beam") <> 0 Then
' Il file zip non contiene il modulo "{0}". - Avviso
Dim sOut As String = String.Format(EgtMsg(6556), "Beam")
Dim sOut As String = String.Format(EgtMsg(6556), "Beam")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Verifico la versione minima del programma
@@ -1464,42 +1438,42 @@ Public Class OptionWindowVM
Dim sOut As String = String.Format(EgtMsg(6557), "Beam", sNewMinExe)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Verifico la versione del Beam e se più vecchia chiedo cosa fare
If String.Compare(sNewVer, sBeamVer) < 0 Then
' La versione del nuovo modulo "{0}" è più vecchia dell'attuale. Vuoi sovrascrivere lo stesso ?
Dim sOut As String = String.Format(EgtMsg(6558), "Beam")
If MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then
if MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
End If
' Faccio una copia di backup del Beam corrente
Dim sBackupDir As String = IniFile.m_sBeamDirPath & ".old"
If My.Computer.FileSystem.DirectoryExists(sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory(sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
Try
My.Computer.FileSystem.MoveDirectory(IniFile.m_sBeamDirPath, sBackupDir, True)
My.Computer.FileSystem.MoveDirectory( IniFile.m_sBeamDirPath, sBackupDir, True)
Catch ex As Exception
' Ripristino lo stato originale ed esco
My.Computer.FileSystem.MoveDirectory(sBackupDir, IniFile.m_sBeamDirPath, True)
My.Computer.FileSystem.MoveDirectory( sBackupDir, IniFile.m_sBeamDirPath, True)
' L'aggiornamento del modulo "{0}" non è riuscito. - Errore
Dim sOut As String = String.Format(EgtMsg(6559), "Beam")
EgtOutLog(sOut)
EgtOutLog( sOut)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End Try
' Installo il Beam
My.Computer.FileSystem.MoveDirectory(sTempDir, IniFile.m_sBeamDirPath, True)
My.Computer.FileSystem.MoveDirectory( sTempDir, IniFile.m_sBeamDirPath, True)
' Il modulo "{0}" è stata aggiornato con successo. - Info
Dim sOk As String = String.Format(EgtMsg(6560), "Beam")
EgtOutLog(sOk)
EgtOutLog( sOk)
MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
End Sub
@@ -1521,10 +1495,10 @@ Public Class OptionWindowVM
Dim sExeVer As String = IniFile.GetProgramVersion()
' Verifico presenza di una precedente installazione del Wall
Dim sWallVer As String = ""
IniFile.GetSpecialLuaVersion(IniFile.m_sWallDirPath, sWallVer)
If String.IsNullOrEmpty(sWallVer) Then
IniFile.GetSpecialLuaVersion( IniFile.m_sWallDirPath, sWallVer)
If String.IsNullOrEmpty( sWallVer) Then
' Il modulo "{0}" non è stato trovato, impossibile aggiornare. - Avviso
Dim sOut As String = String.Format(EgtMsg(6555), "Wall")
Dim sOut As String = String.Format(EgtMsg(6555), "Wall")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Esco
Return
@@ -1540,26 +1514,26 @@ Public Class OptionWindowVM
Dim sWallZip As String = WallDlg.FileName
' Preparo direttorio temporaneo
Dim sTempDir As String = Path.Combine(IniFile.m_sTempDir, "Wall")
If My.Computer.FileSystem.DirectoryExists(sTempDir) Then
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CreateDirectory(sTempDir)
My.Computer.FileSystem.CreateDirectory( sTempDir)
' Unzip nel direttorio temporaneo
Using zip As New Ionic.Zip.ZipFile(sWallZip)
zip.ExtractAll(sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
End Using
' Recupero i dati del nuovo Wall
Dim sNewName = ""
Dim sNewVer = ""
Dim sNewMinExe = ""
IniFile.GetSpecialLuaData(sTempDir, sNewName, sNewVer, sNewMinExe)
IniFile.GetSpecialLuaData( sTempDir, sNewName, sNewVer, sNewMinExe)
' Verifico che sia veramente il Wall
If String.Compare(sNewName, "Wall") <> 0 Then
' Il file zip non contiene il modulo "{0}". - Avviso
Dim sOut As String = String.Format(EgtMsg(6556), "Wall")
Dim sOut As String = String.Format(EgtMsg(6556), "Wall")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Verifico la versione minima del programma
@@ -1568,42 +1542,42 @@ Public Class OptionWindowVM
Dim sOut As String = String.Format(EgtMsg(6557), "Wall", sNewMinExe)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Verifico la versione del Wall e se più vecchia chiedo cosa fare
If String.Compare(sNewVer, sWallVer) < 0 Then
' La versione del nuovo modulo "{0}" è più vecchia dell'attuale. Vuoi sovrascrivere lo stesso ?
Dim sOut As String = String.Format(EgtMsg(6558), "Wall")
If MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then
if MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
End If
' Faccio una copia di backup del Wall corrente
Dim sBackupDir As String = IniFile.m_sWallDirPath & ".old"
If My.Computer.FileSystem.DirectoryExists(sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory(sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
Try
My.Computer.FileSystem.MoveDirectory(IniFile.m_sWallDirPath, sBackupDir, True)
My.Computer.FileSystem.MoveDirectory( IniFile.m_sWallDirPath, sBackupDir, True)
Catch ex As Exception
' Ripristino lo stato originale ed esco
My.Computer.FileSystem.MoveDirectory(sBackupDir, IniFile.m_sWallDirPath, True)
My.Computer.FileSystem.MoveDirectory( sBackupDir, IniFile.m_sWallDirPath, True)
' L'aggiornamento del modulo "{0}" non è riuscito. - Errore
Dim sOut As String = String.Format(EgtMsg(6559), "Wall")
EgtOutLog(sOut)
EgtOutLog( sOut)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End Try
' Installo il Wall
My.Computer.FileSystem.MoveDirectory(sTempDir, IniFile.m_sWallDirPath, True)
My.Computer.FileSystem.MoveDirectory( sTempDir, IniFile.m_sWallDirPath, True)
' Il modulo "{0}" è stata aggiornato con successo. - Info
Dim sOk As String = String.Format(EgtMsg(6560), "Wall")
EgtOutLog(sOk)
EgtOutLog( sOk)
MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
End Sub
@@ -1691,29 +1665,4 @@ Public Class GeomTypeConverter
Throw New NotImplementedException
End Function
End Class
Public Class VMillTypeConverter
Implements IValueConverter
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
Select Case CInt(value)
Case VMillSelTypeOpt.LOWER
Return EgtMsg(31215)
Case VMillSelTypeOpt.LOW
Return EgtMsg(31216)
Case VMillSelTypeOpt.STANDARD
Return EgtMsg(31217)
Case VMillSelTypeOpt.HIGH
Return EgtMsg(31218)
Case VMillSelTypeOpt.HIGHER
Return EgtMsg(31219)
Case Else
Return ""
End Select
End Function
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class
+11 -56
View File
@@ -4,7 +4,7 @@ Imports System.IO
Imports System.Globalization
Imports EgtUILib
Imports EgtWPFLib5
Imports System.Windows.Forms.AxHost
Imports EgtWPFLib5.EgtFloating
Public Class ProjectVM
Inherits TabViewModel
@@ -58,16 +58,14 @@ Public Class ProjectVM
End Get
End Property
#End Region
#Region "EGTUILIB FIELDS"
Private m_bCPlaneTypePos As Boolean
Private m_bCPlaneTypePos As Boolean
' Variabile per implementazione eventi
Private m_InputText As String
Friend bSelObjOnScene As Boolean = False
#End Region
@@ -246,14 +244,14 @@ Public Class ProjectVM
Dim sTitle As String = EgtMsg(10101)
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
End If
' Se altrimenti manca il collegamento con la chiave di rete
' Se altrimenti manca il collegamento con la chiave di rete
ElseIf IniFile.m_nKeyLevel = -9 Then
EgtOutLog("Missing Link with Net Dongle")
' Box di avviso chiave mancante : "Collegamento con la Chiave di rete non riuscito. \n Verificare la connessione." "Errore"
Dim sText As String = EgtMsg(10108) & vbCrLf & EgtMsg(10109)
Dim sTitle As String = EgtMsg(10101)
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
' Altrimenti manca la licenza
' Altrimenti manca la licenza
Else
EgtOutLog("Problems with Licence")
' Box di avviso licenza con problemi : sKeyInfo \n "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
@@ -309,13 +307,10 @@ Public Class ProjectVM
Dim nLineWidth As Integer = 1
nLineWidth = GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, nLineWidth)
m_ProjectScene.SetLineWidth(nLineWidth)
' imposto colori di evidenziazione
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
m_ProjectScene.SetMarkMaterial(MarkColor)
Dim Mark2Color As New Color3d(255, 64, 64)
GetPrivateProfileColor(S_SCENE, K_MARK2, Mark2Color)
m_ProjectScene.SetMark2Material(Mark2Color)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
@@ -488,7 +483,7 @@ Public Class ProjectVM
End If
' Esecuzione
bOk = ExecBeam(sFile, sMachine, nFlag, True)
' altrimenti pareti
' altrimenti pareti
Else
' Verifica abilitazione elaborazione pareti
If Not VerifyWall(sFile, sMachine, nFlag) Then
@@ -502,12 +497,12 @@ Public Class ProjectVM
If nFlag = 0 Or nFlag = 3 Or nFlag = 4 Then
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
' Altrimenti se richiesta visualizzazione DB utensili
' Altrimenti se richiesta visualizzazione DB utensili
ElseIf nFlag = 11 And bOk Then
MyMachinePanelVM.ToolDb()
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
' Altrimenti se richiesta visualizzazione DB lavorazioni
' Altrimenti se richiesta visualizzazione DB lavorazioni
ElseIf nFlag = 12 And bOk Then
MyMachinePanelVM.MachDb()
If bBeam Then
@@ -517,7 +512,7 @@ Public Class ProjectVM
End If
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
' Altrimenti se errore
' Altrimenti se errore
ElseIf Not bOk Then
EgtZoom(ZM.ALL)
End If
@@ -1325,25 +1320,6 @@ Public Class ProjectVM
If Not EgtIsSelectedObj(nId) Then m_Controller.MouseSelectedObj(nId, bLast)
Else
m_Controller.MouseSelectedObj(nId, bLast)
' Recupero primo layer selezionato
Dim nFirstSelId As Integer = EgtGetFirstSelectedObj()
' Se viene selezionato un layer diverso deseleziono il layer precedente
If nFirstSelId <> nId Then
SetLastInteger(nFirstSelId)
Map.refProjectVM.ExecuteCommand(Controller.CMD.DESELECTPARTLAYEROBJ)
End If
' Selezione layer in albero
bSelObjOnScene = True
Map.refManageLayerExpanderVM.UpdateObjInObjTree(nId)
Map.refManageLayerExpanderVM.SelectIdInObjTree(nId)
Map.refManageLayerExpanderVM.UpdateObjTree()
Map.refProjectVM.ExecuteCommand(Controller.CMD.SETCURRPARTLAYER)
' Cancello geometria e info di eventuale precedente analisi
Analyze.ClearAnalyzeGroup()
Map.refStatusBarVM.NotifyStatusOutput("")
EgtDraw()
bSelObjOnScene = False
End If
End Sub
@@ -1414,7 +1390,7 @@ Public Class ProjectVM
If nFac <> -1 Then
' Visualizzo la normale e il contorno della faccia
Analyze.CreateAnalyzeGroup()
Analyze.CreateFacetNormal(nId, nFac)
Analyze.CreateNormal(nId, nFac)
Analyze.CreateFacetLoops(nId, nFac)
' Recupero i dati (in globale o griglia a seconda della impostazione)
Dim ptC As Point3d
@@ -1429,27 +1405,6 @@ Public Class ProjectVM
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
Map.refStatusBarVM.NotifyStatusOutput(sOut)
End If
' Se Regione, visualizzo dati parte toccata
ElseIf EgtGetType(nId) = GDB_TY.SRF_FRGN Then
Dim nChk As Integer = nSub
If nChk >= 0 AndAlso nChk < EgtSurfFrChunkCount(nId) Then
' Visualizzo la normale e il contorno della parte
Analyze.CreateAnalyzeGroup()
Analyze.CreateChunkNormal(nId, nChk)
Analyze.CreateChunkLoops(nId, nChk)
' Recupero i dati (in globale o griglia a seconda della impostazione)
Dim ptC As Point3d
Dim vtN As Vector3d
EgtSurfFrChunkCenter(nId, nChk, If(m_bCPlaneTypePos, GDB_ID.GRID, GDB_ID.ROOT), ptC, vtN)
Dim dLen, dPhi, dTheta As Double
vtN.ToSpherical(dLen, dTheta, dPhi)
' Emetto info sulla barra di stato
Dim sOut As String = "Chunk " + nChk.ToString() +
" : C(" + LenToString(ptC.x, 3) + "," + LenToString(ptC.y, 3) + "," + LenToString(ptC.z, 3) + ")" +
" N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" +
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
Map.refStatusBarVM.NotifyStatusOutput(sOut)
End If
End If
' Aggiorno la visualizzazione
EgtDraw()
+2 -2
View File
@@ -60,8 +60,8 @@ Module Wall
Map.refTopCommandBarVM.SetMachiningMode()
' Se simulazione
If bOk And nFlag = 2 Then
' Se da TS3 e non pezzo da Vista, impedisco di fare altro
If bBtl AndAlso sFile.IndexOf( "Part_", StringComparison.InvariantCulture) = -1 Then
' Se da TS3 impedisco di fare altro
If bBtl Then
Map.refSimulationExpanderVM.bOnlySimulation = True
End If
' Vado in simulazione
-110
View File
@@ -1,6 +1,4 @@
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtWPFLib5.MachiningTreeViewItem
Public Class PrepareInputBoxParam
Friend sTitle As String
@@ -64,112 +62,4 @@ Public Class NewMachOpParam
Me.SelMachOpId = SelMachOpId
End Sub
End Class
Public Class InfoItem
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend nId As Integer
''' <summary>
''' Indice lista info note
''' </summary>
Public ReadOnly Property Id As Integer
Get
Return Id
End Get
End Property
Friend sKey As String
''' <summary>
''' Chiave lista info note
''' </summary>
Public ReadOnly Property Key As String
Get
Return sKey
End Get
End Property
Friend sValour As String
''' <summary>
''' Valore lista info note
''' </summary>
Public Property Valour As String
Get
Return sValour
End Get
Set(value As String)
sValour = value
NotifyPropertyChanged(NameOf(Valour))
End Set
End Property
#End Region ' Fields & Properties
' Comandi
Private m_cmdRemoveInfoItem As ICommand
Private m_cmdDoneInfo As ICommand
#Region "CONSTRUCTORS"
Sub New(nId As Integer, sKey As String, sValue As String)
Me.nId = nId
Me.sKey = sKey
Me.sValour = sValue
End Sub
#End Region ' Constructors
#Region "COMMANDS"
#Region "RemoveItemNoteCommand"
''' <summary>
''' Comando per rimuovere l'informazione selezionata dalla combobox
''' </summary>
Public ReadOnly Property RemoveInfoItemCommand As ICommand
Get
If m_cmdRemoveInfoItem Is Nothing Then
m_cmdRemoveInfoItem = New Command(AddressOf RemoveInfoItem)
End If
Return m_cmdRemoveInfoItem
End Get
End Property
''' <summary>
''' Rimuove l'informazione selezionata dalla combobox
''' </summary>
''' <param name="param"></param>
Public Sub RemoveInfoItem(ByVal param As Object)
Map.refInputExpanderVM.RemoveItemInfo(Me)
End Sub
#End Region ' RemoveItemNoteCommand
#Region "DoneInfoCommand"
''' <summary>
''' Comando per la conferma modifica o aggiunta nuova informazione
''' </summary>
Public ReadOnly Property DoneInfoCommand As ICommand
Get
If m_cmdDoneInfo Is Nothing Then
m_cmdDoneInfo = New Command(AddressOf DoneInfo)
End If
Return m_cmdDoneInfo
End Get
End Property
''' <summary>
''' Conferma modifica o aggiunta nuova informazione
''' </summary>
Public Sub DoneInfo(ByVal param As Object)
Map.refInputExpanderVM.Done(Me)
End Sub
#End Region ' DoneInfoCommand
#End Region ' Commands
End Class
+1 -30
View File
@@ -37,7 +37,7 @@ Module Analyze
Return True
End Function
Function CreateFacetNormal( nId As Integer, nFac As Integer) As Boolean
Function CreateNormal( nId As Integer, nFac As Integer) As Boolean
If m_AnaGrpId = GDB_ID.NULL Then Return False
Dim bEnMod As Boolean = EgtGetEnableModified()
EgtDisableModified()
@@ -66,35 +66,6 @@ Module Analyze
Return True
End Function
Function CreateChunkNormal( nId As Integer, nChk As Integer) As Boolean
If m_AnaGrpId = GDB_ID.NULL Then Return False
Dim bEnMod As Boolean = EgtGetEnableModified()
EgtDisableModified()
Dim ptC As Point3d
Dim vtN As Vector3d
If EgtSurfFrChunkCenter( nId, nChk, GDB_ID.ROOT, ptC, vtN) Then
Dim nNormId As Integer = EgtCreateGeoVector( m_AnaGrpId, 50 * vtN, ptC, GDB_RT.GLOB)
EgtSetColor( nNormId, New Color3d( 255, 0,0))
End If
If bEnMod Then EgtEnableModified()
Return True
End Function
Function CreateChunkLoops( nId As Integer, nChk As Integer) As Boolean
If m_AnaGrpId = GDB_ID.NULL Then Return False
Dim bEnMod As Boolean = EgtGetEnableModified()
EgtDisableModified()
Dim nCount As Integer
Dim nFirstId As Integer = EgtExtractSurfFrChunkLoops( nId, nChk, m_AnaGrpId, nCount)
If nFirstId <> GDB_ID.NULL Then
For nCrvId As Integer = nFirstId To nFirstId + nCount - 1
EgtSetColor( nCrvId, New Color3d( 255, 0,0))
Next
End If
If bEnMod Then EgtEnableModified()
Return True
End Function
Function CreateCurveCompoPntNbrs( nId As Integer) As Boolean
If m_AnaGrpId = GDB_ID.NULL Then Return False
Dim bEnMod As Boolean = EgtGetEnableModified()
-8
View File
@@ -34,14 +34,6 @@ Public Module IniFile
MACHPATH = 5
End Enum
Public Enum VMillSelTypeOpt As Integer
LOWER = -2
LOW = -1
STANDARD = 0
HIGH = 1
HIGHER = 2
End Enum
' MainWindow Page
Friend m_nInstance As Integer = 0
Friend m_nUserLevel As Integer = 1