Compare commits
29 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 | |||
| d4d4e3a9d7 | |||
| 4525c6d780 |
@@ -1,7 +1,7 @@
|
|||||||
<Window x:Class="AboutBoxV"
|
<Window x:Class="AboutBoxV"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
Title="AboutBox" Height="320" Width="300" WindowStyle="None" ResizeMode="NoResize"
|
Title="AboutBox" Height="400" Width="360" WindowStyle="None" ResizeMode="NoResize"
|
||||||
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
|
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
|
||||||
|
|
||||||
<Border BorderThickness="2" BorderBrush="LightBlue">
|
<Border BorderThickness="2" BorderBrush="LightBlue">
|
||||||
@@ -18,11 +18,10 @@
|
|||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="0.5*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<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="0.5*"/>
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="0.35*"/>
|
||||||
<RowDefinition Height="0.25*"/>
|
|
||||||
<RowDefinition Height="0.5*"/>
|
|
||||||
<RowDefinition Height="0.25*"/>
|
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid Grid.Column="1" Grid.Row="1">
|
<Grid Grid.Column="1" Grid.Row="1">
|
||||||
@@ -39,13 +38,11 @@
|
|||||||
VerticalAlignment="Center" FontSize="18" />
|
VerticalAlignment="Center" FontSize="18" />
|
||||||
<TextBlock Name="VersionLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
|
<TextBlock Name="VersionLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" FontSize="18"/>
|
VerticalAlignment="Center" FontSize="18"/>
|
||||||
<TextBlock Name="KeyLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
|
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" FontSize="18"/>
|
|
||||||
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center" FontSize="12" />
|
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"/>
|
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"/>
|
Margin="1,0"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -9,17 +9,36 @@ Public Class AboutBoxV
|
|||||||
"." & My.Application.Info.Version.Minor.ToString() &
|
"." & My.Application.Info.Version.Minor.ToString() &
|
||||||
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
|
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
|
||||||
My.Application.Info.Version.Revision.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
|
Dim sKey As String = String.Empty
|
||||||
EgtGetKeyInfo(sKey)
|
EgtGetKeyInfo(sKey)
|
||||||
Dim sKlev As String = IniFile.m_nKeyLevel.ToString()
|
Dim sKlev As String = IniFile.m_nKeyLevel.ToString()
|
||||||
Dim sOpts As String = IniFile.m_nKeyOptions.ToString()
|
Dim sOpts As String = IniFile.m_nKeyOptions.ToString()
|
||||||
KeyLbl.Text = sKey & " - " & sKlev & " - " & sOpts
|
Dim sLeftDays As String = ""
|
||||||
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
|
Dim nLeftDays As Integer
|
||||||
Dim sInfo As String = If( EgtIsDebug(), "*** Debug Libraries ***" & vbCrLf, "")
|
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 &= "DataRoot " & IniFile.m_sDataRoot & vbCrLf
|
||||||
sInfo &= "Doors " & IniFile.m_sDoorsDirPath & vbCrLf
|
sInfo &= "Doors " & IniFile.m_sDoorsDirPath & vbCrLf
|
||||||
If OptionModule.m_MaterialList.Count = 1 Then
|
If OptionModule.m_MaterialList.Count = 1 Then
|
||||||
sInfo &= "Material " & OptionModule.m_MaterialList(0).Name
|
sInfo &= "Material " & OptionModule.m_MaterialList(0).Name & vbCrLf
|
||||||
End If
|
End If
|
||||||
Dim sOpSys As String = String.Empty
|
Dim sOpSys As String = String.Empty
|
||||||
EgtGetOsInfo( sOpSys)
|
EgtGetOsInfo( sOpSys)
|
||||||
|
|||||||
+26
-7
@@ -1045,7 +1045,15 @@ Public Class Assembly
|
|||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
' carico il valore finale restituito dalla lettura dell'assembalto (di default errore)
|
' 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
|
' vettore di righe del file ddf in lettura
|
||||||
Private FileContent() As String
|
Private FileContent() As String
|
||||||
@@ -1497,7 +1505,13 @@ Public Class Assembly
|
|||||||
sDoorPiece = sDoorPiece.Remove(sDoorPiece.LastIndexOf("_"c) + 1)
|
sDoorPiece = sDoorPiece.Remove(sDoorPiece.LastIndexOf("_"c) + 1)
|
||||||
End If
|
End If
|
||||||
Map.refCompoPanelVM.GoBackVisibility = Visibility.Visible
|
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
|
Else
|
||||||
' significa che stiamo per leggere una porta singola, cerco una porta
|
' significa che stiamo per leggere una porta singola, cerco una porta
|
||||||
If Not Local_Door.TypePart.Contains("DO_") Then
|
If Not Local_Door.TypePart.Contains("DO_") Then
|
||||||
@@ -1726,7 +1740,7 @@ Public Class Assembly
|
|||||||
' controllo degli oggetti caricati nell'assemblato
|
' controllo degli oggetti caricati nell'assemblato
|
||||||
Private Function ControlAssemblyInformation() As Boolean
|
Private Function ControlAssemblyInformation() As Boolean
|
||||||
Dim ErrorMessages As String = String.Empty
|
Dim ErrorMessages As String = String.Empty
|
||||||
Select Case bOk
|
Select Case m_bOk
|
||||||
Case ResultReadingAssembInfo.CorrectAssembInfo
|
Case ResultReadingAssembInfo.CorrectAssembInfo
|
||||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
|
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
|
||||||
' 50520=The current ddf is an assembly
|
' 50520=The current ddf is an assembly
|
||||||
@@ -1780,9 +1794,9 @@ Public Class Assembly
|
|||||||
Public Function ControlAssembly(Optional ByVal bSaving As Boolean = False) As String
|
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
|
' se è una porta singola oppure le info generali non sono state caricate correttamente non controllo l'assemblato
|
||||||
If bSaving Then
|
If bSaving Then
|
||||||
If bOk <> ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
|
If m_bOk <> ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
|
||||||
Else
|
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
|
End If
|
||||||
Dim WritingError As String = String.Empty
|
Dim WritingError As String = String.Empty
|
||||||
Dim DoorTypeList As String = String.Empty
|
Dim DoorTypeList As String = String.Empty
|
||||||
@@ -2031,7 +2045,7 @@ Public Class Assembly
|
|||||||
|
|
||||||
' cerco il nome della componente da associare FrameFile
|
' cerco il nome della componente da associare FrameFile
|
||||||
Dim CurrDoorHArdwareFile As String = CurrCompo.CompoType.Path & "\" & CurrCompo.TemplateSelItem
|
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
|
CurrDoorHArdwareFile &= LUA_EXTENSION
|
||||||
End If
|
End If
|
||||||
' cerco il campo [Match file] nel file lua della componente
|
' cerco il campo [Match file] nel file lua della componente
|
||||||
@@ -2183,7 +2197,7 @@ Public Class Assembly
|
|||||||
|
|
||||||
' cerco il nome della componente da associare FrameFile
|
' cerco il nome della componente da associare FrameFile
|
||||||
Dim CurrDoorHArdwareFile As String = CurrCompo.CompoType.Path & "\" & CurrCompo.TemplateSelItem
|
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
|
CurrDoorHArdwareFile &= LUA_EXTENSION
|
||||||
End If
|
End If
|
||||||
' cerco il campo [Match file] nel file lua della componente
|
' cerco il campo [Match file] nel file lua della componente
|
||||||
@@ -2498,6 +2512,7 @@ Public Class Assembly
|
|||||||
Map.refSceneManagerVM.RefreshBtn()
|
Map.refSceneManagerVM.RefreshBtn()
|
||||||
|
|
||||||
Case "Height"
|
Case "Height"
|
||||||
|
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
|
||||||
HeightJamb()
|
HeightJamb()
|
||||||
HeightDoor()
|
HeightDoor()
|
||||||
TopRabbetJamb()
|
TopRabbetJamb()
|
||||||
@@ -2507,6 +2522,7 @@ Public Class Assembly
|
|||||||
UpDateAllCompo()
|
UpDateAllCompo()
|
||||||
|
|
||||||
Case "Width"
|
Case "Width"
|
||||||
|
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
|
||||||
TopBottomWidth()
|
TopBottomWidth()
|
||||||
TopRabbetJamb()
|
TopRabbetJamb()
|
||||||
BottomRabbetJamb()
|
BottomRabbetJamb()
|
||||||
@@ -2515,10 +2531,12 @@ Public Class Assembly
|
|||||||
UpDateAllCompo()
|
UpDateAllCompo()
|
||||||
|
|
||||||
Case "Thickness"
|
Case "Thickness"
|
||||||
|
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
|
||||||
TopRabbetJamb()
|
TopRabbetJamb()
|
||||||
UpDateAllCompo()
|
UpDateAllCompo()
|
||||||
|
|
||||||
Case "Swing"
|
Case "Swing"
|
||||||
|
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
|
||||||
UpDateCompolistOnJamb()
|
UpDateCompolistOnJamb()
|
||||||
SwingJamb()
|
SwingJamb()
|
||||||
SetPartDoorCurrAssembly()
|
SetPartDoorCurrAssembly()
|
||||||
@@ -2526,6 +2544,7 @@ Public Class Assembly
|
|||||||
'UpDateAllCompo()
|
'UpDateAllCompo()
|
||||||
|
|
||||||
Case "DoorNumber"
|
Case "DoorNumber"
|
||||||
|
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
|
||||||
ClearRefOnAssembly()
|
ClearRefOnAssembly()
|
||||||
SetPartDoorCurrAssembly()
|
SetPartDoorCurrAssembly()
|
||||||
ReverseDoor()
|
ReverseDoor()
|
||||||
|
|||||||
@@ -131,32 +131,65 @@ Public Class AssemblyManagerVM
|
|||||||
' 50540 = The current ddf is a part of a frame, do you want to save?
|
' 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
|
If MessageBox.Show(EgtMsg(50540), EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
|
||||||
DdfFile.SaveErrorCompo = True
|
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
|
DdfFile.SaveErrorCompo = False
|
||||||
Else
|
Else
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
DdfFile.SaveErrorCompo = True
|
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
|
DdfFile.SaveErrorCompo = False
|
||||||
End If
|
End If
|
||||||
Else
|
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
|
If SavedAssName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.CorrectAssembInfo AndAlso
|
||||||
SavedAssName.SelAssembly.ListPartDoor.Count < 3 Then
|
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
|
SavedAssName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.MissingAssembInfo
|
||||||
End If
|
End If
|
||||||
Dim ErrorMessage As String = SavedAssName.SelAssembly.ControlAssembly(True)
|
Dim ErrorMessage As String = SavedAssName.SelAssembly.ControlAssembly(True)
|
||||||
|
Dim m_MessageBoxResult As MessageBoxResult = MessageBoxResult.Cancel
|
||||||
If Not String.IsNullOrEmpty(ErrorMessage) Then
|
If Not String.IsNullOrEmpty(ErrorMessage) Then
|
||||||
If Not MessageBox.Show(ErrorMessage, EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
|
' Richiedo di scegliere se salvare come porta singola oppure come assemblato (altrimenti annullo il salvataggio)
|
||||||
Return False
|
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
|
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
|
End If
|
||||||
DdfFile.SaveErrorCompo = True
|
|
||||||
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
|
|
||||||
DdfFile.SaveErrorCompo = False
|
|
||||||
End If
|
End If
|
||||||
' controllo che il salvataggio sia andato a buon fine
|
' controllo che il salvataggio sia andato a buon fine
|
||||||
|
|
||||||
@@ -334,13 +367,12 @@ Public Class AssemblyManagerVM
|
|||||||
Map.refAssemblyManagerVM.CurrProject.AssemblyList = New ObservableCollection(Of AssemblyName)
|
Map.refAssemblyManagerVM.CurrProject.AssemblyList = New ObservableCollection(Of AssemblyName)
|
||||||
Dim DDFArray() As String = Directory.GetFiles(Map.refAssemblyManagerVM.CurrProject.Name)
|
Dim DDFArray() As String = Directory.GetFiles(Map.refAssemblyManagerVM.CurrProject.Name)
|
||||||
For IndexFile As Integer = 0 To DDFArray.Count - 1
|
For IndexFile As Integer = 0 To DDFArray.Count - 1
|
||||||
If Path.GetExtension(DDFArray(IndexFile)) <> DDF_EXTENSION Then
|
If Path.GetExtension(DDFArray(IndexFile)).ToLower = DDF_EXTENSION Then
|
||||||
Continue For
|
Dim NewAssembly As New AssemblyName
|
||||||
|
NewAssembly.Name = DDFArray(IndexFile)
|
||||||
|
NewAssembly.IsModified = False
|
||||||
|
Map.refAssemblyManagerVM.CurrProject.AssemblyList.Add(NewAssembly)
|
||||||
End If
|
End If
|
||||||
Dim NewAssembly As New AssemblyName
|
|
||||||
NewAssembly.Name = DDFArray(IndexFile)
|
|
||||||
NewAssembly.IsModified = False
|
|
||||||
Map.refAssemblyManagerVM.CurrProject.AssemblyList.Add(NewAssembly)
|
|
||||||
Next
|
Next
|
||||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||||
Try
|
Try
|
||||||
@@ -984,8 +1016,11 @@ Public Class AssemblyManagerVM
|
|||||||
If OptionModule.AdjustDDT Then
|
If OptionModule.AdjustDDT Then
|
||||||
DdfFile.WriteDDFPart(OpenedAssName.SelAssembly.ListPartDoor(0).Door, OptionModule.SaveFileNameFromArgs, True, False)
|
DdfFile.WriteDDFPart(OpenedAssName.SelAssembly.ListPartDoor(0).Door, OptionModule.SaveFileNameFromArgs, True, False)
|
||||||
' TERMINO TUTTO SUBITO
|
' TERMINO TUTTO SUBITO
|
||||||
BlindProgLog("Scrittura file '.ddf' terminata")
|
EgtOutLog("Scrittura file '.ddf' terminata")
|
||||||
End
|
EgtExit()
|
||||||
|
Map.refMainWindowVM.MainWindowModel.ReleaseInstance()
|
||||||
|
Application.Current.Shutdown(0)
|
||||||
|
Return True
|
||||||
End If
|
End If
|
||||||
' aggiorno elenco quotature
|
' aggiorno elenco quotature
|
||||||
Map.refDimensioningPanelVM.LoadHardwareDimList()
|
Map.refDimensioningPanelVM.LoadHardwareDimList()
|
||||||
@@ -1012,7 +1047,16 @@ Public Class AssemblyManagerVM
|
|||||||
If Assembly.Refreshing Then EgtZoom(ZM.ALL)
|
If Assembly.Refreshing Then EgtZoom(ZM.ALL)
|
||||||
m_CurrProject.SelAssemblyName.SelAssembly.MatchCompo()
|
m_CurrProject.SelAssemblyName.SelAssembly.MatchCompo()
|
||||||
m_CurrProject.SelAssemblyName.SelAssembly.UpDateAllOrigValue()
|
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
|
End If
|
||||||
' ogni progetto salvato è l'ultimo da aprire, anche se il programma è chiuso dall'HardwareManager
|
' ogni progetto salvato è l'ultimo da aprire, anche se il programma è chiuso dall'HardwareManager
|
||||||
' controllo che esiste almeno un file aperto
|
' controllo che esiste almeno un file aperto
|
||||||
@@ -1611,8 +1655,8 @@ Public Class AssemblyManagerVM
|
|||||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(FilePath, Trim(FilePath))
|
SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(FilePath, Trim(FilePath))
|
||||||
' Controllo se il nome della porta ha estensione
|
' Controllo se il nome della porta ha estensione
|
||||||
If Path.HasExtension(SaveFileDialog.FileName) Then
|
If Path.HasExtension(SaveFileDialog.FileName) Then
|
||||||
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName)
|
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName).ToLower
|
||||||
If Not sExtension.ToLower = DDF_EXTENSION Then
|
If Not sExtension = DDF_EXTENSION Then
|
||||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(sExtension, DDF_EXTENSION)
|
SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(sExtension, DDF_EXTENSION)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -225,6 +225,8 @@ Public Class CompoPanelVM
|
|||||||
Map.refAssemblyPageVM.CurrAssembly.CreateCompoOnJamb(NewCompo, "")
|
Map.refAssemblyPageVM.CurrAssembly.CreateCompoOnJamb(NewCompo, "")
|
||||||
End If
|
End If
|
||||||
Map.refSceneManagerVM.RefreshBtn()
|
Map.refSceneManagerVM.RefreshBtn()
|
||||||
|
' evidenzio componente
|
||||||
|
Map.refPartPageVM.CurrPart.MarkCompoInScena()
|
||||||
Else
|
Else
|
||||||
MessageBox.Show(EgtMsg(50108), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
MessageBox.Show(EgtMsg(50108), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -133,10 +133,9 @@ Public Class CompoType
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function LoadListTemplate() As Boolean
|
Public Function LoadListTemplate() As Boolean
|
||||||
FolderList.Clear()
|
|
||||||
m_HardwareFolderList.Clear()
|
|
||||||
m_FrameFolderList.Clear()
|
|
||||||
m_FolderList.Clear()
|
m_FolderList.Clear()
|
||||||
|
m_FrameFolderList.Clear()
|
||||||
|
m_HardwareFolderList.Clear()
|
||||||
GetDirectoryCompoModel(m_Path, m_FolderList, m_FrameFolderList, m_HardwareFolderList)
|
GetDirectoryCompoModel(m_Path, m_FolderList, m_FrameFolderList, m_HardwareFolderList)
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ Module ConstGen
|
|||||||
Public Const CONF_DIR As String = "Config"
|
Public Const CONF_DIR As String = "Config"
|
||||||
' Sottodirettorio delle risorse
|
' Sottodirettorio delle risorse
|
||||||
Public Const RES_DIR As String = "Resources"
|
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"
|
Public Const TEMP_DIR As String = "Temp"
|
||||||
' Sottodirettorio di default per il salvataggio con nome
|
' Sottodirettorio di default per il salvataggio con nome
|
||||||
Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
|
Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ Module ConstIni
|
|||||||
Public Const K_EGTCAMEXE As String = "EgtCam5Exe"
|
Public Const K_EGTCAMEXE As String = "EgtCam5Exe"
|
||||||
Public Const K_REFRESHTIME As String = "RefreshTime"
|
Public Const K_REFRESHTIME As String = "RefreshTime"
|
||||||
Public Const K_DDFVERSION As String = "DDFVersion"
|
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 S_LANGUAGES As String = "Languages"
|
||||||
Public Const K_LANGUAGE As String = "Language"
|
Public Const K_LANGUAGE As String = "Language"
|
||||||
@@ -104,6 +106,9 @@ Module ConstIni
|
|||||||
Public Const K_LAUNCHER As String = "Launcher"
|
Public Const K_LAUNCHER As String = "Launcher"
|
||||||
Public Const K_LASTPROJECT As String = "LastProject"
|
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"
|
Public Const DEFAULT_INI_FILE_NAME As String = "Default.ini"
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -63,7 +63,8 @@ Friend Module DdfFile
|
|||||||
DdfFileContent.Add("#EGTDOORCREATOR")
|
DdfFileContent.Add("#EGTDOORCREATOR")
|
||||||
Dim Config As String = IniFile.m_sDoorsDirPath
|
Dim Config As String = IniFile.m_sDoorsDirPath
|
||||||
Config = Path.GetFileName(Config)
|
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
|
' versione 2.6g1: salvo il nome del template da cui è genetato il file corrente
|
||||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.OrigTemplate) Then
|
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.OrigTemplate) Then
|
||||||
DdfFileContent.Add("#OrigTemplate: " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.OrigTemplate)
|
DdfFileContent.Add("#OrigTemplate: " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.OrigTemplate)
|
||||||
|
|||||||
+23
-38
@@ -121,9 +121,9 @@ Public Class Compo
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub SetMark()
|
Public Sub SetMark()
|
||||||
m_BorderColor = Brushes.DeepPink
|
m_BorderColor = DirectCast(New BrushConverter().ConvertFrom("#FF4D84C4"), SolidColorBrush)
|
||||||
m_BackGroundColor = Brushes.White
|
m_BackGroundColor = DirectCast(New BrushConverter().ConvertFrom("#FFFFFFFF"), SolidColorBrush)
|
||||||
m_Foreground = Brushes.Gold
|
m_Foreground = DirectCast(New BrushConverter().ConvertFrom("#FF4D84C4"), SolidColorBrush)
|
||||||
m_BorderThickness = 2
|
m_BorderThickness = 2
|
||||||
m_FontBold = FontWeights.Bold
|
m_FontBold = FontWeights.Bold
|
||||||
NotifyPropertyChanged("BorderColor")
|
NotifyPropertyChanged("BorderColor")
|
||||||
@@ -1917,6 +1917,22 @@ Public Class Compo
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
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
|
' carico il parametro letto
|
||||||
Private Function LoadParamFromLua(sValue As String, ByRef CurrCompoParam As CompoParam) As Boolean
|
Private Function LoadParamFromLua(sValue As String, ByRef CurrCompoParam As CompoParam) As Boolean
|
||||||
If TypeOf CurrCompoParam Is TextBoxOnOffParam Then
|
If TypeOf CurrCompoParam Is TextBoxOnOffParam Then
|
||||||
@@ -1926,29 +1942,11 @@ Public Class Compo
|
|||||||
End If
|
End If
|
||||||
Dim sItems() As String = sValue.Split(";"c)
|
Dim sItems() As String = sValue.Split(";"c)
|
||||||
' estraggo il primo valore: -- NomeParamOnOff = inch(0.6); 0
|
' estraggo il primo valore: -- NomeParamOnOff = inch(0.6); 0
|
||||||
sValue = sItems(0)
|
Dim ReadValue As String = ConvertFromLua( 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)
|
|
||||||
TempParam.SetValue(ReadValue)
|
TempParam.SetValue(ReadValue)
|
||||||
' verifico se deve essere attivata
|
' verifico se deve essere attivata
|
||||||
If sItems.Count > 1 Then
|
If sItems.Count > 1 AndAlso sItems(1).Trim = "0" Then
|
||||||
If sItems(1).Trim <> "0" Then
|
TempParam.SetIsActive(False)
|
||||||
TempParam.SetIsActive(True)
|
|
||||||
Else
|
|
||||||
TempParam.SetIsActive(False)
|
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
TempParam.SetIsActive(True)
|
TempParam.SetIsActive(True)
|
||||||
End If
|
End If
|
||||||
@@ -1959,20 +1957,7 @@ Public Class Compo
|
|||||||
If Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage Then
|
If Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage Then
|
||||||
If Not TempParam.EnableCopy Then Return False
|
If Not TempParam.EnableCopy Then Return False
|
||||||
End If
|
End If
|
||||||
Dim ReadValue = RegexFunction.Brackets(sValue)
|
Dim ReadValue As String = ConvertFromLua( 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)
|
|
||||||
TempParam.SetValue(ReadValue)
|
TempParam.SetValue(ReadValue)
|
||||||
Return True
|
Return True
|
||||||
ElseIf TypeOf CurrCompoParam Is ComboBoxOnOffParam Then
|
ElseIf TypeOf CurrCompoParam Is ComboBoxOnOffParam Then
|
||||||
|
|||||||
+25
-9
@@ -1197,9 +1197,13 @@ Public Class Part
|
|||||||
End Get
|
End Get
|
||||||
Set(value As Compo)
|
Set(value As Compo)
|
||||||
m_SelCompo = value
|
m_SelCompo = value
|
||||||
MarkCompoInScena()
|
' La selezione della componente è demandata all'evento click (PartPageV)
|
||||||
|
'MarkCompoInScena()
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Public Sub SetSelCompo()
|
||||||
|
MarkCompoInScena()
|
||||||
|
End Sub
|
||||||
|
|
||||||
#Region "AddCompo"
|
#Region "AddCompo"
|
||||||
|
|
||||||
@@ -1421,7 +1425,7 @@ Public Class Part
|
|||||||
NewCompo.SetSelBrand(NewCompo.BrandListPart(0))
|
NewCompo.SetSelBrand(NewCompo.BrandListPart(0))
|
||||||
' Carico il primo modello della lista
|
' Carico il primo modello della lista
|
||||||
Dim SelItemIndex As Integer = 0
|
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
|
SelItemIndex += 1
|
||||||
End While
|
End While
|
||||||
If SelItemIndex < NewCompo.FileList.Count Then
|
If SelItemIndex < NewCompo.FileList.Count Then
|
||||||
@@ -1516,13 +1520,12 @@ Public Class Part
|
|||||||
EgtResetMark(nIdLay)
|
EgtResetMark(nIdLay)
|
||||||
nIdLay = EgtGetNextLayer(nIdLay)
|
nIdLay = EgtGetNextLayer(nIdLay)
|
||||||
End While
|
End While
|
||||||
EgtDraw()
|
|
||||||
For Each ItemCompo As Compo In CompoList
|
For Each ItemCompo As Compo In CompoList
|
||||||
ItemCompo.ResetMark()
|
ItemCompo.ResetMark()
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub MarkCompoInScena()
|
Public Sub MarkCompoInScena()
|
||||||
If IsNothing(m_SelCompo) Then Return
|
If IsNothing(m_SelCompo) Then Return
|
||||||
If GetMainPrivateProfileInt(S_GENERAL, "MarkCompo", 0) = 0 Then Return
|
If GetMainPrivateProfileInt(S_GENERAL, "MarkCompo", 0) = 0 Then Return
|
||||||
ResetAllMark()
|
ResetAllMark()
|
||||||
@@ -1534,6 +1537,8 @@ Public Class Part
|
|||||||
DdfFile.GetOrderedListSameCompo(TempList)
|
DdfFile.GetOrderedListSameCompo(TempList)
|
||||||
' ontengo la posizione prevista nella grafica
|
' ontengo la posizione prevista nella grafica
|
||||||
Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, m_SelCompo)
|
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
|
' recupero la lista ordinata
|
||||||
Dim sCompoName As String = m_SelCompo.TemplateSelItem
|
Dim sCompoName As String = m_SelCompo.TemplateSelItem
|
||||||
' recupero il primo part disponibile
|
' recupero il primo part disponibile
|
||||||
@@ -1542,13 +1547,22 @@ Public Class Part
|
|||||||
Dim IndexLay As Integer = 0
|
Dim IndexLay As Integer = 0
|
||||||
While nIdLay <> GDB_ID.NULL
|
While nIdLay <> GDB_ID.NULL
|
||||||
Dim sInfoPath As String = String.Empty
|
Dim sInfoPath As String = String.Empty
|
||||||
If EgtGetInfo(nIdLay, "Path", sInfoPath) Then
|
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
|
Dim sNamePath As String = sInfoPath
|
||||||
If sNamePath.Contains(sCompoName) And IndexLay = IndexInList Then
|
If sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 AndAlso
|
||||||
|
sInfoPath.IndexOf( sDirCompo, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay = IndexInList Then
|
||||||
EgtSetMark(nIdLay)
|
EgtSetMark(nIdLay)
|
||||||
m_SelCompo.SetMark()
|
m_SelCompo.SetMark()
|
||||||
Exit While
|
Exit While
|
||||||
ElseIf sNamePath.Contains(sCompoName) And IndexLay < IndexInList Then
|
ElseIf sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay < IndexInList Then
|
||||||
IndexLay = IndexLay + 1
|
IndexLay = IndexLay + 1
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -1873,6 +1887,7 @@ Public Class Part
|
|||||||
' Messaggi di errore generici, se la stringa dei messaggi contiene delle informazioni allora visualizzo
|
' Messaggi di errore generici, se la stringa dei messaggi contiene delle informazioni allora visualizzo
|
||||||
If Not String.IsNullOrWhiteSpace(sErrorInfo) Then
|
If Not String.IsNullOrWhiteSpace(sErrorInfo) Then
|
||||||
Dim sTitle As String = EgtMsg(50101)
|
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}.
|
' 50541 = {0} in reading {1}.
|
||||||
If Not IsNothing(ReadDoor) Then String.Format(EgtMsg(50541), sTitle, ReadDoor.TypePart)
|
If Not IsNothing(ReadDoor) Then String.Format(EgtMsg(50541), sTitle, ReadDoor.TypePart)
|
||||||
MessageBox.Show(sErrorInfo, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
|
MessageBox.Show(sErrorInfo, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
|
||||||
@@ -3497,10 +3512,11 @@ Public Class Part
|
|||||||
ElseIf nPartDoor > 1 Then
|
ElseIf nPartDoor > 1 Then
|
||||||
' Assemblati
|
' Assemblati
|
||||||
Dim WdSelPartV As New SelectPartV()
|
Dim WdSelPartV As New SelectPartV()
|
||||||
Dim WdSelPartVM As New SelectPartVM("Selezione della porta", "Selezione anta", nPartDoor, 1)
|
' 50233=Selezione della porta, 50234=Selezione anta
|
||||||
|
Dim WdSelPartVM As New SelectPartVM(EgtMsg(50233), EgtMsg(50234), nPartDoor, 1)
|
||||||
WdSelPartV.DataContext = WdSelPartVM
|
WdSelPartV.DataContext = WdSelPartVM
|
||||||
WdSelPartV.ShowDialog()
|
WdSelPartV.ShowDialog()
|
||||||
Dim nSelection As Integer = CInt(WdSelPartVM.Selection.Split(" "c)(1)) - 1
|
Dim nSelection As Integer = WdSelPartVM.nSelectedIndex
|
||||||
' Apro una finestra per chiedere quale anta usare come riferimento
|
' Apro una finestra per chiedere quale anta usare come riferimento
|
||||||
Dim LocalPartDoor As PartDoor = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(nSelection)
|
Dim LocalPartDoor As PartDoor = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(nSelection)
|
||||||
Me.m_Width = LocalPartDoor.Door.m_Width
|
Me.m_Width = LocalPartDoor.Door.m_Width
|
||||||
|
|||||||
@@ -31,4 +31,12 @@
|
|||||||
|
|
||||||
End Sub
|
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
|
End Class
|
||||||
|
|||||||
@@ -227,6 +227,10 @@
|
|||||||
<DependentUpon>SelectPartV.xaml</DependentUpon>
|
<DependentUpon>SelectPartV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ProjectManager\SelectPartVM.vb" />
|
<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="RegexFunction.vb" />
|
||||||
<Compile Include="ReportInfo\ReportCompo.vb" />
|
<Compile Include="ReportInfo\ReportCompo.vb" />
|
||||||
<Compile Include="SceneManager\DimensioningPanel\DimensioningPanelV.xaml.vb">
|
<Compile Include="SceneManager\DimensioningPanel\DimensioningPanelV.xaml.vb">
|
||||||
@@ -371,6 +375,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="ProjectManager\SpecialPanelV.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="SceneManager\DimensioningPanel\DimensioningPanelV.xaml">
|
<Page Include="SceneManager\DimensioningPanel\DimensioningPanelV.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<EgtDOORCreator:AssemblyPageVM x:Key="AssemblyPageVM"/>
|
<EgtDOORCreator:AssemblyPageVM x:Key="AssemblyPageVM"/>
|
||||||
<EgtDOORCreator:HardwarePageVM x:Key="HardwarePageVM"/>
|
<EgtDOORCreator:HardwarePageVM x:Key="HardwarePageVM"/>
|
||||||
<EgtDOORCreator:DimensioningPanelVM x:Key="DimensioningPanelVM"/>
|
<EgtDOORCreator:DimensioningPanelVM x:Key="DimensioningPanelVM"/>
|
||||||
|
<EgtDOORCreator:SpecialPanelVM x:Key="SpecialPanelVM"/>
|
||||||
|
|
||||||
<!--Colori predefiniti-->
|
<!--Colori predefiniti-->
|
||||||
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF4D84C4" />
|
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF4D84C4" />
|
||||||
@@ -162,7 +163,7 @@
|
|||||||
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
|
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
|
||||||
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
|
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
|
||||||
<SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
|
<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.Pressed.Border" Color="#FF2C628B"/>
|
||||||
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
|
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
|
||||||
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
|
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
|
||||||
|
|||||||
@@ -481,11 +481,12 @@ Public Class Hardware
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
' elimina il file temporaneo CurrHardware.lua
|
' elimina il file temporaneo CurrHardware.lua (se esiste anche CurrHardware.luae)
|
||||||
Public Function DeleteTempFile() As Boolean
|
Public Function DeleteTempFile() As Boolean
|
||||||
If String.IsNullOrWhiteSpace(CurrHardwareFilePath) Then Return False
|
If String.IsNullOrWhiteSpace(CurrHardwareFilePath) Then Return False
|
||||||
Try
|
Try
|
||||||
File.Delete(CurrHardwareFilePath)
|
File.Delete(CurrHardwareFilePath)
|
||||||
|
if File.Exists(CurrHardwareFilePath & "e") Then File.Delete(CurrHardwareFilePath & "e")
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
End Try
|
End Try
|
||||||
Return True
|
Return True
|
||||||
@@ -1600,7 +1601,7 @@ Public Class Hardware
|
|||||||
bNewHardware = False
|
bNewHardware = False
|
||||||
Dim ErrorMsg As String = String.Empty
|
Dim ErrorMsg As String = String.Empty
|
||||||
Dim NewFileContent As New ObservableCollection(Of String)
|
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
|
' scrivo tutto sul file corrente
|
||||||
Try
|
Try
|
||||||
@@ -1790,19 +1791,20 @@ Public Class Hardware
|
|||||||
Map.refHardwarePageVM.GenericPart.CompoList.Clear()
|
Map.refHardwarePageVM.GenericPart.CompoList.Clear()
|
||||||
If String.IsNullOrWhiteSpace(Map.refHardwarePageVM.CurrHardware.SelTemplate) Then Return False
|
If String.IsNullOrWhiteSpace(Map.refHardwarePageVM.CurrHardware.SelTemplate) Then Return False
|
||||||
Dim NewFileContent As New ObservableCollection(Of String)
|
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
|
' costruisco il nome del percorso del file corrente
|
||||||
Dim ModelDir As String = String.Empty
|
Dim ModelDir As String = String.Empty
|
||||||
' costruisco il percorso del file temporaneo nella cartella corrente:
|
' costruisco il percorso del file temporaneo nella cartella corrente:
|
||||||
Dim CurrDirectoryInModelDir As String = Path.GetDirectoryName(Map.refHardwarePageVM.CurrHardware.SelTemplate)
|
Dim CurrDirectoryInModelDir As String = Path.GetDirectoryName(Map.refHardwarePageVM.CurrHardware.SelTemplate)
|
||||||
CurrDirectoryInModelDir = Trim(CurrDirectoryInModelDir.Replace(m_HardwareGeneral.Path, ""))
|
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 m_SelBrand.ModelDir <> m_HardwareGeneral.Path Then ModelDir = m_SelBrand.ModelDirGraphic & "\"
|
||||||
If Not String.IsNullOrWhiteSpace(CurrDirectoryInModelDir) Then ModelDir = ModelDir & CurrDirectoryInModelDir & "\"
|
If Not String.IsNullOrWhiteSpace(CurrDirectoryInModelDir) Then ModelDir = ModelDir & CurrDirectoryInModelDir & "\"
|
||||||
Dim sTempFileHardw As String = m_HardwareGeneral.Path & "\" & ModelDir & TEMP_FILE_HARDWARE
|
Dim sTempFileHardw As String = m_HardwareGeneral.Path & "\" & ModelDir & TEMP_FILE_HARDWARE
|
||||||
' salvo il file
|
' salvo il file
|
||||||
File.WriteAllLines(sTempFileHardw, NewFileContent)
|
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
|
' aggiungo la componente
|
||||||
Map.refHardwarePageVM.GenericPart.AddNewHardware(m_HardwareGeneral, ModelDir & Path.GetFileNameWithoutExtension(TEMP_FILE_HARDWARE))
|
Map.refHardwarePageVM.GenericPart.AddNewHardware(m_HardwareGeneral, ModelDir & Path.GetFileNameWithoutExtension(TEMP_FILE_HARDWARE))
|
||||||
CurrHardwareFilePath = sTempFileHardw
|
CurrHardwareFilePath = sTempFileHardw
|
||||||
@@ -1819,7 +1821,7 @@ Public Class Hardware
|
|||||||
If Not File.Exists(TemplFile) Then Return False
|
If Not File.Exists(TemplFile) Then Return False
|
||||||
Dim FileContent() As String = File.ReadAllLines(TemplFile)
|
Dim FileContent() As String = File.ReadAllLines(TemplFile)
|
||||||
Dim NewFileContent As New ObservableCollection(Of String)
|
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
|
' costruisco il nome del percorso del file corrente
|
||||||
Dim CurrConfig As String = m_HardwareGeneral.Path & "\" & CONFIGINI_FILE_NAME
|
Dim CurrConfig As String = m_HardwareGeneral.Path & "\" & CONFIGINI_FILE_NAME
|
||||||
Dim CurrItemPath As String = CurrPath()
|
Dim CurrItemPath As String = CurrPath()
|
||||||
@@ -1831,7 +1833,7 @@ Public Class Hardware
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
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
|
For IndexName As Integer = 0 To m_GroupChapterName.Count - 1
|
||||||
CascadedChapter(m_GroupChapters, m_GroupChapterName(IndexName))
|
CascadedChapter(m_GroupChapters, m_GroupChapterName(IndexName))
|
||||||
Next
|
Next
|
||||||
|
|||||||
+23
-1
@@ -13,6 +13,8 @@ Friend Module IniFile
|
|||||||
|
|
||||||
' Livello dell'utilizzatore
|
' Livello dell'utilizzatore
|
||||||
Friend m_nUserLevel As Integer = 1
|
Friend m_nUserLevel As Integer = 1
|
||||||
|
' Livello di debug
|
||||||
|
Friend m_nDebug As Integer = 0
|
||||||
' Livello della chiave inserita nel PC
|
' Livello della chiave inserita nel PC
|
||||||
Friend m_nKeyLevel As Integer = 0
|
Friend m_nKeyLevel As Integer = 0
|
||||||
' Opzioni attive sulla chiave
|
' Opzioni attive sulla chiave
|
||||||
@@ -58,9 +60,13 @@ Friend Module IniFile
|
|||||||
' Path del modello ListLabel
|
' Path del modello ListLabel
|
||||||
Friend m_sListLabelCurrent As String = String.Empty
|
Friend m_sListLabelCurrent As String = String.Empty
|
||||||
' Path dell'eseguibile Cam5
|
' Path dell'eseguibile Cam5
|
||||||
Friend m_sEgtCameEXEPath As String = String.Empty
|
Friend m_sEgtCam5EXEPath As String = String.Empty
|
||||||
' Path LuaLibs Dir
|
' Path LuaLibs Dir
|
||||||
Friend m_sLuaLibsDir As String = String.Empty
|
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
|
' EgtDoorCreator.ini
|
||||||
Public Function GetPrivateProfileLanguage(ByVal lpAppName As String, ByVal lpKeyName As String) As Language
|
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")
|
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sDoorsDirPath & "\MTables\GeometryNameList.ini")
|
||||||
End Function
|
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
|
End Module
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Image Grid.Column="0" Source="/Resources/TopCommandBar/Import.png" Stretch="Uniform"
|
<Image Grid.Column="0" Source="/Resources/TopCommandBar/Import.png" Stretch="Uniform"
|
||||||
/>
|
/>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Image Grid.Column="0" Source="/Resources/TopCommandBar/New.png" Stretch="Uniform"
|
<Image Grid.Column="0" Source="/Resources/TopCommandBar/New.png" Stretch="Uniform"
|
||||||
HorizontalAlignment="Left"/>
|
HorizontalAlignment="Left"/>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Image Grid.Column="0" Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"
|
<Image Grid.Column="0" Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"
|
||||||
HorizontalAlignment="Left"/>
|
HorizontalAlignment="Left"/>
|
||||||
|
|||||||
@@ -12,12 +12,9 @@ Friend Class MainWindowModel
|
|||||||
Private m_objMutex As New Mutex
|
Private m_objMutex As New Mutex
|
||||||
' Variabile che indica il numero di istanze aperte del programma
|
' Variabile che indica il numero di istanze aperte del programma
|
||||||
Friend m_nInstance As Integer = 0
|
Friend m_nInstance As Integer = 0
|
||||||
|
|
||||||
' Path cartella Data
|
' Path cartella Data
|
||||||
Friend m_sDataRoot As String = String.Empty
|
Friend m_sDataRoot As String = String.Empty
|
||||||
|
|
||||||
Private m_nDebug As Integer = 0
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "CONSTRUCTOR"
|
#Region "CONSTRUCTOR"
|
||||||
@@ -33,10 +30,14 @@ Friend Class MainWindowModel
|
|||||||
IniFile.m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
|
IniFile.m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
|
||||||
' Impostazione direttorio per file temporanei
|
' Impostazione direttorio per file temporanei
|
||||||
IniFile.m_sTempDir = m_sDataRoot & "\" & TEMP_DIR
|
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
|
' Impostazione direttorio Ini file
|
||||||
IniFile.m_sIniFile = IniFile.m_sConfigDir & "\" & INI_FILE_NAME
|
IniFile.m_sIniFile = IniFile.m_sConfigDir & "\" & INI_FILE_NAME
|
||||||
' Impostazione path Ini file
|
' 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
|
' Impostazione direttorio della cartella Help
|
||||||
IniFile.m_sHelpDir = m_sDataRoot & "\" & HELP_DIR
|
IniFile.m_sHelpDir = m_sDataRoot & "\" & HELP_DIR
|
||||||
' Impostazione direttorio della cartella Template
|
' Impostazione direttorio della cartella Template
|
||||||
@@ -56,13 +57,11 @@ Friend Class MainWindowModel
|
|||||||
Dim sKey As String = String.Empty
|
Dim sKey As String = String.Empty
|
||||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||||
EgtSetKey(sKey)
|
EgtSetKey(sKey)
|
||||||
|
|
||||||
Dim sNestKey As String = ""
|
Dim sNestKey As String = ""
|
||||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
||||||
EgtSetNestKey(sNestKey)
|
EgtSetNestKey(sNestKey)
|
||||||
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
||||||
EgtSetNetHwKey(bNetHwKey)
|
EgtSetNetHwKey(bNetHwKey)
|
||||||
|
|
||||||
' Impostazioni per chiave di rete
|
' Impostazioni per chiave di rete
|
||||||
Dim bNetKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
Dim bNetKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
||||||
EgtSetNetHwKey(bNetKey)
|
EgtSetNetHwKey(bNetKey)
|
||||||
@@ -71,15 +70,13 @@ Friend Class MainWindowModel
|
|||||||
If Not String.IsNullOrEmpty(sLockId) Then
|
If Not String.IsNullOrEmpty(sLockId) Then
|
||||||
EgtSetLockId(sLockId)
|
EgtSetLockId(sLockId)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Verifico abilitazione nesting automatico
|
|
||||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
|
||||||
|
|
||||||
' Recupero livello e opzioni della chiave
|
' Recupero livello e opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2612, 1, IniFile.m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2712, 1, IniFile.m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(3279, 2612, 1, IniFile.m_nKeyOptions)
|
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
|
'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 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 &
|
Dim sLogMsg As String = "User " & Environment.UserName & "\" & Environment.MachineName & " (" & m_nInstance.ToString() & ")" & vbLf &
|
||||||
My.Application.Info.Description.ToString() & " ver. " &
|
My.Application.Info.Description.ToString() & " ver. " &
|
||||||
@@ -87,7 +84,7 @@ Friend Class MainWindowModel
|
|||||||
"." & My.Application.Info.Version.Minor.ToString() &
|
"." & My.Application.Info.Version.Minor.ToString() &
|
||||||
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
|
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
|
||||||
My.Application.Info.Version.Revision.ToString()
|
My.Application.Info.Version.Revision.ToString()
|
||||||
EgtInit(m_nDebug, sLogFile, sLogMsg)
|
EgtInit(IniFile.m_nDebug, sLogFile, sLogMsg)
|
||||||
' Carico i messaggi
|
' Carico i messaggi
|
||||||
OptionModule.ReadMessages()
|
OptionModule.ReadMessages()
|
||||||
' Carico direttorio doors
|
' Carico direttorio doors
|
||||||
@@ -121,8 +118,6 @@ Friend Class MainWindowModel
|
|||||||
EgtLuaRequire(sLuaBaseLib)
|
EgtLuaRequire(sLuaBaseLib)
|
||||||
' Imposto path IniFile
|
' Imposto path IniFile
|
||||||
EgtSetIniFile(IniFile.m_sIniFile)
|
EgtSetIniFile(IniFile.m_sIniFile)
|
||||||
' Imposto la modalità di lettura dei file ddf
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
@@ -135,7 +130,7 @@ Friend Class MainWindowModel
|
|||||||
Private Sub ManageIstance()
|
Private Sub ManageIstance()
|
||||||
Dim bCreated As Boolean
|
Dim bCreated As Boolean
|
||||||
Try
|
Try
|
||||||
m_objMutex = New Mutex(False, "Global\EgtDOORCreator", bCreated)
|
m_objMutex = New Mutex(True, "Global\EgtDOORCreator", bCreated)
|
||||||
Catch
|
Catch
|
||||||
bCreated = False
|
bCreated = False
|
||||||
End Try
|
End Try
|
||||||
@@ -144,20 +139,36 @@ Friend Class MainWindowModel
|
|||||||
m_nInstance = 1
|
m_nInstance = 1
|
||||||
' Aggiorno stato istanze attive
|
' Aggiorno stato istanze attive
|
||||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString)
|
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString)
|
||||||
|
' Rilascio il possesso del mutex
|
||||||
|
m_objMutex.ReleaseMutex()
|
||||||
Else
|
Else
|
||||||
' Leggo il massimo numero di istanze ammesse
|
' Leggo il massimo numero di istanze ammesse
|
||||||
|
Const MAX_INST As Integer = 32
|
||||||
Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
|
Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
|
||||||
nMaxInst = Max(1, Min(nMaxInst, 32))
|
nMaxInst = Max(1, Min(nMaxInst, MAX_INST))
|
||||||
' Cerco il primo indice di istanza libero (max 32)
|
' Richiedo il possesso del mutex
|
||||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
Dim bOk As Boolean = False
|
||||||
m_nInstance = 1
|
If m_objMutex.WaitOne(500) Then
|
||||||
Dim nMask As Integer = 1
|
' Cerco il primo indice di istanza libero (max 32)
|
||||||
While (nTmp And nMask) <> 0 And m_nInstance <= m_nInstance
|
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||||
m_nInstance += 1
|
m_nInstance = 1
|
||||||
nMask *= 2
|
Dim nMask As Integer = 1
|
||||||
End While
|
While (nTmp And nMask) <> 0 And m_nInstance <= m_nInstance
|
||||||
' Se l'indice supera il massimo
|
m_nInstance += 1
|
||||||
If m_nInstance > nMaxInst Then
|
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
|
' porto in primo piano la prima istanza
|
||||||
Dim bFound As Boolean = False
|
Dim bFound As Boolean = False
|
||||||
' processi del programma a 32 bit
|
' processi del programma a 32 bit
|
||||||
@@ -181,14 +192,22 @@ Friend Class MainWindowModel
|
|||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
' esco dal programma
|
' esco dal programma
|
||||||
End
|
Environment.Exit(1)
|
||||||
End If
|
End If
|
||||||
' Aggiorno stato istanze attive
|
|
||||||
nTmp += (1 << (m_nInstance - 1))
|
|
||||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
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>
|
''' <summary>
|
||||||
''' Funzione che cancella tutti i file in un direttorio o lo crea se non esiste
|
''' Funzione che cancella tutti i file in un direttorio o lo crea se non esiste
|
||||||
''' </summary>
|
''' </summary>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Class MainWindowV
|
Class MainWindowV
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ Class MainWindowV
|
|||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
' Per leggere più argomenti devono essere scritti ognuno tra doppi apici e separati da spazio
|
' Per leggere più argomenti devono essere scritti ognuno tra doppi apici e separati da spazio
|
||||||
' Esempio:"Argomento 1 di prova" "Argomento 2 di prova"
|
' Esempio:"Argomento 1 di prova" "Argomento 2 di prova"
|
||||||
|
EgtOutLog(" 1 Numero argomenti: " & args.Length.ToString)
|
||||||
If args.Length > 0 Then
|
If args.Length > 0 Then
|
||||||
m_args = args
|
m_args = args
|
||||||
RunBlindCode()
|
RunBlindCode()
|
||||||
@@ -32,7 +34,7 @@ Class MainWindowV
|
|||||||
|
|
||||||
Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
|
Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
|
||||||
' Salvo posizione finestra (se non minimizzata)
|
' 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)
|
WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -50,33 +52,34 @@ Class MainWindowV
|
|||||||
' Lettura degli argomenti e scrittura di un file di Log con i parametri caricati
|
' Lettura degli argomenti e scrittura di un file di Log con i parametri caricati
|
||||||
Private Sub ReadArgs()
|
Private Sub ReadArgs()
|
||||||
If Not IsNothing(m_args) Then
|
If Not IsNothing(m_args) Then
|
||||||
StartBlinProgdLog(IniFile.m_sTempDir & "\BlindProgLog.txt")
|
|
||||||
' leggo gli argomenti: Il programma si chiude appena termina la scrittura del file DDF
|
' leggo gli argomenti: Il programma si chiude appena termina la scrittura del file DDF
|
||||||
Dim Items() As String = m_args(0).Split(";"c)
|
Dim Items() As String = m_args(0).Split(";"c)
|
||||||
|
EgtOutLog(" Argomenti: " & m_args.ToString)
|
||||||
If Items.Length >= 5 Then
|
If Items.Length >= 5 Then
|
||||||
' Avvio progetto - LauncherOpt.Open_last_project (1)
|
' Avvio progetto - LauncherOpt.Open_last_project (1)
|
||||||
OptionModule.m_bLauncherOpenOnce = True
|
OptionModule.m_bLauncherOpenOnce = True
|
||||||
' Indico il percorso del file
|
' Indico il percorso del file
|
||||||
OptionModule.FileNameFromArgs = Items(0)
|
OptionModule.FileNameFromArgs = Items(0)
|
||||||
BlindProgLog(" File '.ddt' input : " & OptionModule.FileNameFromArgs)
|
EgtOutLog(" File '.ddt' input : " & OptionModule.FileNameFromArgs)
|
||||||
' Assegno i valore Width, Height, Thickness
|
' Assegno i valore Width, Height, Thickness
|
||||||
OptionModule.m_Width = Items(1)
|
OptionModule.m_Width = Items(1)
|
||||||
BlindProgLog(" width : " & OptionModule.m_Width)
|
EgtOutLog(" width : " & OptionModule.m_Width)
|
||||||
OptionModule.m_Height = Items(2)
|
OptionModule.m_Height = Items(2)
|
||||||
BlindProgLog(" height : " & OptionModule.m_Height)
|
EgtOutLog(" height : " & OptionModule.m_Height)
|
||||||
OptionModule.m_Thickness = Items(3)
|
OptionModule.m_Thickness = Items(3)
|
||||||
BlindProgLog(" thickness : " & OptionModule.m_Thickness)
|
EgtOutLog(" thickness : " & OptionModule.m_Thickness)
|
||||||
' Indico il percoso di salvataggio file DDF
|
' Indico il percoso di salvataggio file DDF
|
||||||
OptionModule.SaveFileNameFromArgs = Items(4)
|
OptionModule.SaveFileNameFromArgs = Items(4)
|
||||||
BlindProgLog(" File '.ddf' output : " & OptionModule.SaveFileNameFromArgs)
|
EgtOutLog(" File '.ddf' output : " & OptionModule.SaveFileNameFromArgs)
|
||||||
' Nuovo parametro da laggere per gestione Swing
|
' Nuovo parametro da laggere per gestione Swing
|
||||||
If Items.Length = 6 Then
|
If Items.Length = 6 Then
|
||||||
OptionModule.ForcesSideSwing = Items(5)
|
OptionModule.ForcesSideSwing = Items(5)
|
||||||
BlindProgLog(" swing : " & OptionModule.ForcesSideSwing)
|
EgtOutLog(" swing : " & OptionModule.ForcesSideSwing)
|
||||||
End If
|
End If
|
||||||
' abilito lettura dati
|
' abilito lettura dati
|
||||||
OptionModule.AdjustDDT = True
|
OptionModule.AdjustDDT = True
|
||||||
Else
|
Else
|
||||||
|
EgtOutLog(" Argomenti non conformi")
|
||||||
' blocco lettura dati
|
' blocco lettura dati
|
||||||
OptionModule.AdjustDDT = False
|
OptionModule.AdjustDDT = False
|
||||||
' TERMINO TUTTO SUBITO!
|
' TERMINO TUTTO SUBITO!
|
||||||
|
|||||||
+32
-14
@@ -8,6 +8,16 @@ Public Class MainWindowVM
|
|||||||
|
|
||||||
' Modello del MainWindow (classe vera e propria)
|
' Modello del MainWindow (classe vera e propria)
|
||||||
Private m_MainWindowModel As New MainWindowModel
|
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
|
Private m_VisibilityAssemblyManager As Visibility = Visibility.Visible
|
||||||
Public Property VisibilityAssemblyManager As Visibility
|
Public Property VisibilityAssemblyManager As Visibility
|
||||||
@@ -65,10 +75,13 @@ Public Class MainWindowVM
|
|||||||
Return m_SelectedPage
|
Return m_SelectedPage
|
||||||
End Get
|
End Get
|
||||||
Set(value As ListPageEnum)
|
Set(value As ListPageEnum)
|
||||||
m_SelectedPage = value
|
' Verifico che sia una vera modifica
|
||||||
NotifyPropertyChanged("PageControl")
|
If m_SelectedPage <> value Then
|
||||||
If Not IsNothing(Map.refInstrumentPanelVM) Then
|
m_SelectedPage = value
|
||||||
Map.refInstrumentPanelVM.NotifyPropertyChanged("DimensionVisibility")
|
NotifyPropertyChanged("PageControl")
|
||||||
|
If Not IsNothing(Map.refInstrumentPanelVM) Then
|
||||||
|
Map.refInstrumentPanelVM.NotifyPropertyChanged("DimensionVisibility")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -86,7 +99,7 @@ Public Class MainWindowVM
|
|||||||
Public ReadOnly Property PageControl As ContentControl
|
Public ReadOnly Property PageControl As ContentControl
|
||||||
Get
|
Get
|
||||||
If m_SelectedPage = ListPageEnum.nDDFPage Then
|
If m_SelectedPage = ListPageEnum.nDDFPage Then
|
||||||
If OptionModule.m_SingleDoor then
|
If OptionModule.m_SingleDoor Then
|
||||||
VisibilityAssemblyManager = Visibility.Hidden
|
VisibilityAssemblyManager = Visibility.Hidden
|
||||||
Else
|
Else
|
||||||
VisibilityAssemblyManager = Visibility.Visible
|
VisibilityAssemblyManager = Visibility.Visible
|
||||||
@@ -95,7 +108,7 @@ Public Class MainWindowVM
|
|||||||
NotifyPropertyChanged("ProjectManagerControl")
|
NotifyPropertyChanged("ProjectManagerControl")
|
||||||
Return m_PartPage
|
Return m_PartPage
|
||||||
ElseIf m_SelectedPage = ListPageEnum.nAssemblyPage Then
|
ElseIf m_SelectedPage = ListPageEnum.nAssemblyPage Then
|
||||||
If OptionModule.m_SingleDoor then
|
If OptionModule.m_SingleDoor Then
|
||||||
VisibilityAssemblyManager = Visibility.Hidden
|
VisibilityAssemblyManager = Visibility.Hidden
|
||||||
Else
|
Else
|
||||||
VisibilityAssemblyManager = Visibility.Visible
|
VisibilityAssemblyManager = Visibility.Visible
|
||||||
@@ -109,7 +122,7 @@ Public Class MainWindowVM
|
|||||||
NotifyPropertyChanged("ProjectManagerControl")
|
NotifyPropertyChanged("ProjectManagerControl")
|
||||||
Return m_HardwarePage
|
Return m_HardwarePage
|
||||||
Else
|
Else
|
||||||
If OptionModule.m_SingleDoor then
|
If OptionModule.m_SingleDoor Then
|
||||||
VisibilityAssemblyManager = Visibility.Hidden
|
VisibilityAssemblyManager = Visibility.Hidden
|
||||||
Else
|
Else
|
||||||
VisibilityAssemblyManager = Visibility.Visible
|
VisibilityAssemblyManager = Visibility.Visible
|
||||||
@@ -139,7 +152,7 @@ Public Class MainWindowVM
|
|||||||
|
|
||||||
Public ReadOnly Property ProjectManagerControl As ContentControl
|
Public ReadOnly Property ProjectManagerControl As ContentControl
|
||||||
Get
|
Get
|
||||||
If m_SelectedPage <> ListPageEnum.nHardwarePage then
|
If m_SelectedPage <> ListPageEnum.nHardwarePage Then
|
||||||
Return m_ProjectManager
|
Return m_ProjectManager
|
||||||
Else
|
Else
|
||||||
ProjectNameMsg = "HardwareManager"
|
ProjectNameMsg = "HardwareManager"
|
||||||
@@ -155,6 +168,7 @@ Public Class MainWindowVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Sub New()
|
Sub New()
|
||||||
|
EgtOutLog(" Creazione e inizializzazone MainWondowVM ")
|
||||||
Map.SetRefMainWindowVM(Me)
|
Map.SetRefMainWindowVM(Me)
|
||||||
m_AssemblyPage = New AssemblyPageV
|
m_AssemblyPage = New AssemblyPageV
|
||||||
m_AssemblyPage.DataContext = New AssemblyPageVM
|
m_AssemblyPage.DataContext = New AssemblyPageVM
|
||||||
@@ -168,7 +182,6 @@ Public Class MainWindowVM
|
|||||||
m_HardwarePage.DataContext = New HardwarePageVM
|
m_HardwarePage.DataContext = New HardwarePageVM
|
||||||
m_AssemblyManager = New AssemblyManagerV
|
m_AssemblyManager = New AssemblyManagerV
|
||||||
m_AssemblyManager.DataContext = New AssemblyManagerVM
|
m_AssemblyManager.DataContext = New AssemblyManagerVM
|
||||||
' inserisco la scena
|
|
||||||
m_SceneManager = New SceneManagerV
|
m_SceneManager = New SceneManagerV
|
||||||
m_SceneManager.DataContext = New SceneManagerVM
|
m_SceneManager.DataContext = New SceneManagerVM
|
||||||
Dim OptionsPage As OptionsVM = OptionPage
|
Dim OptionsPage As OptionsVM = OptionPage
|
||||||
@@ -313,7 +326,7 @@ Public Class MainWindowVM
|
|||||||
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
||||||
If StartReload Then Return
|
If StartReload Then Return
|
||||||
' 50545 = It has been deleted file: {0}, {1}.
|
' 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
|
selectedWatcher = WatcherCalling.OnDeleted
|
||||||
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
||||||
RaiseEvent Er(Message, e.FullPath)
|
RaiseEvent Er(Message, e.FullPath)
|
||||||
@@ -326,7 +339,7 @@ Public Class MainWindowVM
|
|||||||
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
||||||
If StartReload Then Return
|
If StartReload Then Return
|
||||||
' 50543 = It has been renamed file: {0}, {1}.
|
' 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
|
selectedWatcher = WatcherCalling.OnRenamed
|
||||||
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
||||||
RaiseEvent Er(Message, e.FullPath)
|
RaiseEvent Er(Message, e.FullPath)
|
||||||
@@ -339,7 +352,7 @@ Public Class MainWindowVM
|
|||||||
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
||||||
If StartReload Then Return
|
If StartReload Then Return
|
||||||
' 50544 = It has been created new file: {0}, {1}.
|
' 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
|
selectedWatcher = WatcherCalling.OnCreated
|
||||||
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
||||||
RaiseEvent Er(Message, e.FullPath)
|
RaiseEvent Er(Message, e.FullPath)
|
||||||
@@ -426,7 +439,6 @@ Public Class MainWindowVM
|
|||||||
End If
|
End If
|
||||||
Map.refHardwarePageVM.CurrHardware.DeleteTempFile()
|
Map.refHardwarePageVM.CurrHardware.DeleteTempFile()
|
||||||
End If
|
End If
|
||||||
Utility.UnLockDir()
|
|
||||||
Case Else
|
Case Else
|
||||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
|
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))
|
Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name))
|
||||||
@@ -458,9 +470,15 @@ Public Class MainWindowVM
|
|||||||
Not String.IsNullOrWhiteSpace(Map.refAssemblyManagerVM.CurrProject.Name) Then
|
Not String.IsNullOrWhiteSpace(Map.refAssemblyManagerVM.CurrProject.Name) Then
|
||||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.Name)
|
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.Name)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' Terminazione generale di EgtInterface
|
||||||
EgtExit()
|
EgtExit()
|
||||||
Application.Current.MainWindow.Close()
|
' Libero eventuale porta bloccata
|
||||||
Utility.UnLockDir()
|
Utility.UnLockDir()
|
||||||
|
' Aggiorno istanze usate
|
||||||
|
m_MainWindowModel.ReleaseInstance()
|
||||||
|
' Chiudo la finestra principale del programma
|
||||||
|
Application.Current.MainWindow.Close()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
Private m_refOptionsVM As OptionsVM
|
Private m_refOptionsVM As OptionsVM
|
||||||
|
|
||||||
|
Private m_refSpecialPanelVM As SpecialPanelVM
|
||||||
|
|
||||||
#Region "Get"
|
#Region "Get"
|
||||||
|
|
||||||
Public ReadOnly Property refMainWindowVM As MainWindowVM
|
Public ReadOnly Property refMainWindowVM As MainWindowVM
|
||||||
@@ -148,6 +150,12 @@
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property refSpecialPanelVM As SpecialPanelVM
|
||||||
|
Get
|
||||||
|
Return m_refSpecialPanelVM
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
#End Region ' Get
|
#End Region ' Get
|
||||||
|
|
||||||
#Region "Set"
|
#Region "Set"
|
||||||
@@ -252,6 +260,11 @@
|
|||||||
Return Not IsNothing(m_refHardwareHelpSceneHostV)
|
Return Not IsNothing(m_refHardwareHelpSceneHostV)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function SetRefSpecialPanelVM(SpecialPanelVM As SpecialPanelVM) As Boolean
|
||||||
|
m_refSpecialPanelVM = SpecialPanelVM
|
||||||
|
Return Not IsNothing(m_refSpecialPanelVM)
|
||||||
|
End Function
|
||||||
|
|
||||||
#End Region ' Set
|
#End Region ' Set
|
||||||
|
|
||||||
#Region "Init"
|
#Region "Init"
|
||||||
|
|||||||
@@ -22,17 +22,17 @@ Imports System.Windows
|
|||||||
#End if
|
#End if
|
||||||
#Else
|
#Else
|
||||||
#If DEBUG Then
|
#If DEBUG Then
|
||||||
<Assembly: AssemblyTitle("EgtDOORCreator Debug 32 bit")>
|
<Assembly: AssemblyTitle("EgtDOORCreatorD32.exe")>
|
||||||
<Assembly: AssemblyDescription("EgtDOORCreatorD32.exe")>
|
<Assembly: AssemblyDescription("EgtDOORCreator Debug 32 bit")>
|
||||||
#Else
|
#Else
|
||||||
<Assembly: AssemblyTitle("EgtDOORCreator Release 32 bit")>
|
<Assembly: AssemblyTitle("EgtDOORCreatorR32.exe")>
|
||||||
<Assembly: AssemblyDescription("EgtDOORCreatorR32.exe")>
|
<Assembly: AssemblyDescription("EgtDOORCreator 32 bit")>
|
||||||
#End If
|
#End If
|
||||||
#End If
|
#End If
|
||||||
|
|
||||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyProduct("EgtDOORCreator")>
|
<Assembly: AssemblyProduct("EgtDOORCreator")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2016-2024 by Egalware s.r.l.")>
|
<Assembly: AssemblyCopyright("Copyright © 2016-2026 by Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("")>
|
||||||
<Assembly: ComVisible(false)>
|
<Assembly: ComVisible(false)>
|
||||||
|
|
||||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.6.12.1")>
|
<Assembly: AssemblyVersion("3.1.1.1")>
|
||||||
<Assembly: AssemblyFileVersion("2.6.12.1")>
|
<Assembly: AssemblyFileVersion("3.1.1.1")>
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ Friend Module OptionModule
|
|||||||
' flag per modalità di visualizzazione file (solo lettura)
|
' flag per modalità di visualizzazione file (solo lettura)
|
||||||
Friend ReadOnlyDDF As Boolean = False
|
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
|
' flag per forzare l'aggiornamento delle dimensioni anta dei file DDT
|
||||||
Friend AdjustDDT As Boolean = False
|
Friend AdjustDDT As Boolean = False
|
||||||
Friend FileNameFromArgs As String = String.Empty
|
Friend FileNameFromArgs As String = String.Empty
|
||||||
@@ -243,7 +246,7 @@ Friend Module OptionModule
|
|||||||
' verifico se il programma è in modalità di sola lettura DDF
|
' verifico se il programma è in modalità di sola lettura DDF
|
||||||
If (IniFile.m_nKeyOptions And KEY_OPT.READ_ONLY) <> 0 Then
|
If (IniFile.m_nKeyOptions And KEY_OPT.READ_ONLY) <> 0 Then
|
||||||
OptionModule.ReadOnlyDDF = True
|
OptionModule.ReadOnlyDDF = True
|
||||||
ElseIf GetMainPrivateProfileInt(S_GENERAL, "ReadOnly", 0) <> 0 Then
|
ElseIf GetMainPrivateProfileInt(S_GENERAL, K_READONLY, 0) <> 0 Then
|
||||||
OptionModule.ReadOnlyDDF = True
|
OptionModule.ReadOnlyDDF = True
|
||||||
Else
|
Else
|
||||||
OptionModule.ReadOnlyDDF = False
|
OptionModule.ReadOnlyDDF = False
|
||||||
@@ -333,7 +336,7 @@ Friend Module OptionModule
|
|||||||
Dim sEgtCam5EXE As String = String.Empty
|
Dim sEgtCam5EXE As String = String.Empty
|
||||||
' AndAlso File.Exists(sListLabelFile)
|
' AndAlso File.Exists(sListLabelFile)
|
||||||
If GetMainPrivateProfileString(S_GENERAL, K_EGTCAMEXE, "", sEgtCam5EXE) > 0 Then
|
If GetMainPrivateProfileString(S_GENERAL, K_EGTCAMEXE, "", sEgtCam5EXE) > 0 Then
|
||||||
IniFile.m_sEgtCameEXEPath = sEgtCam5EXE
|
IniFile.m_sEgtCam5EXEPath = sEgtCam5EXE
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim nHelpSelct As Integer = 0
|
Dim nHelpSelct As Integer = 0
|
||||||
@@ -777,6 +780,9 @@ Friend Module OptionModule
|
|||||||
DefaultGetPrivateProfileString(S_OVERMATERIALASSEMBLY, K_BOTTOMOVERMATERIAL_INI, "0", BottomOverMaterialAss)
|
DefaultGetPrivateProfileString(S_OVERMATERIALASSEMBLY, K_BOTTOMOVERMATERIAL_INI, "0", BottomOverMaterialAss)
|
||||||
Utility.ConvertCompoConfig(BottomOverMaterialAss, 100)
|
Utility.ConvertCompoConfig(BottomOverMaterialAss, 100)
|
||||||
m_BottomOverMaterialAssembly = BottomOverMaterialAss
|
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
|
' Lista messaggi per launcher
|
||||||
m_OptionLauncherList.Add(EgtMsg(50206)) 'Open Window
|
m_OptionLauncherList.Add(EgtMsg(50206)) 'Open Window
|
||||||
@@ -1057,13 +1063,13 @@ Friend Module OptionModule
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
Dim Items As String() = Directory.GetFiles(sMTableDir)
|
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
|
For Each MTableFile As String In Items
|
||||||
If MTableFile.EndsWith(".mtl") Then
|
If MTableFile.EndsWith(".mtl") Then
|
||||||
Dim sName As String = Path.GetFileNameWithoutExtension(MTableFile).ToLower
|
Dim sName As String = Path.GetFileNameWithoutExtension(MTableFile).ToLower
|
||||||
Dim sPath As String = MTableFile
|
Dim sPath As String = MTableFile
|
||||||
Dim bIsValid As Boolean = True
|
Dim bIsValid As Boolean = True
|
||||||
Dim ExcludeList As List(Of String) = GetExludeList()
|
|
||||||
For Each ExcludedItem As String In ExcludeList
|
For Each ExcludedItem As String In ExcludeList
|
||||||
If sName.ToLower.Contains(ExcludedItem) Then
|
If sName.ToLower.Contains(ExcludedItem) Then
|
||||||
bIsValid = False
|
bIsValid = False
|
||||||
@@ -1083,17 +1089,17 @@ Friend Module OptionModule
|
|||||||
End If
|
End If
|
||||||
' leggo il nome della MTable attiva
|
' leggo il nome della MTable attiva
|
||||||
Dim sSelectedMTable As String = String.Empty
|
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
|
If GetMainPrivateProfileString(S_DOORS, K_MTABLE, "", sSelectedMTable) <> 0 Then
|
||||||
For Each ItemFile As MTable In m_MTableList
|
For Each ItemFile As MTable In m_MTableList
|
||||||
If ItemFile.FilePath.ToLower = sSelectedMTable.Trim.ToLower Then
|
If ItemFile.FilePath.ToLower = sSelectedMTable.Trim.ToLower Then
|
||||||
m_SelectedMTable = ItemFile
|
m_SelectedMTable = ItemFile
|
||||||
nbSelected = True
|
bSelected = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
If Not nbSelected Then m_SelectedMTable = m_MTableList(0)
|
If Not bSelected Then m_SelectedMTable = m_MTableList(0)
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -1101,10 +1107,12 @@ Friend Module OptionModule
|
|||||||
Dim LocalList As New List(Of String)
|
Dim LocalList As New List(Of String)
|
||||||
Dim sVal As String = String.Empty
|
Dim sVal As String = String.Empty
|
||||||
GetMainPrivateProfileString(S_DOORS, "Exclude", "", sVal)
|
GetMainPrivateProfileString(S_DOORS, "Exclude", "", sVal)
|
||||||
Dim sItems As String() = sVal.Split(","c)
|
If Not String.IsNullOrWhiteSpace( sVal) Then
|
||||||
For Each Item As String In sItems
|
Dim sItems As String() = sVal.Split(","c)
|
||||||
LocalList.Add(Item.Trim)
|
For Each Item As String In sItems
|
||||||
Next
|
LocalList.Add(Item.Trim)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
Return LocalList
|
Return LocalList
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ Public Class OptionsVM
|
|||||||
|
|
||||||
Public ReadOnly Property EnableConfig As Boolean
|
Public ReadOnly Property EnableConfig As Boolean
|
||||||
Get
|
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
|
Return True
|
||||||
Else
|
Else
|
||||||
Return False
|
Return False
|
||||||
@@ -2065,35 +2065,40 @@ Public Class OptionsVM
|
|||||||
OptionsWindow.Close()
|
OptionsWindow.Close()
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
' Se abilitata modifica configurazione
|
||||||
If EnableConfig AndAlso m_IsChangedConfig Then
|
If EnableConfig Then
|
||||||
' Se modifico il direttorio Compo: aggiorno il file Config.ini dell'EgtCAM5
|
' Se cambiato direttorio Doors
|
||||||
EgtLuaExecFile(IniFile.m_sConfigDir & "\ChangeConfig.lua")
|
If m_IsChangedConfig Then
|
||||||
' assegno variabili
|
' Se modifico il direttorio Compo: aggiorno il file Config.ini dell'EgtCAM5
|
||||||
EgtLuaSetGlobStringVar("CCD.NewBaseDir", IniFile.m_sDoorsDirPath)
|
EgtLuaExecFile(IniFile.m_sConfigDir & "\ChangeConfig.lua")
|
||||||
EgtLuaSetGlobStringVar("CCD.NewMTable", OptionModule.m_SelectedMTable.Name)
|
' assegno variabili
|
||||||
' eseguo la funzione che esegue la scrittura delle variabili
|
EgtLuaSetGlobStringVar("CCD.NewBaseDir", IniFile.m_sDoorsDirPath)
|
||||||
EgtLuaCallFunction("CCD.ChangeConfigDirectory")
|
EgtLuaSetGlobStringVar("CCD.NewMTable", OptionModule.m_SelectedMTable.Name)
|
||||||
Dim sVal As String = ""
|
' eseguo la funzione che esegue la scrittura delle variabili
|
||||||
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
EgtLuaCallFunction("CCD.ChangeConfigDirectory")
|
||||||
OptionModule.m_CurrentMachine = sVal
|
Dim sVal As String = ""
|
||||||
EgtLuaResetGlobVar("CCD")
|
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
||||||
' chiudo il programma e lo riavvio
|
OptionModule.m_CurrentMachine = sVal
|
||||||
Map.refMainWindowVM.CloseApplication()
|
WriteMainPrivateProfileString(S_DOORS, K_MTABLE, OptionModule.m_SelectedMTable.FilePath)
|
||||||
Process.Start(Application.ResourceAssembly.Location)
|
EgtLuaResetGlobVar("CCD")
|
||||||
'End If
|
' chiudo il programma e lo riavvio
|
||||||
ElseIf EnableConfig AndAlso m_OrigMTable <> OptionModule.m_SelectedMTable.Name Then
|
Map.refMainWindowVM.CloseApplication()
|
||||||
' aggiorno il file Config.ini dell'EgtCAM5
|
Process.Start(Application.ResourceAssembly.Location)
|
||||||
EgtLuaExecFile(IniFile.m_sConfigDir & "\ChangeConfig.lua")
|
' se altrimenti cambiata MTable
|
||||||
' assegno variabili
|
ElseIf m_OrigMTable <> OptionModule.m_SelectedMTable.Name Then
|
||||||
EgtLuaSetGlobStringVar("CCD.NewBaseDir", IniFile.m_sDoorsDirPath)
|
' aggiorno il file Config.ini dell'EgtCAM5
|
||||||
EgtLuaSetGlobStringVar("CCD.NewMTable", OptionModule.m_SelectedMTable.Name)
|
EgtLuaExecFile(IniFile.m_sConfigDir & "\ChangeConfig.lua")
|
||||||
' eseguo la funzione che esegue la scrittura delle variabili
|
' assegno variabili
|
||||||
EgtLuaCallFunction("CCD.ChangeConfigDirectory")
|
EgtLuaSetGlobStringVar("CCD.NewBaseDir", IniFile.m_sDoorsDirPath)
|
||||||
Dim sVal As String = ""
|
EgtLuaSetGlobStringVar("CCD.NewMTable", OptionModule.m_SelectedMTable.Name)
|
||||||
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
' eseguo la funzione che esegue la scrittura delle variabili
|
||||||
OptionModule.m_CurrentMachine = sVal
|
EgtLuaCallFunction("CCD.ChangeConfigDirectory")
|
||||||
EgtLuaResetGlobVar("CCD")
|
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 If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ Public Class OrderVM
|
|||||||
Private Function VerifyNotIsNothing() As Boolean
|
Private Function VerifyNotIsNothing() As Boolean
|
||||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) OrElse
|
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) OrElse
|
||||||
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) OrElse
|
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) OrElse
|
||||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then
|
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count < 1 Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
Return True
|
Return True
|
||||||
|
|||||||
@@ -1,42 +1,43 @@
|
|||||||
<UserControl x:Class="ProjectManagerV"
|
<UserControl x:Class="ProjectManagerV"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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">
|
<StackPanel Orientation="Horizontal" IsEnabled="{Binding EnableProjectManager}" Height="32">
|
||||||
|
|
||||||
<!--Barra superiore dei comandi-->
|
<!--Barra superiore dei comandi-->
|
||||||
<Button Command="{Binding NewCommand}" ToolTip="{Binding NewToolTip}" Focusable="False"
|
<Button Command="{Binding NewCommand}" ToolTip="{Binding NewToolTip}" Focusable="False"
|
||||||
IsEnabled="{Binding EnableModifyDDF}">
|
IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<Image Source="{Binding NewProjectImg}" Stretch="Uniform"/>
|
<Image Source="{Binding NewProjectImg}" Stretch="Uniform"/>
|
||||||
</Button>
|
</Button>
|
||||||
<!--Visibility="{Binding VisibilityDeleteDDF}"-->
|
<!--Visibility="{Binding VisibilityDeleteDDF}"-->
|
||||||
<Button Command="{Binding DeleteCommand}" ToolTip="{Binding DeleteToolTip}" Focusable="False"
|
<Button Command="{Binding DeleteCommand}" ToolTip="{Binding DeleteToolTip}" Focusable="False"
|
||||||
IsEnabled="{Binding EnableModifyDDF}">
|
IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<Image Source="{Binding DeleteProjectImg}" Stretch="Uniform"/>
|
<Image Source="{Binding DeleteProjectImg}" Stretch="Uniform"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding OpenCommand}" ToolTip="{Binding OpenToolTip}"
|
<Button Command="{Binding OpenCommand}" ToolTip="{Binding OpenToolTip}"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
ContextMenuService.Placement="Bottom"
|
ContextMenuService.Placement="Bottom"
|
||||||
Tag="{Binding}">
|
Tag="{Binding}">
|
||||||
<Button.ContextMenu>
|
<Button.ContextMenu>
|
||||||
<ContextMenu ItemsSource="{Binding MruFileNames}">
|
<ContextMenu ItemsSource="{Binding MruFileNames}">
|
||||||
<ContextMenu.Resources>
|
<ContextMenu.Resources>
|
||||||
<Style TargetType="{x:Type MenuItem}">
|
<Style TargetType="{x:Type MenuItem}">
|
||||||
<Setter Property="Command"
|
<Setter Property="Command"
|
||||||
Value="{Binding PlacementTarget.Tag.OpenMruFileCommand,
|
Value="{Binding PlacementTarget.Tag.OpenMruFileCommand,
|
||||||
RelativeSource={RelativeSource Mode=FindAncestor,
|
RelativeSource={RelativeSource Mode=FindAncestor,
|
||||||
AncestorType=ContextMenu}}"/>
|
AncestorType=ContextMenu}}"/>
|
||||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||||
</Style>
|
</Style>
|
||||||
</ContextMenu.Resources>
|
</ContextMenu.Resources>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</Button.ContextMenu>
|
</Button.ContextMenu>
|
||||||
<Image Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"/>
|
<Image Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding ReloadCommand}" ToolTip="{Binding ReloadToolTip}" Focusable="False"
|
<Button Command="{Binding ReloadCommand}" ToolTip="{Binding ReloadToolTip}" Focusable="False"
|
||||||
IsEnabled="{Binding EnableModifyDDF}">
|
IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding SaveCommand}" ToolTip="{Binding SaveToolTip}" Focusable="False"
|
<Button Command="{Binding SaveCommand}" ToolTip="{Binding SaveToolTip}" Focusable="False"
|
||||||
IsEnabled="{Binding EnableModifyDDF}">
|
IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<Image Source="/Resources/TopCommandBar/Save.png" Stretch="Uniform"/>
|
<Image Source="/Resources/TopCommandBar/Save.png" Stretch="Uniform"/>
|
||||||
@@ -44,74 +45,77 @@
|
|||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding DuplicaCommand}" ToolTip="{Binding DuplicaToolTip}" Focusable="False"
|
<Button Command="{Binding DuplicaCommand}" ToolTip="{Binding DuplicaToolTip}" Focusable="False"
|
||||||
IsEnabled="{Binding EnableModifyDDF}">
|
IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" />
|
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" />
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding CreateTemplateCommand}" ToolTip="{Binding TemplateDoorToolTip}" Focusable="False"
|
<Button Command="{Binding CreateTemplateCommand}" ToolTip="{Binding TemplateDoorToolTip}" Focusable="False"
|
||||||
Visibility="{Binding VisibilityTemplate}" IsEnabled="{Binding EnableModifyDDF}">
|
Visibility="{Binding VisibilityTemplate}" IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<Image Source="/Resources/TopCommandBar/SaveAsTemplate.png" Stretch="Uniform" />
|
<Image Source="/Resources/TopCommandBar/SaveAsTemplate.png" Stretch="Uniform" />
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding CopyCommand}" ToolTip="{Binding CopyToolTip}" Focusable="False"
|
<Button Command="{Binding CopyCommand}" ToolTip="{Binding CopyToolTip}" Focusable="False"
|
||||||
IsEnabled="{Binding EnableModifyDDF}">
|
IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<Image Source="/Resources/TopCommandBar/Export.png" Stretch="Uniform" />
|
<Image Source="/Resources/TopCommandBar/Export.png" Stretch="Uniform" />
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding OpenCamCommand}" ToolTip="{Binding OpenCamToolTip}" Focusable="False"
|
<Button Command="{Binding OpenCamCommand}" ToolTip="{Binding OpenCamToolTip}" Focusable="False"
|
||||||
Visibility="{Binding VisibilityEgtCAM}" IsEnabled="{Binding EnableModifyDDF}">
|
Visibility="{Binding VisibilityEgtCAM}" IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<Image Source="/Resources/EgtCAM5.png" Stretch="Uniform" />
|
<Image Source="/Resources/EgtCAM5.png" Stretch="Uniform" />
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding PrintCommand}" ToolTip="{Binding PrintToolTip}" Focusable="False">
|
<Button Command="{Binding PrintCommand}" ToolTip="{Binding PrintToolTip}" Focusable="False">
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<Image Source="/Resources/InstrumentPanel/Print.png" Stretch="Uniform" />
|
<Image Source="/Resources/InstrumentPanel/Print.png" Stretch="Uniform" />
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
</Button>
|
</Button>
|
||||||
<!--<Button Command="{Binding RefreshDirCommand}" ToolTip="{Binding RefreshDirToolTip}" Focusable="False">
|
<!--<Button Command="{Binding RefreshDirCommand}" ToolTip="{Binding RefreshDirToolTip}" Focusable="False">
|
||||||
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
||||||
</Button>-->
|
</Button>-->
|
||||||
<!--Hardware-->
|
<!--Hardware-->
|
||||||
<!--<Button Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}" Focusable="False"
|
<!--<Button Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}" Focusable="False"
|
||||||
Visibility="{Binding DisableHM}">
|
Visibility="{Binding DisableHM}">
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<Image Source="/Resources/InstrumentPanel/Hardware.png" Stretch="Uniform" />
|
<Image Source="/Resources/InstrumentPanel/Hardware.png" Stretch="Uniform" />
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
</Button>-->
|
</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}">
|
Visibility="{Binding VisibilityCreateAssembly}" IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<Image Source="/Resources/TopCommandBar/Create Assembly.png" Stretch="Uniform" />
|
<Image Source="/Resources/TopCommandBar/Create Assembly.png" Stretch="Uniform" />
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding OptionsCommand}" ToolTip="{Binding OptionsToolTip}" Focusable="False"
|
<Button Command="{Binding OptionsCommand}" ToolTip="{Binding OptionsToolTip}" Focusable="False"
|
||||||
Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}" IsEnabled="{Binding EnableModifyDDF}">
|
Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}" IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}" Focusable="False"
|
|
||||||
|
<DOORCreator:SpecialPanelV DataContext="{StaticResource SpecialPanelVM}"/>
|
||||||
|
|
||||||
|
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}" Focusable="False"
|
||||||
IsEnabled="{Binding EnableModifyDDF}">
|
IsEnabled="{Binding EnableModifyDDF}">
|
||||||
<Image Source="/Resources/TopCommandBar/Send.png" Height="22" Margin="3,0,3,0" />
|
<Image Source="/Resources/TopCommandBar/Send.png" Height="22" Margin="3,0,3,0" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding GuideCommand}" ToolTip="{Binding GuideToolTip}" Focusable="False">
|
<Button Command="{Binding GuideCommand}" ToolTip="{Binding GuideToolTip}" Focusable="False">
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<Image Source="/Resources/TopCommandBar/Help.png" Stretch="Uniform" />
|
<Image Source="/Resources/TopCommandBar/Help.png" Stretch="Uniform" />
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
</Button>
|
</Button>
|
||||||
<!--Door-->
|
<!--Door-->
|
||||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||||
ToolTip="{Binding DoorToolTip}"
|
ToolTip="{Binding DoorToolTip}"
|
||||||
IsChecked="{Binding DoorIsChecked}"
|
IsChecked="{Binding DoorIsChecked}"
|
||||||
Content="{Binding DoorToolTip}"
|
Content="{Binding DoorToolTip}"
|
||||||
IsEnabled="{Binding EnableModifyDDF}">
|
IsEnabled="{Binding EnableModifyDDF}">
|
||||||
</RadioButton>
|
</RadioButton>
|
||||||
<!--Hardware-->
|
<!--Hardware-->
|
||||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||||
Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}"
|
Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}"
|
||||||
Content="{Binding HardwareToolTip}"
|
Content="{Binding HardwareToolTip}"
|
||||||
IsEnabled="{Binding EnableModifyDDF}">
|
IsEnabled="{Binding EnableModifyDDF}">
|
||||||
</RadioButton>
|
</RadioButton>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -67,11 +67,11 @@ Public Class ProjectManagerVM
|
|||||||
|
|
||||||
Public ReadOnly Property VisibilityEgtCAM As Visibility
|
Public ReadOnly Property VisibilityEgtCAM As Visibility
|
||||||
Get
|
Get
|
||||||
If String.IsNullOrEmpty(IniFile.m_sEgtCameEXEPath) Then
|
If String.IsNullOrEmpty(IniFile.m_sEgtCam5EXEPath) Then
|
||||||
Return Visibility.Collapsed
|
Return Visibility.Collapsed
|
||||||
ElseIf Not File.Exists(IniFile.m_sEgtCameEXEPath) Then
|
ElseIf Not File.Exists(IniFile.m_sEgtCam5EXEPath) Then
|
||||||
Return Visibility.Collapsed
|
Return Visibility.Collapsed
|
||||||
ElseIf File.Exists(IniFile.m_sEgtCameEXEPath) Then
|
ElseIf File.Exists(IniFile.m_sEgtCam5EXEPath) Then
|
||||||
Return Visibility.Visible
|
Return Visibility.Visible
|
||||||
Else
|
Else
|
||||||
Return Visibility.Collapsed
|
Return Visibility.Collapsed
|
||||||
@@ -704,7 +704,7 @@ Public Class ProjectManagerVM
|
|||||||
' salvo il nome completo del file
|
' salvo il nome completo del file
|
||||||
sFilePathComplete = fd.FileName
|
sFilePathComplete = fd.FileName
|
||||||
' salvo l'estensione dell'ultimo progetto aperto
|
' salvo l'estensione dell'ultimo progetto aperto
|
||||||
WriteMainPrivateProfileString("General", "LastExtensionOpened", Path.GetExtension(fd.FileName))
|
WriteMainPrivateProfileString("General", "LastExtensionOpened", Path.GetExtension(fd.FileName).ToLower)
|
||||||
' se esiste un file in lettura con questo nome allora blocco tutto
|
' se esiste un file in lettura con questo nome allora blocco tutto
|
||||||
If Utility.IsFileLocked(sFilePath, Path.GetFileNameWithoutExtension(sFilePathComplete)) Then
|
If Utility.IsFileLocked(sFilePath, Path.GetFileNameWithoutExtension(sFilePathComplete)) Then
|
||||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||||
@@ -1006,6 +1006,11 @@ Public Class ProjectManagerVM
|
|||||||
Else
|
Else
|
||||||
EgtOutLog("LastProject '" & OptionModule.m_sLastProject & "' is not a file or does not exist!")
|
EgtOutLog("LastProject '" & OptionModule.m_sLastProject & "' is not a file or does not exist!")
|
||||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||||
|
If OptionModule.AdjustDDT Then
|
||||||
|
EgtExit()
|
||||||
|
Map.refMainWindowVM.MainWindowModel.ReleaseInstance()
|
||||||
|
Application.Current.Shutdown(3)
|
||||||
|
End If
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
@@ -1330,7 +1335,7 @@ Public Class ProjectManagerVM
|
|||||||
Case MessageBoxResult.Yes
|
Case MessageBoxResult.Yes
|
||||||
For IndexFile As Integer = 0 To Map.refAssemblyManagerVM.CurrProject.AssemblyList.Count - 1
|
For IndexFile As Integer = 0 To Map.refAssemblyManagerVM.CurrProject.AssemblyList.Count - 1
|
||||||
' controllo che abbia estensione ddf
|
' 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 SouFile As String = Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).Name
|
||||||
Dim DestFile As String = Path.Combine(MachinProject, Path.GetFileName(SouFile))
|
Dim DestFile As String = Path.Combine(MachinProject, Path.GetFileName(SouFile))
|
||||||
Try
|
Try
|
||||||
@@ -1370,15 +1375,13 @@ Public Class ProjectManagerVM
|
|||||||
|
|
||||||
Public Sub OpenCam()
|
Public Sub OpenCam()
|
||||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject) OrElse
|
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!
|
' 50192 = Impossible to export to machine a door if there is not a door!
|
||||||
MessageBox.Show(EgtMsg(50192), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
MessageBox.Show(EgtMsg(50192), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
'Verifico che tutto sia salvato, altrimenti esco con messaggio
|
'Verifico che tutto sia salvato, altrimenti esco con messaggio
|
||||||
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
|
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?
|
' 50177=Do you want to save the current changes?
|
||||||
Dim ResultMsg As MessageBoxResult = MessageBox.Show(EgtMsg(50177), EgtMsg(50144), MessageBoxButton.OKCancel, MessageBoxImage.Warning)
|
Dim ResultMsg As MessageBoxResult = MessageBox.Show(EgtMsg(50177), EgtMsg(50144), MessageBoxButton.OKCancel, MessageBoxImage.Warning)
|
||||||
If ResultMsg = MessageBoxResult.OK Then
|
If ResultMsg = MessageBoxResult.OK Then
|
||||||
@@ -1389,22 +1392,14 @@ Public Class ProjectManagerVM
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
'' elimino eventuali file .txt associati a ddf corrente (per lettura dei messaggi di errore stampati nel dal log del CAM5)
|
' Lancio esecuzione CAM5
|
||||||
'Dim FileLog As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
|
||||||
'FileLog = FileLog.Replace(DDF_EXTENSION, ".txt")
|
|
||||||
'Try
|
|
||||||
' File.Delete(FileLog)
|
|
||||||
'Catch
|
|
||||||
'End Try
|
|
||||||
Dim Proc As New Process
|
Dim Proc As New Process
|
||||||
' Dim CurrFile As String = IniFile.m_sTempDir & "\CurrPart" & DDF_EXTENSION
|
Dim sCurrFile As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||||
Dim CurrFile 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
|
Try
|
||||||
Proc.StartInfo.FileName = IniFile.m_sEgtCameEXEPath
|
Proc.StartInfo.FileName = IniFile.m_sEgtCam5EXEPath
|
||||||
' 0: creata una porta come descritta nel file riferito
|
Proc.StartInfo.Arguments = """" & sCurrFile & """ """ & nFlag & """"
|
||||||
' 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"""
|
|
||||||
If Not Proc.Start() Then
|
If Not Proc.Start() Then
|
||||||
' Error in starting EgtCam5.exe
|
' Error in starting EgtCam5.exe
|
||||||
MessageBox.Show(EgtMsg(50567), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
MessageBox.Show(EgtMsg(50567), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||||
@@ -1413,22 +1408,6 @@ Public Class ProjectManagerVM
|
|||||||
' Error in starting EgtCam5.exe
|
' Error in starting EgtCam5.exe
|
||||||
MessageBox.Show(EgtMsg(50567), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
MessageBox.Show(EgtMsg(50567), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||||
End Try
|
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 Sub
|
||||||
|
|
||||||
#End Region ' Copy
|
#End Region ' Copy
|
||||||
@@ -1491,9 +1470,6 @@ Public Class ProjectManagerVM
|
|||||||
' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file)
|
' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file)
|
||||||
For DDFIndex = 0 To DDFFileArray.Count - 1
|
For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||||
If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
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
|
' lo aggiungo alla lista delle porte
|
||||||
Dim Local_Assembly As New AssemblyName
|
Dim Local_Assembly As New AssemblyName
|
||||||
Local_Assembly.Name = DDFFileArray(DDFIndex)
|
Local_Assembly.Name = DDFFileArray(DDFIndex)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||||
Height="100" Width="300" Topmost="True"
|
Height="110" Width="300" Topmost="True"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||||
|
|
||||||
<!--<EgtWPFLib5:EgtCustomWindow.Resources>
|
<!--<EgtWPFLib5:EgtCustomWindow.Resources>
|
||||||
@@ -30,7 +30,8 @@
|
|||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
|
|
||||||
<Button IsDefault="True" Name="OkBtn" Grid.Row="2" Grid.ColumnSpan="2"
|
<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}"/>
|
Content="{Binding SaveMsg}" Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,13 @@
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
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"
|
Private m_PartDoorMsg As String = "Select part"
|
||||||
Public ReadOnly Property PartDoorMsg As String
|
Public ReadOnly Property PartDoorMsg As String
|
||||||
Get
|
Get
|
||||||
@@ -31,16 +38,31 @@
|
|||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
m_Selection = value
|
m_Selection = value
|
||||||
|
m_nSelectedIndex = m_PartDoorList.IndexOf(m_Selection)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
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)
|
Sub New(TitleWd As String, MsgWd As String, nParts As Integer, nIndex As Integer)
|
||||||
m_Title = TitleWd
|
m_Title = TitleWd
|
||||||
m_PartDoorMsg = MsgWd
|
m_PartDoorMsg = MsgWd
|
||||||
For Index As Integer = 0 To nParts - 1
|
For Each ItemDoor As PartDoor In Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor
|
||||||
m_PartDoorList.Add("Door " & nParts.ToString)
|
m_PartDoorList.Add(ItemDoor.Type)
|
||||||
Next
|
Next
|
||||||
m_Selection = "Door " & nIndex.ToString
|
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 Sub
|
||||||
|
|
||||||
End Class
|
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
|
||||||
+2
-1
@@ -39,7 +39,7 @@ Module RegexFunction
|
|||||||
' Restituisce il valore scritto tra le parentesi tonde ()
|
' Restituisce il valore scritto tra le parentesi tonde ()
|
||||||
Friend Function Brackets(sLine As String) As String
|
Friend Function Brackets(sLine As String) As String
|
||||||
If Not sLine.Contains("("c) AndAlso Not sLine.Contains(")"c) Then Return sLine
|
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
|
End Function
|
||||||
|
|
||||||
' restituisce quello che segue l'uguale assegnata una parola chiave tra i due trattini e 'uguale
|
' 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())
|
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, (OptionModule.m_SelectedOptionLauncher + LoOpenOnce).ToString())
|
||||||
' esco dall'applicazione
|
' esco dall'applicazione
|
||||||
EgtExit()
|
EgtExit()
|
||||||
|
Map.refMainWindowVM.MainWindowModel.ReleaseInstance()
|
||||||
Application.Current.MainWindow.Close()
|
Application.Current.MainWindow.Close()
|
||||||
End
|
End
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
<UserControl x:Class="InstrumentPanelV"
|
<UserControl x:Class="InstrumentPanelV"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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:EgtDOORCreator="clr-namespace:EgtDOORCreator">
|
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator">
|
||||||
|
|
||||||
<StackPanel Background="Transparent" Orientation="Horizontal" >
|
<StackPanel Background="Transparent" Orientation="Horizontal" >
|
||||||
<ToggleButton ToolTip="{Binding GetDistToolTip}" IsEnabled ="{Binding EnableCmdDist}"
|
<ToggleButton ToolTip="{Binding GetDistToolTip}" IsEnabled ="{Binding EnableCmdDist}"
|
||||||
Style="{StaticResource GridViewPanelToggleButton}" IsChecked="{Binding GetDistIsChecked}">
|
Style="{StaticResource GridViewPanelToggleButton}" IsChecked="{Binding GetDistIsChecked}">
|
||||||
<Image Source="/Resources/InstrumentPanel/GetDist.png" Stretch="Uniform" Width="25" />
|
<Image Source="/Resources/InstrumentPanel/GetDist.png" Stretch="Uniform" Width="25" />
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
<Button ToolTip="{Binding LinearDimensionToolTip}"
|
<Button ToolTip="{Binding LinearDimensionToolTip}"
|
||||||
ToolTipService.ShowOnDisabled="True"
|
ToolTipService.ShowOnDisabled="True"
|
||||||
Command="{Binding LinearDimensionCommand}" IsEnabled="{Binding EnableCmdDimension}"
|
Command="{Binding LinearDimensionCommand}" IsEnabled="{Binding EnableCmdDimension}"
|
||||||
Visibility="{Binding DimensionVisibility}">
|
Visibility="{Binding DimensionVisibility}">
|
||||||
<Image Source="/Resources/InstrumentPanel/LinearDimension.png" Stretch="Uniform" Width="25"/>
|
<Image Source="/Resources/InstrumentPanel/LinearDimension.png" Stretch="Uniform" Width="25"/>
|
||||||
</Button>
|
</Button>
|
||||||
<TextBox Style="{StaticResource DimensioParameter}"
|
<TextBox Style="{StaticResource DimensioParameter}"
|
||||||
Name ="TextBox1"
|
Name ="TextBox1"
|
||||||
Visibility="{Binding TextDimensionVisibility}" Margin="5"
|
Visibility="{Binding TextDimensionVisibility}" Margin="5"
|
||||||
Width="100" Height="25"
|
Width="100" Height="25"
|
||||||
Text="{Binding TextDimension, UpdateSourceTrigger=PropertyChanged}">
|
Text="{Binding TextDimension, UpdateSourceTrigger=PropertyChanged}">
|
||||||
<TextBox.InputBindings>
|
<TextBox.InputBindings>
|
||||||
<KeyBinding Key="Enter" Command="{Binding OkTextDimension}"/>
|
<KeyBinding Key="Enter" Command="{Binding OkTextDimension}"/>
|
||||||
</TextBox.InputBindings>
|
</TextBox.InputBindings>
|
||||||
</TextBox>
|
</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}">
|
IsEnabled ="{Binding EnableCmdSaveImg}" Visibility="{Binding SaveImgHardware}">
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" Width="25"/>
|
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" Width="25"/>
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Public Class InstrumentPanelVM
|
|||||||
|
|
||||||
#Region "FIELDS & PROPERTIES"
|
#Region "FIELDS & PROPERTIES"
|
||||||
|
|
||||||
Private m_GetDistIsChecked As Boolean = True
|
Private m_GetDistIsChecked As Boolean = False
|
||||||
Public Property GetDistIsChecked As Boolean
|
Public Property GetDistIsChecked As Boolean
|
||||||
Get
|
Get
|
||||||
GetDistance(m_GetDistIsChecked)
|
GetDistance(m_GetDistIsChecked)
|
||||||
@@ -44,6 +44,13 @@ Public Class InstrumentPanelVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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)
|
' se il bottone è selezionato (true) allora misura, altrimenti no (false)
|
||||||
Public Sub GetDistance(bGetDistanceIsChecked As Boolean)
|
Public Sub GetDistance(bGetDistanceIsChecked As Boolean)
|
||||||
If bGetDistanceIsChecked Then
|
If bGetDistanceIsChecked Then
|
||||||
|
|||||||
@@ -440,94 +440,114 @@ Public Class SceneManagerVM
|
|||||||
Private Sub MouseMoveOverScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_ProjectScene.OnMouseMoveScene
|
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
|
' Se non abilitata l'evidenziazione dei compo allora esco
|
||||||
If GetMainPrivateProfileInt(S_GENERAL, "MarkCompo", 0) = 0 Then Return
|
If GetMainPrivateProfileInt(S_GENERAL, "MarkCompo", 0) = 0 Then Return
|
||||||
' se non esiste una porta corrente allora esco
|
' Se misurazione attiva
|
||||||
If IsNothing(Map.refPartPageVM) OrElse IsNothing(Map.refPartPageVM.CurrPart) Then
|
If Map.refInstrumentPanelVM.ActualDistanceState Then Return
|
||||||
Return
|
' Se non esiste una porta corrente allora esco
|
||||||
End If
|
If IsNothing(Map.refPartPageVM) OrElse IsNothing(Map.refPartPageVM.CurrPart) Then Return
|
||||||
Dim LocalCompoList As ObservableCollection(Of Compo) = Map.refPartPageVM.CurrPart.CompoList
|
' Ripulisco la scena dai Mark
|
||||||
' Ripulisco la scena da i Mark
|
|
||||||
Map.refPartPageVM.CurrPart.ResetAllMark()
|
Map.refPartPageVM.CurrPart.ResetAllMark()
|
||||||
' Se la lista dei componenti è vuota allora esco
|
' Se la lista dei componenti è vuota allora esco
|
||||||
If Map.refPartPageVM.CurrPart.CompoList.Count < 1 Then Return
|
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
|
' Ricavo il punto corrente in coordinate mondo
|
||||||
Dim ptCurr As Point3d
|
Dim ptCurr As Point3d
|
||||||
EgtUnProjectPoint(e.Location, ptCurr)
|
EgtUnProjectPoint(e.Location, ptCurr)
|
||||||
' Verifico se selezionato curva
|
' Recupero gli oggetti nel mirino di selezione
|
||||||
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||||
Dim nSel As Integer
|
Dim nSel As Integer
|
||||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
||||||
|
' Ciclo su questi oggetti
|
||||||
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
||||||
While nId <> GDB_ID.NULL
|
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
|
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 nIdParent As Integer = EgtGetParent(nId)
|
||||||
Dim sNameLayer As String = String.Empty
|
Dim sNameLayer As String = String.Empty
|
||||||
EgtGetName(nIdParent, sNameLayer)
|
EgtGetName(nIdParent, sNameLayer)
|
||||||
If Not sNameLayer.StartsWith("AUX") Or Not sNameLayer.StartsWith("SOLID") Or Not sNameLayer.StartsWith("DIM") Then
|
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
|
' scorro l'elenco dei componenti fino a trovare un riscontro tra i nomi e i parametri
|
||||||
For Each ItemCompo As Compo In LocalCompoList
|
For Each ItemCompo As Compo In LocalCompoList
|
||||||
If MatchCompoFromScena(nIdParent, ItemCompo, LocalCompoList) Then Exit While
|
If MatchCompoFromScene(nIdParent, ItemCompo, LocalCompoList) Then Exit While
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' Passo al successivo
|
' Passo al successivo
|
||||||
nId = EgtGetNextObjInSelWin()
|
nId = EgtGetNextObjInSelWin()
|
||||||
End While
|
End While
|
||||||
|
'End If
|
||||||
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function MatchCompoFromScena(nIdLay As Integer, CurrCompo As Compo, CompoList As ObservableCollection(Of Compo)) As Boolean
|
Private Function MatchCompoFromScene(nIdLay As Integer, CurrCompo As Compo, CompoList As ObservableCollection(Of Compo)) As Boolean
|
||||||
If IsNothing(CurrCompo) Then Return True
|
|
||||||
|
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
|
' recupero la lista dei compo dello stesso tipo
|
||||||
Dim TempList As ObservableCollection(Of Compo) = DdfFile.GetCurrentListSameCompoType(CompoList, CurrCompo.CompoType.DDFName)
|
Dim TempList As ObservableCollection(Of Compo) = DdfFile.GetCurrentListSameCompoType(CompoList, CurrCompo.CompoType.DDFName)
|
||||||
' recupero la lista dei compo con lo stesso nome
|
' recupero la lista dei compo con lo stesso nome
|
||||||
TempList = DdfFile.GetCurrentListSameCompoDDFName(TempList, CurrCompo.SelFile, CurrCompo.SelBrandPart)
|
TempList = DdfFile.GetCurrentListSameCompoDDFName(TempList, CurrCompo.SelFile, CurrCompo.SelBrandPart)
|
||||||
' riordino la lista appena trovata secondo le regole di stampa DDF
|
' riordino la lista appena trovata secondo le regole di stampa DDF
|
||||||
DdfFile.GetOrderedListSameCompo(TempList)
|
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
|
' ottengo la posizione prevista nella grafica
|
||||||
Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, CurrCompo)
|
Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, CurrCompo)
|
||||||
' recupero la lista ordinata
|
|
||||||
Dim sCompoName As String = CurrCompo.TemplateSelItem
|
|
||||||
' oridnamento del layer
|
|
||||||
Dim IndexLay As Integer = -1
|
|
||||||
' recupero il nome della comaponente selezionata con MouseOver
|
|
||||||
Dim sInfoPath As String = String.Empty
|
|
||||||
If Not EgtGetInfo(nIdLay, "Path", sInfoPath) Then Return True
|
|
||||||
' Dim sNamePath As String = Path.GetFileNameWithoutExtension(sInfoPath)
|
|
||||||
Dim sNamePath As String = sInfoPath
|
|
||||||
'If sNamePath = sCompoName Then
|
|
||||||
If sNamePath.Contains(sCompoName) Then
|
|
||||||
Dim nCurrLayId As Integer = nIdLay
|
|
||||||
Dim nCounter As Integer = 1
|
|
||||||
While nCurrLayId <> GDB_ID.NULL
|
|
||||||
nCurrLayId = EgtGetNext(nCurrLayId)
|
|
||||||
Dim LocalsPath As String = String.Empty
|
|
||||||
If EgtGetInfo(nCurrLayId, "Path", LocalsPath) Then
|
|
||||||
If sNamePath.Trim = LocalsPath.Trim Then
|
|
||||||
nCounter += 1
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End While
|
|
||||||
IndexLay = TempList.Count - nCounter
|
|
||||||
End If
|
|
||||||
' la compo passata non ha lo stesso nome, quindi mi aspetto un'altra compo
|
|
||||||
If IndexLay = -1 Then Return False
|
|
||||||
|
|
||||||
While IndexInList < TempList.Count And nIdLay <> GDB_ID.NULL
|
While IndexInList < TempList.Count And nIdLay <> GDB_ID.NULL
|
||||||
' recupero l'ordinamento del layer
|
' recupero l'ordinamento del layer
|
||||||
If sNamePath.Contains(sCompoName) And IndexLay = IndexInList Then
|
If sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay = IndexInList Then
|
||||||
EgtSetMark(nIdLay)
|
EgtSetMark(nIdLay)
|
||||||
' evidenzio la compo corrente
|
' evidenzio la compo corrente
|
||||||
TempList(IndexInList).SetMark()
|
TempList(IndexInList).SetMark()
|
||||||
EgtDraw()
|
|
||||||
' ricerca terminata correttamente
|
' ricerca terminata correttamente
|
||||||
Return True
|
Return True
|
||||||
Exit While
|
ElseIf sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexInList < IndexLay Then
|
||||||
ElseIf sNamePath.Contains(sCompoName) And IndexInList < IndexLay Then
|
|
||||||
IndexInList += 1
|
IndexInList += 1
|
||||||
Else
|
Else
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End While
|
End While
|
||||||
' prova con un'altra compo
|
|
||||||
|
'non trovata
|
||||||
Return False
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
+48
-56
@@ -270,6 +270,18 @@ Public Module Utility
|
|||||||
Return Index
|
Return Index
|
||||||
End Function
|
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"
|
#Region "PARAM LUA"
|
||||||
|
|
||||||
' elimina i commenti nel file lua
|
' elimina i commenti nel file lua
|
||||||
@@ -614,83 +626,85 @@ Public Module Utility
|
|||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub GetDirectoryCompoFiles(DirectoryPath As String, ByRef FileList As ObservableCollection(Of String), bRemoveNge As Boolean)
|
' costruisco le liste dei file
|
||||||
RecursiveGetDirectoryCompoFiles(DirectoryPath, DirectoryPath, FileList, bRemoveNge)
|
Friend Sub GetDirectoryCompoModel(HardwareDirPath As String, FolderList As ObservableCollection(Of CompoBrandDir),
|
||||||
End Sub
|
Optional FrameFolderList As ObservableCollection(Of CompoBrandDir) = Nothing,
|
||||||
|
Optional HardwareFolderList As ObservableCollection(Of CompoBrandDir) = Nothing)
|
||||||
' csotruisco le liste dei file
|
' Nome del direttorio dei componenti
|
||||||
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)
|
|
||||||
Dim BaseDirName As String = Path.GetFileName(HardwareDirPath)
|
Dim BaseDirName As String = Path.GetFileName(HardwareDirPath)
|
||||||
|
' Carico l'elenco dei file contenuti nei sottodirettori
|
||||||
Dim FolderArray() As String = Directory.GetDirectories(HardwareDirPath)
|
Dim FolderArray() As String = Directory.GetDirectories(HardwareDirPath)
|
||||||
Dim CurrFolder As CompoBrandDir = Nothing
|
|
||||||
For Each Folder In FolderArray
|
For Each Folder In FolderArray
|
||||||
Folder = Folder.Replace("/", "\")
|
Folder = Folder.Replace("/", "\")
|
||||||
CurrFolder = New CompoBrandDir(Folder, BaseDirName)
|
Dim CurrGenFolder As CompoBrandDir = New CompoBrandDir(Folder, BaseDirName)
|
||||||
GetDirectoryCompoFiles(Folder, CurrFolder.ModelFileList, False)
|
GetDirectoryCompoFiles(Folder, CurrGenFolder.ModelFileList, False)
|
||||||
' genero le liste per il DoorCreator
|
' 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
|
If Folder.ToLower.Contains(FRAME_FOLDER) Then
|
||||||
FrameFolderList.Add(CurrFolder)
|
If Not IsNothing(FrameFolderList) Then FrameFolderList.Add(CurrGenFolder)
|
||||||
'If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then HardwareFolderList.Add(CurrFolder)
|
|
||||||
Else
|
Else
|
||||||
FolderList.Add(CurrFolder)
|
FolderList.Add(CurrGenFolder)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' genero le liste per l'HardwareManager
|
' genero le liste per l'HardwareManager
|
||||||
CurrFolder = New CompoBrandDir(Folder, BaseDirName)
|
If Not IsNothing(HardwareFolderList) Then
|
||||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
|
Dim CurrHardFolder As CompoBrandDir = New CompoBrandDir(Folder, BaseDirName)
|
||||||
HardwareFolderList.Add(CurrFolder)
|
GetDirectoryCompoFiles(Folder, CurrHardFolder.ModelFileList, True)
|
||||||
Else
|
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
|
||||||
' solo se non sono in modlità assemblato non carcico gli elenchi ".frame"
|
HardwareFolderList.Add(CurrHardFolder)
|
||||||
If Not Folder.ToLower.Contains(FRAME_FOLDER) Then
|
Else
|
||||||
HardwareFolderList.Add(CurrFolder)
|
' 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
|
||||||
End If
|
End If
|
||||||
GetDirectoryCompoFiles(Folder, CurrFolder.ModelFileList, True)
|
|
||||||
Next
|
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)
|
Dim FileArray() As String = Directory.GetFiles(HardwareDirPath)
|
||||||
CurrFolder = Nothing
|
Dim CurrFolder As CompoBrandDir = Nothing
|
||||||
Dim CurrFrameFolder As CompoBrandDir = Nothing
|
Dim CurrFrameFolder As CompoBrandDir = Nothing
|
||||||
Dim CurrHardwareFolder As CompoBrandDir = Nothing
|
Dim CurrHardwareFolder As CompoBrandDir = Nothing
|
||||||
For Each File In FileArray
|
For Each File In FileArray
|
||||||
File = File.Replace("/", "\")
|
File = File.Replace("/", "\")
|
||||||
If Not Path.GetExtension(File) = INI_EXTENSION And Not Path.GetExtension(File) = TEMPL_EXTENSION And
|
Dim sExt As String = Path.GetExtension(File).ToLower
|
||||||
(Path.GetExtension(File) = LUA_EXTENSION Or Path.GetExtension(File) = NGE_EXTENSION) And
|
If (sExt = LUA_EXTENSION Or sExt = NGE_EXTENSION) And
|
||||||
Not File.Contains(MATCHING_FILE_NAME) And Not File.ToLower().Contains("currhardware") Then
|
Not File.Contains(MATCHING_FILE_NAME) And Not File.ToLower().Contains("currhardware") Then
|
||||||
If File.Contains(FRAME_FOLDER) Then
|
If File.Contains(FRAME_FOLDER) Then
|
||||||
If IsNothing(CurrFrameFolder) Then
|
If IsNothing(CurrFrameFolder) Then
|
||||||
' CurrFrameFolder = New CompoBrandDir(Path.GetFileName(HardwareDirPath), BaseDirName & FRAME_FOLDER)
|
|
||||||
CurrFrameFolder = New CompoBrandDir(HardwareDirPath, BaseDirName & FRAME_FOLDER)
|
CurrFrameFolder = New CompoBrandDir(HardwareDirPath, BaseDirName & FRAME_FOLDER)
|
||||||
FrameFolderList.Add(CurrFrameFolder)
|
If Not IsNothing(FrameFolderList) Then FrameFolderList.Add(CurrFrameFolder)
|
||||||
End If
|
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
|
Else
|
||||||
If IsNothing(CurrFolder) Then
|
If IsNothing(CurrFolder) Then
|
||||||
' CurrFolder = New CompoBrandDir(Path.GetFileName(HardwareDirPath), BaseDirName)
|
|
||||||
CurrFolder = New CompoBrandDir(HardwareDirPath, BaseDirName)
|
CurrFolder = New CompoBrandDir(HardwareDirPath, BaseDirName)
|
||||||
FolderList.Add(CurrFolder)
|
FolderList.Add(CurrFolder)
|
||||||
End If
|
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 Not File.Contains(NGE_EXTENSION) Then
|
||||||
If IsNothing(CurrHardwareFolder) Then
|
If IsNothing(CurrHardwareFolder) Then
|
||||||
' CurrHardwareFolder = New CompoBrandDir(Path.GetFileName(HardwareDirPath), BaseDirName)
|
|
||||||
CurrHardwareFolder = New CompoBrandDir(HardwareDirPath, BaseDirName)
|
CurrHardwareFolder = New CompoBrandDir(HardwareDirPath, BaseDirName)
|
||||||
HardwareFolderList.Add(CurrHardwareFolder)
|
If Not IsNothing(HardwareFolderList) Then HardwareFolderList.Add(CurrHardwareFolder)
|
||||||
End If
|
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
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End Sub
|
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)
|
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)
|
Dim SubDir() As String = Directory.GetDirectories(DirectoryPath)
|
||||||
For Index = 0 To SubDir.Count - 1
|
For Index = 0 To SubDir.Count - 1
|
||||||
RecursiveGetDirectoryCompoFiles(SubDir(Index), BaseDirectory, FileList, bRemoveNge)
|
RecursiveGetDirectoryCompoFiles(SubDir(Index), BaseDirectory, FileList, bRemoveNge)
|
||||||
Next
|
Next
|
||||||
|
' File nel direttorio
|
||||||
Dim Files() As String = Directory.GetFiles(DirectoryPath)
|
Dim Files() As String = Directory.GetFiles(DirectoryPath)
|
||||||
For Index = 0 To Files.Count - 1
|
For Index = 0 To Files.Count - 1
|
||||||
Dim FileExt As String = Path.GetExtension(Files(Index).ToLower())
|
Dim FileExt As String = Path.GetExtension(Files(Index).ToLower())
|
||||||
@@ -707,28 +721,6 @@ Public Module Utility
|
|||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "Create Log"
|
|
||||||
Private sFileBlindProgLog As System.IO.StreamWriter
|
|
||||||
Private sFilePath As String = String.Empty
|
|
||||||
|
|
||||||
Public Sub StartBlinProgdLog(sPath As String)
|
|
||||||
sFilePath = sPath
|
|
||||||
sFileBlindProgLog = New System.IO.StreamWriter(sPath, True)
|
|
||||||
Dim sInfoStart As String = Date.Now.ToString & " Avvio programma in cieco"
|
|
||||||
sInfoStart &= vbCrLf & My.Application.Info.Version.Major.ToString() & "." & My.Application.Info.Version.Minor.ToString() &
|
|
||||||
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() & My.Application.Info.Version.Revision.ToString()
|
|
||||||
sFileBlindProgLog.WriteLine(sInfoStart)
|
|
||||||
sFileBlindProgLog.Close()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Sub BlindProgLog(sMsg As String)
|
|
||||||
sFileBlindProgLog = File.AppendText(sFilePath)
|
|
||||||
sFileBlindProgLog.WriteLine(sMsg)
|
|
||||||
sFileBlindProgLog.Close()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|
||||||
Public Class CompoBrandDir
|
Public Class CompoBrandDir
|
||||||
|
|||||||
Reference in New Issue
Block a user