Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d3d7fbacd4 | |||
| 201cf2ddf1 | |||
| 80c3634506 | |||
| 43bc9d7e59 | |||
| 4ab6a1a393 | |||
| 929966c456 | |||
| 65f8b72488 | |||
| d73ca948c9 | |||
| 9bc09a73b2 | |||
| 2ba7424137 | |||
| aea8143807 | |||
| 79151af902 | |||
| 5bf6b4acd4 | |||
| 0e7764b9df | |||
| c745c69ad2 | |||
| ae2d1e427b | |||
| c12c8f296a | |||
| 901e151399 | |||
| 81711ec12e | |||
| e6ed99afca | |||
| be57be1e27 | |||
| 9853d78cf9 | |||
| f43134d996 | |||
| 3d259cfb9f | |||
| 10bf8719bd | |||
| 9b0ce1a094 | |||
| 47e84044f9 | |||
| a82ded8b77 | |||
| 915e3f32db | |||
| c24f12a208 | |||
| f3a53efa42 | |||
| 1e75e0073c | |||
| e0281a3f46 | |||
| cf07c578a0 | |||
| 6981bcafbb | |||
| 99d69a4ffe | |||
| 4355deafb3 | |||
| e0a8f73b12 | |||
| a0c934f139 | |||
| 99a3ecad0a | |||
| 325d3af0b1 | |||
| 3c7c094fa2 | |||
| b55027a7fc | |||
| bb56d619d3 | |||
| 59fba24e6f | |||
| ed7e46596e | |||
| ae55084292 |
+71
-12
@@ -31,6 +31,13 @@ Public Class Assembly
|
||||
' tutte queste proprietà interagiscono direttamente con le dimensioni del TELAIO
|
||||
' per questo motivo la funzione set può ospitare la chiamata ad una funzione che modifica le dimensioni della porta
|
||||
|
||||
Private m_AssemblyUnit As String = ConstGen.VAL_INCHES
|
||||
Public ReadOnly Property AssemblyUnit As String
|
||||
Get
|
||||
Return m_AssemblyUnit
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "GENERAL"
|
||||
|
||||
#Region "Light Up/Bottom"
|
||||
@@ -1109,6 +1116,28 @@ Public Class Assembly
|
||||
' se non carico nessuna informazione allora non è un assemblato, esco
|
||||
If IndexLine = 0 Then Return ResultReadingAssembInfo.MissingAssembInfo
|
||||
|
||||
' Measure
|
||||
If IndexLine < FileContent.Count - 1 Then
|
||||
If SearchKey(FileContent(IndexLine), "Unit") Then
|
||||
' leggo le dimemensioni dei Jamb e restituisco la riga successiva
|
||||
IndexLine = GetUnit(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
' 50102: Failed reading DDF file. Missing needed parameter {0}.
|
||||
sErrorInfo += String.Format(EgtMsg(50102), "measures" + vbCrLf)
|
||||
Return ResultReadingAssembInfo.ErrorInAssembInfo
|
||||
End If
|
||||
Else
|
||||
IndexLine = GetUnitFromDoor(IndexLine)
|
||||
If IndexLine = -1 Then
|
||||
' 50102: Failed reading DDF file. Missing needed parameter {0}.
|
||||
sErrorInfo += String.Format(EgtMsg(50102), "measures" + vbCrLf)
|
||||
Return ResultReadingAssembInfo.ErrorInAssembInfo
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
IndexLine = SkipWhiteSpace(IndexLine)
|
||||
If IndexLine = 0 Then Return ResultReadingAssembInfo.MissingAssembInfo
|
||||
' Size
|
||||
If IndexLine < FileContent.Count - 1 Then
|
||||
If SearchKey(FileContent(IndexLine), ConstIni.S_SIZE_INI) Then
|
||||
@@ -1184,7 +1213,7 @@ Public Class Assembly
|
||||
If IndexLine < FileContent.Count Then
|
||||
If SearchKey(FileContent(IndexLine), ConstIni.S_DOORS_ASSEMBY) Then
|
||||
' assegno ad una variabile il valore in lettura
|
||||
IndexLine = GetValue(IndexLine, ConstIni.S_DOORS_ASSEMBY, m_DoorNumber)
|
||||
IndexLine = GetValue(IndexLine, ConstIni.S_DOORS_ASSEMBY, m_DoorNumber, False)
|
||||
' assegno il numero di ante
|
||||
SetDoorNumber(m_DoorNumber)
|
||||
If IndexLine = -1 Then
|
||||
@@ -1237,7 +1266,7 @@ Public Class Assembly
|
||||
End Function
|
||||
|
||||
' funzione per la ricerca dei valori, restituice la riga successiva
|
||||
Private Function GetValue(Index As Integer, Name As String, ByRef Var As String) As Integer
|
||||
Private Function GetValue(Index As Integer, Name As String, ByRef Var As String, Optional bConvertUnit As Boolean = True) As Integer
|
||||
If Index = -1 Then Return -1
|
||||
Dim Local_Var As String = GetValueWithKey(FileContent(Index), Name)
|
||||
If String.IsNullOrWhiteSpace(Local_Var) Then
|
||||
@@ -1245,6 +1274,7 @@ Public Class Assembly
|
||||
If Not SearchKey(FileContent(Index), Name) Then Return -1
|
||||
' altrimenti lascia il valore vuoto
|
||||
Else
|
||||
If bConvertUnit Then ConvertDDFValueIntoCurrentUnit(m_AssemblyUnit, Local_Var)
|
||||
Var = Local_Var
|
||||
End If
|
||||
Return Index + 1
|
||||
@@ -1330,6 +1360,35 @@ Public Class Assembly
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' Unit (Metadati Assembly)
|
||||
Private Function GetUnit(Index As Integer) As Integer
|
||||
If Index = -1 Then Return -1
|
||||
Dim PreviuosIndex As Integer = Index
|
||||
Index = GetValue(Index, "measures", m_AssemblyUnit, False)
|
||||
Return Index
|
||||
End Function
|
||||
|
||||
' Measures (Parametri Door)
|
||||
Private Function GetUnitFromDoor(Index As Integer) As Integer
|
||||
' inizio la ricerca all'interno del file
|
||||
Dim PreviuosIndex As Integer = Index
|
||||
Dim bUnitFound As Boolean = False
|
||||
' cerco la prima porta e recupero la sua unità di misura
|
||||
While Not SearchKey(FileContent(Index), "measures") And Index < FileContent.Count - 1
|
||||
Index += 1
|
||||
End While
|
||||
If SearchKey(FileContent(Index), "measures") Then
|
||||
m_AssemblyUnit = GetValueWithKey(FileContent(Index), "measures")
|
||||
bUnitFound = True
|
||||
End If
|
||||
If bUnitFound Then
|
||||
Index = PreviuosIndex
|
||||
Else
|
||||
Index = -1
|
||||
End If
|
||||
Return Index
|
||||
End Function
|
||||
|
||||
' Size
|
||||
Private Function GetSize(Index As Integer) As Integer
|
||||
If Index = -1 Then Return -1
|
||||
@@ -1847,8 +1906,8 @@ Public Class Assembly
|
||||
Door.CompoList(IndexCompo).refJambCompo = Jamb.CompoList(IndexCompoJamb)
|
||||
Jamb.CompoList(IndexCompoJamb).refCompoDoor = Door.CompoList(IndexCompo)
|
||||
Door.CompoList(IndexCompo).refJambCompo.VisibilitiReloadBtn = Visibility.Visible
|
||||
Door.CompoList(IndexCompo).refJambCompo.IsReadOnly = False
|
||||
Door.CompoList(IndexCompo).IsReadOnly = True
|
||||
Door.CompoList(IndexCompo).refJambCompo.IsReadOnly = True
|
||||
Door.CompoList(IndexCompo).IsReadOnly = False
|
||||
' definisco la proprietà ReadOnly per i parametri inseriti
|
||||
If Not LoadCompoParam(Door.CompoList(IndexCompo), Door.TypePart) Then Return
|
||||
For IndexParam As Integer = 0 To Door.CompoList(IndexCompo).refJambCompo.CompoParamList.Count - 1
|
||||
@@ -1872,7 +1931,7 @@ Public Class Assembly
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
Door.CompoList(IndexCompo).IsReadOnly = True
|
||||
Door.CompoList(IndexCompo).IsReadOnly = False
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
@@ -2774,7 +2833,7 @@ Public Class Assembly
|
||||
If TBoxPar.EnableCopy Then
|
||||
TBoxNewPar.SetValue(TBoxPar.Value)
|
||||
TBoxNewPar.SetIsActive(TBoxPar.IsActive)
|
||||
End If
|
||||
End If
|
||||
ElseIf TypeOf PrecCompo.CompoParamList(IndexParam) Is TextBoxParam AndAlso
|
||||
PrecCompo.CompoParamList(IndexParam).DDFName = NewCompo.CompoParamList(IndexParam).DDFName Then
|
||||
Dim TBoxPar As TextBoxParam = DirectCast(PrecCompo.CompoParamList(IndexParam), TextBoxParam)
|
||||
@@ -2796,7 +2855,7 @@ Public Class Assembly
|
||||
Dim CBoxNewPar As ComboBoxParam = DirectCast(NewCompo.CompoParamList(IndexParam), ComboBoxParam)
|
||||
If CBoxNewPar.EnableCopy Then
|
||||
CBoxNewPar.SetSelItem(CBoxNewPar.ItemList(CBoxNewPar.ItemList.IndexOf(CBoxPar.SelItem)))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
@@ -3735,8 +3794,8 @@ Public Class Assembly
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
' rimuovo dalla lista
|
||||
If bRabbet Then Jamb.CompoList.RemoveAt(IndexCompo)
|
||||
' rimuovo dalla lista
|
||||
If bRabbet Then Jamb.CompoList.RemoveAt(IndexCompo)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -3763,9 +3822,9 @@ Public Class Assembly
|
||||
TextParam.m_Value = DoubleToString(dDeltaT + dThicknessDoor, 4)
|
||||
End If
|
||||
TextParam.NotifyPropertyChanged("Value")
|
||||
End If
|
||||
' depth
|
||||
CurrCompoParam = CurrCompo.CompoParamList(2)
|
||||
End If
|
||||
' depth
|
||||
CurrCompoParam = CurrCompo.CompoParamList(2)
|
||||
If TypeOf DirectCast(CurrCompoParam, CompoParam) Is TextBoxParam Then
|
||||
Dim TextParam As TextBoxParam = DirectCast(CurrCompoParam, TextBoxParam)
|
||||
Dim sRabbetDepth As String = sOverlap
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -263,7 +263,7 @@ Public Class AssemblyPageVM
|
||||
Case ConstGen.PART_FRAME_BOTTOM
|
||||
bOkSelection = LoadSelectedPartDoor(ConstGen.PART_FRAME_BOTTOM, OptionModule.m_CompoPanelFrameVisibility, True)
|
||||
Case Else
|
||||
bOkSelection = LoadSelectedPartDoor(SelectPart, Visibility.Visible, False)
|
||||
bOkSelection = LoadSelectedPartDoor(SelectPart, Visibility.Visible, OptionModule.ReadOnlyDDF)
|
||||
End Select
|
||||
If bOkSelection Then Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
|
||||
' aggiorno elenco quotature
|
||||
|
||||
@@ -1633,6 +1633,7 @@ Public Class AssemblyManagerVM
|
||||
' aggiungo il nome del file alla lista degli assemblati
|
||||
Dim Local_AssemblyName As New AssemblyName
|
||||
Local_AssemblyName.Name = SaveFileDialog.FileName
|
||||
Local_AssemblyName.GraphicName = Path.GetFileNameWithoutExtension(Local_AssemblyName.Name)
|
||||
m_CurrProject.AssemblyList.Add(Local_AssemblyName)
|
||||
' Seleziono AssembyName creato
|
||||
m_CurrProject.SelAssemblyName = Local_AssemblyName
|
||||
|
||||
@@ -11,7 +11,9 @@ Public Class AssemblyName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
m_GraphicName = Path.GetFileNameWithoutExtension(m_Name)
|
||||
If m_IsModified Then
|
||||
MakeTitle()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -31,21 +33,22 @@ Public Class AssemblyName
|
||||
' immagine senza asterisco
|
||||
Map.refProjectManagerVM.IsModifiedImage = "/Resources/TopCommandBar/Save.png"
|
||||
End If
|
||||
If OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
Dim sTitle As String = m_Name
|
||||
If m_GraphicName.Contains("*") Then sTitle &= "*"
|
||||
Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
ElseIf Not OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
Dim sTitle As String = Path.GetDirectoryName(m_Name)
|
||||
Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
End If
|
||||
'If OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
' Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
' Dim sTitle As String = m_Name
|
||||
' If m_GraphicName.Contains("*") Then sTitle &= "*"
|
||||
' Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
'ElseIf Not OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
' Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
' Dim sTitle As String = Path.GetDirectoryName(m_Name)
|
||||
' Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
'End If
|
||||
MakeTitle()
|
||||
NotifyPropertyChanged("GraphicName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_GraphicName As String
|
||||
Private m_GraphicName As String = String.Empty
|
||||
Public Property GraphicName As String
|
||||
Get
|
||||
Return m_GraphicName
|
||||
@@ -66,4 +69,17 @@ Public Class AssemblyName
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub MakeTitle()
|
||||
If OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
Dim sTitle As String = m_Name
|
||||
If m_GraphicName.Contains("*") Then sTitle &= "*"
|
||||
Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
ElseIf Not OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
Dim sTitle As String = Path.GetDirectoryName(m_Name)
|
||||
Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -7,7 +7,7 @@
|
||||
<KeyBinding Key="Enter" Command="{Binding RefreshCmd}"/>
|
||||
</UserControl.InputBindings>
|
||||
|
||||
<Grid>
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="16*"/>
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
<ItemsControl ItemsSource="{Binding CompoTypeList}" Focusable="True"
|
||||
Visibility="{Binding IsVisible}">
|
||||
Visibility="{Binding IsVisible}" IsEnabled="{Binding EnableModify}">
|
||||
|
||||
<ItemsControl.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding RefreshCmd}"/>
|
||||
|
||||
+104
-4
@@ -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
|
||||
@@ -44,6 +51,12 @@ Public Class CompoPanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EnableModify As Boolean
|
||||
Get
|
||||
Return Not OptionModule.ReadOnlyDDF
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comando
|
||||
Private m_CmdCompoBtn As ICommand
|
||||
Private m_CmdGoToAssemblyBtn As ICommand
|
||||
@@ -69,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
|
||||
@@ -81,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"
|
||||
@@ -142,7 +212,9 @@ Public Class CompoPanelVM
|
||||
' aggiorno lista hardware di quotatura
|
||||
Map.refDimensioningPanelVM.LoadHardwareDimList()
|
||||
' aggiungo le componenti sui Jamb
|
||||
Map.refAssemblyPageVM.CurrAssembly.CreateCompoOnJamb(NewCompo, "")
|
||||
If IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.CreateCompoOnJamb(NewCompo, "")
|
||||
End If
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50108), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
@@ -207,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
|
||||
+13
-1
@@ -99,6 +99,17 @@ 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()
|
||||
@@ -114,12 +125,13 @@ Public Class CompoType
|
||||
Return other
|
||||
End Function
|
||||
|
||||
Sub New(sName As String, sDDFName As String, sPath As String, sJambSide As String, sFolderName As String)
|
||||
Sub New(sName As String, sDDFName As String, sPath As String, sJambSide As String, sFolderName As String, Optional ByVal sDDFMaterial As String = "wood")
|
||||
m_Name = sName
|
||||
m_DDFName = sDDFName
|
||||
m_Path = sPath
|
||||
m_JambSide = sJambSide
|
||||
m_FolderName = sFolderName
|
||||
m_DDFMaterial = sDDFMaterial
|
||||
LoadListTemplate()
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -135,9 +135,11 @@ Module ConstCompo
|
||||
Public Const INI_COMBOBOX_ONOFF As String = "ComboBoxOnOff"
|
||||
Public Const INI_COMBOBOX_LUA As String = "ComboBoxLua"
|
||||
Public Const INI_TEXTBOX As String = "TextBox"
|
||||
Public Const INI_TEXTBOX_D As String = "TextBox_d"
|
||||
Public Const INI_TEXTBOXDGC As String = "TextBoxDGC"
|
||||
Public Const INI_TEXTBOXTHICKNESS As String = "TextBoxThickness"
|
||||
Public Const INI_TEXTBOX_ONOFF As String = "TextBoxOnOff"
|
||||
Public Const INI_TEXTBOX_ONOFF_D As String = "TextBoxOnOff_d"
|
||||
Public Const INI_TEXTBOXNGE As String = "TextBoxNge"
|
||||
Public Const INI_TEXTBOXLUA As String = "TextBoxLua"
|
||||
Public Const INI_CHECKBOX As String = "CheckBox"
|
||||
|
||||
@@ -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"
|
||||
|
||||
+11
-2
@@ -71,8 +71,10 @@ Friend Module DdfFile
|
||||
DdfFileContent.Add("produce: " & If(Part.IsActive, "true", "false"))
|
||||
'Genero una lista di stringhe
|
||||
DdfFileContent.Add("")
|
||||
If IsNothing(Part.Measure) Then Part.Measure = ConvertMmUnitsToString(OptionModule.m_bIsMmUnit)
|
||||
DdfFileContent.Add(ConstCompo.S_MEASURES & ": " & Part.Measure)
|
||||
'If IsNothing(Part.Measure) Then Part.Measure = ConvertMmUnitsToString(OptionModule.m_bIsMmUnit)
|
||||
'DdfFileContent.Add(ConstCompo.S_MEASURES & ": " & Part.Measure)
|
||||
DdfFileContent.Add(ConstCompo.S_MEASURES & ": " & ConvertMmUnitsToString(OptionModule.m_bIsMmUnit))
|
||||
|
||||
' 50200=Unit measure
|
||||
CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50200), Part.Measure))
|
||||
|
||||
@@ -1540,6 +1542,13 @@ Friend Module DdfFile
|
||||
GeneralAssembly.Add("#EGTDOORCREATOR")
|
||||
GeneralAssembly.Add("#GENERAL ASSEMBLY")
|
||||
GeneralAssembly.Add("#")
|
||||
|
||||
' dalla veresione 2.4l1 per gestione conversione mm/inch e viceversa
|
||||
GeneralAssembly.Add(ConstCompo.DDF_METADATA & "Unit : ")
|
||||
GeneralAssembly.Add(ConstCompo.DDF_METADATA & "measures : " & ConvertMmUnitsToString(OptionModule.m_bIsMmUnit))
|
||||
GeneralAssembly.Add(DDF_METADATA)
|
||||
|
||||
' dati assemblato
|
||||
GeneralAssembly.Add(ConstCompo.DDF_METADATA & "Size : ")
|
||||
If StringToDouble(CurrAssembly.Thickness, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.DDF_METADATA & "thickness : " & DoubleToString(dVal, 5))
|
||||
|
||||
+66
-8
@@ -137,13 +137,14 @@ Public Class Compo
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsReadOnly As Boolean = True
|
||||
Private m_IsReadOnly As Boolean = False
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnly = value
|
||||
NotifyPropertyChanged("IsReadOnly")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1133,7 +1134,7 @@ Public Class Compo
|
||||
|
||||
Return True
|
||||
|
||||
Case INI_TEXTBOX
|
||||
Case INI_TEXTBOX, INI_TEXTBOX_D
|
||||
' NomeDDF e Nome del Text
|
||||
Dim sTextList() As String = sItems(1).Split("/"c)
|
||||
Dim sDDFName As String = String.Empty
|
||||
@@ -1149,20 +1150,30 @@ Public Class Compo
|
||||
' Se ci sono 2 elementi "TextBox; NomeDDF/Nome"
|
||||
If sItems.Count < 3 Then
|
||||
NewCompoParam = New TextBoxParam(sDDFName, sName, Me, "0.000", Nothing, Nothing)
|
||||
If Trim(sItems(0)).EndsWith("d"c) Then
|
||||
Dim Loc_TextBox_d As TextBoxParam = DirectCast(NewCompoParam, TextBoxParam)
|
||||
Loc_TextBox_d.bIsLen = False
|
||||
NewCompoParam = Loc_TextBox_d
|
||||
End If
|
||||
' Errore nella lettura {0} nel parametro {1} della componente: non esiste il valore.
|
||||
sErrorList = ConcatErrorString(sErrorList, String.Format(EgtMsg(50125), sName, m_CompoType.DDFName))
|
||||
Return True
|
||||
End If
|
||||
' recupero il valore di default
|
||||
Dim dHeight As Double = 500 ' Attenzione ai mm
|
||||
If Not ConvertCompoConfig(sItems(2), dHeight) Then
|
||||
If Not Trim(sItems(0)).EndsWith("d"c) AndAlso Not ConvertCompoConfig(sItems(2), dHeight) Then
|
||||
sErrorList = ConcatErrorString(sErrorList, String.Format(EgtMsg(50147), sName, sItems(2)))
|
||||
End If
|
||||
|
||||
NewCompoParam = New TextBoxParam(sDDFName, sName, Me, sItems(2), Nothing, Nothing)
|
||||
If Trim(sItems(0)).EndsWith("d"c) Then
|
||||
Dim Loc_TextBox_d As TextBoxParam = DirectCast(NewCompoParam, TextBoxParam)
|
||||
Loc_TextBox_d.bIsLen = False
|
||||
NewCompoParam = Loc_TextBox_d
|
||||
End If
|
||||
Return True
|
||||
|
||||
Case INI_TEXTBOX_ONOFF
|
||||
Case INI_TEXTBOX_ONOFF, INI_TEXTBOX_ONOFF_D
|
||||
' NomeDDF e Nome del Text
|
||||
Dim sTextList() As String = sItems(1).Split("/"c)
|
||||
Dim sDDFName As String = String.Empty
|
||||
@@ -1178,6 +1189,11 @@ Public Class Compo
|
||||
' Se ci sono 2 elementi "TextBox; NomeDDF/Nome"
|
||||
If sItems.Count < 3 Then
|
||||
NewCompoParam = New TextBoxOnOffParam(sDDFName, sName, Me, "0.000", Nothing, Nothing, False)
|
||||
If Trim(sItems(0)).EndsWith("d"c) Then
|
||||
Dim Loc_TextBox_d As TextBoxOnOffParam = DirectCast(NewCompoParam, TextBoxOnOffParam)
|
||||
Loc_TextBox_d.bIsLen = False
|
||||
NewCompoParam = Loc_TextBox_d
|
||||
End If
|
||||
' Errore nella lettura {0} nel parametro {1} della componente: non esiste il valore.
|
||||
sErrorList = ConcatErrorString(sErrorList, String.Format(EgtMsg(50125), sName, m_CompoType.DDFName))
|
||||
Return True
|
||||
@@ -1190,12 +1206,16 @@ Public Class Compo
|
||||
|
||||
' recupero il valore di default
|
||||
Dim dHeight As Double = 500 ' Attenzione ai mm
|
||||
If Not ConvertCompoConfig(sItems(2), dHeight) Then
|
||||
If Not Trim(sItems(0)).EndsWith("d"c) AndAlso Not ConvertCompoConfig(sItems(2), dHeight) Then
|
||||
sErrorList = ConcatErrorString(sErrorList, String.Format(EgtMsg(50147), sName, sItems(2)))
|
||||
End If
|
||||
|
||||
NewCompoParam = New TextBoxOnOffParam(sDDFName, sName, Me, sItems(2), Nothing, Nothing, bActiveBox)
|
||||
|
||||
If Trim(sItems(0)).EndsWith("d"c) Then
|
||||
Dim Loc_TextBox_d As TextBoxOnOffParam = DirectCast(NewCompoParam, TextBoxOnOffParam)
|
||||
Loc_TextBox_d.bIsLen = False
|
||||
NewCompoParam = Loc_TextBox_d
|
||||
End If
|
||||
Return True
|
||||
|
||||
End Select
|
||||
@@ -1882,6 +1902,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")
|
||||
@@ -1897,7 +1920,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)
|
||||
@@ -1925,11 +1958,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
|
||||
@@ -1981,6 +2027,7 @@ Public Class Compo
|
||||
' creo una copia dell'oggetto
|
||||
Sub New(CompoType As CompoType)
|
||||
m_CompoType = CompoType.DeepCopy()
|
||||
If OptionModule.ReadOnlyDDF Then IsReadOnly = OptionModule.ReadOnlyDDF
|
||||
End Sub
|
||||
|
||||
' creo un riferiemento all'oggetto
|
||||
@@ -2339,6 +2386,17 @@ Public Class TextBoxParam
|
||||
Shared m_PrecCompoIdCode As String = "-1"
|
||||
Shared m_PrecNameParam As String = String.Empty
|
||||
|
||||
' utilizzata per riconoscere se il valore della text deve essere convertito mm/inch o viceversa
|
||||
Private m_bIsLen As Boolean = True
|
||||
Public Property bIsLen As Boolean
|
||||
Get
|
||||
Return m_bIsLen
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsLen = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' utilizzato negli Hardware
|
||||
Private m_TypeVar As String
|
||||
Public Property TypeVar As String
|
||||
|
||||
+38
-8
@@ -232,12 +232,16 @@ Public Class Part
|
||||
OptionModule.m_CurrMaterial = m_SelectedMaterial
|
||||
' ogni volta che cambio la selezione del materiale azzero tutte le selezioni delle proprietà
|
||||
If Not IsNothing(m_SelectedMaterial.PropertiesList) Then
|
||||
For Each ItemProperty In m_SelectedMaterial.PropertiesList
|
||||
'ItemProperty.IsChecked = False
|
||||
Next
|
||||
m_PropertiesList = m_SelectedMaterial.PropertiesList
|
||||
m_SelectedProperty = m_PropertiesList(0)
|
||||
PropertiesIsVisible = Visibility.Visible
|
||||
If m_SelectedMaterial.PropertiesList.Count > 0 Then
|
||||
For Each ItemProperty In m_SelectedMaterial.PropertiesList
|
||||
'ItemProperty.IsChecked = False
|
||||
Next
|
||||
m_PropertiesList = m_SelectedMaterial.PropertiesList
|
||||
m_SelectedProperty = m_PropertiesList(0)
|
||||
PropertiesIsVisible = Visibility.Visible
|
||||
Else
|
||||
PropertiesIsVisible = Visibility.Collapsed
|
||||
End If
|
||||
Else
|
||||
PropertiesIsVisible = Visibility.Collapsed
|
||||
End If
|
||||
@@ -1936,6 +1940,7 @@ Public Class Part
|
||||
'50159= Missing parameter in ddf!
|
||||
MessageBox.Show(String.Format(EgtMsg(50141), ConstIni.K_WIDTH_INI) & EgtMsg(50159), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, Width)
|
||||
SetWidth(Width)
|
||||
End If
|
||||
Index = NextIndex(Index)
|
||||
@@ -1952,6 +1957,7 @@ Public Class Part
|
||||
' 50159 = Missing parameter in ddf!
|
||||
MessageBox.Show(String.Format(EgtMsg(50141), ConstIni.K_HEIGHT_INI) & EgtMsg(50159), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, Height)
|
||||
SetHeight(Height)
|
||||
End If
|
||||
Index = NextIndex(Index)
|
||||
@@ -1968,6 +1974,7 @@ Public Class Part
|
||||
' 50159 = Missing parameter in ddf!
|
||||
MessageBox.Show(String.Format(EgtMsg(50141), ConstIni.K_THICKNESS_INI) & EgtMsg(50159), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, Thickness)
|
||||
SetThickness(Thickness)
|
||||
End If
|
||||
Map.refAssemblyPageVM.CurrAssembly.SetVarAssembly()
|
||||
@@ -2351,6 +2358,7 @@ Public Class Part
|
||||
If String.IsNullOrWhiteSpace(LockEdgeOverMaterial) Then
|
||||
If Not SearchKey(sLine, K_OVERMATERIAL) Then Return -1
|
||||
Else
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, LockEdgeOverMaterial)
|
||||
m_LockEdgeOverMaterial = LockEdgeOverMaterial
|
||||
End If
|
||||
Index = NextIndex(Index)
|
||||
@@ -2413,9 +2421,11 @@ Public Class Part
|
||||
If String.IsNullOrWhiteSpace(HingeEdgeOverMaterial) Then
|
||||
If Not SearchKey(sLine, K_OVERMATERIAL) Then Return -1
|
||||
Else
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, HingeEdgeOverMaterial)
|
||||
m_HingeEdgeOverMaterial = HingeEdgeOverMaterial
|
||||
End If
|
||||
Index = NextIndex(Index)
|
||||
'-------------------------------------------------------------------------------
|
||||
' Top
|
||||
If Index > FileContent.Count() - 1 Then Return -1
|
||||
sLine = RemoveComment(FileContent(Index))
|
||||
@@ -2472,12 +2482,14 @@ Public Class Part
|
||||
If String.IsNullOrWhiteSpace(TopOverMaterial) Then
|
||||
If Not SearchKey(sLine, K_OVERMATERIAL) Then Return -1
|
||||
Else
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, TopOverMaterial)
|
||||
m_TopOverMaterial = TopOverMaterial
|
||||
End If
|
||||
Index = NextIndex(Index)
|
||||
If Index > FileContent.Count() - 1 Then Return -1
|
||||
sLine = RemoveComment(FileContent(Index))
|
||||
'-------------------------------------------------------------------------------
|
||||
' Top Arc
|
||||
Dim Radius As String = GetValueWithKey(sLine, ConstCompo.K_RADIUS)
|
||||
If Not String.IsNullOrEmpty(Radius) Then
|
||||
Index = NextIndex(Index)
|
||||
@@ -2491,7 +2503,9 @@ Public Class Part
|
||||
Index = NextIndex(Index)
|
||||
Else
|
||||
Index = NextIndex(Index)
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, Radius)
|
||||
m_Radius = Radius
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, Posx)
|
||||
m_Posx = Posx
|
||||
TopArcIsChecked = True
|
||||
TopShapeIsChecked = True
|
||||
@@ -2515,6 +2529,7 @@ Public Class Part
|
||||
Else
|
||||
Index = NextIndex(Index)
|
||||
m_Angle = Angle
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, PosxAngle)
|
||||
m_PosxAngle = PosxAngle
|
||||
TopAngleIsChecked = True
|
||||
SelectedShape = m_TopShapeList(1)
|
||||
@@ -2580,6 +2595,7 @@ Public Class Part
|
||||
If String.IsNullOrWhiteSpace(BottomOverMaterial) Then
|
||||
If Not SearchKey(sLine, K_OVERMATERIAL) Then Return -1
|
||||
Else
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, BottomOverMaterial)
|
||||
m_BottomOverMaterial = BottomOverMaterial
|
||||
End If
|
||||
CalcBevelFromSecure()
|
||||
@@ -2807,6 +2823,8 @@ Public Class Part
|
||||
End If
|
||||
' Inserisco il componente in lista
|
||||
m_CurrCompo.FontBold = FontWeights.Normal
|
||||
' forzo la non modificabilità dei parametri della compo
|
||||
If OptionModule.ReadOnlyDDF Then m_CurrCompo.IsReadOnly = OptionModule.ReadOnlyDDF
|
||||
m_CompoList.Add(m_CurrCompo)
|
||||
End While
|
||||
Return Index
|
||||
@@ -2949,7 +2967,13 @@ Public Class Part
|
||||
Dim sVal As String = GetValueWithoutKey(sLine)
|
||||
' per ora non esegue nessun tipo di controllo sui valori letti dal file DDF
|
||||
' DirectCast(CurrCompoParam, TextBoxParam).m_Value = sVal
|
||||
DirectCast(CurrCompoParam, TextBoxParam).Value = sVal
|
||||
Dim Local_TextBoxParam As TextBoxParam = DirectCast(CurrCompoParam, TextBoxParam)
|
||||
If Local_TextBoxParam.bIsLen Then
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, sVal)
|
||||
Local_TextBoxParam.Value = sVal
|
||||
Else
|
||||
Local_TextBoxParam.Value = sVal
|
||||
End If
|
||||
' avviso che il file è modificato (in caso di chiusura del programma obbligo a passare dal salvataggio)
|
||||
Dim dVal As Double
|
||||
If String.IsNullOrEmpty(sVal) OrElse Not StringToDouble(sVal, dVal) Then
|
||||
@@ -2996,7 +3020,13 @@ Public Class Part
|
||||
If String.Equals(Trim(CompoTemplateItem.CompoParamList(IndexParam).DDFName), GetKey(sLine)) Then
|
||||
' se la stringa c'è nel DDF vuol dire che è stata selezionata
|
||||
Dim sVal As String = GetValueWithKey(sLine, Trim(CurrCompoParam.DDFName))
|
||||
DirectCast(CurrCompoParam, TextBoxOnOffParam).m_Value = sVal
|
||||
Dim Local_TextBoxOnOffParam As TextBoxOnOffParam = DirectCast(CurrCompoParam, TextBoxOnOffParam)
|
||||
If Local_TextBoxOnOffParam.bIsLen Then
|
||||
ConvertDDFValueIntoCurrentUnit(m_Measure, sVal)
|
||||
Local_TextBoxOnOffParam.m_Value = sVal
|
||||
Else
|
||||
Local_TextBoxOnOffParam.m_Value = sVal
|
||||
End If
|
||||
'DirectCast(CurrCompoParam, TextBoxOnOffParam).Value = sVal
|
||||
Dim dVal As Double
|
||||
If String.IsNullOrEmpty(sVal) OrElse Not StringToDouble(sVal, dVal) Then
|
||||
|
||||
@@ -135,7 +135,8 @@
|
||||
ToolTip="{Binding CurrPart.ToolTipEvaluatedWeight}"
|
||||
MaxWidth="120" Margin="0.4,2,10,3.2"
|
||||
VerticalAlignment="Stretch" Height="Auto"
|
||||
Visibility="{Binding CurrPart.VisibilityWeight}"/>
|
||||
Visibility="{Binding CurrPart.VisibilityWeight}"
|
||||
IsReadOnly="{Binding IsRaedOnly}"/>
|
||||
|
||||
<!--Seconda colonna -->
|
||||
<!-- Profiles-->
|
||||
@@ -195,13 +196,13 @@
|
||||
Name="LockHingeEdge"
|
||||
Margin="0,0,20,0"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Visibility="Collapsed"/>
|
||||
Visibility="Collapsed"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="3" Grid.RowSpan="2"
|
||||
IsChecked="{Binding CurrPart.ResizeTopBottom}"
|
||||
Name="TopBottomEdge"
|
||||
Margin="0,0,20,0"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Visibility="Collapsed"/>
|
||||
Visibility="Collapsed"/>
|
||||
<!--Machining-->
|
||||
<CheckBox Grid.Column="5" Grid.Row="1"
|
||||
Name="LockEdge" Style="{StaticResource DoorParamsChBx}"
|
||||
@@ -288,11 +289,12 @@
|
||||
Visibility="{Binding AllignGropBox}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
VerticalAlignment="Stretch"
|
||||
Margin="2,0,0.2,0"/>
|
||||
Margin="2,0,0.2,0"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
<ComboBox Style="{StaticResource DoorParamsCmBx}" Width="100"
|
||||
Visibility="{Binding AllignGropBox}"
|
||||
VerticalAlignment="Stretch" Height="Auto"
|
||||
Margin="2,0,0,0"/>
|
||||
Margin="2,0,0,0" IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
|
||||
@@ -353,6 +355,7 @@
|
||||
Visibility="{Binding CurrPart.MaterialIsVisible}"
|
||||
ItemsSource="{Binding CurrPart.MaterialsList}"
|
||||
SelectedItem="{Binding CurrPart.SelectedMaterial}"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"
|
||||
DisplayMemberPath="Name">
|
||||
</ComboBox>
|
||||
<!--lLsta proprietà-->
|
||||
@@ -362,6 +365,7 @@
|
||||
Visibility="{Binding CurrPart.PropertiesIsVisible}"
|
||||
ItemsSource="{Binding CurrPart.PropertiesList}"
|
||||
SelectedItem="{Binding CurrPart.SelectedProperty}"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"
|
||||
DisplayMemberPath="GraphicName">
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
@@ -382,12 +386,14 @@
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrPart.TopShapeIsChecked}"
|
||||
VerticalAlignment="Stretch"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"
|
||||
Margin="2,0,0.2,0"/>
|
||||
<ComboBox Style="{StaticResource DoorParamsCmBx}" Width="100"
|
||||
ItemsSource="{Binding CurrPart.TopShapeList}"
|
||||
SelectedItem="{Binding CurrPart.SelectedShape}"
|
||||
VerticalAlignment="Stretch" Height="Auto"
|
||||
Margin="2,0,0,0"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"
|
||||
DisplayMemberPath="Name"/>
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
@@ -545,7 +551,7 @@
|
||||
</Grid>
|
||||
</GroupBox>-->
|
||||
|
||||
<!--Cut-->
|
||||
<!--Cut NON IN USO-->
|
||||
<GroupBox Grid.Row="6" Grid.Column="1" Margin="2,0,2,0" Visibility="Collapsed">
|
||||
<GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@@ -631,9 +637,8 @@
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<GroupBox
|
||||
Width="{Binding ActualWidth,ElementName=DoorParamsItemsControl,
|
||||
Converter={StaticResource SplitConverter},ConverterParameter=2}" Padding="0,0,1,0">
|
||||
<GroupBox Width="{Binding ActualWidth,ElementName=DoorParamsItemsControl,
|
||||
Converter={StaticResource SplitConverter},ConverterParameter=2}" Padding="0,0,1,0">
|
||||
<GroupBox.Style>
|
||||
<Style TargetType="GroupBox">
|
||||
<Setter Property="BorderBrush" Value="LightGray"/>
|
||||
@@ -651,7 +656,7 @@
|
||||
</Style>
|
||||
</GroupBox.Style>
|
||||
<GroupBox.Header >
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding IsReadOnly, Converter={StaticResource TrueToFalse}}">
|
||||
<Button x:Name="ReloadCompoRef"
|
||||
Visibility="{Binding VisibilitiReloadBtn}"
|
||||
ToolTip="{Binding DataContext.ReloadCompoRefToolTip,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
@@ -696,6 +701,7 @@
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
<StackPanel >
|
||||
<!--Brand Template-->
|
||||
<UniformGrid Columns="2" Visibility="{Binding TemplateVisibility}">
|
||||
<!--Brand-->
|
||||
<TextBlock Text="{Binding BrandMsg}">
|
||||
@@ -712,12 +718,11 @@
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
<ComboBox ItemsSource="{Binding BrandListPart,
|
||||
Converter={StaticResource TemplateListConverter}}"
|
||||
<ComboBox ItemsSource="{Binding BrandListPart, Converter={StaticResource TemplateListConverter}}"
|
||||
Margin="0,0,0,2"
|
||||
SelectedItem="{Binding SelBrandPart}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
IsEnabled="{Binding IsReadOnly}"/>
|
||||
IsEnabled="{Binding IsReadOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
<!--File-->
|
||||
<TextBlock Text="{Binding TemplateName}">
|
||||
<TextBlock.Style>
|
||||
@@ -732,12 +737,11 @@
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
<ComboBox ItemsSource="{Binding FileList,
|
||||
Converter={StaticResource TemplateListConverter}}"
|
||||
<ComboBox ItemsSource="{Binding FileList, Converter={StaticResource TemplateListConverter}}"
|
||||
Margin="0,0,0,2"
|
||||
SelectedItem="{Binding SelFile}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
IsEnabled="{Binding IsReadOnly}"/>
|
||||
IsEnabled="{Binding IsReadOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
</UniformGrid>
|
||||
|
||||
<!--Lista dei parametri-->
|
||||
@@ -764,18 +768,18 @@
|
||||
<ComboBox ItemsSource="{Binding ItemList}" Margin="0,0,0,2"
|
||||
SelectedItem="{Binding SelItem}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
IsEnabled="{Binding IsRaedOnly}"/>
|
||||
IsEnabled="{Binding CurrCompo.IsReadOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
</UniformGrid>
|
||||
</DataTemplate>
|
||||
<!-- ComboBoxOnOff -->
|
||||
<DataTemplate DataType="{x:Type local:ComboBoxOnOffParam}">
|
||||
<Grid>
|
||||
<Grid IsEnabled="{Binding CurrCompo.IsReadOnly, Converter={StaticResource TrueToFalse}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -783,8 +787,7 @@
|
||||
|
||||
<CheckBox Name="ChBxBox" IsChecked="{Binding IsActive}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
VerticalAlignment="Top"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
VerticalAlignment="Top"/>
|
||||
<TextBlock Text="{Binding Name}" Grid.Column="1"
|
||||
Margin="2,0,0,2">
|
||||
<TextBlock.Style>
|
||||
@@ -835,7 +838,7 @@
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="0,0,0,2"
|
||||
ToolTip="{Binding ToolTipValue}"
|
||||
IsEnabled="{Binding IsReadOnly}"/>
|
||||
IsReadOnly="{Binding CurrCompo.IsReadOnly}"/>
|
||||
</UniformGrid>
|
||||
</DataTemplate>
|
||||
<!-- TextBoxOnOff -->
|
||||
@@ -855,7 +858,7 @@
|
||||
<CheckBox Name="ChBx" IsChecked="{Binding IsActive}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
VerticalAlignment="Top"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
IsEnabled="{Binding CurrCompo.IsReadOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
<TextBlock Text="{Binding Name}" Grid.Column="1"
|
||||
Margin="2,0,0,2">
|
||||
<TextBlock.Style>
|
||||
@@ -875,6 +878,7 @@
|
||||
<TextBox Text="{Binding Value,UpdateSourceTrigger=PropertyChanged}" Grid.Column="2"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=ChBx}"
|
||||
IsReadOnly="{Binding CurrCompo.IsReadOnly}"
|
||||
Margin="0,0,0,2"
|
||||
ToolTip="{Binding ToolTipValue,UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</Grid>
|
||||
|
||||
@@ -27,4 +27,7 @@
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub UserControl_IsEnabledChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -80,6 +80,7 @@ Public Class PartPageVM
|
||||
If IsNothing(Map.refCompoPanelVM) Then Map.SetRefCompoPanelVM(New CompoPanelVM("PartPage"))
|
||||
If IsNothing(m_CompoPanelPart) Then m_CompoPanelPart = New CompoPanelV
|
||||
m_CompoPanelPart.DataContext = Map.refCompoPanelVM
|
||||
m_IsReadOnly = OptionModule.ReadOnlyDDF
|
||||
End Sub
|
||||
|
||||
Sub PrepareEvent()
|
||||
|
||||
@@ -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
|
||||
|
||||
+103
-14
@@ -739,14 +739,16 @@ Public Class Hardware
|
||||
Dim nIsActiveMaterial As Integer = 3
|
||||
Dim bIsCurrentMaterial As Boolean = True
|
||||
StdTemplateGetPrivateProfileListMaterial(S_CHAPTER & ChapterIndex, K_MATERIAL, sMaterialList, nIsActiveMaterial)
|
||||
For Each ItemMaterial In sMaterialList
|
||||
bIsCurrentMaterial = False
|
||||
Dim ArrayItemMaterial As String() = ItemMaterial.Split("/"c)
|
||||
If Trim(ArrayItemMaterial(0)) = Trim(Map.refHardwarePageVM.GenericPart.SelectedMaterial.NameDDF) Then
|
||||
bIsCurrentMaterial = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
'For Each ItemMaterial In sMaterialList
|
||||
' bIsCurrentMaterial = False
|
||||
' Dim ArrayItemMaterial As String() = ItemMaterial.Split("/"c)
|
||||
' If Trim(ArrayItemMaterial(0)) = Trim(Map.refHardwarePageVM.GenericPart.SelectedMaterial.NameDDF) Then
|
||||
' bIsCurrentMaterial = True
|
||||
' Exit For
|
||||
' End If
|
||||
'Next
|
||||
IsCurrentMaterial(sMaterialList, bIsCurrentMaterial)
|
||||
|
||||
If Not bIsCurrentMaterial And nIsActive <> 4 Then
|
||||
nIsActive = nIsActiveMaterial
|
||||
End If
|
||||
@@ -792,6 +794,18 @@ Public Class Hardware
|
||||
Dim NewParam As New CompoParam(m_HardwareGeneral.DDFName, m_HardwareGeneral.Name, Chapter)
|
||||
Dim sHelpParam As String = String.Empty
|
||||
EgtUILib.GetPrivateProfileString(S_CHAPTER & ChapterIndex, "HelpParam" & ParamIndex, "", sHelpParam, m_StdTemplate)
|
||||
' verifico se il materiale corrente deve essere visualizzato in funzione del materiale associato al parametro
|
||||
Dim sMaterialParam As String = String.Empty
|
||||
Dim MaterialParamList As New List(Of String)
|
||||
Dim bIsCurrentMaterialParam As Boolean = True
|
||||
Dim sDefaultGhostValue As String = ""
|
||||
StdTemplateGetPrivateProfileListMaterialParam(S_CHAPTER & ChapterIndex, "MaterialParam" & ParamIndex, MaterialParamList, sDefaultGhostValue)
|
||||
IsCurrentMaterial(MaterialParamList, bIsCurrentMaterialParam)
|
||||
If Not bIsCurrentMaterialParam Then
|
||||
' trasformo il parametro in Ghost
|
||||
TrasformCurrParamInGhost(sParam, sDefaultGhostValue)
|
||||
End If
|
||||
|
||||
' leggo il tipo di parametro, se la lettura va a buon fine la carico
|
||||
If Chapter.ReadParamHardware(sParam, sHelpParam, NewParam, ErrorReading) Then Chapter.CompoParamList.Add(NewParam)
|
||||
If TypeOf NewParam Is TextBoxOnOffParam Then
|
||||
@@ -833,6 +847,29 @@ Public Class Hardware
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' recupera il l'elenco dei materiali indicati nella stringa e verifica se nell'elenco è presente il materiale attivo nella porta
|
||||
Private Sub IsCurrentMaterial(sMaterialList As List(Of String), ByRef bIsCurrentMaterial As Boolean)
|
||||
For Each ItemMaterial In sMaterialList
|
||||
bIsCurrentMaterial = False
|
||||
Dim ArrayItemMaterial As String() = ItemMaterial.Split("/"c)
|
||||
If Trim(ArrayItemMaterial(0)) = Trim(Map.refHardwarePageVM.GenericPart.SelectedMaterial.NameDDF) Then
|
||||
bIsCurrentMaterial = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub TrasformCurrParamInGhost(ByRef sParamLine As String, ByVal sDefaultValue As String)
|
||||
' separo la stringa
|
||||
Dim sItems As String() = sParamLine.Split(";"c)
|
||||
If sItems.Count > 2 Then
|
||||
sItems(0) = "Ghost"
|
||||
sItems(2) = sDefaultValue
|
||||
End If
|
||||
' riassemblo la stringa iniziale
|
||||
sParamLine = Trim(sItems(0)) & "; " & Trim(sItems(1)) & "; " & Trim(sItems(2))
|
||||
End Sub
|
||||
|
||||
' carico la liste dei nomi dei capitoli
|
||||
Private Function SetGroupChaptername(sName As String) As Boolean
|
||||
If m_GroupChapterName.Count = 0 Then m_GroupChapterName.Add(sName)
|
||||
@@ -988,6 +1025,10 @@ 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
|
||||
@@ -1055,7 +1096,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 +1169,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))
|
||||
@@ -1929,10 +1994,16 @@ 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
|
||||
@@ -2015,7 +2086,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 +2119,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 +2197,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
|
||||
|
||||
+25
@@ -25,6 +25,8 @@ Friend Module IniFile
|
||||
DOORS = 2
|
||||
DOORCREATOR = 8
|
||||
JAMBS = 32
|
||||
STEELDOOR = 256
|
||||
READ_ONLY = 512
|
||||
End Enum
|
||||
|
||||
' Path cartella Data
|
||||
@@ -57,6 +59,8 @@ Friend Module IniFile
|
||||
Friend m_sListLabelCurrent As String = String.Empty
|
||||
' Path dell'eseguibile Cam5
|
||||
Friend m_sEgtCameEXEPath As String = String.Empty
|
||||
' Path LuaLibs Dir
|
||||
Friend m_sLuaLibsDir As String = String.Empty
|
||||
|
||||
' EgtDoorCreator.ini
|
||||
Public Function GetPrivateProfileLanguage(ByVal lpAppName As String, ByVal lpKeyName As String) As Language
|
||||
@@ -287,6 +291,27 @@ Friend Module IniFile
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' restituisce l'elenco dei materiali ed eventualmente il valore di default da associare al parametro Ghost che viene generato in sostituzione del parametro letto
|
||||
Public Function StdTemplateGetPrivateProfileListMaterialParam(ByVal lpAppName As String, ByVal lpKeyName As String, ByVal List As List(Of String), ByRef sDefaultParam As String) As Boolean
|
||||
Dim sVal As String = String.Empty
|
||||
StdTemplateGetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
|
||||
If String.IsNullOrEmpty(sVal) Then Return False
|
||||
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
' se la lista ha almeno due elementi
|
||||
If sItems.Count > 1 Then
|
||||
For Index = 0 To sItems.Count() - 2
|
||||
List.Add(Trim(sItems(Index)))
|
||||
Next
|
||||
End If
|
||||
' se la lista ha un solo elemento, oppure ha un solo elemento
|
||||
Dim LastItems As String() = sItems.Last.Split(";"c)
|
||||
List.Add(Trim(LastItems(0)))
|
||||
If LastItems.Count > 1 Then
|
||||
sDefaultParam = Trim(LastItems(1))
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function StdTemplateGetPrivateProfileChapterName(ByVal lpAppName As String, ByVal lpKeyName As String, ByRef sValueLua As String, ByRef sValue As String) As Boolean
|
||||
Dim sVal As String = String.Empty
|
||||
StdTemplateGetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
|
||||
|
||||
@@ -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, 2310, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2310, 1, IniFile.m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2412, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2412, 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())
|
||||
@@ -96,11 +96,13 @@ Friend Class MainWindowModel
|
||||
Dim sLuaLibsDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
|
||||
EgtSetLuaLibs(sLuaLibsDir)
|
||||
IniFile.m_sLuaLibsDir = sLuaLibsDir
|
||||
Dim sLuaBaseLib As String = String.Empty
|
||||
GetMainPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
|
||||
EgtLuaRequire(sLuaBaseLib)
|
||||
' Imposto path IniFile
|
||||
EgtSetIniFile(IniFile.m_sIniFile)
|
||||
' Imposto la modalità di lettura dei file ddf
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -331,11 +343,13 @@ Public Class MainWindowVM
|
||||
|
||||
'Public Sub CloseApplication(ByVal param As Object)
|
||||
Public Sub CloseApplication()
|
||||
m_StopClosingApplication = False
|
||||
' verifico se selezionato esiste e modificato
|
||||
Select Case SelectedPage
|
||||
Case ListPageEnum.nHardwarePage
|
||||
If Not IsNothing(Map.refHardwarePageVM) And Not IsNothing(Map.refHardwarePageVM.CurrHardware) Then
|
||||
If Map.refHardwarePageVM.CurrHardware.SaveControl() = Hardware.SaveResult.nCancel Then
|
||||
m_StopClosingApplication = True
|
||||
Return
|
||||
ElseIf Map.refHardwarePageVM.CurrHardware.SaveControl() = Hardware.SaveResult.nYes Then
|
||||
Map.refHardwarePageVM.CurrHardware.Save()
|
||||
@@ -349,10 +363,15 @@ Public Class MainWindowVM
|
||||
Select Case MessageBox.Show(sText, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
|
||||
Case MessageBoxResult.Yes
|
||||
Map.refAssemblyManagerVM.Save(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
|
||||
If Not DdfFile.DDFIsCorrect Then Return ' se il ddf non è corretto non permetto il salvataggio
|
||||
' se il ddf non è corretto non permetto il salvataggio
|
||||
If Not DdfFile.DDFIsCorrect Then
|
||||
m_StopClosingApplication = True
|
||||
Return
|
||||
End If
|
||||
Case MessageBoxResult.No
|
||||
' Non faccio alcunchè
|
||||
Case MessageBoxResult.Cancel
|
||||
m_StopClosingApplication = True
|
||||
Return
|
||||
End Select
|
||||
End If
|
||||
@@ -375,6 +394,14 @@ Public Class MainWindowVM
|
||||
|
||||
End Sub
|
||||
|
||||
Private m_StopClosingApplication As Boolean = False
|
||||
Public ReadOnly Property StopClosingApplication As Boolean
|
||||
Get
|
||||
' restituisce vero se l'operazione di chiusura del programma è stata interotta
|
||||
Return m_StopClosingApplication
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' CloseApplicationCommand
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
@@ -32,7 +32,7 @@ Imports System.Windows
|
||||
|
||||
<Assembly: AssemblyCompany("EgalTech s.r.l.")>
|
||||
<Assembly: AssemblyProduct("EgtDOORCreator")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016-2021 by EgalTech s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016-2022 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.3.10.1")>
|
||||
<Assembly: AssemblyFileVersion("2.3.10.1")>
|
||||
<Assembly: AssemblyVersion("2.4.12.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.12.1")>
|
||||
|
||||
@@ -4,11 +4,18 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Friend Module OptionModule
|
||||
' flag per modalità di visualizzazione file (solo lettura)
|
||||
Friend ReadOnlyDDF As Boolean = False
|
||||
|
||||
' Parametri che contengono lista delle lingue disponibili e lingua selezionata
|
||||
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
|
||||
@@ -216,6 +223,15 @@ Friend Module OptionModule
|
||||
m_ConfigurationSoftware = ConfigType.Door
|
||||
End If
|
||||
|
||||
' verifico se il programma è in modalità di sola lettura DDF
|
||||
If (IniFile.m_nKeyOptions And KEY_OPT.READ_ONLY) <> 0 Then
|
||||
OptionModule.ReadOnlyDDF = True
|
||||
ElseIf GetMainPrivateProfileInt(S_GENERAL, "ReadOnly", 0) <> 0 Then
|
||||
OptionModule.ReadOnlyDDF = True
|
||||
Else
|
||||
OptionModule.ReadOnlyDDF = False
|
||||
End If
|
||||
|
||||
' imposto unità di misura per interfaccia utente
|
||||
m_bIsMmUnit = (GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
|
||||
EgtSetUiUnits(m_bIsMmUnit)
|
||||
@@ -380,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)
|
||||
@@ -813,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
|
||||
@@ -984,6 +1009,81 @@ 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
|
||||
EgtOutLog("Directory " & "'" & sMTableDir & "'" & " not found.")
|
||||
Return False
|
||||
End If
|
||||
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
|
||||
EgtOutLog("Not valid file in directory " & "'" & sMTableDir & "'" & ".")
|
||||
Return False
|
||||
End If
|
||||
' 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_sLuaLibsDir & "\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
|
||||
@@ -1016,3 +1116,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,68 @@ 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_sLuaLibsDir & "\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")
|
||||
NotifyPropertyChanged("BaseDir")
|
||||
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
|
||||
@@ -116,6 +194,28 @@ Public Class OptionsVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value IsNot OptionModule.m_SelectedMeasureUnit Then
|
||||
|
||||
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
|
||||
' procedo alla chiusura del programma
|
||||
Map.refMainWindowVM.CloseApplication()
|
||||
If bRestartProgram Then Process.Start(Application.ResourceAssembly.Location)
|
||||
Else
|
||||
' esco senza salvare la selezione
|
||||
Return
|
||||
End If
|
||||
' sa la chiusura del porgramma è stata interotta
|
||||
If Map.refMainWindowVM.StopClosingApplication Then
|
||||
' esco senza salvare la selezione
|
||||
Return
|
||||
End If
|
||||
|
||||
OptionModule.m_bIsMmUnit = (value = OptionModule.m_MeasureUnitList(0))
|
||||
EgtSetUiUnits(OptionModule.m_bIsMmUnit)
|
||||
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, If(OptionModule.m_bIsMmUnit, "1", "0"))
|
||||
@@ -1112,9 +1212,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 +1239,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 +1428,7 @@ Public Class OptionsVM
|
||||
|
||||
Public ReadOnly Property MachMsg As String
|
||||
Get
|
||||
' Mach.
|
||||
' Mach.
|
||||
Return EgtMsg(50711)
|
||||
End Get
|
||||
End Property
|
||||
@@ -1352,20 +1458,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 +1666,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
|
||||
@@ -1711,7 +1853,7 @@ Public Class OptionsVM
|
||||
Private m_VisibilityConfiguration As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property VisibilityConfiguration As Visibility
|
||||
Get
|
||||
If (GetMainPrivateProfileInt(S_GENERAL, "Debug", 0) > 4) Then
|
||||
If (GetMainPrivateProfileInt(S_GENERAL, "EnableSettingAsOpt", 0) = 1) Then
|
||||
m_VisibilityConfiguration = Visibility.Visible
|
||||
End If
|
||||
Return m_VisibilityConfiguration
|
||||
@@ -1724,6 +1866,26 @@ 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
|
||||
' procedo alla chiusura del programma
|
||||
Map.refMainWindowVM.CloseApplication()
|
||||
If bRestartProgram Then Process.Start(Application.ResourceAssembly.Location)
|
||||
Else
|
||||
' esco senza salvare la selezione
|
||||
Return
|
||||
End If
|
||||
' sa la chiusura del porgramma è stata interotta
|
||||
If Map.refMainWindowVM.StopClosingApplication Then
|
||||
' esco senza salvare la selezione
|
||||
Return
|
||||
End If
|
||||
m_EnableAssembly = value
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_RUNAS, If(m_EnableAssembly, "1", "0"))
|
||||
NotifyPropertyChanged("EnableAssembly")
|
||||
@@ -1870,10 +2032,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"
|
||||
@@ -1903,6 +2065,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_sLuaLibsDir & "\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
|
||||
@@ -1946,6 +2127,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
|
||||
|
||||
+17
-6
@@ -1,6 +1,7 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="OrderV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Title="{Binding Title}" Icon="/Resources/EgtDOOR.ico"
|
||||
TitleBarBrush="{StaticResource EgaltechBlue1}"
|
||||
@@ -10,7 +11,11 @@
|
||||
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
Height="250" Width="350">
|
||||
|
||||
<Grid Margin="2">
|
||||
<Window.Resources>
|
||||
<EgtDOORCreator:TrueToFalse x:Key="TrueToFalse"/>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -26,31 +31,36 @@
|
||||
</Grid.RowDefinitions>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Customer}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,15,5"/>
|
||||
Margin="5,0,15,5"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding CustomerMsg}" VerticalAlignment="Center"
|
||||
Margin="15,0,0,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Elevation}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,15,5"/>
|
||||
Margin="5,0,15,5"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding ElevationMsg}" VerticalAlignment="Center"
|
||||
Margin="15,0,0,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding Project}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,15,5"/>
|
||||
Margin="5,0,15,5"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding ProjectMsg}" VerticalAlignment="Center"
|
||||
Margin="15,0,0,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="3" Text="{Binding PO}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,15,5"/>
|
||||
Margin="5,0,15,5"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="3" Text="{Binding POMsg}" VerticalAlignment="Center"
|
||||
Margin="15,0,0,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="4" Text="{Binding Line}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,15,5"/>
|
||||
Margin="5,0,15,5"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="4" Text="{Binding LineMsg}" VerticalAlignment="Center"
|
||||
Margin="15,0,0,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
@@ -62,6 +72,7 @@
|
||||
SelectedItem="{Binding Configuration}"/>-->
|
||||
<Button Grid.Column="1" Grid.Row="5" Margin="70,2,30,2"
|
||||
Content="{Binding SaveMsg}"
|
||||
IsEnabled="{Binding IsReadOnly, Converter={StaticResource TrueToFalse}}"
|
||||
IsDefault="True"
|
||||
IsCancel="True"/>
|
||||
</Grid>
|
||||
|
||||
@@ -60,6 +60,12 @@ Public Class OrderVM
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
Public ReadOnly Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return OptionModule.ReadOnlyDDF
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property Customer As String
|
||||
Get
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding EnableProjectManager}" Height="32">
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
<Button Command="{Binding NewCommand}" ToolTip="{Binding NewToolTip}" Focusable="False">
|
||||
<Button Command="{Binding NewCommand}" ToolTip="{Binding NewToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="{Binding NewProjectImg}" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<!--Visibility="{Binding VisibilityDeleteDDF}"-->
|
||||
<Button Command="{Binding DeleteCommand}" ToolTip="{Binding DeleteToolTip}" Focusable="False">
|
||||
<Button Command="{Binding DeleteCommand}" ToolTip="{Binding DeleteToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="{Binding DeleteProjectImg}" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding OpenCommand}" ToolTip="{Binding OpenToolTip}"
|
||||
@@ -31,31 +33,35 @@
|
||||
</Button.ContextMenu>
|
||||
<Image Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ReloadCommand}" ToolTip="{Binding ReloadToolTip}" Focusable="False">
|
||||
<Button Command="{Binding ReloadCommand}" ToolTip="{Binding ReloadToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding SaveCommand}" ToolTip="{Binding SaveToolTip}" Focusable="False">
|
||||
<Button Command="{Binding SaveCommand}" ToolTip="{Binding SaveToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Save.png" Stretch="Uniform"/>
|
||||
<!--<Image Source="{Binding IsModifiedImage}" Stretch="Uniform"/>-->
|
||||
</Button>
|
||||
<Button Command="{Binding DuplicaCommand}" ToolTip="{Binding DuplicaToolTip}" Focusable="False">
|
||||
<Button Command="{Binding DuplicaCommand}" ToolTip="{Binding DuplicaToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding CreateTemplateCommand}" ToolTip="{Binding TemplateDoorToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityTemplate}">
|
||||
Visibility="{Binding VisibilityTemplate}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAsTemplate.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding CopyCommand}" ToolTip="{Binding CopyToolTip}" Focusable="False">
|
||||
<Button Command="{Binding CopyCommand}" ToolTip="{Binding CopyToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Export.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding OpenCamCommand}" ToolTip="{Binding OpenCamToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityEgtCAM}">
|
||||
Visibility="{Binding VisibilityEgtCAM}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/EgtCAM5.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
@@ -76,16 +82,17 @@
|
||||
</ContentControl>
|
||||
</Button>-->
|
||||
<Button Command="{Binding CreateAssemblyCommand}" ToolTip="{Binding CreateAssemblyToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityCreateAssembly}">
|
||||
Visibility="{Binding VisibilityCreateAssembly}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Create Assembly.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding OptionsCommand}" ToolTip="{Binding OptionsToolTip}" Focusable="False"
|
||||
Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}">
|
||||
Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
||||
</Button>
|
||||
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}" Focusable="False">
|
||||
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Send.png" Height="22" Margin="3,0,3,0" />
|
||||
</Button>
|
||||
<Button Command="{Binding GuideCommand}" ToolTip="{Binding GuideToolTip}" Focusable="False">
|
||||
@@ -97,12 +104,14 @@
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
ToolTip="{Binding DoorToolTip}"
|
||||
IsChecked="{Binding DoorIsChecked}"
|
||||
Content="{Binding DoorToolTip}">
|
||||
Content="{Binding DoorToolTip}"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
</RadioButton>
|
||||
<!--Hardware-->
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}"
|
||||
Content="{Binding HardwareToolTip}">
|
||||
Content="{Binding HardwareToolTip}"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -120,6 +120,13 @@ Public Class ProjectManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' se in sola lettura il programma allora abilito solo i camndi Apertura e Stampa
|
||||
Public ReadOnly Property EnableModifyDDF As Boolean
|
||||
Get
|
||||
Return Not OptionModule.ReadOnlyDDF
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdNew As ICommand
|
||||
Private m_cmdDelete As ICommand
|
||||
@@ -321,7 +328,22 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
' se annullo la creazione di un nuovo direttorio, rimango in quello attuale (verifico che l'ultimo file non sia già in lettura)
|
||||
If Not SaveFileDialogWnd.ShowDialog Then
|
||||
Utility.OutLog("Annullata la creazione di un nuovo progetto")
|
||||
Utility.OutLog("Annullata la creazione di un nuovo progetto")
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
If Not Utility.IsFileLocked(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Utility.OutLog("Apertura progetto : " & Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
' Se decido di continuare la creazione controllo che il direttorio non esista
|
||||
Dim MsgResult As MessageBoxResult = MessageBoxResult.Yes
|
||||
If Directory.Exists(SaveFileDialog.FileName) Then
|
||||
' se il direttorio contiene almento un file di .lock esco
|
||||
If Utility.IsFileLocked(SaveFileDialog.FileName) Then
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
If Not Utility.IsFileLocked(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
@@ -332,78 +354,63 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
' Se decido di continuare la creazione controllo che il direttorio non esista
|
||||
Dim MsgResult As MessageBoxResult = MessageBoxResult.Yes
|
||||
If Directory.Exists(SaveFileDialog.FileName) Then
|
||||
' se il direttorio contiene almento un file di .lock esco
|
||||
If Utility.IsFileLocked(SaveFileDialog.FileName) Then
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
If Not Utility.IsFileLocked(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Utility.OutLog("Apertura progetto : " & Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName
|
||||
End If
|
||||
|
||||
' Vuoi sovrascrivere il direttorio?
|
||||
String.Format(EgtMsg(50526), SaveFileDialog.FileName)
|
||||
MsgResult = MessageBox.Show(String.Format(EgtMsg(50526), SaveFileDialog.FileName), EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Asterisk)
|
||||
' se decido di non cancellare il direttorio esco
|
||||
If MsgResult = MessageBoxResult.No Then
|
||||
Utility.OutLog("Annullata sovrascrittura delprogetto esistente : " & SaveFileDialog.FileName)
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
If Not Utility.IsFileLocked(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Utility.OutLog("Apertura progetto : " & Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName
|
||||
End If
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
|
||||
' Vuoi sovrascrivere il direttorio?
|
||||
String.Format(EgtMsg(50526), SaveFileDialog.FileName)
|
||||
MsgResult = MessageBox.Show(String.Format(EgtMsg(50526), SaveFileDialog.FileName), EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Asterisk)
|
||||
' se decido di non cancellare il direttorio esco
|
||||
If MsgResult = MessageBoxResult.No Then
|
||||
Utility.OutLog("Annullata sovrascrittura delprogetto esistente : " & SaveFileDialog.FileName)
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
If Not Utility.IsFileLocked(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Utility.OutLog("Apertura progetto : " & Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
|
||||
' cancello il direttorio
|
||||
Try
|
||||
Directory.Delete(SaveFileDialog.FileName, True)
|
||||
Utility.OutLog("Sovrascrivo il progetto : " & SaveFileDialog.FileName)
|
||||
Catch ex As Exception
|
||||
' 50527 = Impossible to overwrite {0}
|
||||
MessageBox.Show(String.Format(EgtMsg(50527), SaveFileDialog.FileName), EgtMsg(501001), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End Try
|
||||
Return
|
||||
End If
|
||||
' Se decido di non sovrascrivere allora rimango in quello attuale
|
||||
|
||||
Utility.OutLog("Creazione nuovo progetto : " & SaveFileDialog.FileName)
|
||||
' Creo nuovo progetto
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
Directory.CreateDirectory(SaveFileDialog.FileName)
|
||||
Dim CurrProject As Project = New Project
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
' salvo path progetto
|
||||
If SaveFileDialog.FileName.EndsWith("\") Then
|
||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Remove(SaveFileDialog.FileName.LastIndexOf("\"))
|
||||
End If
|
||||
CurrProject.Name = SaveFileDialog.FileName
|
||||
' Ripulisco lista porte
|
||||
CurrProject.AssemblyList.Clear()
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
Map.refAssemblyManagerVM.CurrProject = CurrProject
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
' Creo nuova porta
|
||||
Map.refAssemblyManagerVM.AddAssembly()
|
||||
' Map.refOptionsVM.MyProjectDir = CurrProject.Name
|
||||
If Not IsNothing(CurrProject.SelAssemblyName) AndAlso Not String.IsNullOrEmpty(CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = CurrProject.SelAssemblyName
|
||||
End If
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Visible
|
||||
Return
|
||||
' cancello il direttorio
|
||||
Try
|
||||
Directory.Delete(SaveFileDialog.FileName, True)
|
||||
Utility.OutLog("Sovrascrivo il progetto : " & SaveFileDialog.FileName)
|
||||
Catch ex As Exception
|
||||
' 50527 = Impossible to overwrite {0}
|
||||
MessageBox.Show(String.Format(EgtMsg(50527), SaveFileDialog.FileName), EgtMsg(501001), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End Try
|
||||
End If
|
||||
' Se decido di non sovrascrivere allora rimango in quello attuale
|
||||
|
||||
Utility.OutLog("Creazione nuovo progetto : " & SaveFileDialog.FileName)
|
||||
' Creo nuovo progetto
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
Directory.CreateDirectory(SaveFileDialog.FileName)
|
||||
Dim CurrProject As Project = New Project
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
' salvo path progetto
|
||||
If SaveFileDialog.FileName.EndsWith("\") Then
|
||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Remove(SaveFileDialog.FileName.LastIndexOf("\"))
|
||||
End If
|
||||
CurrProject.Name = SaveFileDialog.FileName
|
||||
' Ripulisco lista porte
|
||||
CurrProject.AssemblyList.Clear()
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
Map.refAssemblyManagerVM.CurrProject = CurrProject
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
' Creo nuova porta
|
||||
Map.refAssemblyManagerVM.AddAssembly()
|
||||
' Map.refOptionsVM.MyProjectDir = CurrProject.Name
|
||||
If Not IsNothing(CurrProject.SelAssemblyName) AndAlso Not String.IsNullOrEmpty(CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = CurrProject.SelAssemblyName
|
||||
End If
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Visible
|
||||
Return
|
||||
End If
|
||||
'-------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
'Prima di tutto chiedo se vuole aprire un template
|
||||
@@ -469,6 +476,7 @@ Public Class ProjectManagerVM
|
||||
' creo un nuovo assemblato
|
||||
Dim Local_AssemblyName As New AssemblyName
|
||||
Local_AssemblyName.Name = FilePathComplete
|
||||
Local_AssemblyName.GraphicName = Path.GetFileNameWithoutExtension(FilePathComplete)
|
||||
m_CurrProject.AssemblyList.Add(Local_AssemblyName)
|
||||
' Seleziono AssembyName creato
|
||||
m_CurrProject.SelAssemblyName = Local_AssemblyName
|
||||
@@ -1011,9 +1019,10 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
CurrProject.SelAssemblyName = ItemFile
|
||||
'If OptionModule.m_SingleDoor Then
|
||||
Map.refMainWindowVM.ProjectNameMsg = OptionModule.m_sLastProject
|
||||
Utility.OutLog("Blocco progetto : " & CurrProject.SelAssemblyName.GraphicName)
|
||||
Utility.LockDir(CurrProject.Name, CurrProject.SelAssemblyName.GraphicName)
|
||||
'Map.refMainWindowVM.ProjectNameMsg = OptionModule.m_sLastProject
|
||||
Dim sFileName As String = Path.GetFileNameWithoutExtension(CurrProject.SelAssemblyName.Name)
|
||||
Utility.OutLog("Blocco progetto : " & sFileName)
|
||||
Utility.LockDir(CurrProject.Name, sFileName)
|
||||
'End If
|
||||
Return
|
||||
End If
|
||||
@@ -1311,11 +1320,26 @@ Public Class ProjectManagerVM
|
||||
Return
|
||||
End If
|
||||
'Verifico che tutto sia salvato, altrimenti esco con messaggio
|
||||
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified() Then
|
||||
' Project must be saved before copying
|
||||
MessageBox.Show(EgtMsg(50186), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return
|
||||
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
|
||||
'' Project must be saved before copying
|
||||
'MessageBox.Show(EgtMsg(50186), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
' 50177=Do you want to save the current changes?
|
||||
Dim ResultMsg As MessageBoxResult = MessageBox.Show(EgtMsg(50177), EgtMsg(50144), MessageBoxButton.OKCancel, MessageBoxImage.Warning)
|
||||
If ResultMsg = MessageBoxResult.OK Then
|
||||
' salvo e continuo
|
||||
Save()
|
||||
Else
|
||||
' esco
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
'' elimino eventuali file .txt associati a ddf corrente (per lettura dei messaggi di errore stampati nel dal log del CAM5)
|
||||
'Dim FileLog As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
'FileLog = FileLog.Replace(DDF_EXTENSION, ".txt")
|
||||
'Try
|
||||
' File.Delete(FileLog)
|
||||
'Catch
|
||||
'End Try
|
||||
Dim Proc As New Process
|
||||
' Dim CurrFile As String = IniFile.m_sTempDir & "\CurrPart" & DDF_EXTENSION
|
||||
Dim CurrFile As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
@@ -1323,7 +1347,8 @@ Public Class ProjectManagerVM
|
||||
Proc.StartInfo.FileName = IniFile.m_sEgtCameEXEPath
|
||||
' 0: creata una porta come descritta nel file riferito
|
||||
' 1 viene creata la porta e il suo programma di lavorazione sul centro di lavoro preconfigurato
|
||||
Proc.StartInfo.Arguments = """" & CurrFile & """ " & If((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift, """1""", """0""")
|
||||
' Proc.StartInfo.Arguments = """" & CurrFile & """ " & If((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift, """1""", """0""")
|
||||
Proc.StartInfo.Arguments = """" & CurrFile & """ " & """0"""
|
||||
If Not Proc.Start() Then
|
||||
' Error in starting EgtCam5.exe
|
||||
MessageBox.Show(EgtMsg(50567), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
@@ -1332,16 +1357,22 @@ Public Class ProjectManagerVM
|
||||
' Error in starting EgtCam5.exe
|
||||
MessageBox.Show(EgtMsg(50567), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End Try
|
||||
Dim sError As String = String.Empty
|
||||
Dim nType As Integer = 0
|
||||
ShowGraphicError(sError, nType)
|
||||
If Not String.IsNullOrEmpty(sError) And nType > 0 Then
|
||||
'Proc.Kill()
|
||||
MessageBox.Show(sError, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
ElseIf Not String.IsNullOrEmpty(sError) And nType < 0 Then
|
||||
'Proc.Kill()
|
||||
MessageBox.Show(sError, EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
End If
|
||||
'Dim sError As String = String.Empty
|
||||
'Dim nType As Integer = 0
|
||||
'Dim nCountCycle As Integer = 0
|
||||
'' al massimo attendo 5 secondi
|
||||
'While Not (Proc.HasExited Or File.Exists(FileLog)) And nCountCycle < 50
|
||||
' Threading.Thread.Sleep(100)
|
||||
' nCountCycle += 1
|
||||
'End While
|
||||
'ShowGraphicError(sError, nType)
|
||||
'If Not String.IsNullOrEmpty(sError) And nType > 0 Then
|
||||
' 'Proc.Kill()
|
||||
' MessageBox.Show(sError, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
'ElseIf Not String.IsNullOrEmpty(sError) And nType < 0 Then
|
||||
' 'Proc.Kill()
|
||||
' MessageBox.Show(sError, EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Copy
|
||||
@@ -1463,6 +1494,7 @@ Public Class ProjectManagerVM
|
||||
' aggiungo il nome del file alla lista degli assemblati
|
||||
Dim Local_AssemblyName As New AssemblyName
|
||||
Local_AssemblyName.Name = SaveFileDialog.FileName
|
||||
Local_AssemblyName.GraphicName = Path.GetFileNameWithoutExtension(SaveFileDialog.FileName)
|
||||
LocalCurrProject.AssemblyList.Add(Local_AssemblyName)
|
||||
|
||||
' devo creare tutto l'assemblato (comando GoBack nel CompoPanel)
|
||||
@@ -1703,6 +1735,7 @@ Public Class ProjectManagerVM
|
||||
ErrorMessages = String.Empty
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
+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
|
||||
|
||||
@@ -173,10 +173,15 @@ Public Class InstrumentPanelVM
|
||||
Private m_DimensioningLayer As Integer
|
||||
Public Sub LinearDimension(ByVal param As Object)
|
||||
GetDistIsChecked = False
|
||||
EgtSetCurrPartLayer(EgtGetFirstPart(), m_DimensioningLayer)
|
||||
If EgtSetCurrPartLayer(1, m_DimensioningLayer) Then
|
||||
|
||||
Dim nIndFirstPart As Integer = EgtGetFirstPart()
|
||||
m_DimensioningLayer = EgtGetFirstNameInGroup(nIndFirstPart, "AUX")
|
||||
If Not EgtSetCurrPartLayer(nIndFirstPart, m_DimensioningLayer) Then
|
||||
Map.refSceneManagerVM.GetController.ExecuteCommand(Controller.CMD.NEWPART)
|
||||
Map.refSceneManagerVM.GetController.ExecuteCommand(Controller.CMD.NEWLAYER)
|
||||
nIndFirstPart = EgtGetFirstPart()
|
||||
m_DimensioningLayer = EgtGetCurrLayer()
|
||||
EgtSetCurrPartLayer(1, m_DimensioningLayer)
|
||||
'EgtSetColor(m_DimensioningLayer, "BLACK")
|
||||
End If
|
||||
' blocco la pagina corrente
|
||||
|
||||
@@ -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()
|
||||
@@ -453,6 +454,7 @@ Public Class SceneManagerVM
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedPoint(ByVal sender As Object, ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer) Handles m_ProjectScene.OnMouseSelectedPoint
|
||||
EgtSetCurrentContext(Map.refSceneManagerVM.ProjectScene.GetCtx())
|
||||
Dim bDone As Boolean = (Keyboard.Modifiers And ModifierKeys.Control) <> ModifierKeys.Control
|
||||
m_Controller.MouseSelectedPoint(PtP, nSep, nId, bDone)
|
||||
End Sub
|
||||
|
||||
+52
-11
@@ -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
|
||||
@@ -40,14 +43,14 @@ Public Module Utility
|
||||
Dim sLockFile As String = GenerateLockFileName(CurrDirectory, CurrFile)
|
||||
Dim bIsLocked As Boolean = False
|
||||
Dim FileList As String() = Directory.GetFiles(CurrDirectory)
|
||||
|
||||
|
||||
' recurpero il nome del primo file bloccato nel direttorio corrente (se non è specificato un file)
|
||||
If String.IsNullOrEmpty(CurrFile) then
|
||||
Try
|
||||
If String.IsNullOrEmpty(CurrFile) Then
|
||||
Try
|
||||
sLockFile = FileList.First(Function(x) x.EndsWith(LCK_EXTENSION))
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
If File.Exists(sLockFile) Then
|
||||
Try
|
||||
@@ -101,9 +104,9 @@ Public Module Utility
|
||||
m_CurrLockFile = GenerateLockFileName(CurrDirectory, CurrFile)
|
||||
m_StopSaving = False
|
||||
'If VerifyFileLocked(CurrDirectory, CurrFile) Then Return False
|
||||
If Not IsNothing(Map.refMainWindowVM.AssemblyManagerControl) then
|
||||
If Not IsNothing(Map.refMainWindowVM.AssemblyManagerControl) Then
|
||||
Map.refMainWindowVM.AssemblyManagerControl.Visibility = Visibility.Visible
|
||||
End If
|
||||
End If
|
||||
Try
|
||||
Dim NomeUtente As String = Environment.MachineName & "/" & Environment.UserName
|
||||
File.WriteAllText(m_CurrLockFile, NomeUtente, New System.Text.UTF8Encoding(False))
|
||||
@@ -355,6 +358,22 @@ Public Module Utility
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function DirectInchesToMm(ByRef sMeasure As String) As Boolean
|
||||
Dim dVal As Double = 0.0
|
||||
If Not StringToDouble(sMeasure, dVal) Then Return False
|
||||
dVal = dVal * ONEINCH
|
||||
sMeasure = DoubleToString(dVal, 3)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function DirectMmToInches(ByRef sMeasure As String) As Boolean
|
||||
Dim dVal As Double = 0.0
|
||||
If Not StringToDouble(sMeasure, dVal) Then Return False
|
||||
dVal = dVal / ONEINCH
|
||||
sMeasure = DoubleToString(dVal, 4)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function ConvertCurrentUnitMeasure(ByRef sMeasure As String) As Boolean
|
||||
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
|
||||
' non eseguo nessun tipo di conversione
|
||||
@@ -385,10 +404,10 @@ Public Module Utility
|
||||
' conevrsione in lettura dei valori delle textbox nel DoorCreator/HardwareManager
|
||||
Friend Function ConvertCompoConfig(ByRef sItems As String, ByRef dControlValue As Double) As Boolean
|
||||
Dim dDefaultValue As Double = 0
|
||||
If sItems.Contains("$") then
|
||||
If sItems.Contains("$") Then
|
||||
sItems = "$"
|
||||
Return true
|
||||
end
|
||||
Return True
|
||||
End
|
||||
End If
|
||||
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES And Not OptionModule.m_IsMM Then
|
||||
' Concordi = Inches
|
||||
@@ -450,6 +469,28 @@ Public Module Utility
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function ConvertDDFValueIntoCurrentUnit(sCurrUnitDDF As String, ByRef sValue As String) As Boolean
|
||||
Dim bCurrUnitDDFIsMM As Boolean = ConvertStringToMmUnits(sCurrUnitDDF)
|
||||
Dim dDefaultValue As Double = 0
|
||||
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES And Not bCurrUnitDDFIsMM Then
|
||||
' non eseguo cenversione: Concordi = Inches
|
||||
Return True
|
||||
ElseIf OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES And bCurrUnitDDFIsMM Then
|
||||
' eseguo conversione: Discordi= MM → Inches
|
||||
DirectMmToInches(sValue)
|
||||
'InchesToMm(sValue)
|
||||
Return True
|
||||
ElseIf OptionModule.m_SelectedMeasureUnit = ConstGen.MM And Not bCurrUnitDDFIsMM Then
|
||||
' eseguo conversione: Discordi= Inches → MM
|
||||
DirectInchesToMm(sValue)
|
||||
Return True
|
||||
ElseIf OptionModule.m_SelectedMeasureUnit = ConstGen.MM And bCurrUnitDDFIsMM Then
|
||||
' non eseguo cenversione: Concordi = MM
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' Converte il valore Boolean in una stringa ON/OFF (attributo machining)
|
||||
Friend Function ConvertBooleanToOnOff(bValue As Boolean) As String
|
||||
Return If(bValue, DDF_ON, DDF_OFF)
|
||||
@@ -465,9 +506,9 @@ Public Module Utility
|
||||
End Function
|
||||
|
||||
Friend Function ConvertStringToMmUnits(sUnit As String) As Boolean
|
||||
If Trim(sUnit) = ConstGen.MM Then
|
||||
If Trim(sUnit).ToLower = ConstGen.MM.ToLower Then
|
||||
Return True
|
||||
ElseIf Trim(sUnit) = ConstGen.VAL_INCHES Then
|
||||
ElseIf Trim(sUnit).ToLower = ConstGen.VAL_INCHES.ToLower Then
|
||||
Return False
|
||||
Else
|
||||
Return OptionModule.m_bIsMmUnit
|
||||
|
||||
Reference in New Issue
Block a user