Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d98eb0e9da | |||
| f4e97d4bae | |||
| cefff881f5 | |||
| 923f1ab7ff | |||
| f1b2e66b97 | |||
| b5daa71abf | |||
| ee558cecd6 | |||
| c87210873f | |||
| 0535036d36 | |||
| 77333dfc9e | |||
| a6b9fcd2ba | |||
| 568e98aec8 | |||
| 4548e468a1 | |||
| a73af5928f | |||
| 5385547af6 | |||
| 46f2db3415 | |||
| 2aa61e5141 | |||
| 007c9c0edc | |||
| ba807e89bc | |||
| 53ca42389e | |||
| 35cc8959da | |||
| 467284d008 | |||
| 51a2cbf17c | |||
| 8e8d1c2a91 | |||
| 7a2c45fc4b | |||
| 19b1b8d984 | |||
| 1767aa7f97 | |||
| 652ce25a83 | |||
| 6c2d3bb7b5 | |||
| 4257a92486 | |||
| ac621d9dc0 | |||
| 6f56ae6686 | |||
| e19032f3cb | |||
| 92b770f448 | |||
| 27d8eb37e8 | |||
| dfb3774943 | |||
| a9b003d9ec | |||
| 8c9f2ce613 | |||
| b833d6c4ec | |||
| 21a91b5202 | |||
| c1fba27b1f | |||
| 7225bad678 | |||
| f95ce8d671 | |||
| 54ed7dc11c | |||
| 69beb83764 | |||
| faa8aada54 | |||
| 4dcd4a1fa0 |
@@ -397,10 +397,14 @@ Public Class BTLFeatureM
|
||||
If Param.bIsP Then
|
||||
Param.SetValue(dParamValue)
|
||||
Else
|
||||
' se è un parametro Q verifico nel progetto se sia un valore custom
|
||||
' recupero info Custom
|
||||
Dim nCustom As Integer = 0
|
||||
EgtGetInfo(nFeatureId, Param.sName & "A", nCustom)
|
||||
If nCustom = 1 Then
|
||||
'se pezzo parent di tipo Part
|
||||
If TypeOf m_ParentPart Is PartM Then
|
||||
Param.SetValue(dParamValue)
|
||||
' se è un parametro Q verifico nel progetto se sia un valore custom
|
||||
ElseIf nCustom = 1 Then
|
||||
Param.SetValue(dParamValue)
|
||||
Param.bCustom = True
|
||||
' altrimenti lo setto al valore di default
|
||||
|
||||
@@ -703,6 +703,16 @@ Public Class BTLPartM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nFeaturesGlobalState As CalcStates
|
||||
Public Property nFeaturesGlobalState As CalcStates
|
||||
Get
|
||||
Return m_nFeaturesGlobalState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nFeaturesGlobalState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_GlobalERR As Integer
|
||||
Public Property nCALC_GlobalERR As Integer
|
||||
Get
|
||||
|
||||
@@ -11,6 +11,13 @@ Public Class BTLStructureM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nAsseBaseId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nAsseBaseId As Integer
|
||||
Get
|
||||
Return m_nAsseBaseId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' pezzi da BTL
|
||||
Public m_BTLPartMList As List(Of BTLPartM)
|
||||
Public Property BTLPartMList As List(Of BTLPartM)
|
||||
@@ -384,7 +391,20 @@ Public Class BTLStructureM
|
||||
End If
|
||||
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
|
||||
End While
|
||||
' cerco tra gli AsseBase
|
||||
Dim nAsseBaseLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
While nAsseBaseLayerId <> GDB_ID.NULL
|
||||
' verifico se il layer appartiene al ProjId
|
||||
Dim nAsseBaseLayerProjId As Integer
|
||||
EgtGetInfo(nAsseBaseLayerId, BTL_PRT_PROJ, nAsseBaseLayerProjId)
|
||||
If nAsseBaseLayerProjId = ProjId Then
|
||||
NewBTLStructure.m_nAsseBaseId = nAsseBaseLayerId
|
||||
Exit While
|
||||
End If
|
||||
nAsseBaseLayerId = EgtGetNextName(nAsseBaseLayerId, ASSEBASE)
|
||||
End While
|
||||
Else
|
||||
NewBTLStructure.m_nAsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
NewBTLStructure.m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
End If
|
||||
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNUM, NewBTLStructure.m_sPROJNUM)
|
||||
|
||||
@@ -162,7 +162,8 @@ Public Module CalcIntegration
|
||||
If vBar(nCurrBar).nCmdType = CmdTypes.CHECK OrElse vBar(nCurrBar).nCmdType = CmdTypes.CHECKGEN Then
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
ElseIf vBar(nCurrBar).nCmdType = CmdTypes.GENERATE Then
|
||||
RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
End If
|
||||
bDone = True
|
||||
nCurrBar += 1
|
||||
@@ -177,7 +178,8 @@ Public Module CalcIntegration
|
||||
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN Then
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
|
||||
ElseIf vBar(vProc(j).nBar).nCmdType = CmdTypes.GENERATE Then
|
||||
RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
|
||||
'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
End If
|
||||
bDone = True
|
||||
vProc(j).nBar = -1
|
||||
@@ -199,7 +201,8 @@ Public Module CalcIntegration
|
||||
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN Then
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
|
||||
ElseIf vBar(vProc(j).nBar).nCmdType = CmdTypes.GENERATE Then
|
||||
RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
|
||||
'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
End If
|
||||
bDone = True
|
||||
vProc(j).nBar = -1
|
||||
@@ -260,6 +263,7 @@ Public Module CalcIntegration
|
||||
Result = CalcEndEventArgs.Results.OK
|
||||
End If
|
||||
RaiseEvent Calc_Ended(Nothing, New CalcEndEventArgs(CmdTypes.EDIT, Result))
|
||||
Return
|
||||
Else
|
||||
' Dialog con Progress Bar
|
||||
nDoneBar += 1
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
Public Const COL_VALUE As String = "colVALUE"
|
||||
Public Const COL_CUSTOM As String = "colCUSTOM"
|
||||
Public Const COL_STARTCUT As String = "colSTARTCUT"
|
||||
Public Const COL_W As String = "colW"
|
||||
Public Const COL_L As String = "colL"
|
||||
Public Const COL_ROT As String = "colROT"
|
||||
Public Const COL_FLIP As String = "colFLIP"
|
||||
Public Const COL_POSX As String = "colPOSX"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
Public Const S_PARTINRAWPARTLIST_WALL As String = "DG_PartInRawPartList_WALL"
|
||||
Public Const S_PARAMETERLIST_P As String = "DG_ParameterList_P"
|
||||
Public Const S_PARAMETERLIST_Q As String = "DG_ParameterList_Q"
|
||||
Public Const S_DUPLOPARAMETERLIST_Q As String = "DG_DuploParameterList_Q"
|
||||
Public Const S_RAWPARTLIST_SUPERVISOR As String = "DG_RawPartList_SUPERVISOR"
|
||||
Public Const S_PARTINRAWPARTLIST_SUPERVISOR As String = "DG_PartInRawPartList_SUPERVISOR"
|
||||
Public Const S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR As String = "DG_FeatureInPartInRawPartList_SUPERVISOR"
|
||||
@@ -27,4 +28,6 @@
|
||||
Public Const S_VARIABLESLIST As String = "DG_VariablesList"
|
||||
Public Const S_MDICOMMANDS As String = "DG_MDICommands"
|
||||
|
||||
Public Const K_LOCKTABLE As String = "LockTable"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -75,6 +75,8 @@ Public Module ConstGen
|
||||
Public Const SETUP_LUA As String = "SetUp.lua"
|
||||
' Nome eseguibile per stampa
|
||||
Public Const ZEBRAPRINTER_EXE As String = "ZebraPrinterUtilitiesD32.exe"
|
||||
' Nome eseguibile per applicativo di invio feedback
|
||||
Public Const LIMANTRANSFER_EXE As String = "LiMan.Transfer.exe"
|
||||
' Sottodirettorio di default per macro
|
||||
Public Const MACRO_DFL_DIR As String = "Macro"
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ Public Module ConstIni
|
||||
'Public Const K_USERLEVEL As String = "UserLevel"
|
||||
'Public Const K_MAXINST As String = "MaxInstances"
|
||||
Public Const K_MAXCAMINST As String = "MaxCamInstances"
|
||||
'Public Const K_INSTANCES As String = "Instances"
|
||||
Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
|
||||
Public Const K_SUPERVISOR_INSTANCES As String = "SupervisorInstances"
|
||||
'Public Const K_COMMANDLOG As String = "CommandLog"
|
||||
'Public Const K_MESSAGESDIR As String = "MessagesDir"
|
||||
'Public Const K_MESSAGES As String = "Messages"
|
||||
@@ -29,11 +30,14 @@ Public Module ConstIni
|
||||
'Public Const K_LASTPROJ As String = "LastProj"
|
||||
'Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
|
||||
Public Const K_LASTIMPDIR As String = "LastImpDir"
|
||||
Public Const K_LASTNGEXPDIR As String = "LastNgexpDir"
|
||||
Public Const K_LASTUPDATEDIR As String = "LastUpdateDir"
|
||||
Public Const K_PROJSINDEX As String = "ProjsIndex"
|
||||
Public Const K_PRODSINDEX As String = "ProdsIndex"
|
||||
'Public Const K_SUPPORT As String = "Support"
|
||||
Public Const K_WAREHOUSE As String = "Warehouse"
|
||||
Public Const K_DBADDRESS As String = "DbAddress"
|
||||
Public Const K_LIMANUTILITIES As String = "LiManUtilities"
|
||||
|
||||
'Public Const S_LANGUAGES As String = "Languages"
|
||||
'Public Const K_LANGUAGE As String = "Language"
|
||||
@@ -130,6 +134,11 @@ Public Module ConstIni
|
||||
Public Const K_ZEBRAUTILITIES As String = "ZebraUtilities"
|
||||
Public Const K_TEMPLATE As String = "Template"
|
||||
|
||||
Public Const S_CUSTOMERCONTACT As String = "CustomerContact"
|
||||
Public Const K_CONTACTEMAIL As String = "ContactEmail"
|
||||
Public Const K_CONTACTNAME As String = "ContactName"
|
||||
Public Const K_CONTACTPHONE As String = "ContactPhone"
|
||||
|
||||
Public Const S_BEAM_LIST As String = "Beam_List"
|
||||
Public Const S_WALL_LIST As String = "Wall_List"
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EgtUILib, Version=2.3.6.2, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Reference Include="EgtUILib, Version=2.3.7.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\EgtProg\Dll32\EgtUILib.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\EgtProg\Dll32\EgtUILib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtWPFLib5, Version=2.3.4.3, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Windows.Forms
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
@@ -31,7 +32,8 @@ Public Module DataGridColumnsIniFile
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible))
|
||||
Dim nSortDirection As SortOrder = If(sColumnParams.Count >= 10, CInt(sColumnParams(9)), 0)
|
||||
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible, nSortDirection))
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
@@ -67,7 +69,8 @@ Public Module DataGridColumnsIniFile
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
Column = New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible)
|
||||
Dim nSortDirection As SortOrder = If(sColumnParams.Count >= 10, CInt(sColumnParams(9)), 0)
|
||||
Column = New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible, nSortDirection)
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<EventSetter Event="SizeChanged" Handler="Cell_SizedChanged" />
|
||||
<EventSetter Event="MouseRightButtonDown" Handler="Cell_MouseRightButtonDown" />
|
||||
<EventSetter Event="FrameworkElement.Loaded" Handler="DataGridColumnHeader_Loaded"/>
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Windows.Data
|
||||
Imports System.Windows.Controls.Primitives
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
@@ -10,6 +12,23 @@ Imports EgtWPFLib5
|
||||
|
||||
Public Class EgtDataGrid
|
||||
|
||||
' vecchio indice da salvare per il Reorder delle colonne
|
||||
Public OldIndex As Integer = 0
|
||||
|
||||
' variabili e costanti per il Resize delle colonne adiacenti
|
||||
Private Const LEFT As String = "PART_LeftHeaderGripper"
|
||||
Private Const RIGHT As String = "PART_RightHeaderGripper"
|
||||
Private startPoint As Point
|
||||
Private startWidth As Double
|
||||
Private adjacentStartWidth As Double
|
||||
'Private startUnitType As DataGridLengthUnitType
|
||||
'Private adjacentUnitType As DataGridLengthUnitType
|
||||
Private targetColumn As DataGridColumn
|
||||
Private adjacentColumn As DataGridColumn
|
||||
|
||||
' indice header su cui è aperto il ContextMenu per gestione check/uncheck LockTable
|
||||
Private HeaderDispIndex As Integer = 0
|
||||
|
||||
Sub New()
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
@@ -119,7 +138,89 @@ Public Class EgtDataGrid
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public OldIndex As Integer = 0
|
||||
Private Sub Cell_MouseRightButtonDown(sender As Object, e As RoutedEventArgs)
|
||||
Dim nDispIndex As Integer = sender.DisplayIndex
|
||||
' creo il ContextMenu con gli item checkabili
|
||||
Dim cm As ContextMenu = New ContextMenu()
|
||||
Dim miReorder As MenuItem = New MenuItem()
|
||||
Dim miResize As MenuItem = New MenuItem()
|
||||
Dim miSort As MenuItem = New MenuItem()
|
||||
Dim sep1 As Separator = New Separator()
|
||||
Dim miVis As MenuItem = New MenuItem()
|
||||
Dim sep2 As Separator = New Separator()
|
||||
Dim miLock As MenuItem = New MenuItem()
|
||||
Dim miResetSort As MenuItem = New MenuItem()
|
||||
miReorder.Header = NameOf(EgtDataGridColumn.CanUserReorder)
|
||||
miResize.Header = NameOf(EgtDataGridColumn.CanUserResize)
|
||||
miSort.Header = NameOf(EgtDataGridColumn.CanUserSort)
|
||||
miVis.Header = "Columns Visibility"
|
||||
miLock.Header = "Lock Table"
|
||||
miResetSort.Header = "Reset Sort"
|
||||
miReorder.IsCheckable = True
|
||||
miResize.IsCheckable = True
|
||||
miSort.IsCheckable = True
|
||||
miLock.IsCheckable = True
|
||||
miResetSort.IsCheckable = False
|
||||
miReorder.StaysOpenOnClick = True
|
||||
miResize.StaysOpenOnClick = True
|
||||
miSort.StaysOpenOnClick = True
|
||||
miLock.StaysOpenOnClick = True
|
||||
miResetSort.StaysOpenOnClick = True
|
||||
' setto il binding
|
||||
Dim miReorderBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserReorder))
|
||||
Dim miResizeBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserResize))
|
||||
Dim miSortBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserSort))
|
||||
miReorderBinding.Mode = BindingMode.TwoWay
|
||||
miResizeBinding.Mode = BindingMode.TwoWay
|
||||
miSortBinding.Mode = BindingMode.TwoWay
|
||||
miReorder.DataContext = BindingColumns(nDispIndex)
|
||||
miResize.DataContext = BindingColumns(nDispIndex)
|
||||
miSort.DataContext = BindingColumns(nDispIndex)
|
||||
miReorder.SetBinding(MenuItem.IsCheckedProperty, miReorderBinding)
|
||||
miResize.SetBinding(MenuItem.IsCheckedProperty, miResizeBinding)
|
||||
miSort.SetBinding(MenuItem.IsCheckedProperty, miSortBinding)
|
||||
' setto check e enable associati a LockTable
|
||||
miLock.IsChecked = (GetPrivateProfileInt(BindingColumns(nDispIndex).ParentDataGridName, K_LOCKTABLE, 0, m_sDataGridColumnsIniFile) > 0)
|
||||
miReorder.IsChecked = If(miLock.IsChecked, False, BindingColumns(nDispIndex).CanUserReorder)
|
||||
miResize.IsChecked = If(miLock.IsChecked, False, BindingColumns(nDispIndex).CanUserResize)
|
||||
miReorder.IsEnabled = Not miLock.IsChecked
|
||||
miResize.IsEnabled = Not miLock.IsChecked
|
||||
HeaderDispIndex = nDispIndex
|
||||
AddHandler miLock.Checked, AddressOf miLock_Checked
|
||||
AddHandler miLock.Unchecked, AddressOf miLock_Unchecked
|
||||
AddHandler miResetSort.Click, AddressOf miResetSort_Click
|
||||
' aggiungo i MenuItem al ContextMenu
|
||||
cm.Items.Add(miReorder)
|
||||
cm.Items.Add(miResize)
|
||||
cm.Items.Add(miSort)
|
||||
cm.Items.Add(sep1)
|
||||
cm.Items.Add(miVis)
|
||||
cm.Items.Add(sep2)
|
||||
cm.Items.Add(miLock)
|
||||
cm.Items.Add(miResetSort)
|
||||
' creo e aggiungo gli item figli di Columns Visibility
|
||||
For Each Column In BindingColumns
|
||||
Dim mi As MenuItem = New MenuItem()
|
||||
mi.Header = Column.Name
|
||||
mi.IsCheckable = True
|
||||
Dim miBinding As Binding = New Binding(NameOf(EgtDataGridColumn.Visible))
|
||||
miBinding.Mode = BindingMode.TwoWay
|
||||
mi.DataContext = Column
|
||||
mi.SetBinding(MenuItem.IsCheckedProperty, miBinding)
|
||||
mi.StaysOpenOnClick = True
|
||||
mi.IsEnabled = Column.CanUserEditVisible
|
||||
miVis.Items.Add(mi)
|
||||
Next
|
||||
' disabilito Columns Visibility se tutti i suoi figli sono disabilitati
|
||||
Dim bIsEnabled As Boolean = False
|
||||
For Each visMenuItem In miVis.Items
|
||||
bIsEnabled = visMenuItem.IsEnabled
|
||||
Next
|
||||
cm.Items(4).IsEnabled = bIsEnabled
|
||||
|
||||
cm.PlacementTarget = TryCast(sender, Button)
|
||||
cm.IsOpen = True
|
||||
End Sub
|
||||
|
||||
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
|
||||
@@ -139,25 +240,15 @@ Public Class EgtDataGrid
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Const LEFT As String = "PART_LeftHeaderGripper"
|
||||
Private Const RIGHT As String = "PART_RightHeaderGripper"
|
||||
Private startPoint As Point
|
||||
Private startWidth As Double
|
||||
Private adjacentStartWidth As Double
|
||||
'Private startUnitType As DataGridLengthUnitType
|
||||
'Private adjacentUnitType As DataGridLengthUnitType
|
||||
Private targetColumn As DataGridColumn
|
||||
Private adjacentColumn As DataGridColumn
|
||||
|
||||
Private Sub DataGridColumnHeader_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
Dim header = DirectCast(sender, DataGridColumnHeader)
|
||||
|
||||
Dim thumbLeft As Thumb = header.Template.FindName(LEFT, header)
|
||||
thumbLeft.AddHandler(Thumb.DragStartedEvent, CType(AddressOf Thumb_DragStarted, DragStartedEventHandler), True) ' thumbLeft.AddHandler(Thumb.DragStartedEvent, New DragStartedEventHandler(AddressOf Thumb_DragStarted), True)
|
||||
thumbLeft.AddHandler(Thumb.DragStartedEvent, CType(AddressOf Thumb_DragStarted, DragStartedEventHandler), True)
|
||||
thumbLeft.AddHandler(Thumb.DragCompletedEvent, CType(AddressOf Thumb_DragCompleted, DragCompletedEventHandler), True)
|
||||
|
||||
Dim thumbRight As Thumb = header.Template.FindName(RIGHT, header)
|
||||
thumbRight.AddHandler(Thumb.DragStartedEvent, CType(AddressOf Thumb_DragStarted, DragStartedEventHandler), True) ' thumbRight.AddHandler(Thumb.DragStartedEvent, New DragStartedEventHandler(AddressOf Thumb_DragStarted), True)
|
||||
thumbRight.AddHandler(Thumb.DragStartedEvent, CType(AddressOf Thumb_DragStarted, DragStartedEventHandler), True)
|
||||
thumbRight.AddHandler(Thumb.DragCompletedEvent, CType(AddressOf Thumb_DragCompleted, DragCompletedEventHandler), True)
|
||||
End Sub
|
||||
|
||||
@@ -229,6 +320,76 @@ Public Class EgtDataGrid
|
||||
Return tObj
|
||||
End Function
|
||||
|
||||
Private Sub miLock_Checked(sender As Object, e As RoutedEventArgs)
|
||||
Dim miLock = DirectCast(sender, MenuItem)
|
||||
' disabilito Reorder e Resize di tutte le colonne salvandone prima il valore
|
||||
For Each Column In BindingColumns
|
||||
Column.OldCanUserReorder = Column.CanUserReorder
|
||||
Column.OldCanUserResize = Column.CanUserResize
|
||||
Column.CanUserReorder = False
|
||||
Column.CanUserResize = False
|
||||
Next
|
||||
' aggiorno il ContextMenu correntemente aperto
|
||||
Dim miReorder As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(0)
|
||||
Dim miResize As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(1)
|
||||
miReorder.IsChecked = False
|
||||
miResize.IsChecked = False
|
||||
miReorder.IsEnabled = False
|
||||
miResize.IsEnabled = False
|
||||
' scrivo il valore di LockTable nell'INI
|
||||
WritePrivateProfileString(BindingColumns(HeaderDispIndex).ParentDataGridName, K_LOCKTABLE, 1, m_sDataGridColumnsIniFile)
|
||||
End Sub
|
||||
|
||||
Private Sub miLock_Unchecked(sender As Object, e As RoutedEventArgs)
|
||||
Dim miLock = DirectCast(sender, MenuItem)
|
||||
' abilito Reorder e Resize di tutte le colonne ripristinando il valore precedente, se presente
|
||||
For Each Column In BindingColumns
|
||||
If Not IsNothing(Column.OldCanUserReorder) Then Column.CanUserReorder = Column.OldCanUserReorder
|
||||
If Not IsNothing(Column.OldCanUserResize) Then Column.CanUserResize = Column.OldCanUserResize
|
||||
Next
|
||||
' aggiorno il ContextMenu correntemente aperto
|
||||
Dim miReorder As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(0)
|
||||
Dim miResize As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(1)
|
||||
miReorder.IsChecked = If(IsNothing(BindingColumns(HeaderDispIndex).OldCanUserReorder), BindingColumns(HeaderDispIndex).CanUserReorder, BindingColumns(HeaderDispIndex).OldCanUserReorder)
|
||||
miResize.IsChecked = If(IsNothing(BindingColumns(HeaderDispIndex).OldCanUserResize), BindingColumns(HeaderDispIndex).CanUserResize, BindingColumns(HeaderDispIndex).OldCanUserResize)
|
||||
miReorder.IsEnabled = True
|
||||
miResize.IsEnabled = True
|
||||
' scrivo il valore di LockTable nell'INI
|
||||
WritePrivateProfileString(BindingColumns(HeaderDispIndex).ParentDataGridName, K_LOCKTABLE, 0, m_sDataGridColumnsIniFile)
|
||||
End Sub
|
||||
|
||||
Private Sub miResetSort_Click(sender As Object, e As RoutedEventArgs)
|
||||
CurrDataGrid.Items.SortDescriptions.Clear()
|
||||
For Each column In BindingColumns 'Grid.Columns
|
||||
column.SortDirection = 0
|
||||
' resettiamo graficamente anche l'header della colonna
|
||||
CurrDataGrid.Columns(column.DisplayIndex).SortDirection = Nothing
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_Loaded(sender As Object, e As RoutedEventArgs) Handles CurrDataGrid.Loaded
|
||||
' setto la SortDirection, se attiva, sulla colonna su cui è attiva
|
||||
Dim colIndex As Integer = 0
|
||||
For Each col In BindingColumns
|
||||
If col.SortDirection > 0 Then
|
||||
CurrDataGrid.Items.SortDescriptions.Add(New SortDescription(CurrDataGrid.Columns(colIndex).SortMemberPath, col.SortDirection - 1))
|
||||
Exit For
|
||||
End If
|
||||
colIndex += 1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_Sorting(sender As Object, e As DataGridSortingEventArgs) Handles CurrDataGrid.Sorting
|
||||
Select Case e.Column.SortDirection
|
||||
Case ListSortDirection.Ascending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 2 ' la settiamo a Descending
|
||||
Case ListSortDirection.Descending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la settiamo a Ascending
|
||||
Case Else
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la settiamo a Ascending
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtDataGridColumn
|
||||
@@ -297,6 +458,7 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend OldCanUserReorder As Boolean?
|
||||
Private m_CanUserReorder As Boolean
|
||||
Public Property CanUserReorder As Boolean
|
||||
Get
|
||||
@@ -312,6 +474,7 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend OldCanUserResize As Boolean?
|
||||
Private m_CanUserResize As Boolean
|
||||
Public Property CanUserResize As Boolean
|
||||
Get
|
||||
@@ -378,11 +541,30 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SortDirection As Forms.SortOrder = Forms.SortOrder.None
|
||||
Public Property SortDirection As Forms.SortOrder
|
||||
Get
|
||||
Return m_SortDirection 'If(IsNothing(m_dgColumn.SortDirection), 0, m_dgColumn.SortDirection + 1)
|
||||
End Get
|
||||
Set(value As Forms.SortOrder)
|
||||
'If Not IsNothing(m_dgColumn) Then
|
||||
' If value = 0 Then
|
||||
' m_dgColumn.SortDirection = Nothing
|
||||
' Else
|
||||
' m_dgColumn.SortDirection = value - 1
|
||||
' End If
|
||||
'Else
|
||||
m_SortDirection = 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, bVisible As Boolean, bCanUserEditVisible As Boolean)
|
||||
Sub New(sParentDG As String, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean, nSortDirection As Integer)
|
||||
m_ParentDataGridName = sParentDG
|
||||
m_Name = sName
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
@@ -392,6 +574,7 @@ Public Class EgtDataGridColumn
|
||||
m_Width = Width
|
||||
m_Visible = bVisible
|
||||
m_CanUserEditVisible = bCanUserEditVisible
|
||||
m_SortDirection = nSortDirection
|
||||
End Sub
|
||||
|
||||
Friend Sub InitColumn(dgColumn As DataGridColumn)
|
||||
@@ -403,13 +586,18 @@ Public Class EgtDataGridColumn
|
||||
'm_dgColumn.DisplayIndex = m_DisplayIndex
|
||||
m_dgColumn.Width = m_Width
|
||||
m_dgColumn.Visibility = m_ColumnVisibility
|
||||
If CInt(m_SortDirection) > 0 Then
|
||||
m_dgColumn.SortDirection = m_SortDirection - 1 'If(CInt(m_SortDirection) = 0, Nothing, m_SortDirection - 1)
|
||||
Else
|
||||
m_dgColumn.SortDirection = Nothing
|
||||
End If
|
||||
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 & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0)
|
||||
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
|
||||
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
@@ -213,6 +213,16 @@ Public Class MyMachGroupM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bCALC_PartsGlobalState As CalcStates
|
||||
Public Property bCALC_PartsGlobalState As CalcStates
|
||||
Get
|
||||
Return m_bCALC_PartsGlobalState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_bCALC_PartsGlobalState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_GlobalERR As Integer
|
||||
Public Property nCALC_GlobalERR As Integer
|
||||
Get
|
||||
|
||||
@@ -49,7 +49,7 @@ Public Class MyMachGroupPanelM
|
||||
EgtOutLog("Machine incompatible with beam & wall machining!!")
|
||||
Else
|
||||
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
Dim nPROJTYPE As Integer = BWType.NULL
|
||||
Dim nPROJTYPE As Integer = BWType.NULL
|
||||
EgtGetInfo(nBTLInfoLayerId, BTL_GEN_PROJTYPE, nPROJTYPE)
|
||||
If nPROJTYPE = BWType.BEAM Or nPROJTYPE = BWType.WALL Then
|
||||
TempList.Add(MyMachGroupM.CreateMyMachGroup(nPROJTYPE, nId, sName, sMachine))
|
||||
@@ -168,44 +168,157 @@ Public Class MyMachGroupPanelM
|
||||
|
||||
' funzione che fa l'update di tutte le copie dei pezzi modificati
|
||||
Public Shared Sub UpdateDuplo()
|
||||
' verifico tipo di progetto
|
||||
Dim nBtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
Dim nBWType As Integer = 0
|
||||
EgtGetInfo(nBtlInfoId, BTL_GEN_PROJTYPE, nBWType)
|
||||
' ciclo sui pezzi
|
||||
Dim bTotIsModified As Boolean = False
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim bIsModified As Boolean = False
|
||||
If EgtDuploGetModified(nPartId, bIsModified) AndAlso bIsModified Then
|
||||
' verifico se c'é PRID sugli outline
|
||||
Dim nPRId As Integer = 1
|
||||
Dim nOutlineLayer As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
||||
If nOutlineLayer <> GDB_ID.NULL Then
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
If EgtExistsInfo(nOutlineId, MGR_FTR_PRC) Then
|
||||
If EgtExistsInfo(nOutlineId, MGR_FTR_PRID) Then
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
Continue While
|
||||
Else
|
||||
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
|
||||
nPRId += 1
|
||||
End If
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
End If
|
||||
bTotIsModified = True
|
||||
Dim DuploList As New List(Of Integer)
|
||||
EgtDuploList(nPartId, DuploList)
|
||||
Dim DuploArray() As Integer
|
||||
Dim RotArray(DuploList.Count) As Integer
|
||||
Dim FlipArray(DuploList.Count) As Integer
|
||||
Dim QArray(DuploList.Count) As Dictionary(Of String, Dictionary(Of String, String))
|
||||
DuploArray = DuploList.ToArray()
|
||||
' recupero ROT e FLIP per non perderli
|
||||
' recupero ROT (gradi) e FLIP (0/1) per non perderli
|
||||
For Duploindex = 0 To DuploArray.Length - 1
|
||||
RotArray(Duploindex) = 0
|
||||
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
|
||||
FlipArray(Duploindex) = 0
|
||||
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
|
||||
If FlipArray(Duploindex) <> 0 Then FlipArray(Duploindex) = 180
|
||||
If nBWType = BWType.WALL Then
|
||||
' salvo parametri Q
|
||||
QArray(Duploindex) = New Dictionary(Of String, Dictionary(Of String, String))
|
||||
' ciclo sugli outline
|
||||
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
|
||||
If nOutlineLayer <> GDB_ID.NULL Then
|
||||
Dim nGlobPRId As Integer = 1
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
|
||||
nPRId = 0
|
||||
If Not EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId) Then
|
||||
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
|
||||
nPRId = nGlobPRId
|
||||
nGlobPRId += 1
|
||||
End If
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
|
||||
For QIndex = 1 To 10
|
||||
Dim QKey As String = "Q" & QIndex.ToString("D2")
|
||||
Dim QValue As Integer = 0
|
||||
If EgtGetInfo(nOutlineId, QKey, QValue) Then
|
||||
QArray(Duploindex)(sKey).Add(QKey, QValue)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
End If
|
||||
' ciclo sulle feature
|
||||
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
|
||||
If nFeatureLayer <> GDB_ID.NULL Then
|
||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
|
||||
While nFeatureId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
|
||||
nPRId = 0
|
||||
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
|
||||
For QIndex = 1 To 10
|
||||
Dim QKey As String = "Q" & QIndex.ToString("D2")
|
||||
Dim QValue As Integer = 0
|
||||
If EgtGetInfo(nFeatureId, QKey, QValue) Then
|
||||
QArray(Duploindex)(sKey).Add(QKey, QValue)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
nFeatureId = EgtGetNext(nFeatureId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' aggiornamento dei Duplo
|
||||
EgtDuploUpdate(nPartId)
|
||||
' recupero flip e rot dell'originale
|
||||
Dim OrigRot As Integer
|
||||
Dim OrigFlip As Integer
|
||||
Dim DeltaRot As Integer
|
||||
Dim DeltaFlip As Integer
|
||||
EgtGetInfo(nPartId, BTL_PRT_ROTATED, OrigRot)
|
||||
EgtGetInfo(nPartId, BTL_PRT_INVERTED, OrigFlip)
|
||||
' ripristino i valori di ROT e FLIP
|
||||
For Duploindex = 0 To DuploArray.Length - 1
|
||||
' recupero box del pezzo
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part)
|
||||
' faccio flip e rotazione rispetto all'originale che ha sovrascritto posizione del duplo
|
||||
DeltaRot = RotArray(Duploindex) - OrigRot
|
||||
EgtRotate(DuploArray(Duploindex), b3Part.Center, -Vector3d.Z_AX, DeltaRot)
|
||||
DeltaFlip = FlipArray(Duploindex) - OrigFlip
|
||||
EgtRotate(DuploArray(Duploindex), b3Part.Center, Vector3d.X_AX, DeltaFlip)
|
||||
' ripristino info rot e flip
|
||||
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
|
||||
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
|
||||
If nBWType = BWType.WALL Then
|
||||
' ciclo sugli outline
|
||||
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
|
||||
If nOutlineLayer <> GDB_ID.NULL Then
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
|
||||
nPRId = 0
|
||||
EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
' ripristino parametri Q
|
||||
If QArray(Duploindex).ContainsKey(sKey) Then
|
||||
For Each QPar In QArray(Duploindex)(sKey)
|
||||
EgtSetInfo(nOutlineId, QPar.Key, QPar.Value)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
End If
|
||||
' ciclo sulle feature
|
||||
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
|
||||
If nFeatureLayer <> GDB_ID.NULL Then
|
||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
|
||||
While nFeatureId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
|
||||
nPRId = 0
|
||||
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
' ripristino parametri Q
|
||||
If QArray(Duploindex).ContainsKey(sKey) Then
|
||||
For Each QPar In QArray(Duploindex)(sKey)
|
||||
EgtSetInfo(nFeatureId, QPar.Key, QPar.Value)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
nFeatureId = EgtGetNext(nFeatureId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
@@ -217,6 +330,13 @@ Public Class MyMachGroupPanelM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Class DuploFeature
|
||||
' Id geometrico della feature
|
||||
Friend nFeatureId As Integer
|
||||
Friend nPRC As Integer
|
||||
Friend nPRID As Integer
|
||||
End Class
|
||||
|
||||
' funzione che cancella tutti i pezzi segnati da eliminare
|
||||
Public Shared Sub DeleteDuplo()
|
||||
' reset necessario per poter accedere direttamente al grezzo dalle info pezzo e al MachGroup tramite la gerarchia Db geometrico
|
||||
|
||||
@@ -292,13 +292,13 @@ Public Class PartM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_bFLIP As Boolean
|
||||
Public Property bFLIP As Boolean
|
||||
Protected m_nFLIP As Integer
|
||||
Public Property nFLIP As Integer
|
||||
Get
|
||||
Return m_bFLIP
|
||||
Return m_nFLIP
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bFLIP = value
|
||||
Set(value As Integer)
|
||||
m_nFLIP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -490,7 +490,7 @@ Public Class PartM
|
||||
EgtGetInfo(nPartId, MGR_PRT_POSX, NewPartM.m_dPOSX)
|
||||
EgtGetInfo(nPartId, MGR_PRT_POSY, NewPartM.m_dPOSY)
|
||||
EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT)
|
||||
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_bFLIP)
|
||||
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP)
|
||||
End If
|
||||
' leggo volume
|
||||
If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewPartM.dVolume) Then
|
||||
|
||||
@@ -113,7 +113,7 @@ Public MustInherit Class MyMachGroupPanelVM
|
||||
SelMachGroup.SelPart = Nothing
|
||||
' Imposto vista solo tavola
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
Core.ViewPanelVM.BWSetView(If(ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -235,6 +235,12 @@ Public MustInherit Class MyMachGroupVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nPartsGlobalState As CalcStates
|
||||
Get
|
||||
Return MyMachGroupM.bCALC_PartsGlobalState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nCALC_State As CalcStates
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_State
|
||||
@@ -431,18 +437,6 @@ Public MustInherit Class MyMachGroupVM
|
||||
Public Sub SetSupervisorId(SupervisorId As String)
|
||||
m_SupervisorId = SupervisorId
|
||||
End Sub
|
||||
Public Sub ResetSupervisorId()
|
||||
' resetto stato per MachGroup
|
||||
nProduction_State = ItemState.ND
|
||||
m_SupervisorId = ""
|
||||
NotifyPropertyChanged(NameOf(IsReadOnly))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
' resetto stato per tutti i Part
|
||||
For Each Part In PartVMList
|
||||
Part.nProduction_State = ItemState.ND
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private m_cc As StateChangeEventArgs
|
||||
|
||||
@@ -551,6 +545,8 @@ Public MustInherit Class MyMachGroupVM
|
||||
Public Overridable Sub CalcGlobalUpdate()
|
||||
MyMachGroupM.nCALC_GlobalERR = nCALC_ERR
|
||||
MyMachGroupM.nCALC_GlobalState = nCALC_State
|
||||
' stato globale dei pezzi
|
||||
MyMachGroupM.bCALC_PartsGlobalState = CalcStates.NOTCALCULATED
|
||||
For Each Part In MyMachGroupM.PartMList
|
||||
If Part.nCALC_GlobalState = CalcStates.NOTCALCULATED And nCALC_State < CalcStates.ERROR_ Then
|
||||
MyMachGroupM.nCALC_GlobalState = Part.nCALC_GlobalState
|
||||
@@ -560,6 +556,9 @@ Public MustInherit Class MyMachGroupVM
|
||||
MyMachGroupM.nCALC_GlobalState = Part.nCALC_GlobalState
|
||||
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
|
||||
End If
|
||||
If Part.nCALC_GlobalState > MyMachGroupM.bCALC_PartsGlobalState Then
|
||||
MyMachGroupM.bCALC_PartsGlobalState = Part.nCALC_GlobalState
|
||||
End If
|
||||
If Part.nCALC_ROT <> 0 Then
|
||||
MyMachGroupM.m_nCALC_ROT = Part.nCALC_ROT
|
||||
End If
|
||||
@@ -567,6 +566,7 @@ Public MustInherit Class MyMachGroupVM
|
||||
MyMachGroupM.nCALC_FALL = Part.nCALC_FALL
|
||||
End If
|
||||
Next
|
||||
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
|
||||
@@ -248,12 +248,12 @@ Public MustInherit Class PartVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable Property bFLIP As Boolean
|
||||
Public Overridable Property nFLIP As Integer
|
||||
Get
|
||||
Return m_PartM.bFLIP
|
||||
Return m_PartM.nFLIP
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_PartM.bFLIP = value
|
||||
Set(value As Integer)
|
||||
m_PartM.nFLIP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.1.3")>
|
||||
<Assembly: AssemblyFileVersion("2.4.1.3")>
|
||||
<Assembly: AssemblyVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.2.1")>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="5"
|
||||
BindingColumns="{Binding ProjectColumns}">
|
||||
<DataGrid.Resources>
|
||||
|
||||
@@ -267,6 +267,10 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg)})
|
||||
End If
|
||||
' setto la visibilità delle colonne delle EgtDataGrid
|
||||
For Each col In ProjectColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Function VerifySelected() As Boolean
|
||||
|
||||
@@ -6,15 +6,35 @@ Public Class ViewPanelVM
|
||||
|
||||
' Tipo di progetto aperto
|
||||
Private Shared m_Type As BWType
|
||||
Public Shared ReadOnly Property Type As BWType
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Posizione vista
|
||||
Private Shared m_nViewDir As VT
|
||||
Private Shared m_nViewDir As VT = VT.ISO_SW
|
||||
|
||||
Public Shared Function BWSetView(nView As VT, Optional bRedraw As Boolean = True)
|
||||
' condizioni che cambiano la vista del progetto
|
||||
Select Case m_Type
|
||||
Case BWType.BEAM
|
||||
EgtSetView(VT.ISO_SW, bRedraw)
|
||||
Select Case nView
|
||||
Case VT.TOP
|
||||
EgtSetView(VT.TOP, bRedraw)
|
||||
Case VT.FRONT
|
||||
EgtSetView(VT.FRONT, bRedraw)
|
||||
Case VT.BACK
|
||||
EgtSetView(VT.BACK, bRedraw)
|
||||
Case VT.RIGHT
|
||||
EgtSetView(VT.RIGHT, bRedraw)
|
||||
Case VT.LEFT
|
||||
EgtSetView(VT.LEFT, bRedraw)
|
||||
Case VT.ISO_SW
|
||||
EgtSetView(VT.ISO_SW, bRedraw)
|
||||
Case Else ' VT.ISO_SW
|
||||
EgtSetView(VT.ISO_SW, bRedraw)
|
||||
End Select
|
||||
Case BWType.WALL
|
||||
Select Case nView
|
||||
Case VT.TOP
|
||||
@@ -70,7 +90,7 @@ Public Class ViewPanelVM
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Shared Sub UpdateMachParam(ViewDir As Integer)
|
||||
Public Shared Sub UpdateMachParam(ViewDir As VT)
|
||||
m_nViewDir = ViewDir
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
@@ -74,69 +73,70 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
// Recupero il PROD
|
||||
ProdModel currData = ProdController.man.FindByProdId(ProdId);
|
||||
List<PartModel> PartList2Add = new List<PartModel>();
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var convCurrMG = MachGroupController.ConvertFromCore(newMachGroup, currData.ProdDbId);
|
||||
|
||||
convCurrMG.ProdIndex = 1;
|
||||
|
||||
// aggiungo MachGroup
|
||||
dbCtx.MachGroupList.Add(convCurrMG);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
|
||||
int MachGroupDbId = MachGroupController.man.FindByMachGroupId(ProdId, newMachGroup.Id).MachGroupDbId;
|
||||
// verifico se uguali o meno...
|
||||
foreach (var currPartM in newMachGroup.PartMList)
|
||||
try
|
||||
{
|
||||
var currPart = dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id && x.PartId == currPartM.nPartId)
|
||||
.SingleOrDefault();
|
||||
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
|
||||
if (currPart != null)
|
||||
var convCurrMG = MachGroupController.ConvertFromCore(newMachGroup, currData.ProdDbId);
|
||||
|
||||
convCurrMG.ProdIndex = 1;
|
||||
|
||||
// aggiungo MachGroup
|
||||
localDbCtx.MachGroupList.Add(convCurrMG);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
int MachGroupDbId = MachGroupController.man.FindByMachGroupId(ProdId, newMachGroup.Id).MachGroupDbId;
|
||||
// verifico se uguali o meno...
|
||||
foreach (var currPartM in newMachGroup.PartMList)
|
||||
{
|
||||
// se non identico x equality limitata a ViewOptim...
|
||||
if (!currPart.ViewOptimEquals(convCurrPartM))
|
||||
var currPart = localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id && x.PartId == currPartM.nPartId)
|
||||
.SingleOrDefault();
|
||||
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
|
||||
if (currPart != null)
|
||||
{
|
||||
// aggiorno con nuovi valori ricevuti
|
||||
currPart.H = convCurrPartM.H;
|
||||
currPart.L = convCurrPartM.L;
|
||||
currPart.W = convCurrPartM.W;
|
||||
currPart.Material = convCurrPartM.Material;
|
||||
currPart.CALC_State = convCurrPartM.CALC_State;
|
||||
currPart.ROT = convCurrPartM.ROT;
|
||||
currPart.PDN = convCurrPartM.PDN;
|
||||
currPart.NAM = convCurrPartM.NAM;
|
||||
// salvo
|
||||
dbCtx.SaveChanges();
|
||||
// se non identico x equality limitata a ViewOptim...
|
||||
if (!currPart.ViewOptimEquals(convCurrPartM))
|
||||
{
|
||||
// aggiorno con nuovi valori ricevuti
|
||||
currPart.H = convCurrPartM.H;
|
||||
currPart.L = convCurrPartM.L;
|
||||
currPart.W = convCurrPartM.W;
|
||||
currPart.Material = convCurrPartM.Material;
|
||||
currPart.CALC_State = convCurrPartM.CALC_State;
|
||||
currPart.ROT = convCurrPartM.ROT;
|
||||
currPart.PDN = convCurrPartM.PDN;
|
||||
currPart.NAM = convCurrPartM.NAM;
|
||||
// salvo
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PartList2Add.Add(convCurrPartM);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PartList2Add.Add(convCurrPartM);
|
||||
}
|
||||
|
||||
// aggiungo PartList
|
||||
localDbCtx.PartList.AddRange(PartList2Add);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
// aggiorno valore isNew a false x PROD
|
||||
currData.IsNew = false;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, newMachGroup.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateMachGroup: {exc}");
|
||||
}
|
||||
|
||||
// aggiungo PartList
|
||||
dbCtx.PartList.AddRange(PartList2Add);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
|
||||
// aggiorno valore isNew a false x PROD
|
||||
currData.IsNew = false;
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, newMachGroup.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateMachGroup: {exc}");
|
||||
}
|
||||
|
||||
return currData;
|
||||
}
|
||||
|
||||
@@ -150,19 +150,20 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
MachGroupModel newMachGroup = new MachGroupModel() { MachGroupId = newMachGroupId, Name = Name, State = Core.ItemState.ND };
|
||||
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.MachGroupList.Add(newMachGroup);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.MachGroupList.Add(newMachGroup);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Create: {exc}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Create: {exc}");
|
||||
}
|
||||
|
||||
return newMachGroup;
|
||||
}
|
||||
|
||||
@@ -175,39 +176,40 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Delete(int ProdId, int MachGroupId)
|
||||
{
|
||||
bool done = false;
|
||||
// inizio eliminando le part
|
||||
var parts2del = dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId)
|
||||
.ToList();
|
||||
|
||||
var MG2Del = dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.SingleOrDefault();
|
||||
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// Remove to database
|
||||
dbCtx.PartList.RemoveRange(parts2del);
|
||||
dbCtx.MachGroupList.Remove(MG2Del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
// inizio eliminando le part
|
||||
var parts2del = localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId)
|
||||
.ToList();
|
||||
|
||||
// registro modifica StatusMap
|
||||
StatusMapController.man.UpdateAction(MG2Del.SupervisorId, ProdId, MG2Del.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
||||
var MG2Del = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.SingleOrDefault();
|
||||
|
||||
ResetController();
|
||||
done = true;
|
||||
try
|
||||
{
|
||||
// Remove to database
|
||||
localDbCtx.PartList.RemoveRange(parts2del);
|
||||
localDbCtx.MachGroupList.Remove(MG2Del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
// registro modifica StatusMap
|
||||
StatusMapController.man.UpdateAction(MG2Del.SupervisorId, ProdId, MG2Del.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
||||
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId}{Environment.NewLine}{exc}");
|
||||
}
|
||||
|
||||
// se fatto aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId}{Environment.NewLine}{exc}");
|
||||
}
|
||||
|
||||
// se fatto aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -237,10 +239,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public MachGroupModel FindByMachGroupId(int ProdId, int MachGroupId)
|
||||
{
|
||||
return dbCtx
|
||||
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
return localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -325,6 +331,77 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set ProdIndex for MachGroup
|
||||
/// </summary>
|
||||
/// <param name="ProdId"></param>
|
||||
/// <returns></returns>
|
||||
public int GetMinIndex(int ProdId)
|
||||
{
|
||||
int answ = 5000;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var result = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.ProdIndex >= 5000 && x.ProdIndex < 10000)
|
||||
.OrderByDescending(x => x.ProdIndex)
|
||||
.FirstOrDefault();
|
||||
if (result != null)
|
||||
{
|
||||
answ = result.ProdIndex;
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateOrder: {exc}");
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Imposta a RIMOSSA dal supervisore
|
||||
/// </summary>
|
||||
/// <param name="MachGroupId"></param>
|
||||
/// <param name="newState"></param>
|
||||
/// <returns></returns>
|
||||
public bool RemoveFromSupervisor(int ProdId, int MachGroupId)
|
||||
{
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
if (currRecord != null)
|
||||
{
|
||||
currRecord.State = Core.ItemState.ND;
|
||||
currRecord.SupervisorId = "";
|
||||
currRecord.ProdIndex = 0;
|
||||
}
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
|
||||
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on RemoveFromSupervisor: {exc}");
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reinizializzaizone del controller
|
||||
/// </summary>
|
||||
@@ -344,26 +421,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool SetNeedRedo(int ProdId, int MachGroupId, Core.ItemState newState, string Value)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault()
|
||||
.State = newState;
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault()
|
||||
.State = newState;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -375,25 +453,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Update(MachGroupModel updItem)
|
||||
{
|
||||
bool done = false;
|
||||
var item2update = dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// update, vers 1...
|
||||
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
var item2update = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Update: {exc}");
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Update: {exc}");
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
@@ -408,28 +488,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateEnd(int ProdId, int MachGroupId, DateTime DtEnd)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
|
||||
currRecord.DtEnd = DtEnd;
|
||||
currRecord.DtEnd = DtEnd;
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}");
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -443,58 +525,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateOrder(int ProdId, int MachGroupId, int newProdIndex)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault()
|
||||
.ProdIndex = newProdIndex;
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
#if false
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
#endif
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateOrder: {exc}");
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set ProdIndex for MachGroup
|
||||
/// </summary>
|
||||
/// <param name="ProdId"></param>
|
||||
/// <returns></returns>
|
||||
public int GetMinIndex(int ProdId)
|
||||
{
|
||||
int answ=5000;
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var result = dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.ProdIndex >= 5000 && x.ProdIndex < 10000)
|
||||
.OrderByDescending(x => x.ProdIndex)
|
||||
.FirstOrDefault();
|
||||
if (result != null)
|
||||
try
|
||||
{
|
||||
answ = result.ProdIndex;
|
||||
// aggiorno
|
||||
localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault()
|
||||
.ProdIndex = newProdIndex;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateOrder: {exc}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateOrder: {exc}");
|
||||
}
|
||||
|
||||
return answ;
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -508,28 +559,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateStart(int ProdId, int MachGroupId, DateTime DtStart)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
|
||||
currRecord.DtStart = DtStart;
|
||||
currRecord.DtStart = DtStart;
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}");
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -544,29 +597,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateStartEnd(int ProdId, int MachGroupId, DateTime DtStart, DateTime DtEnd)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
|
||||
currRecord.DtStart = DtStart;
|
||||
currRecord.DtEnd = DtEnd;
|
||||
currRecord.DtStart = DtStart;
|
||||
currRecord.DtEnd = DtEnd;
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}");
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -579,63 +633,28 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateStatus(int ProdId, int MachGroupId, Core.ItemState newState)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault()
|
||||
.State = newState;
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Imposta a RIMOSSA dal supervisore
|
||||
/// </summary>
|
||||
/// <param name="MachGroupId"></param>
|
||||
/// <param name="newState"></param>
|
||||
/// <returns></returns>
|
||||
public bool RemoveFromSupervisor(int ProdId, int MachGroupId)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
if (currRecord != null)
|
||||
try
|
||||
{
|
||||
currRecord.State = Core.ItemState.ND;
|
||||
currRecord.SupervisorId = "";
|
||||
currRecord.ProdIndex = 0;
|
||||
}
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on RemoveFromSupervisor: {exc}");
|
||||
}
|
||||
// aggiorno
|
||||
localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault()
|
||||
.State = newState;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -649,29 +668,31 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateSupervisor(int ProdId, int MachGroupId, string SupervisorId)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
|
||||
currRecord.SupervisorId = SupervisorId;
|
||||
currRecord.State = Core.ItemState.Assigned;
|
||||
currRecord.SupervisorId = SupervisorId;
|
||||
currRecord.State = Core.ItemState.Assigned;
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateSupervisor: {exc}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateSupervisor: {exc}");
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
|
||||
@@ -254,10 +254,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public PartModel FindByPartId(int ProdId, int PartId)
|
||||
{
|
||||
return dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.PartId == PartId)
|
||||
.SingleOrDefault();
|
||||
PartModel answ = null;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
answ = localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.PartId == PartId)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -277,28 +282,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Update(PartModel updItem)
|
||||
{
|
||||
bool done = false;
|
||||
var item2update = dbCtx
|
||||
.PartList
|
||||
.Where(x => x.PartDbId == updItem.PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// update, vers 1...
|
||||
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
var item2update = localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.PartDbId == updItem.PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
|
||||
//// update, vers 2
|
||||
//dbCtx.PartList.Remove(item2del);
|
||||
//dbCtx.PartList.Add(updItem);
|
||||
//// update, vers 2
|
||||
//dbCtx.PartList.Remove(item2del);
|
||||
//dbCtx.PartList.Add(updItem);
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -311,26 +318,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateEnd(int ProdId, int MachGroupId, int PartId, DateTime DtEnd)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.DtEnd = DtEnd;
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.DtEnd = DtEnd;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -343,24 +351,26 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateStart(int ProdId, int MachGroupId, int PartId, DateTime DtStart)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.DtStart = DtStart;
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.DtStart = DtStart;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
}
|
||||
}
|
||||
|
||||
return done;
|
||||
@@ -375,24 +385,26 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateStatus(int ProdId, int MachGroupId, int PartId, Core.ItemState newState)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.State = newState;
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.State = newState;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
}
|
||||
}
|
||||
|
||||
return done;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using static EgtBEAMWALL.Core.ConstBeam;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
@@ -90,6 +90,32 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Search for already imported BTL from FileName (only)
|
||||
/// =0 : NOT found
|
||||
/// >0 : ProjId (already rpesent) for overwrite
|
||||
/// </summary>
|
||||
/// <param name="BTLFileName"></param>
|
||||
/// <returns></returns>
|
||||
public int AlreadyImported(string BTLFileName)
|
||||
{
|
||||
int answ = 0;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var dbResult = localDbCtx
|
||||
.ProjList
|
||||
.Where(x => x.BTLFileName == BTLFileName)
|
||||
.FirstOrDefault();
|
||||
|
||||
//se avesse trovato-- > riporto id...
|
||||
if (dbResult != null && dbResult.ProjId > 0)
|
||||
{
|
||||
answ = dbResult.ProjId;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public bool DeleteProj(int ProjId)
|
||||
{
|
||||
bool done = false;
|
||||
@@ -124,6 +150,51 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get records filtered by BtlPartName matching regexp BtlFileName[_number]
|
||||
/// </summary>
|
||||
/// <param name="BtlFileName">Base name to search for (=starts by BtlFileName%)</param>
|
||||
/// <returns></returns>
|
||||
public List<ProjModel> FindByBtlFileName(string BtlFileName)
|
||||
{
|
||||
List<ProjModel> searchResult = new List<ProjModel>();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// in primi cerco il record "parent" generale, se non ci fosse inutile proseguire...
|
||||
ProjModel parentRec = localDbCtx
|
||||
.ProjList
|
||||
.Where(x => x.BTLFileName == BtlFileName)
|
||||
.FirstOrDefault();
|
||||
if (parentRec != null && parentRec.ProjId > 0)
|
||||
{
|
||||
// inserisco nei risultati
|
||||
searchResult.Add(parentRec);
|
||||
// cerco eventuali dati "child" puliti
|
||||
var childRec = localDbCtx
|
||||
.ProjList
|
||||
.Where(x => x.BTLFileName.StartsWith(BtlFileName+"_"))
|
||||
.ToList();
|
||||
// faccio filtro con ricerca regexp x scartare "falsi positivi" come BtlFileName_nonNumero...
|
||||
if (childRec.Count > 0)
|
||||
{
|
||||
// ciclo nei risultati x verificare se si tratti di PURO NUMERO...
|
||||
foreach (var item in childRec)
|
||||
{
|
||||
string maybeNumber = item.BTLFileName.Replace($"{BtlFileName}_", "");
|
||||
int index = 0;
|
||||
bool isNumber = int.TryParse(maybeNumber, out index);
|
||||
if (isNumber)
|
||||
{
|
||||
searchResult.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return searchResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get record by ProjDbId
|
||||
/// </summary>
|
||||
@@ -526,7 +597,41 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public Core.ProjFileM UpdateInfo(int ProjId, string BTLFileName, string ListName, DateTime DtExported, BWType PType, string Machine)
|
||||
{
|
||||
// cerco specifico Proj
|
||||
var currData = FindByProjId(ProjId);
|
||||
|
||||
// 2022.01.24: verifico UNIVOCITA' nel nome del file: SE fosse duplicato --> nuovo nome, nel formato nomeOriginale_idx, dove idx è il contatore libero successivo
|
||||
var duplicateList = FindByBtlFileName(BTLFileName);
|
||||
// devo verificare SOLO SE la lista non è vuota
|
||||
if (duplicateList != null && duplicateList.Count > 0)
|
||||
{
|
||||
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
|
||||
if (duplicateList.Count == 1)
|
||||
{
|
||||
// verifico se ProjId variato
|
||||
if (!duplicateList[0].ProjId.Equals(currData.ProjId))
|
||||
{
|
||||
// in questo caso ho il PRIMO duplicato
|
||||
BTLFileName = $"{BTLFileName}_1";
|
||||
}
|
||||
}
|
||||
// se ne ho + di 1 --> so che il maxId interno avrò il valore ULTIMO x prendere il successivo
|
||||
else
|
||||
{
|
||||
var lastRec = duplicateList.OrderByDescending(x => x.ProjDbId).FirstOrDefault();
|
||||
// cerco indice
|
||||
string maybeNumber = lastRec.BTLFileName.Replace($"{BTLFileName}_", "");
|
||||
int index = 0;
|
||||
bool isNumber = int.TryParse(maybeNumber, out index);
|
||||
// fasccio comunque verifica sia numerico
|
||||
if (isNumber)
|
||||
{
|
||||
// in questo caso ho il l'ULTIMO duplicato e faccio +1
|
||||
BTLFileName = $"{BTLFileName}_{index + 1}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// aggiorno valore BTL
|
||||
currData.BTLFileName = BTLFileName;
|
||||
currData.DtExported = DtExported;
|
||||
@@ -559,7 +664,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
|
||||
return coreConv(currData);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Update record su DB x PType
|
||||
/// </summary>
|
||||
@@ -568,15 +673,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public Core.ProjFileM UpdateMachine(int ProjId, String Machine)
|
||||
{
|
||||
var currData = FindByProjId(ProjId);
|
||||
// aggiorno valore BTL
|
||||
currData.Machine = Machine;
|
||||
var currData = FindByProjId(ProjId);
|
||||
// aggiorno valore BTL
|
||||
currData.Machine = Machine;
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
|
||||
return coreConv(currData);
|
||||
return coreConv(currData);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
@@ -132,14 +131,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.ToList();
|
||||
}
|
||||
return answ;
|
||||
#if false
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.ItemType == Core.StatusMapItemType.Prod)
|
||||
.OrderByDescending(x => x.Index)
|
||||
.ToList();
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -162,10 +153,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
DateTime adesso = DateTime.Now;
|
||||
|
||||
#if false
|
||||
// svuoto dati precedenti IN BLOCCO
|
||||
done = DeleteSession("");
|
||||
#endif
|
||||
// gestione corretta x multi-supervisors
|
||||
done = DeleteSession(SupervisorId);
|
||||
|
||||
@@ -234,7 +221,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
// aggiorno indice PROD
|
||||
prodData.Index++;
|
||||
// se session è nulla ma ho un PROD --> calcolo da li la sessione
|
||||
// se session è nulla ma ho un PROD --> calcolo da li la sessione
|
||||
if (string.IsNullOrEmpty(Session))
|
||||
{
|
||||
Session = prodData.Session;
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.4.1.3")]
|
||||
[assembly: AssemblyFileVersion("2.4.1.3")]
|
||||
[assembly: AssemblyVersion("2.4.2.1")]
|
||||
[assembly: AssemblyFileVersion("2.4.2.1")]
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Class Application
|
||||
Imports EgtUILib
|
||||
|
||||
Class Application
|
||||
|
||||
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
|
||||
' can be handled in this file.
|
||||
@@ -11,4 +13,9 @@
|
||||
Me.MainWindow.Show()
|
||||
End Sub
|
||||
|
||||
Public Sub ManageUnhandledException(sender As Object, e As System.Windows.Threading.DispatcherUnhandledExceptionEventArgs) Handles Me.DispatcherUnhandledException
|
||||
EgtOutLog(e.Exception.ToString)
|
||||
e.Handled = True
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -69,15 +69,24 @@ Public Class CALCPanelVM
|
||||
If e.End_ <> CalcEndEventArgs.Results.OK Then
|
||||
MessageBox.Show("Execution error (all processes are disabled)")
|
||||
End If
|
||||
' ciclo sui pezzi
|
||||
Dim bNotOkFound As Boolean = False
|
||||
For Each MachGroup As MyMachGroupVM In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList
|
||||
' se trovo pezzo errato, resetto tutti i successivi
|
||||
If Not bNotOkFound AndAlso MachGroup.MyMachGroupM.m_nCALC_GlobalState <> CalcStates.OK AndAlso MachGroup.MyMachGroupM.m_nCALC_GlobalState <> CalcStates.INFO Then
|
||||
bNotOkFound = True
|
||||
End If
|
||||
If bNotOkFound Then MachGroup.ResetProduce()
|
||||
Next
|
||||
Map.refProjectVM.ManageIsEnabled(True)
|
||||
Map.refMyStatusBarVM.ResetStopProgress()
|
||||
End Sub
|
||||
|
||||
Private Sub Calc_ProcessEnded(sender As Object, e As CalcProcessEndEventArgs)
|
||||
Dim nRawid As Integer = e.m_Result.nBarId
|
||||
If nRawid <= 0 Then Return
|
||||
Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(nRawid)
|
||||
Machgroup.CALCEnd()
|
||||
'Dim nRawid As Integer = e.m_Result.nBarId
|
||||
'If nRawid <= 0 Then Return
|
||||
'Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(nRawid)
|
||||
'Machgroup.CALCEnd()
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ProcessResults(Bar As Bar)
|
||||
@@ -337,8 +346,6 @@ Public Class CALCPanelVM
|
||||
Case Core.CalcStates.OK, Core.CalcStates.INFO
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & MachGroup.Name.ToString() & ".ori.bwe"
|
||||
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
|
||||
End Select
|
||||
TempBarList(MachGroupIndex) = Bar
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="5"
|
||||
BindingColumns="{Binding VariablesColumns}">
|
||||
<DataGrid.Resources>
|
||||
@@ -289,50 +289,6 @@
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="Colonne tabelle">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:DGColumnsListV DataContext="{Binding}"
|
||||
ItemsSource="{Binding DGColumnsList}"
|
||||
SelectedItem="{Binding SelDGColumn}"
|
||||
Grid.Column="0"
|
||||
Margin="5">
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Background>
|
||||
<SolidColorBrush Color="LightGray"></SolidColorBrush>
|
||||
</Expander.Background>
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}" />
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<ItemsPresenter />
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</DataGrid.GroupStyle>
|
||||
</EgtBEAMWALL:DGColumnsListV>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
|
||||
@@ -55,18 +55,6 @@ Public Class ConfigurationPageVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle colonne con le relative proprietà della DataGrid
|
||||
Private m_DGColumnsList_View As CollectionView = Nothing
|
||||
Protected m_DGColumnsList As New ObservableCollection(Of IniDataGridColumn)
|
||||
Public Property DGColumnsList As ObservableCollection(Of IniDataGridColumn)
|
||||
Get
|
||||
Return m_DGColumnsList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of IniDataGridColumn))
|
||||
m_DGColumnsList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_VariablesColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property VariablesColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
@@ -252,11 +240,6 @@ Public Class ConfigurationPageVM
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' carico la lista delle colonne delle DataGrid in ConfigurationPage
|
||||
LoadConfigDGColumns()
|
||||
' setto il grouping ad 1 livello per la DataGrid
|
||||
m_DGColumnsList_View = CollectionViewSource.GetDefaultView(m_DGColumnsList)
|
||||
m_DGColumnsList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(IniDataGridColumn.VisParentDataGridName)))
|
||||
' carico la lista delle colonne delle variabili della macchina in ConfigurationPage
|
||||
GetPrivateProfileColumns(S_VARIABLESLIST, VariablesColumns)
|
||||
' carico le Variables della macchina
|
||||
@@ -284,7 +267,6 @@ Public Class ConfigurationPageVM
|
||||
''' </summary>
|
||||
Public Sub Save()
|
||||
WriteVariables()
|
||||
WriteDataGridColumns()
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
|
||||
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
|
||||
End Sub
|
||||
@@ -330,54 +312,8 @@ Public Class ConfigurationPageVM
|
||||
|
||||
' funzione che verifica la modifica dei valori in Configurazione e ne chiede il salvataggio
|
||||
Friend Sub VerifyConfigPageModification()
|
||||
' verifico se i valori delle colonne DataGrid sono stati modificati
|
||||
For Each DGColumnItem In DGColumnsList
|
||||
If DGColumnItem.IsModified Then
|
||||
If MessageBox.Show(EgtMsg(61882), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
|
||||
' scrivo i valori delle colonne DataGrid modificate
|
||||
WriteDataGridColumns()
|
||||
Else
|
||||
' se da non salvare li resetto ed esco dai For
|
||||
LoadConfigDGColumns()
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
' qui veniva verificata solamente la modifica delle proprietà delle colonne delle EgtDataGrid
|
||||
|
||||
' funzione che carica la DataGrid di configurazione delle colonne delle EgtDataGrid
|
||||
Public Sub LoadConfigDGColumns()
|
||||
DGColumnsList.Clear()
|
||||
GetPrivateProfileIniColumns(S_OPENPROJFILEDLG_PROD, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_RAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARTINRAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_VARIABLESLIST, DGColumnsList)
|
||||
End Sub
|
||||
|
||||
' funzione per calcolare e scrivere la stringhe dei parametri delle colonne relative ad una ParentDataGridName nell'INI
|
||||
Public Sub SaveDataGridColumns(ParentDataGridName As String, DGColumnsList As ObservableCollection(Of IniDataGridColumn))
|
||||
For Each ColumnItem In DGColumnsList
|
||||
If ColumnItem.ParentDataGridName = ParentDataGridName Then
|
||||
Dim sColumnParams = String.Empty
|
||||
sColumnParams = ColumnItem.Name & "," & If(ColumnItem.CanUserReorder, 1, 0) & "," & If(ColumnItem.CanUserResize, 1, 0) & "," &
|
||||
If(ColumnItem.CanUserSort, 1, 0) & "," & If(ColumnItem.IsReadOnly, 1, 0) & "," & DoubleToString(ColumnItem.Width.Value, 6) & "," &
|
||||
ColumnItem.Width.UnitType & "," & If(ColumnItem.Visible, 1, 0) & "," & If(ColumnItem.CanUserEditVisible, 1, 0)
|
||||
WriteColumnPrivateProfileParam(ParentDataGridName, ColumnItem.m_DisplayIndex, sColumnParams)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione che scrive i valori delle proprietà delle colonne customizzate delle EgtDataGrid nell'INI
|
||||
Public Sub WriteDataGridColumns()
|
||||
SaveDataGridColumns(S_OPENPROJFILEDLG_PROD, DGColumnsList)
|
||||
SaveDataGridColumns(S_RAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARTINRAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
SaveDataGridColumns(S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
SaveDataGridColumns(S_VARIABLESLIST, DGColumnsList)
|
||||
For Each DGColumnItem In DGColumnsList
|
||||
DGColumnItem.IsModifiedReset()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione che legge le variabili della macchina dall'INI
|
||||
@@ -421,239 +357,6 @@ Public Class ConfigurationPageVM
|
||||
|
||||
End Class
|
||||
|
||||
Public Class IniDataGridColumn
|
||||
|
||||
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
|
||||
|
||||
' Nome datagrid di cui fa parte la colonna visualizzato nell'interfaccia
|
||||
Public ReadOnly Property VisParentDataGridName As String
|
||||
Get
|
||||
Return ParentDataGridName.Replace(ParentDataGridName.Substring(0, 3), "").Trim()
|
||||
End Get
|
||||
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
|
||||
|
||||
' Nome colonna visualizzato nell'interfaccia
|
||||
Public ReadOnly Property VisName As String
|
||||
Get
|
||||
Return Name.Replace(Name.Substring(0, 3), "").Trim()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property m_Width As DataGridLength
|
||||
Public Property Width As DataGridLength
|
||||
Get
|
||||
Return m_Width
|
||||
End Get
|
||||
Set(value As DataGridLength)
|
||||
m_Width = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedDisplayIndex
|
||||
Friend Property m_DisplayIndex As Integer
|
||||
Public Property DisplayIndex As Integer
|
||||
Get
|
||||
Return If(Visible, m_DisplayIndex, -1)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_DisplayIndex = value
|
||||
m_IsModifiedDisplayIndex = (m_Name <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.NAME))
|
||||
' se DisplayIndex viene settato ad un valore che corrisponde a quello che aveva inizialmente aggiorno gli IsModified
|
||||
' delle altre proprietà utilizzando il DisplayIndex attuale
|
||||
If Not m_IsModifiedDisplayIndex Then
|
||||
m_IsModifiedIsReadOnly = (m_IsReadOnly <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.ISREADONLY))
|
||||
m_IsModifiedCanUserReorder = (m_CanUserReorder <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.REORDER))
|
||||
m_IsModifiedCanUserResize = (m_CanUserResize <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.RESIZE))
|
||||
m_IsModifiedCanUserSort = (m_CanUserSort <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.SORT))
|
||||
m_IsModifiedVisible = (m_Visible <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.VISIBLE))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedIsReadOnly As Boolean = False
|
||||
Private Property m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnly = value
|
||||
m_IsModifiedIsReadOnly = (m_IsReadOnly <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.ISREADONLY))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserReorder As Boolean = False
|
||||
Private m_CanUserReorder As Boolean
|
||||
Public Property CanUserReorder As Boolean
|
||||
Get
|
||||
Return m_CanUserReorder
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserReorder = value
|
||||
m_IsModifiedCanUserReorder = (m_CanUserReorder <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.REORDER))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserResize As Boolean = False
|
||||
Private m_CanUserResize As Boolean
|
||||
Public Property CanUserResize As Boolean
|
||||
Get
|
||||
Return m_CanUserResize
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserResize = value
|
||||
m_IsModifiedCanUserResize = (m_CanUserResize <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.RESIZE))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserSort As Boolean = False
|
||||
Private m_CanUserSort As Boolean
|
||||
Public Property CanUserSort As Boolean
|
||||
Get
|
||||
Return m_CanUserSort
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserSort = value
|
||||
m_IsModifiedCanUserSort = (m_CanUserSort <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.SORT))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedVisible As Boolean = False
|
||||
Private m_Visible As Boolean
|
||||
Public Property Visible As Boolean
|
||||
Get
|
||||
Return m_Visible
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_Visible = value
|
||||
' Utilizzo OldDGIndex e NewDGIndex per muovere la Column tra il gruppo dei Visible (in alto) o il gruppo
|
||||
' dei non Visible (in basso): in ambo i casi verrà sempre spostata in mezzo ai due raggruppamenti
|
||||
Dim OldDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Me)
|
||||
If value Then
|
||||
Dim NewDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName AndAlso
|
||||
x.Visible = False))
|
||||
' se NewDGIndex = -1 (ovvero ho settato l'ultima Column rimasta non Visible a Visible) oppure
|
||||
' se il nuovo indice è subito dopo il vecchio non la sposto altrimenti viene spostata in maniera sbagliata
|
||||
If NewDGIndex <> -1 AndAlso NewDGIndex <> OldDGIndex + 1 Then Map.refConfigurationPageVM.DGColumnsList.Move(OldDGIndex, NewDGIndex)
|
||||
Else
|
||||
Dim NewDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName AndAlso
|
||||
x.Visible = False AndAlso
|
||||
x.Name <> Name))
|
||||
' se NewDGIndex = -1 vuol dire che erano tutte settate a Visible perciò devo calcolare l'indice
|
||||
' dell'ultima Column con quel ParentDataGridName e spostarlo lì
|
||||
If NewDGIndex = -1 Then
|
||||
Dim FirstIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName))
|
||||
Dim LastIndex = FirstIndex
|
||||
While LastIndex < Map.refConfigurationPageVM.DGColumnsList.Count AndAlso Map.refConfigurationPageVM.DGColumnsList(LastIndex).ParentDataGridName = ParentDataGridName
|
||||
LastIndex += 1
|
||||
End While
|
||||
NewDGIndex = LastIndex
|
||||
End If
|
||||
Map.refConfigurationPageVM.DGColumnsList.Move(OldDGIndex, NewDGIndex - 1)
|
||||
End If
|
||||
' aggiorno i DisplayIndex di ciascuna Column della ParentDataGridName in questione
|
||||
Dim index = 0
|
||||
For Each DGColumnItem In Map.refConfigurationPageVM.DGColumnsList
|
||||
If DGColumnItem.ParentDataGridName = ParentDataGridName Then
|
||||
DGColumnItem.DisplayIndex = index
|
||||
index += 1
|
||||
End If
|
||||
Next
|
||||
' uso il Move col medesimo valore per i 2 argomenti per refreshare i DisplayIndex delle Column
|
||||
' della ParentDataGridName in questione appena riordinate
|
||||
For index = 0 To Map.refConfigurationPageVM.DGColumnsList.Count - 1
|
||||
If Map.refConfigurationPageVM.DGColumnsList(index).ParentDataGridName = ParentDataGridName Then
|
||||
Map.refConfigurationPageVM.DGColumnsList.Move(index, index)
|
||||
End If
|
||||
Next
|
||||
' setto se il valore è stato modificato, a partire dalla verifica che il Nome e DisplayIndex combacino (altrimenti è per forza modificato)
|
||||
m_IsModifiedVisible = (m_Name <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.NAME)) OrElse
|
||||
(If(m_Visible, 1, 0) <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.VISIBLE))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserEditVisible As Boolean
|
||||
Public Property CanUserEditVisible As Boolean
|
||||
Get
|
||||
Return m_CanUserEditVisible
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserEditVisible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IsModified() As Boolean
|
||||
Get
|
||||
Return m_IsModifiedDisplayIndex OrElse
|
||||
m_IsModifiedIsReadOnly OrElse
|
||||
m_IsModifiedCanUserReorder OrElse
|
||||
m_IsModifiedCanUserResize OrElse
|
||||
m_IsModifiedCanUserSort OrElse
|
||||
m_IsModifiedVisible
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub IsModifiedReset()
|
||||
m_IsModifiedDisplayIndex = False
|
||||
m_IsModifiedIsReadOnly = False
|
||||
m_IsModifiedCanUserReorder = False
|
||||
m_IsModifiedCanUserResize = False
|
||||
m_IsModifiedCanUserSort = False
|
||||
m_IsModifiedVisible = False
|
||||
End Sub
|
||||
|
||||
Sub New(sName As String)
|
||||
m_Name = sName
|
||||
End Sub
|
||||
|
||||
Sub New(sParentDG As String, nDisplayIndex As Integer, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean)
|
||||
m_ParentDataGridName = sParentDG
|
||||
m_DisplayIndex = nDisplayIndex
|
||||
m_Name = sName
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
m_CanUserResize = bCanUserResize
|
||||
m_CanUserSort = bCanUserSort
|
||||
m_IsReadOnly = bIsReadOnly
|
||||
m_Width = Width
|
||||
m_Visible = bVisible
|
||||
m_CanUserEditVisible = bCanUserEditVisible
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ConfigVariable
|
||||
|
||||
Private m_sName As String
|
||||
@@ -712,67 +415,3 @@ End Class
|
||||
' LENGTH = 4
|
||||
' CHECKBOX = 5
|
||||
'End Enum
|
||||
|
||||
Public Module IniDataGridColumnFunctions
|
||||
|
||||
' funzione per ottenere dal file INI le colonne da caricare nella DataGrid usata per customizzare le proprietà delle colonne delle EgtDataGrid del programma
|
||||
Public Function GetPrivateProfileIniColumns(ParentDGName As String, ByRef ocColumns As ObservableCollection(Of IniDataGridColumn)) 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 >= 9 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)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
ocColumns.Add(New IniDataGridColumn(ParentDGName, colIndex, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible))
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
Return ocColumns.Count > 0
|
||||
End Function
|
||||
|
||||
' funzione che ottiene dal file INI la singola proprietà legata ad una specifica colonna
|
||||
Public Function GetPrivateProfileIniColumnProperty(ParentDGName As String, ocColumns As ObservableCollection(Of IniDataGridColumn), DisplayIndex As Integer, PropertyIndex As EgtDGColumnProperty) As String
|
||||
Dim str = String.Empty
|
||||
If EgtUILib.GetPrivateProfileString(ParentDGName, DisplayIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0 Then
|
||||
Dim sColumnParams() As String = str.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sColumnParams.Count >= 9 Then
|
||||
' cancello spazi
|
||||
For index = 0 To sColumnParams.Count - 1
|
||||
sColumnParams(index) = sColumnParams(index).Trim()
|
||||
Next
|
||||
If PropertyIndex > -1 AndAlso PropertyIndex < sColumnParams.Count Then Return sColumnParams(PropertyIndex)
|
||||
End If
|
||||
End If
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
Public Enum EgtDGColumnProperty
|
||||
NAME = 0
|
||||
REORDER = 1
|
||||
RESIZE = 2
|
||||
SORT = 3
|
||||
ISREADONLY = 4
|
||||
WIDTH = 5
|
||||
WIDTHTYPE = 6
|
||||
VISIBLE = 7
|
||||
EDITVISIBLE = 8
|
||||
End Enum
|
||||
|
||||
End Module
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
<DataGrid x:Class="DGColumnsListV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserSortColumns="False"
|
||||
CanUserResizeColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
Margin="0,0,0,5">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--Indice-->
|
||||
<!--<DataGridTextColumn Binding="{Binding DisplayIndex}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.DisplayIndex_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>-->
|
||||
<!--Nome colonna-->
|
||||
<DataGridTextColumn Binding="{Binding VisName}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.ColumnName_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--CanUserReorder-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserReorder, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserReorder_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--CanUserResize-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserResize, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserResize_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--CanUserSort-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserSort, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserSort_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--IsReadOnly-->
|
||||
<!--<DataGridCheckBoxColumn Binding="{Binding IsReadOnly, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.IsReadOnly_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>-->
|
||||
<!--Visible-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding Visible, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Visible_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataGridCheckBoxColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="IsEnabled" Value="{Binding CanUserEditVisible}" />
|
||||
</Style>
|
||||
</DataGridCheckBoxColumn.CellStyle>
|
||||
</DataGridCheckBoxColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class DGColumnsListV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,7 @@
|
||||
Module ConstMachMsg
|
||||
|
||||
Public Const MDI_MSG As String = "MDI"
|
||||
Public Const PLC_MSG As String = "PLC"
|
||||
Public Const CNC_MSG As String = "CNC"
|
||||
|
||||
End Module
|
||||
@@ -235,6 +235,7 @@
|
||||
<Compile Include="CALCPanel\CALCPanelVM.vb" />
|
||||
<Compile Include="Comms\NUMFlexiumComm.vb" />
|
||||
<Compile Include="Comms\TPAComm.vb" />
|
||||
<Compile Include="Constants\ConstMachMsg.vb" />
|
||||
<Compile Include="MDIPage\MDIPageV.xaml.vb">
|
||||
<DependentUpon>MDIPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -251,9 +252,6 @@
|
||||
<DependentUpon>ConfigurationPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ConfigurationPage\ConfigurationPageVM.vb" />
|
||||
<Compile Include="ConfigurationPage\DGColumnsListV.xaml.vb">
|
||||
<DependentUpon>DGColumnsListV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Constants\ConstCommVar.vb" />
|
||||
<Compile Include="ItemParamList\FeatureInPartInRawPartListV.xaml.vb">
|
||||
<DependentUpon>FeatureInPartInRawPartListV.xaml</DependentUpon>
|
||||
@@ -365,10 +363,6 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ConfigurationPage\DGColumnsListV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ItemParamList\FeatureInPartInRawPartListV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding FeatureInPartInRawPartColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding PartInRawPartColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
@@ -130,6 +130,10 @@ Public Class PartInRawPartListVM
|
||||
m_colPartInRawPart_Flip = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
|
||||
m_colPartInRawPart_PosX = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
|
||||
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
' nascondo colonna redo
|
||||
If Not IsNothing(colPartInRawPart_Redo) Then
|
||||
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
|
||||
@@ -143,6 +147,10 @@ Public Class PartInRawPartListVM
|
||||
If Not IsNothing(m_colPartInRawPart_Offset) Then
|
||||
m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Visible
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
If Not IsNothing(m_colPartInRawPart_Rot) Then
|
||||
m_colPartInRawPart_Rot.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
@@ -158,9 +166,6 @@ Public Class PartInRawPartListVM
|
||||
'PartInRawPartColumns.Clear()
|
||||
'GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns)
|
||||
ElseIf nMachType = MachineType.WALL Then
|
||||
If Not IsNothing(m_colPartInRawPart_Offset) Then
|
||||
m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
If Not IsNothing(m_colPartInRawPart_Rot) Then
|
||||
m_colPartInRawPart_Rot.ColumnVisibility = Visibility.Visible
|
||||
End If
|
||||
@@ -173,6 +178,13 @@ Public Class PartInRawPartListVM
|
||||
If Not IsNothing(m_colPartInRawPart_PosY) Then
|
||||
m_colPartInRawPart_PosY.ColumnVisibility = Visibility.Visible
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
If Not IsNothing(m_colPartInRawPart_Offset) Then
|
||||
m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
' PartInRawPartColumns.Clear()
|
||||
'GetPrivateProfileColumns(S_PARTINRAWPARTLIST_WALL, PartInRawPartColumns)
|
||||
End If
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding RawPartColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
@@ -97,7 +97,15 @@ Public Class RawPartListVM
|
||||
End If
|
||||
'RawPartColumns.Clear()
|
||||
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In RawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
ElseIf nMachType = MachineType.WALL Then
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In RawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
If Not IsNothing(m_colRawPart_StartCut) Then
|
||||
m_colRawPart_StartCut.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding GridDims[1].GridLen, Mode=TwoWay}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Header="Channel"
|
||||
<GroupBox Header="{Binding Channel_Msg}"
|
||||
Visibility="{Binding Channel_Visibility}">
|
||||
<ComboBox ItemsSource="{Binding ChannelList}"
|
||||
SelectedItem="{Binding SelChannel}"
|
||||
DisplayMemberPath="Name"/>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Grid.Row="1" Header="OPMode"
|
||||
<GroupBox Grid.Row="1" Header="{Binding OPMode_Msg}"
|
||||
Visibility="{Binding OPMode_Visibility}">
|
||||
<ComboBox ItemsSource="{Binding OPModeList}"
|
||||
SelectedItem="{Binding SelOPMode}"
|
||||
@@ -45,47 +45,45 @@
|
||||
<StackPanel Grid.Row="0"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button ToolTip="˄"
|
||||
Command="{Binding MoveUpRawPart_Command}"
|
||||
IsEnabled="{Binding MoveRawPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Button Command="{Binding MoveUpRawPart_Command}"
|
||||
IsEnabled="{Binding MoveRawPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/MoveUp.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="˅"
|
||||
Command="{Binding MoveDownRawPart_Command}"
|
||||
IsEnabled="{Binding MoveRawPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Button Command="{Binding MoveDownRawPart_Command}"
|
||||
IsEnabled="{Binding MoveRawPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/MoveDown.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="P"
|
||||
Command="{Binding ProduceAll_Command}"
|
||||
IsEnabled="{Binding LeftPanel_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Button ToolTip="{Binding ProduceAll_ToolTip}"
|
||||
Command="{Binding ProduceAll_Command}"
|
||||
IsEnabled="{Binding LeftPanel_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/ProduceAll.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="D"
|
||||
Command="{Binding DoneRawPart_Command}"
|
||||
IsEnabled="{Binding DoneRawPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Button ToolTip="{Binding DoneRawPart_ToolTip}"
|
||||
Command="{Binding DoneRawPart_Command}"
|
||||
IsEnabled="{Binding DoneRawPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/DoneRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="R"
|
||||
Command="{Binding ResetRawPart_Command}"
|
||||
IsEnabled="{Binding ResetRawPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Button ToolTip="{Binding ResetRawPart_ToolTip}"
|
||||
Command="{Binding ResetRawPart_Command}"
|
||||
IsEnabled="{Binding ResetRawPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/ResetRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="-"
|
||||
Command="{Binding DeleteRawPart_Command}"
|
||||
IsEnabled="{Binding DeleteRawPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Button ToolTip="{Binding DeleteRawPart_ToolTip}"
|
||||
Command="{Binding DeleteRawPart_Command}"
|
||||
IsEnabled="{Binding DeleteRawPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/DeleteRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<EgtBEAMWALL:RawPartListV Grid.Row="1"
|
||||
DataContext="{StaticResource RawPartListVM}"
|
||||
Tag="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"/>
|
||||
DataContext="{StaticResource RawPartListVM}"
|
||||
Tag="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"/>
|
||||
</Grid>
|
||||
|
||||
<GridSplitter Height="3" HorizontalAlignment="Stretch" Grid.Row="5" ResizeDirection="Rows" ResizeBehavior="PreviousAndNext"/>
|
||||
@@ -98,14 +96,14 @@
|
||||
<StackPanel Grid.Row="0"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button ToolTip="P"
|
||||
<Button ToolTip="{Binding PrintLabel_ToolTip}"
|
||||
Command="{Binding PrintLabel_Command}"
|
||||
IsEnabled="{Binding LeftPanel_IsEnabled}"
|
||||
Visibility="{Binding PrintLabel_Visibility}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/PrintLabel.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="D"
|
||||
<Button ToolTip="{Binding DonePart_ToolTip}"
|
||||
Command="{Binding DonePart_Command}"
|
||||
IsEnabled="{Binding LeftPanel_IsEnabled}"
|
||||
Visibility="{Binding DonePart_Visibility}"
|
||||
|
||||
@@ -98,6 +98,14 @@ Public Class LeftPanelVM
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetOPMode(value As OPState)
|
||||
' se MDI
|
||||
If value.Id = OPModes.Mdi Then
|
||||
' mostro pagina comandi MDI
|
||||
Map.refProjectVM.SetSelTabPage(ProjectVM.TabPages.MDI)
|
||||
Else
|
||||
' mostro scena
|
||||
Map.refProjectVM.SetSelTabPage(ProjectVM.TabPages.SCENE)
|
||||
End If
|
||||
m_SelOPMode = value
|
||||
NotifyPropertyChanged(NameOf(SelOPMode))
|
||||
End Sub
|
||||
@@ -147,7 +155,7 @@ Public Class LeftPanelVM
|
||||
|
||||
Public ReadOnly Property MoveRawPart_IsEnabled As Boolean
|
||||
Get
|
||||
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
If IsNothing(Map.refProjectVM) OrElse IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
Return False
|
||||
ElseIf m_SelOPState.Id <> OPStates.End AndAlso m_SelOPState.Id <> OPStates.Unspecified Then
|
||||
Return False
|
||||
@@ -164,7 +172,7 @@ Public Class LeftPanelVM
|
||||
|
||||
Public ReadOnly Property DoneRawPart_IsEnabled As Boolean
|
||||
Get
|
||||
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
If IsNothing(Map.refProjectVM) OrElse IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
Return False
|
||||
ElseIf m_SelOPState.Id <> OPStates.End AndAlso m_SelOPState.Id <> OPStates.Unspecified Then
|
||||
Return False
|
||||
@@ -172,7 +180,7 @@ Public Class LeftPanelVM
|
||||
Return False
|
||||
ElseIf Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim SelMachgroup As MyMachGroupVM = DirectCast(Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup, MyMachGroupVM)
|
||||
Return SelMachgroup.nProduction_State <= ItemState.Confirmed
|
||||
Return SelMachgroup.nProduction_State <= ItemState.WIP
|
||||
Else
|
||||
Return m_LeftPanel_IsEnabled
|
||||
End If
|
||||
@@ -181,7 +189,7 @@ Public Class LeftPanelVM
|
||||
|
||||
Public ReadOnly Property ResetRawPart_IsEnabled As Boolean
|
||||
Get
|
||||
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
If IsNothing(Map.refProjectVM) OrElse IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
Return False
|
||||
ElseIf m_SelOPState.Id <> OPStates.End AndAlso m_SelOPState.Id <> OPStates.Unspecified Then
|
||||
Return False
|
||||
@@ -198,7 +206,7 @@ Public Class LeftPanelVM
|
||||
|
||||
Public ReadOnly Property DeleteRawPart_IsEnabled As Boolean
|
||||
Get
|
||||
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
If IsNothing(Map.refProjectVM) OrElse IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
Return False
|
||||
ElseIf m_SelOPState.Id <> OPStates.End AndAlso m_SelOPState.Id <> OPStates.Unspecified Then
|
||||
Return False
|
||||
@@ -234,10 +242,63 @@ Public Class LeftPanelVM
|
||||
|
||||
Public ReadOnly Property DonePart_Visibility As Visibility
|
||||
Get
|
||||
' per test -> 'Return Visibility.Visible
|
||||
Return If(Not IsNothing(Map.refSupervisorManagerVM.CurrProd) AndAlso Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Channel_Msg As String
|
||||
Get
|
||||
Return EgtMsg(62501)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OPMode_Msg As String
|
||||
Get
|
||||
Return EgtMsg(62502)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProduceAll_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(62503)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DoneRawPart_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(62504)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ResetRawPart_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(62505)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DeleteRawPart_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(62506)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PrintLabel_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(62507)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DonePart_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(62508)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdDeleteRawPart As ICommand
|
||||
Private m_cmdMoveUpRawPart As ICommand
|
||||
@@ -392,8 +453,9 @@ Public Class LeftPanelVM
|
||||
''' </summary>
|
||||
Public Sub ProduceAll()
|
||||
If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
|
||||
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count = 0) Then Return
|
||||
If Not Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State <= 1) Then Return
|
||||
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList) OrElse Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count = 0 Then Return
|
||||
If Not Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State <= ItemState.Confirmed) Then Return
|
||||
If Not Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.dtStartTime = DateTime.MinValue) Then Return
|
||||
Dim ToDoList As List(Of MachGroupVM) = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Where(Function(x As MyMachGroupVM) x.nProduction_State <= 1 AndAlso Not x.bResetWhileCutting AndAlso x.dtStartTime = DateTime.MinValue AndAlso Not x.bToBeProduced).ToList()
|
||||
If Not IsNothing(ToDoList) AndAlso ToDoList.Count > 0 Then
|
||||
MyMachGroupVM.Produce(ToDoList)
|
||||
@@ -422,14 +484,21 @@ Public Class LeftPanelVM
|
||||
Public Sub DoneRawPart()
|
||||
If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
|
||||
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup) Then Return
|
||||
If (Not IsNothing(Map.refMachManaging) AndAlso Map.refMachManaging.bConnected AndAlso m_SelOPState.Id <> OPStates.End) OrElse
|
||||
Map.refSupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.bToBeProduced) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup
|
||||
If (Not IsNothing(Map.refMachManaging) AndAlso Map.refMachManaging.bConnected AndAlso m_SelOPState.Id <> OPStates.End) OrElse
|
||||
Map.refSupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) (x.bToBeProduced AndAlso x.Id <> SelMachGroup.Id) OrElse
|
||||
(x.nProduction_State = ItemState.WIP AndAlso x.Id <> SelMachGroup.Id) OrElse
|
||||
(x.dtStartTime <> DateTime.MinValue AndAlso x.dtEndTime = DateTime.MinValue AndAlso x.Id <> SelMachGroup.Id)) Then Return
|
||||
' scrivo tutti pezzi completati
|
||||
For PartIndex = 0 To SelMachGroup.PartVMList.Count - 1
|
||||
Dim Part As PartVM = SelMachGroup.PartVMList(PartIndex)
|
||||
SetDonePart(SelMachGroup, Part)
|
||||
Next
|
||||
' aggiorno bottoni
|
||||
NotifyPropertyChanged(NameOf(DeleteRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(MoveRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(ResetRawPart_IsEnabled))
|
||||
' se avanzamento singolo, sblocco produzione di tutti gli altri
|
||||
If CurrentMachine.Flow = FlowTypes.ONEBYONE Then
|
||||
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
||||
@@ -543,6 +612,11 @@ Public Class LeftPanelVM
|
||||
'SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Production_Background))
|
||||
'SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Produce_IsEnabled))
|
||||
|
||||
' aggiorno bottoni
|
||||
NotifyPropertyChanged(NameOf(DeleteRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(MoveRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(ResetRawPart_IsEnabled))
|
||||
' se avanzamento singolo, sblocco produzione di tutti gli altri
|
||||
If CurrentMachine.Flow = FlowTypes.ONEBYONE Then
|
||||
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
||||
@@ -727,6 +801,13 @@ Public Class LeftPanelVM
|
||||
MachGroup.nProduction_State = ItemState.Produced
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Production_Background))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Produce_IsEnabled))
|
||||
' reset delle variabili di invio alla macchina
|
||||
MachGroup.ResetProduce()
|
||||
' aggiorno bottoni
|
||||
NotifyPropertyChanged(NameOf(DeleteRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(MoveRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(ResetRawPart_IsEnabled))
|
||||
' se avanzamento singolo, sblocco produzione di tutti gli altri
|
||||
If CurrentMachine.Flow = FlowTypes.ONEBYONE Then
|
||||
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding MDICommandColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
@@ -112,7 +112,7 @@ Public Class MDIPageVM
|
||||
If MDICommand.Length() >= 2 Then
|
||||
Dim nDescription As Integer
|
||||
If Integer.TryParse(MDICommand(1), nDescription) Then
|
||||
MDICommand(1) = EgtMsg(nDescription)
|
||||
MDICommand(1) = MachMsg(MsgParagraphs.MDI, nDescription)
|
||||
End If
|
||||
MDICommandList.Add(New MDICommand(MDICommand(0), MDICommand(1)))
|
||||
End If
|
||||
|
||||
@@ -141,6 +141,8 @@ Public Class MachCommandMessagePanelVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Friend bMsgTranslationActive As Boolean = False
|
||||
|
||||
Private m_ErrCycle As New List(Of Alarm)
|
||||
Private m_ErrCycleCount As Integer = 0
|
||||
Public ReadOnly Property sErrCycle As String
|
||||
@@ -234,6 +236,7 @@ Public Class MachCommandMessagePanelVM
|
||||
Return If(CurrentMachine.NCType = NCTypes.TPA, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdConnect As ICommand
|
||||
Private m_cmdDisconnect As ICommand
|
||||
@@ -665,6 +668,13 @@ Public Class MachCommandMessagePanelVM
|
||||
NUM_ErrorTypes.PLC_Message_Reaction_Class_6,
|
||||
NUM_ErrorTypes.PLC_Message_Reaction_Class_7,
|
||||
NUM_ErrorTypes.PLC_Message_Reaction_Class_8
|
||||
Dim sErrorMessage As String = ErrorMessage
|
||||
If bMsgTranslationActive Then
|
||||
Dim sTranslatedMsg = MachMsg(MsgParagraphs.PLC, nErrorNumber)
|
||||
If Not String.IsNullOrWhiteSpace(sTranslatedMsg) Then
|
||||
sErrorMessage = sTranslatedMsg
|
||||
End If
|
||||
End If
|
||||
ErrorNumberMsg = "PLC"
|
||||
ErrorTypMsg = "Classe"
|
||||
AlarmMessage = If(nErrorIndex <> 0, ErrorIndexMsg & ": " & nErrorIndex & " - ", "") &
|
||||
@@ -672,7 +682,7 @@ Public Class MachCommandMessagePanelVM
|
||||
If(nErrorExtNumber <> 0, " - " & ErrorExtNumberMsg & ": " & nErrorExtNumber, "") &
|
||||
ErrorTypMsg & ": " & nErrorTyp - 5 &
|
||||
If(nErrorLine <> 0, " - " & ErrorLineMsg & ": " & nErrorLine, "") &
|
||||
" " & ErrorMessage & If(nErrorAdditional <> 0, " - " & ErrorAdditionalMsg & ": " & nErrorAdditional, "")
|
||||
" " & sErrorMessage & If(nErrorAdditional <> 0, " - " & ErrorAdditionalMsg & ": " & nErrorAdditional, "")
|
||||
Case NUM_ErrorTypes.HMI_Message
|
||||
Case NUM_ErrorTypes.RTS_Message
|
||||
Case NUM_ErrorTypes.Drive_Warning
|
||||
|
||||
@@ -88,7 +88,7 @@ Public Class MyMachGroupPanelVM
|
||||
' Imposto vista solo tavola
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
Map.refFeatureInPartInRawPartListVM.SetFeatureListVisibility(SelMachGroup.bResetWhileCutting)
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -106,6 +106,7 @@ Public Class MyMachGroupVM
|
||||
CurrMachGroup.NotifyPropertyChanged(NameOf(CurrMachGroup.Produce_IsEnabled))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' Machgroup
|
||||
|
||||
#Region "Parts"
|
||||
@@ -133,8 +134,13 @@ Public Class MyMachGroupVM
|
||||
Public Overrides Sub CALCEnd()
|
||||
' aggiorno stato per lancio in macchina
|
||||
If MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.OK OrElse MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.INFO Then
|
||||
m_bCNReCalculated = True
|
||||
NotifyPropertyChanged(NameOf(Production_Background))
|
||||
If m_bToBeProduced AndAlso Not m_bCNReCalculated Then
|
||||
m_bCNReCalculated = True
|
||||
NotifyPropertyChanged(NameOf(Production_Background))
|
||||
End If
|
||||
Else
|
||||
ResetProduce()
|
||||
UpdateProduceIsEnabledForAll()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -271,6 +277,11 @@ Public Class MyMachGroupVM
|
||||
For Each MachGroup As MyMachGroupVM In MachGroupList
|
||||
' cerco primo indice di pezzo non in produzione
|
||||
Dim NewIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) DirectCast(x, MyMachGroupVM).dtStartTime = DateTime.MinValue AndAlso DirectCast(x, MyMachGroupVM).bToBeProduced = False))
|
||||
' se pezzo da produrre gia' iniziato
|
||||
If MachGroup.dtStartTime <> DateTime.MinValue Then
|
||||
' decremento indice di 1
|
||||
NewIndex -= 1
|
||||
End If
|
||||
' segno pezzo da produrre
|
||||
MachGroup.m_bToBeProduced = True
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Production_Background))
|
||||
@@ -368,7 +379,7 @@ Public Class MyMachGroupVM
|
||||
BeamMachGroup.MyMachGroupM.RefreshGroupData()
|
||||
''' aggiorno dati utilizzo barra
|
||||
''BeamMachGroup.UpdateUsage()
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
Core.ViewPanelVM.BWSetView(VT.ISO_SW, False)
|
||||
' salvo nuovo grezzo nel progetto
|
||||
Map.refSupervisorManagerVM.Save()
|
||||
' segno pezzi non completati come scrap
|
||||
|
||||
@@ -458,7 +458,7 @@ Public Class MachManaging
|
||||
' azzero variabile per far ripartire macchina
|
||||
StateVariable.sValue = "0"
|
||||
End If
|
||||
' se pezzo = -1 devo dare end a tutti i pezzi del MachGroup
|
||||
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
|
||||
If nP_Part = -1 Then
|
||||
For Each Part In MachGroup.PartVMList
|
||||
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
|
||||
|
||||
@@ -175,6 +175,10 @@ Public Class MainMenuVM
|
||||
Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
'' apro progetto proj
|
||||
'If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
' If Map.refProjManagerVM.CurrProj.bReloadProject Then
|
||||
@@ -232,20 +236,11 @@ Public Class MainMenuVM
|
||||
|
||||
Private Function InitCONFIG() As Boolean
|
||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||
'' ricarico la lista delle colonne delle DataGrid in ConfigurationPage
|
||||
'If Not IsNothing(Map.refConfigurationPageVM) Then Map.refConfigurationPageVM.LoadConfigDGColumns()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function ExitCONFIG() As Boolean
|
||||
Map.refConfigurationPageVM.VerifyConfigPageModification()
|
||||
' ricarico le EgtDataGrid del programma con le colonne customizzate
|
||||
Map.refRawPartListVM.RawPartColumns.Clear()
|
||||
Map.refPartInRawPartListVM.PartInRawPartColumns.Clear()
|
||||
Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns.Clear()
|
||||
GetPrivateProfileColumns(S_RAWPARTLIST_SUPERVISOR, Map.refRawPartListVM.RawPartColumns)
|
||||
GetPrivateProfileColumns(S_PARTINRAWPARTLIST_SUPERVISOR, Map.refPartInRawPartListVM.PartInRawPartColumns)
|
||||
GetPrivateProfileColumns(S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR, Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ Public Class MainWindowM
|
||||
End Property
|
||||
|
||||
Private m_bPrinterLink As Boolean = False
|
||||
Friend ReadOnly Property bPrinterLink As String
|
||||
Friend ReadOnly Property bPrinterLink As Boolean
|
||||
Get
|
||||
Return m_bPrinterLink
|
||||
End Get
|
||||
@@ -229,8 +229,8 @@ Public Class MainWindowM
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2401, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2401, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2402, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2402, 1, m_nKeyOptions)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||
@@ -299,7 +299,7 @@ Public Class MainWindowM
|
||||
Private Sub ManageInstance()
|
||||
Dim bCreated As Boolean
|
||||
Try
|
||||
m_objMutex = New Mutex(False, "Global\OmagOFFICE", bCreated)
|
||||
m_objMutex = New Mutex(True, "Global\EgtBEAMWALL.Supervisor", bCreated)
|
||||
Catch
|
||||
bCreated = False
|
||||
End Try
|
||||
@@ -308,20 +308,36 @@ Public Class MainWindowM
|
||||
' Prima istanza
|
||||
m_nInstance = 1
|
||||
' Aggiorno stato istanze attive
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString())
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_SUPERVISOR_INSTANCES, m_nInstance.ToString())
|
||||
' Rilascio il possesso del mutex
|
||||
m_objMutex.ReleaseMutex()
|
||||
Else
|
||||
' Leggo il massimo numero di istanze ammesse
|
||||
Dim nMaxInst As Integer = GetMaxInstances()
|
||||
' Cerco il primo indice di istanza libero
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
m_nInstance = 1
|
||||
Dim nMask As Integer = 1
|
||||
While (nTmp And nMask) <> 0 And m_nInstance < MAX_INST
|
||||
m_nInstance += 1
|
||||
nMask *= 2
|
||||
End While
|
||||
' Se l'indice supera il massimo
|
||||
If m_nInstance > nMaxInst Then
|
||||
Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
|
||||
nMaxInst = 1 ' Max(1, Min(nMaxInst, MAX_INST))
|
||||
' Richiedo il possesso del mutex
|
||||
Dim bOk As Boolean = False
|
||||
If m_objMutex.WaitOne(500) Then
|
||||
' Cerco il primo indice di istanza libero
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_SUPERVISOR_INSTANCES, 0)
|
||||
m_nInstance = 1
|
||||
Dim nMask As Integer = 1
|
||||
While (nTmp And nMask) <> 0 And m_nInstance <= MAX_INST
|
||||
m_nInstance += 1
|
||||
nMask *= 2
|
||||
End While
|
||||
' Se nuova istanza nei limiti
|
||||
If m_nInstance <= nMaxInst Then
|
||||
bOk = True
|
||||
' Aggiorno stato istanze attive
|
||||
nTmp += (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_SUPERVISOR_INSTANCES, nTmp.ToString())
|
||||
End If
|
||||
' Rilascio il possesso del mutex
|
||||
m_objMutex.ReleaseMutex()
|
||||
End If
|
||||
' Se non è possibile continuare
|
||||
If Not bOk Then
|
||||
' porto in primo piano la prima istanza
|
||||
Dim bFound As Boolean = False
|
||||
' processi del programma a 32 bit
|
||||
@@ -329,7 +345,7 @@ Public Class MainWindowM
|
||||
For Each p As Process In localProc
|
||||
If p.Id <> Process.GetCurrentProcess().Id Then
|
||||
bFound = True
|
||||
ShowWindow(p.MainWindowHandle, 1)
|
||||
ShowWindow(p.MainWindowHandle, SW.SHOWMAXIMIZED)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
@@ -339,17 +355,14 @@ Public Class MainWindowM
|
||||
For Each p As Process In localProc
|
||||
If p.Id <> Process.GetCurrentProcess().Id Then
|
||||
bFound = True
|
||||
ShowWindow(p.MainWindowHandle, SW.RESTORE)
|
||||
ShowWindow(p.MainWindowHandle, SW.SHOWMAXIMIZED)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' esco dal programma
|
||||
End
|
||||
Environment.Exit(1)
|
||||
End If
|
||||
' Aggiorno stato istanze attive
|
||||
nTmp += (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -360,18 +373,20 @@ Public Class MainWindowM
|
||||
Friend Function GetMaxInstances() As Integer
|
||||
' Leggo il massimo numero di istanze ammesse
|
||||
Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
|
||||
Return Max(1, Min(nMaxInst, MAX_INST))
|
||||
Return 1 ' Max(1, Min(nMaxInst, MAX_INST))
|
||||
End Function
|
||||
|
||||
Friend Sub Close()
|
||||
' Terminazione generale di EgtInterface
|
||||
EgtExit()
|
||||
' Aggiorno istanze usate
|
||||
m_objMutex.WaitOne(1000)
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_SUPERVISOR_INSTANCES, 0)
|
||||
nTmp -= (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_SUPERVISOR_INSTANCES, nTmp.ToString())
|
||||
m_objMutex.ReleaseMutex()
|
||||
' Rilascio mutex
|
||||
If Not IsNothing(m_objMutex) Then m_objMutex.Close()
|
||||
' Aggiorno istanze usate
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
nTmp -= (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
@@ -192,12 +192,20 @@ Public Class MainWindowVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub CloseApplication()
|
||||
' se macchina sta funzionando
|
||||
If Not IsNothing(Map.refMachManaging) AndAlso Map.refMachManaging.bConnected AndAlso
|
||||
(Map.refLeftPanelVM.SelOPState.Id <> OPStates.End AndAlso Map.refLeftPanelVM.SelOPState.Id <> OPStates.Unspecified) Then
|
||||
MessageBox.Show("Impossible closing software while machine is working. If you want to close, first press reset and stop the machine!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
' disconnetto comunicazione con macchina
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.DISCONNECT))
|
||||
' termino thread di comunicazione con Db ed altri programmi
|
||||
ViewerOptimizerCommThread.StopThread()
|
||||
' Verifico modifica parametri in Configurazione e chiedo il salvataggio
|
||||
If Map.refMainMenuVM.SelPage = Pages.CONFIG Then Map.refConfigurationPageVM.VerifyConfigPageModification()
|
||||
' Termino il Model
|
||||
MainWindowM.Close()
|
||||
' Chiudo la finestra principale del programma
|
||||
Application.Current.MainWindow.Close()
|
||||
End Sub
|
||||
|
||||
@@ -55,5 +55,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.1.4")>
|
||||
<Assembly: AssemblyFileVersion("2.4.1.4")>
|
||||
<Assembly: AssemblyVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.2.1")>
|
||||
|
||||
@@ -11,6 +11,12 @@ Public Module CurrentMachine
|
||||
CONTINUOUS = 2
|
||||
End Enum
|
||||
|
||||
Enum MsgParagraphs As Integer
|
||||
MDI = 1
|
||||
PLC = 2
|
||||
CNC = 3
|
||||
End Enum
|
||||
|
||||
' Nome macchina corrente
|
||||
Private m_sMachineName As String = String.Empty
|
||||
' Direttorio macchina corrente
|
||||
@@ -21,6 +27,9 @@ Public Module CurrentMachine
|
||||
Private m_sMachParamIniFile As String = String.Empty
|
||||
' Cartella degli script
|
||||
Private m_sMachScriptDir As String = String.Empty
|
||||
' Ffile dei messaggi macchina
|
||||
Private m_sMachMessagesFile As String = String.Empty
|
||||
|
||||
' Tipo macchina
|
||||
Private m_nType As MachineType
|
||||
|
||||
@@ -101,6 +110,26 @@ Public Module CurrentMachine
|
||||
m_sMachDir = sMachinesRootDir & "\" & sMachineName
|
||||
' Impostazione path MachIni file
|
||||
m_sMachIniFile = sMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
|
||||
|
||||
' Leggo lingua corrente
|
||||
Dim sLanguage As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sLanguage)
|
||||
' Recupero nome file dei messaggi della lingua corrente
|
||||
Dim sMsgName As String = ".txt"
|
||||
Dim nIndex As Integer = 1
|
||||
While True
|
||||
Dim ReadLanguage As Language = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex, m_sMachIniFile)
|
||||
If IsNothing(ReadLanguage) Then Exit While
|
||||
If String.Compare(ReadLanguage.Name, sLanguage, True) = 0 Then
|
||||
sMsgName = ReadLanguage.FilePath
|
||||
Exit While
|
||||
End If
|
||||
nIndex += 1
|
||||
End While
|
||||
' Leggo file messaggi
|
||||
m_sMachMessagesFile = m_sMachDir & "\" & "Messages" & "\" & sMsgName
|
||||
' Leggo attivazione messaggi Cn/Plc
|
||||
Map.refMachCommandMessagePanelVM.bMsgTranslationActive = GetPrivateProfileInt(S_LANGUAGES, K_ENABLE, 0, m_sMachIniFile)
|
||||
' Impostazione tipo macchina
|
||||
m_nType = nMachineType
|
||||
' Impostazione path MachParamIni file
|
||||
@@ -203,6 +232,21 @@ Public Module CurrentMachine
|
||||
'End While
|
||||
End Sub
|
||||
|
||||
Public Function MachMsg(Paragraph As MsgParagraphs, nId As Integer) As String
|
||||
Dim sMsg As String = ""
|
||||
Dim sPar As String = ""
|
||||
Select Case Paragraph
|
||||
Case MsgParagraphs.MDI
|
||||
sPar = MDI_MSG
|
||||
Case MsgParagraphs.PLC
|
||||
sPar = PLC_MSG
|
||||
Case MsgParagraphs.CNC
|
||||
sPar = CNC_MSG
|
||||
End Select
|
||||
EgtGetStringUtf8FromIni(sPar, nId, nId, sMsg, m_sMachMessagesFile)
|
||||
Return sMsg
|
||||
End Function
|
||||
|
||||
#End Region 'Methods
|
||||
|
||||
End Module
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="1"/>
|
||||
<Setter Property="Margin" Value="1"/>
|
||||
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
@@ -204,6 +205,7 @@
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="1"/>
|
||||
<Setter Property="Margin" Value="1"/>
|
||||
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
|
||||
@@ -29,9 +29,15 @@ Public Class ViewerOptimizerComm
|
||||
Case Core.StatusMapOpType.MachGroupAdd
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.Add(MachGroupModification.ItemId, {MachGroupModification.Index, MachGroupModification.Index})
|
||||
Case Core.StatusMapOpType.MachGroupMod
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList(MachGroupModification.ItemId)(0) = MachGroupModification.Index
|
||||
If Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.ContainsKey(MachGroupModification.ItemId) Then
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList(MachGroupModification.ItemId)(0) = MachGroupModification.Index
|
||||
Else
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.Add(MachGroupModification.ItemId, {MachGroupModification.Index, 0})
|
||||
End If
|
||||
Case Core.StatusMapOpType.MachGroupRem
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.Remove(MachGroupModification.ItemId)
|
||||
If Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.ContainsKey(MachGroupModification.ItemId) Then
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.Remove(MachGroupModification.ItemId)
|
||||
End If
|
||||
Case Core.StatusMapOpType.MachGroupAssignedToSupervisor
|
||||
Dim MachgroupIndexes As Integer() = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList(MachGroupModification.ItemId)
|
||||
' se indice di aggiornamento file diverso da indice ultima modifica
|
||||
@@ -42,18 +48,20 @@ Public Class ViewerOptimizerComm
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.ReloadProjectFile()
|
||||
Else
|
||||
Dim ProdMachGroup As MyMachGroupVM = Map.refProjectVM.ProdMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroupModification.ItemId)
|
||||
ProdMachGroup.dtStartTime = DateTime.MinValue
|
||||
ProdMachGroup.dtEndTime = DateTime.MinValue
|
||||
ProdMachGroup.MyMachGroupM.SetProductionState(Core.ItemState.Assigned)
|
||||
Dim DBMachGroup As MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refSupervisorManagerVM.CurrProd.nProdId, ProdMachGroup.Id)
|
||||
ProdMachGroup.SetProductionIndex(DBMachGroup.ProdIndex)
|
||||
For Each Part In ProdMachGroup.PartVMList
|
||||
Part.dtStartTime = DateTime.MinValue
|
||||
Part.dtEndTime = DateTime.MinValue
|
||||
Part.nProduction_State = Core.ItemState.Assigned
|
||||
Next
|
||||
' lo aggiungo alla lista di MachGroup
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.AddMachGroupToSupervisor(ProdMachGroup)
|
||||
If Not IsNothing(ProdMachGroup) Then
|
||||
ProdMachGroup.dtStartTime = DateTime.MinValue
|
||||
ProdMachGroup.dtEndTime = DateTime.MinValue
|
||||
ProdMachGroup.MyMachGroupM.SetProductionState(Core.ItemState.Assigned)
|
||||
Dim DBMachGroup As MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refSupervisorManagerVM.CurrProd.nProdId, ProdMachGroup.Id)
|
||||
If Not IsNothing(DBMachGroup) Then ProdMachGroup.SetProductionIndex(DBMachGroup.ProdIndex)
|
||||
For Each Part In ProdMachGroup.PartVMList
|
||||
Part.dtStartTime = DateTime.MinValue
|
||||
Part.dtEndTime = DateTime.MinValue
|
||||
Part.nProduction_State = Core.ItemState.Assigned
|
||||
Next
|
||||
' lo aggiungo alla lista di MachGroup
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.AddMachGroupToSupervisor(ProdMachGroup)
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
ElseIf MachGroupModification.ItemType = Core.StatusMapItemType.Comm AndAlso MachGroupModification.Operation = Core.StatusMapOpType.ViewOptimStoped Then
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,89 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgtBEAMWALL.SupportRequest
|
||||
{
|
||||
public class SupportRequest
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string CodApp { get; set; } = "";
|
||||
public string CodImp { get; set; } = "";
|
||||
public string CodInst { get; set; } = "";
|
||||
public string ContactEmail { get; set; } = "";
|
||||
public string ContactName { get; set; } = "";
|
||||
public string ContactPhone { get; set; } = "";
|
||||
public int idxSubLic { get; set; } = 0;
|
||||
|
||||
public TipologiaTicket Tipo { get; set; } = TipologiaTicket.ND;
|
||||
|
||||
public bool IsValid
|
||||
{
|
||||
get => !string.IsNullOrEmpty(MasterKey) && !string.IsNullOrEmpty(ContactEmail) && !string.IsNullOrEmpty(CodInst) && !string.IsNullOrEmpty(CodApp);
|
||||
}
|
||||
|
||||
public string MasterKey { get; set; } = "";
|
||||
public string ReqBody { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Istanzia un nuovo ogetto richeista supporto
|
||||
/// </summary>
|
||||
/// <param name="codApp">Codice Applicazione (es EBW-UP)</param>
|
||||
/// <param name="codImp">Codice Impegno (es codice chiave HW)</param>
|
||||
/// <param name="codInst">Codice Cliente/Installazione</param>
|
||||
/// <param name="contactEmail">Email x contatto</param>
|
||||
/// <param name="contactName">Nome del richiedente/clietne</param>
|
||||
/// <param name="contactPhone">Tel richeidente/cliente</param>
|
||||
/// <param name="masterKey">Chiave master di comunicazione da LiMan</param>
|
||||
/// <param name="ReqBody">Testo delal richiesta</param>
|
||||
/// <param name="idxSubLic">Idx univoco di sublic (es x gestione utenti)</param>
|
||||
/// <param name="tipo">tipo ticket da gestire (default fileUpload)</param>
|
||||
public SupportRequest(string codApp, string codImp, string codInst, string contactEmail, string contactName, string contactPhone, string masterKey, string ReqBody, int idxSubLic = 0, TipologiaTicket tipo = TipologiaTicket.FileUpload)
|
||||
{
|
||||
this.CodApp = CodApp;
|
||||
this.CodImp = CodImp;
|
||||
this.CodInst = CodInst;
|
||||
this.ContactEmail = contactEmail;
|
||||
this.ContactName = contactName;
|
||||
this.ContactPhone = contactPhone;
|
||||
this.MasterKey = masterKey;
|
||||
this.ReqBody = ReqBody;
|
||||
this.idxSubLic = idxSubLic;
|
||||
this.Tipo = tipo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio su file di un oggetto richiesta file upload
|
||||
/// </summary>
|
||||
/// <param name="currReq">Oggetto richiesta (già istanziato)</param>
|
||||
/// <param name="filePath">Path dove salvare il file</param>
|
||||
public static bool SaveRequest(SupportRequest currReq, string filePath)
|
||||
{
|
||||
bool fatto = false;
|
||||
try
|
||||
{
|
||||
string rawData = JsonConvert.SerializeObject(currReq, Formatting.Indented);
|
||||
File.WriteAllText(filePath, rawData);
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Write(ex.ToString());
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public enum TipologiaTicket : int {
|
||||
ND = 0,
|
||||
FileUpload = 2
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="5"
|
||||
BindingColumns="{Binding SectXMatColumns}">
|
||||
<DataGrid.Resources>
|
||||
|
||||
@@ -247,6 +247,10 @@ Public Class AddSectionXMaterialWndVM
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_SECTXMATLIST_WALL, SectXMatColumns)
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In SectXMatColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' LoadColumns
|
||||
|
||||
@@ -221,7 +221,10 @@ Public Class BTLFeatureVM
|
||||
|
||||
Sub New(BTLFeatureM As BTLFeatureM)
|
||||
m_BTLFeatureM = BTLFeatureM
|
||||
AddHandler m_BTLFeatureM.QBTLParamAdded, AddressOf OnQBTLParamAdded
|
||||
m_BTLPartM = Nothing
|
||||
Dim Part As PartM = BTLFeatureM.ParentPart
|
||||
If Part.nType = BWType.WALL Then CreateQBTLParamVMList()
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
|
||||
@@ -303,21 +303,24 @@ Public Class BTLParamVM
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End If
|
||||
' se Q
|
||||
' se Q
|
||||
Else
|
||||
For Ind = 0 To vParQ.Length() - 1
|
||||
If vParQ(Ind).StartsWith( m_BTLParamM.sName) Then
|
||||
vParQ(Ind) = m_BTLParamM.sName & ":" & DoubleToString( dNewValue, 3)
|
||||
If vParQ(Ind).StartsWith(m_BTLParamM.sName) Then
|
||||
vParQ(Ind) = m_BTLParamM.sName & ":" & DoubleToString(dNewValue, 3)
|
||||
End If
|
||||
Next
|
||||
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
|
||||
m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
|
||||
If bOK Then
|
||||
' se sono in ottimizzazione
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
' setto nel progetto il fatto che il parametro attuale è custom o meno
|
||||
EgtSetInfo(m_BTLFeatureM.nFeatureId, m_BTLParamM.sName & "A", If(bCustom, "1", ""))
|
||||
NotifyPropertyChanged(NameOf(bCustom))
|
||||
End If
|
||||
m_BTLParamM.bCustom = True
|
||||
' setto nel progetto il fatto che il parametro attuale è custom o meno
|
||||
EgtSetInfo(m_BTLFeatureM.nFeatureId, m_BTLParamM.sName & "A", If(bCustom, "1", ""))
|
||||
NotifyPropertyChanged(NameOf(bCustom))
|
||||
m_BTLParamM.dValue = dNewValue
|
||||
' modifica provvisoria per mancanza aggiornamento su freecontour
|
||||
If m_BTLFeatureM.IsFreeContour Then
|
||||
|
||||
@@ -66,6 +66,26 @@ Public Class BTLPartVM
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse
|
||||
Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
If dBtlW <> m_BTLPartM.dBtlW OrElse dBtlH <> m_BTLPartM.dBtlH OrElse dBtlL <> m_BTLPartM.dBtlL Then
|
||||
' se pezzo gia' in produzione
|
||||
Dim DuploList As New List(Of Integer)
|
||||
EgtDuploList(m_BTLPartM.nPartId, DuploList)
|
||||
Dim bDuploInProduction As Boolean = False
|
||||
For Each DuploId In DuploList
|
||||
Dim nSwapItem As Integer = GDB_ID.NULL
|
||||
If EgtGetInfo(DuploId, "!LST", nSwapItem) AndAlso nSwapItem > 0 Then
|
||||
Dim nMachgroupId As Integer = EgtGetParent(EgtGetParent(EgtGetParent(nSwapItem)))
|
||||
Dim MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refProjManagerVM.CurrProj.nProdId, nMachgroupId)
|
||||
If MachGroupModel.State > ItemState.ND Then
|
||||
bDuploInProduction = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If bDuploInProduction Then
|
||||
MessageBox.Show("Impossible change dimension because already in production!", "", MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
Return False
|
||||
End If
|
||||
' lo impedisco
|
||||
' avviso che tutti i pezzi verranno tolti dai grezzi e chiedo di confermare
|
||||
If MessageBox.Show(String.Format(EgtMsg(61851), nDuploCount), EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
|
||||
MyMachGroupPanelM.DuploSetToDelete(m_BTLPartM.nPartId)
|
||||
@@ -111,7 +131,7 @@ Public Class BTLPartVM
|
||||
Public Property sL As String
|
||||
Get
|
||||
Dim nOrigGroupId As Integer = nPartId
|
||||
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
||||
End If
|
||||
Dim frBeam As New Frame3d
|
||||
@@ -169,7 +189,7 @@ Public Class BTLPartVM
|
||||
Public Property sW As String
|
||||
Get
|
||||
Dim nOrigGroupId As Integer = nPartId
|
||||
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
||||
End If
|
||||
Dim frBeam As New Frame3d
|
||||
@@ -227,7 +247,7 @@ Public Class BTLPartVM
|
||||
Public Property sH As String
|
||||
Get
|
||||
Dim nOrigGroupId As Integer = nPartId
|
||||
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
||||
End If
|
||||
Dim frBeam As New Frame3d
|
||||
@@ -1257,6 +1277,12 @@ Public Class BTLPartVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nFeaturesGlobalState As CalcStates
|
||||
Get
|
||||
Return m_BTLPartM.nFeaturesGlobalState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nState As CalcStates
|
||||
Get
|
||||
Return m_BTLPartM.nState
|
||||
@@ -1487,6 +1513,7 @@ Public Class BTLPartVM
|
||||
Private m_cmdInvert As ICommand
|
||||
Private m_cmdBackRotation As ICommand
|
||||
Private m_cmdForwardRotation As ICommand
|
||||
Private m_cmdXRotation As ICommand
|
||||
Private m_cmdPartColour As ICommand
|
||||
Private m_cmdDeletePart As ICommand
|
||||
|
||||
@@ -1558,7 +1585,7 @@ Public Class BTLPartVM
|
||||
For Each BTLParamVM As BTLParamVM In BTLFeatureVM.QBTLParamVMList
|
||||
AddHandler BTLParamVM.PropertyChanged, AddressOf OnBTLQParamVMPropertyChanged
|
||||
Next
|
||||
AddHandler BTLFeatureVM.PBTLParamVMList.CollectionChanged, AddressOf OnBTLQParamVMListChanged
|
||||
AddHandler BTLFeatureVM.QBTLParamVMList.CollectionChanged, AddressOf OnBTLQParamVMListChanged
|
||||
Next
|
||||
|
||||
m_BTLFeatureVMList = New ObservableCollection(Of BTLFeatureVM)(all)
|
||||
@@ -1652,6 +1679,7 @@ Public Class BTLPartVM
|
||||
Friend Sub CalcGlobalUpdate(Optional bFeatureFirst As Boolean = False)
|
||||
m_BTLPartM.nCALC_GlobalERR = nCALC_ERR
|
||||
m_BTLPartM.nGlobalState = nState
|
||||
m_BTLPartM.nFeaturesGlobalState = CalcStates.NOTCALCULATED
|
||||
If nState > CalcStates.NOTCALCULATED Then
|
||||
For Each Feature In BTLFeatureVMList
|
||||
If Not Feature.bDO And Not bFeatureFirst Then Continue For
|
||||
@@ -1670,6 +1698,9 @@ Public Class BTLPartVM
|
||||
m_BTLPartM.nGlobalState = Feature.nState
|
||||
m_BTLPartM.nCALC_GlobalERR = Feature.nCALC_ERR
|
||||
End If
|
||||
If Feature.nState > m_BTLPartM.nFeaturesGlobalState Then
|
||||
m_BTLPartM.nFeaturesGlobalState = Feature.nState
|
||||
End If
|
||||
If Feature.nCALC_ROT <> 0 Then
|
||||
m_BTLPartM.m_nCALC_ROT = Feature.nCALC_ROT
|
||||
End If
|
||||
@@ -1934,6 +1965,47 @@ Public Class BTLPartVM
|
||||
|
||||
#End Region ' ForwardRotation
|
||||
|
||||
' Comando inutilizzato ma conservato per eventuale rotazione a causa di importazione con rotazione sbagliata
|
||||
#Region "XRotation"
|
||||
|
||||
Public ReadOnly Property XRotation_Command As ICommand
|
||||
Get
|
||||
If m_cmdXRotation Is Nothing Then
|
||||
m_cmdXRotation = New Command(AddressOf XRotation)
|
||||
End If
|
||||
Return m_cmdXRotation
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub XRotation()
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE <> MachineType.WALL Then Return
|
||||
Dim OldSection As SectionXMaterial = Section
|
||||
' recupero il box del pezzo
|
||||
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||
Dim b3Solid As New BBox3d
|
||||
EgtGetBBoxGlob(nLs, GDB_BB.STANDARD, b3Solid)
|
||||
If b3Solid.IsEmpty() Then
|
||||
EgtOutLog("ERROR: Box non definito per la trave " & sNAM)
|
||||
Return
|
||||
End If
|
||||
Dim vtAxes As Vector3d = Vector3d.X_AX
|
||||
' eseguo rotazione di 90 gradi
|
||||
If EgtRotate(nPartId, b3Solid.Center, vtAxes, 90, GDB_RT.GLOB) Then
|
||||
' imposto modificato per copie
|
||||
EgtDuploSetModified(nPartId)
|
||||
End If
|
||||
' aggiorno visualizzazione dimensioni
|
||||
NotifyPropertyChanged(NameOf(sW))
|
||||
NotifyPropertyChanged(NameOf(sH))
|
||||
NotifyPropertyChanged(NameOf(sL))
|
||||
' setto part e tutte le feature da ricalcolare
|
||||
ResetCalcTotalPart()
|
||||
' aggiorno sezioni
|
||||
Map.refProjectVM.BTLStructureVM.UpdateSection(Section, OldSection)
|
||||
End Sub
|
||||
|
||||
#End Region ' XRotation
|
||||
|
||||
#Region "PartColour"
|
||||
|
||||
Public ReadOnly Property PartColour_Command As ICommand
|
||||
|
||||
@@ -67,14 +67,14 @@ Public Class BTLStructureVM
|
||||
If Not IsNothing(m_SelBTLPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing
|
||||
' aggiorno stato selezionato tutto
|
||||
Map.refShowBeamPanelVM.bShowAll = False
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
' resetto gruppo di lavorazione corrente
|
||||
EgtResetCurrMachGroup()
|
||||
' seleziono pezzo nella scena
|
||||
SceneSelPartSelection()
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
End If
|
||||
@@ -577,6 +577,9 @@ Public Class BTLStructureVM
|
||||
m_Calc_PartEnd.Interval = TimeSpan.FromMilliseconds(500)
|
||||
AddHandler m_Calc_PartEnd.Tick, AddressOf Calc_PartEnd_Tick
|
||||
m_Calc_PartEnd.Start()
|
||||
If BTLStructureM.nAsseBaseId = GDB_ID.NULL Then
|
||||
Map.refShowBeamPanelVM.SetShowBuilding(False)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -729,20 +732,12 @@ Public Class BTLStructureVM
|
||||
DisableMgr.ReEnable()
|
||||
Return
|
||||
End If
|
||||
' recupero il gruppo di assemblaggio
|
||||
Dim AsseBaseId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
While AsseBaseId <> GDB_ID.NULL
|
||||
Dim nProj As Integer = 0
|
||||
EgtGetInfo(AsseBaseId, BTL_PRT_PROJ, nProj)
|
||||
If nProj = Map.refProjManagerVM.CurrProj.nProjId Then Exit While
|
||||
AsseBaseId = EgtGetNextName(AsseBaseId, ASSEBASE)
|
||||
End While
|
||||
If AsseBaseId = GDB_ID.NULL Then
|
||||
If Map.refProjectVM.BTLStructureVM.BTLStructureM.nAsseBaseId = GDB_ID.NULL Then
|
||||
DisableMgr.ReEnable()
|
||||
Return
|
||||
End If
|
||||
' recupero il primo oggetto nel gruppo e verifico se devo assemblare o disassemblare
|
||||
Dim AsseId As Integer = EgtGetFirstInGroup(AsseBaseId)
|
||||
Dim AsseId As Integer = EgtGetFirstInGroup(Map.refProjectVM.BTLStructureVM.BTLStructureM.nAsseBaseId)
|
||||
If AsseId = GDB_ID.NULL Then
|
||||
DisableMgr.ReEnable()
|
||||
Return
|
||||
@@ -915,9 +910,9 @@ Public Class BTLStructureVM
|
||||
|
||||
Friend Sub UpdateSection(NewPartSection As SectionXMaterial, OldPartSection As SectionXMaterial)
|
||||
If IsNothing(BTLPartVMList) Then Return
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
|
||||
' verifico se era unico con vecchia sezione
|
||||
If Not m_BTLPartVMList.Any(Function(x) x.Section = OldPartSection) Then
|
||||
'If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
|
||||
' verifico se era unico con vecchia sezione
|
||||
If Not m_BTLPartVMList.Any(Function(x) x.Section = OldPartSection) Then
|
||||
' nel caso seleziono filtro generico
|
||||
SelSection = m_SectionList(0)
|
||||
' e poi lo cerco ed elimino
|
||||
@@ -928,9 +923,9 @@ Public Class BTLStructureVM
|
||||
If Not m_SectionList.Any(Function(x) x = NewPartSection) Then
|
||||
m_SectionList.Add(NewPartSection)
|
||||
End If
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
' se ruoto o inverto parete, la sezione non cambia
|
||||
End If
|
||||
'ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
' ' se ruoto o inverto parete, la sezione non cambia
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna totale tempi a fine calcolo
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding BeamMachiningsColumns}">
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Public Class BeamMachiningsWindowV
|
||||
|
||||
Private WithEvents m_BeamMachiningsWindowVM As BeamMachiningsWindowVM
|
||||
Private WithEvents m_BeamMachiningsWindowVM As MyBeamMachiningsWindowVM
|
||||
|
||||
Sub New(Owner As Window, BeamMachiningsWindowVM As BeamMachiningsWindowVM)
|
||||
Sub New(Owner As Window, BeamMachiningsWindowVM As MyBeamMachiningsWindowVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
|
||||
@@ -1,548 +0,0 @@
|
||||
Imports System.IO
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BeamMachiningsWindowVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private Const MACH_CUT As String = "Cut"
|
||||
Private Const MACH_DRILL As String = "Drill"
|
||||
Private Const MACH_MILLING As String = "Milling"
|
||||
Private Const MACH_POCKETING As String = "Pocketing"
|
||||
Private Const MACH_SAWING As String = "Sawing"
|
||||
Private Const ONCONST As String = "On"
|
||||
Private Const NAME As String = "Name"
|
||||
Private Const TYPE As String = "Type"
|
||||
Private Const DATETIME As String = "%DATE_TIME%"
|
||||
Private Const TABLENAME As String = "%TABLE_NAME%"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_BeamMachiningsColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property BeamMachiningsColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return m_BeamMachiningsColumns
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
m_BeamMachiningsColumns = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MachiningList As New ObservableCollection(Of String)({MACH_CUT, MACH_DRILL, MACH_MILLING, MACH_POCKETING, MACH_SAWING})
|
||||
Public ReadOnly Property MachiningList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_MachiningList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelMachining As String
|
||||
Public Property SelMachining As String
|
||||
Get
|
||||
Return m_SelMachining
|
||||
End Get
|
||||
Set(value As String)
|
||||
' verifico se pagina precedente modificata
|
||||
Dim TableModified As Boolean = False
|
||||
For Each Line In m_TableRowList
|
||||
If Line.IsModified Then
|
||||
TableModified = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' se modificata, chiedo se salvare
|
||||
If TableModified Then
|
||||
' Salvare le modifiche apportate? - Salva
|
||||
Select Case MessageBox.Show(EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNo, MessageBoxImage.Question)
|
||||
Case MessageBoxResult.Yes
|
||||
Save()
|
||||
Case MessageBoxResult.No
|
||||
' non devo fare nulla
|
||||
End Select
|
||||
End If
|
||||
m_SelMachining = value
|
||||
LoadMachiningList()
|
||||
LoadTypeList()
|
||||
ReadTableFile()
|
||||
NotifyPropertyChanged("SelMachining")
|
||||
End Set
|
||||
End Property
|
||||
Private Sub SetSelMachining(value As String)
|
||||
m_SelMachining = value
|
||||
LoadMachiningList()
|
||||
LoadTypeList()
|
||||
ReadTableFile()
|
||||
NotifyPropertyChanged("SelMachining")
|
||||
End Sub
|
||||
|
||||
Private m_TableRowList As ObservableCollection(Of GridLine)
|
||||
Public Property TableRowList As ObservableCollection(Of GridLine)
|
||||
Get
|
||||
Return m_TableRowList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of GridLine))
|
||||
m_TableRowList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelRowIndex As Integer = -1
|
||||
Public Property SelRowIndex As Integer
|
||||
Get
|
||||
Return m_SelRowIndex
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_SelRowIndex = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sTitle As String
|
||||
Private m_BaseDir As String
|
||||
Private m_MachTypeFilePath As String
|
||||
Private m_TableTemplateFilePath As String
|
||||
Private m_IsBeam As Boolean = True
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Title As String
|
||||
Get
|
||||
Return m_sTitle
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OnHdr As String
|
||||
Get
|
||||
Return EgtMsg( 9001) 'On
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property NameHdr As String
|
||||
Get
|
||||
Return EgtMsg( 9002) 'Nome
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property TypeHdr As String
|
||||
Get
|
||||
Return EgtMsg( 9003) 'Tipo
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AddRowMsg As String
|
||||
Get
|
||||
Return EgtMsg( 9004) 'Aggiungi
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DeleteRowMsg As String
|
||||
Get
|
||||
Return EgtMsg( 9005) 'Elimina
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SaveMsg As String
|
||||
Get
|
||||
Return EgtMsg( 9006) 'Salva
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdMoveRowUp As ICommand
|
||||
Private m_cmdMoveRowDown As ICommand
|
||||
Private m_cmdAddRow As ICommand
|
||||
Private m_cmdDeleteRow As ICommand
|
||||
Private m_cmdSave As ICommand
|
||||
Private m_cmdClose As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(sTitle As String, sBaseDir As String, sMachTypePath As String, sTabTemplPath As String, Optional bIsBeam As Boolean = True)
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_BEAMMACHININGS, BeamMachiningsColumns)
|
||||
' Titolo del dialogo
|
||||
m_sTitle = sTitle
|
||||
' Imposto direttorio base e nomi dei file
|
||||
m_BaseDir = sBaseDir
|
||||
m_MachTypeFilePath = sMachTypePath
|
||||
m_TableTemplateFilePath = sTabTemplPath
|
||||
' Imposto se per travi o pareti
|
||||
m_IsBeam = bIsBeam
|
||||
' Seleziono la prima lavorazione
|
||||
If m_MachiningList.Count > 0 Then
|
||||
SetSelMachining(m_MachiningList(0))
|
||||
End If
|
||||
NotifyPropertyChanged("MachiningList")
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Function LoadMachiningList() As Boolean
|
||||
Dim MachiningList As New List(Of String)
|
||||
Select Case SelMachining
|
||||
Case MACH_CUT
|
||||
If m_IsBeam Then
|
||||
LoadMachiningListByType(MachiningList, MCH_MY.MILLING, MCH_TF.SAWBLADE)
|
||||
Else
|
||||
LoadMachiningListByType(MachiningList, MCH_MY.SAWING, 0)
|
||||
End If
|
||||
Case MACH_DRILL
|
||||
LoadMachiningListByType(MachiningList, MCH_MY.DRILLING, 0)
|
||||
LoadMachiningListByType(MachiningList, MCH_MY.POCKETING, 0, False)
|
||||
LoadMachiningListByType(MachiningList, MCH_MY.MILLING, MCH_TF.MILL, False)
|
||||
Case MACH_MILLING
|
||||
LoadMachiningListByType(MachiningList, MCH_MY.MILLING, MCH_TF.MILL)
|
||||
Case MACH_POCKETING
|
||||
LoadMachiningListByType(MachiningList, MCH_MY.POCKETING, 0)
|
||||
Case MACH_SAWING
|
||||
LoadMachiningListByType(MachiningList, MCH_MY.MORTISING, 0)
|
||||
End Select
|
||||
GridLine.SetNamesList(New ObservableCollection(Of String)(MachiningList))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function LoadTypeList() As Boolean
|
||||
Dim TypeList As New List(Of String)
|
||||
Dim Index As Integer = 1
|
||||
Dim Type As String = ""
|
||||
While EgtUILib.GetPrivateProfileString( SelMachining, Index.ToString, "", Type, m_MachTypeFilePath) > 0
|
||||
TypeList.Add(Type)
|
||||
Index += 1
|
||||
End While
|
||||
GridLine.SetTypeList( New ObservableCollection(Of String)( TypeList))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function ReadTableFile() As Boolean
|
||||
' svuoto la lista
|
||||
m_TableRowList = New ObservableCollection(Of GridLine)
|
||||
Dim FilePath As String = m_BaseDir & "\" & SelMachining & "Data.lua"
|
||||
If Not File.Exists(FilePath) Then Return False
|
||||
Dim FileContent As String() = File.ReadAllLines(FilePath)
|
||||
Dim FoundTableName As Boolean = False
|
||||
For LineIndex As Integer = 0 To FileContent.Count - 1
|
||||
If FileContent(LineIndex).Contains(SelMachining & "Data") Then
|
||||
FoundTableName = True
|
||||
End If
|
||||
Dim Open As Integer = CountCharacter(FileContent(LineIndex), "{"c)
|
||||
Dim Close As Integer = CountCharacter(FileContent(LineIndex), "}"c)
|
||||
If Close > Open Then
|
||||
If FoundTableName Then
|
||||
FoundTableName = False
|
||||
End If
|
||||
End If
|
||||
If FoundTableName Then
|
||||
Dim sOn As String = SearchKey(FileContent(LineIndex), ONCONST)
|
||||
Dim sName As String = SearchKey(FileContent(LineIndex), NAME)
|
||||
Dim sType As String = SearchKey(FileContent(LineIndex), TYPE)
|
||||
If Not String.IsNullOrWhiteSpace(sOn) AndAlso Not String.IsNullOrWhiteSpace(sName) AndAlso Not String.IsNullOrWhiteSpace(sType) Then
|
||||
If String.Compare(sOn, "true", True) = 0 Then
|
||||
TableRowList.Add(New GridLine(True, sName, sType))
|
||||
ElseIf String.Compare(sOn, "false", True) = 0 Then
|
||||
TableRowList.Add(New GridLine(False, sName, sType))
|
||||
Else
|
||||
Continue For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged("TableRowList")
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function WriteTableFile() As Boolean
|
||||
' inizio routine di scrittura
|
||||
Dim FileContent As String() = File.ReadAllLines(m_TableTemplateFilePath)
|
||||
Dim NewTableFileContent As New List(Of String)
|
||||
Dim bBeamTable As Boolean = False
|
||||
For LineIndex As Integer = 0 To FileContent.Count - 1
|
||||
Dim sCurrLine As String = FileContent(LineIndex)
|
||||
sCurrLine = sCurrLine.Replace(DATETIME, System.DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"))
|
||||
sCurrLine = sCurrLine.Replace(TABLENAME, SelMachining & "Data")
|
||||
|
||||
If sCurrLine.Contains(SelMachining & "Data") AndAlso sCurrLine.Contains("=") Then
|
||||
bBeamTable = True
|
||||
NewTableFileContent.Add(sCurrLine)
|
||||
PrintActiveMachiningList(NewTableFileContent)
|
||||
End If
|
||||
|
||||
If Not bBeamTable Then
|
||||
NewTableFileContent.Add(sCurrLine)
|
||||
Else
|
||||
bBeamTable = False
|
||||
End If
|
||||
Next
|
||||
Dim FilePath As String = m_BaseDir & "\" & SelMachining & "Data.lua"
|
||||
File.WriteAllLines(FilePath, NewTableFileContent, Text.Encoding.UTF8)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub PrintActiveMachiningList(NewTableFileContent As List(Of String))
|
||||
For Index As Integer = 0 To m_TableRowList.Count - 1
|
||||
If String.IsNullOrEmpty(m_TableRowList(Index).Name) Then Continue For
|
||||
Dim CurrentLine As String = " { On = " & If(m_TableRowList(Index).OnPar, "true", "false") & ", Name = '" & m_TableRowList(Index).Name & "', Type = '" & m_TableRowList(Index).Type & "'}"
|
||||
If Index < m_TableRowList.Count - 1 Then
|
||||
CurrentLine &= ","
|
||||
End If
|
||||
NewTableFileContent.Add(CurrentLine)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "MoveRowUp"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MoveRowUp_Command As ICommand
|
||||
Get
|
||||
If m_cmdMoveRowUp Is Nothing Then
|
||||
m_cmdMoveRowUp = New Command(AddressOf MoveRowUp)
|
||||
End If
|
||||
Return m_cmdMoveRowUp
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MoveRowUp()
|
||||
If SelRowIndex > 0 Then
|
||||
m_TableRowList.Move(SelRowIndex, SelRowIndex - 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' MoveRowUp
|
||||
|
||||
#Region "MoveRowDown"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MoveRowDown_Command As ICommand
|
||||
Get
|
||||
If m_cmdMoveRowDown Is Nothing Then
|
||||
m_cmdMoveRowDown = New Command(AddressOf MoveRowDown)
|
||||
End If
|
||||
Return m_cmdMoveRowDown
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MoveRowDown()
|
||||
If SelRowIndex < m_TableRowList.Count - 1 Then
|
||||
m_TableRowList.Move(SelRowIndex, SelRowIndex + 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' MoveRowDown
|
||||
|
||||
#Region "AddRow"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property AddRow_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddRow Is Nothing Then
|
||||
m_cmdAddRow = New Command(AddressOf AddRow)
|
||||
End If
|
||||
Return m_cmdAddRow
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub AddRow()
|
||||
m_TableRowList.Insert(SelRowIndex + 1, New GridLine(False, "", ""))
|
||||
End Sub
|
||||
|
||||
#End Region ' AddRow
|
||||
|
||||
#Region "DeleteRow"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property DeleteRow_Command As ICommand
|
||||
Get
|
||||
If m_cmdDeleteRow Is Nothing Then
|
||||
m_cmdDeleteRow = New Command(AddressOf DeleteRow)
|
||||
End If
|
||||
Return m_cmdDeleteRow
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub DeleteRow()
|
||||
m_TableRowList.RemoveAt(SelRowIndex)
|
||||
End Sub
|
||||
|
||||
#End Region ' DeleteRow
|
||||
|
||||
#Region "Save"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Save_Command As ICommand
|
||||
Get
|
||||
If m_cmdSave Is Nothing Then
|
||||
m_cmdSave = New Command(AddressOf Save)
|
||||
End If
|
||||
Return m_cmdSave
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub Save()
|
||||
' scrivo il file
|
||||
WriteTableFile()
|
||||
' resetto le modifiche
|
||||
For Each Line In m_TableRowList
|
||||
Line.ResetIsModified()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' Save
|
||||
|
||||
#Region "Close"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Close_Command As ICommand
|
||||
Get
|
||||
If m_cmdClose Is Nothing Then
|
||||
m_cmdClose = New Command(AddressOf Close)
|
||||
End If
|
||||
Return m_cmdClose
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub Close()
|
||||
' verifico se pagina precedente modificata
|
||||
Dim TableModified As Boolean = False
|
||||
For Each Line In m_TableRowList
|
||||
If Line.IsModified Then
|
||||
TableModified = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' se modificata, chiedo se salvare
|
||||
If TableModified Then
|
||||
' Salvare le modifiche apportate? - Salva
|
||||
Select Case MessageBox.Show( EgtMsg( 9007), EgtMsg( 9006), MessageBoxButton.YesNo, MessageBoxImage.Question)
|
||||
Case MessageBoxResult.Yes
|
||||
Save()
|
||||
Case MessageBoxResult.No
|
||||
' non devo fare nulla
|
||||
End Select
|
||||
End If
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' Close
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class GridLine
|
||||
Inherits VMBase
|
||||
|
||||
Friend ReadOnly Property IsModified As Boolean
|
||||
Get
|
||||
Return m_IsOnModified Or m_IsNameModified Or m_IsTypeModified
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub ResetIsModified()
|
||||
m_IsOnModified = False
|
||||
m_IsNameModified = False
|
||||
m_IsTypeModified = False
|
||||
End Sub
|
||||
|
||||
Private m_IsOnModified As Boolean = False
|
||||
Private m_On As Boolean
|
||||
Public Property OnPar As Boolean
|
||||
Get
|
||||
Return m_On
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_On = value
|
||||
m_IsOnModified = True
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Shared m_NamesList As ObservableCollection(Of String)
|
||||
Public ReadOnly Property NamesList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_NamesList
|
||||
End Get
|
||||
End Property
|
||||
Friend Shared Sub SetNamesList(NamesList As ObservableCollection(Of String))
|
||||
m_NamesList = NamesList
|
||||
End Sub
|
||||
|
||||
Private m_IsNameModified As Boolean = False
|
||||
Private m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
m_IsNameModified = True
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Shared m_TypeList As ObservableCollection(Of String)
|
||||
Public ReadOnly Property TypeList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_TypeList
|
||||
End Get
|
||||
End Property
|
||||
Friend Shared Sub SetTypeList(TypeList As ObservableCollection(Of String))
|
||||
m_TypeList = TypeList
|
||||
End Sub
|
||||
|
||||
Private m_IsTypeModified As Boolean = False
|
||||
Private m_Type As String
|
||||
Public Property Type As String
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Type = value
|
||||
m_IsTypeModified = True
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(bOnPar As Boolean, sName As String, sType As String)
|
||||
m_On = bOnPar
|
||||
m_Name = sName
|
||||
m_Type = sType
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,36 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MyBeamMachiningsWindowVM
|
||||
Inherits BeamMachiningsWindowVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_BeamMachiningsColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property BeamMachiningsColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return m_BeamMachiningsColumns
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
m_BeamMachiningsColumns = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(sTitle As String, sBaseDir As String, sMachTypePath As String, sTabTemplPath As String, Optional bIsBeam As Boolean = True)
|
||||
MyBase.New(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, bIsBeam)
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_BEAMMACHININGS, BeamMachiningsColumns)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In BeamMachiningsColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
End Class
|
||||
@@ -1,18 +0,0 @@
|
||||
Imports System.Text.RegularExpressions
|
||||
|
||||
Module TablesUtility
|
||||
|
||||
Friend Function SearchKey(sLine As String, sKey As String) As String
|
||||
Return Regex.Match(sLine, "[,|{|\s]" & sKey & "\s*=\s*['|\""]?(.*?)\s*?[,|}|'|\""]").Groups(1).Value
|
||||
End Function
|
||||
|
||||
Public Function CountCharacter(ByVal sLine As String, ByVal cValue As Char) As Integer
|
||||
Dim nCount As Integer = 0
|
||||
Dim cArray() As Char = sLine.ToCharArray
|
||||
For Index As Integer = 0 To cArray.Count - 1
|
||||
If cArray(Index) = cValue Then nCount += 1
|
||||
Next
|
||||
Return nCount
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -97,13 +97,13 @@ Public Class CALCPanelVM
|
||||
|
||||
Public ReadOnly Property Verify_IsEnabled As Boolean
|
||||
Get
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW, m_CALCPanel_IsEnabled And Not Map.refShowBeamPanelVM.bShowAll, True)
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW, m_CALCPanel_IsEnabled And Not Map.refShowBeamPanelVM.bShowAll, m_CALCPanel_IsEnabled)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Simulate_IsEnabled As Boolean
|
||||
Get
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW, m_CALCPanel_IsEnabled And Not Map.refShowBeamPanelVM.bShowAll, True)
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW, m_CALCPanel_IsEnabled And Not Map.refShowBeamPanelVM.bShowAll, m_CALCPanel_IsEnabled)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -182,6 +182,9 @@ Public Class CALCPanelVM
|
||||
Friend Sub SetCalcPanelIsEnabled(bIsEnabled As Boolean)
|
||||
m_CALCPanel_IsEnabled = bIsEnabled
|
||||
NotifyPropertyChanged(NameOf(CALCPanel_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(Verify_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(Simulate_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(Edit_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Private Sub Calc_ProcessResult(sender As Object, e As CalcResultEventArgs)
|
||||
@@ -483,7 +486,7 @@ Public Class CALCPanelVM
|
||||
Next
|
||||
End Function
|
||||
|
||||
Private Shared Function GetMachgroupVMFromMachgroupId(nMachGroupId As Integer) As MyMachGroupVM
|
||||
Friend Shared Function GetMachgroupVMFromMachgroupId(nMachGroupId As Integer) As MyMachGroupVM
|
||||
Return Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nMachGroupId)
|
||||
End Function
|
||||
|
||||
@@ -526,7 +529,7 @@ Public Class CALCPanelVM
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(MachineList.Count > 1)
|
||||
Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso MachineList.Count > 1)
|
||||
End Sub
|
||||
|
||||
Friend Function IsMachineModified() As Boolean
|
||||
@@ -604,7 +607,7 @@ Public Class CALCPanelVM
|
||||
Case Core.CalcStates.OK, CalcStates.INFO
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nFeaturesGlobalState > CalcStates.INFO Then
|
||||
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
|
||||
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
|
||||
End If
|
||||
@@ -638,7 +641,7 @@ Public Class CALCPanelVM
|
||||
Case Core.CalcStates.OK, CalcStates.INFO
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (SelMachGroup.nPartsGlobalState > CalcStates.INFO) Then
|
||||
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
||||
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
||||
End If
|
||||
@@ -814,7 +817,7 @@ Public Class CALCPanelVM
|
||||
For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
|
||||
If MachGroup.nProduction_State >= ItemState.Assigned Then Continue For
|
||||
If MachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
|
||||
MachGroup.ResetCalcMachGroup()
|
||||
MachGroup.ResetCalcTotalMachGroup()
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
@@ -823,7 +826,7 @@ Public Class CALCPanelVM
|
||||
' se barra gia' assegnata a supervisore, esco
|
||||
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
|
||||
If SelMachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
|
||||
SelMachGroup.ResetCalcMachGroup()
|
||||
SelMachGroup.ResetCalcTotalMachGroup()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -40,11 +40,10 @@
|
||||
Visibility="{Binding ViewPage_Visibility}">
|
||||
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button FontSize="20"
|
||||
FontWeight="Light"
|
||||
ToolTip="{Binding ChooseMachine_ToolTip}"
|
||||
<Button ToolTip="{Binding ChooseMachine_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding ChooseMachine_Command}"
|
||||
IsEnabled="{Binding CALCPanel_IsEnabled}"
|
||||
Visibility="{Binding ChooseMachineBtn_Visibility}">
|
||||
<Image Source="/Resources/CALCPanel/ChooseMachine.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
@@ -215,50 +215,6 @@
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="Colonne tabelle">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:DGColumnsListV DataContext="{Binding}"
|
||||
ItemsSource="{Binding DGColumnsList}"
|
||||
SelectedItem="{Binding SelDGColumn}"
|
||||
Grid.Column="0"
|
||||
Margin="5">
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Background>
|
||||
<SolidColorBrush Color="LightGray"></SolidColorBrush>
|
||||
</Expander.Background>
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}" />
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<ItemsPresenter />
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</DataGrid.GroupStyle>
|
||||
</EgtBEAMWALL:DGColumnsListV>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
|
||||
@@ -124,18 +124,6 @@ Public Class ConfigurationPageVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle colonne con le relative proprietà della DataGrid
|
||||
Private m_DGColumnsList_View As CollectionView = Nothing
|
||||
Protected m_DGColumnsList As New ObservableCollection(Of IniDataGridColumn)
|
||||
Public Property DGColumnsList As ObservableCollection(Of IniDataGridColumn)
|
||||
Get
|
||||
Return m_DGColumnsList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of IniDataGridColumn))
|
||||
m_DGColumnsList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property L_Msg As String
|
||||
@@ -315,11 +303,6 @@ Public Class ConfigurationPageVM
|
||||
m_QBTLParamVMList_View = CollectionViewSource.GetDefaultView(m_QBTLParamVMList)
|
||||
m_QBTLParamVMList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(QBTLParamVM.GroupType)))
|
||||
m_QBTLParamVMList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(QBTLParamVM.ghDesc)))
|
||||
' carico la lista delle colonne delle DataGrid in ConfigurationPage
|
||||
LoadConfigDGColumns()
|
||||
' setto il grouping ad 1 livello per la DataGrid
|
||||
m_DGColumnsList_View = CollectionViewSource.GetDefaultView(m_DGColumnsList)
|
||||
m_DGColumnsList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(IniDataGridColumn.VisParentDataGridName)))
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -345,7 +328,6 @@ Public Class ConfigurationPageVM
|
||||
WriteMachParams()
|
||||
WriteMachParamsLua()
|
||||
WriteProcessParams(PRCList.ToList())
|
||||
WriteDataGridColumns()
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
|
||||
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
|
||||
WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
|
||||
@@ -468,19 +450,6 @@ Public Class ConfigurationPageVM
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(QBTLParamVMList))
|
||||
End If
|
||||
' verifico se i valori delle colonne DataGrid sono stati modificati
|
||||
For Each DGColumnItem In DGColumnsList
|
||||
If DGColumnItem.IsModified Then
|
||||
If MessageBox.Show(EgtMsg(61882), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
|
||||
' scrivo i valori delle colonne DataGrid modificate
|
||||
WriteDataGridColumns()
|
||||
Else
|
||||
' se da non salvare li resetto ed esco dai For
|
||||
LoadConfigDGColumns()
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione che verifica l'inserimento della password quando si edita un parametro Macchina
|
||||
@@ -584,67 +553,6 @@ Public Class ConfigurationPageVM
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione che carica la DataGrid di configurazione delle colonne delle EgtDataGrid
|
||||
Public Sub LoadConfigDGColumns()
|
||||
DGColumnsList.Clear()
|
||||
GetPrivateProfileIniColumns(S_FEATURELIST, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_OPENPROJFILEDLG_PROJ, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_OPENPROJFILEDLG_PROD, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_RAWPARTLIST_BEAM, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_RAWPARTLIST_WALL, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARTINRAWPARTLIST_BEAM, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARTINRAWPARTLIST_WALL, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARTLIST, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_FEATUREINPARTINRAWPARTLIST, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_STATISTICS, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_OPTIMIZERSTATISTICS, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_BEAMMACHININGS, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARAMETERLIST_P, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARAMETERLIST_Q, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_SPARAMLIST_BEAM, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_SPARAMLIST_WALL, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_SECTXMATLIST_BEAM, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_SECTXMATLIST_WALL, DGColumnsList)
|
||||
End Sub
|
||||
|
||||
' funzione per calcolare e scrivere la stringhe dei parametri delle colonne relative ad una ParentDataGridName nell'INI
|
||||
Public Sub SaveDataGridColumns(ParentDataGridName As String, DGColumnsList As ObservableCollection(Of IniDataGridColumn))
|
||||
For Each ColumnItem In DGColumnsList
|
||||
If ColumnItem.ParentDataGridName = ParentDataGridName Then
|
||||
Dim sColumnParams = String.Empty
|
||||
sColumnParams = ColumnItem.Name & "," & If(ColumnItem.CanUserReorder, 1, 0) & "," & If(ColumnItem.CanUserResize, 1, 0) & "," &
|
||||
If(ColumnItem.CanUserSort, 1, 0) & "," & If(ColumnItem.IsReadOnly, 1, 0) & "," & DoubleToString(ColumnItem.Width.Value, 6) & "," &
|
||||
ColumnItem.Width.UnitType & "," & If(ColumnItem.Visible, 1, 0) & "," & If(ColumnItem.CanUserEditVisible, 1, 0)
|
||||
WriteColumnPrivateProfileParam(ParentDataGridName, ColumnItem.m_DisplayIndex, sColumnParams)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione che scrive i valori delle proprietà delle colonne customizzate delle EgtDataGrid nell'INI
|
||||
Public Sub WriteDataGridColumns()
|
||||
SaveDataGridColumns(S_FEATURELIST, DGColumnsList)
|
||||
SaveDataGridColumns(S_OPENPROJFILEDLG_PROJ, DGColumnsList)
|
||||
SaveDataGridColumns(S_OPENPROJFILEDLG_PROD, DGColumnsList)
|
||||
SaveDataGridColumns(S_RAWPARTLIST_BEAM, DGColumnsList)
|
||||
SaveDataGridColumns(S_RAWPARTLIST_WALL, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARTINRAWPARTLIST_BEAM, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARTINRAWPARTLIST_WALL, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARTLIST, DGColumnsList)
|
||||
SaveDataGridColumns(S_FEATUREINPARTINRAWPARTLIST, DGColumnsList)
|
||||
SaveDataGridColumns(S_STATISTICS, DGColumnsList)
|
||||
SaveDataGridColumns(S_OPTIMIZERSTATISTICS, DGColumnsList)
|
||||
SaveDataGridColumns(S_BEAMMACHININGS, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARAMETERLIST_P, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARAMETERLIST_Q, DGColumnsList)
|
||||
SaveDataGridColumns(S_SPARAMLIST_BEAM, DGColumnsList)
|
||||
SaveDataGridColumns(S_SPARAMLIST_WALL, DGColumnsList)
|
||||
SaveDataGridColumns(S_SECTXMATLIST_BEAM, DGColumnsList)
|
||||
SaveDataGridColumns(S_SECTXMATLIST_WALL, DGColumnsList)
|
||||
For Each DGColumnItem In DGColumnsList
|
||||
DGColumnItem.IsModifiedReset()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
End Class
|
||||
@@ -838,239 +746,6 @@ Public Class MachTable
|
||||
|
||||
End Class
|
||||
|
||||
Public Class IniDataGridColumn
|
||||
|
||||
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
|
||||
|
||||
' Nome datagrid di cui fa parte la colonna visualizzato nell'interfaccia
|
||||
Public ReadOnly Property VisParentDataGridName As String
|
||||
Get
|
||||
Return ParentDataGridName.Replace(ParentDataGridName.Substring(0, 3), "").Trim()
|
||||
End Get
|
||||
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
|
||||
|
||||
' Nome colonna visualizzato nell'interfaccia
|
||||
Public ReadOnly Property VisName As String
|
||||
Get
|
||||
Return Name.Replace(Name.Substring(0, 3), "").Trim()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property m_Width As DataGridLength
|
||||
Public Property Width As DataGridLength
|
||||
Get
|
||||
Return m_Width
|
||||
End Get
|
||||
Set(value As DataGridLength)
|
||||
m_Width = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedDisplayIndex
|
||||
Friend Property m_DisplayIndex As Integer
|
||||
Public Property DisplayIndex As Integer
|
||||
Get
|
||||
Return If(Visible, m_DisplayIndex, -1)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_DisplayIndex = value
|
||||
m_IsModifiedDisplayIndex = (m_Name <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.NAME))
|
||||
' se DisplayIndex viene settato ad un valore che corrisponde a quello che aveva inizialmente aggiorno gli IsModified
|
||||
' delle altre proprietà utilizzando il DisplayIndex attuale
|
||||
If Not m_IsModifiedDisplayIndex Then
|
||||
m_IsModifiedIsReadOnly = (m_IsReadOnly <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.ISREADONLY))
|
||||
m_IsModifiedCanUserReorder = (m_CanUserReorder <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.REORDER))
|
||||
m_IsModifiedCanUserResize = (m_CanUserResize <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.RESIZE))
|
||||
m_IsModifiedCanUserSort = (m_CanUserSort <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.SORT))
|
||||
m_IsModifiedVisible = (m_Visible <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.VISIBLE))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedIsReadOnly As Boolean = False
|
||||
Private Property m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnly = value
|
||||
m_IsModifiedIsReadOnly = (m_IsReadOnly <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.ISREADONLY))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserReorder As Boolean = False
|
||||
Private m_CanUserReorder As Boolean
|
||||
Public Property CanUserReorder As Boolean
|
||||
Get
|
||||
Return m_CanUserReorder
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserReorder = value
|
||||
m_IsModifiedCanUserReorder = (m_CanUserReorder <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.REORDER))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserResize As Boolean = False
|
||||
Private m_CanUserResize As Boolean
|
||||
Public Property CanUserResize As Boolean
|
||||
Get
|
||||
Return m_CanUserResize
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserResize = value
|
||||
m_IsModifiedCanUserResize = (m_CanUserResize <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.RESIZE))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserSort As Boolean = False
|
||||
Private m_CanUserSort As Boolean
|
||||
Public Property CanUserSort As Boolean
|
||||
Get
|
||||
Return m_CanUserSort
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserSort = value
|
||||
m_IsModifiedCanUserSort = (m_CanUserSort <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.SORT))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedVisible As Boolean = False
|
||||
Private m_Visible As Boolean
|
||||
Public Property Visible As Boolean
|
||||
Get
|
||||
Return m_Visible
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_Visible = value
|
||||
' Utilizzo OldDGIndex e NewDGIndex per muovere la Column tra il gruppo dei Visible (in alto) o il gruppo
|
||||
' dei non Visible (in basso): in ambo i casi verrà sempre spostata in mezzo ai due raggruppamenti
|
||||
Dim OldDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Me)
|
||||
If value Then
|
||||
Dim NewDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName AndAlso
|
||||
x.Visible = False))
|
||||
' se NewDGIndex = -1 (ovvero ho settato l'ultima Column rimasta non Visible a Visible) oppure
|
||||
' se il nuovo indice è subito dopo il vecchio non la sposto altrimenti viene spostata in maniera sbagliata
|
||||
If NewDGIndex <> -1 AndAlso NewDGIndex <> OldDGIndex + 1 Then Map.refConfigurationPageVM.DGColumnsList.Move(OldDGIndex, NewDGIndex)
|
||||
Else
|
||||
Dim NewDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName AndAlso
|
||||
x.Visible = False AndAlso
|
||||
x.Name <> Name))
|
||||
' se NewDGIndex = -1 vuol dire che erano tutte settate a Visible perciò devo calcolare l'indice
|
||||
' dell'ultima Column con quel ParentDataGridName e spostarlo lì
|
||||
If NewDGIndex = -1 Then
|
||||
Dim FirstIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName))
|
||||
Dim LastIndex = FirstIndex
|
||||
While LastIndex < Map.refConfigurationPageVM.DGColumnsList.Count AndAlso Map.refConfigurationPageVM.DGColumnsList(LastIndex).ParentDataGridName = ParentDataGridName
|
||||
LastIndex += 1
|
||||
End While
|
||||
NewDGIndex = LastIndex
|
||||
End If
|
||||
Map.refConfigurationPageVM.DGColumnsList.Move(OldDGIndex, NewDGIndex - 1)
|
||||
End If
|
||||
' aggiorno i DisplayIndex di ciascuna Column della ParentDataGridName in questione
|
||||
Dim index = 0
|
||||
For Each DGColumnItem In Map.refConfigurationPageVM.DGColumnsList
|
||||
If DGColumnItem.ParentDataGridName = ParentDataGridName Then
|
||||
DGColumnItem.DisplayIndex = index
|
||||
index += 1
|
||||
End If
|
||||
Next
|
||||
' uso il Move col medesimo valore per i 2 argomenti per refreshare i DisplayIndex delle Column
|
||||
' della ParentDataGridName in questione appena riordinate
|
||||
For index = 0 To Map.refConfigurationPageVM.DGColumnsList.Count - 1
|
||||
If Map.refConfigurationPageVM.DGColumnsList(index).ParentDataGridName = ParentDataGridName Then
|
||||
Map.refConfigurationPageVM.DGColumnsList.Move(index, index)
|
||||
End If
|
||||
Next
|
||||
' setto se il valore è stato modificato, a partire dalla verifica che il Nome e DisplayIndex combacino (altrimenti è per forza modificato)
|
||||
m_IsModifiedVisible = (m_Name <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.NAME)) OrElse
|
||||
(If(m_Visible, 1, 0) <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.VISIBLE))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserEditVisible As Boolean
|
||||
Public Property CanUserEditVisible As Boolean
|
||||
Get
|
||||
Return m_CanUserEditVisible
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserEditVisible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IsModified() As Boolean
|
||||
Get
|
||||
Return m_IsModifiedDisplayIndex OrElse
|
||||
m_IsModifiedIsReadOnly OrElse
|
||||
m_IsModifiedCanUserReorder OrElse
|
||||
m_IsModifiedCanUserResize OrElse
|
||||
m_IsModifiedCanUserSort OrElse
|
||||
m_IsModifiedVisible
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub IsModifiedReset()
|
||||
m_IsModifiedDisplayIndex = False
|
||||
m_IsModifiedIsReadOnly = False
|
||||
m_IsModifiedCanUserReorder = False
|
||||
m_IsModifiedCanUserResize = False
|
||||
m_IsModifiedCanUserSort = False
|
||||
m_IsModifiedVisible = False
|
||||
End Sub
|
||||
|
||||
Sub New(sName As String)
|
||||
m_Name = sName
|
||||
End Sub
|
||||
|
||||
Sub New(sParentDG As String, nDisplayIndex As Integer, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean)
|
||||
m_ParentDataGridName = sParentDG
|
||||
m_DisplayIndex = nDisplayIndex
|
||||
m_Name = sName
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
m_CanUserResize = bCanUserResize
|
||||
m_CanUserSort = bCanUserSort
|
||||
m_IsReadOnly = bIsReadOnly
|
||||
m_Width = Width
|
||||
m_Visible = bVisible
|
||||
m_CanUserEditVisible = bCanUserEditVisible
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
' Tipo parametro nel file di configurazione Macchina
|
||||
Public Enum MachParamType As Integer
|
||||
DOUBLE_ = 1
|
||||
@@ -1079,68 +754,3 @@ Public Enum MachParamType As Integer
|
||||
LENGTH = 4
|
||||
CHECKBOX = 5
|
||||
End Enum
|
||||
|
||||
Public Module IniDataGridColumnFunctions
|
||||
|
||||
' funzione per ottenere dal file INI le colonne da caricare nella DataGrid usata per customizzare le proprietà delle colonne delle EgtDataGrid del programma
|
||||
Public Function GetPrivateProfileIniColumns(ParentDGName As String, ByRef ocColumns As ObservableCollection(Of IniDataGridColumn)) 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 >= 9 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)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
ocColumns.Add(New IniDataGridColumn(ParentDGName, colIndex, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible))
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
Return ocColumns.Count > 0
|
||||
End Function
|
||||
|
||||
' funzione che ottiene dal file INI la singola proprietà legata ad una specifica colonna
|
||||
Public Function GetPrivateProfileIniColumnProperty(ParentDGName As String, ocColumns As ObservableCollection(Of IniDataGridColumn), DisplayIndex As Integer, PropertyIndex As EgtDGColumnProperty) As String
|
||||
Dim str = String.Empty
|
||||
If EgtUILib.GetPrivateProfileString(ParentDGName, DisplayIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0 Then
|
||||
Dim sColumnParams() As String = str.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sColumnParams.Count >= 9 Then
|
||||
' cancello spazi
|
||||
For index = 0 To sColumnParams.Count - 1
|
||||
sColumnParams(index) = sColumnParams(index).Trim()
|
||||
Next
|
||||
If PropertyIndex > -1 AndAlso PropertyIndex < sColumnParams.Count Then Return sColumnParams(PropertyIndex)
|
||||
End If
|
||||
End If
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
Public Enum EgtDGColumnProperty
|
||||
NAME = 0
|
||||
REORDER = 1
|
||||
RESIZE = 2
|
||||
SORT = 3
|
||||
ISREADONLY = 4
|
||||
WIDTH = 5
|
||||
WIDTHTYPE = 6
|
||||
VISIBLE = 7
|
||||
EDITVISIBLE = 8
|
||||
End Enum
|
||||
|
||||
End Module
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
<DataGrid x:Class="DGColumnsListV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserSortColumns="False"
|
||||
CanUserResizeColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
Margin="0,0,0,5">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--Indice-->
|
||||
<!--<DataGridTextColumn Binding="{Binding DisplayIndex}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.DisplayIndex_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>-->
|
||||
<!--Nome colonna-->
|
||||
<DataGridTextColumn Binding="{Binding VisName}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.ColumnName_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--CanUserReorder-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserReorder, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserReorder_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--CanUserResize-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserResize, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserResize_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--CanUserSort-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserSort, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserSort_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--IsReadOnly-->
|
||||
<!--<DataGridCheckBoxColumn Binding="{Binding IsReadOnly, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.IsReadOnly_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>-->
|
||||
<!--Visible-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding Visible, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Visible_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataGridCheckBoxColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="IsEnabled" Value="{Binding CanUserEditVisible}" />
|
||||
</Style>
|
||||
</DataGridCheckBoxColumn.CellStyle>
|
||||
</DataGridCheckBoxColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class DGColumnsListV
|
||||
|
||||
End Class
|
||||
@@ -165,10 +165,15 @@
|
||||
<Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb">
|
||||
<DependentUpon>AboutBoxV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MovePartInRawPartWnd\MovePartInRawPartWndV.xaml.vb">
|
||||
<DependentUpon>MovePartInRawPartWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MovePartInRawPartWnd\MovePartInRawPartWndVM.vb" />
|
||||
<Compile Include="InputPwdWnd\InputPwdWndV.xaml.vb">
|
||||
<DependentUpon>InputPwdWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="InputPwdWnd\InputPwdWndVM.vb" />
|
||||
<Compile Include="ItemParamList\DuploQParameterListVM.vb" />
|
||||
<Compile Include="MultiCopyRawPartWnd\MultiCopyRawPartWndV.xaml.vb">
|
||||
<DependentUpon>MultiCopyRawPartWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -180,8 +185,7 @@
|
||||
<Compile Include="BeamMachiningsWindow\BeamMachiningsWindowV.xaml.vb">
|
||||
<DependentUpon>BeamMachiningsWindowV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BeamMachiningsWindow\BeamMachiningsWindowVM.vb" />
|
||||
<Compile Include="BeamMachiningsWindow\TablesUtility.vb" />
|
||||
<Compile Include="BeamMachiningsWindow\MyBeamMachiningsWindowVM.vb" />
|
||||
<Compile Include="BlockedWnd\BlockedWndV.xaml.vb">
|
||||
<DependentUpon>BlockedWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -209,9 +213,6 @@
|
||||
<DependentUpon>CalcPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CALCPanel\CALCPanelVM.vb" />
|
||||
<Compile Include="ConfigurationPage\DGColumnsListV.xaml.vb">
|
||||
<DependentUpon>DGColumnsListV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Constants\ConstWarehouseIni.vb" />
|
||||
<Compile Include="FreeContourManager\FreeContourManagerV.xaml.vb">
|
||||
<DependentUpon>FreeContourManagerV.xaml</DependentUpon>
|
||||
@@ -254,7 +255,6 @@
|
||||
<Compile Include="Utility\DbControllers.vb" />
|
||||
<Compile Include="Utility\DisableModifiedMgr.vb" />
|
||||
<Compile Include="Utility\LuaExec.vb" />
|
||||
<Compile Include="Utility\MachineModel.vb" />
|
||||
<Compile Include="Utility\ManageWindow.vb" />
|
||||
<Compile Include="Utility\SectionXMaterialToBeAdded.vb" />
|
||||
<Compile Include="Utility\TextBlockUtils.vb" />
|
||||
@@ -357,6 +357,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MovePartInRawPartWnd\MovePartInRawPartWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="InputPwdWnd\InputPwdWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -405,10 +409,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ConfigurationPage\DGColumnsListV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="FreeContourManager\FreeContourManagerV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -697,6 +697,10 @@
|
||||
<Project>{24d7760e-662a-47e4-b729-b70126c24a31}</Project>
|
||||
<Name>EgtBEAMWALL.DataLayer</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\LiMan.Core\LiMan.Core.csproj">
|
||||
<Project>{b61508b2-20cb-45d9-8c00-209a22c44de5}</Project>
|
||||
<Name>LiMan.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TreeView\Folder.png" />
|
||||
@@ -849,6 +853,15 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\OptimizePanel\UnlockRotation.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\MovePartInRawPart\MoveLeftParts.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\MovePartInRawPart\MoveRightParts.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TopPanel\MovePartInRawPart.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class DuploQParameterListVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_colQParam_Value As EgtDataGridColumn
|
||||
Public ReadOnly Property colQParam_Value As EgtDataGridColumn
|
||||
Get
|
||||
Return m_colQParam_Value
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_colQParam_Custom As EgtDataGridColumn
|
||||
Public ReadOnly Property colQParam_Custom As EgtDataGridColumn
|
||||
Get
|
||||
Return m_colQParam_Custom
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_QParameterListColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property QParameterListColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return m_QParameterListColumns
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
m_QParameterListColumns = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Custom_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61801)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property NAM_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61808)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Description_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61603)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Value_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61615)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Min_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61616)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Max_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61617)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Aggiungo riferimento a Map
|
||||
' Map.SetRefQParameterListVM(Me)
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_DUPLOPARAMETERLIST_Q, QParameterListColumns)
|
||||
' recupero riferimento a colonna Value e Custom
|
||||
m_colQParam_Value = QParameterListColumns.FirstOrDefault(Function(x) x.Name = COL_VALUE)
|
||||
'm_colQParam_Custom = QParameterListColumns.FirstOrDefault(Function(x) x.Name = COL_CUSTOM)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
End Class
|
||||
@@ -19,7 +19,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding FeatureInPartInRawPartColumns}"
|
||||
BeginningEdit="FeatureInPartInRawPartList_BeginningEdit"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
ItemsSource="{Binding Tag.PBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PParameterListV}}}"
|
||||
SelectedItem="{Binding Tag.SelPBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PParameterListV}}}"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding PartInRawPartColumns}"
|
||||
BeginningEdit="PartInRawPartList_BeginningEdit"
|
||||
|
||||
@@ -129,6 +129,10 @@ Public Class PartInRawPartListVM
|
||||
m_colPartInRawPart_Flip = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
|
||||
m_colPartInRawPart_PosX = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
|
||||
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5">
|
||||
|
||||
<DataGrid.Resources>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
ItemsSource="{Binding Tag.QBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:QParameterListV}}}"
|
||||
SelectedItem="{Binding Tag.SelQBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:QParameterListV}}}"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding RawPartColumns}"
|
||||
BeginningEdit="RawPartList_BeginningEdit"
|
||||
|
||||
@@ -13,6 +13,20 @@ Public Class RawPartListVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_colRawPart_W As EgtDataGridColumn
|
||||
Public ReadOnly Property colRawPart_W As EgtDataGridColumn
|
||||
Get
|
||||
Return m_colRawPart_W
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_colRawPart_L As EgtDataGridColumn
|
||||
Public ReadOnly Property colRawPart_L As EgtDataGridColumn
|
||||
Get
|
||||
Return m_colRawPart_L
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_RawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property RawPartColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
@@ -98,6 +112,12 @@ Public Class RawPartListVM
|
||||
End If
|
||||
' recupero riferimento a colonna StartCut
|
||||
m_colRawPart_StartCut = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_STARTCUT)
|
||||
m_colRawPart_W = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_W)
|
||||
m_colRawPart_L = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_L)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In RawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -52,7 +52,7 @@ Public Class LeftPanelVM
|
||||
|
||||
Private ReadOnly Property PartIsSelected As Boolean
|
||||
Get
|
||||
Return Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart)
|
||||
Return Not IsNothing(Map.refProjectVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart)
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property FeatureIsSelected As Boolean
|
||||
@@ -350,6 +350,7 @@ Public Class LeftPanelVM
|
||||
BeamMachGroup.MyMachGroupM.RefreshGroupData()
|
||||
' aggiorno dati utilizzo barra
|
||||
BeamMachGroup.UpdateUsage()
|
||||
Core.ViewPanelVM.BWSetView(VT.ISO_SW, False)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
' scrivo dati in gruppo di lavorazione
|
||||
Dim dPosX As Double = dKerf
|
||||
@@ -390,8 +391,8 @@ Public Class LeftPanelVM
|
||||
WallMachGroup.MyMachGroupM.RefreshGroupData()
|
||||
' aggiorno dati ultilizzo barra
|
||||
WallMachGroup.UpdateUsage()
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
End If
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
@@ -484,6 +485,7 @@ Public Class LeftPanelVM
|
||||
End If
|
||||
' aggiorno dati ultilizzo barra
|
||||
BeamMachGroup.UpdateUsage()
|
||||
Core.ViewPanelVM.BWSetView(VT.ISO_SW, False)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
Dim WallMachGroup As MyMachGroupVM = SelMachGroup
|
||||
' verifico spessore
|
||||
@@ -497,8 +499,8 @@ Public Class LeftPanelVM
|
||||
End If
|
||||
' aggiorno dati ultilizzo barra
|
||||
WallMachGroup.UpdateUsage()
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
End If
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
@@ -721,7 +723,7 @@ Public Class LeftPanelVM
|
||||
EgtBeamSetPartCount(AddPartWndVM.nCNT)
|
||||
EgtBeamSetPartBox(AddPartWndVM.dL, AddPartWndVM.dH, AddPartWndVM.dW)
|
||||
' se progetto pareti e vista ruotata
|
||||
If nType = BWType.WALL AndAlso (CurrentMachine.ViewDir = 1 OrElse CurrentMachine.ViewDir = 3) Then
|
||||
If nType = BWType.WALL AndAlso (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) Then
|
||||
'' ruoto le pareti di 180 per raddrizzarle rispetto alla vista
|
||||
'NewPart.Rotation(True, Map.refProjectVM.BTLStructureVM.nPROJTYPE, 180, False)
|
||||
' recupero il box del pezzo
|
||||
|
||||
@@ -174,18 +174,21 @@ Public Class MyMachGroupPanelVM
|
||||
EgtErase(nDuploId)
|
||||
'' recupero gruppo di lavorazione e trave dell'interfaccia
|
||||
Dim BeamMachGroup As MyMachGroupVM = MachGroupVMList.FirstOrDefault(Function(x) x.Id = nMachGroupId)
|
||||
If Not IsNothing( BeamMachGroup) Then
|
||||
If Not IsNothing(BeamMachGroup) Then
|
||||
Dim Beam As PartVM = BeamMachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nDuploId)
|
||||
EgtSetCurrMachGroup(BeamMachGroup.Id)
|
||||
Beam.DeletePart()
|
||||
End If
|
||||
Next
|
||||
' aggiorno quantita' in prod
|
||||
Dim BTLPart As BTLPartVM = CALCPanelVM.GetBTLPartVMFromBTLPartId(nPartId)
|
||||
BTLPart.RefreshPartInProd()
|
||||
End If
|
||||
DuploResetToDelete(nPartId)
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
' se cancellato almeno un pezzo, salvo
|
||||
' se cancellato almeno un pezzo
|
||||
If bDuploToDeleteFound Then
|
||||
Map.refProdManagerVM.Save()
|
||||
End If
|
||||
@@ -231,7 +234,7 @@ Public Class MyMachGroupPanelVM
|
||||
SelMachGroup.SelPart = Nothing
|
||||
' Imposto vista solo tavola
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
Imports EgtUILib
|
||||
@@ -14,6 +15,8 @@ Public Class MyMachGroupVM
|
||||
|
||||
#Region "General"
|
||||
|
||||
Private m_RefreshPartList_Timer As New DispatcherTimer
|
||||
|
||||
Public Overrides Property SelPart As Core.PartVM
|
||||
Get
|
||||
Return m_SelPart
|
||||
@@ -253,6 +256,8 @@ Public Class MyMachGroupVM
|
||||
MyBase.New(MyMachGroupM)
|
||||
' aggiorno stato di produzione
|
||||
ReadProductionState()
|
||||
m_RefreshPartList_Timer.Interval = TimeSpan.FromMilliseconds(50)
|
||||
AddHandler m_RefreshPartList_Timer.Tick, AddressOf RefreshPartList_Tick
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
@@ -323,7 +328,7 @@ Public Class MyMachGroupVM
|
||||
BeamWallMachGroup.MyMachGroupM.RefreshGroupData()
|
||||
' aggiorno dati ultilizzo barra
|
||||
BeamWallMachGroup.UpdateUsage()
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
Core.ViewPanelVM.BWSetView(VT.ISO_SW, False)
|
||||
Next
|
||||
Else
|
||||
Dim sPartArray(m_PartVMList.Count - 1) As String
|
||||
@@ -509,6 +514,166 @@ Public Class MyMachGroupVM
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub ResetSupervisorId()
|
||||
' resetto stato per MachGroup
|
||||
nProduction_State = ItemState.ND
|
||||
SetSupervisorId("")
|
||||
Dim bTotDuploToUpdate As Boolean = False
|
||||
Dim bTotIsModified As Boolean = False
|
||||
' sblocco duplo di tutti i part
|
||||
For Each Part In PartVMList
|
||||
' recupero se Duplo da aggiornare
|
||||
Dim bDuploToUpdate As Boolean = False
|
||||
If EgtGetInfo(Part.nPartId, GDB_SI_DUPTOUPDATE, bDuploToUpdate) AndAlso bDuploToUpdate Then
|
||||
bTotDuploToUpdate = True
|
||||
End If
|
||||
' verifico tipo di progetto
|
||||
Dim nBtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
Dim nBWType As Integer = 0
|
||||
EgtGetInfo(nBtlInfoId, BTL_GEN_PROJTYPE, nBWType)
|
||||
Dim DuploRot As Integer = 0
|
||||
Dim DuploFlip As Integer = 0
|
||||
Dim QParams As New Dictionary(Of String, Dictionary(Of String, String))
|
||||
' se da aggiornare, leggo info del duplo che verrebbero perse
|
||||
If bDuploToUpdate Then
|
||||
' recupero ROT (gradi) e FLIP (gradi) per non perderli
|
||||
EgtGetInfo(Part.nPartId, MGR_PRT_ROT, DuploRot)
|
||||
EgtGetInfo(Part.nPartId, MGR_PRT_FLIP, DuploFlip)
|
||||
If DuploFlip <> 0 Then DuploFlip = 180
|
||||
If nBWType = BWType.WALL Then
|
||||
' ciclo sugli outline
|
||||
Dim nOutlineLayer As Integer = EgtGetFirstNameInGroup(Part.nPartId, OUTLINE)
|
||||
If nOutlineLayer <> GDB_ID.NULL Then
|
||||
Dim nGlobPRId As Integer = 1
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia outline
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
|
||||
Dim nPRId As Integer = 0
|
||||
If Not EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId) Then
|
||||
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
|
||||
nPRId = nGlobPRId
|
||||
bTotIsModified = True
|
||||
nGlobPRId += 1
|
||||
End If
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
QParams.Add(sKey, New Dictionary(Of String, String))
|
||||
For QIndex = 1 To 10
|
||||
Dim QKey As String = "Q" & QIndex.ToString("D2")
|
||||
Dim QValue As Integer = 0
|
||||
If EgtGetInfo(nOutlineId, QKey, QValue) Then
|
||||
QParams(sKey).Add(QKey, QValue)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
End If
|
||||
' ciclo sulle feature
|
||||
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(Part.nPartId, PROCESSINGS)
|
||||
If nFeatureLayer <> GDB_ID.NULL Then
|
||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
|
||||
While nFeatureId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
|
||||
Dim nPRId As Integer = 0
|
||||
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
QParams.Add(sKey, New Dictionary(Of String, String))
|
||||
For QIndex = 1 To 10
|
||||
Dim QKey As String = "Q" & QIndex.ToString("D2")
|
||||
Dim QValue As Integer = 0
|
||||
If EgtGetInfo(nFeatureId, QKey, QValue) Then
|
||||
QParams(sKey).Add(QKey, QValue)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
nFeatureId = EgtGetNext(nFeatureId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' sblocco Duplo
|
||||
EgtDuploResetLocked(Part.nPartId)
|
||||
' se da aggiornare, ripristino info del duplo che verrebbero perse
|
||||
If bDuploToUpdate Then
|
||||
' ripristino i valori di ROT e FLIP
|
||||
EgtSetInfo(Part.nPartId, MGR_PRT_ROT, DuploRot)
|
||||
EgtSetInfo(Part.nPartId, MGR_PRT_FLIP, DuploFlip)
|
||||
If nBWType = BWType.WALL Then
|
||||
' ciclo sugli outline
|
||||
Dim nOutlineLayer As Integer = EgtGetFirstNameInGroup(Part.nPartId, OUTLINE)
|
||||
If nOutlineLayer <> GDB_ID.NULL Then
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
|
||||
Dim nPRId As Integer = 0
|
||||
EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
' ripristino parametri Q
|
||||
If QParams.ContainsKey(sKey) Then
|
||||
For Each QPar In QParams(sKey)
|
||||
EgtSetInfo(nOutlineId, QPar.Key, QPar.Value)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
End If
|
||||
' ciclo sulle feature
|
||||
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(Part.nPartId, PROCESSINGS)
|
||||
If nFeatureLayer <> GDB_ID.NULL Then
|
||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
|
||||
While nFeatureId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
|
||||
Dim nPRId As Integer = 0
|
||||
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
' ripristino parametri Q
|
||||
If QParams.ContainsKey(sKey) Then
|
||||
For Each QPar In QParams(sKey)
|
||||
EgtSetInfo(nFeatureId, QPar.Key, QPar.Value)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
nFeatureId = EgtGetNext(nFeatureId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Part.nProduction_State = ItemState.ND
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
If bDuploToUpdate Then
|
||||
Dim Duplo As PartVM = CALCPanelVM.GetPartVMFromPartId(Part.nPartId)
|
||||
Duplo.ResetCalcTotalPart()
|
||||
End If
|
||||
Next
|
||||
If bTotDuploToUpdate Then
|
||||
m_RefreshPartList_Timer.Start()
|
||||
End If
|
||||
If bTotIsModified Then
|
||||
Dim CurrFilePath As String = ""
|
||||
EgtGetCurrFilePath(CurrFilePath)
|
||||
EgtSaveFile(CurrFilePath, NGE.CMPTEXT)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(IsReadOnly))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Sub
|
||||
|
||||
Private Sub RefreshPartList_Tick()
|
||||
m_RefreshPartList_Timer.Stop()
|
||||
Dim nCurrMachGroupId As Integer = EgtGetCurrMachGroup()
|
||||
EgtSetCurrMachGroup(Id)
|
||||
DirectCast(MachGroupM, MyMachGroupM).RefreshPartList()
|
||||
EgtSetCurrMachGroup(nCurrMachGroupId)
|
||||
End Sub
|
||||
|
||||
#End Region ' Machgroup
|
||||
|
||||
#Region "Parts"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
@@ -151,14 +152,15 @@ Public Class PartVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overrides Property bFLIP As Boolean
|
||||
Public Property bFLIP As Boolean
|
||||
Get
|
||||
Return m_PartM.bFLIP
|
||||
Return m_PartM.nFLIP <> 0
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Map.refProjectVM.bCalcRunning Then Return
|
||||
' se MachGroup gia' mandato in produzione, esco
|
||||
If m_ParentMachGroupVM.nProduction_State >= ItemState.Assigned Then Return
|
||||
If value <> m_PartM.bFLIP Then
|
||||
If (value And m_PartM.nFLIP = 0) OrElse (Not value And m_PartM.nFLIP <> 0) Then
|
||||
' salvo posizione
|
||||
Dim dTempPosX As Double = m_PartM.dPOSX
|
||||
Dim dTempPosY As Double = m_PartM.dPOSY
|
||||
@@ -170,8 +172,8 @@ Public Class PartVM
|
||||
Dim b3Box As New BBox3d
|
||||
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
|
||||
If EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB) Then
|
||||
m_PartM.bFLIP = value
|
||||
EgtSetInfo(nPartId, MGR_PRT_FLIP, value)
|
||||
m_PartM.nFLIP = If(value, 180, 0)
|
||||
EgtSetInfo(nPartId, MGR_PRT_FLIP, If(value, 180, 0))
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(bFLIP))
|
||||
End If
|
||||
@@ -267,10 +269,10 @@ Public Class PartVM
|
||||
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
|
||||
' se invertito lo reinverto
|
||||
Dim bFliped As Boolean = bFLIP
|
||||
If bFliped Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180)
|
||||
If bFliped Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB)
|
||||
Dim dAng As Double = If(IsPositive, 90, -90)
|
||||
' eseguo rotazione
|
||||
Dim bOk As Boolean = EgtRotate(nPartId, b3Box.Center, -Vector3d.Z_AX, dAng)
|
||||
Dim bOk As Boolean = EgtRotate(nPartId, b3Box.Center, -Vector3d.Z_AX, dAng, GDB_RT.GLOB)
|
||||
If bOk Then
|
||||
Dim TempRot = m_PartM.dROT
|
||||
TempRot += dAng
|
||||
@@ -283,7 +285,7 @@ Public Class PartVM
|
||||
EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT)
|
||||
End If
|
||||
' ripristino eventuale inversione
|
||||
If bFliped Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180)
|
||||
If bFliped Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB)
|
||||
' recupero box del pezzo
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part)
|
||||
@@ -337,6 +339,140 @@ Public Class PartVM
|
||||
PartM.SetProductionState(PartModel.State)
|
||||
PartM.dtStartTime = PartModel.DtStart
|
||||
PartM.dtEndTime = PartModel.DtEnd
|
||||
' verifico se bloccare o sbloccare duplo
|
||||
Dim bLocked As Boolean = True
|
||||
EgtDuploGetLocked(nPartId, bLocked)
|
||||
If PartModel.State <= ItemState.ND And bLocked Then
|
||||
' recupero se Duplo da aggiornare
|
||||
Dim bDuploToUpdate As Boolean = False
|
||||
EgtGetInfo(nPartId, GDB_SI_DUPTOUPDATE, bDuploToUpdate)
|
||||
' verifico tipo di progetto
|
||||
Dim nBtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
Dim nBWType As Integer = 0
|
||||
EgtGetInfo(nBtlInfoId, BTL_GEN_PROJTYPE, nBWType)
|
||||
Dim DuploRot As Integer = 0
|
||||
Dim DuploFlip As Integer = 0
|
||||
Dim QParams As New Dictionary(Of String, Dictionary(Of String, String))
|
||||
' se da aggiornare, leggo info del duplo che verrebbero perse
|
||||
If bDuploToUpdate Then
|
||||
' recupero ROT (gradi) e FLIP (gradi) per non perderli
|
||||
EgtGetInfo(nPartId, MGR_PRT_ROT, DuploRot)
|
||||
EgtGetInfo(nPartId, MGR_PRT_FLIP, DuploFlip)
|
||||
If DuploFlip <> 0 Then DuploFlip = 180
|
||||
If nBWType = BWType.WALL Then
|
||||
' ciclo sugli outline
|
||||
Dim nOutlineLayer As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
||||
If nOutlineLayer <> GDB_ID.NULL Then
|
||||
Dim nGlobPRId As Integer = 1
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia outline
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
|
||||
Dim nPRId As Integer = 0
|
||||
If Not EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId) Then
|
||||
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
|
||||
nPRId = nGlobPRId
|
||||
nGlobPRId += 1
|
||||
End If
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
QParams.Add(sKey, New Dictionary(Of String, String))
|
||||
For QIndex = 1 To 10
|
||||
Dim QKey As String = "Q" & QIndex.ToString("D2")
|
||||
Dim QValue As Integer = 0
|
||||
If EgtGetInfo(nOutlineId, QKey, QValue) Then
|
||||
QParams(sKey).Add(QKey, QValue)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
End If
|
||||
' ciclo sulle feature
|
||||
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
|
||||
If nFeatureLayer <> GDB_ID.NULL Then
|
||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
|
||||
While nFeatureId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
|
||||
Dim nPRId As Integer = 0
|
||||
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
QParams.Add(sKey, New Dictionary(Of String, String))
|
||||
For QIndex = 1 To 10
|
||||
Dim QKey As String = "Q" & QIndex.ToString("D2")
|
||||
Dim QValue As Integer = 0
|
||||
If EgtGetInfo(nFeatureId, QKey, QValue) Then
|
||||
QParams(sKey).Add(QKey, QValue)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
nFeatureId = EgtGetNext(nFeatureId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' sblocco Duplo
|
||||
EgtDuploResetLocked(nPartId)
|
||||
' se da aggiornare, ripristino info del duplo che verrebbero perse
|
||||
If bDuploToUpdate Then
|
||||
' ripristino i valori di ROT e FLIP
|
||||
EgtSetInfo(nPartId, MGR_PRT_ROT, DuploRot)
|
||||
EgtSetInfo(nPartId, MGR_PRT_FLIP, DuploFlip)
|
||||
If nBWType = BWType.WALL Then
|
||||
' ciclo sugli outline
|
||||
Dim nOutlineLayer As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
||||
If nOutlineLayer <> GDB_ID.NULL Then
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
|
||||
Dim nPRId As Integer = 0
|
||||
EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
' ripristino parametri Q
|
||||
If QParams.ContainsKey(sKey) Then
|
||||
For Each QPar In QParams(sKey)
|
||||
EgtSetInfo(nOutlineId, QPar.Key, QPar.Value)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
End If
|
||||
' ciclo sulle feature
|
||||
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
|
||||
If nFeatureLayer <> GDB_ID.NULL Then
|
||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
|
||||
While nFeatureId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
|
||||
Dim nPRId As Integer = 0
|
||||
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
' ripristino parametri Q
|
||||
If QParams.ContainsKey(sKey) Then
|
||||
For Each QPar In QParams(sKey)
|
||||
EgtSetInfo(nFeatureId, QPar.Key, QPar.Value)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
nFeatureId = EgtGetNext(nFeatureId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
nProduction_State = ItemState.ND
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
If bDuploToUpdate Then
|
||||
ResetCalcTotalPart()
|
||||
End If
|
||||
ElseIf PartModel.State > ItemState.ND And Not bLocked Then
|
||||
EgtDuploSetLocked(nPartId)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -350,6 +486,10 @@ Public Class PartVM
|
||||
|
||||
For Each BTLFeatureVM As BTLFeatureVM In all
|
||||
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
For Each BTLParamVM As BTLParamVM In BTLFeatureVM.QBTLParamVMList
|
||||
AddHandler BTLParamVM.PropertyChanged, AddressOf OnBTLQParamVMPropertyChanged
|
||||
Next
|
||||
AddHandler BTLFeatureVM.QBTLParamVMList.CollectionChanged, AddressOf OnBTLQParamVMListChanged
|
||||
Next
|
||||
|
||||
m_FeatureVMList = New ObservableCollection(Of Core.BTLFeatureVM)(all)
|
||||
@@ -382,6 +522,8 @@ Public Class PartVM
|
||||
End Property
|
||||
|
||||
Public Sub BackRotation()
|
||||
' se sta calcolando, esco subito
|
||||
If Map.refProjectVM.bCalcRunning Then Return
|
||||
' se MachGroup gia' mandato in produzione, esco
|
||||
If m_ParentMachGroupVM.nProduction_State >= ItemState.Assigned Then Return
|
||||
Rotate(False)
|
||||
@@ -402,6 +544,7 @@ Public Class PartVM
|
||||
End Property
|
||||
|
||||
Public Sub ForwardRotation()
|
||||
If Map.refProjectVM.bCalcRunning Then Return
|
||||
' se MachGroup gia' mandato in produzione, esco
|
||||
If m_ParentMachGroupVM.nProduction_State >= ItemState.Assigned Then Return
|
||||
Rotate(True)
|
||||
@@ -422,6 +565,27 @@ Public Class PartVM
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLQParamVMListChanged(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 OnBTLQParamVMPropertyChanged
|
||||
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 OnBTLQParamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLQParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
Case NameOf(sender.dValue), NameOf(sender.sValue)
|
||||
' setto pezzo da ricalcolare
|
||||
ResetCalcTotalPart()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -200,7 +200,7 @@ Public Class MachinePanelVM
|
||||
If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then
|
||||
' apro finestra di gestione lavorazioni travi
|
||||
Dim sTitle = EgtMsg(9000) 'Tabelle delle lavorazioni delle travi
|
||||
Dim BeamMchsWinVM As New BeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath)
|
||||
Dim BeamMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath)
|
||||
Dim BeamMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, BeamMchsWinVM)
|
||||
BeamMchsWinV.ShowDialog()
|
||||
Else
|
||||
@@ -219,7 +219,7 @@ Public Class MachinePanelVM
|
||||
If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then
|
||||
' apro finestra di gestione lavorazioni pareti
|
||||
Dim sTitle = EgtMsg(9010) 'Tabelle delle lavorazioni delle pareti
|
||||
Dim WallMchsWinVM As New BeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, False)
|
||||
Dim WallMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, False)
|
||||
Dim WallMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, WallMchsWinVM)
|
||||
WallMchsWinV.ShowDialog()
|
||||
Else
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports LiMan.Core
|
||||
|
||||
Public Class MainMenuVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_LiManTimer As New DispatcherTimer
|
||||
|
||||
Private m_MainMenu_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property MainMenu_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -162,6 +166,8 @@ Public Class MainMenuVM
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in EgtCAM5Map
|
||||
Map.SetRefMainMenuVM(Me)
|
||||
m_LiManTimer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||
AddHandler m_LiManTimer.Tick, AddressOf LiManTimer_Tick
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -189,6 +195,22 @@ Public Class MainMenuVM
|
||||
If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
|
||||
Map.refFeatureListVM.colFeature_Do.ColumnVisibility = Visibility.Visible
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In Map.refFeatureListVM.FeatureColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refPartListVM.PartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refStatisticsVM.StatisticsColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refPParameterListVM.PParameterListColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refQParameterListVM.QParameterListColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
' imposto dimensioni colonne/righe della Grid
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.PROJECT_VIEW, Map.refProjectVM.GridDims)
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.LEFTPANEL_VIEW, Map.refLeftPanelVM.GridDims)
|
||||
@@ -249,9 +271,6 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.SetProdManager_Visibility(True)
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
Map.refCALCPanelVM.SetChooseMachine_Visibility(False)
|
||||
If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
|
||||
Map.refFeatureListVM.colFeature_Do.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -268,6 +287,26 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
Map.refProjectVM.NotifyAllPanelVisibility()
|
||||
Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(False)
|
||||
Map.refTopPanelVM.UpdateQParameterVisibility()
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In Map.refFeatureListVM.FeatureColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refRawPartListVM.RawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refPartInRawPartListVM.PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refStatisticsVM.OptimizerStatisticsColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
|
||||
Map.refFeatureListVM.colFeature_Do.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
' imposto dimensioni colonne/righe della Grid
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.PROJECT_OPTIMIZER, Map.refProjectVM.GridDims)
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.LEFTPANEL_OPTIMIZER, Map.refLeftPanelVM.GridDims)
|
||||
@@ -354,8 +393,6 @@ Public Class MainMenuVM
|
||||
Private Function InitCONFIG() As Boolean
|
||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||
Map.refMainMenuVM.NotifyPropertyChanged(NameOf(Map.refMainMenuVM.SendFeedbackIsEnabled))
|
||||
' ricarico la lista delle colonne delle DataGrid in ConfigurationPage
|
||||
If Not IsNothing(Map.refConfigurationPageVM) Then Map.refConfigurationPageVM.LoadConfigDGColumns()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -363,21 +400,6 @@ Public Class MainMenuVM
|
||||
Map.refConfigurationPageVM.VerifyConfigPageModification()
|
||||
' resetto flag inserimento password
|
||||
Map.refConfigurationPageVM.bModifyMachParam = False
|
||||
' ricarico le EgtDataGrid del programma con le colonne customizzate
|
||||
Map.refFeatureListVM.FeatureColumns.Clear()
|
||||
Map.refPartListVM.PartColumns.Clear()
|
||||
Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns.Clear()
|
||||
Map.refStatisticsVM.StatisticsColumns.Clear()
|
||||
Map.refStatisticsVM.OptimizerStatisticsColumns.Clear()
|
||||
Map.refPParameterListVM.PParameterListColumns.Clear()
|
||||
Map.refQParameterListVM.QParameterListColumns.Clear()
|
||||
GetPrivateProfileColumns(S_FEATURELIST, Map.refFeatureListVM.FeatureColumns)
|
||||
GetPrivateProfileColumns(S_PARTLIST, Map.refPartListVM.PartColumns)
|
||||
GetPrivateProfileColumns(S_FEATUREINPARTINRAWPARTLIST, Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns)
|
||||
GetPrivateProfileColumns(S_STATISTICS, Map.refStatisticsVM.StatisticsColumns)
|
||||
GetPrivateProfileColumns(S_OPTIMIZERSTATISTICS, Map.refStatisticsVM.OptimizerStatisticsColumns)
|
||||
GetPrivateProfileColumns(S_PARAMETERLIST_P, Map.refPParameterListVM.PParameterListColumns)
|
||||
GetPrivateProfileColumns(S_PARAMETERLIST_Q, Map.refQParameterListVM.QParameterListColumns)
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
@@ -447,6 +469,7 @@ Public Class MainMenuVM
|
||||
MessageBox.Show(EgtMsg(61891), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
Dim FileToSendList As New List(Of String)
|
||||
' Recupero indirizzo a cui spedire la mail
|
||||
Dim sSupportAddress As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress)
|
||||
@@ -483,48 +506,19 @@ Public Class MainMenuVM
|
||||
End If
|
||||
Dim sExportFileName = Map.refProjManagerVM.CurrProj.nProjId.ToString("0000") & " - " & Map.refProjManagerVM.CurrProj.sBTLFileName & " - ProjectExport"
|
||||
Dim sExpZipToCreate = Map.refProjManagerVM.ExportProject(sExportFileName)
|
||||
' Creo zip file da allegare
|
||||
Dim sZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Feedback.zip"
|
||||
If File.Exists(sZipToCreate) Then
|
||||
File.Delete(sZipToCreate)
|
||||
|
||||
|
||||
' creo zip del progetto esportato, BTLFeatures.ini e Log
|
||||
Dim sExpAndMoreZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\" & sExportFileName & " and more.zip"
|
||||
If File.Exists(sExpAndMoreZipToCreate) Then
|
||||
File.Delete(sExpAndMoreZipToCreate)
|
||||
End If
|
||||
Try
|
||||
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
|
||||
Using zip As New Ionic.Zip.ZipFile(sExpAndMoreZipToCreate, Console.Out)
|
||||
' aggiungo progetto esportato
|
||||
If File.Exists(sExpZipToCreate) Then
|
||||
zip.AddItem(sExpZipToCreate, "")
|
||||
End If
|
||||
' aggiungo Prod e Proj associati
|
||||
Dim ProdId As Integer
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
ProdId = Map.refProjManagerVM.CurrProj.nProdId
|
||||
Case Pages.MACHINING
|
||||
ProdId = Map.refProdManagerVM.CurrProd.nProdId
|
||||
End Select
|
||||
If ProdId = 0 Then
|
||||
zip.AddItem(Map.refProjManagerVM.CurrProj.sProjDirPath, "Projs\" & Map.refProjManagerVM.CurrProj.nProjId.ToString("0000"))
|
||||
Else
|
||||
ProjFileMList = DbControllers.m_ProjController.GetByProdAsc(ProdId)
|
||||
' se piu' di uno
|
||||
If IsNothing(ProjFileMList) Then
|
||||
Return
|
||||
ElseIf ProjFileMList.Count > 0 Then
|
||||
Dim ProjFileVMList As New List(Of ProjectFileVM)
|
||||
For Each Project In ProjFileMList
|
||||
ProjFileVMList.Add(New ProjFileVM(Project))
|
||||
Next
|
||||
For Each ProjFileVMItem In ProjFileVMList
|
||||
zip.AddItem(ProjFileVMItem.sProjDirPath, "Projs\" & ProjFileVMItem.nProjId.ToString("0000"))
|
||||
Next
|
||||
zip.AddItem(ProjFileVMList(0).sProdDirPath, "Prods\" & ProjFileVMList(0).nProdId.ToString("0000"))
|
||||
End If
|
||||
End If
|
||||
' aggiungo cartella macchina del progetto
|
||||
Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sMachineName
|
||||
If Directory.Exists(sMachineDir) Then
|
||||
zip.AddItem(sMachineDir, sMachineName)
|
||||
End If
|
||||
' aggiungo file log
|
||||
If File.Exists(Map.refMainWindowVM.MainWindowM.sLogFile) Then
|
||||
zip.AddItem(Map.refMainWindowVM.MainWindowM.sLogFile, "")
|
||||
@@ -536,30 +530,167 @@ Public Class MainMenuVM
|
||||
' salvo lo zip
|
||||
zip.Save()
|
||||
End Using
|
||||
FileToSendList.Add(sExpAndMoreZipToCreate)
|
||||
|
||||
' creo zip della cartella macchina
|
||||
Dim sMachineZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\" & sMachineName & ".zip"
|
||||
If File.Exists(sMachineZipToCreate) Then
|
||||
File.Delete(sMachineZipToCreate)
|
||||
End If
|
||||
Using zip As New Ionic.Zip.ZipFile(sMachineZipToCreate, Console.Out)
|
||||
' aggiungo cartella macchina del progetto
|
||||
Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sMachineName
|
||||
If Directory.Exists(sMachineDir) Then
|
||||
zip.AddItem(sMachineDir, sMachineName)
|
||||
End If
|
||||
' salvo lo zip
|
||||
zip.Save()
|
||||
End Using
|
||||
FileToSendList.Add(sMachineZipToCreate)
|
||||
|
||||
' aggiungo Prod e Proj associati
|
||||
Dim ProdId As Integer
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
ProdId = Map.refProjManagerVM.CurrProj.nProdId
|
||||
Case Pages.MACHINING
|
||||
ProdId = Map.refProdManagerVM.CurrProd.nProdId
|
||||
End Select
|
||||
If ProdId = 0 Then
|
||||
' Creo zip del Proj
|
||||
Dim sProjZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Projs.zip"
|
||||
If File.Exists(sProjZipToCreate) Then
|
||||
File.Delete(sProjZipToCreate)
|
||||
End If
|
||||
' aggiungo lo zip del solo Proj
|
||||
Using zip As New Ionic.Zip.ZipFile(sProjZipToCreate, Console.Out)
|
||||
zip.AddItem(Map.refProjManagerVM.CurrProj.sProjDirPath, "Projs\" & Map.refProjManagerVM.CurrProj.nProjId.ToString("0000"))
|
||||
' salvo lo zip
|
||||
zip.Save()
|
||||
End Using
|
||||
FileToSendList.Add(sProjZipToCreate)
|
||||
Else
|
||||
ProjFileMList = DbControllers.m_ProjController.GetByProdAsc(ProdId)
|
||||
' se piu' di uno
|
||||
If IsNothing(ProjFileMList) Then
|
||||
Return
|
||||
ElseIf ProjFileMList.Count > 0 Then
|
||||
Dim ProjFileVMList As New List(Of ProjectFileVM)
|
||||
For Each Project In ProjFileMList
|
||||
ProjFileVMList.Add(New ProjFileVM(Project))
|
||||
Next
|
||||
' prima creo zip del Proj
|
||||
Dim sProjZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Projs.zip"
|
||||
If File.Exists(sProjZipToCreate) Then
|
||||
File.Delete(sProjZipToCreate)
|
||||
End If
|
||||
' aggiungo lo zip del Proj riempiendolo con tutti i Proj associati
|
||||
Using zip As New Ionic.Zip.ZipFile(sProjZipToCreate, Console.Out)
|
||||
For Each ProjFileVMItem In ProjFileVMList
|
||||
zip.AddItem(ProjFileVMItem.sProjDirPath, "Projs\" & ProjFileVMItem.nProjId.ToString("0000"))
|
||||
Next
|
||||
' salvo lo zip
|
||||
zip.Save()
|
||||
End Using
|
||||
FileToSendList.Add(sProjZipToCreate)
|
||||
' ora creo zip del Prod
|
||||
Dim sProdZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Prods.zip"
|
||||
If File.Exists(sProdZipToCreate) Then
|
||||
File.Delete(sProdZipToCreate)
|
||||
End If
|
||||
' ora aggiungo lo zip del Prod
|
||||
Using zip As New Ionic.Zip.ZipFile(sProdZipToCreate, Console.Out)
|
||||
zip.AddItem(ProjFileVMList(0).sProdDirPath, "Prods\" & ProjFileVMList(0).nProdId.ToString("0000"))
|
||||
' salvo lo zip
|
||||
zip.Save()
|
||||
End Using
|
||||
FileToSendList.Add(sProdZipToCreate)
|
||||
End If
|
||||
End If
|
||||
Catch ex1 As Exception
|
||||
EgtOutLog("Exception in zip: " & ex1.ToString())
|
||||
End Try
|
||||
' preparo la mail per il supporto
|
||||
Dim bEx As Boolean = False
|
||||
Try
|
||||
Dim sAddressArray As String() = sSupportAddress.Split(CType(",", Char()))
|
||||
Dim SendFeedbackWindow As New EgtWPFLib5.MapiMailMessage("EgtBEAMWALL Feedback - " & sKey)
|
||||
SendFeedbackWindow.Recipients.Add(sAddressArray(0))
|
||||
For index As Integer = 1 To sAddressArray.Length() - 1
|
||||
SendFeedbackWindow.Recipients.Add(sAddressArray(index), EgtWPFLib5.MapiMailMessage.RecipientType.CC)
|
||||
|
||||
' recupero codice chiave di protezione
|
||||
'Dim sLicFileName As String = String.Empty
|
||||
'GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
|
||||
'Dim sLicFile As String = Map.refMainWindowVM.MainWindowM.sConfigDir & "\" & sLicFileName
|
||||
'Dim sKey As String = String.Empty
|
||||
'EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||
|
||||
' recupero contatti cliente
|
||||
Dim sContactEmail As String = String.Empty
|
||||
Dim sContactName As String = String.Empty
|
||||
Dim sContactPhone As String = String.Empty
|
||||
GetMainPrivateProfileString(S_CUSTOMERCONTACT, K_CONTACTEMAIL, "", sContactEmail)
|
||||
GetMainPrivateProfileString(S_CUSTOMERCONTACT, K_CONTACTNAME, "", sContactName)
|
||||
GetMainPrivateProfileString(S_CUSTOMERCONTACT, K_CONTACTPHONE, "", sContactPhone)
|
||||
|
||||
Dim sp As SupportRequest = New SupportRequest("Uploader",
|
||||
sKey,
|
||||
"EgalWare",
|
||||
sContactEmail,
|
||||
sContactName,
|
||||
sContactPhone,
|
||||
"4AIc8fMEXcSyDIMl1Ro05O/1xar7nrVHXAQzrh/fmxfvlczA13tQwXAqida6hTqV",
|
||||
"Upload da sendlog di EGT BeamWall",
|
||||
0,
|
||||
TipologiaTicket.FileUpload)
|
||||
|
||||
' specifico le cartelle Data (da cui prendere i file) e Archive (in cui archiviare i file)
|
||||
Dim sDataFolderPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Data"
|
||||
Dim sArchiveFolderPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Archive"
|
||||
' creo le cartelle
|
||||
DeleteDirectory(sDataFolderPath)
|
||||
Directory.CreateDirectory(sDataFolderPath)
|
||||
If Not Directory.Exists(sArchiveFolderPath) Then
|
||||
Directory.CreateDirectory(sArchiveFolderPath)
|
||||
End If
|
||||
' muovo zip e json nella cartella Data
|
||||
For Each FileName In FileToSendList
|
||||
Dim mFile As FileInfo = New FileInfo(FileName)
|
||||
mFile.MoveTo(sDataFolderPath & "\" & mFile.Name)
|
||||
Next
|
||||
SupportRequest.SaveRequest(sp, sDataFolderPath & "\request.json")
|
||||
|
||||
' eseguo LiMan Transfer con le 2 cartelle come argomenti
|
||||
Dim Proc = New Process()
|
||||
Proc.StartInfo.FileName = Map.refMainWindowVM.MainWindowM.sLiManTransferExe
|
||||
Proc.StartInfo.Arguments = sDataFolderPath & " " & sArchiveFolderPath
|
||||
Proc.StartInfo.CreateNoWindow = True
|
||||
Proc.StartInfo.UseShellExecute = False
|
||||
AddHandler Proc.Exited, AddressOf Proc_Exited
|
||||
|
||||
For Inde = 0 To 100
|
||||
If Not m_LiManTimer.IsEnabled Then Exit For
|
||||
Threading.Thread.Sleep(100)
|
||||
Next
|
||||
If Not m_LiManTimer.IsEnabled AndAlso Proc.Start() Then
|
||||
m_LiManTimer.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Proc_Exited()
|
||||
m_LiManTimer.Stop()
|
||||
End Sub
|
||||
|
||||
Private Sub LiManTimer_Tick()
|
||||
m_LiManTimer.Stop()
|
||||
EgtOutLog("LiMan Transfer timeout!")
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteDirectory(path As String)
|
||||
If Directory.Exists(path) Then
|
||||
'Delete all files from the Directory
|
||||
For Each filepath As String In Directory.GetFiles(path)
|
||||
File.Delete(filepath)
|
||||
Next
|
||||
If Not String.IsNullOrWhiteSpace(sZipToCreate) AndAlso File.Exists(sZipToCreate) Then
|
||||
SendFeedbackWindow.Files.Add(Map.refMainWindowVM.MainWindowM.sTempDir & "\Feedback.zip")
|
||||
End If
|
||||
SendFeedbackWindow.ShowDialog()
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Feedback exception: " & ex.ToString)
|
||||
bEx = True
|
||||
End Try
|
||||
If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then
|
||||
MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
|
||||
Else
|
||||
Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(MSG_TOPCOMMANDBAR + 14))
|
||||
'Delete all child Directories
|
||||
For Each dir As String In Directory.GetDirectories(path)
|
||||
DeleteDirectory(dir)
|
||||
Next
|
||||
'Delete a Directory
|
||||
Directory.Delete(path)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -152,6 +152,14 @@ Public Class MainWindowM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property sLiManTransferExe As String
|
||||
Get
|
||||
Dim sTransferExe As String = ""
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LIMANUTILITIES, LIMANTRANSFER_EXE, sTransferExe)
|
||||
Return sTransferExe
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -221,8 +229,8 @@ Public Class MainWindowM
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2401, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2401, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2402, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2402, 1, m_nKeyOptions)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
m_sLogFile = m_sTempDir & "\" & VWOPTGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||
@@ -284,7 +292,7 @@ Public Class MainWindowM
|
||||
Private Sub ManageInstance()
|
||||
Dim bCreated As Boolean
|
||||
Try
|
||||
m_objMutex = New Mutex(False, "Global\OmagOFFICE", bCreated)
|
||||
m_objMutex = New Mutex(False, "Global\EgtBEAMWALL.ViewerOptimizer", bCreated)
|
||||
Catch
|
||||
bCreated = False
|
||||
End Try
|
||||
@@ -293,15 +301,15 @@ Public Class MainWindowM
|
||||
' Prima istanza
|
||||
m_nInstance = 1
|
||||
' Aggiorno stato istanze attive
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString())
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_VIEWOPTIM_INSTANCES, m_nInstance.ToString())
|
||||
Else
|
||||
' Leggo il massimo numero di istanze ammesse
|
||||
Dim nMaxInst As Integer = GetMaxInstances()
|
||||
' Cerco il primo indice di istanza libero
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_VIEWOPTIM_INSTANCES, 0)
|
||||
m_nInstance = 1
|
||||
Dim nMask As Integer = 1
|
||||
While (nTmp And nMask) <> 0 And m_nInstance < MAX_INST
|
||||
While (nTmp And nMask) <> 0 And m_nInstance <= MAX_INST
|
||||
m_nInstance += 1
|
||||
nMask *= 2
|
||||
End While
|
||||
@@ -334,7 +342,7 @@ Public Class MainWindowM
|
||||
End If
|
||||
' Aggiorno stato istanze attive
|
||||
nTmp += (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_VIEWOPTIM_INSTANCES, nTmp.ToString())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -345,7 +353,7 @@ Public Class MainWindowM
|
||||
Friend Function GetMaxInstances() As Integer
|
||||
' Leggo il massimo numero di istanze ammesse
|
||||
Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
|
||||
Return Max(1, Min(nMaxInst, MAX_INST))
|
||||
Return 1 ' Max(1, Min(nMaxInst, MAX_INST))
|
||||
End Function
|
||||
|
||||
Friend Function GetMaxCamInstances() As Integer
|
||||
@@ -357,12 +365,14 @@ Public Class MainWindowM
|
||||
Friend Sub Close()
|
||||
' Terminazione generale di EgtInterface
|
||||
EgtExit()
|
||||
' Aggiorno istanze usate
|
||||
m_objMutex.WaitOne(1000)
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_VIEWOPTIM_INSTANCES, 0)
|
||||
nTmp -= (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_VIEWOPTIM_INSTANCES, nTmp.ToString())
|
||||
m_objMutex.ReleaseMutex()
|
||||
' Rilascio mutex
|
||||
If Not IsNothing(m_objMutex) Then m_objMutex.Close()
|
||||
' Aggiorno istanze usate
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
nTmp -= (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="MovePartInRawPartWndV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="MovePartInRawPartWndV">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding MoveDirMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0,5"/>
|
||||
|
||||
<RadioButton IsChecked="{Binding LeftIsChecked}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"
|
||||
Grid.Row="1" Grid.Column="0">
|
||||
<Image Source="/Resources/MovePartInRawPart/MoveLeftParts.png" Stretch="Uniform"/>
|
||||
</RadioButton>
|
||||
<RadioButton IsChecked="{Binding RightIsChecked}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"
|
||||
Grid.Row="1" Grid.Column="1">
|
||||
<Image Source="/Resources/MovePartInRawPart/MoveRightParts.png" Stretch="Uniform"/>
|
||||
</RadioButton>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding MoveLenMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,5"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sMoveLen}"
|
||||
Grid.Row="1"
|
||||
Width="200"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="3"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="Cancel"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class MovePartInRawPartWndV
|
||||
|
||||
Private WithEvents m_MovePartInRawPartWndVM As MovePartInRawPartWndVM
|
||||
|
||||
Sub New(Owner As Window, MovePartInRawPartWndVM As MovePartInRawPartWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = MovePartInRawPartWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_MovePartInRawPartWndVM = MovePartInRawPartWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_MovePartInRawPartWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,147 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class MovePartInRawPartWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_dMoveLen As Double
|
||||
Public ReadOnly Property dMoveLen As Double
|
||||
Get
|
||||
Return m_dMoveLen
|
||||
End Get
|
||||
End Property
|
||||
Public Property sMoveLen As String
|
||||
Get
|
||||
Return LenToString(m_dMoveLen, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempMoveLen As Double
|
||||
If StringToLen(value, dTempMoveLen) AndAlso dTempMoveLen > 0 Then
|
||||
m_dMoveLen = dTempMoveLen
|
||||
Else
|
||||
m_dMoveLen = 0
|
||||
NotifyPropertyChanged(NameOf(sMoveLen))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LeftIsChecked As Boolean
|
||||
Public Property LeftIsChecked As Boolean
|
||||
Get
|
||||
Return m_LeftIsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value <> m_LeftIsChecked Then
|
||||
m_LeftIsChecked = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_RightIsChecked As Boolean
|
||||
Public Property RightIsChecked As Boolean
|
||||
Get
|
||||
Return m_RightIsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value <> m_RightIsChecked Then
|
||||
m_RightIsChecked = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property MoveDirMsg As String
|
||||
Get
|
||||
Return EgtMsg(61945)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MoveLenMsg As String
|
||||
Get
|
||||
Return EgtMsg(61946)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' MESSAGES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' setto il bottone Left a premuto
|
||||
LeftIsChecked = True
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf Ok)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
' verifico che il campo dello spostamento abbia un valore valido
|
||||
If Not IsNothing(m_dMoveLen) AndAlso m_dMoveLen > 0 Then
|
||||
' calcolo BBox globale del grezzo
|
||||
Dim b3RawPart As New BBox3d
|
||||
EgtGetBBoxGlob(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.Id, GDB_BB.ONLY_VISIBLE, b3RawPart)
|
||||
' calcolo BBox globale dei pezzi aggiunti al grezzo
|
||||
Dim b3Parts As New BBox3d
|
||||
For Each Part In Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.PartVMList
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(Part.nPartId, GDB_BB.ONLY_VISIBLE, b3Part)
|
||||
b3Parts.Add(b3Part)
|
||||
Next
|
||||
' ricavo coordinate minime e massime sull'asse X dei BBox del grezzo e dei pezzi
|
||||
Dim dRawPartMinL As Double = b3RawPart.Min.x
|
||||
Dim dRawPartMaxL As Double = b3RawPart.Max.x
|
||||
Dim dPartsMinL As Double = b3Parts.Min.x
|
||||
Dim dPartsMaxL As Double = b3Parts.Max.x
|
||||
' ricavo il vettore di spostamento
|
||||
Dim vtMove As Vector3d = New Vector3d(If(LeftIsChecked, dMoveLen, -dMoveLen), 0, 0)
|
||||
' verifico che i pezzi venendo mossi non escano dal box
|
||||
If dPartsMinL + vtMove.x > dRawPartMinL And dPartsMaxL + vtMove.x < dRawPartMaxL Then
|
||||
' muovo i pezzi di quanto possibile
|
||||
If vtMove.SqLen() > EPS_SMALL * EPS_SMALL Then
|
||||
' muovo tutti i pezzi della lista
|
||||
For Each Part In Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.PartVMList
|
||||
EgtMovePartInRawPart(Part.nPartId, vtMove)
|
||||
' aggiorno valori nella tabella
|
||||
Part.NotifyPropertyChanged(NameOf(PartVM.dPOSX))
|
||||
Part.NotifyPropertyChanged(NameOf(PartVM.sPOSX))
|
||||
Part.NotifyPropertyChanged(NameOf(PartVM.dPOSY))
|
||||
Part.NotifyPropertyChanged(NameOf(PartVM.sPOSY))
|
||||
EgtZoom(ZM.ALL)
|
||||
Next
|
||||
End If
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61947), EgtMsg(30007))
|
||||
End If
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61948), EgtMsg(30007))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -70,5 +70,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.1.4")>
|
||||
<Assembly: AssemblyFileVersion("2.4.1.4")>
|
||||
<Assembly: AssemblyVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.2.1")>
|
||||
|
||||
@@ -151,7 +151,7 @@ Public Class NestingRunningWndVM
|
||||
m_RotFlipList.Add(BTLPart)
|
||||
' se ho selezionato nest per materiale e c'è una sezione selezionata diversa da sezione nulla
|
||||
ElseIf SelPartType = OptimizePanelVM.PartType.MATERIAL AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelSection) AndAlso Map.refProjectVM.BTLStructureVM.SelSection.dH <> -1 Then
|
||||
m_RotFlipList = Map.refProjectVM.BTLStructureVM.BTLPartVMList.Where(Function(x) x.Section = Map.refProjectVM.BTLStructureVM.SelSection)
|
||||
m_RotFlipList = Map.refProjectVM.BTLStructureVM.BTLPartVMList.Where(Function(x) x.Section = Map.refProjectVM.BTLStructureVM.SelSection).ToList()
|
||||
Else
|
||||
' altrimenti prendo tutti i pezzi
|
||||
m_RotFlipList = Map.refProjectVM.BTLStructureVM.BTLPartVMList.ToList()
|
||||
@@ -268,7 +268,7 @@ Public Class NestingRunningWndVM
|
||||
For Each SectionProgress In m_SectionProgressList
|
||||
'Dim SectionPartList As New List(Of BTLPartM)(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Where(Function(x) x.Section = Section.SectXMat).ToList())
|
||||
Dim SectionPartList As List(Of BTLPartM) = (From x In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
Where x.Section = SectionProgress.Section AndAlso x.bDO
|
||||
Where x.Section = SectionProgress.Section AndAlso x.bDO AndAlso x.nCNT + x.nADDED > x.nINPROD
|
||||
Select x.BTLPartM).ToList()
|
||||
SectionProgress.SetSectionPartList(SectionPartList)
|
||||
Next
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<EgtFloating:EgtFloatingPanel x:Class="OptimizePanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
|
||||
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
|
||||
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||
|
||||
<ComboBox ItemsSource="{Binding PartTypeList}"
|
||||
SelectedItem="{Binding SelPartType}"
|
||||
Height="22"
|
||||
Width="85"
|
||||
Margin="5,0,2.5,0"
|
||||
Visibility="{Binding MachiningPage_Visibility}"/>
|
||||
Visibility="{Binding Optimize_Visibility}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding OriginTypeList}"
|
||||
SelectedItem="{Binding SelOriginType}"
|
||||
@@ -41,15 +41,15 @@
|
||||
FontWeight="Light"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding Optimize_Command}"
|
||||
IsEnabled="{Binding OptimizePanel_IsEnabled}"
|
||||
Visibility="{Binding MachiningPage_Visibility}">
|
||||
IsEnabled="{Binding Optimize_IsEnabled}"
|
||||
Visibility="{Binding Optimize_Visibility}">
|
||||
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
|
||||
</Button>
|
||||
|
||||
<Button Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding CalcRotFlip_Command}"
|
||||
IsEnabled="{Binding CalcRotFlip_IsEnabled}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
Visibility="{Binding CalcRotFlip_Visibility}"
|
||||
ToolTip="{Binding CalcRotFlip_ToolTip}">
|
||||
<Image Source="/Resources/OptimizePanel/FlipRot.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
@@ -57,7 +57,7 @@
|
||||
<Button Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding UnlockFlip_Command}"
|
||||
IsEnabled="{Binding CalcRotFlip_IsEnabled}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
Visibility="{Binding CalcRotFlip_Visibility}"
|
||||
ToolTip="{Binding UnlockFlip_ToolTip}">
|
||||
<Image Source="/Resources/OptimizePanel/UnlockFlip.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
@@ -65,7 +65,7 @@
|
||||
<Button Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding UnlockRot_Command}"
|
||||
IsEnabled="{Binding CalcRotFlip_IsEnabled}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
Visibility="{Binding CalcRotFlip_Visibility}"
|
||||
ToolTip="{Binding UnlockRot_ToolTip}">
|
||||
<Image Source="/Resources/OptimizePanel/UnlockRotation.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
@@ -98,10 +98,23 @@ Public Class OptimizePanelVM
|
||||
Return m_Optimize_IsEnabled
|
||||
End Get
|
||||
End Property
|
||||
Private m_CalcDisp_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property CalcDisp_IsEnabled As Boolean
|
||||
Private m_CalcRotFlip_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property CalcRotFlip_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_CalcDisp_IsEnabled
|
||||
Return m_CalcRotFlip_IsEnabled
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CalcRotFlip_Visibility As Visibility
|
||||
Get
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO), Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Optimize_Visibility As Visibility
|
||||
Get
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso
|
||||
(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse
|
||||
(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))), Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -190,12 +203,13 @@ Public Class OptimizePanelVM
|
||||
' se pareti e senza opzione nesting, lascio disabilitato
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Not Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO) Then
|
||||
m_Optimize_IsEnabled = False
|
||||
m_CalcDisp_IsEnabled = False
|
||||
m_CalcRotFlip_IsEnabled = False
|
||||
Else
|
||||
m_Optimize_IsEnabled = bIsEnabled
|
||||
m_CalcDisp_IsEnabled = bIsEnabled
|
||||
m_CalcRotFlip_IsEnabled = bIsEnabled
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Optimize_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(CalcRotFlip_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Friend Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
|
||||
|
||||
@@ -89,6 +89,14 @@
|
||||
Margin="0,0,10,0">
|
||||
<Image Source="/Resources/PartManager/RightRotate.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
<!--Comando inutilizzato ma conservato per eventuale rotazione a causa di importazione con rotazione sbagliata-->
|
||||
<!--<Button Command="{Binding Tag.XRotation_Command,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartManagerV}}}"
|
||||
Style="{StaticResource ToolBar_SmallButton}"
|
||||
Margin="0,0,10,0">
|
||||
<Image Source="/Resources/PartManager/RightRotate.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
<TextBlock Text="{Binding Tag.sNAM,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartManagerV}}}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
</Button>-->
|
||||
<Button Command="{Binding AddProj_Command}"
|
||||
ToolTip="{Binding AddProj_ToolTip}"
|
||||
Visibility="Collapsed"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user