Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 651de09d7d | |||
| 23844a542f | |||
| 895af630e3 | |||
| 2361e1f6f8 | |||
| f1640f75f8 | |||
| a58f7d9fda |
@@ -0,0 +1,259 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Media
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BTLFeatureVM
|
||||
Inherits VMBase
|
||||
|
||||
Protected WithEvents m_BTLFeatureM As BTLFeatureM
|
||||
Public ReadOnly Property BTLFeatureM As BTLFeatureM
|
||||
Get
|
||||
Return m_BTLFeatureM
|
||||
End Get
|
||||
End Property
|
||||
Protected m_BTLPartM As BTLPartM
|
||||
|
||||
Public ReadOnly Property nFeatureId As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nFeatureId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable Property nSelGRP As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nSelGRP
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_BTLFeatureM.nSelGRP = value
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property sDescGRP As String
|
||||
Get
|
||||
Dim sDescConstruction As String = String.Empty
|
||||
If CalcBeamPrivateProfileGRP(m_BTLFeatureM.nSelGRP) = 0 Then
|
||||
sDescConstruction = "L"
|
||||
Else
|
||||
sDescConstruction = "T"
|
||||
End If
|
||||
sDescConstruction &= m_BTLFeatureM.nPRC.ToString("000")
|
||||
Return sDescConstruction
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nPRC As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nPRC
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_BTLFeatureM.nPRC = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Lato
|
||||
Public Overridable Property nSelSIDE As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nSelSIDE
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_BTLFeatureM.nSelSIDE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_BTLFeatureM.sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable Property bDO As Boolean
|
||||
Get
|
||||
Return m_BTLFeatureM.bDO
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_BTLFeatureM.bDO = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nPRID As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nPRID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_BTLFeatureM.nPRID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property sDES As String
|
||||
Get
|
||||
Return m_BTLFeatureM.sDES
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_BTLFeatureM.sDES = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property frFRAME As Frame3d
|
||||
Get
|
||||
Return m_BTLFeatureM.frFRAME
|
||||
End Get
|
||||
Set(value As Frame3d)
|
||||
m_BTLFeatureM.frFRAME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' proprieta' che mostra la descrizione in interfaccia
|
||||
Public ReadOnly Property sDesc As String
|
||||
Get
|
||||
Return sDescGRP & " " & sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nState As CalcStates
|
||||
Get
|
||||
Return m_BTLFeatureM.nState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nCALC_ERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nCALC_ROT
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_BTLFeatureM.sCALC_MSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If Not m_BTLFeatureM.bDO Then
|
||||
Return Brushes.Aqua
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.OK Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.NOTCALCULATED Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.INFO Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.WARNING Then
|
||||
Return Brushes.Orange
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.ERROR_ Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_BTLFeatureM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Letter As String
|
||||
Get
|
||||
Select Case m_BTLFeatureM.nCALC_ERR
|
||||
Case 22
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Return "e"
|
||||
Case 17
|
||||
Return "w"
|
||||
Case < 0
|
||||
Return "i"
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
||||
Get
|
||||
Select Case m_BTLFeatureM.nState
|
||||
Case CalcStates.ERROR_
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
Case CalcStates.INFO
|
||||
Return Brushes.Green
|
||||
Case Else
|
||||
Return Brushes.Red
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
'Sub New(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM)
|
||||
' m_BTLFeatureM = BTLFeatureM
|
||||
' AddHandler m_BTLFeatureM.PBTLParamAdded, AddressOf OnPBTLParamAdded
|
||||
' AddHandler m_BTLFeatureM.QBTLParamAdded, AddressOf OnQBTLParamAdded
|
||||
' m_BTLPartM = BTLPartM
|
||||
' CreatePBTLParamVMList()
|
||||
' CreateQBTLParamVMList()
|
||||
' NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
' NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
' NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
' NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
'End Sub
|
||||
|
||||
Sub New()
|
||||
End Sub
|
||||
|
||||
Sub New(BTLFeatureM As BTLFeatureM)
|
||||
m_BTLFeatureM = BTLFeatureM
|
||||
m_BTLPartM = Nothing
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
' funzione che seleziona la feature nella geometria
|
||||
Public Sub SelGeomFeature()
|
||||
EgtDeselectAll()
|
||||
SelGeomFeature(nFeatureId)
|
||||
End Sub
|
||||
Private Sub SelGeomFeature(nMyFeatureId As Integer)
|
||||
EgtSelectObj(nMyFeatureId)
|
||||
Dim sVal As String = ""
|
||||
If EgtGetInfo(nMyFeatureId, BTL_FTR_ADJID, sVal) Then
|
||||
Dim vAdjId() As String = sVal.Split(","c)
|
||||
For Each sAdjId In vAdjId
|
||||
Dim nAdjId As Integer
|
||||
If Integer.TryParse(sAdjId, nAdjId) Then
|
||||
SelGeomFeature(nMyFeatureId + nAdjId)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If EgtGetInfo(nMyFeatureId, BTL_FTR_AUXID, sVal) Then
|
||||
Dim vAuxId() As String = sVal.Split(","c)
|
||||
For Each sAuxId In vAuxId
|
||||
Dim nAuxId As Integer
|
||||
If Integer.TryParse(sAuxId, nAuxId) Then
|
||||
EgtSelectObj(nMyFeatureId + nAuxId)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -201,6 +201,8 @@
|
||||
Friend Const BTL_FTR_PRID As String = "PRID"
|
||||
Friend Const BTL_FTR_FRAME As String = "FRAME"
|
||||
Friend Const BTL_FTR_MAINID As String = "MAINID"
|
||||
Friend Const BTL_FTR_ADJID As String = "ADJID"
|
||||
Friend Const BTL_FTR_AUXID As String = "AUXID"
|
||||
|
||||
' parametri machgroup grezzi
|
||||
Friend Const MGR_RPT_ID As String = "ID"
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
Public Module ConstDataGridColumnsIni
|
||||
|
||||
Public Const DATAGRIDCOLUMNS_FILE_NAME As String = "DataGridColumns.ini"
|
||||
|
||||
Public Const S_FEATURELIST As String = "DG_FeatureList"
|
||||
Public Const S_OPENPROJFILEDLG_PROJ As String = "DG_OpenProjectFileDialog_PROJ"
|
||||
Public Const S_OPENPROJFILEDLG_PROD As String = "DG_OpenProjectFileDialog_PROD"
|
||||
Public Const S_RAWPARTLIST_BEAM As String = "DG_RawPartList_BEAM"
|
||||
Public Const S_RAWPARTLIST_WALL As String = "DG_RawPartList_WALL"
|
||||
Public Const S_PARTINRAWPARTLIST_BEAM As String = "DG_PartInRawPartList_BEAM"
|
||||
Public Const S_PARTINRAWPARTLIST_WALL As String = "DG_PartInRawPartList_WALL"
|
||||
|
||||
End Module
|
||||
@@ -10,8 +10,9 @@
|
||||
<AssemblyName>EgtBEAMWALL.Core</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -21,6 +22,7 @@
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Core.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -30,6 +32,7 @@
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Core.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
@@ -56,6 +59,8 @@
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@@ -74,8 +79,14 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BeamM.vb" />
|
||||
<Compile Include="BTL ViewModel\BTLFeatureVM.vb" />
|
||||
<Compile Include="Constants\ConstColumns.vb" />
|
||||
<Compile Include="Constants\ConstDataGridColumnsIni.vb" />
|
||||
<Compile Include="Constants\ConstMachComm.vb" />
|
||||
<Compile Include="EgtDataGrid\EgtDataGrid.xaml.vb">
|
||||
<DependentUpon>EgtDataGrid.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EgtDataGrid\DataGridColumnsIniFile.vb" />
|
||||
<Compile Include="MachGroup Model\BeamMachGroupM.vb" />
|
||||
<Compile Include="DataAccess\PartAddedEventArgs.vb" />
|
||||
<Compile Include="DataAccess\BTLParamAddedEventArgs.vb" />
|
||||
@@ -90,11 +101,19 @@
|
||||
<Compile Include="BTL Model\BTLStructureM.vb" />
|
||||
<Compile Include="Constants\ConstBeam.vb" />
|
||||
<Compile Include="Enum.vb" />
|
||||
<Compile Include="MachGroupPanel\BeamMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\BeamVM.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\PartVM.vb" />
|
||||
<Compile Include="MachGroupPanel\WallMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\WallVM.vb" />
|
||||
<Compile Include="MachLog.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -111,13 +130,21 @@
|
||||
<Compile Include="Lib\MachGroupPanelM.vb" />
|
||||
<Compile Include="MachGroup Model\MyMachGroupPanelM.vb" />
|
||||
<Compile Include="MyMachine.vb" />
|
||||
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml.vb">
|
||||
<DependentUpon>OpenProjectFileDialogV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogVM.vb" />
|
||||
<Compile Include="PartM.vb" />
|
||||
<Compile Include="ProdFileM.vb" />
|
||||
<Compile Include="ProjectFileM.vb" />
|
||||
<Compile Include="ProjectManager\ProdFileVM.vb" />
|
||||
<Compile Include="ProjectManager\ProjectFileVM.vb" />
|
||||
<Compile Include="ProjectManager\ProjFileVM.vb" />
|
||||
<Compile Include="ProjFileM.vb" />
|
||||
<Compile Include="SectionXMaterial.vb" />
|
||||
<Compile Include="Utility\BTLIniFile.vb" />
|
||||
<Compile Include="Utility\Command.vb" />
|
||||
<Compile Include="Utility\CoreMap.vb" />
|
||||
<Compile Include="Utility\VMBase.vb" />
|
||||
<Compile Include="WallM.vb" />
|
||||
<Compile Include="WallMachGroupM.vb" />
|
||||
@@ -141,6 +168,16 @@
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="EgtDataGrid\EgtDataGrid.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.Core.dll</PostBuildEvent>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Windows.Controls
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Module DataGridColumnsIniFile
|
||||
|
||||
Public m_sDataGridColumnsIniFile As String
|
||||
|
||||
Public Function GetPrivateProfileColumns(ParentDGName As String, ByRef ocColumns As ObservableCollection(Of EgtDataGridColumn)) As Boolean
|
||||
Dim colIndex As Integer = 0
|
||||
Dim str = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(ParentDGName, colIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0
|
||||
Dim sColumnParams() As String = str.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sColumnParams.Count >= 7 Then
|
||||
' cancello spazi
|
||||
For index = 0 To sColumnParams.Count - 1
|
||||
sColumnParams(index) = sColumnParams(index).Trim()
|
||||
Next
|
||||
' creo colonna
|
||||
Dim sName = sColumnParams(0)
|
||||
Dim bReorder As Boolean = sColumnParams(1).Equals("1")
|
||||
Dim bResize As Boolean = sColumnParams(2).Equals("1")
|
||||
Dim bSort As Boolean = sColumnParams(3).Equals("1")
|
||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||
Dim Width As Double
|
||||
Dim WidthType As DataGridLengthUnitType
|
||||
StringToDouble(sColumnParams(5), Width)
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType)))
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
Return ocColumns.Count > 0
|
||||
End Function
|
||||
|
||||
Public Function WriteColumnPrivateProfileParam(ParentDataGridName As String, DisplayIndex As String, sColumnParams As String) As Boolean
|
||||
Return WritePrivateProfileString(ParentDataGridName, DisplayIndex, sColumnParams, m_sDataGridColumnsIniFile)
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,13 @@
|
||||
<DataGrid x:Class="EgtDataGrid"
|
||||
x:Name="CurrDataGrid"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<EventSetter Event="SizeChanged" Handler="Cell_SizedChanged" />
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
|
||||
@@ -0,0 +1,275 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Controls
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class EgtDataGrid
|
||||
|
||||
Sub New()
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
|
||||
Public Shadows Property BindingColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return CType(MyBase.GetValue(BindingColumnsProperty), ObservableCollection(Of EgtDataGridColumn))
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
MyBase.SetValue(BindingColumnsProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly BindingColumnsProperty As DependencyProperty = DependencyProperty.Register("BindingColumns", GetType(ObservableCollection(Of EgtDataGridColumn)), GetType(EgtDataGrid), New FrameworkPropertyMetadata(New ObservableCollection(Of EgtDataGridColumn), New PropertyChangedCallback(AddressOf OnDataGridColumnsPropertyChanged)) With {.BindsTwoWayByDefault = True})
|
||||
|
||||
Private Shared Sub OnDataGridColumnsPropertyChanged(ByVal source As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
|
||||
Dim context = TryCast(source, EgtDataGrid)
|
||||
Dim oldItems = TryCast(e.OldValue, ObservableCollection(Of EgtDataGridColumn))
|
||||
|
||||
If oldItems IsNot Nothing Then
|
||||
|
||||
For Index = 0 To oldItems.Count - 1
|
||||
Dim Column As DataGridColumn = context.FindResource(oldItems(Index))
|
||||
context.Columns.Remove(Column)
|
||||
Next
|
||||
|
||||
RemoveHandler oldItems.CollectionChanged, AddressOf context.collectionChanged
|
||||
End If
|
||||
|
||||
Dim newItems = TryCast(e.NewValue, ObservableCollection(Of EgtDataGridColumn))
|
||||
|
||||
If newItems IsNot Nothing Then
|
||||
|
||||
For Index = 0 To newItems.Count - 1
|
||||
Dim col As DataGridColumn = context.FindResource(newItems(Index).Name)
|
||||
newItems(Index).InitColumn(col)
|
||||
context.Columns.Add(col)
|
||||
Next
|
||||
|
||||
AddHandler newItems.CollectionChanged, AddressOf context.collectionChanged
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub collectionChanged(ByVal sender As Object, ByVal e As NotifyCollectionChangedEventArgs)
|
||||
Select Case e.Action
|
||||
Case NotifyCollectionChangedAction.Add
|
||||
|
||||
If e.NewItems IsNot Nothing Then
|
||||
|
||||
For Each one As EgtDataGridColumn In e.NewItems
|
||||
Dim col As DataGridColumn = CurrDataGrid.FindResource(one.Name)
|
||||
one.InitColumn(col)
|
||||
CurrDataGrid.Columns.Insert(e.NewStartingIndex, col)
|
||||
If col.DisplayIndex <> e.NewStartingIndex Then
|
||||
CurrDataGrid.Columns(e.NewStartingIndex).DisplayIndex = e.NewStartingIndex
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
Case NotifyCollectionChangedAction.Remove
|
||||
|
||||
If e.OldItems IsNot Nothing Then
|
||||
|
||||
For Each one As EgtDataGridColumn In e.OldItems
|
||||
Dim col As DataGridColumn = CurrDataGrid.FindResource(one.Name)
|
||||
CurrDataGrid.Columns.Remove(col)
|
||||
Next
|
||||
End If
|
||||
|
||||
Case NotifyCollectionChangedAction.Move
|
||||
'Dim col As DataGridColumn = CurrDataGrid.FindResource(BindingColumns(e.OldStartingIndex))
|
||||
'col.DisplayIndex = e.NewStartingIndex
|
||||
CurrDataGrid.Columns.Move(e.OldStartingIndex, e.NewStartingIndex)
|
||||
CurrDataGrid.Columns(e.NewStartingIndex).DisplayIndex = e.NewStartingIndex
|
||||
'Dim x = CurrDataGrid.Columns(e.OldStartingIndex).DisplayIndex
|
||||
Case NotifyCollectionChangedAction.Reset
|
||||
CurrDataGrid.Columns.Clear()
|
||||
|
||||
If e.NewItems IsNot Nothing Then
|
||||
|
||||
For Each one As DataGridColumn In e.NewItems
|
||||
Dim col As DataGridColumn = CurrDataGrid.FindResource(one)
|
||||
CurrDataGrid.Columns.Add(col)
|
||||
Next
|
||||
End If
|
||||
Case NotifyCollectionChangedAction.Replace
|
||||
Dim col As DataGridColumn = CurrDataGrid.FindResource(e.NewItems(0))
|
||||
CurrDataGrid.Columns(e.NewStartingIndex) = col
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub Cell_SizedChanged(sender As Object, e As SizeChangedEventArgs)
|
||||
' ad ogni ridimensionamento della cella del ColumnHeader salvo le nuove dimensioni nell'ini
|
||||
If Not IsNothing(e.OriginalSource.Column) AndAlso Not IsNothing(BindingColumns(e.OriginalSource.Column.DisplayIndex)) Then
|
||||
BindingColumns(e.OriginalSource.Column.DisplayIndex).SaveDataGridColumn()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public OldIndex As Integer = 0
|
||||
|
||||
Private Sub CurrDataGrid_ColumnReordering(sender As Object, e As DataGridColumnEventArgs) Handles CurrDataGrid.ColumnReordering
|
||||
' conservo il vecchio indice in modo da effettuare lo scambio in BindingColumns una volta riordinate graficamente
|
||||
OldIndex = e.Column.DisplayIndex
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_ColumnReordered(sender As Object, e As DataGridColumnEventArgs) Handles CurrDataGrid.ColumnReordered
|
||||
' scambio le colonne in BindingColumns
|
||||
BindingColumns.Move(OldIndex, e.Column.DisplayIndex)
|
||||
' scrivo tutte le colonne interessate dallo spostamento
|
||||
' (se OldIndex > e.Column.DisplayIndex, il ciclo non viene eseguito quindi lo faccio nell'altro senso)
|
||||
For index = OldIndex To e.Column.DisplayIndex
|
||||
BindingColumns(index).SaveDataGridColumn()
|
||||
Next
|
||||
For index = e.Column.DisplayIndex To OldIndex
|
||||
BindingColumns(index).SaveDataGridColumn()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtDataGridColumn
|
||||
|
||||
Private m_dgColumn As DataGridColumn
|
||||
|
||||
Private Property m_ParentDataGridName As String
|
||||
Public Property ParentDataGridName As String
|
||||
Get
|
||||
Return m_ParentDataGridName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ParentDataGridName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_Width As DataGridLength
|
||||
Public Property Width As DataGridLength
|
||||
Get
|
||||
Return m_dgColumn.Width
|
||||
End Get
|
||||
Set(value As DataGridLength)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.Width = value
|
||||
Else
|
||||
m_Width = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_DisplayIndex As Integer
|
||||
Public Property DisplayIndex As Integer
|
||||
Get
|
||||
Return m_dgColumn.DisplayIndex
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.DisplayIndex = value
|
||||
Else
|
||||
m_DisplayIndex = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_dgColumn.IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.IsReadOnly = value
|
||||
Else
|
||||
m_IsReadOnly = value
|
||||
End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserReorder As Boolean
|
||||
Public Property CanUserReorder As Boolean
|
||||
Get
|
||||
Return m_dgColumn.CanUserReorder
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.CanUserReorder = value
|
||||
Else
|
||||
m_CanUserReorder = value
|
||||
End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserResize As Boolean
|
||||
Public Property CanUserResize As Boolean
|
||||
Get
|
||||
Return m_dgColumn.CanUserResize
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.CanUserResize = value
|
||||
Else
|
||||
m_CanUserResize = value
|
||||
End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserSort As Boolean
|
||||
Public Property CanUserSort As Boolean
|
||||
Get
|
||||
Return m_dgColumn.CanUserSort
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.CanUserSort = value
|
||||
Else
|
||||
m_CanUserSort = value
|
||||
End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sName As String)
|
||||
m_Name = sName
|
||||
End Sub
|
||||
|
||||
Sub New(sParentDG As String, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength)
|
||||
m_ParentDataGridName = sParentDG
|
||||
m_Name = sName
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
m_CanUserResize = bCanUserResize
|
||||
m_CanUserSort = bCanUserSort
|
||||
m_IsReadOnly = bIsReadOnly
|
||||
m_Width = Width
|
||||
End Sub
|
||||
|
||||
Friend Sub InitColumn(dgColumn As DataGridColumn)
|
||||
m_dgColumn = dgColumn
|
||||
m_dgColumn.CanUserReorder = m_CanUserReorder
|
||||
m_dgColumn.CanUserResize = m_CanUserResize
|
||||
m_dgColumn.CanUserSort = m_CanUserSort
|
||||
m_dgColumn.IsReadOnly = m_IsReadOnly
|
||||
'm_dgColumn.DisplayIndex = m_DisplayIndex
|
||||
m_dgColumn.Width = m_Width
|
||||
End Sub
|
||||
|
||||
' funzione per calcolare e scrivere la stringa dei parametri della colonna nell'INI
|
||||
Public Function SaveDataGridColumn() As Boolean
|
||||
Dim bOk As Boolean
|
||||
Dim sColumnParams = String.Empty
|
||||
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType
|
||||
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -21,7 +21,7 @@ Public Class NewMachGroupPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_MachGroupVMList As ObservableCollection(Of MachGroupVM)
|
||||
Protected m_MachGroupVMList As ObservableCollection(Of MachGroupVM)
|
||||
Public Property MachGroupVMList As ObservableCollection(Of MachGroupVM)
|
||||
Get
|
||||
Return m_MachGroupVMList
|
||||
@@ -31,7 +31,7 @@ Public Class NewMachGroupPanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelectedMachGroup As MachGroupVM
|
||||
Protected m_SelectedMachGroup As MachGroupVM
|
||||
Public Property SelectedMachGroup As MachGroupVM
|
||||
Get
|
||||
Return m_SelectedMachGroup
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BeamMachGroupVM
|
||||
Inherits MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property m_BeamMachGroupM As BeamMachGroupM
|
||||
Get
|
||||
Return m_MachGroupM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable Property sStartCut As String
|
||||
Get
|
||||
Return LenToString(m_BeamMachGroupM.dStartCut, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_BeamMachGroupM.dStartCut)
|
||||
End Set
|
||||
End Property
|
||||
Public Property dStartCut As Double
|
||||
Get
|
||||
Return m_BeamMachGroupM.dStartCut
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_BeamMachGroupM.dStartCut = value
|
||||
NotifyPropertyChanged(NameOf(sStartCut))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SelBeam As BeamVM
|
||||
Get
|
||||
Return m_SelPart
|
||||
End Get
|
||||
Set(value As BeamVM)
|
||||
m_SelPart = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New(BeamMachGroupM As BeamMachGroupM)
|
||||
MyBase.New(BeamMachGroupM)
|
||||
AddHandler m_BeamMachGroupM.PartAdded, AddressOf OnBeamAdded
|
||||
AddHandler m_BeamMachGroupM.PartRemoved, AddressOf OnBeamRemoved
|
||||
CreateBeamVMList()
|
||||
' Aggiorno stato da stati feature
|
||||
CalcGlobalUpdate()
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub CreateBeamVMList()
|
||||
Dim all As List(Of BeamVM) = (From BeamM In m_BeamMachGroupM.GetParts()
|
||||
Select New BeamVM(BeamM, Me)).ToList()
|
||||
|
||||
For Each BeamVM As BeamVM In all
|
||||
AddHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_PartVMList = New ObservableCollection(Of PartVM)(all)
|
||||
AddHandler m_PartVMList.CollectionChanged, AddressOf OnBeamVMListChanged
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshPartList()
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshGroupData()
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnBeamAdded(sender As Object, e As PartAddedEventArgs)
|
||||
Dim BeamVM As BeamVM = New BeamVM(e.NewPart, Me)
|
||||
PartVMList.Add(BeamVM)
|
||||
End Sub
|
||||
Private Sub OnBeamRemoved(sender As Object, e As PartAddedEventArgs)
|
||||
Dim BeamVM As BeamVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
|
||||
If Not IsNothing(BeamVM) Then PartVMList.Remove(BeamVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnBeamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If e.Action = NotifyCollectionChangedAction.Add Then
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BeamVM As BeamVM In e.NewItems
|
||||
AddHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If e.Action = NotifyCollectionChangedAction.Remove Then
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each BeamVM As BeamVM In e.OldItems
|
||||
RemoveHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If e.Action = NotifyCollectionChangedAction.Move Then
|
||||
Dim ItemVM As PartVM = e.OldItems(0)
|
||||
m_BeamMachGroupM.PartMList.RemoveAt(e.OldStartingIndex)
|
||||
m_BeamMachGroupM.PartMList.Insert(e.NewStartingIndex, ItemVM.PartM)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnBeamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,47 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BeamVM
|
||||
Inherits PartVM
|
||||
|
||||
Public ReadOnly Property m_BeamM As BeamM
|
||||
Get
|
||||
Return m_PartM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable Property sOffset As String
|
||||
Get
|
||||
Return LenToString(m_BeamM.dOffset, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_BeamM.dOffset)
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property dOffset As Double
|
||||
Get
|
||||
Return m_BeamM.dOffset
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(BeamM As BeamM)
|
||||
MyBase.New(BeamM)
|
||||
End Sub
|
||||
|
||||
Sub New(BeamM As BeamM, ParentMachGroupVM As BeamMachGroupVM)
|
||||
MyBase.New(BeamM, ParentMachGroupVM)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,187 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MyMachGroupPanelVM
|
||||
Inherits NewMachGroupPanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Public ReadOnly Property m_MyMachGroupPanelM As MyMachGroupPanelM
|
||||
Get
|
||||
Return m_MachGroupPanelM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotMachGroups As String
|
||||
Get
|
||||
Return m_MachGroupVMList.Count()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotVolume As String
|
||||
Get
|
||||
Dim dMMTotVolume As Double = m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.dUnitVolume, Func(Of MachGroupVM, Double)))
|
||||
Return If(EgtUiUnitsAreMM(), DoubleToString(dMMTotVolume / 1000000000, 3), DoubleToString(dMMTotVolume * (12 / ONEINCH), 3))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotTime As String
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.nCALC_TIME, Func(Of MachGroupVM, Double)))).ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(MachGroupPanelM As MachGroupPanelM)
|
||||
MyBase.New(MachGroupPanelM)
|
||||
' Creo riferimento a questa classe in Map
|
||||
CoreMap.SetRefMachGroupPanelVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Protected Overrides Sub CreateMachGroupVMList()
|
||||
Dim all As New List(Of MachGroupVM)
|
||||
For Each MachGroupM In m_MachGroupPanelM.GetMachGroups()
|
||||
If DirectCast(MachGroupM, MyMachGroupM).nMachineType = MachineType.BEAM Then
|
||||
all.Add(New BeamMachGroupVM(MachGroupM))
|
||||
Else
|
||||
all.Add(New WallMachGroupVM(MachGroupM))
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each MachGroupvM As MachGroupVM In all
|
||||
AddHandler MachGroupvM.PropertyChanged, AddressOf OnMachGroupVMPropertyChanged
|
||||
Next
|
||||
|
||||
MachGroupVMList = New ObservableCollection(Of MachGroupVM)(all)
|
||||
AddHandler MachGroupVMList.CollectionChanged, AddressOf OnMachGroupVMListChanged
|
||||
End Sub
|
||||
|
||||
Public Overrides Function InitMachGroupList(Optional bUseDefaults As Boolean = False) As Boolean
|
||||
' Svuoto precedente lista di MachGroup
|
||||
MachGroupVMList.Clear()
|
||||
' aggiorno copie
|
||||
MyMachGroupPanelM.UpdateDuplo()
|
||||
' verifico se esistono già gruppi di lavorazione o se devo creare il primo
|
||||
Dim bOk As Boolean = False
|
||||
Dim nId = EgtGetFirstMachGroup()
|
||||
If nId <> GDB_ID.NULL Then
|
||||
bOk = EgtSetCurrMachGroup(nId)
|
||||
End If
|
||||
If Not bOk Then Return True
|
||||
' carico lista dei gruppi di lavorazione
|
||||
m_MachGroupPanelM.MachGroupMList = MyMachGroupPanelM.LoadMyMachGroups(CoreMap.refMachinePanelVM.MachineList.ToList())
|
||||
' elimino copie da cancellare
|
||||
MyMachGroupPanelM.DeleteDuplo()
|
||||
If bOk Then SelectedMachGroup = MachGroupVMList(0)
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
'Public Overrides Sub AddMachGroup()
|
||||
' Dim MyMachGroupM As MyMachGroupM = m_MyMachGroupPanelM.NewMyMachGroup(CurrentMachine.sMachineName, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
' ' e lo seleziono
|
||||
' SelectedMachGroup = MachGroupVMList.FirstOrDefault(Function(x) x.MachGroupM Is MyMachGroupM)
|
||||
'End Sub
|
||||
|
||||
Public Overrides Function OnPreSetCurrMachGroup() As Boolean
|
||||
EgtSetCurrentContext(CoreMap.refSceneHostVM.MainScene.GetCtx())
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
|
||||
' resetto eventuale selezione pezzo
|
||||
DirectCast(SelectedMachGroup, MyMachGroupVM).SelPart = Nothing
|
||||
' Imposto vista solo tavola
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
Dim View As VT
|
||||
For Each Mach As MyMachine In CoreMap.refMachinePanelVM.MachineList
|
||||
If Mach.Name = SelectedMachGroup.Machine Then
|
||||
If Mach.nType = Core.ConstBeam.MachineType.BEAM Then
|
||||
View = VT.ISO_SW
|
||||
Else
|
||||
View = VT.TOP
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
EgtSetView(View, False)
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' funzione che seleziona primo gruppo
|
||||
'Friend Sub SelFirstMachGroup()
|
||||
' If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
|
||||
' SelectedMachGroup = MachGroupVMList(0)
|
||||
' Else
|
||||
' SelectedMachGroup = Nothing
|
||||
' EgtResetCurrMachGroup()
|
||||
' ' nascondo tutti i pezzi
|
||||
' Map.refProjectVM.BTLStructureVM.HideAll()
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
' funzione che seleziona ultimo gruppo
|
||||
Public Sub SelLastMachGroup()
|
||||
If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
|
||||
SelectedMachGroup = MachGroupVMList(MachGroupVMList.Count - 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function GetLastMachGroup() As MachGroupVM
|
||||
If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
|
||||
Return MachGroupVMList(MachGroupVMList.Count - 1)
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
' funzione che aggiorna totale tempi a fine calcolo
|
||||
Public Sub CalcGlobalTime()
|
||||
NotifyPropertyChanged(NameOf(sTotTime))
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna numero gruppi di lavorazione e volume totale
|
||||
Public Sub CalcGlobalUpdate()
|
||||
NotifyPropertyChanged(NameOf(sTotMachGroups))
|
||||
NotifyPropertyChanged(NameOf(sTotVolume))
|
||||
NotifyPropertyChanged(NameOf(sTotTime))
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Protected Overrides Sub OnMachGroupAdded(sender As Object, e As MachGroupAddedEventArgs)
|
||||
Dim MachGroupVM As MachGroupVM = Nothing
|
||||
Select Case DirectCast(e.NewMachGroupM, MyMachGroupM).nMachineType
|
||||
Case Core.ConstBeam.MachineType.BEAM
|
||||
MachGroupVM = New BeamMachGroupVM(e.NewMachGroupM)
|
||||
Case Core.ConstBeam.MachineType.WALL
|
||||
MachGroupVM = New WallMachGroupVM(e.NewMachGroupM)
|
||||
Case Core.ConstBeam.MachineType.NULL
|
||||
Return
|
||||
End Select
|
||||
MachGroupVMList.Add(MachGroupVM)
|
||||
NotifyPropertyChanged(NameOf(MachGroupVMList))
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnMachGroupVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
'Case nameof(sender.sMATERIAL)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,422 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class MyMachGroupVM
|
||||
Inherits MachGroupVM
|
||||
|
||||
Public ReadOnly Property MyMachGroupM As MyMachGroupM
|
||||
Get
|
||||
Return m_MachGroupM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nMachineType As MachineType
|
||||
Get
|
||||
Return MyMachGroupM.nMachineType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return MyMachGroupM.dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
MyMachGroupM.dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return MyMachGroupM.dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
MyMachGroupM.dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return MyMachGroupM.dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
MyMachGroupM.dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtStartTime As DateTime
|
||||
Get
|
||||
Return MyMachGroupM.dtStartTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
MyMachGroupM.dtStartTime = value
|
||||
NotifyPropertyChanged(NameOf(Production_Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtEndTime As DateTime
|
||||
Get
|
||||
Return MyMachGroupM.dtEndTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
MyMachGroupM.dtEndTime = value
|
||||
NotifyPropertyChanged(NameOf(Production_Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dUsage As Double
|
||||
Get
|
||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, MyMachGroupM.dMatForPart / MyMachGroupM.dTotMat * 100, 0)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dWaste As Double
|
||||
Get
|
||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, (MyMachGroupM.dTotMat - MyMachGroupM.dMatForPart) / MyMachGroupM.dTotMat * 100, 0)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sUsage As String
|
||||
Get
|
||||
Return DoubleToString(dUsage, 3)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sWaste As String
|
||||
Get
|
||||
Return DoubleToString(dWaste, 3)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return MyMachGroupM.sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
MyMachGroupM.sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei pezzi che sono nel grezzo
|
||||
Protected m_PartVMList As New ObservableCollection(Of PartVM)
|
||||
Public Property PartVMList As ObservableCollection(Of PartVM)
|
||||
Get
|
||||
Return m_PartVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of PartVM))
|
||||
m_PartVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelPart As PartVM
|
||||
Public Overridable Property SelPart As PartVM
|
||||
Get
|
||||
Return m_SelPart
|
||||
End Get
|
||||
Set(value As PartVM)
|
||||
m_SelPart = value
|
||||
' seleziono pezzo
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(value) Then EgtSelectObj(SelPart.nPartId)
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelPart))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_ERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_FALL
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sCALC_MSG As String
|
||||
Get
|
||||
Return MyMachGroupM.sCALC_MSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
MyMachGroupM.nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
MyMachGroupM.nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nGlobalState As CalcStates
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_GlobalState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
MyMachGroupM.nCALC_GlobalState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCALC_State As CalcStates
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_State
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
MyMachGroupM.nCALC_State = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If MyMachGroupM.nCALC_GlobalState = CalcStates.OK Then
|
||||
Return Brushes.Green
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.INFO Then
|
||||
Return Brushes.Green
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.WARNING Then
|
||||
Return Brushes.Gold
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.ERROR_ Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nProduction_State As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nProductionState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable ReadOnly Property Production_Background As SolidColorBrush
|
||||
Get
|
||||
If dtEndTime <> DateTime.MinValue Then ' barra finita
|
||||
Return Brushes.LightGray
|
||||
ElseIf dtStartTime <> DateTime.MinValue Then ' barra iniziata
|
||||
Return Brushes.Green
|
||||
Else ' barra in coda
|
||||
Return Brushes.White
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(MyMachGroupM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_FALL_Visibility As Visibility
|
||||
Get
|
||||
Return If(MyMachGroupM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Letter As String
|
||||
Get
|
||||
Select Case MyMachGroupM.nCALC_GlobalERR
|
||||
Case 22
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Return "e"
|
||||
Case 17
|
||||
Return "w"
|
||||
Case < 0
|
||||
Return "i"
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
||||
Get
|
||||
Select Case MyMachGroupM.m_nCALC_GlobalState
|
||||
Case CalcStates.ERROR_
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
Case CalcStates.INFO
|
||||
Return Brushes.Green
|
||||
Case Else
|
||||
Return Brushes.Red
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sUnitTime As String
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(nCALC_TIME).ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dUnitVolume As Double
|
||||
Get
|
||||
Return dL * dW * dH
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Section As SectionXMaterial
|
||||
Get
|
||||
Return New SectionXMaterial(dW, dH, dL, MyMachGroupM.sMATERIAL)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdDeleteMachGroup As ICommand
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New(MyMachGroupM As MyMachGroupM)
|
||||
MyBase.New(MyMachGroupM)
|
||||
'aggiorno lista pezzi
|
||||
RefreshPartList()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Public Overridable Function Copy() As MyMachGroupVM
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
Public MustOverride Sub RefreshPartList()
|
||||
|
||||
Public MustOverride Sub RefreshGroupData()
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcMachGroupUpdate(ERR As Integer, ROT As Integer, MSG As String)
|
||||
EgtSetInfo(Id, ITG_PROD_ERR, ERR, True)
|
||||
EgtSetInfo(Id, ITG_PROD_MSG, MSG, True)
|
||||
EgtSetInfo(Id, ITG_PROD_ROT, ROT, True)
|
||||
MyMachGroupM.nCALC_ERR = ERR
|
||||
MyMachGroupM.nCALC_ROT = ROT
|
||||
MyMachGroupM.sCALC_MSG = MSG
|
||||
If ERR = 0 Then
|
||||
nCALC_State = CalcStates.OK
|
||||
ElseIf ERR = 17 Then
|
||||
nCALC_State = CalcStates.WARNING
|
||||
ElseIf ERR > 0 Then
|
||||
nCALC_State = CalcStates.ERROR_
|
||||
ElseIf ERR < 0 Then
|
||||
nCALC_State = CalcStates.INFO
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Sub
|
||||
|
||||
Public Sub ResetCalcMachGroup()
|
||||
EgtRemoveInfo(Id, ITG_PROD_ERR)
|
||||
EgtRemoveInfo(Id, ITG_PROD_MSG)
|
||||
EgtRemoveInfo(Id, ITG_PROD_ROT)
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
MyMachGroupM.nCALC_State = CalcStates.NOTCALCULATED
|
||||
MyMachGroupM.nCALC_GlobalERR = 0
|
||||
MyMachGroupM.nCALC_ERR = 0
|
||||
MyMachGroupM.nCALC_ROT = 0
|
||||
MyMachGroupM.nCALC_FALL = 0
|
||||
MyMachGroupM.sCALC_MSG = ""
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcGlobalUpdate()
|
||||
MyMachGroupM.nCALC_GlobalERR = nCALC_ERR
|
||||
MyMachGroupM.nCALC_GlobalState = nCALC_State
|
||||
For Each Part In MyMachGroupM.PartMList
|
||||
If Part.nCALC_GlobalState = CalcStates.NOTCALCULATED Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
Exit For
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.OK AndAlso MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.NOTCALCULATED Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.OK
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.INFO And (MyMachGroupM.nCALC_GlobalState = CalcStates.OK Or MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED) Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.INFO
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.WARNING And (MyMachGroupM.nCALC_GlobalState = CalcStates.OK Or MyMachGroupM.nCALC_GlobalState = CalcStates.INFO Or MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED) Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.WARNING
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.ERROR_ And (MyMachGroupM.nCALC_GlobalState = CalcStates.OK Or MyMachGroupM.nCALC_GlobalState = CalcStates.INFO Or MyMachGroupM.nCALC_GlobalState = CalcStates.WARNING Or MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED) Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.ERROR_
|
||||
End If
|
||||
If Part.nCALC_GlobalERR = 22 Then
|
||||
MyMachGroupM.nCALC_GlobalERR = 22
|
||||
ElseIf Part.nCALC_GlobalERR > 0 And MyMachGroupM.nCALC_GlobalERR <= 0 Then
|
||||
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
|
||||
ElseIf Part.nCALC_GlobalERR < 0 And MyMachGroupM.nCALC_GlobalERR = 0 Then
|
||||
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
|
||||
End If
|
||||
If Part.nCALC_ROT <> 0 Then
|
||||
MyMachGroupM.m_nCALC_ROT = Part.nCALC_ROT
|
||||
End If
|
||||
If Part.nCALC_FALL <> 0 Then
|
||||
MyMachGroupM.nCALC_FALL = Part.nCALC_FALL
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
Public Sub CalcTimeUpdate(TIME As Integer)
|
||||
EgtSetInfo(Id, ITG_PROD_TIME, TIME, True)
|
||||
nCALC_TIME = TIME
|
||||
NotifyPropertyChanged(NameOf(sUnitTime))
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DeleteMachGroup"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property DeleteMachGroup_Command As ICommand
|
||||
Get
|
||||
If m_cmdDeleteMachGroup Is Nothing Then
|
||||
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroup)
|
||||
End If
|
||||
Return m_cmdDeleteMachGroup
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
#End Region ' DeleteMachGroup
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,507 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class PartVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Protected m_PartM As PartM
|
||||
Public ReadOnly Property PartM As PartM
|
||||
Get
|
||||
Return m_PartM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_ParentMachGroupVM As MyMachGroupVM
|
||||
Public ReadOnly Property ParentMachGroupVM As MyMachGroupVM
|
||||
Get
|
||||
Return m_ParentMachGroupVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Id geometrico del pezzo
|
||||
Public ReadOnly Property nPartId As Integer
|
||||
Get
|
||||
Return m_PartM.nPartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Proj del pezzo
|
||||
Public Property nProjId As Integer
|
||||
Get
|
||||
Return m_PartM.nProjId
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nProjId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Info del pezzo
|
||||
Public ReadOnly Property nPDN As Integer
|
||||
Get
|
||||
Return m_PartM.nPDN
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sNAM As String
|
||||
Get
|
||||
Return m_PartM.sNAM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sL As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dL, 3)
|
||||
End Get
|
||||
End Property
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return m_PartM.dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sW As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dW, 3)
|
||||
End Get
|
||||
End Property
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return m_PartM.dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sH As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dH, 3)
|
||||
End Get
|
||||
End Property
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return m_PartM.dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overridable Property sPOSX As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dPOSX, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_PartM.dPOSX)
|
||||
End Set
|
||||
End Property
|
||||
Public Property dPOSX As Double
|
||||
Get
|
||||
Return m_PartM.dPOSX
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dPOSX = value
|
||||
NotifyPropertyChanged(NameOf(sPOSX))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCNT As Integer
|
||||
Get
|
||||
Return m_PartM.nCNT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCNT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sINVERTED As String
|
||||
Get
|
||||
Return m_PartM.nINVERTED & "°"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sROTATED As String
|
||||
Get
|
||||
Return m_PartM.nROTATED & "°"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return m_PartM.sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_PartM.sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nGlobalState As CalcStates
|
||||
Get
|
||||
Return m_PartM.nCALC_GlobalState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nCALC_GlobalERR As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_GlobalERR
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_GlobalERR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCALC_State As CalcStates
|
||||
Get
|
||||
Return m_PartM.nCALC_State
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_PartM.nCALC_State = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If m_PartM.nCALC_GlobalState = CalcStates.OK Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.NOTCALCULATED Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.INFO Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.WARNING Then
|
||||
Return Brushes.Orange
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.ERROR_ Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nProduction_State As CalcStates
|
||||
Get
|
||||
Return m_PartM.nProductionState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_PartM.SetProductionState(value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Production_Background As SolidColorBrush
|
||||
Get
|
||||
If dtEndTime <> DateTime.MinValue Then ' barra finita
|
||||
Return Brushes.LightGray
|
||||
ElseIf dtStartTime <> DateTime.MinValue Then ' barra iniziata
|
||||
Return Brushes.Green
|
||||
Else ' barra in coda
|
||||
Return Brushes.White
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_PartM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_FALL_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_PartM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Letter As String
|
||||
Get
|
||||
Select Case m_PartM.nCALC_GlobalERR
|
||||
Case 22
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Return "e"
|
||||
Case 17
|
||||
Return "w"
|
||||
Case < 0
|
||||
Return "i"
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
||||
Get
|
||||
Select Case m_PartM.nCALC_GlobalState
|
||||
Case CalcStates.ERROR_
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
Case CalcStates.INFO
|
||||
Return Brushes.Green
|
||||
Case Else
|
||||
Return Brushes.Red
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_ERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_PartM.sCALC_MSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_FALL
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_FALL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle feature del pezzo
|
||||
Protected m_FeatureVMList As ObservableCollection(Of BTLFeatureVM)
|
||||
Public Property FeatureVMList As ObservableCollection(Of BTLFeatureVM)
|
||||
Get
|
||||
Return m_FeatureVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLFeatureVM))
|
||||
m_FeatureVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelFeatureVM As BTLFeatureVM
|
||||
Public Property SelFeatureVM As BTLFeatureVM
|
||||
Get
|
||||
Return m_SelFeatureVM
|
||||
End Get
|
||||
Set(value As BTLFeatureVM)
|
||||
m_SelFeatureVM = value
|
||||
If Not IsNothing(m_SelFeatureVM) Then
|
||||
DirectCast(m_SelFeatureVM, BTLFeatureVM).SelGeomFeature()
|
||||
Else
|
||||
EgtDeselectAll()
|
||||
End If
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelFeatureVM))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtStartTime As DateTime
|
||||
Get
|
||||
Return m_PartM.dtStartTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_PartM.dtStartTime = value
|
||||
NotifyPropertyChanged(NameOf(Production_Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtEndTime As DateTime
|
||||
Get
|
||||
Return m_PartM.dtEndTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_PartM.dtEndTime = value
|
||||
NotifyPropertyChanged(NameOf(Production_Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdDeletePart As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(PartM As PartM)
|
||||
m_PartM = PartM
|
||||
AddHandler m_PartM.BTLFeatureAdded, AddressOf OnBTLFeatureAdded
|
||||
CreateBTLFeatureVMList()
|
||||
End Sub
|
||||
|
||||
Sub New(PartM As PartM, ParentMachGroupVM As MyMachGroupVM)
|
||||
m_PartM = PartM
|
||||
m_ParentMachGroupVM = ParentMachGroupVM
|
||||
AddHandler m_PartM.BTLFeatureAdded, AddressOf OnBTLFeatureAdded
|
||||
CreateBTLFeatureVMList()
|
||||
' Aggiorno stato da stati feature
|
||||
CalcGlobalUpdate()
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Private Sub CreateBTLFeatureVMList()
|
||||
Dim all As List(Of BTLFeatureVM) = (From BTLFeatureM In m_PartM.GetBTLFeatures()
|
||||
Select New BTLFeatureVM(BTLFeatureM)).ToList()
|
||||
|
||||
For Each BTLFeatureVM As BTLFeatureVM In all
|
||||
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_FeatureVMList = New ObservableCollection(Of BTLFeatureVM)(all)
|
||||
AddHandler m_FeatureVMList.CollectionChanged, AddressOf OnBTLFeatureVMListChanged
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcPartUpdate(ERR As Integer, ROT As Integer, MSG As String)
|
||||
EgtSetInfo(nPartId, ITG_PROD_ERR, ERR, True)
|
||||
EgtSetInfo(nPartId, ITG_PROD_MSG, MSG, True)
|
||||
EgtSetInfo(nPartId, ITG_PROD_ROT, ROT, True)
|
||||
m_PartM.nCALC_ERR = ERR
|
||||
m_PartM.nCALC_ROT = ROT
|
||||
m_PartM.sCALC_MSG = MSG
|
||||
If ERR = 0 Then
|
||||
nCALC_State = CalcStates.OK
|
||||
ElseIf ERR = 17 Then
|
||||
nCALC_State = CalcStates.WARNING
|
||||
ElseIf ERR > 0 Then
|
||||
nCALC_State = CalcStates.ERROR_
|
||||
ElseIf ERR < 0 Then
|
||||
nCALC_State = CalcStates.INFO
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Sub
|
||||
|
||||
Public Sub ResetCalcPart()
|
||||
EgtRemoveInfo(nPartId, ITG_PROD_ERR)
|
||||
EgtRemoveInfo(nPartId, ITG_PROD_MSG)
|
||||
EgtRemoveInfo(nPartId, ITG_PROD_ROT)
|
||||
EgtRemoveInfo(nPartId, ITG_PROD_FALL)
|
||||
m_PartM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
m_PartM.nCALC_State = CalcStates.NOTCALCULATED
|
||||
m_PartM.nCALC_GlobalERR = 0
|
||||
m_PartM.nCALC_ERR = 0
|
||||
m_PartM.nCALC_ROT = 0
|
||||
m_PartM.nCALC_FALL = 0
|
||||
m_PartM.sCALC_MSG = ""
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
ParentMachGroupVM.ResetCalcMachGroup()
|
||||
End Sub
|
||||
|
||||
Public Sub CalcFallUpdate(FALL As Integer)
|
||||
EgtSetInfo(nPartId, ITG_PROD_FALL, FALL, True)
|
||||
m_PartM.nCALC_FALL = 0
|
||||
NotifyPropertyChanged(NameOf(nCALC_FALL))
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcGlobalUpdate()
|
||||
m_PartM.nCALC_GlobalState = nCALC_State
|
||||
For Each Feature In FeatureVMList
|
||||
If Not Feature.bDO Then
|
||||
ElseIf Feature.nState = CalcStates.NOTCALCULATED Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
Exit For
|
||||
ElseIf Feature.nState = CalcStates.INFO And m_PartM.nCALC_GlobalState = CalcStates.OK Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.INFO
|
||||
ElseIf Feature.nState = CalcStates.WARNING And (m_PartM.nCALC_GlobalState = CalcStates.OK Or m_PartM.nCALC_GlobalState = CalcStates.INFO) Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.WARNING
|
||||
ElseIf Feature.nState = CalcStates.ERROR_ And (m_PartM.nCALC_GlobalState = CalcStates.OK Or m_PartM.nCALC_GlobalState = CalcStates.INFO Or m_PartM.nCALC_GlobalState = CalcStates.WARNING) Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.ERROR_
|
||||
End If
|
||||
If Feature.nCALC_ERR = 22 Then
|
||||
m_PartM.nCALC_GlobalERR = 22
|
||||
ElseIf Feature.nCALC_ERR > 0 And m_PartM.nCALC_GlobalERR <= 0 Then
|
||||
m_PartM.nCALC_GlobalERR = Feature.nCALC_ERR
|
||||
ElseIf Feature.nCALC_ERR < 0 And m_PartM.nCALC_GlobalERR = 0 Then
|
||||
m_PartM.nCALC_GlobalERR = Feature.nCALC_ERR
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
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()
|
||||
End Sub
|
||||
|
||||
#End Region ' DeletePart
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnBTLFeatureAdded(sender As Object, e As BTLFeatureAddedEventArgs)
|
||||
Dim BTLFeatureVM As BTLFeatureVM = New BTLFeatureVM(e.NewBTLFeature)
|
||||
FeatureVMList.Add(BTLFeatureVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLFeatureVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BTLFeatureVM As BTLFeatureVM In e.NewItems
|
||||
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each BTLFeatureVM As BTLFeatureVM In e.OldItems
|
||||
RemoveHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLFeatureVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,90 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class WallMachGroupVM
|
||||
Inherits MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property m_WallMachGroupM As WallMachGroupM
|
||||
Get
|
||||
Return m_MachGroupM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New(WallMachGroupM As WallMachGroupM)
|
||||
MyBase.New(WallMachGroupM)
|
||||
AddHandler m_WallMachGroupM.PartAdded, AddressOf OnWallAdded
|
||||
AddHandler m_WallMachGroupM.PartRemoved, AddressOf OnWallRemoved
|
||||
CreateWallVMList()
|
||||
' Aggiorno stato da stati feature
|
||||
CalcGlobalUpdate()
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub CreateWallVMList()
|
||||
Dim all As List(Of WallVM) = (From WallM In m_WallMachGroupM.GetParts()
|
||||
Select New WallVM(WallM, Me)).ToList()
|
||||
|
||||
For Each WallVM As WallVM In all
|
||||
AddHandler WallVM.PropertyChanged, AddressOf OnWallVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_PartVMList = New ObservableCollection(Of PartVM)(all)
|
||||
AddHandler m_PartVMList.CollectionChanged, AddressOf OnWallVMListChanged
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
Public Overrides Sub RefreshPartList()
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshGroupData()
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnWallAdded(sender As Object, e As PartAddedEventArgs)
|
||||
Dim WallVM As WallVM = New WallVM(e.NewPart, Me)
|
||||
PartVMList.Add(WallVM)
|
||||
End Sub
|
||||
Private Sub OnWallRemoved(sender As Object, e As PartAddedEventArgs)
|
||||
Dim WallVM As WallVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
|
||||
If Not IsNothing(WallVM) Then PartVMList.Remove(WallVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnWallVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each WallVM As WallVM In e.NewItems
|
||||
AddHandler WallVM.PropertyChanged, AddressOf OnWallVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each WallVM As WallVM In e.OldItems
|
||||
RemoveHandler WallVM.PropertyChanged, AddressOf OnWallVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnWallVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,69 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Input
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class WallVM
|
||||
Inherits PartVM
|
||||
|
||||
Public ReadOnly Property m_WallM As WallM
|
||||
Get
|
||||
Return m_PartM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property sPOSX As String
|
||||
Get
|
||||
Return LenToString(m_WallM.dPOSX, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_WallM.dPOSX)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overridable Property sPOSY As String
|
||||
Get
|
||||
Return LenToString(m_WallM.dPOSY, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_WallM.dPOSY)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property sROT As String
|
||||
Get
|
||||
Return LenToString(m_WallM.dROT, 3) & "°"
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_WallM.dROT)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overridable Property bFLIP As Boolean
|
||||
Get
|
||||
Return m_WallM.bFLIP
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_WallM.bFLIP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(WallM As WallM, ParentMachGroupVM As WallMachGroupVM)
|
||||
MyBase.New(WallM, ParentMachGroupVM)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
+12
-11
@@ -11,6 +11,7 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
@@ -21,20 +22,20 @@ Namespace My.Resources
|
||||
'''<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()> _
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.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)> _
|
||||
<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
|
||||
@@ -44,17 +45,17 @@ Namespace My.Resources
|
||||
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)> _
|
||||
<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)
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
+25
-25
@@ -13,42 +13,42 @@ 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)> _
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.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)
|
||||
|
||||
|
||||
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 addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
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
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, 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
|
||||
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
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="OpenProjectFileDialogV"
|
||||
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.Core"
|
||||
Title="{Binding Title}"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
Height="500" Width="500" Topmost="True"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||
|
||||
<EgtWPFLib5:EgtCustomWindow.Resources>
|
||||
<EgtWPFLib5:FileNameConverter x:Key="FileNameConverter"/>
|
||||
</EgtWPFLib5:EgtCustomWindow.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel>
|
||||
<Grid Grid.Row="0" Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*" />
|
||||
<RowDefinition Height="1*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding FilterType_Msg}"
|
||||
Grid.Row="0" Grid.Column="0"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding SearchColumnList}"
|
||||
SelectedItem="{Binding SelSearchColumn}"
|
||||
Width="Auto"
|
||||
Margin="5"
|
||||
Grid.Row="0" Grid.Column="1"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<TextBlock Text="{Binding Search_Msg}"
|
||||
Margin="0,5,0,0"
|
||||
Grid.Row="1" Grid.Column="0"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SearchText}"
|
||||
Margin="5"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Visibility="{Binding SearchText_Visibility}"/>
|
||||
<Calendar SelectedDatesChanged="Calendar_SelectedDatesChanged"
|
||||
SelectionMode="MultipleRange"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Visibility="{Binding SearchDate_Visibility}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
|
||||
ItemsSource="{Binding ProjectList}"
|
||||
SelectedItem="{Binding SelProject}"
|
||||
CanUserAddRows="False"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
Margin="5"
|
||||
BindingColumns="{Binding ProjectColumns}">
|
||||
<DataGrid.Resources>
|
||||
<!-- ProjId -->
|
||||
<DataGridTextColumn x:Key="colPROJID" Binding="{Binding sProjId}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- ProdId -->
|
||||
<DataGridTextColumn x:Key="colPRODID" Binding="{Binding sProdId}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- BTL FileName -->
|
||||
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- ListName -->
|
||||
<DataGridTextColumn x:Key="colLISTNAME" Binding="{Binding sListName}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.ListName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- Exported date -->
|
||||
<DataGridTextColumn x:Key="colEXPDATE" Binding="{Binding dtExportDate}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.ExportDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- Creation date -->
|
||||
<DataGridTextColumn x:Key="colCRTDATE" Binding="{Binding dtCreateDate}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.CreateDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!-- Name (per Prod) -->
|
||||
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!-- Delete -->
|
||||
<!--
|
||||
<DataGridTemplateColumn x:Key="colDELETE"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="X"
|
||||
Command="{Binding Delete_Command}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>-->
|
||||
</DataGrid.Resources>
|
||||
<!--<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding OpenFileName}"
|
||||
Padding="4,1,4,1">
|
||||
<TextBlock.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick"
|
||||
Command="{Binding DataContext.ProjectDoubleClick_Command, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"
|
||||
CommandParameter="{Binding nProjId}" />
|
||||
</TextBlock.InputBindings>
|
||||
</TextBlock>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>-->
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<EventSetter Event="MouseDoubleClick" Handler="ProjectList_MouseDoubleClick"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
</EgtBEAMWALL:EgtDataGrid>
|
||||
|
||||
<!--<ListBox Grid.Row="0"
|
||||
ItemsSource="{Binding ProjectList}"
|
||||
SelectedItem="{Binding SelProject}"
|
||||
Margin="5">
|
||||
-->
|
||||
<!--<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding ProjFileName}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>-->
|
||||
<!--
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
|
||||
<Setter Property="Padding" Value="0"></Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding OpenFileName}"
|
||||
Padding="4,1,4,1">
|
||||
<TextBlock.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick"
|
||||
Command="{Binding DataContext.ProjectDoubleClick_Command, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"
|
||||
CommandParameter="{Binding nProjId}" />
|
||||
</TextBlock.InputBindings>
|
||||
</TextBlock>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>-->
|
||||
|
||||
|
||||
<UniformGrid Columns="3" Grid.Row="2" Margin="0,0,0,5">
|
||||
<Button IsDefault="True" Name="OpenBtn"
|
||||
Content="{Binding Open_Msg}" Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding Delete_Msg}"
|
||||
Command="{Binding Delete_Command}"
|
||||
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
||||
<Button IsCancel="True"
|
||||
Content="{Binding Cancel_Msg}"
|
||||
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,63 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Windows.Input
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class OpenProjectFileDialogV
|
||||
|
||||
Private WithEvents m_OpenProjFileDialogVM As OpenProjectFileDialogVM
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(Owner As Window, OpenProjFileDialogVM As OpenProjectFileDialogVM)
|
||||
' Funzione che interpreta l'xaml
|
||||
InitializeComponent()
|
||||
Me.Owner = Owner
|
||||
Me.DataContext = OpenProjFileDialogVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_OpenProjFileDialogVM = OpenProjFileDialogVM
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Public Function EgtShowDialog(ProjectType As ProjectType) As Boolean?
|
||||
m_OpenProjFileDialogVM.Init(ProjectType)
|
||||
' mostro la finestra di dialogo
|
||||
Return Me.ShowDialog()
|
||||
End Function
|
||||
Public Function EgtShowDialog(ProjectType As ProjectType, ProjectList As List(Of ProjectFileVM)) As Boolean?
|
||||
m_OpenProjFileDialogVM.Init(ProjectType, ProjectList)
|
||||
' mostro la finestra di dialogo
|
||||
Return Me.ShowDialog()
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub ProjectList_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
|
||||
m_OpenProjFileDialogVM.ProjDoubleClick()
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
Private Sub OpenBtn_Click(sender As Object, e As RoutedEventArgs) Handles OpenBtn.Click
|
||||
DialogResult = m_OpenProjFileDialogVM.VerifySelected()
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_OpenProjFileDialogVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
Private Sub Calendar_SelectedDatesChanged(sender As Object, e As SelectionChangedEventArgs)
|
||||
Dim cal As System.Windows.Controls.Calendar = sender
|
||||
m_OpenProjFileDialogVM.m_SearchDate = cal.SelectedDates
|
||||
m_OpenProjFileDialogVM.m_ProjectList_View.Refresh()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,355 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Windows.Data
|
||||
Imports System.Windows.Input
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class OpenProjectFileDialogVM
|
||||
Inherits VMBase
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property ProjectColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return m_ProjectColumns
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
m_ProjectColumns = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_ProjectType As ProjectType
|
||||
|
||||
Protected m_sFilter As String
|
||||
Public Property Filter As String
|
||||
Get
|
||||
Return m_sFilter
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sFilter = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sFileNameFilter As Predicate(Of String)
|
||||
Public Property FileNameFilter As Predicate(Of String)
|
||||
Get
|
||||
Return m_sFileNameFilter
|
||||
End Get
|
||||
Set(value As Predicate(Of String))
|
||||
m_sFileNameFilter = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sExtensions As New List(Of String)
|
||||
Public ReadOnly Property Extensions As List(Of String)
|
||||
Get
|
||||
Return m_sExtensions
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public m_ProjectList_View As CollectionView = Nothing
|
||||
Protected m_ProjectList As New ObservableCollection(Of ProjectFileVM)
|
||||
Public ReadOnly Property ProjectList As ObservableCollection(Of ProjectFileVM)
|
||||
Get
|
||||
Return m_ProjectList
|
||||
End Get
|
||||
'Set(value As List(Of ProjFile))
|
||||
' m_ProjList = value
|
||||
' NotifyPropertyChanged("ProjList")
|
||||
'End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelProject As ProjectFileVM
|
||||
Public Property SelProject As ProjectFileVM
|
||||
Get
|
||||
Return m_SelProject
|
||||
End Get
|
||||
Set(value As ProjectFileVM)
|
||||
m_SelProject = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_FileName As String
|
||||
Public Property FileName As String
|
||||
Get
|
||||
Return m_FileName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_FileName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista campi per ricerca testuale e con datepicker
|
||||
Protected m_SearchColumnList As New ObservableCollection(Of IdNameStruct)
|
||||
Public ReadOnly Property SearchColumnList As ObservableCollection(Of IdNameStruct)
|
||||
Get
|
||||
Return m_SearchColumnList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_SelSearchColumn As IdNameStruct = Nothing
|
||||
Public Property SelSearchColumn As IdNameStruct
|
||||
Get
|
||||
Return m_SelSearchColumn
|
||||
End Get
|
||||
Set(value As IdNameStruct)
|
||||
' resetto il contenuto della barra di ricerca testuale
|
||||
m_SearchText = ""
|
||||
NotifyPropertyChanged(NameOf(SearchText))
|
||||
' resetto le selezioni sul calendario
|
||||
If Not IsNothing(SearchDate) Then SearchDate.Clear()
|
||||
' setto il Tipo Filtro a NULL e refresho la lista dei progetti (in modo da averli visibili tutti)
|
||||
m_SelSearchColumn = m_SearchColumnList(0)
|
||||
m_ProjectList_View.Refresh()
|
||||
' ora setto il valore scelto come Tipo Filtro
|
||||
m_SelSearchColumn = value
|
||||
Select Case m_SelSearchColumn.Id
|
||||
Case OpenProjFileColumn.ID, OpenProjFileColumn.BTLFILENAME, OpenProjFileColumn.LISTNAME
|
||||
SearchText_Visibility = Visibility.Visible
|
||||
SearchDate_Visibility = Visibility.Collapsed
|
||||
Case OpenProjFileColumn.EXPORTDATE, OpenProjFileColumn.CREATEDATE
|
||||
SearchText_Visibility = Visibility.Collapsed
|
||||
SearchDate_Visibility = Visibility.Visible
|
||||
Case Else
|
||||
SearchText_Visibility = Visibility.Collapsed
|
||||
SearchDate_Visibility = Visibility.Collapsed
|
||||
End Select
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SearchText As String = ""
|
||||
Public Property SearchText As String
|
||||
Get
|
||||
Return m_SearchText
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SearchText = value
|
||||
m_ProjectList_View.Refresh()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend m_SearchDate As SelectedDatesCollection = Nothing
|
||||
Public ReadOnly Property SearchDate As SelectedDatesCollection
|
||||
Get
|
||||
Return m_SearchDate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_SearchText_Visibility As Visibility = Visibility.Collapsed
|
||||
Public Property SearchText_Visibility As Visibility
|
||||
Get
|
||||
Return m_SearchText_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_SearchText_Visibility = value
|
||||
NotifyPropertyChanged(NameOf(SearchText_Visibility))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SearchDate_Visibility As Visibility = Visibility.Collapsed
|
||||
Public Property SearchDate_Visibility As Visibility
|
||||
Get
|
||||
Return m_SearchDate_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_SearchDate_Visibility = value
|
||||
NotifyPropertyChanged(NameOf(SearchDate_Visibility))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Enum OpenProjFileColumn As Integer
|
||||
NULL = 0
|
||||
ID = 1
|
||||
BTLFILENAME = 2
|
||||
LISTNAME = 3
|
||||
EXPORTDATE = 4
|
||||
CREATEDATE = 5
|
||||
End Enum
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property FilterType_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61836)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Search_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61837)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Id_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61815)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property BTLFileName_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61819)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ListName_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61820)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ExportDate_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61821)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property CreateDate_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61822)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Name_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61808)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Open_Msg As String
|
||||
Get
|
||||
Return EgtMsg(30006)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Delete_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61823)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Cancel_Msg As String
|
||||
Get
|
||||
Return EgtMsg(30002)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdProjectDoubleClick As ICommand
|
||||
Private m_cmdDelete As ICommand
|
||||
|
||||
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing) As Boolean?
|
||||
|
||||
Protected Sub LoadColumns(ProjectType As ProjectType)
|
||||
If ProjectType = ProjectType.PROJ Then
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, ProjectColumns)
|
||||
' carico campi su cui eseguire il filtro di ricerca
|
||||
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
||||
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.LISTNAME, ListName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.EXPORTDATE, ExportDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg)})
|
||||
ElseIf ProjectType = ProjectType.PROD Then
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
|
||||
' carico campi su cui eseguire il filtro di ricerca
|
||||
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
||||
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg)})
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Function VerifySelected() As Boolean
|
||||
If IsNothing(SelProject) Then Return False
|
||||
Dim AllFilesInDir As IEnumerable(Of String)
|
||||
If m_ProjectType = Core.ConstBeam.ProjectType.PROJ Then
|
||||
' verifico se esiste ProdId
|
||||
AllFilesInDir = IO.Directory.EnumerateFiles(SelProject.sProjDirPath)
|
||||
ElseIf m_ProjectType = Core.ConstBeam.ProjectType.PROD Then
|
||||
AllFilesInDir = IO.Directory.EnumerateFiles(SelProject.sProdDirPath)
|
||||
End If
|
||||
For Each File In AllFilesInDir
|
||||
If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Protected Function ProjectFilter(Proj As Object) As Boolean
|
||||
Dim bProjectOk As Boolean = True
|
||||
If m_ProjectType = ProjectType.PROJ Then
|
||||
Dim CurrProj As ProjFileVM = DirectCast(Proj, ProjFileVM)
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.EXPORTDATE AndAlso Not SearchDate.Contains(CurrProj.dtExportDate.Date)) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProjId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
ElseIf m_ProjectType = ProjectType.PROD Then
|
||||
Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
End If
|
||||
Return bProjectOk
|
||||
End Function
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "ProjectDoubleClick"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do New.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ProjectDoubleClick_Command As ICommand
|
||||
Get
|
||||
If m_cmdProjectDoubleClick Is Nothing Then
|
||||
m_cmdProjectDoubleClick = New Command(AddressOf ProjDoubleClick)
|
||||
End If
|
||||
Return m_cmdProjectDoubleClick
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Friend Sub ProjDoubleClick()
|
||||
If VerifySelected() Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ProjectDoubleClick
|
||||
|
||||
#Region "Delete"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do New.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Delete_Command As ICommand
|
||||
Get
|
||||
If m_cmdDelete Is Nothing Then
|
||||
m_cmdDelete = New Command(AddressOf Delete)
|
||||
End If
|
||||
Return m_cmdDelete
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Friend Overridable Sub Delete()
|
||||
End Sub
|
||||
|
||||
#End Region ' Delete
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,69 @@
|
||||
Imports System.IO
|
||||
|
||||
Public Class ProdFile
|
||||
|
||||
'Private m_nProjId As Integer = 0
|
||||
'Public ReadOnly Property nProjId As Integer
|
||||
' Get
|
||||
' Return m_nProjId
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Friend ReadOnly Property sProjPath As String
|
||||
' Get
|
||||
' Dim sPath As String = String.Empty
|
||||
' If IsNothing(m_nProjId) OrElse m_nProjId = 0 Then Return String.Empty
|
||||
' sPath = refMainWindowVM.MainWindowM.sProjsDir & "\" & nProjId.ToString("0000") & "\" & nProjId.ToString("0000") & FILENAMESEPARATOR
|
||||
' If Not IsNothing(m_nProdId) AndAlso m_nProdId > 0 Then
|
||||
' sPath &= nProjId.ToString("0000")
|
||||
' End If
|
||||
' sPath &= FILENAMESEPARATOR & BTLFileName & ".nge"
|
||||
' Return sPath
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Private m_nProdId As Integer = 0
|
||||
Public ReadOnly Property nProdId As Integer
|
||||
Get
|
||||
Return m_nProdId
|
||||
End Get
|
||||
End Property
|
||||
Friend ReadOnly Property sProdPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(m_nProdId) OrElse m_nProdId = 0 Then Return String.Empty
|
||||
Return refMainWindowVM.MainWindowM.sProdsDir & "\" & nProdId.ToString("0000") & "\" & nProdId.ToString("0000") & ".nge"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Private m_BTLFileName As String = String.Empty
|
||||
'Public ReadOnly Property BTLFileName As String
|
||||
' Get
|
||||
' Return m_BTLFileName
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Private m_NewProd As Boolean
|
||||
Friend Property NewProd As Boolean
|
||||
Get
|
||||
Return m_NewProd
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_NewProd = value
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property ProjectFileName As String
|
||||
Get
|
||||
Return m_nProdId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(ProdFileName As String)
|
||||
Integer.TryParse(Path.GetFileNameWithoutExtension(ProdFileName), m_nProdId)
|
||||
End Sub
|
||||
|
||||
Friend Sub SetProdId(nProdId As Integer)
|
||||
m_nProdId = nProdId
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,105 @@
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ProdFileVM
|
||||
Inherits ProjectFileVM
|
||||
|
||||
Public ReadOnly Property ProdFileM As ProdFileM
|
||||
Get
|
||||
Return m_ProjectFileM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nProjIdList As List(Of Integer)
|
||||
Get
|
||||
Return ProdFileM.nProjIdList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property nProdId As Integer
|
||||
Get
|
||||
Return ProdFileM.nProdId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property sProdDirPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(ProdFileM.nProdId) OrElse ProdFileM.nProdId = 0 Then Return String.Empty
|
||||
Return m_sProdsDir & "\" & nProdId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
Public Overrides ReadOnly Property sProdPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(ProdFileM.nProdId) OrElse ProdFileM.nProdId = 0 Then Return String.Empty
|
||||
Return m_sProdsDir & "\" & nProdId.ToString("0000") & "\" & nProdId.ToString("0000") & ".nge"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property bIsNew As Boolean
|
||||
Get
|
||||
Return ProdFileM.bIsNew
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ProdFileM.bIsNew = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return ProdFileM.sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sBTLFileName As String
|
||||
Public ReadOnly Property sBTLFileName As String
|
||||
Get
|
||||
Return m_sBTLFileName
|
||||
End Get
|
||||
End Property
|
||||
Protected Sub SetBTLFileName(value As String)
|
||||
m_sBTLFileName = value
|
||||
End Sub
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New(ProdFileM As ProdFileM)
|
||||
m_ProjectFileM = ProdFileM
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
Friend Function GetProjPath(nProjId As Integer)
|
||||
Dim sPath As String = String.Empty
|
||||
If nProjId = 0 Then Return String.Empty
|
||||
Return m_sProjsDir & "\" & nProjId.ToString("0000") & "\" & nProjId.ToString("0000") & ".nge"
|
||||
End Function
|
||||
|
||||
' funzione che restituisce le parti di nome file
|
||||
Friend Shared Function VerifyProjectFile(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
If nProjectType = ProjectType.PROJ Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
Return True
|
||||
Else Return False
|
||||
End If
|
||||
ElseIf nProjectType = ProjectType.PROD Then
|
||||
Return Integer.TryParse(ProjectFileName, nProdId)
|
||||
Else Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,125 @@
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ProjFileVM
|
||||
Inherits ProjectFileVM
|
||||
|
||||
Public ReadOnly Property ProjFileM As ProjFileM
|
||||
Get
|
||||
Return m_ProjectFileM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property nProjId As Integer
|
||||
Get
|
||||
Return ProjFileM.nProjId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property nProdId As Integer
|
||||
Get
|
||||
Return ProjFileM.nProdId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property sProjDirPath As String
|
||||
Get
|
||||
If IsNothing(ProjFileM.nProjId) OrElse ProjFileM.nProjId = 0 Then Return String.Empty
|
||||
Return m_sProjsDir & "\" & nProjId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
Public Overrides ReadOnly Property sProjPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(ProjFileM.nProjId) OrElse ProjFileM.nProjId = 0 Then Return String.Empty
|
||||
sPath = m_sProjsDir & "\" & nProjId.ToString("0000") & "\" & nProjId.ToString("0000") & ".nge"
|
||||
Return sPath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property sProdDirPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(ProjFileM.nProdId) OrElse ProjFileM.nProdId = 0 Then Return String.Empty
|
||||
Return m_sProdsDir & "\" & nProdId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
Public Overrides ReadOnly Property sProdPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(ProjFileM.nProdId) OrElse ProjFileM.nProdId = 0 Then Return String.Empty
|
||||
Return m_sProdsDir & "\" & nProdId.ToString("0000") & "\" & nProdId.ToString("0000") & ".nge"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property bIsNew As Boolean
|
||||
Get
|
||||
Return ProjFileM.bIsNew
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ProjFileM.bIsNew = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sBTLFileName As String
|
||||
Get
|
||||
Return ProjFileM.sBTLFileName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sListName As String
|
||||
Get
|
||||
Return ProjFileM.sListName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dtExportDate As DateTime
|
||||
Get
|
||||
Return ProjFileM.dtExportDate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New(ProjectFileM As ProjFileM)
|
||||
m_ProjectFileM = ProjectFileM
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Public Sub SetBTLFileName(BTLFileName As String)
|
||||
ProjFileM.sBTLFileName = BTLFileName
|
||||
End Sub
|
||||
|
||||
' funzione che restituisce le parti di nome file
|
||||
Friend Shared Function VerifyProjectFile(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
If nProjectType = ProjectType.PROJ Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
Return True
|
||||
Else Return False
|
||||
End If
|
||||
ElseIf nProjectType = ProjectType.PROD Then
|
||||
Return Integer.TryParse(ProjectFileName, nProdId)
|
||||
Else Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,145 @@
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ProjectFileVM
|
||||
Inherits VMBase
|
||||
|
||||
Protected Shared m_sProjsDir As String
|
||||
Protected Shared m_sProdsDir As String
|
||||
|
||||
Protected m_ProjectFileM As ProjectFileM
|
||||
|
||||
Public Overridable ReadOnly Property nProjId As Integer
|
||||
Get
|
||||
Return m_ProjectFileM.nProjId
|
||||
End Get
|
||||
End Property
|
||||
Public Overridable ReadOnly Property sProjId As String
|
||||
Get
|
||||
Return m_ProjectFileM.nProjId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable ReadOnly Property nProdId As Integer
|
||||
Get
|
||||
Return m_ProjectFileM.nProdId
|
||||
End Get
|
||||
End Property
|
||||
Public Overridable ReadOnly Property sProdId As String
|
||||
Get
|
||||
Return m_ProjectFileM.nProdId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable ReadOnly Property sProjDirPath As String
|
||||
Get
|
||||
If IsNothing(m_ProjectFileM.nProjId) OrElse m_ProjectFileM.nProjId = 0 Then Return String.Empty
|
||||
Return m_sProjsDir & "\" & nProjId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
Public Overridable ReadOnly Property sProjPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(m_ProjectFileM.nProjId) OrElse m_ProjectFileM.nProjId = 0 Then Return String.Empty
|
||||
sPath = m_sProjsDir & "\" & nProjId.ToString("0000") & "\" & nProjId.ToString("0000") & ".nge"
|
||||
Return sPath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable ReadOnly Property sProdDirPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(m_ProjectFileM.nProdId) OrElse m_ProjectFileM.nProdId = 0 Then Return String.Empty
|
||||
Return m_sProdsDir & "\" & nProdId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
Public Overridable ReadOnly Property sProdPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(m_ProjectFileM.nProdId) OrElse m_ProjectFileM.nProdId = 0 Then Return String.Empty
|
||||
Return m_sProdsDir & "\" & nProdId.ToString("0000") & "\" & nProdId.ToString("0000") & ".nge"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable Property bIsNew As Boolean
|
||||
Get
|
||||
Return m_ProjectFileM.bIsNew
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_ProjectFileM.bIsNew = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overridable Property bIsLocked As Boolean
|
||||
Get
|
||||
Return m_ProjectFileM.bIsLocked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_ProjectFileM.bIsLocked = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dtCreateDate As DateTime
|
||||
Get
|
||||
Return m_ProjectFileM.dtCreateDate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' variabile che indica se ricaricare il progetto
|
||||
Private m_bReloadProject As Boolean = True
|
||||
Friend ReadOnly Property bReloadProject As Boolean
|
||||
Get
|
||||
Return m_bReloadProject
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Id_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61815)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property BTLFileName_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61819)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ListName_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61820)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ExportDate_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61821)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property CreateDate_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61822)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Name_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61808)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
Public Sub SetReloadProject(bValue As Boolean)
|
||||
m_bReloadProject = bValue
|
||||
End Sub
|
||||
|
||||
Public Shared Sub Init(sProjsDir As String, sProdsDir As String)
|
||||
m_sProjsDir = sProjsDir
|
||||
m_sProdsDir = sProdsDir
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,330 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Module CoreMap
|
||||
|
||||
'Private m_refMainWindowVM As MainWindowVM
|
||||
'Private m_refMyStatusBarVM As MyStatusBarVM
|
||||
'Private m_refProjManagerVM As ProjManagerVM
|
||||
'Private m_refProdManagerVM As ProdManagerVM
|
||||
'Private m_refProjectVM As ProjectVM
|
||||
'Private m_refMainMenuVM As MainMenuVM
|
||||
Private m_refMachinePanelVM As MachinePanelVM
|
||||
Private m_refMyMachGroupPanelVM As MyMachGroupPanelVM
|
||||
'Private m_refLeftPanelVM As LeftPanelVM
|
||||
'Private m_refBottomPanelVM As BottomPanelVM
|
||||
'Private m_refShowBeamPanelVM As ShowBeamPanelVM
|
||||
'Private m_refConfigurationPageVM As ConfigurationPageVM
|
||||
'Private m_refRawPartListVM As RawPartListVM
|
||||
'Private m_refPartInRawPartListVM As PartInRawPartListVM
|
||||
'Private m_refWarehouseWndVM As WarehouseWndVM
|
||||
'Private m_refFeatureListVM As FeatureListVM
|
||||
'Private m_refFreeContourManagerVM As FreeContourManagerVM
|
||||
'Private m_refFreeContourInputVM As FreeContourInputVM
|
||||
'Private m_refPartManagerVM As PartManagerVM
|
||||
'Private m_refInstrumentPanelVM As InstrumentPanelVM
|
||||
'Private m_refTopPanelVM As TopPanelVM
|
||||
'Private m_refOptimizePanelVM As OptimizePanelVM
|
||||
'Private m_refOpenProjectFileDialogVM As OpenProjectFileDialogVM
|
||||
|
||||
#Region "Get"
|
||||
|
||||
'Public ReadOnly Property refMainWindowVM As MainWindowVM
|
||||
' Get
|
||||
' Return m_refMainWindowVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refMyStatusBarVM As MyStatusBarVM
|
||||
' Get
|
||||
' Return LibMap.refStatusBarVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refProjManagerVM As ProjManagerVM
|
||||
' Get
|
||||
' Return m_refProjManagerVM
|
||||
' End Get
|
||||
'End Property
|
||||
'Public ReadOnly Property refProdManagerVM As ProdManagerVM
|
||||
' Get
|
||||
' Return m_refProdManagerVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refProjectVM As ProjectVM
|
||||
' Get
|
||||
' Return m_refProjectVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Public ReadOnly Property refSceneHostVM As SceneHostVM
|
||||
Get
|
||||
Return LibMap.refSceneHostVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Public ReadOnly Property refShowPanelVM As ShowPanelVM
|
||||
' Get
|
||||
' Return LibMap.refShowPanelVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refMainMenuVM As MainMenuVM
|
||||
' Get
|
||||
' Return m_refMainMenuVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Public ReadOnly Property refMachinePanelVM As MachinePanelVM
|
||||
Get
|
||||
Return m_refMachinePanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Public ReadOnly Property refLeftPanelVM As LeftPanelVM
|
||||
' Get
|
||||
' Return m_refLeftPanelVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Public ReadOnly Property refMachGroupPanelVM As MyMachGroupPanelVM
|
||||
Get
|
||||
Return m_refMyMachGroupPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Public ReadOnly Property refBottomPanelVM As BottomPanelVM
|
||||
' Get
|
||||
' Return m_refBottomPanelVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refShowBeamPanelVM As ShowBeamPanelVM
|
||||
' Get
|
||||
' Return m_refShowBeamPanelVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refConfigurationPageVM As ConfigurationPageVM
|
||||
' Get
|
||||
' Return m_refConfigurationPageVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refRawPartListVM As RawPartListVM
|
||||
' Get
|
||||
' Return m_refRawPartListVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refPartInRawPartListVM As PartInRawPartListVM
|
||||
' Get
|
||||
' Return m_refPartInRawPartListVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refWarehouseWndVM As WarehouseWndVM
|
||||
' Get
|
||||
' Return m_refWarehouseWndVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refFeatureListVM As FeatureListVM
|
||||
' Get
|
||||
' Return m_refFeatureListVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refFreeContourManagerVM As FreeContourManagerVM
|
||||
' Get
|
||||
' Return m_refFreeContourManagerVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refFreeContourInputVM As FreeContourInputVM
|
||||
' Get
|
||||
' Return m_refFreeContourInputVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refPartManagerVM As PartManagerVM
|
||||
' Get
|
||||
' Return m_refPartManagerVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refInstrumentPanelVM As MyInstrumentPanelVM
|
||||
' Get
|
||||
' Return m_refInstrumentPanelVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refTopPanelVM As TopPanelVM
|
||||
' Get
|
||||
' Return m_refTopPanelVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refOptimizePanelVM As OptimizePanelVM
|
||||
' Get
|
||||
' Return m_refOptimizePanelVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property refOpenProjectFileDialogVM As OpenProjectFileDialogVM
|
||||
' Get
|
||||
' Return m_refOpenProjectFileDialogVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
#End Region ' Get
|
||||
|
||||
#Region "Set"
|
||||
|
||||
'Friend Function SetRefMyStatusBarVM(MyStatusBarVM As MyStatusBarVM) As Boolean
|
||||
' LibMap.SetRefStatusBarVM(MyStatusBarVM)
|
||||
' Return Not IsNothing(LibMap.refStatusBarVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefProjManagerVM(ProjManagerVM As ProjManagerVM) As Boolean
|
||||
' m_refProjManagerVM = ProjManagerVM
|
||||
' Return Not IsNothing(m_refProjManagerVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefProdManagerVM(ProdManagerVM As ProdManagerVM) As Boolean
|
||||
' m_refProdManagerVM = ProdManagerVM
|
||||
' Return Not IsNothing(m_refProdManagerVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefProjectVM(ProjectVM As ProjectVM) As Boolean
|
||||
' m_refProjectVM = ProjectVM
|
||||
' Return Not IsNothing(m_refProjectVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefMainMenuVM(MainMenuVM As MainMenuVM) As Boolean
|
||||
' m_refMainMenuVM = MainMenuVM
|
||||
' Return Not IsNothing(m_refMainMenuVM)
|
||||
'End Function
|
||||
|
||||
Public Function SetRefSceneHostVM(SceneHostVM As SceneHostVM) As Boolean
|
||||
LibMap.SetRefSceneHostVM(SceneHostVM)
|
||||
Return Not IsNothing(LibMap.refSceneHostVM)
|
||||
End Function
|
||||
|
||||
'Friend Function SetRefShowPanelVM(ShowPanelVM As ShowPanelVM) As Boolean
|
||||
' LibMap.SetRefShowPanelVM(ShowPanelVM)
|
||||
' Return Not IsNothing(LibMap.refShowPanelVM)
|
||||
'End Function
|
||||
|
||||
Public Function SetRefMachinePanelVM(MachinePanelVM As MachinePanelVM) As Boolean
|
||||
m_refMachinePanelVM = MachinePanelVM
|
||||
Return Not IsNothing(m_refMachinePanelVM)
|
||||
End Function
|
||||
|
||||
'Friend Function SetRefLeftPanelVM(LeftPanelVM As LeftPanelVM) As Boolean
|
||||
' m_refLeftPanelVM = LeftPanelVM
|
||||
' Return Not IsNothing(m_refLeftPanelVM)
|
||||
'End Function
|
||||
|
||||
Public Function SetRefMachGroupPanelVM(MachGroupPanelVM As MyMachGroupPanelVM) As Boolean
|
||||
m_refMyMachGroupPanelVM = MachGroupPanelVM
|
||||
Return Not IsNothing(m_refMyMachGroupPanelVM)
|
||||
End Function
|
||||
|
||||
'Friend Function SetRefBottomPanelVM(BottomPanelVM As BottomPanelVM) As Boolean
|
||||
' m_refBottomPanelVM = BottomPanelVM
|
||||
' Return Not IsNothing(m_refBottomPanelVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefShowBeamPanelVM(ShowBeamPanelVM As ShowBeamPanelVM) As Boolean
|
||||
' m_refShowBeamPanelVM = ShowBeamPanelVM
|
||||
' Return Not IsNothing(m_refShowBeamPanelVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefConfigurationPageVM(ConfigurationPageVM As ConfigurationPageVM) As Boolean
|
||||
' m_refConfigurationPageVM = ConfigurationPageVM
|
||||
' Return Not IsNothing(m_refConfigurationPageVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefRawPartListVM(RawPartListVM As RawPartListVM) As Boolean
|
||||
' m_refRawPartListVM = RawPartListVM
|
||||
' Return Not IsNothing(m_refRawPartListVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefPartInRawPartListVM(PartInRawPartListVM As PartInRawPartListVM) As Boolean
|
||||
' m_refPartInRawPartListVM = PartInRawPartListVM
|
||||
' Return Not IsNothing(m_refPartInRawPartListVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefWarehouseWndVM(WarehouseWndVM As WarehouseWndVM) As Boolean
|
||||
' m_refWarehouseWndVM = WarehouseWndVM
|
||||
' Return Not IsNothing(m_refWarehouseWndVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefFeatureListVM(FeatureListVM As FeatureListVM) As Boolean
|
||||
' m_refFeatureListVM = FeatureListVM
|
||||
' Return Not IsNothing(m_refFeatureListVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefFreeContourManagerVM(FreeContourManagerVM As FreeContourManagerVM) As Boolean
|
||||
' m_refFreeContourManagerVM = FreeContourManagerVM
|
||||
' Return Not IsNothing(m_refFreeContourManagerVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefFreeContourInputVM(FreeContourInputVM As FreeContourInputVM) As Boolean
|
||||
' m_refFreeContourInputVM = FreeContourInputVM
|
||||
' Return Not IsNothing(m_refFreeContourInputVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefPartManagerVM(PartManagerVM As PartManagerVM) As Boolean
|
||||
' m_refPartManagerVM = PartManagerVM
|
||||
' Return Not IsNothing(m_refPartManagerVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefInstrumentPanelVM(InstrumentPanelVM As InstrumentPanelVM) As Boolean
|
||||
' m_refInstrumentPanelVM = InstrumentPanelVM
|
||||
' Return Not IsNothing(m_refInstrumentPanelVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefTopPanelVM(TopPanelVM As TopPanelVM) As Boolean
|
||||
' m_refTopPanelVM = TopPanelVM
|
||||
' Return Not IsNothing(m_refTopPanelVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefOptimizePanelVM(OptimizePanelVM As OptimizePanelVM) As Boolean
|
||||
' m_refOptimizePanelVM = OptimizePanelVM
|
||||
' Return Not IsNothing(m_refOptimizePanelVM)
|
||||
'End Function
|
||||
|
||||
'Friend Function SetRefOpenProjectFileDialogVM(OpenProjectFileDialogVM As OpenProjectFileDialogVM) As Boolean
|
||||
' m_refOpenProjectFileDialogVM = OpenProjectFileDialogVM
|
||||
' Return Not IsNothing(m_refOpenProjectFileDialogVM)
|
||||
'End Function
|
||||
|
||||
#End Region ' Set
|
||||
|
||||
#Region "Init"
|
||||
|
||||
'Friend Function BeginInit(MainWindowVM As MainWindowVM) As Boolean
|
||||
' m_refMainWindowVM = MainWindowVM
|
||||
' Return Not IsNothing(m_refMainWindowVM)
|
||||
'End Function
|
||||
Friend Function EndInit() As Boolean
|
||||
'Return Not IsNothing(m_refMainWindowVM) AndAlso Not IsNothing(m_refMainMenuVM) AndAlso
|
||||
' Not IsNothing(LibMap.refStatusBarVM) AndAlso Not IsNothing(m_refProjManagerVM) AndAlso
|
||||
' Not IsNothing(m_refProdManagerVM) AndAlso Not IsNothing(m_refConfigurationPageVM) AndAlso
|
||||
' Not IsNothing(LibMap.refSceneHostVM) AndAlso Not IsNothing(LibMap.refShowPanelVM) AndAlso
|
||||
' Not IsNothing(m_refMachinePanelVM) AndAlso Not IsNothing(LibMap.refMachGroupPanelVM) AndAlso
|
||||
' Not IsNothing(m_refRawPartListVM) AndAlso Not IsNothing(m_refWarehouseWndVM) AndAlso
|
||||
' Not IsNothing(m_refFeatureListVM) AndAlso Not IsNothing(m_refPartInRawPartListVM) AndAlso
|
||||
' Not IsNothing(m_refFreeContourManagerVM) AndAlso Not IsNothing(m_refFreeContourInputVM) AndAlso
|
||||
' Not IsNothing(m_refInstrumentPanelVM) AndAlso Not IsNothing(m_refTopPanelVM) AndAlso
|
||||
' Not IsNothing(m_refPartManagerVM) AndAlso Not IsNothing(m_refOptimizePanelVM) AndAlso
|
||||
' Not IsNothing(m_refShowBeamPanelVM) AndAlso Not IsNothing(m_refOpenProjectFileDialogVM) AndAlso
|
||||
' LibMap.EndInit()
|
||||
Return Not IsNothing(m_refMachinePanelVM) AndAlso Not IsNothing(LibMap.refMachGroupPanelVM)
|
||||
End Function
|
||||
|
||||
#End Region ' Init
|
||||
|
||||
End Module
|
||||
@@ -6,121 +6,9 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BTLFeatureVM
|
||||
Inherits VMBase
|
||||
Inherits Core.BTLFeatureVM
|
||||
|
||||
Private WithEvents m_BTLFeatureM As BTLFeatureM
|
||||
Public ReadOnly Property BTLFeatureM As BTLFeatureM
|
||||
Get
|
||||
Return m_BTLFeatureM
|
||||
End Get
|
||||
End Property
|
||||
Private m_BTLPartM As BTLPartM
|
||||
|
||||
Public ReadOnly Property nFeatureId As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nFeatureId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property GRPList As ObservableCollection(Of Integer)
|
||||
Get
|
||||
Return m_BTLFeatureM.GRPList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Integer))
|
||||
m_BTLFeatureM.GRPList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nSelGRP As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nSelGRP
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value <> -1 Then
|
||||
' aggiorno la feature con nuovo valore
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
||||
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(value, m_BTLFeatureM.nPRC, nSelSIDE, m_BTLFeatureM.sDES, m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
If bOK Then
|
||||
m_BTLFeatureM.nSelGRP = value
|
||||
' seleziono feature in disegno
|
||||
SelGeomFeature()
|
||||
' rendo non calcolata questa feature
|
||||
CalcFeatureUpdate(False, 0, 0, 0, "")
|
||||
Else
|
||||
NotifyPropertyChanged("nSelGRP")
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nSelGRP))
|
||||
EgtDraw()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Friend ReadOnly Property sDescGRP As String
|
||||
Get
|
||||
Dim sDescConstruction As String = String.Empty
|
||||
If CalcBeamPrivateProfileGRP(m_BTLFeatureM.nSelGRP) = 0 Then
|
||||
sDescConstruction = "L"
|
||||
Else
|
||||
sDescConstruction = "T"
|
||||
End If
|
||||
sDescConstruction &= m_BTLFeatureM.nPRC.ToString("000")
|
||||
Return sDescConstruction
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nPRC As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nPRC
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_BTLFeatureM.nPRC = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SIDEList As ObservableCollection(Of Integer)
|
||||
Get
|
||||
Return m_BTLFeatureM.SIDEList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Integer))
|
||||
m_BTLFeatureM.SIDEList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Lato
|
||||
Public Property nSelSIDE As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nSelSIDE
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value <> -1 Then
|
||||
' aggiorno la feature con nuovo valore
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
||||
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(nSelGRP, m_BTLFeatureM.nPRC, value, m_BTLFeatureM.sDES, m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
If bOK Then
|
||||
m_BTLFeatureM.nSelSIDE = value
|
||||
SelGeomFeature()
|
||||
' rendo non calcolata questa feature
|
||||
CalcFeatureUpdate(False, 0, 0, 0, "")
|
||||
Else
|
||||
NotifyPropertyChanged("nSelGRP")
|
||||
End If
|
||||
EgtDraw()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_BTLFeatureM.sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property bDO As Boolean
|
||||
Public Overrides Property bDO As Boolean
|
||||
Get
|
||||
Return m_BTLFeatureM.bDO
|
||||
End Get
|
||||
@@ -134,214 +22,8 @@ Public Class BTLFeatureVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nPRID As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nPRID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_BTLFeatureM.nPRID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property sDES As String
|
||||
Get
|
||||
Return m_BTLFeatureM.sDES
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_BTLFeatureM.sDES = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property frFRAME As Frame3d
|
||||
Get
|
||||
Return m_BTLFeatureM.frFRAME
|
||||
End Get
|
||||
Set(value As Frame3d)
|
||||
m_BTLFeatureM.frFRAME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' proprieta' che mostra la descrizione in interfaccia
|
||||
Public ReadOnly Property sDesc As String
|
||||
Get
|
||||
Return sDescGRP & " " & sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sDrawPath As String
|
||||
Get
|
||||
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nState As CalcStates
|
||||
Get
|
||||
Return m_BTLFeatureM.nState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nCALC_ERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nCALC_ROT
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_MSG As String
|
||||
Get
|
||||
Return m_BTLFeatureM.sCALC_MSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If Not m_BTLFeatureM.bDO Then
|
||||
Return Brushes.Aqua
|
||||
ElseIf m_BTLFeatureM.nState = 0 Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_BTLFeatureM.nState < 0 Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf m_BTLFeatureM.nState > 0 Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_BTLFeatureM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Letter As String
|
||||
Get
|
||||
Select Case m_BTLFeatureM.nCALC_ERR
|
||||
Case 22
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Return "e"
|
||||
Case 17
|
||||
Return "w"
|
||||
Case < 0
|
||||
Return "i"
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
||||
Get
|
||||
Select Case m_BTLFeatureM.nCALC_ERR
|
||||
Case 19, 22, 23, 24, 25
|
||||
Return Brushes.Red
|
||||
Case 17
|
||||
Return Brushes.Orange
|
||||
Case < 0
|
||||
Return Brushes.Green
|
||||
Case Else
|
||||
Return Brushes.Red
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Private m_PBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
||||
'Public Property PBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
||||
' Get
|
||||
' Return m_PBTLParamVMList
|
||||
' End Get
|
||||
' Set(value As ObservableCollection(Of BTLParamVM))
|
||||
' m_PBTLParamVMList = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
'Protected m_SelPBTLParam As BTLParamVM
|
||||
'Public Property SelPBTLParam As BTLParamVM
|
||||
' Get
|
||||
' Return m_SelPBTLParam
|
||||
' End Get
|
||||
' Set(value As BTLParamVM)
|
||||
' m_SelPBTLParam = value
|
||||
' If Not IsNothing(m_SelPBTLParam) Then
|
||||
' ' imposto path disegno da mostrare in BottomPanel
|
||||
' Map.refBottomPanelVM.SetCurrDraw(sDrawPath)
|
||||
' End If
|
||||
' NotifyPropertyChanged(NameOf(SelPBTLParam))
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
'Private m_QBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
||||
'Public Property QBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
||||
' Get
|
||||
' Return m_QBTLParamVMList
|
||||
' End Get
|
||||
' Set(value As ObservableCollection(Of BTLParamVM))
|
||||
' m_QBTLParamVMList = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
'Protected m_SelQParam As BTLParamVM
|
||||
'Public Property SelQBTLParam As BTLParamVM
|
||||
' Get
|
||||
' Return m_SelQParam
|
||||
' End Get
|
||||
' Set(value As BTLParamVM)
|
||||
' m_SelQParam = value
|
||||
' If Not IsNothing(m_SelQParam) Then
|
||||
' ' imposto path disegno da mostrare in BottomPanel
|
||||
' Map.refBottomPanelVM.SetCurrDraw(sDrawPath)
|
||||
' End If
|
||||
' NotifyPropertyChanged(NameOf(SelQBTLParam))
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdDeleteFeature As ICommand
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
'Sub New(ParentPart As BTLPartVM, nFeatureId As Integer)
|
||||
' MyBase.New(ParentPart, nFeatureId)
|
||||
' ' leggo gruppo, numero feature e lato
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_GRP, m_nSelGRP)
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_PRC, m_nPRC)
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_SIDE, m_nSelSIDE)
|
||||
' Dim nDO As Integer = 1
|
||||
' If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
||||
' m_bDO = (nDO <> 0)
|
||||
' Else
|
||||
' m_bDO = True
|
||||
' End If
|
||||
' ' leggo des,prid e frame
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_DES, m_sDES)
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_PRID, m_nPRID)
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_FRAME, m_frFRAME)
|
||||
' ' leggo calc error
|
||||
' Dim nErr As Integer = 0
|
||||
' Dim nRot As Integer = 0
|
||||
' Dim nFall As Integer = 0
|
||||
' Dim sMsg As String = ""
|
||||
' Dim bCalc As Boolean = False
|
||||
' bCalc = EgtGetInfo(m_nFeatureId, ITG_PROJ_ERR, nErr)
|
||||
' EgtGetInfo(m_nFeatureId, ITG_PROJ_ROT, nRot)
|
||||
' EgtGetInfo(m_nFeatureId, ITG_PROJ_FALL, nFall)
|
||||
' EgtGetInfo(m_nFeatureId, ITG_PROJ_MSG, sMsg)
|
||||
' CalcFeatureUpdate(bCalc, nErr, nRot, nFall, sMsg)
|
||||
' ' leggo parametri della feature
|
||||
' GetBeamPrivateProfileGRPList(CalcBeamPrivateProfileGRP(nSelGRP), m_nPRC, m_GRPList)
|
||||
' GetBeamPrivateProfileName(m_nSelGRP, m_nPRC, Me)
|
||||
' ' crea parametri per questa feature da file ini
|
||||
' CreateFeatureParams()
|
||||
' ReadFeatureParams()
|
||||
'End Sub
|
||||
|
||||
Sub New(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM)
|
||||
m_BTLFeatureM = BTLFeatureM
|
||||
'AddHandler m_BTLFeatureM.PBTLParamAdded, AddressOf OnPBTLParamAdded
|
||||
@@ -366,160 +48,10 @@ Public Class BTLFeatureVM
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
'Private Sub CreatePBTLParamVMList()
|
||||
' Dim all As List(Of BTLParamVM) = (From BTLParamM In m_BTLFeatureM.GetPBTLParams()
|
||||
' Select New BTLParamVM(BTLParamM, m_BTLFeatureM)).ToList()
|
||||
|
||||
' For Each BTLParamVM As BTLParamVM In all
|
||||
' AddHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
|
||||
' Next
|
||||
|
||||
' m_PBTLParamVMList = New ObservableCollection(Of BTLParamVM)(all)
|
||||
' AddHandler m_PBTLParamVMList.CollectionChanged, AddressOf OnPBTLParamVMListChanged
|
||||
|
||||
'End Sub
|
||||
|
||||
'Private Sub CreateQBTLParamVMList()
|
||||
' Dim all As List(Of BTLParamVM) = (From BTLParamM In m_BTLFeatureM.GetQBTLParams()
|
||||
' Select New BTLParamVM(BTLParamM, m_BTLFeatureM)).ToList()
|
||||
' For Each BTLParamVM As BTLParamVM In all
|
||||
' AddHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
|
||||
' Next
|
||||
|
||||
' m_QBTLParamVMList = New ObservableCollection(Of BTLParamVM)(all)
|
||||
' AddHandler m_QBTLParamVMList.CollectionChanged, AddressOf OnQBTLParamVMListChanged
|
||||
'End Sub
|
||||
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Friend Sub CalcFeatureUpdate(bCalc As Boolean, ERR As Integer, ROT As Integer, FALL As Integer, MSG As String)
|
||||
If Not bCalc Then
|
||||
m_BTLFeatureM.nState = CalcStates.NOTCALCULATED
|
||||
m_BTLFeatureM.nCALC_ERR = 0
|
||||
m_BTLFeatureM.nCALC_ROT = 0
|
||||
m_BTLFeatureM.sCALC_MSG = ""
|
||||
Else
|
||||
m_BTLFeatureM.nCALC_ERR = ERR
|
||||
m_BTLFeatureM.nCALC_ROT = ROT
|
||||
m_BTLFeatureM.sCALC_MSG = MSG
|
||||
If ERR = 0 Then
|
||||
m_BTLFeatureM.nState = 0
|
||||
ElseIf ERR > 1 Then
|
||||
m_BTLFeatureM.nState = 1
|
||||
ElseIf ERR < 1 Then
|
||||
m_BTLFeatureM.nState = -1
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Sub
|
||||
|
||||
' funzione che seleziona la feature nella geometria
|
||||
Friend Shared Sub SelGeomFeature(Feature As BTLFeatureVM)
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(Feature) Then EgtSelectObj(Feature.nFeatureId)
|
||||
End Sub
|
||||
Friend Sub SelGeomFeature()
|
||||
EgtDeselectAll()
|
||||
EgtSelectObj(nFeatureId)
|
||||
End Sub
|
||||
|
||||
Public Function Copy() As BTLFeatureM
|
||||
' creo nuova feature
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
||||
' aggiorno la feature con nuovo valore
|
||||
EgtBeamSetPart(m_BTLPartM.nPartId)
|
||||
Dim nNewFeatureId As Integer = EgtBeamAddProcess(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
|
||||
m_BTLFeatureM.ParentPart.NewProcId(), m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
' se è stata creata
|
||||
If nNewFeatureId <> GDB_ID.NULL Then
|
||||
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
|
||||
' la aggiungo a struttura BTL corrente
|
||||
m_BTLPartM.AddBTLFeature(NewFeat)
|
||||
Return NewFeat
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Public Function Copy(DestBTLPart As BTLPartM) As Boolean
|
||||
' creo nuova feature
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
||||
' aggiorno la feature con nuovo valore
|
||||
EgtBeamSetPart(DestBTLPart.nPartId)
|
||||
Dim nNewFeatureId As Integer = EgtBeamAddProcess(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
|
||||
DestBTLPart.NewProcId(), m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
' se è stata creata
|
||||
If nNewFeatureId <> GDB_ID.NULL Then
|
||||
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
|
||||
' la aggiungo a struttura BTL pezzo di destinazione
|
||||
DestBTLPart.AddBTLFeature(NewFeat)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
'Private Sub OnPBTLParamAdded(sender As Object, e As BTLParamAddedEventArgs) Handles m_BTLFeatureM.PBTLParamAdded
|
||||
' Dim BTLParamVM As BTLParamVM = New BTLParamVM(e.NewBTLParam, m_BTLFeatureM)
|
||||
' PBTLParamVMList.Add(BTLParamVM)
|
||||
'End Sub
|
||||
'Private Sub OnQBTLParamAdded(sender As Object, e As BTLParamAddedEventArgs) Handles m_BTLFeatureM.QBTLParamAdded
|
||||
' Dim BTLParamVM As BTLParamVM = New BTLParamVM(e.NewBTLParam, m_BTLFeatureM)
|
||||
' QBTLParamVMList.Add(BTLParamVM)
|
||||
'End Sub
|
||||
|
||||
'Private Sub OnPBTLParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
' If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
' For Each BTLParamVM As BTLParamVM In e.NewItems
|
||||
' AddHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
|
||||
' Next
|
||||
' End If
|
||||
' If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
' For Each BTLParamVM As BTLParamVM In e.OldItems
|
||||
' RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
|
||||
' Next
|
||||
' End If
|
||||
'End Sub
|
||||
'Private Sub OnQBTLParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
' If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
' For Each BTLParamVM As BTLParamVM In e.NewItems
|
||||
' AddHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
|
||||
' Next
|
||||
' End If
|
||||
' If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
' For Each BTLParamVM As BTLParamVM In e.OldItems
|
||||
' RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
|
||||
' Next
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
'Private Sub OnPBTLParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
' Select Case e.PropertyName
|
||||
' Case "dValue", "sValue"
|
||||
' ' riseleziono questa feature
|
||||
' SelGeomFeature()
|
||||
' ' rendo non calcolata questa feature
|
||||
' CalcFeatureUpdate(False, 0, 0, 0, "")
|
||||
' End Select
|
||||
'End Sub
|
||||
'Private Sub OnQBTLParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
' Select Case e.PropertyName
|
||||
' 'Case "sMATERIAL"
|
||||
' End Select
|
||||
'End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -243,7 +243,6 @@
|
||||
<Compile Include="MachGroupPanel\BeamVM.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\PartVM.vb" />
|
||||
<Compile Include="MachinePanel\MachinePanelV.xaml.vb">
|
||||
<DependentUpon>MachinePanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -253,12 +252,8 @@
|
||||
<Compile Include="MachManagingThread\MachManagingThread.vb" />
|
||||
<Compile Include="MachManagingThread\RWVariableManager.vb" />
|
||||
<Compile Include="MainWindow\MainWindowM.vb" />
|
||||
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml.vb">
|
||||
<DependentUpon>OpenProjectFileDialogV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogVM.vb" />
|
||||
<Compile Include="ProjectManager\ProdFileVM.vb" />
|
||||
<Compile Include="ProjectManager\ProjectFileVM.vb" />
|
||||
<Compile Include="Project\ProjectV.xaml.vb">
|
||||
<DependentUpon>ProjectV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -286,6 +281,8 @@
|
||||
</Compile>
|
||||
<Compile Include="Utility\Map.vb" />
|
||||
<Compile Include="Utility\VMBase.vb" />
|
||||
<Compile Include="ViewerOptimizerCommThread\ViewerOptimizerComm.vb" />
|
||||
<Compile Include="ViewerOptimizerCommThread\ViewerOptimizerCommThread.vb" />
|
||||
<Compile Include="ViewPanel\ViewPanelV.xaml.vb">
|
||||
<DependentUpon>ViewPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -326,10 +323,6 @@
|
||||
<DependentUpon>MainWindowV.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Project\ProjectV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
||||
@@ -456,6 +449,7 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\AboutBoxImage.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -92,7 +92,7 @@ Public Class LeftPanelVM
|
||||
End If
|
||||
DbControllers.m_MachGroupController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup.Id, ItemState.Produced)
|
||||
' aggiungere status!!
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Calc_Background))
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Production_Background))
|
||||
|
||||
Next
|
||||
End Sub
|
||||
|
||||
@@ -245,7 +245,7 @@ Public Class MachCommandMessagePanelVM
|
||||
Public Sub Connect(ByVal param As Object)
|
||||
' creo thread gestione macchina
|
||||
m_MachManagingThread = New Thread(Sub()
|
||||
CommunicationThread.MachManagingThreadFunction(AddressOf ResultCallbackDlg, AddressOf CloseCallbackDlg,
|
||||
MachineCommThread.MachManagingThreadFunction(AddressOf ResultCallbackDlg, AddressOf CloseCallbackDlg,
|
||||
AddressOf UpdateCallbackDlg, AddressOf AlarmCallbackDlg,
|
||||
AddressOf AxisCoordinatesCallbackDlg, AddressOf OpStateCallbackDlg,
|
||||
AddressOf ReadVarCallbackDlg)
|
||||
|
||||
@@ -7,278 +7,21 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BeamMachGroupVM
|
||||
Inherits MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property m_BeamMachGroupM As BeamMachGroupM
|
||||
Get
|
||||
Return m_MachGroupM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sStartCut As String
|
||||
Get
|
||||
Return LenToString(m_BeamMachGroupM.dStartCut, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dValue As Double
|
||||
If StringToLen(value, dValue) Then
|
||||
Dim dOldValue As Double = m_BeamMachGroupM.dStartCut
|
||||
m_BeamMachGroupM.dStartCut = dValue
|
||||
If Not ReDrawBeamMachgroup() Then
|
||||
' rispristino vecchio valore
|
||||
m_BeamMachGroupM.dStartCut = dOldValue
|
||||
ReDrawBeamMachgroup()
|
||||
End If
|
||||
m_BeamMachGroupM.dStartCut = dValue
|
||||
EgtDraw()
|
||||
If PartVMList.Count > 0 Then
|
||||
Dim Beam As BeamVM = DirectCast(PartVMList(0), BeamVM)
|
||||
Beam.UpdateOffset()
|
||||
Beam.NotifyPropertyChanged("sOffset")
|
||||
End If
|
||||
Else
|
||||
NotifyPropertyChanged("sStartCut")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Public Property dStartCut As Double
|
||||
Get
|
||||
Return m_BeamMachGroupM.dStartCut
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_BeamMachGroupM.dStartCut = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SelBeam As BeamVM
|
||||
Get
|
||||
Return m_SelPart
|
||||
End Get
|
||||
Set(value As BeamVM)
|
||||
m_SelPart = value
|
||||
End Set
|
||||
End Property
|
||||
Inherits Core.BeamMachGroupVM
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdDeleteMachGroup As ICommand
|
||||
|
||||
Sub New(BeamMachGroupM As BeamMachGroupM)
|
||||
MyBase.New(BeamMachGroupM)
|
||||
AddHandler m_BeamMachGroupM.PartAdded, AddressOf OnBeamAdded
|
||||
AddHandler m_BeamMachGroupM.PartRemoved, AddressOf OnBeamRemoved
|
||||
CreateBeamVMList()
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub CreateBeamVMList()
|
||||
Dim all As List(Of BeamVM) = (From BeamM In m_BeamMachGroupM.GetParts()
|
||||
Select New BeamVM(BeamM)).ToList()
|
||||
|
||||
For Each BeamVM As BeamVM In all
|
||||
AddHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_PartVMList = New ObservableCollection(Of PartVM)(all)
|
||||
AddHandler m_PartVMList.CollectionChanged, AddressOf OnBeamVMListChanged
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
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_BeamMachGroupM.dStartCut)
|
||||
Else
|
||||
m_BeamMachGroupM.dStartCut = 0
|
||||
End If
|
||||
' aggiorno lista pezzi
|
||||
PartVMList.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 BeamVM = New BeamVM(Me, nPartId, nRawPartId)
|
||||
'''PartVMList.Add(NewBeam)
|
||||
'''NewBeam.UpdateOffset()
|
||||
End If
|
||||
nRawPartId = EgtGetNextRawPart(nRawPartId)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshGroupData()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateUsage()
|
||||
m_BeamMachGroupM.SetTotMat(dL)
|
||||
m_BeamMachGroupM.SetMatForPart(0)
|
||||
For Each Part In PartVMList
|
||||
m_BeamMachGroupM.SetMatForPart(m_BeamMachGroupM.dMatForPart + Part.dL)
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(dUsage))
|
||||
NotifyPropertyChanged(NameOf(dWaste))
|
||||
End Sub
|
||||
|
||||
Friend Function ReDrawBeamMachgroup() As Boolean
|
||||
'' scrivo dati di tutti i pezzi
|
||||
'Dim dPosX As Double = m_BeamMachGroupM.dStartCut
|
||||
'Dim nIndex As Integer
|
||||
'For nIndex = 0 To PartVMList.Count - 1
|
||||
' If nIndex <> 0 Then
|
||||
' Dim Beam As BeamVM = DirectCast(PartVMList(nIndex), BeamVM)
|
||||
' dPosX += Beam.m_BeamM.dOffset
|
||||
' End If
|
||||
' PartVMList(nIndex).dPOSX = dPosX
|
||||
' EgtSetInfo(Id, MGR_RPT_PART & nIndex + 1, PartVMList(nIndex).nPartId & "," & dPosX)
|
||||
' dPosX += PartVMList(nIndex).dL
|
||||
'Next
|
||||
'' elimino eventuali successive info pezzi di troppo
|
||||
'nIndex = PartVMList.Count + 1
|
||||
'Dim sTemp As String = ""
|
||||
'While EgtGetInfo(Id, MGR_RPT_PART & nIndex, sTemp)
|
||||
' EgtSetInfo(Id, MGR_RPT_PART & nIndex, "")
|
||||
'End While
|
||||
'' elimino vecchio grezzo ed eseguo script creazione nuovo
|
||||
'Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||
'While nRawId <> GDB_ID.NULL
|
||||
' EgtRemoveRawPart(nRawId)
|
||||
' nRawId = EgtGetFirstRawPart()
|
||||
'End While
|
||||
'If Not ExecBeam(Map.refMainWindowVM.MainWindowM.sTempDir, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdType.RAWPART, False) Then Return False
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Sub MoveBeam(Beam As BeamVM, MoveDirection As MoveDirections)
|
||||
Dim nBeamIndex As Integer = PartVMList.IndexOf(Beam)
|
||||
If nBeamIndex = 0 AndAlso MoveDirection = MoveDirections.UP Then Return
|
||||
If nBeamIndex = PartVMList.Count - 1 AndAlso MoveDirection = MoveDirections.DOWN Then Return
|
||||
' se pezzo mosso diventa primo
|
||||
Dim FirstBeam As BeamVM
|
||||
If (nBeamIndex = 1 AndAlso MoveDirection = MoveDirections.UP) OrElse (nBeamIndex = 0 AndAlso MoveDirection = MoveDirections.DOWN) Then
|
||||
'' resetto offset per vecchio primo
|
||||
FirstBeam = DirectCast(PartVMList(0), BeamVM)
|
||||
FirstBeam.ResetOffset()
|
||||
End If
|
||||
PartVMList.Move(nBeamIndex, nBeamIndex + MoveDirection)
|
||||
ReDrawBeamMachgroup()
|
||||
' aggiorno offset primo pezzo
|
||||
FirstBeam = DirectCast(PartVMList(0), BeamVM)
|
||||
FirstBeam.UpdateOffset()
|
||||
FirstBeam.NotifyPropertyChanged(NameOf(FirstBeam.sOffset))
|
||||
End Sub
|
||||
|
||||
Friend Sub ReorderBeam()
|
||||
Dim TempPartList = PartVMList.OrderBy(Function(x) x.dL).ToList()
|
||||
' verifico se non sono già in oridne
|
||||
Dim bSort As Boolean = False
|
||||
For PartIndex = 0 To PartVMList.Count - 1
|
||||
If PartVMList(PartIndex).nPartId <> TempPartList(PartIndex).nPartId Then
|
||||
bSort = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not bSort Then Return
|
||||
' resetto offset primo pezzo
|
||||
Dim FirstBeam As BeamVM = DirectCast(PartVMList(0), BeamVM)
|
||||
FirstBeam.ResetOffset()
|
||||
PartVMList.Clear()
|
||||
For Each Part In TempPartList
|
||||
PartVMList.Add(Part)
|
||||
Next
|
||||
ReDrawBeamMachgroup()
|
||||
' aggiorno offset primo pezzo
|
||||
FirstBeam = DirectCast(PartVMList(0), BeamVM)
|
||||
FirstBeam.UpdateOffset()
|
||||
FirstBeam.NotifyPropertyChanged(NameOf(FirstBeam.sOffset))
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DeleteMachGroup"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property DeleteMachGroup_Command As ICommand
|
||||
Get
|
||||
If m_cmdDeleteMachGroup Is Nothing Then
|
||||
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroup)
|
||||
End If
|
||||
Return m_cmdDeleteMachGroup
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Overrides 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)
|
||||
' rimuovo dalla lista grezzi
|
||||
Dim Index As Integer = Map.refMachGroupPanelVM.MachGroupVMList.IndexOf(Me)
|
||||
If Index = 0 Then
|
||||
If Map.refMachGroupPanelVM.MachGroupVMList.Count > 0 Then
|
||||
Map.refMachGroupPanelVM.SelectedMachGroup = Map.refMachGroupPanelVM.MachGroupVMList(0)
|
||||
Else
|
||||
Map.refMachGroupPanelVM.SelectedMachGroup = Nothing
|
||||
End If
|
||||
ElseIf Index = Map.refMachGroupPanelVM.MachGroupvmList.Count - 1 Then
|
||||
If Map.refMachGroupPanelVM.MachGroupVMList.Count > 1 Then
|
||||
Map.refMachGroupPanelVM.SelectedMachGroup = Map.refMachGroupPanelVM.MachGroupVMList(Map.refMachGroupPanelVM.MachGroupVMList.Count - 2)
|
||||
Else
|
||||
Map.refMachGroupPanelVM.SelectedMachGroup = Nothing
|
||||
End If
|
||||
Else
|
||||
Map.refMachGroupPanelVM.SelectedMachGroup = Map.refMachGroupPanelVM.MachGroupVMList(Index - 1)
|
||||
End If
|
||||
Map.refMachGroupPanelVM.MachGroupVMList.Remove(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' DeleteMachGroup
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnBeamAdded(sender As Object, e As PartAddedEventArgs)
|
||||
Dim BeamVM As BeamVM = New BeamVM(e.NewPart)
|
||||
PartVMList.Add(BeamVM)
|
||||
End Sub
|
||||
Private Sub OnBeamRemoved(sender As Object, e As PartAddedEventArgs)
|
||||
Dim BeamVM As BeamVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
|
||||
If Not IsNothing(BeamVM) Then PartVMList.Remove(BeamVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnBeamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BeamVM As BeamVM In e.NewItems
|
||||
AddHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each BeamVM As BeamVM In e.OldItems
|
||||
RemoveHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnBeamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -5,44 +5,7 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BeamVM
|
||||
Inherits PartVM
|
||||
|
||||
Public ReadOnly Property m_BeamM As BeamM
|
||||
Get
|
||||
Return m_PartM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sOffset As String
|
||||
Get
|
||||
Return LenToString(m_BeamM.dOffset, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dValue As Double
|
||||
If StringToLen(value, dValue) Then
|
||||
Dim dOldValue As Double = m_BeamM.dOffset
|
||||
m_BeamM.dOffset = dValue
|
||||
'''Dim BeamMachGroup As BeamMachGroupVM = DirectCast(ParentMachGroup, BeamMachGroupVM)
|
||||
'''If Not BeamMachGroup.ReDrawBeamMachgroup() Then
|
||||
''' ' rispristino vecchio valore
|
||||
''' m_BeamM.dOffset = dOldValue
|
||||
''' BeamMachGroup.ReDrawBeamMachgroup()
|
||||
'''End If
|
||||
Else
|
||||
NotifyPropertyChanged("sOffset")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property dOffset As Double
|
||||
Get
|
||||
Return m_BeamM.dOffset
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Sub ResetOffset()
|
||||
'm_BeamM.dOffset = RawPartConfiguration.dBeamDist
|
||||
'NotifyPropertyChanged(NameOf(sOffset))
|
||||
End Sub
|
||||
Inherits Core.BeamVM
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
@@ -54,96 +17,6 @@ Public Class BeamVM
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
'Sub New(nParentMachGroup As Core.MyMachGroupM, nPartId As Integer, nRawPartId As Integer)
|
||||
' MyBase.New(nParentMachGroup, nPartId, nRawPartId)
|
||||
' ' leggo info pezzo
|
||||
' EgtGetInfo(nPartId, BTL_PRT_PROJ, nProjId)
|
||||
' EgtGetInfo(nPartId, BTL_PRT_PDN, nPDN)
|
||||
' EgtGetInfo(nPartId, BTL_PRT_NAM, sNAM)
|
||||
' EgtGetInfo(nPartId, BTL_PRT_L, dL)
|
||||
' EgtGetInfo(nPartId, BTL_PRT_W, dW)
|
||||
' EgtGetInfo(nPartId, BTL_PRT_H, dH)
|
||||
' EgtGetInfo(nPartId, BTL_PRT_CNT, nCNT)
|
||||
' Dim nTemp As Integer = 0
|
||||
' If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
|
||||
' nTemp = 0
|
||||
' End If
|
||||
' SetRotated(nTemp)
|
||||
' If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, nTemp) Then
|
||||
' nTemp = 0
|
||||
' End If
|
||||
' SetInverted(nTemp)
|
||||
' ' leggo PosX
|
||||
' Dim sInfo As String = ""
|
||||
' Dim Index = 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 sSplitInfo(0) = nPartId Then
|
||||
' bFound = True
|
||||
' Exit While
|
||||
' End If
|
||||
' End If
|
||||
' Index += 1
|
||||
' End While
|
||||
' If bFound Then
|
||||
' StringToDouble(sSplitInfo(1), dPOSX)
|
||||
' End If
|
||||
' ' leggo feature
|
||||
' Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
|
||||
' Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
|
||||
' While nFeatureId <> GDB_ID.NULL
|
||||
' ' verifico che sia una feature
|
||||
' Dim nGRP As Integer
|
||||
' If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
|
||||
' ' creo la feature
|
||||
' '''FeatureList.Add(New BTLFeatureVM(Nothing, nFeatureId))
|
||||
' End If
|
||||
' nFeatureId = EgtGetNext(nFeatureId)
|
||||
' End While
|
||||
'End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Friend Sub UpdateOffset()
|
||||
' calcolo offset
|
||||
'''Dim nBeamIndex As Integer = ParentMachGroup.PartMList.IndexOf(Me)
|
||||
'''If nBeamIndex > 0 Then
|
||||
''' m_BeamM.dOffset = dPOSX - (ParentMachGroup.PartMList(nBeamIndex - 1).dPOSX + ParentMachGroup.PartMList(nBeamIndex - 1).dL)
|
||||
'''Else
|
||||
''' Dim BeamMachGroup As BeamMachGroupVM = DirectCast(ParentMachGroup, BeamMachGroupVM)
|
||||
''' m_BeamM.dOffset = BeamMachGroup.dStartCut
|
||||
'''End If
|
||||
End Sub
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Overrides Sub DeletePart()
|
||||
' elimino pezzo copia
|
||||
EgtRemovePartFromRawPart(Me.nPartId)
|
||||
EgtErase(Me.nPartId)
|
||||
'''' rimuovo dalla lista pezzi
|
||||
'''Dim Index As Integer = ParentMachGroup.PartMList.IndexOf(Function(x) x.nPartId = Me.nPartId)
|
||||
'''If Index = 0 Then
|
||||
''' If ParentMachGroup.PartMList.Count > 0 Then
|
||||
''' ParentMachGroup.SelPart = ParentMachGroup.PartMList(0)
|
||||
''' Else
|
||||
''' ParentMachGroup.SelPart = Nothing
|
||||
''' End If
|
||||
'''ElseIf Index = ParentMachGroup.PartMList.Count - 1 Then
|
||||
''' If ParentMachGroup.PartMList.Count > 1 Then
|
||||
''' ParentMachGroup.SelPart = ParentMachGroup.PartMList(ParentMachGroup.PartMList.Count - 2)
|
||||
''' Else
|
||||
''' ParentMachGroup.SelPart = Nothing
|
||||
''' End If
|
||||
'''Else
|
||||
''' ParentMachGroup.SelPart = ParentMachGroup.PartMList(Index - 1)
|
||||
'''End If
|
||||
'''ParentMachGroup.PartMList.Remove(Me)
|
||||
'''Dim BeamParentMachGroup As BeamMachGroupVM = DirectCast(ParentMachGroup, BeamMachGroupVM)
|
||||
'''If Not IsNothing(BeamParentMachGroup) Then BeamParentMachGroup.ReDrawBeamMachgroup()
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -6,16 +6,10 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MyMachGroupPanelVM
|
||||
Inherits NewMachGroupPanelVM
|
||||
Inherits Core.MyMachGroupPanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Public ReadOnly Property m_MyMachGroupPanelM As MyMachGroupPanelM
|
||||
Get
|
||||
Return m_MachGroupPanelM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -25,27 +19,12 @@ Public Class MyMachGroupPanelVM
|
||||
' Recupero la macchina di default
|
||||
Dim sDefaultMachine As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MACH, K_CURRMACH, "", sDefaultMachine)
|
||||
' Creo riferimento a questa classe in Map
|
||||
Map.SetRefMachGroupPanelVM(Me)
|
||||
'''InitMachGroupPanel(True, Map.refMachinePanelVM.MachineList.ToList(), sDefaultMachine)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Protected Overrides Sub CreateMachGroupVMList()
|
||||
Dim all As List(Of MachGroupVM) = (From MachGroupM In m_MachGroupPanelM.GetMachGroups()
|
||||
Select If(DirectCast(MachGroupM, MyMachGroupM).nMachineType = MachineType.BEAM, New BeamMachGroupVM(MachGroupM), New MachGroupVM(MachGroupM))).ToList()
|
||||
|
||||
For Each MachGroupvM As MachGroupVM In all
|
||||
AddHandler MachGroupvM.PropertyChanged, AddressOf OnMachGroupVMPropertyChanged
|
||||
Next
|
||||
|
||||
MachGroupVMList = New ObservableCollection(Of MachGroupVM)(all)
|
||||
AddHandler MachGroupVMList.CollectionChanged, AddressOf OnMachGroupVMListChanged
|
||||
End Sub
|
||||
|
||||
Public Function FirstNotToBeProducedIndex() As Integer
|
||||
Return MachGroupVMList.IndexOf(MachGroupVMList.FirstOrDefault(Function(x) DirectCast(x, MyMachGroupVM).bToBeProduced = False))
|
||||
End Function
|
||||
@@ -61,104 +40,14 @@ Public Class MyMachGroupPanelVM
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Overrides Function InitMachGroupList(Optional bUseDefaults As Boolean = False) As Boolean
|
||||
' Svuoto precedente lista di MachGroup
|
||||
MachGroupVMList.Clear()
|
||||
' aggiorno copie
|
||||
MyMachGroupPanelM.UpdateDuplo()
|
||||
' verifico se esistono già gruppi di lavorazione o se devo creare il primo
|
||||
Dim bOk As Boolean = False
|
||||
Dim nId = EgtGetFirstMachGroup()
|
||||
If nId <> GDB_ID.NULL Then
|
||||
bOk = EgtSetCurrMachGroup(nId)
|
||||
End If
|
||||
If Not bOk Then Return True
|
||||
' carico lista dei gruppi di lavorazione
|
||||
m_MachGroupPanelM.MachGroupMList = MyMachGroupPanelM.LoadMyMachGroups(Map.refMachinePanelVM.MachineList.ToList())
|
||||
' elimino copie da cancellare
|
||||
MyMachGroupPanelM.DeleteDuplo()
|
||||
If bOk Then SelectedMachGroup = MachGroupVMList(0)
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function RefreshMachGroupList() As Boolean
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Sub AddMachGroup()
|
||||
Dim SelMyMachine As MyMachine = Map.refMachinePanelVM.SelectedMachine
|
||||
Dim MyMachGroupM As MyMachGroupM = m_MyMachGroupPanelM.NewMyMachGroup(SelMyMachine.Name, SelMyMachine.nType)
|
||||
If Not IsNothing(MyMachGroupM) Then Return
|
||||
'' creo oggetto gruppo creato
|
||||
'Dim sNewMachGroupName As String = String.Empty
|
||||
'Dim sNewMachGroupMachineName As String = String.Empty
|
||||
'EgtGetMachGroupName(nNewMachGroupID, sNewMachGroupName)
|
||||
'EgtGetMachGroupMachineName(nNewMachGroupID, sNewMachGroupMachineName)
|
||||
'Dim MyMachGroup As MyMachGroupM
|
||||
'If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM Then
|
||||
' MyMachGroup = New BeamMachGroupVM(nNewMachGroupID, sNewMachGroupName, sNewMachGroupMachineName)
|
||||
'Else
|
||||
' MyMachGroup = New WallMachGroup(nNewMachGroupID, sNewMachGroupName, sNewMachGroupMachineName)
|
||||
'End If
|
||||
'' lo aggiungo alla lista
|
||||
'MachGroupList.Add(MyMachGroup)
|
||||
' e lo seleziono
|
||||
SelectedMachGroup = MachGroupVMList.FirstOrDefault(Function(x) x.MachGroupM Is MyMachGroupM)
|
||||
End Sub
|
||||
|
||||
Public Overrides Function OnPreSetCurrMachGroup() As Boolean
|
||||
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
|
||||
' Imposto vista solo tavola
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtSetView(VT.ISO_SW, False)
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' funzione che seleziona ultimo gruppo
|
||||
Friend Sub SelLastMachGroup()
|
||||
If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
|
||||
SelectedMachGroup = MachGroupVMList(MachGroupVMList.Count - 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Function GetLastMachGroup() As MachGroupVM
|
||||
If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
|
||||
Return MachGroupVMList(MachGroupVMList.Count - 1)
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Protected Overrides Sub OnMachGroupAdded(sender As Object, e As MachGroupAddedEventArgs)
|
||||
Dim MachGroupVM As MachGroupVM = Nothing
|
||||
Select Case DirectCast(e.NewMachGroupM, MyMachGroupM).nMachineType
|
||||
Case Core.ConstBeam.MachineType.BEAM
|
||||
MachGroupVM = New BeamMachGroupVM(e.NewMachGroupM)
|
||||
Case Core.ConstBeam.MachineType.WALL
|
||||
'MachGroupVM = New wallMachGroupVM(e.NewMachGroupM)
|
||||
Case Core.ConstBeam.MachineType.NULL
|
||||
Return
|
||||
End Select
|
||||
MachGroupVMList.Add(MachGroupVM)
|
||||
NotifyPropertyChanged(NameOf(MachGroupVMList))
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnMachGroupVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
'Case nameof(sender.sMATERIAL)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -7,133 +7,9 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class MyMachGroupVM
|
||||
Inherits MachGroupVM
|
||||
Inherits Core.MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property MyMachGroupM As MyMachGroupM
|
||||
Get
|
||||
Return m_MachGroupM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nMachineType As MachineType
|
||||
Get
|
||||
Return MyMachGroupM.nMachineType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return MyMachGroupM.dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
MyMachGroupM.dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return MyMachGroupM.dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
MyMachGroupM.dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return MyMachGroupM.dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
MyMachGroupM.dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtStartTime As DateTime
|
||||
Get
|
||||
Return MyMachGroupM.dtStartTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
MyMachGroupM.dtStartTime = value
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtEndTime As DateTime
|
||||
Get
|
||||
Return MyMachGroupM.dtEndTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
MyMachGroupM.dtEndTime = value
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dUsage As Double
|
||||
Get
|
||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, MyMachGroupM.dMatForPart / MyMachGroupM.dTotMat * 100, 0)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dWaste As Double
|
||||
Get
|
||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, (MyMachGroupM.dTotMat - MyMachGroupM.dMatForPart) / MyMachGroupM.dTotMat * 100, 0)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sUsage As String
|
||||
Get
|
||||
Return DoubleToString( dUsage, 3)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sWaste As String
|
||||
Get
|
||||
Return DoubleToString( dWaste, 3)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return MyMachGroupM.sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
MyMachGroupM.sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei pezzi che sono nel grezzo
|
||||
Protected m_PartVMList As New ObservableCollection(Of PartVM)
|
||||
Public Property PartVMList As ObservableCollection(Of PartVM)
|
||||
Get
|
||||
Return m_PartVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of PartVM))
|
||||
m_PartVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelPart As PartVM
|
||||
Public Overridable Property SelPart As PartVM
|
||||
Get
|
||||
Return m_SelPart
|
||||
End Get
|
||||
Set(value As PartVM)
|
||||
m_SelPart = value
|
||||
' seleziono pezzo
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(value) Then EgtSelectObj(SelPart.nPartId)
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelPart))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nState As CalcStates
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_State
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Public Overrides ReadOnly Property Production_Background As SolidColorBrush
|
||||
Get
|
||||
If dtEndTime <> DateTime.MinValue Then ' barra finita
|
||||
Return Brushes.LightGray
|
||||
@@ -188,12 +64,14 @@ Public MustInherit Class MyMachGroupVM
|
||||
' definizione comandi
|
||||
Private m_cmdProduceMachGroup As ICommand
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New(MyMachGroupM As MyMachGroupM)
|
||||
MyBase.New(MyMachGroupM)
|
||||
'aggiorno lista pezzi
|
||||
RefreshPartList()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub ResetProduce()
|
||||
@@ -205,34 +83,6 @@ Public MustInherit Class MyMachGroupVM
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
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()
|
||||
MyMachGroupM.SetState(CalcStates.OK)
|
||||
For Each Part In PartVMList
|
||||
If Part.nGlobalState > 0 AndAlso nState = CalcStates.OK Then
|
||||
MyMachGroupM.SetState(CalcStates.ERROR_)
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Sub
|
||||
|
||||
Public Function CnFilePath() As String
|
||||
Return Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & Name & ".cnc"
|
||||
End Function
|
||||
@@ -275,7 +125,7 @@ Public MustInherit Class MyMachGroupVM
|
||||
DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, Id, NewIndex)
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(OldIndex, NewIndex)
|
||||
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(nCALC_State))
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -9,401 +9,23 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class PartVM
|
||||
Inherits VMBase
|
||||
Inherits Core.PartVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Protected m_PartM As PartM
|
||||
Public ReadOnly Property PartM As PartM
|
||||
Get
|
||||
Return m_PartM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ParentMachGroup As MyMachGroupM
|
||||
Get
|
||||
Return m_PartM.ParentMachGroup
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Id geometrico del pezzo
|
||||
Public ReadOnly Property nPartId As Integer
|
||||
Get
|
||||
Return m_PartM.nPartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Proj del pezzo
|
||||
Public Property nProjId As Integer
|
||||
Get
|
||||
Return m_PartM.nProjId
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nProjId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Info del pezzo
|
||||
Public ReadOnly Property nPDN As Integer
|
||||
Get
|
||||
Return m_PartM.nPDN
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sNAM As String
|
||||
Get
|
||||
Return m_PartM.sNAM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return m_PartM.dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return m_PartM.dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return m_PartM.dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property sPOSX As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dPOSX, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_PartM.dPOSX)
|
||||
End Set
|
||||
End Property
|
||||
Public Property dPOSX As Double
|
||||
Get
|
||||
Return m_PartM.dPOSX
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dPOSX = value
|
||||
NotifyPropertyChanged(NameOf(sPOSX))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCNT As Integer
|
||||
Get
|
||||
Return m_PartM.nCNT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCNT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sINVERTED As String
|
||||
Get
|
||||
Return m_PartM.nINVERTED & "°"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sROTATED As String
|
||||
Get
|
||||
Return m_PartM.nROTATED & "°"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return m_PartM.sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_PartM.sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nGlobalState As CalcStates
|
||||
Get
|
||||
Return m_PartM.nCALC_GlobalState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nState As CalcStates
|
||||
Get
|
||||
Return m_PartM.nProductionState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_PartM.SetProductionState(value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If dtEndTime <> DateTime.MinValue Then ' barra finita
|
||||
Return Brushes.LightGray
|
||||
ElseIf dtStartTime <> DateTime.MinValue Then ' barra iniziata
|
||||
Return Brushes.Green
|
||||
Else ' barra in coda
|
||||
Return Brushes.White
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_ERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_PartM.sCALC_MSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_FALL
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_FALL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle feature del pezzo
|
||||
Protected m_FeatureVMList As ObservableCollection(Of BTLFeatureVM)
|
||||
Public Property FeatureVMList As ObservableCollection(Of BTLFeatureVM)
|
||||
Get
|
||||
Return m_FeatureVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLFeatureVM))
|
||||
m_FeatureVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelFeatureVM As BTLFeatureVM
|
||||
Public Property SelFeatureVM As BTLFeatureVM
|
||||
Get
|
||||
Return m_SelFeatureVM
|
||||
End Get
|
||||
Set(value As BTLFeatureVM)
|
||||
m_SelFeatureVM = value
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(value) Then EgtSelectObj(m_SelFeatureVM.nFeatureId)
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(m_SelFeatureVM))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtStartTime As DateTime
|
||||
Get
|
||||
Return m_PartM.dtStartTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_PartM.dtStartTime = value
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtEndTime As DateTime
|
||||
Get
|
||||
Return m_PartM.dtEndTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_PartM.dtEndTime = value
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdDeletePart As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(PartM As PartM)
|
||||
m_PartM = PartM
|
||||
AddHandler m_PartM.BTLFeatureAdded, AddressOf OnBTLFeatureAdded
|
||||
CreateBTLFeatureVMList()
|
||||
MyBase.New(PartM)
|
||||
End Sub
|
||||
'Sub New(nParentMachGroup As MyMachGroupM, nPartId As Integer)
|
||||
' m_ParentMachGroup = nParentMachGroup
|
||||
' SetPartId(nPartId)
|
||||
' m_FeatureVMList = New ObservableCollection(Of BTLFeatureM)
|
||||
'End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Private Sub CreateBTLFeatureVMList()
|
||||
Dim all As List(Of BTLFeatureVM) = (From BTLFeatureM In m_PartM.GetBTLFeatures()
|
||||
Select New BTLFeatureVM(BTLFeatureM)).ToList()
|
||||
|
||||
For Each BTLFeatureVM As BTLFeatureVM In all
|
||||
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_FeatureVMList = New ObservableCollection(Of BTLFeatureVM)(all)
|
||||
AddHandler m_FeatureVMList.CollectionChanged, AddressOf OnBTLFeatureVMListChanged
|
||||
End Sub
|
||||
|
||||
' 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_PartM.nCALC_ERR = 0
|
||||
m_PartM.nCALC_ROT = 0
|
||||
m_PartM.nCALC_FALL = 0
|
||||
m_PartM.sCALC_MSG = ""
|
||||
Else
|
||||
m_PartM.nCALC_ERR = ERR
|
||||
m_PartM.nCALC_ROT = ROT
|
||||
m_PartM.nCALC_FALL = 0
|
||||
m_PartM.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(NameOf(Calc_Background))
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcFeatureUpdate()
|
||||
m_PartM.nCALC_GlobalState = nState
|
||||
For Each Feature In FeatureVMList
|
||||
If Not Feature.bDO Then
|
||||
|
||||
ElseIf Feature.nState < 0 Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
Exit For
|
||||
ElseIf Feature.nState > 0 AndAlso m_PartM.nCALC_GlobalState = CalcStates.OK Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.ERROR_
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(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(m_PartM.nPartId)
|
||||
' elimino pezzo copia
|
||||
EgtErase(m_PartM.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.PartMList.IndexOf(Me)
|
||||
'''If Index = 0 Then
|
||||
''' If ParentMachGroup.PartMList.Count > 0 Then
|
||||
''' ParentMachGroup.SelPart = ParentMachGroup.PartMList(0)
|
||||
''' Else
|
||||
''' ParentMachGroup.SelPart = Nothing
|
||||
''' End If
|
||||
'''ElseIf Index = ParentMachGroup.PartMList.Count - 1 Then
|
||||
''' If ParentMachGroup.PartMList.Count > 1 Then
|
||||
''' ParentMachGroup.SelPart = ParentMachGroup.PartMList(ParentMachGroup.PartMList.Count - 2)
|
||||
''' Else
|
||||
''' ParentMachGroup.SelPart = Nothing
|
||||
''' End If
|
||||
'''Else
|
||||
''' ParentMachGroup.SelPart = ParentMachGroup.PartMList(Index - 1)
|
||||
'''End If
|
||||
'''ParentMachGroup.PartMList.Remove(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' DeletePart
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnBTLFeatureAdded(sender As Object, e As BTLFeatureAddedEventArgs)
|
||||
Dim BTLFeatureVM As BTLFeatureVM = New BTLFeatureVM(e.NewBTLFeature)
|
||||
FeatureVMList.Add(BTLFeatureVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLFeatureVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BTLFeatureVM As BTLFeatureVM In e.NewItems
|
||||
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each BTLFeatureVM As BTLFeatureVM In e.OldItems
|
||||
RemoveHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLFeatureVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -5,6 +5,7 @@ Imports ISOCNC.Remoting
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Class MachManaging
|
||||
|
||||
@@ -103,7 +104,7 @@ Class MachManaging
|
||||
nP_Machgroup = 0 AndAlso
|
||||
nP_Part = 0 AndAlso
|
||||
nP_State = PartState.NULL) AndAlso
|
||||
Tpa.opState = MachineOperatingState.Pending AndAlso tpa.remObject.MachineOperativeStatus = MachineOperatingState.Pending Then
|
||||
Tpa.opState = MachineOperatingState.Pending AndAlso Tpa.remObject.MachineOperativeStatus = MachineOperatingState.Pending Then
|
||||
' verifico se c'e' un programma da lanciare
|
||||
SendNextProgram()
|
||||
' attesa per essere sicuro che abbia scritto e riletto variabili
|
||||
@@ -121,19 +122,19 @@ Class MachManaging
|
||||
' recupero pezzo
|
||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||
' scrivo stato start
|
||||
Part.nState = 1
|
||||
Part.nCALC_State = 1
|
||||
Part.dtStartTime = dtStart
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nState))
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nCALC_State))
|
||||
' azzero variabile per far ripartire macchina
|
||||
Tpa.RWVariableManager.WriteVar(P_STATE, 0)
|
||||
' se nessun pezzo della barra diverso da quello corrente e' in start
|
||||
If Not MachGroup.PartVMList.Any(Function(x) x.nPartId <> nP_Part AndAlso x.nState = 1) Then
|
||||
If Not MachGroup.PartVMList.Any(Function(x) x.nPartId <> nP_Part AndAlso x.nCALC_State = 1) Then
|
||||
' scrivo data start su Db barra
|
||||
DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
|
||||
' scrivo stato start
|
||||
MachGroup.MyMachGroupM.SetState(1)
|
||||
MachGroup.dtStartTime = dtStart
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nState))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nCALC_State))
|
||||
End If
|
||||
' attesa per essere sicuro che abbia scritto e riletto variabili
|
||||
Threading.Thread.Sleep(300)
|
||||
@@ -146,19 +147,19 @@ Class MachManaging
|
||||
' recupero pezzo
|
||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||
' scrivo stato end
|
||||
Part.nState = 2
|
||||
Part.nCALC_State = 2
|
||||
Part.dtEndTime = dtEnd
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nState))
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nCALC_State))
|
||||
' azzero variabile per far ripartire macchina
|
||||
Tpa.RWVariableManager.WriteVar(P_STATE, 0)
|
||||
' se tutti i pezzi della barra sono in end
|
||||
If MachGroup.PartVMList.All(Function(x) x.nState >= 2) Then
|
||||
If MachGroup.PartVMList.All(Function(x) x.nCALC_State >= 2) Then
|
||||
' scrivo data end su Db barra
|
||||
DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, dtEnd)
|
||||
' scrivo stato end
|
||||
MachGroup.MyMachGroupM.SetState(2)
|
||||
MachGroup.dtEndTime = dtEnd
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nState))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nCALC_State))
|
||||
' azzero tutte le variabilli per iniziare barra successiva
|
||||
Tpa.RWVariableManager.WriteVar(P_PROD, 0)
|
||||
Tpa.RWVariableManager.WriteVar(P_MACHGROUP, 0)
|
||||
@@ -289,7 +290,7 @@ Class MachManaging
|
||||
Me.OnDispose()
|
||||
m_Tpa.OnDispose()
|
||||
' termino thread di comunicazione
|
||||
CommunicationThread.StopThread()
|
||||
MachineCommThread.StopThread()
|
||||
End Sub
|
||||
|
||||
Public Sub SetOPState()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Imports EgtBEAMWALL.Core.ConstMachComm
|
||||
|
||||
Class CommunicationThread
|
||||
Class MachineCommThread
|
||||
|
||||
' variabile che ferma il ciclo
|
||||
Private Shared m_Stop As Boolean = False
|
||||
|
||||
@@ -186,6 +186,10 @@ Public Class MainWindowM
|
||||
m_sWallRoot = m_sDataRoot & "\" & WALL_DIR
|
||||
End If
|
||||
m_sWarehouseRoot = m_sDataRoot & "\" & WAREHOUSE_DIR
|
||||
' imposto cartelle dei progetti
|
||||
ProjectFileVM.Init(sProjsDir, sProdsDir)
|
||||
' Impostazione path Ini file DataGrid
|
||||
DataGridColumnsIniFile.m_sDataGridColumnsIniFile = m_sConfigDir & "\" & DATAGRIDCOLUMNS_FILE_NAME
|
||||
' Verifico indice di istanza
|
||||
ManageInstance()
|
||||
' Imposto tipo di chiave
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports System.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class MainWindowVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_ViewerOptimizerCommThread As Thread
|
||||
|
||||
' Riferimento al Model della MainWindow
|
||||
Private m_MainWindowM As MainWindowM
|
||||
Friend ReadOnly Property MainWindowM As MainWindowM
|
||||
@@ -76,6 +79,16 @@ Public Class MainWindowVM
|
||||
' apro in modalita' VIEW
|
||||
' Map.refMainMenuVM.SelPage = Pages.VIEW
|
||||
|
||||
|
||||
' inizializzo thread di aggiornamento e comunicazione con DB
|
||||
' creo thread gestione macchina
|
||||
m_ViewerOptimizerCommThread = New Thread(Sub()
|
||||
ViewerOptimizerCommThread.ViewerOptimizerCommThreadFunction()
|
||||
End Sub)
|
||||
' avvio thread di gestione della macchina che avvia la connessione
|
||||
m_ViewerOptimizerCommThread.Start()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
@@ -123,6 +136,8 @@ Public Class MainWindowVM
|
||||
Public Sub CloseApplication()
|
||||
' disconnetto comunicazione con macchina
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.DISCONNECT))
|
||||
' termino thread di comunicazione con Db ed altri programmi
|
||||
ViewerOptimizerCommThread.StopThread()
|
||||
' Chiudo la finestra principale del programma
|
||||
Application.Current.MainWindow.Close()
|
||||
End Sub
|
||||
|
||||
@@ -1,114 +1,22 @@
|
||||
Imports System.IO
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class OpenProjectFileDialogVM
|
||||
Inherits VMBase
|
||||
Inherits Core.OpenProjectFileDialogVM
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_ProjectType As ProjectType
|
||||
|
||||
Private m_FileNameTxBl As TextBlock
|
||||
|
||||
Private m_sDirectory As String
|
||||
Public Property Directory As String
|
||||
Get
|
||||
Return m_sDirectory
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDirectory = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sFilter As String
|
||||
Public Property Filter As String
|
||||
Get
|
||||
Return m_sFilter
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sFilter = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sFileNameFilter As Predicate(Of String)
|
||||
Public Property FileNameFilter As Predicate(Of String)
|
||||
Get
|
||||
Return m_sFileNameFilter
|
||||
End Get
|
||||
Set(value As Predicate(Of String))
|
||||
m_sFileNameFilter = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sExtensions As New List(Of String)
|
||||
Public ReadOnly Property Extensions As List(Of String)
|
||||
Get
|
||||
Return m_sExtensions
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProjectList As New List(Of ProjectFileVM)
|
||||
Public ReadOnly Property ProjectList As List(Of ProjectFileVM)
|
||||
Get
|
||||
Return m_ProjectList
|
||||
End Get
|
||||
'Set(value As List(Of ProjFile))
|
||||
' m_ProjList = value
|
||||
' NotifyPropertyChanged("ProjList")
|
||||
'End Set
|
||||
End Property
|
||||
|
||||
Private m_SelProject As ProjectFileVM
|
||||
Public Property SelProject As ProjectFileVM
|
||||
Get
|
||||
Return m_SelProject
|
||||
End Get
|
||||
Set(value As ProjectFileVM)
|
||||
m_SelProject = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_FileName As String
|
||||
Public Property FileName As String
|
||||
Get
|
||||
Return m_FileName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_FileName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property OpenMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_EGTSAVEFILEDIALOG + 6)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_EGTSAVEFILEDIALOG + 2)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdProjectDoubleClick As ICommand
|
||||
|
||||
Public Function Init(ProjectType As ProjectType, Optional ProjectList As List(Of ProjectFileVM) = Nothing) As Boolean?
|
||||
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing) As Boolean?
|
||||
m_ProjectType = ProjectType
|
||||
If IsNothing(ProjectList) OrElse ProjectList.Count = 0 Then
|
||||
' carico colonne
|
||||
LoadColumns(ProjectType)
|
||||
NotifyPropertyChanged(NameOf(SearchColumnList))
|
||||
m_SelSearchColumn = m_SearchColumnList(0)
|
||||
' carico lista progetti
|
||||
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
|
||||
' leggo da db
|
||||
If ProjectType = ProjectType.PROJ Then
|
||||
'Dim DbProjectList As New List(Of ProjFileM)
|
||||
'DbProjectList = DbControllers.m_ProjController.GetLastDesc(50)
|
||||
'For Each Project In DbProjectList
|
||||
' m_ProjectList.Add(New ProjFileVM(Project))
|
||||
'Next
|
||||
ElseIf ProjectType = ProjectType.PROD Then
|
||||
If ProjectType = ProjectType.PROD Then
|
||||
Dim DbProjectList As New List(Of ProdFileM)
|
||||
DbProjectList = DbControllers.m_ProdController.GetLastDesc(50)
|
||||
For Each Project In DbProjectList
|
||||
@@ -116,76 +24,11 @@ Public Class OpenProjectFileDialogVM
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
m_ProjectList = ProjectList
|
||||
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
|
||||
NotifyPropertyChanged(NameOf(ProjectList))
|
||||
End If
|
||||
m_ProjectList_View = CollectionViewSource.GetDefaultView(m_ProjectList)
|
||||
m_ProjectList_View.Filter = AddressOf ProjectFilter
|
||||
End Function
|
||||
|
||||
Friend Function VerifySelected() As Boolean
|
||||
Dim AllFilesInDir As IEnumerable(Of String)
|
||||
If m_ProjectType = Core.ConstBeam.ProjectType.PROJ Then
|
||||
' verifico se esiste ProdId
|
||||
AllFilesInDir = IO.Directory.EnumerateFiles(SelProject.sProjDirPath)
|
||||
ElseIf m_ProjectType = Core.ConstBeam.ProjectType.PROD Then
|
||||
AllFilesInDir = IO.Directory.EnumerateFiles(SelProject.sProdDirPath)
|
||||
End If
|
||||
For Each File In AllFilesInDir
|
||||
If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
'Private Sub m_FileNameTxBl_MouseDown(sender As Object, e As Windows.Input.MouseButtonEventArgs) Handles FileNameList.MouseDoubleClick
|
||||
' Dim src As DependencyObject = VisualTreeHelper.GetParent(DirectCast(e.OriginalSource, DependencyObject))
|
||||
' ' verifico che venga clickato un item, non lo spazio vuoto o la scrollbar
|
||||
' If Not TypeOf src Is ListBoxItem Then
|
||||
' src = Utility.FindAncestor(Of ListBoxItem)(src)
|
||||
' End If
|
||||
' If IsNothing(src) OrElse src.[GetType]() <> GetType(ListBoxItem) Then
|
||||
' e.Handled = True
|
||||
' Else
|
||||
' If Not IsNothing(m_SelectedFile) Then
|
||||
' m_FileName = SelectedFile
|
||||
' DialogResult = True
|
||||
' End If
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
'Private Sub OpenBtn_Click(sender As Object, e As RoutedEventArgs) Handles OpenBtn.Click
|
||||
' If Not IsNothing(m_SelectedFile) Then
|
||||
' m_FileName = SelectedFile
|
||||
' DialogResult = True
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "ProjectDoubleClick"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do New.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ProjectDoubleClick_Command As ICommand
|
||||
Get
|
||||
If m_cmdProjectDoubleClick Is Nothing Then
|
||||
m_cmdProjectDoubleClick = New Command(AddressOf ProjDoubleClick)
|
||||
End If
|
||||
Return m_cmdProjectDoubleClick
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Friend Sub ProjDoubleClick(ByVal param As Object)
|
||||
If VerifySelected() Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ProjectDoubleClick
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
|
||||
@@ -3,181 +3,21 @@ Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ProdFileVM
|
||||
Inherits ProjectFileVM
|
||||
|
||||
Public ReadOnly Property ProdFileM As ProdFileM
|
||||
Get
|
||||
Return m_ProjectFileM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property nProjIdList As List(Of Integer)
|
||||
Get
|
||||
Return ProdFileM.nProjIdList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides ReadOnly Property nProdId As Integer
|
||||
Get
|
||||
Return ProdFileM.nProdId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Overrides ReadOnly Property sProdDirPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(ProdFileM.nProdId) OrElse ProdFileM.nProdId = 0 Then Return String.Empty
|
||||
Return refMainWindowVM.MainWindowM.sProdsDir & "\" & nProdId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
Friend Overrides ReadOnly Property sProdPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(ProdFileM.nProdId) OrElse ProdFileM.nProdId = 0 Then Return String.Empty
|
||||
Return refMainWindowVM.MainWindowM.sProdsDir & "\" & nProdId.ToString("0000") & "\" & nProdId.ToString("0000") & ".nge"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property bIsNew As Boolean
|
||||
Get
|
||||
Return ProdFileM.bIsNew
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ProdFileM.bIsNew = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' nome del file mostrato nella finestra OpenProjFileDialog
|
||||
Public ReadOnly Property OpenFileName As String
|
||||
Get
|
||||
Return ProdFileM.nProdId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
Inherits Core.ProdFileVM
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New(ProdFileM As ProdFileM)
|
||||
m_ProjectFileM = ProdFileM
|
||||
MyBase.New(ProdFileM)
|
||||
' aggiungo nome btl
|
||||
Dim sBTLFileName As String = ""
|
||||
For Each CurrProj In nProjIdList
|
||||
Dim TempProj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(CurrProj)
|
||||
If Not IsNothing(TempProj) Then sBTLFileName &= TempProj.sListName
|
||||
Next
|
||||
SetBTLFileName(sBTLFileName)
|
||||
End Sub
|
||||
|
||||
'Sub New(nProjectType As ProjectType, ProjectFileName As String)
|
||||
' m_nProjectType = nProjectType
|
||||
' If m_nProjectType = ProjectType.PROJ Then
|
||||
' Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
' Integer.TryParse(DataFromFileName(0), m_nProjId)
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
' Integer.TryParse(DataFromFileName(1), m_nProdId)
|
||||
' Else
|
||||
' m_nProdId = 0
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
' m_BTLFileName = DataFromFileName(2)
|
||||
' End If
|
||||
' ElseIf m_nProjectType = ProjectType.PROD Then
|
||||
' Integer.TryParse(ProjectFileName, m_nProdId)
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
'Sub New(nProjectType As ProjectType, nProjId As Integer, nProdId As Integer, sBTLFileName As String)
|
||||
' MyBase.New(nProjectType, nProjId, nProdId, sBTLFileName)
|
||||
'End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
' funzione che restituisce le parti di nome file
|
||||
Friend Shared Function VerifyProjectFile(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
If nProjectType = ProjectType.PROJ Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
Return True
|
||||
Else Return False
|
||||
End If
|
||||
ElseIf nProjectType = ProjectType.PROD Then
|
||||
Return Integer.TryParse(ProjectFileName, nProdId)
|
||||
Else Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
' funzione che dato un nome file e il tipo restituisce il corretto numero di progetto
|
||||
Friend Shared Function GetProjectNumber(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
If String.IsNullOrWhiteSpace(ProjectFileName) Then
|
||||
nProjId = 0
|
||||
nProdId = 0
|
||||
sBTLFileName = ""
|
||||
Return False
|
||||
ElseIf ProjectFileName.Contains(FILENAMESEPARATOR) Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
Return True
|
||||
Else Return False
|
||||
End If
|
||||
ElseIf nProjectType = ProjectType.PROJ Then
|
||||
Dim ProjectFileNameProd As String = Integer.TryParse(ProjectFileName, nProdId)
|
||||
Dim nTempProjId As Integer = 0
|
||||
Dim nTempProdId As Integer = 0
|
||||
Dim sTempBTLFileName As String = ""
|
||||
' ricavo lista cartelle proj
|
||||
Dim AllDirsInDir As IEnumerable(Of String) = IO.Directory.EnumerateDirectories(Map.refMainWindowVM.MainWindowM.sProjsDir)
|
||||
For Each Directory In AllDirsInDir
|
||||
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Directory)
|
||||
For Each File In AllFilesInDir
|
||||
If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||
If File.Contains(FILENAMESEPARATOR) Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nTempProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nTempProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sTempBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
If ProjectFileNameProd = nTempProdId Then
|
||||
nProjId = nTempProjId
|
||||
nProdId = nTempProdId
|
||||
sTempBTLFileName = sBTLFileName
|
||||
Return True
|
||||
End If
|
||||
Else Return False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -4,6 +4,7 @@ Module DbControllers
|
||||
|
||||
Friend m_SupervisorId As String = "1"
|
||||
|
||||
Public m_ProjController As DataLayer.Controllers.ProjController
|
||||
Public m_ProdController As DataLayer.Controllers.ProdController
|
||||
Public m_MachGroupController As DataLayer.Controllers.MachGroupController
|
||||
Public m_PartController As DataLayer.Controllers.PartController
|
||||
@@ -25,6 +26,7 @@ Module DbControllers
|
||||
DataLayer.DbConfig.InitDb("127.0.0.1", sUser, sPwd)
|
||||
DataLayer.DbConfig.CheckUser(sUser, sPwd)
|
||||
|
||||
m_ProjController = New DataLayer.Controllers.ProjController
|
||||
m_ProdController = New DataLayer.Controllers.ProdController
|
||||
m_MachGroupController = New DataLayer.Controllers.MachGroupController
|
||||
m_PartController = New DataLayer.Controllers.PartController
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
Public Class ViewerOptimizerComm
|
||||
|
||||
Sub New()
|
||||
' imposto in Map
|
||||
'Map.SetRefMachManaging(Me)
|
||||
End Sub
|
||||
|
||||
Friend Sub Timer_Tick()
|
||||
' se c'e' un progetto aperto
|
||||
If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
|
||||
' verifico se e' aperto in qualche ottimizzatore
|
||||
'DbControllers.m_ProdController.
|
||||
'Map.refSupervisorManagerVM.CurrProd.bIsLocked
|
||||
' verifico se la mappa messaggi ha indice maggiore del mio
|
||||
|
||||
' ricarico il progetto
|
||||
|
||||
' aggiorno eventuali nuovi machgroup
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
' se devo ripartire a meta' di una barra
|
||||
|
||||
' mando messaggio di blocco dell'ottimizzatore
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,23 @@
|
||||
Public Class ViewerOptimizerCommThread
|
||||
|
||||
' variabile che ferma il ciclo
|
||||
Private Shared m_Stop As Boolean = False
|
||||
|
||||
Friend Shared Sub StopThread()
|
||||
m_Stop = True
|
||||
End Sub
|
||||
|
||||
Public Shared Sub ViewerOptimizerCommThreadFunction()
|
||||
|
||||
' creo classe di comunicazione
|
||||
Dim m_ViewerOptimizerComm As ViewerOptimizerComm = New ViewerOptimizerComm()
|
||||
|
||||
While Not m_Stop
|
||||
' eseguo ciclo principale che tiene vivo il thread
|
||||
m_ViewerOptimizerComm.Timer_Tick()
|
||||
Threading.Thread.Sleep(TimeSpan.FromMilliseconds(1000))
|
||||
End While
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -6,21 +6,7 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BTLFeatureVM
|
||||
Inherits VMBase
|
||||
|
||||
Private WithEvents m_BTLFeatureM As BTLFeatureM
|
||||
Public ReadOnly Property BTLFeatureM As BTLFeatureM
|
||||
Get
|
||||
Return m_BTLFeatureM
|
||||
End Get
|
||||
End Property
|
||||
Private m_BTLPartM As BTLPartM
|
||||
|
||||
Public ReadOnly Property nFeatureId As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nFeatureId
|
||||
End Get
|
||||
End Property
|
||||
Inherits Core.BTLFeatureVM
|
||||
|
||||
Public Property GRPList As ObservableCollection(Of Integer)
|
||||
Get
|
||||
@@ -31,7 +17,7 @@ Public Class BTLFeatureVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nSelGRP As Integer
|
||||
Public Overrides Property nSelGRP As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nSelGRP
|
||||
End Get
|
||||
@@ -58,27 +44,6 @@ Public Class BTLFeatureVM
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Friend ReadOnly Property sDescGRP As String
|
||||
Get
|
||||
Dim sDescConstruction As String = String.Empty
|
||||
If CalcBeamPrivateProfileGRP(m_BTLFeatureM.nSelGRP) = 0 Then
|
||||
sDescConstruction = "L"
|
||||
Else
|
||||
sDescConstruction = "T"
|
||||
End If
|
||||
sDescConstruction &= m_BTLFeatureM.nPRC.ToString("000")
|
||||
Return sDescConstruction
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nPRC As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nPRC
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_BTLFeatureM.nPRC = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SIDEList As ObservableCollection(Of Integer)
|
||||
Get
|
||||
@@ -90,7 +55,7 @@ Public Class BTLFeatureVM
|
||||
End Property
|
||||
|
||||
' Lato
|
||||
Public Property nSelSIDE As Integer
|
||||
Public Overrides Property nSelSIDE As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nSelSIDE
|
||||
End Get
|
||||
@@ -116,13 +81,7 @@ Public Class BTLFeatureVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_BTLFeatureM.sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property bDO As Boolean
|
||||
Public Overrides Property bDO As Boolean
|
||||
Get
|
||||
Return m_BTLFeatureM.bDO
|
||||
End Get
|
||||
@@ -139,128 +98,12 @@ Public Class BTLFeatureVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nPRID As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nPRID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_BTLFeatureM.nPRID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property sDES As String
|
||||
Get
|
||||
Return m_BTLFeatureM.sDES
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_BTLFeatureM.sDES = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property frFRAME As Frame3d
|
||||
Get
|
||||
Return m_BTLFeatureM.frFRAME
|
||||
End Get
|
||||
Set(value As Frame3d)
|
||||
m_BTLFeatureM.frFRAME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' proprieta' che mostra la descrizione in interfaccia
|
||||
Public ReadOnly Property sDesc As String
|
||||
Get
|
||||
Return sDescGRP & " " & sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sDrawPath As String
|
||||
Get
|
||||
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nState As CalcStates
|
||||
Get
|
||||
Return m_BTLFeatureM.nState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nCALC_ERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nCALC_ROT
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_BTLFeatureM.sCALC_MSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If Not m_BTLFeatureM.bDO Then
|
||||
Return Brushes.Aqua
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.OK Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.NOTCALCULATED Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.INFO Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.WARNING Then
|
||||
Return Brushes.Orange
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.ERROR_ Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_BTLFeatureM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Letter As String
|
||||
Get
|
||||
Select Case m_BTLFeatureM.nCALC_ERR
|
||||
Case 22
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Return "e"
|
||||
Case 17
|
||||
Return "w"
|
||||
Case < 0
|
||||
Return "i"
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
||||
Get
|
||||
Select Case m_BTLFeatureM.nState
|
||||
Case CalcStates.ERROR_
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
Case CalcStates.INFO
|
||||
Return Brushes.Green
|
||||
Case Else
|
||||
Return Brushes.Red
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_PBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
||||
Public Property PBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
||||
Get
|
||||
@@ -334,41 +177,6 @@ Public Class BTLFeatureVM
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
'Sub New(ParentPart As BTLPartVM, nFeatureId As Integer)
|
||||
' MyBase.New(ParentPart, nFeatureId)
|
||||
' ' leggo gruppo, numero feature e lato
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_GRP, m_nSelGRP)
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_PRC, m_nPRC)
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_SIDE, m_nSelSIDE)
|
||||
' Dim nDO As Integer = 1
|
||||
' If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
||||
' m_bDO = (nDO <> 0)
|
||||
' Else
|
||||
' m_bDO = True
|
||||
' End If
|
||||
' ' leggo des,prid e frame
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_DES, m_sDES)
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_PRID, m_nPRID)
|
||||
' EgtGetInfo(nFeatureId, BTL_FTR_FRAME, m_frFRAME)
|
||||
' ' leggo calc error
|
||||
' Dim nErr As Integer = 0
|
||||
' Dim nRot As Integer = 0
|
||||
' Dim nFall As Integer = 0
|
||||
' Dim sMsg As String = ""
|
||||
' Dim bCalc As Boolean = False
|
||||
' bCalc = EgtGetInfo(m_nFeatureId, ITG_PROJ_ERR, nErr)
|
||||
' EgtGetInfo(m_nFeatureId, ITG_PROJ_ROT, nRot)
|
||||
' EgtGetInfo(m_nFeatureId, ITG_PROJ_FALL, nFall)
|
||||
' EgtGetInfo(m_nFeatureId, ITG_PROJ_MSG, sMsg)
|
||||
' CalcFeatureUpdate(bCalc, nErr, nRot, nFall, sMsg)
|
||||
' ' leggo parametri della feature
|
||||
' GetBeamPrivateProfileGRPList(CalcBeamPrivateProfileGRP(nSelGRP), m_nPRC, m_GRPList)
|
||||
' GetBeamPrivateProfileName(m_nSelGRP, m_nPRC, Me)
|
||||
' ' crea parametri per questa feature da file ini
|
||||
' CreateFeatureParams()
|
||||
' ReadFeatureParams()
|
||||
'End Sub
|
||||
|
||||
Sub New(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM)
|
||||
m_BTLFeatureM = BTLFeatureM
|
||||
AddHandler m_BTLFeatureM.PBTLParamAdded, AddressOf OnPBTLParamAdded
|
||||
@@ -384,11 +192,7 @@ Public Class BTLFeatureVM
|
||||
|
||||
Sub New(BTLFeatureM As BTLFeatureM)
|
||||
m_BTLFeatureM = BTLFeatureM
|
||||
'AddHandler m_BTLFeatureM.PBTLParamAdded, AddressOf OnPBTLParamAdded
|
||||
'AddHandler m_BTLFeatureM.QBTLParamAdded, AddressOf OnQBTLParamAdded
|
||||
m_BTLPartM = Nothing
|
||||
'CreatePBTLParamVMList()
|
||||
'CreateQBTLParamVMList()
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
@@ -460,34 +264,6 @@ Public Class BTLFeatureVM
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
' funzione che seleziona la feature nella geometria
|
||||
Friend Sub SelGeomFeature()
|
||||
EgtDeselectAll()
|
||||
SelGeomFeature(nFeatureId)
|
||||
End Sub
|
||||
Private Sub SelGeomFeature(nMyFeatureId As Integer)
|
||||
EgtSelectObj(nMyFeatureId)
|
||||
Dim sVal As String = ""
|
||||
If EgtGetInfo(nMyFeatureId, BTL_FTR_ADJID, sVal) Then
|
||||
Dim vAdjId() As String = sVal.Split(","c)
|
||||
For Each sAdjId In vAdjId
|
||||
Dim nAdjId As Integer
|
||||
If Integer.TryParse(sAdjId, nAdjId) Then
|
||||
SelGeomFeature(nMyFeatureId + nAdjId)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If EgtGetInfo(nMyFeatureId, BTL_FTR_AUXID, sVal) Then
|
||||
Dim vAuxId() As String = sVal.Split(","c)
|
||||
For Each sAuxId In vAuxId
|
||||
Dim nAuxId As Integer
|
||||
If Integer.TryParse(sAuxId, nAuxId) Then
|
||||
EgtSelectObj(nMyFeatureId + nAuxId)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function Copy() As BTLFeatureM
|
||||
Return Copy( m_BTLPartM)
|
||||
End Function
|
||||
|
||||
@@ -1750,6 +1750,12 @@ Public Class BTLPartVM
|
||||
Return Qty = Added
|
||||
End Function
|
||||
|
||||
' funzione che dato l'Id di un Part(Duplo) restituisce il BTLPart di origine
|
||||
Friend Shared Function RetrieveBTLPartFromPart(nPartId As Integer) As BTLPartVM
|
||||
Dim BTLPartId As Integer = EgtDuploGetOriginal(nPartId)
|
||||
Return Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = BTLPartId)
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
@@ -491,44 +491,44 @@ Public Class BTLStructureVM
|
||||
|
||||
Public ReadOnly Property sBTLTotParts As String
|
||||
Get
|
||||
Return Map.refProjectVM.BTLStructureVM.BTLPartVMList.Sum(Function(x) x.nCNT + x.nADDED)
|
||||
Return m_BTLPartVMList.Sum(Function(x) x.nCNT + x.nADDED)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sBTLTotVolume As String
|
||||
Get
|
||||
Dim dMMTotVolume As Double = Map.refProjectVM.BTLStructureVM.BTLPartVMList.Sum(Function(x) x.dUnitVolume * (x.nCNT + x.nADDED))
|
||||
Dim dMMTotVolume As Double = m_BTLPartVMList.Sum(Function(x) x.dUnitVolume * (x.nCNT + x.nADDED))
|
||||
Return If(EgtUiUnitsAreMM(), DoubleToString(dMMTotVolume / 1000000000, 3), DoubleToString(dMMTotVolume * (12 / ONEINCH), 3))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sBTLTotTime As String
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Sum(Function(x) x.nCALC_TIME * (x.nCNT + x.nADDED))).ToString()
|
||||
Return TimeSpan.FromSeconds(m_BTLPartVMList.Sum(Function(x) x.nCALC_TIME * (x.nCNT + x.nADDED))).ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotCNTParts As String
|
||||
Get
|
||||
Return Map.refProjectVM.BTLStructureVM.BTLPartVMList.Sum(Function(x) x.nCNT)
|
||||
Return m_BTLPartVMList.Sum(Function(x) x.nCNT)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotADDEDParts As String
|
||||
Get
|
||||
Return Map.refProjectVM.BTLStructureVM.BTLPartVMList.Sum(Function(x) x.nADDED)
|
||||
Return m_BTLPartVMList.Sum(Function(x) x.nADDED)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotINPRODParts As String
|
||||
Get
|
||||
Return Map.refProjectVM.BTLStructureVM.BTLPartVMList.Sum(Function(x) x.nINPROD)
|
||||
Return m_BTLPartVMList.Sum(Function(x) x.nINPROD)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotDONEParts As String
|
||||
Get
|
||||
Return Map.refProjectVM.BTLStructureVM.BTLPartVMList.Sum(Function(x) x.nDONE)
|
||||
Return m_BTLPartVMList.Sum(Function(x) x.nDONE)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
@@ -9,10 +9,7 @@
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureListV}}}"
|
||||
CanUserAddRows="False"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserSortColumns="True"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="True"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
@@ -21,14 +18,13 @@
|
||||
BindingColumns="{Binding FeatureColumns}">
|
||||
<DataGrid.Resources>
|
||||
<!--DO - Abilitazione-->
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureListV}}}"/>
|
||||
</DataGridCheckBoxColumn.Header>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--Validità feature-->
|
||||
<DataGridTemplateColumn x:Key="colCALC" Width="Auto">
|
||||
<DataGridTemplateColumn x:Key="colCALC">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
@@ -73,9 +69,7 @@
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--Descrizione-->
|
||||
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}"
|
||||
Width="1*"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Description_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class FeatureListVM
|
||||
|
||||
Private m_FeatureColumns As New ObservableCollection(Of String)
|
||||
Public Property FeatureColumns As ObservableCollection(Of String)
|
||||
Private m_FeatureColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property FeatureColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return m_FeatureColumns
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
m_FeatureColumns = value
|
||||
End Set
|
||||
End Property
|
||||
@@ -26,10 +27,8 @@ Public Class FeatureListVM
|
||||
Sub New()
|
||||
' creo riferimento in Map
|
||||
Map.SetRefFeatureListVM(Me)
|
||||
' aggiungo le colonne alla tabella
|
||||
FeatureColumns.Add("colDO")
|
||||
FeatureColumns.Add("colCALC")
|
||||
FeatureColumns.Add("colDESC")
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_FEATURELIST, FeatureColumns)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -10,10 +10,7 @@
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserSortColumns="False"
|
||||
CanUserResizeColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
@@ -31,14 +28,13 @@
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.Resources>
|
||||
<!--PDN - Nome-->
|
||||
<DataGridTextColumn x:Key="colPDN" Binding="{Binding nPDN}"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colPDN" Binding="{Binding nPDN}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--Validità pezzo-->
|
||||
<DataGridTemplateColumn x:Key="colCALC" Width="Auto">
|
||||
<DataGridTemplateColumn x:Key="colCALC">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
@@ -81,40 +77,31 @@
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--NAM - Descrizione-->
|
||||
<DataGridTextColumn x:Key="colNAM" Binding="{Binding sNAM}"
|
||||
Width="1*"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colNAM" Binding="{Binding sNAM}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--W - Larghezza-->
|
||||
<DataGridTextColumn x:Key="colW" Binding="{Binding sW}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colW" Binding="{Binding sW}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.W_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--H - Altezza-->
|
||||
<DataGridTextColumn x:Key="colH" Binding="{Binding sH}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colH" Binding="{Binding sH}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.H_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--L - Lunghezza-->
|
||||
<DataGridTextColumn x:Key="colL" Binding="{Binding sL}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colL" Binding="{Binding sL}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.L_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--ROT - Rotazione-->
|
||||
<DataGridTemplateColumn x:Key="colROT" Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTemplateColumn x:Key="colROT">
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock Text="Rotazione"/>
|
||||
</DataGridTemplateColumn.Header>
|
||||
@@ -149,8 +136,7 @@
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--INV - Inversione-->
|
||||
<DataGridTemplateColumn x:Key="colFLIP" Width="65"
|
||||
IsReadOnly="False">
|
||||
<DataGridTemplateColumn x:Key="colFLIP">
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock Text="Inversione"/>
|
||||
</DataGridTemplateColumn.Header>
|
||||
@@ -163,9 +149,7 @@
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--PosX - Posizione-->
|
||||
<DataGridTextColumn x:Key="colPOSX" Binding="{Binding sPOSX, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto"
|
||||
IsReadOnly="False">
|
||||
<DataGridTextColumn x:Key="colPOSX" Binding="{Binding sPOSX, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.PosX_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
@@ -173,9 +157,7 @@
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--PosY - Posizione-->
|
||||
<DataGridTextColumn x:Key="colPOSY" Binding="{Binding sPOSY, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto"
|
||||
IsReadOnly="False">
|
||||
<DataGridTextColumn x:Key="colPOSY" Binding="{Binding sPOSY, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.PosY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
@@ -183,8 +165,7 @@
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--Off - Offset-->
|
||||
<DataGridTextColumn x:Key="colOFFSET" Binding="{Binding sOffset}"
|
||||
Width="Auto">
|
||||
<DataGridTextColumn x:Key="colOFFSET" Binding="{Binding sOffset}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Offset_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
@@ -192,9 +173,7 @@
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--MAT - Materiale-->
|
||||
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}"
|
||||
Width="1*"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.MAT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
|
||||
@@ -6,9 +6,9 @@ Public Class PartInRawPartListV
|
||||
Private Sub PartInRawPartList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
If TypeOf sender Is DataGridRow Then
|
||||
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
|
||||
If Not IsNothing(Row) AndAlso Row.IsSelected Then
|
||||
If Not IsNothing(Row) Then
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
Dim BeamMachGroup As BeamMachGroupVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
|
||||
Dim BeamMachGroup As Core.BeamMachGroupVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
|
||||
If EgtGetCurrMachGroup() = GDB_ID.NULL Then Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = BeamMachGroup
|
||||
BeamMachGroup.SelPart = BeamMachGroup.SelPart
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
|
||||
@@ -4,12 +4,12 @@ Imports EgtUILib
|
||||
|
||||
Public Class PartInRawPartListVM
|
||||
|
||||
Private m_PartInRawPartColumns As New ObservableCollection(Of String)
|
||||
Public Property PartInRawPartColumns As ObservableCollection(Of String)
|
||||
Private m_PartInRawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property PartInRawPartColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return m_PartInRawPartColumns
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
m_PartInRawPartColumns = value
|
||||
End Set
|
||||
End Property
|
||||
@@ -74,36 +74,19 @@ Public Class PartInRawPartListVM
|
||||
Sub New()
|
||||
' aggiungo riferimento a map
|
||||
Map.SetRefPartInRawPartListVM(Me)
|
||||
' aggiungo colonne
|
||||
PartInRawPartColumns.Add(COL_PDN)
|
||||
PartInRawPartColumns.Add(COL_CALC)
|
||||
PartInRawPartColumns.Add(COL_NAM)
|
||||
PartInRawPartColumns.Add(COL_W)
|
||||
PartInRawPartColumns.Add(COL_H)
|
||||
PartInRawPartColumns.Add(COL_L)
|
||||
PartInRawPartColumns.Add(COL_ROT)
|
||||
PartInRawPartColumns.Add(COL_FLIP)
|
||||
PartInRawPartColumns.Add(COL_POSX)
|
||||
PartInRawPartColumns.Add(COL_POSY)
|
||||
PartInRawPartColumns.Add(COL_OFFSET)
|
||||
PartInRawPartColumns.Add(COL_MATERIAL)
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Friend Sub UpdateColumns(nMachType As MachineType)
|
||||
If nMachType = MachineType.BEAM Then
|
||||
If Not IsNothing(m_PartInRawPartColumns.FirstOrDefault(Function(x) x = COL_ROT)) Then m_PartInRawPartColumns.Remove(COL_ROT)
|
||||
If Not IsNothing(m_PartInRawPartColumns.FirstOrDefault(Function(x) x = COL_FLIP)) Then m_PartInRawPartColumns.Remove(COL_FLIP)
|
||||
If Not IsNothing(m_PartInRawPartColumns.FirstOrDefault(Function(x) x = COL_POSX)) Then m_PartInRawPartColumns.Remove(COL_POSX)
|
||||
If Not IsNothing(m_PartInRawPartColumns.FirstOrDefault(Function(x) x = COL_POSY)) Then m_PartInRawPartColumns.Remove(COL_POSY)
|
||||
If IsNothing(m_PartInRawPartColumns.FirstOrDefault(Function(x) x = COL_OFFSET)) Then m_PartInRawPartColumns.Insert(6, COL_OFFSET)
|
||||
PartInRawPartColumns.Clear()
|
||||
GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns)
|
||||
ElseIf nMachType = MachineType.WALL Then
|
||||
If Not IsNothing(m_PartInRawPartColumns.FirstOrDefault(Function(x) x = COL_OFFSET)) Then m_PartInRawPartColumns.Remove(COL_OFFSET)
|
||||
If IsNothing(m_PartInRawPartColumns.FirstOrDefault(Function(x) x = COL_ROT)) Then m_PartInRawPartColumns.Insert(6, COL_ROT)
|
||||
If IsNothing(m_PartInRawPartColumns.FirstOrDefault(Function(x) x = COL_FLIP)) Then m_PartInRawPartColumns.Insert(7, COL_FLIP)
|
||||
If IsNothing(m_PartInRawPartColumns.FirstOrDefault(Function(x) x = COL_POSX)) Then m_PartInRawPartColumns.Insert(8, COL_POSX)
|
||||
If IsNothing(m_PartInRawPartColumns.FirstOrDefault(Function(x) x = COL_POSY)) Then m_PartInRawPartColumns.Insert(9, COL_POSY)
|
||||
PartInRawPartColumns.Clear()
|
||||
GetPrivateProfileColumns(S_PARTINRAWPARTLIST_WALL, PartInRawPartColumns)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -9,10 +9,7 @@
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserSortColumns="True"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="true"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
@@ -21,15 +18,13 @@
|
||||
BindingColumns="{Binding RawPartColumns}">
|
||||
<DataGrid.Resources>
|
||||
<!--ID - Id gruppo-->
|
||||
<DataGridTextColumn x:Key="colNAME" Binding="{Binding Name}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colNAME" Binding="{Binding Name}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.ID_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--Validità pezzo-->
|
||||
<DataGridTemplateColumn x:Key="colCALC" Width="Auto">
|
||||
<DataGridTemplateColumn x:Key="colCALC">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
@@ -72,8 +67,7 @@
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--STARTCUT - Ritaglio iniziale-->
|
||||
<DataGridTextColumn x:Key="colSTARTCUT" Binding="{Binding sStartCut}"
|
||||
Width="65">
|
||||
<DataGridTextColumn x:Key="colSTARTCUT" Binding="{Binding sStartCut}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.StartOffset_Msg,
|
||||
@@ -82,54 +76,42 @@
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--W - Larghezza-->
|
||||
<DataGridTextColumn x:Key="colW" Binding="{Binding dW}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colW" Binding="{Binding dW}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.W_Msg,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--H - Altezza-->
|
||||
<DataGridTextColumn x:Key="colH" Binding="{Binding dH}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colH" Binding="{Binding dH}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.H_Msg,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--L - Lunghezza-->
|
||||
<DataGridTextColumn x:Key="colL" Binding="{Binding dL}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colL" Binding="{Binding dL}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.L_Msg,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--MAT - Materiale-->
|
||||
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}"
|
||||
Width="1*"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Material_Msg,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--% - % utilizzo-->
|
||||
<DataGridTextColumn x:Key="colUSAGE" Binding="{Binding sUsage}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colUSAGE" Binding="{Binding sUsage}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Used_Msg,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--S - Scarti-->
|
||||
<DataGridTextColumn x:Key="colWASTE" Binding="{Binding sWaste}"
|
||||
Width="65"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colWASTE" Binding="{Binding sWaste}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Waste_Msg,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
|
||||
@@ -6,12 +6,12 @@ Public Class RawPartListVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_RawPartColumns As New ObservableCollection(Of String)
|
||||
Public Property RawPartColumns As ObservableCollection(Of String)
|
||||
Private m_RawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property RawPartColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return m_RawPartColumns
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
m_RawPartColumns = value
|
||||
End Set
|
||||
End Property
|
||||
@@ -75,25 +75,19 @@ Public Class RawPartListVM
|
||||
Sub New()
|
||||
' Aggiungo riferimento a Map
|
||||
Map.SetRefRawPartListVM(Me)
|
||||
' aggiungo colonne
|
||||
RawPartColumns.Add(COL_NAME)
|
||||
RawPartColumns.Add(COL_CALC)
|
||||
RawPartColumns.Add(COL_STARTCUT)
|
||||
RawPartColumns.Add(COL_W)
|
||||
RawPartColumns.Add(COL_H)
|
||||
RawPartColumns.Add(COL_L)
|
||||
RawPartColumns.Add(COL_MATERIAL)
|
||||
RawPartColumns.Add(COL_USAGE)
|
||||
RawPartColumns.Add(COL_WASTE)
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Friend Sub UpdateColumns(nMachType As MachineType)
|
||||
If nMachType = MachineType.BEAM Then
|
||||
If IsNothing(m_RawPartColumns.FirstOrDefault(Function(x) x = COL_STARTCUT)) Then m_RawPartColumns.Insert(2, COL_STARTCUT)
|
||||
RawPartColumns.Clear()
|
||||
GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
|
||||
ElseIf nMachType = MachineType.WALL Then
|
||||
If Not IsNothing(m_RawPartColumns.FirstOrDefault(Function(x) x = COL_STARTCUT)) Then m_RawPartColumns.Remove(COL_STARTCUT)
|
||||
RawPartColumns.Clear()
|
||||
GetPrivateProfileColumns(S_RAWPARTLIST_WALL, RawPartColumns)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
Module ConstDataGridColumnsIni
|
||||
|
||||
Public Const DATAGRIDCOLUMNS_FILE_NAME As String = "DataGridColumns.ini"
|
||||
|
||||
Public Const S_FEATURELIST As String = "DG_FeatureList"
|
||||
Public Const S_OPENPROJFILEDLG_PROJ As String = "DG_OpenProjectFileDialog_PROJ"
|
||||
Public Const S_OPENPROJFILEDLG_PROD As String = "DG_OpenProjectFileDialog_PROD"
|
||||
Public Const S_RAWPARTLIST_BEAM As String = "DG_RawPartList_BEAM"
|
||||
Public Const S_RAWPARTLIST_WALL As String = "DG_RawPartList_WALL"
|
||||
Public Const S_PARTINRAWPARTLIST_BEAM As String = "DG_PartInRawPartList_BEAM"
|
||||
Public Const S_PARTINRAWPARTLIST_WALL As String = "DG_PartInRawPartList_WALL"
|
||||
|
||||
End Module
|
||||
@@ -174,6 +174,7 @@
|
||||
</Compile>
|
||||
<Compile Include="BTLParam\PartInRawPartListVM.vb" />
|
||||
<Compile Include="BTLParam\PartListVM.vb" />
|
||||
<Compile Include="Constants\ConstDataGridColumnsIni.vb" />
|
||||
<Compile Include="Constants\ConstWarehouseIni.vb" />
|
||||
<Compile Include="FreeContourManager\FreeContourManagerV.xaml.vb">
|
||||
<DependentUpon>FreeContourManagerV.xaml</DependentUpon>
|
||||
@@ -185,10 +186,9 @@
|
||||
<Compile Include="FreeContourInput\FreeContourInputVM.vb" />
|
||||
<Compile Include="MachGroupPanel\BeamMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\BeamVM.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\PartVM.vb" />
|
||||
<Compile Include="MachGroupPanel\WallVM.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||
<Compile Include="MachGroupPanel\WallMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\WallVM.vb" />
|
||||
<Compile Include="ProjectTypeWnd\ProjectTypeWndV.xaml.vb">
|
||||
<DependentUpon>ProjectTypeWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -217,6 +217,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Utility\DisableModifiedMgr.vb" />
|
||||
<Compile Include="Utility\MachineModel.vb" />
|
||||
<Compile Include="Utility\DataGridColumnsIniFile.vb" />
|
||||
<Compile Include="Utility\TreeViewItemBase.vb" />
|
||||
<Compile Include="WarehouseWnd\WarehouseWndV.xaml.vb">
|
||||
<DependentUpon>WarehouseWndV.xaml</DependentUpon>
|
||||
@@ -489,7 +490,6 @@
|
||||
<DependentUpon>LeftPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LeftPanel\LeftPanelVM.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||
<Compile Include="MainMenu\MainMenuV.xaml.vb">
|
||||
<DependentUpon>MainMenuV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -7,15 +7,9 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BeamMachGroupVM
|
||||
Inherits MyMachGroupVM
|
||||
Inherits Core.BeamMachGroupVM
|
||||
|
||||
Public ReadOnly Property m_BeamMachGroupM As BeamMachGroupM
|
||||
Get
|
||||
Return m_MachGroupM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sStartCut As String
|
||||
Public Overrides Property sStartCut As String
|
||||
Get
|
||||
Return LenToString(m_BeamMachGroupM.dStartCut, 3)
|
||||
End Get
|
||||
@@ -47,53 +41,17 @@ Public Class BeamMachGroupVM
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Public Property dStartCut As Double
|
||||
Get
|
||||
Return m_BeamMachGroupM.dStartCut
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_BeamMachGroupM.dStartCut = value
|
||||
NotifyPropertyChanged(NameOf(sStartCut))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SelBeam As BeamVM
|
||||
Get
|
||||
Return m_SelPart
|
||||
End Get
|
||||
Set(value As BeamVM)
|
||||
m_SelPart = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New(BeamMachGroupM As BeamMachGroupM)
|
||||
MyBase.New(BeamMachGroupM)
|
||||
AddHandler m_BeamMachGroupM.PartAdded, AddressOf OnBeamAdded
|
||||
AddHandler m_BeamMachGroupM.PartRemoved, AddressOf OnBeamRemoved
|
||||
CreateBeamVMList()
|
||||
' Aggiorno stato da stati feature
|
||||
CalcGlobalUpdate()
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub CreateBeamVMList()
|
||||
Dim all As List(Of BeamVM) = (From BeamM In m_BeamMachGroupM.GetParts()
|
||||
Select New BeamVM(BeamM, Me)).ToList()
|
||||
|
||||
For Each BeamVM As BeamVM In all
|
||||
AddHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_PartVMList = New ObservableCollection(Of PartVM)(all)
|
||||
AddHandler m_PartVMList.CollectionChanged, AddressOf OnBeamVMListChanged
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshPartList()
|
||||
' leggo StartCut da posizione primo pezzo
|
||||
Dim sInfo As String = ""
|
||||
@@ -211,12 +169,12 @@ Public Class BeamMachGroupVM
|
||||
FirstBeam.NotifyPropertyChanged(NameOf(FirstBeam.sOffset))
|
||||
End Sub
|
||||
|
||||
Friend Overrides Function Copy() As MyMachGroupVM
|
||||
Public Overrides Function Copy() As MyMachGroupVM
|
||||
EgtResetCurrMachGroup()
|
||||
' recupero lista dei pezzi BTL originali
|
||||
Dim PartList As New List(Of BTLPartVM)
|
||||
For Each Part In m_PartVMList
|
||||
PartList.Add(Part.RetrieveBTLPartFromPart())
|
||||
PartList.Add(BTLPartVM.RetrieveBTLPartFromPart(Part.nPartId))
|
||||
Next
|
||||
' verifico che nessun pezzo da copiare abbia raggiunto il numero massimo
|
||||
If Not VerifyPartCount(PartList) Then Return Nothing
|
||||
@@ -300,8 +258,7 @@ Public Class BeamMachGroupVM
|
||||
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
While nRawPartId <> GDB_ID.NULL
|
||||
If EgtRemovePartFromRawPart(nBeamId) Then
|
||||
Dim Part As PartVM = PartVMList.FirstOrDefault(Function(x) x.nPartId = nBeamId)
|
||||
Dim BTLPart As BTLPartVM = Part.RetrieveBTLPartFromPart()
|
||||
Dim BTLPart As BTLPartVM = BTLPartVM.RetrieveBTLPartFromPart(nBeamId)
|
||||
EgtErase(nBeamId)
|
||||
If Not IsNothing(BTLPart) Then BTLPart.RefreshPartInProd()
|
||||
End If
|
||||
@@ -336,45 +293,4 @@ Public Class BeamMachGroupVM
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnBeamAdded(sender As Object, e As PartAddedEventArgs)
|
||||
Dim BeamVM As BeamVM = New BeamVM(e.NewPart, Me)
|
||||
PartVMList.Add(BeamVM)
|
||||
End Sub
|
||||
Private Sub OnBeamRemoved(sender As Object, e As PartAddedEventArgs)
|
||||
Dim BeamVM As BeamVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
|
||||
If Not IsNothing(BeamVM) Then PartVMList.Remove(BeamVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnBeamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If e.Action = NotifyCollectionChangedAction.Add Then
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BeamVM As BeamVM In e.NewItems
|
||||
AddHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If e.Action = NotifyCollectionChangedAction.Remove Then
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each BeamVM As BeamVM In e.OldItems
|
||||
RemoveHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If e.Action = NotifyCollectionChangedAction.Move Then
|
||||
Dim ItemVM As PartVM = e.OldItems(0)
|
||||
m_BeamMachGroupM.PartMList.RemoveAt(e.OldStartingIndex)
|
||||
m_BeamMachGroupM.PartMList.Insert(e.NewStartingIndex, ItemVM.PartM)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnBeamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -5,15 +5,9 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BeamVM
|
||||
Inherits PartVM
|
||||
Inherits Core.BeamVM
|
||||
|
||||
Public ReadOnly Property m_BeamM As BeamM
|
||||
Get
|
||||
Return m_PartM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sOffset As String
|
||||
Public Overrides Property sOffset As String
|
||||
Get
|
||||
Return LenToString(m_BeamM.dOffset, 3)
|
||||
End Get
|
||||
@@ -40,11 +34,6 @@ Public Class BeamVM
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property dOffset As Double
|
||||
Get
|
||||
Return m_BeamM.dOffset
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Sub ResetOffset()
|
||||
m_BeamM.dOffset = RawPartConfiguration.dBeamDist
|
||||
@@ -68,7 +57,7 @@ Public Class BeamVM
|
||||
' elimino pezzo copia
|
||||
EgtRemovePartFromRawPart(Me.nPartId)
|
||||
' Recupero Id BTLPart originale
|
||||
Dim BTLPart As BTLPartVM = RetrieveBTLPartFromPart()
|
||||
Dim BTLPart As BTLPartVM = BTLPartVM.RetrieveBTLPartFromPart(nPartId)
|
||||
EgtErase(Me.nPartId)
|
||||
' rimuovo dalla lista pezzi
|
||||
Dim Index As Integer = ParentMachGroupVM.PartVMList.IndexOf(ParentMachGroupVM.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId))
|
||||
|
||||
@@ -6,43 +6,16 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MyMachGroupPanelVM
|
||||
Inherits NewMachGroupPanelVM
|
||||
Inherits Core.MyMachGroupPanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Public ReadOnly Property m_MyMachGroupPanelM As MyMachGroupPanelM
|
||||
Get
|
||||
Return m_MachGroupPanelM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotMachGroups As String
|
||||
Get
|
||||
Return Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotVolume As String
|
||||
Get
|
||||
Dim dMMTotVolume As Double = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.dUnitVolume, Func(Of MachGroupVM, Double)))
|
||||
Return If(EgtUiUnitsAreMM(), DoubleToString(dMMTotVolume / 1000000000, 3), DoubleToString(dMMTotVolume * (12 / ONEINCH), 3))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotTime As String
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.nCALC_TIME, Func(Of MachGroupVM, Double)))).ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(MachGroupPanelM As MachGroupPanelM)
|
||||
MyBase.New(MachGroupPanelM)
|
||||
' Creo riferimento a questa classe in Map
|
||||
Map.SetRefMachGroupPanelVM(Me)
|
||||
' elimino copie da cancellare
|
||||
DeleteDuplo()
|
||||
End Sub
|
||||
@@ -51,44 +24,44 @@ Public Class MyMachGroupPanelVM
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Protected Overrides Sub CreateMachGroupVMList()
|
||||
Dim all As New List(Of MachGroupVM)
|
||||
For Each MachGroupM In m_MachGroupPanelM.GetMachGroups()
|
||||
If DirectCast(MachGroupM, MyMachGroupM).nMachineType = MachineType.BEAM Then
|
||||
all.Add(New BeamMachGroupVM(MachGroupM))
|
||||
Else
|
||||
all.Add(New WallMachGroupVM(MachGroupM))
|
||||
End If
|
||||
Next
|
||||
'Protected Overrides Sub CreateMachGroupVMList()
|
||||
' Dim all As New List(Of MachGroupVM)
|
||||
' For Each MachGroupM In m_MachGroupPanelM.GetMachGroups()
|
||||
' If DirectCast(MachGroupM, MyMachGroupM).nMachineType = MachineType.BEAM Then
|
||||
' all.Add(New BeamMachGroupVM(MachGroupM))
|
||||
' Else
|
||||
' all.Add(New WallMachGroupVM(MachGroupM))
|
||||
' End If
|
||||
' Next
|
||||
|
||||
For Each MachGroupvM As MachGroupVM In all
|
||||
AddHandler MachGroupvM.PropertyChanged, AddressOf OnMachGroupVMPropertyChanged
|
||||
Next
|
||||
' For Each MachGroupvM As MachGroupVM In all
|
||||
' AddHandler MachGroupvM.PropertyChanged, AddressOf OnMachGroupVMPropertyChanged
|
||||
' Next
|
||||
|
||||
MachGroupVMList = New ObservableCollection(Of MachGroupVM)(all)
|
||||
AddHandler MachGroupVMList.CollectionChanged, AddressOf OnMachGroupVMListChanged
|
||||
End Sub
|
||||
' MachGroupVMList = New ObservableCollection(Of MachGroupVM)(all)
|
||||
' AddHandler MachGroupVMList.CollectionChanged, AddressOf OnMachGroupVMListChanged
|
||||
'End Sub
|
||||
|
||||
Public Overrides Function InitMachGroupList(Optional bUseDefaults As Boolean = False) As Boolean
|
||||
' Svuoto precedente lista di MachGroup
|
||||
MachGroupVMList.Clear()
|
||||
' aggiorno copie
|
||||
MyMachGroupPanelM.UpdateDuplo()
|
||||
' verifico se esistono già gruppi di lavorazione o se devo creare il primo
|
||||
Dim bOk As Boolean = False
|
||||
Dim nId = EgtGetFirstMachGroup()
|
||||
If nId <> GDB_ID.NULL Then
|
||||
bOk = EgtSetCurrMachGroup(nId)
|
||||
End If
|
||||
If Not bOk Then Return True
|
||||
' carico lista dei gruppi di lavorazione
|
||||
m_MachGroupPanelM.MachGroupMList = MyMachGroupPanelM.LoadMyMachGroups(Map.refMachinePanelVM.MachineList.ToList())
|
||||
' elimino copie da cancellare
|
||||
MyMachGroupPanelM.DeleteDuplo()
|
||||
If bOk Then SelectedMachGroup = MachGroupVMList(0)
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
'Public Overrides Function InitMachGroupList(Optional bUseDefaults As Boolean = False) As Boolean
|
||||
' ' Svuoto precedente lista di MachGroup
|
||||
' MachGroupVMList.Clear()
|
||||
' ' aggiorno copie
|
||||
' MyMachGroupPanelM.UpdateDuplo()
|
||||
' ' verifico se esistono già gruppi di lavorazione o se devo creare il primo
|
||||
' Dim bOk As Boolean = False
|
||||
' Dim nId = EgtGetFirstMachGroup()
|
||||
' If nId <> GDB_ID.NULL Then
|
||||
' bOk = EgtSetCurrMachGroup(nId)
|
||||
' End If
|
||||
' If Not bOk Then Return True
|
||||
' ' carico lista dei gruppi di lavorazione
|
||||
' m_MachGroupPanelM.MachGroupMList = MyMachGroupPanelM.LoadMyMachGroups(Map.refMachinePanelVM.MachineList.ToList())
|
||||
' ' elimino copie da cancellare
|
||||
' MyMachGroupPanelM.DeleteDuplo()
|
||||
' If bOk Then SelectedMachGroup = MachGroupVMList(0)
|
||||
' EgtZoom(ZM.ALL)
|
||||
' Return True
|
||||
'End Function
|
||||
|
||||
Public Function RefreshMachGroupList() As Boolean
|
||||
' carico lista dei gruppi di lavorazione
|
||||
@@ -99,7 +72,7 @@ Public Class MyMachGroupPanelVM
|
||||
For Each MachGroup As MyMachGroupVM In MachGroupVMList
|
||||
For Each Part In MachGroup.PartVMList
|
||||
' aggiorno calcolo pezzi in produzione
|
||||
Dim BTLPart As BTLPartVM = Part.RetrieveBTLPartFromPart()
|
||||
Dim BTLPart As BTLPartVM = BTLPartVM.RetrieveBTLPartFromPart(Part.nPartId)
|
||||
If Not IsNothing(BTLPart) Then BTLPart.RefreshPartInProd()
|
||||
Next
|
||||
Next
|
||||
@@ -185,32 +158,6 @@ Public Class MyMachGroupPanelVM
|
||||
SelectedMachGroup = MachGroupVMList.FirstOrDefault(Function(x) x.MachGroupM Is MyMachGroupM)
|
||||
End Sub
|
||||
|
||||
Public Overrides Function OnPreSetCurrMachGroup() As Boolean
|
||||
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
|
||||
' resetto eventuale selezione pezzo
|
||||
DirectCast(SelectedMachGroup, MyMachGroupVM).SelPart = Nothing
|
||||
' Imposto vista solo tavola
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
Dim View As VT
|
||||
For Each Mach As MyMachine In Map.refMachinePanelVM.MachineList
|
||||
If Mach.Name = SelectedMachGroup.Machine Then
|
||||
If Mach.nType = Core.ConstBeam.MachineType.BEAM Then
|
||||
View = VT.ISO_SW
|
||||
Else
|
||||
View = VT.TOP
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
EgtSetView(View, False)
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' funzione che seleziona primo gruppo
|
||||
Friend Sub SelFirstMachGroup()
|
||||
If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
|
||||
@@ -223,56 +170,7 @@ Public Class MyMachGroupPanelVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' funzione che seleziona ultimo gruppo
|
||||
Friend Sub SelLastMachGroup()
|
||||
If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
|
||||
SelectedMachGroup = MachGroupVMList(MachGroupVMList.Count - 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Function GetLastMachGroup() As MachGroupVM
|
||||
If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
|
||||
Return MachGroupVMList(MachGroupVMList.Count - 1)
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
' funzione che aggiorna totale tempi a fine calcolo
|
||||
Friend Sub CalcGlobalTime()
|
||||
NotifyPropertyChanged(NameOf(sTotTime))
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna numero gruppi di lavorazione e volume totale
|
||||
Friend Sub CalcGlobalUpdate()
|
||||
NotifyPropertyChanged(NameOf(sTotMachGroups))
|
||||
NotifyPropertyChanged(NameOf(sTotVolume))
|
||||
NotifyPropertyChanged(NameOf(sTotTime))
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Protected Overrides Sub OnMachGroupAdded(sender As Object, e As MachGroupAddedEventArgs)
|
||||
Dim MachGroupVM As MachGroupVM = Nothing
|
||||
Select Case DirectCast(e.NewMachGroupM, MyMachGroupM).nMachineType
|
||||
Case Core.ConstBeam.MachineType.BEAM
|
||||
MachGroupVM = New BeamMachGroupVM(e.NewMachGroupM)
|
||||
Case Core.ConstBeam.MachineType.WALL
|
||||
MachGroupVM = New WallMachGroupVM(e.NewMachGroupM)
|
||||
Case Core.ConstBeam.MachineType.NULL
|
||||
Return
|
||||
End Select
|
||||
MachGroupVMList.Add(MachGroupVM)
|
||||
NotifyPropertyChanged(NameOf(MachGroupVMList))
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnMachGroupVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
'Case nameof(sender.sMATERIAL)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -7,263 +7,8 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class MyMachGroupVM
|
||||
Inherits MachGroupVM
|
||||
Inherits Core.MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property MyMachGroupM As MyMachGroupM
|
||||
Get
|
||||
Return m_MachGroupM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nMachineType As MachineType
|
||||
Get
|
||||
Return MyMachGroupM.nMachineType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return MyMachGroupM.dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
MyMachGroupM.dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return MyMachGroupM.dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
MyMachGroupM.dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return MyMachGroupM.dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
MyMachGroupM.dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtStartTime As DateTime
|
||||
Get
|
||||
Return MyMachGroupM.dtStartTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
MyMachGroupM.dtStartTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtEndTime As DateTime
|
||||
Get
|
||||
Return MyMachGroupM.dtEndTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
MyMachGroupM.dtEndTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dUsage As Double
|
||||
Get
|
||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, MyMachGroupM.dMatForPart / MyMachGroupM.dTotMat * 100, 0)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dWaste As Double
|
||||
Get
|
||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, (MyMachGroupM.dTotMat - MyMachGroupM.dMatForPart) / MyMachGroupM.dTotMat * 100, 0)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sUsage As String
|
||||
Get
|
||||
Return DoubleToString(dUsage, 3)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sWaste As String
|
||||
Get
|
||||
Return DoubleToString(dWaste, 3)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return MyMachGroupM.sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
MyMachGroupM.sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei pezzi che sono nel grezzo
|
||||
Protected m_PartVMList As New ObservableCollection(Of PartVM)
|
||||
Public Property PartVMList As ObservableCollection(Of PartVM)
|
||||
Get
|
||||
Return m_PartVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of PartVM))
|
||||
m_PartVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelPart As PartVM
|
||||
Public Overridable Property SelPart As PartVM
|
||||
Get
|
||||
Return m_SelPart
|
||||
End Get
|
||||
Set(value As PartVM)
|
||||
m_SelPart = value
|
||||
' seleziono pezzo
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(value) Then EgtSelectObj(SelPart.nPartId)
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelPart))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_ERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_FALL
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sCALC_MSG As String
|
||||
Get
|
||||
Return MyMachGroupM.sCALC_MSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
MyMachGroupM.nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
MyMachGroupM.nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nGlobalState As CalcStates
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_GlobalState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
MyMachGroupM.nCALC_GlobalState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nState As CalcStates
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_State
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
MyMachGroupM.nCALC_State = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nProductionState As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nProductionState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If MyMachGroupM.nCALC_GlobalState = CalcStates.OK Then
|
||||
Return Brushes.Green
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.INFO Then
|
||||
Return Brushes.Green
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.WARNING Then
|
||||
Return Brushes.Gold
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.ERROR_ Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(MyMachGroupM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_FALL_Visibility As Visibility
|
||||
Get
|
||||
Return If(MyMachGroupM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Letter As String
|
||||
Get
|
||||
Select Case MyMachGroupM.nCALC_GlobalERR
|
||||
Case 22
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Return "e"
|
||||
Case 17
|
||||
Return "w"
|
||||
Case < 0
|
||||
Return "i"
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
||||
Get
|
||||
Select Case MyMachGroupM.m_nCALC_GlobalState
|
||||
Case CalcStates.ERROR_
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
Case CalcStates.INFO
|
||||
Return Brushes.Green
|
||||
Case Else
|
||||
Return Brushes.Red
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sUnitTime As String
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(nCALC_TIME).ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dUnitVolume As Double
|
||||
Get
|
||||
Return dL * dW * dH
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Section As SectionXMaterial
|
||||
Get
|
||||
Return New SectionXMaterial(dW, dH, dL, MyMachGroupM.sMATERIAL)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdDeleteMachGroup As ICommand
|
||||
@@ -272,104 +17,14 @@ Public MustInherit Class MyMachGroupVM
|
||||
|
||||
Sub New(MyMachGroupM As MyMachGroupM)
|
||||
MyBase.New(MyMachGroupM)
|
||||
'aggiorno lista pezzi
|
||||
RefreshPartList()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend MustOverride Function Copy() As MyMachGroupVM
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
Public MustOverride Sub RefreshPartList()
|
||||
|
||||
Public MustOverride Sub RefreshGroupData()
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Friend Sub CalcMachGroupUpdate(ERR As Integer, ROT As Integer, MSG As String)
|
||||
EgtSetInfo(Id, ITG_PROD_ERR, ERR, True)
|
||||
EgtSetInfo(Id, ITG_PROD_MSG, MSG, True)
|
||||
EgtSetInfo(Id, ITG_PROD_ROT, ROT, True)
|
||||
MyMachGroupM.nCALC_ERR = ERR
|
||||
MyMachGroupM.nCALC_ROT = ROT
|
||||
MyMachGroupM.sCALC_MSG = MSG
|
||||
If ERR = 0 Then
|
||||
nState = CalcStates.OK
|
||||
ElseIf ERR = 17 Then
|
||||
nState = CalcStates.WARNING
|
||||
ElseIf ERR > 0 Then
|
||||
nState = CalcStates.ERROR_
|
||||
ElseIf ERR < 0 Then
|
||||
nState = CalcStates.INFO
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Sub
|
||||
|
||||
Friend Sub ResetCalcMachGroup()
|
||||
EgtRemoveInfo(Id, ITG_PROD_ERR)
|
||||
EgtRemoveInfo(Id, ITG_PROD_MSG)
|
||||
EgtRemoveInfo(Id, ITG_PROD_ROT)
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
MyMachGroupM.nCALC_State = CalcStates.NOTCALCULATED
|
||||
MyMachGroupM.nCALC_GlobalERR = 0
|
||||
MyMachGroupM.nCALC_ERR = 0
|
||||
MyMachGroupM.nCALC_ROT = 0
|
||||
MyMachGroupM.nCALC_FALL = 0
|
||||
MyMachGroupM.sCALC_MSG = ""
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Friend Sub CalcGlobalUpdate()
|
||||
MyMachGroupM.nCALC_GlobalERR = nCALC_ERR
|
||||
MyMachGroupM.nCALC_GlobalState = nState
|
||||
For Each Part In MyMachGroupM.PartMList
|
||||
If Part.nCALC_GlobalState = CalcStates.NOTCALCULATED Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
Exit For
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.OK AndAlso MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.NOTCALCULATED Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.OK
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.INFO And (MyMachGroupM.nCALC_GlobalState = CalcStates.OK Or MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED) Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.INFO
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.WARNING And (MyMachGroupM.nCALC_GlobalState = CalcStates.OK Or MyMachGroupM.nCALC_GlobalState = CalcStates.INFO Or MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED) Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.WARNING
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.ERROR_ And (MyMachGroupM.nCALC_GlobalState = CalcStates.OK Or MyMachGroupM.nCALC_GlobalState = CalcStates.INFO Or MyMachGroupM.nCALC_GlobalState = CalcStates.WARNING Or MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED) Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.ERROR_
|
||||
End If
|
||||
If Part.nCALC_GlobalERR = 22 Then
|
||||
MyMachGroupM.nCALC_GlobalERR = 22
|
||||
ElseIf Part.nCALC_GlobalERR > 0 And MyMachGroupM.nCALC_GlobalERR <= 0 Then
|
||||
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
|
||||
ElseIf Part.nCALC_GlobalERR < 0 And MyMachGroupM.nCALC_GlobalERR = 0 Then
|
||||
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
|
||||
End If
|
||||
If Part.nCALC_ROT <> 0 Then
|
||||
MyMachGroupM.m_nCALC_ROT = Part.nCALC_ROT
|
||||
End If
|
||||
If Part.nCALC_FALL <> 0 Then
|
||||
MyMachGroupM.nCALC_FALL = Part.nCALC_FALL
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
Friend Sub CalcTimeUpdate(TIME As Integer)
|
||||
EgtSetInfo(Id, ITG_PROD_TIME, TIME, True)
|
||||
nCALC_TIME = TIME
|
||||
NotifyPropertyChanged(NameOf(sUnitTime))
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DeleteMachGroup"
|
||||
|
||||
@@ -9,524 +9,22 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class PartVM
|
||||
Inherits VMBase
|
||||
Inherits Core.PartVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Protected m_PartM As PartM
|
||||
Public ReadOnly Property PartM As PartM
|
||||
Get
|
||||
Return m_PartM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_ParentMachGroupVM As MyMachGroupVM
|
||||
Public ReadOnly Property ParentMachGroupVM As MyMachGroupVM
|
||||
Get
|
||||
Return m_ParentMachGroupVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Id geometrico del pezzo
|
||||
Public ReadOnly Property nPartId As Integer
|
||||
Get
|
||||
Return m_PartM.nPartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Proj del pezzo
|
||||
Public Property nProjId As Integer
|
||||
Get
|
||||
Return m_PartM.nProjId
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nProjId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Info del pezzo
|
||||
Public ReadOnly Property nPDN As Integer
|
||||
Get
|
||||
Return m_PartM.nPDN
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sNAM As String
|
||||
Get
|
||||
Return m_PartM.sNAM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sL As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dL, 3)
|
||||
End Get
|
||||
End Property
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return m_PartM.dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sW As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dW, 3)
|
||||
End Get
|
||||
End Property
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return m_PartM.dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sH As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dH, 3)
|
||||
End Get
|
||||
End Property
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return m_PartM.dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overridable Property sPOSX As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dPOSX, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_PartM.dPOSX)
|
||||
End Set
|
||||
End Property
|
||||
Public Property dPOSX As Double
|
||||
Get
|
||||
Return m_PartM.dPOSX
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_PartM.dPOSX = value
|
||||
NotifyPropertyChanged(NameOf(sPOSX))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCNT As Integer
|
||||
Get
|
||||
Return m_PartM.nCNT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCNT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sINVERTED As String
|
||||
Get
|
||||
Return m_PartM.nINVERTED & "°"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sROTATED As String
|
||||
Get
|
||||
Return m_PartM.nROTATED & "°"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return m_PartM.sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_PartM.sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nGlobalState As CalcStates
|
||||
Get
|
||||
Return m_PartM.nCALC_GlobalState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nCALC_GlobalERR As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_GlobalERR
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_GlobalERR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nState As CalcStates
|
||||
Get
|
||||
Return m_PartM.nCALC_State
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_PartM.nCALC_State = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If m_PartM.nCALC_GlobalState = CalcStates.OK Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.NOTCALCULATED Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.INFO Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.WARNING Then
|
||||
Return Brushes.Orange
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.ERROR_ Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_PartM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_FALL_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_PartM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Letter As String
|
||||
Get
|
||||
Select Case m_PartM.nCALC_GlobalERR
|
||||
Case 22
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Return "e"
|
||||
Case 17
|
||||
Return "w"
|
||||
Case < 0
|
||||
Return "i"
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
||||
Get
|
||||
Select Case m_PartM.nCALC_GlobalState
|
||||
Case CalcStates.ERROR_
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
Case CalcStates.INFO
|
||||
Return Brushes.Green
|
||||
Case Else
|
||||
Return Brushes.Red
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_ERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_PartM.sCALC_MSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_FALL
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_FALL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return m_PartM.nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle feature del pezzo
|
||||
Protected m_FeatureVMList As ObservableCollection(Of BTLFeatureVM)
|
||||
Public Property FeatureVMList As ObservableCollection(Of BTLFeatureVM)
|
||||
Get
|
||||
Return m_FeatureVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLFeatureVM))
|
||||
m_FeatureVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelFeatureVM As BTLFeatureVM
|
||||
Public Property SelFeatureVM As BTLFeatureVM
|
||||
Get
|
||||
Return m_SelFeatureVM
|
||||
End Get
|
||||
Set(value As BTLFeatureVM)
|
||||
m_SelFeatureVM = value
|
||||
If Not IsNothing(m_SelFeatureVM) Then
|
||||
DirectCast(m_SelFeatureVM, BTLFeatureVM).SelGeomFeature()
|
||||
Else
|
||||
EgtDeselectAll()
|
||||
End If
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelFeatureVM))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtStartTime As DateTime
|
||||
Get
|
||||
Return m_PartM.dtStartTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_PartM.dtStartTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtEndTime As DateTime
|
||||
Get
|
||||
Return m_PartM.dtEndTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_PartM.dtEndTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdDeletePart As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(PartM As PartM, ParentMachGroupVM As MyMachGroupVM)
|
||||
m_PartM = PartM
|
||||
m_ParentMachGroupVM = ParentMachGroupVM
|
||||
AddHandler m_PartM.BTLFeatureAdded, AddressOf OnBTLFeatureAdded
|
||||
CreateBTLFeatureVMList()
|
||||
' Aggiorno stato da stati feature
|
||||
CalcGlobalUpdate()
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
MyBase.New(PartM, ParentMachGroupVM)
|
||||
End Sub
|
||||
'Sub New(nParentMachGroup As MyMachGroupM, nPartId As Integer)
|
||||
' m_ParentMachGroup = nParentMachGroup
|
||||
' SetPartId(nPartId)
|
||||
' m_FeatureVMList = New ObservableCollection(Of BTLFeatureM)
|
||||
'End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Private Sub CreateBTLFeatureVMList()
|
||||
Dim all As List(Of BTLFeatureVM) = (From BTLFeatureM In m_PartM.GetBTLFeatures()
|
||||
Select New BTLFeatureVM(BTLFeatureM)).ToList()
|
||||
|
||||
For Each BTLFeatureVM As BTLFeatureVM In all
|
||||
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_FeatureVMList = New ObservableCollection(Of BTLFeatureVM)(all)
|
||||
AddHandler m_FeatureVMList.CollectionChanged, AddressOf OnBTLFeatureVMListChanged
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcPartUpdate(ERR As Integer, ROT As Integer, MSG As String)
|
||||
EgtSetInfo(nPartId, ITG_PROD_ERR, ERR, True)
|
||||
EgtSetInfo(nPartId, ITG_PROD_MSG, MSG, True)
|
||||
EgtSetInfo(nPartId, ITG_PROD_ROT, ROT, True)
|
||||
m_PartM.nCALC_ERR = ERR
|
||||
m_PartM.nCALC_ROT = ROT
|
||||
m_PartM.sCALC_MSG = MSG
|
||||
If ERR = 0 Then
|
||||
nState = CalcStates.OK
|
||||
ElseIf ERR = 17 Then
|
||||
nState = CalcStates.WARNING
|
||||
ElseIf ERR > 0 Then
|
||||
nState = CalcStates.ERROR_
|
||||
ElseIf ERR < 0 Then
|
||||
nState = CalcStates.INFO
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Sub
|
||||
|
||||
Friend Sub ResetCalcPart()
|
||||
EgtRemoveInfo(nPartId, ITG_PROD_ERR)
|
||||
EgtRemoveInfo(nPartId, ITG_PROD_MSG)
|
||||
EgtRemoveInfo(nPartId, ITG_PROD_ROT)
|
||||
EgtRemoveInfo(nPartId, ITG_PROD_FALL)
|
||||
m_PartM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
m_PartM.nCALC_State = CalcStates.NOTCALCULATED
|
||||
m_PartM.nCALC_GlobalERR = 0
|
||||
m_PartM.nCALC_ERR = 0
|
||||
m_PartM.nCALC_ROT = 0
|
||||
m_PartM.nCALC_FALL = 0
|
||||
m_PartM.sCALC_MSG = ""
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
ParentMachGroupVM.ResetCalcMachGroup()
|
||||
End Sub
|
||||
|
||||
Public Sub CalcFallUpdate(FALL As Integer)
|
||||
EgtSetInfo(nPartId, ITG_PROD_FALL, FALL, True)
|
||||
m_PartM.nCALC_FALL = 0
|
||||
NotifyPropertyChanged(NameOf(nCALC_FALL))
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcGlobalUpdate()
|
||||
m_PartM.nCALC_GlobalState = nState
|
||||
For Each Feature In FeatureVMList
|
||||
If Not Feature.bDO Then
|
||||
ElseIf Feature.nState = CalcStates.NOTCALCULATED Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
Exit For
|
||||
ElseIf Feature.nState = CalcStates.INFO And m_PartM.nCALC_GlobalState = CalcStates.OK Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.INFO
|
||||
ElseIf Feature.nState = CalcStates.WARNING And (m_PartM.nCALC_GlobalState = CalcStates.OK Or m_PartM.nCALC_GlobalState = CalcStates.INFO) Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.WARNING
|
||||
ElseIf Feature.nState = CalcStates.ERROR_ And (m_PartM.nCALC_GlobalState = CalcStates.OK Or m_PartM.nCALC_GlobalState = CalcStates.INFO Or m_PartM.nCALC_GlobalState = CalcStates.WARNING) Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.ERROR_
|
||||
End If
|
||||
If Feature.nCALC_ERR = 22 Then
|
||||
m_PartM.nCALC_GlobalERR = 22
|
||||
ElseIf Feature.nCALC_ERR > 0 And m_PartM.nCALC_GlobalERR <= 0 Then
|
||||
m_PartM.nCALC_GlobalERR = Feature.nCALC_ERR
|
||||
ElseIf Feature.nCALC_ERR < 0 And m_PartM.nCALC_GlobalERR = 0 Then
|
||||
m_PartM.nCALC_GlobalERR = Feature.nCALC_ERR
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
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(m_PartM.nPartId)
|
||||
' Recupero Id BTLPart originale
|
||||
Dim BTLPart As BTLPartVM = RetrieveBTLPartFromPart()
|
||||
' elimino pezzo copia
|
||||
EgtErase(m_PartM.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(ParentMachGroupVM.Id, MGR_RPT_PART & Index, sInfo)
|
||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||
sSplitInfo = sInfo.Split(","c)
|
||||
If bFound Then
|
||||
EgtSetInfo(ParentMachGroupVM.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(ParentMachGroupVM.Id, MGR_RPT_PART & Index - 1, "")
|
||||
End If
|
||||
' rimuovo dalla lista pezzi
|
||||
Index = ParentMachGroupVM.PartVMList.IndexOf(Me)
|
||||
If Index = 0 Then
|
||||
If ParentMachGroupVM.PartVMList.Count > 0 Then
|
||||
ParentMachGroupVM.SelPart = ParentMachGroupVM.PartVMList(0)
|
||||
Else
|
||||
ParentMachGroupVM.SelPart = Nothing
|
||||
End If
|
||||
ElseIf Index = ParentMachGroupVM.PartVMList.Count - 1 Then
|
||||
If ParentMachGroupVM.PartVMList.Count > 1 Then
|
||||
ParentMachGroupVM.SelPart = ParentMachGroupVM.PartVMList(ParentMachGroupVM.PartVMList.Count - 2)
|
||||
Else
|
||||
ParentMachGroupVM.SelPart = Nothing
|
||||
End If
|
||||
Else
|
||||
ParentMachGroupVM.SelPart = ParentMachGroupVM.PartVMList(Index - 1)
|
||||
End If
|
||||
ParentMachGroupVM.PartVMList.Remove(Me)
|
||||
' aggiorno contatore pezzi usati in Prod
|
||||
If Not IsNothing(BTLPart) Then BTLPart.RefreshPartInProd()
|
||||
End Sub
|
||||
|
||||
Friend Function RetrieveBTLPartFromPart() As BTLPartVM
|
||||
Dim BTLPartId As Integer = EgtDuploGetOriginal(nPartId)
|
||||
Return Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = BTLPartId)
|
||||
End Function
|
||||
|
||||
#End Region ' DeletePart
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnBTLFeatureAdded(sender As Object, e As BTLFeatureAddedEventArgs)
|
||||
Dim BTLFeatureVM As BTLFeatureVM = New BTLFeatureVM(e.NewBTLFeature)
|
||||
FeatureVMList.Add(BTLFeatureVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLFeatureVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BTLFeatureVM As BTLFeatureVM In e.NewItems
|
||||
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each BTLFeatureVM As BTLFeatureVM In e.OldItems
|
||||
RemoveHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLFeatureVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -7,42 +7,18 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class WallMachGroupVM
|
||||
Inherits MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property m_WallMachGroupM As WallMachGroupM
|
||||
Get
|
||||
Return m_MachGroupM
|
||||
End Get
|
||||
End Property
|
||||
Inherits Core.WallMachGroupVM
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New(WallMachGroupM As WallMachGroupM)
|
||||
MyBase.New(WallMachGroupM)
|
||||
AddHandler m_WallMachGroupM.PartAdded, AddressOf OnWallAdded
|
||||
AddHandler m_WallMachGroupM.PartRemoved, AddressOf OnWallRemoved
|
||||
CreateWallVMList()
|
||||
' Aggiorno stato da stati feature
|
||||
CalcGlobalUpdate()
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub CreateWallVMList()
|
||||
Dim all As List(Of WallVM) = (From WallM In m_WallMachGroupM.GetParts()
|
||||
Select New WallVM(WallM, Me)).ToList()
|
||||
|
||||
For Each WallVM As WallVM In all
|
||||
AddHandler WallVM.PropertyChanged, AddressOf OnWallVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_PartVMList = New ObservableCollection(Of PartVM)(all)
|
||||
AddHandler m_PartVMList.CollectionChanged, AddressOf OnWallVMListChanged
|
||||
End Sub
|
||||
|
||||
Friend Function ReDrawWallMachgroup() As Boolean
|
||||
' scrivo dati di tutti i pezzi
|
||||
Dim nIndex As Integer
|
||||
@@ -68,10 +44,7 @@ Public Class WallMachGroupVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Overrides Function Copy() As MyMachGroupVM
|
||||
|
||||
|
||||
|
||||
Public Overrides Function Copy() As MyMachGroupVM
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
@@ -93,7 +66,6 @@ Public Class WallMachGroupVM
|
||||
NotifyPropertyChanged(NameOf(dWaste))
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DeleteMachGroup"
|
||||
@@ -105,8 +77,7 @@ Public Class WallMachGroupVM
|
||||
Dim nWallId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
While nWallId <> GDB_ID.NULL
|
||||
If EgtRemovePartFromRawPart(nWallId) Then
|
||||
Dim Part As PartVM = PartVMList.FirstOrDefault(Function(x) x.nPartId = nWallId)
|
||||
Dim BTLPart As BTLPartVM = Part.RetrieveBTLPartFromPart()
|
||||
Dim BTLPart As BTLPartVM = BTLPartVM.RetrieveBTLPartFromPart(nWallId)
|
||||
EgtErase(nWallId)
|
||||
If Not IsNothing(BTLPart) Then BTLPart.RefreshPartInProd()
|
||||
End If
|
||||
@@ -140,36 +111,4 @@ Public Class WallMachGroupVM
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnWallAdded(sender As Object, e As PartAddedEventArgs)
|
||||
Dim WallVM As WallVM = New WallVM(e.NewPart, Me)
|
||||
PartVMList.Add(WallVM)
|
||||
End Sub
|
||||
Private Sub OnWallRemoved(sender As Object, e As PartAddedEventArgs)
|
||||
Dim WallVM As WallVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
|
||||
If Not IsNothing(WallVM) Then PartVMList.Remove(WallVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnWallVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each WallVM As WallVM In e.NewItems
|
||||
AddHandler WallVM.PropertyChanged, AddressOf OnWallVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each WallVM As WallVM In e.OldItems
|
||||
RemoveHandler WallVM.PropertyChanged, AddressOf OnWallVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnWallVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -5,13 +5,7 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class WallVM
|
||||
Inherits PartVM
|
||||
|
||||
Public ReadOnly Property m_WallM As WallM
|
||||
Get
|
||||
Return m_PartM
|
||||
End Get
|
||||
End Property
|
||||
Inherits Core.WallVM
|
||||
|
||||
Public Overrides Property sPOSX As String
|
||||
Get
|
||||
@@ -35,7 +29,7 @@ Public Class WallVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property sPOSY As String
|
||||
Public Overrides Property sPOSY As String
|
||||
Get
|
||||
Return LenToString(m_WallM.dPOSY, 3)
|
||||
End Get
|
||||
@@ -57,16 +51,7 @@ Public Class WallVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property sROT As String
|
||||
Get
|
||||
Return LenToString(m_WallM.dROT, 3) & "°"
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_WallM.dROT)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property bFLIP As Boolean
|
||||
Public Overrides Property bFLIP As Boolean
|
||||
Get
|
||||
Return m_WallM.bFLIP
|
||||
End Get
|
||||
@@ -110,7 +95,7 @@ Public Class WallVM
|
||||
' elimino pezzo copia
|
||||
EgtRemovePartFromRawPart(Me.nPartId)
|
||||
' Recupero Id BTLPart originale
|
||||
Dim BTLPart As BTLPartVM = RetrieveBTLPartFromPart()
|
||||
Dim BTLPart As BTLPartVM = BTLPartVM.RetrieveBTLPartFromPart(nPartId)
|
||||
EgtErase(Me.nPartId)
|
||||
' rimuovo dalla lista pezzi
|
||||
Dim Index As Integer = ParentMachGroupVM.PartVMList.IndexOf(ParentMachGroupVM.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId))
|
||||
|
||||
@@ -5,30 +5,20 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MachinePanelVM
|
||||
Inherits VMBase
|
||||
Inherits EgtWPFLib5.MachinePanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
' Radice del direttorio delle macchine
|
||||
Private m_sMachinesRoot As String
|
||||
|
||||
' Lista delle macchine disponibili
|
||||
Private m_MachineList As New ObservableCollection(Of Machine)
|
||||
Public Property MachineList As ObservableCollection(Of Machine)
|
||||
Get
|
||||
Return m_MachineList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Machine))
|
||||
m_MachineList = value
|
||||
End Set
|
||||
End Property
|
||||
' Macchina correntemente selezionata e quindi attiva
|
||||
Private m_SelectedMachine As Machine = Nothing
|
||||
Public Property SelectedMachine As MyMachine
|
||||
Public Overrides Property SelectedMachine As Machine
|
||||
Get
|
||||
Return m_SelectedMachine
|
||||
End Get
|
||||
Set(value As MyMachine)
|
||||
Set(value As Machine)
|
||||
If value IsNot m_SelectedMachine Then
|
||||
' se sono in modalità disegno
|
||||
If Map.refMainMenuVM.SelPage = Pages.CONFIG Then
|
||||
@@ -55,7 +45,6 @@ Public Class MachinePanelVM
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(BeamTable_Visibility))
|
||||
NotifyPropertyChanged(NameOf(WallTable_Visibility))
|
||||
Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.MovePart_Visibility))
|
||||
' resetto Proj e Prod correnti, BTLStructure e MachGroupPanel
|
||||
Map.refProjManagerVM.ResetCurrProj()
|
||||
Map.refProdManagerVM.ResetCurrProd()
|
||||
@@ -70,17 +59,6 @@ Public Class MachinePanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SetUp_Background As Brush = New BrushConverter().ConvertFrom("#FFDDDDDD")
|
||||
Public Property SetUp_Background As Brush
|
||||
Get
|
||||
Return m_SetUp_Background
|
||||
End Get
|
||||
Set(value As Brush)
|
||||
m_SetUp_Background = value
|
||||
NotifyPropertyChanged("SetUp_Background")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MachPanel_IsEnabled As Boolean = True
|
||||
Public Property MachPanel_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -147,10 +125,6 @@ Public Class MachinePanelVM
|
||||
#End Region ' ToolTip
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdToolDb As ICommand
|
||||
Private m_cmdMachDb As ICommand
|
||||
Private m_cmdSetUp As ICommand
|
||||
Private m_cmdMachOptions As ICommand
|
||||
Private m_cmdBeamTable As ICommand
|
||||
Private m_cmdWallTable As ICommand
|
||||
|
||||
@@ -172,7 +146,7 @@ Public Class MachinePanelVM
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub LoadCurrentMachine()
|
||||
If m_MachineList.Count = 0 Then Return
|
||||
If MachineList.Count = 0 Then Return
|
||||
Dim CurrMach As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MACH, K_CURRMACH, String.Empty, CurrMach)
|
||||
Dim bFound As Boolean = False
|
||||
@@ -252,28 +226,7 @@ Public Class MachinePanelVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "ToolDbCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ToolDbCommand As ICommand
|
||||
Get
|
||||
If m_cmdToolDb Is Nothing Then
|
||||
m_cmdToolDb = New Command(AddressOf ToolDb)
|
||||
End If
|
||||
Return m_cmdToolDb
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ToolDb(ByVal param As Object)
|
||||
Public Overrides Sub ToolDb(ByVal param As Object)
|
||||
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
|
||||
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
|
||||
If Not EgtTdbReload() Then
|
||||
@@ -294,26 +247,7 @@ Public Class MachinePanelVM
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' ToolDbCommand
|
||||
|
||||
#Region "MachDbCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MachDbCommand As ICommand
|
||||
Get
|
||||
If m_cmdMachDb Is Nothing Then
|
||||
m_cmdMachDb = New Command(AddressOf MachDb)
|
||||
End If
|
||||
Return m_cmdMachDb
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MachDb(ByVal param As Object)
|
||||
Public Overrides Sub MachDb(ByVal param As Object)
|
||||
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
|
||||
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
|
||||
If Not EgtMdbReload() Then
|
||||
@@ -334,26 +268,7 @@ Public Class MachinePanelVM
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' MachDbCommand
|
||||
|
||||
#Region "SetUpCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property SetUpCommand As ICommand
|
||||
Get
|
||||
If m_cmdSetUp Is Nothing Then
|
||||
m_cmdSetUp = New Command(AddressOf SetUp)
|
||||
End If
|
||||
Return m_cmdSetUp
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub SetUp(ByVal param As Object)
|
||||
Public Overrides Sub SetUp(ByVal param As Object)
|
||||
' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
|
||||
If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then
|
||||
EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
|
||||
@@ -392,30 +307,9 @@ Public Class MachinePanelVM
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' SetUpCommand
|
||||
#End Region
|
||||
|
||||
#Region "MachOptionsCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MachOptionsCommand As ICommand
|
||||
Get
|
||||
If m_cmdMachOptions Is Nothing Then
|
||||
m_cmdMachOptions = New Command(AddressOf MachOptions)
|
||||
End If
|
||||
Return m_cmdMachOptions
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MachOptions(ByVal param As Object)
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' MachOptionsCommand
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "BeamTable"
|
||||
|
||||
@@ -447,7 +341,7 @@ Public Class MachinePanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' BeamTable
|
||||
#End Region ' WallTable
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
@@ -158,6 +158,13 @@ Public Class MainMenuVM
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) OrElse Map.refProjManagerVM.CurrProj.bReloadProject Then
|
||||
Map.refProjManagerVM.OpenProject(Map.refProjManagerVM.CurrProj)
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True)
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
|
||||
Else
|
||||
' verifico se il prod di provenienza ha piu' proj
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
||||
@@ -215,7 +222,15 @@ Public Class MainMenuVM
|
||||
If File.Exists(Map.refProdManagerVM.CurrProd.sProdPath) Then
|
||||
' apro progetto
|
||||
If Map.refProdManagerVM.CurrProd.bReloadProject Then
|
||||
Map.refSceneHostVM.MainController.OpenProject(Map.refProdManagerVM.CurrProd.sProdPath, False)
|
||||
If Map.refSceneHostVM.MainController.OpenProject(Map.refProdManagerVM.CurrProd.sProdPath, False) Then
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True)
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
End If
|
||||
Else
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll( False)
|
||||
@@ -242,6 +257,7 @@ Public Class MainMenuVM
|
||||
End If
|
||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||
Map.refInstrumentPanelVM.NotifyPropertyChanged(NameOf(Map.refInstrumentPanelVM.ChangeParam_Visibility))
|
||||
Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.MovePart_Visibility))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
@@ -180,6 +180,8 @@ Public Class MainWindowM
|
||||
IniFile.m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
|
||||
' Impostazione path BTL Ini File
|
||||
BTLIniFile.m_sBTLIniFile = m_sConfigDir & "\" & BTLFEATURES_FILE_NAME
|
||||
' Impostazione path Ini file DataGrid
|
||||
DataGridColumnsIniFile.m_sDataGridColumnsIniFile = m_sConfigDir & "\" & DATAGRIDCOLUMNS_FILE_NAME
|
||||
' Impostazione path resources dir
|
||||
m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
|
||||
' Impostazione direttorio per le macchine
|
||||
@@ -198,6 +200,8 @@ Public Class MainWindowM
|
||||
m_sWallRoot = m_sDataRoot & "\" & WALL_DIR
|
||||
End If
|
||||
m_sWarehouseRoot = m_sDataRoot & "\" & WAREHOUSE_DIR
|
||||
' imposto cartelle dei progetti
|
||||
Core.ProjectFileVM.Init(sProjsDir, sProdsDir)
|
||||
' Verifico indice di istanza
|
||||
ManageInstance()
|
||||
' Imposto tipo di chiave
|
||||
|
||||
@@ -61,10 +61,7 @@
|
||||
SelectedItem="{Binding SelProject}"
|
||||
CanUserAddRows="False"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserSortColumns="True"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="True"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
@@ -73,9 +70,7 @@
|
||||
BindingColumns="{Binding ProjectColumns}">
|
||||
<DataGrid.Resources>
|
||||
<!-- ProjId -->
|
||||
<DataGridTextColumn x:Key="colPROJID" Binding="{Binding sProjId}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colPROJID" Binding="{Binding sProjId}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
@@ -83,9 +78,7 @@
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- ProdId -->
|
||||
<DataGridTextColumn x:Key="colPRODID" Binding="{Binding sProdId}"
|
||||
Width="1*"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colPRODID" Binding="{Binding sProdId}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
@@ -93,9 +86,7 @@
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- BTL FileName -->
|
||||
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}"
|
||||
Width="1*"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
@@ -103,9 +94,7 @@
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- ListName -->
|
||||
<DataGridTextColumn x:Key="colLISTNAME" Binding="{Binding sListName}"
|
||||
Width="1*"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colLISTNAME" Binding="{Binding sListName}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.ListName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
@@ -113,9 +102,7 @@
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- Exported date -->
|
||||
<DataGridTextColumn x:Key="colEXPDATE" Binding="{Binding dtExportDate}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colEXPDATE" Binding="{Binding dtExportDate}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.ExportDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
@@ -123,17 +110,13 @@
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- Creation date -->
|
||||
<DataGridTextColumn x:Key="colCRTDATE" Binding="{Binding dtCreateDate}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colCRTDATE" Binding="{Binding dtCreateDate}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.CreateDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!-- Name (per Prod) -->
|
||||
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
|
||||
@@ -10,20 +10,18 @@ Public Class OpenProjectFileDialogVM
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_ProjectColumns As New ObservableCollection(Of String)
|
||||
Public Property ProjectColumns As ObservableCollection(Of String)
|
||||
Private m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property ProjectColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return m_ProjectColumns
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
m_ProjectColumns = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProjectType As ProjectType
|
||||
|
||||
Private m_FileNameTxBl As TextBlock
|
||||
|
||||
Private m_sFilter As String
|
||||
Public Property Filter As String
|
||||
Get
|
||||
@@ -270,11 +268,8 @@ Public Class OpenProjectFileDialogVM
|
||||
|
||||
Private Sub LoadColumns(ProjectType As ProjectType)
|
||||
If ProjectType = ProjectType.PROJ Then
|
||||
ProjectColumns.Add("colPROJID")
|
||||
ProjectColumns.Add("colBTLNAME")
|
||||
ProjectColumns.Add("colLISTNAME")
|
||||
ProjectColumns.Add("colEXPDATE")
|
||||
ProjectColumns.Add("colCRTDATE")
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, ProjectColumns)
|
||||
' carico campi su cui eseguire il filtro di ricerca
|
||||
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
||||
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
||||
@@ -283,9 +278,8 @@ Public Class OpenProjectFileDialogVM
|
||||
New IdNameStruct(OpenProjFileColumn.EXPORTDATE, ExportDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg)})
|
||||
ElseIf ProjectType = ProjectType.PROD Then
|
||||
ProjectColumns.Add("colPRODID")
|
||||
ProjectColumns.Add("colBTLNAME")
|
||||
ProjectColumns.Add("colCRTDATE")
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
|
||||
' carico campi su cui eseguire il filtro di ricerca
|
||||
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
||||
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
||||
|
||||
@@ -1,278 +0,0 @@
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ProjectFile
|
||||
|
||||
Private m_nProjectType As ProjectType
|
||||
Public ReadOnly Property nProjectType As ProjectType
|
||||
Get
|
||||
Return m_nProjectType
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetProjectType(nProjectType As ProjectType)
|
||||
m_nProjectType = nProjectType
|
||||
End Sub
|
||||
|
||||
Private m_nProjId As Integer = 0
|
||||
Public ReadOnly Property nProjId As Integer
|
||||
Get
|
||||
Return m_nProjId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property sProjDirPath As String
|
||||
Get
|
||||
If IsNothing(m_nProjId) OrElse m_nProjId = 0 Then Return String.Empty
|
||||
Return refMainWindowVM.MainWindowM.sProjsDir & "\" & nProjId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
Friend ReadOnly Property sProjPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(m_nProjId) OrElse m_nProjId = 0 Then Return String.Empty
|
||||
sPath = refMainWindowVM.MainWindowM.sProjsDir & "\" & nProjId.ToString("0000") & "\" & nProjId.ToString("0000") & FILENAMESEPARATOR
|
||||
If Not IsNothing(m_nProdId) AndAlso m_nProdId > 0 Then
|
||||
sPath &= nProdId.ToString("0000")
|
||||
End If
|
||||
sPath &= FILENAMESEPARATOR & BTLFileName & ".nge"
|
||||
Return sPath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nProdId As Integer = 0
|
||||
Public ReadOnly Property nProdId As Integer
|
||||
Get
|
||||
Return m_nProdId
|
||||
End Get
|
||||
End Property
|
||||
Friend ReadOnly Property sProdDirPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(m_nProdId) OrElse m_nProdId = 0 Then Return String.Empty
|
||||
Return refMainWindowVM.MainWindowM.sProdsDir & "\" & nProdId.ToString("0000")
|
||||
End Get
|
||||
End Property
|
||||
Friend ReadOnly Property sProdPath As String
|
||||
Get
|
||||
Dim sPath As String = String.Empty
|
||||
If IsNothing(m_nProdId) OrElse m_nProdId = 0 Then Return String.Empty
|
||||
Return refMainWindowVM.MainWindowM.sProdsDir & "\" & nProdId.ToString("0000") & "\" & nProdId.ToString("0000") & ".nge"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_BTLFileName As String = String.Empty
|
||||
Public ReadOnly Property BTLFileName As String
|
||||
Get
|
||||
Return m_BTLFileName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_NewProj As Boolean
|
||||
Friend Property NewProj As Boolean
|
||||
Get
|
||||
Return m_NewProj
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_NewProj = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_NewProd As Boolean
|
||||
Friend Property NewProd As Boolean
|
||||
Get
|
||||
Return m_NewProd
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_NewProd = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' nome del file mostrato nella finestra OpenProjFileDialog
|
||||
Public ReadOnly Property OpenFileName As String
|
||||
Get
|
||||
If m_nProjectType = ProjectType.PROJ Then
|
||||
Return m_nProjId.ToString("0000") & " " & BTLFileName
|
||||
ElseIf m_nProjectType = ProjectType.PROD Then
|
||||
Return m_nProdId.ToString("0000")
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(nProjectType As ProjectType, ProjectFileName As String)
|
||||
m_nProjectType = nProjectType
|
||||
If m_nProjectType = ProjectType.PROJ Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), m_nProjId)
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), m_nProdId)
|
||||
Else
|
||||
m_nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
m_BTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
ElseIf m_nProjectType = ProjectType.PROD Then
|
||||
Integer.TryParse(ProjectFileName, m_nProdId)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub New(nProjectType As ProjectType, nProjId As Integer, nProdId As Integer, sBTLFileName As String)
|
||||
m_nProjectType = nProjectType
|
||||
If m_nProjectType = ProjectType.PROJ Then
|
||||
m_nProjId = nProjId
|
||||
m_nProdId = nProdId
|
||||
m_BTLFileName = sBTLFileName
|
||||
ElseIf m_nProjectType = ProjectType.PROD Then
|
||||
m_nProdId = nProdId
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub SetProdId(nProdId As Integer)
|
||||
' rinomino proj con riferimento a prod
|
||||
Dim OldPath As String = sProjPath
|
||||
m_nProdId = nProdId
|
||||
Dim NewPath As String = sProjPath
|
||||
File.Move(OldPath, NewPath)
|
||||
End Sub
|
||||
|
||||
Friend Sub ResetProdId()
|
||||
SetProdId(0)
|
||||
End Sub
|
||||
|
||||
' funzione che restituisce le parti di nome file
|
||||
Friend Shared Function VerifyProjectFile(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
If nProjectType = ProjectType.PROJ Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
Return True
|
||||
Else Return False
|
||||
End If
|
||||
ElseIf nProjectType = ProjectType.PROD Then
|
||||
Return Integer.TryParse(ProjectFileName, nProdId)
|
||||
Else Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
' funzione che dato un nome file e il tipo restituisce il corretto numero di progetto
|
||||
Friend Shared Function GetProjectNumber(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
If String.IsNullOrWhiteSpace(ProjectFileName) Then
|
||||
nProjId = 0
|
||||
nProdId = 0
|
||||
sBTLFileName = ""
|
||||
Return False
|
||||
ElseIf ProjectFileName.Contains(FILENAMESEPARATOR) Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
Return True
|
||||
Else Return False
|
||||
End If
|
||||
ElseIf nProjectType = ProjectType.PROJ Then
|
||||
Dim ProjectFileNameProd As String = Integer.TryParse(ProjectFileName, nProdId)
|
||||
Dim nTempProjId As Integer = 0
|
||||
Dim nTempProdId As Integer = 0
|
||||
Dim sTempBTLFileName As String = ""
|
||||
' ricavo lista cartelle proj
|
||||
Dim AllDirsInDir As IEnumerable(Of String) = IO.Directory.EnumerateDirectories(Map.refMainWindowVM.MainWindowM.sProjsDir)
|
||||
For Each Directory In AllDirsInDir
|
||||
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Directory)
|
||||
For Each File In AllFilesInDir
|
||||
If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||
If File.Contains(FILENAMESEPARATOR) Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nTempProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nTempProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sTempBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
If ProjectFileNameProd = nTempProdId Then
|
||||
nProjId = nTempProjId
|
||||
nProdId = nTempProdId
|
||||
sTempBTLFileName = sBTLFileName
|
||||
Return True
|
||||
End If
|
||||
Else Return False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Shared Function VerifyProjectModification(CurrProject As ProjectFile, Type As ProjectType) As Boolean
|
||||
If IsNothing(CurrProject) Then Return False
|
||||
Dim bNewProject As Boolean = False
|
||||
Dim sProjectDirPath As String = ""
|
||||
If Type = ProjectType.PROJ Then
|
||||
bNewProject = CurrProject.NewProj
|
||||
sProjectDirPath = CurrProject.sProjDirPath
|
||||
Else
|
||||
bNewProject = CurrProject.NewProd
|
||||
sProjectDirPath = CurrProject.sProdDirPath
|
||||
End If
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If (EgtGetModified() Or bNewProject) Then
|
||||
If MessageBox.Show("Salvare le modifiche apportate al progetto?", "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
|
||||
' salvo proj
|
||||
If Type = ProjectType.PROJ Then
|
||||
Map.refProjManagerVM.Save()
|
||||
Else
|
||||
Map.refProdManagerVM.Save()
|
||||
End If
|
||||
Return True
|
||||
Else
|
||||
' se da non salvare e nuovo proj
|
||||
If bNewProject Then
|
||||
' lo elimino
|
||||
Directory.Delete(sProjectDirPath, True)
|
||||
If Type = ProjectType.PROD AndAlso CurrProject.m_nProdId = Map.refProjManagerVM.CurrProj.m_nProdId Then
|
||||
' reset prod in path proj
|
||||
Map.refProjManagerVM.CurrProj.ResetProdId()
|
||||
End If
|
||||
CurrProject = Nothing
|
||||
End If
|
||||
EgtResetModified()
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -6,17 +6,20 @@
|
||||
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||
|
||||
<Button Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding ShowAll_Command}">
|
||||
Command="{Binding ShowAll_Command}"
|
||||
ToolTip="{Binding ShowAll_ToolTip}">
|
||||
<Image Source="/Resources/ShowBeamPanel/ShowAll.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<ToggleButton Style="{StaticResource ToolBar_ToggleButton}"
|
||||
IsChecked="{Binding ShowSolid_IsChecked}"
|
||||
IsEnabled="{Binding ShowSolid_IsEnabled}">
|
||||
IsEnabled="{Binding ShowSolid_IsEnabled}"
|
||||
ToolTip="{Binding ShowSolid_ToolTip}">
|
||||
<Image Source="/Resources/ShowBeamPanel/ShowSolid.png" Stretch="Uniform"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Style="{StaticResource ToolBar_ToggleButton}"
|
||||
IsChecked="{Binding ShowBuilding_IsChecked}"
|
||||
IsEnabled="{Binding ShowBuilding_IsEnabled}">
|
||||
IsEnabled="{Binding ShowBuilding_IsEnabled}"
|
||||
ToolTip="{Binding ShowBuilding_ToolTip}">
|
||||
<Image Source="/Resources/ShowBeamPanel/ShowBuilding.png" Stretch="Uniform"/>
|
||||
</ToggleButton>
|
||||
|
||||
|
||||
@@ -7,27 +7,21 @@ Public Class ShowBeamPanelVM
|
||||
|
||||
#Region "ToolTip"
|
||||
|
||||
Public ReadOnly Property RenderingWFToolTip As String
|
||||
Public ReadOnly Property ShowAll_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(MSG_GRIDVIEWPANEL + 1)
|
||||
Return EgtMsg(61925)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RenderingHLToolTip As String
|
||||
Public ReadOnly Property ShowSolid_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(MSG_GRIDVIEWPANEL + 2)
|
||||
Return EgtMsg(61926)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RenderingSHToolTip As String
|
||||
Public ReadOnly Property ShowBuilding_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(MSG_GRIDVIEWPANEL + 3)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CurveDirToolTip As String
|
||||
Get
|
||||
Return EgtMsg(MSG_GRIDVIEWPANEL + 16)
|
||||
Return EgtMsg(61927)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
@@ -38,6 +38,11 @@
|
||||
ToolTip="{Binding ProduceAllRawPart_ToolTip}"
|
||||
IsEnabled="{Binding TopPanel_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_SmallButton}"/>
|
||||
<Button Content="R"
|
||||
Command="{Binding ResetCALCRawPart_Command}"
|
||||
ToolTip="{Binding ResetCALCRawPart_ToolTip}"
|
||||
IsEnabled="{Binding TopPanel_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_SmallButton}"/>
|
||||
<Button Content="C"
|
||||
Command="{Binding CopyRawPart_Command}"
|
||||
ToolTip="{Binding CopyRawPart_ToolTip}"
|
||||
|
||||
@@ -38,6 +38,7 @@ Public Class TopPanelVM
|
||||
' Definizione comandi
|
||||
Private m_cmdProduceAllRawPart As ICommand
|
||||
Private m_cmdProduceRawPart As ICommand
|
||||
Private m_cmdResetCALCRawPart As ICommand
|
||||
Private m_cmdCopyRawPart As ICommand
|
||||
Private m_cmdRemoveRawPart As ICommand
|
||||
Private m_cmdRemovePart As ICommand
|
||||
@@ -47,8 +48,8 @@ Public Class TopPanelVM
|
||||
|
||||
Public ReadOnly Property MovePart_Visibility As Visibility
|
||||
Get
|
||||
If Not IsNothing(Map.refMachinePanelVM.SelectedMachine) Then
|
||||
Return If(Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM, Visibility.Visible, Visibility.Collapsed)
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Return If(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM, Visibility.Visible, Visibility.Collapsed)
|
||||
End If
|
||||
Return Visibility.Collapsed
|
||||
End Get
|
||||
@@ -62,6 +63,12 @@ Public Class TopPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ResetCALCRawPart_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61924)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProduceAllRawPart_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61913)
|
||||
@@ -183,6 +190,34 @@ Public Class TopPanelVM
|
||||
|
||||
#End Region ' ProduceAllRawPart
|
||||
|
||||
#Region "ResetCALCRawPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ResetCALCRawPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdResetCALCRawPart Is Nothing Then
|
||||
m_cmdResetCALCRawPart = New Command(AddressOf ResetCALCRawPart)
|
||||
End If
|
||||
Return m_cmdResetCALCRawPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ResetCALCRawPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If IsNothing(SelMachGroup) Then Return
|
||||
If SelMachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
|
||||
SelMachGroup.ResetCalcMachGroup()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ResetCALCRawPart
|
||||
|
||||
#Region "CopyRawPart"
|
||||
|
||||
''' <summary>
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Friend Module DataGridColumnsIniFile
|
||||
|
||||
Public m_sDataGridColumnsIniFile As String
|
||||
|
||||
Public Function GetPrivateProfileColumns(ParentDGName As String, ByRef ocColumns As ObservableCollection(Of EgtDataGridColumn)) As Boolean
|
||||
Dim colIndex As Integer = 0
|
||||
Dim str = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(ParentDGName, colIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0
|
||||
Dim sColumnParams() As String = str.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sColumnParams.Count >= 7 Then
|
||||
' cancello spazi
|
||||
For index = 0 To sColumnParams.Count - 1
|
||||
sColumnParams(index) = sColumnParams(index).Trim()
|
||||
Next
|
||||
' creo colonna
|
||||
Dim sName = sColumnParams(0)
|
||||
Dim bReorder As Boolean = sColumnParams(1).Equals("1")
|
||||
Dim bResize As Boolean = sColumnParams(2).Equals("1")
|
||||
Dim bSort As Boolean = sColumnParams(3).Equals("1")
|
||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||
Dim Width As Double
|
||||
Dim WidthType As DataGridLengthUnitType
|
||||
StringToDouble(sColumnParams(5), Width)
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType)))
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
Return ocColumns.Count > 0
|
||||
End Function
|
||||
|
||||
Public Function WriteColumnPrivateProfileParam(ParentDataGridName As String, DisplayIndex As String, sColumnParams As String) As Boolean
|
||||
Return WritePrivateProfileString(ParentDataGridName, DisplayIndex, sColumnParams, m_sDataGridColumnsIniFile)
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -1,6 +1,13 @@
|
||||
<DataGrid x:Class="EgtDataGrid"
|
||||
x:Name="CurrDataGrid"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"/>
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<EventSetter Event="SizeChanged" Handler="Cell_SizedChanged" />
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class EgtDataGrid
|
||||
|
||||
@@ -7,20 +9,20 @@ Public Class EgtDataGrid
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
|
||||
Public Shadows Property BindingColumns As ObservableCollection(Of String)
|
||||
Public Shadows Property BindingColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return CType(MyBase.GetValue(BindingColumnsProperty), ObservableCollection(Of String))
|
||||
Return CType(MyBase.GetValue(BindingColumnsProperty), ObservableCollection(Of EgtDataGridColumn))
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
MyBase.SetValue(BindingColumnsProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly BindingColumnsProperty As DependencyProperty = DependencyProperty.Register("BindingColumns", GetType(ObservableCollection(Of String)), GetType(EgtDataGrid), New FrameworkPropertyMetadata(New ObservableCollection(Of String), New PropertyChangedCallback(AddressOf OnDataGridColumnsPropertyChanged)) With {.BindsTwoWayByDefault = True})
|
||||
Public Shared ReadOnly BindingColumnsProperty As DependencyProperty = DependencyProperty.Register("BindingColumns", GetType(ObservableCollection(Of EgtDataGridColumn)), GetType(EgtDataGrid), New FrameworkPropertyMetadata(New ObservableCollection(Of EgtDataGridColumn), New PropertyChangedCallback(AddressOf OnDataGridColumnsPropertyChanged)) With {.BindsTwoWayByDefault = True})
|
||||
|
||||
Private Shared Sub OnDataGridColumnsPropertyChanged(ByVal source As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
|
||||
Dim context = TryCast(source, EgtDataGrid)
|
||||
Dim oldItems = TryCast(e.OldValue, ObservableCollection(Of String))
|
||||
Dim oldItems = TryCast(e.OldValue, ObservableCollection(Of EgtDataGridColumn))
|
||||
|
||||
If oldItems IsNot Nothing Then
|
||||
|
||||
@@ -32,12 +34,13 @@ Public Class EgtDataGrid
|
||||
RemoveHandler oldItems.CollectionChanged, AddressOf context.collectionChanged
|
||||
End If
|
||||
|
||||
Dim newItems = TryCast(e.NewValue, ObservableCollection(Of String))
|
||||
Dim newItems = TryCast(e.NewValue, ObservableCollection(Of EgtDataGridColumn))
|
||||
|
||||
If newItems IsNot Nothing Then
|
||||
|
||||
For Index = 0 To newItems.Count - 1
|
||||
Dim col As DataGridColumn = context.FindResource(newItems(Index))
|
||||
Dim col As DataGridColumn = context.FindResource(newItems(Index).Name)
|
||||
newItems(Index).InitColumn(col)
|
||||
context.Columns.Add(col)
|
||||
Next
|
||||
|
||||
@@ -51,8 +54,9 @@ Public Class EgtDataGrid
|
||||
|
||||
If e.NewItems IsNot Nothing Then
|
||||
|
||||
For Each one As String In e.NewItems
|
||||
Dim col As DataGridColumn = CurrDataGrid.FindResource(one)
|
||||
For Each one As EgtDataGridColumn In e.NewItems
|
||||
Dim col As DataGridColumn = CurrDataGrid.FindResource(one.Name)
|
||||
one.InitColumn(col)
|
||||
CurrDataGrid.Columns.Insert(e.NewStartingIndex, col)
|
||||
If col.DisplayIndex <> e.NewStartingIndex Then
|
||||
CurrDataGrid.Columns(e.NewStartingIndex).DisplayIndex = e.NewStartingIndex
|
||||
@@ -64,8 +68,8 @@ Public Class EgtDataGrid
|
||||
|
||||
If e.OldItems IsNot Nothing Then
|
||||
|
||||
For Each one As String In e.OldItems
|
||||
Dim col As DataGridColumn = CurrDataGrid.FindResource(one)
|
||||
For Each one As EgtDataGridColumn In e.OldItems
|
||||
Dim col As DataGridColumn = CurrDataGrid.FindResource(one.Name)
|
||||
CurrDataGrid.Columns.Remove(col)
|
||||
Next
|
||||
End If
|
||||
@@ -91,4 +95,179 @@ Public Class EgtDataGrid
|
||||
CurrDataGrid.Columns(e.NewStartingIndex) = col
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub Cell_SizedChanged(sender As Object, e As SizeChangedEventArgs)
|
||||
' ad ogni ridimensionamento della cella del ColumnHeader salvo le nuove dimensioni nell'ini
|
||||
If Not IsNothing(e.OriginalSource.Column) AndAlso Not IsNothing(BindingColumns(e.OriginalSource.Column.DisplayIndex)) Then
|
||||
BindingColumns(e.OriginalSource.Column.DisplayIndex).SaveDataGridColumn()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public OldIndex As Integer = 0
|
||||
|
||||
Private Sub CurrDataGrid_ColumnReordering(sender As Object, e As DataGridColumnEventArgs) Handles CurrDataGrid.ColumnReordering
|
||||
' conservo il vecchio indice in modo da effettuare lo scambio in BindingColumns una volta riordinate graficamente
|
||||
OldIndex = e.Column.DisplayIndex
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_ColumnReordered(sender As Object, e As DataGridColumnEventArgs) Handles CurrDataGrid.ColumnReordered
|
||||
' scambio le colonne in BindingColumns
|
||||
BindingColumns.Move(OldIndex, e.Column.DisplayIndex)
|
||||
' scrivo tutte le colonne interessate dallo spostamento
|
||||
' (se OldIndex > e.Column.DisplayIndex, il ciclo non viene eseguito quindi lo faccio nell'altro senso)
|
||||
For index = OldIndex To e.Column.DisplayIndex
|
||||
BindingColumns(index).SaveDataGridColumn()
|
||||
Next
|
||||
For index = e.Column.DisplayIndex To OldIndex
|
||||
BindingColumns(index).SaveDataGridColumn()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtDataGridColumn
|
||||
|
||||
Private m_dgColumn As DataGridColumn
|
||||
|
||||
Private Property m_ParentDataGridName As String
|
||||
Public Property ParentDataGridName As String
|
||||
Get
|
||||
Return m_ParentDataGridName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ParentDataGridName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_Width As DataGridLength
|
||||
Public Property Width As DataGridLength
|
||||
Get
|
||||
Return m_dgColumn.Width
|
||||
End Get
|
||||
Set(value As DataGridLength)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.Width = value
|
||||
Else
|
||||
m_Width = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_DisplayIndex As Integer
|
||||
Public Property DisplayIndex As Integer
|
||||
Get
|
||||
Return m_dgColumn.DisplayIndex
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.DisplayIndex = value
|
||||
Else
|
||||
m_DisplayIndex = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_dgColumn.IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.IsReadOnly = value
|
||||
Else
|
||||
m_IsReadOnly = value
|
||||
End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserReorder As Boolean
|
||||
Public Property CanUserReorder As Boolean
|
||||
Get
|
||||
Return m_dgColumn.CanUserReorder
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.CanUserReorder = value
|
||||
Else
|
||||
m_CanUserReorder = value
|
||||
End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserResize As Boolean
|
||||
Public Property CanUserResize As Boolean
|
||||
Get
|
||||
Return m_dgColumn.CanUserResize
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.CanUserResize = value
|
||||
Else
|
||||
m_CanUserResize = value
|
||||
End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserSort As Boolean
|
||||
Public Property CanUserSort As Boolean
|
||||
Get
|
||||
Return m_dgColumn.CanUserSort
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.CanUserSort = value
|
||||
Else
|
||||
m_CanUserSort = value
|
||||
End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sName As String)
|
||||
m_Name = sName
|
||||
End Sub
|
||||
|
||||
Sub New(sParentDG As String, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength)
|
||||
m_ParentDataGridName = sParentDG
|
||||
m_Name = sName
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
m_CanUserResize = bCanUserResize
|
||||
m_CanUserSort = bCanUserSort
|
||||
m_IsReadOnly = bIsReadOnly
|
||||
m_Width = Width
|
||||
End Sub
|
||||
|
||||
Friend Sub InitColumn(dgColumn As DataGridColumn)
|
||||
m_dgColumn = dgColumn
|
||||
m_dgColumn.CanUserReorder = m_CanUserReorder
|
||||
m_dgColumn.CanUserResize = m_CanUserResize
|
||||
m_dgColumn.CanUserSort = m_CanUserSort
|
||||
m_dgColumn.IsReadOnly = m_IsReadOnly
|
||||
'm_dgColumn.DisplayIndex = m_DisplayIndex
|
||||
m_dgColumn.Width = m_Width
|
||||
End Sub
|
||||
|
||||
' funzione per calcolare e scrivere la stringa dei parametri della colonna nell'INI
|
||||
Public Function SaveDataGridColumn() As Boolean
|
||||
Dim bOk As Boolean
|
||||
Dim sColumnParams = String.Empty
|
||||
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType
|
||||
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Module Map
|
||||
|
||||
@@ -8,8 +9,8 @@ Module Map
|
||||
Private m_refProdManagerVM As ProdManagerVM
|
||||
Private m_refProjectVM As ProjectVM
|
||||
Private m_refMainMenuVM As MainMenuVM
|
||||
Private m_refMachinePanelVM As MachinePanelVM
|
||||
Private m_refMyMachGroupPanelVM As MyMachGroupPanelVM
|
||||
'Private m_refMachinePanelVM As MachinePanelVM
|
||||
'Private m_refMyMachGroupPanelVM As MyMachGroupPanelVM
|
||||
Private m_refLeftPanelVM As LeftPanelVM
|
||||
Private m_refBottomPanelVM As BottomPanelVM
|
||||
Private m_refShowBeamPanelVM As ShowBeamPanelVM
|
||||
@@ -83,7 +84,7 @@ Module Map
|
||||
|
||||
Public ReadOnly Property refMachinePanelVM As MachinePanelVM
|
||||
Get
|
||||
Return m_refMachinePanelVM
|
||||
Return CoreMap.refMachinePanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -95,7 +96,7 @@ Module Map
|
||||
|
||||
Public ReadOnly Property refMachGroupPanelVM As MyMachGroupPanelVM
|
||||
Get
|
||||
Return m_refMyMachGroupPanelVM
|
||||
Return CoreMap.refMachGroupPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -265,8 +266,8 @@ Module Map
|
||||
End Function
|
||||
|
||||
Friend Function SetRefMachinePanelVM(MachinePanelVM As MachinePanelVM) As Boolean
|
||||
m_refMachinePanelVM = MachinePanelVM
|
||||
Return Not IsNothing(m_refMachinePanelVM)
|
||||
CoreMap.SetRefMachinePanelVM(MachinePanelVM)
|
||||
Return Not IsNothing(CoreMap.refMachinePanelVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefLeftPanelVM(LeftPanelVM As LeftPanelVM) As Boolean
|
||||
@@ -275,8 +276,8 @@ Module Map
|
||||
End Function
|
||||
|
||||
Friend Function SetRefMachGroupPanelVM(MachGroupPanelVM As MyMachGroupPanelVM) As Boolean
|
||||
m_refMyMachGroupPanelVM = MachGroupPanelVM
|
||||
Return Not IsNothing(m_refMyMachGroupPanelVM)
|
||||
CoreMap.SetRefMachGroupPanelVM(MachGroupPanelVM)
|
||||
Return Not IsNothing(CoreMap.refMachGroupPanelVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefBottomPanelVM(BottomPanelVM As BottomPanelVM) As Boolean
|
||||
@@ -406,7 +407,7 @@ Module Map
|
||||
Not IsNothing(LibMap.refStatusBarVM) AndAlso Not IsNothing(m_refProjManagerVM) AndAlso
|
||||
Not IsNothing(m_refProdManagerVM) AndAlso Not IsNothing(m_refConfigurationPageVM) AndAlso
|
||||
Not IsNothing(LibMap.refSceneHostVM) AndAlso Not IsNothing(LibMap.refShowPanelVM) AndAlso
|
||||
Not IsNothing(m_refMachinePanelVM) AndAlso Not IsNothing(LibMap.refMachGroupPanelVM) AndAlso
|
||||
Not IsNothing(CoreMap.refMachinePanelVM) AndAlso Not IsNothing(LibMap.refMachGroupPanelVM) AndAlso
|
||||
Not IsNothing(m_refRawPartListVM) AndAlso Not IsNothing(m_refWarehouseWndVM) AndAlso
|
||||
Not IsNothing(m_refFeatureListVM) AndAlso Not IsNothing(m_refPartInRawPartListVM) AndAlso
|
||||
Not IsNothing(m_refFreeContourManagerVM) AndAlso Not IsNothing(m_refFreeContourInputVM) AndAlso
|
||||
|
||||
Reference in New Issue
Block a user