Compare commits
86 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1aa30cb695 | |||
| 30497d3ee6 | |||
| 0f8a2634bd | |||
| ef0dc65d9d | |||
| f968341f72 | |||
| beea154999 | |||
| eaf753646a | |||
| d73000bdd7 | |||
| 5aa4d596d8 | |||
| ba2ce76713 | |||
| c66589b38d | |||
| 74b72e774e | |||
| 9e07561399 | |||
| 42ba2f7015 | |||
| 2ed0c9e337 | |||
| 382719af6b | |||
| 25b205f21d | |||
| 47487bfe2f | |||
| 1a6a4ff228 | |||
| aeba705637 | |||
| 70737f3ad1 | |||
| 28ac231cba | |||
| 201792b9cc | |||
| f7ccde68f4 | |||
| d9f56bccf3 | |||
| 328d333e16 | |||
| 306798a7d5 | |||
| 52461712a8 | |||
| d4d4e3a9d7 | |||
| 4525c6d780 | |||
| a814b83e87 | |||
| 316374761d | |||
| a53f9ff352 | |||
| 5d32bb9ddf | |||
| 8006b66a01 | |||
| a97f84f49b | |||
| 98a16e0828 | |||
| e4390636fe | |||
| faa6bd2b8c | |||
| dd8be77fb5 | |||
| 301ec52bf3 | |||
| ee5a14a8f8 | |||
| dbc2b88e51 | |||
| 11a270febf | |||
| 03f8312a3d | |||
| 61310b1579 | |||
| ac9f8354cc | |||
| 1d65a311f3 | |||
| 3fb5e636bf | |||
| 621bd11b3d | |||
| 22941facd2 | |||
| 90a898f25a | |||
| 062c19ff6f | |||
| ef29a33418 | |||
| ab097ff0f0 | |||
| 68ccdd17bd | |||
| 41f5c23479 | |||
| 04d76a6f62 | |||
| 72cfd8ff7d | |||
| 8284811a4b | |||
| 4143ea0389 | |||
| a4202d0be1 | |||
| 2730d1ad32 | |||
| a6492ac6e1 | |||
| 1fb0c4bd09 | |||
| 5f71f7dfa3 | |||
| 86b2e011e0 | |||
| b16d860805 | |||
| 774c64678f | |||
| 34472efbc2 | |||
| 6ddc0f305b | |||
| 9edda7ead3 | |||
| a6890f804a | |||
| 9b89b68684 | |||
| bdc22318dc | |||
| 0c1e267540 | |||
| afe4769bf0 | |||
| da9c0416c5 | |||
| 9dc427da4d | |||
| fe403db43a | |||
| ac48e9c706 | |||
| e4c76f8d88 | |||
| 0a59263410 | |||
| f507d0be44 | |||
| d2c87c76b5 | |||
| 1c1ef08caf |
@@ -1,7 +1,7 @@
|
||||
<Window x:Class="AboutBoxV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="AboutBox" Height="320" Width="300" WindowStyle="None" ResizeMode="NoResize"
|
||||
Title="AboutBox" Height="400" Width="360" WindowStyle="None" ResizeMode="NoResize"
|
||||
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Border BorderThickness="2" BorderBrush="LightBlue">
|
||||
@@ -18,11 +18,10 @@
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="2.5*"/>
|
||||
<RowDefinition Height="0.35*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="0.35*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Column="1" Grid.Row="1">
|
||||
@@ -39,13 +38,11 @@
|
||||
VerticalAlignment="Center" FontSize="18" />
|
||||
<TextBlock Name="VersionLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="18"/>
|
||||
<TextBlock Name="KeyLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="18"/>
|
||||
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Center"
|
||||
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="12" />
|
||||
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="7" HorizontalAlignment="Stretch"
|
||||
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="true" TextWrapping="Wrap"/>
|
||||
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="9" IsCancel="True"
|
||||
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="8" IsCancel="True"
|
||||
Margin="1,0"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -9,17 +9,49 @@ Public Class AboutBoxV
|
||||
"." & My.Application.Info.Version.Minor.ToString() &
|
||||
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
|
||||
My.Application.Info.Version.Revision.ToString()
|
||||
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
|
||||
Dim sInfo As String = String.Empty
|
||||
Dim sKey As String = String.Empty
|
||||
EgtGetKeyInfo(sKey)
|
||||
Dim sKlev As String = IniFile.m_nKeyLevel.ToString()
|
||||
Dim sOpts As String = IniFile.m_nKeyOptions.ToString()
|
||||
KeyLbl.Text = sKey & " - " & sKlev & " - " & sOpts
|
||||
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
|
||||
Dim sInfo As String = "DataRoot " & IniFile.m_sDataRoot & vbCrLf
|
||||
Dim sLeftDays As String = ""
|
||||
Dim nLeftDays As Integer
|
||||
if EgtGetKeyLeftDays( nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays= " (" & nLeftDays.ToString() & ")"
|
||||
Dim sAssStatus As String = " discontinued"
|
||||
Dim nAssLeftDays As Integer
|
||||
If EgtGetKeyAssLeftDays( nAssLeftDays) And nAssLeftDays >= 0 Then
|
||||
If nAssLeftDays > 30 then
|
||||
sAssStatus = "expires within " & nAssLeftDays.ToString() & " days"
|
||||
Else If nAssLeftDays > 0 then
|
||||
sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
|
||||
Else
|
||||
sAssStatus = "to be renewed by today"
|
||||
End If
|
||||
End If
|
||||
sInfo = If( EgtIsDebug(), "*** Debug Libraries ***" & vbCrLf, "")
|
||||
sInfo &= "User " & Environment.MachineName & "\" & Environment.UserName &
|
||||
" Inst" & Map.refMainWindowVM.Instance().ToString() &
|
||||
" Ulv" & IniFile.m_nUserLevel.ToString() & " Dbg" & IniFile.m_nDebug.ToString() & vbCrLf
|
||||
sInfo &= sKey & " - " & sKlev & " - " & sOpts & vbCrLf
|
||||
sInfo &= "SupportPlane " & sAssStatus & vbCrLf
|
||||
sInfo &= "DataRoot " & IniFile.m_sDataRoot & vbCrLf
|
||||
sInfo &= "Doors " & IniFile.m_sDoorsDirPath & vbCrLf
|
||||
If OptionModule.m_MaterialList.Count = 1 Then
|
||||
sInfo &= "Material " & OptionModule.m_MaterialList(0).Name
|
||||
sInfo &= "Material " & OptionModule.m_MaterialList(0).Name & vbCrLf
|
||||
End If
|
||||
Dim sOpSys As String = String.Empty
|
||||
EgtGetOsInfo( sOpSys)
|
||||
sInfo &= sOpSys & Environment.NewLine
|
||||
Dim sCPU As String = String.Empty
|
||||
EgtGetCpuInfo( sCPU)
|
||||
sInfo &= sCPU & Environment.NewLine
|
||||
Dim sMem As String = String.Empty
|
||||
EgtGetMemoryInfo( sMem)
|
||||
sInfo &= sMem & Environment.NewLine
|
||||
Dim sScene As String = String.Empty
|
||||
EgtGetSceneInfo(sScene)
|
||||
sInfo &= sScene
|
||||
InfoLbl.Text = sInfo
|
||||
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
|
||||
End Sub
|
||||
|
||||
+8
-3
@@ -9,10 +9,15 @@ Class Application
|
||||
MyBase.OnStartup(e)
|
||||
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
|
||||
' Creo la View principale
|
||||
Me.MainWindow = New MainWindowV
|
||||
Me.MainWindow = New MainWindowV(e.Args)
|
||||
System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(Me.MainWindow)
|
||||
' Mostro la View principale
|
||||
Me.MainWindow.Show()
|
||||
If OptionModule.AdjustDDT Then
|
||||
Me.MainWindow.Hide()
|
||||
Else
|
||||
Me.MainWindow.Show()
|
||||
End If
|
||||
'' Mostro la View principale
|
||||
'Me.MainWindow.Show()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
+45
-13
@@ -1045,7 +1045,15 @@ Public Class Assembly
|
||||
End Enum
|
||||
|
||||
' carico il valore finale restituito dalla lettura dell'assembalto (di default errore)
|
||||
Public bOk As ResultReadingAssembInfo = ResultReadingAssembInfo.ErrorInAssembInfo
|
||||
Private m_bOk As ResultReadingAssembInfo = ResultReadingAssembInfo.ErrorInAssembInfo
|
||||
Public Property bOk As ResultReadingAssembInfo
|
||||
Get
|
||||
Return m_bOk
|
||||
End Get
|
||||
Set(value As ResultReadingAssembInfo)
|
||||
m_bOk = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' vettore di righe del file ddf in lettura
|
||||
Private FileContent() As String
|
||||
@@ -1058,6 +1066,8 @@ Public Class Assembly
|
||||
If Not File.Exists(sPathDDF) Then
|
||||
Return
|
||||
End If
|
||||
' verifico se il file è un template
|
||||
Dim bIsTemplate As Boolean = (Path.GetExtension(sPathDDF).ToLower = ".ddt")
|
||||
ReadAssembly.FileContent = File.ReadAllLines(sPathDDF)
|
||||
' se il file esiste ma è vuoto
|
||||
If ReadAssembly.FileContent.Count = 0 Then
|
||||
@@ -1080,7 +1090,7 @@ Public Class Assembly
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
Else
|
||||
Map.refSceneManagerVM.EnableRefresh = False
|
||||
If ReadAssembly.GetDDFDoor(IndexLine, sErrorInfo) = -1 Then
|
||||
If ReadAssembly.GetDDFDoor(IndexLine, sErrorInfo, bIsTemplate) = -1 Then
|
||||
' errore nella lettura di un part: blocco tutto
|
||||
ReadAssembly = Nothing
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = False
|
||||
@@ -1468,10 +1478,11 @@ Public Class Assembly
|
||||
End Function
|
||||
|
||||
' dopo la lettura delle informazioni dell'assemblato
|
||||
Private Function GetDDFDoor(IndexLine As Integer, ByRef sErrorInfo As String) As Integer
|
||||
Private Function GetDDFDoor(IndexLine As Integer, ByRef sErrorInfo As String, Optional ByVal bIsTemplate As Boolean = False) As Integer
|
||||
Dim Line As Integer = IndexLine
|
||||
While Line < FileContent.Count - 1 AndAlso Not Search3Dots(FileContent(Line))
|
||||
Dim Local_PartDoor As New PartDoor
|
||||
Local_PartDoor.IsTemplate = bIsTemplate
|
||||
Dim Local_Door As New Part(Local_PartDoor)
|
||||
' carcio la liste delle propiretà
|
||||
'CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial)
|
||||
@@ -1494,7 +1505,13 @@ Public Class Assembly
|
||||
sDoorPiece = sDoorPiece.Remove(sDoorPiece.LastIndexOf("_"c) + 1)
|
||||
End If
|
||||
Map.refCompoPanelVM.GoBackVisibility = Visibility.Visible
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
|
||||
' verifico che la lettura dell'assemblato sia andato a buon fine
|
||||
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.MissingAssembInfo Then
|
||||
' forzo l'apertura della pagina DOOR
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
|
||||
Else
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
|
||||
End If
|
||||
Else
|
||||
' significa che stiamo per leggere una porta singola, cerco una porta
|
||||
If Not Local_Door.TypePart.Contains("DO_") Then
|
||||
@@ -1723,7 +1740,7 @@ Public Class Assembly
|
||||
' controllo degli oggetti caricati nell'assemblato
|
||||
Private Function ControlAssemblyInformation() As Boolean
|
||||
Dim ErrorMessages As String = String.Empty
|
||||
Select Case bOk
|
||||
Select Case m_bOk
|
||||
Case ResultReadingAssembInfo.CorrectAssembInfo
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
|
||||
' 50520=The current ddf is an assembly
|
||||
@@ -1777,9 +1794,9 @@ Public Class Assembly
|
||||
Public Function ControlAssembly(Optional ByVal bSaving As Boolean = False) As String
|
||||
' se è una porta singola oppure le info generali non sono state caricate correttamente non controllo l'assemblato
|
||||
If bSaving Then
|
||||
If bOk <> ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
|
||||
If m_bOk <> ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
|
||||
Else
|
||||
If bOk = ResultReadingAssembInfo.ErrorInAssembInfo OrElse bOk = ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
|
||||
If m_bOk = ResultReadingAssembInfo.ErrorInAssembInfo OrElse m_bOk = ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
|
||||
End If
|
||||
Dim WritingError As String = String.Empty
|
||||
Dim DoorTypeList As String = String.Empty
|
||||
@@ -2028,7 +2045,7 @@ Public Class Assembly
|
||||
|
||||
' cerco il nome della componente da associare FrameFile
|
||||
Dim CurrDoorHArdwareFile As String = CurrCompo.CompoType.Path & "\" & CurrCompo.TemplateSelItem
|
||||
If Path.GetExtension(CurrDoorHArdwareFile) <> NGE_EXTENSION Then
|
||||
If Path.GetExtension(CurrDoorHArdwareFile).ToLower <> NGE_EXTENSION Then
|
||||
CurrDoorHArdwareFile &= LUA_EXTENSION
|
||||
End If
|
||||
' cerco il campo [Match file] nel file lua della componente
|
||||
@@ -2180,7 +2197,7 @@ Public Class Assembly
|
||||
|
||||
' cerco il nome della componente da associare FrameFile
|
||||
Dim CurrDoorHArdwareFile As String = CurrCompo.CompoType.Path & "\" & CurrCompo.TemplateSelItem
|
||||
If Path.GetExtension(CurrDoorHArdwareFile) <> NGE_EXTENSION Then
|
||||
If Path.GetExtension(CurrDoorHArdwareFile).ToLower <> NGE_EXTENSION Then
|
||||
CurrDoorHArdwareFile &= LUA_EXTENSION
|
||||
End If
|
||||
' cerco il campo [Match file] nel file lua della componente
|
||||
@@ -2495,6 +2512,7 @@ Public Class Assembly
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
|
||||
Case "Height"
|
||||
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
|
||||
HeightJamb()
|
||||
HeightDoor()
|
||||
TopRabbetJamb()
|
||||
@@ -2504,6 +2522,7 @@ Public Class Assembly
|
||||
UpDateAllCompo()
|
||||
|
||||
Case "Width"
|
||||
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
|
||||
TopBottomWidth()
|
||||
TopRabbetJamb()
|
||||
BottomRabbetJamb()
|
||||
@@ -2512,10 +2531,12 @@ Public Class Assembly
|
||||
UpDateAllCompo()
|
||||
|
||||
Case "Thickness"
|
||||
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
|
||||
TopRabbetJamb()
|
||||
UpDateAllCompo()
|
||||
|
||||
Case "Swing"
|
||||
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
|
||||
UpDateCompolistOnJamb()
|
||||
SwingJamb()
|
||||
SetPartDoorCurrAssembly()
|
||||
@@ -2523,6 +2544,7 @@ Public Class Assembly
|
||||
'UpDateAllCompo()
|
||||
|
||||
Case "DoorNumber"
|
||||
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
|
||||
ClearRefOnAssembly()
|
||||
SetPartDoorCurrAssembly()
|
||||
ReverseDoor()
|
||||
@@ -3588,9 +3610,14 @@ Public Class Assembly
|
||||
If Not bRabbet Then
|
||||
'Map.refPartPageVM.CurrPart = Jamb
|
||||
CurrCompo = Jamb.AddNewCompo(Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel), True)
|
||||
DirectCast(CurrCompo.CompoParamList(0), ComboBoxParam).SelItem = DirectCast(CurrCompo.CompoParamList(0), ComboBoxParam).ItemList(0)
|
||||
If Not IsNothing(CurrCompo) Then
|
||||
DirectCast(CurrCompo.CompoParamList(0), ComboBoxParam).SelItem = DirectCast(CurrCompo.CompoParamList(0), ComboBoxParam).ItemList(0)
|
||||
Else
|
||||
' 50180=Warning : {0} does not exist.
|
||||
MessageBox.Show(String.Format(EgtMsg(50180), Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel).Name & ".frame"), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
Else
|
||||
CurrCompo = Jamb.CompoList(IndexCompo)
|
||||
CurrCompo = Jamb.CompoList(IndexCompo)
|
||||
End If
|
||||
' mofico la componete rabbet
|
||||
If Not IsNothing(CurrCompo) Then
|
||||
@@ -3729,9 +3756,14 @@ Public Class Assembly
|
||||
If Not bRabbet Then
|
||||
' lo aggiungo
|
||||
Local_Compo = Jamb.AddNewCompo(Map.refCompoPanelVM.CompoTypeList(CompoListIndex), True)
|
||||
DirectCast(Local_Compo.CompoParamList(0), ComboBoxParam).SetSelItem(DirectCast(Local_Compo.CompoParamList(0), ComboBoxParam).ItemList(nIndexSide))
|
||||
If Not IsNothing(Local_Compo) Then
|
||||
DirectCast(Local_Compo.CompoParamList(0), ComboBoxParam).SetSelItem(DirectCast(Local_Compo.CompoParamList(0), ComboBoxParam).ItemList(nIndexSide))
|
||||
Else
|
||||
' 50180=Warning : {0} does not exist.
|
||||
MessageBox.Show(String.Format(EgtMsg(50180), Map.refCompoPanelVM.CompoTypeList(CompoListIndex).Name & ".frame"), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
Else
|
||||
Local_Compo = Jamb.CompoList(IndexCompo)
|
||||
Local_Compo = Jamb.CompoList(IndexCompo)
|
||||
End If
|
||||
If Not IsNothing(Local_Compo) Then
|
||||
Dim dVal1 As Double = 0
|
||||
|
||||
@@ -7,6 +7,16 @@ Imports EgtWPFLib5
|
||||
Public Class PartDoor
|
||||
Inherits VMBase
|
||||
|
||||
Private m_IsTemplate As Boolean = False
|
||||
Public Property IsTemplate As Boolean
|
||||
Get
|
||||
Return m_IsTemplate
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsTemplate = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Door As Part
|
||||
Public Property Door As Part
|
||||
Get
|
||||
|
||||
@@ -21,7 +21,7 @@ Public Class AssemblyManagerVM
|
||||
Private m_VisibilityDoorList As Visibility = Visibility.Collapsed
|
||||
Public Property VisibilityDoorList As Visibility
|
||||
Get
|
||||
Return m_VisibilityDoorList
|
||||
Return m_VisibilityDoorList
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_VisibilityDoorList = value
|
||||
@@ -81,7 +81,9 @@ Public Class AssemblyManagerVM
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
|
||||
' ricarico la lista completa degli swing
|
||||
NewAssName.SelAssembly.ListPartDoor(0).Door.SwingTypeList = OptionModule.m_SwingTypeList
|
||||
NewAssName.SelAssembly.ListPartDoor(0).Door.SetSwing(OptionModule.m_Swing)
|
||||
If String.IsNullOrEmpty(NewAssName.SelAssembly.ListPartDoor(0).Door.Swing) Then
|
||||
NewAssName.SelAssembly.ListPartDoor(0).Door.SetSwing(OptionModule.m_Swing)
|
||||
End If
|
||||
DdfFile.WriteDDFPart(NewAssName.SelAssembly.ListPartDoor(0).Door, sTempFile, False, False)
|
||||
' assegno la porte salvata nel CurrPart.ddf come porta corrente del progetto
|
||||
Map.refPartPageVM.CurrPart = NewAssName.SelAssembly.ListPartDoor(0).Door
|
||||
@@ -129,35 +131,68 @@ Public Class AssemblyManagerVM
|
||||
' 50540 = The current ddf is a part of a frame, do you want to save?
|
||||
If MessageBox.Show(EgtMsg(50540), EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
|
||||
DdfFile.SaveErrorCompo = True
|
||||
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, True, False)
|
||||
Dim _IsDDF As Boolean = IsCurrentFileDDF(SavedAssName.Name)
|
||||
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, _IsDDF, False)
|
||||
DdfFile.SaveErrorCompo = False
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
DdfFile.SaveErrorCompo = True
|
||||
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, True, False)
|
||||
Dim _IsDDF As Boolean = IsCurrentFileDDF(SavedAssName.Name)
|
||||
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, _IsDDF, False)
|
||||
DdfFile.SaveErrorCompo = False
|
||||
End If
|
||||
Else
|
||||
' se il ddf che sto leggendo è composto dal al massimo due parti significa che c'è un errore
|
||||
' Se il ddf che sto leggendo è composto dal al massimo due parti significa che c'è un errore
|
||||
If SavedAssName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.CorrectAssembInfo AndAlso
|
||||
SavedAssName.SelAssembly.ListPartDoor.Count < 3 Then
|
||||
' se sto salvando meno di tre componenti significa che mancano qualche pezzo per essere un assemblato
|
||||
' Se sto salvando meno di tre componenti significa che mancano qualche pezzo per essere un assemblato
|
||||
SavedAssName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.MissingAssembInfo
|
||||
End If
|
||||
Dim ErrorMessage As String = SavedAssName.SelAssembly.ControlAssembly(True)
|
||||
Dim m_MessageBoxResult As MessageBoxResult = MessageBoxResult.Cancel
|
||||
If Not String.IsNullOrEmpty(ErrorMessage) Then
|
||||
If Not MessageBox.Show(ErrorMessage, EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
|
||||
Return False
|
||||
' Richiedo di scegliere se salvare come porta singola oppure come assemblato (altrimenti annullo il salvataggio)
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_SAVEASSINGLEDOOR, 0) <> 0 Then
|
||||
' 50732=Save as Assembly (YES), Single door (NO).
|
||||
m_MessageBoxResult = MessageBox.Show(EgtMsg(50732), EgtMsg(50144), MessageBoxButton.YesNoCancel, MessageBoxImage.Warning, MessageBoxResult.No)
|
||||
If m_MessageBoxResult = MessageBoxResult.Cancel Then
|
||||
' interrompo il salvataggio
|
||||
Return False
|
||||
End If
|
||||
If m_MessageBoxResult = MessageBoxResult.Yes Then
|
||||
' Procedo a sovrascrivere il file come ASSEMBALTO
|
||||
DdfFile.SaveErrorCompo = True
|
||||
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
|
||||
DdfFile.SaveErrorCompo = False
|
||||
ElseIf m_MessageBoxResult = MessageBoxResult.No Then
|
||||
' Procedo a sovrascrivere il file come SINGLE DOOR
|
||||
DdfFile.SaveErrorCompo = True
|
||||
Dim _IsDDF As Boolean = IsCurrentFileDDF(SavedAssName.Name)
|
||||
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, _IsDDF, False)
|
||||
DdfFile.SaveErrorCompo = False
|
||||
End If
|
||||
Else
|
||||
' Avviso che sto per salvare una porta singola come assemblato (altrimenti annullo il salvataggio)
|
||||
If Not MessageBox.Show(ErrorMessage, EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
|
||||
Return False
|
||||
End If
|
||||
' Procedo a sovrascrivere il file
|
||||
DdfFile.SaveErrorCompo = True
|
||||
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
|
||||
DdfFile.SaveErrorCompo = False
|
||||
End If
|
||||
Else
|
||||
' Non ci sono errori: procedo a sovrascrivere il file
|
||||
DdfFile.SaveErrorCompo = True
|
||||
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
|
||||
DdfFile.SaveErrorCompo = False
|
||||
End If
|
||||
DdfFile.SaveErrorCompo = True
|
||||
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
|
||||
DdfFile.SaveErrorCompo = False
|
||||
|
||||
End If
|
||||
' controllo che il salvataggio sia andato a buon fine
|
||||
|
||||
|
||||
If bConfirmSavin Then
|
||||
SavedAssName.IsModified = False
|
||||
' ogni progetto salvato è l'ultimo da aprire, anche se il programma è chiuso dall'HardwareManager
|
||||
@@ -321,31 +356,30 @@ Public Class AssemblyManagerVM
|
||||
End Select
|
||||
Map.refMainWindowVM.selectedWatcher = MainWindowVM.WatcherCalling.NoEvents
|
||||
' se sono in modalità hardware allora esco senza caricare l'elenco delle porte
|
||||
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage then Return true
|
||||
'-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage Then Return True
|
||||
'-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
' devo ricalcolare l'elenco delle porte nel progetto corrente:
|
||||
If OptionModule.m_SingleDoor then Return True
|
||||
If OptionModule.m_SingleDoor Then Return True
|
||||
' calcolo l'elenco delle porte solo dopo il salvataggio della porta corrente
|
||||
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified then Return true
|
||||
If Not IsNothing( Map.refAssemblyManagerVM.CurrProject) andAlso Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.Name) then
|
||||
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then Return True
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.Name) Then
|
||||
Dim CurrAssemblyName As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
Map.refAssemblyManagerVM.CurrProject.AssemblyList = New ObservableCollection(Of AssemblyName)
|
||||
Dim DDFArray()as String = Directory.GetFiles(Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
For IndexFile As Integer = 0 to DDFArray.Count - 1
|
||||
If Path.GetExtension(DDFArray(IndexFile)) <> DDF_EXTENSION then
|
||||
Continue For
|
||||
Dim DDFArray() As String = Directory.GetFiles(Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
For IndexFile As Integer = 0 To DDFArray.Count - 1
|
||||
If Path.GetExtension(DDFArray(IndexFile)).ToLower = DDF_EXTENSION Then
|
||||
Dim NewAssembly As New AssemblyName
|
||||
NewAssembly.Name = DDFArray(IndexFile)
|
||||
NewAssembly.IsModified = False
|
||||
Map.refAssemblyManagerVM.CurrProject.AssemblyList.Add(NewAssembly)
|
||||
End If
|
||||
Dim NewAssembly As New AssemblyName
|
||||
NewAssembly.Name = DDFArray(IndexFile)
|
||||
NewAssembly.IsModified = False
|
||||
Map.refAssemblyManagerVM.CurrProject.AssemblyList.Add(NewAssembly)
|
||||
Next
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) then
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
Try
|
||||
'Map.refAssemblyManagerVM.CurrProject = LocalCurrProject
|
||||
'LocalCurrProject.SelAssemblyName = LocalCurrProject.AssemblyList.First(Function(x) x.Name = Local_AssemblyName.Name)
|
||||
Map.refAssemblyManagerVM.CurrProject = Map.refAssemblyManagerVM.CurrProject
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.AssemblyList.First(Function(x) x.Name = CurrAssemblyName)
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.AssemblyList.First(Function(x) x.Name = CurrAssemblyName)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Aggiornamento Progetto Corrente: impossibile caricare ultima porta")
|
||||
End Try
|
||||
@@ -372,8 +406,8 @@ Public Class AssemblyManagerVM
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' ricerca il tipo di compoente chiamato
|
||||
@@ -446,7 +480,7 @@ Public Class AssemblyManagerVM
|
||||
If Not bBrandExists OrElse Not bFileExists Then
|
||||
'' se la compoenente che sto caricando era corretta
|
||||
'ErrCompo.LoadByDefault = True
|
||||
' se il brand non esiste, ma è selezionato
|
||||
' se il brand non esiste, ma è selezionato
|
||||
If Not bBrandExists Then
|
||||
ErrCompo.MissingDirectory = True
|
||||
ErrCompo.MissingFile = True
|
||||
@@ -752,6 +786,30 @@ Public Class AssemblyManagerVM
|
||||
NewList(IndexParam).ErrorInReading = True
|
||||
End If
|
||||
|
||||
ElseIf TypeOf OldList(IndexParam) Is ComboBoxOnOffParam Then
|
||||
Dim OldParam As ComboBoxOnOffParam = DirectCast(OldList(IndexParam), ComboBoxOnOffParam)
|
||||
Dim NewParam As ComboBoxOnOffParam = DirectCast(NewList(IndexParam), ComboBoxOnOffParam)
|
||||
|
||||
If OldParam.ItemList.Count > OldParam.ItemListDDF.Count Then
|
||||
NewParam.ItemList.Add(OldParam.ItemList.Last)
|
||||
NewParam.SetSelItem(NewParam.ItemList.Last)
|
||||
NewList(IndexParam).ErrorInReading = True
|
||||
End If
|
||||
Dim IndexItem As Integer = -1
|
||||
For IndexItem = 0 To OldParam.ItemListDDF.Count - 1
|
||||
If OldParam.SelItem = OldParam.ItemList(IndexItem) Then
|
||||
NewList(IndexParam).ErrorInReading = False
|
||||
NewParam.MissingParameterInReading = OldParam.MissingParameterInReading
|
||||
NewParam.SetSelItem(NewParam.ItemList(IndexItem))
|
||||
If OldParam.ItemList.Count > OldParam.ItemListDDF.Count Then
|
||||
OldParam.ItemList.RemoveAt(OldParam.ItemList.Count - 1)
|
||||
NewParam.ItemList.RemoveAt(NewParam.ItemList.Count - 1)
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
NewParam.SetIsActive(OldParam.IsActive)
|
||||
|
||||
ElseIf TypeOf OldList(IndexParam) Is ComboBoxParam Then
|
||||
Dim OldParam As ComboBoxParam = DirectCast(OldList(IndexParam), ComboBoxParam)
|
||||
Dim NewParam As ComboBoxParam = DirectCast(NewList(IndexParam), ComboBoxParam)
|
||||
@@ -774,17 +832,7 @@ Public Class AssemblyManagerVM
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
'ElseIf TypeOf ErrCompo.CompoParamList(IndexParam) Is ComboBoxOnOffParam Then
|
||||
' Dim Param As ComboBoxOnOffParam = DirectCast(ErrCompo.CompoParamList(IndexParam), ComboBoxOnOffParam)
|
||||
' For Each Item In Param.ItemListDDF
|
||||
' If Param.SelItem = Item Then
|
||||
' If Param.ItemList.Count > Param.ItemListDDF.Count Then
|
||||
' Param.ItemList.RemoveAt(Param.ItemList.Count - 1)
|
||||
' End If
|
||||
' Param.ErrorInReading = False
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
@@ -965,6 +1013,15 @@ Public Class AssemblyManagerVM
|
||||
OpenedAssName.IsModified = Part.FirstReadingEdge
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
|
||||
DdfFile.WriteDDFPart(OpenedAssName.SelAssembly.ListPartDoor(0).Door, sTempFile, True, False)
|
||||
If OptionModule.AdjustDDT Then
|
||||
DdfFile.WriteDDFPart(OpenedAssName.SelAssembly.ListPartDoor(0).Door, OptionModule.SaveFileNameFromArgs, True, False)
|
||||
' TERMINO TUTTO SUBITO
|
||||
EgtOutLog("Scrittura file '.ddf' terminata")
|
||||
EgtExit()
|
||||
Map.refMainWindowVM.MainWindowModel.ReleaseInstance()
|
||||
Application.Current.Shutdown(0)
|
||||
Return True
|
||||
End If
|
||||
' aggiorno elenco quotature
|
||||
Map.refDimensioningPanelVM.LoadHardwareDimList()
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False)
|
||||
@@ -990,7 +1047,16 @@ Public Class AssemblyManagerVM
|
||||
If Assembly.Refreshing Then EgtZoom(ZM.ALL)
|
||||
m_CurrProject.SelAssemblyName.SelAssembly.MatchCompo()
|
||||
m_CurrProject.SelAssemblyName.SelAssembly.UpDateAllOrigValue()
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
|
||||
' Se mancano le info per generare l'assemblato accedo direttamente alla prima porta
|
||||
If m_CurrProject.SelAssemblyName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.MissingAssembInfo Then
|
||||
If m_CurrProject.SelAssemblyName.SelAssembly.ListPartDoorOfDoor.Count > 0 Then
|
||||
Map.refAssemblyPageVM.JambBtn(m_CurrProject.SelAssemblyName.SelAssembly.ListPartDoorOfDoor(0).Type)
|
||||
Else
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
|
||||
End If
|
||||
Else
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
|
||||
End If
|
||||
End If
|
||||
' ogni progetto salvato è l'ultimo da aprire, anche se il programma è chiuso dall'HardwareManager
|
||||
' controllo che esiste almeno un file aperto
|
||||
@@ -1058,7 +1124,7 @@ Public Class AssemblyManagerVM
|
||||
|
||||
Public Function ManageModified() As Boolean
|
||||
' verifico se selezionato esiste e modificato
|
||||
If Not IsNothing (m_CurrProject) AndAlso Not IsNothing(m_CurrProject.SelAssemblyName) AndAlso m_CurrProject.SelAssemblyName.IsModified Then
|
||||
If Not IsNothing(m_CurrProject) AndAlso Not IsNothing(m_CurrProject.SelAssemblyName) AndAlso m_CurrProject.SelAssemblyName.IsModified Then
|
||||
Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(m_CurrProject.SelAssemblyName.Name))
|
||||
Select Case MessageBox.Show(sText, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
|
||||
Case MessageBoxResult.Yes
|
||||
@@ -1289,7 +1355,8 @@ Public Class AssemblyManagerVM
|
||||
' creo le Ante
|
||||
For IndexDoor As Integer = 0 To nDoorNumber - 1
|
||||
Dim Type As String = ConstGen.PART_DO_ & IndexDoor + 1
|
||||
If IsNothing(ReserchPartDoor(Type)) Then
|
||||
Dim _PartDoor As PartDoor = ReserchPartDoor(Type)
|
||||
If IsNothing(_PartDoor) Then
|
||||
Dim Local_PartDoor As New PartDoor
|
||||
Local_PartDoor.Door = New Part(Local_PartDoor)
|
||||
Local_PartDoor.Door.TypePart = Type
|
||||
@@ -1299,7 +1366,7 @@ Public Class AssemblyManagerVM
|
||||
'CreateNewPropertiesList(Local_PartDoor.Door.PropertiesList, Local_PartDoor.Door.SelectedMaterial)
|
||||
CurrAssembly.ListPartDoor.Add(Local_PartDoor)
|
||||
Else
|
||||
'CurrAssembly.ListPartDoor.Add(ReserchPartDoor(Type))
|
||||
CurrAssembly.ListPartDoor.Add(_PartDoor)
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -1588,15 +1655,15 @@ Public Class AssemblyManagerVM
|
||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(FilePath, Trim(FilePath))
|
||||
' Controllo se il nome della porta ha estensione
|
||||
If Path.HasExtension(SaveFileDialog.FileName) Then
|
||||
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName)
|
||||
If Not sExtension.ToLower = DDF_EXTENSION Then
|
||||
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName).ToLower
|
||||
If Not sExtension = DDF_EXTENSION Then
|
||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(sExtension, DDF_EXTENSION)
|
||||
End If
|
||||
Else
|
||||
SaveFileDialog.FileName &= DDF_EXTENSION
|
||||
End If
|
||||
' verifico che non sia bloccato (in fase di creazione di una nuova porta posso avere il file .lck senza il ddf)
|
||||
If Utility.IsFileLocked(Path.GetDirectoryName(SaveFileDialog.FileName), Path.GetFileNameWithoutExtension(SaveFileDialog.FileName)) then
|
||||
If Utility.IsFileLocked(Path.GetDirectoryName(SaveFileDialog.FileName), Path.GetFileNameWithoutExtension(SaveFileDialog.FileName)) Then
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
Utility.OutLog("Apertura progetto : " & Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
Utility.LockDir(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName)
|
||||
@@ -1640,7 +1707,7 @@ Public Class AssemblyManagerVM
|
||||
' aggiorno la lista
|
||||
'------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
' LETTURA DI UN FILE DI TIPO TEMPLATE
|
||||
If ImportTemplate(sImportTemplate) Then
|
||||
If ImportTemplate(sImportTemplate) Then
|
||||
Utility.OutLog("Apertura progetto : " & Local_AssemblyName.Name)
|
||||
Utility.LockDir(Path.GetDirectoryName(Local_AssemblyName.Name), Path.GetFileNameWithoutExtension(Local_AssemblyName.Name))
|
||||
' carico il nome come Assemblato selezionato
|
||||
|
||||
@@ -17,6 +17,16 @@ Public Class AssemblyName
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_OrigTemplate As String = String.Empty
|
||||
Public Property OrigTemplate As String
|
||||
Get
|
||||
Return m_OrigTemplate
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_OrigTemplate = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModified As Boolean
|
||||
Public Property IsModified As Boolean
|
||||
Get
|
||||
|
||||
@@ -128,7 +128,7 @@ Public Class CompoPanelVM
|
||||
If CompoPanelList(IndexCompoOrder) = CompoNameDDF Then
|
||||
Dim Local_NewCompoType As CompoType
|
||||
If Not String.IsNullOrEmpty(Image) Then
|
||||
Local_NewCompoType = New CompoType(CompoName, CompoNameDDF, CompoArray(Index), Image, Side, FolderName)
|
||||
Local_NewCompoType = New CompoType(CompoName, CompoNameDDF, CompoArray(Index), Image, Side, FolderName, "wood")
|
||||
Else
|
||||
Local_NewCompoType = New CompoType(CompoName, CompoNameDDF, CompoArray(Index), Side, FolderName)
|
||||
End If
|
||||
@@ -225,6 +225,8 @@ Public Class CompoPanelVM
|
||||
Map.refAssemblyPageVM.CurrAssembly.CreateCompoOnJamb(NewCompo, "")
|
||||
End If
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
' evidenzio componente
|
||||
Map.refPartPageVM.CurrPart.MarkCompoInScena()
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50108), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
End If
|
||||
|
||||
@@ -133,10 +133,9 @@ Public Class CompoType
|
||||
End Sub
|
||||
|
||||
Public Function LoadListTemplate() As Boolean
|
||||
FolderList.Clear()
|
||||
m_HardwareFolderList.Clear()
|
||||
m_FrameFolderList.Clear()
|
||||
m_FolderList.Clear()
|
||||
m_FrameFolderList.Clear()
|
||||
m_HardwareFolderList.Clear()
|
||||
GetDirectoryCompoModel(m_Path, m_FolderList, m_FrameFolderList, m_HardwareFolderList)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -62,6 +62,7 @@ Module ConstCompo
|
||||
Public Const K_DEPTH_BOTTOM As String = "depth bottom"
|
||||
Public Const K_DELTA_BOTTOM As String = "delta bottom"
|
||||
Public Const K_HARDWARE As String = "hardware"
|
||||
Public Const K_OPTIONS As String = "options"
|
||||
|
||||
' Nome, sezioni e chiavi del file Config.ini
|
||||
Public Const CONFIGINI_FILE_NAME As String = "Config.ini"
|
||||
|
||||
@@ -23,6 +23,9 @@ Module ConstGen
|
||||
Public Const LIC_FILE_NAME As String = "EgtDOORCreator.lic"
|
||||
Public Const S_LICENCE As String = "Licence"
|
||||
Public Const K_KEY As String = "Key"
|
||||
Public Const K_NETKEY As String = "NetKey"
|
||||
Public Const K_LOCKID As String = "LockId"
|
||||
Public Const K_NESTKEY As String = "NestKey"
|
||||
|
||||
' File di log generale
|
||||
Public Const GENLOG_FILE_NAME As String = "EgtDOORCreatorLog#.txt"
|
||||
@@ -33,7 +36,9 @@ Module ConstGen
|
||||
Public Const CONF_DIR As String = "Config"
|
||||
' Sottodirettorio delle risorse
|
||||
Public Const RES_DIR As String = "Resources"
|
||||
' Sottodirettorio temporaneo
|
||||
' Sottodirettorio degli scripts lua
|
||||
Public Const SCRIPT_DIR As String = "Scripts"
|
||||
' Sottodirettorio temporaneo
|
||||
Public Const TEMP_DIR As String = "Temp"
|
||||
' Sottodirettorio di default per il salvataggio con nome
|
||||
Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
|
||||
|
||||
@@ -42,6 +42,8 @@ Module ConstIni
|
||||
Public Const K_EGTCAMEXE As String = "EgtCam5Exe"
|
||||
Public Const K_REFRESHTIME As String = "RefreshTime"
|
||||
Public Const K_DDFVERSION As String = "DDFVersion"
|
||||
Public Const K_SAVEASSINGLEDOOR As String = "SaveAsSingleDoor"
|
||||
Public Const K_READONLY As String = "ReadOnly"
|
||||
|
||||
Public Const S_LANGUAGES As String = "Languages"
|
||||
Public Const K_LANGUAGE As String = "Language"
|
||||
@@ -90,7 +92,8 @@ Module ConstIni
|
||||
Public Const K_DDFFUNCTION As String = "DdfFun"
|
||||
Public Const K_MYPROJECTDIR As String = "ProjectDirectory"
|
||||
Public Const K_TEMPLATEDIR As String = "TemplateDirectory"
|
||||
Public Const K_MACHINDIR As String = "MachinDirectory"
|
||||
' Correzione nome Chiave valore ver 2.6k2 "MachineDirectory"
|
||||
Public Const K_MACHINDIR As String = "MachineDirectory"
|
||||
Public Const K_MTABLE As String = "MTable"
|
||||
|
||||
Public Const S_REPORT As String = "Report"
|
||||
@@ -103,6 +106,9 @@ Module ConstIni
|
||||
Public Const K_LAUNCHER As String = "Launcher"
|
||||
Public Const K_LASTPROJECT As String = "LastProject"
|
||||
|
||||
Public Const S_SPECIAL As String = "Special"
|
||||
Public Const K_SPECIALENABLE As String = "SpecialEnable"
|
||||
|
||||
'-------------------------------------------------------------------------
|
||||
Public Const DEFAULT_INI_FILE_NAME As String = "Default.ini"
|
||||
|
||||
|
||||
+124
-9
@@ -63,7 +63,12 @@ Friend Module DdfFile
|
||||
DdfFileContent.Add("#EGTDOORCREATOR")
|
||||
Dim Config As String = IniFile.m_sDoorsDirPath
|
||||
Config = Path.GetFileName(Config)
|
||||
DdfFileContent.Add("#Config: " & Config)
|
||||
' versione 2.7d1: non esiste un sottodirettorio di Doors allora non stampo il nome della configurazione
|
||||
If Config <> "Doors" Then DdfFileContent.Add("#Config: " & Config)
|
||||
' versione 2.6g1: salvo il nome del template da cui è genetato il file corrente
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.OrigTemplate) Then
|
||||
DdfFileContent.Add("#OrigTemplate: " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.OrigTemplate)
|
||||
End If
|
||||
If Not IsNothing(Part.TypePart) Then
|
||||
DdfFileContent.Add("#" & PrintTitleDDFPart(Part.TypePart))
|
||||
End If
|
||||
@@ -526,6 +531,12 @@ Friend Module DdfFile
|
||||
If Not Directory.Exists(Path.GetDirectoryName(sPath)) Then
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(sPath))
|
||||
End If
|
||||
|
||||
If OptionModule.m_sVersionDDF = "2" Then
|
||||
DdfFileContent.Add(ConstCompo.K_OPTIONS & ": ")
|
||||
DdfFileContent.Add(Part.sOptions)
|
||||
End If
|
||||
|
||||
DdfFileContent.Add(" ")
|
||||
DdfFileContent.Add("# End Part")
|
||||
' se sono arrivato fin qui significa che tutto è andato a buon fine (posso quindisalvare il file corrente)
|
||||
@@ -564,6 +575,7 @@ Friend Module DdfFile
|
||||
End If
|
||||
' dal 20/04/2023 inserita gestione della versione (da configurare nel programma)
|
||||
If OptionModule.m_sVersionDDF <> "1" Then
|
||||
DdfFileContent.Add("")
|
||||
DdfFileContent.Add("version: " & OptionModule.m_sVersionDDF)
|
||||
End If
|
||||
DdfFileContent.Add("")
|
||||
@@ -698,7 +710,12 @@ Friend Module DdfFile
|
||||
End If
|
||||
'----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":")
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel))
|
||||
If OptionModule.m_sVersionDDF = "2" Then ' K_TYPE
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LOCKEDGE & ": ")
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel))
|
||||
Else
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel))
|
||||
End If
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining))
|
||||
If Not StringToDouble(Part.LockEdgeOverMaterial, dVal) Then
|
||||
MessageBox.Show(String.Format(EgtMsg(50141), K_LOCKEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
@@ -714,7 +731,12 @@ Friend Module DdfFile
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal)
|
||||
End If
|
||||
End If
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HINGEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
|
||||
If OptionModule.m_sVersionDDF = "2" Then ' K_TYPE
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HINGEEDGE & ": ")
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
|
||||
Else
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HINGEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
|
||||
End If
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.HingeEdgeMachining))
|
||||
If Not StringToDouble(Part.HingeEdgeOverMaterial, dVal) Then
|
||||
MessageBox.Show(String.Format(EgtMsg(50141), K_HINGEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
@@ -730,7 +752,12 @@ Friend Module DdfFile
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal)
|
||||
End If
|
||||
End If
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_TOP & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
|
||||
If OptionModule.m_sVersionDDF = "2" Then ' K_TYPE
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_TOP & ": ")
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
|
||||
Else
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_TOP & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
|
||||
End If
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.TopMachining))
|
||||
If Not StringToDouble(Part.TopOverMaterial, dVal) Then
|
||||
MessageBox.Show(String.Format(EgtMsg(50141), K_TOPOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
@@ -746,7 +773,12 @@ Friend Module DdfFile
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal)
|
||||
End If
|
||||
End If
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
|
||||
If OptionModule.m_sVersionDDF = "2" Then ' K_TYPE
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_BOTTOM & ": ")
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
|
||||
Else
|
||||
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
|
||||
End If
|
||||
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.BottomMachining))
|
||||
If Not StringToDouble(Part.BottomOverMaterial, dVal) Then
|
||||
MessageBox.Show(String.Format(EgtMsg(50141), K_BOTTOMOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
@@ -763,8 +795,9 @@ Friend Module DdfFile
|
||||
End If
|
||||
End If
|
||||
|
||||
DdfFileContent.Add(" ")
|
||||
If OptionModule.m_sVersionDDF = "2" Then
|
||||
DdfFileContent.Add(ConstCompo.K_HARDWARE & "hardware: ")
|
||||
DdfFileContent.Add(ConstCompo.K_HARDWARE & ": ")
|
||||
End If
|
||||
' Riordino e stampo le compo
|
||||
SearchCompo(DdfFileContent, Part, bIsDDF)
|
||||
@@ -953,7 +986,7 @@ Friend Module DdfFile
|
||||
z = DoubleToString(-dDeltaThickness + dDeltaBottom, 4)
|
||||
End If
|
||||
End If
|
||||
Return z
|
||||
Return z
|
||||
End Function
|
||||
|
||||
#End Region ' Funzioni per il posizionamento
|
||||
@@ -1049,10 +1082,32 @@ Friend Module DdfFile
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function AscendingOrder(List As ObservableCollection(Of Compo), DdfFileContent As List(Of String), bIsDDF As Boolean) As Boolean
|
||||
' ritorna una lista con tutti i compo dello stesso tipo
|
||||
Public Function GetCurrentListSameCompoType(ByVal ListCompo As ObservableCollection(Of Compo), sCompoTypeDDF As String) As ObservableCollection(Of Compo)
|
||||
Dim TempList As New ObservableCollection(Of Compo)
|
||||
For Index As Integer = 0 To ListCompo.Count - 1
|
||||
If ListCompo(Index).CompoType.DDFName = sCompoTypeDDF Then
|
||||
TempList.Add(ListCompo(Index))
|
||||
End If
|
||||
Next
|
||||
Return TempList
|
||||
End Function
|
||||
|
||||
' ritorna una lista con tutti i compo dello stesso tipo con lo stesso nome
|
||||
Public Function GetCurrentListSameCompoDDFName(ByVal ListCompo As ObservableCollection(Of Compo), sSelFile As String, sSelBrand As String) As ObservableCollection(Of Compo)
|
||||
Dim TempList As New ObservableCollection(Of Compo)
|
||||
For Index As Integer = 0 To ListCompo.Count - 1
|
||||
If ListCompo(Index).SelFile = sSelFile And ListCompo(Index).SelBrandPart = sSelBrand Then
|
||||
TempList.Add(ListCompo(Index))
|
||||
End If
|
||||
Next
|
||||
Return TempList
|
||||
End Function
|
||||
|
||||
' data la lista compo dello stesso tipo, la riordino ( Config.ini → TidyLayer = ...)
|
||||
Public Sub GetOrderedListSameCompo(ByRef List As ObservableCollection(Of Compo))
|
||||
Dim tidyParamIndex1 As Integer = -1
|
||||
Dim tidyParamIndex2 As Integer = -1
|
||||
Dim WritingError As String = String.Empty
|
||||
If List.Count >= 2 Then
|
||||
For IndexList1 As Integer = 0 To List.Count - 2
|
||||
For IndexList2 As Integer = IndexList1 + 1 To List.Count - 1
|
||||
@@ -1085,6 +1140,66 @@ Friend Module DdfFile
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' rercupera indice nella lista corrente della componente passata
|
||||
Public Function GetIndexInList(ListCompo As ObservableCollection(Of Compo), SelCompo As Compo) As Integer
|
||||
' Se sono qui allora i compo devono avere lo stesso nome?.. Mettere controllo..
|
||||
Dim bFoundSelCompo As Boolean = True
|
||||
For Ind As Integer = 0 To ListCompo.Count - 1
|
||||
For Ind2 As Integer = 0 To ListCompo(Ind).CompoParamList.Count - 1
|
||||
' verifco che gli oggetti abbiano lo stesso nome?.. Metter controllo..
|
||||
If TypeOf ListCompo(Ind).CompoParamList(Ind2) Is TextBoxOnOffParam And
|
||||
TypeOf SelCompo.CompoParamList(Ind2) Is TextBoxOnOffParam Then
|
||||
Dim Temp As TextBoxOnOffParam = DirectCast(ListCompo(Ind).CompoParamList(Ind2), TextBoxOnOffParam)
|
||||
Dim SelTemp As TextBoxOnOffParam = DirectCast(SelCompo.CompoParamList(Ind2), TextBoxOnOffParam)
|
||||
If Temp.Value <> SelTemp.Value Or Temp.IsActive <> SelTemp.IsActive Then
|
||||
bFoundSelCompo = False
|
||||
End If
|
||||
ElseIf TypeOf ListCompo(Ind).CompoParamList(Ind2) Is TextBoxParam And
|
||||
TypeOf SelCompo.CompoParamList(Ind2) Is TextBoxParam Then
|
||||
Dim Temp As TextBoxParam = DirectCast(ListCompo(Ind).CompoParamList(Ind2), TextBoxParam)
|
||||
Dim SelTemp As TextBoxParam = DirectCast(SelCompo.CompoParamList(Ind2), TextBoxParam)
|
||||
If Temp.Value <> SelTemp.Value Then
|
||||
bFoundSelCompo = False
|
||||
End If
|
||||
ElseIf TypeOf ListCompo(Ind).CompoParamList(Ind2) Is ComboBoxOnOffParam And
|
||||
TypeOf SelCOmpo.CompoParamList(Ind2) Is ComboBoxOnOffParam Then
|
||||
Dim Temp As ComboBoxOnOffParam = DirectCast(ListCompo(Ind).CompoParamList(Ind2), ComboBoxOnOffParam)
|
||||
Dim SelTemp As ComboBoxOnOffParam = DirectCast(SelCompo.CompoParamList(Ind2), ComboBoxOnOffParam)
|
||||
If Temp.SelItem <> SelTemp.SelItem Or Temp.IsActive <> SelTemp.IsActive Then
|
||||
bFoundSelCompo = False
|
||||
End If
|
||||
ElseIf TypeOf ListCompo(Ind).CompoParamList(Ind2) Is ComboBoxParam And
|
||||
TypeOf SelCompo.CompoParamList(Ind2) Is ComboBoxParam Then
|
||||
Dim Temp As ComboBoxParam = DirectCast(ListCompo(Ind).CompoParamList(Ind2), ComboBoxParam)
|
||||
Dim SelTemp As ComboBoxParam = DirectCast(SelCompo.CompoParamList(Ind2), ComboBoxParam)
|
||||
If Temp.SelItem <> SelTemp.SelItem Then
|
||||
bFoundSelCompo = False
|
||||
End If
|
||||
Else
|
||||
' le componeti non sono dello stesso tipo!
|
||||
Return -1
|
||||
End If
|
||||
' verifico che il parametro corrente è uguale a quello della compo selezionata
|
||||
If Not bFoundSelCompo Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' verifico se ho trovato la compo
|
||||
If Not bFoundSelCompo Then
|
||||
bFoundSelCompo = True
|
||||
Else
|
||||
Return Ind
|
||||
End If
|
||||
Next
|
||||
' se esco senza aver trovato niente
|
||||
Return -1
|
||||
End Function
|
||||
|
||||
Private Function AscendingOrder(List As ObservableCollection(Of Compo), DdfFileContent As List(Of String), bIsDDF As Boolean) As Boolean
|
||||
Dim WritingError As String = String.Empty
|
||||
GetOrderedListSameCompo(List)
|
||||
' stampa lista
|
||||
DdfFileContent.AddRange(GenerateCompolistDDF(List(0), WritingError, True, bIsDDF))
|
||||
For IndexItem As Integer = 1 To List.Count - 1
|
||||
|
||||
+47
-40
@@ -10,11 +10,7 @@ Module Modified
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
|
||||
If Not IsNothing(Map.refPartPageVM) AndAlso Not IsNothing(Map.refPartPageVM.CurrPart) Then
|
||||
For Each Compo In Map.refPartPageVM.CurrPart.CompoList
|
||||
Compo.BorderColor = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush)
|
||||
Compo.BackGroundColor = DirectCast(New BrushConverter().ConvertFrom("#FFFFFF"), SolidColorBrush)
|
||||
Compo.Foreground = DirectCast(New BrushConverter().ConvertFrom("#000000"), SolidColorBrush)
|
||||
Compo.BorderThickness = 1
|
||||
Compo.FontBold = FontWeights.Normal
|
||||
Compo.ResetMark()
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
@@ -111,6 +107,32 @@ Public Class Compo
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub ResetMark()
|
||||
m_BorderColor = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush)
|
||||
m_BackGroundColor = Brushes.White
|
||||
m_Foreground = Brushes.Black
|
||||
m_BorderThickness = 1
|
||||
m_FontBold = FontWeights.Normal
|
||||
NotifyPropertyChanged("BorderColor")
|
||||
NotifyPropertyChanged("BackGroundColor")
|
||||
NotifyPropertyChanged("Foreground")
|
||||
NotifyPropertyChanged("BorderThickness")
|
||||
NotifyPropertyChanged("FontBold")
|
||||
End Sub
|
||||
|
||||
Public Sub SetMark()
|
||||
m_BorderColor = DirectCast(New BrushConverter().ConvertFrom("#FF4D84C4"), SolidColorBrush)
|
||||
m_BackGroundColor = DirectCast(New BrushConverter().ConvertFrom("#FFFFFFFF"), SolidColorBrush)
|
||||
m_Foreground = DirectCast(New BrushConverter().ConvertFrom("#FF4D84C4"), SolidColorBrush)
|
||||
m_BorderThickness = 2
|
||||
m_FontBold = FontWeights.Bold
|
||||
NotifyPropertyChanged("BorderColor")
|
||||
NotifyPropertyChanged("BackGroundColor")
|
||||
NotifyPropertyChanged("Foreground")
|
||||
NotifyPropertyChanged("BorderThickness")
|
||||
NotifyPropertyChanged("FontBold")
|
||||
End Sub
|
||||
|
||||
#End Region ' Colori GroupBox
|
||||
|
||||
#Region "CompoRef"
|
||||
@@ -1895,6 +1917,22 @@ Public Class Compo
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Conversione da meta espressione in file lua ad espressione valida in interfaccia
|
||||
Private Function ConvertFromLua( sValue As String) As String
|
||||
' sistemo variabili
|
||||
sValue = sValue.Replace( "(DGD.dW)", "W")
|
||||
sValue = sValue.Replace( "(DGD.dW/25.4)", "W")
|
||||
sValue = sValue.Replace( "(DGD.dT)", "T")
|
||||
sValue = sValue.Replace( "(DGD.dT/25.4)", "T")
|
||||
sValue = sValue.Replace( "(DGD.dH)", "H")
|
||||
sValue = sValue.Replace( "(DGD.dH/25.4)", "H")
|
||||
' elimino inch(...) o mm(...)
|
||||
sValue = RegexFunction.Brackets(sValue)
|
||||
' sistemo per unità in interfaccia
|
||||
Utility.ConvertCurrentUnitMeasure(sValue)
|
||||
return sValue
|
||||
End Function
|
||||
|
||||
' carico il parametro letto
|
||||
Private Function LoadParamFromLua(sValue As String, ByRef CurrCompoParam As CompoParam) As Boolean
|
||||
If TypeOf CurrCompoParam Is TextBoxOnOffParam Then
|
||||
@@ -1904,29 +1942,11 @@ Public Class Compo
|
||||
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")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
If ReadValue.Contains("DGD.dT") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "T")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
If ReadValue.Contains("DGD.dH") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "H")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
Utility.ConvertCurrentUnitMeasure(ReadValue)
|
||||
Dim ReadValue As String = ConvertFromLua( sItems(0))
|
||||
TempParam.SetValue(ReadValue)
|
||||
' 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
|
||||
If sItems.Count > 1 AndAlso sItems(1).Trim = "0" Then
|
||||
TempParam.SetIsActive(False)
|
||||
Else
|
||||
TempParam.SetIsActive(True)
|
||||
End If
|
||||
@@ -1937,20 +1957,7 @@ Public Class Compo
|
||||
If Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage Then
|
||||
If Not TempParam.EnableCopy Then Return False
|
||||
End If
|
||||
Dim ReadValue = RegexFunction.Brackets(sValue)
|
||||
If ReadValue.Contains("DGD.dW") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "W")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
If ReadValue.Contains("DGD.dT") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "T")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
If ReadValue.Contains("DGD.dH") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "H")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
Utility.ConvertCurrentUnitMeasure(ReadValue)
|
||||
Dim ReadValue As String = ConvertFromLua( sValue)
|
||||
TempParam.SetValue(ReadValue)
|
||||
Return True
|
||||
ElseIf TypeOf CurrCompoParam Is ComboBoxOnOffParam Then
|
||||
|
||||
+200
-10
@@ -2,6 +2,7 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports System.Text.RegularExpressions
|
||||
|
||||
Public Class Part
|
||||
@@ -1161,6 +1162,21 @@ Public Class Part
|
||||
|
||||
#End Region ' Top Angle
|
||||
|
||||
#Region "OPTIONS"
|
||||
|
||||
Private m_sOptions As String = String.Empty
|
||||
|
||||
Public Property sOptions As String
|
||||
Get
|
||||
Return m_sOptions
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sOptions = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Options
|
||||
|
||||
#End Region ' General
|
||||
|
||||
' lista delle componenti
|
||||
@@ -1181,8 +1197,13 @@ Public Class Part
|
||||
End Get
|
||||
Set(value As Compo)
|
||||
m_SelCompo = value
|
||||
' La selezione della componente è demandata all'evento click (PartPageV)
|
||||
'MarkCompoInScena()
|
||||
End Set
|
||||
End Property
|
||||
Public Sub SetSelCompo()
|
||||
MarkCompoInScena()
|
||||
End Sub
|
||||
|
||||
#Region "AddCompo"
|
||||
|
||||
@@ -1404,7 +1425,7 @@ Public Class Part
|
||||
NewCompo.SetSelBrand(NewCompo.BrandListPart(0))
|
||||
' Carico il primo modello della lista
|
||||
Dim SelItemIndex As Integer = 0
|
||||
While SelItemIndex < NewCompo.FileList.Count - 1 AndAlso Path.HasExtension(NewCompo.FileList(SelItemIndex)) AndAlso Path.GetExtension(NewCompo.FileList(SelItemIndex)) = NGE_EXTENSION
|
||||
While SelItemIndex < NewCompo.FileList.Count - 1 AndAlso Path.HasExtension(NewCompo.FileList(SelItemIndex)) AndAlso Path.GetExtension(NewCompo.FileList(SelItemIndex)).ToLower = NGE_EXTENSION
|
||||
SelItemIndex += 1
|
||||
End While
|
||||
If SelItemIndex < NewCompo.FileList.Count Then
|
||||
@@ -1490,6 +1511,69 @@ Public Class Part
|
||||
|
||||
#End Region 'AddCompo
|
||||
|
||||
#Region "Selection compo"
|
||||
|
||||
Public Sub ResetAllMark()
|
||||
Dim nIdFirstPart As Integer = EgtGetFirstPart()
|
||||
Dim nIdLay As Integer = EgtGetFirstLayer(nIdFirstPart)
|
||||
While nIdLay <> GDB_ID.NULL
|
||||
EgtResetMark(nIdLay)
|
||||
nIdLay = EgtGetNextLayer(nIdLay)
|
||||
End While
|
||||
For Each ItemCompo As Compo In CompoList
|
||||
ItemCompo.ResetMark()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub MarkCompoInScena()
|
||||
If IsNothing(m_SelCompo) Then Return
|
||||
If GetMainPrivateProfileInt(S_GENERAL, "MarkCompo", 0) = 0 Then Return
|
||||
ResetAllMark()
|
||||
' recupero la lista dei compo dello stesso tipo
|
||||
Dim TempList As ObservableCollection(Of Compo) = DdfFile.GetCurrentListSameCompoType(m_CompoList, m_SelCompo.CompoType.DDFName)
|
||||
' recupero la lista dei compo con lo stesso nome
|
||||
TempList = DdfFile.GetCurrentListSameCompoDDFName(TempList, m_SelCompo.SelFile, m_SelCompo.SelBrandPart)
|
||||
' riordino la lista appena trovata secondo le regole di stampa DDF
|
||||
DdfFile.GetOrderedListSameCompo(TempList)
|
||||
' ontengo la posizione prevista nella grafica
|
||||
Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, m_SelCompo)
|
||||
' recupero il direttorio della componente
|
||||
Dim sDirCompo As String = Path.GetFileName(m_SelCompo.CompoType.Path)
|
||||
' recupero la lista ordinata
|
||||
Dim sCompoName As String = m_SelCompo.TemplateSelItem
|
||||
' recupero il primo part disponibile
|
||||
Dim nIdFirstPart As Integer = EgtGetFirstPart()
|
||||
Dim nIdLay As Integer = EgtGetFirstLayer(nIdFirstPart)
|
||||
Dim IndexLay As Integer = 0
|
||||
While nIdLay <> GDB_ID.NULL
|
||||
Dim sInfoPath As String = String.Empty
|
||||
If Not EgtGetInfo(nIdLay, "Path", sInfoPath) Then
|
||||
Dim sFileName As String = String.Empty
|
||||
Dim sFileDir As String = String.Empty
|
||||
If EgtGetInfo(nIdLay, "CustGeomFile", sFileName) AndAlso
|
||||
EgtGetInfo(nIdLay, "CustGeomPath", sFileDir) Then
|
||||
sInfoPath = sFileDir & sFileName
|
||||
End If
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace( sInfoPath) Then
|
||||
Dim sNamePath As String = sInfoPath
|
||||
If sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 AndAlso
|
||||
sInfoPath.IndexOf( sDirCompo, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay = IndexInList Then
|
||||
EgtSetMark(nIdLay)
|
||||
m_SelCompo.SetMark()
|
||||
Exit While
|
||||
ElseIf sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay < IndexInList Then
|
||||
IndexLay = IndexLay + 1
|
||||
End If
|
||||
End If
|
||||
nIdLay = EgtGetNextLayer(nIdLay)
|
||||
End While
|
||||
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "RemoveCompo"
|
||||
|
||||
Friend Sub RemoveCompo(CompoToRemove As Compo, Optional OnlyOnJamb As Boolean = False)
|
||||
@@ -1702,6 +1786,8 @@ Public Class Part
|
||||
ReadDoorCompleted = True
|
||||
Case ConstCompo.K_HARDWARE
|
||||
LineIndex = LineIndex + 1
|
||||
Case ConstCompo.K_OPTIONS
|
||||
LineIndex = ReadDoor.GetOptions(ReadDoor.NextIndex(LineIndex))
|
||||
Case Else 'COMPONENTS
|
||||
' Se sezione senza nome o altro errore
|
||||
If String.IsNullOrWhiteSpace(sSection) Then
|
||||
@@ -1801,6 +1887,7 @@ Public Class Part
|
||||
' Messaggi di errore generici, se la stringa dei messaggi contiene delle informazioni allora visualizzo
|
||||
If Not String.IsNullOrWhiteSpace(sErrorInfo) Then
|
||||
Dim sTitle As String = EgtMsg(50101)
|
||||
If Not IsNothing(ReadDoor) AndAlso Not IsNothing(ReadDoor.TypePart) Then sTitle &= ReadDoor.TypePart.ToString
|
||||
' 50541 = {0} in reading {1}.
|
||||
If Not IsNothing(ReadDoor) Then String.Format(EgtMsg(50541), sTitle, ReadDoor.TypePart)
|
||||
MessageBox.Show(sErrorInfo, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
@@ -1966,6 +2053,9 @@ Public Class Part
|
||||
If Index > FileContent.Count() - 1 Then Return -1
|
||||
Dim sLine As String = RemoveComment(FileContent(Index))
|
||||
Dim Width As String = GetValueWithKey(sLine, K_WIDTH)
|
||||
If m_refPartDoor.IsTemplate And OptionModule.AdjustDDT Then
|
||||
Width = OptionModule.m_Width
|
||||
End If
|
||||
If String.IsNullOrWhiteSpace(Width) Then
|
||||
If Not SearchKey(sLine, K_WIDTH) Then Return -1
|
||||
' altrimenti
|
||||
@@ -1983,6 +2073,9 @@ Public Class Part
|
||||
If Index > FileContent.Count() - 1 Then Return -1
|
||||
sLine = RemoveComment(FileContent(Index))
|
||||
Dim Height As String = GetValueWithKey(sLine, K_HEIGHT)
|
||||
If m_refPartDoor.IsTemplate And OptionModule.AdjustDDT Then
|
||||
Height = OptionModule.m_Height
|
||||
End If
|
||||
If String.IsNullOrWhiteSpace(Height) Then
|
||||
If Not SearchKey(sLine, K_HEIGHT) Then Return -1
|
||||
' altrimenti
|
||||
@@ -2000,6 +2093,9 @@ Public Class Part
|
||||
If Index > FileContent.Count() - 1 Then Return -1
|
||||
sLine = RemoveComment(FileContent(Index))
|
||||
Dim Thickness As String = GetValueWithKey(sLine, K_THICKNESS)
|
||||
If m_refPartDoor.IsTemplate And OptionModule.AdjustDDT Then
|
||||
Thickness = OptionModule.m_Thickness
|
||||
End If
|
||||
If String.IsNullOrWhiteSpace(Thickness) Then
|
||||
If Not SearchKey(sLine, K_THICKNESS) Then Return -1
|
||||
' altrimenti
|
||||
@@ -2091,6 +2187,10 @@ Public Class Part
|
||||
MessageBox.Show(String.Format(EgtMsg(50141), ConstIni.K_SWING_INI) & EgtMsg(50159), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
' carico il valore nella porta corrente
|
||||
If m_refPartDoor.IsTemplate And OptionModule.AdjustDDT AndAlso Not String.IsNullOrEmpty(OptionModule.ForcesSideSwing) Then
|
||||
Swing = Swing.Remove(0, 1)
|
||||
Swing = OptionModule.ForcesSideSwing & Swing
|
||||
End If
|
||||
m_Swing = Swing
|
||||
OptionModule.SetCurrSwing(m_SwingAlias, m_Swing)
|
||||
If IsNothing(m_SwingAlias) Then Return -1
|
||||
@@ -2205,6 +2305,28 @@ Public Class Part
|
||||
Return NextIndex(Index)
|
||||
End Function
|
||||
|
||||
Private Function GetOptions(Index As Integer) As Integer
|
||||
If Index > FileContent.Count() - 1 Then Return Index
|
||||
Dim sLine As String = RemoveComment(FileContent(Index))
|
||||
' se stringa vuota passo alla riga successiva
|
||||
If String.IsNullOrEmpty(sLine) Then
|
||||
Return Index
|
||||
End If
|
||||
' procedo a leggere le options
|
||||
Dim nCount As Integer = 0
|
||||
m_sOptions = String.Empty
|
||||
' sLine.StartsWith(OptionModule.m_sSpace1Tab)
|
||||
While Not (Search3Hyphens(sLine) OrElse Search3Dots(sLine))
|
||||
m_sOptions &= If(nCount > 0, vbCrLf, "") & sLine
|
||||
Index = NextIndex(Index)
|
||||
' se il file è terminatpo esco
|
||||
If Index > FileContent.Count() - 1 Then Return Index
|
||||
sLine = RemoveComment(FileContent(Index))
|
||||
nCount = nCount + 1
|
||||
End While
|
||||
Return Index
|
||||
End Function
|
||||
|
||||
' calcola la congruenza del posizionamento e del secure
|
||||
Private Sub CalcBevelFromSecure()
|
||||
' se sono nella configurazione assemblato e sto leggendo un frame
|
||||
@@ -2635,7 +2757,10 @@ Public Class Part
|
||||
If SearchKey(sLine, sEdgeName) Then
|
||||
' passo alla riga successiva
|
||||
Index = NextIndex(Index)
|
||||
If Index > FileContent.Count() - 1 Then Return -1
|
||||
If Index > FileContent.Count() - 1 Then
|
||||
nError = -1
|
||||
Return ""
|
||||
End If
|
||||
sLine = RemoveComment(FileContent(Index))
|
||||
sVal = GetValueWithKey(sLine, K_TYPEEDGE)
|
||||
Else
|
||||
@@ -3318,6 +3443,7 @@ Public Class Part
|
||||
|
||||
' utilizzata per generare la porta/jamb dell'Hardware
|
||||
Sub New(Hardware As String)
|
||||
|
||||
If Not String.IsNullOrEmpty(Hardware) Then
|
||||
Me.m_Width = OptionModule.m_WidthJamb
|
||||
Me.m_Height = OptionModule.m_Height
|
||||
@@ -3351,10 +3477,78 @@ Public Class Part
|
||||
Me.TypePart = ConstGen.PART_FRAME_LEFT
|
||||
Return
|
||||
End If
|
||||
Me.m_Width = OptionModule.m_Width
|
||||
Me.m_Height = OptionModule.m_Height
|
||||
Me.m_Thickness = OptionModule.m_Thickness
|
||||
Me.SetSwing(OptionModule.m_Swing)
|
||||
|
||||
Dim bCLoneDoor As Boolean = (GetMainPrivateProfileInt(S_GENERAL, "CloneDoor", 0) = 1)
|
||||
' Se abilitato in file Ini "DoorClone" allora verifico se esiste una porta corrente
|
||||
If bCLoneDoor And Not IsNothing(Map.refAssemblyManagerVM) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso
|
||||
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) AndAlso
|
||||
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor) Then
|
||||
' Se presente una sola anta
|
||||
Dim nPartDoor As Integer = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count
|
||||
If nPartDoor = 1 Then
|
||||
Dim LocalPartDoor As PartDoor = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0)
|
||||
If Not IsNothing(LocalPartDoor.Door) Then
|
||||
Me.m_Width = LocalPartDoor.Door.m_Width
|
||||
Me.m_Height = LocalPartDoor.Door.m_Height
|
||||
Me.m_Thickness = LocalPartDoor.Door.m_Thickness
|
||||
Me.SetSwing(LocalPartDoor.Door.m_Swing)
|
||||
Me.SetLockEdgeType(New EdgeType(LocalPartDoor.Door.LockEdgeType.Name, Visibility.Visible))
|
||||
Me.SetHingeEdgeType(New EdgeType(LocalPartDoor.Door.HingeEdgeType.Name, Visibility.Visible))
|
||||
Me.SetTopType(New EdgeType(LocalPartDoor.Door.TopType.Name, Visibility.Visible))
|
||||
Me.SetBottomType(New EdgeType(LocalPartDoor.Door.BottomType.Name, Visibility.Visible))
|
||||
Else
|
||||
' Devo usare i parametri di default
|
||||
Me.m_Width = OptionModule.m_Width
|
||||
Me.m_Height = OptionModule.m_Height
|
||||
Me.m_Thickness = OptionModule.m_Thickness
|
||||
Me.SetSwing(OptionModule.m_Swing)
|
||||
Me.SetLockEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetHingeEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetTopType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetBottomType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
End If
|
||||
|
||||
ElseIf nPartDoor > 1 Then
|
||||
' Assemblati
|
||||
Dim WdSelPartV As New SelectPartV()
|
||||
' 50233=Selezione della porta, 50234=Selezione anta
|
||||
Dim WdSelPartVM As New SelectPartVM(EgtMsg(50233), EgtMsg(50234), nPartDoor, 1)
|
||||
WdSelPartV.DataContext = WdSelPartVM
|
||||
WdSelPartV.ShowDialog()
|
||||
Dim nSelection As Integer = WdSelPartVM.nSelectedIndex
|
||||
' Apro una finestra per chiedere quale anta usare come riferimento
|
||||
Dim LocalPartDoor As PartDoor = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(nSelection)
|
||||
Me.m_Width = LocalPartDoor.Door.m_Width
|
||||
Me.m_Height = LocalPartDoor.Door.m_Height
|
||||
Me.m_Thickness = LocalPartDoor.Door.m_Thickness
|
||||
Me.SetSwing(LocalPartDoor.Door.m_Swing)
|
||||
Me.SetLockEdgeType(New EdgeType(LocalPartDoor.Door.LockEdgeType.Name, Visibility.Visible))
|
||||
Me.SetHingeEdgeType(New EdgeType(LocalPartDoor.Door.HingeEdgeType.Name, Visibility.Visible))
|
||||
Me.SetTopType(New EdgeType(LocalPartDoor.Door.TopType.Name, Visibility.Visible))
|
||||
Me.SetBottomType(New EdgeType(LocalPartDoor.Door.BottomType.Name, Visibility.Visible))
|
||||
Else
|
||||
' Devo usare i parametri di default
|
||||
Me.m_Width = OptionModule.m_Width
|
||||
Me.m_Height = OptionModule.m_Height
|
||||
Me.m_Thickness = OptionModule.m_Thickness
|
||||
Me.SetSwing(OptionModule.m_Swing)
|
||||
Me.SetLockEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetHingeEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetTopType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetBottomType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
End If
|
||||
Else
|
||||
Me.m_Width = OptionModule.m_Width
|
||||
Me.m_Height = OptionModule.m_Height
|
||||
Me.m_Thickness = OptionModule.m_Thickness
|
||||
Me.SetSwing(OptionModule.m_Swing)
|
||||
Me.SetLockEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetHingeEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetTopType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetBottomType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
End If
|
||||
|
||||
If Not IsNothing(OptionModule.m_CurrMaterial) Then
|
||||
Try
|
||||
Me.SetMaterial(m_MaterialList.First(Function(x) x.Name = Trim(OptionModule.m_CurrMaterial.Name)))
|
||||
@@ -3367,10 +3561,6 @@ Public Class Part
|
||||
Me.m_IsActive = True
|
||||
Me.m_Measure = ConvertMmUnitsToString(OptionModule.m_bIsMmUnit)
|
||||
Me.m_Weight = OptionModule.m_Weight
|
||||
Me.SetLockEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetHingeEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetTopType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.SetBottomType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
|
||||
Me.m_LockEdgeMachining = OptionModule.m_LockEdgeMachining
|
||||
Me.m_HingeEdgeMachining = OptionModule.m_HingeEdgeMachining
|
||||
Me.m_TopMachining = OptionModule.m_TopMachining
|
||||
|
||||
@@ -31,4 +31,12 @@
|
||||
|
||||
End Sub
|
||||
|
||||
' Forzo la selzione della compo corrente
|
||||
Private Sub DoorParamsItemsControl_Click() Handles DoorParamsItemsControl.MouseLeftButtonUp
|
||||
If Not IsNothing(Map.refPartPageVM) AndAlso Not IsNothing(Map.refPartPageVM.CurrPart) Then
|
||||
Map.refPartPageVM.CurrPart.SetSelCompo()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
+19
-3
@@ -84,15 +84,15 @@
|
||||
<Reference Include="combit.ListLabel25.Wpf">
|
||||
<HintPath>..\..\EgtProg\EgtDOORCreator\combit.ListLabel25.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DotNetZip">
|
||||
<HintPath>..\..\EgtProg\OmagCUT\DotNetZip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtUILib">
|
||||
<HintPath>..\..\EgtProg\Dll32\EgtUILib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtWPFLib5">
|
||||
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\..\EgtProg\EgtDOORCreator\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Design" />
|
||||
<Reference Include="System.Drawing" />
|
||||
@@ -223,6 +223,14 @@
|
||||
</Compile>
|
||||
<Compile Include="ProjectManager\ProjectManagerVM.vb" />
|
||||
<Compile Include="ProjectManager\MySaveFileDialogVM.vb" />
|
||||
<Compile Include="ProjectManager\SelectPartV.xaml.vb">
|
||||
<DependentUpon>SelectPartV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectManager\SelectPartVM.vb" />
|
||||
<Compile Include="ProjectManager\SpecialPanelV.xaml.vb">
|
||||
<DependentUpon>SpecialPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectManager\SpecialPanelVM.vb" />
|
||||
<Compile Include="RegexFunction.vb" />
|
||||
<Compile Include="ReportInfo\ReportCompo.vb" />
|
||||
<Compile Include="SceneManager\DimensioningPanel\DimensioningPanelV.xaml.vb">
|
||||
@@ -363,6 +371,14 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ProjectManager\SelectPartV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ProjectManager\SpecialPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SceneManager\DimensioningPanel\DimensioningPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<EgtDOORCreator:AssemblyPageVM x:Key="AssemblyPageVM"/>
|
||||
<EgtDOORCreator:HardwarePageVM x:Key="HardwarePageVM"/>
|
||||
<EgtDOORCreator:DimensioningPanelVM x:Key="DimensioningPanelVM"/>
|
||||
<EgtDOORCreator:SpecialPanelVM x:Key="SpecialPanelVM"/>
|
||||
|
||||
<!--Colori predefiniti-->
|
||||
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF4D84C4" />
|
||||
@@ -162,7 +163,7 @@
|
||||
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
|
||||
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
|
||||
<SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
|
||||
<SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
|
||||
<SolidColorBrush x:Key="Button.Pressed.Background" Color="#FF90CFEE"/>
|
||||
<SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
|
||||
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
|
||||
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
|
||||
|
||||
+10
-12
@@ -1,19 +1,17 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="GuideV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Title="{Binding Title}" Icon="/Resources/EgtDOOR.ico"
|
||||
TitleBarBrush="{StaticResource EgaltechBlue1}"
|
||||
BorderBrush="{StaticResource EgaltechBlue1}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
|
||||
IsMinimizable="True" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
Height="800" Width="1500">
|
||||
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Title="{Binding Title}" Icon="/Resources/EgtDOOR.ico"
|
||||
TitleBarBrush="{StaticResource EgaltechBlue1}"
|
||||
BorderBrush="{StaticResource EgaltechBlue1}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
|
||||
IsMinimizable="True" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
Height="800" Width="1500">
|
||||
|
||||
<DockPanel Margin="5">
|
||||
<WebBrowser x:Name="DoorBrowser"/>
|
||||
</DockPanel>
|
||||
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
|
||||
@@ -20,10 +20,10 @@ Public Class GuideV
|
||||
Dim sHelpDir As String = String.Empty
|
||||
If OptionModule.m_SmartHelp = HelpPage.LocalHost Then
|
||||
sHelpDir = IniFile.m_sHelpDir.Replace("C:", "file://127.0.0.1/c$")
|
||||
DoorBrowser.Navigate(New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html"))
|
||||
DoorBrowser.Source = New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html")
|
||||
ElseIf OptionModule.m_SmartHelp = HelpPage.WebBrowserVB Then
|
||||
sHelpDir = IniFile.m_sHelpDir
|
||||
DoorBrowser.Navigate(New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html"))
|
||||
DoorBrowser.Source = New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html")
|
||||
Else
|
||||
sHelpDir = IniFile.m_sHelpDir
|
||||
Try
|
||||
|
||||
+67
-39
@@ -83,8 +83,8 @@ Public Class Hardware
|
||||
If Not IsNothing(value) Then
|
||||
m_SelBrand = value
|
||||
ElseIf Not IsNothing(value) AndAlso Not Directory.Exists(value.ModelDir) Then
|
||||
' 50542 = {0}: Directory does not exist!
|
||||
ErrorReading = String.Format(EgtMsg(50542),value.ModelDir)
|
||||
' 50542 = {0}: Directory does not exist!
|
||||
ErrorReading = String.Format(EgtMsg(50542), value.ModelDir)
|
||||
RefreshTemplateListEgtDOORCreator()
|
||||
Else
|
||||
Return
|
||||
@@ -130,8 +130,8 @@ Public Class Hardware
|
||||
SelTemplate = String.Empty
|
||||
'Map.refSceneManagerVM.RefreshBtn()
|
||||
End If
|
||||
Else
|
||||
SelTemplate = String.Empty
|
||||
Else
|
||||
SelTemplate = String.Empty
|
||||
'Map.refSceneManagerVM.RefreshBtn()
|
||||
End If
|
||||
' termine della selezione
|
||||
@@ -481,11 +481,12 @@ Public Class Hardware
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' elimina il file temporaneo CurrHardware.lua
|
||||
' elimina il file temporaneo CurrHardware.lua (se esiste anche CurrHardware.luae)
|
||||
Public Function DeleteTempFile() As Boolean
|
||||
If String.IsNullOrWhiteSpace(CurrHardwareFilePath) Then Return False
|
||||
Try
|
||||
File.Delete(CurrHardwareFilePath)
|
||||
if File.Exists(CurrHardwareFilePath & "e") Then File.Delete(CurrHardwareFilePath & "e")
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
Return True
|
||||
@@ -530,7 +531,9 @@ Public Class Hardware
|
||||
Else
|
||||
SwingTemplate = "RH"
|
||||
End If
|
||||
IniFile.StdTemplateGetPrivateProfileString("Hardware", "Swing", SwingTemplate, SwingTemplate)
|
||||
If String.IsNullOrEmpty(SwingTemplate) Or Not (GetMainPrivateProfileInt(S_GENERAL, "CloneDoor", 0) = 1) Then
|
||||
IniFile.StdTemplateGetPrivateProfileString("Hardware", "Swing", SwingTemplate, SwingTemplate)
|
||||
End If
|
||||
Map.refHardwarePageVM.GenericPart.SetSwing(SwingTemplate)
|
||||
If bIsFrame Then
|
||||
IniFile.StdTemplateGetPrivateProfileString("Hardware", "SwingFrame", "RH", SwingTemplate)
|
||||
@@ -555,17 +558,17 @@ Public Class Hardware
|
||||
If Map.refHardwarePageVM.GenericPart.CompoList.Count < 1 Then Return
|
||||
'If String.IsNullOrEmpty(HardwareGeneral.JambSide) Then
|
||||
For Each Item In Map.refHardwarePageVM.GenericPart.CompoList(0).CompoParamList
|
||||
If TypeOf Item Is ComboBoxParam AndAlso
|
||||
Item.DDFName = "side" Then
|
||||
Dim CBoxPar As ComboBoxParam = DirectCast(Item, ComboBoxParam)
|
||||
Dim IndexItem As Integer = CBoxPar.ItemList.IndexOf(CBoxPar.SelItem)
|
||||
If IndexItem > -1 Then
|
||||
HardwareGeneral.SetJambSide(CBoxPar.ItemListDDF(IndexItem))
|
||||
End If
|
||||
'HardwareGeneral.SetJambSide(CBoxPar.SelItem)
|
||||
Exit For
|
||||
If TypeOf Item Is ComboBoxParam AndAlso
|
||||
Item.DDFName = "side" Then
|
||||
Dim CBoxPar As ComboBoxParam = DirectCast(Item, ComboBoxParam)
|
||||
Dim IndexItem As Integer = CBoxPar.ItemList.IndexOf(CBoxPar.SelItem)
|
||||
If IndexItem > -1 Then
|
||||
HardwareGeneral.SetJambSide(CBoxPar.ItemListDDF(IndexItem))
|
||||
End If
|
||||
Next
|
||||
'HardwareGeneral.SetJambSide(CBoxPar.SelItem)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
'End If
|
||||
If HardwareGeneral.JambSide.ToLower.Contains("hinge") Then
|
||||
Map.refHardwarePageVM.GenericPart.TypePart = PART_FRAME_LEFT & HINGE
|
||||
@@ -581,21 +584,21 @@ Public Class Hardware
|
||||
Map.refHardwarePageVM.GenericPart.SetHeight(OptionModule.m_Height)
|
||||
End If
|
||||
Return
|
||||
ElseIf HardwareGeneral.JambSide.ToLower.Contains("top") Then
|
||||
ElseIf HardwareGeneral.JambSide.ToLower.Contains("top") Then
|
||||
Map.refHardwarePageVM.GenericPart.TypePart = PART_FRAME_TOP & TOP
|
||||
If Not HardwarePartVM.bIsSettingDoor Then
|
||||
Map.refHardwarePageVM.GenericPart.SetWidth(OptionModule.m_Width)
|
||||
Map.refHardwarePageVM.GenericPart.SetHeight(OptionModule.m_ThicknessHead)
|
||||
End If
|
||||
Return
|
||||
ElseIf HardwareGeneral.JambSide.ToLower.Contains("bottom") Then
|
||||
ElseIf HardwareGeneral.JambSide.ToLower.Contains("bottom") Then
|
||||
Map.refHardwarePageVM.GenericPart.TypePart = PART_FRAME_BOTTOM & BOTTOM
|
||||
If Not HardwarePartVM.bIsSettingDoor Then
|
||||
Map.refHardwarePageVM.GenericPart.SetWidth(OptionModule.m_Width)
|
||||
Map.refHardwarePageVM.GenericPart.SetHeight(OptionModule.m_ThicknessBottom)
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -826,7 +829,7 @@ Public Class Hardware
|
||||
End If
|
||||
|
||||
End If
|
||||
ParamIndex += 1
|
||||
ParamIndex += 1
|
||||
End While ' termina lettura del capitolo
|
||||
|
||||
GroupChapters.Add(Chapter)
|
||||
@@ -1598,7 +1601,7 @@ Public Class Hardware
|
||||
bNewHardware = False
|
||||
Dim ErrorMsg As String = String.Empty
|
||||
Dim NewFileContent As New ObservableCollection(Of String)
|
||||
If Not WriteFile(NewFileContent) Then Return False
|
||||
If Not ReadFile(NewFileContent) Then Return False
|
||||
|
||||
' scrivo tutto sul file corrente
|
||||
Try
|
||||
@@ -1788,19 +1791,20 @@ Public Class Hardware
|
||||
Map.refHardwarePageVM.GenericPart.CompoList.Clear()
|
||||
If String.IsNullOrWhiteSpace(Map.refHardwarePageVM.CurrHardware.SelTemplate) Then Return False
|
||||
Dim NewFileContent As New ObservableCollection(Of String)
|
||||
If Not WriteFile(NewFileContent) Then Return False
|
||||
If Not ReadFile(NewFileContent) Then Return False
|
||||
' costruisco il nome del percorso del file corrente
|
||||
Dim ModelDir As String = String.Empty
|
||||
' costruisco il percorso del file temporaneo nella cartella corrente:
|
||||
Dim CurrDirectoryInModelDir As String = Path.GetDirectoryName(Map.refHardwarePageVM.CurrHardware.SelTemplate)
|
||||
CurrDirectoryInModelDir = Trim(CurrDirectoryInModelDir.Replace(m_HardwareGeneral.Path, ""))
|
||||
'If m_SelBrand.ModelDir <> RegexFunction.ModelTemplate(m_HardwareGeneral.Path) Then ModelDir = m_SelBrand.ModelDirGraphic & "\"
|
||||
If m_SelBrand.ModelDir <> m_HardwareGeneral.Path Then ModelDir = m_SelBrand.ModelDirGraphic & "\"
|
||||
If Not String.IsNullOrWhiteSpace(CurrDirectoryInModelDir) Then ModelDir = ModelDir & CurrDirectoryInModelDir & "\"
|
||||
Dim sTempFileHardw As String = m_HardwareGeneral.Path & "\" & ModelDir & TEMP_FILE_HARDWARE
|
||||
' salvo il file
|
||||
File.WriteAllLines(sTempFileHardw, NewFileContent)
|
||||
'LoadSwingFromTemplate()
|
||||
' salvo eventuale file associato luae
|
||||
Dim sLuaeFile As String = m_HardwareGeneral.Path & "\" & ModelDir & Map.refHardwarePageVM.CurrHardware.SelTemplate & ".luae"
|
||||
If File.Exists(sLuaeFile) Then File.Copy(sLuaeFile, sTempFileHardw & "e")
|
||||
' aggiungo la componente
|
||||
Map.refHardwarePageVM.GenericPart.AddNewHardware(m_HardwareGeneral, ModelDir & Path.GetFileNameWithoutExtension(TEMP_FILE_HARDWARE))
|
||||
CurrHardwareFilePath = sTempFileHardw
|
||||
@@ -1817,7 +1821,7 @@ Public Class Hardware
|
||||
If Not File.Exists(TemplFile) Then Return False
|
||||
Dim FileContent() As String = File.ReadAllLines(TemplFile)
|
||||
Dim NewFileContent As New ObservableCollection(Of String)
|
||||
If Not WriteFile(NewFileContent) Then Return False
|
||||
If Not ReadFile(NewFileContent) Then Return False
|
||||
' costruisco il nome del percorso del file corrente
|
||||
Dim CurrConfig As String = m_HardwareGeneral.Path & "\" & CONFIGINI_FILE_NAME
|
||||
Dim CurrItemPath As String = CurrPath()
|
||||
@@ -1829,7 +1833,7 @@ Public Class Hardware
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function WriteFile(ByRef NewFileContent As ObservableCollection(Of String)) As Boolean
|
||||
Private Function ReadFile(ByRef NewFileContent As ObservableCollection(Of String)) As Boolean
|
||||
For IndexName As Integer = 0 To m_GroupChapterName.Count - 1
|
||||
CascadedChapter(m_GroupChapters, m_GroupChapterName(IndexName))
|
||||
Next
|
||||
@@ -1876,7 +1880,7 @@ Public Class Hardware
|
||||
' cerco un numero finito di parametri
|
||||
For IndexParam As Integer = 0 To IndexParamDDF - 1
|
||||
If LineIndex + ParamIndex > sFile.Count - 1 Then Return False
|
||||
' recuro il nome del parametro
|
||||
' recupero il nome del parametro
|
||||
KeyParam = Trim(RegexFunction.KeyParamLine(sFile(LineIndex + ParamIndex)))
|
||||
While String.IsNullOrEmpty(KeyParam) And LineIndex + ParamIndex < sFile(LineIndex + ParamIndex).Count
|
||||
ParamIndex += 1
|
||||
@@ -2013,21 +2017,27 @@ Public Class Hardware
|
||||
If Text.ToolTipValue.Contains("Invalid") Then
|
||||
sValue = "0.0000"
|
||||
Else
|
||||
sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
'sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
sValue = "inch( " & Text.Value & ")"
|
||||
End If
|
||||
Else
|
||||
sValue = Text.Value
|
||||
If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
'If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
sValue = "mm( " & sValue & ")"
|
||||
End If
|
||||
Case ConstGen.MM
|
||||
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
|
||||
sValue = Text.Value
|
||||
InchesToMm(sValue)
|
||||
'sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
sValue = "inch( " & sValue & ")"
|
||||
Else
|
||||
If Text.ToolTipValue.Contains("Invalid") Then
|
||||
sValue = "0.0000"
|
||||
Else
|
||||
sValue = Text.Value
|
||||
'sValue = Text.Value
|
||||
'sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
sValue = "mm( " & Text.Value & ")"
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
@@ -2046,21 +2056,27 @@ Public Class Hardware
|
||||
If Text.ToolTipValue.Contains("Invalid") Then
|
||||
sValue = "0.0000"
|
||||
Else
|
||||
sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
'sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
sValue = "inch( " & Text.Value & ")"
|
||||
End If
|
||||
Else
|
||||
sValue = Text.Value
|
||||
If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
'If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
sValue = "mm( " & sValue & ")"
|
||||
End If
|
||||
Case ConstGen.MM
|
||||
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
|
||||
sValue = Text.Value
|
||||
InchesToMm(sValue)
|
||||
'sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
sValue = "inch( " & sValue & ")"
|
||||
Else
|
||||
If Text.ToolTipValue.Contains("Invalid") Then
|
||||
sValue = "0.0000"
|
||||
Else
|
||||
sValue = Text.Value
|
||||
'sValue = Text.Value
|
||||
'sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
sValue = "mm( " & Text.Value & ")"
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
@@ -2093,22 +2109,28 @@ Public Class Hardware
|
||||
If Text.ToolTipValue.Contains("Invalid") Then
|
||||
sValue = "0.0000"
|
||||
Else
|
||||
sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
'sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
sValue = "inch( " & Text.Value & ")"
|
||||
End If
|
||||
'sValue = Text.TypeVar & "( " & Text.ToolTipValue & ")"
|
||||
Else
|
||||
sValue = Text.Value
|
||||
If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
'If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
sValue = "mm( " & sValue & ")"
|
||||
End If
|
||||
Case ConstGen.MM
|
||||
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
|
||||
sValue = Text.Value
|
||||
InchesToMm(sValue)
|
||||
'sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
sValue = "inch( " & sValue & ")"
|
||||
Else
|
||||
If Text.ToolTipValue.Contains("Invalid") Then
|
||||
sValue = "0.0000"
|
||||
Else
|
||||
sValue = Text.Value
|
||||
'sValue = Text.Value
|
||||
'sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
sValue = "mm( " & Text.Value & ")"
|
||||
End If
|
||||
'sValue = Text.ToolTipValue
|
||||
End If
|
||||
@@ -2139,22 +2161,28 @@ Public Class Hardware
|
||||
If Text.ToolTipValue.Contains("Invalid") Then
|
||||
sValue = "0.0000"
|
||||
Else
|
||||
sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
'sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
sValue = "inch( " & Text.Value & ")"
|
||||
End If
|
||||
'sValue = Text.TypeVar & "( " & Text.ToolTipValue & ")"
|
||||
Else
|
||||
sValue = Text.Value
|
||||
If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
'If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
sValue = "mm( " & Text.Value & ")"
|
||||
End If
|
||||
Case ConstGen.MM
|
||||
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
|
||||
sValue = Text.Value
|
||||
InchesToMm(sValue)
|
||||
'sValue = Text.TypeVar & "( " & sValue & ")"
|
||||
sValue = "inch( " & Text.Value & ")"
|
||||
Else
|
||||
If Text.ToolTipValue.Contains("Invalid") Then
|
||||
sValue = "0.0000"
|
||||
Else
|
||||
sValue = Text.Value
|
||||
'sValue = Text.Value
|
||||
'sValue = Text.TypeVar & "( " & Text.Value & ")"
|
||||
sValue = "mm( " & Text.Value & ")"
|
||||
End If
|
||||
'sValue = Text.ToolTipValue
|
||||
End If
|
||||
|
||||
+23
-1
@@ -13,6 +13,8 @@ Friend Module IniFile
|
||||
|
||||
' Livello dell'utilizzatore
|
||||
Friend m_nUserLevel As Integer = 1
|
||||
' Livello di debug
|
||||
Friend m_nDebug As Integer = 0
|
||||
' Livello della chiave inserita nel PC
|
||||
Friend m_nKeyLevel As Integer = 0
|
||||
' Opzioni attive sulla chiave
|
||||
@@ -58,9 +60,13 @@ Friend Module IniFile
|
||||
' Path del modello ListLabel
|
||||
Friend m_sListLabelCurrent As String = String.Empty
|
||||
' Path dell'eseguibile Cam5
|
||||
Friend m_sEgtCameEXEPath As String = String.Empty
|
||||
Friend m_sEgtCam5EXEPath As String = String.Empty
|
||||
' Path LuaLibs Dir
|
||||
Friend m_sLuaLibsDir As String = String.Empty
|
||||
' Path ResourcesRoot
|
||||
Friend m_sResourcesRoot As String = String.Empty
|
||||
' Path ScriptsRoot
|
||||
Friend m_sScriptsRoot As String = String.Empty
|
||||
|
||||
' EgtDoorCreator.ini
|
||||
Public Function GetPrivateProfileLanguage(ByVal lpAppName As String, ByVal lpKeyName As String) As Language
|
||||
@@ -485,4 +491,20 @@ Friend Module IniFile
|
||||
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sDoorsDirPath & "\MTables\GeometryNameList.ini")
|
||||
End Function
|
||||
|
||||
Public Function GetPrivateProfileButton(sSection As String, sKey As String, sBaseDir As String, ByRef ReadButtonItem As ButtonItem) As Boolean
|
||||
ReadButtonItem = Nothing
|
||||
Dim sVal As String = String.Empty
|
||||
GetMainPrivateProfileString(sSection, sKey, "", sVal)
|
||||
If String.IsNullOrWhiteSpace(sVal) Then Return False
|
||||
Dim sItems() As String = sVal.Split(","c)
|
||||
If sItems.Count() >= 1 Then
|
||||
Dim sLuaPath As String = sItems(0)
|
||||
Dim sImagePath As String = If(sItems.Count() >= 2, sItems(1), "")
|
||||
Dim sToolTip As String = If(sItems.Count() >= 3, sItems(2), "")
|
||||
ReadButtonItem = New ButtonItem(sLuaPath, sImagePath, sToolTip)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0" Source="/Resources/TopCommandBar/Import.png" Stretch="Uniform"
|
||||
/>
|
||||
@@ -31,7 +31,7 @@
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0" Source="/Resources/TopCommandBar/New.png" Stretch="Uniform"
|
||||
HorizontalAlignment="Left"/>
|
||||
@@ -44,7 +44,7 @@
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0" Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"
|
||||
HorizontalAlignment="Left"/>
|
||||
|
||||
@@ -12,12 +12,9 @@ Friend Class MainWindowModel
|
||||
Private m_objMutex As New Mutex
|
||||
' Variabile che indica il numero di istanze aperte del programma
|
||||
Friend m_nInstance As Integer = 0
|
||||
|
||||
' Path cartella Data
|
||||
Friend m_sDataRoot As String = String.Empty
|
||||
|
||||
Private m_nDebug As Integer = 0
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -33,10 +30,14 @@ Friend Class MainWindowModel
|
||||
IniFile.m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
|
||||
' Impostazione direttorio per file temporanei
|
||||
IniFile.m_sTempDir = m_sDataRoot & "\" & TEMP_DIR
|
||||
' Impostazione direttorio per risorse programma
|
||||
IniFile.m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
|
||||
' Impostazione direttorio scripts lua
|
||||
IniFile.m_sScriptsRoot = m_sDataRoot & "\" & SCRIPT_DIR
|
||||
' Impostazione direttorio Ini file
|
||||
IniFile.m_sIniFile = IniFile.m_sConfigDir & "\" & INI_FILE_NAME
|
||||
' Impostazione path Ini file
|
||||
EgtWPFLib5.IniFile.m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
|
||||
EgtWPFLib5.IniFile.m_sIniFile = IniFile.m_sIniFile
|
||||
' Impostazione direttorio della cartella Help
|
||||
IniFile.m_sHelpDir = m_sDataRoot & "\" & HELP_DIR
|
||||
' Impostazione direttorio della cartella Template
|
||||
@@ -56,11 +57,26 @@ Friend Class MainWindowModel
|
||||
Dim sKey As String = String.Empty
|
||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||
EgtSetKey(sKey)
|
||||
Dim sNestKey As String = ""
|
||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
||||
EgtSetNestKey(sNestKey)
|
||||
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
||||
EgtSetNetHwKey(bNetHwKey)
|
||||
' Impostazioni per chiave di rete
|
||||
Dim bNetKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
||||
EgtSetNetHwKey(bNetKey)
|
||||
Dim sLockId As String = ""
|
||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
|
||||
If Not String.IsNullOrEmpty(sLockId) Then
|
||||
EgtSetLockId(sLockId)
|
||||
End If
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2541, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2541, 1, IniFile.m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2712, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2712, 1, IniFile.m_nKeyOptions)
|
||||
' Leggo e imposto livello utilizzatore
|
||||
IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
|
||||
'Inizializzazione generale di EgtInterface
|
||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
IniFile.m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
Dim sLogFile As String = IniFile.m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||
Dim sLogMsg As String = "User " & Environment.UserName & "\" & Environment.MachineName & " (" & m_nInstance.ToString() & ")" & vbLf &
|
||||
My.Application.Info.Description.ToString() & " ver. " &
|
||||
@@ -68,7 +84,7 @@ Friend Class MainWindowModel
|
||||
"." & My.Application.Info.Version.Minor.ToString() &
|
||||
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
|
||||
My.Application.Info.Version.Revision.ToString()
|
||||
EgtInit(m_nDebug, sLogFile, sLogMsg)
|
||||
EgtInit(IniFile.m_nDebug, sLogFile, sLogMsg)
|
||||
' Carico i messaggi
|
||||
OptionModule.ReadMessages()
|
||||
' Carico direttorio doors
|
||||
@@ -102,8 +118,6 @@ Friend Class MainWindowModel
|
||||
EgtLuaRequire(sLuaBaseLib)
|
||||
' Imposto path IniFile
|
||||
EgtSetIniFile(IniFile.m_sIniFile)
|
||||
' Imposto la modalità di lettura dei file ddf
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -116,7 +130,7 @@ Friend Class MainWindowModel
|
||||
Private Sub ManageIstance()
|
||||
Dim bCreated As Boolean
|
||||
Try
|
||||
m_objMutex = New Mutex(False, "Global\EgtDOORCreator", bCreated)
|
||||
m_objMutex = New Mutex(True, "Global\EgtDOORCreator", bCreated)
|
||||
Catch
|
||||
bCreated = False
|
||||
End Try
|
||||
@@ -125,20 +139,36 @@ Friend Class MainWindowModel
|
||||
m_nInstance = 1
|
||||
' Aggiorno stato istanze attive
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString)
|
||||
' Rilascio il possesso del mutex
|
||||
m_objMutex.ReleaseMutex()
|
||||
Else
|
||||
' Leggo il massimo numero di istanze ammesse
|
||||
Const MAX_INST As Integer = 32
|
||||
Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
|
||||
nMaxInst = Max(1, Min(nMaxInst, 32))
|
||||
' Cerco il primo indice di istanza libero (max 32)
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
m_nInstance = 1
|
||||
Dim nMask As Integer = 1
|
||||
While (nTmp And nMask) <> 0 And m_nInstance <= m_nInstance
|
||||
m_nInstance += 1
|
||||
nMask *= 2
|
||||
End While
|
||||
' Se l'indice supera il massimo
|
||||
If m_nInstance > nMaxInst Then
|
||||
nMaxInst = Max(1, Min(nMaxInst, MAX_INST))
|
||||
' Richiedo il possesso del mutex
|
||||
Dim bOk As Boolean = False
|
||||
If m_objMutex.WaitOne(500) Then
|
||||
' Cerco il primo indice di istanza libero (max 32)
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
m_nInstance = 1
|
||||
Dim nMask As Integer = 1
|
||||
While (nTmp And nMask) <> 0 And m_nInstance <= m_nInstance
|
||||
m_nInstance += 1
|
||||
nMask *= 2
|
||||
End While
|
||||
' Se nuova istanza nei limiti
|
||||
If m_nInstance <= nMaxInst Then
|
||||
bOk = True
|
||||
' Aggiorno stato istanze attive
|
||||
nTmp += (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
End If
|
||||
' Rilascio il possesso del mutex
|
||||
m_objMutex.ReleaseMutex()
|
||||
End If
|
||||
' Se non è possibile continuare
|
||||
If Not bOk Then
|
||||
' porto in primo piano la prima istanza
|
||||
Dim bFound As Boolean = False
|
||||
' processi del programma a 32 bit
|
||||
@@ -162,13 +192,21 @@ Friend Class MainWindowModel
|
||||
Next
|
||||
End If
|
||||
' esco dal programma
|
||||
End
|
||||
Environment.Exit(1)
|
||||
End If
|
||||
' Aggiorno stato istanze attive
|
||||
nTmp += (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub ReleaseInstance()
|
||||
' Aggiorno istanze usate
|
||||
Dim bOk As Boolean = m_objMutex.WaitOne(1000)
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
nTmp -= (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
If bOk Then m_objMutex.ReleaseMutex()
|
||||
' Rilascio mutex
|
||||
If Not IsNothing(m_objMutex) Then m_objMutex.Close()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che cancella tutti i file in un direttorio o lo crea se non esiste
|
||||
|
||||
@@ -1,9 +1,27 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Class MainWindowV
|
||||
|
||||
Private m_args() As String = Nothing
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Public Sub New(args As String())
|
||||
|
||||
' La chiamata è richiesta dalla finestra di progettazione.
|
||||
InitializeComponent()
|
||||
' Per leggere più argomenti devono essere scritti ognuno tra doppi apici e separati da spazio
|
||||
' Esempio:"Argomento 1 di prova" "Argomento 2 di prova"
|
||||
EgtOutLog(" 1 Numero argomenti: " & args.Length.ToString)
|
||||
If args.Length > 0 Then
|
||||
m_args = args
|
||||
RunBlindCode()
|
||||
End If
|
||||
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
' Carico e imposto posizione finestra
|
||||
WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
|
||||
@@ -11,19 +29,63 @@ Class MainWindowV
|
||||
|
||||
Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
|
||||
' se è assente la chiave di protezione non mostro la finestra Launcher
|
||||
If Map.refSceneManagerVM.bProtectKey Then
|
||||
Map.refMainWindowVM.SetLauncher()
|
||||
Map.refMainWindowVM.ShowErrorCompoLoad()
|
||||
End If
|
||||
RunBlindCode()
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
|
||||
' Salvo posizione finestra (se non minimizzata)
|
||||
If WindowState <> WindowState.Minimized Then
|
||||
If WindowState <> WindowState.Minimized And Not OptionModule.AdjustDDT Then
|
||||
WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
Private Sub RunBlindCode()
|
||||
If Map.refSceneManagerVM.bProtectKey Then
|
||||
ReadArgs()
|
||||
Map.refMainWindowVM.SetLauncher()
|
||||
Map.refMainWindowVM.ShowErrorCompoLoad()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' Lettura degli argomenti e scrittura di un file di Log con i parametri caricati
|
||||
Private Sub ReadArgs()
|
||||
If Not IsNothing(m_args) Then
|
||||
' leggo gli argomenti: Il programma si chiude appena termina la scrittura del file DDF
|
||||
Dim Items() As String = m_args(0).Split(";"c)
|
||||
EgtOutLog(" Argomenti: " & m_args.ToString)
|
||||
If Items.Length >= 5 Then
|
||||
' Avvio progetto - LauncherOpt.Open_last_project (1)
|
||||
OptionModule.m_bLauncherOpenOnce = True
|
||||
' Indico il percorso del file
|
||||
OptionModule.FileNameFromArgs = Items(0)
|
||||
EgtOutLog(" File '.ddt' input : " & OptionModule.FileNameFromArgs)
|
||||
' Assegno i valore Width, Height, Thickness
|
||||
OptionModule.m_Width = Items(1)
|
||||
EgtOutLog(" width : " & OptionModule.m_Width)
|
||||
OptionModule.m_Height = Items(2)
|
||||
EgtOutLog(" height : " & OptionModule.m_Height)
|
||||
OptionModule.m_Thickness = Items(3)
|
||||
EgtOutLog(" thickness : " & OptionModule.m_Thickness)
|
||||
' Indico il percoso di salvataggio file DDF
|
||||
OptionModule.SaveFileNameFromArgs = Items(4)
|
||||
EgtOutLog(" File '.ddf' output : " & OptionModule.SaveFileNameFromArgs)
|
||||
' Nuovo parametro da laggere per gestione Swing
|
||||
If Items.Length = 6 Then
|
||||
OptionModule.ForcesSideSwing = Items(5)
|
||||
EgtOutLog(" swing : " & OptionModule.ForcesSideSwing)
|
||||
End If
|
||||
' abilito lettura dati
|
||||
OptionModule.AdjustDDT = True
|
||||
Else
|
||||
EgtOutLog(" Argomenti non conformi")
|
||||
' blocco lettura dati
|
||||
OptionModule.AdjustDDT = False
|
||||
' TERMINO TUTTO SUBITO!
|
||||
End
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
+40
-16
@@ -8,6 +8,16 @@ Public Class MainWindowVM
|
||||
|
||||
' Modello del MainWindow (classe vera e propria)
|
||||
Private m_MainWindowModel As New MainWindowModel
|
||||
Friend ReadOnly Property MainWindowModel As MainWindowModel
|
||||
Get
|
||||
Return m_MainWindowModel
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Instance As Integer
|
||||
Get
|
||||
Return m_MainWindowModel.m_nInstance
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_VisibilityAssemblyManager As Visibility = Visibility.Visible
|
||||
Public Property VisibilityAssemblyManager As Visibility
|
||||
@@ -65,9 +75,14 @@ Public Class MainWindowVM
|
||||
Return m_SelectedPage
|
||||
End Get
|
||||
Set(value As ListPageEnum)
|
||||
m_SelectedPage = value
|
||||
NotifyPropertyChanged("PageControl")
|
||||
Map.refInstrumentPanelVM.NotifyPropertyChanged("DimensionVisibility")
|
||||
' Verifico che sia una vera modifica
|
||||
If m_SelectedPage <> value Then
|
||||
m_SelectedPage = value
|
||||
NotifyPropertyChanged("PageControl")
|
||||
If Not IsNothing(Map.refInstrumentPanelVM) Then
|
||||
Map.refInstrumentPanelVM.NotifyPropertyChanged("DimensionVisibility")
|
||||
End If
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -84,20 +99,20 @@ Public Class MainWindowVM
|
||||
Public ReadOnly Property PageControl As ContentControl
|
||||
Get
|
||||
If m_SelectedPage = ListPageEnum.nDDFPage Then
|
||||
If OptionModule.m_SingleDoor then
|
||||
If OptionModule.m_SingleDoor Then
|
||||
VisibilityAssemblyManager = Visibility.Hidden
|
||||
Else
|
||||
VisibilityAssemblyManager = Visibility.Visible
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("AssemblyManagerControl")
|
||||
NotifyPropertyChanged("ProjectManagerControl")
|
||||
Return m_PartPage
|
||||
ElseIf m_SelectedPage = ListPageEnum.nAssemblyPage Then
|
||||
If OptionModule.m_SingleDoor then
|
||||
If OptionModule.m_SingleDoor Then
|
||||
VisibilityAssemblyManager = Visibility.Hidden
|
||||
Else
|
||||
VisibilityAssemblyManager = Visibility.Visible
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("AssemblyManagerControl")
|
||||
NotifyPropertyChanged("ProjectManagerControl")
|
||||
Return m_AssemblyPage
|
||||
@@ -107,11 +122,11 @@ Public Class MainWindowVM
|
||||
NotifyPropertyChanged("ProjectManagerControl")
|
||||
Return m_HardwarePage
|
||||
Else
|
||||
If OptionModule.m_SingleDoor then
|
||||
If OptionModule.m_SingleDoor Then
|
||||
VisibilityAssemblyManager = Visibility.Hidden
|
||||
Else
|
||||
VisibilityAssemblyManager = Visibility.Visible
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("AssemblyManagerControl")
|
||||
NotifyPropertyChanged("ProjectManagerControl")
|
||||
Return Nothing
|
||||
@@ -137,7 +152,7 @@ Public Class MainWindowVM
|
||||
|
||||
Public ReadOnly Property ProjectManagerControl As ContentControl
|
||||
Get
|
||||
If m_SelectedPage <> ListPageEnum.nHardwarePage then
|
||||
If m_SelectedPage <> ListPageEnum.nHardwarePage Then
|
||||
Return m_ProjectManager
|
||||
Else
|
||||
ProjectNameMsg = "HardwareManager"
|
||||
@@ -153,6 +168,7 @@ Public Class MainWindowVM
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
EgtOutLog(" Creazione e inizializzazone MainWondowVM ")
|
||||
Map.SetRefMainWindowVM(Me)
|
||||
m_AssemblyPage = New AssemblyPageV
|
||||
m_AssemblyPage.DataContext = New AssemblyPageVM
|
||||
@@ -166,7 +182,6 @@ Public Class MainWindowVM
|
||||
m_HardwarePage.DataContext = New HardwarePageVM
|
||||
m_AssemblyManager = New AssemblyManagerV
|
||||
m_AssemblyManager.DataContext = New AssemblyManagerVM
|
||||
' inserisco la scena
|
||||
m_SceneManager = New SceneManagerV
|
||||
m_SceneManager.DataContext = New SceneManagerVM
|
||||
Dim OptionsPage As OptionsVM = OptionPage
|
||||
@@ -311,7 +326,7 @@ Public Class MainWindowVM
|
||||
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
||||
If StartReload Then Return
|
||||
' 50545 = It has been deleted file: {0}, {1}.
|
||||
Dim Message As String = String.Format(EgtMsg(50545), e.FullPath, e.ChangeType)
|
||||
Dim Message As String = String.Format(EgtMsg(50545), e.FullPath, e.ChangeType)
|
||||
selectedWatcher = WatcherCalling.OnDeleted
|
||||
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
||||
RaiseEvent Er(Message, e.FullPath)
|
||||
@@ -324,7 +339,7 @@ Public Class MainWindowVM
|
||||
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
||||
If StartReload Then Return
|
||||
' 50543 = It has been renamed file: {0}, {1}.
|
||||
Dim Message As String = String.Format(EgtMsg(50543), e.FullPath, e.ChangeType)
|
||||
Dim Message As String = String.Format(EgtMsg(50543), e.FullPath, e.ChangeType)
|
||||
selectedWatcher = WatcherCalling.OnRenamed
|
||||
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
||||
RaiseEvent Er(Message, e.FullPath)
|
||||
@@ -337,7 +352,7 @@ Public Class MainWindowVM
|
||||
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
||||
If StartReload Then Return
|
||||
' 50544 = It has been created new file: {0}, {1}.
|
||||
Dim Message As String =String.Format(EgtMsg(50544), e.FullPath, e.ChangeType)
|
||||
Dim Message As String = String.Format(EgtMsg(50544), e.FullPath, e.ChangeType)
|
||||
selectedWatcher = WatcherCalling.OnCreated
|
||||
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
||||
RaiseEvent Er(Message, e.FullPath)
|
||||
@@ -366,6 +381,10 @@ Public Class MainWindowVM
|
||||
Case LauncherOpt.Open_last_project
|
||||
' se definito ultimo progetto, lo apro
|
||||
If GetMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, "", m_sLastProject) > 0 Then
|
||||
' se caricato il nome in avvio del programma allora sovrascrivo
|
||||
If OptionModule.AdjustDDT Then
|
||||
m_sLastProject = OptionModule.FileNameFromArgs
|
||||
End If
|
||||
Map.refProjectManagerVM.OpenLastProject()
|
||||
End If
|
||||
Case Else
|
||||
@@ -420,7 +439,6 @@ Public Class MainWindowVM
|
||||
End If
|
||||
Map.refHardwarePageVM.CurrHardware.DeleteTempFile()
|
||||
End If
|
||||
Utility.UnLockDir()
|
||||
Case Else
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
|
||||
Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name))
|
||||
@@ -452,9 +470,15 @@ Public Class MainWindowVM
|
||||
Not String.IsNullOrWhiteSpace(Map.refAssemblyManagerVM.CurrProject.Name) Then
|
||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
End If
|
||||
|
||||
' Terminazione generale di EgtInterface
|
||||
EgtExit()
|
||||
Application.Current.MainWindow.Close()
|
||||
' Libero eventuale porta bloccata
|
||||
Utility.UnLockDir()
|
||||
' Aggiorno istanze usate
|
||||
m_MainWindowModel.ReleaseInstance()
|
||||
' Chiudo la finestra principale del programma
|
||||
Application.Current.MainWindow.Close()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
Private m_refOptionsVM As OptionsVM
|
||||
|
||||
Private m_refSpecialPanelVM As SpecialPanelVM
|
||||
|
||||
#Region "Get"
|
||||
|
||||
Public ReadOnly Property refMainWindowVM As MainWindowVM
|
||||
@@ -148,6 +150,12 @@
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSpecialPanelVM As SpecialPanelVM
|
||||
Get
|
||||
Return m_refSpecialPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Get
|
||||
|
||||
#Region "Set"
|
||||
@@ -252,6 +260,11 @@
|
||||
Return Not IsNothing(m_refHardwareHelpSceneHostV)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefSpecialPanelVM(SpecialPanelVM As SpecialPanelVM) As Boolean
|
||||
m_refSpecialPanelVM = SpecialPanelVM
|
||||
Return Not IsNothing(m_refSpecialPanelVM)
|
||||
End Function
|
||||
|
||||
#End Region ' Set
|
||||
|
||||
#Region "Init"
|
||||
|
||||
@@ -22,17 +22,17 @@ Imports System.Windows
|
||||
#End if
|
||||
#Else
|
||||
#If DEBUG Then
|
||||
<Assembly: AssemblyTitle("EgtDOORCreator Debug 32 bit")>
|
||||
<Assembly: AssemblyDescription("EgtDOORCreatorD32.exe")>
|
||||
<Assembly: AssemblyTitle("EgtDOORCreatorD32.exe")>
|
||||
<Assembly: AssemblyDescription("EgtDOORCreator Debug 32 bit")>
|
||||
#Else
|
||||
<Assembly: AssemblyTitle("EgtDOORCreator Release 32 bit")>
|
||||
<Assembly: AssemblyDescription("EgtDOORCreatorR32.exe")>
|
||||
<Assembly: AssemblyTitle("EgtDOORCreatorR32.exe")>
|
||||
<Assembly: AssemblyDescription("EgtDOORCreator 32 bit")>
|
||||
#End If
|
||||
#End If
|
||||
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("EgtDOORCreator")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016-2023 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016-2026 by Egalware 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.5.4.1")>
|
||||
<Assembly: AssemblyFileVersion("2.5.4.1")>
|
||||
<Assembly: AssemblyVersion("3.1.1.1")>
|
||||
<Assembly: AssemblyFileVersion("3.1.1.1")>
|
||||
|
||||
+26
-10
@@ -23,24 +23,40 @@
|
||||
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- A list of all Windows versions that this application is designed to work with.
|
||||
Windows will automatically select the most compatible environment.-->
|
||||
<!-- A list of the Windows versions that this application has been tested on
|
||||
and is designed to work with. Uncomment the appropriate elements
|
||||
and Windows will automatically select the most compatible environment. -->
|
||||
|
||||
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
|
||||
<!-- Windows Vista -->
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
|
||||
|
||||
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
|
||||
<!-- Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
|
||||
|
||||
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
|
||||
<!-- Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
|
||||
|
||||
<!-- If your application is designed to work with Windows 8.1, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>-->
|
||||
<!-- Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
|
||||
|
||||
<!-- Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
|
||||
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
|
||||
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
|
||||
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
|
||||
<!--
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
-->
|
||||
|
||||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
||||
<!-- <dependency>
|
||||
<dependentAssembly>
|
||||
|
||||
@@ -7,6 +7,16 @@ Friend Module OptionModule
|
||||
' flag per modalità di visualizzazione file (solo lettura)
|
||||
Friend ReadOnlyDDF As Boolean = False
|
||||
|
||||
' gestione bottoni nella barra SpecialPanel
|
||||
Friend IsActiveSpecialPanel As Boolean = False
|
||||
|
||||
' flag per forzare l'aggiornamento delle dimensioni anta dei file DDT
|
||||
Friend AdjustDDT As Boolean = False
|
||||
Friend FileNameFromArgs As String = String.Empty
|
||||
Friend SaveFileNameFromArgs As String = String.Empty
|
||||
' Forza la scrittura dello swing Left(L..) oppure Right(R..)
|
||||
Friend ForcesSideSwing As String = String.Empty
|
||||
|
||||
' Parametri che contengono lista delle lingue disponibili e lingua selezionata
|
||||
Friend m_LanguageList As New ObservableCollection(Of Language)
|
||||
Friend m_SelectedLanguage As Language
|
||||
@@ -236,7 +246,7 @@ Friend Module OptionModule
|
||||
' 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
|
||||
ElseIf GetMainPrivateProfileInt(S_GENERAL, K_READONLY, 0) <> 0 Then
|
||||
OptionModule.ReadOnlyDDF = True
|
||||
Else
|
||||
OptionModule.ReadOnlyDDF = False
|
||||
@@ -326,7 +336,7 @@ Friend Module OptionModule
|
||||
Dim sEgtCam5EXE As String = String.Empty
|
||||
' AndAlso File.Exists(sListLabelFile)
|
||||
If GetMainPrivateProfileString(S_GENERAL, K_EGTCAMEXE, "", sEgtCam5EXE) > 0 Then
|
||||
IniFile.m_sEgtCameEXEPath = sEgtCam5EXE
|
||||
IniFile.m_sEgtCam5EXEPath = sEgtCam5EXE
|
||||
End If
|
||||
|
||||
Dim nHelpSelct As Integer = 0
|
||||
@@ -434,19 +444,19 @@ Friend Module OptionModule
|
||||
|
||||
Dim Width As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_SIZE_INI, K_WIDTH_INI, "32", Width)
|
||||
Utility.ConvertCompoConfig(Width, 500)
|
||||
Utility.ConvertCompoConfig(Width, 9999)
|
||||
m_Width = Width
|
||||
Dim dWidth As Double
|
||||
If StringToDouble(m_Width, dWidth) Then EgtLuaSetGlobNumVar("W", dWidth)
|
||||
Dim Height As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_SIZE_INI, K_HEIGHT_INI, "80", Height)
|
||||
Utility.ConvertCompoConfig(Height, 500)
|
||||
Utility.ConvertCompoConfig(Height, 9999)
|
||||
m_Height = Height
|
||||
Dim dHeight As Double
|
||||
If StringToDouble(m_Height, dHeight) Then EgtLuaSetGlobNumVar("H", dHeight)
|
||||
Dim Thickness As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_SIZE_INI, K_THICKNESS_INI, "1.75", Thickness)
|
||||
Utility.ConvertCompoConfig(Thickness, 100)
|
||||
Utility.ConvertCompoConfig(Thickness, 9999)
|
||||
m_Thickness = Thickness
|
||||
Dim dThickness As Double
|
||||
If StringToDouble(m_Thickness, dThickness) Then EgtLuaSetGlobNumVar("T", dThickness)
|
||||
@@ -770,6 +780,9 @@ Friend Module OptionModule
|
||||
DefaultGetPrivateProfileString(S_OVERMATERIALASSEMBLY, K_BOTTOMOVERMATERIAL_INI, "0", BottomOverMaterialAss)
|
||||
Utility.ConvertCompoConfig(BottomOverMaterialAss, 100)
|
||||
m_BottomOverMaterialAssembly = BottomOverMaterialAss
|
||||
' Visualizzazione SpecialPanel
|
||||
Dim btDummy As ButtonItem = Nothing
|
||||
IsActiveSpecialPanel = GetMainPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) <> 0 AndAlso GetPrivateProfileButton(S_SPECIAL, K_BUTTON & "1", "", btDummy)
|
||||
|
||||
' Lista messaggi per launcher
|
||||
m_OptionLauncherList.Add(EgtMsg(50206)) 'Open Window
|
||||
@@ -1050,13 +1063,13 @@ Friend Module OptionModule
|
||||
Return False
|
||||
End If
|
||||
Dim Items As String() = Directory.GetFiles(sMTableDir)
|
||||
' recupero i file che hanno estemsione *.mtl
|
||||
' recupero i file che hanno estemsione *.mtl e non sono esclusi
|
||||
Dim ExcludeList As List(Of String) = GetExludeList()
|
||||
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
|
||||
@@ -1076,17 +1089,17 @@ Friend Module OptionModule
|
||||
End If
|
||||
' leggo il nome della MTable attiva
|
||||
Dim sSelectedMTable As String = String.Empty
|
||||
Dim nbSelected As Boolean = False
|
||||
Dim bSelected 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
|
||||
bSelected = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If Not nbSelected Then m_SelectedMTable = m_MTableList(0)
|
||||
If Not bSelected Then m_SelectedMTable = m_MTableList(0)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -1094,10 +1107,12 @@ Friend Module OptionModule
|
||||
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
|
||||
If Not String.IsNullOrWhiteSpace( sVal) Then
|
||||
Dim sItems As String() = sVal.Split(","c)
|
||||
For Each Item As String In sItems
|
||||
LocalList.Add(Item.Trim)
|
||||
Next
|
||||
End If
|
||||
Return LocalList
|
||||
End Function
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ Public Class OptionsVM
|
||||
|
||||
Public ReadOnly Property EnableConfig As Boolean
|
||||
Get
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) > 4 And File.Exists(IniFile.m_sConfigDir & "\ChangeConfig.lua") Then
|
||||
If IniFile.m_nUserLevel > 4 AndAlso File.Exists(IniFile.m_sConfigDir & "\ChangeConfig.lua") Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
@@ -2065,35 +2065,40 @@ Public Class OptionsVM
|
||||
OptionsWindow.Close()
|
||||
End If
|
||||
Next
|
||||
|
||||
If EnableConfig AndAlso m_IsChangedConfig Then
|
||||
' Se modifico il direttorio Compo: aggiorno il file Config.ini dell'EgtCAM5
|
||||
EgtLuaExecFile(IniFile.m_sConfigDir & "\ChangeConfig.lua")
|
||||
' assegno variabili
|
||||
EgtLuaSetGlobStringVar("CCD.NewBaseDir", IniFile.m_sDoorsDirPath)
|
||||
EgtLuaSetGlobStringVar("CCD.NewMTable", OptionModule.m_SelectedMTable.Name)
|
||||
' eseguo la funzione che esegue la scrittura delle variabili
|
||||
EgtLuaCallFunction("CCD.ChangeConfigDirectory")
|
||||
Dim sVal As String = ""
|
||||
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
||||
OptionModule.m_CurrentMachine = sVal
|
||||
EgtLuaResetGlobVar("CCD")
|
||||
' chiudo il programma e lo riavvio
|
||||
Map.refMainWindowVM.CloseApplication()
|
||||
Process.Start(Application.ResourceAssembly.Location)
|
||||
'End If
|
||||
ElseIf EnableConfig AndAlso m_OrigMTable <> OptionModule.m_SelectedMTable.Name Then
|
||||
' aggiorno il file Config.ini dell'EgtCAM5
|
||||
EgtLuaExecFile(IniFile.m_sConfigDir & "\ChangeConfig.lua")
|
||||
' assegno variabili
|
||||
EgtLuaSetGlobStringVar("CCD.NewBaseDir", IniFile.m_sDoorsDirPath)
|
||||
EgtLuaSetGlobStringVar("CCD.NewMTable", OptionModule.m_SelectedMTable.Name)
|
||||
' eseguo la funzione che esegue la scrittura delle variabili
|
||||
EgtLuaCallFunction("CCD.ChangeConfigDirectory")
|
||||
Dim sVal As String = ""
|
||||
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
||||
OptionModule.m_CurrentMachine = sVal
|
||||
EgtLuaResetGlobVar("CCD")
|
||||
' Se abilitata modifica configurazione
|
||||
If EnableConfig Then
|
||||
' Se cambiato direttorio Doors
|
||||
If m_IsChangedConfig Then
|
||||
' Se modifico il direttorio Compo: aggiorno il file Config.ini dell'EgtCAM5
|
||||
EgtLuaExecFile(IniFile.m_sConfigDir & "\ChangeConfig.lua")
|
||||
' assegno variabili
|
||||
EgtLuaSetGlobStringVar("CCD.NewBaseDir", IniFile.m_sDoorsDirPath)
|
||||
EgtLuaSetGlobStringVar("CCD.NewMTable", OptionModule.m_SelectedMTable.Name)
|
||||
' eseguo la funzione che esegue la scrittura delle variabili
|
||||
EgtLuaCallFunction("CCD.ChangeConfigDirectory")
|
||||
Dim sVal As String = ""
|
||||
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
||||
OptionModule.m_CurrentMachine = sVal
|
||||
WriteMainPrivateProfileString(S_DOORS, K_MTABLE, OptionModule.m_SelectedMTable.FilePath)
|
||||
EgtLuaResetGlobVar("CCD")
|
||||
' chiudo il programma e lo riavvio
|
||||
Map.refMainWindowVM.CloseApplication()
|
||||
Process.Start(Application.ResourceAssembly.Location)
|
||||
' se altrimenti cambiata MTable
|
||||
ElseIf m_OrigMTable <> OptionModule.m_SelectedMTable.Name Then
|
||||
' aggiorno il file Config.ini dell'EgtCAM5
|
||||
EgtLuaExecFile(IniFile.m_sConfigDir & "\ChangeConfig.lua")
|
||||
' assegno variabili
|
||||
EgtLuaSetGlobStringVar("CCD.NewBaseDir", IniFile.m_sDoorsDirPath)
|
||||
EgtLuaSetGlobStringVar("CCD.NewMTable", OptionModule.m_SelectedMTable.Name)
|
||||
' eseguo la funzione che esegue la scrittura delle variabili
|
||||
EgtLuaCallFunction("CCD.ChangeConfigDirectory")
|
||||
Dim sVal As String = ""
|
||||
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
||||
OptionModule.m_CurrentMachine = sVal
|
||||
WriteMainPrivateProfileString(S_DOORS, K_MTABLE, OptionModule.m_SelectedMTable.FilePath)
|
||||
EgtLuaResetGlobVar("CCD")
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
+14
-10
@@ -66,10 +66,18 @@ Public Class OrderVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Function VerifyNotIsNothing() As Boolean
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) OrElse
|
||||
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) OrElse
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count < 1 Then
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Property Customer As String
|
||||
Get
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
|
||||
If Not VerifyNotIsNothing() Then Return Nothing
|
||||
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Customer
|
||||
End Get
|
||||
Set(value As String)
|
||||
@@ -83,8 +91,7 @@ Public Class OrderVM
|
||||
|
||||
Public Property Elevation As String
|
||||
Get
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
|
||||
If Not VerifyNotIsNothing() Then Return Nothing
|
||||
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Elevation
|
||||
End Get
|
||||
Set(value As String)
|
||||
@@ -98,8 +105,7 @@ Public Class OrderVM
|
||||
|
||||
Public Property Project As String
|
||||
Get
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
|
||||
If Not VerifyNotIsNothing() Then Return Nothing
|
||||
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Project
|
||||
End Get
|
||||
Set(value As String)
|
||||
@@ -113,8 +119,7 @@ Public Class OrderVM
|
||||
|
||||
Public Property PO As String
|
||||
Get
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
|
||||
If Not VerifyNotIsNothing() Then Return Nothing
|
||||
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.PO
|
||||
End Get
|
||||
Set(value As String)
|
||||
@@ -128,8 +133,7 @@ Public Class OrderVM
|
||||
|
||||
Public Property Line As String
|
||||
Get
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
|
||||
If Not VerifyNotIsNothing() Then Return Nothing
|
||||
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Line
|
||||
End Get
|
||||
Set(value As String)
|
||||
|
||||
@@ -361,6 +361,8 @@ Public Class ProjectManagerHardwareVM
|
||||
End If
|
||||
Try
|
||||
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
|
||||
zip.AlternateEncodingUsage = Ionic.Zip.ZipOption.Always
|
||||
zip.AlternateEncoding = Text.Encoding.UTF8
|
||||
' aggiungo progetto corrente .nge
|
||||
If File.Exists(sCurrProject) Then
|
||||
zip.AddItem(sCurrProject, "")
|
||||
|
||||
@@ -1,42 +1,43 @@
|
||||
<UserControl x:Class="ProjectManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:DOORCreator="clr-namespace:EgtDOORCreator" >
|
||||
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding EnableProjectManager}" Height="32">
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
<Button Command="{Binding NewCommand}" ToolTip="{Binding NewToolTip}" Focusable="False"
|
||||
<!--Barra superiore dei comandi-->
|
||||
<Button Command="{Binding NewCommand}" ToolTip="{Binding NewToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="{Binding NewProjectImg}" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<!--Visibility="{Binding VisibilityDeleteDDF}"-->
|
||||
</Button>
|
||||
<!--Visibility="{Binding VisibilityDeleteDDF}"-->
|
||||
<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}"
|
||||
</Button>
|
||||
<Button Command="{Binding OpenCommand}" ToolTip="{Binding OpenToolTip}"
|
||||
Focusable="False"
|
||||
ContextMenuService.Placement="Bottom"
|
||||
Tag="{Binding}">
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding MruFileNames}">
|
||||
<ContextMenu.Resources>
|
||||
<Style TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="Command"
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding MruFileNames}">
|
||||
<ContextMenu.Resources>
|
||||
<Style TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="Command"
|
||||
Value="{Binding PlacementTarget.Tag.OpenMruFileCommand,
|
||||
RelativeSource={RelativeSource Mode=FindAncestor,
|
||||
AncestorType=ContextMenu}}"/>
|
||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||
</Style>
|
||||
</ContextMenu.Resources>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
<Image Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ReloadCommand}" ToolTip="{Binding ReloadToolTip}" Focusable="False"
|
||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||
</Style>
|
||||
</ContextMenu.Resources>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
<Image Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ReloadCommand}" ToolTip="{Binding ReloadToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding SaveCommand}" ToolTip="{Binding SaveToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Save.png" Stretch="Uniform"/>
|
||||
@@ -44,74 +45,77 @@
|
||||
</Button>
|
||||
<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"
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding CreateTemplateCommand}" ToolTip="{Binding TemplateDoorToolTip}" Focusable="False"
|
||||
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"
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAsTemplate.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<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"
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Export.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding OpenCamCommand}" ToolTip="{Binding OpenCamToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityEgtCAM}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/EgtCAM5.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding PrintCommand}" ToolTip="{Binding PrintToolTip}" Focusable="False">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/InstrumentPanel/Print.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<!--<Button Command="{Binding RefreshDirCommand}" ToolTip="{Binding RefreshDirToolTip}" Focusable="False">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/InstrumentPanel/Print.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<!--<Button Command="{Binding RefreshDirCommand}" ToolTip="{Binding RefreshDirToolTip}" Focusable="False">
|
||||
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
<!--Hardware-->
|
||||
<!--<Button Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}" Focusable="False"
|
||||
<!--Hardware-->
|
||||
<!--<Button Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}" Focusable="False"
|
||||
Visibility="{Binding DisableHM}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/InstrumentPanel/Hardware.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>-->
|
||||
<Button Command="{Binding CreateAssemblyCommand}" ToolTip="{Binding CreateAssemblyToolTip}" Focusable="False"
|
||||
<Button Command="{Binding CreateAssemblyCommand}" ToolTip="{Binding CreateAssemblyToolTip}" Focusable="False"
|
||||
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"
|
||||
<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}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
||||
</Button>
|
||||
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}" Focusable="False"
|
||||
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
||||
</Button>
|
||||
|
||||
<DOORCreator:SpecialPanelV DataContext="{StaticResource SpecialPanelVM}"/>
|
||||
|
||||
<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">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Help.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<!--Door-->
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
<Image Source="/Resources/TopCommandBar/Send.png" Height="22" Margin="3,0,3,0" />
|
||||
</Button>
|
||||
<Button Command="{Binding GuideCommand}" ToolTip="{Binding GuideToolTip}" Focusable="False">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Help.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<!--Door-->
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
ToolTip="{Binding DoorToolTip}"
|
||||
IsChecked="{Binding DoorIsChecked}"
|
||||
Content="{Binding DoorToolTip}"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
</RadioButton>
|
||||
<!--Hardware-->
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
</RadioButton>
|
||||
<!--Hardware-->
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}"
|
||||
Content="{Binding HardwareToolTip}"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -6,7 +6,7 @@ Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports Ionic.zip
|
||||
Imports Ionic.Zip
|
||||
|
||||
Public Class ProjectManagerVM
|
||||
Implements INotifyPropertyChanged
|
||||
@@ -67,11 +67,11 @@ Public Class ProjectManagerVM
|
||||
|
||||
Public ReadOnly Property VisibilityEgtCAM As Visibility
|
||||
Get
|
||||
If String.IsNullOrEmpty(IniFile.m_sEgtCameEXEPath) Then
|
||||
If String.IsNullOrEmpty(IniFile.m_sEgtCam5EXEPath) Then
|
||||
Return Visibility.Collapsed
|
||||
ElseIf Not File.Exists(IniFile.m_sEgtCameEXEPath) Then
|
||||
ElseIf Not File.Exists(IniFile.m_sEgtCam5EXEPath) Then
|
||||
Return Visibility.Collapsed
|
||||
ElseIf File.Exists(IniFile.m_sEgtCameEXEPath) Then
|
||||
ElseIf File.Exists(IniFile.m_sEgtCam5EXEPath) Then
|
||||
Return Visibility.Visible
|
||||
Else
|
||||
Return Visibility.Collapsed
|
||||
@@ -411,10 +411,10 @@ Public Class ProjectManagerVM
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Visible
|
||||
Return
|
||||
End If
|
||||
'-------------------------------------------------------------------------------------------------------------------------
|
||||
'-------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
'Prima di tutto chiedo se vuole aprire un template
|
||||
Dim sImportTemplate As String = Map.refAssemblyManagerVM.ShowDialogImportTemplate
|
||||
'Prima di tutto chiedo se vuole aprire un template
|
||||
Dim sImportTemplate As String = Map.refAssemblyManagerVM.ShowDialogImportTemplate
|
||||
|
||||
' dichiaro la finestra di dialogo
|
||||
Dim saveFileDialog1 As New System.Windows.Forms.SaveFileDialog()
|
||||
@@ -476,6 +476,7 @@ Public Class ProjectManagerVM
|
||||
' creo un nuovo assemblato
|
||||
Dim Local_AssemblyName As New AssemblyName
|
||||
Local_AssemblyName.Name = FilePathComplete
|
||||
Local_AssemblyName.OrigTemplate = sImportTemplate
|
||||
Local_AssemblyName.GraphicName = Path.GetFileNameWithoutExtension(FilePathComplete)
|
||||
m_CurrProject.AssemblyList.Add(Local_AssemblyName)
|
||||
' Seleziono AssembyName creato
|
||||
@@ -487,13 +488,17 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
' tolgo la visualizzazione della lista dei nomi
|
||||
Map.refAssemblyManagerVM.CurrProject = CurrProject
|
||||
Map.refAssemblyManagerVM.ImportTemplate(sImportTemplate)
|
||||
Dim bImportedTemplate As Boolean = Map.refAssemblyManagerVM.ImportTemplate(sImportTemplate)
|
||||
' Creo nuovo assembly
|
||||
Map.refAssemblyManagerVM.NewCmd(Local_AssemblyName)
|
||||
Utility.OutLog("Creazione nuovo progetto : " & saveFileDialog1.FileName)
|
||||
Utility.LockDir(Path.GetDirectoryName(saveFileDialog1.FileName), Path.GetFileNameWithoutExtension(saveFileDialog1.FileName))
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Collapsed
|
||||
CurrProject.NotifyPropertyChanged("Name")
|
||||
' Se l'importazione del template è andata a buon fine allora salvo
|
||||
If bImportedTemplate Then
|
||||
Save()
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -682,8 +687,8 @@ Public Class ProjectManagerVM
|
||||
fd.InitialDirectory = IniFile.m_MyProjectDir
|
||||
End If
|
||||
' seleziono il filtro di apertura
|
||||
fd.Filter = "(*.ddt) |*.ddt|(*.ddf) |*.ddf"
|
||||
fd.FilterIndex = 2
|
||||
fd.Filter = "(*.ddf) |*.ddf|(*.ddt) |*.ddt"
|
||||
fd.FilterIndex = GetCurrentFilter()
|
||||
fd.RestoreDirectory = True
|
||||
' apro la finestra di dialogo
|
||||
If fd.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
|
||||
@@ -698,6 +703,8 @@ Public Class ProjectManagerVM
|
||||
sFilePath = Path.GetDirectoryName(fd.FileName)
|
||||
' salvo il nome completo del file
|
||||
sFilePathComplete = fd.FileName
|
||||
' salvo l'estensione dell'ultimo progetto aperto
|
||||
WriteMainPrivateProfileString("General", "LastExtensionOpened", Path.GetExtension(fd.FileName).ToLower)
|
||||
' se esiste un file in lettura con questo nome allora blocco tutto
|
||||
If Utility.IsFileLocked(sFilePath, Path.GetFileNameWithoutExtension(sFilePathComplete)) Then
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
@@ -841,6 +848,21 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function GetCurrentFilter() As Integer
|
||||
Dim nFilter As Integer = 1
|
||||
Dim sExt As String = String.Empty
|
||||
GetMainPrivateProfileString("General", "LastExtensionOpened", "ddf", sExt)
|
||||
sExt = sExt.Replace("."c, "")
|
||||
sExt = sExt.Trim
|
||||
Select Case sExt
|
||||
Case = "ddf"
|
||||
nFilter = 1
|
||||
Case = "ddt"
|
||||
nFilter = 2
|
||||
End Select
|
||||
Return nFilter
|
||||
End Function
|
||||
|
||||
#End Region ' OpenCommand
|
||||
|
||||
#Region "OpenMruFileCommand"
|
||||
@@ -982,7 +1004,13 @@ Public Class ProjectManagerVM
|
||||
Local_Assembly.IsModified = False
|
||||
CurrProject.AssemblyList.Add(Local_Assembly)
|
||||
Else
|
||||
EgtOutLog("LastProject '" & OptionModule.m_sLastProject & "' is not a file or does not exist!")
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
If OptionModule.AdjustDDT Then
|
||||
EgtExit()
|
||||
Map.refMainWindowVM.MainWindowModel.ReleaseInstance()
|
||||
Application.Current.Shutdown(3)
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
Else
|
||||
@@ -1121,6 +1149,8 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
Try
|
||||
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
|
||||
zip.AlternateEncodingUsage = Ionic.Zip.ZipOption.Always
|
||||
zip.AlternateEncoding = Text.Encoding.UTF8
|
||||
' aggiungo progetto corrente .nge
|
||||
If File.Exists(sCurrProject) Then
|
||||
zip.AddItem(sCurrProject, "")
|
||||
@@ -1186,17 +1216,48 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
' se esite una porta, allora rendo possibile la creazione di un template della porta corrente
|
||||
If Not IsNothing(Map.refPartPageVM.CurrPart) Then
|
||||
' Stampo il file correte nella cartella Template
|
||||
Dim SaveFileDialog As New MySaveFileDialogVM
|
||||
Dim SaveFileDialogWnd As New EgtWPFLib5.SaveFileDialogV(Application.Current.MainWindow, SaveFileDialog)
|
||||
SaveFileDialog.Title = EgtMsg(50417)
|
||||
SaveFileDialog.Directory = IniFile.m_TemplateDir
|
||||
SaveFileDialog.Extension = DDT_EXTENSION
|
||||
'SaveFileDialog.FileName = m_CurrProject.Name & "\"
|
||||
' se decido di chiuedere la finestra
|
||||
If Not SaveFileDialogWnd.ShowDialog Then
|
||||
|
||||
' ' Stampo il file correte nella cartella Template
|
||||
' Dim SaveFileDialog As New MySaveFileDialogVM
|
||||
' Dim SaveFileDialogWnd As New EgtWPFLib5.SaveFileDialogV(Application.Current.MainWindow, SaveFileDialog)
|
||||
' SaveFileDialog.Title = EgtMsg(50417)
|
||||
' SaveFileDialog.Directory = IniFile.m_TemplateDir
|
||||
' SaveFileDialog.Extension = DDT_EXTENSION
|
||||
' 'SaveFileDialog.FileName = m_CurrProject.Name & "\"
|
||||
' ' se decido di chiuedere la finestra
|
||||
' If Not SaveFileDialogWnd.ShowDialog Then
|
||||
' Return
|
||||
' End If
|
||||
|
||||
' Apro la finestra di salvataggio generica
|
||||
Dim SaveFileDialog As New System.Windows.Forms.SaveFileDialog()
|
||||
' controllo se esiste il file DDF
|
||||
Dim sFilePath As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
If File.Exists(sFilePath) Then
|
||||
' recupero il nome del template che ha generato il DDF corrente
|
||||
Dim DDTOrig As String = String.Empty
|
||||
Dim fStream As String() = File.ReadAllLines(sFilePath)
|
||||
DDTOrig = ReadOrigTemplate(fStream)
|
||||
SaveFileDialog.Filter = "(*.ddt) |*.ddt"
|
||||
SaveFileDialog.FilterIndex = 2
|
||||
If String.IsNullOrEmpty(DDTOrig) Then
|
||||
If OptionModule.m_SingleDoor Then
|
||||
SaveFileDialog.FileName = Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name)
|
||||
Else
|
||||
SaveFileDialog.FileName = Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
End If
|
||||
Else
|
||||
SaveFileDialog.FileName = Path.GetFileNameWithoutExtension(DDTOrig)
|
||||
End If
|
||||
End If
|
||||
|
||||
' avvio la ricerca nell'ultimo direttorio aperto
|
||||
SaveFileDialog.InitialDirectory = IniFile.m_TemplateDir
|
||||
If SaveFileDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
|
||||
' Interrompo la creazione del template
|
||||
Return
|
||||
End If
|
||||
|
||||
' Controllo se ha estensione il nome della porta
|
||||
If Path.HasExtension(SaveFileDialog.FileName) Then
|
||||
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName)
|
||||
@@ -1274,7 +1335,7 @@ Public Class ProjectManagerVM
|
||||
Case MessageBoxResult.Yes
|
||||
For IndexFile As Integer = 0 To Map.refAssemblyManagerVM.CurrProject.AssemblyList.Count - 1
|
||||
' controllo che abbia estensione ddf
|
||||
If Path.GetExtension(Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).Name) = ".ddf" Then
|
||||
If Path.GetExtension(Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).Name).ToLower = ".ddf" Then
|
||||
Dim SouFile As String = Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).Name
|
||||
Dim DestFile As String = Path.Combine(MachinProject, Path.GetFileName(SouFile))
|
||||
Try
|
||||
@@ -1314,15 +1375,13 @@ Public Class ProjectManagerVM
|
||||
|
||||
Public Sub OpenCam()
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject) OrElse
|
||||
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
' 50192 = Impossible to export to machine a door if there is not a door!
|
||||
MessageBox.Show(EgtMsg(50192), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
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)
|
||||
' 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
|
||||
@@ -1333,22 +1392,14 @@ Public Class ProjectManagerVM
|
||||
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
|
||||
' Lancio esecuzione CAM5
|
||||
Dim Proc As New Process
|
||||
' Dim CurrFile As String = IniFile.m_sTempDir & "\CurrPart" & DDF_EXTENSION
|
||||
Dim CurrFile As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
Dim sCurrFile As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
' Flag : 0 = solo disegno, 1 = anche calcolo lavorazioni
|
||||
Dim nFlag As Integer = If((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift, 1, 0)
|
||||
Try
|
||||
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 & """ " & """0"""
|
||||
Proc.StartInfo.FileName = IniFile.m_sEgtCam5EXEPath
|
||||
Proc.StartInfo.Arguments = """" & sCurrFile & """ """ & nFlag & """"
|
||||
If Not Proc.Start() Then
|
||||
' Error in starting EgtCam5.exe
|
||||
MessageBox.Show(EgtMsg(50567), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
@@ -1357,22 +1408,6 @@ 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
|
||||
'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
|
||||
@@ -1435,9 +1470,6 @@ Public Class ProjectManagerVM
|
||||
' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file)
|
||||
For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)) <> DDF_EXTENSION Then
|
||||
Continue For
|
||||
End If
|
||||
' lo aggiungo alla lista delle porte
|
||||
Dim Local_Assembly As New AssemblyName
|
||||
Local_Assembly.Name = DDFFileArray(DDFIndex)
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="SelectPartV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Title="{Binding Title}"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
Height="110" Width="300" Topmost="True"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||
|
||||
<!--<EgtWPFLib5:EgtCustomWindow.Resources>
|
||||
<EgtWPFLib5:FileNameConverter x:Key="FileNameConverter"/>
|
||||
</EgtWPFLib5:EgtCustomWindow.Resources>-->
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<UniformGrid Columns="2" Grid.Row="0" Grid.ColumnSpan="2">
|
||||
<TextBlock Margin="5" Height="24" Text="{Binding PartDoorMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox Margin="5,0,5,0" Height="24" VerticalAlignment="Center"
|
||||
ItemsSource="{Binding PartDoorList}" SelectedItem="{Binding Selection}"/>
|
||||
</UniformGrid>
|
||||
|
||||
|
||||
<Button IsDefault="True" Name="OkBtn" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Right"
|
||||
Margin="0,0,5,0"
|
||||
Content="{Binding SaveMsg}" Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,15 @@
|
||||
Public Class SelectPartV
|
||||
|
||||
Sub New()
|
||||
|
||||
' La chiamata è richiesta dalla finestra di progettazione.
|
||||
InitializeComponent()
|
||||
|
||||
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click() Handles OkBtn.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
End Class
|
||||
@@ -0,0 +1,68 @@
|
||||
Public Class SelectPartVM
|
||||
|
||||
Private m_Title As String = "Selection of door"
|
||||
Public ReadOnly Property Title As String
|
||||
Get
|
||||
Return m_Title
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SaveMsg As String = "Ok"
|
||||
Public ReadOnly Property SaveMsg As String
|
||||
Get
|
||||
Return m_SaveMsg
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_PartDoorMsg As String = "Select part"
|
||||
Public ReadOnly Property PartDoorMsg As String
|
||||
Get
|
||||
Return m_PartDoorMsg
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_PartDoorList As New List(Of String)
|
||||
Public Property PartDoorList As List(Of String)
|
||||
Get
|
||||
Return m_PartDoorList
|
||||
End Get
|
||||
Set(value As List(Of String))
|
||||
m_ListPartDoor = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Selection As String = ""
|
||||
Public Property Selection As String
|
||||
Get
|
||||
Return m_Selection
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Selection = value
|
||||
m_nSelectedIndex = m_PartDoorList.IndexOf(m_Selection)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nSelectedIndex As Integer = 0
|
||||
Public ReadOnly Property nSelectedIndex As Integer
|
||||
Get
|
||||
Return m_nSelectedIndex
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Sub New(TitleWd As String, MsgWd As String, nParts As Integer, nIndex As Integer)
|
||||
m_Title = TitleWd
|
||||
m_PartDoorMsg = MsgWd
|
||||
For Each ItemDoor As PartDoor In Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor
|
||||
m_PartDoorList.Add(ItemDoor.Type)
|
||||
Next
|
||||
If Not IsNothing(Map.refPartPageVM) AndAlso Not IsNothing(Map.refPartPageVM.CurrPart) AndAlso
|
||||
Not IsNothing(Map.refPartPageVM.CurrPart.TypePart) Then
|
||||
m_nSelectedIndex = m_PartDoorList.IndexOf(Map.refPartPageVM.CurrPart.TypePart)
|
||||
Else
|
||||
m_nSelectedIndex = 0
|
||||
End If
|
||||
m_Selection = m_PartDoorList(m_nSelectedIndex)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,26 @@
|
||||
<UserControl x:Class="SpecialPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:EgtDOORCreator"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Visibility="{Binding SpecialPanelVisibility}">
|
||||
<StackPanel Orientation="Horizontal" Height="32">
|
||||
<ItemsControl ItemsSource="{Binding ButtonList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}">
|
||||
<Image Source="{Binding ImagePath}"/>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class SpecialPanelV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,121 @@
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class SpecialPanelVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_ButtonList As New List(Of ButtonItem)
|
||||
Public ReadOnly Property ButtonList As List(Of ButtonItem)
|
||||
Get
|
||||
Return m_ButtonList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SpecialPanelVisibility As Visibility
|
||||
Public ReadOnly Property SpecialPanelVisibility As Visibility
|
||||
Get
|
||||
Return m_SpecialPanelVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSpecialPanelVisibility(bValue As Boolean)
|
||||
m_SpecialPanelVisibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(SpecialPanelVisibility))
|
||||
End Sub
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in Map
|
||||
Map.SetRefSpecialPanelVM(Me)
|
||||
' se attivo, inizializzo i bottoni leggendoli da file ini
|
||||
If OptionModule.IsActiveSpecialPanel Then
|
||||
Dim BtnIndex As Integer = 1
|
||||
Dim CurrBtn As ButtonItem = Nothing
|
||||
While GetPrivateProfileButton(S_SPECIAL, K_BUTTON & BtnIndex, "", CurrBtn)
|
||||
m_ButtonList.Add(CurrBtn)
|
||||
BtnIndex += 1
|
||||
End While
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ButtonItem
|
||||
Inherits VMBase
|
||||
|
||||
Private m_sImagePath As String
|
||||
Public ReadOnly Property ImagePath As String
|
||||
Get
|
||||
Return m_sImagePath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sLuaCmdPath As String
|
||||
|
||||
Private m_sToolTip As String
|
||||
Public ReadOnly Property ToolTip As String
|
||||
Get
|
||||
Return m_sToolTip
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend m_Btn_Visibility As Visibility
|
||||
Public ReadOnly Property Btn_Visibility As Visibility
|
||||
Get
|
||||
Return m_Btn_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend m_Btn_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property Btn_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_Btn_IsEnabled
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdLuaExec As ICommand
|
||||
|
||||
Sub New(sLuaCmdPath As String, sImagePath As String, sToolTip As String)
|
||||
' creo il percorso del file
|
||||
m_sImagePath = IniFile.m_sResourcesRoot & "\" & sImagePath
|
||||
If Not File.Exists(m_sImagePath) Then
|
||||
EgtOutLog("File '" & m_sImagePath & "' does not exist.")
|
||||
End If
|
||||
m_sLuaCmdPath = IniFile.m_sScriptsRoot & "\" & sLuaCmdPath
|
||||
m_sToolTip = sToolTip
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "LuaExecCommand"
|
||||
|
||||
Public ReadOnly Property LuaExecCommand As ICommand
|
||||
Get
|
||||
If m_cmdLuaExec Is Nothing Then
|
||||
m_cmdLuaExec = New Command(AddressOf LuaExec)
|
||||
End If
|
||||
Return m_cmdLuaExec
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub LuaExec(ByVal param As Object)
|
||||
If Not File.Exists(m_sLuaCmdPath) Then
|
||||
EgtOutLog("File '" & m_sLuaCmdPath & "' does not exists.")
|
||||
Return
|
||||
End If
|
||||
If Not Path.GetExtension(m_sLuaCmdPath).ToLower = ".lua" Then
|
||||
EgtOutLog("File '" & m_sLuaCmdPath & "' has not '.lua' extension.")
|
||||
Return
|
||||
End If
|
||||
Dim bOk As Boolean = EgtLuaExecFile(m_sLuaCmdPath)
|
||||
If Not bOk Then
|
||||
EgtOutLog("File '" & m_sLuaCmdPath & "' has not been excute.")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' LuaExecCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
+16
-1
@@ -39,7 +39,7 @@ Module RegexFunction
|
||||
' Restituisce il valore scritto tra le parentesi tonde ()
|
||||
Friend Function Brackets(sLine As String) As String
|
||||
If Not sLine.Contains("("c) AndAlso Not sLine.Contains(")"c) Then Return sLine
|
||||
Return Regex.Match(sLine, "\s*\(\s*(.*?\b)\s*\).*").Groups(1).Value
|
||||
Return Regex.Match(sLine, "\s*\(\s*(.*\b)\s*\).*").Groups(1).Value
|
||||
End Function
|
||||
|
||||
' restituisce quello che segue l'uguale assegnata una parola chiave tra i due trattini e 'uguale
|
||||
@@ -111,6 +111,7 @@ Module RegexFunction
|
||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, (OptionModule.m_SelectedOptionLauncher + LoOpenOnce).ToString())
|
||||
' esco dall'applicazione
|
||||
EgtExit()
|
||||
Map.refMainWindowVM.MainWindowModel.ReleaseInstance()
|
||||
Application.Current.MainWindow.Close()
|
||||
End
|
||||
Else
|
||||
@@ -121,6 +122,20 @@ Module RegexFunction
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' leggo dal vettore per cercare la stringa OrigTemplate
|
||||
Friend Function ReadOrigTemplate(fStream As String()) As String
|
||||
Dim sOrigTemplate As String = String.Empty
|
||||
For Each Line As String In fStream
|
||||
If Line.Contains("#OrigTemplate") Then
|
||||
sOrigTemplate = Regex.Match(Line, "\s*:\s*(.*?)\s*$").Groups(1).Value
|
||||
Return sOrigTemplate
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' Processo il tipo di configurazione
|
||||
Return sOrigTemplate
|
||||
End Function
|
||||
|
||||
' restituisce quello che segue l'uguale assegnata la parola chiave Err
|
||||
Friend Function ErrDraw(sLine As String) As Integer
|
||||
Dim sErrMsg As String = Regex.Match(sLine, "\s*(Err)\s*=\s*(.*?\b)\s*$").Groups(2).Value
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
<UserControl x:Class="InstrumentPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator">
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator">
|
||||
|
||||
<StackPanel Background="Transparent" Orientation="Horizontal" >
|
||||
<ToggleButton ToolTip="{Binding GetDistToolTip}" IsEnabled ="{Binding EnableCmdDist}"
|
||||
<StackPanel Background="Transparent" Orientation="Horizontal" >
|
||||
<ToggleButton ToolTip="{Binding GetDistToolTip}" IsEnabled ="{Binding EnableCmdDist}"
|
||||
Style="{StaticResource GridViewPanelToggleButton}" IsChecked="{Binding GetDistIsChecked}">
|
||||
<Image Source="/Resources/InstrumentPanel/GetDist.png" Stretch="Uniform" Width="25" />
|
||||
</ToggleButton>
|
||||
<Button ToolTip="{Binding LinearDimensionToolTip}"
|
||||
ToolTipService.ShowOnDisabled="True"
|
||||
Command="{Binding LinearDimensionCommand}" IsEnabled="{Binding EnableCmdDimension}"
|
||||
Visibility="{Binding DimensionVisibility}">
|
||||
<Image Source="/Resources/InstrumentPanel/LinearDimension.png" Stretch="Uniform" Width="25"/>
|
||||
ToolTipService.ShowOnDisabled="True"
|
||||
Command="{Binding LinearDimensionCommand}" IsEnabled="{Binding EnableCmdDimension}"
|
||||
Visibility="{Binding DimensionVisibility}">
|
||||
<Image Source="/Resources/InstrumentPanel/LinearDimension.png" Stretch="Uniform" Width="25"/>
|
||||
</Button>
|
||||
<TextBox Style="{StaticResource DimensioParameter}"
|
||||
Name ="TextBox1"
|
||||
Visibility="{Binding TextDimensionVisibility}" Margin="5"
|
||||
Width="100" Height="25"
|
||||
Text="{Binding TextDimension, UpdateSourceTrigger=PropertyChanged}">
|
||||
<TextBox.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding OkTextDimension}"/>
|
||||
</TextBox.InputBindings>
|
||||
</TextBox>
|
||||
<TextBox Style="{StaticResource DimensioParameter}"
|
||||
Name ="TextBox1"
|
||||
Visibility="{Binding TextDimensionVisibility}" Margin="5"
|
||||
Width="100" Height="25"
|
||||
Text="{Binding TextDimension, UpdateSourceTrigger=PropertyChanged}">
|
||||
<TextBox.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding OkTextDimension}"/>
|
||||
</TextBox.InputBindings>
|
||||
</TextBox>
|
||||
|
||||
<Button Command="{Binding PrintHardwareCommand}" ToolTip="{Binding PrintHardwareToolTip}" Focusable="False"
|
||||
<Button Command="{Binding PrintHardwareCommand}" ToolTip="{Binding PrintHardwareToolTip}" Focusable="False"
|
||||
IsEnabled ="{Binding EnableCmdSaveImg}" Visibility="{Binding SaveImgHardware}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" Width="25"/>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" Width="25"/>
|
||||
</ContentControl>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -29,7 +29,7 @@ Public Class InstrumentPanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_GetDistIsChecked As Boolean = True
|
||||
Private m_GetDistIsChecked As Boolean = False
|
||||
Public Property GetDistIsChecked As Boolean
|
||||
Get
|
||||
GetDistance(m_GetDistIsChecked)
|
||||
@@ -44,6 +44,13 @@ Public Class InstrumentPanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Restituisce l'ultimo stato del comando
|
||||
Public ReadOnly Property ActualDistanceState As Boolean
|
||||
Get
|
||||
Return m_GetDistIsChecked
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' se il bottone è selezionato (true) allora misura, altrimenti no (false)
|
||||
Public Sub GetDistance(bGetDistanceIsChecked As Boolean)
|
||||
If bGetDistanceIsChecked Then
|
||||
|
||||
@@ -121,12 +121,26 @@ Public Class SceneManagerVM
|
||||
m_ProjectSceneHost.Child = Nothing
|
||||
' Se manca la chiave
|
||||
If IniFile.m_nKeyLevel = -1 Or IniFile.m_nKeyLevel = -2 Then
|
||||
EgtOutLog("Missing Dongle")
|
||||
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
|
||||
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
|
||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
||||
If Not EgtGetNetHwKey() Then
|
||||
EgtOutLog("Missing Dongle")
|
||||
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
|
||||
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
|
||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
||||
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
EgtOutLog("NetDongle is full")
|
||||
' Box di avviso slot chiave di rete occupato : "Chiave di Rete completamente occupata. \n Uscire dal programma su un altro PC." "Errore"
|
||||
Dim sText As String = EgtMsg(10110) & vbCrLf & EgtMsg(10111)
|
||||
Dim sTitle As String = EgtMsg(10101)
|
||||
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
ElseIf IniFile.m_nKeyLevel = -9 Then
|
||||
EgtOutLog("Missing Link with Net Dongle")
|
||||
' Box di avviso chiave mancante : "Collegamento con la Chiave di rete non riuscito. \n Verificare la connessione." "Errore"
|
||||
Dim sText As String = EgtMsg(10108) & vbCrLf & EgtMsg(10109)
|
||||
Dim sTitle As String = EgtMsg(10101)
|
||||
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Altrimenti manca la licenza
|
||||
' Altrimenti manca la licenza
|
||||
Else
|
||||
EgtOutLog("Problems with Licence")
|
||||
' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
|
||||
@@ -158,7 +172,7 @@ Public Class SceneManagerVM
|
||||
' Chiudo il programma
|
||||
End
|
||||
End If
|
||||
Return m_ProjectSceneHost
|
||||
Return m_ProjectSceneHost
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -332,7 +346,7 @@ Public Class SceneManagerVM
|
||||
ElseIf Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage Then
|
||||
If Not EnableRefresh Then Return
|
||||
' Verifico esista elemento selezionato
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) orelse IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then Return
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) OrElse IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then Return
|
||||
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, sTempFile, True)
|
||||
ExecDoors(m_ProjectScene, sTempFile, False)
|
||||
' mantengo i layer accesi
|
||||
@@ -421,6 +435,124 @@ Public Class SceneManagerVM
|
||||
|
||||
#End Region ' Command
|
||||
|
||||
#Region "EVENT Scene"
|
||||
|
||||
Private Sub MouseMoveOverScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_ProjectScene.OnMouseMoveScene
|
||||
' Se non abilitata l'evidenziazione dei compo allora esco
|
||||
If GetMainPrivateProfileInt(S_GENERAL, "MarkCompo", 0) = 0 Then Return
|
||||
' Se misurazione attiva
|
||||
If Map.refInstrumentPanelVM.ActualDistanceState Then Return
|
||||
' Se non esiste una porta corrente allora esco
|
||||
If IsNothing(Map.refPartPageVM) OrElse IsNothing(Map.refPartPageVM.CurrPart) Then Return
|
||||
' Ripulisco la scena dai Mark
|
||||
Map.refPartPageVM.CurrPart.ResetAllMark()
|
||||
' Se la lista dei componenti è vuota allora esco
|
||||
Dim LocalCompoList As ObservableCollection(Of Compo) = Map.refPartPageVM.CurrPart.CompoList
|
||||
If LocalCompoList.Count < 1 Then
|
||||
EgtDraw()
|
||||
Return
|
||||
End If
|
||||
' Ricavo il punto corrente in coordinate mondo
|
||||
Dim ptCurr As Point3d
|
||||
EgtUnProjectPoint(e.Location, ptCurr)
|
||||
' Recupero gli oggetti nel mirino di selezione
|
||||
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||
Dim nSel As Integer
|
||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
||||
' Ciclo su questi oggetti
|
||||
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
||||
While nId <> GDB_ID.NULL
|
||||
If EgtGetType(nId) = GDB_TY.CRV_COMPO Or EgtGetType(nId) = GDB_TY.CRV_ARC Or EgtGetType(nId) = GDB_TY.CRV_LINE Then
|
||||
Dim nIdParent As Integer = EgtGetParent(nId)
|
||||
Dim sNameLayer As String = String.Empty
|
||||
EgtGetName(nIdParent, sNameLayer)
|
||||
If Not ( sNameLayer.StartsWith("AUX") OrElse sNameLayer.StartsWith("SOLID") OrElse sNameLayer.StartsWith("DIM")) Then
|
||||
' scorro l'elenco dei componenti fino a trovare un riscontro tra i nomi e i parametri
|
||||
For Each ItemCompo As Compo In LocalCompoList
|
||||
If MatchCompoFromScene(nIdParent, ItemCompo, LocalCompoList) Then Exit While
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
' Passo al successivo
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
'End If
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Function MatchCompoFromScene(nIdLay As Integer, CurrCompo As Compo, CompoList As ObservableCollection(Of Compo)) As Boolean
|
||||
|
||||
If IsNothing(CurrCompo) Then Return False
|
||||
|
||||
' recupero il direttorio del componente
|
||||
Dim sDirCompo As String = Path.GetFileName(CurrCompo.CompoType.Path)
|
||||
' recupero il nome del componente
|
||||
Dim sCompoName As String = CurrCompo.TemplateSelItem
|
||||
' recupero il nome della componente selezionata con MouseOver
|
||||
Dim sInfoPath As String = String.Empty
|
||||
If Not EgtGetInfo(nIdLay, "Path", sInfoPath) Then
|
||||
Dim sFileName As String = String.Empty
|
||||
Dim sFileDir As String = String.Empty
|
||||
If EgtGetInfo(nIdLay, "CustGeomFile", sFileName) AndAlso
|
||||
EgtGetInfo(nIdLay, "CustGeomPath", sFileDir) Then
|
||||
sInfoPath = sFileDir & sFileName
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
' verifico validità
|
||||
If Not ( sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 AndAlso
|
||||
sInfoPath.IndexOf( sDirCompo, StringComparison.InvariantCultureIgnoreCase) >= 0) Then
|
||||
Return False
|
||||
End If
|
||||
' recupero la lista dei compo dello stesso tipo
|
||||
Dim TempList As ObservableCollection(Of Compo) = DdfFile.GetCurrentListSameCompoType(CompoList, CurrCompo.CompoType.DDFName)
|
||||
' recupero la lista dei compo con lo stesso nome
|
||||
TempList = DdfFile.GetCurrentListSameCompoDDFName(TempList, CurrCompo.SelFile, CurrCompo.SelBrandPart)
|
||||
' riordino la lista appena trovata secondo le regole di stampa DDF
|
||||
DdfFile.GetOrderedListSameCompo(TempList)
|
||||
|
||||
' cerco ordine layer
|
||||
Dim nCounter As Integer = 1
|
||||
Dim nCurrLayId As Integer = nIdLay
|
||||
While nCurrLayId <> GDB_ID.NULL
|
||||
nCurrLayId = EgtGetNext(nCurrLayId)
|
||||
Dim LocalsPath As String = String.Empty
|
||||
Dim LocalsName As String = String.Empty
|
||||
Dim LocalsDir As String = String.Empty
|
||||
If ( EgtGetInfo(nCurrLayId, "Path", LocalsPath) AndAlso
|
||||
sInfoPath.Trim = LocalsPath.Trim) OrElse
|
||||
( EgtGetInfo(nCurrLayId, "CustGeomFile", LocalsName) AndAlso
|
||||
EgtGetInfo(nCurrLayId, "CustGeomPath", LocalsDir) AndAlso
|
||||
sInfoPath.Trim = LocalsDir.Trim & LocalsName.Trim) Then
|
||||
nCounter += 1
|
||||
End If
|
||||
End While
|
||||
Dim IndexLay As Integer = Math.Max( TempList.Count - nCounter, 0)
|
||||
|
||||
' ottengo la posizione prevista nella grafica
|
||||
Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, CurrCompo)
|
||||
While IndexInList < TempList.Count And nIdLay <> GDB_ID.NULL
|
||||
' recupero l'ordinamento del layer
|
||||
If sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay = IndexInList Then
|
||||
EgtSetMark(nIdLay)
|
||||
' evidenzio la compo corrente
|
||||
TempList(IndexInList).SetMark()
|
||||
' ricerca terminata correttamente
|
||||
Return True
|
||||
ElseIf sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexInList < IndexLay Then
|
||||
IndexInList += 1
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End While
|
||||
|
||||
'non trovata
|
||||
Return False
|
||||
End Function
|
||||
|
||||
#End Region ' Event scene
|
||||
|
||||
Public Sub ComposeAssembly(nAssembl As Integer)
|
||||
If Not File.Exists(IniFile.m_sDoorsDirPath & "\" & "Main_Assemb.lua") Then
|
||||
EgtOutLog("SetUp error: SetUp configuration file (" & IniFile.m_sDoorsDirPath & "\" & "Main_Assemb.lua)" & " doesn't exist ")
|
||||
|
||||
+110
-50
@@ -22,6 +22,10 @@ Public Module Utility
|
||||
|
||||
' CurrFile deve arrivare già senza estensione!
|
||||
Private Function GenerateLockFileName(ByVal CurrDirectory As String, Optional ByVal CurrFile As String = "") As String
|
||||
' Se in modalità Modifica file DDT allora non bloccare il file
|
||||
If OptionModule.AdjustDDT Then
|
||||
Return String.Empty
|
||||
End If
|
||||
If OptionModule.ReadOnlyDDF Then
|
||||
Return String.Empty
|
||||
End If
|
||||
@@ -40,6 +44,10 @@ Public Module Utility
|
||||
End Function
|
||||
|
||||
Public Function IsFileLocked(ByVal CurrDirectory As String, Optional ByVal CurrFile As String = "", Optional ByVal bSendMsg As Boolean = True) As Boolean
|
||||
If String.IsNullOrEmpty(CurrDirectory) Then
|
||||
EgtOutLog("Impossible to find directory")
|
||||
Return False
|
||||
End If
|
||||
Dim sLockFile As String = GenerateLockFileName(CurrDirectory, CurrFile)
|
||||
Dim bIsLocked As Boolean = False
|
||||
Dim FileList As String() = Directory.GetFiles(CurrDirectory)
|
||||
@@ -262,6 +270,18 @@ Public Module Utility
|
||||
Return Index
|
||||
End Function
|
||||
|
||||
' Verifica se il file/path indicato è ddf (true)
|
||||
Friend Function IsCurrentFileDDF(sFileName As String) As Boolean
|
||||
Dim IsDDF As Boolean = True
|
||||
If Not String.IsNullOrEmpty(sFileName) AndAlso Path.HasExtension(sFileName) Then
|
||||
Dim sExtension As String = Path.GetExtension(sFileName)
|
||||
If sExtension.ToLower = DDT_EXTENSION Then
|
||||
IsDDF = False
|
||||
End If
|
||||
End If
|
||||
Return IsDDF
|
||||
End Function
|
||||
|
||||
#Region "PARAM LUA"
|
||||
|
||||
' elimina i commenti nel file lua
|
||||
@@ -304,7 +324,32 @@ Public Module Utility
|
||||
Return "0.0000"
|
||||
End If
|
||||
End Select
|
||||
ElseIf sValue.Contains("(") And sValue.Contains(")") And Not sValue.Contains("inch") Then
|
||||
ElseIf sValue.Contains("(") And sValue.Contains(")") And sValue.Contains("mm") Then
|
||||
sValue = Trim(sValue.Replace("mm", ""))
|
||||
If sValue.StartsWith("(") And sValue.EndsWith(")") Then
|
||||
Dim ArrayString() As Char = StringToChar(sValue)
|
||||
ArrayString(0) = CChar("§")
|
||||
ArrayString(ArrayString.Count - 1) = CChar("§")
|
||||
sValue = CharToString(ArrayString, sValue)
|
||||
sValue = Trim(sValue.Replace("§", ""))
|
||||
End If
|
||||
If String.IsNullOrEmpty(sValue) Then Return "0.0000"
|
||||
' ricevo un valore in inches
|
||||
Select Case OptionModule.m_SelectedMeasureUnit
|
||||
Case ConstGen.MM ' se la configurazione è inches non faccio conversioni
|
||||
If StringToDouble(sValue, dVal) Then
|
||||
Return sValue
|
||||
Else
|
||||
Return "0.0000"
|
||||
End If
|
||||
Case ConstGen.VAL_INCHES ' se la configurazione è in mm faccio la conevrsione
|
||||
If MmToInches(sValue) Then
|
||||
Return sValue
|
||||
Else
|
||||
Return "0.0000"
|
||||
End If
|
||||
End Select
|
||||
ElseIf sValue.Contains("(") And sValue.Contains(")") And (Not sValue.Contains("inch") Or Not sValue.Contains("mm")) Then
|
||||
'sValue = Regex.Match(sValue, "\s*\((.*?)\s*\)\s*\.*").Groups(1).Value
|
||||
If String.IsNullOrEmpty(sValue) Then Return "0.0000"
|
||||
' ricevo un valore in mm
|
||||
@@ -353,7 +398,7 @@ Public Module Utility
|
||||
Friend Function MmToInches(ByRef sMeasure As String) As Boolean
|
||||
Dim dVal As Double = 0.0
|
||||
If Not StringToDouble(sMeasure, dVal) Then Return False
|
||||
dVal = dVal / ONEINCH
|
||||
'dVal = dVal / ONEINCH
|
||||
sMeasure = LenToString(dVal, 4)
|
||||
Return True
|
||||
End Function
|
||||
@@ -379,6 +424,10 @@ Public Module Utility
|
||||
' non eseguo nessun tipo di conversione
|
||||
Return True
|
||||
Else
|
||||
' la configurazione è già in mm quindi non devo convertire
|
||||
If OptionModule.m_IsMM Then
|
||||
Return True
|
||||
End If
|
||||
Return InchesToMm(sMeasure)
|
||||
End If
|
||||
Return False
|
||||
@@ -417,7 +466,7 @@ Public Module Utility
|
||||
End If
|
||||
ElseIf OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES And OptionModule.m_IsMM Then
|
||||
' Discordi
|
||||
If StringToLen(sItems, dDefaultValue) AndAlso dDefaultValue < dControlValue Then
|
||||
If StringToDouble(sItems, dDefaultValue) AndAlso dDefaultValue < dControlValue Then
|
||||
MmToInches(sItems)
|
||||
Return True
|
||||
End If
|
||||
@@ -525,9 +574,9 @@ Public Module Utility
|
||||
sMyVal = sMyVal.Replace("H", "(DGD.dH/25.4)")
|
||||
sMyVal = sMyVal.Replace("T", "(DGD.dT/25.4)")
|
||||
Else
|
||||
sMyVal = sMyVal.Replace("W", "DGD.dW")
|
||||
sMyVal = sMyVal.Replace("H", "DGD.dH")
|
||||
sMyVal = sMyVal.Replace("T", "DGD.dT")
|
||||
sMyVal = sMyVal.Replace("W", "(DGD.dW)")
|
||||
sMyVal = sMyVal.Replace("H", "(DGD.dH)")
|
||||
sMyVal = sMyVal.Replace("T", "(DGD.dT)")
|
||||
End If
|
||||
End If
|
||||
Return sMyVal
|
||||
@@ -536,16 +585,25 @@ Public Module Utility
|
||||
Friend Function ConvertToDGD(sTypeVar As String, sValue As String) As String
|
||||
Dim sMyVal As String = sValue
|
||||
' se testo numerico, eseguo opportunbe conversioni per H,W e T
|
||||
If sTypeVar = ConstGen.INCHES Or sTypeVar = ConstGen.MM Then
|
||||
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
|
||||
sMyVal = sMyVal.Replace("(DGD.dW/25.4)", "W")
|
||||
sMyVal = sMyVal.Replace("(DGD.dH/25.4)", "H")
|
||||
sMyVal = sMyVal.Replace("(DGD.dT/25.4)", "T")
|
||||
Else
|
||||
sMyVal = sMyVal.Replace("DGD.dW", "W")
|
||||
sMyVal = sMyVal.Replace("DGD.dH", "H")
|
||||
sMyVal = sMyVal.Replace("DGD.dT", "T")
|
||||
End If
|
||||
'If sTypeVar = ConstGen.INCHES Or sTypeVar = ConstGen.MM Then
|
||||
' If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
|
||||
' sMyVal = sMyVal.Replace("(DGD.dW/25.4)", "W")
|
||||
' sMyVal = sMyVal.Replace("(DGD.dH/25.4)", "H")
|
||||
' sMyVal = sMyVal.Replace("(DGD.dT/25.4)", "T")
|
||||
' Else
|
||||
' sMyVal = sMyVal.Replace("DGD.dW", "W")
|
||||
' sMyVal = sMyVal.Replace("DGD.dH", "H")
|
||||
' sMyVal = sMyVal.Replace("DGD.dT", "T")
|
||||
' End If
|
||||
'End If
|
||||
If sMyVal.Contains("25.4") Then
|
||||
sMyVal = sMyVal.Replace("(DGD.dW/25.4)", "W")
|
||||
sMyVal = sMyVal.Replace("(DGD.dH/25.4)", "H")
|
||||
sMyVal = sMyVal.Replace("(DGD.dT/25.4)", "T")
|
||||
Else
|
||||
sMyVal = sMyVal.Replace("(DGD.dW)", "W")
|
||||
sMyVal = sMyVal.Replace("(DGD.dH)", "H")
|
||||
sMyVal = sMyVal.Replace("(DGD.dT)", "T")
|
||||
End If
|
||||
Return sMyVal
|
||||
End Function
|
||||
@@ -568,83 +626,85 @@ Public Module Utility
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub GetDirectoryCompoFiles(DirectoryPath As String, ByRef FileList As ObservableCollection(Of String), bRemoveNge As Boolean)
|
||||
RecursiveGetDirectoryCompoFiles(DirectoryPath, DirectoryPath, FileList, bRemoveNge)
|
||||
End Sub
|
||||
|
||||
' csotruisco le liste dei file
|
||||
Friend Sub GetDirectoryCompoModel(HardwareDirPath As String, FolderList As ObservableCollection(Of CompoBrandDir), Optional FrameFolderList As ObservableCollection(Of CompoBrandDir) = Nothing, Optional HardwareFolderList As ObservableCollection(Of CompoBrandDir) = Nothing)
|
||||
'FrameFolderList = New ObservableCollection(Of CompoBrandDir)
|
||||
' costruisco le liste dei file
|
||||
Friend Sub GetDirectoryCompoModel(HardwareDirPath As String, FolderList As ObservableCollection(Of CompoBrandDir),
|
||||
Optional FrameFolderList As ObservableCollection(Of CompoBrandDir) = Nothing,
|
||||
Optional HardwareFolderList As ObservableCollection(Of CompoBrandDir) = Nothing)
|
||||
' Nome del direttorio dei componenti
|
||||
Dim BaseDirName As String = Path.GetFileName(HardwareDirPath)
|
||||
' Carico l'elenco dei file contenuti nei sottodirettori
|
||||
Dim FolderArray() As String = Directory.GetDirectories(HardwareDirPath)
|
||||
Dim CurrFolder As CompoBrandDir = Nothing
|
||||
For Each Folder In FolderArray
|
||||
Folder = Folder.Replace("/", "\")
|
||||
CurrFolder = New CompoBrandDir(Folder, BaseDirName)
|
||||
GetDirectoryCompoFiles(Folder, CurrFolder.ModelFileList, False)
|
||||
Dim CurrGenFolder As CompoBrandDir = New CompoBrandDir(Folder, BaseDirName)
|
||||
GetDirectoryCompoFiles(Folder, CurrGenFolder.ModelFileList, False)
|
||||
' genero le liste per il DoorCreator
|
||||
If CurrFolder.ModelFileList.Count > 0 Then
|
||||
If CurrGenFolder.ModelFileList.Count > 0 Then
|
||||
If Folder.ToLower.Contains(FRAME_FOLDER) Then
|
||||
FrameFolderList.Add(CurrFolder)
|
||||
'If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then HardwareFolderList.Add(CurrFolder)
|
||||
If Not IsNothing(FrameFolderList) Then FrameFolderList.Add(CurrGenFolder)
|
||||
Else
|
||||
FolderList.Add(CurrFolder)
|
||||
FolderList.Add(CurrGenFolder)
|
||||
End If
|
||||
End If
|
||||
' genero le liste per l'HardwareManager
|
||||
CurrFolder = New CompoBrandDir(Folder, BaseDirName)
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
|
||||
HardwareFolderList.Add(CurrFolder)
|
||||
Else
|
||||
' solo se non sono in modlità assemblato non carcico gli elenchi ".frame"
|
||||
If Not Folder.ToLower.Contains(FRAME_FOLDER) Then
|
||||
HardwareFolderList.Add(CurrFolder)
|
||||
If Not IsNothing(HardwareFolderList) Then
|
||||
Dim CurrHardFolder As CompoBrandDir = New CompoBrandDir(Folder, BaseDirName)
|
||||
GetDirectoryCompoFiles(Folder, CurrHardFolder.ModelFileList, True)
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
|
||||
HardwareFolderList.Add(CurrHardFolder)
|
||||
Else
|
||||
' solo se non sono in modalità assemblato non carico gli elenchi ".frame"
|
||||
If Not Folder.ToLower.Contains(FRAME_FOLDER) Then
|
||||
HardwareFolderList.Add(CurrHardFolder)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
GetDirectoryCompoFiles(Folder, CurrFolder.ModelFileList, True)
|
||||
Next
|
||||
' Carico l'elenco dei file contenuti nella radice del direttorio
|
||||
' Carico l'elenco dei file contenuti nel direttorio
|
||||
Dim FileArray() As String = Directory.GetFiles(HardwareDirPath)
|
||||
CurrFolder = Nothing
|
||||
Dim CurrFolder As CompoBrandDir = Nothing
|
||||
Dim CurrFrameFolder As CompoBrandDir = Nothing
|
||||
Dim CurrHardwareFolder As CompoBrandDir = Nothing
|
||||
For Each File In FileArray
|
||||
File = File.Replace("/", "\")
|
||||
If Not Path.GetExtension(File) = INI_EXTENSION And Not Path.GetExtension(File) = TEMPL_EXTENSION And
|
||||
(Path.GetExtension(File) = LUA_EXTENSION Or Path.GetExtension(File) = NGE_EXTENSION) And
|
||||
Dim sExt As String = Path.GetExtension(File).ToLower
|
||||
If (sExt = LUA_EXTENSION Or sExt = NGE_EXTENSION) And
|
||||
Not File.Contains(MATCHING_FILE_NAME) And Not File.ToLower().Contains("currhardware") Then
|
||||
If File.Contains(FRAME_FOLDER) Then
|
||||
If IsNothing(CurrFrameFolder) Then
|
||||
' CurrFrameFolder = New CompoBrandDir(Path.GetFileName(HardwareDirPath), BaseDirName & FRAME_FOLDER)
|
||||
CurrFrameFolder = New CompoBrandDir(HardwareDirPath, BaseDirName & FRAME_FOLDER)
|
||||
FrameFolderList.Add(CurrFrameFolder)
|
||||
If Not IsNothing(FrameFolderList) Then FrameFolderList.Add(CurrFrameFolder)
|
||||
End If
|
||||
CurrFrameFolder.ModelFileList.Add(If(Path.GetExtension(File) = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
CurrFrameFolder.ModelFileList.Add(If(Path.GetExtension(File).ToLower = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
Else
|
||||
If IsNothing(CurrFolder) Then
|
||||
' CurrFolder = New CompoBrandDir(Path.GetFileName(HardwareDirPath), BaseDirName)
|
||||
CurrFolder = New CompoBrandDir(HardwareDirPath, BaseDirName)
|
||||
FolderList.Add(CurrFolder)
|
||||
End If
|
||||
CurrFolder.ModelFileList.Add(If(Path.GetExtension(File) = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
CurrFolder.ModelFileList.Add(If(Path.GetExtension(File).ToLower = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
If Not File.Contains(NGE_EXTENSION) Then
|
||||
If IsNothing(CurrHardwareFolder) Then
|
||||
' CurrHardwareFolder = New CompoBrandDir(Path.GetFileName(HardwareDirPath), BaseDirName)
|
||||
CurrHardwareFolder = New CompoBrandDir(HardwareDirPath, BaseDirName)
|
||||
HardwareFolderList.Add(CurrHardwareFolder)
|
||||
If Not IsNothing(HardwareFolderList) Then HardwareFolderList.Add(CurrHardwareFolder)
|
||||
End If
|
||||
CurrHardwareFolder.ModelFileList.Add(If(Path.GetExtension(File) = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
CurrHardwareFolder.ModelFileList.Add(If(Path.GetExtension(File).ToLower = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub GetDirectoryCompoFiles(DirectoryPath As String, ByRef FileList As ObservableCollection(Of String), bRemoveNge As Boolean)
|
||||
RecursiveGetDirectoryCompoFiles(DirectoryPath, DirectoryPath, FileList, bRemoveNge)
|
||||
End Sub
|
||||
|
||||
Private Sub RecursiveGetDirectoryCompoFiles(DirectoryPath As String, BaseDirectory As String, ByRef FileList As ObservableCollection(Of String), bRemoveNge As Boolean)
|
||||
' File nei sottodirettori
|
||||
Dim SubDir() As String = Directory.GetDirectories(DirectoryPath)
|
||||
For Index = 0 To SubDir.Count - 1
|
||||
RecursiveGetDirectoryCompoFiles(SubDir(Index), BaseDirectory, FileList, bRemoveNge)
|
||||
Next
|
||||
' File nel direttorio
|
||||
Dim Files() As String = Directory.GetFiles(DirectoryPath)
|
||||
For Index = 0 To Files.Count - 1
|
||||
Dim FileExt As String = Path.GetExtension(Files(Index).ToLower())
|
||||
|
||||
Reference in New Issue
Block a user