Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9bc09a73b2 | |||
| 2ba7424137 | |||
| aea8143807 | |||
| 79151af902 | |||
| 5bf6b4acd4 | |||
| 0e7764b9df | |||
| c745c69ad2 |
@@ -90,6 +90,7 @@ Module ConstIni
|
||||
Public Const K_MYPROJECTDIR As String = "ProjectDirectory"
|
||||
Public Const K_TEMPLATEDIR As String = "TemplateDirectory"
|
||||
Public Const K_MACHINDIR As String = "MachinDirectory"
|
||||
Public Const K_MTABLE As String = "MTable"
|
||||
|
||||
Public Const S_REPORT As String = "Report"
|
||||
Public Const K_REPORTDIR As String = "ReportDirectory"
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
<EgtDOORCreator:TrueToFalse x:Key="TrueToFalse"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Name="MainGrid" IsEnabled="{Binding EnablePageDoor}">
|
||||
<Grid IsEnabled="{Binding EnablePageDoor}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding WidthColumn1}"/>
|
||||
<ColumnDefinition Width="{Binding WidthColumn2}"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Margin="0,0,0,0.2" Grid.Column="{Binding GridGeneralDiposition}" IsEnabled="{Binding IsReadOnly}">
|
||||
<Grid Margin="0,0,0,0.2" Grid.Column="1" IsEnabled="{Binding IsReadOnly}">
|
||||
<Grid.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding DataContext.RefreshCmd,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||
<KeyBinding Key="F1" Command="{Binding DataContext.GuideCmd,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||
@@ -893,7 +893,7 @@
|
||||
</ListBox>
|
||||
|
||||
</Grid>
|
||||
<ContentControl Name="MainContentConrol" Grid.Column="{Binding CompoPanelDiposition}" Grid.Row="0" Content="{Binding CompoPanelControl}"/>
|
||||
<ContentControl Grid.Column="0" Grid.Row="0" Content="{Binding CompoPanelControl}"/>
|
||||
<!--<EgtDOORCreator:CompoPanelV Grid.Column="0" DataContext="{Binding CompoPanelPartVM}"/>-->
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Public Class PartPageV
|
||||
|
||||
Public Sub ItemsControl_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
|
||||
Dim ListControl As ListBox = DirectCast(sender, ListBox)
|
||||
If Not IsNothing(ListControl.SelectedItem) Then
|
||||
Dim ListControl As ListBox=DirectCast(sender,listbox)
|
||||
If Not IsNothing( ListControl.SelectedItem) Then
|
||||
Dim SelectedItemIndex As Integer = ListControl.Items.IndexOf(ListControl.SelectedItem)
|
||||
If SelectedItemIndex < 0 Then Return
|
||||
ListControl.Dispatcher.BeginInvoke(DirectCast(Sub()
|
||||
@@ -30,5 +30,4 @@
|
||||
Private Sub UserControl_IsEnabledChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -73,50 +73,6 @@ Public Class PartPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "DISPOSITION SCREEN"
|
||||
|
||||
Public ReadOnly Property WidthColumn1 As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 0 Or OptionModule.m_nDispostionScreen = 1 Then
|
||||
Return "1*"
|
||||
Else
|
||||
Return "5*"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property WidthColumn2 As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 0 Or OptionModule.m_nDispostionScreen = 1 Then
|
||||
Return "5*"
|
||||
Else
|
||||
Return "1*"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GridGeneralDiposition As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 0 Or OptionModule.m_nDispostionScreen = 1 Then
|
||||
Return "1"
|
||||
Else
|
||||
Return "0"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CompoPanelDiposition As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 0 Or OptionModule.m_nDispostionScreen = 1 Then
|
||||
Return "0"
|
||||
Else
|
||||
Return "1"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Disposition Screen
|
||||
|
||||
#Region "CONSTUCTOR"
|
||||
|
||||
Sub New()
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<Grid IsEnabled="{Binding EnablePageHardware}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<!-- Colonna dedicata alla lista dei bottoni -->
|
||||
<ColumnDefinition Width="{Binding WidthColumn1}"/>
|
||||
<ColumnDefinition Width="{Binding WidthColumn2}"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
@@ -26,9 +26,8 @@
|
||||
<KeyBinding Key="Enter" Command="{Binding DataContext.RefreshCmd,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||
<KeyBinding Key="F1" Command="{Binding DataContext.GuideCmd,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||
</Grid.InputBindings>
|
||||
|
||||
<!-- La griglia che gestirà i parametri hardaware -->
|
||||
<Grid Grid.Column="{Binding GridGeneralDiposition}" Grid.Row="0">
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<!-- Deicata al general dell'hardware-->
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -859,9 +858,9 @@
|
||||
</Grid>
|
||||
|
||||
<!-- Elenco pulsanti Hardware -->
|
||||
<ContentControl Grid.Column="{Binding CompoPanelDiposition}" Grid.RowSpan="2" Grid.Row="0" Content="{Binding CompoPanelControl}"/>
|
||||
<ContentControl Grid.Column="0" Grid.RowSpan="2" Grid.Row="0" Content="{Binding CompoPanelControl}"/>
|
||||
|
||||
<EgtDOORCreator:HardwareHelpSceneHostV Grid.Column="{Binding GridGeneralDiposition}" Grid.Row="1" Margin="0,0,2,0" />
|
||||
<EgtDOORCreator:HardwareHelpSceneHostV Grid.Column="1" Grid.Row="1" Margin="0,0,2,0"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -93,50 +93,6 @@ Public Class HardwarePageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "DISPOSITION SCREEN"
|
||||
|
||||
Public ReadOnly Property WidthColumn1 As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 0 Or OptionModule.m_nDispostionScreen = 1 Then
|
||||
Return "1*"
|
||||
Else
|
||||
Return "5*"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property WidthColumn2 As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 0 Or OptionModule.m_nDispostionScreen = 1 Then
|
||||
Return "5*"
|
||||
Else
|
||||
Return "1*"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GridGeneralDiposition As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 0 Or OptionModule.m_nDispostionScreen = 1 Then
|
||||
Return "1"
|
||||
Else
|
||||
Return "0"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CompoPanelDiposition As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 0 Or OptionModule.m_nDispostionScreen = 1 Then
|
||||
Return "0"
|
||||
Else
|
||||
Return "1"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Disposition Screen
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property GeneralMsg As String
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--<ColumnDefinition Width="1*"/>-->
|
||||
<ColumnDefinition Width="{Binding WidthColumn1}"/>
|
||||
<ColumnDefinition Width="{Binding WidthColumn2}"/>
|
||||
<ColumnDefinition Width="6*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -32,11 +32,10 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--<EgtDOORCreator:AssemblyManagerV Grid.Column="0" DataContext="{StaticResource AssemblyManagerVM}"/>-->
|
||||
<ContentControl Grid.Column="{Binding AssemblyManagerDisposition}" Grid.Row="0" Content="{Binding AssemblyManagerControl}"/>
|
||||
<ContentControl Grid.Column="{Binding PageControlDisposition}" Grid.Row="1" Content="{Binding PageControl}"/>
|
||||
<!--<EgtDOORCreator:SceneManagerV Grid.Column="{Binding SceneManagerDiposition}" Grid.RowSpan="2" DataContext="{StaticResource SceneManagerVM}"/>-->
|
||||
<!--<EgtDOORCreator:SceneManagerV Grid.Column="0" Grid.RowSpan="2" DataContext="{StaticResource SceneManagerVM}"/>-->
|
||||
<ContentControl Grid.Column="{Binding SceneManagerDiposition}" Grid.RowSpan="2" Content="{Binding SceneManagerControl}"/>
|
||||
<ContentControl Grid.Column="0" Grid.Row="0" Content="{Binding AssemblyManagerControl}"/>
|
||||
<ContentControl Grid.Column="0" Grid.Row="1" Content="{Binding PageControl}"/>
|
||||
<EgtDOORCreator:SceneManagerV Grid.Column="1" Grid.RowSpan="2" DataContext="{StaticResource SceneManagerVM}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
|
||||
@@ -77,7 +77,6 @@ Public Class MainWindowVM
|
||||
Private m_PartPage As PartPageV
|
||||
Private m_AssemblyPage As AssemblyPageV
|
||||
Private m_HardwarePage As HardwarePageV
|
||||
Private m_SceneManager As SceneManagerV
|
||||
|
||||
Private Watcher As FileSystemWatcher = New FileSystemWatcher(IniFile.m_CompoDir, "*" & LUA_EXTENSION)
|
||||
|
||||
@@ -129,12 +128,6 @@ Public Class MainWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SceneManagerControl As ContentControl
|
||||
Get
|
||||
Return m_SceneManager
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProjectManagerControl As ContentControl
|
||||
Get
|
||||
If m_SelectedPage <> ListPageEnum.nHardwarePage then
|
||||
@@ -166,67 +159,10 @@ Public Class MainWindowVM
|
||||
m_HardwarePage.DataContext = New HardwarePageVM
|
||||
m_AssemblyManager = New AssemblyManagerV
|
||||
m_AssemblyManager.DataContext = New AssemblyManagerVM
|
||||
' inserisco la scena
|
||||
m_SceneManager = New SceneManagerV
|
||||
m_SceneManager.DataContext = New SceneManagerVM
|
||||
Dim OptionsPage As OptionsVM = OptionPage
|
||||
InitWatcher()
|
||||
End Sub
|
||||
|
||||
#Region "DISPOSITION SCREEN"
|
||||
|
||||
Public ReadOnly Property WidthColumn1 As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 1 Or OptionModule.m_nDispostionScreen = 2 Then
|
||||
Return "5*"
|
||||
Else
|
||||
Return "6*"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property WidthColumn2 As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 1 Or OptionModule.m_nDispostionScreen = 2 Then
|
||||
Return "6*"
|
||||
Else
|
||||
Return "5*"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AssemblyManagerDisposition As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 1 Or OptionModule.m_nDispostionScreen = 2 Then
|
||||
Return "1"
|
||||
Else
|
||||
Return "0"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PageControlDisposition As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 1 Or OptionModule.m_nDispostionScreen = 2 Then
|
||||
Return "1"
|
||||
Else
|
||||
Return "0"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SceneManagerDiposition As String
|
||||
Get
|
||||
If OptionModule.m_nDispostionScreen = 1 Or OptionModule.m_nDispostionScreen = 2 Then
|
||||
Return "0"
|
||||
Else
|
||||
Return "1"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Disposition Screen
|
||||
|
||||
#Region "Methods"
|
||||
|
||||
Public Sub ShowErrorCompoLoad()
|
||||
|
||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.9.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.9.1")>
|
||||
<Assembly: AssemblyVersion("2.4.11.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.11.1")>
|
||||
|
||||
+116
-13
@@ -11,6 +11,11 @@ Friend Module OptionModule
|
||||
Friend m_LanguageList As New ObservableCollection(Of Language)
|
||||
Friend m_SelectedLanguage As Language
|
||||
|
||||
' Elenco delle MTable disponibili nella configurazione corrente
|
||||
Friend m_MTableList As New ObservableCollection(Of MTable)
|
||||
Friend m_SelectedMTable As MTable
|
||||
Friend m_CurrentMachine As String = String.Empty
|
||||
|
||||
Friend m_OptionLauncherList As New List(Of String)
|
||||
Friend m_SelectedOptionLauncher As Integer = 0
|
||||
Friend m_bLauncherOpenOnce As Boolean = False
|
||||
@@ -45,8 +50,6 @@ Friend Module OptionModule
|
||||
|
||||
Friend m_EnableBrowse As Boolean = False
|
||||
|
||||
Friend m_nDispostionScreen As Integer = 0
|
||||
|
||||
Friend Enum LauncherOpt As Integer
|
||||
Open_window = 0
|
||||
Open_last_project = 1
|
||||
@@ -234,14 +237,6 @@ Friend Module OptionModule
|
||||
EgtSetUiUnits(m_bIsMmUnit)
|
||||
m_SelectedMeasureUnit = m_MeasureUnitList(If(m_bIsMmUnit, 0, 1))
|
||||
|
||||
' leggo come deve essere visualizzato il programma
|
||||
Dim nDispositionScreen As Integer = GetMainPrivateProfileInt(S_GENERAL, "DispositionScreen", 0)
|
||||
If nDispositionScreen < 0 Or nDispositionScreen > 2 Then
|
||||
m_nDispostionScreen = 0
|
||||
Else
|
||||
m_nDispostionScreen = nDispositionScreen
|
||||
End If
|
||||
|
||||
' imposto tipo di avvio
|
||||
Dim nLauncher As Integer = GetMainPrivateProfileInt(S_LAUNCHERWINDOW, K_LAUNCHER, 0)
|
||||
m_SelectedOptionLauncher = (nLauncher Mod LoOpenOnce)
|
||||
@@ -401,6 +396,10 @@ Friend Module OptionModule
|
||||
DefaultGetMmUnits(ConstCompo.S_GENERALINI, ConstCompo.K_MMUNITSINI, IsMM)
|
||||
m_IsMM = IsMM
|
||||
|
||||
If GetCurrentMTableList() Then
|
||||
' abilito la modifica della MTbale solo se Debug superioere a 5
|
||||
End If
|
||||
|
||||
Dim Width As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_SIZE_INI, K_WIDTH_INI, "32", Width)
|
||||
Utility.ConvertCompoConfig(Width, 500)
|
||||
@@ -834,12 +833,17 @@ Friend Module OptionModule
|
||||
Friend Sub CreateNewPropertiesList(ByRef LocalPart As Part)
|
||||
If OptionModule.m_DisableProperties <> Visibility.Visible Then Return
|
||||
If OptionModule.m_MaterialList.Count > 0 Then
|
||||
LocalPart.SetMaterial(OptionModule.m_MaterialList(0))
|
||||
' assegno la proprietà di materiale
|
||||
If Not IsNothing(LocalPart.SelectedMaterial) Then
|
||||
LocalPart.SetMaterial(LocalPart.SelectedMaterial)
|
||||
Else
|
||||
LocalPart.SetMaterial(OptionModule.m_MaterialList(0))
|
||||
End If
|
||||
LocalPart.SetPropertiesList(OptionModule.m_MaterialList(0).PropertiesList)
|
||||
Return
|
||||
End If
|
||||
' configurazione senza materiali
|
||||
If LocalPart.PropertiesList.Count > 0 Then LocalPart.PropertiesList.Clear()
|
||||
' configurazione senza materiali
|
||||
If LocalPart.PropertiesList.Count > 0 Then LocalPart.PropertiesList.Clear()
|
||||
For Each Item In OptionModule.m_PropertList
|
||||
LocalPart.PropertiesList.Add(New PropertyItem(Item.Name, Item.GraphicName, Item.IsChecked))
|
||||
Next
|
||||
@@ -1005,6 +1009,75 @@ Friend Module OptionModule
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function GetCurrentMTableList() As Boolean
|
||||
If String.IsNullOrEmpty(IniFile.m_sDoorsDirPath) Then Return False
|
||||
m_MTableList.Clear()
|
||||
Dim sMTableDir As String = IniFile.m_sDoorsDirPath & "\MTables"
|
||||
If Not Directory.Exists(sMTableDir) Then Return False
|
||||
Dim Items As String() = Directory.GetFiles(sMTableDir)
|
||||
' recupero i file che hanno estemsione *.mtl
|
||||
For Each MTableFile As String In Items
|
||||
If MTableFile.EndsWith(".mtl") Then
|
||||
Dim sName As String = Path.GetFileNameWithoutExtension(MTableFile).ToLower
|
||||
Dim sPath As String = MTableFile
|
||||
Dim bIsValid As Boolean = True
|
||||
Dim ExcludeList As List(Of String) = GetExludeList()
|
||||
For Each ExcludedItem As String In ExcludeList
|
||||
If sName.ToLower.Contains(ExcludedItem) Then
|
||||
bIsValid = False
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If bIsValid Then
|
||||
sName = Path.GetFileNameWithoutExtension(MTableFile)
|
||||
Dim LocalMTable As New MTable(sName.Trim, sPath.Trim)
|
||||
m_MTableList.Add(LocalMTable)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If m_MTableList.Count < 1 Then Return False
|
||||
' leggo il nome della MTable attiva
|
||||
Dim sSelectedMTable As String = String.Empty
|
||||
Dim nbSelected As Boolean = False
|
||||
If GetMainPrivateProfileString(S_DOORS, K_MTABLE, "", sSelectedMTable) <> 0 Then
|
||||
For Each ItemFile As MTable In m_MTableList
|
||||
If ItemFile.FilePath.ToLower = sSelectedMTable.Trim.ToLower Then
|
||||
m_SelectedMTable = ItemFile
|
||||
nbSelected = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If Not nbSelected Then m_SelectedMTable = m_MTableList(0)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function GetExludeList() As List(Of String)
|
||||
Dim LocalList As New List(Of String)
|
||||
Dim sVal As String = String.Empty
|
||||
GetMainPrivateProfileString(S_DOORS, "Exclude", "", sVal)
|
||||
Dim sItems As String() = sVal.Split(","c)
|
||||
For Each Item As String In sItems
|
||||
LocalList.Add(Item.Trim)
|
||||
Next
|
||||
Return LocalList
|
||||
End Function
|
||||
|
||||
Public Sub GetCurrentMachineInMTable()
|
||||
' aggiorno il file Config.ini dell'EgtCAM5
|
||||
EgtLuaExecFile(IniFile.m_sConfigDir & "\ChangeConfig.lua")
|
||||
' assegno variabili
|
||||
Dim sDir As String = IniFile.m_sDoorsDirPath.Replace("\", "/")
|
||||
EgtLuaSetGlobStringVar("CCD.NewBaseDir", sDir)
|
||||
EgtLuaSetGlobStringVar("CCD.NewMTable", m_SelectedMTable.Name)
|
||||
' eseguo la funzione che esegue la scrittura delle variabili
|
||||
EgtLuaCallFunction("CCD.GetCurrentMachineInMTable")
|
||||
Dim sVal As String = ""
|
||||
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
||||
OptionModule.m_CurrentMachine = sVal
|
||||
EgtLuaResetGlobVar("CCD")
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
|
||||
' Classe che identifica una lingua del programma con nome e path del file dei messaggi
|
||||
@@ -1037,3 +1110,33 @@ Public Class Language
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class MTable
|
||||
|
||||
Private m_sName As String
|
||||
Private m_sFilePath As String
|
||||
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FilePath As String
|
||||
Get
|
||||
Return m_sFilePath
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sFilePath = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sName As String, sFilePath As String)
|
||||
Me.Name = sName
|
||||
Me.FilePath = sFilePath
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
Title="{Binding Title}" Icon="/Resources/EgtDOOR.ico"
|
||||
TitleBarBrush="{StaticResource EgaltechBlue1}"
|
||||
BorderBrush="{StaticResource EgaltechBlue1}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30"
|
||||
IsResizable="True" IsMovable="True"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
|
||||
|
||||
<EgtWPFLib5:EgtCustomWindow.InputBindings>
|
||||
<KeyBinding Key="F1" Command="{Binding OptionGuideCmd}"/>
|
||||
<KeyBinding Key="Esc" Command="{Binding CloseOptionsCommand}"/>
|
||||
</EgtWPFLib5:EgtCustomWindow.InputBindings>
|
||||
|
||||
|
||||
@@ -27,7 +29,7 @@
|
||||
<RowDefinition Height="6.7*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
@@ -253,6 +255,64 @@
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="{Binding ConfigOption}" IsEnabled="{Binding EnableConfig}">
|
||||
<Grid Margin="3,3,3,3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="3.25*"/>
|
||||
<RowDefinition Height="3.0*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Header="{Binding ConfigMsg}" Grid.Row="0" Grid.ColumnSpan="4">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="23*"/>
|
||||
<ColumnDefinition Width="125*"/>
|
||||
<ColumnDefinition Width="443*"/>
|
||||
<ColumnDefinition Width="147*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding ConfigDirectoryMsg}" Grid.Row="1" Grid.Column="0" Margin="2,10,5,5"
|
||||
Style="{StaticResource DoorParamsTxBl}" Grid.ColumnSpan="2"/>
|
||||
<TextBlock Text="{Binding BaseDir}" Grid.Row="1" Grid.Column="2" Margin="2,10,5,5"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<Button Content="{Binding ChangeConfigMsg}" Grid.Row="1" Grid.Column="3"
|
||||
Command="{Binding BrowseCommand}" Margin="5"
|
||||
CommandParameter="ConfigDir"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Seclta della MTable-->
|
||||
<GroupBox Header="{Binding MTableMsg}" Grid.Row="1">
|
||||
<UniformGrid Rows="2">
|
||||
<ComboBox ItemsSource="{Binding MTableList, Mode=OneWay}"
|
||||
DisplayMemberPath="Name" SelectedItem="{Binding SelectedMTable}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Text="{Binding MTableAdvertMsg}" TextWrapping="Wrap"
|
||||
TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Seclta della MTable-->
|
||||
<GroupBox Header="{Binding CurrMachTitleMsg}" Grid.Row="1" Grid.Column="1">
|
||||
<UniformGrid Rows="1">
|
||||
<TextBlock Text="{Binding CurrentMachine}" TextWrapping="Wrap"
|
||||
TextAlignment="Center" VerticalAlignment="Center" FontWeight="Black" Margin="5,0,5,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<!--Impostazioni generali della porta-->
|
||||
@@ -327,7 +387,7 @@
|
||||
Margin="0,10,5,18"
|
||||
Style="{StaticResource DoorParamsChBx}" />
|
||||
|
||||
<TextBox Style="{StaticResource DoorParamsTxBx}"
|
||||
<TextBox Style="{StaticResource DoorParamsTxBx}"
|
||||
Grid.Column="0"
|
||||
Text="{Binding WeightValue, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,5,10,13"
|
||||
|
||||
@@ -80,9 +80,25 @@ Public Class OptionsVM
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_SelectedTabGeneral = value
|
||||
If m_SelectedTabGeneral = 2 Then
|
||||
OptionModule.GetCurrentMachineInMTable()
|
||||
NotifyPropertyChanged("CurrentMachine")
|
||||
m_OrigBaseDir = IniFile.m_sDoorsDirPath
|
||||
m_OrigMTable = OptionModule.m_SelectedMTable.Name
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsChangedConfig As Boolean = False
|
||||
Public ReadOnly Property IsChangedConfig As Boolean
|
||||
Get
|
||||
Return m_IsChangedConfig
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_OrigBaseDir As String = String.Empty
|
||||
Private m_OrigMTable As String = String.Empty
|
||||
|
||||
|
||||
#End Region ' Hardware_part
|
||||
|
||||
@@ -104,6 +120,67 @@ Public Class OptionsVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EnableConfig As Boolean
|
||||
Get
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) > 4 And File.Exists(IniFile.m_sConfigDir & "\ChangeConfig.lua") Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MTableList As ObservableCollection(Of MTable)
|
||||
Get
|
||||
Return OptionModule.m_MTableList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property SelectedMTable As MTable
|
||||
Get
|
||||
Return OptionModule.m_SelectedMTable
|
||||
End Get
|
||||
Set(value As MTable)
|
||||
If Not IsNothing(value) AndAlso value IsNot OptionModule.m_SelectedMTable Then
|
||||
OptionModule.m_SelectedMTable = value
|
||||
WriteMainPrivateProfileString(S_DOORS, K_MTABLE, OptionModule.m_SelectedMTable.FilePath)
|
||||
NotifyPropertyChanged("SelectedMTable")
|
||||
OptionModule.GetCurrentMachineInMTable()
|
||||
NotifyPropertyChanged("CurrentMachine")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property BaseDir As String
|
||||
Get
|
||||
Return IniFile.m_sDoorsDirPath
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value.Trim.ToLower <> IniFile.m_sDoorsDirPath.ToLower Then
|
||||
Dim sPreValue As String = IniFile.m_sDoorsDirPath
|
||||
IniFile.m_sDoorsDirPath = value
|
||||
If Not GetCurrentMTableList() Then
|
||||
MessageBox.Show("Currente directory '" & value & "' is not valid as BaseDir!", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
IniFile.m_sDoorsDirPath = sPreValue
|
||||
GetCurrentMTableList()
|
||||
End If
|
||||
WriteMainPrivateProfileString(S_DOORS, K_BASEDIR, IniFile.m_sDoorsDirPath)
|
||||
m_IsChangedConfig = True
|
||||
NotifyPropertyChanged("SelectedMTable")
|
||||
End If
|
||||
NotifyPropertyChanged("MTableList")
|
||||
NotifyPropertyChanged("ConfigDir")
|
||||
OptionModule.GetCurrentMachineInMTable()
|
||||
NotifyPropertyChanged("CurrentMachine")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CurrentMachine As String
|
||||
Get
|
||||
Return OptionModule.m_CurrentMachine
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MeasureUnitList As List(Of String)
|
||||
Get
|
||||
Return OptionModule.m_MeasureUnitList
|
||||
@@ -1112,9 +1189,9 @@ Public Class OptionsVM
|
||||
Public ReadOnly Property Title As String
|
||||
Get
|
||||
Dim sTitle As String = EgtMsg(MSG_MAINWINDOW + 209)
|
||||
If Map.refMainWindowVM.SelectedPage =MainWindowVM.ListPageEnum.nDDFPage then
|
||||
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage Then
|
||||
sTitle = "DOOR - " & sTitle
|
||||
else
|
||||
Else
|
||||
sTitle = "HARDWARE - " & sTitle
|
||||
End If
|
||||
Return sTitle
|
||||
@@ -1139,6 +1216,12 @@ Public Class OptionsVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MTableAdvertMsg As String
|
||||
Get
|
||||
Return "Going out this page the program will restart."
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MeasureUnit As String
|
||||
Get
|
||||
Return EgtMsg(50211)
|
||||
@@ -1322,7 +1405,7 @@ Public Class OptionsVM
|
||||
|
||||
Public ReadOnly Property MachMsg As String
|
||||
Get
|
||||
' Mach.
|
||||
' Mach.
|
||||
Return EgtMsg(50711)
|
||||
End Get
|
||||
End Property
|
||||
@@ -1352,20 +1435,56 @@ Public Class OptionsVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' TabMsg
|
||||
Public ReadOnly Property GeneralOption As String
|
||||
Get
|
||||
' 50729=General
|
||||
Return EgtMsg(50729)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GeneralCam As String
|
||||
Get
|
||||
' 50730=Report
|
||||
Return EgtMsg(50730)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ConfigOption As String
|
||||
Get
|
||||
Return "Config"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ChangeConfigMsg As String
|
||||
Get
|
||||
Return "Change config"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MTableMsg As String
|
||||
Get
|
||||
Return "MTable"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ConfigMsg As String
|
||||
Get
|
||||
Return "Door Config"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CurrMachTitleMsg As String
|
||||
Get
|
||||
Return "Current Machine"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ConfigDirectoryMsg As String
|
||||
Get
|
||||
Return "Directory"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' GenearlCamMsg
|
||||
Public ReadOnly Property ExtLineLenMsg As String
|
||||
Get
|
||||
' Estensione linea
|
||||
@@ -1524,14 +1643,14 @@ Public Class OptionsVM
|
||||
|
||||
Public ReadOnly Property LightUpMsg As String
|
||||
Get
|
||||
' Light Up
|
||||
' Light Up
|
||||
Return EgtMsg(50056)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LightLockMsg As String
|
||||
Get
|
||||
' Light Lock
|
||||
' Light Lock
|
||||
Return EgtMsg(50057)
|
||||
End Get
|
||||
End Property
|
||||
@@ -1724,10 +1843,17 @@ Public Class OptionsVM
|
||||
Return m_EnableAssembly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
Dim sMessage As String = "The program will be shut down, do you want to proced?"
|
||||
Dim bRestartProgram As Boolean = EnableConfig
|
||||
If bRestartProgram Then
|
||||
sMessage = "The program will be restart, do you want to proced?"
|
||||
End If
|
||||
|
||||
' chiedo se desidera procedere con lo spegnimento del programma
|
||||
If MessageBox.Show("The program will be shut down, do you want to proced?", "Warning", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation, MessageBoxResult.Cancel) = MessageBoxResult.OK Then
|
||||
If MessageBox.Show(sMessage, "Warning", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation, MessageBoxResult.Cancel) = MessageBoxResult.OK Then
|
||||
' procedo alla chiusura del programma
|
||||
Map.refMainWindowVM.CloseApplication()
|
||||
If bRestartProgram Then Process.Start(Application.ResourceAssembly.Location)
|
||||
Else
|
||||
' esco senza salvare la selezione
|
||||
Return
|
||||
@@ -1883,10 +2009,10 @@ Public Class OptionsVM
|
||||
|
||||
Sub New()
|
||||
Map.SetRefOptionsVM(Me)
|
||||
If IsEnableHarwarePart then
|
||||
If IsEnableHarwarePart Then
|
||||
m_HardwarePartVM = New HardwarePartVM
|
||||
m_HardwarePartV = New HardwarePartV(m_HardwarePartVM)
|
||||
End if
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -1916,6 +2042,25 @@ Public Class OptionsVM
|
||||
OptionsWindow.Close()
|
||||
End If
|
||||
Next
|
||||
|
||||
If m_IsChangedConfig AndAlso EnableConfig AndAlso m_OrigBaseDir <> IniFile.m_sDoorsDirPath AndAlso m_OrigMTable <> OptionModule.m_SelectedMTable.Name Then
|
||||
' aggiorno il file Config.ini dell'EgtCAM5
|
||||
EgtLuaExecFile(IniFile.m_sConfigDir & "\ChangeConfig.lua")
|
||||
' assegno variabili
|
||||
EgtLuaSetGlobStringVar("CCD.NewBaseDir", IniFile.m_sDoorsDirPath)
|
||||
EgtLuaSetGlobStringVar("CCD.NewMTable", OptionModule.m_SelectedMTable.Name)
|
||||
' eseguo la funzione che esegue la scrittura delle variabili
|
||||
EgtLuaCallFunction("CCD.ChangeConfigDirectory")
|
||||
Dim sVal As String = ""
|
||||
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
||||
OptionModule.m_CurrentMachine = sVal
|
||||
EgtLuaResetGlobVar("CCD")
|
||||
' chiudo il programma e lo riavvio
|
||||
Map.refMainWindowVM.CloseApplication()
|
||||
Process.Start(Application.ResourceAssembly.Location)
|
||||
'End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' CloseOptionsCommand
|
||||
@@ -1959,6 +2104,15 @@ Public Class OptionsVM
|
||||
Return
|
||||
End If
|
||||
TemplateDir = FolderBrowserDialog.SelectedPath
|
||||
Case "ConfigDir"
|
||||
Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog
|
||||
FolderBrowserDialog.SelectedPath = IniFile.m_sDoorsDirPath
|
||||
' mostriamo la finestra di dialogo aperta fino alla directory MyProjects
|
||||
If FolderBrowserDialog.ShowDialog <> Forms.DialogResult.OK Then
|
||||
' se la risposta è diversa da OK esce
|
||||
Return
|
||||
End If
|
||||
BaseDir = FolderBrowserDialog.SelectedPath
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
+9
-1
@@ -88,13 +88,21 @@ Module RegexFunction
|
||||
Dim sErrorMsg As String = String.Format(EgtMsg(50196), ConfigurationCompo)
|
||||
MessageBox.Show(sErrorMsg, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
' se abilitata la modifica delle configurazioni cambio messaggio e disabilito la chiusura del programma
|
||||
If Map.refOptionsVM.EnableConfig Then
|
||||
Dim sWarningMsg As String = String.Format("The current ddf configuration ({0}) is different from the current program configuration ({1})", ConfigurationCompo, Path.GetFileName(IniFile.m_sDoorsDirPath), vbCrLf)
|
||||
MessageBox.Show(sWarningMsg, "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Part.LastPartName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
Return True
|
||||
End If
|
||||
|
||||
Dim MsgBoxResult As MessageBoxResult = MessageBoxResult.No
|
||||
' 50195=The current ddf configuration ({0}) is different from the current program configuration ({1}).
|
||||
Dim sWarningMas As String = String.Format(EgtMsg(50195), ConfigurationCompo, Path.GetFileName(IniFile.m_sDoorsDirPath), vbCrLf)
|
||||
MsgBoxResult = MessageBox.Show(sWarningMas, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
|
||||
If MsgBoxResult = MessageBoxResult.Yes Then
|
||||
' Imposto nuova configurazione
|
||||
WriteMainPrivateProfileString("Doors", "BaseDir", sConfCompoPath)
|
||||
WriteMainPrivateProfileString(S_DOORS, K_BASEDIR, sConfCompoPath)
|
||||
' Imposto progetto corrente
|
||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name)
|
||||
' Imposto apertura automatica al prossimo avvio
|
||||
|
||||
Reference in New Issue
Block a user