- creato nuova pagina aggiungi nuova feature,

-creato macro con relativi template
This commit is contained in:
Demetrio Cassarino
2024-02-09 17:12:30 +01:00
parent 827c955d1d
commit 4fead794f3
13 changed files with 337 additions and 138 deletions
@@ -37,8 +37,8 @@ Public Class AddFeatureWndVM
ElseIf m_SelGRPType = GRPType.T Then
nSelPRC = PRCList(m_PrevSelPRCIndex_T)
End If
NotifyPropertyChanged("PRCList")
NotifyPropertyChanged("nSelPRC")
NotifyPropertyChanged(NameOf(PRCList))
NotifyPropertyChanged(NameOf(nSelPRC))
End Set
End Property
@@ -49,6 +49,14 @@ Public Class AddFeatureWndVM
End Get
End Property
Private m_PRCListView As New List(Of PRC)
Public ReadOnly Property PRCListView As List(Of PRC)
Get
Return m_PRCListView
End Get
End Property
Private m_NewMacroList As New ObservableCollection(Of NewMacro)
Public ReadOnly Property NewMacroList As ObservableCollection(Of NewMacro)
Get
@@ -82,10 +90,10 @@ Public Class AddFeatureWndVM
m_PrevSelPRCIndex_T = PRCList.IndexOf(m_nSelPRC)
End If
End If
NotifyPropertyChanged("sDrawPath")
NotifyPropertyChanged(NameOf(sDrawPath))
' carico eventuali file Macro
MacroList.Clear()
NewMacroList.Clear()
If Core.Configuration.bOnlyProd Then NewMacroList.Clear()
m_MacroFilePathList = New List(Of String)
If Not IsNothing(nSelPRC) Then
Dim nGRPFromFileName As Integer = 0
@@ -109,28 +117,36 @@ Public Class AddFeatureWndVM
sMacroNameFromFileName = DataFromFileName(1)
End If
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
'MacroList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
NewMacroList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroDir & "\Templete\" & sMacroNameFromFileName & ".png"))
MacroList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
If Core.Configuration.bOnlyProd Then NewMacroList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroDir & "\Template\" & sMacroNameFromFileName & ".png"))
m_MacroFilePathList.Add(File)
nIdMacroName = nIdMacroName + 1
nIdMacroName += 1
End If
End If
End If
End If
Next
'If MacroList.Count > 0 Then
' MacroList_IsEnabled = True
'Else
' MacroList_IsEnabled = False
'End If
If NewMacroList.Count > 0 Then
If Core.Configuration.bOnlyProd Then
Dim sGRP As String = m_nSelPRC.ghDesc.ToCharArray(0, 1)
If sGRP = "L" Then
sDrawMacro = Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & "L" & m_nSelPRC.nPRC.ToString("000") & ".png"
Else
sDrawMacro = Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & "T" & m_nSelPRC.nPRC.ToString("000") & ".png"
End If
If NewMacroList.Count > 0 Then
MacroList_IsEnabled = True
Else
MacroList_IsEnabled = False
End If
End If
If MacroList.Count > 0 Then
MacroList_IsEnabled = True
Else
MacroList_IsEnabled = False
End If
End If
End If
NotifyPropertyChanged(NameOf(nSelPRC))
End Set
End Property
@@ -142,7 +158,7 @@ Public Class AddFeatureWndVM
Set(value As Boolean)
If value <> m_MacroList_IsEnabled Then
m_MacroList_IsEnabled = value
NotifyPropertyChanged("MacroList_IsEnabled")
NotifyPropertyChanged(NameOf(MacroList_IsEnabled))
End If
End Set
End Property
@@ -180,40 +196,75 @@ Public Class AddFeatureWndVM
End Get
End Property
Private m_sDrawMacro As String
Public Property sDrawMacro As String
Get
Return m_sDrawMacro
End Get
Set(value As String)
m_sDrawMacro = value
NotifyPropertyChanged(NameOf(sDrawMacro))
End Set
End Property
' Definizione comandi
Private m_cmdOk As ICommand
#Region "Messages"
Public ReadOnly Property Process_Msg As String
Get
Return EgtMsg(61805).ToUpper()
End Get
End Property
Public ReadOnly Property Macro_Msg As String
Get
Return EgtMsg(61899).ToUpper()
End Get
End Property
#End Region
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
SelGRPType = 0
'nSelPRC = PRCList(0)
' carico lista process
Dim TempPRCList As New ObservableCollection(Of Integer)
Dim TempPRCLList As New ObservableCollection(Of Integer)
Dim TempPRCLTist As New ObservableCollection(Of Integer)
GetBeamPrivateProfileProcessList(0, TempPRCLList)
GetBeamPrivateProfileProcessList(1, TempPRCLTist)
For Each PRCL In TempPRCLList
TempPRCList.Add(PRCL)
Next
For Each PRCT In TempPRCLTist
TempPRCList.Add(PRCT)
Next
m_PRCList.Clear()
For Each PRC In TempPRCList
' leggo gruppi
Dim GRPList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileGRPList(0, PRC, GRPList)
Dim x = GRPList.Count
GetBeamPrivateProfileGRPList(1, PRC, GRPList)
m_PRCList.Add(New PRC(GRPList(0), PRC, GetBeamPrivateProfileName(0, PRC)))
m_PRCList.Add(New PRC(GRPList(0), PRC, GetBeamPrivateProfileName(1, PRC)))
Next
If Core.Configuration.bOnlyProd Then
' carico lista process
Dim TempPRCList As New ObservableCollection(Of Integer)
Dim TempPRCLList As New ObservableCollection(Of Integer)
Dim TempPRCLTist As New ObservableCollection(Of Integer)
GetBeamPrivateProfileProcessList(0, TempPRCLList)
GetBeamPrivateProfileProcessList(1, TempPRCLTist)
' riporto le liste process in un unica lista
For Each PRCL In TempPRCLList
TempPRCList.Add(PRCL)
Next
For Each PRCT In TempPRCLTist
TempPRCList.Add(PRCT)
Next
m_PRCList.Clear()
' ciclo sulla lista process eliminado i doppi
For Each PRC In TempPRCList.Distinct()
' leggo gruppi
Dim GRPLList As New ObservableCollection(Of Integer)
Dim GRPTList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileGRPList(0, PRC, GRPLList)
GetBeamPrivateProfileGRPList(1, PRC, GRPTList)
If GRPLList.Count > 0 Then m_PRCList.Add(New PRC(GRPLList(0), PRC, GetBeamPrivateProfileName(0, PRC)))
If GRPTList.Count > 0 Then m_PRCList.Add(New PRC(GRPTList(0), PRC, GetBeamPrivateProfileName(1, PRC)))
Next
m_PRCListView = m_PRCList.OrderBy(Function(x) x.nPRC).ToList()
nSelPRC = m_PRCList(0)
NotifyPropertyChanged(NameOf(PRCListView))
NotifyPropertyChanged(NameOf(PRCList))
Else
SelGRPType = 0
nSelPRC = PRCList(0)
End If
End Sub
#End Region ' CONSTRUCTOR
@@ -325,7 +376,7 @@ Public Class NewMacro
Private m_sMacroName As String
Public ReadOnly Property sMacroName As String
Get
Return m_sMacroName
Return m_sMacroName.ToUpper()
End Get
End Property