Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c2a3fdfbd4 | |||
| 0218880d93 | |||
| 3752846faa | |||
| 31822c78a4 | |||
| a36313b9b2 | |||
| bd13256399 | |||
| 83bfe07c50 | |||
| ae7474445d | |||
| ebec1bb583 | |||
| acd66d7738 | |||
| 7be48bd00a | |||
| 136de45c47 | |||
| 93c4e02633 | |||
| f47bf047b8 | |||
| b0c6bb52f8 | |||
| f8dc8d075b | |||
| 927f171cd6 | |||
| 5ca6f13899 | |||
| b68f6bfeee |
@@ -666,7 +666,7 @@ Public Class BTLPartM
|
||||
Private m_sCALC_MSG As String
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
Return MessageFromLuaMsg(m_sCALC_MSG)
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
@@ -1001,6 +1001,16 @@ Public Class BTLPartM
|
||||
Return TempList
|
||||
End Function
|
||||
|
||||
Private Function MessageFromLuaMsg(LuaMsg As String) As String
|
||||
Dim sSplit() As String = LuaMsg.Split("$$")
|
||||
Dim nMsg As Integer = -1
|
||||
If sSplit.Count > 1 AndAlso Integer.TryParse(sSplit(0), nMsg) Then
|
||||
Return EgtMsg(65000 + nMsg)
|
||||
Else
|
||||
Return LuaMsg
|
||||
End If
|
||||
End Function
|
||||
|
||||
'Sub New(ParentStructure As BTLStructureVM, nPartId As Integer)
|
||||
' MyBase.New(ParentStructure, nPartId)
|
||||
' ' leggo info pezzo
|
||||
|
||||
@@ -75,8 +75,6 @@ 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"
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ Public Module ConstIni
|
||||
'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 K_UPDATEBTL As String = "UpdateBtl"
|
||||
|
||||
'Public Const S_LANGUAGES As String = "Languages"
|
||||
'Public Const K_LANGUAGE As String = "Language"
|
||||
@@ -134,11 +134,6 @@ 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"
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml" />
|
||||
@@ -108,6 +109,11 @@
|
||||
<Compile Include="BTLModel\BTLPartM.vb" />
|
||||
<Compile Include="BTLModel\BTLStructureM.vb" />
|
||||
<Compile Include="Constants\ConstBeam.vb" />
|
||||
<Compile Include="LoadingWnd\LoadingWndHelper.vb" />
|
||||
<Compile Include="LoadingWnd\LoadingWndV.xaml.vb">
|
||||
<DependentUpon>LoadingWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LoadingWnd\LoadingWndVM.vb" />
|
||||
<Compile Include="Utility\DimensionsIniFile.vb" />
|
||||
<Compile Include="Utility\Enum.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||
@@ -135,6 +141,7 @@
|
||||
<Compile Include="Lib\MachGroupM.vb" />
|
||||
<Compile Include="Lib\MachGroupPanelM.vb" />
|
||||
<Compile Include="MachGroupModel\MyMachGroupPanelM.vb" />
|
||||
<Compile Include="Utility\ManageWindow.vb" />
|
||||
<Compile Include="Utility\MyMachine.vb" />
|
||||
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml.vb">
|
||||
<DependentUpon>OpenProjectFileDialogV.xaml</DependentUpon>
|
||||
@@ -180,6 +187,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="LoadingWnd\LoadingWndV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
||||
</Page>
|
||||
<Page Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Windows.Forms
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
@@ -32,8 +31,7 @@ Public Module DataGridColumnsIniFile
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
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))
|
||||
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible))
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
@@ -69,8 +67,7 @@ Public Module DataGridColumnsIniFile
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
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)
|
||||
Column = New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible)
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -2,13 +2,18 @@
|
||||
x:Name="CurrDataGrid"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<EventSetter Event="SizeChanged" Handler="Cell_SizedChanged" />
|
||||
<EventSetter Event="MouseRightButtonDown" Handler="Cell_MouseRightButtonDown" />
|
||||
<EventSetter Event="FrameworkElement.Loaded" Handler="DataGridColumnHeader_Loaded"/>
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Stretch" />
|
||||
<EventSetter Event="SizeChanged"
|
||||
Handler="Cell_SizedChanged" />
|
||||
<EventSetter Event="MouseRightButtonDown"
|
||||
Handler="Cell_MouseRightButtonDown" />
|
||||
<EventSetter Event="FrameworkElement.Loaded"
|
||||
Handler="DataGridColumnHeader_Loaded"/>
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Windows.Data
|
||||
@@ -149,23 +148,19 @@ Public Class EgtDataGrid
|
||||
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))
|
||||
@@ -188,7 +183,6 @@ Public Class EgtDataGrid
|
||||
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)
|
||||
@@ -197,7 +191,6 @@ Public Class EgtDataGrid
|
||||
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()
|
||||
@@ -358,38 +351,6 @@ Public Class EgtDataGrid
|
||||
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
|
||||
@@ -541,30 +502,11 @@ 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, nSortDirection As Integer)
|
||||
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)
|
||||
m_ParentDataGridName = sParentDG
|
||||
m_Name = sName
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
@@ -574,7 +516,6 @@ Public Class EgtDataGridColumn
|
||||
m_Width = Width
|
||||
m_Visible = bVisible
|
||||
m_CanUserEditVisible = bCanUserEditVisible
|
||||
m_SortDirection = nSortDirection
|
||||
End Sub
|
||||
|
||||
Friend Sub InitColumn(dgColumn As DataGridColumn)
|
||||
@@ -586,18 +527,13 @@ 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) & "," & CInt(SortDirection)
|
||||
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)
|
||||
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
Imports System.Threading
|
||||
Imports System.Windows.Threading
|
||||
|
||||
Public Module LoadingWndHelper
|
||||
|
||||
Public Enum ActiveIds As Integer
|
||||
OPENPROJ = 1
|
||||
SAVEPROJ = 2
|
||||
IMPORTBTL = 3
|
||||
GOTOPROD = 4
|
||||
OPENPROD = 5
|
||||
SAVEPROD = 6
|
||||
GOTOPROJ = 7
|
||||
EXPORTPROJECT = 8
|
||||
IMPORTPROJECT = 9
|
||||
CHANGEPARAM = 10
|
||||
End Enum
|
||||
|
||||
Dim m_MainWindow As Windows.Window
|
||||
Public Function SetMainWindow(MainWindow As Windows.Window)
|
||||
m_MainWindow = MainWindow
|
||||
End Function
|
||||
|
||||
Private m_bMainWindow_IsActive As Boolean = True
|
||||
Public Function SetMainWindowIsActive(IsActive As Boolean)
|
||||
m_bMainWindow_IsActive = IsActive
|
||||
End Function
|
||||
|
||||
Delegate Sub CallbackLoadingDlg(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
|
||||
|
||||
Private m_thread As Thread
|
||||
Private m_LoadingWndVM As Core.LoadingWndVM
|
||||
Private m_CurrStep As Integer
|
||||
Private m_StepText As String
|
||||
Private m_nProgress As Integer
|
||||
Private m_nNextProgress As Integer
|
||||
Private m_bClose As Boolean
|
||||
Private m_bActiveId As Integer = -1
|
||||
|
||||
Public Function OpenLoadingWnd(Id As Integer, nSteps As Integer, TotText As String, FirstStepText As String, nNextProgress As Integer) As Boolean
|
||||
If m_bActiveId > 0 Then Return False
|
||||
m_bActiveId = Id
|
||||
m_LoadingWndVM = Nothing
|
||||
m_CurrStep = 1
|
||||
m_StepText = FirstStepText
|
||||
m_nProgress = 1
|
||||
m_nNextProgress = nNextProgress
|
||||
m_bClose = False
|
||||
Dim Top As Double = m_MainWindow.Top + (m_MainWindow.Height / 2) - 100
|
||||
Dim Left As Double = m_MainWindow.Left + (m_MainWindow.Width / 2) - 150
|
||||
Dim WindowStartupLocation As Windows.WindowStartupLocation = Windows.WindowStartupLocation.Manual
|
||||
If m_MainWindow.WindowState = Windows.WindowState.Maximized Then
|
||||
WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen
|
||||
End If
|
||||
m_thread = New Thread(Sub()
|
||||
m_LoadingWndVM = New Core.LoadingWndVM(nSteps, TotText, AddressOf LoadingCallback)
|
||||
m_LoadingWndVM.UpdateProgress(m_CurrStep, m_StepText, m_nProgress, m_nNextProgress)
|
||||
Dim LoadingWnd As New LoadingWndV(Nothing, m_LoadingWndVM)
|
||||
' posiziono la finestra
|
||||
If WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen Then
|
||||
LoadingWnd.WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen
|
||||
Else
|
||||
LoadingWnd.Top = Top
|
||||
LoadingWnd.Left = Left
|
||||
End If
|
||||
LoadingWnd.Show()
|
||||
Dispatcher.Run()
|
||||
End Sub)
|
||||
m_thread.SetApartmentState(ApartmentState.STA)
|
||||
m_thread.Start()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub LoadingCallback(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
|
||||
CurrStep = m_CurrStep
|
||||
StepText = m_StepText
|
||||
nProgress = m_nProgress
|
||||
nNextProgress = m_nNextProgress
|
||||
m_bMainWindow_IsActive = MainWindow_IsActive
|
||||
bClose = m_bClose
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateLoadingWnd(Id As Integer, CurrStep As Integer, StepText As String, nProgress As Integer, nNextProgress As Integer)
|
||||
If Id <> m_bActiveId Then Return
|
||||
m_CurrStep = CurrStep
|
||||
m_StepText = StepText
|
||||
m_nProgress = nProgress
|
||||
m_nNextProgress = nNextProgress
|
||||
End Sub
|
||||
|
||||
Public Sub CloseLoadingWnd(Id As Integer)
|
||||
If Id <> m_bActiveId Then Return
|
||||
m_bClose = True
|
||||
m_bActiveId = -1
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,54 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="LoadingWndV"
|
||||
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"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Height="200" Width="300"
|
||||
IsClosable="False" IsMinimizable="False"
|
||||
WindowStartupLocation="Manual" ShowInTaskbar="False">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding TotText_Msg}"
|
||||
TextAlignment="Center"/>
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding StepText_Msg}"
|
||||
TextAlignment="Center"
|
||||
Visibility="{Binding StepText_Visibility}"/>
|
||||
<Grid Grid.Row="3"
|
||||
Visibility="{Binding StepProgress_Visibility}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Height="20"/>
|
||||
<ProgressBar Grid.Row="1"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
Value="{Binding StepProgress_Value}"
|
||||
Height="20"
|
||||
Margin="40,0,40,0"/>
|
||||
</Grid>
|
||||
<ProgressBar Grid.Row="5"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
Value="{Binding TotProgress_Value}"
|
||||
Height="20"
|
||||
Margin="40,0,40,0"/>
|
||||
<TextBlock Grid.Row="7"
|
||||
Text="{Binding TotProgress_Msg}"
|
||||
TextAlignment="Center"/>
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,28 @@
|
||||
Imports System.Windows
|
||||
|
||||
Public Class LoadingWndV
|
||||
|
||||
Private WithEvents m_LoadingWndVM As LoadingWndVM
|
||||
|
||||
Sub New(Owner As Window, LoadingWndVM As LoadingWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = LoadingWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_LoadingWndVM = LoadingWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_LoadingWndVM.m_CloseWindow
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub ActivateWindow() Handles m_LoadingWndVM.m_ActivateWindow
|
||||
Me.Activate()
|
||||
End Sub
|
||||
|
||||
Private Sub Me_ContentRendered() Handles Me.ContentRendered
|
||||
m_LoadingWndVM.StartFunction()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,233 @@
|
||||
Imports System.Timers
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class LoadingWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Enum LoadingTypes As Integer
|
||||
NULL = 0
|
||||
OPEN = 1
|
||||
IMPORT = 2
|
||||
End Enum
|
||||
|
||||
Delegate Sub CallbackLoadingDlg(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
Friend Event m_ActivateWindow()
|
||||
|
||||
Private m_CallbackLoading As CallbackLoadingDlg
|
||||
Private m_Waiting_Timer As New DispatcherTimer
|
||||
|
||||
' numero di passaggi di caricamento
|
||||
Private m_nSteps As Integer
|
||||
' titolo testo di caricamento
|
||||
Private m_TotText As String
|
||||
' numero passaggio corrente
|
||||
Private m_CurrStep As Integer
|
||||
' testo del passaggio corrente
|
||||
Private m_StepText As String
|
||||
' indice d'inizio di questo passaggio
|
||||
Private m_nStartProgress As Integer
|
||||
' indice d'inizio del prossimo passaggio
|
||||
Private m_nNextProgress As Integer
|
||||
' variabile che indica richiesta chiusura della finestra
|
||||
Private m_bClosing As Boolean = False
|
||||
Private m_bMainWindow_IsActive As Boolean = True
|
||||
|
||||
Private m_StepProgress_Value As Double = 0
|
||||
Public Property StepProgress_Value As Double
|
||||
Get
|
||||
Return m_StepProgress_Value
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_StepProgress_Value = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_TotProgress_Value As Double = 0
|
||||
Public Property TotProgress_Value As Double
|
||||
Get
|
||||
Return Math.Floor(m_TotProgress_Value)
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_TotProgress_Value = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_StepText_Visibility As Visibility
|
||||
Public ReadOnly Property StepText_Visibility As Visibility
|
||||
Get
|
||||
Return m_StepText_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_StepProgress_Visibility As Visibility
|
||||
Public ReadOnly Property StepProgress_Visibility As Visibility
|
||||
Get
|
||||
Return m_StepProgress_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property TotText_Msg As String
|
||||
Get
|
||||
Return If(m_nSteps > 0, m_TotText & " (" & m_CurrStep & "/" & m_nSteps & ")", m_TotText)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property StepText_Msg As String
|
||||
Get
|
||||
Return m_StepText
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property TotProgress_Msg As String
|
||||
Get
|
||||
Return m_TotProgress_Value.ToString("0.#") & "%"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdCancel As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
Sub New(Steps As Integer, TotText As String, callback As CallbackLoadingDlg)
|
||||
m_nSteps = Steps
|
||||
m_TotText = TotText
|
||||
m_CallbackLoading = callback
|
||||
m_bClosing = False
|
||||
If Steps = 1 Then
|
||||
m_StepText_Visibility = Visibility.Collapsed
|
||||
m_StepProgress_Visibility = Visibility.Collapsed
|
||||
Else
|
||||
m_StepText_Visibility = Visibility.Visible
|
||||
m_StepProgress_Visibility = Visibility.Visible
|
||||
End If
|
||||
' imposto contatore
|
||||
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(200)
|
||||
AddHandler m_Waiting_Timer.Tick, AddressOf WaitingTimer_Tick
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateProgress(CurrStep As Integer, StepText As String, nStartProgress As Integer, nNextProgress As Integer)
|
||||
m_CurrStep = CurrStep
|
||||
m_StepText = StepText
|
||||
m_StepProgress_Value = nStartProgress
|
||||
m_nNextProgress = nNextProgress
|
||||
NotifyPropertyChanged(NameOf(StepText_Msg))
|
||||
NotifyPropertyChanged(NameOf(TotText_Msg))
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub StartFunction()
|
||||
m_Waiting_Timer.Start()
|
||||
End Sub
|
||||
|
||||
Protected Overridable Sub WaitingTimer_Tick()
|
||||
' leggo eventuali nuovi valori
|
||||
Dim CurrStep As Integer = 0
|
||||
Dim StepText As String = ""
|
||||
Dim nStartProgress As Integer = 0
|
||||
Dim nNextProgress As Integer = 0
|
||||
Dim bMainWindow_IsActive As Boolean = True
|
||||
Dim bClose As Boolean = False
|
||||
m_CallbackLoading(CurrStep, StepText, nStartProgress, nNextProgress, bMainWindow_IsActive, bClose)
|
||||
If bMainWindow_IsActive <> m_bMainWindow_IsActive Then
|
||||
RaiseEvent m_ActivateWindow()
|
||||
End If
|
||||
If m_bClosing Then
|
||||
Close()
|
||||
Dispatcher.CurrentDispatcher.InvokeShutdown()
|
||||
Return
|
||||
ElseIf bClose Then
|
||||
m_bClosing = True
|
||||
' mostro completamento caricamento
|
||||
m_CurrStep = m_nSteps
|
||||
m_StepProgress_Value = 100
|
||||
m_TotProgress_Value = 100
|
||||
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||
Else
|
||||
If m_CurrStep <> CurrStep Then
|
||||
If m_StepProgress_Value < 100 Then
|
||||
m_StepProgress_Value = 100
|
||||
ElseIf m_StepProgress_Value = 100 Then
|
||||
m_StepProgress_Value = 0
|
||||
m_CurrStep = CurrStep
|
||||
m_StepText = StepText
|
||||
m_nStartProgress = nStartProgress
|
||||
m_nNextProgress = nNextProgress
|
||||
End If
|
||||
Else
|
||||
' incremento Step corrente
|
||||
If m_StepProgress_Value < 80 Then
|
||||
m_StepProgress_Value += 1
|
||||
ElseIf m_StepProgress_Value < 90 Then
|
||||
m_StepProgress_Value += 0.4
|
||||
ElseIf m_StepProgress_Value < 98 Then
|
||||
m_StepProgress_Value += 0.1
|
||||
Else
|
||||
m_StepProgress_Value += 0.01
|
||||
End If
|
||||
End If
|
||||
' calcolo totale
|
||||
Dim dStepStart As Double = If(m_CurrStep > 1, m_nStartProgress, 0)
|
||||
Dim dStepEnd As Double = m_nNextProgress
|
||||
m_TotProgress_Value = dStepStart + ((dStepEnd - dStepStart) / 100 * m_StepProgress_Value)
|
||||
End If
|
||||
' aggiorno grafica
|
||||
NotifyPropertyChanged(NameOf(StepText_Msg))
|
||||
NotifyPropertyChanged(NameOf(TotText_Msg))
|
||||
NotifyPropertyChanged(NameOf(StepProgress_Value))
|
||||
NotifyPropertyChanged(NameOf(TotProgress_Value))
|
||||
NotifyPropertyChanged(NameOf(TotProgress_Msg))
|
||||
End Sub
|
||||
|
||||
Public Sub Close()
|
||||
' fermo timer
|
||||
m_Waiting_Timer.Stop()
|
||||
' chiudo finestra
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Open.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub Cancel()
|
||||
'' chiedo conferma
|
||||
'If MessageBox.Show("Are you sure you want to stop the nesting?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then Return
|
||||
'' fermo il nesting
|
||||
'Map.refOptimizePanelVM.m_StopNesting = True
|
||||
'' fermo timer e chiudo finestra
|
||||
'CloseNesting()
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -203,6 +203,16 @@ Public Class PartM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_sSTOREY As String
|
||||
Public Property sSTOREY As String
|
||||
Get
|
||||
Return m_sSTOREY
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sSTOREY = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_sGROUP As String
|
||||
Public Property sGROUP As String
|
||||
Get
|
||||
@@ -456,6 +466,7 @@ Public Class PartM
|
||||
EgtGetInfo(nPartId, BTL_PRT_H, NewPartM.m_dBtlH)
|
||||
EgtGetInfo(nPartId, BTL_PRT_CNT, NewPartM.m_nCNT)
|
||||
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP)
|
||||
EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY)
|
||||
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL)
|
||||
Dim nTemp As Integer = 0
|
||||
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
|
||||
|
||||
@@ -162,6 +162,18 @@ Public MustInherit Class PartVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sSTOREY As String
|
||||
Get
|
||||
Return m_PartM.sSTOREY
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sGROUP As String
|
||||
Get
|
||||
Return m_PartM.sGROUP
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dVolume As Double
|
||||
Get
|
||||
Return m_PartM.dVolume
|
||||
|
||||
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyVersion("2.4.3.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.3.1")>
|
||||
|
||||
@@ -58,6 +58,9 @@ Public Enum StatusMapOpType
|
||||
SupervisorReleaseStop = 11
|
||||
ResetPartStart = 12
|
||||
ResetPartEnd = 13
|
||||
ChangeProdInSupervisorRequest = 14
|
||||
ChangeProdInProdRequest = 15
|
||||
OpenPageInViewOptimRequest = 16
|
||||
End Enum
|
||||
|
||||
Public Enum DimensionType
|
||||
|
||||
@@ -6,6 +6,8 @@ Imports EgtWPFLib5
|
||||
Public Class GridDimension
|
||||
Inherits VMBase
|
||||
|
||||
Private Shared m_SoftwareModActive As Boolean = False
|
||||
|
||||
Private Property m_GridName As String
|
||||
Public Property GridName As String
|
||||
Get
|
||||
@@ -43,7 +45,7 @@ Public Class GridDimension
|
||||
End Get
|
||||
Set(value As GridLength)
|
||||
m_GridLen = value
|
||||
DimensionsIniFile.SaveGridDimensions(GridName, GridDimensions)
|
||||
If Not m_SoftwareModActive Then DimensionsIniFile.SaveGridDimensions(GridName, GridDimensions)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -64,4 +66,8 @@ Public Class GridDimension
|
||||
m_GridLen = GridLen
|
||||
End Sub
|
||||
|
||||
Public Shared Sub SetSoftwareMod(bActive As Boolean)
|
||||
m_SoftwareModActive = bActive
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
Module ManageWindow
|
||||
Public Module ManageWindow
|
||||
|
||||
|
||||
<DllImport("user32.dll")>
|
||||
@@ -41,7 +41,7 @@ Module ManageWindow
|
||||
Public rcNormalPosition As System.Drawing.Rectangle
|
||||
End Structure
|
||||
|
||||
Friend Sub BringWindowToFront(wdwIntPtr As IntPtr)
|
||||
Public Sub BringWindowToFront(wdwIntPtr As IntPtr)
|
||||
'Dim wdwIntPtr As IntPtr = FindWindow(Nothing, "0016 - EgtBEAMWALL")
|
||||
Dim placement As Windowplacement = New Windowplacement()
|
||||
GetWindowPlacement(wdwIntPtr, placement)
|
||||
@@ -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.2.1")]
|
||||
[assembly: AssemblyFileVersion("2.4.2.1")]
|
||||
[assembly: AssemblyVersion("2.4.3.1")]
|
||||
[assembly: AssemblyFileVersion("2.4.3.1")]
|
||||
|
||||
@@ -101,27 +101,35 @@ Public Class Axis
|
||||
Public ReadOnly Property sValue As String
|
||||
Get
|
||||
Dim nDec As Integer = 0
|
||||
Select Case Type
|
||||
Case AxisTypes.LINEAR
|
||||
nDec = -3
|
||||
Case AxisTypes.ROTATIONAL
|
||||
nDec = -4
|
||||
Case Else
|
||||
nDec = 0
|
||||
End Select
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
nDec = -3
|
||||
Else
|
||||
Select Case Type
|
||||
Case AxisTypes.LINEAR
|
||||
nDec = -3
|
||||
Case AxisTypes.ROTATIONAL
|
||||
nDec = -4
|
||||
Case Else
|
||||
nDec = 0
|
||||
End Select
|
||||
End If
|
||||
Return DoubleToString(m_dValue, nDec)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Sub SetValue(value As Double)
|
||||
Select Case Type
|
||||
Case AxisTypes.LINEAR
|
||||
m_dValue = value / 1000
|
||||
Case AxisTypes.ROTATIONAL
|
||||
m_dValue = value / 10000
|
||||
Case Else
|
||||
m_dValue = value
|
||||
End Select
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
m_dValue = value
|
||||
Else
|
||||
Select Case Type
|
||||
Case AxisTypes.LINEAR
|
||||
m_dValue = value / 1000
|
||||
Case AxisTypes.ROTATIONAL
|
||||
m_dValue = value / 10000
|
||||
Case Else
|
||||
m_dValue = value
|
||||
End Select
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ Public Class CALCPanelVM
|
||||
Private m_cmdVerifyAll As ICommand
|
||||
Private m_cmdSimulate As ICommand
|
||||
|
||||
Private m_ProcessResultList As New List(Of Integer)
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Verify_ToolTip As String
|
||||
@@ -58,6 +60,7 @@ Public Class CALCPanelVM
|
||||
End Sub
|
||||
|
||||
Private Sub Calc_ProcessResult(sender As Object, e As CalcResultEventArgs)
|
||||
m_ProcessResultList.Add(e.m_Result.nBarId)
|
||||
ProcessResults(e.m_Result)
|
||||
Dim nRawid As Integer = e.m_Result.nBarId
|
||||
If nRawid <= 0 Then Return
|
||||
@@ -71,13 +74,15 @@ Public Class CALCPanelVM
|
||||
End If
|
||||
' ciclo sui pezzi
|
||||
Dim bNotOkFound As Boolean = False
|
||||
For Each MachGroup As MyMachGroupVM In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList
|
||||
Dim MachGroupList As List(Of MachGroupVM) = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Where(Function(x) m_ProcessResultList.Contains(x.Id)).ToList()
|
||||
For Each MachGroup As MyMachGroupVM In MachGroupList
|
||||
' 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
|
||||
m_ProcessResultList = New List(Of Integer)
|
||||
Map.refProjectVM.ManageIsEnabled(True)
|
||||
Map.refMyStatusBarVM.ResetStopProgress()
|
||||
End Sub
|
||||
|
||||
@@ -68,7 +68,7 @@ Public Class TPAComm
|
||||
Private m_Proxy_ListInfoEventHandler As New ListInfoEventHandler(AddressOf RemoteObject_ListInfoResponse)
|
||||
Private m_Proxy_RPCUpdateEventHandler As New RPCUpdateEventHandler(AddressOf RemoteObject_RPCUpdate)
|
||||
Private m_Proxy_VariableCommandExecutedEventHandler As New VariableCommandExecutedEventHandler(AddressOf RemoteObject_VariableCommandExecuted)
|
||||
Private m_Proxy_TickUpdateEventHandler As New TickUpdateEventHandler(AddressOf RemoteObject_TickUpdate)
|
||||
'Private m_Proxy_TickUpdateEventHandler As New TickUpdateEventHandler(AddressOf RemoteObject_TickUpdate)
|
||||
Private m_Rem_CommandExecutedEventHandler As CommandExecutedEventHandler
|
||||
Private m_Rem_ServerErrorEventHandler As ServerErrorEventHandler
|
||||
Private m_Rem_AxesCoordinatesUpdateEventHandler As AxesCoordinatesUpdateEventHandler
|
||||
@@ -77,7 +77,7 @@ Public Class TPAComm
|
||||
Private m_Rem_ListInfoEventHandler As ListInfoEventHandler
|
||||
Private m_Rem_RPCUpdateEventHandler As RPCUpdateEventHandler
|
||||
Private m_Rem_VariableCommandExecutedEventHandler As VariableCommandExecutedEventHandler
|
||||
|
||||
'Private m_Rem_TickUpdateEventHandler As TickUpdateEventHandler
|
||||
|
||||
<SecurityPermission(SecurityAction.Demand)>
|
||||
Public Sub New(MachManaging As MachManaging)
|
||||
@@ -110,7 +110,7 @@ Public Class TPAComm
|
||||
AddHandler m_eventProxy.ListInfoResponse, m_Proxy_ListInfoEventHandler
|
||||
AddHandler m_eventProxy.RPCUpdate, m_Proxy_RPCUpdateEventHandler
|
||||
AddHandler m_eventProxy.VariableCommandExecuted, m_Proxy_VariableCommandExecutedEventHandler
|
||||
AddHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
|
||||
'AddHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
|
||||
|
||||
_remObject = CType(Activator.GetObject(GetType(ISOCNC.Remoting_Server), serverURI), ISOCNC.Remoting_Server)
|
||||
Try
|
||||
@@ -122,6 +122,7 @@ Public Class TPAComm
|
||||
m_Rem_ListInfoEventHandler = New ListInfoEventHandler(AddressOf m_eventProxy.LocallyHandleListInfo)
|
||||
m_Rem_RPCUpdateEventHandler = New RPCUpdateEventHandler(AddressOf m_eventProxy.LocallyHandleRPCUpdate)
|
||||
m_Rem_VariableCommandExecutedEventHandler = New VariableCommandExecutedEventHandler(AddressOf m_eventProxy.LocallyHandleVariableCommandExecuted)
|
||||
'm_Rem_TickUpdateEventHandler = New TickUpdateEventHandler(AddressOf m_eventProxy.LocallyHandleTickUpdate)
|
||||
AddHandler _remObject.CommandExecuted, m_Rem_CommandExecutedEventHandler
|
||||
AddHandler _remObject.ServerError, m_Rem_ServerErrorEventHandler
|
||||
AddHandler _remObject.AxisCoordinatesUpdate, m_Rem_AxesCoordinatesUpdateEventHandler
|
||||
@@ -130,6 +131,7 @@ Public Class TPAComm
|
||||
AddHandler _remObject.ListInfoResponse, m_Rem_ListInfoEventHandler
|
||||
AddHandler _remObject.RPCUpdate, m_Rem_RPCUpdateEventHandler
|
||||
AddHandler _remObject.VariableCommandExecuted, m_Rem_VariableCommandExecutedEventHandler
|
||||
'AddHandler _remObject.TickUpdate, m_Rem_TickUpdateEventHandler
|
||||
Catch ex As System.Runtime.Remoting.RemotingException
|
||||
Dim dR As MessageBoxResult = MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
@@ -154,9 +156,10 @@ Public Class TPAComm
|
||||
RemoveHandler m_eventProxy.ListInfoResponse, m_Proxy_ListInfoEventHandler
|
||||
RemoveHandler m_eventProxy.RPCUpdate, m_Proxy_RPCUpdateEventHandler
|
||||
RemoveHandler m_eventProxy.VariableCommandExecuted, m_Proxy_VariableCommandExecutedEventHandler
|
||||
RemoveHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
|
||||
'RemoveHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub RemoteObject_OpStateUpdate(ByVal newOpState As ISOCNC.Remoting.MachineOperatingState)
|
||||
' resetto stato pending iniziale
|
||||
If Map.refMachManaging.StartPending AndAlso newOpState = MachineOperatingState.Pending Then
|
||||
@@ -239,6 +242,7 @@ Public Class TPAComm
|
||||
End Sub
|
||||
|
||||
Private Sub RemoteObject_TickUpdate(ByVal newTick As ULong)
|
||||
'EgtUILib.EgtOutLog("Tick: " & newTick)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -503,17 +503,6 @@
|
||||
<Resource Include="Resources\EgtBEAMWALL.ico" />
|
||||
<Resource Include="Resources\TreeView\Folder.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ProjectManager\DxfOut.png" />
|
||||
<Resource Include="Resources\ProjectManager\Export.png" />
|
||||
<Resource Include="Resources\ProjectManager\Import.png" />
|
||||
<Resource Include="Resources\ProjectManager\New.png" />
|
||||
<Resource Include="Resources\ProjectManager\Open.png" />
|
||||
<Resource Include="Resources\ProjectManager\Options.png" />
|
||||
<Resource Include="Resources\ProjectManager\Save.png" />
|
||||
<Resource Include="Resources\ProjectManager\SaveAs.png" />
|
||||
<Resource Include="Resources\ProjectManager\Send.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ShowPanel\RenderingHL.png" />
|
||||
<Resource Include="Resources\ShowPanel\RenderingSH.png" />
|
||||
@@ -558,6 +547,12 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\MDIPage\Send.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ProjectManager\GoToProd.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ProjectManager\Open.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -156,6 +156,18 @@
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--GRP - Gruppo-->
|
||||
<DataGridTextColumn x:Key="colGROUP" Binding="{Binding sGROUP}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--STOREY - Sottogruppo-->
|
||||
<DataGridTextColumn x:Key="colSTOREY" Binding="{Binding sSTOREY}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.RowStyle>
|
||||
|
||||
@@ -113,6 +113,18 @@ Public Class PartInRawPartListVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GRP_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61624)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property STOREY_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61623)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--MAT - Materiale-->
|
||||
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding dL}">
|
||||
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Material_Msg,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
|
||||
@@ -410,9 +410,6 @@ Public Class LeftPanelVM
|
||||
m_OPModeList = New List(Of OPState) From {
|
||||
New OPState("Manual", OPModes.Manual)
|
||||
}
|
||||
' imposto stato manuale
|
||||
Dim ManualMode As OPState = m_OPModeList.FirstOrDefault(Function(x) x.Id = OPModes.Manual)
|
||||
SetOPState(ManualMode)
|
||||
Case NCTypes.NUM_FLEXIUM
|
||||
m_OPModeList = New List(Of OPState) From {
|
||||
New OPState("Auto", OPModes.Auto),
|
||||
@@ -494,6 +491,8 @@ Public Class LeftPanelVM
|
||||
Dim Part As PartVM = SelMachGroup.PartVMList(PartIndex)
|
||||
SetDonePart(SelMachGroup, Part)
|
||||
Next
|
||||
' riseleziono il gruppo
|
||||
Map.refSupervisorMachGroupPanelVM.SelectedMachGroup = SelMachGroup
|
||||
' aggiorno bottoni
|
||||
NotifyPropertyChanged(NameOf(DeleteRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
|
||||
@@ -586,32 +585,8 @@ Public Class LeftPanelVM
|
||||
DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, SelMachGroup.nProductionIndex)
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(OldIndex, NewIndex - 1)
|
||||
|
||||
|
||||
|
||||
|
||||
'' scrivo tutti pezzi completati
|
||||
'For PartIndex = 0 To SelMachGroup.PartVMList.Count - 1
|
||||
' Dim Part As PartVM = SelMachGroup.PartVMList(PartIndex)
|
||||
' ' reset start, end e stato pezzo
|
||||
' DbControllers.m_PartController.UpdateStart(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, DateTime.MinValue)
|
||||
' DbControllers.m_PartController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, DateTime.MinValue)
|
||||
' DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, ItemState.ND)
|
||||
' Part.dtStartTime = DateTime.MinValue
|
||||
' Part.dtEndTime = DateTime.MinValue
|
||||
' Part.nProduction_State = ItemState.ND
|
||||
|
||||
' Part.NotifyPropertyChanged(NameOf(Part.Production_Background))
|
||||
'Next
|
||||
'' reset start, end e stato MachGroup
|
||||
'DbControllers.m_MachGroupController.UpdateStart(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Time)
|
||||
'DbControllers.m_MachGroupController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Time)
|
||||
'DbControllers.m_MachGroupController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, ItemState.WIP)
|
||||
'SelMachGroup.dtStartTime = DateTime.MinValue
|
||||
'SelMachGroup.dtEndTime = DateTime.MinValue
|
||||
'SelMachGroup.nProduction_State = ItemState.ND
|
||||
'SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Production_Background))
|
||||
'SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Produce_IsEnabled))
|
||||
|
||||
' riseleziono il gruppo
|
||||
Map.refSupervisorMachGroupPanelVM.SelectedMachGroup = SelMachGroup
|
||||
' aggiorno bottoni
|
||||
NotifyPropertyChanged(NameOf(DeleteRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
|
||||
@@ -709,10 +684,15 @@ Public Class LeftPanelVM
|
||||
For Each Part In SelMachGroup.PartVMList
|
||||
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, ItemState.ND)
|
||||
Next
|
||||
Dim nRemovedIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(SelMachGroup)
|
||||
' se rimozione da Db ok, lo rimuovo da lista
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Remove(SelMachGroup)
|
||||
If Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count = 0 Then
|
||||
EgtResetCurrMachGroup()
|
||||
ManageBTLParts.HideAll()
|
||||
Else
|
||||
If nRemovedIndex >= Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count Then nRemovedIndex = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count - 1
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList(nRemovedIndex)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -521,6 +521,9 @@ Public Class MachCommandMessagePanelVM
|
||||
_Connected = True
|
||||
NotifyPropertyChanged(NameOf(Connect_Background))
|
||||
If ResultType = ResultTypes.EXECUTED Then
|
||||
' avvio tick di comunicazione con la macchina
|
||||
MachineCommThread.StartTick()
|
||||
' inizializzo variabili
|
||||
Init()
|
||||
End If
|
||||
End If
|
||||
@@ -549,9 +552,9 @@ Public Class MachCommandMessagePanelVM
|
||||
Select Case AlarmType
|
||||
Case CInt(ISOCNC.Remoting.AlarmType.Cycle)
|
||||
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
|
||||
m_ErrCycle.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
m_Iso.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
Else
|
||||
m_ErrCycle.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
m_Iso.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
'Dim ToRemove As Alarm = m_ErrCycle.FirstOrDefault(Function(x) x.sCode = AlarmCode)
|
||||
'If Not IsNothing(ToRemove) Then
|
||||
' m_ErrCycle.Remove(ToRemove)
|
||||
@@ -559,9 +562,9 @@ Public Class MachCommandMessagePanelVM
|
||||
End If
|
||||
Case CInt(ISOCNC.Remoting.AlarmType.ISO)
|
||||
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
|
||||
m_Iso.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
m_ErrSystem.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
Else
|
||||
m_Iso.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
m_ErrSystem.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
'Dim ToRemove As Alarm = m_Iso.FirstOrDefault(Function(x) x.sCode = AlarmCode)
|
||||
'If Not IsNothing(ToRemove) Then
|
||||
' m_Iso.Remove(ToRemove)
|
||||
@@ -580,9 +583,9 @@ Public Class MachCommandMessagePanelVM
|
||||
Case CInt(ISOCNC.Remoting.AlarmType.None)
|
||||
Case CInt(ISOCNC.Remoting.AlarmType.System)
|
||||
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
|
||||
m_ErrSystem.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
m_ErrCycle.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
Else
|
||||
m_ErrSystem.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
m_ErrCycle.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
'Dim ToRemove As Alarm = m_ErrSystem.FirstOrDefault(Function(x) x.sCode = AlarmCode)
|
||||
'If Not IsNothing(ToRemove) Then
|
||||
' m_ErrSystem.Remove(ToRemove)
|
||||
|
||||
@@ -124,7 +124,19 @@ Public Class MyMachGroupVM
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshPartList()
|
||||
|
||||
If nType = BWType.BEAM Then
|
||||
' leggo StartCut da posizione primo pezzo
|
||||
Dim sInfo As String = ""
|
||||
Dim sSplitInfo() As String
|
||||
Dim bFound As Boolean = False
|
||||
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||
sSplitInfo = sInfo.Split(","c)
|
||||
StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut)
|
||||
Else
|
||||
MyMachGroupM.dStartCut = 0
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Parts
|
||||
|
||||
@@ -32,6 +32,15 @@ Public Class PartVM
|
||||
NotifyPropertyChanged(NameOf(bDO))
|
||||
End Sub
|
||||
|
||||
Public Property bFLIP As Boolean
|
||||
Get
|
||||
Return m_PartM.nFLIP <> 0
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
Return
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Supervisor
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
@@ -12,6 +12,9 @@ Public Class SupervisorMachGroupPanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_ReloadProj_Timer As New DispatcherTimer
|
||||
Private m_bReloadProj As Boolean = False
|
||||
|
||||
' lock per aggiunta elemento a lista MachGroup
|
||||
Private m_Lock_AddMachGroup As New Object
|
||||
|
||||
@@ -37,8 +40,8 @@ Public Class SupervisorMachGroupPanelVM
|
||||
Map.SetRefSupervisorMachGroupPanelVM(Me)
|
||||
BindingOperations.EnableCollectionSynchronization(m_MachGroupVMList, m_Lock_AddMachGroup)
|
||||
m_ReloadProj_Timer.Interval = TimeSpan.FromMilliseconds(500)
|
||||
m_ReloadProj_Timer.Start()
|
||||
AddHandler m_ReloadProj_Timer.Tick, AddressOf ReloadProject_Tick
|
||||
m_ReloadProj_Timer.Start()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -56,9 +59,6 @@ Public Class SupervisorMachGroupPanelVM
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Produce_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Private m_bReloadProj As Boolean = False
|
||||
Private m_ReloadProj_Timer As New DispatcherTimer
|
||||
|
||||
Public Sub ReloadProjectFile()
|
||||
m_bReloadProj = True
|
||||
End Sub
|
||||
|
||||
@@ -403,6 +403,14 @@ Public Class MachManaging
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||
' resetto stato redo
|
||||
Part.bRedo = False
|
||||
' se non impostata data start
|
||||
If Part.dtStartTime = DateTime.MinValue Then
|
||||
' scrivo data start su Db pezzo
|
||||
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
|
||||
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
|
||||
Part.dtStartTime = dtStart
|
||||
End If
|
||||
|
||||
Next
|
||||
Else
|
||||
' scrivo data end su Db pezzo
|
||||
@@ -417,12 +425,6 @@ Public Class MachManaging
|
||||
' resetto stato redo
|
||||
Part.bRedo = False
|
||||
End If
|
||||
'Select Case CurrentMachine.NCType
|
||||
' Case NCTypes.TPA
|
||||
' Tpa.RWVariableManager.WriteVar(P_STATE, 0)
|
||||
' Case NCTypes.NUM_FLEXIUM
|
||||
' StateVariable.sValue = "0"
|
||||
'End Select
|
||||
|
||||
' se tutti i pezzi della barra sono in end
|
||||
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= 2) Then
|
||||
@@ -438,15 +440,24 @@ Public Class MachManaging
|
||||
MachGroupVariable.sValue = "0"
|
||||
PartVariable.sValue = "0"
|
||||
StateVariable.sValue = "0"
|
||||
' azzero variabile per far ripartire macchina
|
||||
'Select Case CurrentMachine.NCType
|
||||
' 'Case NCTypes.TPA
|
||||
' ' Tpa.RWVariableManager.WriteVar(P_PROD, 0)
|
||||
' ' Tpa.RWVariableManager.WriteVar(P_MACHGROUP, 0)
|
||||
' ' Tpa.RWVariableManager.WriteVar(P_PART, 0)
|
||||
' ' Tpa.RWVariableManager.WriteVar(P_STATE, 0)
|
||||
'End Select
|
||||
|
||||
' se non impostata data start
|
||||
If MachGroup.dtStartTime = DateTime.MinValue Then
|
||||
EgtOutLog("Start date not set on Prod " & nP_Prod & " Machgroup " & nP_Machgroup)
|
||||
Dim dtStart As DateTime = MachGroup.dtEndTime - TimeSpan.FromSeconds(60)
|
||||
' provo a recuperare tempo stimato
|
||||
If MachGroup.nCALC_TIME > 0 Then
|
||||
Dim MinPartStart As DateTime = MachGroup.PartVMList.Min(Function(x) x.dtStartTime)
|
||||
If MinPartStart > DateTime.MinValue Then
|
||||
dtStart = New DateTime(Math.Min((MachGroup.dtEndTime - TimeSpan.FromSeconds(MachGroup.nCALC_TIME)).Ticks, MinPartStart.Ticks))
|
||||
Else
|
||||
dtStart = MachGroup.dtEndTime - TimeSpan.FromSeconds(MachGroup.nCALC_TIME)
|
||||
End If
|
||||
End If
|
||||
' scrivo data start su Db barra
|
||||
DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
|
||||
MachGroup.dtStartTime = dtStart
|
||||
End If
|
||||
' resetto stati di produzione
|
||||
MachGroup.ResetProduce()
|
||||
' se partenza pezzi uno a uno
|
||||
@@ -605,6 +616,9 @@ Public Class MachManaging
|
||||
m_CN = New TPAComm(Me)
|
||||
m_bConnected = Tpa.remObject.OnConnect()
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
|
||||
' imposto stato manuale
|
||||
Dim ManualMode As OPState = Map.refLeftPanelVM.OPModeList.FirstOrDefault(Function(x) x.Id = OPModes.Manual)
|
||||
Map.refLeftPanelVM.SetOPMode(ManualMode)
|
||||
' creo classe di gestione variabili
|
||||
Catch ex As Exception
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
|
||||
|
||||
@@ -4,10 +4,14 @@ Class MachineCommThread
|
||||
|
||||
' variabile che ferma il ciclo
|
||||
Private Shared m_Stop As Boolean = False
|
||||
Private Shared m_StartTick As Boolean = False
|
||||
|
||||
Friend Shared Sub StopThread()
|
||||
m_Stop = True
|
||||
End Sub
|
||||
Friend Shared Sub StartTick()
|
||||
m_StartTick = True
|
||||
End Sub
|
||||
|
||||
' variabile in cui ci sono stati inizio e fine pezzo
|
||||
Private Shared sP1VarName As String = "0.FUNM.E81295"
|
||||
@@ -37,7 +41,9 @@ Class MachineCommThread
|
||||
|
||||
While Not m_Stop
|
||||
' eseguo ciclo principale che tiene vivo il thread
|
||||
m_MachManaging.Timer_Tick()
|
||||
If m_StartTick Then
|
||||
m_MachManaging.Timer_Tick()
|
||||
End If
|
||||
Threading.Thread.Sleep(TimeSpan.FromMilliseconds(1000))
|
||||
End While
|
||||
|
||||
|
||||
@@ -6,14 +6,22 @@
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
<UniformGrid Rows="1">
|
||||
<Button Content="{Binding Viewer_Msg}"
|
||||
Command="{Binding Viewer_Command}"
|
||||
Style="{StaticResource MainMenu_Button}"/>
|
||||
<Button Content="{Binding Optimizer_Msg}"
|
||||
Command="{Binding Optimizer_Command}"
|
||||
Style="{StaticResource MainMenu_Button}"/>
|
||||
<RadioButton Content="{Binding Supervisor_Msg}"
|
||||
IsChecked="{Binding Supervisor_IsChecked}"
|
||||
Style="{StaticResource MainMenu_ToggleButton}"/>
|
||||
<RadioButton Content="{Binding Inputs_Msg}"
|
||||
IsChecked="{Binding Inputs_IsChecked}"
|
||||
Visibility="{Binding Inputs_Visibility}"
|
||||
Style="{StaticResource MainMenu_ToggleButton}"/>
|
||||
<RadioButton Content="{Binding Outputs_Msg}"
|
||||
IsChecked="{Binding Outputs_IsChecked}"
|
||||
Visibility="{Binding Outputs_Visibility}"
|
||||
Style="{StaticResource MainMenu_ToggleButton}"/>
|
||||
<RadioButton Content="{Binding Configuration_Msg}"
|
||||
IsChecked="{Binding Config_IsChecked}"
|
||||
|
||||
@@ -53,6 +53,20 @@ Public Class MainMenuVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Inputs_Visibility As Visibility
|
||||
Public ReadOnly Property Inputs_Visibility As Visibility
|
||||
Get
|
||||
Return m_Inputs_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Outputs_Visibility As Visibility
|
||||
Public ReadOnly Property Outputs_Visibility As Visibility
|
||||
Get
|
||||
Return m_Outputs_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelPage As Integer = -1
|
||||
Public Property SelPage As Integer
|
||||
Get
|
||||
@@ -106,9 +120,9 @@ Public Class MainMenuVM
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Supervisor_Msg As String
|
||||
Public ReadOnly Property Viewer_Msg As String
|
||||
Get
|
||||
Return EgtMsg(62500)
|
||||
Return EgtMsg(61830)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -118,6 +132,12 @@ Public Class MainMenuVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Supervisor_Msg As String
|
||||
Get
|
||||
Return EgtMsg(62500)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Configuration_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61832)
|
||||
@@ -138,6 +158,10 @@ Public Class MainMenuVM
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdViewer As ICommand
|
||||
Private m_cmdOptimizer As ICommand
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -151,6 +175,13 @@ Public Class MainMenuVM
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub SetInputOutputVisibility()
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
m_Inputs_Visibility = Visibility.Collapsed
|
||||
m_Outputs_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub SetMainMenuIsEnabled(bIsEnabled As Boolean)
|
||||
m_MainMenu_IsEnabled = bIsEnabled
|
||||
NotifyPropertyChanged(NameOf(MainMenu_IsEnabled))
|
||||
@@ -276,4 +307,76 @@ Public Class MainMenuVM
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Viewer"
|
||||
|
||||
Public ReadOnly Property Viewer_Command As ICommand
|
||||
Get
|
||||
If m_cmdViewer Is Nothing Then
|
||||
m_cmdViewer = New Command(AddressOf Viewer)
|
||||
End If
|
||||
Return m_cmdViewer
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Viewer()
|
||||
Dim sViewerOptimizerName As String = "EgtBEAMWALL.ViewerOptimizerR32"
|
||||
' recupero processo del supervisore
|
||||
Dim localProc As Process() = Process.GetProcessesByName(sViewerOptimizerName)
|
||||
If localProc.Length > 0 Then
|
||||
For Each p As Process In localProc
|
||||
' porto in primo piano il ViewerOptimizer
|
||||
BringWindowToFront(p.MainWindowHandle)
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, -Pages.VIEW, StatusMapItemType.Comm, StatusMapOpType.OpenPageInViewOptimRequest, "")
|
||||
Exit For
|
||||
Next
|
||||
Else
|
||||
Dim sViewerOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sViewerOptimizerName & ".exe"
|
||||
Try
|
||||
Process.Start(sViewerOptimizerPath, "2 " & Pages.VIEW)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error: impossible starting vieweroptimizer from path " & sViewerOptimizerPath)
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Viewer
|
||||
|
||||
#Region "Optimizer"
|
||||
|
||||
Public ReadOnly Property Optimizer_Command As ICommand
|
||||
Get
|
||||
If m_cmdOptimizer Is Nothing Then
|
||||
m_cmdOptimizer = New Command(AddressOf Optimizer)
|
||||
End If
|
||||
Return m_cmdOptimizer
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Optimizer()
|
||||
Dim sViewerOptimizerName As String = "EgtBEAMWALL.ViewerOptimizerR32"
|
||||
' recupero processo del supervisore
|
||||
Dim localProc As Process() = Process.GetProcessesByName(sViewerOptimizerName)
|
||||
If localProc.Length > 0 Then
|
||||
For Each p As Process In localProc
|
||||
' porto in primo piano il ViewerOptimizer
|
||||
BringWindowToFront(p.MainWindowHandle)
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, -Pages.MACHINING, StatusMapItemType.Comm, StatusMapOpType.OpenPageInViewOptimRequest, "")
|
||||
Exit For
|
||||
Next
|
||||
Else
|
||||
Dim sViewerOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sViewerOptimizerName & ".exe"
|
||||
Try
|
||||
Process.Start(sViewerOptimizerPath, "2 " & Pages.MACHINING)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error: impossible starting vieweroptimizer from path " & sViewerOptimizerPath)
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Optimizer
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -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, 2402, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2402, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2403, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2403, 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())
|
||||
|
||||
@@ -101,25 +101,35 @@ Public Class MainWindowVM
|
||||
' apro in modalita' VIEW
|
||||
' Map.refMainMenuVM.SelPage = Pages.VIEW
|
||||
|
||||
' setto il primo file dalla lista degli MRU come prod corrente da aprire
|
||||
Dim sLastProdPath As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MRUSUPERVISORPRODFILES, K_FILE & "1", String.Empty, sLastProdPath)
|
||||
If Not String.IsNullOrWhiteSpace(sLastProdPath) AndAlso File.Exists(sLastProdPath) Then
|
||||
' ricavo l'Id e il prod associato per l'apertura di quest'ultimo
|
||||
Dim PdId As Integer = 0
|
||||
Dim sPdId As String = Path.GetFileNameWithoutExtension(sLastProdPath)
|
||||
Integer.TryParse(sPdId, PdId)
|
||||
Map.refSupervisorManagerVM.SetCurrProd(PdId)
|
||||
' apro prod
|
||||
If Not IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Map.refSupervisorManagerVM.OpenProject(Map.refSupervisorManagerVM.CurrProd)
|
||||
End If
|
||||
' imposto MainWindow per finestra di Loading
|
||||
LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
|
||||
|
||||
|
||||
' leggo riga di comando
|
||||
Dim nCommandType As Integer = 0
|
||||
Dim nPage As Pages = Pages.VIEW
|
||||
Dim nProdId As Integer = 0
|
||||
If ProcessCommandLine(nCommandType, nProdId) AndAlso nCommandType = 1 Then
|
||||
Map.refSupervisorManagerVM.SetCurrProd(nProdId)
|
||||
Else
|
||||
' setto il primo file dalla lista degli MRU come progetto corrente da aprire
|
||||
Dim sLastProdPath As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MRUSUPERVISORPRODFILES, K_FILE & "1", String.Empty, sLastProdPath)
|
||||
If Not String.IsNullOrWhiteSpace(sLastProdPath) AndAlso File.Exists(sLastProdPath) Then
|
||||
' ricavo l'Id e il prod associato per l'apertura di quest'ultimo
|
||||
Dim PdId As Integer = 0
|
||||
Dim sPdId As String = Path.GetFileNameWithoutExtension(sLastProdPath)
|
||||
Integer.TryParse(sPdId, PdId)
|
||||
Map.refSupervisorManagerVM.SetCurrProd(PdId)
|
||||
End If
|
||||
End If
|
||||
' apro prod
|
||||
If Not IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Map.refSupervisorManagerVM.OpenProject(Map.refSupervisorManagerVM.CurrProd)
|
||||
' apro in modalita' SUPERVISOR
|
||||
Map.refMainMenuVM.SelPage = Pages.SUPERVISOR
|
||||
|
||||
Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.FeatureList_Visibility))
|
||||
|
||||
|
||||
' inizializzo thread di aggiornamento e comunicazione con DB
|
||||
' creo thread gestione macchina
|
||||
m_ViewerOptimizerCommThread = New Thread(Sub()
|
||||
@@ -128,10 +138,23 @@ Public Class MainWindowVM
|
||||
m_ViewerOptimizerCommThread.SetApartmentState(ApartmentState.STA)
|
||||
' avvio thread di gestione della macchina che avvia la connessione
|
||||
m_ViewerOptimizerCommThread.Start()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Function ProcessCommandLine(ByRef nCommandType As Integer, ByRef nProdId As Integer) As Boolean
|
||||
' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
|
||||
If Environment.GetCommandLineArgs.Count() <= 1 Then Return False
|
||||
' Recupero primo parametro che dovrebbe essere il tipo di modalita' riga di comando
|
||||
Dim sFile As String = Environment.GetCommandLineArgs(1)
|
||||
If String.IsNullOrWhiteSpace(sFile) OrElse Not Integer.TryParse(sFile, nCommandType) OrElse nCommandType <= 0 Then Return False
|
||||
Select Case nCommandType
|
||||
Case 1 ' apri progetto in supervisore
|
||||
' recupero secondo parametro
|
||||
Dim sProdId As String = Environment.GetCommandLineArgs(2)
|
||||
If Not Integer.TryParse(sProdId, nProdId) OrElse nProdId <= 0 Then Return False
|
||||
Return True
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Friend Sub KeyDown(PressedKey As Key)
|
||||
' Con ESC esco dall'azione corrente
|
||||
If PressedKey = Key.Escape Then
|
||||
|
||||
@@ -55,5 +55,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyVersion("2.4.3.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.3.1")>
|
||||
|
||||
|
Before Width: | Height: | Size: 1002 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 622 B |
|
Before Width: | Height: | Size: 671 B |
|
Before Width: | Height: | Size: 538 B |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 610 B |
|
Before Width: | Height: | Size: 951 B |
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -235,6 +235,7 @@ Public Class MySceneHostVM
|
||||
Private Sub OnOpenProject(sender As Object, sFile As String, bOk As Boolean)
|
||||
' Procedo a seconda del risultato
|
||||
If bOk Then
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 2, EgtMsg(63003), 50, 70) ' Loading machining groups
|
||||
' leggo MachGroup
|
||||
Map.refProjectVM.ProdMachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
IsRightDockable="False"
|
||||
IsEnabled="{Binding SupervisorManager_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
<Button Command="{Binding OpenCommand}"
|
||||
ToolTip="{Binding OpenToolTip}"
|
||||
@@ -14,49 +14,23 @@
|
||||
Tag="{Binding}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding MruFileNames}">
|
||||
<ContextMenu.Resources>
|
||||
<Style TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="Command"
|
||||
<ContextMenu ItemsSource="{Binding MruFileNames}">
|
||||
<ContextMenu.Resources>
|
||||
<Style TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="Command"
|
||||
Value="{Binding PlacementTarget.Tag.OpenMruFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}" />
|
||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||
</Style>
|
||||
</ContextMenu.Resources>
|
||||
</ContextMenu>
|
||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||
</Style>
|
||||
</ContextMenu.Resources>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
<Image Source="/Resources/ProjectManager/Open.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<!--<Button Command="{Binding SaveCommand}"
|
||||
ToolTip="{Binding SaveToolTip}"
|
||||
<Button Command="{Binding GoToProd_Command}"
|
||||
ToolTip="{Binding GoToProd_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
|
||||
<Image Source="/Resources/ProjectManager/GoToProd.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
--><!--<Button Command="{Binding SaveAsCommand}"
|
||||
ToolTip="{Binding SaveAsToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/SaveAs.png" Stretch="Uniform"/>
|
||||
</Button>--><!--
|
||||
<Button Command="{Binding AddProj_Command}" ToolTip="{Binding AddProjToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Content="<"
|
||||
Command="{Binding GoToProj_Command}" ToolTip="{Binding AddProjToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"/>-->
|
||||
|
||||
<!--<Button Command="{Binding OptionsCommand}"
|
||||
ToolTip="{Binding OptionsToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Options.png" Height="22"/>
|
||||
</Button>-->
|
||||
<!--<Button Command="{Binding SendFeedbackCommand}"
|
||||
ToolTip="{Binding SendFeedbackToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Send.png" Height="22" Margin="3,0,3,0" />
|
||||
</Button>-->
|
||||
<!--<Button Command="{Binding UpdateBTL_Command}" ToolTip="{Binding UpdateBTLToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
@@ -11,6 +12,10 @@ Public Class SupervisorManagerVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_OpenProj_Timer As New DispatcherTimer
|
||||
Private m_bOpenProj As Boolean = False
|
||||
Private m_nProjIdToOpen As Integer = GDB_ID.NULL
|
||||
|
||||
Private m_SupervisorManager_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property SupervisorManager_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -70,7 +75,7 @@ Public Class SupervisorManagerVM
|
||||
Private m_cmdOpen As ICommand
|
||||
Private m_cmdOpenMruFile As ICommand
|
||||
'Private m_cmdSave As ICommand
|
||||
'Private m_cmdGoToProj As ICommand
|
||||
Private m_cmdGoToProd As ICommand
|
||||
|
||||
'#Region "ToolTip"
|
||||
|
||||
@@ -97,6 +102,10 @@ Public Class SupervisorManagerVM
|
||||
Map.SetRefSupervisorManagerVM(Me)
|
||||
' Impostazioni MruLists
|
||||
m_MruFiles.Init(S_MRUSUPERVISORPRODFILES, 8)
|
||||
' imposto timer di apertura da ottimizzatore
|
||||
m_OpenProj_Timer.Interval = TimeSpan.FromMilliseconds(500)
|
||||
AddHandler m_OpenProj_Timer.Tick, AddressOf OpenProject_Tick
|
||||
m_OpenProj_Timer.Start()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -129,6 +138,24 @@ Public Class SupervisorManagerVM
|
||||
DbControllers.m_ProdController.UpdateMachGroup(CurrProd.nProdId, MyMachGroupList)
|
||||
End Sub
|
||||
|
||||
Public Sub OpenProjectFromOptimizer(ProjIdToOpen As Integer)
|
||||
If ProjIdToOpen <> Map.refSupervisorManagerVM.m_CurrProd.nProdId Then
|
||||
m_nProjIdToOpen = ProjIdToOpen
|
||||
m_bOpenProj = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub OpenProject_Tick()
|
||||
If Not m_bOpenProj Then Return
|
||||
m_bOpenProj = False
|
||||
' recupero progetto da Id
|
||||
Dim DbProject As ProdFileM
|
||||
DbProject = DbControllers.m_ProdController.FindCoreByProdId(m_nProjIdToOpen)
|
||||
Dim ProjectVM As New ProdFileVM(DbProject)
|
||||
OpenProject(ProjectVM)
|
||||
m_nProjIdToOpen = GDB_ID.NULL
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -194,9 +221,12 @@ Public Class SupervisorManagerVM
|
||||
m_bLoadingProd = False
|
||||
Return
|
||||
End If
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63000), EgtMsg(63001), 50) 'Project opening 'Loading project geometries
|
||||
If Map.refSceneHostVM.MainController.OpenProject(sFilePath, False) Then
|
||||
m_CurrProd = TempCurrProd
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
' inizializzo visibilita' bottone done per i Part
|
||||
Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.DonePart_Visibility))
|
||||
'If Map.refMachGroupPanelVM.InitMachGroupList() Then
|
||||
' m_CurrProd = TempCurrProd
|
||||
' Map.refMainWindowVM.SetTitle(CurrProd.nProdId.ToString("0000") & " - EgtBEAMWALL")
|
||||
@@ -215,6 +245,7 @@ Public Class SupervisorManagerVM
|
||||
Map.refSceneHostVM.MainController.NewProject()
|
||||
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
|
||||
End If
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63004), 70, 100) ' Loading production data
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM = New SupervisorMachGroupPanelVM(MachGroupPanelM.CreateNewMachGroupPanel())
|
||||
' apro sessione di comunicazione e fisso indice a 0
|
||||
DbControllers.m_StatusMapController.StartProd(Map.refSupervisorManagerVM.CurrProd.nProdId, m_SupervisorId)
|
||||
@@ -257,6 +288,7 @@ Public Class SupervisorManagerVM
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList))
|
||||
m_bLoadingProd = False
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenCommand
|
||||
@@ -292,6 +324,49 @@ Public Class SupervisorManagerVM
|
||||
|
||||
#End Region ' OpenMruFileCommand
|
||||
|
||||
#Region "GoToProd"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Open.
|
||||
''' </summary>
|
||||
Public ReadOnly Property GoToProd_Command As ICommand
|
||||
Get
|
||||
If m_cmdGoToProd Is Nothing Then
|
||||
m_cmdGoToProd = New Command(AddressOf GoToProd)
|
||||
End If
|
||||
Return m_cmdGoToProd
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub GoToProd()
|
||||
If IsNothing(m_CurrProd) Then Return
|
||||
' apro ottimizzatore
|
||||
Dim sOptimizerName As String = "EgtBEAMWALL.ViewerOptimizerR32"
|
||||
' recupero processo del supervisore
|
||||
Dim localProc As Process() = Process.GetProcessesByName(sOptimizerName)
|
||||
If localProc.Length > 0 Then
|
||||
For Each p As Process In localProc
|
||||
' porto in primo piano il Supervisor
|
||||
BringWindowToFront(p.MainWindowHandle)
|
||||
Exit For
|
||||
Next
|
||||
Else
|
||||
Dim sOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sOptimizerName & ".exe"
|
||||
Try
|
||||
Process.Start(sOptimizerPath, "1 " & CurrProd.nProdId)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error: impossible starting optimizer from path " & sOptimizerPath)
|
||||
End Try
|
||||
End If
|
||||
' mando richiesta di apertura progetto in ottimizzatore
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refSupervisorManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInProdRequest, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' GoToProd
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
|
||||
@@ -160,6 +160,8 @@ Public Module CurrentMachine
|
||||
' inizializzo assi
|
||||
Map.refAxesPanelVM.LoadAxes()
|
||||
|
||||
' imposto visibilita' input output
|
||||
Map.refMainMenuVM.SetInputOutputVisibility()
|
||||
' leggo parametri macchina da WallData
|
||||
If nType = MachineType.WALL Then
|
||||
' Assegno i dati
|
||||
@@ -201,8 +203,6 @@ Public Module CurrentMachine
|
||||
Map.refLeftPanelVM.LoadChannels()
|
||||
Map.refLeftPanelVM.LoadOPStates()
|
||||
Map.refLeftPanelVM.LoadOPModes()
|
||||
' inizializzo visibilita' bottone done per i Part
|
||||
Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.DonePart_Visibility))
|
||||
End Sub
|
||||
|
||||
#End Region 'Init
|
||||
|
||||
@@ -276,6 +276,14 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MainMenu_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Background" Value="{StaticResource Omag_White}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource Omag_DarkGray}"/>
|
||||
<Setter Property="TextBlock.FontWeight" Value="Normal"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="90"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Option_ColorButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
|
||||
Public Class ViewerOptimizerComm
|
||||
|
||||
Private m_bTickInExecution As Boolean = False
|
||||
|
||||
Sub New()
|
||||
' imposto in Map
|
||||
'Map.SetRefMachManaging(Me)
|
||||
End Sub
|
||||
|
||||
Friend Sub Timer_Tick()
|
||||
If m_bTickInExecution Then
|
||||
EgtUILib.EgtOutLog("Tick gia' in esecuzione!!")
|
||||
Return
|
||||
End If
|
||||
m_bTickInExecution = True
|
||||
' se c'e' un progetto aperto o in caricamento
|
||||
If IsNothing(Map.refSupervisorManagerVM.CurrProd) OrElse Map.refSupervisorManagerVM.bLoadingProd Then Return
|
||||
If IsNothing(Map.refSupervisorManagerVM.CurrProd) OrElse Map.refSupervisorManagerVM.bLoadingProd Then
|
||||
m_bTickInExecution = False
|
||||
Return
|
||||
End If
|
||||
' recupero indice modifica del prod
|
||||
Dim nModificationIndex As Integer = 0
|
||||
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd()
|
||||
@@ -64,8 +75,13 @@ Public Class ViewerOptimizerComm
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
ElseIf MachGroupModification.ItemType = Core.StatusMapItemType.Comm AndAlso MachGroupModification.Operation = Core.StatusMapOpType.ViewOptimStoped Then
|
||||
ViewerOptimizerCommThread.SetViewerOptimizerBlocked(True)
|
||||
ElseIf MachGroupModification.ItemType = Core.StatusMapItemType.Comm Then
|
||||
If MachGroupModification.Operation = Core.StatusMapOpType.ViewOptimStoped Then
|
||||
ViewerOptimizerCommThread.SetViewerOptimizerBlocked(True)
|
||||
ElseIf MachGroupModification.Operation = Core.StatusMapOpType.ChangeProdInSupervisorRequest Then
|
||||
' lo apro
|
||||
Map.refSupervisorManagerVM.OpenProjectFromOptimizer(MachGroupModification.ItemId)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' se devo ricaricare il file
|
||||
@@ -74,39 +90,11 @@ Public Class ViewerOptimizerComm
|
||||
For Each MachGroupModification In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.Where(Function(x) x.Value(0) <> x.Value(1))
|
||||
MachGroupModification.Value(1) = MachGroupModification.Value(0)
|
||||
Next
|
||||
|
||||
|
||||
' ricarico il progetto
|
||||
'Map.refProjectVM.SupervisorMachGroupPanelVM.ReloadProjectFile()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
' aggiorno indice del prod
|
||||
Map.refSupervisorManagerVM.CurrProd.SetModificationIndex(nModificationIndex)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
' verifico se e' aperto in qualche ottimizzatore
|
||||
'DbControllers.m_ProdController.
|
||||
'Map.refSupervisorManagerVM.CurrProd.bIsLocked
|
||||
' verifico se la mappa messaggi ha indice maggiore del mio
|
||||
|
||||
' ricarico il progetto
|
||||
|
||||
' aggiorno eventuali nuovi machgroup
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
' se devo ripartire a meta' di una barra
|
||||
|
||||
' mando messaggio di blocco dell'ottimizzatore
|
||||
|
||||
|
||||
m_bTickInExecution = False
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,89 +0,0 @@
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -91,7 +91,7 @@ Public Class AddRawPartWndVM
|
||||
m_nProjectType = ProjectType
|
||||
Select Case ProjectType
|
||||
Case BWType.BEAM
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL), ' lunghezza
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL + dPosx), ' lunghezza + ritaglio iniziale
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61816), dPosx), ' ritaglio iniziale
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61937), dOffset)}) ' offset
|
||||
Case BWType.WALL
|
||||
|
||||
@@ -82,6 +82,7 @@ Public Class BTLFeatureVM
|
||||
End Property
|
||||
|
||||
' proprieta' che indica se e' attivo l'update del parametro bDO su piu' feature (attiva/disattiva tutti su pezzo, o per tipo con tasto destro)
|
||||
' necessario per evitare ricalcolo della grafica sulla modifica del parametro per ogni feature
|
||||
Private Shared m_bDO_MultipleUpdate As Boolean = False
|
||||
Public Shared Property bDO_MultipleUpdate As Boolean
|
||||
Get
|
||||
|
||||
@@ -314,13 +314,13 @@ Public Class BTLParamVM
|
||||
m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
|
||||
If bOK Then
|
||||
m_BTLParamM.bCustom = True
|
||||
' 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
|
||||
m_BTLParamM.dValue = dNewValue
|
||||
' modifica provvisoria per mancanza aggiornamento su freecontour
|
||||
If m_BTLFeatureM.IsFreeContour Then
|
||||
|
||||
@@ -41,7 +41,7 @@ Public Class BTLPartVM
|
||||
Set(value As Boolean)
|
||||
m_BTLPartM.bDO = value
|
||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_DO, If(value, 1, 0))
|
||||
NotifyPropertyChanged("Calc_BorderBrush")
|
||||
NotifyPropertyChanged(NameOf(Calc_BorderBrush))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1362,8 +1362,12 @@ Public Class BTLPartVM
|
||||
|
||||
Public ReadOnly Property Section As SectionXMaterial
|
||||
Get
|
||||
Dim nOrigGroupId As Integer = nPartId
|
||||
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
|
||||
EgtGetGroupGlobFrame(nPartId, frBeam)
|
||||
EgtGetGroupGlobFrame(nOrigGroupId, frBeam)
|
||||
Dim dL As Double
|
||||
If IsX(frBeam.VersX(), EPS_SMALL) Then
|
||||
dL = m_BTLPartM.dBtlL
|
||||
@@ -1440,7 +1444,7 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As Boolean?)
|
||||
If BTLFeatureVMList.Count = 0 Then
|
||||
NotifyPropertyChanged("bDOALL")
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
Return
|
||||
End If
|
||||
' imposto modalita' update multiplo
|
||||
@@ -1823,8 +1827,13 @@ Public Class BTLPartVM
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nNewPartId, GDB_BB.STANDARD, b3Part)
|
||||
' ripristino le rotazioni di ROT e FLIP
|
||||
EgtRotate(nNewPartId, b3Part.Center, -Vector3d.Z_AX, nROTATED)
|
||||
EgtRotate(nNewPartId, b3Part.Center, Vector3d.X_AX, nINVERTED)
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
EgtRotate(nNewPartId, b3Part.Center, Vector3d.X_AX, nROTATED)
|
||||
EgtRotate(nNewPartId, b3Part.Center, Vector3d.Z_AX, nINVERTED)
|
||||
Else
|
||||
EgtRotate(nNewPartId, b3Part.Center, -Vector3d.Z_AX, nROTATED)
|
||||
EgtRotate(nNewPartId, b3Part.Center, Vector3d.X_AX, nINVERTED)
|
||||
End If
|
||||
' aggiungo pezzo alla lista
|
||||
m_BTLStructureM.AddBTLPart(NewPart)
|
||||
Return NewPart
|
||||
|
||||
@@ -89,9 +89,8 @@ Public Class BTLStructureVM
|
||||
|
||||
' lista parametri per ricerca testuale
|
||||
Private m_SearchParamList As New ObservableCollection(Of IdNameStruct)({New IdNameStruct(BTLPartParam.NULL, ""),
|
||||
New IdNameStruct(BTLPartParam.PDN, "PDN"),
|
||||
New IdNameStruct(BTLPartParam.NAM, "Descrizione"),
|
||||
New IdNameStruct(BTLPartParam.GRP, "Gruppo")})
|
||||
New IdNameStruct(BTLPartParam.PDN, EgtMsg(61809)),
|
||||
New IdNameStruct(BTLPartParam.NAM, EgtMsg(61603))})
|
||||
Public ReadOnly Property SearchParamList As ObservableCollection(Of IdNameStruct)
|
||||
Get
|
||||
Return m_SearchParamList
|
||||
@@ -112,27 +111,53 @@ Public Class BTLStructureVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei materiali utilizzati
|
||||
Private m_MaterialList_View As CollectionView = Nothing
|
||||
Private m_MaterialList As New ObservableCollection(Of String)({""})
|
||||
Public Property MaterialList As ObservableCollection(Of String)
|
||||
' lista dei gruppi
|
||||
Private m_GroupList_View As CollectionView = Nothing
|
||||
Private m_GroupList As New ObservableCollection(Of String)({""})
|
||||
Public Property GroupList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_MaterialList
|
||||
Return m_GroupList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
m_MaterialList = value
|
||||
m_GroupList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelMaterial As String = ""
|
||||
Public Property SelMaterial As String
|
||||
Private m_SelGroup As String = ""
|
||||
Public Property SelGroup As String
|
||||
Get
|
||||
Return m_SelMaterial
|
||||
Return m_SelGroup
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelMaterial = value
|
||||
m_SelGroup = value
|
||||
m_BTLPartVMList_View.Refresh()
|
||||
m_SectionList_View.Refresh()
|
||||
m_SubGroupList_View.Refresh()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei SubGroup
|
||||
Private m_SubGroupList_View As CollectionView = Nothing
|
||||
Private m_SubGroupList As New ObservableCollection(Of String)({""})
|
||||
Public Property SubGroupList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_SubGroupList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
m_SubGroupList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelSubGroup As String = ""
|
||||
Public Property SelSubGroup As String
|
||||
Get
|
||||
Return m_SelSubGroup
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelSubGroup = value
|
||||
m_BTLPartVMList_View.Refresh()
|
||||
m_SectionList_View.Refresh()
|
||||
m_GroupList_View.Refresh()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -157,7 +182,8 @@ Public Class BTLStructureVM
|
||||
If Not IsNothing(value) Then
|
||||
m_SelSection = value
|
||||
m_BTLPartVMList_View.Refresh()
|
||||
m_MaterialList_View.Refresh()
|
||||
m_GroupList_View.Refresh()
|
||||
m_SubGroupList_View.Refresh()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -170,11 +196,40 @@ Public Class BTLStructureVM
|
||||
Set(value As String)
|
||||
m_SearchText = value
|
||||
m_BTLPartVMList_View.Refresh()
|
||||
m_MaterialList_View.Refresh()
|
||||
m_GroupList_View.Refresh()
|
||||
m_SectionList_View.Refresh()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property bDOALL As Boolean?
|
||||
Get
|
||||
If BTLPartVMList.Count = 0 Then Return False
|
||||
Dim bTemp As Boolean = BTLPartVMList(0).bDO
|
||||
For FeatureIndex = 1 To BTLPartVMList.Count - 1
|
||||
If BTLPartVMList(FeatureIndex).bDO <> bTemp Then Return Nothing
|
||||
Next
|
||||
Return bTemp
|
||||
End Get
|
||||
Set(value As Boolean?)
|
||||
If BTLPartVMList.Count = 0 Then
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
Return
|
||||
End If
|
||||
For PartIndex = 0 To BTLPartVMList.Count - 1
|
||||
Dim Part As BTLPartVM = BTLPartVMList(PartIndex)
|
||||
If (IsNothing(m_SelSection) OrElse m_SelSection.dH = -1 OrElse Part.Section = m_SelSection) AndAlso
|
||||
(SelGroup = "" OrElse Part.sGROUP = SelGroup) AndAlso
|
||||
(SelSubGroup = "" OrElse Part.sSTOREY = SelSubGroup) AndAlso
|
||||
(SelSearchParam.Id = BTLPartParam.NULL OrElse SearchText = String.Empty OrElse (
|
||||
(SelSearchParam.Id = BTLPartParam.PDN AndAlso Part.nPDN.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0) OrElse
|
||||
(SelSearchParam.Id = BTLPartParam.NAM AndAlso Part.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0))) Then
|
||||
Part.bDO = value
|
||||
Part.NotifyPropertyChanged(NameOf(Part.bDO))
|
||||
End If
|
||||
Next
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Parametri generici"
|
||||
|
||||
Public Property sPROJNUM As String
|
||||
@@ -569,14 +624,17 @@ Public Class BTLStructureVM
|
||||
' creo lista di BTLPartVM
|
||||
CreateBTLPartVMList()
|
||||
m_BTLPartVMList_View = CollectionViewSource.GetDefaultView(m_BTLPartVMList)
|
||||
m_MaterialList_View = CollectionViewSource.GetDefaultView(m_MaterialList)
|
||||
m_GroupList_View = CollectionViewSource.GetDefaultView(m_GroupList)
|
||||
m_SubGroupList_View = CollectionViewSource.GetDefaultView(m_SubGroupList)
|
||||
m_SectionList_View = CollectionViewSource.GetDefaultView(m_SectionList)
|
||||
m_BTLPartVMList_View.Filter = AddressOf PartFilter
|
||||
m_MaterialList_View.Filter = AddressOf MaterialFilter
|
||||
m_GroupList_View.Filter = AddressOf GroupFilter
|
||||
m_SectionList_View.Filter = AddressOf SectionFilter
|
||||
m_Calc_PartEnd.Interval = TimeSpan.FromMilliseconds(500)
|
||||
AddHandler m_Calc_PartEnd.Tick, AddressOf Calc_PartEnd_Tick
|
||||
m_Calc_PartEnd.Start()
|
||||
' Aggiorno check DOALL
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
If BTLStructureM.nAsseBaseId = GDB_ID.NULL Then
|
||||
Map.refShowBeamPanelVM.SetShowBuilding(False)
|
||||
End If
|
||||
@@ -592,19 +650,27 @@ Public Class BTLStructureVM
|
||||
|
||||
For Each BTLPartVM As BTLPartVM In all
|
||||
AddHandler BTLPartVM.PropertyChanged, AddressOf OnBTLPartVMPropertyChanged
|
||||
' verifico sezione e materiale per inserirli nei filtri
|
||||
If Not MaterialList.Contains(BTLPartVM.sMATERIAL) Then
|
||||
MaterialList.Add(BTLPartVM.sMATERIAL)
|
||||
End If
|
||||
If Not SectionList.Contains(BTLPartVM.Section) Then
|
||||
SectionList.Add(BTLPartVM.Section)
|
||||
End If
|
||||
Next
|
||||
|
||||
m_BTLPartVMList = New ObservableCollection(Of BTLPartVM)(all)
|
||||
AddHandler m_BTLPartVMList.CollectionChanged, AddressOf OnBTLPartVMListChanged
|
||||
End Sub
|
||||
|
||||
Friend Sub LoadFilters()
|
||||
For Each BTLPartVM As BTLPartVM In m_BTLPartVMList
|
||||
' verifico sezione, gruppo e sottogruppo per inserirli nei filtri
|
||||
If Not SectionList.Contains(BTLPartVM.Section) Then
|
||||
SectionList.Add(BTLPartVM.Section)
|
||||
End If
|
||||
If Not GroupList.Contains(BTLPartVM.sGROUP) Then
|
||||
GroupList.Add(BTLPartVM.sGROUP)
|
||||
End If
|
||||
If Not SubGroupList.Contains(BTLPartVM.sSTOREY) Then
|
||||
SubGroupList.Add(BTLPartVM.sSTOREY)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub Calc_PartEnd_Tick()
|
||||
' se calcolo non in corso (mainmenu e' attivo), esco
|
||||
If Map.refMainMenuVM.MainMenu_IsEnabled Then Return
|
||||
@@ -877,24 +943,41 @@ Public Class BTLStructureVM
|
||||
|
||||
Private Function PartFilter(Part As Object) As Boolean
|
||||
Dim CurrBTLPart As BTLPartVM = DirectCast(Part, BTLPartVM)
|
||||
Dim bMaterialOk As Boolean = True
|
||||
Dim bGroupOk As Boolean = True
|
||||
Dim bSubGroupOk As Boolean = True
|
||||
Dim bSectionOk As Boolean = True
|
||||
Dim bSearchTextOk As Boolean = True
|
||||
If SelMaterial <> "" AndAlso CurrBTLPart.sMATERIAL <> SelMaterial Then bMaterialOk = False
|
||||
If SelSection <> SectionXMaterial.Empty AndAlso CurrBTLPart.Section <> SelSection Then bSectionOk = False
|
||||
'If SearchText <> "" AndAlso CurrBTLPart.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0 Then bSectionOk = False
|
||||
If SelGroup <> "" AndAlso CurrBTLPart.sGROUP <> SelGroup Then bGroupOk = False
|
||||
If SelSubGroup <> "" AndAlso CurrBTLPart.sSTOREY <> SelSubGroup Then bSubGroupOk = False
|
||||
If m_SelSearchParam.Id <> BTLPartParam.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelSearchParam.Id = BTLPartParam.PDN AndAlso CurrBTLPart.nPDN.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchParam.Id = BTLPartParam.NAM AndAlso CurrBTLPart.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchParam.Id = BTLPartParam.GRP AndAlso (IsNothing(CurrBTLPart.sGROUP) OrElse CurrBTLPart.sGROUP.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase)) < 0)) Then bSectionOk = False
|
||||
Return (bMaterialOk AndAlso bSectionOk)
|
||||
(m_SelSearchParam.Id = BTLPartParam.NAM AndAlso CurrBTLPart.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then
|
||||
bSearchTextOk = False
|
||||
End If
|
||||
Return bSectionOk AndAlso bGroupOk AndAlso bSubGroupOk AndAlso bSearchTextOk
|
||||
End Function
|
||||
|
||||
Private Function MaterialFilter(Material As Object) As Boolean
|
||||
Dim CurrMaterial As String = DirectCast(Material, String)
|
||||
Private Function GroupFilter(Group As Object) As Boolean
|
||||
Dim CurrGroup As String = DirectCast(Group, String)
|
||||
Dim bOk As Boolean = True
|
||||
If SelSection <> SectionXMaterial.Empty AndAlso SearchText <> "" AndAlso CurrMaterial <> "" Then
|
||||
bOk = m_BTLPartVMList.Any(Function(x) x.sMATERIAL = CurrMaterial AndAlso x.Section = SelSection AndAlso Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0)
|
||||
If CurrGroup <> "" AndAlso (SelSection <> SectionXMaterial.Empty OrElse SelSubGroup <> "" OrElse SearchText <> "") Then
|
||||
bOk = m_BTLPartVMList.Any(Function(x) x.sGROUP = CurrGroup AndAlso
|
||||
(SelSection = SectionXMaterial.Empty OrElse x.Section = SelSection) AndAlso
|
||||
(SelSubGroup = "" OrElse x.sSTOREY = SelSubGroup) AndAlso
|
||||
(SearchText = "" OrElse Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0))
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Function SubGroupFilter(SubGroup As Object) As Boolean
|
||||
Dim CurrSubGroup As String = DirectCast(SubGroup, String)
|
||||
Dim bOk As Boolean = True
|
||||
If CurrSubGroup <> "" AndAlso (SelSection <> SectionXMaterial.Empty OrElse SearchText <> "" OrElse SelGroup <> "") Then
|
||||
bOk = m_BTLPartVMList.Any(Function(x) x.sGROUP = CurrSubGroup AndAlso
|
||||
(SelSection = SectionXMaterial.Empty OrElse x.Section = SelSection) AndAlso
|
||||
(SelGroup = "" OrElse x.sGROUP = SelGroup) AndAlso
|
||||
(SearchText = "" OrElse Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0))
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
@@ -902,8 +985,11 @@ Public Class BTLStructureVM
|
||||
Private Function SectionFilter(Section As Object) As Boolean
|
||||
Dim CurrSection As SectionXMaterial = DirectCast(Section, SectionXMaterial)
|
||||
Dim bOk As Boolean = True
|
||||
If SelMaterial <> "" AndAlso SearchText <> "" AndAlso CurrSection <> Section.Empty Then
|
||||
bOk = m_BTLPartVMList.Any(Function(x) x.sMATERIAL = SelMaterial AndAlso x.Section = CurrSection AndAlso Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0)
|
||||
If CurrSection <> Section.Empty AndAlso (SelGroup <> "" OrElse SelSubGroup <> "" OrElse SearchText <> "") Then
|
||||
bOk = m_BTLPartVMList.Any(Function(x) x.Section = CurrSection AndAlso
|
||||
(SelGroup = "" OrElse x.sGROUP = SelGroup) AndAlso
|
||||
(SelSubGroup = "" OrElse x.sSTOREY = SelSubGroup) AndAlso
|
||||
(SearchText = "" OrElse Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0))
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
@@ -913,16 +999,16 @@ Public Class BTLStructureVM
|
||||
'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
|
||||
m_SectionList.FirstOrDefault(Function(x) x = OldPartSection)
|
||||
m_SectionList.Remove(m_SectionList.FirstOrDefault(Function(x) x = OldPartSection))
|
||||
End If
|
||||
' verifico se esiste già nuova sezione
|
||||
If Not m_SectionList.Any(Function(x) x = NewPartSection) Then
|
||||
m_SectionList.Add(NewPartSection)
|
||||
End If
|
||||
' nel caso seleziono filtro generico
|
||||
SelSection = m_SectionList(0)
|
||||
' e poi lo cerco ed elimino
|
||||
m_SectionList.FirstOrDefault(Function(x) x = OldPartSection)
|
||||
m_SectionList.Remove(m_SectionList.FirstOrDefault(Function(x) x = OldPartSection))
|
||||
End If
|
||||
' verifico se esiste già nuova sezione
|
||||
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
|
||||
@@ -983,8 +1069,8 @@ Public Class BTLStructureVM
|
||||
Private Sub OnBTLPartVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
Case NameOf(sender.sMATERIAL)
|
||||
If Not MaterialList.Contains(sender.sMATERIAL) Then
|
||||
MaterialList.Add(sender.sMATERIAL)
|
||||
If Not GroupList.Contains(sender.sMATERIAL) Then
|
||||
GroupList.Add(sender.sMATERIAL)
|
||||
End If
|
||||
Case NameOf(sender.sW), NameOf(sender.sH), NameOf(sender.sL)
|
||||
'If Not SectionList.Contains(sender.Section) Then
|
||||
@@ -994,6 +1080,8 @@ Public Class BTLStructureVM
|
||||
' UpdateSection(CType(sender, BTLPartVM).BTLPartM)
|
||||
Case NameOf(sender.nDONE)
|
||||
NotifyPropertyChanged(NameOf(sBTLRemainingTime))
|
||||
Case NameOf(sender.bDOALL)
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -304,11 +304,23 @@ Public Class CALCPanelVM
|
||||
' Inizializzo il pezzo in verifica
|
||||
Dim BTLPart As BTLPartVM = GetBTLPartVMFromBTLPartId(Bar.nBarId)
|
||||
BTLPart.CalcPartUpdate(0, 0, "")
|
||||
' Resetto feature in collisione
|
||||
For Each Feature In BTLPart.m_BTLFeatureVMList
|
||||
If Feature.nState = CalcStates.COLLISION Then
|
||||
Feature.CalcFeatureUpdate(0, 0, "")
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
' Inizializzo i pezzi del gruppo di lavoro in verifica
|
||||
Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
||||
For Each Part In Machgroup.PartVMList
|
||||
For Each Part As PartVM In Machgroup.PartVMList
|
||||
Part.CalcPartUpdate(0, 0, "")
|
||||
' Resetto feature in collisione
|
||||
For Each Feature As BTLFeatureVM In Part.FeatureVMList
|
||||
If Feature.nState = CalcStates.COLLISION Then
|
||||
Feature.CalcFeatureUpdate(0, 0, "")
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
Machgroup.CalcMachGroupUpdate(0, 0, "")
|
||||
End If
|
||||
@@ -728,7 +740,7 @@ Public Class CALCPanelVM
|
||||
Case Core.CalcStates.OK, CalcStates.INFO
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
|
||||
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
|
||||
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
|
||||
End If
|
||||
@@ -759,7 +771,7 @@ Public Class CALCPanelVM
|
||||
Case Core.CalcStates.OK, CalcStates.INFO
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
|
||||
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
|
||||
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
||||
End If
|
||||
|
||||
@@ -165,10 +165,6 @@
|
||||
<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>
|
||||
@@ -255,7 +251,6 @@
|
||||
<Compile Include="Utility\DbControllers.vb" />
|
||||
<Compile Include="Utility\DisableModifiedMgr.vb" />
|
||||
<Compile Include="Utility\LuaExec.vb" />
|
||||
<Compile Include="Utility\ManageWindow.vb" />
|
||||
<Compile Include="Utility\SectionXMaterialToBeAdded.vb" />
|
||||
<Compile Include="Utility\TextBlockUtils.vb" />
|
||||
<Compile Include="Utility\TreeViewItemBase.vb" />
|
||||
@@ -357,10 +352,6 @@
|
||||
<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>
|
||||
@@ -697,10 +688,6 @@
|
||||
<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" />
|
||||
@@ -853,15 +840,6 @@
|
||||
<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
|
||||
|
||||
@@ -167,6 +167,7 @@ Public Class MyInstrumentPanelVM
|
||||
Dim ChangeParameterWndVM As New ChangeParameterWndVM
|
||||
Dim ChangeParameterWnd As New ChangeParameterWndV(Application.Current.MainWindow, ChangeParameterWndVM)
|
||||
If ChangeParameterWnd.ShowDialog() Then
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.CHANGEPARAM, 1, EgtMsg(63014), "", 100) ' Modifying parameters
|
||||
' faccio passare pezzi
|
||||
If Not IsNothing(ChangeParameterWndVM.SelParam) Then
|
||||
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
@@ -228,6 +229,7 @@ Public Class MyInstrumentPanelVM
|
||||
'Next
|
||||
Next
|
||||
End If
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.CHANGEPARAM)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -95,9 +95,11 @@
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--DO - Abilitazione-->
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
|
||||
MinWidth="28">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
|
||||
HorizontalAlignment="Center"/>
|
||||
</DataGridCheckBoxColumn.Header>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--W - Larghezza-->
|
||||
@@ -133,13 +135,15 @@
|
||||
<!--CNT - Richiesti da BTL-->
|
||||
<DataGridTextColumn x:Key="colCNT" Binding="{Binding sCNT}" SortMemberPath="nCNT">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.CNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
<TextBlock Text="{Binding Path=DataContext.ShortCNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
|
||||
ToolTip="{Binding Path=DataContext.CNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--ADDED - Aggiunti-->
|
||||
<DataGridTextColumn x:Key="colADDED" Binding="{Binding sADDED}" SortMemberPath="nADDED">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.ADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
<TextBlock Text="{Binding Path=DataContext.ShortADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
|
||||
ToolTip="{Binding Path=DataContext.ADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
<DataGridTextColumn.EditingElementStyle>
|
||||
<Style TargetType="{x:Type TextBox}">
|
||||
@@ -150,13 +154,15 @@
|
||||
<!--INPROD - IN OTTIMIZZAZIONE-->
|
||||
<DataGridTextColumn x:Key="colINPROD" Binding="{Binding nINPROD}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.INPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
<TextBlock Text="{Binding Path=DataContext.ShortINPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
|
||||
ToolTip="{Binding Path=DataContext.INPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--DONE - PRODOTTI-->
|
||||
<DataGridTextColumn x:Key="colDONE" Binding="{Binding nDONE}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.DONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
<TextBlock Text="{Binding Path=DataContext.ShortDONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
|
||||
ToolTip="{Binding Path=DataContext.DONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--TBP - In produzione-->
|
||||
@@ -186,6 +192,12 @@
|
||||
<TextBlock Text="{Binding Path=DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--STOREY - Sottogruppo-->
|
||||
<DataGridTextColumn x:Key="colSTOREY" Binding="{Binding sSTOREY}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--UNT - Unit Time-->
|
||||
<!--<DataGridTextColumn Binding="{Binding nUNT}"
|
||||
IsReadOnly="True">
|
||||
|
||||
@@ -70,26 +70,52 @@ Public Class BTLPartListVM
|
||||
Return EgtMsg(61608)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ShortCNT_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61952)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ADDED_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61813)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ShortADDED_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61953)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property INPROD_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61609)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ShortINPROD_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61954)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DONE_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61814)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ShortDONE_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61955)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GRP_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61612)
|
||||
Return EgtMsg(61624)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property STOREY_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61623)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
<DataGrid.Resources>
|
||||
<!--DO - Abilitazione-->
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
|
||||
MinWidth="28">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureListV}}}"/>
|
||||
</DataGridCheckBoxColumn.Header>
|
||||
|
||||
@@ -187,6 +187,18 @@
|
||||
<TextBlock Text="{Binding Path=DataContext.MAT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--GRP - Gruppo-->
|
||||
<DataGridTextColumn x:Key="colGROUP" Binding="{Binding sGROUP}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--STOREY - Sottogruppo-->
|
||||
<DataGridTextColumn x:Key="colSTOREY" Binding="{Binding sSTOREY}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.InputBindings>
|
||||
|
||||
@@ -102,6 +102,18 @@ Public Class PartInRawPartListVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GRP_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61624)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property STOREY_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61623)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
|
||||
|
||||
<EgtBEAMWALLCORE:EgtDataGrid
|
||||
AutoGenerateColumns="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserResizeRows="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
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}}}"
|
||||
BindingColumns="{Binding QParameterListColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
<EgtBEAMWALLCORE:EgtDataGrid AutoGenerateColumns="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserResizeRows="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
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}}}"
|
||||
BeginningEdit="QParameterList_BeginningEdit"
|
||||
BindingColumns="{Binding QParameterListColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Class QParameterListV
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Class QParameterListV
|
||||
|
||||
Private Sub QParameterList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
If TypeOf sender Is DataGridRow Then
|
||||
@@ -9,4 +11,16 @@
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' funzione che impedisce di editare le righe che sono gia' in produzione
|
||||
Private Sub QParameterList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs)
|
||||
If IsNothing(e.Row) Then Return
|
||||
If Map.refMainMenuVM.SelPage <> Pages.MACHINING Then Return
|
||||
Dim RowVM As BTLParamVM = DirectCast(e.Row.DataContext, BTLParamVM)
|
||||
' se in produzione impedisco modifica dei parametri
|
||||
If DirectCast(RowVM.BTLParamM.ParentFeature.ParentPart, PartM).nProductionState > ItemState.ND Then
|
||||
'For Each cell In Row.Item
|
||||
e.Cancel = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -3,42 +3,77 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
|
||||
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding GridDims[0].GridLen, Mode=TwoWay}"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding GridDims[1].GridLen, Mode=TwoWay}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Header="Search & Filter"
|
||||
<GroupBox Header="{Binding SearchFilter_Msg}"
|
||||
Margin="3,1,3,3">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Parameter Type"/>
|
||||
<ComboBox ItemsSource="{Binding Tag.SearchParamList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
SelectedItem="{Binding Tag.SelSearchParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
Grid.Column="1"/>
|
||||
<TextBlock Text="Text"
|
||||
Grid.Row="1"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.SearchText, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"/>
|
||||
<TextBlock Text="Section"
|
||||
Grid.Row="2"/>
|
||||
<ComboBox ItemsSource="{Binding Tag.SectionList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
SelectedItem="{Binding Tag.SelSection, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
DisplayMemberPath="sSectionXMaterial"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"/>
|
||||
</Grid>
|
||||
<Expander>
|
||||
<Expander.Header>
|
||||
<Grid HorizontalAlignment="{Binding HorizontalAlignment, RelativeSource={RelativeSource AncestorType=ContentPresenter}, Mode=OneWayToSource}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*" x:Name="ComboColumn"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Section_Msg}"
|
||||
VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding Tag.SectionList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
SelectedItem="{Binding Tag.SelSection, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
DisplayMemberPath="sSectionXMaterial"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
</Expander.Header>
|
||||
<Grid Margin="1,0,1,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="24"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding Group_Msg}"
|
||||
Grid.ColumnSpan="2"
|
||||
VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding Tag.GroupList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
SelectedItem="{Binding Tag.SelGroup, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
Grid.Column="2"
|
||||
Margin="0,2,0,2"/>
|
||||
<TextBlock Text="{Binding SubGroup_Msg}"
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="2"
|
||||
VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding Tag.SubGroupList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
SelectedItem="{Binding Tag.SelSubGroup, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="1"
|
||||
Margin="0,2,0,2"/>
|
||||
<TextBlock Text="{Binding ParType_Msg}"
|
||||
Grid.Row="2"
|
||||
Grid.ColumnSpan="2"
|
||||
VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding Tag.SearchParamList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
SelectedItem="{Binding Tag.SelSearchParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="2"
|
||||
Margin="0,2,0,2"/>
|
||||
<TextBlock Text="{Binding ParValue_Msg}"
|
||||
Grid.Row="3"
|
||||
Grid.ColumnSpan="2"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.SearchText, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="3"
|
||||
Margin="0,2,0,0"/>
|
||||
</Grid>
|
||||
</Expander>
|
||||
</GroupBox>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -128,5 +163,5 @@
|
||||
Tag="{Binding Tag.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
Grid.Row="1"/>
|
||||
</Grid>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -98,7 +98,42 @@ Public Class LeftPanelVM
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property NewRawPart_ToopTip As String
|
||||
Public ReadOnly Property SearchFilter_Msg As String
|
||||
Get
|
||||
Return "Search & Filter"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Section_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61771)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Group_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61624)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SubGroup_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61623)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ParType_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61950)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ParValue_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61951)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property NewRawPart_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61903)
|
||||
End Get
|
||||
@@ -173,6 +208,9 @@ Public Class LeftPanelVM
|
||||
Friend Sub SetLeftPanelIsEnabled(bIsEnabled As Boolean)
|
||||
m_LeftPanel_IsEnabled = bIsEnabled
|
||||
NotifyPropertyChanged(NameOf(LeftPanel_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(CopyPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(RemovePart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(AddFeature_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Friend Sub PartShowAllChanged()
|
||||
@@ -329,11 +367,18 @@ Public Class LeftPanelVM
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & 1, nPartDuploId & "," & dStartOffset)
|
||||
Dim BeamMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.GetLastMachGroup()
|
||||
' eseguo script creazione grezzo
|
||||
Dim nERR As Integer = 0
|
||||
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
|
||||
' elimino duplo e gruppo di lavorazione
|
||||
EgtErase(nPartDuploId)
|
||||
BeamMachGroup.DeleteMachGroup()
|
||||
Dim LogFile As String() = File.ReadAllLines(sLogPath)
|
||||
If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
|
||||
MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
If File.Exists(sLogPath) Then
|
||||
Dim LogFile As String() = File.ReadAllLines(sLogPath)
|
||||
If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
|
||||
MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
Else
|
||||
MessageBox.Show("Impossible creating rawpart", EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
' se nessun grezzo, rimetto tutti i pezzi invisibili
|
||||
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then
|
||||
@@ -482,6 +527,8 @@ Public Class LeftPanelVM
|
||||
If AddPartToBeam(BeamMachGroup, SelPart) Then
|
||||
' aggiorno contatore pezzi usati in Prod
|
||||
SelPart.RefreshPartInProd()
|
||||
' resetto stato di calc
|
||||
SelMachGroup.ResetCalcMachGroup()
|
||||
End If
|
||||
' aggiorno dati ultilizzo barra
|
||||
BeamMachGroup.UpdateUsage()
|
||||
@@ -496,6 +543,8 @@ Public Class LeftPanelVM
|
||||
If AddPartToWall(WallMachGroup, SelPart) Then
|
||||
' aggiorno contatore pezzi usati in Prod
|
||||
SelPart.RefreshPartInProd()
|
||||
' resetto stato di calc
|
||||
SelMachGroup.ResetCalcMachGroup()
|
||||
End If
|
||||
' aggiorno dati ultilizzo barra
|
||||
WallMachGroup.UpdateUsage()
|
||||
|
||||
@@ -231,7 +231,7 @@ Public Class MyMachGroupPanelVM
|
||||
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
|
||||
' resetto eventuale selezione pezzo
|
||||
Dim SelMachGroup As MyMachGroupVM = DirectCast(SelectedMachGroup, MyMachGroupVM)
|
||||
SelMachGroup.SelPart = Nothing
|
||||
SelMachGroup.SetSelPart(Nothing)
|
||||
' Imposto vista solo tavola
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
|
||||
@@ -33,6 +33,12 @@ Public Class MyMachGroupVM
|
||||
NotifyPropertyChanged(NameOf(SelPart))
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetSelPart(value As Core.PartVM)
|
||||
m_SelPart = value
|
||||
EgtDeselectAll()
|
||||
EgtSelectObj(SelPart.nPartId)
|
||||
NotifyPropertyChanged(NameOf(SelPart))
|
||||
End Sub
|
||||
|
||||
Public Property sL As Double
|
||||
Get
|
||||
@@ -122,6 +128,7 @@ Public Class MyMachGroupVM
|
||||
End If
|
||||
End Select
|
||||
UpdateUsage()
|
||||
ResetCalcTotalMachGroup()
|
||||
End If
|
||||
End If
|
||||
End Set
|
||||
@@ -191,6 +198,7 @@ Public Class MyMachGroupVM
|
||||
NotifyPropertyChanged(NameOf(sW))
|
||||
End If
|
||||
UpdateUsage()
|
||||
ResetCalcTotalMachGroup()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -595,8 +603,12 @@ Public Class MyMachGroupVM
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' disabilito impostazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
' sblocco Duplo
|
||||
EgtDuploResetLocked(Part.nPartId)
|
||||
' ripristino precedente impostazione modificato
|
||||
DisableMgr.ReEnable()
|
||||
' se da aggiornare, ripristino info del duplo che verrebbero perse
|
||||
If bDuploToUpdate Then
|
||||
' ripristino i valori di ROT e FLIP
|
||||
|
||||
@@ -14,6 +14,9 @@ Public Class PartVM
|
||||
|
||||
#Region "General"
|
||||
|
||||
' variabile che indica se almeno un pezzo e' stato modificato durante il caricamento del progetto
|
||||
Private Shared m_PartModifiedOnLoading As Boolean = False
|
||||
|
||||
Public ReadOnly Property dVolume As Double
|
||||
Get
|
||||
Return dVolume
|
||||
@@ -247,6 +250,8 @@ Public Class PartVM
|
||||
ParentMachGroupVM.SelPart = ParentMachGroupVM.PartVMList(Index - 1)
|
||||
End If
|
||||
ParentMachGroupVM.PartVMList.Remove(Me)
|
||||
' aggiorno Db
|
||||
DbControllers.m_PartController.Delete(Map.refProdManagerVM.CurrProd.nProdId, ParentMachGroupVM.Id, nPartId)
|
||||
If nType = MachineType.BEAM Then
|
||||
Dim BeamParentMachGroup As MyMachGroupVM = DirectCast(ParentMachGroupVM, MyMachGroupVM)
|
||||
If Not IsNothing(BeamParentMachGroup) Then BeamParentMachGroup.ReDrawBeamMachgroup()
|
||||
@@ -413,8 +418,12 @@ Public Class PartVM
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' disabilito impostazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
' sblocco Duplo
|
||||
EgtDuploResetLocked(nPartId)
|
||||
' ripristino precedente impostazione modificato
|
||||
DisableMgr.ReEnable()
|
||||
' se da aggiornare, ripristino info del duplo che verrebbero perse
|
||||
If bDuploToUpdate Then
|
||||
' ripristino i valori di ROT e FLIP
|
||||
@@ -471,7 +480,11 @@ Public Class PartVM
|
||||
ResetCalcTotalPart()
|
||||
End If
|
||||
ElseIf PartModel.State > ItemState.ND And Not bLocked Then
|
||||
' disabilito impostazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
EgtDuploSetLocked(nPartId)
|
||||
' ripristino precedente impostazione modificato
|
||||
DisableMgr.ReEnable()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
@@ -486,10 +499,12 @@ 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
|
||||
If ParentMachGroupVM.nType = BWType.WALL Then
|
||||
For Each BTLParamVM As BTLParamVM In BTLFeatureVM.QBTLParamVMList
|
||||
AddHandler BTLParamVM.PropertyChanged, AddressOf OnBTLQParamVMPropertyChanged
|
||||
Next
|
||||
AddHandler BTLFeatureVM.QBTLParamVMList.CollectionChanged, AddressOf OnBTLQParamVMListChanged
|
||||
End If
|
||||
Next
|
||||
|
||||
m_FeatureVMList = New ObservableCollection(Of Core.BTLFeatureVM)(all)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
Style="{StaticResource MainMenu_ToggleButton}"/>
|
||||
<Button Content="{Binding Supervisor_Msg}"
|
||||
Command="{Binding Supervisor_Command}"
|
||||
Visibility="{Binding Supervisor_Visibility}"
|
||||
Style="{StaticResource MainMenu_Button}"/>
|
||||
<RadioButton Content="{Binding Configuration_Msg}"
|
||||
IsChecked="{Binding Config_IsChecked}"
|
||||
|
||||
@@ -7,14 +7,15 @@ 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_OpenPage_Timer As New DispatcherTimer
|
||||
Private m_bOpenPage As Boolean = False
|
||||
Private m_nPageToOpen As Pages = Pages.MACHINING
|
||||
|
||||
Private m_MainMenu_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property MainMenu_IsEnabled As Boolean
|
||||
@@ -35,7 +36,13 @@ Public Class MainMenuVM
|
||||
Return m_SelPage = Pages.VIEW
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value Then SelPage = Pages.VIEW
|
||||
If value Then
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso
|
||||
Map.refProjManagerVM.CurrProj.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
Map.refProjManagerVM.CurrProj.SetReloadProject(False)
|
||||
End If
|
||||
SelPage = Pages.VIEW
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -44,7 +51,13 @@ Public Class MainMenuVM
|
||||
Return m_SelPage = Pages.MACHINING
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value Then SelPage = Pages.MACHINING
|
||||
If value Then
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso
|
||||
Map.refProjManagerVM.CurrProj.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(False)
|
||||
End If
|
||||
SelPage = Pages.MACHINING
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -66,6 +79,13 @@ Public Class MainMenuVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Supervisor_Visibility As Visibility
|
||||
Public ReadOnly Property Supervisor_Visibility As Visibility
|
||||
Get
|
||||
Return m_Supervisor_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelPage As Integer = -1
|
||||
Public Property SelPage As Integer
|
||||
Get
|
||||
@@ -166,8 +186,16 @@ 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
|
||||
' abilito supervisore
|
||||
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.SUPERVISOR) Then
|
||||
m_Supervisor_Visibility = Visibility.Visible
|
||||
Else
|
||||
m_Supervisor_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
' imposto timer di apertura da ottimizzatore
|
||||
m_OpenPage_Timer.Interval = TimeSpan.FromMilliseconds(500)
|
||||
AddHandler m_OpenPage_Timer.Tick, AddressOf OpenPage_Tick
|
||||
m_OpenPage_Timer.Start()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -217,25 +245,31 @@ Public Class MainMenuVM
|
||||
' apro progetto proj
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
If Map.refProjManagerVM.CurrProj.bReloadProject Then
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROJ, 2, EgtMsg(63005), 10, 100) ' Loading parts
|
||||
Map.refProjManagerVM.OpenProject(Map.refProjManagerVM.CurrProj)
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Else
|
||||
Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
End If
|
||||
DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True)
|
||||
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
|
||||
Else
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROJ, 2, EgtMsg(63005), 10, 100) ' Loading parts
|
||||
' verifico se il prod di provenienza ha piu' proj
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
||||
' se si rigenero BTLStructure
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refProjManagerVM.CurrProj.nProjId))
|
||||
' carico filtri di ricerca
|
||||
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
||||
End If
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll()
|
||||
Map.refShowBeamPanelVM.ShowAll(True)
|
||||
Map.refProjManagerVM.CurrProj.SetReloadProject(True)
|
||||
End If
|
||||
' aggiorno titolo
|
||||
@@ -275,6 +309,71 @@ Public Class MainMenuVM
|
||||
End Function
|
||||
|
||||
Private Function InitMACHINING() As Boolean
|
||||
' imposto dimensioni colonne/righe della Grid
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.PROJECT_OPTIMIZER, Map.refProjectVM.GridDims)
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.LEFTPANEL_OPTIMIZER, Map.refLeftPanelVM.GridDims)
|
||||
' inizializzo gruppi di lavorazione
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd.nProdId) AndAlso Map.refProdManagerVM.CurrProd.nProdId > 0 Then
|
||||
If File.Exists(Map.refProdManagerVM.CurrProd.sProdPath) Then
|
||||
' apro progetto
|
||||
If Map.refProdManagerVM.CurrProd.bReloadProject Then
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 50) ' Loading parts
|
||||
Map.refProdManagerVM.TempCurrProd = Map.refProdManagerVM.CurrProd
|
||||
If Map.refSceneHostVM.MainController.OpenProject(Map.refProdManagerVM.CurrProd.sProdPath, False) Then
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True)
|
||||
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
End If
|
||||
Else
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 30) ' Loading parts
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll(False)
|
||||
' verifico se il prod ha piu' proj
|
||||
If Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
||||
' se si rigenero BTLStructure
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
||||
' carico filtri di ricerca
|
||||
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
||||
End If
|
||||
' recupero indice di modifica progetto
|
||||
Dim CommIndex As Integer = -1
|
||||
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd()
|
||||
For Each ActiveSession In ActiveSessionList
|
||||
If ActiveSession.ItemId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
CommIndex = ActiveSession.Index
|
||||
End If
|
||||
Next
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63002), 30, 100) ' Loading machining groups
|
||||
' carico lista dei MachGroup
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
' fisso indice sessione di comunicazione
|
||||
If CommIndex > -1 Then
|
||||
Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
End If
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(True)
|
||||
End If
|
||||
'DbControllers.m_ProdController.ResetController()
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True)
|
||||
' seleziono prima barra
|
||||
Map.refProjectVM.MachGroupPanelVM.SelFirstMachGroup()
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61871))
|
||||
End If
|
||||
Else
|
||||
Map.refSceneHostVM.MainController.NewProject()
|
||||
Map.refProjectVM.BTLStructureVM = Nothing
|
||||
Map.refProjectVM.MachGroupPanelVM = Nothing
|
||||
End If
|
||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||
Map.refMainMenuVM.NotifyPropertyChanged(NameOf(Map.refMainMenuVM.SendFeedbackIsEnabled))
|
||||
Map.refInstrumentPanelVM.NotifyPropertyChanged(NameOf(Map.refInstrumentPanelVM.ChangeParam_Visibility))
|
||||
Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.MovePart_Visibility))
|
||||
' aggiorno visibilita' degli elementi grafici
|
||||
Map.refProjectVM.SetBottomPanel_Visibility(False)
|
||||
Map.refProjectVM.SetLeftPanel_Visibility(True)
|
||||
Map.refLeftPanelVM.UpdateView()
|
||||
@@ -284,7 +383,6 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.SetShowBeamPanel_Visibility(False)
|
||||
Map.refProjectVM.SetProjManager_Visibility(False)
|
||||
Map.refProjectVM.SetProdManager_Visibility(True)
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
Map.refProjectVM.NotifyAllPanelVisibility()
|
||||
Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(False)
|
||||
Map.refTopPanelVM.UpdateQParameterVisibility()
|
||||
@@ -307,63 +405,7 @@ Public Class MainMenuVM
|
||||
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)
|
||||
' inizializzo gruppi di lavorazione
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd.nProdId) AndAlso Map.refProdManagerVM.CurrProd.nProdId > 0 Then
|
||||
If File.Exists(Map.refProdManagerVM.CurrProd.sProdPath) Then
|
||||
' apro progetto
|
||||
If Map.refProdManagerVM.CurrProd.bReloadProject Then
|
||||
If Map.refSceneHostVM.MainController.OpenProject(Map.refProdManagerVM.CurrProd.sProdPath, False) Then
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True)
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
End If
|
||||
Else
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll(False)
|
||||
' verifico se il prod ha piu' proj
|
||||
If Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
||||
' se si rigenero BTLStructure
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
||||
End If
|
||||
' recupero indice di modifica progetto
|
||||
Dim CommIndex As Integer = -1
|
||||
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd()
|
||||
For Each ActiveSession In ActiveSessionList
|
||||
If ActiveSession.ItemId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
CommIndex = ActiveSession.Index
|
||||
End If
|
||||
Next
|
||||
' carico lista dei MachGroup
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
' fisso indice sessione di comunicazione
|
||||
If CommIndex > -1 Then
|
||||
Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
End If
|
||||
Map.refProjManagerVM.CurrProj.SetReloadProject(True)
|
||||
End If
|
||||
'DbControllers.m_ProdController.ResetController()
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True)
|
||||
' seleziono prima barra
|
||||
Map.refProjectVM.MachGroupPanelVM.SelFirstMachGroup()
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61871))
|
||||
End If
|
||||
Else
|
||||
Map.refSceneHostVM.MainController.NewProject()
|
||||
Map.refProjectVM.BTLStructureVM = Nothing
|
||||
Map.refProjectVM.MachGroupPanelVM = Nothing
|
||||
End If
|
||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||
Map.refMainMenuVM.NotifyPropertyChanged(NameOf(Map.refMainMenuVM.SendFeedbackIsEnabled))
|
||||
Map.refInstrumentPanelVM.NotifyPropertyChanged(NameOf(Map.refInstrumentPanelVM.ChangeParam_Visibility))
|
||||
Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.MovePart_Visibility))
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -402,14 +444,31 @@ Public Class MainMenuVM
|
||||
Map.refConfigurationPageVM.bModifyMachParam = False
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Else
|
||||
Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Sub OpenPageFromSupervisor(Page As Pages)
|
||||
If m_SelPage <> Page Then
|
||||
m_nPageToOpen = Page
|
||||
m_bOpenPage = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub OpenPage_Tick()
|
||||
If Not m_bOpenPage Then Return
|
||||
m_bOpenPage = False
|
||||
' apro la pagina
|
||||
SelPage = m_nPageToOpen
|
||||
m_nPageToOpen = Pages.MACHINING
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -469,7 +528,6 @@ 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)
|
||||
@@ -506,19 +564,48 @@ 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 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)
|
||||
' Creo zip file da allegare
|
||||
Dim sZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Feedback.zip"
|
||||
If File.Exists(sZipToCreate) Then
|
||||
File.Delete(sZipToCreate)
|
||||
End If
|
||||
Try
|
||||
Using zip As New Ionic.Zip.ZipFile(sExpAndMoreZipToCreate, Console.Out)
|
||||
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, 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, "")
|
||||
@@ -530,167 +617,30 @@ 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
|
||||
|
||||
' 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)
|
||||
' 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)
|
||||
Next
|
||||
'Delete all child Directories
|
||||
For Each dir As String In Directory.GetDirectories(path)
|
||||
DeleteDirectory(dir)
|
||||
Next
|
||||
'Delete a Directory
|
||||
Directory.Delete(path)
|
||||
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))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -152,14 +152,6 @@ 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"
|
||||
@@ -229,8 +221,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, 2402, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2402, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2403, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2403, 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())
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Class MainWindowV
|
||||
|
||||
@@ -56,6 +57,14 @@ Class MainWindowV
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_Activated(sender As Object, e As EventArgs) Handles Me.Activated
|
||||
LoadingWndHelper.SetMainWindowIsActive(True)
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_Deactivated(sender As Object, e As EventArgs) Handles Me.Deactivated
|
||||
LoadingWndHelper.SetMainWindowIsActive(False)
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtBEAMWALL.Core.ConstGen
|
||||
Imports EgtBEAMWALL.Core.ConstIni
|
||||
Imports EgtUILib
|
||||
@@ -116,34 +117,33 @@ Public Class MainWindowVM
|
||||
End If
|
||||
' Aggiorno visualizzazione unità di misura
|
||||
'Map.refStatusBarVM.SetMeasureUnit(If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH))
|
||||
' Se istanza oltre la prima, chiedo cosa aprire
|
||||
If Not m_MainWindowM.bFirstInstance Then
|
||||
' Map.refProjectManagerVM.Open()
|
||||
' ' altrimenti verifico se richiesto ultimo progetto
|
||||
'ElseIf GetMainPrivateProfileInt(S_GENERAL, K_AUTOLOADLASTPROJ, 0) = 1 Then
|
||||
' Dim sLastProjectPath As String = String.Empty
|
||||
' GetMainPrivateProfileString(S_GENERAL, K_LASTPROJ, String.Empty, sLastProjectPath)
|
||||
' If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then
|
||||
' Map.refProjectManagerVM.OpenProject(sLastProjectPath)
|
||||
' Else
|
||||
' Map.refProjectManagerVM.NewCmd()
|
||||
' End If
|
||||
' ' altrimenti nuovo progetto
|
||||
'Else
|
||||
' Map.refProjectManagerVM.NewCmd()
|
||||
' imposto MainWindow per finestra di Loading
|
||||
LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
|
||||
' leggo riga di comando
|
||||
Dim nCommandType As Integer = 0
|
||||
Dim nPage As Pages = Pages.VIEW
|
||||
Dim nProdId As Integer = 0
|
||||
If ProcessCommandLine(nCommandType, nPage, nProdId) Then
|
||||
Select Case nCommandType
|
||||
Case 1
|
||||
Map.refProdManagerVM.SetCurrProd(nProdId)
|
||||
Case 2
|
||||
' pagina gia' impostata nella variabile
|
||||
End Select
|
||||
Else
|
||||
' setto il primo file dalla lista degli MRU come progetto corrente da aprire
|
||||
Dim sLastProjectPath As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MRUPROJFILES, K_FILE & "1", String.Empty, sLastProjectPath)
|
||||
If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then
|
||||
' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo
|
||||
Dim PjId As Integer = 0
|
||||
Dim sPjId As String = Path.GetFileNameWithoutExtension(sLastProjectPath)
|
||||
Integer.TryParse(sPjId, PjId)
|
||||
Map.refProjManagerVM.SetCurrProj(PjId)
|
||||
End If
|
||||
End If
|
||||
' setto il primo file dalla lista degli MRU come progetto corrente da aprire
|
||||
Dim sLastProjectPath As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MRUPROJFILES, K_FILE & "1", String.Empty, sLastProjectPath)
|
||||
If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then
|
||||
' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo
|
||||
Dim PjId As Integer = 0
|
||||
Dim sPjId As String = Path.GetFileNameWithoutExtension(sLastProjectPath)
|
||||
Integer.TryParse(sPjId, PjId)
|
||||
Map.refProjManagerVM.SetCurrProj(PjId)
|
||||
End If
|
||||
' apro in modalita' VIEW
|
||||
Map.refMainMenuVM.SelPage = Pages.VIEW
|
||||
' seleziono pagina da aprire
|
||||
Map.refMainMenuVM.SelPage = nPage
|
||||
|
||||
' inizializzo thread di aggiornamento e comunicazione con DB
|
||||
' creo thread gestione macchina
|
||||
@@ -156,6 +156,27 @@ Public Class MainWindowVM
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Function ProcessCommandLine(ByRef nCommandType As Integer, ByRef nPage As Pages, ByRef nProdId As Integer) As Boolean
|
||||
' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
|
||||
If Environment.GetCommandLineArgs.Count() <= 1 Then Return False
|
||||
' Recupero primo parametro che dovrebbe essere il tipo di modalita' riga di comando
|
||||
Dim sFile As String = Environment.GetCommandLineArgs(1)
|
||||
If String.IsNullOrWhiteSpace(sFile) OrElse Not Integer.TryParse(sFile, nCommandType) OrElse nCommandType <= 0 Then Return False
|
||||
Select Case nCommandType
|
||||
Case 1 ' apri progetto in ottimizzatore
|
||||
' recupero secondo parametro
|
||||
Dim sProdId As String = Environment.GetCommandLineArgs(2)
|
||||
If Not Integer.TryParse(sProdId, nProdId) OrElse nProdId <= 0 Then Return False
|
||||
nPage = Pages.MACHINING
|
||||
Return True
|
||||
Case 2 ' apri pagina specifica senza progetto specifico
|
||||
' recupero secondo parametro
|
||||
Dim sPage As String = Environment.GetCommandLineArgs(2)
|
||||
If Not Integer.TryParse(sPage, nPage) OrElse (nPage <> Pages.VIEW AndAlso nPage <> Pages.MACHINING) Then Return False
|
||||
Return True
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Friend Sub KeyDown(PressedKey As Key)
|
||||
' Con ESC esco dall'azione corrente
|
||||
If PressedKey = Key.Escape Then
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
<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>
|
||||
@@ -1,18 +0,0 @@
|
||||
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
|
||||
@@ -1,147 +0,0 @@
|
||||
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.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyVersion("2.4.3.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.3.1")>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Windows.Threading
|
||||
Imports System.IO
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
@@ -11,6 +12,7 @@ Public Class NestingRunningWndVM
|
||||
Public Enum OperationTypes
|
||||
ROTFLIP = 1
|
||||
NESTING = 2
|
||||
BTLNESTING = 3
|
||||
End Enum
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
@@ -22,6 +24,7 @@ Public Class NestingRunningWndVM
|
||||
Private m_Step As Double = 1
|
||||
Private m_SectionIndex As Integer
|
||||
|
||||
Private m_SelPartType As Integer
|
||||
Private m_SectionProgressList As New List(Of SectionProgress)
|
||||
Friend ReadOnly Property SectionProgressList As List(Of SectionProgress)
|
||||
Get
|
||||
@@ -109,8 +112,9 @@ Public Class NestingRunningWndVM
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
Sub New(OperationType As OperationTypes, SelPartType As Integer, Optional bLDIntersOther As Boolean = False, Optional nMinScore As Integer = 0)
|
||||
m_OperationType = OperationType
|
||||
Sub New(SelPartType As Integer, Optional bLDIntersOther As Boolean = False, Optional nMinScore As Integer = 0)
|
||||
m_OperationType = OperationTypes.NESTING
|
||||
m_SelPartType = SelPartType
|
||||
m_bLDIntersOther = bLDIntersOther
|
||||
m_nMinScore = nMinScore
|
||||
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\NestLog.txt"
|
||||
@@ -139,12 +143,30 @@ Public Class NestingRunningWndVM
|
||||
AddHandler m_Waiting_Timer.Tick, AddressOf WaitingTimer_Tick
|
||||
End Sub
|
||||
|
||||
Sub New(SelPartType As Integer)
|
||||
m_OperationType = OperationTypes.BTLNESTING
|
||||
m_SelPartType = SelPartType
|
||||
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\BTLNestLog.txt"
|
||||
' disabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(True)
|
||||
' se ho selezionato nest per materiale e c'è una sezione selezionata diversa da sezione nulla
|
||||
If SelPartType = OptimizePanelVM.PartType.MATERIAL AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelSection) AndAlso Map.refProjectVM.BTLStructureVM.SelSection.dH <> -1 Then
|
||||
m_SectionProgressList.Add(New SectionProgress(Map.refProjectVM.BTLStructureVM.SelSection))
|
||||
Else
|
||||
' altrimenti prendo tutte le sezioni
|
||||
For Each CurrSection In Map.refProjectVM.BTLStructureVM.SectionList
|
||||
If CurrSection.dH = -1 Then Continue For
|
||||
m_SectionProgressList.Add(New SectionProgress(CurrSection))
|
||||
Next
|
||||
End If
|
||||
' imposto contatore
|
||||
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(70)
|
||||
AddHandler m_Waiting_Timer.Tick, AddressOf WaitingTimer_Tick
|
||||
End Sub
|
||||
|
||||
Sub New(SelPartType As Integer, BTLPart As BTLPartVM)
|
||||
m_OperationType = OperationTypes.ROTFLIP
|
||||
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RotFlipLog.txt"
|
||||
'Dim dSectionTime As Double = GetMainPrivateProfileDouble(S_NEST, K_SECTIONTIME, 1)
|
||||
'Dim dPartTime As Double = GetMainPrivateProfileDouble(S_NEST, K_PARTTIME, 1)
|
||||
'SectionProgress.SetPartSectionTimes(dPartTime, dSectionTime)
|
||||
' disabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(True)
|
||||
If Not IsNothing(BTLPart) Then
|
||||
@@ -204,6 +226,8 @@ Public Class NestingRunningWndVM
|
||||
DoRotFlip()
|
||||
Case OperationTypes.NESTING
|
||||
DoNesting()
|
||||
Case OperationTypes.BTLNESTING
|
||||
DoBtlNesting()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -229,7 +253,7 @@ Public Class NestingRunningWndVM
|
||||
dStartOffset = WarehouseHelper.GetStartOffset()
|
||||
' riporto la stessa lunghezza in tutte le sezioni
|
||||
For Each SectionProgress In m_SectionProgressList
|
||||
SectionProgress.SParamList.Add(New SParam(SectionProgress.Section, dRawL, nQuantity))
|
||||
SectionProgress.SParamList.Add(New SParam(SectionProgress.Section, dRawL, nQuantity, True))
|
||||
Next
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
If Not WarehouseHelper.GetCurrentDimensions(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dRawW, dRawL) Then
|
||||
@@ -268,7 +292,12 @@ 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 AndAlso x.nCNT + x.nADDED > x.nINPROD
|
||||
Where x.Section = SectionProgress.Section AndAlso x.bDO AndAlso x.nCNT + x.nADDED > x.nINPROD AndAlso
|
||||
(m_SelPartType = OptimizePanelVM.PartType.ALL OrElse ((Map.refProjectVM.BTLStructureVM.SelGroup = "" OrElse x.sGROUP = Map.refProjectVM.BTLStructureVM.SelGroup) AndAlso
|
||||
(Map.refProjectVM.BTLStructureVM.SelSubGroup = "" OrElse x.sSTOREY = Map.refProjectVM.BTLStructureVM.SelSubGroup) AndAlso
|
||||
(Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.NULL OrElse Map.refProjectVM.BTLStructureVM.SearchText = String.Empty OrElse (
|
||||
(Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.PDN AndAlso x.nPDN.ToString.IndexOf(Map.refProjectVM.BTLStructureVM.SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0) OrElse
|
||||
(Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.NAM AndAlso x.sNAM.IndexOf(Map.refProjectVM.BTLStructureVM.SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0)))))
|
||||
Select x.BTLPartM).ToList()
|
||||
SectionProgress.SetSectionPartList(SectionPartList)
|
||||
Next
|
||||
@@ -297,6 +326,234 @@ Public Class NestingRunningWndVM
|
||||
CloseNesting()
|
||||
End Sub
|
||||
|
||||
Friend Sub DoBtlNesting()
|
||||
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
|
||||
' verifico se presente layer con RawParts
|
||||
Dim nRawPartsLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, "RawParts")
|
||||
If nRawPartsLayerId = GDB_ID.NULL Then Return
|
||||
' avvio timer avanzamento nesting
|
||||
m_CurrState = SectionProgress.NestStates.NULL
|
||||
m_TotTime = 0
|
||||
m_CurrTime = 0
|
||||
m_Waiting_Timer.Start()
|
||||
' calcolo nesting
|
||||
Dim nRawPartId As Integer = EgtGetFirstInGroup(nRawPartsLayerId)
|
||||
While nRawPartId <> GDB_ID.NULL
|
||||
' ne recupero il frame
|
||||
Dim frRawFrame As New Frame3d
|
||||
EgtGetGroupGlobFrame(nRawPartId, frRawFrame)
|
||||
' ne recupero lo spessore
|
||||
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nRawPartId, "Box")
|
||||
Dim b3Box As New BBox3d
|
||||
Dim dRawPartH As Double = 0
|
||||
If EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box) Then
|
||||
dRawPartH = b3Box.DimZ
|
||||
End If
|
||||
' verifico che sia tra quelli da nestare
|
||||
If dRawPartH <= 0 Or Not m_SectionProgressList.Any(Function(x) x.Section.dH = dRawPartH) Then Continue While
|
||||
' recupero il contorno
|
||||
Dim nOutlineLayerId As Integer = EgtGetFirstNameInGroup(nRawPartId, "Outline")
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayerId)
|
||||
Dim bOutlineFound As Boolean = False
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
If EgtGetType(nOutlineId) = GDB_TY.CRV_COMPO Then
|
||||
bOutlineFound = True
|
||||
Exit While
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
' recupero i pezzi con frame
|
||||
Dim PartList As New List(Of NestPartWithFrame)
|
||||
Dim nPartPlaceHolderId As Integer = EgtGetFirstInGroup(nRawPartId)
|
||||
While nPartPlaceHolderId <> GDB_ID.NULL
|
||||
Dim nSourceId As Integer = GDB_ID.NULL
|
||||
If Not EgtGetInfo(nPartPlaceHolderId, "!SOU", nSourceId) OrElse nSourceId <= 0 Then
|
||||
nPartPlaceHolderId = EgtGetNext(nPartPlaceHolderId)
|
||||
Continue While
|
||||
End If
|
||||
Dim frPlaceHolderGlob As New Frame3d
|
||||
EgtGetGroupGlobFrame(nPartPlaceHolderId, frPlaceHolderGlob)
|
||||
Dim p3Origin As Point3d = frPlaceHolderGlob.Orig - frRawFrame.Orig + Point3d.ORIG
|
||||
Dim frPart As New Frame3d
|
||||
Dim frPlaceHolder As New Frame3d
|
||||
EgtFrame(nPartPlaceHolderId, nRawPartId, frPlaceHolder)
|
||||
EgtGetGroupGlobFrame(nSourceId, frPart)
|
||||
'frPlaceHolderGlob.ToLoc(frPart)
|
||||
' creo duplo del pezzo
|
||||
Dim nPartDuploId As Integer = EgtDuploNew(nSourceId)
|
||||
' elimino valori calcolo dell'originale
|
||||
MyMachGroupPanelVM.DuploRemoveProjCalc(nPartDuploId)
|
||||
' lo rendo std
|
||||
EgtSetMode(nPartDuploId, GDB_MD.STD)
|
||||
PartList.Add(New NestPartWithFrame(nPartPlaceHolderId, p3Origin, frPlaceHolder, nPartDuploId, nSourceId))
|
||||
nPartPlaceHolderId = EgtGetNext(nPartPlaceHolderId)
|
||||
End While
|
||||
' creo Machgroup
|
||||
Dim nCurrMachGroup As Integer = EgtAddMachGroup(NewMachGroupName(), CurrentMachine.sMachineName)
|
||||
' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup)
|
||||
' aggiungo le info
|
||||
If bOutlineFound Then
|
||||
EgtSetInfo(nCurrMachGroup, "BTLNESTING", 1)
|
||||
EgtSetInfo(nCurrMachGroup, "RAWOUTLINEID", nOutlineId)
|
||||
Else
|
||||
' recupero dati da box
|
||||
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELLEN, b3Box.DimX())
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELWIDTH, b3Box.DimY())
|
||||
End If
|
||||
If PartList.Count > 0 Then
|
||||
Dim FirstPart = CALCPanelVM.GetBTLPartVMFromPartId(PartList(0).nSourcePartId)
|
||||
If Not IsNothing(FirstPart) Then EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, FirstPart.sMATERIAL)
|
||||
End If
|
||||
Dim nPartIndex = 0
|
||||
For Each NestPart In PartList
|
||||
Dim dRot As Double = 0
|
||||
Dim dFlip As Double = 0
|
||||
Dim dPosX As Double = NestPart.p3Orig.x
|
||||
Dim dPosY As Double = NestPart.p3Orig.y
|
||||
' calcolo rot ed invert da frame
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
If AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) Then
|
||||
dFlip = 0
|
||||
dRot = GetAngle(NestPart.frFrame.VersZ, Vector3d.Z_AX)
|
||||
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.X_AX) Then
|
||||
dFlip = 180
|
||||
dRot = -GetAngle(NestPart.frFrame.VersZ, Vector3d.Z_AX)
|
||||
Else
|
||||
' errore, la trave deve essere allineata all'asse X
|
||||
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non allineato all'asse X ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersX))
|
||||
Continue For
|
||||
End If
|
||||
' faccio rotazioni
|
||||
Dim b3Duplo As New BBox3d
|
||||
EgtGetBBoxGlob(NestPart.nPartDuploId, GDB_BB.STANDARD, b3Duplo)
|
||||
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.X_AX, dRot)
|
||||
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.Z_AX, dFlip)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
If AreSameVectorApprox(NestPart.frFrame.VersZ, Vector3d.Z_AX) Then
|
||||
dFlip = 0
|
||||
dRot = GetAngle(NestPart.frFrame.VersX, Vector3d.X_AX)
|
||||
ElseIf AreSameVectorApprox(NestPart.frFrame.VersZ, -Vector3d.Z_AX) Then
|
||||
dFlip = 180
|
||||
dRot = -GetAngle(NestPart.frFrame.VersX, Vector3d.X_AX)
|
||||
Else
|
||||
' errore, la parete deve stare nel piano del grezzo
|
||||
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non giace nel piano XY ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersZ))
|
||||
Continue For
|
||||
End If
|
||||
' faccio rotazioni
|
||||
Dim b3Duplo As New BBox3d
|
||||
EgtGetBBoxGlob(NestPart.nPartDuploId, GDB_BB.STANDARD, b3Duplo)
|
||||
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, -Vector3d.Z_AX, dRot)
|
||||
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.X_AX, dFlip)
|
||||
End If
|
||||
nPartIndex += 1
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & nPartIndex, NestPart.nPartDuploId & "," & dPosX & "," & dPosY & "," & 0 & "," & 0)
|
||||
' scrivo dati pezzo
|
||||
EgtSetInfo(NestPart.nPartDuploId, MGR_PRT_POSX, dPosX)
|
||||
EgtSetInfo(NestPart.nPartDuploId, MGR_PRT_POSY, dPosY)
|
||||
EgtSetInfo(NestPart.nPartDuploId, MGR_PRT_ROT, dRot)
|
||||
EgtSetInfo(NestPart.nPartDuploId, MGR_PRT_FLIP, dFlip)
|
||||
Next
|
||||
' scrivo info per segnalare gruppo nestato e quindi da caricare in grafica
|
||||
EgtSetInfo(nCurrMachGroup, "UPDATEUI", 1)
|
||||
' eseguo script creazione grezzo
|
||||
If Not ExecWall(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
|
||||
' elimino duplo e gruppo di lavorazione
|
||||
For Each Duplo In PartList
|
||||
EgtErase(Duplo.nPartDuploId)
|
||||
Next
|
||||
EgtRemoveMachGroup(nCurrMachGroup)
|
||||
If File.Exists(sLogPath) Then
|
||||
Dim LogFile As String() = File.ReadAllLines(sLogPath)
|
||||
If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
|
||||
MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
Else
|
||||
MessageBox.Show("Impossible creating rawpart", EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
' se nessun grezzo, rimetto tutti i pezzi invisibili
|
||||
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then
|
||||
Map.refProjectVM.BTLStructureVM.HideAll(True)
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
|
||||
' passo al prossimo RawPart
|
||||
nRawPartId = EgtGetNext(nRawPartId)
|
||||
End While
|
||||
' update liste grezzi e pezzi della grafica
|
||||
Map.refProjectVM.MachGroupPanelVM.RefreshMachGroupList()
|
||||
' seleziono ultimo gruppo
|
||||
Map.refProjectVM.MachGroupPanelVM.SelLastMachGroup()
|
||||
' riabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(False)
|
||||
' fermo timer e chiudo finestra
|
||||
CloseNesting()
|
||||
End Sub
|
||||
|
||||
Private Function NewMachGroupName() As Integer
|
||||
Dim nMachGroupId = EgtGetFirstMachGroup()
|
||||
If nMachGroupId = GDB_ID.NULL Then Return 1
|
||||
Dim nMaxMachGroup = 0
|
||||
While nMachGroupId <> GDB_ID.NULL
|
||||
Dim sMachGroupName = ""
|
||||
Dim nMachGroupName = 0
|
||||
EgtGetMachGroupName(nMachGroupId, sMachGroupName)
|
||||
Integer.TryParse(sMachGroupName, nMachGroupName)
|
||||
If nMachGroupName > nMaxMachGroup Then
|
||||
nMaxMachGroup = nMachGroupName
|
||||
End If
|
||||
nMachGroupId = EgtGetNextMachGroup(nMachGroupId)
|
||||
End While
|
||||
Return nMaxMachGroup + 1
|
||||
End Function
|
||||
|
||||
Private Class NestPartWithFrame
|
||||
|
||||
Private m_nSourcePartId As Integer
|
||||
Public ReadOnly Property nSourcePartId As Integer
|
||||
Get
|
||||
Return m_nSourcePartId
|
||||
End Get
|
||||
End Property
|
||||
Private m_nPartId As Integer
|
||||
Public ReadOnly Property nPartId As Integer
|
||||
Get
|
||||
Return m_nPartId
|
||||
End Get
|
||||
End Property
|
||||
Private m_nPartDuploId As Integer
|
||||
Public ReadOnly Property nPartDuploId As Integer
|
||||
Get
|
||||
Return m_nPartDuploId
|
||||
End Get
|
||||
End Property
|
||||
Private m_p3Orig As Point3d
|
||||
Public ReadOnly Property p3Orig As Point3d
|
||||
Get
|
||||
Return m_p3Orig
|
||||
End Get
|
||||
End Property
|
||||
Private m_frFrame As Frame3d
|
||||
Public ReadOnly Property frFrame As Frame3d
|
||||
Get
|
||||
Return m_frFrame
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(nPartId As Integer, p3Orig As Point3d, frFrame As Frame3d, nPartDuploId As Integer, nSourcePartId As Integer)
|
||||
m_nPartId = nPartId
|
||||
m_p3Orig = p3Orig
|
||||
m_frFrame = frFrame
|
||||
m_nPartDuploId = nPartDuploId
|
||||
m_nSourcePartId = nSourcePartId
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Friend Sub DoRotFlip()
|
||||
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
|
||||
' avvio timer avanzamento nesting
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
Height="22"
|
||||
Width="85"
|
||||
Margin="2.5,0,5,0"
|
||||
Visibility="Collapsed"/>
|
||||
Visibility="{Binding Optimize_Visibility}"/>
|
||||
<CheckBox Content="{Binding LongDrillArea_Msg}"
|
||||
IsChecked="{Binding bLDIntersOther}"
|
||||
FlowDirection="RightToLeft"
|
||||
|
||||
@@ -22,8 +22,8 @@ Public Class OptimizePanelVM
|
||||
FROM_BTL = 1
|
||||
End Enum
|
||||
|
||||
Private m_PartTypeList As New List(Of IdNameStruct)({New IdNameStruct(PartType.MATERIAL, "Materiale"),
|
||||
New IdNameStruct(PartType.ALL, "Tutti")})
|
||||
Private m_PartTypeList As New List(Of IdNameStruct)({New IdNameStruct(PartType.MATERIAL, EgtMsg(61957)),
|
||||
New IdNameStruct(PartType.ALL, EgtMsg(61956))})
|
||||
Public ReadOnly Property PartTypeList As List(Of IdNameStruct)
|
||||
Get
|
||||
Return m_PartTypeList
|
||||
@@ -40,8 +40,8 @@ Public Class OptimizePanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_OriginTypeList As New List(Of IdNameStruct)({New IdNameStruct(OriginType.STANDARD, "Standard"),
|
||||
New IdNameStruct(OriginType.FROM_BTL, "Da BTL")})
|
||||
Private m_OriginTypeList As New List(Of IdNameStruct)({New IdNameStruct(OriginType.STANDARD, EgtMsg(61964)),
|
||||
New IdNameStruct(OriginType.FROM_BTL, EgtMsg(61965))})
|
||||
Public ReadOnly Property OriginTypeList As List(Of IdNameStruct)
|
||||
Get
|
||||
Return m_OriginTypeList
|
||||
@@ -55,6 +55,7 @@ Public Class OptimizePanelVM
|
||||
End Get
|
||||
Set(value As IdNameStruct)
|
||||
m_SelOriginType = value
|
||||
NotifyPropertyChanged(NameOf(NestingOption_Visibility))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -72,7 +73,7 @@ Public Class OptimizePanelVM
|
||||
Get
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
If CurrentMachine.nType = MachineType.WALL OrElse CurrentMachine.nType = MachineType.BOTH Then
|
||||
If CurrentMachine.dHorDrillDiam > 0 And Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO) Then
|
||||
If CurrentMachine.dHorDrillDiam > 0 And Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO) And m_SelOriginType.Id = OriginType.STANDARD Then
|
||||
Return Visibility.Visible
|
||||
End If
|
||||
End If
|
||||
@@ -388,7 +389,12 @@ Public Class OptimizePanelVM
|
||||
End If
|
||||
' apro finestra di attesa nesting
|
||||
m_bNestingRunning = True
|
||||
Dim NestingRunningWndVM As New NestingRunningWndVM(NestingRunningWndVM.OperationTypes.NESTING, m_SelPartType.Id, m_bLDIntersOther, m_nMinScore)
|
||||
Dim NestingRunningWndVM As NestingRunningWndVM
|
||||
If m_SelOriginType.Id = OriginType.FROM_BTL Then
|
||||
NestingRunningWndVM = New NestingRunningWndVM(m_SelPartType.Id)
|
||||
Else
|
||||
NestingRunningWndVM = New NestingRunningWndVM(m_SelPartType.Id, m_bLDIntersOther, m_nMinScore)
|
||||
End If
|
||||
Dim NestingRunningWnd As New NestingRunningWndV(Application.Current.MainWindow, NestingRunningWndVM)
|
||||
NestingRunningWnd.ShowDialog()
|
||||
m_bNestingRunning = False
|
||||
@@ -398,13 +404,38 @@ Public Class OptimizePanelVM
|
||||
End If
|
||||
' mostro risultati
|
||||
Dim sResult As String = ""
|
||||
Dim dStartOffset As Double = WarehouseHelper.GetStartOffset()
|
||||
For Each Section In NestingRunningWndVM.SectionProgressList
|
||||
Dim bSectionInitiated As Boolean = False
|
||||
If Section.SectionPartList.Count > 0 AndAlso Section.SParamList.Count = 0 Then
|
||||
sResult &= Section.Section.sSectionXMaterial & ": no raw part found in the warehouse!" & Environment.NewLine
|
||||
sResult &= "Section " & Section.Section.sSectionXMaterial & ": no raw part found in the warehouse!" & Environment.NewLine
|
||||
bSectionInitiated = True
|
||||
End If
|
||||
For Each Part In Section.SectionPartList
|
||||
If Part.nINPROD <> Part.nCNT + Part.nADDED Then
|
||||
sResult &= Section.Section.sSectionXMaterial & " - " & Part.nPDN & ": partially nested!" & "(" & Part.nINPROD & "/" & Part.nCNT + Part.nADDED & ")" & Environment.NewLine
|
||||
' verifico se inizializzare sezione
|
||||
If Not bSectionInitiated Then
|
||||
sResult &= "Section " & Section.Section.sSectionXMaterial & ":" & Environment.NewLine
|
||||
bSectionInitiated = True
|
||||
End If
|
||||
' recupero VM
|
||||
Dim PartVM As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is Part)
|
||||
If Not IsNothing(PartVM) AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM AndAlso Section.SParamList.Count > 0 Then
|
||||
Dim dMaxL As Double = Section.SParamList.Max(Function(x) x.dL)
|
||||
If PartVM.dL + dStartOffset < dMaxL Then
|
||||
sResult &= " - " & Part.nPDN & ": material L(" & dMaxL & ") too short for a part with L(" & PartVM.dL & ")!" & Environment.NewLine
|
||||
Else
|
||||
sResult &= " - " & Part.nPDN & ": partially nested!" & "(" & Part.nINPROD & "/" & Part.nCNT + Part.nADDED & ")" & Environment.NewLine
|
||||
End If
|
||||
ElseIf Not IsNothing(PartVM) AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
If Not Section.SParamList.Any(Function(x) x.dL > PartVM.dL AndAlso x.dW > PartVM.dW) Then
|
||||
sResult &= " - " & Part.nPDN & ": no material can fit part dimensions(" & PartVM.dW & " x " & PartVM.dL & ")!" & Environment.NewLine
|
||||
Else
|
||||
sResult &= " - " & Part.nPDN & ": partially nested!" & "(" & Part.nINPROD & "/" & Part.nCNT + Part.nADDED & ")" & Environment.NewLine
|
||||
End If
|
||||
Else
|
||||
sResult &= " - " & Part.nPDN & ": partially nested!" & "(" & Part.nINPROD & "/" & Part.nCNT + Part.nADDED & ")" & Environment.NewLine
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
@@ -48,6 +48,12 @@
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/GoToProj.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding GoToSupervisor_Command}"
|
||||
ToolTip="{Binding GoToSupervisor_ToolTip}"
|
||||
Visibility="{Binding GoToSupervisor_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/GoToProd.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
<!--<Button Command="{Binding OptionsCommand}"
|
||||
ToolTip="{Binding OptionsToolTip}"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
@@ -11,6 +12,10 @@ Public Class ProdManagerVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_OpenProj_Timer As New DispatcherTimer
|
||||
Private m_bOpenProj As Boolean = False
|
||||
Private m_nProjIdToOpen As Integer = GDB_ID.NULL
|
||||
|
||||
Private m_ProdManager_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property ProdManager_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -72,11 +77,19 @@ Public Class ProdManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_GoToSupervisor_Visibility As Visibility
|
||||
Public ReadOnly Property GoToSupervisor_Visibility As Visibility
|
||||
Get
|
||||
Return m_GoToSupervisor_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOpen As ICommand
|
||||
Private m_cmdOpenMruFile As ICommand
|
||||
Private m_cmdSave As ICommand
|
||||
Private m_cmdGoToProj As ICommand
|
||||
Private m_cmdGoToSupervisor As ICommand
|
||||
|
||||
#Region "ToolTip"
|
||||
|
||||
@@ -111,10 +124,20 @@ Public Class ProdManagerVM
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in Map
|
||||
Map.SetRefProdManagerVM(Me)
|
||||
' abilito passaggio a supervisore
|
||||
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.SUPERVISOR) Then
|
||||
m_GoToSupervisor_Visibility = Visibility.Visible
|
||||
Else
|
||||
m_GoToSupervisor_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
' Leggo ultimo indice di progetto
|
||||
m_nLastProdId = GetMainPrivateProfileInt(S_GENERAL, K_PRODSINDEX, 1)
|
||||
' Impostazioni MruLists
|
||||
m_MruFiles.Init(S_MRUPRODFILES, 8)
|
||||
' imposto timer di apertura da ottimizzatore
|
||||
m_OpenProj_Timer.Interval = TimeSpan.FromMilliseconds(500)
|
||||
AddHandler m_OpenProj_Timer.Tick, AddressOf OpenProject_Tick
|
||||
m_OpenProj_Timer.Start()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -157,6 +180,50 @@ Public Class ProdManagerVM
|
||||
NotifyPropertyChanged(NameOf(ProdManager_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Public Sub OpenProjectFromSupervisor(ProjIdToOpen As Integer)
|
||||
If (Not IsNothing(Map.refProdManagerVM.m_CurrProd) AndAlso ProjIdToOpen <> Map.refProdManagerVM.m_CurrProd.nProdId) OrElse Map.refMainMenuVM.SelPage <> Pages.MACHINING Then
|
||||
m_nProjIdToOpen = ProjIdToOpen
|
||||
m_bOpenProj = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub OpenProject_Tick()
|
||||
If Not m_bOpenProj Then Return
|
||||
m_bOpenProj = False
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.MACHINING
|
||||
' recupero progetto da Id
|
||||
Dim DbProject As ProdFileM
|
||||
DbProject = DbControllers.m_ProdController.FindCoreByProdId(m_nProjIdToOpen)
|
||||
Dim ProjectVM As New ProdFileVM(DbProject)
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
OpenProject(ProjectVM)
|
||||
Case Pages.VIEW
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63004), EgtMsg(63011), 10) ' Optimization opening ' Loading environment
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso (m_nProjIdToOpen <> Map.refProjManagerVM.CurrProj.nProdId OrElse IsNothing(Map.refProdManagerVM.CurrProd)) Then
|
||||
Map.refProdManagerVM.SetCurrProd(m_nProjIdToOpen)
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(True)
|
||||
Else
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(False)
|
||||
End If
|
||||
' Ricavo il tipo di Warehouse settato nell'INI
|
||||
Dim nDefault As Integer = 1
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_WAREHOUSE, nDefault) = WarehouseType.MEDIUM Then
|
||||
' Se di tipo Medium confronto le Sezioni del BTL importato con quelle in Warehouse
|
||||
WarehouseWndVM.UpdateSectionXMaterial()
|
||||
End If
|
||||
' vado in pagina prod
|
||||
Map.refMainMenuVM.SetSelPage(Pages.MACHINING, False)
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.GOTOPROD)
|
||||
End Select
|
||||
m_nProjIdToOpen = GDB_ID.NULL
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -200,6 +267,7 @@ Public Class ProdManagerVM
|
||||
Else
|
||||
sFilePath = If(Not IsNothing(TempCurrProd.sProdPath), TempCurrProd.sProdPath, "")
|
||||
End If
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63004), EgtMsg(63001), 50) ' Optimization opening ' Loading project geometries
|
||||
If File.Exists(sFilePath) Then
|
||||
' se la macchina del progetto in apertura non è tra le macchine disponibili lo segnalo e apro un progetto vuoto
|
||||
If IsNothing(Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine)) Then
|
||||
@@ -210,7 +278,7 @@ Public Class ProdManagerVM
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
Else
|
||||
If Map.refSceneHostVM.MainController.OpenProject(sFilePath, False) Then
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO)))
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
Map.refTopPanelVM.UpdateQParameterVisibility()
|
||||
'SectionXMaterial.SetType(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
'' aggiorno le colonne in base al tipo progetto
|
||||
@@ -225,9 +293,9 @@ Public Class ProdManagerVM
|
||||
End If
|
||||
End If
|
||||
' imposto flag secondo tipo di progetto (travi o pareti)
|
||||
Dim sBTLFlag As String = If( TempCurrProd.nType = Core.ConstBeam.BWType.BEAM, K_BTLFLAG, K_WALLBTLFLAG)
|
||||
Dim sBTLFlag As String = If(TempCurrProd.nType = Core.ConstBeam.BWType.BEAM, K_BTLFLAG, K_WALLBTLFLAG)
|
||||
Dim nFlag As Integer = GetMainPrivateProfileInt(S_IMPORT, sBTLFlag, EIB_FL.TS3_POS + EIB_FL.SORT + EIB_FL.USEUATTR)
|
||||
EgtBeamSetFlag( nFlag)
|
||||
EgtBeamSetFlag(nFlag)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61871))
|
||||
Map.refSceneHostVM.MainController.NewProject()
|
||||
@@ -236,6 +304,7 @@ Public Class ProdManagerVM
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenCommand
|
||||
@@ -279,7 +348,7 @@ Public Class ProdManagerVM
|
||||
Public ReadOnly Property SaveCommand As ICommand
|
||||
Get
|
||||
If m_cmdSave Is Nothing Then
|
||||
m_cmdSave = New Command(AddressOf Save)
|
||||
m_cmdSave = New Command(AddressOf SaveCmd)
|
||||
End If
|
||||
Return m_cmdSave
|
||||
End Get
|
||||
@@ -288,10 +357,16 @@ Public Class ProdManagerVM
|
||||
''' <summary>
|
||||
''' Execute the Save. This method is invoked by the SaveCommand.
|
||||
''' </summary>
|
||||
Public Sub Save()
|
||||
Public Sub SaveCmd()
|
||||
Save(True)
|
||||
End Sub
|
||||
|
||||
Public Sub Save(Optional bShowLoading As Boolean = False)
|
||||
If IsNothing(m_CurrProd) Then Return
|
||||
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63007), EgtMsg(63012), 70) ' Project saving ' Saving geometry
|
||||
Map.refSceneHostVM.SaveProject()
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63013), 70, 100) ' Saving data on Db
|
||||
Dim MyMachGroupList As New List(Of MyMachGroupM)
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
|
||||
For Each MachGroup In Map.refProjectVM.MachGroupPanelVM.m_MyMachGroupPanelM.MachGroupMList
|
||||
@@ -321,6 +396,7 @@ Public Class ProdManagerVM
|
||||
m_CurrProd.bIsNew = False
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
If bShowLoading Then LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD)
|
||||
End Sub
|
||||
|
||||
#End Region ' SaveCommand
|
||||
@@ -354,6 +430,7 @@ Public Class ProdManagerVM
|
||||
If IsNothing(ProjFileMList) Then
|
||||
Return
|
||||
ElseIf ProjFileMList.Count = 1 AndAlso ProjFileMList(0).nProjId > 0 Then
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.GOTOPROJ, 2, EgtMsg(63015), EgtMsg(63011), 10) ' Part viewer opening ' Loading environment
|
||||
nProjId = ProjFileMList(0).nProjId
|
||||
ElseIf ProjFileMList.Count > 1 Then
|
||||
Dim ProjFileVMList As New List(Of ProjectFileVM)
|
||||
@@ -369,6 +446,7 @@ Public Class ProdManagerVM
|
||||
If Not IsNothing(OpenProjectFileDialogVM.SelProject.nProdId) AndAlso OpenProjectFileDialogVM.SelProject.nProdId > 0 Then
|
||||
nProjId = OpenProjectFileDialogVM.SelProject.nProjId
|
||||
End If
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.GOTOPROJ, 2, EgtMsg(63015), EgtMsg(63011), 10) ' Part viewer opening ' Loading environment
|
||||
Else Return
|
||||
End If
|
||||
' apro progetto proj
|
||||
@@ -377,10 +455,55 @@ Public Class ProdManagerVM
|
||||
Map.refProjManagerVM.CurrProj.SetReloadProject(IsNothing(CurrProd) OrElse VerifyResult = MessageBoxResult.No)
|
||||
' vado in pagina proj
|
||||
Map.refMainMenuVM.SetSelPage(Pages.VIEW, False)
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.GOTOPROJ)
|
||||
End Sub
|
||||
|
||||
#End Region ' GoToProj
|
||||
|
||||
#Region "GoToSupervisor"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Open.
|
||||
''' </summary>
|
||||
Public ReadOnly Property GoToSupervisor_Command As ICommand
|
||||
Get
|
||||
If m_cmdGoToSupervisor Is Nothing Then
|
||||
m_cmdGoToSupervisor = New Command(AddressOf GoToSupervisor)
|
||||
End If
|
||||
Return m_cmdGoToSupervisor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub GoToSupervisor()
|
||||
If IsNothing(m_CurrProd) Then Return
|
||||
' apro supervisore
|
||||
Dim sSupervisorName As String = "EgtBEAMWALL.SupervisorR32"
|
||||
' recupero processo del supervisore
|
||||
Dim localProc As Process() = Process.GetProcessesByName(sSupervisorName)
|
||||
If localProc.Length > 0 Then
|
||||
For Each p As Process In localProc
|
||||
' porto in primo piano il Supervisor
|
||||
BringWindowToFront(p.MainWindowHandle)
|
||||
Exit For
|
||||
Next
|
||||
Else
|
||||
Dim sSupervisorPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sSupervisorName & ".exe"
|
||||
Try
|
||||
Process.Start(sSupervisorPath, "1 " & CurrProd.nProdId)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error: impossible starting supervisor from path " & sSupervisorPath)
|
||||
End Try
|
||||
End If
|
||||
' mando richiesta di apertura progetto in supervisore
|
||||
'Dim x = DbControllers.m_StatusMapController.GetProd
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refProdManagerVM.CurrProd.nProdId, Map.refProdManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInSupervisorRequest, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' GoToSupervisor
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
</Button>-->
|
||||
<Button Command="{Binding UpdateBTL_Command}"
|
||||
ToolTip="{Binding UpdateBTL_ToolTip}"
|
||||
Visibility="{Binding UpdateBTL_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/UpdateBTL.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
@@ -91,6 +91,16 @@ Public Class ProjManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_UpdateBTL_Visibility As Visibility = Visibility.Collapsed
|
||||
Public Property UpdateBTL_Visibility As Visibility
|
||||
Get
|
||||
Return m_UpdateBTL_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_UpdateBTL_Visibility = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdNew As ICommand
|
||||
Private m_cmdOpen As ICommand
|
||||
@@ -173,6 +183,10 @@ Public Class ProjManagerVM
|
||||
m_nLastProjId = GetMainPrivateProfileInt(S_GENERAL, K_PROJSINDEX, 1)
|
||||
' Impostazioni MruLists
|
||||
m_MruFiles.Init(S_MRUPROJFILES, 8)
|
||||
' leggo attivazione update btl
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_UPDATEBTL, 0) > 0 Then
|
||||
UpdateBTL_Visibility = Visibility.Visible
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -380,10 +394,10 @@ Public Class ProjManagerVM
|
||||
OpenProject(Nothing)
|
||||
End Sub
|
||||
|
||||
Friend Sub OpenProject(TempCurrPj As ProjFileVM)
|
||||
Friend Sub OpenProject(ReceivedCurrProj As ProjFileVM)
|
||||
Dim bStart As Boolean = IsNothing(m_TempCurrProj)
|
||||
m_TempCurrProj = TempCurrPj
|
||||
' se la string è vuota
|
||||
m_TempCurrProj = ReceivedCurrProj
|
||||
' se la stringa è vuota
|
||||
Dim OpenProjectFileDialogVM As OpenProjectFileDialogVM = Nothing
|
||||
If IsNothing(TempCurrProj) Then
|
||||
' apro dialogo di scelta file
|
||||
@@ -393,6 +407,7 @@ Public Class ProjManagerVM
|
||||
If IsNothing(DialogResult) OrElse Not DialogResult Then Return
|
||||
TempCurrProj = OpenProjectFileDialogVM.SelProject
|
||||
End If
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROJ, 3, EgtMsg(63000), EgtMsg(63001), 50) ' Project opening ' Loading project geometries
|
||||
' imposto ProjId di caricamento
|
||||
m_nLoadingProjId = TempCurrProj.nProjId
|
||||
' se esiste prod prendo quello, altrimenti proj
|
||||
@@ -428,6 +443,7 @@ Public Class ProjManagerVM
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROJ)
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenCommand
|
||||
@@ -471,19 +487,24 @@ Public Class ProjManagerVM
|
||||
Public ReadOnly Property SaveCommand As ICommand
|
||||
Get
|
||||
If m_cmdSave Is Nothing Then
|
||||
m_cmdSave = New Command(AddressOf Save)
|
||||
m_cmdSave = New Command(AddressOf SaveCmd)
|
||||
End If
|
||||
Return m_cmdSave
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub SaveCmd()
|
||||
Save(True)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Save. This method is invoked by the SaveCommand.
|
||||
''' </summary>
|
||||
Public Sub Save()
|
||||
Public Sub Save(Optional bShowLoading As Boolean = False)
|
||||
If IsNothing(CurrProj) Then Return
|
||||
Dim bShowBuilding As Boolean = False
|
||||
Dim bShowSolid As Boolean = False
|
||||
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROJ, 1, EgtMsg(63007), "", 100) ' Project saving
|
||||
' se vista tutti i pezzi
|
||||
If Map.refShowBeamPanelVM.bShowAll Then
|
||||
' verifico se assemblato e lo annullo per salvataggio
|
||||
@@ -521,6 +542,7 @@ Public Class ProjManagerVM
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
If bShowLoading Then LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROJ)
|
||||
End Sub
|
||||
|
||||
#End Region ' SaveCommand
|
||||
@@ -611,6 +633,7 @@ Public Class ProjManagerVM
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63008), EgtMsg(63009), 50) ' BTL file importing ' Reading BTL file
|
||||
' inizializzo nuovo progetto
|
||||
If nProjId = 0 Then
|
||||
InitNewProject(nProjId, sProjDir, nType, Machine)
|
||||
@@ -632,6 +655,9 @@ Public Class ProjManagerVM
|
||||
EgtOutLog("Impossibile copiare il file")
|
||||
bOk = False
|
||||
End Try
|
||||
' disattivo temporaneamente bottone assemblato per non prendere il riferimento sbagliato durante importazione
|
||||
Dim bAssembly As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
|
||||
Map.refShowBeamPanelVM.ShowBuilding_IsChecked = False
|
||||
' importo file
|
||||
If bOk Then
|
||||
bOk = Map.refSceneHostVM.MainController.ImportProject(sBtlCopyPath, False)
|
||||
@@ -670,16 +696,22 @@ Public Class ProjManagerVM
|
||||
Next
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))
|
||||
Map.refPartManagerVM.LockVisibilityUpdate()
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63006), 70, 100) ' Loading graphics
|
||||
Map.refShowBeamPanelVM.ShowBuilding_IsChecked = bAssembly
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll()
|
||||
Map.refShowBeamPanelVM.ShowAll(True)
|
||||
Else
|
||||
Map.refShowBeamPanelVM.ShowBuilding_IsChecked = bAssembly
|
||||
' elimino da Db
|
||||
DbControllers.m_ProjController.DeleteProj(nProjId)
|
||||
End If
|
||||
' carico filtri di ricerca
|
||||
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
||||
' gestisco log di importazione
|
||||
ManageImportLog(nProjId, sProjDir)
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTBTL)
|
||||
End Sub
|
||||
|
||||
Private Sub ManageImportLog(nProjId As Integer, sProjDir As String)
|
||||
@@ -881,6 +913,16 @@ Public Class ProjManagerVM
|
||||
Case Else
|
||||
Return Nothing
|
||||
End Select
|
||||
|
||||
' apro finestra di salvataggio progetto
|
||||
Dim ExportDlg As New Microsoft.Win32.SaveFileDialog() With {.DefaultExt = ".ngexp",
|
||||
.Filter = "ProjectExport (*.ngexp)|*.ngexp",
|
||||
.FileName = CurrProj.nProjId.ToString("0000") & " - " & CurrProj.sBTLFileName & " - ProjectExport"}
|
||||
If IsNothing(sExportFileName) Then
|
||||
If ExportDlg.ShowDialog() <> True Then Return Nothing
|
||||
End If
|
||||
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.EXPORTPROJECT, 2, EgtMsg(63010), EgtMsg(63016), 30) ' Project exporting ' Adding export info
|
||||
' se assemblato me lo segno e lo smonto
|
||||
Dim bShowBuilding As Boolean = False
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
@@ -891,14 +933,6 @@ Public Class ProjManagerVM
|
||||
End If
|
||||
End If
|
||||
|
||||
' apro finestra di salvataggio progetto
|
||||
Dim ExportDlg As New Microsoft.Win32.SaveFileDialog() With {.DefaultExt = ".ngexp",
|
||||
.Filter = "ProjectExport (*.ngexp)|*.ngexp",
|
||||
.FileName = CurrProj.nProjId.ToString("0000") & " - " & CurrProj.sBTLFileName & " - ProjectExport"}
|
||||
If IsNothing(sExportFileName) Then
|
||||
If ExportDlg.ShowDialog() <> True Then Return Nothing
|
||||
End If
|
||||
|
||||
' per ogni BTLInfo nel progetto riporto il relativo nome del BTL
|
||||
Dim nBTLInfoProjId As Integer
|
||||
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
@@ -931,6 +965,7 @@ Public Class ProjManagerVM
|
||||
'Else
|
||||
' EgtSetInfo(Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId, EXP_PROJ & 1, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
'End If
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.EXPORTPROJECT, 2, EgtMsg(63017), 30, 100) ' Exporting...
|
||||
' salvo info inserite
|
||||
Map.refSceneHostVM.SaveProject()
|
||||
' creo file zip
|
||||
@@ -957,6 +992,7 @@ Public Class ProjManagerVM
|
||||
' salvo eliminazione info inserite
|
||||
Map.refSceneHostVM.SaveProject()
|
||||
If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False)
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.EXPORTPROJECT)
|
||||
Return sZipToCreate
|
||||
End Function
|
||||
|
||||
@@ -1009,10 +1045,12 @@ Public Class ProjManagerVM
|
||||
MessageBox.Show("Impossibile importare file", "Errore")
|
||||
Return
|
||||
End Try
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.IMPORTPROJECT, 2, EgtMsg(63018), EgtMsg(63019), 30) ' Project importing ' Loading project
|
||||
' carico progetto
|
||||
Dim sProjFromPath() As String = Directory.GetFiles(sProjectimportDir, "*.nge")
|
||||
Dim bOk = EgtOpenFile(sProjFromPath(0))
|
||||
If Not bOk Then
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT)
|
||||
MessageBox.Show("Impossibile aprire il file", "Errore")
|
||||
Return
|
||||
End If
|
||||
@@ -1022,6 +1060,7 @@ Public Class ProjManagerVM
|
||||
EgtGetInfo(nImpExpPartId, EXP_MACHINE, sMachine)
|
||||
' se la macchina del progetto in apertura non è tra le macchine disponibili lo segnalo e apro un progetto vuoto
|
||||
If IsNothing(Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = sMachine)) Then
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT)
|
||||
MessageBox.Show(EgtMsg(61885), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
|
||||
Return
|
||||
End If
|
||||
@@ -1029,11 +1068,13 @@ Public Class ProjManagerVM
|
||||
Dim nType As Integer = BWType.NULL
|
||||
EgtGetInfo(nImpExpPartId, BTL_GEN_PROJTYPE, nType)
|
||||
If IsNothing(Machine) OrElse nType = BWType.NULL Then
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT)
|
||||
MessageBox.Show(EgtMsg(61885), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
|
||||
Return
|
||||
End If
|
||||
' elimino part di esportazione
|
||||
EgtErase(nImpExpPartId)
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.IMPORTPROJECT, 2, EgtMsg(63020), 30, 100) ' Creating imported project
|
||||
' leggo proj e prod presenti dai layer BTLInfo
|
||||
Dim ImportProjIdList As New List(Of Integer)
|
||||
Dim NewProjIdList As New List(Of Integer)
|
||||
@@ -1107,6 +1148,7 @@ Public Class ProjManagerVM
|
||||
File.Copy(sProjFromPath(0), sProjFileName)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Impossibile copiare il file")
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT)
|
||||
MessageBox.Show("Impossibile copiare il file del progetto", "Errore")
|
||||
Return
|
||||
End Try
|
||||
@@ -1208,6 +1250,7 @@ Public Class ProjManagerVM
|
||||
' ripristino eventuale CurrProd precedente
|
||||
Map.refProdManagerVM.CurrProd = CurrProd
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, Path.GetDirectoryName(ImportDlg.FileName))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT)
|
||||
''' imposto progetto corrente
|
||||
''If NewProjIdList.Count > 0 Then SetCurrProj(NewProjIdList(0))
|
||||
''' costruisco BTLStructure del proj
|
||||
@@ -1257,10 +1300,10 @@ Public Class ProjManagerVM
|
||||
''' Execute the GoToProd. This method is invoked by the GoToProd_Command.
|
||||
''' </summary>
|
||||
Public Sub GoToProd(ByVal param As Object)
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
If IsNothing(CurrProj) Then Return
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
Dim bSaved As Boolean = True
|
||||
If Map.refProjManagerVM.CurrProj.bIsNew Or EgtGetModified() OrElse Map.refCALCPanelVM.IsMachineModified() Then
|
||||
If CurrProj.bIsNew Or EgtGetModified() OrElse Map.refCALCPanelVM.IsMachineModified() Then
|
||||
Select Case MessageBox.Show(EgtMsg(61877), "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
|
||||
Case MessageBoxResult.Yes
|
||||
Save()
|
||||
@@ -1277,6 +1320,8 @@ Public Class ProjManagerVM
|
||||
End Select
|
||||
End If
|
||||
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63004), EgtMsg(63011), 10) ' Optimization opening ' Loading environment
|
||||
|
||||
Dim nProdId As Integer = Map.refProjManagerVM.CurrProj.nProdId
|
||||
If nProdId > 0 Then
|
||||
Map.refProdManagerVM.SetCurrProd(nProdId)
|
||||
@@ -1357,6 +1402,7 @@ Public Class ProjManagerVM
|
||||
Map.refMainMenuVM.SetSelPage(Pages.MACHINING, False)
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.GOTOPROD)
|
||||
End Sub
|
||||
|
||||
#End Region ' GoToProd
|
||||
|
||||
@@ -13,53 +13,73 @@
|
||||
Visibility="{Binding DataContext.OptimizePanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
|
||||
</EgtFloating:EgtFloatingTray>
|
||||
|
||||
<EgtBEAMWALL:FreeContourInputV DockPanel.Dock="Right"
|
||||
<EgtBEAMWALL:FreeContourInputV DockPanel.Dock="Right"
|
||||
DataContext="{StaticResource FreeContourInputVM}"
|
||||
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding GridDims[0].GridLen, Mode=TwoWay}"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="{Binding GridDims[1].GridLen, Mode=TwoWay}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding GridDims[0].GridLen, Mode=TwoWay}"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="{Binding GridDims[1].GridLen, Mode=TwoWay}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding GridDims[2].GridLen, Mode=TwoWay}"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding GridDims[3].GridLen, Mode=TwoWay}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:LeftPanelV Grid.Column="0"
|
||||
Grid.RowSpan="4"
|
||||
DataContext="{StaticResource LeftPanelVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
|
||||
Visibility="{Binding DataContext.LeftPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
|
||||
<GridSplitter Grid.Column="1"
|
||||
Grid.RowSpan="4"
|
||||
Width="3"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Stretch"/>
|
||||
<EgtFloating:EgtFloatingTray x:Name="SCENETOPTRAY"
|
||||
Grid.Column="2"
|
||||
Grid.Row="0">
|
||||
<WrapPanel Orientation="Horizontal" Width="{Binding ActualWidth, ElementName=TOPTRAY}">
|
||||
<EgtBEAMWALL:ShowPanelV DataContext="{StaticResource ShowPanelVM}"/>
|
||||
<EgtBEAMWALL:ShowBeamPanelV DataContext="{StaticResource ShowBeamPanelVM}"
|
||||
Visibility="{Binding DataContext.ShowBeamPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
|
||||
<EgtBEAMWALL:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
|
||||
<EgtBEAMWALL:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
|
||||
<EgtBEAMWALL:CalcPanelV DataContext="{StaticResource CALCPanelVM}"/>
|
||||
<EgtBEAMWALL:FreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
|
||||
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
|
||||
</WrapPanel>
|
||||
</EgtFloating:EgtFloatingTray>
|
||||
<!--<Grid Grid.Column="2" Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition MinHeight="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding GridDims[2].GridLen, Mode=TwoWay}"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding GridDims[3].GridLen, Mode=TwoWay}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:LeftPanelV Grid.Column="0" Grid.RowSpan="4" Margin="0,0,5,0"
|
||||
DataContext="{StaticResource LeftPanelVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
|
||||
Visibility="{Binding DataContext.LeftPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
|
||||
<GridSplitter Width="3" HorizontalAlignment="Center" VerticalAlignment="Stretch" Grid.Column="1" Grid.RowSpan="4"/>
|
||||
<EgtFloating:EgtFloatingTray x:Name="SCENETOPTRAY" Grid.Column="2" Grid.Row="0">
|
||||
<WrapPanel Orientation="Horizontal" Width="{Binding ActualWidth, ElementName=TOPTRAY}">
|
||||
<EgtBEAMWALL:ShowPanelV DataContext="{StaticResource ShowPanelVM}"/>
|
||||
<EgtBEAMWALL:ShowBeamPanelV DataContext="{StaticResource ShowBeamPanelVM}"
|
||||
Visibility="{Binding DataContext.ShowBeamPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
|
||||
<EgtBEAMWALL:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
|
||||
<EgtBEAMWALL:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
|
||||
<EgtBEAMWALL:CalcPanelV DataContext="{StaticResource CALCPanelVM}"/>
|
||||
<EgtBEAMWALL:FreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
|
||||
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
|
||||
</WrapPanel>
|
||||
</EgtFloating:EgtFloatingTray>
|
||||
<Grid Grid.Column="2" Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition MinHeight="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:SceneHostV Grid.Row="0" Margin="0,0,0,5"/>
|
||||
<EgtBEAMWALL:PartManagerV Grid.Row="1"
|
||||
DataContext="{StaticResource PartManagerVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
|
||||
Visibility="{Binding DataContext.PartManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
|
||||
</Grid.RowDefinitions>-->
|
||||
<EgtBEAMWALL:SceneHostV Grid.Column="2" Grid.Row="1"/>
|
||||
<!--<EgtBEAMWALL:PartManagerV Grid.Row="1"
|
||||
DataContext="{StaticResource PartManagerVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
|
||||
Visibility="{Binding DataContext.PartManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>-->
|
||||
|
||||
</Grid>
|
||||
<GridSplitter Height="3" HorizontalAlignment="Stretch" Grid.Column="2" Grid.Row="2"/>
|
||||
<Grid Grid.Column="2" Grid.Row="3">
|
||||
<!--</Grid>-->
|
||||
<GridSplitter Grid.Column="2"
|
||||
Grid.Row="2"
|
||||
Height="3"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
<Grid Grid.Column="2"
|
||||
Grid.Row="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="5"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:PartManagerV Grid.Row="0"
|
||||
DataContext="{StaticResource PartManagerVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
|
||||
Visibility="{Binding DataContext.PartManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
|
||||
<Grid Grid.Column="2" Grid.Row="1">
|
||||
<EgtBEAMWALL:TopPanelV
|
||||
DataContext="{StaticResource TopPanelVM}"
|
||||
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
|
||||
@@ -70,7 +90,9 @@
|
||||
Tag="{Binding DataContext.BTLStructureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
|
||||
Visibility="{Binding DataContext.BottomPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
|
||||
Height="Auto"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</EgtFloating:EgtFloatingManager>
|
||||
|
||||
|
Before Width: | Height: | Size: 449 B |
|
Before Width: | Height: | Size: 427 B |
|
Before Width: | Height: | Size: 379 B |
@@ -498,6 +498,8 @@ Public Class MySceneHostVM
|
||||
Private Sub OnNewProject(sender As Object, bOk As Boolean)
|
||||
Map.refMainWindowVM.SetTitle(" New - EgtBEAMWALL")
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateNewBTLStructure())
|
||||
' carico filtri di ricerca
|
||||
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
||||
EgtDraw()
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
@@ -507,6 +509,8 @@ Public Class MySceneHostVM
|
||||
Dim ProjId As Integer = If(ProjectType = ProjectType.PROJ, Map.refProjManagerVM.nLoadingProjId, 0)
|
||||
' Procedo a seconda del risultato
|
||||
If bOk Then
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROJ, 2, EgtMsg(63005), 50, 70) ' Loading part list
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 2, EgtMsg(63005), 50, 70) ' Loading part list
|
||||
' leggo struttura BTL
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjId))
|
||||
' verifico se volume pezzi calcolato
|
||||
@@ -534,6 +538,7 @@ Public Class MySceneHostVM
|
||||
Map.refMachinePanelVM.SelectedMachine = Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.TempCurrProj.sMachine)
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Map.refProjManagerVM.CurrProj = Map.refProjManagerVM.TempCurrProj
|
||||
DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True)
|
||||
@@ -548,6 +553,7 @@ Public Class MySceneHostVM
|
||||
SectionXMaterial.SetType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
If Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then Map.refProdManagerVM.CurrProd = Map.refProdManagerVM.TempCurrProd
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True)
|
||||
@@ -555,8 +561,9 @@ Public Class MySceneHostVM
|
||||
Map.refCALCPanelVM.LoadMachineList()
|
||||
End If
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROJ, 3, EgtMsg(63006), 70, 100) ' Loading graphics
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll()
|
||||
Map.refShowBeamPanelVM.ShowAll(True)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
' recupero indice di modifica progetto quando caricato
|
||||
Dim CommIndex As Integer = -1
|
||||
@@ -566,6 +573,8 @@ Public Class MySceneHostVM
|
||||
CommIndex = ActiveSession.Index
|
||||
End If
|
||||
Next
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63002), 70, 100) ' Loading machining groups
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63002), 50, 100) ' Loading machining groups
|
||||
' carico gruppi di lavorazione
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
' fisso indice sessione di comunicazione
|
||||
@@ -596,6 +605,9 @@ Public Class MySceneHostVM
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
End If
|
||||
End If
|
||||
' carico filtri di ricerca
|
||||
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
||||
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
@@ -653,6 +665,7 @@ Public Class MySceneHostVM
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, Path.GetDirectoryName(sFile))
|
||||
Dim bFirstPart As Boolean = EgtGetFirstPart() <> GDB_ID.NULL
|
||||
If bOk OrElse bFirstPart Then
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.IMPORTBTL, 2, EgtMsg(63005), 50, 70) ' Loading parts
|
||||
' leggo struttura BTL
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
@@ -687,6 +700,7 @@ Public Class MySceneHostVM
|
||||
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
|
||||
Map.refProjManagerVM.NewProject()
|
||||
End If
|
||||
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
@@ -808,6 +822,13 @@ Public Class MySceneHostVM
|
||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
||||
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
||||
While nId <> GDB_ID.NULL
|
||||
' scarto box per evitare selezione pezzo esterno in finestre
|
||||
Dim sName As String = ""
|
||||
EgtGetName(nId, sName)
|
||||
If sName = "Box" Then
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
Continue While
|
||||
End If
|
||||
' Recupero l'identificativo del pezzo cui appartiene
|
||||
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
|
||||
Dim MyMachGroup As MyMachGroupVM = DirectCast(Map.refMachGroupPanelVM.SelectedMachGroup, MyMachGroupVM)
|
||||
|
||||
@@ -130,13 +130,17 @@ Public Class ShowBeamPanelVM
|
||||
Public ReadOnly Property ShowAll_Command As ICommand
|
||||
Get
|
||||
If m_cmdShowAll Is Nothing Then
|
||||
m_cmdShowAll = New Command(AddressOf ShowAll)
|
||||
m_cmdShowAll = New Command(AddressOf ShowAllCmd)
|
||||
End If
|
||||
Return m_cmdShowAll
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub ShowAll(Optional bDraw As Boolean = True)
|
||||
Public Sub ShowAllCmd()
|
||||
ShowAll(True)
|
||||
End Sub
|
||||
|
||||
Public Sub ShowAll(bDraw As Boolean)
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
' se necessario tolgo solido dal precedentemente selezionato
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso m_bShowSolid Then
|
||||
|
||||
@@ -303,7 +303,7 @@ Public Class StatisticsVM
|
||||
If Not IsNothing(RawPart) Then
|
||||
RawPart.nQuantity += 1
|
||||
Else
|
||||
m_RawPartList.Add(New SParam(MachGroup.Section, MachGroup.dL, 1))
|
||||
m_RawPartList.Add(New SParam(MachGroup.Section, MachGroup.dL, 1, True))
|
||||
End If
|
||||
Next
|
||||
Case BWType.WALL
|
||||
|
||||
@@ -4,6 +4,10 @@ Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
Public Class SupervisorComm
|
||||
|
||||
Private m_BlockedWnd As BlockedWndV
|
||||
Private m_bTickInExecution As Boolean = False
|
||||
|
||||
Private m_CurrSession_ProdId As Integer = 0
|
||||
Private m_CurrSession_Index As Integer = 0
|
||||
|
||||
Sub New()
|
||||
' imposto in Map
|
||||
@@ -11,21 +15,57 @@ Public Class SupervisorComm
|
||||
End Sub
|
||||
|
||||
Friend Sub Timer_Tick()
|
||||
If m_bTickInExecution Then
|
||||
EgtUILib.EgtOutLog("Tick gia' in esecuzione!!")
|
||||
Return
|
||||
End If
|
||||
m_bTickInExecution = True
|
||||
' se arriva info di cambio progetto
|
||||
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd()
|
||||
Dim MySession As StatusMapModel = ActiveSessionList.FirstOrDefault(Function(x) x.Session = DbControllers.m_SupervisorId)
|
||||
If Not IsNothing(MySession) Then
|
||||
If m_CurrSession_ProdId <> MySession.ItemId OrElse MySession.Index < m_CurrSession_Index Then
|
||||
m_CurrSession_ProdId = MySession.ItemId
|
||||
m_CurrSession_Index = MySession.Index
|
||||
End If
|
||||
If MySession.Index > m_CurrSession_Index Then
|
||||
' recupero elementi modificati
|
||||
Dim MessagesList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetFrom(m_CurrSession_Index + 1)
|
||||
For Each Message In MessagesList
|
||||
Select Case Message.ItemType
|
||||
Case StatusMapItemType.Comm
|
||||
Select Case Message.Operation
|
||||
Case StatusMapOpType.ChangeProdInProdRequest
|
||||
Map.refProdManagerVM.OpenProjectFromSupervisor(Message.ItemId)
|
||||
Case StatusMapOpType.OpenPageInViewOptimRequest
|
||||
Map.refMainMenuVM.OpenPageFromSupervisor(Math.Abs(Message.ItemId))
|
||||
End Select
|
||||
End Select
|
||||
Next
|
||||
m_CurrSession_Index = MySession.Index
|
||||
End If
|
||||
End If
|
||||
' se sono in pagina vista
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
' se non c'e' un progetto attivo, esco
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
m_bTickInExecution = False
|
||||
Return
|
||||
End If
|
||||
' verifico se c'e' un progetto aperto o in caricamento
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse Map.refProjManagerVM.bLoadingProj Then Return
|
||||
' verifico se c'e' una sessione aperta sul progetto corrente
|
||||
Dim nModificationIndex As Integer = -1
|
||||
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd()
|
||||
ActiveSessionList = DbControllers.m_StatusMapController.GetProd()
|
||||
For Each ActiveSession In ActiveSessionList
|
||||
If ActiveSession.ItemId = Map.refProjManagerVM.CurrProj.nProdId Then
|
||||
nModificationIndex = ActiveSession.Index
|
||||
End If
|
||||
Next
|
||||
If nModificationIndex = -1 Then Return
|
||||
If nModificationIndex = -1 Then
|
||||
m_bTickInExecution = False
|
||||
Return
|
||||
End If
|
||||
' verifico se ci sono modifiche
|
||||
If nModificationIndex <> Map.refProjManagerVM.CurrProj.nModificationIndex Then
|
||||
' recupero elementi modificati
|
||||
@@ -61,18 +101,24 @@ Public Class SupervisorComm
|
||||
' se sono in pagina ottimizzatore
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
' se non c'e' un progetto attivo, esco
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
m_bTickInExecution = False
|
||||
Return
|
||||
End If
|
||||
' verifico se c'e' un progetto aperto o in caricamento
|
||||
'If IsNothing(Map.refProdManagerVM.CurrProd) OrElse Map.refProdManagerVM.bLoadingProd Then Return
|
||||
' verifico se c'e' una sessione aperta sul progetto corrente
|
||||
Dim nModificationIndex As Integer = -1
|
||||
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd()
|
||||
ActiveSessionList = DbControllers.m_StatusMapController.GetProd()
|
||||
For Each ActiveSession In ActiveSessionList
|
||||
If ActiveSession.ItemId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
nModificationIndex = ActiveSession.Index
|
||||
End If
|
||||
Next
|
||||
If nModificationIndex = -1 Then Return
|
||||
If nModificationIndex = -1 Then
|
||||
m_bTickInExecution = False
|
||||
Return
|
||||
End If
|
||||
' verifico se ci sono modifiche
|
||||
If nModificationIndex <> Map.refProdManagerVM.CurrProd.nModificationIndex Then
|
||||
' recupero elementi modificati
|
||||
@@ -209,20 +255,14 @@ Public Class SupervisorComm
|
||||
' MachGroupModification.Value(1) = MachGroupModification.Value(0)
|
||||
' Next
|
||||
|
||||
|
||||
' ' ricarico il progetto
|
||||
' 'Map.refProjectVM.SupervisorMachGroupPanelVM.ReloadProjectFile()
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
' ' aggiorno indice del prod
|
||||
' Map.refSupervisorManagerVM.CurrProd.SetModificationIndex(nModificationIndex)
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
|
||||
'' verifico se e' aperto in qualche ottimizzatore
|
||||
''DbControllers.m_ProdController.
|
||||
''Map.refSupervisorManagerVM.CurrProd.bIsLocked
|
||||
@@ -232,15 +272,11 @@ Public Class SupervisorComm
|
||||
|
||||
'' aggiorno eventuali nuovi machgroup
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'' se devo ripartire a meta' di una barra
|
||||
|
||||
'' mando messaggio di blocco dell'ottimizzatore
|
||||
|
||||
|
||||
m_bTickInExecution = False
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
End Class
|
||||
@@ -56,12 +56,6 @@
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/TopPanel/RemoveRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding MovePartInRawPart_Command}"
|
||||
ToolTip="{Binding MovePartInRawPart_ToolTip}"
|
||||
IsEnabled="{Binding TopPanel_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/TopPanel/MovePartInRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<EgtBEAMWALL:RawPartListV Grid.Column="1"
|
||||
@@ -101,7 +95,8 @@
|
||||
</StackPanel>
|
||||
<EgtBEAMWALL:PartInRawPartListV Grid.Column="1" Grid.Row="2"
|
||||
DataContext="{StaticResource PartInRawPartListVM}"
|
||||
Tag="{Binding Tag.MachGroupPanelVM.SelectedMachGroup, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:TopPanelV}}}"/>
|
||||
Tag="{Binding Tag.MachGroupPanelVM.SelectedMachGroup, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:TopPanelV}}}"
|
||||
Margin="0,0,5,0"/>
|
||||
</Grid>
|
||||
<GridSplitter Width="3" HorizontalAlignment="Center" VerticalAlignment="Stretch" Grid.Column="1"/>
|
||||
<Grid Grid.Column="2">
|
||||
@@ -127,7 +122,8 @@
|
||||
Tag="{Binding Tag.MachGroupPanelVM.SelectedMachGroup.SelPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:TopPanelV}}}"/>
|
||||
<GridSplitter Height="3"
|
||||
HorizontalAlignment="Stretch"
|
||||
Grid.Row="1"/>
|
||||
Grid.Row="1"
|
||||
Visibility="{Binding QParSplitter_Visibility}"/>
|
||||
<EgtBEAMWALL:QParameterListV Grid.Row="2"
|
||||
DataContext="{StaticResource DuploQParameterListVM}"
|
||||
Tag="{Binding Tag.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:TopPanelV}}}"
|
||||
|
||||
@@ -19,6 +19,13 @@ Public Class TopPanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_QParSplitter_Visibility As Visibility
|
||||
Public ReadOnly Property QParSplitter_Visibility As Visibility
|
||||
Get
|
||||
Return If(Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE = BWType.WALL, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Enum Tabs As Integer
|
||||
OPTIMIZATION = 0
|
||||
STATISTICS = 1
|
||||
@@ -63,7 +70,6 @@ Public Class TopPanelVM
|
||||
Private m_cmdMoveUpPart As ICommand
|
||||
Private m_cmdMoveDownPart As ICommand
|
||||
Private m_cmdReOrderPart As ICommand
|
||||
Private m_cmdMovePartInRawPart As ICommand
|
||||
|
||||
Public ReadOnly Property MovePart_Visibility As Visibility
|
||||
Get
|
||||
@@ -130,12 +136,6 @@ Public Class TopPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MovePartInRawPart_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61944)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region 'FIELDS & PROPERTIES
|
||||
@@ -158,6 +158,22 @@ Public Class TopPanelVM
|
||||
NotifyPropertyChanged(NameOf(QParameter_Visibility))
|
||||
End Sub
|
||||
|
||||
Friend Sub ManageQParamsRowVisibility(bVisible As Boolean)
|
||||
If bVisible Then
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.TOPPANEL_OPTIMIZER, GridDims)
|
||||
Else
|
||||
GridDimension.SetSoftwareMod(True)
|
||||
Dim FeatureRow = m_GridDims(4)
|
||||
Dim QParRow = m_GridDims(5)
|
||||
m_GridDims(4).GridLen = New GridLength(1, GridUnitType.Star)
|
||||
m_GridDims(4).NotifyPropertyChanged(NameOf(FeatureRow.GridLen))
|
||||
m_GridDims(5).GridLen = New GridLength(0)
|
||||
m_GridDims(5).NotifyPropertyChanged(NameOf(QParRow.GridLen))
|
||||
GridDimension.SetSoftwareMod(False)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(QParSplitter_Visibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -204,8 +220,12 @@ Public Class TopPanelVM
|
||||
DbControllers.m_PartController.UpdateStatus(Map.refProdManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.Assigned)
|
||||
Part.nProduction_State = ItemState.Assigned
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
' disabilito impostazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
' blocco modifica del pezzo
|
||||
EgtDuploSetLocked(Part.nPartId)
|
||||
' ripristino precedente impostazione modificato
|
||||
DisableMgr.ReEnable()
|
||||
Next
|
||||
Else
|
||||
ErrorMsg = String.Format("Impossible sending {0} to supervisor because not machinable!", MachGroup.Name)
|
||||
@@ -478,32 +498,6 @@ Public Class TopPanelVM
|
||||
|
||||
#End Region ' ReOrderPart
|
||||
|
||||
#Region "MovePartInRawPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MovePartInRawPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdMovePartInRawPart Is Nothing Then
|
||||
m_cmdMovePartInRawPart = New Command(AddressOf MovePartInRawPart)
|
||||
End If
|
||||
Return m_cmdMovePartInRawPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MovePartInRawPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
Dim MovePartInRawPartWndVM As New MovePartInRawPartWndVM()
|
||||
Dim MovePartInRawPartWnd As New MovePartInRawPartWndV(Application.Current.MainWindow, MovePartInRawPartWndVM)
|
||||
If Not MovePartInRawPartWnd.ShowDialog() Then Return
|
||||
End Sub
|
||||
|
||||
#End Region ' MovePartInRawPart
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||