Compare commits

..

26 Commits

Author SHA1 Message Date
NicolaP 9bc09a73b2 Migliorata gestione cambio configurazione 2022-12-06 16:39:19 +01:00
NicolaP 2ba7424137 Gestione scrittura a video nome macchina corrente 2022-12-06 14:49:09 +01:00
NicolaP aea8143807 Migliorata gestione lettura cambio configurazione 2022-11-22 18:05:12 +01:00
NicolaP 79151af902 Gestione configurazione EgtCAM5.ini 2022-11-22 17:54:13 +01:00
NicolaP 5bf6b4acd4 Inizio gestione cambio configurazione 2022-11-21 20:17:04 +01:00
NicolaP 0e7764b9df Merge branch 'Features/Correzione_Sel_Material_Assemb' 2022-11-07 11:38:44 +01:00
NicolaP c745c69ad2 Correzione lettura materiale in assemblato 2022-11-07 11:38:31 +01:00
NicolaP ae2d1e427b Gestione file compialti 2022-09-05 14:21:24 +02:00
NicolaP c12c8f296a Correzione ComboBoxOnOff DDF parmeteer in Hardware 2022-07-11 12:03:49 +02:00
NicolaP 901e151399 Correzione gestione TextBoxOnOff e ComboBoxOnOff 2022-07-11 11:42:54 +02:00
NicolaP 81711ec12e Merge branch 'NicolaP' 2022-07-08 11:31:31 +02:00
NicolaP e6ed99afca Cambio versione 2022-07-08 11:31:16 +02:00
NicolaP be57be1e27 Correzione stampa parameteri On/Off HardwareManager 2022-07-08 11:12:59 +02:00
NicolaP 9853d78cf9 Gestione chiave di protezione 2022-06-28 19:42:18 +02:00
NicolaP f43134d996 Merge branch 'master' into NicolaP 2022-06-27 17:36:46 +02:00
NicolaP 3d259cfb9f Merge branch 'Features/Restyle_Interface_Assembly' 2022-06-27 17:26:13 +02:00
NicolaP 10bf8719bd Modificata dimensione bottoni Ante 2022-06-27 17:25:50 +02:00
NicolaP 9b0ce1a094 Merge branch 'master' into NicolaP 2022-06-27 15:47:59 +02:00
NicolaP 47e84044f9 Cambio versione 2022-06-27 15:46:45 +02:00
NicolaP a82ded8b77 Merge commit '915e3f32db96319bf6d856f21f3a7b02fd9fc1bd' 2022-06-27 15:43:56 +02:00
NicolaP 915e3f32db Merge branch 'Features/Manage_ParamOnOff_In_Hardware_DDF_Param' into NicolaP 2022-06-27 15:43:22 +02:00
NicolaP c24f12a208 Gestione DDF_ParmOnOf in HardwareManager 2022-06-27 15:25:42 +02:00
NicolaP f3a53efa42 Non blocco i file se programma in sola lettura 2022-05-30 18:23:17 +02:00
NicolaP 1e75e0073c Miglioramento gestione errori per compo 2022-05-30 18:19:35 +02:00
NicolaP e0281a3f46 Miglioramento gestione errori per direttori compo 2022-05-12 18:08:55 +02:00
NicolaP cf07c578a0 Merge branch 'Features/OnlyRead' into NicolaP 2022-05-12 15:11:07 +02:00
16 changed files with 556 additions and 41 deletions
+9 -9
View File
@@ -415,17 +415,17 @@
<Grid Margin="0,0,0,2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="20"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="{Binding}"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="7"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="7"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="{Binding}"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="7"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="7"/>
<ColumnDefinition Width="20"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="3*"/>
@@ -566,7 +566,7 @@
Command="{Binding DataContext.JambBtnCommand,
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding Type}"
Width="100"
Width="140"
Style="{StaticResource DoorButton}"
IsEnabled="{Binding IsChecked, ElementName=DoorChk}"
Grid.Column="0" />
+95 -3
View File
@@ -6,6 +6,13 @@ Imports System.IO
Public Class CompoPanelVM
Implements INotifyPropertyChanged
Private m_ErroLoadCompo As String = String.Empty
Public ReadOnly Property ErrorLoadCompo As String
Get
Return m_ErroLoadCompo
End Get
End Property
Private m_PageName As String = String.Empty
Public ReadOnly Property GoToAssembly As String
@@ -75,9 +82,39 @@ Public Class CompoPanelVM
Return
End If
Dim CompoArray() As String = Directory.GetDirectories(IniFile.m_CompoDir)
Dim ListCompoToInsert As New List(Of VerifyCompo)
For Ind As Integer = 0 To DdfFile.CompoListOrder.Count - 1
ListCompoToInsert.Add(New VerifyCompo(DdfFile.CompoListOrder(Ind), False))
Next
' Verifico che la lista Panel abbia un numero di elementi uguale o minore di quella DDF
If OptionModule.m_CompoPaneOrder.Count > DdfFile.CompoListOrder.Count Then
Dim ListCompoToShow As New List(Of VerifyCompo)
For Ind As Integer = 0 To OptionModule.m_CompoPaneOrder.Count - 1
ListCompoToShow.Add(New VerifyCompo(OptionModule.m_CompoPaneOrder(Ind), False))
Next
' cerco quali sono le componenti in esubero nella lista CompoPane
For Each ItemCompoPane As String In DdfFile.CompoListOrder
ListCompoToShow.Find(Function(x) x.sName = ItemCompoPane).SetExists(True)
Next
' recupero i nomi delle componenti non presenti nell'elenco DDF
Dim sMissingCompoInDDFList As String = String.Empty
For Each Item As VerifyCompo In ListCompoToShow
If Not Item.bExists Then
If String.IsNullOrEmpty(sMissingCompoInDDFList) Then
sMissingCompoInDDFList = Item.sName
Else
sMissingCompoInDDFList &= ", " & Item.sName
End If
End If
Next
m_ErroLoadCompo = "Verify component in CompoPanelOrder: " & sMissingCompoInDDFList
Return
End If
' carico i valori dei bottoni con un preciso ordine
Dim CompoPanelList As List(Of String) = OptionModule.m_CompoPaneOrder
For IndexCompoOrder = 0 To DdfFile.CompoListOrder.Count - 1
For IndexCompoOrder = 0 To CompoPanelList.Count() - 1 ' DdfFile.CompoListOrder.Count - 1
For Index = 0 To CompoArray.Count - 1
' apro ogni directory e cerco un file di testo di nome Config.ini
Dim CurrCompoPath As String = CompoArray(Index) & "\" & ConstCompo.CONFIGINI_FILE_NAME
@@ -87,14 +124,41 @@ Public Class CompoPanelVM
GetPrivateProfileFolderName(S_TEMPLATE, K_FOLDER_NAME, FolderName, CurrCompoPath)
If CompoPanelList(IndexCompoOrder) = CompoNameDDF Then
m_CompoTypeList.Add(New CompoType(CompoName, CompoNameDDF, CompoArray(Index), Side, FolderName))
ListCompoToInsert.Find(Function(x) x.sName = CompoNameDDF).SetExists(True)
' aggiungere il caricamento delle liste
Exit For
End If
End If
Next
Next
' verifica nella lista di partenza quali sono i componenti che non sono stati caricati
m_ErroLoadCompo = String.Empty
' cerco eventuali discrepanze tra la lista DDF e la lista Panel
Dim sMissingCompoInPanel As String = String.Empty
For nInd As Integer = 0 To ListCompoToInsert.Count - 1
Dim DDFCompoName As String = ListCompoToInsert(nInd).sName
If IsNothing(CompoPanelList.Find(Function(x) x = DDFCompoName)) Then
If String.IsNullOrEmpty(sMissingCompoInPanel) Then
sMissingCompoInPanel = "Missing component Panel button: " & vbCrLf & " - " & DDFCompoName
Else
sMissingCompoInPanel &= vbCrLf & " - " & DDFCompoName
End If
ListCompoToInsert(nInd).SetExists(True)
End If
Next
' cerco discrepanze tra la lista dei bottoni e direttori
For Each Item As VerifyCompo In ListCompoToInsert
If Not Item.bExists Then
If String.IsNullOrEmpty(m_ErroLoadCompo) Then
m_ErroLoadCompo = "Missing component Directory: " & vbCrLf & " - " & Item.sName
Else
m_ErroLoadCompo &= vbCrLf & " - " & Item.sName
End If
End If
Next
If Not String.IsNullOrEmpty(sMissingCompoInPanel) Then
m_ErroLoadCompo &= vbCrLf & sMissingCompoInPanel
End If
End Sub
#Region "COMMANDS"
@@ -215,3 +279,31 @@ Public Class CompoPanelVM
End Sub
End Class
Public Class VerifyCompo
Private m_sName As String
Public ReadOnly Property sName As String
Get
Return m_sName
End Get
End Property
Private m_bExists As Boolean = False
Public ReadOnly Property bExists As Boolean
Get
Return m_bExists
End Get
End Property
Public Sub SetExists(Exists As Boolean)
m_bExists = Exists
End Sub
Sub New(Name As String, Exists As Boolean)
m_sName = Name
m_bExists = Exists
End Sub
End Class
+1
View File
@@ -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"
+28 -2
View File
@@ -1883,6 +1883,9 @@ Public Class Compo
If Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage Then
If Not TempParam.EnableCopy Then Return False
End If
Dim sItems() As String = sValue.Split(";"c)
' estraggo il primo valore: -- NomeParamOnOff = inch(0.6); 0
sValue = sItems(0)
Dim ReadValue = RegexFunction.Brackets(sValue)
If ReadValue.Contains("DGD.dW") Then
ReadValue = sValue.Replace(ReadValue & ")", "W")
@@ -1898,7 +1901,17 @@ Public Class Compo
End If
Utility.ConvertCurrentUnitMeasure(ReadValue)
TempParam.SetValue(ReadValue)
TempParam.SetIsActive(True)
' verifico se deve essere attivata
If sItems.Count > 1 Then
If sItems(1).Trim <> "0" Then
TempParam.SetIsActive(True)
Else
TempParam.SetIsActive(False)
End If
Else
TempParam.SetIsActive(True)
End If
TempParam.NotifyPropertyChanged("IsActive")
Return True
ElseIf TypeOf CurrCompoParam Is TextBoxParam Then
Dim TempParam As TextBoxParam = DirectCast(CurrCompoParam, TextBoxParam)
@@ -1926,11 +1939,24 @@ Public Class Compo
If Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage Then
If Not TempParam.EnableCopy Then Return False
End If
Dim sItems() As String = sValue.Split(";"c)
' estraggo il primo valore: -- NomeParamOnOff = inch(0.6); 0
sValue = sItems(0)
Dim ReadValue = Trim(sValue)
For Each Item In TempParam.ItemListDDF
If Trim(Item).ToLower = ReadValue.ToLower Then
TempParam.SetSelItem(TempParam.ItemList(TempParam.ItemListDDF.IndexOf(Item)))
TempParam.SetIsActive(True)
' verifico se deve essere attivata
If sItems.Count > 1 Then
If sItems(1).Trim <> "0" Then
TempParam.SetIsActive(True)
Else
TempParam.SetIsActive(False)
End If
Else
TempParam.SetIsActive(True)
End If
TempParam.NotifyPropertyChanged("IsActive")
Exit For
End If
Next
+2
View File
@@ -41,6 +41,8 @@ Public Module Doors
Dim sExecName As String = String.Empty
GetMainPrivateProfileString(S_DOORS, K_DDFEXEC, "", sExecName)
sExecPath = IniFile.m_sDoorsDirPath & "\" & sExecName
EgtLuaCreateGlobTable("DGD")
EgtLuaSetGlobStringVar("DGD.BASEDIR", IniFile.m_sDoorsDirPath & "\")
If Not EgtLuaExecFile(sExecPath) Then Return False
' Setto variabili per quotatura Lua
For Each HardwareDimension In Map.refDimensioningPanelVM.HardwareDimensionList
+48 -6
View File
@@ -1055,7 +1055,19 @@ Public Class Hardware
ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is TextBoxOnOffParam Then
Dim Text As TextBoxOnOffParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), TextBoxOnOffParam)
Text.SetIsActive(True)
' estraggo il valore: -- NomeParamOnOff = inch(0.6); 0
Dim sItems() As String = sValue.Split(";"c)
sValue = sItems(0)
' verifico se deve essere attivata
If sItems.Count > 1 Then
If sItems(1).Trim <> "0" Then
Text.SetIsActive(True)
Else
Text.SetIsActive(False)
End If
Else
Text.SetIsActive(True)
End If
' se testo numerico, eseguo opportunbe conversioni per H,W e T
sValue = ConvertToDGD(Text.TypeVar, sValue)
' controllo il tipo di dato che si aspetta
@@ -1116,7 +1128,19 @@ Public Class Hardware
ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is ComboBoxOnOffParam Then
Dim Text As ComboBoxOnOffParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), ComboBoxOnOffParam)
Text.SetIsActive(True)
' estraggo il valore: -- NomeParamOnOff = inch(0.6); 0
Dim sItems() As String = sValue.Split(";"c)
sValue = sItems(0)
' verifico se deve essere attivata
If sItems.Count > 1 Then
If sItems(1).Trim <> "0" Then
Text.SetIsActive(True)
Else
Text.SetIsActive(False)
End If
Else
Text.SetIsActive(True)
End If
Text.SetSelItem(Text.ItemList(0))
For IndexCombo As Integer = 0 To Text.ItemListDDF.Count - 1
If Trim(Utility.DeleteSuperScript(Text.ItemListDDF(IndexCombo))) = Trim(Utility.DeleteSuperScript(sValue)) Then Text.SetSelItem(Text.ItemList(IndexCombo))
@@ -2015,7 +2039,6 @@ Public Class Hardware
ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is TextBoxOnOffParam Then
Dim Text As TextBoxOnOffParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), TextBoxOnOffParam)
sValue = String.Empty
If Not Text.IsActive Then sValue = " nil" : Return True
' controllo il tipo di dato che si aspetta
Select Case Text.TypeVar
Case ConstGen.INCHES
@@ -2049,6 +2072,15 @@ Public Class Hardware
End Select
' se testo numerico, eseguo opportune conversioni per H,W e T
sValue = ConvertFromDGD(Text.TypeVar, sValue)
' se parametro spento (Solo per capitolo DDF)
If Not Text.IsActive Then
If m_GroupChapters(IndexGroupChapters).TemplateDDFName = "DDF" Then
sValue &= "; 0"
Else
' per inidicare di spegnere il valore deve essere restituito il valore " nill"
sValue = " nil"
End If
End If
Return True
ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is TextBoxParam Then
Dim Text As TextBoxParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), TextBoxParam)
@@ -2118,11 +2150,21 @@ Public Class Hardware
'-- attenzione a quando abbiamo da stampare delle stringhe! e non dei valori numerici
Dim Text As ComboBoxOnOffParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), ComboBoxOnOffParam)
sValue = String.Empty
If Not Text.IsActive Then sValue = " nil" : Return True
For Index As Integer = 0 To Text.ItemList.Count - 1
If Text.SelItem = Text.ItemList(Index) Then sValue = Text.ItemListDDF(Index) : Return True
If Text.SelItem = Text.ItemList(Index) Then sValue = Text.ItemListDDF(Index)
Next
sValue = Text.SelItem
If String.IsNullOrEmpty(sValue) Then
sValue = Text.SelItem
End If
' se parametro spento
If Not Text.IsActive Then
If m_GroupChapters(IndexGroupChapters).TemplateDDFName = "DDF" Then
sValue &= "; 0"
Else
' per inidicare di spegnere il valore deve essere restituito il valore " nill"
sValue = " nil"
End If
End If
Return True
ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is ComboBoxParam Then
+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, 2404, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2404, 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())
+1
View File
@@ -13,6 +13,7 @@ Class MainWindowV
' se è assente la chiave di protezione non mostro la finestra Launcher
If Map.refSceneManagerVM.bProtectKey Then
Map.refMainWindowVM.SetLauncher()
Map.refMainWindowVM.ShowErrorCompoLoad()
End If
End Sub
+12
View File
@@ -163,6 +163,18 @@ Public Class MainWindowVM
InitWatcher()
End Sub
#Region "Methods"
Public Sub ShowErrorCompoLoad()
Dim sError As String = Map.refCompoPanelVM.ErrorLoadCompo
If Not String.IsNullOrEmpty(sError) Then
MessageBox.Show(sError, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog(sError)
End If
End Sub
#End Region ' Methods
#Region "Watcher"
Public Enum WatcherCalling
+2 -2
View File
@@ -72,5 +72,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.4.1")>
<Assembly: AssemblyFileVersion("2.4.4.1")>
<Assembly: AssemblyVersion("2.4.11.1")>
<Assembly: AssemblyFileVersion("2.4.11.1")>
+116 -3
View File
@@ -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
@@ -391,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)
@@ -824,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
@@ -995,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
@@ -1027,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
+63 -3
View File
@@ -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"
+163 -9
View File
@@ -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
View File
@@ -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
+2 -1
View File
@@ -109,7 +109,8 @@ Public Class SceneManagerVM
' Creazione scena
PreInitializeScene()
' Se tutto bene
If m_ProjectScene.Init() And (IniFile.m_nKeyOptions And KEY_OPT.DOORCREATOR) <> 0 Then
If m_ProjectScene.Init() And ((IniFile.m_nKeyOptions And KEY_OPT.DOORCREATOR) <> 0 OrElse
(Not (IniFile.m_nKeyOptions And KEY_OPT.DOORCREATOR) <> 0 AndAlso (IniFile.m_nKeyOptions And KEY_OPT.READ_ONLY) <> 0)) Then
EgtSetCurrentContext(m_ProjectScene.GetCtx)
PostInitializeScene()
m_ProjectScene.SetStatusNull()
+3
View File
@@ -22,6 +22,9 @@ Public Module Utility
' CurrFile deve arrivare già senza estensione!
Private Function GenerateLockFileName(ByVal CurrDirectory As String, Optional ByVal CurrFile As String = "") As String
If OptionModule.ReadOnlyDDF Then
Return String.Empty
End If
' per bloccare il direttorio
If String.IsNullOrEmpty(CurrFile) Then
Return CurrDirectory & "\Lock_Project" & LCK_EXTENSION