Compare commits

..

3 Commits

Author SHA1 Message Date
NicolaP 07e19039ea Gestione visualizzazione schermi da Config 2023-01-18 12:54:54 +01:00
NicolaP 30a5b5ed49 Nuova disposizione finestra in interfaccia 2022-10-28 15:10:48 +02:00
NicolaP 467874aa93 Merge branch 'master' into NicolaP 2022-10-28 14:32:59 +02:00
16 changed files with 205 additions and 399 deletions
+1 -13
View File
@@ -99,17 +99,6 @@ Public Class CompoType
m_FolderName = FolderName
End Sub
Private m_DDFMaterial As String
Public ReadOnly Property DDFMaterial As String
Get
Return m_DDFMaterial
End Get
End Property
Public Sub SetDDFMaterial(DDFMaterial As String)
m_DDFMaterial = DDFMaterial
End Sub
Public Function LoadListTemplate() As Boolean
FolderList.Clear()
m_HardwareFolderList.Clear()
@@ -125,13 +114,12 @@ Public Class CompoType
Return other
End Function
Sub New(sName As String, sDDFName As String, sPath As String, sJambSide As String, sFolderName As String, Optional ByVal sDDFMaterial As String = "wood")
Sub New(sName As String, sDDFName As String, sPath As String, sJambSide As String, sFolderName As String)
m_Name = sName
m_DDFName = sDDFName
m_Path = sPath
m_JambSide = sJambSide
m_FolderName = sFolderName
m_DDFMaterial = sDDFMaterial
LoadListTemplate()
End Sub
-1
View File
@@ -90,7 +90,6 @@ 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"
+5 -5
View File
@@ -12,16 +12,16 @@
<EgtDOORCreator:TrueToFalse x:Key="TrueToFalse"/>
</UserControl.Resources>
<Grid IsEnabled="{Binding EnablePageDoor}">
<Grid Name="MainGrid" IsEnabled="{Binding EnablePageDoor}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="{Binding WidthColumn1}"/>
<ColumnDefinition Width="{Binding WidthColumn2}"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Margin="0,0,0,0.2" Grid.Column="1" IsEnabled="{Binding IsReadOnly}">
<Grid Margin="0,0,0,0.2" Grid.Column="{Binding GridGeneralDiposition}" 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 Grid.Column="0" Grid.Row="0" Content="{Binding CompoPanelControl}"/>
<ContentControl Name="MainContentConrol" Grid.Column="{Binding CompoPanelDiposition}" Grid.Row="0" Content="{Binding CompoPanelControl}"/>
<!--<EgtDOORCreator:CompoPanelV Grid.Column="0" DataContext="{Binding CompoPanelPartVM}"/>-->
</Grid>
</UserControl>
+3 -2
View File
@@ -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,4 +30,5 @@
Private Sub UserControl_IsEnabledChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
End Sub
End Class
+44
View File
@@ -73,6 +73,50 @@ 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()
-11
View File
@@ -747,7 +747,6 @@ Public Class Hardware
Exit For
End If
Next
If Not bIsCurrentMaterial And nIsActive <> 4 Then
nIsActive = nIsActiveMaterial
End If
@@ -989,10 +988,6 @@ Public Class Hardware
' caricamento dei dati del file lua
Private Function FindParamTemplateInConfigList(sParam As String, sValue As String) As Boolean
For IndexGroupChapters As Integer = 0 To m_GroupChapters.Count - 1
' verifico che sia attivo il gruppo
If Not m_GroupChapters(IndexGroupChapters).EnableChapter Then
Continue For
End If
For IndexChapter As Integer = 0 To m_GroupChapters(IndexGroupChapters).CompoParamList.Count - 1
If m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter).DDFName = sParam Then
' ho trovato una corrispondenza tra il valore de file ini e quello lua in lettura
@@ -1958,16 +1953,10 @@ Public Class Hardware
End If
For IndexGroupChapters As Integer = 0 To m_GroupChapters.Count - 1
' se il presente gruppo non è attivo passo al successivo (di default assegno "nil", in caso di uscita senza gruppo il valore
If Not m_GroupChapters(IndexGroupChapters).EnableChapter Then
sValue = " nil"
Continue For
End If
For IndexChapter As Integer = 0 To m_GroupChapters(IndexGroupChapters).CompoParamList.Count - 1
If m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter).DDFName = NameParam Then
' verifico che il parametro da stampare sia abilitato alla stampa (altriementi NON scrivere nel file)
If Not m_GroupChapters(IndexGroupChapters).IsActiveChapter Then sValue = " nil" : Return True
If TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is TextBoxDGCParam Then
Dim Text As TextBoxDGCParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), TextBoxDGCParam)
sValue = String.Empty
+6 -5
View File
@@ -15,8 +15,8 @@
<Grid IsEnabled="{Binding EnablePageHardware}">
<Grid.ColumnDefinitions>
<!-- Colonna dedicata alla lista dei bottoni -->
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="{Binding WidthColumn1}"/>
<ColumnDefinition Width="{Binding WidthColumn2}"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
@@ -26,8 +26,9 @@
<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="1">
<Grid Grid.Column="{Binding GridGeneralDiposition}" Grid.Row="0">
<Grid.RowDefinitions>
<!-- Deicata al general dell'hardware-->
<RowDefinition Height="Auto"/>
@@ -858,9 +859,9 @@
</Grid>
<!-- Elenco pulsanti Hardware -->
<ContentControl Grid.Column="0" Grid.RowSpan="2" Grid.Row="0" Content="{Binding CompoPanelControl}"/>
<ContentControl Grid.Column="{Binding CompoPanelDiposition}" Grid.RowSpan="2" Grid.Row="0" Content="{Binding CompoPanelControl}"/>
<EgtDOORCreator:HardwareHelpSceneHostV Grid.Column="1" Grid.Row="1" Margin="0,0,2,0"/>
<EgtDOORCreator:HardwareHelpSceneHostV Grid.Column="{Binding GridGeneralDiposition}" Grid.Row="1" Margin="0,0,2,0" />
</Grid>
+44
View File
@@ -93,6 +93,50 @@ 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
+2 -2
View File
@@ -57,8 +57,8 @@ Friend Class MainWindowModel
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
EgtSetKey(sKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2412, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2412, 1, IniFile.m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2407, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2407, 1, IniFile.m_nKeyOptions)
'Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
Dim sLogFile As String = IniFile.m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
+7 -6
View File
@@ -23,8 +23,8 @@
<Grid>
<Grid.ColumnDefinitions>
<!--<ColumnDefinition Width="1*"/>-->
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="{Binding WidthColumn1}"/>
<ColumnDefinition Width="{Binding WidthColumn2}"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -32,10 +32,11 @@
</Grid.RowDefinitions>
<!--<EgtDOORCreator:AssemblyManagerV Grid.Column="0" DataContext="{StaticResource AssemblyManagerVM}"/>-->
<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}"/>
<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}"/>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
+64
View File
@@ -77,6 +77,7 @@ 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)
@@ -128,6 +129,12 @@ 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
@@ -159,10 +166,67 @@ 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()
+3 -3
View File
@@ -32,7 +32,7 @@ Imports System.Windows
<Assembly: AssemblyCompany("EgalTech s.r.l.")>
<Assembly: AssemblyProduct("EgtDOORCreator")>
<Assembly: AssemblyCopyright("Copyright © 2016-2022 by EgalTech s.r.l.")>
<Assembly: AssemblyCopyright("Copyright © 2016-2021 by EgalTech s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
@@ -72,5 +72,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.12.1")>
<Assembly: AssemblyFileVersion("2.4.12.1")>
<Assembly: AssemblyVersion("2.4.9.1")>
<Assembly: AssemblyFileVersion("2.4.9.1")>
+13 -116
View File
@@ -11,11 +11,6 @@ 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
@@ -50,6 +45,8 @@ 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
@@ -237,6 +234,14 @@ 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)
@@ -396,10 +401,6 @@ 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)
@@ -833,17 +834,12 @@ 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
' 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.SetMaterial(OptionModule.m_MaterialList(0))
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
@@ -1009,75 +1005,6 @@ 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
@@ -1110,33 +1037,3 @@ 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
+3 -63
View File
@@ -5,14 +5,12 @@
Title="{Binding Title}" Icon="/Resources/EgtDOOR.ico"
TitleBarBrush="{StaticResource EgaltechBlue1}"
BorderBrush="{StaticResource EgaltechBlue1}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30"
IsResizable="True" IsMovable="True"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
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>
@@ -29,7 +27,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>
@@ -255,64 +253,6 @@
</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-->
@@ -387,7 +327,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"
+9 -163
View File
@@ -80,25 +80,9 @@ 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
@@ -120,67 +104,6 @@ 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
@@ -1189,9 +1112,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
@@ -1216,12 +1139,6 @@ 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)
@@ -1405,7 +1322,7 @@ Public Class OptionsVM
Public ReadOnly Property MachMsg As String
Get
' Mach.
' Mach.
Return EgtMsg(50711)
End Get
End Property
@@ -1435,56 +1352,20 @@ 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
@@ -1643,14 +1524,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
@@ -1843,17 +1724,10 @@ 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(sMessage, "Warning", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation, MessageBoxResult.Cancel) = MessageBoxResult.OK Then
If MessageBox.Show("The program will be shut down, do you want to proced?", "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
@@ -2009,10 +1883,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"
@@ -2042,25 +1916,6 @@ 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
@@ -2104,15 +1959,6 @@ 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
+1 -9
View File
@@ -88,21 +88,13 @@ 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(S_DOORS, K_BASEDIR, sConfCompoPath)
WriteMainPrivateProfileString("Doors", "BaseDir", sConfCompoPath)
' Imposto progetto corrente
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name)
' Imposto apertura automatica al prossimo avvio