initial commit
This commit is contained in:
@@ -0,0 +1,409 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BTLFeature
|
||||
Inherits VMBase
|
||||
|
||||
' Feature a cui appartiene il parametro
|
||||
Protected m_ParentPart As BTLPart
|
||||
Public ReadOnly Property ParentPart As BTLPart
|
||||
Get
|
||||
Return m_ParentPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Id geometrico della feature
|
||||
Protected m_nFeatureId As Integer
|
||||
Public ReadOnly Property nFeatureId As Integer
|
||||
Get
|
||||
Return m_nFeatureId
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetFeatureId(nFeatureId As Integer)
|
||||
m_nFeatureId = nFeatureId
|
||||
End Sub
|
||||
|
||||
' lista dei gruppi
|
||||
Protected m_GRPList As New ObservableCollection(Of Integer)
|
||||
Public Property GRPList As ObservableCollection(Of Integer)
|
||||
Get
|
||||
Return m_GRPList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Integer))
|
||||
m_GRPList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nSelGRP As Integer = -1
|
||||
Public Overridable Property nSelGRP As Integer
|
||||
Get
|
||||
Return m_nSelGRP
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nSelGRP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Processo
|
||||
Protected m_nPRC As Integer
|
||||
Public Property nPRC As Integer
|
||||
Get
|
||||
Return m_nPRC
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPRC = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Lato
|
||||
Protected m_SIDEList As New ObservableCollection(Of Integer)({1, 2, 3, 4})
|
||||
Public Property SIDEList As ObservableCollection(Of Integer)
|
||||
Get
|
||||
Return m_SIDEList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Integer))
|
||||
m_SIDEList = value
|
||||
End Set
|
||||
End Property
|
||||
Protected m_nSelSIDE As Integer = -1
|
||||
Public Overridable Property nSelSIDE As Integer
|
||||
Get
|
||||
Return m_nSelSIDE
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nSelSIDE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Nome
|
||||
Protected m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetName(sName As String)
|
||||
m_sName = sName
|
||||
End Sub
|
||||
|
||||
Protected m_bDO As Boolean
|
||||
Public Overridable Property bDO As Boolean
|
||||
Get
|
||||
Return m_bDO
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bDO = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nPRID As Integer
|
||||
Public Property nPRID As Integer
|
||||
Get
|
||||
Return m_nPRID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPRID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sDES As String = String.Empty
|
||||
Public Property sDES As String
|
||||
Get
|
||||
Return m_sDES
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDES = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_frFRAME As New Frame3d
|
||||
Public Property frFRAME As Frame3d
|
||||
Get
|
||||
Return m_frFRAME
|
||||
End Get
|
||||
Set(value As Frame3d)
|
||||
m_frFRAME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nState As CalcStates = -1
|
||||
Public ReadOnly Property nState As CalcStates
|
||||
Get
|
||||
Return m_nState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_ERR As Integer = -1
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_nCALC_ERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_ROT As Integer
|
||||
Public ReadOnly Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_nCALC_ROT
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_FALL As Integer
|
||||
Public ReadOnly Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return m_nCALC_FALL
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_sCALC_MSG As String
|
||||
Public ReadOnly Property nCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' lista dei parametri della feature
|
||||
Protected m_PParamList As ObservableCollection(Of BTLParam)
|
||||
Public Property PParamList As ObservableCollection(Of BTLParam)
|
||||
Get
|
||||
Return m_PParamList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLParam))
|
||||
m_PParamList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelPParam As BTLParam
|
||||
Public Overridable Property SelPParam As BTLParam
|
||||
Get
|
||||
Return m_SelPParam
|
||||
End Get
|
||||
Set(value As BTLParam)
|
||||
m_SelPParam = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei parametri della feature
|
||||
Protected m_QParamList As ObservableCollection(Of BTLParam)
|
||||
Public Property QParamList As ObservableCollection(Of BTLParam)
|
||||
Get
|
||||
Return m_QParamList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLParam))
|
||||
m_QParamList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelQParam As BTLParam
|
||||
Public Overridable Property SelQParam As BTLParam
|
||||
Get
|
||||
Return m_SelQParam
|
||||
End Get
|
||||
Set(value As BTLParam)
|
||||
m_SelQParam = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property Name_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61614)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Value_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61615)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Min_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61616)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Max_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61617)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Sub New(ParentPart As BTLPart, nFeatureId As Integer)
|
||||
m_ParentPart = ParentPart
|
||||
m_nFeatureId = nFeatureId
|
||||
m_PParamList = New ObservableCollection(Of BTLParam)
|
||||
m_QParamList = New ObservableCollection(Of BTLParam)
|
||||
End Sub
|
||||
|
||||
Sub New(nPRC As Integer, nGRP As Integer, nSIDE As Integer)
|
||||
m_PParamList = New ObservableCollection(Of BTLParam)
|
||||
m_QParamList = New ObservableCollection(Of BTLParam)
|
||||
m_nPRC = nPRC
|
||||
m_nSelGRP = nGRP
|
||||
m_nSelSIDE = nSIDE
|
||||
m_bDO = True
|
||||
End Sub
|
||||
|
||||
' funzione che crea l'elenco dei parametri
|
||||
Public Overridable Sub CreateFeatureParams()
|
||||
Dim ParamIndex As Integer = 1
|
||||
Dim NewBTLParam As BTLParam = Nothing
|
||||
' leggo tutti i P della feature
|
||||
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, True, ParamIndex, Me, NewBTLParam)
|
||||
m_PParamList.Add(NewBTLParam)
|
||||
ParamIndex += 1
|
||||
End While
|
||||
' leggo tutti i Q della feature
|
||||
ParamIndex = 1
|
||||
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, False, ParamIndex, Me, NewBTLParam)
|
||||
m_QParamList.Add(NewBTLParam)
|
||||
ParamIndex += 1
|
||||
End While
|
||||
End Sub
|
||||
|
||||
' funzione che legge il valore corrente del parametro
|
||||
Public Function ReadFeatureParams() As Boolean
|
||||
Return ReadFeatureParams(PParamList) And ReadFeatureParams(QParamList)
|
||||
End Function
|
||||
Private Function ReadFeatureParams(ParamList As ObservableCollection(Of Core.BTLParam)) As Boolean
|
||||
' leggo valore parametro da struttura geometrica
|
||||
For Each Param As BTLParam In ParamList
|
||||
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
|
||||
Dim dParamValue As Double = 0
|
||||
If Not EgtGetInfo(m_nFeatureId, Param.sName, dParamValue) Then
|
||||
dParamValue = 0
|
||||
End If
|
||||
Param.dValue = dParamValue
|
||||
ElseIf Param.nType = BTLParamType.STRING_ Then
|
||||
Dim sParamValue As String = String.Empty
|
||||
EgtGetInfo(m_nFeatureId, Param.sName, sParamValue)
|
||||
Param.sValue = sParamValue
|
||||
ElseIf Param.nType = BTLParamType.COMBO Then
|
||||
Dim nParamValue As Integer
|
||||
EgtGetInfo(m_nFeatureId, Param.sName, nParamValue)
|
||||
Param.nSelValue = nParamValue
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' funzione che setta i valori di default a tutti i parametri
|
||||
Public Function SetDefaultValues() As Boolean
|
||||
Return SetDefaultValues(PParamList) And SetDefaultValues(QParamList)
|
||||
End Function
|
||||
Private Function SetDefaultValues(ParamList As ObservableCollection(Of Core.BTLParam)) As Boolean
|
||||
' leggo valore parametro da struttura geometrica
|
||||
For Each Param As BTLParam In ParamList
|
||||
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
|
||||
Param.dValue = Param.dDefault
|
||||
ElseIf Param.nType = BTLParamType.STRING_ Then
|
||||
Param.sValue = ""
|
||||
ElseIf Param.nType = BTLParamType.COMBO Then
|
||||
Param.nSelValue = Param.dDefault
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' funzione che calcola array dei valori dei parametri
|
||||
Public Function CalcParamArray(ByRef vPar() As Double, ByRef sPar As String) As Boolean
|
||||
' verifico che lista parametri non sia vuota
|
||||
If IsNothing(m_PParamList) OrElse m_PParamList.Count = 0 Then Return False
|
||||
' caclcolo lunghezza array
|
||||
Dim nLastParId As Integer = m_PParamList(m_PParamList.Count - 1).nId - 1
|
||||
Dim vTempPar(nLastParId) As Double
|
||||
Dim sTempPar As String = String.Empty
|
||||
' carico tutti i parametri su array
|
||||
For ParIndex = 0 To m_PParamList.Count - 1
|
||||
Dim BTLPar As BTLParam = DirectCast(m_PParamList(ParIndex), BTLParam)
|
||||
Select Case BTLPar.nType
|
||||
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
||||
vTempPar(BTLPar.nId - 1) = BTLPar.dValue
|
||||
Case BTLParamType.STRING_
|
||||
sTempPar = BTLPar.sValue
|
||||
'Case BTLParamType.COMBO
|
||||
' Dim cBTLPar As BTLParamCombo = DirectCast(ParentFeature.PParamList(ParIndex), BTLParamCombo)
|
||||
' vPar(ParIndex) = cBTLPar.
|
||||
End Select
|
||||
Next
|
||||
vPar = vTempPar
|
||||
If String.IsNullOrEmpty(sTempPar) Then
|
||||
sPar = " "
|
||||
Else
|
||||
sPar = sTempPar
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Overridable Function Copy() As BTLFeature
|
||||
' creo nuova feature
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Me.CalcParamArray(vPar, sPar)
|
||||
' aggiorno la feature con nuovo valore
|
||||
EgtBeamSetPart(Me.ParentPart.nPartId)
|
||||
Dim nNewFeatureId As Integer = EgtBeamAddProcess(Me.nSelGRP, Me.nPRC, Me.nSelSIDE, Me.sDES, Me.ParentPart.NewProcId(), Me.frFRAME, vPar, sPar)
|
||||
' se è stata creata
|
||||
If nNewFeatureId <> GDB_ID.NULL Then
|
||||
Dim NewFeat As New BTLFeature(Me.ParentPart, nNewFeatureId)
|
||||
' la aggiungo a struttura BTL corrente
|
||||
Me.ParentPart.FeatureList.Add(NewFeat)
|
||||
Return NewFeat
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Public Overridable Function Copy(DestBTLPart As BTLPart) As Boolean
|
||||
' creo nuova feature
|
||||
Dim vPar() As Double
|
||||
Dim sPar As String = String.Empty
|
||||
Me.CalcParamArray(vPar, sPar)
|
||||
' aggiorno la feature con nuovo valore
|
||||
EgtBeamSetPart(DestBTLPart.nPartId)
|
||||
Dim nNewFeatureId As Integer = EgtBeamAddProcess(Me.nSelGRP, Me.nPRC, Me.nSelSIDE, Me.sDES, DestBTLPart.NewProcId(), Me.frFRAME, vPar, sPar)
|
||||
' se è stata creata
|
||||
If nNewFeatureId <> GDB_ID.NULL Then
|
||||
Dim NewFeat As New BTLFeature(Me.ParentPart, nNewFeatureId)
|
||||
' la aggiungo a struttura BTL pezzo di destinazione
|
||||
DestBTLPart.FeatureList.Add(NewFeat)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' funzione che aggiorna parametri della feature
|
||||
Public Function UpdateParams(nNewGRP As Integer, nNewPRC As Integer, nNewSIDE As Integer, sNewDesc As String, nNewProcId As Integer,
|
||||
frNewRef As Frame3d, vNewPar() As Double, sNewPar As String) As Boolean
|
||||
' aggiorno la feature con nuovo valore
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
CalcParamArray(vPar, sPar)
|
||||
Dim nFeatureId As Integer = EgtBeamModifyProcess(Me.nFeatureId, nNewGRP, nNewPRC, nNewSIDE, sNewDesc, nNewProcId,
|
||||
frNewRef, vNewPar, sNewPar)
|
||||
If nFeatureId <> GDB_ID.NULL Then
|
||||
SetFeatureId(nFeatureId)
|
||||
' imposto modificato per copie
|
||||
EgtDuploSetModified(ParentPart.nPartId)
|
||||
Return True
|
||||
Else
|
||||
MessageBox.Show("Impossible create feature with this values", "Error")
|
||||
nFeatureId = EgtBeamModifyProcess(Me.nFeatureId, Me.nSelGRP, Me.nPRC, Me.nSelSIDE, "", Me.nPRID, New Frame3d(), vPar, sPar)
|
||||
SetFeatureId(nFeatureId)
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
' funzione che restituisce se la feature è un contorno libero
|
||||
Public Function IsFreeContour() As Boolean
|
||||
Return m_nPRC = 250 OrElse m_nPRC = 251 OrElse m_nPRC = 252
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BTLParam
|
||||
Inherits VMBase
|
||||
|
||||
' parametro che dice se il parametro e' P o Q
|
||||
Protected m_bIsP As Boolean = True
|
||||
Public ReadOnly Property bIsP As Boolean
|
||||
Get
|
||||
Return m_bIsP
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' parametri da struttura
|
||||
Protected m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nId As Integer
|
||||
Public ReadOnly Property nId As Integer
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_sDescription As String
|
||||
Public Property sDescription As String
|
||||
Get
|
||||
Return m_sDescription
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDescription = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' parametri da struttura
|
||||
Protected m_dMin As Double
|
||||
|
||||
Protected m_dMax As Double
|
||||
|
||||
Protected m_ValueList As List(Of String)
|
||||
Public ReadOnly Property ValueList As List(Of String)
|
||||
Get
|
||||
Return m_ValueList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' parametri da geometria
|
||||
Protected m_dValue As Double
|
||||
Protected m_sValue As String
|
||||
Public Overridable Property sValue As String
|
||||
Get
|
||||
Return m_sValue
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sValue = value
|
||||
End Set
|
||||
End Property
|
||||
Public Overridable Property dValue As Double
|
||||
Get
|
||||
Return m_dValue
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dValue = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nSelValue As Integer
|
||||
Public Property nSelValue As Integer
|
||||
Get
|
||||
Return m_nSelValue
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nSelValue = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dDefault As Double
|
||||
Public ReadOnly Property dDefault As Double
|
||||
Get
|
||||
Return m_dDefault
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_sDrawPath As String
|
||||
|
||||
' tipo della variabile
|
||||
Protected m_nType As BTLParamType
|
||||
Public ReadOnly Property nType As BTLParamType
|
||||
Get
|
||||
Return m_nType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Feature a cui appartiene il parametro
|
||||
Protected m_ParentFeature As BTLFeature
|
||||
Public ReadOnly Property ParentFeature As BTLFeature
|
||||
Get
|
||||
Return m_ParentFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property Name_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61614)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Value_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61615)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Min_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61616)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Max_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61617)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Sub StdInit(ParentFeature As BTLFeature, IsP As Boolean, Type As BTLParamType, sName As String, sDescription As String)
|
||||
m_ParentFeature = ParentFeature
|
||||
m_bIsP = IsP
|
||||
m_nType = Type
|
||||
m_sName = sName
|
||||
Dim nDescription As Integer
|
||||
If IsNumeric(sDescription) AndAlso Integer.TryParse(sDescription, nDescription) Then
|
||||
m_sDescription = EgtMsg(sDescription)
|
||||
Else
|
||||
m_sDescription = sDescription
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace(sName) Then
|
||||
Dim sId As String = sName.Trim({"P"c, "Q"c, "p"c, "q"c})
|
||||
Integer.TryParse(sId, m_nId)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' new per double e length
|
||||
Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, dMin As Double, dMax As Double, dDefault As Double, sDescription As String)
|
||||
StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||
m_dMin = dMin
|
||||
m_dMax = dMax
|
||||
m_dDefault = dDefault
|
||||
End Sub
|
||||
|
||||
' new per stringhe
|
||||
Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
|
||||
StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||
End Sub
|
||||
|
||||
' new per combobox
|
||||
Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, nMin As Integer, nMax As Integer, nDefault As Integer, sDescription As String, ValueList As List(Of String))
|
||||
StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||
m_dMin = nMin
|
||||
m_dMax = nMax
|
||||
m_dDefault = nDefault
|
||||
m_ValueList = ValueList
|
||||
End Sub
|
||||
|
||||
' new per parametro vuoto
|
||||
Sub New(IsP As Boolean, nType As BTLParamType, sParamName As String)
|
||||
StdInit(Nothing, IsP, nType, sParamName, "")
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
|
||||
Public Class BTLPart
|
||||
Inherits VMBase
|
||||
|
||||
' Feature a cui appartiene il parametro
|
||||
Protected m_ParentStructure As BTLStructure
|
||||
Public ReadOnly Property ParentStructure As BTLStructure
|
||||
Get
|
||||
Return m_ParentStructure
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Id geometrico del pezzo
|
||||
Protected m_nPartId As Integer
|
||||
Public ReadOnly Property nPartId As Integer
|
||||
Get
|
||||
Return m_nPartId
|
||||
End Get
|
||||
End Property
|
||||
Public WriteOnly Property SetPartId As Integer
|
||||
Set(value As Integer)
|
||||
m_nPartId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Info del pezzo
|
||||
Protected m_nPDN As Integer
|
||||
Public Property nPDN As Integer
|
||||
Get
|
||||
Return m_nPDN
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPDN = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_bDO As Boolean
|
||||
Public Overridable Property bDO As Boolean
|
||||
Get
|
||||
Return m_bDO
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bDO = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sNAM As String
|
||||
Public Overridable Property sNAM As String
|
||||
Get
|
||||
Return m_sNAM
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sNAM = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dL As Double
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return m_dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dW As Double
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return m_dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dH As Double
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return m_dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sMATERIAL As String
|
||||
Public Overridable Property sMATERIAL As String
|
||||
Get
|
||||
Return m_sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCNT As Integer
|
||||
Public Property nCNT As Integer
|
||||
Get
|
||||
Return m_nCNT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCNT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nTBP As Integer
|
||||
Public Property nTBP As Integer
|
||||
Get
|
||||
Return m_nTBP
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nTBP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nDON As Integer
|
||||
Public Property nDON As Integer
|
||||
Get
|
||||
Return m_nDON
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nDON = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nROT As Integer
|
||||
Public Property nROT As Integer
|
||||
Get
|
||||
Return m_nROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sGRP As String
|
||||
Public Property sGRP As String
|
||||
Get
|
||||
Return m_sGRP
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sGRP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nUNT As Integer
|
||||
Public Property nUNT As Integer
|
||||
Get
|
||||
Return m_nUNT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nUNT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nGlobalState As CalcStates = -1
|
||||
Protected m_nState As CalcStates = -1
|
||||
Public Property nState As CalcStates
|
||||
Get
|
||||
Return m_nState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_ROT As Integer
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_TIME As Integer
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return m_nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle feature del pezzo
|
||||
Protected m_FeatureList As ObservableCollection(Of BTLFeature)
|
||||
Public Property FeatureList As ObservableCollection(Of BTLFeature)
|
||||
Get
|
||||
Return m_FeatureList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLFeature))
|
||||
m_FeatureList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelFeature As BTLFeature
|
||||
Public Overridable Property SelFeature As BTLFeature
|
||||
Get
|
||||
Return m_SelFeature
|
||||
End Get
|
||||
Set(value As BTLFeature)
|
||||
m_SelFeature = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Section As SectionXMaterial
|
||||
Get
|
||||
Return New SectionXMaterial(m_dW, m_dH, m_dL, m_sMATERIAL)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(ParentStructure As BTLStructure, nPartId As Integer)
|
||||
m_ParentStructure = ParentStructure
|
||||
Me.SetPartId = nPartId
|
||||
m_FeatureList = New ObservableCollection(Of BTLFeature)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Public Function NewProcId() As Integer
|
||||
Dim nMaxProcId As Integer = 0
|
||||
If Not IsNothing(Me.FeatureList) AndAlso Me.FeatureList.Count > 0 Then
|
||||
nMaxProcId = Me.FeatureList.Max(Function(x) x.nPRID)
|
||||
End If
|
||||
Return nMaxProcId + 1
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,382 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BTLStructure
|
||||
Inherits VMBase
|
||||
|
||||
Dim m_bOldEnMod As Boolean = False
|
||||
Dim m_nBTLInfoId As Integer = 0
|
||||
|
||||
' pezzi da BTL
|
||||
Protected m_PartList As New ObservableCollection(Of BTLPart)
|
||||
Public Property PartList As ObservableCollection(Of BTLPart)
|
||||
Get
|
||||
Return m_PartList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLPart))
|
||||
m_PartList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelPart As BTLPart
|
||||
Public Overridable Property SelPart As BTLPart
|
||||
Get
|
||||
Return m_SelPart
|
||||
End Get
|
||||
Set(value As BTLPart)
|
||||
m_SelPart = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' grezzi da BTL
|
||||
Protected m_BTLRawPartList As List(Of BTLRawPart)
|
||||
|
||||
#Region "Parametri generici"
|
||||
|
||||
Protected m_sPROJNUM As String
|
||||
Public Overridable Property sPROJNUM As String
|
||||
Get
|
||||
Return m_sPROJNUM
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sPROJNUM = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sPROJNAME As String
|
||||
Public Overridable Property sPROJNAME As String
|
||||
Get
|
||||
Return m_sPROJNAME
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sPROJNAME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sPROJPART As String
|
||||
Public Overridable Property sPROJPART As String
|
||||
Get
|
||||
Return m_sPROJPART
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sPROJPART = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sPROJGUID As String
|
||||
Public Overridable Property sPROJGUID As String
|
||||
Get
|
||||
Return m_sPROJGUID
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sPROJGUID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sLISTNAME As String
|
||||
Public Overridable Property sLISTNAME As String
|
||||
Get
|
||||
Return m_sLISTNAME
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sLISTNAME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sCUSTOMER As String
|
||||
Public Overridable Property sCUSTOMER As String
|
||||
Get
|
||||
Return m_sCUSTOMER
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCUSTOMER = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sARCHITECT As String
|
||||
Public Overridable Property sARCHITECT As String
|
||||
Get
|
||||
Return m_sARCHITECT
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sARCHITECT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sEDITOR As String
|
||||
Public Overridable Property sEDITOR As String
|
||||
Get
|
||||
Return m_sEDITOR
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sEDITOR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sDELIVDATE As String
|
||||
Public Overridable Property sDELIVDATE As String
|
||||
Get
|
||||
Return m_sDELIVDATE
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDELIVDATE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sEXPDATE As String
|
||||
Public Overridable Property sEXPDATE As String
|
||||
Get
|
||||
Return m_sEXPDATE
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sEXPDATE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sEXPTIME As String
|
||||
Public Overridable Property sEXPTIME As String
|
||||
Get
|
||||
Return m_sEXPTIME
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sEXPTIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sEXPRELEASE As String
|
||||
Public Overridable Property sEXPRELEASE As String
|
||||
Get
|
||||
Return m_sEXPRELEASE
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sEXPRELEASE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sLANGUAGE As String
|
||||
Public Overridable Property sLANGUAGE As String
|
||||
Get
|
||||
Return m_sLANGUAGE
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sLANGUAGE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_ocRANGE As New ObservableCollection(Of Object)({New IdNameStruct(Range.STANDARD, EgtMsg(61710)),
|
||||
New IdNameStruct(Range.EXTENDED, EgtMsg(61711))})
|
||||
Public ReadOnly Property ocRANGE As ObservableCollection(Of Object)
|
||||
Get
|
||||
Return m_ocRANGE
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_SelRANGE As Integer
|
||||
Public Overridable Property SelRANGE As Integer
|
||||
Get
|
||||
Return m_SelRANGE
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_SelRANGE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_ocPROCESSINGQUALITY As New ObservableCollection(Of Object)({New IdNameStruct(ProcessingQuality.AUTOMATIC, EgtMsg(61658)),
|
||||
New IdNameStruct(ProcessingQuality.VISIBLE, EgtMsg(61659)),
|
||||
New IdNameStruct(ProcessingQuality.FAST, EgtMsg(61660))})
|
||||
Public ReadOnly Property ocPROCESSINGQUALITY As ObservableCollection(Of Object)
|
||||
Get
|
||||
Return m_ocPROCESSINGQUALITY
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_SelPROCESSINGQUALITY As Integer
|
||||
Public Overridable Property SelPROCESSINGQUALITY As Integer
|
||||
Get
|
||||
Return m_SelPROCESSINGQUALITY
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_SelPROCESSINGQUALITY = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sCOMPUTERNAME As String
|
||||
Public Overridable Property sCOMPUTERNAME As String
|
||||
Get
|
||||
Return m_sCOMPUTERNAME
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCOMPUTERNAME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sUSER As String
|
||||
Public Overridable Property sUSER As String
|
||||
Get
|
||||
Return m_sUSER
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sUSER = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sSRCFILE As String
|
||||
Public Overridable Property sSRCFILE As String
|
||||
Get
|
||||
Return m_sSRCFILE
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sSRCFILE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sEXPFILE As String
|
||||
Public Overridable Property sEXPFILE As String
|
||||
Get
|
||||
Return m_sEXPFILE
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sEXPFILE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_ocRECESS As New ObservableCollection(Of Object)({New IdNameStruct(Recess.AUTOMATIC, EgtMsg(61658)),
|
||||
New IdNameStruct(Recess.MANUAL, EgtMsg(61661))})
|
||||
Public ReadOnly Property ocRECESS As ObservableCollection(Of Object)
|
||||
Get
|
||||
Return m_ocRECESS
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_SelRECESS As Integer
|
||||
Public Overridable Property SelRECESS As Integer
|
||||
Get
|
||||
Return m_SelRECESS
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_SelRECESS = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sUSERATTRIBUTE As String
|
||||
Public Overridable Property sUSERATTRIBUTE As String
|
||||
Get
|
||||
Return m_sUSERATTRIBUTE
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sUSERATTRIBUTE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Parametri generici
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
' Info del pezzo
|
||||
Public ReadOnly Property PDN_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61601)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DO_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61602)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property NAM_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61603)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property L_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61604)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property W_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61605)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property H_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61606)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MAT_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61607)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CNT_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61608)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property TBP_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61609)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DON_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61610)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ROT_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61611)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GRP_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61612)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UNT_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61613)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' MESSAGES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Public Function NewPDN() As Integer
|
||||
Dim nMaxPDN As Integer = 0
|
||||
If Not IsNothing(PartList) And PartList.Count > 0 Then
|
||||
nMaxPDN = PartList.Max(Function(x) x.nPDN)
|
||||
End If
|
||||
Return nMaxPDN + 1
|
||||
End Function
|
||||
|
||||
Public Shared Function Empty()
|
||||
Return New BTLStructure
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class BTLRawPart
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class Beam
|
||||
Inherits Part
|
||||
|
||||
Protected m_dOffset As Double
|
||||
Public ReadOnly Property dOffset As Double
|
||||
Get
|
||||
Return m_dOffset
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Id del grezzo
|
||||
Protected m_nRawPartId As Integer = GDB_ID.NULL
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(nParentMachGroup As Core.MyMachGroup, nPartId As Integer, nRawPartId As Integer)
|
||||
MyBase.New(nParentMachGroup, nPartId)
|
||||
m_nRawPartId = nRawPartId
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Friend Sub UpdateOffset()
|
||||
' calcolo offset
|
||||
Dim nBeamIndex As Integer = ParentMachGroup.PartList.IndexOf(Me)
|
||||
If nBeamIndex > 0 Then
|
||||
m_dOffset = dPOSX - (ParentMachGroup.PartList(nBeamIndex - 1).dPOSX + ParentMachGroup.PartList(nBeamIndex - 1).dL)
|
||||
Else
|
||||
Dim BeamMachGroup As BeamMachGroup = DirectCast(ParentMachGroup, BeamMachGroup)
|
||||
m_dOffset = BeamMachGroup.dStartCut
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,60 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BeamMachGroup
|
||||
Inherits MyMachGroup
|
||||
|
||||
Protected m_dStartCut As Double
|
||||
Public ReadOnly Property dStartCut As Double
|
||||
Get
|
||||
Return m_dStartCut
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(nId As Integer, sName As String, sMachine As String)
|
||||
MyBase.New(nId, sName, sMachine)
|
||||
SetMachineType(MachineType.BEAM)
|
||||
EgtGetInfo(nId, MGR_RPT_BARLEN, dL)
|
||||
EgtGetInfo(nId, MGR_RPT_BARHEIGHT, dH)
|
||||
EgtGetInfo(nId, MGR_RPT_BARWIDTH, dW)
|
||||
m_dTotMat = dL
|
||||
For Each Part In PartList
|
||||
m_dMatForPart += Part.dL
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshPartList()
|
||||
' leggo StartCut da posizione primo pezzo
|
||||
Dim sInfo As String = ""
|
||||
Dim sSplitInfo() As String
|
||||
Dim bFound As Boolean = False
|
||||
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||
sSplitInfo = sInfo.Split(","c)
|
||||
StringToDouble(sSplitInfo(1), m_dStartCut)
|
||||
Else
|
||||
m_dStartCut = 0
|
||||
End If
|
||||
' aggiorno lista pezzi
|
||||
PartList.Clear()
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
While nRawPartId <> GDB_ID.NULL
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
If nPartId <> GDB_ID.NULL Then
|
||||
Dim NewBeam As Beam = New Beam(Me, nPartId, nRawPartId)
|
||||
PartList.Add(NewBeam)
|
||||
NewBeam.UpdateOffset()
|
||||
End If
|
||||
nRawPartId = EgtGetNextRawPart(nRawPartId)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshGroupData()
|
||||
EgtGetInfo(Id, MGR_RPT_BARLEN, dL)
|
||||
EgtGetInfo(Id, MGR_RPT_BARHEIGHT, dH)
|
||||
EgtGetInfo(Id, MGR_RPT_BARWIDTH, dW)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,257 @@
|
||||
Public Module ConstBeam
|
||||
|
||||
Public Enum BTLParamType As Integer
|
||||
DOUBLE_ = 1
|
||||
STRING_ = 2
|
||||
COMBO = 3
|
||||
LENGTH = 4
|
||||
CHECKBOX = 5
|
||||
End Enum
|
||||
|
||||
Public Enum BTLPartParam As Integer
|
||||
NULL = 0
|
||||
PDN = 1
|
||||
NAM = 2
|
||||
GRP = 3
|
||||
End Enum
|
||||
|
||||
Public Enum GRPType As Integer
|
||||
L = 0
|
||||
T = 1
|
||||
End Enum
|
||||
|
||||
Enum MachineType As Integer
|
||||
NULL = 0
|
||||
BEAM = 1
|
||||
WALL = 2
|
||||
End Enum
|
||||
|
||||
Enum CalcStates As Integer
|
||||
NOTCALCULATED = -1
|
||||
OK = 0
|
||||
WARNING = 1
|
||||
ERROR_ = 2
|
||||
End Enum
|
||||
|
||||
Public Enum Range As Integer
|
||||
STANDARD = 1
|
||||
EXTENDED = 2
|
||||
End Enum
|
||||
|
||||
Public Enum PartOffset_RefSideFixClamp As Integer
|
||||
INACTIVE = 0
|
||||
REFSIDE1 = 1
|
||||
REFSIDE2 = 2
|
||||
REFSIDE3 = 3
|
||||
REFSIDE4 = 4
|
||||
End Enum
|
||||
|
||||
Public Enum ProcessingQuality As Integer
|
||||
AUTOMATIC = 1
|
||||
VISIBLE = 2
|
||||
FAST = 3
|
||||
End Enum
|
||||
|
||||
Public Enum Recess As Integer
|
||||
AUTOMATIC = 1
|
||||
MANUAL = 2
|
||||
End Enum
|
||||
|
||||
Public Enum StoreyType As Integer
|
||||
CEILING = 1
|
||||
ROOF = 2
|
||||
WALL = 3
|
||||
End Enum
|
||||
|
||||
Public Enum AlignmentLocation As Integer
|
||||
INACTIV = 0
|
||||
BR = 1
|
||||
TR = 2
|
||||
BA = 3
|
||||
TA = 4
|
||||
HC = 5
|
||||
VC = 6
|
||||
AC = 7
|
||||
End Enum
|
||||
|
||||
Public Enum AlignmentEndtype As Integer
|
||||
R = 1
|
||||
A = 2
|
||||
D = 3
|
||||
End Enum
|
||||
|
||||
Public Enum MaterialType As Integer
|
||||
INACTIV = 0
|
||||
BA = 1
|
||||
CL = 2
|
||||
MT = 3
|
||||
ME_ = 4
|
||||
GB = 5
|
||||
GF = 6
|
||||
IN_ = 7
|
||||
SH = 8
|
||||
FB = 9
|
||||
PB = 10
|
||||
PL = 11
|
||||
End Enum
|
||||
|
||||
Public Enum MoveDirections As Integer
|
||||
UP = -1
|
||||
DOWN = 1
|
||||
End Enum
|
||||
|
||||
Public Const BTLFEATURES_FILE_NAME As String = "BTLFeatures.ini"
|
||||
|
||||
'Public Const S_GENERAL As String = "General"
|
||||
'Public Const K_DEBUG As String = "Debug"
|
||||
|
||||
' Tipo di progetto
|
||||
Public Enum ProjectType As Integer
|
||||
PROJ = 1
|
||||
PROD = 2
|
||||
End Enum
|
||||
|
||||
Friend Const PROJ As String = "PROJ"
|
||||
Friend Const FILENAMESEPARATOR As Char = "^"c
|
||||
Friend Const BTLINFO As String = "BtlInfo"
|
||||
|
||||
' info parametri BTL
|
||||
Friend Const BTL_PRT_PDN As String = "PDN"
|
||||
Friend Const BTL_PRT_DO As String = "DO"
|
||||
Friend Const BTL_PRT_NAM As String = "NAM"
|
||||
Friend Const BTL_PRT_L As String = "L"
|
||||
Friend Const BTL_PRT_W As String = "W"
|
||||
Friend Const BTL_PRT_H As String = "H"
|
||||
Friend Const BTL_PRT_CNT As String = "CNT"
|
||||
Friend Const BTL_PRT_ROTATED As String = "ROTATED"
|
||||
Friend Const BTL_PRT_INVERTED As String = "INVERTED"
|
||||
Friend Const BTL_PRT_MATERIAL As String = "MATERIAL"
|
||||
' parametri pezzo
|
||||
Friend Const BTL_PRT_SINGLEMEMBERNUM = "SINGLEMEMBERNUMBER"
|
||||
Friend Const BTL_PRT_ASSEMBLYNUM = "ASSEMBLYNUMBER"
|
||||
Friend Const BTL_PRT_ORDERNUM = "ORDERNUMBER"
|
||||
Friend Const BTL_PRT_DESIGNATION = "DESIGNATION"
|
||||
Friend Const BTL_PRT_ANNOTATION = "ANNOTATION"
|
||||
Friend Const BTL_PRT_STOREY = "STOREY"
|
||||
Friend Const BTL_PRT_GROUP = "GROUP"
|
||||
Friend Const BTL_PRT_PACKAGE = "PACKAGE"
|
||||
Friend Const BTL_PRT_TIMBERGRADE = "TIMBERGRADE"
|
||||
Friend Const BTL_PRT_QUALITYGRADE = "QUALITYGRADE"
|
||||
Friend Const BTL_PRT_COLOUR = "COLOUR"
|
||||
Friend Const BTL_PRT_PLANINGLENGTH = "PLANINGLENGTH"
|
||||
Friend Const BTL_PRT_STARTOFFSET = "STARTOFFSET"
|
||||
Friend Const BTL_PRT_ENDOFFSET = "ENDOFFSET"
|
||||
Friend Const BTL_PRT_UID = "UID"
|
||||
Friend Const BTL_PRT_TRANSFORMATION = "TRANSFORMATION"
|
||||
Friend Const BTL_PRT_CAMBER = "CAMBER"
|
||||
Friend Const BTL_PRT_PARTOFFSET = "PARTOFFSET"
|
||||
Friend Const BTL_PRT_PROCESSINGQUALITY = "PROCESSINGQUALITY"
|
||||
Friend Const BTL_PRT_RECESS = "RECESS"
|
||||
Friend Const BTL_PRT_STOREYTYPE = "STOREYTYPE"
|
||||
Friend Const BTL_PRT_ELEMENTNUM = "ELEMENTNUMBER"
|
||||
Friend Const BTL_PRT_LAYER = "LAYER"
|
||||
Friend Const BTL_PRT_MODULENUM = "MODULENUMBER"
|
||||
'Friend Const BTL_PRT_USERATTRIBUTE = "USERATTRIBUTE"
|
||||
Friend Const BTL_PRT_COMMENT = "COMMENT"
|
||||
Friend Const BTL_PRT_GRAINDIR = "GRAINDIRECTION"
|
||||
Friend Const BTL_PRT_REFSIDE = "REFERENCESIDE"
|
||||
Friend Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
|
||||
Friend Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
|
||||
|
||||
' parametri generici
|
||||
Friend Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
|
||||
Friend Const BTL_GEN_PROJNAME = "PROJECTNAME"
|
||||
Friend Const BTL_GEN_PROJPART = "PROJECTPART"
|
||||
Friend Const BTL_GEN_PROJGUID = "PROJECTGUID"
|
||||
Friend Const BTL_GEN_LISTNAME = "LISTNAME"
|
||||
Friend Const BTL_GEN_CUSTOMER = "CUSTOMER"
|
||||
Friend Const BTL_GEN_ARCHITECT = "ARCHITECT"
|
||||
Friend Const BTL_GEN_EDITOR = "EDITOR"
|
||||
Friend Const BTL_GEN_DELIVDATE = "DELIVERYDATE"
|
||||
Friend Const BTL_GEN_EXPDATE = "EXPORTDATE"
|
||||
Friend Const BTL_GEN_EXPTIME = "EXPORTTIME"
|
||||
Friend Const BTL_GEN_EXPRELEASE = "EXPORTRELEASE"
|
||||
Friend Const BTL_GEN_LANGUAGE = "LANGUAGE"
|
||||
Friend Const BTL_GEN_RANGE = "RANGE"
|
||||
Friend Const BTL_GEN_COMPUTERNAME = "COMPUTERNAME"
|
||||
Friend Const BTL_GEN_USER = "USER"
|
||||
Friend Const BTL_GEN_SRCFILE = "SOURCEFILE"
|
||||
Friend Const BTL_GEN_EXPFILE = "EXPORTFILE"
|
||||
Friend Const BTL_GEN_USERATTRIBUTE = "USERATTRIBUTE"
|
||||
|
||||
Friend Const PROCESSINGS As String = "Processings"
|
||||
Friend Const OUTLINE As String = "Outline"
|
||||
Friend Const BTL_FTR_GRP As String = "GRP"
|
||||
Friend Const BTL_FTR_PRC As String = "PRC"
|
||||
Friend Const BTL_FTR_DO As String = "DO"
|
||||
Friend Const BTL_FTR_SIDE As String = "SIDE"
|
||||
Friend Const BTL_FTR_NAME As String = "NAME"
|
||||
Friend Const BTL_FTR_DES As String = "DES"
|
||||
Friend Const BTL_FTR_PRID As String = "PRID"
|
||||
Friend Const BTL_FTR_FRAME As String = "FRAME"
|
||||
|
||||
' parametri machgroup grezzi
|
||||
Friend Const MGR_RPT_ID As String = "ID"
|
||||
Friend Const MGR_RPT_L As String = "L"
|
||||
Friend Const MGR_RPT_W As String = "W"
|
||||
Friend Const MGR_RPT_H As String = "H"
|
||||
Friend Const MGR_RPT_WASTE As String = "WASTE"
|
||||
Friend Const MGR_RPT_USAGE As String = "USAGE"
|
||||
Friend Const MGR_RPT_STARTCUT As String = "STARTCUT"
|
||||
Friend Const MGR_RPT_MATERIAL As String = "MATERIAL"
|
||||
|
||||
Friend Const MGR_PRT_PDN As String = "PDN"
|
||||
Friend Const MGR_PRT_L As String = "L"
|
||||
Friend Const MGR_PRT_W As String = "W"
|
||||
Friend Const MGR_PRT_H As String = "H"
|
||||
Friend Const MGR_PRT_DES As String = "DES"
|
||||
Friend Const MGR_PRT_STARTCUT As String = "STARTCUT"
|
||||
Friend Const MGR_PRT_MATERIAL As String = "MATERIAL"
|
||||
|
||||
Friend Const MGR_FTR_GRP As String = "GRP"
|
||||
Friend Const MGR_FTR_PRC As String = "PRC"
|
||||
Friend Const MGR_FTR_DO As String = "DO"
|
||||
Friend Const MGR_FTR_SIDE As String = "SIDE"
|
||||
Friend Const MGR_FTR_NAME As String = "NAME"
|
||||
Friend Const MGR_FTR_DES As String = "DES"
|
||||
Friend Const MGR_FTR_PRID As String = "PRID"
|
||||
Friend Const MGR_FTR_FRAME As String = "FRAME"
|
||||
|
||||
' parametri creazione barre
|
||||
Friend Const MGR_RPT_BARLEN As String = "BARLEN"
|
||||
Friend Const MGR_RPT_BARHEIGHT As String = "BARHEIGHT"
|
||||
Friend Const MGR_RPT_BARWIDTH As String = "BARWIDTH"
|
||||
Friend Const MGR_RPT_PANELLEN As String = "PANELLEN"
|
||||
Friend Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
|
||||
Friend Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
|
||||
Friend Const MGR_RPT_PART As String = "PART"
|
||||
|
||||
' parametri errori integration
|
||||
Friend Const ITG_CUTID As String = "CUTID"
|
||||
Friend Const ITG_TASKID As String = "TASKID"
|
||||
Friend Const ITG_PROJ_ERR As String = "PROJ_ERR"
|
||||
Friend Const ITG_PROJ_MSG As String = "PROJ_MSG"
|
||||
Friend Const ITG_PROJ_ROT As String = "PROJ_ROT"
|
||||
Friend Const ITG_PROJ_FALL As String = "PROJ_FALL"
|
||||
Friend Const ITG_PROJ_TIME As String = "PROJ_TIME"
|
||||
|
||||
' parametri errori integration
|
||||
Friend Const ITG_PROD_ERR As String = "PROD_ERR"
|
||||
Friend Const ITG_PROD_MSG As String = "PROD_MSG"
|
||||
Friend Const ITG_PROD_ROT As String = "PROD_ROT"
|
||||
Friend Const ITG_PROD_TIME As String = "PROD_TIME"
|
||||
|
||||
' parametri errori integration
|
||||
Friend Const DUPLO_TODELETE As String = "DUPLO_TODELETE"
|
||||
|
||||
' parametri warehouse
|
||||
Friend Const WRH_BEAM As String = "BEAM"
|
||||
Friend Const WRH_WALL As String = "WALL"
|
||||
Friend Const WRH_CURRENT As String = "Current"
|
||||
Friend Const WRH_STARTOFFSET As String = "StartOffset"
|
||||
Friend Const WRH_OFFSET As String = "Offset"
|
||||
Friend Const WRH_L As String = "L"
|
||||
Friend Const WRH_KERF As String = "Kerf"
|
||||
Friend Const WRH_S As String = "S"
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>EgtBEAMWALL.Core</RootNamespace>
|
||||
<AssemblyName>EgtBEAMWALL.Core</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Core.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Core.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EgtUILib">
|
||||
<HintPath>..\..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtWPFLib5">
|
||||
<HintPath>..\..\..\EgtProg\DllD32\EgtWPFLib5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Beam.vb" />
|
||||
<Compile Include="BeamMachGroup.vb" />
|
||||
<Compile Include="BTLFeature.vb" />
|
||||
<Compile Include="BTLParam.vb" />
|
||||
<Compile Include="BTLPart.vb" />
|
||||
<Compile Include="BTLStructure.vb" />
|
||||
<Compile Include="Constants\ConstBeam.vb" />
|
||||
<Compile Include="Enum.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="MyMachGroup.vb" />
|
||||
<Compile Include="Part.vb" />
|
||||
<Compile Include="SectionXMaterial.vb" />
|
||||
<Compile Include="Utility\BTLIniFile.vb" />
|
||||
<Compile Include="Utility\Command.vb" />
|
||||
<Compile Include="Utility\VMBase.vb" />
|
||||
<Compile Include="Wall.vb" />
|
||||
<Compile Include="WallMachGroup.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\ViewerOptimizer\EgtBEAMWALL.Core.dll</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
Public Enum CalcStates As Integer
|
||||
NOTCALCULATED = -1
|
||||
OK = 0
|
||||
WARNING = 1
|
||||
ERROR_ = 2
|
||||
End Enum
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
@@ -0,0 +1,35 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' General Information about an assembly is controlled through the following
|
||||
' set of attributes. Change these attribute values to modify the information
|
||||
' associated with an assembly.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("EgtBEAMWALL.Core")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("EgtBEAMWALL.Core")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2020")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("632ea0b1-10e2-4f07-8b1b-d9371ef8392e")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
' Major Version
|
||||
' Minor Version
|
||||
' Build Number
|
||||
' Revision
|
||||
'
|
||||
' You can specify all the values or you can default the Build and Revision Numbers
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("EgtBEAMWALL.Core.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set(ByVal value As Global.System.Globalization.CultureInfo)
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.EgtBEAMWALL.Core.My.MySettings
|
||||
Get
|
||||
Return Global.EgtBEAMWALL.Core.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,166 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class MyMachGroup
|
||||
Inherits MachGroup
|
||||
|
||||
Protected m_nMachineType As MachineType
|
||||
Public ReadOnly Property nMachineType As MachineType
|
||||
Get
|
||||
Return m_nMachineType
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetMachineType(nMachineType As MachineType)
|
||||
m_nMachineType = nMachineType
|
||||
End Sub
|
||||
|
||||
Protected m_dL As Double
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return m_dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dW As Double
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return m_dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dH As Double
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return m_dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dMatForPart As Double = 0
|
||||
Protected m_dTotMat As Double = 0
|
||||
Public ReadOnly Property dUsage As Double
|
||||
Get
|
||||
Return If(m_dMatForPart > 0 AndAlso m_dTotMat > 0, m_dMatForPart / m_dTotMat * 100, 0)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dWaste As Double
|
||||
Get
|
||||
Return If(m_dMatForPart > 0 AndAlso m_dTotMat > 0, (m_dTotMat - m_dMatForPart) / m_dTotMat * 100, 0)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sUsage As String
|
||||
Get
|
||||
Return dUsage & "%"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sWaste As String
|
||||
Get
|
||||
Return dWaste & "%"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_sMATERIAL As String
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return m_sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei pezzi che sono nel grezzo
|
||||
Private m_PartList As New ObservableCollection(Of Part)
|
||||
Public Property PartList As ObservableCollection(Of Part)
|
||||
Get
|
||||
Return m_PartList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Part))
|
||||
m_PartList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelPart As Part
|
||||
Public Overridable Property SelPart As Part
|
||||
Get
|
||||
Return m_SelPart
|
||||
End Get
|
||||
Set(value As Part)
|
||||
m_SelPart = value
|
||||
' seleziono pezzo
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(value) Then EgtSelectObj(SelPart.nPartId)
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged("SelPart")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nState As CalcStates = -1
|
||||
Public ReadOnly Property nState As CalcStates
|
||||
Get
|
||||
Return m_nState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If m_nState = 0 Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_nState < 0 Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf m_nState > 0 Then
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(nId As Integer, sName As String, sMachine As String)
|
||||
MyBase.New(nId, sName, sMachine)
|
||||
'aggiorno lista pezzi
|
||||
RefreshPartList()
|
||||
End Sub
|
||||
|
||||
Public MustOverride Sub RefreshPartList()
|
||||
|
||||
Public MustOverride Sub RefreshGroupData()
|
||||
|
||||
Public Overridable Sub DeleteMachGroup()
|
||||
' elimino tutte le copie
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
While nRawPartId <> GDB_ID.NULL
|
||||
EgtRemovePartFromRawPart(nBeamId)
|
||||
EgtErase(nBeamId)
|
||||
nRawPartId = EgtGetNextRawPart(nRawPartId)
|
||||
nBeamId = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
End While
|
||||
' elimino MachGroup
|
||||
EgtRemoveMachGroup(Me.Id)
|
||||
End Sub
|
||||
|
||||
Public Sub CalcMachGroupUpdate()
|
||||
m_nState = CalcStates.OK
|
||||
For Each Part In PartList
|
||||
If Part.nGlobalState > 0 AndAlso m_nState = CalcStates.OK Then
|
||||
m_nState = CalcStates.ERROR_
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged("Calc_Background")
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,350 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class Part
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Protected m_ParentMachGroup As MyMachGroup
|
||||
Public ReadOnly Property ParentMachGroup As MyMachGroup
|
||||
Get
|
||||
Return m_ParentMachGroup
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Id geometrico del pezzo
|
||||
Protected m_nPartId As Integer
|
||||
Public ReadOnly Property nPartId As Integer
|
||||
Get
|
||||
Return m_nPartId
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetPartId(nPartId As Integer)
|
||||
m_nPartId = nPartId
|
||||
End Sub
|
||||
' Info del pezzo
|
||||
Protected m_nPDN As Integer
|
||||
Public ReadOnly Property nPDN As Integer
|
||||
Get
|
||||
Return m_nPDN
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_sNAM As String
|
||||
Public ReadOnly Property sNAM As String
|
||||
Get
|
||||
Return m_sNAM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_dL As Double
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return m_dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dW As Double
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return m_dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dH As Double
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return m_dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dPOSX As Double
|
||||
Public Property sPOSX As String
|
||||
Get
|
||||
Return LenToString(m_dPOSX, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_dPOSX)
|
||||
End Set
|
||||
End Property
|
||||
Public Property dPOSX As Double
|
||||
Get
|
||||
Return m_dPOSX
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dPOSX = value
|
||||
NotifyPropertyChanged("sPOSX")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCNT As Integer
|
||||
Public Property nCNT As Integer
|
||||
Get
|
||||
Return m_nCNT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCNT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nINVERTED As Integer
|
||||
Public ReadOnly Property sINVERTED As String
|
||||
Get
|
||||
Return m_nINVERTED & "°"
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetInverted(nInverted As Integer)
|
||||
m_nINVERTED = nInverted
|
||||
End Sub
|
||||
|
||||
Protected m_nROTATED As Integer
|
||||
Public ReadOnly Property sROTATED As String
|
||||
Get
|
||||
Return m_nROTATED & "°"
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetRotated(nRotated As Integer)
|
||||
m_nROTATED = nRotated
|
||||
End Sub
|
||||
|
||||
Protected m_sMATERIAL As String
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return m_sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nGlobalState As CalcStates = -1
|
||||
Public ReadOnly Property nGlobalState As CalcStates
|
||||
Get
|
||||
Return m_nGlobalState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_nState As CalcStates = -1
|
||||
Public Property nState As CalcStates
|
||||
Get
|
||||
Return m_nState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If m_nGlobalState = 0 Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_nGlobalState < 0 Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf m_nGlobalState > 0 Then
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_ERR As Integer
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_nCALC_ERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_sCALC_MSG As String = String.Empty
|
||||
Public ReadOnly Property nCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_ROT As Integer
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_FALL As Integer
|
||||
Public Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return m_nCALC_FALL
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_FALL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_TIME As Integer
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return m_nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle feature del pezzo
|
||||
Protected m_FeatureList As ObservableCollection(Of BTLFeature)
|
||||
Public Property FeatureList As ObservableCollection(Of BTLFeature)
|
||||
Get
|
||||
Return m_FeatureList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLFeature))
|
||||
m_FeatureList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelFeature As BTLFeature
|
||||
Public Property SelFeature As Core.BTLFeature
|
||||
Get
|
||||
Return m_SelFeature
|
||||
End Get
|
||||
Set(value As Core.BTLFeature)
|
||||
m_SelFeature = value
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(value) Then EgtSelectObj(m_SelFeature.nFeatureId)
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged("SelFeature")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdDeletePart As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(nParentMachGroup As MyMachGroup, nPartId As Integer)
|
||||
m_ParentMachGroup = nParentMachGroup
|
||||
SetPartId(nPartId)
|
||||
m_FeatureList = New ObservableCollection(Of BTLFeature)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcPartUpdate(bCalc As Boolean, ERR As Integer, ROT As Integer, FALL As Integer, MSG As String)
|
||||
If Not bCalc Then
|
||||
nState = CalcStates.NOTCALCULATED
|
||||
m_nCALC_ERR = 0
|
||||
m_nCALC_ROT = 0
|
||||
m_nCALC_FALL = 0
|
||||
m_sCALC_MSG = ""
|
||||
Else
|
||||
m_nCALC_ERR = ERR
|
||||
m_nCALC_ROT = ROT
|
||||
m_nCALC_FALL = 0
|
||||
m_sCALC_MSG = MSG
|
||||
If ERR = 0 Then
|
||||
nState = CalcStates.OK
|
||||
ElseIf ERR > 1 Then
|
||||
nState = CalcStates.ERROR_
|
||||
ElseIf ERR < 1 Then
|
||||
nState = CalcStates.NOTCALCULATED
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("Calc_Background")
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcFeatureUpdate()
|
||||
m_nGlobalState = nState
|
||||
For Each Feature In FeatureList
|
||||
If Not Feature.bDO Then
|
||||
|
||||
ElseIf Feature.nState < 0 Then
|
||||
m_nGlobalState = CalcStates.NOTCALCULATED
|
||||
Exit For
|
||||
ElseIf Feature.nState > 0 AndAlso m_nGlobalState = CalcStates.OK Then
|
||||
m_nGlobalState = CalcStates.ERROR_
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged("Calc_Background")
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DeletePart"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property DeletePart_Command() As ICommand
|
||||
Get
|
||||
If m_cmdDeletePart Is Nothing Then
|
||||
m_cmdDeletePart = New Command(AddressOf DeletePart)
|
||||
End If
|
||||
Return m_cmdDeletePart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Overridable Sub DeletePart()
|
||||
EgtRemovePartFromRawPart(Me.m_nPartId)
|
||||
' elimino pezzo copia
|
||||
EgtErase(Me.m_nPartId)
|
||||
' elimino info pezzo su mach group
|
||||
Dim sInfo As String = ""
|
||||
Dim Index As Integer = 1
|
||||
Dim sSplitInfo() As String
|
||||
Dim bFound As Boolean = False
|
||||
While EgtGetInfo(m_ParentMachGroup.Id, MGR_RPT_PART & Index, sInfo)
|
||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||
sSplitInfo = sInfo.Split(","c)
|
||||
If bFound Then
|
||||
EgtSetInfo(m_ParentMachGroup.Id, MGR_RPT_PART & Index - 1, sInfo)
|
||||
End If
|
||||
If sSplitInfo(0) = nPartId Then
|
||||
bFound = True
|
||||
End If
|
||||
End If
|
||||
Index += 1
|
||||
End While
|
||||
If bFound Then
|
||||
EgtSetInfo(m_ParentMachGroup.Id, MGR_RPT_PART & Index - 1, "")
|
||||
End If
|
||||
' rimuovo dalla lista pezzi
|
||||
Index = ParentMachGroup.PartList.IndexOf(Me)
|
||||
If Index = 0 Then
|
||||
If ParentMachGroup.PartList.Count > 0 Then
|
||||
ParentMachGroup.SelPart = ParentMachGroup.PartList(0)
|
||||
Else
|
||||
ParentMachGroup.SelPart = Nothing
|
||||
End If
|
||||
ElseIf Index = ParentMachGroup.PartList.Count - 1 Then
|
||||
If ParentMachGroup.PartList.Count > 1 Then
|
||||
ParentMachGroup.SelPart = ParentMachGroup.PartList(ParentMachGroup.PartList.Count - 2)
|
||||
Else
|
||||
ParentMachGroup.SelPart = Nothing
|
||||
End If
|
||||
Else
|
||||
ParentMachGroup.SelPart = ParentMachGroup.PartList(Index - 1)
|
||||
End If
|
||||
ParentMachGroup.PartList.Remove(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' DeletePart
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,226 @@
|
||||
Imports System.Windows
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class SectionXMaterial
|
||||
Inherits VMBase
|
||||
|
||||
Private Shared m_nType As MachineType
|
||||
Public Shared Sub SetType(nType As MachineType)
|
||||
m_nType = nType
|
||||
End Sub
|
||||
|
||||
Protected m_Material As List(Of String)
|
||||
Public ReadOnly Property sMaterial As List(Of String)
|
||||
Get
|
||||
Return m_Material
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_MaterialForSameSection_List As New List(Of String)
|
||||
Public Property MaterialForSameSection_List As List(Of String)
|
||||
Get
|
||||
Return m_MaterialForSameSection_List
|
||||
End Get
|
||||
Set(value As List(Of String))
|
||||
m_MaterialForSameSection_List = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelMaterialForSameSection As String
|
||||
Public Property SelMaterialForSameSection As String
|
||||
Get
|
||||
Return m_SelMaterialForSameSection
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelMaterialForSameSection = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dW As Double = 0
|
||||
Public ReadOnly Property dW As Double
|
||||
Get
|
||||
Return m_dW
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_dH As Double = 0
|
||||
Public ReadOnly Property dH As Double
|
||||
Get
|
||||
Return m_dH
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_dL As Double = 0
|
||||
Public ReadOnly Property dL As Double
|
||||
Get
|
||||
Return m_dL
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sSectionXMaterial As String
|
||||
Get
|
||||
Dim sAlias As String = String.Empty
|
||||
For Each sMatItem In sMaterial
|
||||
sAlias &= sMatItem & ";"
|
||||
Next
|
||||
sAlias = sAlias.TrimEnd(";")
|
||||
If Me = Empty Then
|
||||
Return ""
|
||||
ElseIf m_nType = MachineType.BEAM Then
|
||||
Return LenToString(m_dW, 3) & " x " & LenToString(m_dH, 3) & " " & sAlias
|
||||
ElseIf m_nType = MachineType.WALL Then
|
||||
Return LenToString(m_dH, 3) & " " & sAlias
|
||||
Else Return ""
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Shared Operator =(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
|
||||
Return (S1.m_dH = S2.m_dH AndAlso S1.m_dW = S2.m_dW AndAlso S1.m_dL = S2.m_dL AndAlso S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x)))
|
||||
End Operator
|
||||
|
||||
Shared Operator <>(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
|
||||
Return (S1.m_dH <> S2.m_dH OrElse S1.m_dW <> S2.m_dW OrElse S1.m_dL <> S2.m_dL) OrElse Not S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x))
|
||||
End Operator
|
||||
|
||||
Public Overrides Function Equals(ByVal obj As Object) As Boolean
|
||||
If TypeOf obj Is SectionXMaterial Then
|
||||
Return (m_dH = obj.dH AndAlso m_dW = obj.dW AndAlso m_dL = obj.dL AndAlso m_Material.Any(Function(x) DirectCast(obj.sMaterial, List(Of String)).Any(Function(y) y = x)))
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String)
|
||||
If m_nType = MachineType.BEAM Then
|
||||
m_dW = dW
|
||||
m_dH = dH
|
||||
ElseIf m_nType = MachineType.WALL Then
|
||||
m_dH = dH
|
||||
End If
|
||||
m_Material = New List(Of String)
|
||||
Dim sMaterialArray() As String = Split(sMaterial, ";")
|
||||
For Each sMatItem In sMaterialArray
|
||||
m_Material.Add(sMatItem)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Shared Empty As New SectionXMaterial(-1, -1, -1, "")
|
||||
|
||||
#Region "Import BTL <-> Warehouse"
|
||||
|
||||
Private m_dNewW As Double
|
||||
Public Property dNewW As Double
|
||||
Get
|
||||
Return m_dNewW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dNewW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dNewL As Double
|
||||
Public Property dNewL As Double
|
||||
Get
|
||||
Return m_dNewL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dNewL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Alias_IsEnabled As Boolean
|
||||
Public Property Alias_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_Alias_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_Alias_IsEnabled = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Alias_IsChecked As Boolean
|
||||
Public Property Alias_IsChecked As Boolean
|
||||
Get
|
||||
Return m_Alias_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_Alias_IsChecked = value
|
||||
If value Then
|
||||
NewBeam_Visibility = Visibility.Collapsed
|
||||
NewWall_Visibility = Visibility.Collapsed
|
||||
Alias_Visibility = Visibility.Visible
|
||||
Else
|
||||
If m_nType = MachineType.BEAM Then
|
||||
NewBeam_Visibility = Visibility.Visible
|
||||
NewWall_Visibility = Visibility.Collapsed
|
||||
Else
|
||||
NewBeam_Visibility = Visibility.Collapsed
|
||||
NewWall_Visibility = Visibility.Visible
|
||||
End If
|
||||
Alias_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_NewBeam_Visibility As Visibility
|
||||
Public Property NewBeam_Visibility As Visibility
|
||||
Get
|
||||
Return m_NewBeam_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
If value <> m_NewBeam_Visibility Then
|
||||
m_NewBeam_Visibility = value
|
||||
NotifyPropertyChanged("NewBeam_Visibility")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_NewWall_Visibility As Visibility
|
||||
Public Property NewWall_Visibility As Visibility
|
||||
Get
|
||||
Return m_NewWall_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
If value <> m_NewWall_Visibility Then
|
||||
m_NewWall_Visibility = value
|
||||
NotifyPropertyChanged("NewWall_Visibility")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Alias_Visibility As Visibility
|
||||
Public Property Alias_Visibility As Visibility
|
||||
Get
|
||||
Return m_Alias_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
If value <> m_Alias_Visibility Then
|
||||
m_Alias_Visibility = value
|
||||
NotifyPropertyChanged("Alias_Visibility")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property L_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61604)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property W_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61605)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property H_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61606)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Import BTL <-> Warehouse
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' EgalTech 2017-2017
|
||||
'----------------------------------------------------------------------------
|
||||
' File : IniFile.vb Data : 08.04.17 Versione : 1.8d1
|
||||
' Contenuto : Modulo IniFile per gestione lettura/scrittura da file INI.
|
||||
'
|
||||
'
|
||||
'
|
||||
' Modifiche : 08.04.17 ES Creazione modulo.
|
||||
'
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Module BTLIniFile
|
||||
|
||||
Public m_sBTLIniFile As String
|
||||
|
||||
Public Function GetBeamPrivateProfileProcessList(IpGRPType As GRPType, ByRef IpProcessList As ObservableCollection(Of Integer)) As Boolean
|
||||
Dim PRCList As New ObservableCollection(Of Integer)
|
||||
Dim sProcess As String = String.Empty
|
||||
If EgtUILib.GetPrivateProfileString(PROCESSINGS, IpGRPType, String.Empty, sProcess, m_sBTLIniFile) > 0 Then
|
||||
Dim sProcesses() As String = sProcess.Split(","c)
|
||||
' verifico ce ne sia almeno uno
|
||||
If sProcesses.Count >= 0 Then
|
||||
' cancello spazi
|
||||
For Index = 0 To sProcesses.Count - 1
|
||||
sProcesses(Index) = sProcesses(Index).Trim()
|
||||
Dim nProcess As Integer
|
||||
Integer.TryParse(sProcesses(Index), nProcess)
|
||||
PRCList.Add(nProcess)
|
||||
Next
|
||||
IpProcessList = PRCList
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function GetBeamPrivateProfileGRPList(IpGRP As Integer, IpPRC As Integer, ByRef IpGRPList As ObservableCollection(Of Integer)) As Boolean
|
||||
IpGRPList.Clear()
|
||||
' ciclo sui tipi di gruppo
|
||||
Dim sBTLGroup As String = String.Empty
|
||||
If EgtUILib.GetPrivateProfileString(IpGRP & "." & IpPRC, BTL_FTR_GRP, String.Empty, sBTLGroup, m_sBTLIniFile) > 0 Then
|
||||
Dim sBTLGroups() As String = sBTLGroup.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sBTLGroups.Count >= 0 Then
|
||||
' cancello spazi
|
||||
For Index = 0 To sBTLGroups.Count - 1
|
||||
sBTLGroups(Index) = sBTLGroups(Index).Trim()
|
||||
Next
|
||||
' creo parametro
|
||||
For Each Group In sBTLGroups
|
||||
Dim nGroup As Integer = -1
|
||||
Integer.TryParse(Group, nGroup)
|
||||
If IpGRP = GRPType.L And (nGroup = 0 OrElse nGroup = 3 OrElse nGroup = 4) Then
|
||||
IpGRPList.Add(nGroup)
|
||||
ElseIf IpGRP = GRPType.T And (nGroup = 1 OrElse nGroup = 2) Then
|
||||
IpGRPList.Add(nGroup)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Return IpGRPList.Count > 0
|
||||
End Function
|
||||
|
||||
'Public Function GetBeamPrivateProfileVerifyGRP(IpAppName As String, IpGPRtoVerify As String) As Boolean
|
||||
' ' ciclo sui tipi di gruppo
|
||||
' Dim sBTLGroup As String = String.Empty
|
||||
' If EgtUILib.GetPrivateProfileString(IpAppName, BTL_FTR_GRP, String.Empty, sBTLGroup, m_sBTLIniFile) > 0 Then
|
||||
' Dim sBTLGroups() As String = sBTLGroup.Split(","c)
|
||||
' ' verifico numero minimo di parametri
|
||||
' If sBTLGroups.Count >= 0 Then
|
||||
' ' cancello spazi
|
||||
' For Index = 0 To sBTLGroups.Count - 1
|
||||
' sBTLGroups(Index) = sBTLGroups(Index).Trim()
|
||||
' Next
|
||||
' End If
|
||||
' Return sBTLGroups.Contains(IpGPRtoVerify)
|
||||
' End If
|
||||
' Return False
|
||||
'End Function
|
||||
|
||||
Public Function CalcBeamPrivateProfileGRP(nGRP As Integer) As Integer
|
||||
If nGRP = 1 Or nGRP = 2 Then
|
||||
Return 1
|
||||
ElseIf nGRP = 0 Or nGRP = 3 Or nGRP = 4 Then
|
||||
Return 0
|
||||
Else
|
||||
Return nGRP
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function GetBeamPrivateProfileName(IpGRP As Integer, IpPRC As Integer, ByRef IpBTLFeature As BTLFeature) As Boolean
|
||||
Dim sBTLName As String = String.Empty
|
||||
' creo lista GRP e leggo nome
|
||||
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, BTL_FTR_NAME, String.Empty, sBTLName, m_sBTLIniFile) > 0 Then
|
||||
' verifico numero minimo di parametri
|
||||
If Not String.IsNullOrEmpty(sBTLName) Then
|
||||
Dim nNameMsg As Integer
|
||||
Integer.TryParse(sBTLName, nNameMsg)
|
||||
IpBTLFeature.SetName(EgtMsg(nNameMsg))
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function GetBeamPrivateProfileName(IpGRP As Integer, IpPRC As Integer) As String
|
||||
Dim sBTLName As String = String.Empty
|
||||
' creo lista GRP e leggo nome
|
||||
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, BTL_FTR_NAME, String.Empty, sBTLName, m_sBTLIniFile) > 0 Then
|
||||
' verifico numero minimo di parametri
|
||||
If Not String.IsNullOrEmpty(sBTLName) Then
|
||||
Dim nNameMsg As Integer
|
||||
Integer.TryParse(sBTLName, nNameMsg)
|
||||
Return EgtMsg(nNameMsg)
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
Public Function GetBeamPrivateProfileParam(IpGRP As Integer, IpPRC As Integer, IsP As Boolean, IpFeatureParamIndex As String, IpParentFeature As BTLFeature, ByRef IpBTLParam As BTLParam) As Boolean
|
||||
Dim sBTLParam As String = String.Empty
|
||||
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, If(IsP, "P", "Q") & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
|
||||
Dim sBTLParamParams() As String = sBTLParam.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sBTLParamParams.Count >= 6 Then
|
||||
' cancello spazi
|
||||
For Index = 0 To sBTLParamParams.Count - 1
|
||||
sBTLParamParams(Index) = sBTLParamParams(Index).Trim()
|
||||
Next
|
||||
' creo parametro
|
||||
If sBTLParamParams(0) = "d" OrElse sBTLParamParams(0) = "l" Then
|
||||
Dim dMin As Double
|
||||
Dim dMax As Double
|
||||
Dim dDefault As Double
|
||||
StringToDouble(sBTLParamParams(2), dMin)
|
||||
StringToDouble(sBTLParamParams(3), dMax)
|
||||
StringToDouble(sBTLParamParams(4), dDefault)
|
||||
Dim ParamType As BTLParamType
|
||||
If sBTLParamParams(0) = "d" Then
|
||||
ParamType = BTLParamType.DOUBLE_
|
||||
Else
|
||||
ParamType = BTLParamType.LENGTH
|
||||
End If
|
||||
IpBTLParam = New BTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5))
|
||||
Return Not IsNothing(IpBTLParam)
|
||||
ElseIf sBTLParamParams(0) = "s" Then
|
||||
IpBTLParam = New BTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5))
|
||||
Return Not IsNothing(IpBTLParam)
|
||||
ElseIf sBTLParamParams(0) = "c" Then
|
||||
Dim nMin As Integer
|
||||
Dim nMax As Integer
|
||||
Dim nDefault As Integer
|
||||
Integer.TryParse(sBTLParamParams(2), nMin)
|
||||
Integer.TryParse(sBTLParamParams(3), nMax)
|
||||
Integer.TryParse(sBTLParamParams(4), nDefault)
|
||||
' recupero lista valori
|
||||
Dim ValueList As New List(Of String)
|
||||
IpBTLParam = New BTLParam(IpParentFeature, IsP, BTLParamType.COMBO, sBTLParamParams(1), nMin, nMax, nDefault, sBTLParamParams(5), ValueList)
|
||||
Return Not IsNothing(IpBTLParam)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,70 @@
|
||||
Imports System.Windows.Input
|
||||
|
||||
''' <summary>
|
||||
''' A command whose sole purpose is to
|
||||
''' relay its functionality to other
|
||||
''' objects by invoking delegates. The
|
||||
''' default return value for the CanExecute
|
||||
''' method is 'true'.
|
||||
''' </summary>
|
||||
Public Class Command
|
||||
Implements ICommand
|
||||
|
||||
#Region "Fields"
|
||||
|
||||
Private ReadOnly _execute As Action(Of Object)
|
||||
Private ReadOnly _canExecute As Predicate(Of Object)
|
||||
|
||||
#End Region ' Fields
|
||||
|
||||
#Region "Constructors"
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new command that can always execute.
|
||||
''' </summary>
|
||||
''' <param name="execute">The execution logic.</param>
|
||||
Public Sub New(ByVal execute As Action(Of Object))
|
||||
Me.New(execute, Nothing)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new command.
|
||||
''' </summary>
|
||||
''' <param name="execute">The execution logic.</param>
|
||||
''' <param name="canExecute">The execution status logic.</param>
|
||||
Public Sub New(ByVal execute As Action(Of Object), ByVal canExecute As Predicate(Of Object))
|
||||
If execute Is Nothing Then
|
||||
Throw New ArgumentNullException("execute")
|
||||
End If
|
||||
|
||||
_execute = execute
|
||||
_canExecute = canExecute
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructors
|
||||
|
||||
#Region "ICommand Members"
|
||||
|
||||
<DebuggerStepThrough> _
|
||||
Public Function CanExecute(ByVal parameter As Object) As Boolean Implements ICommand.CanExecute
|
||||
Return If(_canExecute Is Nothing, True, _canExecute(parameter))
|
||||
End Function
|
||||
|
||||
Public Custom Event CanExecuteChanged As EventHandler Implements ICommand.CanExecuteChanged
|
||||
AddHandler(ByVal value As EventHandler)
|
||||
AddHandler CommandManager.RequerySuggested, value
|
||||
End AddHandler
|
||||
RemoveHandler(ByVal value As EventHandler)
|
||||
RemoveHandler CommandManager.RequerySuggested, value
|
||||
End RemoveHandler
|
||||
RaiseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
||||
End RaiseEvent
|
||||
End Event
|
||||
|
||||
Public Sub Execute(ByVal parameter As Object) Implements ICommand.Execute
|
||||
_execute(parameter)
|
||||
End Sub
|
||||
|
||||
#End Region ' ICommand Members
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,12 @@
|
||||
Imports System.ComponentModel
|
||||
|
||||
Public Class VMBase
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,47 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class Wall
|
||||
Inherits Part
|
||||
|
||||
Protected m_dPOSY As Double
|
||||
Public Property dPOSY As Double
|
||||
Get
|
||||
Return m_dPOSY
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dPOSY = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dROT As Double
|
||||
Public Property dROT As Double
|
||||
Get
|
||||
Return m_dROT
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dFLIP As Double
|
||||
Public Property dFLIP As Double
|
||||
Get
|
||||
Return m_dFLIP
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dFLIP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(nParentMachGroup As MyMachGroup, nPartId As Integer)
|
||||
MyBase.New(nParentMachGroup, nPartId)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,45 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class WallMachGroup
|
||||
Inherits MyMachGroup
|
||||
|
||||
Protected m_nRawPartId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nRawPartId As Integer
|
||||
Get
|
||||
Return m_nRawPartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(nId As Integer, sName As String, sMachine As String)
|
||||
MyBase.New(nId, sName, sMachine)
|
||||
SetMachineType(MachineType.WALL)
|
||||
m_nRawPartId = EgtGetFirstRawPart()
|
||||
EgtGetInfo(nId, MGR_RPT_PANELLEN, dL)
|
||||
EgtGetInfo(nId, MGR_RPT_PANELWIDTH, dW)
|
||||
EgtGetInfo(nId, MGR_RPT_PANELHEIGHT, dH)
|
||||
m_dTotMat = dL * dW
|
||||
For Each Part In PartList
|
||||
m_dMatForPart += (Part.dL * Part.dW)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshPartList()
|
||||
m_nRawPartId = EgtGetFirstRawPart()
|
||||
PartList.Clear()
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_nRawPartId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
PartList.Add(New Wall(Me, nPartId))
|
||||
nPartId = EgtGetNextPartInRawPart(nPartId)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshGroupData()
|
||||
EgtGetInfo(Id, MGR_RPT_PANELLEN, dL)
|
||||
EgtGetInfo(Id, MGR_RPT_PANELWIDTH, dW)
|
||||
EgtGetInfo(Id, MGR_RPT_PANELHEIGHT, dH)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
||||
<providers>
|
||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="MySql.Data.MySqlClient" />
|
||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
</DbProviderFactories>
|
||||
</system.data>
|
||||
</configuration>
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
|
||||
// Database config
|
||||
public const string DATABASE_SERV = "127.0.0.1";
|
||||
public const string DATABASE_NAME = "EgtBwDb";
|
||||
public const string DATABASE_USER = "root";
|
||||
public const string DATABASE_PWD = "viacremasca";
|
||||
public static int DATABASE_PROCESS_TIMEOUT = 5;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class BTLPartController : IDisposable
|
||||
{
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
public BTLPartController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by DBId
|
||||
/// </summary>
|
||||
/// <param name="PartDbId"></param>
|
||||
/// <returns></returns>
|
||||
public BTLPartModel FindByDbId(int PartDbId)
|
||||
{
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by ExtId
|
||||
/// </summary>
|
||||
/// <param name="PartId"></param>
|
||||
/// <returns></returns>
|
||||
public BTLPartModel FindByPartId(int PartId)
|
||||
{
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartId == PartId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="PartDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetPaginatedAsc(int PartDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = PartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartDbId <= PartDbIdStart)
|
||||
.OrderBy(x => x.PartDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="PartDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = PartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartDbId <= PartDbIdStart)
|
||||
.OrderByDescending(x => x.PartDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by ProjectId (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProjDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetByProjectAsc(int ProjDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == ProjDbId)
|
||||
.OrderBy(x => x.PartDbId)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by ProjectId (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProjDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetByProjectDesc(int ProjDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == ProjDbId)
|
||||
.OrderByDescending(x => x.PartDbId)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create multiple (empty) BTLPart record associated to Project
|
||||
/// </summary>
|
||||
/// <param name="ProjDbId"></param>
|
||||
/// <param name="rawListData"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> CreateBaseObj(int ProjDbId, List<int> rawListData)
|
||||
{
|
||||
List<BTLPartModel> partData = new List<BTLPartModel>();
|
||||
|
||||
foreach (var item in rawListData)
|
||||
{
|
||||
BTLPartModel newItem = new BTLPartModel() { ProjDbId = ProjDbId, PartId = item };
|
||||
partData.Add(newItem);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.AddRange(partData);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
return partData;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create multiple BTLPart record associated to Project
|
||||
/// </summary>
|
||||
/// <param name="ProjID"></param>
|
||||
/// <param name="partData"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> Create(int ProjID, List<BTLPartModel> partData)
|
||||
{
|
||||
// se è adv mode --> uso TUTTI i dati
|
||||
if (DbManager.AdvDataModel)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.AddRange(partData);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return partData;
|
||||
}
|
||||
// se non adv --> faccio solo copia degli id...
|
||||
else
|
||||
{
|
||||
List<int> partIdList = new List<int>();
|
||||
foreach (var item in partData)
|
||||
{
|
||||
partIdList.Add(item.PartId);
|
||||
}
|
||||
return CreateBaseObj(ProjID, partIdList);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update single BTLPart
|
||||
/// </summary>
|
||||
/// <param name="updItem"></param>
|
||||
/// <returns></returns>
|
||||
public bool Update(BTLPartModel updItem)
|
||||
{
|
||||
bool done = false;
|
||||
var item2del = dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartDbId == updItem.PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
dbCtx.Entry(item2del).CurrentValues.SetValues(updItem);
|
||||
|
||||
//// update, vers 2
|
||||
//dbCtx.BTLPartList.Remove(item2del);
|
||||
//dbCtx.BTLPartList.Add(updItem);
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete single BTLPart
|
||||
/// </summary>
|
||||
/// <param name="PartDbId"></param>
|
||||
/// <returns></returns>
|
||||
public bool Delete(int PartDbId)
|
||||
{
|
||||
bool done = false;
|
||||
var item2del = dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.Remove(item2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return done;
|
||||
}
|
||||
/// <summary>
|
||||
/// Delete BTLPart by project
|
||||
/// </summary>
|
||||
/// <param name="ProjDbId"></param>
|
||||
/// <returns></returns>
|
||||
public bool DeleteByProject(int ProjDbId)
|
||||
{
|
||||
bool done = false;
|
||||
var items2del = dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == ProjDbId);
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.RemoveRange(items2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Conversion of base class to DB model class
|
||||
/// </summary>
|
||||
/// <param name="corePart"></param>
|
||||
/// <returns></returns>
|
||||
public BTLPartModel Convert(Core.BTLPart corePart)
|
||||
{
|
||||
BTLPartModel answ = new BTLPartModel();
|
||||
if (corePart != null)
|
||||
{
|
||||
answ = new BTLPartModel()
|
||||
{
|
||||
PartId = corePart.nPartId,
|
||||
PDN = corePart.nPDN,
|
||||
DO = corePart.bDO,
|
||||
NAM = corePart.sNAM,
|
||||
W = corePart.dW,
|
||||
L = corePart.dL,
|
||||
H = corePart.dH,
|
||||
MAT = corePart.sMATERIAL,
|
||||
CNT = corePart.nCNT,
|
||||
TBP = corePart.nTBP,
|
||||
DON = corePart.nDON,
|
||||
ROT = corePart.nROT,
|
||||
GRP = corePart.sGRP,
|
||||
UNT = corePart.nUNT,
|
||||
CALC_State = (int)corePart.nState
|
||||
};
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class ProdController : IDisposable
|
||||
{
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
public ProdController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by RawPartDbId
|
||||
/// </summary>
|
||||
/// <param name="RawPartDbId"></param>
|
||||
/// <returns></returns>
|
||||
public ProdModel FindByRawPartDbId(int RawPartDbId)
|
||||
{
|
||||
var rawPart = dbCtx
|
||||
.RawPartList
|
||||
.Where(x => x.RawPartDbId == RawPartDbId)
|
||||
.SingleOrDefault();
|
||||
|
||||
return FindByProdDbId(rawPart.ProdDbId);
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by RawPartId
|
||||
/// </summary>
|
||||
/// <param name="RawPartId "></param>
|
||||
/// <returns></returns>
|
||||
public ProdModel FindByRawPartId(int RawPartId)
|
||||
{
|
||||
var rawPart = dbCtx
|
||||
.RawPartList
|
||||
.Where(x => x.RawPartId == RawPartId)
|
||||
.SingleOrDefault();
|
||||
|
||||
return FindByProdDbId(rawPart.ProdDbId);
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by ProdDbId
|
||||
/// </summary>
|
||||
/// <param name="ProdDbId"></param>
|
||||
/// <returns></returns>
|
||||
public ProdModel FindByProdDbId(int ProdDbId)
|
||||
{
|
||||
return dbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdDbId == ProdDbId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by ProdId
|
||||
/// </summary>
|
||||
/// <param name="ProdId"></param>
|
||||
/// <returns></returns>
|
||||
public ProdModel FindByProdId(int ProdId)
|
||||
{
|
||||
return dbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdId == ProdId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProdDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProdModel> GetPaginatedAsc(int ProdDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = ProdDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdDbId <= ProdDbIdStart)
|
||||
.OrderBy(x => x.ProdDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="PartDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProdModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = PartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdDbId <= PartDbIdStart)
|
||||
.OrderByDescending(x => x.ProdDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by ProdectId (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProdDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProdModel> GetByProdAsc(int ProdDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdDbId == ProdDbId)
|
||||
.OrderBy(x => x.ProdDbId)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by ProdectId (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProdDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProdModel> GetByProdDesc(int ProdDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdDbId == ProdDbId)
|
||||
.OrderByDescending(x => x.ProdDbId)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create record on DB
|
||||
/// </summary>
|
||||
/// <param name="newProdId"></param>
|
||||
/// <param name="Description"></param>
|
||||
/// <returns></returns>
|
||||
public ProdModel Create(int newProdId, string Description)
|
||||
{
|
||||
ProdModel newProd = new ProdModel() { ProdId = newProdId, Description = Description };
|
||||
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.ProdList.Add(newProd);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
return newProd;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class ProjController : IDisposable
|
||||
{
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
public ProjController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by ProjDbId
|
||||
/// </summary>
|
||||
/// <param name="ProjDbId"></param>
|
||||
/// <returns></returns>
|
||||
public ProjModel FindByProjDbId(int ProjDbId)
|
||||
{
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjDbId == ProjDbId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by ProjId
|
||||
/// </summary>
|
||||
/// <param name="ProjId"></param>
|
||||
/// <returns></returns>
|
||||
public ProjModel FindByProjId(int ProjId)
|
||||
{
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjId == ProjId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProjDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProjModel> GetPaginatedAsc(int ProjDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = ProjDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjDbId <= ProjDbIdStart)
|
||||
.OrderBy(x => x.ProjDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="PartDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProjModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = PartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjDbId <= PartDbIdStart)
|
||||
.OrderByDescending(x => x.ProjDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by ProjectId (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProdDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProjModel> GetByProdAsc(int ProdDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProdDbId == ProdDbId)
|
||||
.OrderBy(x => x.ProdDbId)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by ProjectId (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProdDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProjModel> GetByProdDesc(int ProdDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProdDbId == ProdDbId)
|
||||
.OrderByDescending(x => x.ProdDbId)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create record on DB
|
||||
/// </summary>
|
||||
/// <param name="newProjId"></param>
|
||||
/// <param name="newBTLFileName"></param>
|
||||
/// <returns></returns>
|
||||
public ProjModel Create(int newProjId, string newBTLFileName)
|
||||
{
|
||||
ProjModel newProj = new ProjModel() { ProjId=newProjId, BTLFileName=newBTLFileName };
|
||||
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.ProjList.Add(newProj);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
return newProj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class RawPartController : IDisposable
|
||||
{
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
public RawPartController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by RawPartDbId
|
||||
/// </summary>
|
||||
/// <param name="RawPartDbId"></param>
|
||||
/// <returns></returns>
|
||||
public RawPartModel FindByRawPartDbId(int RawPartDbId)
|
||||
{
|
||||
return dbCtx
|
||||
.RawPartList
|
||||
.Where(x => x.RawPartDbId == RawPartDbId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by RawPartId
|
||||
/// </summary>
|
||||
/// <param name="RawPartId"></param>
|
||||
/// <returns></returns>
|
||||
public RawPartModel FindByRawPartId(int RawPartId)
|
||||
{
|
||||
return dbCtx
|
||||
.RawPartList
|
||||
.Where(x => x.RawPartId == RawPartId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="RawPartDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<RawPartModel> GetPaginatedAsc(int RawPartDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = RawPartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.RawPartList
|
||||
.Where(x => x.RawPartDbId <= RawPartDbIdStart)
|
||||
.OrderBy(x => x.RawPartDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="PartDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<RawPartModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = PartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.RawPartList
|
||||
.Where(x => x.RawPartDbId <= PartDbIdStart)
|
||||
.OrderByDescending(x => x.RawPartDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by RawPartectId (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProdDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<RawPartModel> GetByProdAsc(int ProdDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.RawPartList
|
||||
.Where(x => x.ProdDbId == ProdDbId)
|
||||
.OrderBy(x => x.ProdDbId)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by RawPartectId (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProdDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<RawPartModel> GetByProdDesc(int ProdDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.RawPartList
|
||||
.Where(x => x.ProdDbId == ProdDbId)
|
||||
.OrderByDescending(x => x.ProdDbId)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create record on DB
|
||||
/// </summary>
|
||||
/// <param name="newRawPartId"></param>
|
||||
/// <param name="description"></param>
|
||||
/// <returns></returns>
|
||||
public RawPartModel Create(int newRawPartId, string description)
|
||||
{
|
||||
RawPartModel newRawPart = new RawPartModel() { RawPartId=newRawPartId, Description=description, State= RawPartState.ND };
|
||||
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.RawPartList.Add(newRawPart);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
return newRawPart;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Migrations;
|
||||
using MySql.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using EgtBEAMWALL.DataLayer.Migrations;
|
||||
using System.ServiceProcess;
|
||||
//using EgtBEAMWALL.DataLayer.Migrations;
|
||||
//using EgtBEAMWALL.DataLayer.Controllers;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer
|
||||
{
|
||||
|
||||
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
||||
public class DatabaseContext : DbContext
|
||||
{
|
||||
/// <summary>
|
||||
/// BTLParts management
|
||||
/// </summary>
|
||||
public DbSet<BTLPartModel> BTLPartList { get; set; }
|
||||
/// <summary>
|
||||
/// Parts management
|
||||
/// </summary>
|
||||
public DbSet<ProdModel> ProdList { get; set; }
|
||||
/// <summary>
|
||||
/// Parts management
|
||||
/// </summary>
|
||||
public DbSet<ProjModel> ProjList { get; set; }
|
||||
/// <summary>
|
||||
/// Parts management
|
||||
/// </summary>
|
||||
public DbSet<RawPartModel> RawPartList { get; set; }
|
||||
/// <summary>
|
||||
/// Parts management
|
||||
/// </summary>
|
||||
public DbSet<PartModel> PartList { get; set; }
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Db data mode
|
||||
/// </summary>
|
||||
public static bool AdvDataModel { get; set; } = false;
|
||||
#endif
|
||||
|
||||
//providerName="System.Data.EntityClient"
|
||||
|
||||
|
||||
public static string CONNECTION_STRING = $"server={Constants.DATABASE_SERV};port=3306;database={Constants.DATABASE_NAME};uid={Constants.DATABASE_USER};pwd={Constants.DATABASE_PWD};";
|
||||
|
||||
public DatabaseContext() : base(CONNECTION_STRING)
|
||||
{
|
||||
}
|
||||
|
||||
public static DatabaseContext Create()
|
||||
{
|
||||
return new DatabaseContext();
|
||||
}
|
||||
|
||||
private static string getDbServiceName()
|
||||
{
|
||||
ServiceController[] services = ServiceController.GetServices();
|
||||
var service = services.FirstOrDefault(s => s.ServiceName == "MariaDB");
|
||||
if (service != null)
|
||||
return service.DisplayName;
|
||||
|
||||
service = services.FirstOrDefault(s => s.ServiceName == "MySQL");
|
||||
if (service != null)
|
||||
return service.DisplayName;
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
public static bool SetUpDbConnectionAndDbConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
String serviceName = getDbServiceName();
|
||||
if (serviceName.Equals(""))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
ServiceController service = new ServiceController(serviceName);
|
||||
try
|
||||
{
|
||||
TimeSpan timeout = TimeSpan.FromSeconds(Constants.DATABASE_PROCESS_TIMEOUT);
|
||||
service.WaitForStatus(ServiceControllerStatus.Running, timeout);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
System.Data.Entity.Database.SetInitializer<DatabaseContext>(null);
|
||||
var migrator = new DbMigrator(new Configuration());
|
||||
|
||||
if (migrator.GetPendingMigrations().Any())
|
||||
{
|
||||
// Run migrations and seed.
|
||||
migrator.Update();
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabella di gestione dei PROTOTIPI dal file BTL (part + quantità)
|
||||
/// </summary>
|
||||
[Table("BTLPartList")]
|
||||
public class BTLPartModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Chiave univoca
|
||||
/// </summary>
|
||||
[Key, Column("BTLPartDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int PartDbId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PartId dal programma
|
||||
/// </summary>
|
||||
[Column("BTLPartId")]
|
||||
public int PartId { get; set; }
|
||||
|
||||
[Column("BTLPart_PDN")]
|
||||
public int PDN { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_DO")]
|
||||
public bool DO { get; set; } = false;
|
||||
|
||||
[Column("BTLPart_NAM")]
|
||||
public string NAM { get; set; } = "";
|
||||
|
||||
[Column("BTLPart_W")]
|
||||
public double W { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_L")]
|
||||
public double L { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_H")]
|
||||
public double H { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_MAT")]
|
||||
public string MAT { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Quantità richiesta
|
||||
/// </summary>
|
||||
[Column("BTLPart_CNT")]
|
||||
public int CNT { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_TBP")]
|
||||
public int TBP { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_DON")]
|
||||
public int DON { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_ROT")]
|
||||
public int ROT { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_GRP")]
|
||||
public string GRP { get; set; } = "";
|
||||
|
||||
[Column("BTLPart_UNT")]
|
||||
public int UNT { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_CalcState")]
|
||||
public int CALC_State { get; set; } = -1;
|
||||
|
||||
[Column("ProjDbId")]
|
||||
public int ProjDbId { get; set; }
|
||||
|
||||
[ForeignKey("ProjDbId")]
|
||||
public ProjModel Project { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabelal delle singole istsanze prodotte\
|
||||
/// </summary>
|
||||
[Table("PartList")]
|
||||
public class PartModel
|
||||
{
|
||||
[Key, Column("PartDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int PartDbId { get; set; }
|
||||
|
||||
[Column("PartId")]
|
||||
public int PartId { get; set; }
|
||||
|
||||
[Column("Part_PDN")]
|
||||
public int PDN { get; set; } = 0;
|
||||
|
||||
[Column("Part_NAM")]
|
||||
public string NAM { get; set; } = "";
|
||||
|
||||
[Column("Part_W")]
|
||||
public double W { get; set; } = 0;
|
||||
|
||||
[Column("Part_L")]
|
||||
public double L { get; set; } = 0;
|
||||
|
||||
[Column("Part_H")]
|
||||
public double H { get; set; } = 0;
|
||||
|
||||
[Column("Part_MAT")]
|
||||
public string MAT { get; set; } = "";
|
||||
|
||||
[Column("Part_ROT")]
|
||||
public int ROT { get; set; } = 0;
|
||||
|
||||
[Column("Part_GRP")]
|
||||
public string GRP { get; set; } = "";
|
||||
|
||||
[Column("Part_CalcState")]
|
||||
public int CALC_State { get; set; } = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Stato della singola Part (da enum)
|
||||
/// </summary>
|
||||
[Column("Part_State")]
|
||||
public PartState State { get; set; } = PartState.ND;
|
||||
|
||||
[Column("BTLPartDbId")]
|
||||
public int BTLPartDbId { get; set; }
|
||||
|
||||
[ForeignKey("BTLPartDbId")]
|
||||
public BTLPartModel BTLPart { get; set; }
|
||||
|
||||
[Column("RawPartDbId")]
|
||||
public int? RawPartDbId { get; set; }
|
||||
|
||||
[ForeignKey("RawPartDbId")]
|
||||
public virtual RawPartModel RawPart { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabella deiu raggruppamenti PROJ in forma di PROD
|
||||
/// </summary>
|
||||
[Table("ProdList")]
|
||||
public class ProdModel
|
||||
{
|
||||
[Key, Column("ProdDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int ProdDbId { get; set; }
|
||||
|
||||
[Column("ProdId")]
|
||||
public int ProdId { get; set; }
|
||||
|
||||
[Column("Prod_Description")]
|
||||
public string Description { get; set; } = "";
|
||||
|
||||
[Column("Prod_Lock")]
|
||||
public bool Locked { get; set; } = false;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabella dei PROJ caricati dal BTL
|
||||
/// </summary>
|
||||
[Table("ProjList")]
|
||||
public class ProjModel
|
||||
{
|
||||
[Key, Column("ProjDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int ProjDbId { get; set; }
|
||||
|
||||
[Column("ProjId")]
|
||||
public int ProjId { get; set; }
|
||||
|
||||
[Column("Proj_BTLFileName")]
|
||||
public string BTLFileName { get; set; } = "";
|
||||
|
||||
[Column("ProdDbId")]
|
||||
public int? ProdDbId { get; set; }
|
||||
|
||||
[ForeignKey("ProdDbId")]
|
||||
public virtual ProdModel Prod { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabella dei grezzi
|
||||
/// </summary>
|
||||
[Table("RawPartList")]
|
||||
public class RawPartModel
|
||||
{
|
||||
[Key, Column("RawPartDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int RawPartDbId { get; set; }
|
||||
|
||||
[Column("RawPartId")]
|
||||
public int RawPartId { get; set; }
|
||||
|
||||
[Column("RawPart_Descript")]
|
||||
public string Description { get; set; } = "";
|
||||
|
||||
[Column("RawPart_State")]
|
||||
public RawPartState State { get; set; } = RawPartState.ND;
|
||||
|
||||
[Column("RawPart_Assign")]
|
||||
public string Assign { get; set; } = "";
|
||||
|
||||
[Column("ProdDbId")]
|
||||
public int ProdDbId { get; set; }
|
||||
|
||||
[ForeignKey("ProdDbId")]
|
||||
public ProdModel Prod { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer
|
||||
{
|
||||
public class DbManager
|
||||
{
|
||||
public static bool AdvDataModel { get; set; } = false;
|
||||
|
||||
public DbManager()
|
||||
{
|
||||
}
|
||||
|
||||
public Controllers.ProjController ProjCtr = new Controllers.ProjController();
|
||||
public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{24D7760E-662A-47E4-B729-B70126C24A31}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>EgtBEAMWALL.DataLayer</RootNamespace>
|
||||
<AssemblyName>EgtBEAMWALL.DataLayer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.0.0\lib\net40\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.0.0\lib\net40\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.6.9.12\lib\net40\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data.Entity.EF6, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.Entity.6.9.12\lib\net40\MySql.Data.Entity.EF6.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Constants.cs" />
|
||||
<Compile Include="Controllers\ProdController.cs" />
|
||||
<Compile Include="Controllers\RawPartController.cs" />
|
||||
<Compile Include="Controllers\ProjController.cs" />
|
||||
<Compile Include="Controllers\BTLPartController.cs" />
|
||||
<Compile Include="DatabaseContext.cs" />
|
||||
<Compile Include="DatabaseModels\PartModel.cs" />
|
||||
<Compile Include="DatabaseModels\BTLPartModel.cs" />
|
||||
<Compile Include="DatabaseModels\ProdModel.cs" />
|
||||
<Compile Include="DatabaseModels\ProjModel.cs" />
|
||||
<Compile Include="DatabaseModels\RawPartModel.cs" />
|
||||
<Compile Include="DbManager.cs" />
|
||||
<Compile Include="Enums.cs" />
|
||||
<Compile Include="Migrations\202103031811160_InitDb.cs" />
|
||||
<Compile Include="Migrations\202103031811160_InitDb.Designer.cs">
|
||||
<DependentUpon>202103031811160_InitDb.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgtBEAMWALL.Core\EgtBEAMWALL.Core.vbproj">
|
||||
<Project>{f22835a1-83d8-4334-91bb-baaeb9cf59b1}</Project>
|
||||
<Name>EgtBEAMWALL.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Migrations\202103031811160_InitDb.resx">
|
||||
<DependentUpon>202103031811160_InitDb.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\ViewerOptimizer\EgtBEAMWALL.DataLayer.dll</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Stati ammessi per le PARTS da tagliare
|
||||
/// </summary>
|
||||
public enum PartState
|
||||
{
|
||||
ND = -1,
|
||||
RawAssigned = 0,
|
||||
WIP = 1,
|
||||
Produced = 2,
|
||||
Scrapped = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stati ammessi per le RawParts
|
||||
/// </summary>
|
||||
public enum RawPartState
|
||||
{
|
||||
ND = -1,
|
||||
Assigned = 0,
|
||||
Wip = 1,
|
||||
Produced = 2,
|
||||
Scrapped = 3
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.0.0-20911")]
|
||||
public sealed partial class InitDb : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(InitDb));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "202103031811160_InitDb"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class InitDb : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.BTLPartList",
|
||||
c => new
|
||||
{
|
||||
BTLPartDbId = c.Int(nullable: false, identity: true),
|
||||
BTLPartId = c.Int(nullable: false),
|
||||
BTLPart_PDN = c.Int(nullable: false),
|
||||
BTLPart_DO = c.Boolean(nullable: false),
|
||||
BTLPart_NAM = c.String(unicode: false),
|
||||
BTLPart_W = c.Double(nullable: false),
|
||||
BTLPart_L = c.Double(nullable: false),
|
||||
BTLPart_H = c.Double(nullable: false),
|
||||
BTLPart_MAT = c.String(unicode: false),
|
||||
BTLPart_CNT = c.Int(nullable: false),
|
||||
BTLPart_TBP = c.Int(nullable: false),
|
||||
BTLPart_DON = c.Int(nullable: false),
|
||||
BTLPart_ROT = c.Int(nullable: false),
|
||||
BTLPart_GRP = c.String(unicode: false),
|
||||
BTLPart_UNT = c.Int(nullable: false),
|
||||
BTLPart_State = c.Int(nullable: false),
|
||||
ProjDbId = c.Int(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => t.BTLPartDbId)
|
||||
.ForeignKey("dbo.ProjList", t => t.ProjDbId, cascadeDelete: true)
|
||||
.Index(t => t.ProjDbId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.ProjList",
|
||||
c => new
|
||||
{
|
||||
ProjDbId = c.Int(nullable: false, identity: true),
|
||||
ProjId = c.Int(nullable: false),
|
||||
Proj_BTLFileName = c.String(unicode: false),
|
||||
ProdDbId = c.Int(),
|
||||
})
|
||||
.PrimaryKey(t => t.ProjDbId)
|
||||
.ForeignKey("dbo.ProdList", t => t.ProdDbId)
|
||||
.Index(t => t.ProdDbId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.ProdList",
|
||||
c => new
|
||||
{
|
||||
ProdDbId = c.Int(nullable: false, identity: true),
|
||||
ProdId = c.Int(nullable: false),
|
||||
Prod_Description = c.String(unicode: false),
|
||||
Prod_Lock = c.Boolean(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => t.ProdDbId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.PartList",
|
||||
c => new
|
||||
{
|
||||
PartDbId = c.Int(nullable: false, identity: true),
|
||||
PartId = c.Int(nullable: false),
|
||||
Part_PDN = c.Int(nullable: false),
|
||||
Part_NAM = c.String(unicode: false),
|
||||
Part_W = c.Double(nullable: false),
|
||||
Part_L = c.Double(nullable: false),
|
||||
Part_H = c.Double(nullable: false),
|
||||
Part_MAT = c.String(unicode: false),
|
||||
Part_ROT = c.Int(nullable: false),
|
||||
Part_GRP = c.String(unicode: false),
|
||||
Part_State = c.Int(nullable: false),
|
||||
BTLPartDbId = c.Int(nullable: false),
|
||||
RawPartDbId = c.Int(),
|
||||
})
|
||||
.PrimaryKey(t => t.PartDbId)
|
||||
.ForeignKey("dbo.BTLPartList", t => t.BTLPartDbId, cascadeDelete: true)
|
||||
.ForeignKey("dbo.RawPartList", t => t.RawPartDbId)
|
||||
.Index(t => t.BTLPartDbId)
|
||||
.Index(t => t.RawPartDbId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.RawPartList",
|
||||
c => new
|
||||
{
|
||||
RawPartDbId = c.Int(nullable: false, identity: true),
|
||||
RawPartId = c.Int(nullable: false),
|
||||
RawPart_Descript = c.String(unicode: false),
|
||||
RawPart_Lock = c.Boolean(nullable: false),
|
||||
ProdDbId = c.Int(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => t.RawPartDbId)
|
||||
.ForeignKey("dbo.ProdList", t => t.ProdDbId, cascadeDelete: true)
|
||||
.Index(t => t.ProdDbId);
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropForeignKey("dbo.PartList", "RawPartDbId", "dbo.RawPartList");
|
||||
DropForeignKey("dbo.RawPartList", "ProdDbId", "dbo.ProdList");
|
||||
DropForeignKey("dbo.PartList", "BTLPartDbId", "dbo.BTLPartList");
|
||||
DropForeignKey("dbo.BTLPartList", "ProjDbId", "dbo.ProjList");
|
||||
DropForeignKey("dbo.ProjList", "ProdDbId", "dbo.ProdList");
|
||||
DropIndex("dbo.PartList", new[] { "RawPartDbId" });
|
||||
DropIndex("dbo.RawPartList", new[] { "ProdDbId" });
|
||||
DropIndex("dbo.PartList", new[] { "BTLPartDbId" });
|
||||
DropIndex("dbo.BTLPartList", new[] { "ProjDbId" });
|
||||
DropIndex("dbo.ProjList", new[] { "ProdDbId" });
|
||||
DropTable("dbo.RawPartList");
|
||||
DropTable("dbo.PartList");
|
||||
DropTable("dbo.ProdList");
|
||||
DropTable("dbo.ProjList");
|
||||
DropTable("dbo.BTLPartList");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>H4sIAAAAAAAEAO1czW7jNhC+F+g7CDoWqJ3sYoF2Ye/CsZNNUDsJ4mRzDBiRdtTVjyvRafJsPfSR+gqlZEkWxR+RIp3Ei73FIvlxODPifBxx8t8//w4+P4WB84iS1I+joXvYO3AdFHkx9KPl0F3jxa+/uZ8//fzT4BiGT87Xst/7rB8ZGaVD9wHj1cd+P/UeUAjSXuh7SZzGC9zz4rAPYNx/d3Dwe//wsI8IhEuwHGdwtY6wH6L8B/k5jiMPrfAaBLMYoiAtnpOWeY7qnIMQpSvgoaF7vMRHx6PZ7Wg67U0ABlPwjBLXGQU+IMLMUbBwHRBFMQaYiPrxJkVznMTRcr4iD0Bw/bxCpN8CBCkqlvBx2111NQfvstX0twM7acOt1klWekw0gp8z8fLVDt2j6+klSHCukXpP0vcP9Ew9II8uk3iFEvx8hRbF+Gzw5P4Muk6fHt1vDq8GMyMzcYbuWYTfv3Od83UQgPsAVdqrqXmO4wR9QRFKAEbwEmCMEqLNM4jyZTEycGZsn68FY3JuBjC5KMcfxXGAQKSNcD6alRDE6cgr5Doz8DRF0RI/DF3yp+uc+E8Ilk8K0JvIJ28cGYSTdesct+UMk3hNJNOWcWo4/tRw/Gx0vXMdjc+vzVzh+ujS1JcMnfHqwnAJX64ud67nG1M9z8n2gQxf+yT+U2WzaqCcg0d/me9dHDzkYde5QkHenj74q01g6dW35Luq40kSh1dx0Niyy/a7ebxOvGyRsaTTNUiWCNNSDvrbmCCNFBlI9zBR6U87TChq3mKYIDOahgmi/hM/QNmPnb8f5CfkaEjDFSHXDyuD3226bD2QbmF8r9Fs6nXQxOtgZ6/j6XS3XgdNvW6CUi/xVxuquGOvm8beNwT1uIy61X9Q0hekpD8I5dsglHvBxiyQqYKbdOBTTYWBvwVAqsGvEIUf/yr+VPWqhcBmIxsFmR68QCgTrlhei3BVL55wRaNEuLKHUZQuQDpv2ZQhdXdtsRfscOMuJv3eI3Z3ZmRMP+s+xTBQppHxcLaHjoeP0jT2/Fyk5vFnIwu9uuMIOnJqvDEtRauJidcB9leB7xEJhu4vjNKEsOVSaFjIhT3o9Q4ZZPLqoSTzdBCMidZxAvwIs++pH3n+CgRSIRqjtIh4ZoBqlmbLBK1QlL2OUtWaTl/N0th12jQ06Nd8RO463AO9yNLy0/3W3lTiVsOTpIkBFTc9bKp8cBFNUIAwckbeJr09BqkHILsJkJcNWvBD2RIU3YGbjNDyRpmdTIV4AZ9kyY1w6xEznZq3dHFFMUNS9PPXd0XhEpRcQEB59HZFkXlUJKCY+Kv4IRvlRd4iCflbb6GIqIYritmCSoh9fT8Uyv9i0Vlonj0I0Oxhqn3LYk5W1jbD5olM0b0t8jyRKCqmlBzlOu5rDU1bEMK6S20OEWQMJiNQUh7uAAb3IEXZc/TEOlU2Zo4wvRdP/ZTYfHsq4YZBxotoqIxbCHBqtK4dBIpBoCKIeEXqyymsKcCh34kGVM1etHrqx8paJ/6nj6YDtR73qhXUbcH4YevxjoaBPBjKJUlPheXzvy+ySmg/tqgfXGorofxcohPpQUVBwR00w8n4cXxDzpwVuXN9ASraEHNlNdV20AYnAcNqo4W/KTK42hqol12iEDFj281bw0m4ynyDSyQUqUR332hSBzW9SrRR5seq0Fa1DfqbW3PFg0FfcL1uMAOrlR8ta9ftiifOfHPXbvzrXP9iW7jB6Hsp535bJW01E44TsESNVjI1kfTET1JchmrXGcOQ6aYYyMvZ2HjO2q4MYuWY7O/NOO7VQzr+sxSogDkhqwwzDpVnt9mdQTDcya5AggAkwu+h4zhYh5HCoVEOJoDSBMq+d3JQ7vIGdZzsJh4PJnuujpJ/POXB5A3qOLd8lFsdjCkfY6qDccrHONXByD+W8lDyBnWc/IYdDydvUMfJL9rxcPIGHY8ReF7eoI6Tf+jl4eQN6jj5914eTt6gjnMj0vONnp6Lb8M8pKJJ4y2v8qN1OHHWNAtBjV2QOfcx2y6Ti6F3cqV9vuKf5pv89nCmv8NLxtpTsQyJh6OHQl2aa0LdUa1aokHuIgUJp9f0I2jPj3iX5lT9SDTWnoplSDwcPRTqo3oT6o5q1YitxddzBi9reEtuZI9zmhBOa2zTFtW0wDO7kEyGHlrghsbE0JgVWqCEXfggw5uskKYujInDdLrRHOowZeGURWW+63jSlPir7Vb1rIT5hiW+hpYDtu1Z8uG2Nd6CJ0CzFAnLRFHZwTQSlniiYLgn7IxJdzW7VLNXaa9GemtQpJraS0yZ3NOmi+uQ1T/6MMs7zZ7nfwW5f/fyP8eBTxa87TEDkb9AKb6Ov6Fo6H7ofWiUqHYoF+2nKQw4OTWLNaOSra39tifn8rCf6aT1Pme3S8qNWbqB3NWu6JvAbGtH7+M46AxTu+8fxNEyT2nWsFTuktbSUxsg2O1afS1FZQXn1BJO7bq/qYpqZaImtq8Vi5q5kBVPrJUqmMDUChZM1XxjR81UeUMXoG36RBVj3yowd7LdltkiM8XTSSIzx9qSEK5MLMS+1TTuyo7Q2I6NJI25HQteqhw7961QcTemNKY/NriPLcZiha5Y4SpWiIotlmIjmtsK5XYCsOiAYF5baC8CvLV6uZ3sH0yJnIEZaokKMx+jExUGh6kWeqARVExqzcprmJ0LwTh3ELtWq3WtKRN+qlInP06nOrJ9uJquVTumaUKrZQv8i5sGJWtmJYqvUwj2fVV+dTLkjpyKL8iu3Unbti0FVfrVD99dGZdm0NqRO9FFA50LyPYl5LV8GHtzUa/lHrWpIduY0KvsNdo2sl5ptUelVezF7aYxucVVhf1aqqs2H+LI0fw+Jh6w4fOy0gpe+ZVoplobb5pLUTELrzpLMgeUz8EviuAVbwnnkKtLWVf0a9pS3MWbSVbX8ALVX7QRGjfolEq+mGImfiXbm6nz0hRcwihF9QlvsJCrk+CioMK9JvcG67VM3Jv3XrOXbN5gWVYnwXdkaY3qK/baCYm5tf9/TqJ+6i+3ENl/Q4+QR0Xbqs9ZtIjLyN+QqOzSyIbNEAaQhOJRgv0F8DBp9lCa5v/I6isI1qTLcXiP4Fl0scarNSZLRuF9QP2brYw8yObPS8xomQcX+Sei1MYSiJg+WQK6iI7WfgAruU84mTwBRMZKigRqZkucJVKXzxXSeRwpAhXqq8jUNQpXAQFLL6I5eERi2dp1SGtsMPHBMgFhWmBsx5OfxP1g+PTpf0/YPpzBXwAA</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,31 @@
|
||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Linq;
|
||||
|
||||
internal sealed class Configuration : DbMigrationsConfiguration<EgtBEAMWALL.DataLayer.DatabaseContext>
|
||||
{
|
||||
public Configuration()
|
||||
{
|
||||
AutomaticMigrationsEnabled = false;
|
||||
}
|
||||
|
||||
protected override void Seed(EgtBEAMWALL.DataLayer.DatabaseContext context)
|
||||
{
|
||||
// This method will be called after migrating to the latest version.
|
||||
|
||||
// You can use the DbSet<T>.AddOrUpdate() helper extension method
|
||||
// to avoid creating duplicate seed data. E.g.
|
||||
//
|
||||
// context.People.AddOrUpdate(
|
||||
// p => p.FullName,
|
||||
// new Person { FullName = "Andrew Peters" },
|
||||
// new Person { FullName = "Brice Lambson" },
|
||||
// new Person { FullName = "Rowan Miller" }
|
||||
// );
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EgtBEAMWALL.DataLayer")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgtBEAMWALL.DataLayer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("24d7760e-662a-47e4-b729-b70126c24a31")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.2.12.1")]
|
||||
[assembly: AssemblyFileVersion("2.2.12.1")]
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.0.0" targetFramework="net40" />
|
||||
<package id="MySql.Data" version="6.9.12" targetFramework="net40" />
|
||||
<package id="MySql.Data.Entity" version="6.9.12" targetFramework="net40" />
|
||||
</packages>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework"
|
||||
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
requirePermission="false"/>
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<!--<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />-->
|
||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6"/>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
|
||||
|
||||
<provider invariantName="MySql.Data.MySqlClient"
|
||||
type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||
</provider></providers>
|
||||
</entityFramework>
|
||||
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.10.9.0" newVersion="6.10.9.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EgtBEAMWALL.DbDataLayer
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
|
||||
// Database config
|
||||
public const string DATABASE_SERV = "127.0.0.1";
|
||||
public const string DATABASE_NAME = "EgtBwDb";
|
||||
public const string DATABASE_USER = "root";
|
||||
public const string DATABASE_PWD = "viacremasca";
|
||||
public static int DATABASE_PROCESS_TIMEOUT = 5;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DbDataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DbDataLayer.Controllers
|
||||
{
|
||||
public class BTLPartController : IDisposable
|
||||
{
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
public BTLPartController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by Id
|
||||
/// </summary>
|
||||
/// <param name="PartDbId"></param>
|
||||
/// <returns></returns>
|
||||
public BTLPartModel FindByDbId(int PartDbId)
|
||||
{
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by ExtId
|
||||
/// </summary>
|
||||
/// <param name="PartId"></param>
|
||||
/// <returns></returns>
|
||||
public BTLPartModel FindByPartId(int PartId)
|
||||
{
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartId == PartId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="PartDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetPaginatedAsc(int PartDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = PartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartDbId <= PartDbIdStart)
|
||||
.OrderBy(x => x.PartDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="PartDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = PartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartDbId <= PartDbIdStart)
|
||||
.OrderByDescending(x => x.PartDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by ProjectId (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProjDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetByProjectAsc(int ProjDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == ProjDbId)
|
||||
.OrderBy(x => x.PartDbId)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by ProjectId (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProjDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetByProjectDesc(int ProjDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == ProjDbId)
|
||||
.OrderByDescending(x => x.PartDbId)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create multiple (empty) Part record associated to Project
|
||||
/// </summary>
|
||||
/// <param name="ProjDbId"></param>
|
||||
/// <param name="rawListData"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> CreateBaseObj(int ProjDbId, List<int> rawListData)
|
||||
{
|
||||
List<BTLPartModel> partData = new List<BTLPartModel>();
|
||||
|
||||
foreach (var item in rawListData)
|
||||
{
|
||||
BTLPartModel newItem = new BTLPartModel() { ProjDbId = ProjDbId, PartId = item };
|
||||
partData.Add(newItem);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.AddRange(partData);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
return partData;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create multipole Part record associated to Project
|
||||
/// </summary>
|
||||
/// <param name="ProjID"></param>
|
||||
/// <param name="partData"></param>
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> Create(int ProjID, List<BTLPartModel> partData)
|
||||
{
|
||||
// se è adv mode --> uso TUTTI i dati
|
||||
if (DbManager.AdvDataModel)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.AddRange(partData);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return partData;
|
||||
}
|
||||
// se non adv --> faccio solo copia degli id...
|
||||
else
|
||||
{
|
||||
List<int> partIdList = new List<int>();
|
||||
foreach (var item in partData)
|
||||
{
|
||||
partIdList.Add(item.PartId);
|
||||
}
|
||||
return CreateBaseObj(ProjID, partIdList);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete single Part
|
||||
/// </summary>
|
||||
/// <param name="updItem"></param>
|
||||
/// <returns></returns>
|
||||
public bool Update(BTLPartModel updItem)
|
||||
{
|
||||
bool done = false;
|
||||
var item2del = dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartDbId == updItem.PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
dbCtx.Entry(item2del).CurrentValues.SetValues(updItem);
|
||||
|
||||
//// update, vers 2
|
||||
//dbCtx.BTLPartList.Remove(item2del);
|
||||
//dbCtx.BTLPartList.Add(updItem);
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete single Part
|
||||
/// </summary>
|
||||
/// <param name="PartDbId"></param>
|
||||
/// <returns></returns>
|
||||
public bool Delete(int PartDbId)
|
||||
{
|
||||
bool done = false;
|
||||
var item2del = dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.Remove(item2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return done;
|
||||
}
|
||||
/// <summary>
|
||||
/// Delete Part by project
|
||||
/// </summary>
|
||||
/// <param name="ProjDbId"></param>
|
||||
/// <returns></returns>
|
||||
public bool DeleteByProject(int ProjDbId)
|
||||
{
|
||||
bool done = false;
|
||||
var items2del = dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == ProjDbId);
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.RemoveRange(items2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// COnversion of base class to DB model class
|
||||
/// </summary>
|
||||
/// <param name="corePart"></param>
|
||||
/// <returns></returns>
|
||||
public BTLPartModel Convert(Core.BTLPart corePart)
|
||||
{
|
||||
BTLPartModel answ = new BTLPartModel();
|
||||
if (corePart != null)
|
||||
{
|
||||
answ = new BTLPartModel()
|
||||
{
|
||||
PartId = corePart.nPartId,
|
||||
PDN = corePart.nPDN,
|
||||
DO = corePart.bDO,
|
||||
NAM = corePart.sNAM,
|
||||
W = corePart.dW,
|
||||
L = corePart.dL,
|
||||
H = corePart.dH,
|
||||
MAT = corePart.sMATERIAL,
|
||||
CNT = corePart.nCNT,
|
||||
TBP = corePart.nTBP,
|
||||
DON = corePart.nDON,
|
||||
ROT = corePart.nROT,
|
||||
GRP = corePart.sGRP,
|
||||
UNT = corePart.nUNT,
|
||||
State = (int)corePart.nState
|
||||
};
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DbDataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DbDataLayer.Controllers
|
||||
{
|
||||
public class ProjController : IDisposable
|
||||
{
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
public ProjController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by ProjDbId
|
||||
/// </summary>
|
||||
/// <param name="ProjDbId"></param>
|
||||
/// <returns></returns>
|
||||
public ProjModel FindByProjDbId(int ProjDbId)
|
||||
{
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjDbId == ProjDbId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get record by ProjId
|
||||
/// </summary>
|
||||
/// <param name="ProjId"></param>
|
||||
/// <returns></returns>
|
||||
public ProjModel FindByProjId(int ProjId)
|
||||
{
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjId == ProjId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProjDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProjModel> GetPaginatedAsc(int ProjDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = ProjDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjDbId <= ProjDbIdStart)
|
||||
.OrderBy(x => x.ProjDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="PartDbIdStart"></param>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProjModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
|
||||
{
|
||||
int numEnd = PartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjDbId <= PartDbIdStart)
|
||||
.OrderByDescending(x => x.ProjDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by ProjectId (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProdDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProjModel> GetByProdAsc(int ProdDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProdDbId == ProdDbId)
|
||||
.OrderBy(x => x.ProdDbId)
|
||||
.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get filtered data by ProjectId (DESC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProdDbId"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProjModel> GetByProdDesc(int ProdDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProdDbId == ProdDbId)
|
||||
.OrderByDescending(x => x.ProdDbId)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create record on DB
|
||||
/// </summary>
|
||||
/// <param name="newProjId"></param>
|
||||
/// <param name="newBTLFileName"></param>
|
||||
/// <returns></returns>
|
||||
public ProjModel Create(int newProjId, string newBTLFileName)
|
||||
{
|
||||
ProjModel newProj = new ProjModel() { ProjId=newProjId, BTLFileName=newBTLFileName };
|
||||
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.ProjList.Add(newProj);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
return newProj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Migrations;
|
||||
using MySql.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DbDataLayer.DatabaseModels;
|
||||
using EgtBEAMWALL.DbDataLayer.Migrations;
|
||||
using System.ServiceProcess;
|
||||
//using EgtBEAMWALL.DataLayer.Migrations;
|
||||
//using EgtBEAMWALL.DataLayer.Controllers;
|
||||
|
||||
namespace EgtBEAMWALL.DbDataLayer
|
||||
{
|
||||
|
||||
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
||||
public class DatabaseContext : DbContext
|
||||
{
|
||||
/// <summary>
|
||||
/// BTLParts management
|
||||
/// </summary>
|
||||
public DbSet<BTLPartModel> BTLPartList { get; set; }
|
||||
/// <summary>
|
||||
/// Parts management
|
||||
/// </summary>
|
||||
public DbSet<ProdModel> ProdList { get; set; }
|
||||
/// <summary>
|
||||
/// Parts management
|
||||
/// </summary>
|
||||
public DbSet<ProjModel> ProjList { get; set; }
|
||||
/// <summary>
|
||||
/// Parts management
|
||||
/// </summary>
|
||||
public DbSet<RawPartModel> RawPartList { get; set; }
|
||||
/// <summary>
|
||||
/// Parts management
|
||||
/// </summary>
|
||||
public DbSet<PartModel> PartList { get; set; }
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Db data mode
|
||||
/// </summary>
|
||||
public static bool AdvDataModel { get; set; } = false;
|
||||
#endif
|
||||
|
||||
//providerName="System.Data.EntityClient"
|
||||
|
||||
|
||||
public static string CONNECTION_STRING = $"server={Constants.DATABASE_SERV};port=3306;database={Constants.DATABASE_NAME};uid={Constants.DATABASE_USER};pwd={Constants.DATABASE_PWD};";
|
||||
|
||||
public DatabaseContext() : base(CONNECTION_STRING)
|
||||
{
|
||||
}
|
||||
|
||||
public static DatabaseContext Create()
|
||||
{
|
||||
return new DatabaseContext();
|
||||
}
|
||||
|
||||
private static string getDbServiceName()
|
||||
{
|
||||
ServiceController[] services = ServiceController.GetServices();
|
||||
var service = services.FirstOrDefault(s => s.ServiceName == "MariaDB");
|
||||
if (service != null)
|
||||
return service.DisplayName;
|
||||
|
||||
service = services.FirstOrDefault(s => s.ServiceName == "MySQL");
|
||||
if (service != null)
|
||||
return service.DisplayName;
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
public static bool SetUpDbConnectionAndDbConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
String serviceName = getDbServiceName();
|
||||
if (serviceName.Equals(""))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
ServiceController service = new ServiceController(serviceName);
|
||||
try
|
||||
{
|
||||
TimeSpan timeout = TimeSpan.FromSeconds(Constants.DATABASE_PROCESS_TIMEOUT);
|
||||
service.WaitForStatus(ServiceControllerStatus.Running, timeout);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
System.Data.Entity.Database.SetInitializer<DatabaseContext>(null);
|
||||
var migrator = new DbMigrator(new Configuration());
|
||||
|
||||
if (migrator.GetPendingMigrations().Any())
|
||||
{
|
||||
// Run migrations and seed.
|
||||
migrator.Update();
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EgtBEAMWALL.DbDataLayer.DatabaseModels
|
||||
{
|
||||
[Table("BTLPartList")]
|
||||
public class BTLPartModel
|
||||
{
|
||||
[Key, Column("BTLPartDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int PartDbId { get; set; }
|
||||
|
||||
[Column("BTLPartId")]
|
||||
public int PartId { get; set; }
|
||||
|
||||
[Column("BTLPart_PDN")]
|
||||
public int PDN { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_DO")]
|
||||
public bool DO { get; set; } = false;
|
||||
|
||||
[Column("BTLPart_NAM")]
|
||||
public string NAM { get; set; } = "";
|
||||
|
||||
[Column("BTLPart_W")]
|
||||
public double W { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_L")]
|
||||
public double L { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_H")]
|
||||
public double H { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_MAT")]
|
||||
public string MAT { get; set; } = "";
|
||||
|
||||
[Column("BTLPart_CNT")]
|
||||
public int CNT { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_TBP")]
|
||||
public int TBP { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_DON")]
|
||||
public int DON { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_ROT")]
|
||||
public int ROT { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_GRP")]
|
||||
public string GRP { get; set; } = "";
|
||||
|
||||
[Column("BTLPart_UNT")]
|
||||
public int UNT { get; set; } = 0;
|
||||
|
||||
[Column("BTLPart_State")]
|
||||
public int State { get; set; } = -1;
|
||||
|
||||
[Column("ProjDbId")]
|
||||
public int ProjDbId { get; set; }
|
||||
|
||||
[ForeignKey("ProjDbId")]
|
||||
public ProjModel Project { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EgtBEAMWALL.DbDataLayer.DatabaseModels
|
||||
{
|
||||
[Table("PartList")]
|
||||
public class PartModel
|
||||
{
|
||||
[Key, Column("PartDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int PartDbId { get; set; }
|
||||
|
||||
[Column("PartId")]
|
||||
public int PartId { get; set; }
|
||||
|
||||
[Column("Part_PDN")]
|
||||
public int PDN { get; set; } = 0;
|
||||
|
||||
[Column("Part_NAM")]
|
||||
public string NAM { get; set; } = "";
|
||||
|
||||
[Column("Part_W")]
|
||||
public double W { get; set; } = 0;
|
||||
|
||||
[Column("Part_L")]
|
||||
public double L { get; set; } = 0;
|
||||
|
||||
[Column("Part_H")]
|
||||
public double H { get; set; } = 0;
|
||||
|
||||
[Column("Part_MAT")]
|
||||
public string MAT { get; set; } = "";
|
||||
|
||||
[Column("Part_ROT")]
|
||||
public int ROT { get; set; } = 0;
|
||||
|
||||
[Column("Part_GRP")]
|
||||
public string GRP { get; set; } = "";
|
||||
|
||||
[Column("Part_State")]
|
||||
public int State { get; set; } = -1;
|
||||
|
||||
[Column("BTLPartDbId")]
|
||||
public int BTLPartDbId { get; set; }
|
||||
|
||||
[ForeignKey("BTLPartDbId")]
|
||||
public BTLPartModel BTLPart { get; set; }
|
||||
|
||||
[Column("RawPartDbId")]
|
||||
public int? RawPartDbId { get; set; }
|
||||
|
||||
[ForeignKey("RawPartDbId")]
|
||||
public virtual RawPartModel RawPart { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EgtBEAMWALL.DbDataLayer.DatabaseModels
|
||||
{
|
||||
[Table("ProdList")]
|
||||
public class ProdModel
|
||||
{
|
||||
[Key, Column("ProdDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int ProdDbId { get; set; }
|
||||
|
||||
[Column("ProdId")]
|
||||
public int ProdId { get; set; }
|
||||
|
||||
[Column("Prod_Description")]
|
||||
public string Description { get; set; } = "";
|
||||
|
||||
[Column("Prod_Lock")]
|
||||
public bool Locked { get; set; } = false;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EgtBEAMWALL.DbDataLayer.DatabaseModels
|
||||
{
|
||||
[Table("ProjList")]
|
||||
public class ProjModel
|
||||
{
|
||||
[Key, Column("ProjDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int ProjDbId { get; set; }
|
||||
|
||||
[Column("ProjId")]
|
||||
public int ProjId { get; set; }
|
||||
|
||||
[Column("Proj_BTLFileName")]
|
||||
public string BTLFileName { get; set; } = "";
|
||||
|
||||
[Column("ProdDbId")]
|
||||
public int? ProdDbId { get; set; }
|
||||
|
||||
[ForeignKey("ProdDbId")]
|
||||
public virtual ProdModel Prod { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EgtBEAMWALL.DbDataLayer.DatabaseModels
|
||||
{
|
||||
[Table("RawPartList")]
|
||||
public class RawPartModel
|
||||
{
|
||||
[Key, Column("RawPartDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int RawPartDbId { get; set; }
|
||||
|
||||
[Column("RawPartId")]
|
||||
public int RawPartId { get; set; }
|
||||
|
||||
[Column("RawPart_Descript")]
|
||||
public string Description { get; set; } = "";
|
||||
|
||||
[Column("RawPart_Lock")]
|
||||
public bool Locked { get; set; } = false;
|
||||
|
||||
[Column("ProdDbId")]
|
||||
public int ProdDbId { get; set; }
|
||||
|
||||
[ForeignKey("ProdDbId")]
|
||||
public ProdModel Prod { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EgtBEAMWALL.DbDataLayer
|
||||
{
|
||||
public class DbManager
|
||||
{
|
||||
public static bool AdvDataModel { get; set; } = false;
|
||||
|
||||
public DbManager()
|
||||
{
|
||||
}
|
||||
|
||||
public Controllers.ProjController ProjCtr = new Controllers.ProjController();
|
||||
public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{5F1CDE84-FD6A-4107-968C-ECC4D64F8043}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>EgtBEAMWALL.DbDataLayer</RootNamespace>
|
||||
<AssemblyName>EgtBEAMWALL.DbDataLayer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.6.10.9\lib\net452\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.Entity.6.10.9\lib\net452\MySql.Data.Entity.EF6.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Configuration.Install" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Drawing.Design" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Constants.cs" />
|
||||
<Compile Include="Controllers\BTLPartController.cs" />
|
||||
<Compile Include="Controllers\ProjController.cs" />
|
||||
<Compile Include="DatabaseContext.cs" />
|
||||
<Compile Include="DatabaseModels\BTLPartModel.cs" />
|
||||
<Compile Include="DatabaseModels\PartModel.cs" />
|
||||
<Compile Include="DatabaseModels\ProdModel.cs" />
|
||||
<Compile Include="DatabaseModels\ProjModel.cs" />
|
||||
<Compile Include="DatabaseModels\RawPartModel.cs" />
|
||||
<Compile Include="DbManager.cs" />
|
||||
<Compile Include="Migrations\202103031756343_InitDb.cs" />
|
||||
<Compile Include="Migrations\202103031756343_InitDb.designer.cs">
|
||||
<DependentUpon>202103031756343_InitDb.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgtBEAMWALL.Core\EgtBEAMWALL.Core.vbproj">
|
||||
<Project>{f22835a1-83d8-4334-91bb-baaeb9cf59b1}</Project>
|
||||
<Name>EgtBEAMWALL.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Migrations\202103031756343_InitDb.resx">
|
||||
<DependentUpon>202103031756343_InitDb.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||
</Project>
|
||||
@@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace EgtBEAMWALL.DbDataLayer.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||
public sealed partial class InitDb : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(InitDb));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "202103031756343_InitDb"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
namespace EgtBEAMWALL.DbDataLayer.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class InitDb : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.BTLPartList",
|
||||
c => new
|
||||
{
|
||||
BTLPartDbId = c.Int(nullable: false, identity: true),
|
||||
BTLPartId = c.Int(nullable: false),
|
||||
BTLPart_PDN = c.Int(nullable: false),
|
||||
BTLPart_DO = c.Boolean(nullable: false),
|
||||
BTLPart_NAM = c.String(unicode: false),
|
||||
BTLPart_W = c.Double(nullable: false),
|
||||
BTLPart_L = c.Double(nullable: false),
|
||||
BTLPart_H = c.Double(nullable: false),
|
||||
BTLPart_MAT = c.String(unicode: false),
|
||||
BTLPart_CNT = c.Int(nullable: false),
|
||||
BTLPart_TBP = c.Int(nullable: false),
|
||||
BTLPart_DON = c.Int(nullable: false),
|
||||
BTLPart_ROT = c.Int(nullable: false),
|
||||
BTLPart_GRP = c.String(unicode: false),
|
||||
BTLPart_UNT = c.Int(nullable: false),
|
||||
BTLPart_State = c.Int(nullable: false),
|
||||
ProjDbId = c.Int(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => t.BTLPartDbId)
|
||||
.ForeignKey("dbo.ProjList", t => t.ProjDbId, cascadeDelete: true)
|
||||
.Index(t => t.ProjDbId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.ProjList",
|
||||
c => new
|
||||
{
|
||||
ProjDbId = c.Int(nullable: false, identity: true),
|
||||
ProjId = c.Int(nullable: false),
|
||||
Proj_BTLFileName = c.String(unicode: false),
|
||||
ProdDbId = c.Int(),
|
||||
})
|
||||
.PrimaryKey(t => t.ProjDbId)
|
||||
.ForeignKey("dbo.ProdList", t => t.ProdDbId)
|
||||
.Index(t => t.ProdDbId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.ProdList",
|
||||
c => new
|
||||
{
|
||||
ProdDbId = c.Int(nullable: false, identity: true),
|
||||
ProdId = c.Int(nullable: false),
|
||||
Prod_Description = c.String(unicode: false),
|
||||
Prod_Lock = c.Boolean(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => t.ProdDbId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.PartList",
|
||||
c => new
|
||||
{
|
||||
PartDbId = c.Int(nullable: false, identity: true),
|
||||
PartId = c.Int(nullable: false),
|
||||
Part_PDN = c.Int(nullable: false),
|
||||
Part_NAM = c.String(unicode: false),
|
||||
Part_W = c.Double(nullable: false),
|
||||
Part_L = c.Double(nullable: false),
|
||||
Part_H = c.Double(nullable: false),
|
||||
Part_MAT = c.String(unicode: false),
|
||||
Part_ROT = c.Int(nullable: false),
|
||||
Part_GRP = c.String(unicode: false),
|
||||
Part_State = c.Int(nullable: false),
|
||||
BTLPartDbId = c.Int(nullable: false),
|
||||
RawPartDbId = c.Int(),
|
||||
})
|
||||
.PrimaryKey(t => t.PartDbId)
|
||||
.ForeignKey("dbo.BTLPartList", t => t.BTLPartDbId, cascadeDelete: true)
|
||||
.ForeignKey("dbo.RawPartList", t => t.RawPartDbId)
|
||||
.Index(t => t.BTLPartDbId)
|
||||
.Index(t => t.RawPartDbId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.RawPartList",
|
||||
c => new
|
||||
{
|
||||
RawPartDbId = c.Int(nullable: false, identity: true),
|
||||
RawPartId = c.Int(nullable: false),
|
||||
RawPart_Descript = c.String(unicode: false),
|
||||
RawPart_Lock = c.Boolean(nullable: false),
|
||||
ProdDbId = c.Int(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => t.RawPartDbId)
|
||||
.ForeignKey("dbo.ProdList", t => t.ProdDbId, cascadeDelete: true)
|
||||
.Index(t => t.ProdDbId);
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropForeignKey("dbo.PartList", "RawPartDbId", "dbo.RawPartList");
|
||||
DropForeignKey("dbo.RawPartList", "ProdDbId", "dbo.ProdList");
|
||||
DropForeignKey("dbo.PartList", "BTLPartDbId", "dbo.BTLPartList");
|
||||
DropForeignKey("dbo.BTLPartList", "ProjDbId", "dbo.ProjList");
|
||||
DropForeignKey("dbo.ProjList", "ProdDbId", "dbo.ProdList");
|
||||
DropIndex("dbo.RawPartList", new[] { "ProdDbId" });
|
||||
DropIndex("dbo.PartList", new[] { "RawPartDbId" });
|
||||
DropIndex("dbo.PartList", new[] { "BTLPartDbId" });
|
||||
DropIndex("dbo.ProjList", new[] { "ProdDbId" });
|
||||
DropIndex("dbo.BTLPartList", new[] { "ProjDbId" });
|
||||
DropTable("dbo.RawPartList");
|
||||
DropTable("dbo.PartList");
|
||||
DropTable("dbo.ProdList");
|
||||
DropTable("dbo.ProjList");
|
||||
DropTable("dbo.BTLPartList");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>H4sIAAAAAAAEAO1d224juRF9D5B/aPRjMCvZM1ggMaRd2JK9Y0SyDcveyZtBN2lNZ/uidFMTG0G+LA/5pPxC2FeRzUuTTcqWB4t5kUTykCwWWaeKLM///vPfyc/PceR9Q1kepsnUPx4d+R5KghSGyXrqb/HTD3/2f/7pj3+YnMP42fu1qfepqEdaJvnU/4rx5mQ8zoOvKAb5KA6DLM3TJzwK0ngMYDr+eHT0l/Hx8RgRCJ9ged7kdpvgMEblF/J1liYB2uAtiJYpRFFe/05KViWqdwVilG9AgKb++RqfnZ8uv5wuFqP54xxgsAAvKPO90ygEZDgrFD35HkiSFANMBntyn6MVztJkvdqQH0B097JBpN4TiHJUT+JkV113Pkcfi/mMdw0bqGCb4zQ2BDz+VAto3G0+SMx+K0AiwnMiavxSzLoU49Q/u1vcgAyXova9bocnsygrKkslPSo+PYIcVWs1ouE+eJJGH1rdISpW/PvgzbYR3mZomqAtzgBperN9jMLgr+jlLv0NJdNkG0X0RMhUSBnzA/npJks3KMMvt+ipnl4xmPnjJfS9Mdt63G3eNuZaVgK4TPCnj753RQYCHiPU6gwlrBVOM/QLSlAGMII3AGOUkSW/hKiUOjcGQY/9/fVgzK/sAObXTfuzNI0QSIwRrk6XDQTZauTo8L0leF6gZI2/Tn3y0fcuwmcEm19q0PskJCcNaYSzbW8fX5oe5inRE2Q8xoVl+8+W7Zend3uX0ezqzk4V7s5ubHXJUhlvry2n8Mvtzd7lfG8r5xU5PpDlts/Sv+scVh2UK/AtXJdnlwAPBdj3blFUludfw01lTpkj/qGteJGl8W0adSxKU/6wSrdZUEwyVVS6A9kaYXaUk/HOZCkNWQHiyoq1WAdhwtq1NTZhmlrh0ISRHm1NGFGNizBCxZe9713yFQokZLBNoHCPtAr0UFXZ7Q62hNsXnWLbHQEd7gh4SDsCDt4RovXe746AtjtijvIgCzeVB7DnHbFIg98QNOOA+hrp0NP43c14z27G707CYTgJ74JhOyDINd8cwJG7AgP/lADpkoZ6KGLe0HLithZFHbqFPHvgaogIhGpw9fR6BtfWEg2uLlQMrqlhxW5qEFfmhIY7BIvC6JmpUZEr6R7tSt3p9052hpNKa6+C1lHOseAKuQ3I1zDZgKd5ngZhOaSux12NhZ3deQI9tcdTLS3jLZElJtsp3JANREYw9f/ECU0K20yFhYVC2KPR6JhDJlsPZYWmg2hGpE42c5hgfp+GSRBuQKQcRKeVkQ9TLEDbS7dkjjYoKbajUrS23be9dE6dPglNxpSOqFVHGEOSrbQ6oLRbb/YqQ1+TlLEoHTU97op8cp3MUYQw8k6D6tpnBvIAQP4QIJsNOtBD1RQ01UEYYzLSRtU62Q7iFXSS517So0dOxChtGaKKcgKnqedvr4rSKWipgITymJ2KsuXRGQHjKLyJHvJWXqYtCpO/0xaWJ+uropwt6JjYt9dD6fhfzTpLl+cdGGje1+s/sjjHz9lh2HUYNdXbIc+TDUVnKRWu3MBzrSNpB4NwrlKVE0HaYNICZY1zVzvdxe/oGQv89ntSWLnuee3DddWjwF0hzJ7XizAnaDvPRWgqOU1joQr+IcGhqF8/CJSDQE0Q+Yz0p1OvuASH3TcdKGpNWfHQridVSXzr1VWyXpewnQG9Fpyu9rqALAwUwTBqS2pqTF987c0Lod+10XduqJkweq6QidKZ0RDwAMkIgpYC3VCza01+TU9ARxpyPq0n2gHSEARpeGn0cDxNlkfNgdnsCoHIWd1+do0gZqzSDSHZ0KQbw3WjSy/05KqQRhNDa81fWzYZV49Y6x8mY8lr18kSbDZhsqZev9a/eKvq6evsh5X5c9C4whgHueBVaDvatiecZmCNOqWkazLSizDLcWPOfW8GY65a19hLzFXTG2/P+bVrjFjTpvhctZOF+RkGwBOlGuiCzDMumFYZA+fPBklzr3iTDCKQSS91Z2m0jRMN11INJoEyBCoubQUoD2WBPk7xRFQEU/yuj1LeAItgygJ9nC9ilC8mGAsxxsIE47MY47MJRnnjK0IpC/RxyqefIpyyQB+nfAEqwikLTDRGonllgT5OeVstwikL9HHKS2sRTlmgj3Mvk/O9mZzrC24RUl1ksMvbKCoNJ4+tFkaocwpy3iF38HIRG/Ys1zrpWwbq4pjfOWjmZ7yirTshq5BEOGYozJvJLtQDU2o0NCicpCQw9ZaaBF1qErTQJFlbd0JWIYlwzFCY6/cu1ANTamBf63t2Dq8oOCRFcsk8bWinM87pinA6YJtDqCZHEh0wRGt6aM0NHRDDIayQY09OqNMQ3iTgO8PIDuNSOfC1mCg5jacMn7/ZeUVHJ1wcWUxQ2PzUUjd3LfMePAmaI2vYhIyaCrbWsMGTGcR3wtG4wFe3Stt7GwDrBLomddCpP/ebi0JVVXyPzP5bCIsI1PJl9Y+ofOk5Kj/OopBMeFdjCZLwCeW4eqrp/zj6sZM5fjhZ3OM8h5EgaCdL5WbXTOvJqeLM7H9yKnhgHRai7n1UOuwhd6eXYSAPVBqDDcwuZ/oxTaPBMFRORJQm6+qCdIel86CVin5VQHBY6gEVAXOC89kRDpUSYSsiKj3aZu2pJGk7FXKiiVQ6hw0MldRhK+Z7N2JmUkCGAO1iMxQG9/rgMoHoeer/q2x04l3+7aFp98G7zojFOPGOvH87S4cTB55eOy14L+d0E8OyWzE2dGWnkTtSZKwBUKUBfN8DMnSHKYCjLNh9KQC0VoBOxMleAWqCrW2tB6S2DlnKwbTrVTiXPeFywbZccSQnBMkJO3JCjVzxIhf8wRV5cGPyZS6JxplPNTUw/PwQBIl4ukOgmu7B8shDNW+TnriXc4vLSByiRXykx0632UiPhdu4Lz5jYAVtcgKbp7CDE/YE70CHZhUOzf2TXhTqszVvUL7fe0ghMMrxM1xCp+kl4sezFqmFdqmkb5Ow931l6A1ayD0plXgg+1Yn47XtSXwzz1L57tLtDI3WntSJTdwYnOj3Xkxez5XkwVm9nrfstgvZx4Te5KwxXiPnGXHvKAWOfzzfXUxhglu9fj0ZbtUV6NSHjynRgIrPq9JbRClwsp6oMlE3N7KEIlGGnKIPqO5DnJgiSqCT9qEWl7as2G3ak2An6kmVW/IKGXjsInTeL2ql3XEJZeJswoPJtTMcuIJRyjJEDjCZbtDAZUZF+ETxAHPmbNRbtK/5500HmBo3aOB7WmmDDDj+wQ+xudR/CUGsfh6udxDFfxCRoICxtm2dy+QpbSx/Z0RNlU4YbYkwgMQUn2Y4fAIBJsUByvPyD479CqItqXIePyJ4mVxv8WaLyZRR/Bgxfw6tIA+q/ss0P3bMk+vyTit3MQUyzJBMAV0nZ9swgu24LwSRPAlEwUrqyGuxlriIwK5fWqSrNNEEqsXXkqk7FG8iApZfJyvwDQ0Z232OFmgNgpeb+tmWHKR/IVixT+YhWGcgzmuMXXvylegwjJ9/+j/V9lSRGWUAAA==</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace EgtBEAMWALL.DbDataLayer.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Linq;
|
||||
|
||||
internal sealed class Configuration : DbMigrationsConfiguration<EgtBEAMWALL.DbDataLayer.DatabaseContext>
|
||||
{
|
||||
public Configuration()
|
||||
{
|
||||
AutomaticMigrationsEnabled = false;
|
||||
}
|
||||
|
||||
protected override void Seed(EgtBEAMWALL.DbDataLayer.DatabaseContext context)
|
||||
{
|
||||
// This method will be called after migrating to the latest version.
|
||||
|
||||
// You can use the DbSet<T>.AddOrUpdate() helper extension method
|
||||
// to avoid creating duplicate seed data.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EgtBEAMWALL.DbDataLayer")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgtBEAMWALL.DbDataLayer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("5f1cde84-fd6a-4107-968c-ecc4d64f8043")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
||||
<package id="MySql.Data" version="6.10.9" targetFramework="net452" />
|
||||
<package id="MySql.Data.Entity" version="6.10.9" targetFramework="net452" />
|
||||
</packages>
|
||||
@@ -0,0 +1,10 @@
|
||||
<Application x:Class="Application"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgtBEAMWALL.Supervisor">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary Source="Utility/Dictionary.xaml"/>
|
||||
</Application.Resources>
|
||||
|
||||
</Application>
|
||||
@@ -0,0 +1,14 @@
|
||||
Class Application
|
||||
|
||||
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
|
||||
' can be handled in this file.
|
||||
Protected Overrides Sub OnStartup(e As StartupEventArgs)
|
||||
MyBase.OnStartup(e)
|
||||
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
|
||||
' Creo la View principale
|
||||
Me.MainWindow = New MainWindowV
|
||||
' Mostro la View principale
|
||||
Me.MainWindow.Show()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,201 @@
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{B71DA327-38C8-4305-BBA1-34F3F3F32405}</ProjectGuid>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>EgtBEAMWALL.Supervisor</RootNamespace>
|
||||
<AssemblyName>EgtBEAMWALL.Supervisor</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<MyType>Custom</MyType>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>true</IncrementalBuild>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>false</IncrementalBuild>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EgtUILib">
|
||||
<HintPath>..\..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtWPFLib5">
|
||||
<HintPath>..\..\..\EgtProg\DllD32\EgtWPFLib5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="Application.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Utility\Command.vb" />
|
||||
<Compile Include="Utility\Dictionary.xaml.vb">
|
||||
<DependentUpon>Dictionary.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\VMBase.vb" />
|
||||
<Page Include="MainWindow\MainWindowV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="Application.xaml.vb">
|
||||
<DependentUpon>Application.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainWindow\MainWindowV.xaml.vb">
|
||||
<DependentUpon>MainWindowV.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="Utility\Dictionary.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Windows" />
|
||||
<Import Include="System.Windows.Controls" />
|
||||
<Import Include="System.Windows.Data" />
|
||||
<Import Include="System.Windows.Documents" />
|
||||
<Import Include="System.Windows.Input" />
|
||||
<Import Include="System.Windows.Shapes" />
|
||||
<Import Include="System.Windows.Media" />
|
||||
<Import Include="System.Windows.Media.Imaging" />
|
||||
<Import Include="System.Windows.Navigation" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow\MainWindowVM.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="My Project\MyExtensions\MyWpfExtension.vb">
|
||||
<VBMyExtensionTemplateID>Microsoft.VisualBasic.WPF.MyExtension</VBMyExtensionTemplateID>
|
||||
<VBMyExtensionTemplateVersion>1.0.0.0</VBMyExtensionTemplateVersion>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgtBEAMWALL.Core\EgtBEAMWALL.Core.vbproj">
|
||||
<Project>{f22835a1-83d8-4334-91bb-baaeb9cf59b1}</Project>
|
||||
<Name>EgtBEAMWALL.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\EgtBEAMWALL.DataLayer\EgtBEAMWALL.DataLayer.csproj">
|
||||
<Project>{24d7760e-662a-47e4-b729-b70126c24a31}</Project>
|
||||
<Name>EgtBEAMWALL.DataLayer</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\EgtBEAMWALL.ico" />
|
||||
<Resource Include="Resources\TreeView\Folder.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,106 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="MainWindowV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
DataContext="{StaticResource MainWindowVM}"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Title="{Binding Title}" Icon="/Resources/EgtBEAMWALL.ico"
|
||||
MinHeight="600" MinWidth="800">
|
||||
<!--<Grid>
|
||||
<ListBox ItemsSource="{Binding MachGroupList}"
|
||||
SelectedItem="{Binding SelMachGroup}"/>
|
||||
</Grid>-->
|
||||
|
||||
<DataGrid ItemsSource="{Binding MachGroupList}"
|
||||
SelectedItem="{Binding SelMachGroup}"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserSortColumns="False"
|
||||
CanUserResizeColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
Margin="0,0,0,5">
|
||||
<DataGrid.InputBindings>
|
||||
<KeyBinding Key="Delete" Command="{Binding DeleteMachGroup_Command}"/>
|
||||
</DataGrid.InputBindings>
|
||||
<DataGrid.Columns>
|
||||
<!--ID - Id gruppo-->
|
||||
<DataGridTextColumn Binding="{Binding Name}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="ID"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--Validità pezzo-->
|
||||
<DataGridTemplateColumn Width="Auto">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Border Background="{Binding Calc_Background}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--STARTCUT - Ritaglio iniziale-->
|
||||
<DataGridTextColumn Binding="{Binding sStartCut}"
|
||||
Width="65">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="Ritaglio iniziale"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--W - Larghezza-->
|
||||
<DataGridTextColumn Binding="{Binding dW}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="W"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--H - Altezza-->
|
||||
<DataGridTextColumn Binding="{Binding dH}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="H"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--L - Lunghezza-->
|
||||
<DataGridTextColumn Binding="{Binding dL}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="L"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--MAT - Materiale-->
|
||||
<DataGridTextColumn Binding="{Binding dL}"
|
||||
Width="1*"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="Materiale"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--% - % utilizzo-->
|
||||
<DataGridTextColumn Binding="{Binding dUsage}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="% utilizzo"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--S - Scarti-->
|
||||
<DataGridTextColumn Binding="{Binding dWaste}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="Scarti"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class MainWindowV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,37 @@
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class MainWindowVM
|
||||
|
||||
Private m_MachGroupList As New List(Of MyMachGroup)
|
||||
Public Property MachGroupList As List(Of MyMachGroup)
|
||||
Get
|
||||
Return m_MachGroupList
|
||||
End Get
|
||||
Set(value As List(Of MyMachGroup))
|
||||
m_MachGroupList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelMachGroup As MyMachGroup
|
||||
Public Property SelMachGroup As MyMachGroup
|
||||
Get
|
||||
Return m_SelMachGroup
|
||||
End Get
|
||||
Set(value As MyMachGroup)
|
||||
m_SelMachGroup = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
'' Avvio l'inizializzazione della mappa passandogli il riferimento al MainWindowVM
|
||||
'Map.BeginInit(Me)
|
||||
'' Creo Model della MainWindow
|
||||
'm_MainWindowM = New MainWindowM
|
||||
m_MachGroupList.Add(New beammachgroup(43, "Mach7", "Essetre-FAST"))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,59 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Globalization
|
||||
Imports System.Resources
|
||||
Imports System.Windows
|
||||
|
||||
' General Information about an assembly is controlled through the following
|
||||
' set of attributes. Change these attribute values to modify the information
|
||||
' associated with an assembly.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("EgtBEAMWALL.Supervisor")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("EgtBEAMWALL.Supervisor")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2020")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
|
||||
'In order to begin building localizable applications, set
|
||||
'<UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj file
|
||||
'inside a <PropertyGroup>. For example, if you are using US english
|
||||
'in your source files, set the <UICulture> to "en-US". Then uncomment the
|
||||
'NeutralResourceLanguage attribute below. Update the "en-US" in the line
|
||||
'below to match the UICulture setting in the project file.
|
||||
|
||||
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)>
|
||||
|
||||
|
||||
'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
|
||||
'1st parameter: where theme specific resource dictionaries are located
|
||||
'(used if a resource is not found in the page,
|
||||
' or application resource dictionaries)
|
||||
|
||||
'2nd parameter: where the generic resource dictionary is located
|
||||
'(used if a resource is not found in the page,
|
||||
'app, and any theme specific resource dictionaries)
|
||||
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
|
||||
|
||||
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("16031106-9f5a-44e4-b3c9-d30368e4be13")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
' Major Version
|
||||
' Minor Version
|
||||
' Build Number
|
||||
' Revision
|
||||
'
|
||||
' You can specify all the values or you can default the Build and Revision Numbers
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.2.12.1")>
|
||||
<Assembly: AssemblyFileVersion("2.2.12.1")>
|
||||
@@ -0,0 +1,121 @@
|
||||
#If _MyType <> "Empty" Then
|
||||
|
||||
Namespace My
|
||||
''' <summary>
|
||||
''' Module used to define the properties that are available in the My Namespace for WPF
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
<Global.Microsoft.VisualBasic.HideModuleName()> _
|
||||
Module MyWpfExtension
|
||||
Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
|
||||
Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
|
||||
Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
|
||||
Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
|
||||
''' <summary>
|
||||
''' Returns the application object for the running application
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
Friend ReadOnly Property Application() As Application
|
||||
Get
|
||||
Return CType(Global.System.Windows.Application.Current, Application)
|
||||
End Get
|
||||
End Property
|
||||
''' <summary>
|
||||
''' Returns information about the host computer.
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
|
||||
Get
|
||||
Return s_Computer.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
''' <summary>
|
||||
''' Returns information for the current user. If you wish to run the application with the current
|
||||
''' Windows user credentials, call My.User.InitializeWithWindowsUser().
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
|
||||
Get
|
||||
Return s_User.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
''' <summary>
|
||||
''' Returns the application log. The listeners can be configured by the application's configuration file.
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
|
||||
Get
|
||||
Return s_Log.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Returns the collection of Windows defined in the project.
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
Friend ReadOnly Property Windows() As MyWindows
|
||||
<Global.System.Diagnostics.DebuggerHidden()> _
|
||||
Get
|
||||
Return s_Windows.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
<Global.Microsoft.VisualBasic.MyGroupCollection("System.Windows.Window", "Create__Instance__", "Dispose__Instance__", "My.MyWpfExtenstionModule.Windows")> _
|
||||
Friend NotInheritable Class MyWindows
|
||||
<Global.System.Diagnostics.DebuggerHidden()> _
|
||||
Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
|
||||
If Instance Is Nothing Then
|
||||
If s_WindowBeingCreated IsNot Nothing Then
|
||||
If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
|
||||
Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
|
||||
End If
|
||||
Else
|
||||
s_WindowBeingCreated = New Global.System.Collections.Hashtable()
|
||||
End If
|
||||
s_WindowBeingCreated.Add(GetType(T), Nothing)
|
||||
Return New T()
|
||||
s_WindowBeingCreated.Remove(GetType(T))
|
||||
Else
|
||||
Return Instance
|
||||
End If
|
||||
End Function
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
|
||||
<Global.System.Diagnostics.DebuggerHidden()> _
|
||||
Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
|
||||
instance = Nothing
|
||||
End Sub
|
||||
<Global.System.Diagnostics.DebuggerHidden()> _
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
End Sub
|
||||
<Global.System.ThreadStatic()> Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function Equals(ByVal o As Object) As Boolean
|
||||
Return MyBase.Equals(o)
|
||||
End Function
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function GetHashCode() As Integer
|
||||
Return MyBase.GetHashCode
|
||||
End Function
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Friend Overloads Function [GetType]() As Global.System.Type
|
||||
Return GetType(MyWindows)
|
||||
End Function
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function ToString() As String
|
||||
Return MyBase.ToString
|
||||
End Function
|
||||
End Class
|
||||
End Module
|
||||
End Namespace
|
||||
Partial Class Application
|
||||
Inherits Global.System.Windows.Application
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
|
||||
Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
|
||||
<Global.System.Diagnostics.DebuggerHidden()> _
|
||||
Get
|
||||
Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
#End If
|
||||
@@ -0,0 +1,62 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:$clrversion$
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("$safeprojectname$.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set(ByVal value As Global.System.Globalization.CultureInfo)
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,73 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.EgtBEAMWALL.Supervisor.My.MySettings
|
||||
Get
|
||||
Return Global.EgtBEAMWALL.Supervisor.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,68 @@
|
||||
|
||||
''' <summary>
|
||||
''' A command whose sole purpose is to
|
||||
''' relay its functionality to other
|
||||
''' objects by invoking delegates. The
|
||||
''' default return value for the CanExecute
|
||||
''' method is 'true'.
|
||||
''' </summary>
|
||||
Public Class Command
|
||||
Implements ICommand
|
||||
|
||||
#Region "Fields"
|
||||
|
||||
Private ReadOnly _execute As Action(Of Object)
|
||||
Private ReadOnly _canExecute As Predicate(Of Object)
|
||||
|
||||
#End Region ' Fields
|
||||
|
||||
#Region "Constructors"
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new command that can always execute.
|
||||
''' </summary>
|
||||
''' <param name="execute">The execution logic.</param>
|
||||
Public Sub New(ByVal execute As Action(Of Object))
|
||||
Me.New(execute, Nothing)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new command.
|
||||
''' </summary>
|
||||
''' <param name="execute">The execution logic.</param>
|
||||
''' <param name="canExecute">The execution status logic.</param>
|
||||
Public Sub New(ByVal execute As Action(Of Object), ByVal canExecute As Predicate(Of Object))
|
||||
If execute Is Nothing Then
|
||||
Throw New ArgumentNullException("execute")
|
||||
End If
|
||||
|
||||
_execute = execute
|
||||
_canExecute = canExecute
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructors
|
||||
|
||||
#Region "ICommand Members"
|
||||
|
||||
<DebuggerStepThrough> _
|
||||
Public Function CanExecute(ByVal parameter As Object) As Boolean Implements ICommand.CanExecute
|
||||
Return If(_canExecute Is Nothing, True, _canExecute(parameter))
|
||||
End Function
|
||||
|
||||
Public Custom Event CanExecuteChanged As EventHandler Implements ICommand.CanExecuteChanged
|
||||
AddHandler(ByVal value As EventHandler)
|
||||
AddHandler CommandManager.RequerySuggested, value
|
||||
End AddHandler
|
||||
RemoveHandler(ByVal value As EventHandler)
|
||||
RemoveHandler CommandManager.RequerySuggested, value
|
||||
End RemoveHandler
|
||||
RaiseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
||||
End RaiseEvent
|
||||
End Event
|
||||
|
||||
Public Sub Execute(ByVal parameter As Object) Implements ICommand.Execute
|
||||
_execute(parameter)
|
||||
End Sub
|
||||
|
||||
#End Region ' ICommand Members
|
||||
End Class
|
||||
@@ -0,0 +1,646 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5">
|
||||
|
||||
<!--
|
||||
Assign a Key to every Panel ViewModel to use
|
||||
it in xaml file(ProjectView.xaml).
|
||||
-->
|
||||
<EgtBEAMWALL:MainWindowVM x:Key="MainWindowVM"/>
|
||||
<!--<EgtBEAMWALL:MySceneHostVM x:Key="MySceneHostVM"/>-->
|
||||
<!--<EgtBEAMWALL:ProjManagerVM x:Key="ProjManagerVM"/>
|
||||
<EgtBEAMWALL:ProdManagerVM x:Key="ProdManagerVM"/>
|
||||
<EgtBEAMWALL:MainMenuVM x:Key="MainMenuVM"/>
|
||||
<EgtBEAMWALL:MyStatusBarVM x:Key="StatusBarVM"/>
|
||||
<EgtBEAMWALL:ProjectVM x:Key="ProjectVM"/>
|
||||
<EgtWPFLib5:ShowPanelVM x:Key="ShowPanelVM"/>
|
||||
<EgtBEAMWALL:ShowBeamPanelVM x:Key="ShowBeamPanelVM"/>
|
||||
<EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/>
|
||||
<EgtBEAMWALL:MyInstrumentPanelVM x:Key="InstrumentPanelVM"/>
|
||||
<EgtBEAMWALL:MachinePanelVM x:Key="MachinePanelVM"/>
|
||||
<EgtBEAMWALL:PartParametersVM x:Key="PartParametersVM"/>
|
||||
<EgtBEAMWALL:LeftPanelVM x:Key="LeftPanelVM"/>
|
||||
<EgtBEAMWALL:BottomPanelVM x:Key="BottomPanelVM"/>
|
||||
<EgtBEAMWALL:ConfigurationPageVM x:Key="ConfigurationPageVM"/>
|
||||
<EgtBEAMWALL:TopPanelVM x:Key="TopPanelVM"/>
|
||||
<EgtBEAMWALL:RawPartListVM x:Key="RawPartListVM"/>
|
||||
<EgtBEAMWALL:OptimizePanelVM x:Key="OptimizePanelVM"/>-->
|
||||
<!--<OmagOFFICE:VeinMatchPanelVM x:Key="VeinMatchPanelVM"/>
|
||||
<OmagOFFICE:OptionPanelVM x:Key="OptionPanelVM"/>
|
||||
<OmagOFFICE:RawPartTabVM x:Key="RawPartTabVM"/>
|
||||
<OmagOFFICE:NestingTabVM x:Key="NestingTabVM"/>
|
||||
<OmagOFFICE:MachiningTabVM x:Key="MachiningTabVM"/>
|
||||
<OmagOFFICE:SimulTabVM x:Key="SimulTabVM"/>-->
|
||||
<!--<EgtBEAMWALL:MyMachGroupPanelVM x:Key="MachGroupPanelVM"/>-->
|
||||
|
||||
<!--Colori predefiniti-->
|
||||
<SolidColorBrush x:Key="Omag_Blue" Color="#FF095CA8" />
|
||||
<SolidColorBrush x:Key="Omag_Yellow" Color="#FFFFCE5B" />
|
||||
<SolidColorBrush x:Key="Omag_Red" Color="Red" />
|
||||
<SolidColorBrush x:Key="Omag_Green" Color="LawnGreen" />
|
||||
<SolidColorBrush x:Key="Omag_VeryLightGray" Color="#FFF2F2F2" />
|
||||
<SolidColorBrush x:Key="Omag_LightGray" Color="LightGray" />
|
||||
<SolidColorBrush x:Key="Omag_Gray" Color="#FF9E9E9E" />
|
||||
<SolidColorBrush x:Key="Omag_DarkGray" Color="#FF444444" />
|
||||
<SolidColorBrush x:Key="Omag_White" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="Omag_Black" Color="#FF000000" />
|
||||
|
||||
<!--Colori per EgtWPFLib5-->
|
||||
<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
|
||||
<!--Colori per TabHeader-->
|
||||
<LinearGradientBrush x:Key="TabItem.Static.Background" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="#F0F0F0" Offset="0.0"/>
|
||||
<GradientStop Color="#E5E5E5" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
|
||||
<!--Risorsa che toglie le animazioni dai menù popup per evitare che i menù mru di scelta dei file rimangano aperti se il file è grosso -->
|
||||
<!--o viene eseguito un lua che non aggiorna l'interfaccia-->
|
||||
<PopupAnimation x:Key="{x:Static SystemParameters.MenuPopupAnimationKey}">None</PopupAnimation>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- FocusVisual standard-->
|
||||
<Style x:Key="FocusVisual">
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- Button Style -->
|
||||
|
||||
<SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
|
||||
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
|
||||
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
|
||||
<SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
|
||||
<SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
|
||||
<SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
|
||||
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
|
||||
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
|
||||
<SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
||||
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="1"/>
|
||||
<Setter Property="Margin" Value="1"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="border" CornerRadius="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsDefaulted" Value="true">
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
|
||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
|
||||
<Setter Property="OpacityMask" Value="#54707070"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--Template che permette di andare a capo-->
|
||||
<DataTemplate x:Key="WrapButton_DataTemplate">
|
||||
<TextBlock TextWrapping="WrapWithOverflow" Text="{Binding}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<Style x:Key="ToolBar_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="30"/>
|
||||
</Style>
|
||||
<Style x:Key="ToolBar_SmallButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="20"/>
|
||||
<Setter Property="Width" Value="20"/>
|
||||
</Style>
|
||||
<Style x:Key="ToolBar_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="80"/>
|
||||
</Style>
|
||||
<Style x:Key="OptionPanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="60"/>
|
||||
<Setter Property="Width" Value="60"/>
|
||||
</Style>
|
||||
<Style x:Key="OptionPanel_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
</Style>
|
||||
<Style x:Key="OptionPanel_TextWrapButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource WrapButton_DataTemplate}" />
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||
<Setter Property="Height" Value="45"/>
|
||||
</Style>
|
||||
<Style x:Key="OptionPanel_NestingButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="60"/>
|
||||
<Setter Property="Width" Value="60"/>
|
||||
</Style>
|
||||
<Style x:Key="CompoWindow_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="40"/>
|
||||
</Style>
|
||||
<Style x:Key="EgtWPFLib5_InputButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="60"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="LeftPanel_SmallButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="20"/>
|
||||
<Setter Property="Width" Value="20"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- ToggleButton Style -->
|
||||
|
||||
<Style TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
||||
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="1"/>
|
||||
<Setter Property="Margin" Value="1"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Border x:Name="border" CornerRadius="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Button.IsDefaulted" Value="true">
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Omag_Yellow}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
|
||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
|
||||
<Setter Property="OpacityMask" Value="#54707070"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToolBar_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="30"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToolBar_TextToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="70"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OptionPanel_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OptionPanel_NestingToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="60"/>
|
||||
<Setter Property="Width" Value="60"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CompoWindow_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="40"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MainMenu_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Background" Value="{StaticResource Omag_White}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource Omag_DarkGray}"/>
|
||||
<Setter Property="TextBlock.FontWeight" Value="Normal"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="90"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsChecked" Value="true">
|
||||
<Setter Property="TextBlock.FontWeight" Value="ExtraBold"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Option_ColorButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#FFB8C3CD"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="OpacityMask" Value="#33FF0000"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ToggleButton.IsChecked" Value="True">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Background" Value="#FFF4F4F4"/>
|
||||
<Setter Property="BorderBrush" Value="#FFADB2B5"/>
|
||||
<Setter Property="TextElement.Foreground" Value="#FF838383"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- TextBlock -->
|
||||
|
||||
<Style x:Key="ToolsTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="Margin" Value="10,0,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MachiningsTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="Margin" Value="10,0,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MachiningsToolTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="Margin" Value="10,5,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ValidationErrorTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="FontStyle" Value="Italic"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Foreground" Value="Red"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="Margin" Value="0,1"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OptionTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Margin" Value="10,0,10,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="PartParam_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Margin" Value="10,0,10,0"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- TextBox -->
|
||||
|
||||
<Style TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Height" Value="22"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||
<Setter Property="ExplicitUpdateSource" Value="EnterKeyPress"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToolsTextBox" TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MachiningsTextBox" TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Margin" Value="0,0,0,10"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MachiningsToolTextBox" TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OptionTextBox" TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="PartParam_TextBox" TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Width" Value="150"/>
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- MachGroup -->
|
||||
|
||||
<SolidColorBrush x:Key="ScrollBar.Static.Background" Color="#F0F0F0"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Static.Border" Color="#F0F0F0"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Pressed.Glyph" Color="#FFFFFF"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.MouseOver.Glyph" Color="#000000"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Disabled.Glyph" Color="#BFBFBF"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Static.Glyph" Color="#606060"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.MouseOver.Background" Color="#DADADA"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.MouseOver.Border" Color="#DADADA"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Pressed.Background" Color="#606060"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Pressed.Border" Color="#606060"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Disabled.Background" Color="#F0F0F0"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Disabled.Border" Color="#F0F0F0"/>
|
||||
<Style x:Key="CustomScrollBarButton" TargetType="{x:Type RepeatButton}">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="1"/>
|
||||
<Setter Property="Focusable" Value="false"/>
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||
<Border x:Name="border" CornerRadius="3" BorderBrush="{StaticResource ScrollBar.Static.Border}" BorderThickness="1" Background="{StaticResource ScrollBar.Static.Background}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource ScrollBar.MouseOver.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollBar.MouseOver.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource ScrollBar.Pressed.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollBar.Pressed.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource ScrollBar.Disabled.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollBar.Disabled.Border}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- Border -->
|
||||
|
||||
<Style x:Key="DefaultBorder" TargetType="{x:Type Border}">
|
||||
<Setter Property="BorderBrush" Value="#D5DFE5"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="3"/>
|
||||
<Setter Property="Padding" Value="3"/>
|
||||
<Setter Property="Margin" Value="1"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Border" TargetType="{x:Type Border}">
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
|
||||
<Setter Property="CornerRadius" Value="3"/>
|
||||
<Setter Property="Padding" Value="3"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- EgtCustomWindow -->
|
||||
|
||||
<Style TargetType="{x:Type EgtWPFLib5:EgtCustomWindow}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtCustomWindow}}">
|
||||
<Setter Property="TitleBarHeight" Value="32"/>
|
||||
<Setter Property="TitleBarBrush" Value="{StaticResource Omag_LightGray}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- EgtFloatingPanel -->
|
||||
|
||||
<Style x:Key="ToolBar_EgtFloatingPanel" TargetType="{x:Type EgtFloating:EgtFloatingPanel}" BasedOn="{StaticResource {x:Type EgtFloating:EgtFloatingPanel}}">
|
||||
<Setter Property="Background" Value="{StaticResource Omag_Gray}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Option_EgtFloatingPanel" TargetType="{x:Type EgtFloating:EgtFloatingPanel}" BasedOn="{StaticResource {x:Type EgtFloating:EgtFloatingPanel}}">
|
||||
<Setter Property="IsToolBar" Value="False"/>
|
||||
<Setter Property="TitleBarOrientation" Value="Vertical"/>
|
||||
<Setter Property="Background" Value="{StaticResource Omag_Gray}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- CsvTreeViewItem DA CAMBIARE!! -->
|
||||
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Fill" Color="#FF595959"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Stroke" Color="#FF262626"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Stroke" Color="#FF1BBBFA"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Fill" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Stroke" Color="#FF262626"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Fill" Color="#FF595959"/>
|
||||
<PathGeometry x:Key="TreeArrow" Figures="M0,0 L0,6 L6,0 z"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Fill" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Stroke" Color="#FF989898"/>
|
||||
<Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Width" Value="16"/>
|
||||
<Setter Property="Height" Value="16"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Border Background="Transparent" Height="16" Padding="5,5,5,5" Width="16">
|
||||
<Path x:Name="ExpandPath" Data="{StaticResource TreeArrow}" Fill="{StaticResource TreeViewItem.TreeArrow.Static.Fill}" Stroke="{StaticResource TreeViewItem.TreeArrow.Static.Stroke}">
|
||||
<Path.RenderTransform>
|
||||
<RotateTransform Angle="135" CenterY="3" CenterX="3"/>
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="RenderTransform" TargetName="ExpandPath">
|
||||
<Setter.Value>
|
||||
<RotateTransform Angle="180" CenterY="3" CenterX="3"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.Static.Checked.Fill}"/>
|
||||
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.Static.Checked.Stroke}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Stroke}"/>
|
||||
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Fill}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="True"/>
|
||||
<Condition Property="IsChecked" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Checked.Stroke}"/>
|
||||
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Checked.Fill}"/>
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CsvPartItemStyle" TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TreeViewItem}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="19" Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border x:Name="ExpanderBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
|
||||
</Border>
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Border>
|
||||
<ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsExpanded" Value="false">
|
||||
<Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter Property="Background" TargetName="Bd" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1"/>
|
||||
<Setter Property="Background" TargetName="ExpanderBorder" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" TargetName="ExpanderBorder" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" TargetName="ExpanderBorder" Value="1,1,0,1"/>
|
||||
<!--<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>-->
|
||||
</Trigger>
|
||||
<!--<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="true"/>
|
||||
<Condition Property="IsSelectionActive" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
</MultiTrigger>-->
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- ComboBox -->
|
||||
|
||||
<Style x:Key="MachiningsComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
<Setter Property="Margin" Value="0,0,0,10"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MachiningsToolComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="FeatureComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
<Setter Property="Height" Value="22"/>
|
||||
<Setter Property="Width" Value="55"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="PartParam_ComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
<Setter Property="Height" Value="22"/>
|
||||
<Setter Property="Width" Value="150"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="BtlData_ComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
<Setter Property="Height" Value="22"/>
|
||||
<Setter Property="Width" Value="150"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- CheckBox -->
|
||||
|
||||
<Style x:Key="OptionCheckBox" TargetType="{x:Type CheckBox}" BasedOn="{StaticResource {x:Type CheckBox}}">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="Margin" Value="10,0,0,0"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- GroupBox -->
|
||||
|
||||
<Style x:Key="GroupBoxStyle_NoHeader" TargetType="{x:Type GroupBox}">
|
||||
<Setter Property="Margin" Value="1.5,3,3,0"/>
|
||||
<Setter Property="Padding" Value="5,5,0,0"/>
|
||||
<Setter Property="BorderBrush" Value="#FFD5DFE5"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupBox}">
|
||||
<Grid SnapsToDevicePixels="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="6"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="6"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="6"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="4" Grid.Column="0" CornerRadius="4" Grid.Row="1" Grid.RowSpan="3"/>
|
||||
<Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" CornerRadius="4" Grid.Row="1" Grid.RowSpan="3">
|
||||
<!--<Border.OpacityMask>
|
||||
<MultiBinding ConverterParameter="7" UpdateSourceTrigger="Default">
|
||||
<MultiBinding.Converter>
|
||||
<BorderGapMaskConverter/>
|
||||
</MultiBinding.Converter>
|
||||
<Binding ElementName="Header" Path="ActualWidth"/>
|
||||
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
|
||||
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/>
|
||||
</MultiBinding>
|
||||
</Border.OpacityMask>-->
|
||||
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
|
||||
<Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/>
|
||||
</Border>
|
||||
</Border>
|
||||
<Border x:Name="Header" Grid.Column="1" Padding="3,1,3,0" Grid.Row="0" Grid.RowSpan="2">
|
||||
<ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Border>
|
||||
<ContentPresenter Grid.ColumnSpan="2" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Margin="{TemplateBinding Padding}" Grid.Row="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,30 @@
|
||||
Public Class OmagOFFICEDictionary
|
||||
|
||||
Public Shared ReadOnly MySceneHostVM As String = "MySceneHostVM"
|
||||
|
||||
#Region "Colors"
|
||||
|
||||
Private m_Omag_Red As SolidColorBrush = Brushes.Red
|
||||
Public ReadOnly Property Omag_Red As SolidColorBrush
|
||||
Get
|
||||
Return m_Omag_Red
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Shared m_Button_Static_Background As SolidColorBrush = New BrushConverter().ConvertFrom("#FFDDDDDD")
|
||||
Public Shared ReadOnly Property Button_Static_Background As SolidColorBrush
|
||||
Get
|
||||
Return m_Button_Static_Background
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Shared m_TabControl_Header_Background As LinearGradientBrush = Application.Current.FindResource("TabItem.Static.Background")
|
||||
Public Shared ReadOnly Property TabControl_Header_Background As LinearGradientBrush
|
||||
Get
|
||||
Return m_TabControl_Header_Background
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Colors
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,12 @@
|
||||
Imports System.ComponentModel
|
||||
|
||||
Public Class VMBase
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class AddFeatureWndV
|
||||
|
||||
Private WithEvents m_AddFeatureWndVM As AddFeatureWndVM
|
||||
|
||||
Sub New(Owner As Window, AddFeatureWndVM As AddFeatureWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddFeatureWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_AddFeatureWndVM = AddFeatureWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddFeatureWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,111 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="AddFeatureWndV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddProcess">
|
||||
<StackPanel Margin="5,5,5,0">
|
||||
<TabControl SelectedIndex="{Binding SelGRPType}">
|
||||
<TabItem Header="L"/>
|
||||
<TabItem Header="T"/>
|
||||
</TabControl>
|
||||
<Border Grid.Row="1"
|
||||
BorderThickness="1"
|
||||
BorderBrush="DarkGray"
|
||||
Background="White"
|
||||
Margin="0,-6,0,5">
|
||||
<Grid Margin="0,5,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Process"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding PRCList}"
|
||||
SelectedItem="{Binding nSelPRC}"
|
||||
Grid.Column="1"
|
||||
DisplayMemberPath="ghDesc"
|
||||
Width="200"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<TextBlock Text="Macro"
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding MacroList}"
|
||||
SelectedIndex="{Binding nSelMacro}"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
DisplayMemberPath="Name"
|
||||
IsEnabled="{Binding MacroList_IsEnabled}"
|
||||
Width="200"
|
||||
Margin="0,5,0,0"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
</Grid>
|
||||
<Image Source="{Binding sDrawPath}"
|
||||
Grid.Row="1"
|
||||
Height="300"
|
||||
Width="300"
|
||||
Margin="5,0,5,5"/>
|
||||
|
||||
<!--<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
Grid.Row="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="Face"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding SIDEList}"
|
||||
SelectedItem="{Binding nSelSIDE}"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<TextBlock Text="Group"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding GRPList}"
|
||||
SelectedItem="{Binding nSelGRP}"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
</StackPanel>-->
|
||||
|
||||
<Grid Grid.Row="2" Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="Cancel"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</StackPanel>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,230 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class AddFeatureWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
Friend m_MacroFilePathList As List(Of String)
|
||||
|
||||
Private m_SelGRPType As GRPType
|
||||
Public Property SelGRPType As Integer
|
||||
Get
|
||||
Return m_SelGRPType
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_SelGRPType = value
|
||||
' carico lista process
|
||||
Dim TempPRCList As New ObservableCollection(Of Integer)
|
||||
GetBeamPrivateProfileProcessList(m_SelGRPType, TempPRCList)
|
||||
m_PRCList.Clear()
|
||||
For Each PRC In TempPRCList
|
||||
' leggo gruppi
|
||||
Dim GRPList As New ObservableCollection(Of Integer)
|
||||
GetBeamPrivateProfileGRPList(m_SelGRPType, PRC, GRPList)
|
||||
m_PRCList.Add(New PRC(If(GRPList.Count > 0, GRPList(0), m_SelGRPType), PRC, GetBeamPrivateProfileName(m_SelGRPType, PRC)))
|
||||
Next
|
||||
m_nSelPRC = Nothing
|
||||
MacroList_IsEnabled = False
|
||||
NotifyPropertyChanged("PRCList")
|
||||
NotifyPropertyChanged("nSelPRC")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_PRCList As New ObservableCollection(Of PRC)
|
||||
Public ReadOnly Property PRCList As ObservableCollection(Of PRC)
|
||||
Get
|
||||
Return m_PRCList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nSelPRC As PRC = Nothing
|
||||
Public Property nSelPRC As PRC
|
||||
Get
|
||||
Return m_nSelPRC
|
||||
End Get
|
||||
Set(value As PRC)
|
||||
If value IsNot m_nSelPRC Then
|
||||
m_nSelPRC = value
|
||||
NotifyPropertyChanged("sDrawPath")
|
||||
' carico eventuali file Macro
|
||||
MacroList.Clear()
|
||||
m_MacroFilePathList = New List(Of String)
|
||||
If Not IsNothing(nSelPRC) Then
|
||||
Dim nGRPFromFileName As Integer = 0
|
||||
Dim nPRCFromFileName As Integer = 0
|
||||
Dim sMacroNameFromFileName As String = String.Empty
|
||||
Dim nIdMacroName As Integer = 0
|
||||
' ricavo lista file Macro
|
||||
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroDir)
|
||||
For Each File In AllFilesInDir
|
||||
If Path.GetExtension(File).ToLower() = ".lua" Then
|
||||
If File.Contains(FILENAMESEPARATOR) Then
|
||||
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
|
||||
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 2 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
|
||||
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
|
||||
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
sMacroNameFromFileName = DataFromFileName(1)
|
||||
End If
|
||||
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
|
||||
MacroList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
|
||||
m_MacroFilePathList.Add(File)
|
||||
nIdMacroName = 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
|
||||
End If
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MacroList_IsEnabled As Boolean
|
||||
Public Property MacroList_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_MacroList_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value <> m_MacroList_IsEnabled Then
|
||||
m_MacroList_IsEnabled = value
|
||||
NotifyPropertyChanged("MacroList_IsEnabled")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MacroList As New ObservableCollection(Of Object)
|
||||
Public ReadOnly Property MacroList As ObservableCollection(Of Object)
|
||||
Get
|
||||
Return m_MacroList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nSelMacro As Integer = -1
|
||||
Public Property nSelMacro As Integer
|
||||
Get
|
||||
Return m_nSelMacro
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value <> m_nSelMacro Then
|
||||
m_nSelMacro = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sDrawPath As String
|
||||
Get
|
||||
If IsNothing(m_nSelPRC) Then Return ""
|
||||
Dim sDescConstruction As String = String.Empty
|
||||
If m_SelGRPType = GRPType.L Then
|
||||
sDescConstruction = "L"
|
||||
Else
|
||||
sDescConstruction = "T"
|
||||
End If
|
||||
sDescConstruction &= m_nSelPRC.nPRC.ToString("000")
|
||||
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescConstruction & ".png"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
SelGRPType = 0
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf Ok)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
If Not IsNothing(m_nSelPRC) AndAlso m_nSelPRC.nPRC > 0 Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show("Errore! Impossibile creare una feature con questi parametri", "Errore")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class PRC
|
||||
|
||||
' Processo
|
||||
Private m_nPRC As Integer
|
||||
Friend ReadOnly Property nPRC As Integer
|
||||
Get
|
||||
Return m_nPRC
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Gruppo
|
||||
Private m_nGRP As Integer
|
||||
Friend ReadOnly Property nGRP As Integer
|
||||
Get
|
||||
Return m_nGRP
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nSIDE As Integer = 2
|
||||
Public ReadOnly Property nSIDE As Integer
|
||||
Get
|
||||
Return m_nSIDE
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Nome
|
||||
Private m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ghDesc As String
|
||||
Get
|
||||
Return If(m_nGRP = 1 OrElse m_nGRP = 2, "T", "L") & m_nPRC.ToString("000") & " " & m_sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(GRP As Integer, PRC As Integer, Name As String)
|
||||
m_nPRC = PRC
|
||||
m_sName = Name
|
||||
m_nGRP = GRP
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,104 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="AddPartWndV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddPartWndV">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!--<RowDefinition Height="Auto"/>-->
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Name"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sNAM}"
|
||||
Grid.Column="1"
|
||||
Width="200"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Prod Number"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding nPDN}"
|
||||
Grid.Column="1"
|
||||
Width="45"/>
|
||||
<TextBlock Text="Count"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sCNT}"
|
||||
Grid.Column="3"
|
||||
Width="45"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="W"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sW}"
|
||||
Grid.Column="1"
|
||||
Width="45"/>
|
||||
<TextBlock Text="H"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sH}"
|
||||
Grid.Column="3"
|
||||
Width="45"/>
|
||||
<TextBlock Text="L"
|
||||
Grid.Column="4"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sL}"
|
||||
Grid.Column="5"
|
||||
Width="45"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="3"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="Cancel"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class AddPartWndV
|
||||
|
||||
Private WithEvents m_AddPartWndVM As AddPartWndVM
|
||||
|
||||
Sub New(Owner As Window, AddPartWndVM As AddPartWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddPartWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_AddPartWndVM = AddPartWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddPartWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,176 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class AddPartWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_nPDN As Integer
|
||||
Public Property nPDN As Integer
|
||||
Get
|
||||
Return m_nPDN
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPDN = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sNAM As String
|
||||
Public Property sNAM As String
|
||||
Get
|
||||
Return m_sNAM
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sNAM = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dL As Double
|
||||
Public ReadOnly Property dL As Double
|
||||
Get
|
||||
Return m_dL
|
||||
End Get
|
||||
End Property
|
||||
Public Property sL As String
|
||||
Get
|
||||
Return LenToString(m_dL, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempL As Double
|
||||
If StringToLen(value, dTempL) AndAlso dTempL > 0 Then
|
||||
m_dL = dTempL
|
||||
Else
|
||||
NotifyPropertyChanged("sL")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dW As Double
|
||||
Public ReadOnly Property dW As Double
|
||||
Get
|
||||
Return m_dW
|
||||
End Get
|
||||
End Property
|
||||
Public Property sW As String
|
||||
Get
|
||||
Return LenToString(m_dW, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempW As Double
|
||||
If StringToLen(value, dTempW) AndAlso dTempW > 0 Then
|
||||
EgtDraw()
|
||||
m_dW = dTempW
|
||||
Else
|
||||
NotifyPropertyChanged("sW")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dH As Double
|
||||
Public ReadOnly Property dH As Double
|
||||
Get
|
||||
Return m_dH
|
||||
End Get
|
||||
End Property
|
||||
Public Property sH As String
|
||||
Get
|
||||
Return LenToString(m_dH, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempH As Double
|
||||
If StringToLen(value, dTempH) AndAlso dTempH > 0 Then
|
||||
EgtDraw()
|
||||
m_dH = dTempH
|
||||
Else
|
||||
NotifyPropertyChanged("sH")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sMAT As String
|
||||
Public Property sMAT As String
|
||||
Get
|
||||
Return m_sMAT
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMAT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCNT As Integer
|
||||
Public ReadOnly Property nCNT As Integer
|
||||
Get
|
||||
Return m_nCNT
|
||||
End Get
|
||||
End Property
|
||||
Public Property sCNT As String
|
||||
Get
|
||||
Return m_nCNT
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim nTempCNT As Integer
|
||||
If Integer.TryParse(value, nTempCNT) AndAlso nTempCNT > 0 Then
|
||||
m_nCNT = nTempCNT
|
||||
Else
|
||||
NotifyPropertyChanged("sCNT")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructure.PartList) Then
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructure.SelPart) Then
|
||||
m_dW = Map.refProjectVM.BTLStructure.SelPart.dW
|
||||
m_dH = Map.refProjectVM.BTLStructure.SelPart.dH
|
||||
m_dL = Map.refProjectVM.BTLStructure.SelPart.dL
|
||||
ElseIf Map.refProjectVM.BTLStructure.PartList.Count > 0 Then
|
||||
m_dW = Map.refProjectVM.BTLStructure.PartList(0).dW
|
||||
m_dH = Map.refProjectVM.BTLStructure.PartList(0).dH
|
||||
m_dL = Map.refProjectVM.BTLStructure.PartList(0).dL
|
||||
End If
|
||||
m_nPDN = Map.refProjectVM.BTLStructure.NewPDN()
|
||||
End If
|
||||
m_nCNT = 1
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf Ok)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
If Not IsNothing(m_dL) AndAlso m_dL > 0 AndAlso
|
||||
Not IsNothing(m_dW) AndAlso m_dW >= 0 AndAlso
|
||||
Not IsNothing(m_dH) AndAlso m_dH >= 0 Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show("Errore! Impossibile creare un nuovo pezzo con questi parametri", "Errore")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,83 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="AddRawPartWndV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddRawPartWnd">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ItemsControl ItemsSource="{Binding VariableList}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding sMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sValue}"
|
||||
Grid.Column="1"
|
||||
Width="65"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<!--<Grid Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="Lunghezza"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sL}"
|
||||
Grid.Column="1"
|
||||
Width="65"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,5"
|
||||
Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Ritaglio iniziale"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sPOSX}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Width="65"/>
|
||||
</Grid>-->
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="Cancel"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class AddRawPartWndV
|
||||
|
||||
Private WithEvents m_AddRawPartWndVM As AddRawPartWndVM
|
||||
|
||||
Sub New(Owner As Window, AddRawPartWndVM As AddRawPartWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddRawPartWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_AddRawPartWndVM = AddRawPartWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddRawPartWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,198 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class AddRawPartWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
' flag che indica se trave o parete
|
||||
Private m_nMachineType As MachineType = 1
|
||||
|
||||
' lista delle varibili da mostrare
|
||||
Private m_VariableList As ObservableCollection(Of Variable)
|
||||
Public ReadOnly Property VariableList As ObservableCollection(Of Variable)
|
||||
Get
|
||||
Return m_VariableList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Private m_dL As Double
|
||||
'Public ReadOnly Property dL As Double
|
||||
' Get
|
||||
' Return m_dL
|
||||
' End Get
|
||||
'End Property
|
||||
'Public Property sL As String
|
||||
' Get
|
||||
' Return LenToString(m_dL, 3)
|
||||
' End Get
|
||||
' Set(value As String)
|
||||
' Dim dTempL As Double
|
||||
' If StringToLen(value, dTempL) AndAlso dTempL > 0 Then
|
||||
' m_dL = dTempL
|
||||
' Else
|
||||
' NotifyPropertyChanged("sL")
|
||||
' End If
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
'Private m_dPOSX As Double
|
||||
'Public Property dPOSX As Double
|
||||
' Get
|
||||
' Return m_dPOSX
|
||||
' End Get
|
||||
' Set(value As Double)
|
||||
' m_dPOSX = value
|
||||
' End Set
|
||||
'End Property
|
||||
'Public Property sPOSX As String
|
||||
' Get
|
||||
' Return LenToString(m_dPOSX, 3)
|
||||
' End Get
|
||||
' Set(value As String)
|
||||
' Dim dTempPOSX As Double
|
||||
' If StringToLen(value, dTempPOSX) AndAlso dTempPOSX > 0 Then
|
||||
' m_dPOSX = dTempPOSX
|
||||
' Else
|
||||
' NotifyPropertyChanged("sPOSX")
|
||||
' End If
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(MachineType As Integer, dL As Double, dW As Double, dPosx As Double)
|
||||
m_nMachineType = MachineType
|
||||
Select Case m_nMachineType
|
||||
Case ConstBeam.MachineType.BEAM
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, "Lunghezza", dL),
|
||||
New Variable(Variable.VariableType.LENGTH, "Ritaglio iniziale", dPosx)})
|
||||
Case ConstBeam.MachineType.WALL
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, "Lunghezza", dL),
|
||||
New Variable(Variable.VariableType.LENGTH, "Larghezza", dW)})
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf Ok)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
For Each Variable In m_VariableList
|
||||
If (Variable.nType = Variable.VariableType.STRING_ AndAlso IsNothing(Variable.sValue)) OrElse
|
||||
((Variable.nType = Variable.VariableType.DOUBLE_ OrElse Variable.nType = Variable.VariableType.LENGTH) AndAlso IsNothing(Variable.dValue)) Then
|
||||
MessageBox.Show(If(m_nMachineType = MachineType.BEAM, "Errore! Impossibile creare una barra con questi parametri", "Errore! Impossibile creare una parete con questi parametri"), "Errore")
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
' se non ci sono problemi esco restituendo vero
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
'If Not IsNothing(m_dL) AndAlso m_dL > 0 AndAlso
|
||||
' Not IsNothing(m_dPOSX) AndAlso m_dPOSX >= 0 Then
|
||||
' RaiseEvent m_CloseWindow(True)
|
||||
'Else
|
||||
' MessageBox.Show("Errore! Impossibile creare una barra con questi parametri", "Errore")
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Variable
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum VariableType As Integer
|
||||
DOUBLE_ = 1
|
||||
STRING_ = 2
|
||||
COMBO = 3
|
||||
LENGTH = 4
|
||||
End Enum
|
||||
|
||||
Private m_nType As VariableType
|
||||
Public ReadOnly Property nType As VariableType
|
||||
Get
|
||||
Return m_nType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sMsg As String
|
||||
Public Property sMsg As String
|
||||
Get
|
||||
Return m_sMsg
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMsg = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dValue As Double = 0
|
||||
Friend ReadOnly Property dValue As Double
|
||||
Get
|
||||
Return m_dValue
|
||||
End Get
|
||||
End Property
|
||||
Private m_sValue As String = ""
|
||||
Public Property sValue As String
|
||||
Get
|
||||
Select Case m_nType
|
||||
Case VariableType.STRING_
|
||||
Return m_sValue
|
||||
Case VariableType.LENGTH
|
||||
Return LenToString(m_dValue, 3)
|
||||
Case Else ' VariableType.DOUBLE_
|
||||
Return DoubleToString(m_dValue, 3)
|
||||
End Select
|
||||
End Get
|
||||
Set(value As String)
|
||||
Select Case m_nType
|
||||
Case VariableType.STRING_
|
||||
m_sValue = value
|
||||
Case VariableType.LENGTH
|
||||
Dim dTempValue As Double
|
||||
If StringToLen(value, dTempValue) Then
|
||||
m_dValue = dTempValue
|
||||
Else
|
||||
NotifyPropertyChanged("sValue")
|
||||
End If
|
||||
Case Else ' VariableType.DOUBLE_
|
||||
Dim dTempValue As Double
|
||||
If StringToDouble(value, dTempValue) Then
|
||||
m_dValue = dTempValue
|
||||
Else
|
||||
NotifyPropertyChanged("sValue")
|
||||
End If
|
||||
End Select
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Type As VariableType, Msg As String, Value As String)
|
||||
m_nType = Type
|
||||
m_sMsg = Msg
|
||||
sValue = Value
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,136 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="AddSectionXMaterialWndV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddSectionXMaterial">
|
||||
<StackPanel Margin="5,5,5,0">
|
||||
|
||||
<Grid Grid.Row="0" Margin="5" Width="500">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding SectionXMaterial_Msg}"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
FontWeight="DemiBold"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<TextBlock Text="{Binding Alias_Msg}"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontWeight="DemiBold"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<TextBlock Text="{Binding Values_Msg}"
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
FontWeight="DemiBold"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
</Grid>
|
||||
|
||||
<EgtWPFLib5:EgtScrollViewer Focusable="False" MaxHeight="600">
|
||||
<ItemsControl ItemsSource="{Binding NewSectionXMaterialList}" Grid.Row="1" Grid.Column="0" Width="500" Margin="5">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel x:Name="GroupStackPanel"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding sSectionXMaterial}"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<CheckBox IsChecked="{Binding Alias_IsChecked}"
|
||||
IsEnabled="{Binding Alias_IsEnabled}"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<Grid Grid.Column="2" Visibility="{Binding NewBeam_Visibility}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding L_Msg}"
|
||||
Style="{StaticResource OptionTextBlock}"
|
||||
Grid.Column="1"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding dNewL, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="2"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="2" Visibility="{Binding NewWall_Visibility}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding W_Msg}"
|
||||
Style="{StaticResource OptionTextBlock}"
|
||||
Grid.Column="0"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding dNewW, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="1"/>
|
||||
<TextBlock Text="{Binding L_Msg}"
|
||||
Style="{StaticResource OptionTextBlock}"
|
||||
Grid.Column="2"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding dNewL, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="3"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="2" Visibility="{Binding Alias_Visibility}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ComboBox ItemsSource="{Binding MaterialForSameSection_List}"
|
||||
SelectedItem="{Binding SelMaterialForSameSection}"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</EgtWPFLib5:EgtScrollViewer>
|
||||
|
||||
<Grid Grid.Row="2" Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="{Binding Ok_Msg}"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding Cancel_Msg}"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class AddSectionXMaterialWndV
|
||||
|
||||
Private WithEvents m_AddSectionXMaterialWndVM As AddSectionXMaterialWndVM
|
||||
|
||||
Sub New(Owner As Window, AddSectionXMaterialWndVM As AddSectionXMaterialWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddSectionXMaterialWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_AddSectionXMaterialWndVM = AddSectionXMaterialWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddSectionXMaterialWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,228 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class AddSectionXMaterialWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_NewSectionXMaterialList As New ObservableCollection(Of SectionXMaterial)
|
||||
Public Property NewSectionXMaterialList As ObservableCollection(Of SectionXMaterial)
|
||||
Get
|
||||
Return m_NewSectionXMaterialList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of SectionXMaterial))
|
||||
m_NewSectionXMaterialList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property SectionXMaterial_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61771)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Alias_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61772)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Values_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61773)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Ok_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61761)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Cancel_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61763)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Error_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61764)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IncorrectValues_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61768)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' MESSAGES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(SectXMatList As List(Of SectionXMaterial))
|
||||
NewSectionXMaterialList = New ObservableCollection(Of SectionXMaterial)(SectXMatList)
|
||||
' Rimuovo il primo elemento perché sempre vuoto
|
||||
NewSectionXMaterialList.RemoveAt(0)
|
||||
' Prendo i SectionXMaterial appena messi nella Lista di questa finestra e li confronto con ciascuno di quelli presenti in BTLStructure.SectionList.
|
||||
' Se le sezioni sono uguali carico i materiali relativi alla medesima sezione.
|
||||
' Se i materiali di quella medesima sezione non ci sono disabilito la CheckBox Alias.
|
||||
For Each NewSectXMatItem In NewSectionXMaterialList
|
||||
NewSectXMatItem.Alias_IsChecked = False
|
||||
|
||||
For Each SectionListItem In Map.refProjectVM.BTLStructure.SectionList
|
||||
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM Then
|
||||
If NewSectXMatItem.dW = SectionListItem.dW AndAlso NewSectXMatItem.dH = SectionListItem.dH Then
|
||||
' Se le sezioni sono uguali allora indago sui materiali
|
||||
For Index As Integer = 0 To SectionListItem.sMaterial.Count - 1
|
||||
If Not NewSectXMatItem.MaterialForSameSection_List.Contains(SectionListItem.sMaterial(Index)) And Not NewSectXMatItem.sMaterial.Contains(SectionListItem.sMaterial(Index)) Then
|
||||
NewSectXMatItem.MaterialForSameSection_List.Add(SectionListItem.sMaterial(Index))
|
||||
End If
|
||||
If NewSectXMatItem.MaterialForSameSection_List.Count > 0 Then
|
||||
NewSectXMatItem.Alias_IsEnabled = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
ElseIf Map.refMachinePanelVM.SelectedMachine.nType = MachineType.WALL Then
|
||||
If NewSectXMatItem.dH = SectionListItem.dH Then
|
||||
' Se le sezioni sono uguali allora indago sui materiali
|
||||
For Index As Integer = 0 To SectionListItem.sMaterial.Count - 1
|
||||
If Not NewSectXMatItem.MaterialForSameSection_List.Contains(SectionListItem.sMaterial(Index)) And Not NewSectXMatItem.sMaterial.Contains(SectionListItem.sMaterial(Index)) Then
|
||||
NewSectXMatItem.MaterialForSameSection_List.Add(SectionListItem.sMaterial(Index))
|
||||
End If
|
||||
If NewSectXMatItem.MaterialForSameSection_List.Count > 0 Then
|
||||
NewSectXMatItem.Alias_IsEnabled = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf Ok)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
' Se i valori non sono corretti segnalo l'errore e impedisco il salvataggio
|
||||
For Index As Integer = 0 To NewSectionXMaterialList.Count - 1
|
||||
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM AndAlso NewSectionXMaterialList(Index).dNewL < 0 Then
|
||||
MessageBox.Show(IncorrectValues_Msg, Error_Msg)
|
||||
Return
|
||||
End If
|
||||
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.WALL AndAlso (NewSectionXMaterialList(Index).dNewW < 0 Or NewSectionXMaterialList(Index).dNewL < 0) Then
|
||||
MessageBox.Show(IncorrectValues_Msg, Error_Msg)
|
||||
Return
|
||||
End If
|
||||
Index += 1
|
||||
Next
|
||||
' Se i valori sono corretti salvo
|
||||
Save()
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
#Region "Save"
|
||||
|
||||
Public Sub Save()
|
||||
|
||||
' Indice per scansionare NewSectionXMaterialList
|
||||
Dim Index = 0
|
||||
' Indice da incrementare in modo da scrivere i nuovi parametri L/S a partire dal giusto numero
|
||||
Dim ParamIndex = 1
|
||||
|
||||
Dim sWarehousePath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_MEDIUM_INI_FILE_NAME
|
||||
|
||||
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM Then
|
||||
|
||||
' Ciclo sui parametri L esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere
|
||||
Dim sValue As String = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(S_BEAM, "L" & ParamIndex, String.Empty, sValue, sWarehousePath)
|
||||
ParamIndex += 1
|
||||
End While
|
||||
|
||||
' Se i valori sono tutti >= 0 li scrivo nel file INI
|
||||
Index = 0
|
||||
For Each NewSxMItem In NewSectionXMaterialList
|
||||
Dim sAlias As String = String.Empty
|
||||
For Each Mat In NewSectionXMaterialList(Index).sMaterial
|
||||
sAlias &= Mat & ";"
|
||||
Next
|
||||
sAlias = sAlias.TrimEnd(";")
|
||||
' Se Alias è checkato aggiungo l'Alias scelto dalla ComboBox alla stringa
|
||||
If NewSxMItem.Alias_IsChecked Then sAlias &= ";" & NewSxMItem.SelMaterialForSameSection
|
||||
' Scrivo il parametro
|
||||
WritePrivateProfileString(S_BEAM, K_L & ParamIndex, LenToString(NewSectionXMaterialList(Index).dW, 3) & "," &
|
||||
LenToString(NewSectionXMaterialList(Index).dH, 3) & "," &
|
||||
sAlias & "," &
|
||||
LenToString(NewSectionXMaterialList(Index).dNewL, 3), sWarehousePath)
|
||||
Index += 1
|
||||
ParamIndex += 1
|
||||
Next
|
||||
ElseIf Map.refMachinePanelVM.SelectedMachine.nType = MachineType.WALL Then
|
||||
|
||||
' Ciclo sui parametri S esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere
|
||||
Dim sValue As String = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(S_WALL, "S" & ParamIndex, String.Empty, sValue, sWarehousePath)
|
||||
ParamIndex += 1
|
||||
End While
|
||||
|
||||
' Se i valori sono tutti > 0 li scrivo nel file INI
|
||||
Index = 0
|
||||
For Each NewSxMItem In NewSectionXMaterialList
|
||||
Dim sAlias As String = String.Empty
|
||||
For Each Mat In NewSectionXMaterialList(Index).sMaterial
|
||||
sAlias &= Mat & ";"
|
||||
Next
|
||||
sAlias = sAlias.TrimEnd(";")
|
||||
' Se Alias è checkato aggiungo l'Alias scelto dalla ComboBox alla stringa
|
||||
If NewSxMItem.Alias_IsChecked Then sAlias &= ";" & NewSxMItem.SelMaterialForSameSection
|
||||
' Scrivo il parametro
|
||||
WritePrivateProfileString(S_WALL, K_S & ParamIndex, LenToString(NewSectionXMaterialList(Index).dH, 3) & "," &
|
||||
sAlias & "," &
|
||||
LenToString(NewSectionXMaterialList(Index).dNewW, 3) & "," &
|
||||
LenToString(NewSectionXMaterialList(Index).dNewL, 3), sWarehousePath)
|
||||
Index += 1
|
||||
ParamIndex += 1
|
||||
Next
|
||||
End If
|
||||
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' Save
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework"
|
||||
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
requirePermission="false"/>
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
|
||||
</providers>
|
||||
</entityFramework>
|
||||
</configuration>
|
||||
@@ -0,0 +1,9 @@
|
||||
<Application x:Class="Application"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary Source="Utility/Dictionary.xaml"/>
|
||||
</Application.Resources>
|
||||
|
||||
</Application>
|
||||
@@ -0,0 +1,14 @@
|
||||
Class Application
|
||||
|
||||
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
|
||||
' can be handled in this file.
|
||||
Protected Overrides Sub OnStartup(e As StartupEventArgs)
|
||||
MyBase.OnStartup(e)
|
||||
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
|
||||
' Creo la View principale
|
||||
Me.MainWindow = New MainWindowV
|
||||
' Mostro la View principale
|
||||
Me.MainWindow.Show()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,159 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="BTLDataWndV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="True"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="BTLDataWndV"
|
||||
Name="BTLDataWndV">
|
||||
|
||||
<UniformGrid Margin="5"
|
||||
Columns="6" Rows="7">
|
||||
|
||||
<TextBlock Text="{Binding PROJNUM_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sPROJNUM, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding PROJNAME_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sPROJNAME, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding PROJPART_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sPROJPART, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding PROJGUID_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sPROJGUID, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding LISTNAME_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sLISTNAME, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding CUSTOMER_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sCUSTOMER, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding ARCHITECT_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sARCHITECT, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding EDITOR_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sEDITOR, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding DELIVDATE_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sDELIVDATE, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding EXPDATE_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sEXPDATE, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding EXPTIME_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sEXPTIME, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding EXPRELEASE_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sEXPRELEASE, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding LANGUAGE_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sLANGUAGE, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding RANGE_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
|
||||
Path=Tag.ocRANGE,
|
||||
Mode=OneWay}"
|
||||
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
|
||||
Path=Tag.SelRANGE,
|
||||
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource BtlData_ComboBox}"/>
|
||||
<TextBlock Text="{Binding PROCESSINGQUALITY_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
|
||||
Path=Tag.ocPROCESSINGQUALITY,
|
||||
Mode=OneWay}"
|
||||
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
|
||||
Path=Tag.SelPROCESSINGQUALITY,
|
||||
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource BtlData_ComboBox}"/>
|
||||
<TextBlock Text="{Binding COMPUTERNAME_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sCOMPUTERNAME, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding USER_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sUSER, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding SRCFILE_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sSRCFILE, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding EXPFILE_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sEXPFILE, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
<TextBlock Text="{Binding RECESS_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
|
||||
Path=Tag.ocRECESS,
|
||||
Mode=OneWay}"
|
||||
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
|
||||
Path=Tag.SelRECESS,
|
||||
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource BtlData_ComboBox}"/>
|
||||
<TextBlock Text="{Binding USERATTRIBUTE_MSG}"
|
||||
Style="{StaticResource PartParam_TextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sUSERATTRIBUTE, UpdateSourceTrigger=Explicit,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PartParam_TextBox}"/>
|
||||
|
||||
</UniformGrid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,19 @@
|
||||
Public Class BTLDataWndV
|
||||
|
||||
Private WithEvents m_BTLDataWndVM As BTLDataWndVM
|
||||
|
||||
Sub New(Owner As Window, BTLDataWndVM As BTLDataWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = BTLDataWndVM
|
||||
Me.Tag = Map.refProjectVM.BTLStructure
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_BTLDataWndVM = BTLDataWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BTLDataWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,182 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class BTLDataWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property PROJNUM_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61692)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PROJNAME_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61693)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PROJPART_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61694)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PROJGUID_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61695)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LISTNAME_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61696)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CUSTOMER_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61697)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ARCHITECT_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61698)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EDITOR_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61699)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DELIVDATE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61700)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EXPDATE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61701)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EXPTIME_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61702)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EXPRELEASE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61703)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LANGUAGE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61704)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RANGE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61705)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PROCESSINGQUALITY_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61642)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property COMPUTERNAME_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61706)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property USER_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61707)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SRCFILE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61708)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EXPFILE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61709)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RECESS_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61643)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property USERATTRIBUTE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61648)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf Ok)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
''verifico che tutti i campi contengano un valore valido
|
||||
'If Not IsNothing(m_dL) AndAlso m_dL > 0 AndAlso
|
||||
' Not IsNothing(m_dW) AndAlso m_dW >= 0 AndAlso
|
||||
' Not IsNothing(m_dH) AndAlso m_dH >= 0 Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
'Else
|
||||
' MessageBox.Show("Errore! Impossibile creare una feature con questi parametri", "Errore")
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user