-aggiunto finestre personalizzate messagebox e colorpicker

This commit is contained in:
Demetrio Cassarino
2024-07-25 10:12:29 +02:00
parent 2cfc921f3c
commit 4b8f4e9679
41 changed files with 1066 additions and 313 deletions
+2 -1
View File
@@ -210,7 +210,8 @@ Class Application
Friend Const GUNSTOCKMODIF As String = "GunStockModif"
Private Sub Application_DispatcherUnhandledException(ByVal sender As System.Object, ByVal e As System.Windows.Threading.DispatcherUnhandledExceptionEventArgs)
MessageBox.Show(e.Exception.Message)
'MessageBox.Show(e.Exception.Message)
EgtMessageBoxV.Show(Application.Current.MainWindow, e.Exception.Message)
e.Handled = True
End Sub
+6 -4
View File
@@ -161,7 +161,8 @@ Public Class CurrSetUpVM
sFilePath = SaveFileDialogViewVM.FileName
If Not m_SetUpVM.Save(sFilePath) Then
EgtOutLog("Error in setup saving: can't find the directory")
MessageBox.Show("Error in saving Setup.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("Error in saving Setup.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Error in saving Setup.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
End If
End Sub
@@ -256,14 +257,15 @@ Public Class CurrSetUpVM
' Verifico se l'attrezzaggio è stato modificato
If m_SetUpVM.IsAppliedSetUp() Then
' se modificato chiedo se salvarlo prima di uscire
If MessageBox.Show(EgtMsg(MSG_SETUP + 6), EgtMsg(MSG_SETUP + 2), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(MSG_SETUP + 6), EgtMsg(MSG_SETUP + 2), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUP + 6), EgtMsg(MSG_SETUP + 2), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' lo salvo
Apply()
End If
End If
' Resetto tutti i delegate usati
ExitToolAssociation.m_delIsModifiedSetUp = Nothing
' Resetto tutti i delegate usati
ExitToolAssociation.m_delIsModifiedSetUp = Nothing
' Reset lua
EgtLuaResetGlobVar("STU")
+26
View File
@@ -161,6 +161,12 @@
<DependentUpon>CurrSetUpV.xaml</DependentUpon>
</Compile>
<Compile Include="CurrSetUp\CurrSetUpVM.vb" />
<Compile Include="EgtColorPicker\EgtColorPickerV.xaml.vb">
<DependentUpon>EgtColorPickerV.xaml</DependentUpon>
</Compile>
<Compile Include="EgtMessageBox\EgtMessageBoxV.xaml.vb">
<DependentUpon>EgtMessageBoxV.xaml</DependentUpon>
</Compile>
<Compile Include="LeftTray\LeftTrayV.xaml.vb">
<DependentUpon>LeftTrayV.xaml</DependentUpon>
</Compile>
@@ -455,6 +461,14 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="EgtColorPicker\EgtColorPickerV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EgtMessageBox\EgtMessageBoxV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EstimationsDetailsWnd\EstimationsDetailsWndV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -1034,6 +1048,18 @@
<ItemGroup>
<Resource Include="Resources\DrawPanel\StmMoveVertex.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EgtMessageBox\Error.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EgtMessageBox\Information.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EgtMessageBox\Question.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EgtMessageBox\Warning.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtCAM5\EgtCAM5R32.exe
+266
View File
@@ -0,0 +1,266 @@
<EgtWPFLib5:EgtCustomWindow x:Class="EgtColorPickerV"
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"
Title="{Binding sTitle}"
WindowStartupLocation="CenterOwner"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="32"
IsMinimizable="False" ShowInTaskbar="False"
Width="750" Height="450"
CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="5,5,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TabControl>
<TabItem Header="{Binding BasicColor_Msg}">
<Grid HorizontalAlignment="Center"
VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding BasicColors}"
SelectedItem="{Binding SelColor}"
HorizontalAlignment="Center"
BorderThickness="0">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="13"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Rectangle Width="20"
Height="20"
Margin="2"
Stroke="Black"
StrokeThickness="0.5"
Fill="{Binding Fill}"/>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Grid>
</TabItem>
<TabItem Header="{Binding ColorPicker_Msg}">
<TabItem.Resources>
<Style TargetType="{x:Type EgtWPFLib5:EgtHexItem}" BasedOn="{StaticResource EgtHexItem}">
<Setter Property="BorderThickness" Value="1.5"/>
<Setter Property="BorderBrush" Value="White"/>
</Style>
</TabItem.Resources>
<EgtWPFLib5:EgtHexList ItemsSource="{Binding HexList}"
SelectedItem="{Binding sHexSelColor}"
Orientation="Vertical"
Margin="2.5"
RowCount="13"
ColumnCount="13"
Height="300"
Width="350"
Style="{StaticResource EgtHexList}">
<EgtWPFLib5:EgtHexList.ItemTemplate>
<DataTemplate/>
</EgtWPFLib5:EgtHexList.ItemTemplate>
<EgtWPFLib5:EgtHexList.ItemContainerStyle>
<Style TargetType="EgtWPFLib5:EgtHexItem" BasedOn="{StaticResource EgtHexItem}">
<Setter Property="Grid.Row" Value="{Binding nRow}"/>
<Setter Property="Grid.Column" Value="{Binding nColumn}"/>
<Setter Property="Background" Value="{Binding Background}"/>
</Style>
</EgtWPFLib5:EgtHexList.ItemContainerStyle>
</EgtWPFLib5:EgtHexList>
</TabItem>
<TabItem Header="{Binding ColorPickerTheme_Msg}">
<Grid HorizontalAlignment="Center"
VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding BasicColorsTheme}"
SelectedItem="{Binding SelColorTheme}"
BorderThickness="0">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="13"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Rectangle Width="20"
Height="20"
Margin="2"
Stroke="Black"
StrokeThickness="0.5"
Fill="{Binding Fill}"/>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Grid>
</TabItem>
</TabControl>
</Grid>
<Grid Grid.Column="1"
Margin="5,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding CustomColor_Msg}"
Margin="5,18,5,10"
Style="{StaticResource DialogWindow_TextBlock}"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding CustomColors}"
SelectedItem="{Binding SelCustomColor}"
HorizontalAlignment="Center"
BorderThickness="0">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="13"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Rectangle Width="20"
Height="20"
Margin="2"
Stroke="Black"
StrokeThickness="0.5"
Fill="{Binding Fill}"/>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Grid>
<Grid Grid.Row="2"
Margin="0,20,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Margin="0,10,5,0"
HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle Width="100"
Height="70"
Stroke="Black"
StrokeThickness="0.5"
Fill="{Binding CurrColor}"/>
<Button x:Name="SaveColor"
Grid.Row="1"
Margin="0,10,0,0"
Content="{Binding AddCColor_Msg}"
Command="{Binding SaveColor_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Red_Msg}"
Margin="0,10,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="1"
HorizontalAlignment="Right"
Margin="0,10,5,0"
IsReadOnly="False"
Text="{Binding Red, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ColorPicker_TextBox}"/>
<TextBlock Grid.Row="1"
Text="{Binding Green_Msg}"
Margin="5,5,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="1"
Grid.Row="1"
HorizontalAlignment="Right"
Margin="5,5,5,0"
IsReadOnly="False"
Text="{Binding Green, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ColorPicker_TextBox}"/>
<TextBlock Grid.Row="2"
Text="{Binding Blu_Msg}"
Margin="5,5,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="1"
Grid.Row="2"
HorizontalAlignment="Right"
Margin="5,5,5,0"
IsReadOnly="False"
Text="{Binding Blue, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ColorPicker_TextBox}"/>
<TextBlock Grid.Row="3"
Text="{Binding Hexadecimal_Msg}"
Margin="5,5,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="1"
Grid.Row="3"
HorizontalAlignment="Right"
Margin="5,5,5,0"
Text="{Binding Hexadecimal}"
Style="{StaticResource ColorPicker_TextBox}"/>
</Grid>
</Grid>
</Grid>
</Grid>
<UniformGrid Grid.Row="2"
Rows="1"
Margin="10,10,10,0">
<Button IsDefault="True"
Content="OK"
Command="{Binding Ok_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
<Button Content="Cancel"
Command="{Binding Cancel_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
+68
View File
@@ -0,0 +1,68 @@
Imports System.Windows.Forms
Imports EgtWPFLib5
Public Class EgtColorPickerV
#Region "FIELDS & PROPERTIES"
Private WithEvents m_EgtColorPickerVM As EgtColorPickerVM
Private Shadows DialogResult As DialogResult
Public Property CustomColors As Integer()
Get
Return m_EgtColorPickerVM.GetCustomColors()
End Get
Set(value As Integer())
m_EgtColorPickerVM.SetCustomColors(value)
End Set
End Property
Public Property Color As System.Drawing.Color
Get
Return System.Drawing.Color.FromArgb(255, m_EgtColorPickerVM.Red, m_EgtColorPickerVM.Green, m_EgtColorPickerVM.Blue)
End Get
Set(value As System.Drawing.Color)
m_EgtColorPickerVM.Red = value.R
m_EgtColorPickerVM.Green = value.G
m_EgtColorPickerVM.Blue = value.B
End Set
End Property
#End Region ' Fields & Properties
#Region "CONTRUCTORS"
Sub New(Owner As Window, EtgColorPickerVM As EgtColorPickerVM)
MyBase.New(Owner)
InitializeComponent()
Me.DataContext = EtgColorPickerVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_EgtColorPickerVM = EtgColorPickerVM
End Sub
#End Region ' Constructors
#Region "EVENTS"
Private Sub CloseWindow(DialogResult As MessageBoxResult) Handles m_EgtColorPickerVM.m_CloseWindow
Me.DialogResult = DialogResult
Me.Close()
End Sub
#End Region ' Events
#Region "METHODS"
''' <summary>
''' Apre una finestra EgtColorPicker
''' </summary>
''' <returns></returns>
Public Overloads Function ShowDialog() As DialogResult
MyBase.ShowDialog()
Return Me.DialogResult
End Function
#End Region ' Methods
End Class
+49
View File
@@ -0,0 +1,49 @@
<EgtWPFLib5:EgtCustomWindow x:Class="EgtMessageBoxV"
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"
Title="{Binding sTitle}"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="32"
IsMinimizable="False" ShowInTaskbar="False"
CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="20,20,20,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding sIconSource}"
Margin="0,0,0,0"/>
<TextBlock Grid.Column="1"
Text="{Binding sMessage}"
Margin="5,0,5,0"
Style="{StaticResource DialogWindow_TextBlock}"/>
</Grid>
<ItemsControl Grid.Row="1"
ItemsSource="{Binding ButtonList}"
HorizontalAlignment="Center">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="1"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button IsDefault="{Binding bIsDefault}"
Content="{Binding sMessage}"
Command="{Binding Command_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
+109
View File
@@ -0,0 +1,109 @@
Imports EgtWPFLib5
Public Class EgtMessageBoxV
#Region "FIELDS & PROPERTIES"
Private WithEvents m_EgtMessageBoxVM As EgtMessageBoxVM
Private Shadows DialogResult As MessageBoxResult
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(Owner As Window, EgtMessageBoxVM As EgtMessageBoxVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = EgtMessageBoxVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_EgtMessageBoxVM = EgtMessageBoxVM
End Sub
#End Region
#Region "METHODS"
''' <summary>
''' Apre una EgtMessageBox con un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <param name="Button">Valore che specifica quali bottoni mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String, Button As MessageBoxButton) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption, Button))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <param name="Button">Valore che specifica quali bottoni mostrare</param>
''' <param name="Icon">Valore che specifica quale icona mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String, Button As MessageBoxButton, Icon As MessageBoxImage) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption, Button, Icon))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <param name="Button">Valore che specifica quali bottoni mostrare</param>
''' <param name="Icon">Valore che specifica quale icona mostrare</param>
''' <param name="DefaultResult">Valore che specifica il bottone di default</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String, Button As MessageBoxButton, Icon As MessageBoxImage, DefaultResult As MessageBoxResult) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption, Button, Icon, DefaultResult))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
#End Region ' METHODS
#Region "EVENTS"
Private Sub CloseWindow(DialogResult As MessageBoxResult) Handles m_EgtMessageBoxVM.m_CloseWindow
Me.DialogResult = DialogResult
Me.Close()
End Sub
#End Region
End Class
+13 -7
View File
@@ -68,7 +68,8 @@ Public Class MyMachGroupPanelVM
' se la lista gruppi è vuota creo un nuovo gruppo
If MachGroupList.Count = 0 Then
' Vuoi creare un nuovo Gruppo di Lavoro con i pezzi selezionati ? - LAVORA
If MessageBox.Show(EgtMsg(5552), EgtMsg(5002), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(5552), EgtMsg(5002), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5552), EgtMsg(5002), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
Return If(AddNewMachGroup(nGroupId, vPart), 0, 1)
Else
Return -2
@@ -92,9 +93,10 @@ Public Class MyMachGroupPanelVM
' altrimenti creo il primo gruppo
Else
' Vuoi creare un nuovo Gruppo di Lavoro con i pezzi selezionati ? - LAVORA
If MessageBox.Show(EgtMsg(5552), EgtMsg(5002), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(5552), EgtMsg(5002), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5552), EgtMsg(5002), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
Return If(AddNewMachGroup(nGroupId, vPart), 0, 1)
Else
Else
Return -2
End If
End If
@@ -122,7 +124,8 @@ Public Class MyMachGroupPanelVM
EgtLuaSetGlobStringVar("DISP.PARTS", sParts)
If Not EgtLuaExecFile(sScriptPath) Then
EgtOutLog("Error executing disposition init script " & sScriptPath)
MessageBox.Show(EgtMsg(MSG_DISPOSITIONERRORS + 2) & " " & sScriptPath, EgtMsg(MSG_DISPOSITIONERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_DISPOSITIONERRORS + 2) & " " & sScriptPath, EgtMsg(MSG_DISPOSITIONERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DISPOSITIONERRORS + 2) & " " & sScriptPath, EgtMsg(MSG_DISPOSITIONERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End If
Dim nErr As Integer = 999
@@ -299,7 +302,8 @@ Public Class MyMachGroupPanelVM
If Not String.IsNullOrEmpty(sDefaultSetUpName) Then
If Not EgtImportSetup(String.Empty) Then
EgtOutLog("Error loading default setup " & sDefaultSetUpName)
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 9) & " " & sDefaultSetUpName, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 9) & " " & sDefaultSetUpName, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 9) & " " & sDefaultSetUpName, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
End If
End If
End Sub
@@ -366,7 +370,8 @@ Public Class MyMachGroupPanelVM
Dim nSelectedMachGroupIndex As Integer = MachGroupList.IndexOf(SelectedMachGroup)
If nSelectedMachGroupIndex = 0 And MachGroupList.Count = 1 Then
' chiedo conferma prima di cancellare il gruppo di lavorazione
Select Case MessageBox.Show(EgtMsg(MSG_MACHGROUP + 2), "", MessageBoxButton.YesNo, MessageBoxImage.Question)
'Select Case MessageBox.Show(EgtMsg(MSG_MACHGROUP + 2), "", MessageBoxButton.YesNo, MessageBoxImage.Question)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_MACHGROUP + 2), "", MessageBoxButton.YesNo, MessageBoxImage.Question)
Case MessageBoxResult.Yes
' cancello il gruppo corrente
EgtRemoveMachGroup(EgtGetMachGroupId(MachGroupList(nSelectedMachGroupIndex).Name))
@@ -379,7 +384,8 @@ Public Class MyMachGroupPanelVM
End Select
Else
' chiedo conferma prima di cancellare il gruppo di lavorazione
Select Case MessageBox.Show(EgtMsg(MSG_MACHGROUP + 2), "", MessageBoxButton.YesNo, MessageBoxImage.Question)
'Select Case MessageBox.Show(EgtMsg(MSG_MACHGROUP + 2), "", MessageBoxButton.YesNo, MessageBoxImage.Question)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_MACHGROUP + 2), "", MessageBoxButton.YesNo, MessageBoxImage.Question)
Case MessageBoxResult.Yes
Dim nNewInd As Integer = -1
If nSelectedMachGroupIndex = 0 And MachGroupList.Count > 1 Then
+12 -6
View File
@@ -208,7 +208,8 @@ Public Class MyMachinePanelVM
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtTdbReload() Then
EgtOutLog("Impossible reloading tool Db")
MessageBox.Show(EgtMsg(MSG_TOOLSERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_TOOLSERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOOLSERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
@@ -231,7 +232,8 @@ Public Class MyMachinePanelVM
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtTdbReload() Then
EgtOutLog("Impossible reloading tool Db")
MessageBox.Show(EgtMsg(MSG_TOOLSERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_TOOLSERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOOLSERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
@@ -256,7 +258,8 @@ Public Class MyMachinePanelVM
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtMdbReload() Then
EgtOutLog("Impossible reloading machining Db")
MessageBox.Show(EgtMsg(MSG_MACHININGSERRORS + 7), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_MACHININGSERRORS + 7), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_MACHININGSERRORS + 7), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(IniFile.m_sCurrMachIniFilePath, IniFile.m_ProjectSceneContext, "Wood", IniFile.m_nUserLevel > 9, True)
@@ -277,7 +280,8 @@ Public Class MyMachinePanelVM
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtMdbReload() Then
EgtOutLog("Impossible reloading machining Db")
MessageBox.Show(EgtMsg(MSG_MACHININGSERRORS + 7), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_MACHININGSERRORS + 7), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_MACHININGSERRORS + 7), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(IniFile.m_sCurrMachIniFilePath, IniFile.m_ProjectSceneContext, "Wood", IniFile.m_nUserLevel > 9, True)
@@ -302,7 +306,8 @@ Public Class MyMachinePanelVM
' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
If Not File.Exists(IniFile.m_sCurrMachScriptsDirPath & "\" & SETUP_LUA) Then
EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato,
@@ -321,7 +326,8 @@ Public Class MyMachinePanelVM
EgtLuaGetGlobIntVar("STU.ERR", nErr)
If nErr = 0 Then
If EgtGetHeadExitCount(sHead) = 0 Then
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
End If
@@ -17,7 +17,7 @@
<TextBlock Text="{Binding TextBlock}"
Visibility="{Binding TextVisibility}" Margin="5,5,0,5"/>
<TextBox x:Name="TextBoxFocus" Text="{Binding TextBox,UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding TextVisibility}" Margin="5,0,5,5">
Visibility="{Binding TextVisibility}" Margin="5,0,5,5" IsEnabled="True" Focusable="True">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding DoneCommand}"/>
<KeyBinding Key="S" Modifiers="Control" Command="{Binding ShowCommand}"/>
@@ -479,9 +479,8 @@ Public Class ManageLayerExpanderVM
' Se è un pezzo con lavorazioni, devo chiedere conferma della cancellazione
If EgtIsPart(RightClickedTreeItemId) And EgtExistsInfo(RightClickedTreeItemId, GDB_SI_LIST) Then
' Pezzo in lavorazione, vuoi cancellarlo lo stesso ? - Erase Confirm
If MessageBox.Show(EgtMsg(MSG_DRAWOPTION + 17), EgtMsg(MSG_DRAWOPTION + 16), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then
Return
End If
'If MessageBox.Show(EgtMsg(MSG_DRAWOPTION + 17), EgtMsg(MSG_DRAWOPTION + 16), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then Return
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DRAWOPTION + 17), EgtMsg(MSG_DRAWOPTION + 16), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then Return
End If
' Recupero Id vicino per prossimo selezionato in albero
Dim nNewId As Integer = EgtGetNext(RightClickedTreeItemId)
@@ -54,7 +54,8 @@ Public Class EstimationsExpanderVM
' Verifico che il file esista
If Not File.Exists(sEstFile) Then
' File delle stime non trovato
MessageBox.Show(EgtMsg(MSG_SIMULATION + 18), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show(EgtMsg(MSG_SIMULATION + 18), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 18), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
' Visualizzazione
@@ -114,7 +115,8 @@ Public Class EstimationsExpanderVM
If bAskSave Then
If String.IsNullOrEmpty(sCurrFilePath) OrElse EgtGetModified() Then
' Il progetto deve essere salvato prima di poter essere generato. Vuoi farlo ?
If MessageBox.Show(EgtMsg(MSG_SIMULATION + 31), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
'If MessageBox.Show(EgtMsg(MSG_SIMULATION + 31), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 31), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
' Abbandono
bOk = False
Else
@@ -129,7 +131,8 @@ Public Class EstimationsExpanderVM
Else
If String.IsNullOrEmpty(sCurrFilePath) Then
' File delle stime non trovato
MessageBox.Show(EgtMsg(MSG_SIMULATION + 18), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show(EgtMsg(MSG_SIMULATION + 18), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 18), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning)
bOk = False
End If
End If
@@ -179,9 +182,11 @@ Public Class EstimationsExpanderVM
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
sErr = sErr.Replace("Cnc", "Est")
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
'MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
MessageBox.Show(EgtMsg(MSG_SIMULATION + 17), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SIMULATION + 17), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 17), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
End If
bOk = False
End If
@@ -85,7 +85,8 @@ Public Class MachiningTreeExpanderVM
' Se l'operazione non è andata a buon fine
If MachiningId = GDB_ID.NULL Then
' Inserimento lavorazione non riuscito ERRORE
MessageBox.Show(EgtMsg(MSG_OPERATION + 19), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_OPERATION + 19), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_OPERATION + 19), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Map.refOperationsListExpanderVM.CancelOperationCmd()
Return
End If
@@ -136,7 +136,8 @@ Public Class FixtureParametersVM
If Not PositionFixtureOnNearestHook(nAddedFixtureId) Then
' non ci sono punti liberi, quindi rimuovo la ventosa e segnalo
EgtRemoveFixture(nAddedFixtureId)
MessageBox.Show("No free hook point!", "ERROR")
'MessageBox.Show("No free hook point!", "ERROR")
EgtMessageBoxV.Show(Application.Current.MainWindow, "No free hook point!", "ERROR")
Return
End If
Else
@@ -352,7 +352,8 @@ Public Class MachiningParameterExpanderVM
sErrorList += Environment.NewLine + " - " + m_CurrOperation.GetErrorString([property])
End If
Next [property]
MessageBox.Show(EgtMsg(5423) + sErrorList, EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation)
'MessageBox.Show(EgtMsg(5423) + sErrorList, EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5423) + sErrorList, EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Return
End If
@@ -431,10 +432,12 @@ Public Class MachiningParameterExpanderVM
Dim sInfo As String = String.Empty
EgtGetOutstrokeInfo(sInfo)
If Not String.IsNullOrEmpty(sInfo) Then sErr &= " " & sInfo
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
'MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
' Errore nel calcolo della lavorazione!
MessageBox.Show(EgtMsg(5345), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(5345), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5345), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Else
If EgtGetMachMgrWarningId(0) <> 0 Then
@@ -199,7 +199,8 @@ Public Class MachiningOpListBoxItem
' verifico che il nome non inizi con disp
If m_ModifiedName.StartsWith("disp", StringComparison.InvariantCultureIgnoreCase) Then
m_CloseModifyLostFocus = False
MessageBox.Show(EgtMsg(MSG_OPERATION + 21), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show(EgtMsg(MSG_OPERATION + 21), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_OPERATION + 21), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
' Imposto il nuovo nome
@@ -207,7 +208,8 @@ Public Class MachiningOpListBoxItem
If Not EgtSetOperationName(Id, m_ModifiedName) Then
m_Spy = False
m_CloseModifyLostFocus = False
MessageBox.Show(EgtMsg(MSG_OPERATION + 22), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show(EgtMsg(MSG_OPERATION + 22), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_OPERATION + 22), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Warning)
m_IsActive_ModifyName = True
NotifyPropertyChanged(NameOf(ModifyName_Visibility))
m_Spy = True
@@ -31,7 +31,7 @@
Command="{Binding DataContext.OperationListDoubleClickCommand, RelativeSource={RelativeSource AncestorType={x:Type EgtCAM5:OperationsListExpanderV}}}"
CommandParameter="{Binding Id}"/>
</Border.InputBindings>
<Grid Style="{StaticResource LayoutRoot}">
<Grid Style="{StaticResource LayoutRoot}" FocusManager.FocusedElement="{Binding ElementName=Box}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@@ -44,10 +44,9 @@
Visibility="{Binding Name_Visibility}" Margin="0,0,5,0"/>
<TextBox Grid.Column="1" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}"
Width="150"
x:Name="Box" x:Uid="Box"
IsTabStop="False"
x:Name="Box" IsEnabled="True" Focusable="True"
Visibility="{Binding ModifyName_Visibility}" Margin="0,0,5,0">
<TextBox.Style>
<!--<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsSelected}" Value="True">
@@ -55,7 +54,7 @@
</DataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox.Style>-->
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding ModifyNameEnterCommand}"/>
<KeyBinding Key="Escape" Command="{Binding ModifyNameEscCommand}"/>
@@ -618,9 +618,11 @@ Public Class OperationsListExpanderVM
' In caso di errori, li segnalo
If Not bOk Then
If Not String.IsNullOrEmpty(sErr) Then
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
'MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Else
Map.refStatusBarVM.NotifyStatusOutput(EgtMsg(MSG_OPERATION + 11))
@@ -651,7 +653,8 @@ Public Class OperationsListExpanderVM
' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
If Not File.Exists(IniFile.m_sCurrMachScriptsDirPath & "\" & SETUP_LUA) Then
EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato,
@@ -670,7 +673,8 @@ Public Class OperationsListExpanderVM
EgtLuaGetGlobIntVar("STU.ERR", nErr)
If nErr = 0 Then
If EgtGetHeadExitCount(sHead) = 0 Then
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
End If
@@ -867,18 +871,25 @@ Public Class OperationsListExpanderVM
' verifico che il nome non sia già utilizzato
Private Function NameVerifyer(Name As String) As Boolean
If String.IsNullOrWhiteSpace(Name) Then
MessageBox.Show(EgtMsg(MSG_EGTSAVEFILEDIALOG + 8),
EgtMsg(MSG_EGTSAVEFILEDIALOG + 7),
MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_EGTSAVEFILEDIALOG + 8),
' EgtMsg(MSG_EGTSAVEFILEDIALOG + 7),
' MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_EGTSAVEFILEDIALOG + 8),
EgtMsg(MSG_EGTSAVEFILEDIALOG + 7),
MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End If
Dim TempName As String = Name
EgtMdbGetMachiningNewName(TempName)
If String.Compare(TempName, Name, True) = 0 Then Return True
MessageBox.Show(Name & " " &
EgtMsg(MSG_EGTSAVEFILEDIALOG + 3),
EgtMsg(MSG_EGTSAVEFILEDIALOG + 7),
MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(Name & " " &
' EgtMsg(MSG_EGTSAVEFILEDIALOG + 3),
' EgtMsg(MSG_EGTSAVEFILEDIALOG + 7),
' MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, Name & " " &
EgtMsg(MSG_EGTSAVEFILEDIALOG + 3),
EgtMsg(MSG_EGTSAVEFILEDIALOG + 7),
MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End Function
@@ -39,7 +39,7 @@ Public Class SimulationExpanderVM
End Get
Set(value As Boolean)
m_bOnlySimulation = value
NotifyPropertyChanged("bOnlySimulation")
NotifyPropertyChanged(NameOf(bOnlySimulation))
End Set
End Property
@@ -102,12 +102,15 @@ Public Class SimulationExpanderVM
If Not EgtGenerate(sCncFile, sInfo) Then
Dim nErr = EgtGetLastMachMgrErrorId()
If nErr = 1000 Then
MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
'MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
'MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
MessageBox.Show(EgtMsg(5306), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(5306), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5306), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error)
End If
bNcView = False
Else
@@ -165,9 +168,9 @@ Public Class SimulationExpanderVM
Map.refTopCommandBarVM.DrawIsEnabled = False
Map.refOperationsListExpanderVM.OpersListViewIsEnabled = False
Map.refOperationParametersExpanderVM.OperParamsViewIsEnabled = False
Map.refEstimationsExpanderVM.Estimation_IsEnabled =False
Map.refEstimationsExpanderVM.Estimation_IsEnabled = False
Map.refMachGroupPanelVM.SetMachGroupState(False)
Map.refEstimationsExpanderVM.NotifyPropertyChanged("Estimation_IsEnabled")
Map.refEstimationsExpanderVM.NotifyPropertyChanged(NameOf(Map.refEstimationsExpanderVM.Estimation_IsEnabled))
End If
Return True
End Function
@@ -196,7 +199,7 @@ Public Class SimulationExpanderVM
Friend Function UpdateAllMachinings() As Boolean
' Se disabilitato, esco
If GetPrivateProfileInt( S_MACH, K_AUTOUPDATEALLMACHININGS, 1) = 0 Then Return True
If GetPrivateProfileInt(S_MACH, K_AUTOUPDATEALLMACHININGS, 1) = 0 Then Return True
' Eseguo ricalcolo
Dim bModified As Boolean = EgtGetModified()
Dim sErr As String = String.Empty
@@ -204,9 +207,11 @@ Public Class SimulationExpanderVM
' In caso di errori, li segnalo
If Not bOk Then
If Not String.IsNullOrEmpty(sErr) Then
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
'MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
End If
End If
If Not bModified Then EgtResetModified()
@@ -226,9 +231,11 @@ Public Class SimulationExpanderVM
If Not bOk Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
'MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
EgtMessageBoxV.Show(Application.Current.MainWindow, sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
Else
MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
'MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
End If
End If
' Imposto stato corrente
@@ -268,9 +275,11 @@ Public Class SimulationExpanderVM
If Not EgtSimStart(False) Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
'MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
EgtMessageBoxV.Show(Application.Current.MainWindow, sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
Else
MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
'MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
EgtMessageBoxV.Show(Application.Current.MainWindow, 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
@@ -291,7 +300,7 @@ Public Class SimulationExpanderVM
SetShowPlay(True)
NotifyPropertyChanged(NameOf(PlayPauseImage))
End If
' Se movimento con collisione
' Se movimento con collisione
ElseIf nMove = MCH_SIM.COLLISION Then
If m_bStopOnNextCollision Then
' Imposto stato Pausa
@@ -301,11 +310,12 @@ Public Class SimulationExpanderVM
SetShowPlay(True)
NotifyPropertyChanged(NameOf(PlayPauseImage))
' Messaggio
MessageBox.Show(EgtMsg(MSG_SIMULATION + 19), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 19), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning)
Else
m_bStopOnNextCollision = True
End If
' Altrimenti movimento non riuscito
' Altrimenti movimento non riuscito
Else
SetSimulationStatus(MCH_SIM_ST.UI_STOP)
' Aggiornamenti per bottone Play/Pause
@@ -321,15 +331,19 @@ Public Class SimulationExpanderVM
Case MCH_SIM.OUTSTROKE
Dim sInfo As String = String.Empty
EgtGetOutstrokeInfo(sInfo)
MessageBox.Show(EgtMsg(MSG_SIMULATION + 2) & " " & sInfo, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Extracorsa ...
'MessageBox.Show(EgtMsg(MSG_SIMULATION + 2) & " " & sInfo, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Extracorsa ...
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 2) & " " & sInfo, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Extracorsa ...
Case MCH_SIM.DIR_ERR
MessageBox.Show(EgtMsg(MSG_SIMULATION + 3), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Direzione utensile irraggiungibile
'MessageBox.Show(EgtMsg(MSG_SIMULATION + 3), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Direzione utensile irraggiungibile
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 3), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Direzione utensile irraggiungibile
Case Else
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
'MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
EgtMessageBoxV.Show(Application.Current.MainWindow, sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
Else
MessageBox.Show(EgtMsg(MSG_SIMULATION + 4), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore - ERRORE
'MessageBox.Show(EgtMsg(MSG_SIMULATION + 4), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore - ERRORE
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 4), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore - ERRORE
End If
End Select
End If
@@ -366,7 +380,7 @@ Public Class SimulationExpanderVM
End If
Map.refEstimationsExpanderVM.NotifyPropertyChanged(NameOf(Map.refEstimationsExpanderVM.Estimation_IsEnabled))
If IniFile.m_bSimulEndExitApp Then
refMainWindowVM.CloseApplication( Nothing)
refMainWindowVM.CloseApplication(Nothing)
End If
End Sub
@@ -399,7 +413,8 @@ Public Class SimulationExpanderVM
If bAskSave Then
If String.IsNullOrEmpty(sCurrFilePath) OrElse EgtGetModified() Then
' Il progetto deve essere salvato prima di poter essere generato. Vuoi farlo ?
If MessageBox.Show(EgtMsg(MSG_SIMULATION + 31), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
'If MessageBox.Show(EgtMsg(MSG_SIMULATION + 31), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATION + 31), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
' Abbandono
Return False
Else
@@ -413,11 +428,11 @@ Public Class SimulationExpanderVM
End If
End If
sCncFile = ""
#If PLATFORM = "x64" Then
#If PLATFORM = "x64" Then
sInfo = "EgtCAM5 64bit ver." & Map.refMainWindowVM.Version() & " - " & sCurrFilePath
#Else
sInfo = "EgtCAM5 ver." & Map.refMainWindowVM.Version() & " - " & sCurrFilePath
#End If
#Else
sInfo = "EgtCAM5 ver." & Map.refMainWindowVM.Version() & " - " & sCurrFilePath
#End If
If EgtGetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_NCNAME, sCncFile) AndAlso Not String.IsNullOrWhiteSpace(sCncFile) Then
sCncFile = Path.GetDirectoryName(sCurrFilePath) & "\" & sCncFile
Else
@@ -435,7 +450,7 @@ Public Class SimulationExpanderVM
Return True
End Function
Friend Sub SimulationExpander_Update_CncData( nFlag As Integer)
Friend Sub SimulationExpander_Update_CncData(nFlag As Integer)
If Simulation_IsExpanded Then
ShowCncData()
' Se fermo per Collisione rilevata da script Lua
+2 -1
View File
@@ -80,7 +80,8 @@ Friend Module OptionModule
End While
If nIndex = 1 Then
EgtOutLog("Error missing languages section in Config.ini")
MessageBox.Show("Error : missing languages informations", "EgtCAM5", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("Error : missing languages informations", "EgtCAM5", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Error : missing languages informations", "EgtCAM5", MessageBoxButton.OK, MessageBoxImage.Error)
End
End If
' Inizializzo la lingua corrente
+161 -140
View File
@@ -2,6 +2,7 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class OptionWindowVM
Inherits VMBase
@@ -257,8 +258,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
@@ -578,7 +579,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
@@ -598,7 +599,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
@@ -618,7 +619,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
@@ -633,7 +634,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
@@ -648,7 +649,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
@@ -706,17 +707,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
@@ -1168,143 +1169,146 @@ 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)
'MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, 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 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 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
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)
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtOutLog(sKo)
'MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, 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)
MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtOutLog(sOk)
'MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, 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
#End Region ' AddMachine
#Region "ExportMachine"
''' <summary>
''' Returns a command that export a new machining.
''' </summary>
@@ -1344,7 +1348,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()
@@ -1354,13 +1358,15 @@ Public Class OptionWindowVM
' L'esportazione della macchina "{0}" non è riuscita.
Dim sKo As String = String.Format(EgtMsg(6551), sCurrMachineName)
EgtOutLog(sKo)
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
return
'MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
Return
End Try
'La macchina "{0}" è stata esportata con successo.
Dim sOk As String = String.Format(EgtMsg(6552), sCurrMachineName)
EgtOutLog(sOk)
MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
'MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
End Sub
#End Region ' ExportMachine
@@ -1380,11 +1386,12 @@ 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")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
Dim sOut As String = String.Format(EgtMsg(6555), "Beam")
'MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Esco
Return
End If
@@ -1392,78 +1399,83 @@ Public Class OptionWindowVM
Dim BeamDlg As New Microsoft.Win32.OpenFileDialog() With {
.DefaultExt = ".zip",
.Filter = "Beam (.zip)|*.zip",
.CheckFileExists = True,
.ValidateNames = True
}
.CheckFileExists = True,
.ValidateNames = True
}
If BeamDlg.ShowDialog() <> True Then Return
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")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
Dim sOut As String = String.Format(EgtMsg(6556), "Beam")
'MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.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
If String.Compare(sExeVer, sNewMinExe) < 0 Then
' Il nuovo modulo "{0}" richiede un programma con versione minima {1}. - Avviso
Dim sOut As String = String.Format(EgtMsg(6557), "Beam", sNewMinExe)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.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
If EgtMessageBoxV.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)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog(sOut)
'MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.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)
MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
EgtOutLog(sOk)
'MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
End Sub
#End Region ' UpdateBeam
@@ -1478,17 +1490,17 @@ Public Class OptionWindowVM
Return m_cmdUpdateWallCmd
End Get
End Property
Public Sub UpdateWallCmd()
' Recupero la versione del programma in esecuzione
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")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
Dim sOut As String = String.Format(EgtMsg(6555), "Wall")
'MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Esco
Return
End If
@@ -1503,77 +1515,82 @@ 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")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
Dim sOut As String = String.Format(EgtMsg(6556), "Wall")
'MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.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
If String.Compare(sExeVer, sNewMinExe) < 0 Then
' Il nuovo modulo "{0}" richiede un programma con versione minima {1}. - Avviso
Dim sOut As String = String.Format(EgtMsg(6557), "Wall", sNewMinExe)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.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
If EgtMessageBoxV.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)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog(sOut)
'MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.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)
MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
EgtOutLog(sOk)
'MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
End Sub
#End Region ' UpdateWall
#Region "CloseOptionsCommand"
''' <summary>
''' Returns a command that remove the current selected machining.
''' </summary>
@@ -1616,10 +1633,14 @@ Public Class OptionWindowVM
End If
Next
' Creo dialogo colori
Dim ColorDlg As New System.Windows.Forms.ColorDialog
ColorDlg.FullOpen = True
ColorDlg.CustomColors = nCustomColors.ToArray()
ColorDlg.Color = Col.ToColor()
'Dim ColorDlg As New System.Windows.Forms.ColorDialog
'ColorDlg.FullOpen = True
'ColorDlg.CustomColors = nCustomColors.ToArray()
'ColorDlg.Color = Col.ToColor()
Dim ColorDlg As New EgtColorPickerV(Application.Current.MainWindow, New EgtColorPickerVM()) With {
.CustomColors = nCustomColors.ToArray(),
.Color = Col.ToColor()
}
' Visualizzo dialogo
If ColorDlg.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return False
' Recupero colore scelto
+46 -27
View File
@@ -61,7 +61,7 @@ Public Class ProjectVM
#Region "EGTUILIB FIELDS"
Private m_bCPlaneTypePos As Boolean
Private m_bCPlaneTypePos As Boolean
' Variabile per implementazione eventi
Private m_InputText As String
@@ -231,29 +231,33 @@ Public Class ProjectVM
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
Dim sText As String = EgtMsg(10102) & vbCrLf & EgtMsg(10103)
Dim sTitle As String = EgtMsg(10101)
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
Else
EgtOutLog("NetDongle is full")
' Box di avviso slot chiave di rete occupato : "Chiave di Rete completamente occupata. \n Uscire dal programma su un altro PC." "Errore"
Dim sText As String = EgtMsg(10110) & vbCrLf & EgtMsg(10111)
Dim sTitle As String = EgtMsg(10101)
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, 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
'MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
' 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"
Dim sKeyInfo As String = "" : EgtGetKeyInfo(sKeyInfo)
Dim sText As String = sKeyInfo & vbCrLf & EgtMsg(10105) & vbCrLf & EgtMsg(10106)
Dim sTitle As String = EgtMsg(10101)
If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
'If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
' Apro dialogo per richiesta file licenza
Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With {
.DefaultExt = ".lic",
@@ -335,8 +339,9 @@ Public Class ProjectVM
If Not m_Controller.SetCommandLog(bLuaReg, m_sTempDir, sCmdLogFile) Then
EgtOutLog("Command log not started")
If Environment.GetCommandLineArgs.Count() <= 1 Then
MessageBox.Show("Command log not started", "EgtCAM5 Warning",
MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show("Command log not started", "EgtCAM5 Warning",
' MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Command log not started", "EgtCAM5 Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
End If
End If
m_Controller.SetSurfTmTolerance(OptionModule.m_dGeometryTolerance)
@@ -478,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
@@ -492,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
@@ -507,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
@@ -819,9 +824,11 @@ Public Class ProjectVM
For Index = 1 To Lines.Count - 1
If Not String.IsNullOrWhiteSpace(Lines(Index)) Then sErrMsg &= Lines(Index) & vbCrLf
Next
MessageBox.Show(sErrMsg, Lines(0).ToUpper, MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(sErrMsg, Lines(0).ToUpper, MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, sErrMsg, Lines(0).ToUpper, MessageBoxButton.OK, MessageBoxImage.Error)
Catch ex As Exception
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 7))
'MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 7))
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORSERRORS + 7))
End Try
End If
End If
@@ -857,9 +864,11 @@ Public Class ProjectVM
For Index = 1 To Lines.Count - 1
If Not String.IsNullOrWhiteSpace(Lines(Index)) Then sErrMsg &= Lines(Index) & vbCrLf
Next
MessageBox.Show(sErrMsg, Lines(0).ToUpper, MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(sErrMsg, Lines(0).ToUpper, MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, sErrMsg, Lines(0).ToUpper, MessageBoxButton.OK, MessageBoxImage.Error)
Catch ex As Exception
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 7))
'MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 7))
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORSERRORS + 7))
End Try
End If
End Sub
@@ -870,11 +879,13 @@ Public Class ProjectVM
If bOk Then
' Copia dei file terminata con successo ...
Dim sMsg As String = EgtMsg(8216) & vbCrLf & sFilePath & vbCrLf & "->" & sDirDest
MessageBox.Show(sMsg, EgtMsg(8214), MessageBoxButton.OK, MessageBoxImage.Information)
'MessageBox.Show(sMsg, EgtMsg(8214), MessageBoxButton.OK, MessageBoxImage.Information)
EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(8214), MessageBoxButton.OK, MessageBoxImage.Information)
Else
' Errore nella copia dei file ...
Dim sMsg As String = EgtMsg(8255) & vbCrLf & sFilePath & vbCrLf & "->" & sDirDest
MessageBox.Show(sMsg, EgtMsg(8251), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(sMsg, EgtMsg(8251), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(8251), MessageBoxButton.OK, MessageBoxImage.Error)
End If
End Sub
@@ -1452,7 +1463,8 @@ Public Class ProjectVM
Private Sub OnNewProject(ByVal sender As Object, ByVal bOk As Boolean) Handles m_Controller.OnNewProject
EgtZoom(ZM.ALL)
If Not bOk Then
MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error
'MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error
End If
End Sub
@@ -1473,7 +1485,8 @@ Public Class ProjectVM
Else
sMsg = EgtMsg(10009) & " '" & sFile & "'" 'Missing file
End If
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
End If
End Sub
@@ -1501,7 +1514,8 @@ Public Class ProjectVM
Else
IniFile.m_MruFiles.Remove(sFile)
Dim sMsg As String = EgtMsg(10004) & " '" & sFile & "'" 'Error saving file
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
End If
End Sub
@@ -1515,7 +1529,8 @@ Public Class ProjectVM
Else
IniFile.m_MruFiles.Remove(sFile)
Dim sMsg As String = EgtMsg(10004) & " '" & sFile & "'" 'Error saving file
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
End If
End Sub
@@ -1536,7 +1551,8 @@ Public Class ProjectVM
Map.refStatusBarVM.NotifyStatusProgress(0)
Map.refStatusBarVM.NotifyStatusStop(True)
Else
MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error
'MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error
End If
End Sub
@@ -1550,7 +1566,8 @@ Public Class ProjectVM
' Segnalo eventuale errore
If Not bOk Then
Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
End If
End Sub
@@ -1561,7 +1578,8 @@ Public Class ProjectVM
WritePrivateProfileString(S_GENERAL, K_LASTEXPDIR, Path.GetDirectoryName(sFile))
If Not bOk Then
Dim sMsg As String = EgtMsg(10007) & " '" & sFile & "'" 'Error exporting file
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
End If
End Sub
@@ -1589,7 +1607,8 @@ Public Class ProjectVM
IniFile.m_MruScripts.Remove(sFile)
End If
End If
MessageBox.Show(Application.Current.MainWindow, sError, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
'MessageBox.Show(Application.Current.MainWindow, sError, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
EgtMessageBoxV.Show(Application.Current.MainWindow, sError, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
End If
' Disabilito progress e bottone stop
Map.refStatusBarVM.NotifyStatusProgress(0)
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

+10 -7
View File
@@ -444,10 +444,12 @@ Public Class SetUpVM
If String.IsNullOrWhiteSpace(sSearchedTool) Then sSearchedTool = sToolNameList(ToolIndex)
If Not String.IsNullOrWhiteSpace(sSearchedTool) Then
' Impossibile trovare l'utensile xxx nel DB utensili
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 3) & " " & sSearchedTool & " " & EgtMsg(MSG_SETUPERRORS + 4), EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 3) & " " & sSearchedTool & " " & EgtMsg(MSG_SETUPERRORS + 4), EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 3) & " " & sSearchedTool & " " & EgtMsg(MSG_SETUPERRORS + 4), EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Error)
Else
' Impossibile trovare l'utensile nel DB utensili
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 3) & " " & EgtMsg(MSG_SETUPERRORS + 4), EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 3) & " " & EgtMsg(MSG_SETUPERRORS + 4), EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 3) & " " & EgtMsg(MSG_SETUPERRORS + 4), EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Error)
End If
End If
End If
@@ -563,7 +565,8 @@ Public Class SetUpVM
For ErrorIndex = 0 To ErrorList.Count - 1
sError &= "- " & ErrorList(ErrorIndex) & Environment.NewLine
Next
MessageBox.Show(sError, EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Exclamation)
'MessageBox.Show(sError, EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, sError, EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Exclamation)
End If
End If
End Sub
@@ -610,7 +613,8 @@ Public Class SetUpVM
' se la posizione non è valida, restituisco errore
If sHead = INVALIDPOS Then
EgtOutLog("SetUp warning: try to set " & SelTool.Name & " on " & Position.TcPos)
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 5), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 5), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 5), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return False
' altrimenti, se la posizione nell'attrezzaggio è vuota
ElseIf Not PosIsOccupied Then
@@ -637,13 +641,11 @@ Public Class SetUpVM
' altrimenti restituisco falso
Else
ErrorList.Add(SelTool.Name)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 9) & " " & SelTool.Name & " " & EgtMsg(MSG_SETUPERRORS + 6), EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Return False
End If
' altrimenti restituisco falso
Else
ErrorList.Add(SelTool.Name)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 9) & " " & SelTool.Name & " " & EgtMsg(MSG_SETUPERRORS + 6), EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Return False
End If
Return True
@@ -790,7 +792,8 @@ Public Class SetUpVM
For ErrorIndex = 0 To ErrorList.Count - 1
sError &= "- " & ErrorList(ErrorIndex) & Environment.NewLine
Next
MessageBox.Show(sError, EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Exclamation)
'MessageBox.Show(sError, EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, sError, EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Exclamation)
End If
' abilito e disabilito tutte le uscite in base all'utensile selezionato
+12 -6
View File
@@ -27,7 +27,8 @@ Public Class SetUpDbVM
Set(value As String)
' se setup modificato, chiedo se salvare
If m_SetUpVM.IsModifiedSetUp OrElse m_IsNew Then
Select Case MessageBox.Show(EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNo, MessageBoxImage.Question)
'Select Case MessageBox.Show(EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNo, MessageBoxImage.Question)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNo, MessageBoxImage.Question)
Case MessageBoxResult.Yes
Save()
Case MessageBoxResult.No
@@ -127,7 +128,8 @@ Public Class SetUpDbVM
Public Sub Save()
If Not m_SetUpVM.Save(m_SetUpDir_FilePath & "\" & m_SelSetUp & SETUP_FILEEXTENSION) Then
EgtOutLog("Error in setup saving: can't find the directory")
MessageBox.Show("Error in saving Setup.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("Error in saving Setup.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Error in saving Setup.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Else
m_IsNew = False
m_SetUpVM.ResetModifiedSetUp()
@@ -156,7 +158,8 @@ Public Class SetUpDbVM
Public Sub AddSetup()
' se setup modificato, chiedo se salvare
If m_SetUpVM.IsModifiedSetUp OrElse m_IsNew Then
Select Case MessageBox.Show(EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
'Select Case MessageBox.Show(EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes
Save()
Case MessageBoxResult.No
@@ -208,7 +211,8 @@ Public Class SetUpDbVM
''' </summary>
Public Sub RemoveSetup()
' chiedo conferma
If MessageBox.Show("Are you sure you want to delete this setup?", "Setup", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then Return
'If MessageBox.Show("Are you sure you want to delete this setup?", "Setup", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then Return
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to delete this setup?", "Setup", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then Return
' recupero indice setup corrente
Dim DeletedIndex As Integer = m_SetUpList.IndexOf(m_SelSetUp)
' elimino il file
@@ -218,7 +222,8 @@ Public Class SetUpDbVM
File.Delete(DeleteFilePath)
Catch ex As Exception
EgtOutLog("Error in deleting setup file: " & ex.ToString)
MessageBox.Show("Impossible deleting the setup file.", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation)
'MessageBox.Show("Impossible deleting the setup file.", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible deleting the setup file.", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation)
Return
End Try
End If
@@ -254,7 +259,8 @@ Public Class SetUpDbVM
Public Sub Close()
' se setup modificato, chiedo se salvare
If m_SetUpVM.IsModifiedSetUp OrElse m_IsNew Then
Select Case MessageBox.Show(EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
'Select Case MessageBox.Show(EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes
Save()
Case MessageBoxResult.No
+2 -1
View File
@@ -84,7 +84,8 @@ Module Beam
BeamMchsWinV.ShowDialog()
Else
' Impossibile aprire l'Editor delle lavorazioni delle travi.<br/>Mancano i file di configurazione. - Errore
MessageBox.Show(EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
'MessageBox.Show(EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
End If
Return True
End Function
+2 -1
View File
@@ -85,7 +85,8 @@ Module Wall
WallMchsWinV.ShowDialog()
Else
' Impossibile aprire l'Editor delle lavorazioni delle pareti.<br/>Mancano i file di configurazione. - Errore
MessageBox.Show(EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
'MessageBox.Show(EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
End If
Return True
End Function
+6 -10
View File
@@ -150,21 +150,24 @@ Public Class DoorPanelVM
Dim sTablesDir As String = String.Empty
If GetPrivateProfileString(S_DOORS, K_TABLESDIR, "", sTablesDir) = 0 Then
' Se non lo trovo mando messaggio di errore e chiudo la finestra
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 4), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 4), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORSERRORS + 4), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
IniFile.m_sTablesRoot = IniFile.m_sDoorsDirPath & "\" & sTablesDir
' Verifico che la cartella indicata esista
If Not My.Computer.FileSystem.DirectoryExists(IniFile.m_sTablesRoot) Then
' Se non la trovo mando messaggio di errore e chiudo la finestra
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 5), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 5), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORSERRORS + 5), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' Verifico che ci sia il file ini per scrivere le tabelle
If Not My.Computer.FileSystem.FileExists(IniFile.m_sTablesRoot & "\" & MTABLETEMPLATE_FILE) OrElse Not My.Computer.FileSystem.FileExists(IniFile.m_sTablesRoot & "\" & GEONAMELIST_FILE) _
OrElse Not My.Computer.FileSystem.FileExists(IniFile.m_sTablesRoot & "\" & OPERATIONLIST_FILE) Then
' Se non la trovo mando messaggio di errore e chiudo la finestra
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 6), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 6), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORSERRORS + 6), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' verifico
@@ -172,13 +175,6 @@ Public Class DoorPanelVM
Dim MTableDb As New MTableDbV(Application.Current.MainWindow, New MTableDbVM)
MTableDb.ShowDialog()
'Dim MTableDbWindow As New MTableDbView
'MTableDbWindow.Height = 614
'MTableDbWindow.Width = 1024
'MTableDbWindow.DataContext = New MTableDbViewModel
'MTableDbWindow.Owner = Application.Current.MainWindow
'MTableDbWindow.ShowDialog()
End Sub
#End Region ' MTableDbCommand
+8 -4
View File
@@ -83,7 +83,8 @@ Public Module Doors
If Not bNcGen And Not bBatch And nProbing = 0 Then
' Segnalazione eventuali Warnings/Errors
If nErr = 999 Then
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 17), EgtMsg(MSG_DOORSERRORS + 1).ToUpper)
'MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 17), EgtMsg(MSG_DOORSERRORS + 1).ToUpper)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORSERRORS + 17), EgtMsg(MSG_DOORSERRORS + 1).ToUpper)
ElseIf nErr <> 0 Then
Try
Dim sErrFilePath As String = Path.ChangeExtension(sDdfFile, ".txt")
@@ -93,12 +94,15 @@ Public Module Doors
If Not String.IsNullOrWhiteSpace(Lines(Index)) Then sErrMsg &= Lines(Index) & vbCrLf
Next
If nErr > 0 Then
MessageBox.Show(sErrMsg, EgtMsg(MSG_DOORSERRORS + 1).ToUpper, MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(sErrMsg, EgtMsg(MSG_DOORSERRORS + 1).ToUpper, MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, sErrMsg, EgtMsg(MSG_DOORSERRORS + 1).ToUpper, MessageBoxButton.OK, MessageBoxImage.Error)
Else
MessageBox.Show(sErrMsg, EgtMsg(MSG_DOORSERRORS + 3).ToUpper, MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show(sErrMsg, EgtMsg(MSG_DOORSERRORS + 3).ToUpper, MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, sErrMsg, EgtMsg(MSG_DOORSERRORS + 3).ToUpper, MessageBoxButton.OK, MessageBoxImage.Warning)
End If
Catch ex As Exception
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 7), EgtMsg(MSG_DOORSERRORS + 1).ToUpper)
'MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 7), EgtMsg(MSG_DOORSERRORS + 1).ToUpper)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORSERRORS + 7), EgtMsg(MSG_DOORSERRORS + 1).ToUpper)
End Try
End If
End If
+13 -12
View File
@@ -404,9 +404,9 @@ Public Class MTableDbVM
If EgtVerifyMachinesDir() AndAlso Not bActiveMTableFound AndAlso m_TablesList.Count > 0 Then
m_TablesList(0).IsSelected = True
If Not m_TablesList(0).IsSelected Then
m_TablesList.RemoveAt( 0)
return
End If
m_TablesList.RemoveAt(0)
Return
End If
m_TablesList(0).SelMachine = m_TablesList(0).ActiveMachinesList(0)
End If
End Sub
@@ -921,11 +921,13 @@ Public Class MTableDbVM
End While
' verifico se la tabella selezionata è quella attiva
If SelectedMTable.ActiveTable Then
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 8) & vbCrLf & EgtMsg(MSG_DOORSERRORS + 9), "", MessageBoxButton.OK, MessageBoxImage.Stop)
'MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 8) & vbCrLf & EgtMsg(MSG_DOORSERRORS + 9), "", MessageBoxButton.OK, MessageBoxImage.Stop)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORSERRORS + 8) & vbCrLf & EgtMsg(MSG_DOORSERRORS + 9), "", MessageBoxButton.OK, MessageBoxImage.Stop)
Exit Sub
End If
' chiedo conferma prima di cancellare la tabella
If MessageBox.Show(EgtMsg(MSG_DOORS + 6), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(MSG_DOORS + 6), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORS + 6), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If Not String.IsNullOrEmpty(SelectedMTable.TableNamePath) Then
File.Delete(SelectedMTable.TableNamePath)
End If
@@ -1188,9 +1190,8 @@ Public Class MTableDbVM
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If Not IsNothing(SelectedMTable) AndAlso SelectedMTable.ActiveMachinesList.Count > 1 Then
' Chiedo conferma cancellazione associazione macchina
If MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 12), EgtMsg(MSG_DOORSERRORS + 11), MessageBoxButton.YesNo, MessageBoxImage.Question) <> MessageBoxResult.Yes Then
Return
End If
'If MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 12), EgtMsg(MSG_DOORSERRORS + 11), MessageBoxButton.YesNo, MessageBoxImage.Question) <> MessageBoxResult.Yes Then Return
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORSERRORS + 12), EgtMsg(MSG_DOORSERRORS + 11), MessageBoxButton.YesNo, MessageBoxImage.Question) <> MessageBoxResult.Yes Then Return
SelectedMTable.ActiveMachinesList.RemoveAt(SelectedMTable.SharedMachIndex - 1)
SelectedMTable.MachIdList.RemoveAt(SelectedMTable.SharedMachIndex - 1)
SelectedMTable.SharedMachIndex -= 1
@@ -1251,9 +1252,8 @@ Public Class MTableDbVM
If Not IsNothing(SelectedMTable) AndAlso SelectedMTable.AssociationList.Count > 1 Then
If IsNothing(SelectedMTable.SelectedAssociation) Then Return
' Chiedo conferma cancellazione riga di associazione
If MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 10), EgtMsg(MSG_DOORSERRORS + 11), MessageBoxButton.YesNo, MessageBoxImage.Question) <> MessageBoxResult.Yes Then
Return
End If
'If MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 10), EgtMsg(MSG_DOORSERRORS + 11), MessageBoxButton.YesNo, MessageBoxImage.Question) <> MessageBoxResult.Yes Then Return
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORSERRORS + 10), EgtMsg(MSG_DOORSERRORS + 11), MessageBoxButton.YesNo, MessageBoxImage.Question) <> MessageBoxResult.Yes Then Return
Dim SelectedIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociation)
' rimuovo Item associati dalla lisa lavorazioni ordinata
RemoveMachItem(SelectedIndex, SelectedMTable, SelectedMTable.AssociationList(SelectedIndex).RefMachItem)
@@ -1754,7 +1754,8 @@ Public Class MTableDbVM
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If Not IsNothing(SelectedMTable) AndAlso (SelectedMTable.IsModified() OrElse String.IsNullOrEmpty(SelectedMTable.m_TableNamePath)) Then
' chiedo se salvare la tabella corrente prima di passare alla successiva
If MessageBox.Show(EgtMsg(MSG_DOORS + 7), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(MSG_DOORS + 7), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORS + 7), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
SaveTable(SelectedMTable)
End If
End If
+3 -2
View File
@@ -56,7 +56,8 @@ Public Class MTableListBoxItem
m_delSearchInMTable(Me)
ElseIf IsModified() OrElse String.IsNullOrEmpty(m_TableNamePath) Then
' chiedo se salvare la tabella corrente prima di passare alla successiva
If MessageBox.Show(EgtMsg(MSG_DOORS + 7), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(MSG_DOORS + 7), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DOORS + 7), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
m_delSaveMTable(Me)
ElseIf String.IsNullOrEmpty(m_TableNamePath) Then
Visibility = Windows.Visibility.Collapsed
@@ -315,7 +316,7 @@ Public Class MTableMachineListBoxItem
Sub New(sMachName As String, bNcGenerate As Boolean, bMakeraw As Boolean, nMachId As Integer)
If m_MachinesList.Count = 0 Then
If Not SearchMachine() Then MessageBox.Show("Error: Can't find machines dir!")
If Not SearchMachine() Then EgtMessageBoxV.Show(Application.Current.MainWindow, "Error: Can't find machines dir!") ' MessageBox.Show("Error: Can't find machines dir!")
End If
If Not String.IsNullOrWhiteSpace(sMachName) Then
For Index = 0 To m_MachinesList.Count - 1
+2 -1
View File
@@ -496,7 +496,8 @@ Module TableUtility
If Directory.Exists(IniFile.m_sDoorsDirPath) Then
Return True
Else
If MessageBox.Show(String.Format(EgtMsg(MSG_DOORSERRORS + 15) & Environment.NewLine & EgtMsg(MSG_DOORSERRORS + 16), IniFile.m_sDoorsDirPath), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) = MessageBoxResult.Yes Then
'If MessageBox.Show(String.Format(EgtMsg(MSG_DOORSERRORS + 15) & Environment.NewLine & EgtMsg(MSG_DOORSERRORS + 16), IniFile.m_sDoorsDirPath), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(MSG_DOORSERRORS + 15) & Environment.NewLine & EgtMsg(MSG_DOORSERRORS + 16), IniFile.m_sDoorsDirPath), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) = MessageBoxResult.Yes Then
Return RecursiveVerifyDoorsDir()
End If
Return False
+20 -10
View File
@@ -56,7 +56,8 @@ Module GunStock
' Carico ambiente lua per Gunstock
If Not LoadGunStock() Then
MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 2), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 2), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_GUNSTOCKERRORS + 2), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog("Error in LoadGunStock")
Return False
End If
@@ -64,7 +65,8 @@ Module GunStock
' Lettura dei parametri dal modello
m_sDescription = String.Empty
If Not ReadModParams() Then
MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 3), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 3), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_GUNSTOCKERRORS + 3), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog("Error in ReadModParams")
Return False
End If
@@ -80,14 +82,16 @@ Module GunStock
' Scrivo file PEZ
If Not WritePezParams() Then
MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog("Error in WritePezParams")
Return False
End If
' Visualizzo dimensioni grezzo
If Not ShowRawDim() Then
MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog("Error in ShawRawDim")
Return False
End If
@@ -127,14 +131,16 @@ Module GunStock
' Carico ambiente lua per Gunstock
If Not LoadGunStock() Then
MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 2), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 2), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_GUNSTOCKERRORS + 2), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog("Error in LoadGunStock")
Return False
End If
' Lettura dei parametri dal pezzo
If Not ReadPezParams() Then
MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 3), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 3), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_GUNSTOCKERRORS + 3), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog("Error in ReadPezParams")
Return False
End If
@@ -146,14 +152,16 @@ Module GunStock
' Scrivo file PEZ
If Not WritePezParams() Then
MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog("Error in WritePezParams")
Return False
End If
' Visualizzo dimensioni grezzo
If Not ShowRawDim() Then
MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_GUNSTOCKERRORS + 4), EgtMsg(MSG_GUNSTOCKERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog("Error in ShawRawDim")
Return False
End If
@@ -172,7 +180,8 @@ Module GunStock
' Carico ambiente lua per Gunstock
If Not LoadGunStock() Then
MessageBox.Show(EgtMsg(8252), EgtMsg(8251), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(8252), EgtMsg(8251), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(8252), EgtMsg(8251), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog("Error in LoadGunStock")
Return False
End If
@@ -316,7 +325,8 @@ Module GunStock
If Not EgtLuaGetGlobStringVar("GGD.DIMGREZ", sDimGrez) Or
String.IsNullOrWhiteSpace(sDimGrez) Then Return False
' Visualizzo la dimensione del grezzo
MessageBox.Show(sDimGrez, EgtMsg(MSG_GUNSTOCK + 13), MessageBoxButton.OK, MessageBoxImage.Information)
'MessageBox.Show(sDimGrez, EgtMsg(MSG_GUNSTOCK + 13), MessageBoxButton.OK, MessageBoxImage.Information)
EgtMessageBoxV.Show(Application.Current.MainWindow, sDimGrez, EgtMsg(MSG_GUNSTOCK + 13), MessageBoxButton.OK, MessageBoxImage.Information)
Return True
End Function
+4 -2
View File
@@ -11,8 +11,10 @@ Public Class GunStockWndV
System.IO.Path.GetExtension(FileNameTxBl.Text)
' Verifico se esiste già e chiedo conferma di sovrascrittura
If File.Exists(sFile) Then
If MessageBox.Show(sFile & " " & EgtMsg(MSG_EGTSAVEFILEDIALOG + 3) & vbCrLf & EgtMsg(MSG_EGTSAVEFILEDIALOG + 4),
"", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) <> MessageBoxResult.Yes Then
'If MessageBox.Show(sFile & " " & EgtMsg(MSG_EGTSAVEFILEDIALOG + 3) & vbCrLf & EgtMsg(MSG_EGTSAVEFILEDIALOG + 4),
' "", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) <> MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, sFile & " " & EgtMsg(MSG_EGTSAVEFILEDIALOG + 3) & vbCrLf & EgtMsg(MSG_EGTSAVEFILEDIALOG + 4),
"", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) <> MessageBoxResult.Yes Then
Exit Sub
End If
End If
+4 -2
View File
@@ -58,7 +58,8 @@ Public Class MyToolDbWindowVM
' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
If Not File.Exists(IniFile.m_sCurrMachScriptsDirPath & "\" & SETUP_LUA) Then
EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato,
@@ -77,7 +78,8 @@ Public Class MyToolDbWindowVM
EgtLuaGetGlobIntVar("STU.ERR", nErr)
If nErr = 0 Then
If EgtGetHeadExitCount(sHead) = 0 Then
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
End If
+16 -8
View File
@@ -256,7 +256,8 @@ Public Class TopCommandBarVM
EgtLuaCreateGlobTable("MACH")
If Not EgtLuaExecFile(sInitMachScriptPath) Then
EgtOutLog("Error executing Machining init script " & sInitMachScriptPath)
MessageBox.Show(EgtMsg(MSG_DISPOSITIONERRORS + 3) & " " & sInitMachScriptPath, EgtMsg(MSG_DISPOSITIONERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_DISPOSITIONERRORS + 3) & " " & sInitMachScriptPath, EgtMsg(MSG_DISPOSITIONERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DISPOSITIONERRORS + 3) & " " & sInitMachScriptPath, EgtMsg(MSG_DISPOSITIONERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End If
Dim nErr As Integer = 999
@@ -275,7 +276,8 @@ Public Class TopCommandBarVM
EgtLuaCreateGlobTable("MACH")
If Not EgtLuaExecFile(sExitMachScriptPath) Then
EgtOutLog("Error executing Machining exit script " & sExitMachScriptPath)
MessageBox.Show(EgtMsg(MSG_DISPOSITIONERRORS + 4) & " " & sExitMachScriptPath, EgtMsg(MSG_DISPOSITIONERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_DISPOSITIONERRORS + 4) & " " & sExitMachScriptPath, EgtMsg(MSG_DISPOSITIONERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_DISPOSITIONERRORS + 4) & " " & sExitMachScriptPath, EgtMsg(MSG_DISPOSITIONERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End If
Dim nErr As Integer = 999
@@ -616,7 +618,8 @@ Public Class TopCommandBarVM
GetPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress)
' se vuoto do messaggio di errore ed esco
If String.IsNullOrWhiteSpace(sSupportAddress) Then
MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' Recupero numero chiave
@@ -627,14 +630,16 @@ Public Class TopCommandBarVM
EgtGetCurrFilePath(sCurrProject)
' se nome file vuoto, chiedo se si vuole salvare
If String.IsNullOrWhiteSpace(sCurrProject) Then
If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
Map.refProjectVM.SaveProject()
End If
EgtGetCurrFilePath(sCurrProject)
' se modificato, chiedo se si vuole salvare
Else
If EgtGetModified() Then
If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
Map.refProjectVM.SaveProject()
End If
End If
@@ -732,7 +737,8 @@ Public Class TopCommandBarVM
bEx = True
End Try
If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then
MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
'MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
Else
Map.refStatusBarVM.NotifyStatusOutput(EgtMsg(MSG_TOPCOMMANDBAR + 14))
End If
@@ -754,10 +760,12 @@ Public Class TopCommandBarVM
m_MachiningIsChecked = False
If nErr = 1 Then
' Error loading or creating Machining Group - LAVORA
MessageBox.Show(EgtMsg(10008), EgtMsg(5002), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(10008), EgtMsg(5002), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(10008), EgtMsg(5002), MessageBoxButton.OK, MessageBoxImage.Error)
ElseIf nErr = -1 Then
' Non ci sono gruppi di lavoro - LAVORA
MessageBox.Show(EgtMsg(5551), EgtMsg(5002), MessageBoxButton.OK, MessageBoxImage.Information)
'MessageBox.Show(EgtMsg(5551), EgtMsg(5002), MessageBoxButton.OK, MessageBoxImage.Information)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5551), EgtMsg(5002), MessageBoxButton.OK, MessageBoxImage.Information)
End If
End If
End Sub
+105
View File
@@ -1238,4 +1238,109 @@
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<!--EgtHexagon-->
<EgtWPFLib5:HexClipConverter x:Key="ClipConverter"/>
<Style TargetType="{x:Type EgtWPFLib5:EgtHexItem}" x:Key="EgtHexItem">
<Setter Property="Background" Value="CornflowerBlue"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1.5"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="EgtWPFLib5:EgtHexItem">
<Grid Name="hexBorder" Background="{TemplateBinding BorderBrush}">
<Grid.Clip>
<MultiBinding Converter="{StaticResource ClipConverter}">
<Binding Path="ActualWidth" ElementName="hexBorder"/>
<Binding Path="ActualHeight" ElementName="hexBorder"/>
<Binding Path="Orientation" RelativeSource="{RelativeSource TemplatedParent}"/>
</MultiBinding>
</Grid.Clip>
<Grid Name="hexContent"
Background="{TemplateBinding Background}"
Margin="{TemplateBinding BorderThickness}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.Clip>
<MultiBinding Converter="{StaticResource ClipConverter}">
<Binding Path="ActualWidth" ElementName="hexContent"/>
<Binding Path="ActualHeight" ElementName="hexContent"/>
<Binding Path="Orientation" RelativeSource="{RelativeSource TemplatedParent}"/>
</MultiBinding>
</Grid.Clip>
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
ClipToBounds="True"
Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="Gold"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--HexList-->
<Style TargetType="{x:Type EgtWPFLib5:EgtHexList}" x:Key="EgtHexList">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<EgtWPFLib5:EgtHexagon ColumnCount="{Binding Path=ColumnCount, RelativeSource={RelativeSource AncestorType=ListBox}}"
RowCount="{Binding Path=RowCount, RelativeSource={RelativeSource AncestorType=ListBox}}"
Background="{Binding Path=Background, RelativeSource={RelativeSource AncestorType=ListBox}}"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type EgtWPFLib5:EgtHexList}">
<Grid>
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
<ScrollViewer Focusable="False"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
Padding="{TemplateBinding Padding}">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DialogWindow_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="LeftPanel_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
</Style>
<Style x:Key="ColorPicker_TextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Width" Value="65"/>
</Style>
<Style x:Key="RightPanel_HalfRound_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="24"/>
<Setter Property="Width" Value="64"/>
<Setter Property="BorderThickness" Value="1,1,1,0"/>
</Style>
</ResourceDictionary>
+4 -2
View File
@@ -102,7 +102,8 @@ Public Module MachineModel
If EgtSetCurrMachine(sMachineName) Then
Return True
End If
If MessageBox.Show(String.Format(EgtMsg(MSG_DOORSERRORS + 13) & Environment.NewLine & EgtMsg(MSG_DOORSERRORS + 14), sMachineName), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) = MessageBoxResult.Yes Then
'If MessageBox.Show(String.Format(EgtMsg(MSG_DOORSERRORS + 13) & Environment.NewLine & EgtMsg(MSG_DOORSERRORS + 14), sMachineName), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(MSG_DOORSERRORS + 13) & Environment.NewLine & EgtMsg(MSG_DOORSERRORS + 14), sMachineName), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) = MessageBoxResult.Yes Then
Return EgtTrySettingCurrMachine(sMachineName)
End If
Return False
@@ -121,7 +122,8 @@ Public Module MachineModel
If Directory.Exists(IniFile.m_sMachinesRoot) Then
Return True
Else
If MessageBox.Show(String.Format(EgtMsg(MSG_DOORSERRORS + 13) & Environment.NewLine & EgtMsg(MSG_DOORSERRORS + 14), IniFile.m_sMachinesRoot), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) = MessageBoxResult.Yes Then
'If MessageBox.Show(String.Format(EgtMsg(MSG_DOORSERRORS + 13) & Environment.NewLine & EgtMsg(MSG_DOORSERRORS + 14), IniFile.m_sMachinesRoot), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(MSG_DOORSERRORS + 13) & Environment.NewLine & EgtMsg(MSG_DOORSERRORS + 14), IniFile.m_sMachinesRoot), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.YesNo, MessageBoxImage.Error) = MessageBoxResult.Yes Then
Return VerifyMachinesDir()
End If
Return False