Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 31dcf81fc2 | |||
| b7ada79678 | |||
| a158df1115 | |||
| b0f7488fd6 | |||
| 8b871d0c15 | |||
| 01804c5d0d | |||
| 75c02a7625 |
@@ -155,7 +155,7 @@ Public Module CalcIntegration
|
||||
Else
|
||||
vProc(j).Proc.StartInfo.Arguments = """" & vBar(nCurrBar).sBarPath & """ " &
|
||||
"""" & vBar(nCurrBar).nProjType & """ " &
|
||||
"""" & vBar(nCurrBar).nMachineName & """ " & vBar(nCurrBar).nCmdType
|
||||
"""" & vBar(nCurrBar).nMachineName & """ " & vBar(nCurrBar).nCmdType & " " & vBar(nCurrBar).nBarState
|
||||
End If
|
||||
vProc(j).Proc.StartInfo.UseShellExecute = False
|
||||
|
||||
@@ -475,7 +475,7 @@ Public Module CalcIntegration
|
||||
End Module
|
||||
|
||||
Public Class Bar
|
||||
Public nBarState As Integer
|
||||
Public nBarState As Integer = -1
|
||||
Public nBarId As Integer
|
||||
Public sBarPath As String
|
||||
Public bBarOk As Boolean
|
||||
|
||||
@@ -38,5 +38,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("3.1.5.1")>
|
||||
<Assembly: AssemblyFileVersion("3.1.5.1")>
|
||||
<Assembly: AssemblyVersion("3.1.4.7")>
|
||||
<Assembly: AssemblyFileVersion("3.1.4.7")>
|
||||
|
||||
@@ -302,11 +302,7 @@
|
||||
|
||||
<!--#region Colori ComboBox-->
|
||||
|
||||
<!--<SolidColorBrush x:Key="ComboBox.Static.Background" Color="{StaticResource BeamWall_Glacier_Color}"/>-->
|
||||
<LinearGradientBrush x:Key="ComboBox.Static.Background" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="{StaticResource BeamWall_Gallery_Color}" Offset="0.0"/>
|
||||
<GradientStop Color="{StaticResource BeamWall_Mercury_Color}" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Background" Color="{StaticResource BeamWall_Glacier_Color}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Border" Color="{StaticResource BeamWall_Glacier_Color}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Glyph" Color="{StaticResource BeamWall_White_Color}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Foreground" Color="{StaticResource BeamWall_Corduroy_Color}"/>
|
||||
|
||||
@@ -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("3.1.5.1")]
|
||||
[assembly: AssemblyFileVersion("3.1.5.1")]
|
||||
[assembly: AssemblyVersion("3.1.4.7")]
|
||||
[assembly: AssemblyFileVersion("3.1.4.7")]
|
||||
|
||||
@@ -106,7 +106,11 @@ Public Class AddFeatureWndVM
|
||||
GetMacroListDefault(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
|
||||
' ricavo lista file Macro Custom
|
||||
GetMacroListCustom(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
|
||||
MacroList_IsEnabled = If(MacroCustomList.Count > 0, True, False)
|
||||
If MacroCustomList.Count > 0 Then
|
||||
MacroList_IsEnabled = True
|
||||
Else
|
||||
MacroList_IsEnabled = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nSelPRC))
|
||||
|
||||
@@ -147,7 +147,7 @@ Public Class AddPartWndVM
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok_Command"
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
@@ -169,7 +169,7 @@ Public Class AddPartWndVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok_Command
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ Public Class AddRawPartWndVM
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok_Command"
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
@@ -167,7 +167,7 @@ Public Class AddRawPartWndVM
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok_Command
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
@@ -829,7 +829,7 @@ Public Class BTLDataWndVM
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok_Command"
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
@@ -856,9 +856,9 @@ Public Class BTLDataWndVM
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok_Command
|
||||
#End Region ' Ok
|
||||
|
||||
#Region "Cancel_Command"
|
||||
#Region "Cancel"
|
||||
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
@@ -873,7 +873,7 @@ Public Class BTLDataWndVM
|
||||
RaiseEvent m_CloseWindow(False)
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel_Command
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
@@ -1,66 +1,4 @@
|
||||
<dxb:PopupMenu x:Class="BTLPartManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
|
||||
xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal"
|
||||
xmlns:dxt="http://schemas.devexpress.com/winfx/2008/xaml/core/themekeys"
|
||||
DataContext="{StaticResource BTLPartManagerVM}"
|
||||
Background="{StaticResource Border.BTLPartManager.Background}"
|
||||
BorderBrush="{StaticResource Border.BTLPartManager.Border}"
|
||||
BorderThickness="2"
|
||||
CornerRadius="5"
|
||||
Margin="0"
|
||||
Padding="0">
|
||||
|
||||
<dxb:BarItemMenuHeader ShowContentHeader="False"
|
||||
ItemsOrientation="Horizontal"
|
||||
Margin="0"
|
||||
Padding="0">
|
||||
<dxb:BarButtonItem Command="{Binding CopyPart_Command}"
|
||||
ToolTip="{Binding CopyPart_ToolTip}"
|
||||
IsEnabled="{Binding CopyPart_IsEnabled}"
|
||||
Glyph="{StaticResource CopyPart_Image}"
|
||||
Style="{StaticResource DropDownButton_BarButtonItem}">
|
||||
<!--<Image Source="{StaticResource CopyPart_Image}"
|
||||
Style="{StaticResource BTLDataWnd_Image}"/>-->
|
||||
</dxb:BarButtonItem>
|
||||
<dxb:BarButtonItem Command="{Binding RemovePart_Command}"
|
||||
ToolTip="{Binding RemovePart_ToolTip}"
|
||||
IsEnabled="{Binding RemovePart_IsEnabled}"
|
||||
Glyph="{StaticResource Remove_Image}"
|
||||
Style="{StaticResource DropDownButton_BarButtonItem}">
|
||||
<!--<Image Source="{StaticResource Remove_Image}"
|
||||
Style="{StaticResource BTLDataWnd_Image}"/>-->
|
||||
</dxb:BarButtonItem>
|
||||
<dxb:BarButtonItem ToolTip="{Binding Simulate_ToolTip}"
|
||||
Command="{Binding Simulate_Command}"
|
||||
IsEnabled="{Binding Simulate_IsEnabled}"
|
||||
Glyph="{StaticResource Simulate_Image}"
|
||||
Style="{StaticResource DropDownButton_BarButtonItem}">
|
||||
<!--<Image Source="{StaticResource Simulate_Image}"
|
||||
Style="{StaticResource BTLDataWnd_Image}"/>-->
|
||||
</dxb:BarButtonItem>
|
||||
<dxb:BarButtonItem ToolTip="{Binding Edit_ToolTip}"
|
||||
Command="{Binding Edit_Command}"
|
||||
IsEnabled="{Binding Edit_IsEnabled}"
|
||||
Glyph="{StaticResource Edit_Image}"
|
||||
Style="{StaticResource DropDownButton_BarButtonItem}">
|
||||
<!--<Image Source="{StaticResource Edit_Image}"
|
||||
Style="{StaticResource BTLDataWnd_Image}"/>-->
|
||||
</dxb:BarButtonItem>
|
||||
<dxb:BarButtonItem Command="{Binding ResetCalc_Command}"
|
||||
ToolTip="{Binding ResetCalc_ToolTip}"
|
||||
IsEnabled="{Binding CALCPanel_IsEnabled}"
|
||||
Glyph="{StaticResource ResetCalc_Image}"
|
||||
Style="{StaticResource DropDownButton_BarButtonItem}">
|
||||
<!--<Image Source="{StaticResource ResetCalc_Image}"
|
||||
Style="{StaticResource BTLDataWnd_Image}"/>-->
|
||||
</dxb:BarButtonItem>
|
||||
</dxb:BarItemMenuHeader>
|
||||
|
||||
</dxb:PopupMenu>
|
||||
<!--<Border x:Class="BTLPartManagerV"
|
||||
<Border x:Class="BTLPartManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
DataContext="{StaticResource BTLPartManagerVM}"
|
||||
@@ -68,6 +6,7 @@
|
||||
|
||||
<StackPanel Style="{StaticResource PartManager_StackPanel}">
|
||||
<Button Command="{Binding CopyPart_Command}"
|
||||
Click="ClosePopUp_Click"
|
||||
ToolTip="{Binding CopyPart_ToolTip}"
|
||||
IsEnabled="{Binding CopyPart_IsEnabled}"
|
||||
Style="{StaticResource LP_Button}">
|
||||
@@ -75,6 +14,7 @@
|
||||
Style="{StaticResource BTLDataWnd_Image}"/>
|
||||
</Button>
|
||||
<Button Command="{Binding RemovePart_Command}"
|
||||
Click="ClosePopUp_Click"
|
||||
ToolTip="{Binding RemovePart_ToolTip}"
|
||||
IsEnabled="{Binding RemovePart_IsEnabled}"
|
||||
Style="{StaticResource LP_Button}">
|
||||
@@ -82,6 +22,7 @@
|
||||
Style="{StaticResource BTLDataWnd_Image}"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding Simulate_ToolTip}"
|
||||
Click="ClosePopUp_Click"
|
||||
Command="{Binding Simulate_Command}"
|
||||
IsEnabled="{Binding Simulate_IsEnabled}"
|
||||
Style="{StaticResource LP_Button}">
|
||||
@@ -89,6 +30,7 @@
|
||||
Style="{StaticResource BTLDataWnd_Image}"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding Edit_ToolTip}"
|
||||
Click="ClosePopUp_Click"
|
||||
Command="{Binding Edit_Command}"
|
||||
IsEnabled="{Binding Edit_IsEnabled}"
|
||||
Style="{StaticResource LP_Button}">
|
||||
@@ -96,6 +38,7 @@
|
||||
Style="{StaticResource BTLDataWnd_Image}"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ResetCalc_Command}"
|
||||
Click="ClosePopUp_Click"
|
||||
ToolTip="{Binding ResetCalc_ToolTip}"
|
||||
IsEnabled="{Binding CALCPanel_IsEnabled}"
|
||||
Style="{StaticResource LP_Button}">
|
||||
@@ -104,4 +47,4 @@
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
</Border>-->
|
||||
</Border>
|
||||
|
||||
@@ -8,6 +8,8 @@ Public Class BTLPartManagerVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private PADLOCK_IMAGE As String = "pack://application:,,,/Resources/NewPage/padlock.png"
|
||||
|
||||
Private m_BTLPartManager_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property BTLPartManager_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -176,7 +178,7 @@ Public Class BTLPartManagerVM
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "CopyPart_Command"
|
||||
#Region "CopyPart"
|
||||
|
||||
Public ReadOnly Property CopyPart_Command As ICommand
|
||||
Get
|
||||
@@ -200,9 +202,9 @@ Public Class BTLPartManagerVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' CopyPart_Command
|
||||
#End Region ' CopyPart
|
||||
|
||||
#Region "RemovePart_Command"
|
||||
#Region "RemovePart"
|
||||
|
||||
Public ReadOnly Property RemovePart_Command As ICommand
|
||||
Get
|
||||
@@ -286,9 +288,9 @@ Public Class BTLPartManagerVM
|
||||
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
|
||||
End Sub
|
||||
|
||||
#End Region ' RemovePart_Command
|
||||
#End Region ' RemovePart
|
||||
|
||||
#Region "Simulate_Command"
|
||||
#Region "SimulateCommand"
|
||||
|
||||
Public ReadOnly Property Simulate_Command As ICommand
|
||||
Get
|
||||
@@ -333,9 +335,9 @@ Public Class BTLPartManagerVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' Simulate_Command
|
||||
#End Region ' SimulateCommand
|
||||
|
||||
#Region "Edit_Command"
|
||||
#Region "Edit"
|
||||
|
||||
Public ReadOnly Property Edit_Command As ICommand
|
||||
Get
|
||||
@@ -369,9 +371,9 @@ Public Class BTLPartManagerVM
|
||||
Map.refProjectVM.SetLeftPanel_Opacity(0.2)
|
||||
End Sub
|
||||
|
||||
#End Region ' Edit_Command
|
||||
#End Region ' Edit
|
||||
|
||||
#Region "ResetCalc_Command"
|
||||
#Region "ResetCalc"
|
||||
|
||||
Public ReadOnly Property ResetCalc_Command As ICommand
|
||||
Get
|
||||
@@ -393,7 +395,7 @@ Public Class BTLPartManagerVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ResetCalc_Command
|
||||
#End Region ' ResetCalc
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
@@ -293,12 +293,6 @@ Public Class BTLFeatureVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sFeature_Name As String
|
||||
Get
|
||||
Return $"[{nSelGRP}-{nPRC:000}] {sName}"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Edit_ToolTip As String
|
||||
@@ -487,7 +481,7 @@ Public Class BTLFeatureVM
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DeleteFeature_Command"
|
||||
#Region "DeleteFeature"
|
||||
|
||||
Public ReadOnly Property DeleteFeature_Command As ICommand
|
||||
Get
|
||||
@@ -502,9 +496,9 @@ Public Class BTLFeatureVM
|
||||
Map.refFeatureListManagerVM.RemoveFeature()
|
||||
End Sub
|
||||
|
||||
#End Region ' DeleteFeature_Command
|
||||
#End Region ' DeleteFeature
|
||||
|
||||
#Region "Edit_Command"
|
||||
#Region "Edit"
|
||||
|
||||
Public ReadOnly Property Edit_Command As ICommand
|
||||
Get
|
||||
@@ -520,9 +514,9 @@ Public Class BTLFeatureVM
|
||||
Map.refFreeContourManagerVM.Open()
|
||||
End Sub
|
||||
|
||||
#End Region ' Edit_Command
|
||||
#End Region ' Edit
|
||||
|
||||
#Region "Save_Command"
|
||||
#Region "Save"
|
||||
|
||||
Public ReadOnly Property Save_Command As ICommand
|
||||
Get
|
||||
@@ -543,9 +537,9 @@ Public Class BTLFeatureVM
|
||||
Map.refFreeContourManagerVM.Close(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' Save_Command
|
||||
#End Region ' Save
|
||||
|
||||
#Region "Cancel_Command"
|
||||
#Region "Cancel"
|
||||
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
@@ -561,9 +555,9 @@ Public Class BTLFeatureVM
|
||||
Map.refFreeContourManagerVM.Close(False)
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel_Command
|
||||
#End Region ' Cancel
|
||||
|
||||
#Region "Strategy_Command"
|
||||
#Region "Strategy"
|
||||
|
||||
Public ReadOnly Property Strategy_Command As ICommand
|
||||
Get
|
||||
@@ -582,9 +576,9 @@ Public Class BTLFeatureVM
|
||||
Map.refForcedStrategyPanelVM.Init(BTLFeatureM)
|
||||
End Sub
|
||||
|
||||
#End Region ' Strategy_Command
|
||||
#End Region ' Strategy
|
||||
|
||||
#Region "EditFeature_Command"
|
||||
#Region "EditFeature"
|
||||
|
||||
Public ReadOnly Property EditFeature_Command As ICommand
|
||||
Get
|
||||
@@ -613,7 +607,7 @@ Public Class BTLFeatureVM
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' EditFeature_Command
|
||||
#End Region ' EditFeature
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ Public Class BTLPartVM
|
||||
Return m_BTLPartM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_BTLStructureM As BTLStructureM
|
||||
|
||||
Public ReadOnly Property nPartId As Integer
|
||||
@@ -1370,13 +1369,13 @@ Public Class BTLPartVM
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_BTLPartM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Hidden)
|
||||
Return If(m_BTLPartM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_FALL_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_BTLPartM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Hidden)
|
||||
Return If(m_BTLPartM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -2212,26 +2211,11 @@ Public Class BTLPartVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Sub BackRotation(Optional bUpdateSection As Boolean = False, Optional bRedraw As Boolean = True)
|
||||
' salvo sezione impostata
|
||||
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
|
||||
' ruoto
|
||||
Rotation(False, Map.refProjectVM.BTLStructureVM.nPROJTYPE, bRedraw)
|
||||
' imposto lock
|
||||
bLockRotation = True
|
||||
' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi)
|
||||
If bUpdateSection AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM AndAlso CurrSection <> SectionXMaterial.Empty Then
|
||||
' se esiste, imposto sezione inversa
|
||||
Dim InverseSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SectionList.FirstOrDefault(Function(x) x.dH = CurrSection.dW AndAlso x.dW = CurrSection.dH AndAlso x.sMaterial(0) = CurrSection.sMaterial(0))
|
||||
If Not IsNothing(InverseSection) Then Map.refProjectVM.BTLStructureVM.SetSelSection(InverseSection)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Invert_Command"
|
||||
#Region "Invert"
|
||||
|
||||
Public ReadOnly Property Invert_Command As ICommand
|
||||
Get
|
||||
@@ -2253,9 +2237,41 @@ Public Class BTLPartVM
|
||||
NotifyPropertyChanged(NameOf(sINVERTED))
|
||||
End Sub
|
||||
|
||||
#End Region ' Invert_Command
|
||||
#End Region ' Invert
|
||||
|
||||
#Region "ForwardRotation_Command"
|
||||
#Region "BackRotation"
|
||||
|
||||
Public ReadOnly Property BackRotation_Command As ICommand
|
||||
Get
|
||||
If m_cmdBackRotation Is Nothing Then
|
||||
m_cmdBackRotation = New Command(AddressOf BackRotationCmd)
|
||||
End If
|
||||
Return m_cmdBackRotation
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub BackRotationCmd()
|
||||
BackRotation(True)
|
||||
End Sub
|
||||
|
||||
Public Sub BackRotation(Optional bUpdateSection As Boolean = False, Optional bRedraw As Boolean = True)
|
||||
' salvo sezione impostata
|
||||
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
|
||||
' ruoto
|
||||
Rotation(False, Map.refProjectVM.BTLStructureVM.nPROJTYPE, bRedraw)
|
||||
' imposto lock
|
||||
bLockRotation = True
|
||||
' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi)
|
||||
If bUpdateSection AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM AndAlso CurrSection <> SectionXMaterial.Empty Then
|
||||
' se esiste, imposto sezione inversa
|
||||
Dim InverseSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SectionList.FirstOrDefault(Function(x) x.dH = CurrSection.dW AndAlso x.dW = CurrSection.dH AndAlso x.sMaterial(0) = CurrSection.sMaterial(0))
|
||||
If Not IsNothing(InverseSection) Then Map.refProjectVM.BTLStructureVM.SetSelSection(InverseSection)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' BackRotation
|
||||
|
||||
#Region "ForwardRotation"
|
||||
|
||||
Public ReadOnly Property ForwardRotation_Command As ICommand
|
||||
Get
|
||||
@@ -2284,7 +2300,7 @@ Public Class BTLPartVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ForwardRotation_Command
|
||||
#End Region ' ForwardRotation
|
||||
|
||||
' Comando inutilizzato ma conservato per eventuale rotazione a causa di importazione con rotazione sbagliata
|
||||
#Region "XRotation"
|
||||
@@ -2327,7 +2343,7 @@ Public Class BTLPartVM
|
||||
|
||||
#End Region ' XRotation
|
||||
|
||||
#Region "PartColour_Command"
|
||||
#Region "PartColour"
|
||||
|
||||
Public ReadOnly Property PartColour_Command As ICommand
|
||||
Get
|
||||
@@ -2359,9 +2375,9 @@ Public Class BTLPartVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' PartColour_Command
|
||||
#End Region ' PartColour
|
||||
|
||||
#Region "Verify_Command"
|
||||
#Region "Verify"
|
||||
|
||||
Public ReadOnly Property Verify_Command As ICommand
|
||||
Get
|
||||
@@ -2379,9 +2395,9 @@ Public Class BTLPartVM
|
||||
Return
|
||||
End Sub
|
||||
|
||||
#End Region ' Verify_Command
|
||||
#End Region ' Verify
|
||||
|
||||
#Region "AddToRawPart_Command"
|
||||
#Region "AddToRawPart"
|
||||
|
||||
Public ReadOnly Property AddToRawPart_Command As ICommand
|
||||
Get
|
||||
@@ -2676,9 +2692,9 @@ Public Class BTLPartVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' AddToRawPart_Command
|
||||
#End Region ' AddToRawPart
|
||||
|
||||
#Region "SelectAllFeature_Command"
|
||||
#Region "SelectAllFeature"
|
||||
|
||||
Public ReadOnly Property SelectAllFeature_Command As ICommand
|
||||
Get
|
||||
@@ -2694,9 +2710,9 @@ Public Class BTLPartVM
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
End Sub
|
||||
|
||||
#End Region ' SelectAllFeature_Command
|
||||
#End Region ' SelectAllFeature
|
||||
|
||||
#Region "DeselectAllFeature_Command"
|
||||
#Region "DeselectAllFeature"
|
||||
|
||||
Public ReadOnly Property DeselectAllFeature_Command As ICommand
|
||||
Get
|
||||
@@ -2712,9 +2728,9 @@ Public Class BTLPartVM
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
End Sub
|
||||
|
||||
#End Region ' DeselectAllFeature_Command
|
||||
#End Region ' DeselectAllFeature
|
||||
|
||||
#Region "SelectItemFeature_Command"
|
||||
#Region "SelectItemFeature"
|
||||
|
||||
Public ReadOnly Property SelectItemFeature_Command As ICommand
|
||||
Get
|
||||
@@ -2736,9 +2752,9 @@ Public Class BTLPartVM
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' SelectItemFeature_Command
|
||||
#End Region ' SelectItemFeature
|
||||
|
||||
#Region "DeselectItemFeature_Command"
|
||||
#Region "DeselectItemFeature"
|
||||
|
||||
Public ReadOnly Property DeselectItemFeature_Command As ICommand
|
||||
Get
|
||||
@@ -2760,7 +2776,7 @@ Public Class BTLPartVM
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' DeselectItemFeature_Command
|
||||
#End Region ' DeselectItemFeature
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
@@ -1243,7 +1243,7 @@ Public Class BTLStructureVM
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DeletePart_Command"
|
||||
#Region "DeletePart"
|
||||
|
||||
Public ReadOnly Property DeletePart_Command As ICommand
|
||||
Get
|
||||
@@ -1258,9 +1258,9 @@ Public Class BTLStructureVM
|
||||
Map.refBTLPartManagerVM.RemovePartCmd()
|
||||
End Sub
|
||||
|
||||
#End Region ' DeletePart_Command
|
||||
#End Region ' DeletePart
|
||||
|
||||
#Region "Data_Command"
|
||||
#Region "Data"
|
||||
|
||||
Public ReadOnly Property Data_Command As ICommand
|
||||
Get
|
||||
@@ -1276,9 +1276,9 @@ Public Class BTLStructureVM
|
||||
BTLDataWnd.ShowDialog()
|
||||
End Sub
|
||||
|
||||
#End Region ' Data_Command
|
||||
#End Region ' Data
|
||||
|
||||
#Region "AddPart_Command"
|
||||
#Region "AddPart"
|
||||
|
||||
Public ReadOnly Property AddPart_Command As ICommand
|
||||
Get
|
||||
@@ -1330,9 +1330,9 @@ Public Class BTLStructureVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' AddPart_Command
|
||||
#End Region ' AddPart
|
||||
|
||||
#Region "UpdateBTL_Command"
|
||||
#Region "UpdateBTL"
|
||||
|
||||
Public ReadOnly Property UpdateBTL_Command As ICommand
|
||||
Get
|
||||
@@ -1872,7 +1872,7 @@ Public Class BTLStructureVM
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
#End Region ' UpdateBTL_Command
|
||||
#End Region ' UpdateBTL
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ Public Class BlockedWndVM
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Save_Command"
|
||||
#Region "Save"
|
||||
|
||||
Public ReadOnly Property Save_Command As ICommand
|
||||
Get
|
||||
@@ -130,9 +130,9 @@ Public Class BlockedWndVM
|
||||
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' Save_Command
|
||||
#End Region ' Save
|
||||
|
||||
#Region "DoNotSave_Command"
|
||||
#Region "DoNotSave"
|
||||
|
||||
Public ReadOnly Property DoNotSave_Command As ICommand
|
||||
Get
|
||||
@@ -148,7 +148,7 @@ Public Class BlockedWndVM
|
||||
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' DoNotSave_Command
|
||||
#End Region ' DoNotSave
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
@@ -996,9 +996,6 @@
|
||||
<PackageReference Include="BouncyCastle">
|
||||
<Version>1.8.5</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="DevExpress.Wpf">
|
||||
<Version>25.2.5</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="EgwMultiEngineManager.Core">
|
||||
<Version>3.1.1.2</Version>
|
||||
</PackageReference>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtBEAMWALL.Core.ConstIni
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
@@ -76,35 +77,19 @@ Module MyExecProcessManager
|
||||
EgtOutLog("Risultato progetto " & nBarId)
|
||||
CALCPanelVM.ProcessResults(sBarPath, nProgramPage, nBarId)
|
||||
If Answer.Args.Count > 4 Then
|
||||
Dim PartItem As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nBarId)
|
||||
Dim nPreInvert As Integer = -1
|
||||
Dim bPreInvert As Boolean = False
|
||||
If Answer.Args.ContainsKey("PREINVERT") Then
|
||||
Integer.TryParse(Answer.Args("PREINVERT"), nPreInvert)
|
||||
End If
|
||||
Integer.TryParse(Answer.Args("PREINVERT"), nPreInvert)
|
||||
If nPreInvert = 1 Then bPreInvert = True
|
||||
Dim nPreRotate As Integer = -1
|
||||
If Answer.Args.ContainsKey("PREROTATE90") Then
|
||||
Integer.TryParse(Answer.Args("PREROTATE90"), nPreRotate)
|
||||
End If
|
||||
Integer.TryParse(Answer.Args("PREROTATE90"), nPreRotate)
|
||||
Dim dAng As Integer = nPreRotate * 90
|
||||
Dim BTLPartItem As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nBarId)
|
||||
If nPreInvert > 0 Then
|
||||
If nPreInvert = 1 Then bPreInvert = True
|
||||
If PartItem.IsInverted Then bPreInvert = False
|
||||
PartItem.SetInverted(bPreInvert)
|
||||
If BTLPartItem.IsInverted Then bPreInvert = False
|
||||
BTLPartItem.SetInverted(bPreInvert)
|
||||
End If
|
||||
If nPreRotate > 0 Then
|
||||
Dim dAng As Integer = nPreRotate * 90
|
||||
PartItem.ForwardRotation(True, True, dAng, False)
|
||||
End If
|
||||
|
||||
Dim prefix As String = "INFONGEPART_"
|
||||
|
||||
Dim sInfoNgePartList As List(Of String) = Answer.Args.Where(Function(k) k.Key.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)).Select(Function(k) k.Value).ToList()
|
||||
|
||||
For Each InfoNgePartItem As String In sInfoNgePartList
|
||||
Dim sKeyVal() As String = InfoNgePartItem.Trim().Split("="c)
|
||||
EgtSetInfo(PartItem.nPartId, sKeyVal(0), sKeyVal(1))
|
||||
Next
|
||||
|
||||
If nPreRotate > 0 Then BTLPartItem.ForwardRotation(True, True, dAng, False)
|
||||
End If
|
||||
' Gestione progressbar per verificare l'inizio e la fine della verifica
|
||||
Dim BeamManager As ExecProcessManager = m_ExecProcessManagerList(EXECENVIRONMENTS.BEAM)
|
||||
|
||||
@@ -145,6 +145,21 @@ Public Class ForcedStrategyPanelVM
|
||||
m_StrategyList = New ObservableCollection(Of Strategy)((From JsonAvailableStrategy In JsonAvailableTopology.StrategyList
|
||||
Select JsonAvailableStrategy.Deserialize(ProjectManagerVM.CurrProd.nType, -1)).ToList())
|
||||
End If
|
||||
If File.Exists(sAvailableStrategiesFilePath) Then
|
||||
sReadedFile = File.ReadAllText(sAvailableStrategiesFilePath)
|
||||
Dim JsonStrategyFeatureList As List(Of JsonAvailableStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonAvailableStrategyFeature))(sReadedFile)
|
||||
Dim JsonAvailableStrategyFeature As JsonAvailableStrategyFeature = JsonStrategyFeatureList.FirstOrDefault(Function(x) x.nGrp = nGRP AndAlso x.nPrc = nPRC)
|
||||
If IsNothing(JsonAvailableStrategyFeature) Then Return False
|
||||
Dim JsonAvailableTopology As JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
|
||||
If IsNothing(JsonAvailableTopology) Then
|
||||
' ricavo topologia da feature
|
||||
FindTopologyFromFeature(nFeatureId, sTopologyName)
|
||||
JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
|
||||
End If
|
||||
If IsNothing(JsonAvailableTopology) Then Return False
|
||||
m_StrategyList = New ObservableCollection(Of Strategy)((From JsonAvailableStrategy In JsonAvailableTopology.StrategyList
|
||||
Select JsonAvailableStrategy.Deserialize(ProjectManagerVM.CurrProd.nType, -1)).ToList())
|
||||
End If
|
||||
' recupero custom
|
||||
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nFeatureId))
|
||||
Dim nPartProjId As Integer = 0
|
||||
|
||||
@@ -465,7 +465,6 @@ Public MustInherit Class ProjectParameters
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
End Class
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
Style="{StaticResource ProjectParameters_UniformGrid}">
|
||||
<TextBlock Text="{Binding sDescriptionShort}"
|
||||
Style="{StaticResource ProjectParameters_TextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding ComboList}"
|
||||
SelectedItem="{Binding SelValue}"
|
||||
<ComboBox ItemsSource="{Binding ComboList, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding SelValue, UpdateSourceTrigger=PropertyChanged}"
|
||||
DisplayMemberPath="sValue"
|
||||
Style="{StaticResource ProjectParameters_ComboBox}">
|
||||
</ComboBox>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,4 @@
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports DevExpress.Data
|
||||
Imports DevExpress.Xpf.Bars
|
||||
Imports DevExpress.Xpf.Core.Serialization
|
||||
Imports DevExpress.Xpf.Grid
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports System.Reflection
|
||||
|
||||
Public Class BTLPartListV
|
||||
|
||||
@@ -14,127 +8,14 @@ Public Class BTLPartListV
|
||||
Private m_isDraggingSelectionField As FieldInfo
|
||||
Private m_endDraggingMethod As MethodInfo
|
||||
|
||||
Private m_sDataGridLayoutPath As String = ""
|
||||
|
||||
Sub New()
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
' Add any initialization after the InitializeComponent() call.
|
||||
' Evita il drag sulla selezione multipla
|
||||
'm_isDraggingSelectionField = m_DataGridType.GetField("_isDraggingSelection", BindingFlags.Instance Or BindingFlags.NonPublic)
|
||||
'm_endDraggingMethod = m_DataGridType.GetMethod("EndDragging", BindingFlags.Instance Or BindingFlags.NonPublic)
|
||||
|
||||
m_sDataGridLayoutPath = Path.GetDirectoryName(DataGridColumnsIniFile.m_sDataGridColumnsIniFile) & "\NewDataGridLayoutFile.json"
|
||||
|
||||
For Each Column In BTLPart_GridControl.Columns
|
||||
Column.[AddHandler](DXSerializer.AllowPropertyEvent,
|
||||
New AllowPropertyEventHandler(AddressOf OnAllowProperty))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' imposto parametri aggiuntivi da scrivere in Json colonne tabella
|
||||
Private Sub OnAllowProperty(ByVal sender As Object, ByVal e As AllowPropertyEventArgs)
|
||||
If e.DependencyProperty Is GridColumn.AllowResizingProperty Then
|
||||
e.Allow = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' salvataggio del layout colonne
|
||||
Public Sub SaveBTLPartGridControlLayout()
|
||||
BTLPart_GridControl.SaveLayoutToJson(m_sDataGridLayoutPath)
|
||||
End Sub
|
||||
|
||||
Public Sub IsVisibleGroupSummary(bValue As Boolean)
|
||||
If bValue AndAlso BTLPart_GridControl.GroupSummary.Count = 0 Then
|
||||
BTLPart_GridControl.GroupSummary.Clear()
|
||||
Dim PDNGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nPDN",
|
||||
.DisplayFormat = "{0}",
|
||||
.SummaryType = SummaryItemType.Count,
|
||||
.ShowInGroupColumnFooter = "nPDN"}
|
||||
BTLPart_GridControl.GroupSummary.Add(PDNGroupSummaryItem)
|
||||
Dim CNTGroupSummaryItem As New GridSummaryItem() With {.FieldName = "sCNT",
|
||||
.DisplayFormat = "{0}",
|
||||
.SummaryType = SummaryItemType.Sum,
|
||||
.ShowInGroupColumnFooter = "sCNT"}
|
||||
BTLPart_GridControl.GroupSummary.Add(CNTGroupSummaryItem)
|
||||
Dim ADDEDGroupSummaryItem As New GridSummaryItem() With {.FieldName = "sADDED",
|
||||
.DisplayFormat = "{0}",
|
||||
.SummaryType = SummaryItemType.Sum,
|
||||
.ShowInGroupColumnFooter = "sADDED"}
|
||||
BTLPart_GridControl.GroupSummary.Add(ADDEDGroupSummaryItem)
|
||||
Dim INPRODGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nINPROD",
|
||||
.DisplayFormat = "{0}",
|
||||
.SummaryType = SummaryItemType.Sum,
|
||||
.ShowInGroupColumnFooter = "nINPROD"}
|
||||
BTLPart_GridControl.GroupSummary.Add(INPRODGroupSummaryItem)
|
||||
Dim DONEGroupSummaryItem As New GridSummaryItem() With {.FieldName = "nDONE",
|
||||
.DisplayFormat = "{0}",
|
||||
.SummaryType = SummaryItemType.Sum,
|
||||
.ShowInGroupColumnFooter = "nDONE"}
|
||||
BTLPart_GridControl.GroupSummary.Add(DONEGroupSummaryItem)
|
||||
End If
|
||||
BTLPart_TableView.ShowGroupFooters = bValue
|
||||
End Sub
|
||||
|
||||
Public Sub Me_Loaded() Handles Me.Loaded
|
||||
' imposto DataContext
|
||||
m_BTLPartListVM = DataContext
|
||||
' imposto riferimento ad action per salvataggio layout tabella
|
||||
m_BTLPartListVM.refSaveBTLPartGridControlLayout = AddressOf SaveBTLPartGridControlLayout
|
||||
' rispristino layout tabella
|
||||
If Not IsNothing(m_sDataGridLayoutPath) AndAlso File.Exists(m_sDataGridLayoutPath) Then
|
||||
BTLPart_GridControl.RestoreLayoutFromJson(m_sDataGridLayoutPath)
|
||||
End If
|
||||
' da gestire chiamandolo quando viene aperto un progetto o aggiunto/rimosso un btl, per evitare che ci sia il GroupSummary se c'e' un solo gruppo
|
||||
IsVisibleGroupSummary(False)
|
||||
End Sub
|
||||
|
||||
' customizzazione ContextMenu del GridControl
|
||||
Private Sub OnShowGridMenu(sender As Object, e As DevExpress.Xpf.Grid.GridMenuEventArgs)
|
||||
If e.MenuType = GridMenuType.Column Then
|
||||
' rimozione bottoni
|
||||
e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupBox})
|
||||
e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupColumn})
|
||||
e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.ColumnChooser})
|
||||
e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFit})
|
||||
e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFitColumns})
|
||||
e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.FilterEditor})
|
||||
|
||||
Dim info As GridColumnMenuInfo = CType(e.MenuInfo, GridColumnMenuInfo)
|
||||
Dim item As ColumnBase = CType(info.Column, ColumnBase)
|
||||
' aggiunta separatore
|
||||
Dim separator As BarItemLinkSeparator = New BarItemLinkSeparator()
|
||||
e.Customizations.Add(separator)
|
||||
' aggiunta bottone AllowResize e Auto Fit
|
||||
Dim AllowResize As BarCheckItem = New BarCheckItem() With {.Content = "Allow Resize", .IsChecked = (BTLPart_TableView.AllowResizing AndAlso (item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default))}
|
||||
AddHandler AllowResize.CheckedChanged, AddressOf AllowResize_CheckedChanged
|
||||
e.Customizations.Add(AllowResize)
|
||||
If item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default Then
|
||||
Dim FixAuto As BarButtonItem = New BarCheckItem() With {.Content = "Auto Fit"}
|
||||
AddHandler FixAuto.ItemClick, AddressOf FixAuto_ItemClick
|
||||
e.Customizations.Add(FixAuto)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' gestore evento Allow Resize
|
||||
Private Sub AllowResize_CheckedChanged(sender As Object, e As ItemClickEventArgs)
|
||||
Dim info As GridColumnMenuInfo = TryCast(BTLPart_TableView.GridMenu.MenuInfo, GridColumnMenuInfo)
|
||||
Dim item As ColumnBase = CType(info.Column, ColumnBase)
|
||||
If item.AllowResizing = DevExpress.Utils.DefaultBoolean.False Then
|
||||
item.AllowResizing = DevExpress.Utils.DefaultBoolean.True
|
||||
Else
|
||||
item.AllowResizing = DevExpress.Utils.DefaultBoolean.False
|
||||
End If
|
||||
End Sub
|
||||
' gestore evento Auto Fit
|
||||
Private Sub FixAuto_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||
Dim info As GridColumnMenuInfo = TryCast(BTLPart_TableView.GridMenu.MenuInfo, GridColumnMenuInfo)
|
||||
Dim item As ColumnBase = CType(info.Column, ColumnBase)
|
||||
item.Width = New GridColumnWidth(1, GridColumnUnitType.Auto)
|
||||
BTLPart_TableView.UpdateLayout()
|
||||
item.Width = item.ActualWidth
|
||||
item.AllowResizing = DevExpress.Utils.DefaultBoolean.False
|
||||
' Evita il drag sulla selezione multipla
|
||||
m_isDraggingSelectionField = m_DataGridType.GetField("_isDraggingSelection", BindingFlags.Instance Or BindingFlags.NonPublic)
|
||||
m_endDraggingMethod = m_DataGridType.GetMethod("EndDragging", BindingFlags.Instance Or BindingFlags.NonPublic)
|
||||
End Sub
|
||||
|
||||
Public Sub DataGrid_PreviewMouseMove(sender As Object, e As MouseEventArgs)
|
||||
@@ -234,5 +115,4 @@ Public Class SettingsBtnVerticalOffsetMultiConverter
|
||||
Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -9,8 +9,6 @@ Public Class BTLPartListVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend refSaveBTLPartGridControlLayout As Action
|
||||
|
||||
Private m_colPart_Do As EgwWPFBaseLib.ColumnLayout
|
||||
Public ReadOnly Property colPart_Do As EgwWPFBaseLib.ColumnLayout
|
||||
Get
|
||||
@@ -209,12 +207,6 @@ Public Class BTLPartListVM
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
Friend Sub Close()
|
||||
If Not IsNothing(refSaveBTLPartGridControlLayout) Then
|
||||
refSaveBTLPartGridControlLayout()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Class DataGridCellBorderThicknessConverter
|
||||
@@ -248,7 +240,7 @@ Class ProjIdToBtlFileName
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
|
||||
If TypeOf value IsNot String Then Return ""
|
||||
If TypeOf value IsNot Integer Then Return ""
|
||||
Dim nProjId As Integer = CInt(value)
|
||||
Dim ProjModel As EgtBEAMWALL.DataLayer.DatabaseModels.ProjModel = DbControllers.m_ProjController.FindByProjId(nProjId)
|
||||
If IsNothing(ProjModel) Then Return ""
|
||||
|
||||
@@ -980,6 +980,7 @@ Public Class MyMachGroupVM
|
||||
.bBarOk = True,
|
||||
.nMachineName = MachineName,
|
||||
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
|
||||
.nBarState = SelMachGroup.nProduction_State,
|
||||
.nGlobState = SelMachGroup.nGlobalState}
|
||||
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
||||
|
||||
@@ -88,7 +88,9 @@
|
||||
</TabControl.ItemContainerStyle>
|
||||
<TabItem Header="EMPTY"/>
|
||||
<TabItem Header="STRATEGIES">
|
||||
<OPTIMIZER:StrategyManagerV DataContext="{StaticResource StrategyManagerVM}" Margin="0,0,0,-25"/>
|
||||
<StackPanel>
|
||||
<OPTIMIZER:StrategyManagerV DataContext="{StaticResource StrategyManagerVM}"/>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="PARAMETERS">
|
||||
<StackPanel Style="{StaticResource PartManager_StackPanel}">
|
||||
|
||||
@@ -637,7 +637,7 @@ Public Class MainMenuVM
|
||||
Dim bEx As Boolean = False
|
||||
Try
|
||||
Dim sAddressArray As String() = sSupportAddress.Split(CType(",", Char()))
|
||||
Dim SendFeedbackWindow As New EgtWPFLib5.MapiMailMessage("AEdifica Feedback - " & sKey)
|
||||
Dim SendFeedbackWindow As New EgtWPFLib5.MapiMailMessage("Aedifica 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)
|
||||
|
||||
@@ -427,8 +427,6 @@ Public Class MainWindowVM
|
||||
{S_FEATUREINPARTINRAWPARTLIST, Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns},
|
||||
{S_PARAMETERLIST_P, Map.refPParameterListVM.PParameterListColumns}}
|
||||
EgwWPFBaseLib.EgwDataGrid.WriteColumnLayout(DataGridColumnsIniFile.m_sDataGridColumnsIniFile, DataGridColumnDictionary)
|
||||
Map.refPartListVM.Close()
|
||||
|
||||
End If
|
||||
' Termino il Model
|
||||
m_MainWindowM.Close()
|
||||
|
||||
@@ -67,5 +67,5 @@ Imports System.Windows
|
||||
' Revision
|
||||
'
|
||||
|
||||
<Assembly: AssemblyVersion("3.1.5.1")>
|
||||
<Assembly: AssemblyFileVersion("3.1.5.1")>
|
||||
<Assembly: AssemblyVersion("3.1.4.7")>
|
||||
<Assembly: AssemblyFileVersion("3.1.4.7")>
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
Style="{StaticResource Bottom_WrapPanel}">
|
||||
<OPTIMIZER:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
|
||||
<OPTIMIZER:ShowPanelV DataContext="{StaticResource ShowPanelVM}"/>
|
||||
<OPTIMIZER:ShowBeamPanelV DataContext="{StaticResource ShowBeamPanelVM}"/>
|
||||
<OPTIMIZER:ShowBeamPanelV DataContext="{StaticResource ShowBeamPanelVM}"
|
||||
Visibility="{Binding DataContext.ShowBeamPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:LeftPanelBottomV}}}"/>
|
||||
<OPTIMIZER:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
|
||||
</WrapPanel>
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<OPTIMIZER:LeftPanelV DataContext="{StaticResource LeftPanelVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:LeftPanelTopV}}}"
|
||||
Visibility="{Binding DataContext.LeftPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:LeftPanelTopV}}}"
|
||||
IsEnabled="{Binding DataContext.LeftPanel_IsEnabled, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:LeftPanelTopV}}}"
|
||||
Opacity="{Binding DataContext.LeftPanel_Opacity, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:LeftPanelTopV}}}"/>
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Style="{StaticResource TopPanel_Border}">
|
||||
<OPTIMIZER:ProdManagerV DataContext="{DynamicResource ProdManagerVM}"/>
|
||||
<OPTIMIZER:ProdManagerV DataContext="{DynamicResource ProdManagerVM}"
|
||||
Visibility="{Binding DataContext.ProdManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:TopPanelV}}}"/>
|
||||
</Border>
|
||||
|
||||
<OPTIMIZER:CalcPanelV Grid.Column="1"
|
||||
|
||||
@@ -4,6 +4,7 @@ Imports System.IO.Compression
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
Imports EgtBEAMWALL.Optimizer.MainMenuVM
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports Newtonsoft.Json
|
||||
@@ -992,15 +993,6 @@ Public Class ProdManagerVM
|
||||
|
||||
' Apro finestra parametri generali
|
||||
Dim GeneralParametersWndVM As New GeneralParametersWndVM(nType)
|
||||
|
||||
' Controllo se la cartella AiSetUp è presente
|
||||
GetFirstAiSetUp(nType)
|
||||
|
||||
Dim sDefaultConfigFile As String = String.Empty
|
||||
If EgtUILib.GetPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sDefaultConfigFile, Map.refMainWindowVM.MainWindowM.sDefaultConfig) = 0 Then
|
||||
SetFirstStrategy(GeneralParametersWndVM, sDefaultConfigFile)
|
||||
End If
|
||||
|
||||
GeneralParametersWndVM.SetbSaveGeneralParameters(True)
|
||||
GeneralParametersWndVM.SaveProjectParameters()
|
||||
|
||||
|
||||
@@ -60,6 +60,32 @@ Public Class ProjectVM
|
||||
End Property
|
||||
Private m_bLockUX As Boolean = False
|
||||
|
||||
Private m_FeatureManager_Visibility As Boolean = True
|
||||
Public Property FeatureManager_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_FeatureManager_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_FeatureManager_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetFeatureManager_Visibility(IsVisible As Boolean)
|
||||
m_FeatureManager_Visibility = IsVisible
|
||||
End Sub
|
||||
|
||||
Private m_ShowBeamPanel_Visibility As Boolean = True
|
||||
Public Property ShowBeamPanel_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_ShowBeamPanel_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_ShowBeamPanel_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetShowBeamPanel_Visibility(IsVisible As Boolean)
|
||||
m_ShowBeamPanel_Visibility = IsVisible
|
||||
End Sub
|
||||
|
||||
Private m_FreeContourManager_Visibility As Boolean = False
|
||||
Public Property FreeContourManager_Visibility As Visibility
|
||||
Get
|
||||
@@ -74,6 +100,32 @@ Public Class ProjectVM
|
||||
NotifyPropertyChanged(NameOf(FreeContourManager_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_ProdManager_Visibility As Boolean = True
|
||||
Public Property ProdManager_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_ProdManager_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_ProdManager_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetProdManager_Visibility(IsVisible As Boolean)
|
||||
m_ProdManager_Visibility = IsVisible
|
||||
End Sub
|
||||
|
||||
Private m_LeftPanel_Visibility As Boolean = True
|
||||
Public Property LeftPanel_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_LeftPanel_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_LeftPanel_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetLeftPanel_Visibility(IsVisible As Boolean)
|
||||
m_LeftPanel_Visibility = IsVisible
|
||||
End Sub
|
||||
|
||||
Private m_LeftPanel_IsEnabled As Boolean = True
|
||||
Public Property LeftPanel_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -202,7 +254,7 @@ Public Class ProjectVM
|
||||
Return m_FeatureList_Visibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetFeatureListVisibility(bVisible As Boolean)
|
||||
Sub SetFeatureListVisibility(bVisible As Boolean)
|
||||
m_FeatureList_Visibility = If(bVisible, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(FeatureList_Visibility))
|
||||
End Sub
|
||||
@@ -213,7 +265,7 @@ Public Class ProjectVM
|
||||
Return m_RawPartManagerVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetRawPartManagerVisibility(bVisible As Boolean)
|
||||
Sub SetRawPartManagerVisibility(bVisible As Boolean)
|
||||
m_RawPartManagerVisibility = If(bVisible, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(RawPartManagerVisibility))
|
||||
End Sub
|
||||
@@ -224,7 +276,7 @@ Public Class ProjectVM
|
||||
Return m_StrategyManagerVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetStrategyManagerVisibility(bVisible As Boolean)
|
||||
Sub SetStrategyManagerVisibility(bVisible As Boolean)
|
||||
m_StrategyManagerVisibility = If(bVisible, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(StrategyManagerVisibility))
|
||||
End Sub
|
||||
@@ -235,7 +287,7 @@ Public Class ProjectVM
|
||||
Return m_SceneShowBuldingVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSceneShowBuldingVisibility(bVisible As Boolean)
|
||||
Sub SetSceneShowBuldingVisibility(bVisible As Boolean)
|
||||
m_SceneShowBuldingVisibility = If(bVisible, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(SceneShowBuldingVisibility))
|
||||
End Sub
|
||||
@@ -246,7 +298,7 @@ Public Class ProjectVM
|
||||
Return m_ManagerTabVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetManagerTabVisibility(bVisible As Boolean)
|
||||
Sub SetManagerTabVisibility(bVisible As Boolean)
|
||||
m_ManagerTabVisibility = If(bVisible, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(ManagerTabVisibility))
|
||||
End Sub
|
||||
@@ -493,6 +545,11 @@ Public Class ProjectVM
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub NotifyAllPanelVisibility()
|
||||
NotifyPropertyChanged(NameOf(FeatureManager_Visibility))
|
||||
NotifyPropertyChanged(NameOf(ShowBeamPanel_Visibility))
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che permette di eliminare un pezzo modificato e reinserirlo nell'assemblato
|
||||
''' </summary>
|
||||
@@ -540,26 +597,31 @@ Public Class ProjectVM
|
||||
For Each GeneralParameter In m_GeneralParametersList
|
||||
Select Case GeneralParameter.GetType()
|
||||
Case GetType(BooleanGenericParameter)
|
||||
SetGeneralParameters(False)
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(DoubleGenericParameter)
|
||||
SetGeneralParameters(False)
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(ComboGenericParameter)
|
||||
SetGeneralParameters(False)
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(StringGenericParameter)
|
||||
SetGeneralParameters(False)
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(ListGenericParameter)
|
||||
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
|
||||
If Item.bIsActive Then
|
||||
sInfo &= Item.sUUID & "," & Item.sName & ";"
|
||||
SetGeneralParameters(False)
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge)
|
||||
End If
|
||||
Next
|
||||
@@ -634,7 +696,7 @@ Public Class ProjectVM
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sTmpValueInfo)
|
||||
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpValueInfo)
|
||||
Else
|
||||
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpComboValue)
|
||||
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
|
||||
SetGeneralParameters(False)
|
||||
End If
|
||||
Case GetType(StringGenericParameter)
|
||||
@@ -761,12 +823,7 @@ Public Class ProjectVM
|
||||
Dim sTmpStrategySetup As String = String.Empty
|
||||
Dim nBTLInfoLayerId As Integer = 0
|
||||
If bValuePart Then
|
||||
If m_SelStrategySetup Is String.Empty Then
|
||||
nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
EgtGetInfo(nBTLInfoLayerId, AI_SETUP, m_SelStrategySetup)
|
||||
Else
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
End If
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
Else
|
||||
nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
EgtGetInfo(nBTLInfoLayerId, AI_SETUP, sStrategyBTLSetup)
|
||||
@@ -895,12 +952,11 @@ Public Class ProjectVM
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
#Region "COMMAND"
|
||||
|
||||
#Region "Optimizer_Command"
|
||||
#Region "Ottimization"
|
||||
|
||||
Public ReadOnly Property Optimizer_Command As ICommand
|
||||
Get
|
||||
@@ -916,9 +972,9 @@ Public Class ProjectVM
|
||||
StatisticWndV.ShowDialog()
|
||||
End Sub
|
||||
|
||||
#End Region ' Optimizer_Command
|
||||
#End Region ' Ottimization
|
||||
|
||||
#Region "Parameter_Command"
|
||||
#Region "Parameter"
|
||||
|
||||
Public ReadOnly Property Parameter_Command As ICommand
|
||||
Get
|
||||
@@ -934,7 +990,7 @@ Public Class ProjectVM
|
||||
PartParametersWnd.ShowDialog()
|
||||
End Sub
|
||||
|
||||
#End Region ' Parameter_Command
|
||||
#End Region ' Parameter
|
||||
|
||||
#Region "Back_Command"
|
||||
|
||||
@@ -973,14 +1029,7 @@ Public Class ProjectVM
|
||||
|
||||
Public Sub Ok()
|
||||
NotifyPropertyChanged(NameOf(GeneralParametersList))
|
||||
If m_SelStrategySetup Is String.Empty Then
|
||||
Dim nBTLInfoLayerId As Integer = 0
|
||||
nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
EgtGetInfo(nBTLInfoLayerId, AI_SETUP, m_SelStrategySetup)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
Else
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
End If
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
Dim sInfo As String = String.Empty
|
||||
If m_bSaveGeneralParameters Then
|
||||
For Each GeneralParameter In m_GeneralParametersList
|
||||
|
||||
@@ -384,6 +384,7 @@ Module PDFHelper
|
||||
Dim paragraph As Paragraph = section.AddParagraph(EgtMsg(62590), "Heading2")
|
||||
paragraph.Format.SpaceAfter = Unit.FromMillimeter(3.0)
|
||||
|
||||
' Controllo se bPreview è true mostra il PDF di preview se no il PDF completo
|
||||
If bPreview Then
|
||||
CreateRawPartPage(section, sMachGroupList, sPDN, sW, sH, sL, sDesc, sMaterial, Nothing, bPreview)
|
||||
Else
|
||||
|
||||
@@ -12,7 +12,11 @@
|
||||
End Sub
|
||||
|
||||
Private Sub Statistic_TabControl_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
|
||||
Me.Tag = If(Statistic_TabControl.SelectedIndex = 0, Map.refProjectVM.BTLStructureVM, Map.refProjectVM)
|
||||
If Statistic_TabControl.SelectedIndex = 0 Then
|
||||
Me.Tag = Map.refProjectVM.BTLStructureVM
|
||||
Else
|
||||
Me.Tag = Map.refProjectVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_StatisticsVM.m_CloseWindow
|
||||
|
||||
@@ -1927,7 +1927,7 @@ Public Class ListStrategyParameter
|
||||
End Property
|
||||
|
||||
Friend Sub CloseToolList()
|
||||
SetAvailableToolListVisibility(False)
|
||||
SetAvailableToolListVisibility(True)
|
||||
SetOpenToolListIsEnable(True)
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
xmlns:EgtBEAMWALLCore="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2">
|
||||
|
||||
<!--#region Panel ViewModel-->
|
||||
@@ -837,14 +835,6 @@
|
||||
<Setter Property="Margin" Value="2.5,2.5,2.5,2.5"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DropDownButton_BarButtonItem" TargetType="{x:Type dxb:BarButtonItem}">
|
||||
<Setter Property="Background" Value="{StaticResource ButtonBasic.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource ButtonBasic.Static.Border}"/>
|
||||
<Setter Property="BorderThickness" Value="0.5"/>
|
||||
<Setter Property="CornerRadius" Value="3"/>
|
||||
<Setter Property="GlyphSize" Value="Medium"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MacroFeaturen_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource ProdManager_Button}">
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="Margin" Value="2.5,2.5,10,2.5"/>
|
||||
@@ -2056,10 +2046,6 @@
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TableView_StackPanel" TargetType="{x:Type StackPanel}" BasedOn="{StaticResource PartManager_StackPanel}">
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
</Style>
|
||||
|
||||
<!--#endregion PartManager-->
|
||||
|
||||
<!--#region OptStatistics-->
|
||||
@@ -2242,10 +2228,6 @@
|
||||
<Setter Property="Margin" Value="5,5,5,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TableView_Grid" TargetType="{x:Type Grid}">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<!--#endregion Grid-->
|
||||
|
||||
<!--#region GridSplitter-->
|
||||
@@ -2578,7 +2560,7 @@
|
||||
<Setter Property="Background" Value="{DynamicResource Border.BTLPartManager.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource Border.BTLPartManager.Border}"/>
|
||||
<Setter Property="CornerRadius" Value="5"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SetUp_Border" TargetType="{x:Type Border}">
|
||||
@@ -2592,10 +2574,6 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TableView_Border" TargetType="{x:Type Border}">
|
||||
<Setter Property="Background" Value="{StaticResource Grid.Static.ExpanderDown.Background}"/>
|
||||
</Style>
|
||||
|
||||
<!--#region TopPanel_Border-->
|
||||
|
||||
<Style x:Key="TopPanel_Border" TargetType="{x:Type Border}">
|
||||
@@ -2725,41 +2703,4 @@
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!--#region DevExpress-->
|
||||
|
||||
<Style x:Key="HeaderStyle" TargetType="{x:Type dxg:BaseGridHeader}">
|
||||
<Setter Property="Background" Value="{StaticResource DataGridColumnHeader.Static.Main.Background}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource DataGridColumnHeader.Static.Main.Foreground}"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
<Setter Property="FontSize" Value="15"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<!--<Setter Property="dxg:BaseGridColumnHeader.ShowFilterButtonOnHover" Value="False"/>-->
|
||||
</Style>
|
||||
|
||||
<Style x:Key="HeaderImageStyle" TargetType="{x:Type Image}">
|
||||
<Setter Property="Height" Value="20"/>
|
||||
<Setter Property="Stretch" Value="Uniform"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="RowStyle" TargetType="{x:Type dxg:RowControl}">
|
||||
<Setter Property="IsEnabled" Value="{Binding Row.IsRowEnabled}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="SelectionState" Value="Selected">
|
||||
<Setter Property="Background" Value="{StaticResource RowDataGrid.Selected.Background}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource RowDataGrid.Selected.Foreground}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource RowDataGrid.Selected.Border}"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
</Trigger>
|
||||
<Trigger Property="dxg:GridViewBase.IsFocusedRow" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource RowDataGrid.Selected.Background}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource RowDataGrid.Selected.Foreground}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource RowDataGrid.Selected.Border}"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!--#endregion DevExpress-->
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -496,7 +496,8 @@ Public Class CALCPanelVM
|
||||
.nProjType = ProjType,
|
||||
.bBarOk = True,
|
||||
.nMachineName = MachineName,
|
||||
.nCmdType = CalcIntegration.CmdTypes.SIMULATE}
|
||||
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
|
||||
.nBarState = SelMachGroup.nProduction_State}
|
||||
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
||||
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
||||
|
||||
@@ -0,0 +1,521 @@
|
||||
Imports System.Buffers.Binary
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports Sharp7
|
||||
|
||||
Public Class SIEMENSSharp7Comm
|
||||
|
||||
Private m_DBVariableList As New List(Of DBBuffer) ' Buffer list
|
||||
|
||||
Private IntBuffer() As Byte = {0, 0}
|
||||
Private BoolBuffer() As Byte = {0}
|
||||
Private DIntBuffer() As Byte = {0, 0, 0, 0}
|
||||
Private RealBuffer() As Byte = {0, 0, 0, 0}
|
||||
Private StringBuffer(65536) As Byte ' Buffer
|
||||
Private Client As New S7Client ' Client Object
|
||||
|
||||
' lista variabili in lettura
|
||||
Private Shared m_ReadingVars(100) As CommVar
|
||||
|
||||
' lista dei messaggi di errore attivi
|
||||
Private m_ActiveMessages As New List(Of SiemensReadMessages)
|
||||
|
||||
Private m_MachManaging As MachManaging
|
||||
Friend ReadOnly Property MachManaging As MachManaging
|
||||
Get
|
||||
Return m_MachManaging
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_RefreshTime As Integer = 10
|
||||
Private m_WaitingRefreshTime As Integer = 20
|
||||
Private m_RefreshCounter As Integer = 0
|
||||
Private m_IsRefreshing As Boolean = False
|
||||
|
||||
Public Sub New(MachManaging As MachManaging)
|
||||
m_MachManaging = MachManaging
|
||||
End Sub
|
||||
|
||||
Public Shared Function InitVar(Variable As CommVar) As CommVar
|
||||
Dim Index As Integer = Array.IndexOf(m_ReadingVars, Nothing)
|
||||
m_ReadingVars(Index) = Variable
|
||||
Return m_ReadingVars(Index)
|
||||
End Function
|
||||
|
||||
' Avvio la connessione Hardware-Client
|
||||
Friend Function InitConnection() As Boolean
|
||||
' Ip del PLC
|
||||
Dim sIp As String = ""
|
||||
GetPrivateProfileString(S_GENERAL, K_IP, "", sIp, CurrentMachine.sMachIniFile)
|
||||
' unità usate dal PLC (Rack e Slot)
|
||||
Dim nRack As Integer = GetPrivateProfileInt(S_GENERAL, K_RACK, 0, CurrentMachine.sMachIniFile)
|
||||
Dim nSlot As Integer = GetPrivateProfileInt(S_GENERAL, K_SLOT, 0, CurrentMachine.sMachIniFile)
|
||||
Map.refMachManaging.DebugMessage(1, "Tentativo di connessione a CN Siemens con Sharp7")
|
||||
Map.refMachManaging.DebugMessage(1, "IP: " & sIp)
|
||||
Map.refMachManaging.DebugMessage(1, "Rack: " & nRack)
|
||||
Map.refMachManaging.DebugMessage(1, "Slot: " & nSlot)
|
||||
Dim nResult As Integer = Client.ConnectTo(sIp, nRack, nSlot)
|
||||
If nResult = 0 Then
|
||||
Map.refMachManaging.DebugMessage(1, "Connessione effettuata")
|
||||
Else
|
||||
Map.refMachManaging.DebugMessage(1, "Connessione fallita con codice di errore: " & nResult)
|
||||
End If
|
||||
' se la connessione è restituisce 0
|
||||
Return nResult = 0
|
||||
End Function
|
||||
|
||||
' chiudo la connessione
|
||||
Friend Sub CloseConnection()
|
||||
Dim nResult As Integer = Client.Disconnect()
|
||||
If Map.refMachManaging.Debug > 0 Then
|
||||
If nResult = 0 Then
|
||||
EgtOutLog("Disconnessione effettuata")
|
||||
Else
|
||||
EgtOutLog("Disconnessione fallita con codice di errore: " & nResult)
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub RefreshConnection()
|
||||
If m_RefreshCounter < m_RefreshTime Then
|
||||
m_RefreshCounter += 1
|
||||
Else
|
||||
' riavvio connessione
|
||||
m_IsRefreshing = True
|
||||
CloseConnection()
|
||||
InitConnection()
|
||||
m_IsRefreshing = False
|
||||
m_RefreshCounter = 0
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function WaitingRefresh() As Boolean
|
||||
If Not m_IsRefreshing Then Return True
|
||||
Dim WaitingCounter As Integer = 0
|
||||
While m_IsRefreshing < m_WaitingRefreshTime
|
||||
If Not m_IsRefreshing Then Return True
|
||||
Threading.Thread.Sleep(100)
|
||||
End While
|
||||
EgtOutLog("Waiting reconnection timeout!")
|
||||
Return False
|
||||
End Function
|
||||
|
||||
#Region "Read Variables"
|
||||
|
||||
Public Sub RefreshAllVars()
|
||||
WaitingRefresh()
|
||||
m_DBVariableList.Clear()
|
||||
For Each Var In m_ReadingVars
|
||||
' rileggo solo variabili continue
|
||||
If Not IsNothing(Var) AndAlso Var.nReadType = CommVar.ReadTypes.CONTINUOUS Then
|
||||
Dim CompleteAddressSplit() As String = Var.sAddress.Split(":"c)
|
||||
Dim nDBAddress As Integer = 0
|
||||
Integer.TryParse(CompleteAddressSplit(0), nDBAddress)
|
||||
If nDBAddress = 0 Then Return
|
||||
Dim DBBuffer As DBBuffer = m_DBVariableList.FirstOrDefault(Function(x) x.DBAddress = nDBAddress)
|
||||
If IsNothing(DBBuffer) Then
|
||||
Dim Buffer(65536) As Byte
|
||||
Dim nAddressByte As Integer = 0
|
||||
Select Case nDBAddress
|
||||
Case 301
|
||||
nAddressByte = 8
|
||||
Case 302
|
||||
nAddressByte = 34
|
||||
End Select
|
||||
Map.refMachManaging.DebugMessage(1, "Lettura di " & nAddressByte & " byte dalla variabile " & nDBAddress)
|
||||
Dim nResult As Integer = 1234567890
|
||||
Try
|
||||
nResult = Client.DBRead(nDBAddress, 0, nAddressByte, Buffer)
|
||||
Catch ex As Exception
|
||||
nResult = 1234567890
|
||||
Map.refMachManaging.DebugMessage(1, "Lettura di " & nDBAddress & " ha generato un'eccezione")
|
||||
Map.refMachManaging.DebugMessage(1, ex.ToString())
|
||||
End Try
|
||||
If nResult = 0 Then
|
||||
Map.refMachManaging.DebugMessage(1, "Lettura di " & nDBAddress & " effettuata")
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
'For Index = 0 To Buffer.Count - 1
|
||||
' Map.refMachManaging.DebugMessage(2, Index & ": " & Buffer(Index))
|
||||
'Next
|
||||
End If
|
||||
Else
|
||||
Map.refMachManaging.DebugMessage(2, "Lettura fallita con codice di errore: " & nResult)
|
||||
End If
|
||||
If nResult = 0 Then
|
||||
DBBuffer = New DBBuffer(nDBAddress, Buffer)
|
||||
m_DBVariableList.Add(DBBuffer)
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(DBBuffer) Then
|
||||
Dim PositionAddressSplit() As String = CompleteAddressSplit(1).Split("."c)
|
||||
Dim nStartIndex As Integer = 0
|
||||
Integer.TryParse(PositionAddressSplit(0), nStartIndex)
|
||||
Select Case CompleteAddressSplit(2)
|
||||
Case 1
|
||||
Dim nBytePositionIndex As Integer = 0
|
||||
Integer.TryParse(PositionAddressSplit(1), nBytePositionIndex)
|
||||
Dim nPower As Integer = Math.Pow(2, nBytePositionIndex)
|
||||
' Dim bValue As Boolean = (TestBuffer(nStartIndex) And nPower) = nPower
|
||||
Map.refMachManaging.DebugMessage(2, "Lettura variabile " & nDBAddress & ":" & nStartIndex & "." & nBytePositionIndex)
|
||||
Var.SetValue(If((DBBuffer.DBValue(nStartIndex) And nPower) = nPower, 1, 0))
|
||||
Map.refMachManaging.DebugMessage(2, "Variabile " & nDBAddress & ":" & nStartIndex & "." & nBytePositionIndex & " (Tipo 1) = " & Var.sValue)
|
||||
Case 2
|
||||
'Dim x = BitConverter.ToInt16(TestBuffer, nStartIndex)
|
||||
Dim nValue As Int16 = BitConverter.ToInt16(DBBuffer.DBValue, nStartIndex)
|
||||
Map.refMachManaging.DebugMessage(2, "Lettura variabile " & nDBAddress & ":" & nStartIndex)
|
||||
Var.SetValue(BinaryPrimitives.ReverseEndianness(nValue))
|
||||
Map.refMachManaging.DebugMessage(2, "Variabile " & nDBAddress & ":" & nStartIndex & " (Tipo 2) = " & Var.sValue)
|
||||
Case 3
|
||||
' Dim x = BitConverter.ToInt32(TestBuffer, nStartIndex)
|
||||
Dim nValue As Integer = BitConverter.ToInt32(DBBuffer.DBValue, nStartIndex)
|
||||
Map.refMachManaging.DebugMessage(2, "Lettura variabile " & nDBAddress & ":" & nStartIndex)
|
||||
Var.SetValue(BinaryPrimitives.ReverseEndianness(nValue))
|
||||
Map.refMachManaging.DebugMessage(2, "Variabile " & nDBAddress & ":" & nStartIndex & " (Tipo 3) = " & Var.sValue)
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Function WriteVariable(Address As String, Value As String) As Boolean
|
||||
WaitingRefresh()
|
||||
Dim CompleteAddressSplit() As String = Address.Split(":"c)
|
||||
Dim nDBAddress As Integer = 0
|
||||
Integer.TryParse(CompleteAddressSplit(0), nDBAddress)
|
||||
If nDBAddress = 0 Then Return False
|
||||
Dim PositionAddressSplit() As String = CompleteAddressSplit(1).Split("."c)
|
||||
Dim nStartIndex As Integer = 0
|
||||
Integer.TryParse(PositionAddressSplit(0), nStartIndex)
|
||||
Select Case CompleteAddressSplit(2)
|
||||
Case 1
|
||||
' rileggo int16
|
||||
Dim Buffer(1) As Byte
|
||||
Client.DBRead(nDBAddress, nStartIndex, 1, Buffer)
|
||||
Dim nBytePositionIndex As Integer = 0
|
||||
Integer.TryParse(PositionAddressSplit(1), nBytePositionIndex)
|
||||
Dim nPower As Integer = Math.Pow(2, nBytePositionIndex)
|
||||
Dim nNewValue As Integer = 0
|
||||
If Not Integer.TryParse(Value, nNewValue) Then Return False
|
||||
Dim nOldValue As Integer = If((Buffer(0) And nPower) = nPower, 1, 0)
|
||||
If nOldValue = nNewValue Then
|
||||
Return True
|
||||
ElseIf nOldValue = 0 Then
|
||||
Buffer(0) = Buffer(0) Or nPower
|
||||
ElseIf nOldValue = 1 Then
|
||||
Buffer(0) = Buffer(0) Xor nPower
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
' Buffer(0) = Buffer(0) And nPower
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
EgtOutLog("Scrittura variabile " & Address & " (Tipo 1) con valore " & Value)
|
||||
'For Index = 0 To Buffer.Count - 1
|
||||
' EgtOutLog(Index & ": " & Buffer(Index))
|
||||
'Next
|
||||
End If
|
||||
Dim nResult As Integer = Client.DBWrite(nDBAddress, nStartIndex, 1, Buffer) ' DbNumber, Start, Amount, Buffer
|
||||
' Return WriteBool(nDBAddress, nStartIndex, bValue)
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
If nResult <> 0 Then
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " effettuata")
|
||||
Else
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " fallita")
|
||||
End If
|
||||
End If
|
||||
Return nResult = 0
|
||||
Case 2
|
||||
Dim nValue As Int16 = 0
|
||||
If Not Int16.TryParse(Value, nValue) Then Return False
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
EgtOutLog("Scrittura variabile " & Address & " (Tipo 2) con valore " & Value)
|
||||
End If
|
||||
Dim bResult As Boolean = WriteInt(nDBAddress, nStartIndex, nValue)
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
If bResult Then
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " effettuata")
|
||||
Else
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " fallita")
|
||||
End If
|
||||
End If
|
||||
Return bResult
|
||||
Case 3
|
||||
Dim nValue As Integer = 0
|
||||
If Not Integer.TryParse(Value, nValue) Then Return False
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
EgtOutLog("Scrittura variabile " & Address & " (Tipo 3) con valore " & Value)
|
||||
End If
|
||||
Dim bResult As Boolean = WriteDInt(nDBAddress, nStartIndex, nValue)
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
If bResult Then
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " effettuata")
|
||||
Else
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " fallita")
|
||||
End If
|
||||
End If
|
||||
Return bResult
|
||||
Case 4
|
||||
Dim dValue As Single = 0
|
||||
If Not StringToDoubleAdv(Value, dValue) Then Return False
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
EgtOutLog("Scrittura variabile " & Address & " (Tipo 4) con valore " & Value)
|
||||
End If
|
||||
Dim bResult As Boolean = WriteReal(nDBAddress, nStartIndex, dValue)
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
If bResult Then
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " effettuata")
|
||||
Else
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " fallita")
|
||||
End If
|
||||
End If
|
||||
Return bResult
|
||||
End Select
|
||||
End Function
|
||||
|
||||
#End Region ' Read Variables
|
||||
|
||||
Friend Function ReadInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean
|
||||
WaitingRefresh()
|
||||
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
|
||||
Dim Result As Integer = Client.DBRead(DBNumber, Start, 2, IntBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
If Result = 0 Then
|
||||
Value = S7.GetIntAt(IntBuffer, 0)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function WriteInt(DBNumber As Integer, Start As Integer, Value As Int16) As Boolean
|
||||
WaitingRefresh()
|
||||
S7.SetIntAt(IntBuffer, 0, Value)
|
||||
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
|
||||
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 2, IntBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
Return Result = 0
|
||||
End Function
|
||||
|
||||
Friend Function ReadBool(DBNumber As Integer, Start As Integer, ByRef Value As Boolean) As Boolean
|
||||
WaitingRefresh()
|
||||
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
|
||||
Dim Result As Integer = Client.DBRead(DBNumber, Start, 1, BoolBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
If Result = 0 Then
|
||||
Value = BitConverter.ToBoolean(BoolBuffer, 0)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function WriteBool(DBNumber As Integer, Start As Integer, Value As Boolean) As Boolean
|
||||
WaitingRefresh()
|
||||
|
||||
If Value Then
|
||||
BoolBuffer(0) = &H1
|
||||
Else
|
||||
BoolBuffer(0) = &H0
|
||||
End If
|
||||
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
|
||||
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 1, BoolBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
Return Result = 0
|
||||
End Function
|
||||
|
||||
Friend Function ReadDInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean
|
||||
WaitingRefresh()
|
||||
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
|
||||
Dim Result As Integer = Client.DBRead(DBNumber, Start, 4, DIntBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
If Result = 0 Then
|
||||
Value = S7.GetDIntAt(DIntBuffer, 0)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function WriteDInt(DBNumber As Integer, Start As Integer, Value As Integer) As Boolean
|
||||
WaitingRefresh()
|
||||
S7.SetDIntAt(DIntBuffer, 0, Value)
|
||||
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
|
||||
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 4, DIntBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
Return Result = 0
|
||||
End Function
|
||||
|
||||
Friend Function ReadReal(DBNumber As Integer, Start As Integer, ByRef Value As Double) As Boolean
|
||||
WaitingRefresh()
|
||||
' Read 4 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
|
||||
Dim Result As Integer = Client.DBRead(DBNumber, Start, 4, RealBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
If Result = 0 Then
|
||||
Value = S7.GetRealAt(RealBuffer, 0)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function WriteReal(DBNumber As Integer, Start As Integer, Value As Single) As Boolean
|
||||
WaitingRefresh()
|
||||
S7.SetRealAt(RealBuffer, 0, Value)
|
||||
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
|
||||
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 4, RealBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
Return Result = 0
|
||||
End Function
|
||||
|
||||
Friend Function ReadString(DBNumber As Integer, Start As Integer, Length As Integer, ByRef Value As String) As Boolean
|
||||
WaitingRefresh()
|
||||
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
|
||||
Dim Result As Integer = Client.DBRead(DBNumber, Start, Length, StringBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
If Result = 0 Then
|
||||
Value = S7.GetStringAt(StringBuffer, 0)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function WriteString(DBNumber As Integer, Start As Integer, Value As String) As Boolean
|
||||
WaitingRefresh()
|
||||
|
||||
If Value.Length > 65535 Then
|
||||
Return False
|
||||
End If
|
||||
S7.SetStringAt(StringBuffer, 0, 65535, Value)
|
||||
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
|
||||
Dim Result As Integer = Client.DBWrite(DBNumber, Start, Value.Length + 2, StringBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
Return Result = 0
|
||||
End Function
|
||||
|
||||
Friend Function ResetStep(bReset As Boolean) As Boolean
|
||||
WaitingRefresh()
|
||||
Dim varResetStep As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList(19) ' Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESET_STEP)
|
||||
If bReset Then
|
||||
Map.refMachManaging.DebugMessage(1, "Imposto variabile ResetStep a 1")
|
||||
varResetStep.sValue = 1
|
||||
Threading.Thread.Sleep(100)
|
||||
Dim nResetStepOk As Integer = 0
|
||||
Dim ResetStepOk As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESET_STEP_OK)
|
||||
Dim ResetMachine As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESET_STATE)
|
||||
While nResetStepOk <> 1
|
||||
If ResetMachine.sValue = "1" Then
|
||||
Return False
|
||||
End If
|
||||
Map.refMachManaging.DebugMessage(1, "Rileggo variabili")
|
||||
RefreshAllVars()
|
||||
Map.refMachManaging.DebugMessage(1, "Leggo valore ResetStepOk")
|
||||
Integer.TryParse(ResetStepOk.sValue, nResetStepOk)
|
||||
Threading.Thread.Sleep(1000)
|
||||
End While
|
||||
End If
|
||||
varResetStep.sValue = 0
|
||||
Map.refMachManaging.DebugMessage(1, "Imposto variabile ResetStep a 0")
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Sub ReadPLCMessages()
|
||||
WaitingRefresh()
|
||||
|
||||
Dim nPlc_Msg As New List(Of Byte)
|
||||
For Index As Integer = 1 To 6
|
||||
Dim nIndex As Integer = Index
|
||||
Dim PLCMessagesVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = PLC_MESSAGES & nIndex)
|
||||
If IsNothing(PLCMessagesVariable) OrElse IsNothing(PLCMessagesVariable.sValue) Then Return
|
||||
Dim nTemp As Int16 = 0
|
||||
Int16.TryParse(PLCMessagesVariable.sValue, nTemp)
|
||||
nTemp = BinaryPrimitives.ReverseEndianness(nTemp)
|
||||
Dim Bytes As Byte() = BitConverter.GetBytes(nTemp)
|
||||
nPlc_Msg.AddRange(Bytes)
|
||||
Next
|
||||
Dim BitArray As New BitArray(nPlc_Msg.ToArray())
|
||||
Dim ErrorList As New List(Of Integer)
|
||||
For BitIndex = 0 To BitArray.Count - 1
|
||||
If BitIndex <= 169 AndAlso BitArray(BitIndex) Then
|
||||
ErrorList.Add(BitIndex)
|
||||
End If
|
||||
Next
|
||||
ShowPLCError(ErrorList)
|
||||
End Sub
|
||||
|
||||
Friend Sub ShowPLCError(ErrorNumber As List(Of Integer))
|
||||
' resetto stati bFound
|
||||
For Each Message In m_ActiveMessages
|
||||
Message.bFound = False
|
||||
Next
|
||||
|
||||
For index As Integer = 0 To ErrorNumber.Count - 1
|
||||
Dim nIndex As Integer = index
|
||||
Dim NewMessageInList As SiemensReadMessages = m_ActiveMessages.FirstOrDefault(Function(x) x.nIndex = 0.ToString())
|
||||
' se il messaggio e' gia' in lista
|
||||
If Not IsNothing(NewMessageInList) Then
|
||||
' lo segno come trovato
|
||||
NewMessageInList.bFound = True
|
||||
Else
|
||||
' lo aggiungo
|
||||
Dim NewMessage As SiemensReadMessages = New SiemensReadMessages(0.ToString())
|
||||
NewMessage.bFound = True
|
||||
m_ActiveMessages.Add(NewMessage)
|
||||
m_SiemensAlarmCallbackDlg(0, 0)
|
||||
End If
|
||||
Next
|
||||
|
||||
' cancello messaggi non trovati
|
||||
For Index = m_ActiveMessages.Count - 1 To 0 Step -1
|
||||
Dim Message As SiemensReadMessages = m_ActiveMessages(Index)
|
||||
If Not Message.bFound Then
|
||||
m_SiemensAlarmCallbackDlg(Message.nIndex, 1)
|
||||
m_ActiveMessages.RemoveAt(Index)
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Friend Class DBBuffer
|
||||
|
||||
Private m_DBAddress As Integer
|
||||
Public ReadOnly Property DBAddress As Integer
|
||||
Get
|
||||
Return m_DBAddress
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_DBValue(65536) As Byte
|
||||
Public ReadOnly Property DBValue As Byte()
|
||||
Get
|
||||
Return m_DBValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(DBAddress As Integer, DBValue As Byte())
|
||||
m_DBAddress = DBAddress
|
||||
m_DBValue = DBValue
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class SiemensReadMessages
|
||||
|
||||
Private m_nIndex As Integer
|
||||
Public ReadOnly Property nIndex As Integer
|
||||
Get
|
||||
Return m_nIndex
|
||||
End Get
|
||||
End Property
|
||||
Private m_sMessage As String
|
||||
Public ReadOnly Property sMessage As String
|
||||
Get
|
||||
Return m_sMessage
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetMessage(sValue As String)
|
||||
m_sMessage = sValue
|
||||
End Sub
|
||||
|
||||
Private m_bFound As Boolean = False
|
||||
Friend Property bFound As Boolean
|
||||
Get
|
||||
Return m_bFound
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bFound = value
|
||||
End Set
|
||||
End Property
|
||||
Public Sub New(nIndex As Integer)
|
||||
m_nIndex = nIndex
|
||||
m_sMessage = sMessage
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -19,6 +19,7 @@ Module ConstCommVar
|
||||
NUM_FLEXIUM = 2
|
||||
NUM_AXIUM_APSERVER = 3
|
||||
NUM_AXIUM_PCTOOLKIT = 4
|
||||
SIEMENS_SHARP7 = 5
|
||||
End Enum
|
||||
|
||||
' Assi
|
||||
@@ -54,6 +55,42 @@ Module ConstCommVar
|
||||
Public Const PLC_MESSAGES As String = "PLC_Messages"
|
||||
' variabile per leggere e scrivere permesso invio cn a macchina
|
||||
Public Const SENDPERMISSION As String = "SendPermission"
|
||||
' variabile per confermare lettura dati di stato pezzo
|
||||
Public Const DATAREADED As String = "Data_Readed"
|
||||
' variabile per confermare lettura stato reset
|
||||
Public Const RESETREADED As String = "Reset_Readed"
|
||||
' variabile per confermare lettura stato reset
|
||||
Public Const DATATOREAD As String = "Data_ToRead"
|
||||
' variabile per confermare lettura stato reset
|
||||
Public Const RESET_STEP As String = "Reset_Step"
|
||||
' variabile per confermare lettura stato reset
|
||||
Public Const RESET_STEP_OK As String = "Reset_Step_Ok"
|
||||
' variabile per stato CN
|
||||
Public Const NC_STATUS As String = "NC_Status"
|
||||
' variabile per modo CN
|
||||
Public Const NC_MODE As String = "NC_Mode"
|
||||
' variabile per apertura pinze manuale
|
||||
Public Const OPEN_CLAMP As String = "Open_Clamp"
|
||||
' variabile per larghezza barra al carico
|
||||
Public Const W_CARICO As String = "W_Carico"
|
||||
' variabile per lunghezza prossima barra
|
||||
Public Const NEXTPART_L As String = "NextPartL"
|
||||
' variabile per larghezza prossima barra
|
||||
Public Const NEXTPART_W As String = "NextPartW"
|
||||
' variabile per altezza prossima barra
|
||||
Public Const NEXTPART_H As String = "NextPartH"
|
||||
' variabile per PressX1 prossima barra
|
||||
Public Const NEXTPART_PRESSX1 As String = "NextPartPressX1"
|
||||
' variabile per Feed prossima barra
|
||||
Public Const NEXTPART_FEED As String = "NextPartFeed"
|
||||
' variabile per Accelerazione prossima barra
|
||||
Public Const NEXTPART_ACC As String = "NextPartAcc"
|
||||
' variabile per Ref1 prossima barra
|
||||
Public Const NEXTPART_REF1 As String = "NextPartRef1"
|
||||
' variabile per Ref2 prossima barra
|
||||
Public Const NEXTPART_REF2 As String = "NextPartRef2"
|
||||
' variabile per Ref2 prossima barra
|
||||
Public Const STOP_WORKING As String = "Stop_Working"
|
||||
|
||||
Public Enum OPStates
|
||||
Start = 1
|
||||
@@ -72,4 +109,11 @@ Module ConstCommVar
|
||||
Home = 8
|
||||
End Enum
|
||||
|
||||
' Variabili Siemens
|
||||
Public Const K_IP As String = "Ip"
|
||||
Public Const K_RACK As String = "Rack"
|
||||
Public Const K_SLOT As String = "Slot"
|
||||
Public Const K_TIMERINTERVAL As String = "TimerInterval"
|
||||
Public Const K_ISOFILEDIR As String = "IsoFileDir"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -117,7 +117,8 @@
|
||||
<HintPath>..\ExtLibs\Interop.FXServer.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="ISOCNC.Remoting">
|
||||
<Reference Include="ISOCNC.Remoting, Version=3.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\ExtLibs\ISOCNC.Remoting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
@@ -167,6 +168,9 @@
|
||||
<Reference Include="SdkApi.Desktop.Usb, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\SdkApi.Desktop.Usb.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sharp7.net">
|
||||
<HintPath>..\ExtLibs\Sharp7.net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpSnmpLib, Version=10.0.9.0, Culture=neutral, PublicKeyToken=4c00852d3788e005, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Lextm.SharpSnmpLib.10.0.9\lib\net452\SharpSnmpLib.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -280,6 +284,7 @@
|
||||
<Compile Include="Comms\NUMAxiumComm.vb" />
|
||||
<Compile Include="Comms\NUMAxiumPcToolkitComm.vb" />
|
||||
<Compile Include="Comms\NUMFlexiumComm.vb" />
|
||||
<Compile Include="Comms\SIEMENSSharp7Comm.vb" />
|
||||
<Compile Include="Comms\TPAComm.vb" />
|
||||
<Compile Include="ConfigurationPage\ConfigurationPageV.xaml.vb">
|
||||
<DependentUpon>ConfigurationPageV.xaml</DependentUpon>
|
||||
|
||||
@@ -147,6 +147,17 @@ Public Class LeftPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property m_Axis_Visibility As Visibility
|
||||
Public ReadOnly Property Axis_Visibility As Visibility
|
||||
Get
|
||||
Return m_Axis_Visibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetAxisVisibility()
|
||||
m_Axis_Visibility = If(CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7, Visibility.Collapsed, Visibility.Visible)
|
||||
NotifyPropertyChanged(NameOf(Axis_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_bRestart As Boolean = False
|
||||
Public Property bRestart As Boolean
|
||||
Get
|
||||
@@ -268,7 +279,7 @@ Public Class LeftPanelVM
|
||||
|
||||
Public ReadOnly Property OPMode_Visibility As Visibility
|
||||
Get
|
||||
Return If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT Or CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -428,7 +439,7 @@ Public Class LeftPanelVM
|
||||
New OPState("Pending", OPStates.Pending),
|
||||
New OPState("Unspecified", OPStates.Unspecified)
|
||||
}
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
|
||||
m_OPStateList = New List(Of OPState) From {New OPState("Start", OPStates.Start),
|
||||
New OPState("Stop", OPStates.Stop),
|
||||
New OPState("Reset", OPStates.End),
|
||||
@@ -454,6 +465,13 @@ Public Class LeftPanelVM
|
||||
New OPState("Manual", OPModes.Manual),
|
||||
New OPState("Home", OPModes.Home)
|
||||
}
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
m_OPModeList = New List(Of OPState) From {
|
||||
New OPState("Auto", OPModes.Auto),
|
||||
New OPState("Mdi", OPModes.Mdi),
|
||||
New OPState("Manual", OPModes.Manual),
|
||||
New OPState("Reference Point", OPModes.Home)
|
||||
}
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ Public Class MachCommandMessagePanelVM
|
||||
m_MachManagingThread = New Thread(Sub()
|
||||
MachineCommThread.MachManagingThreadFunction(AddressOf ResultCallbackDlg, AddressOf CloseCallbackDlg,
|
||||
AddressOf UpdateCallbackDlg, AddressOf TPAAlarmCallbackDlg, AddressOf NUMAlarmCallbackDlg,
|
||||
AddressOf AxisCoordinatesCallbackDlg, AddressOf OpStateCallbackDlg,
|
||||
AddressOf SiemensAlarmCallbackDlg, AddressOf AxisCoordinatesCallbackDlg, AddressOf OpStateCallbackDlg,
|
||||
AddressOf OpModeCallbackDlg, AddressOf ChannelCallbackDlg, AddressOf ReadVarCallbackDlg)
|
||||
End Sub)
|
||||
' avvio thread di gestione della macchina che avvia la connessione
|
||||
@@ -680,6 +680,42 @@ Public Class MachCommandMessagePanelVM
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateAlarmLog(DateTime.Now(), AlarmOperation & LogEvent.cSeparator & ErrorTyp & LogEvent.cSeparator & AlarmMessage & LogEvent.cSeparator & AlarmCode & LogEvent.cSeparator, DbControllers.m_SupervisorId))
|
||||
End Sub
|
||||
|
||||
Friend Sub SiemensAlarmCallbackDlg(nIndex As Integer, AlarmOperation As Integer)
|
||||
|
||||
' se aggiungo allarme e non ce ne erano
|
||||
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) AndAlso m_ErrCycle.Count = 0 AndAlso m_Iso.Count = 0 AndAlso m_Message.Count = 0 AndAlso m_ErrSystem.Count = 0 Then
|
||||
' avvio il timer degli allarmi
|
||||
m_AlarmTimer.Start()
|
||||
End If
|
||||
Dim AlarmMessage As String = nIndex
|
||||
|
||||
' costruisco messaggio errore in base al tipo
|
||||
Dim sErrorMessage As String = AlarmMessage
|
||||
If bMsgTranslationActive Then
|
||||
Dim sTranslatedMsg = MachMsg(MsgParagraphs.PLC, nIndex)
|
||||
If Not String.IsNullOrWhiteSpace(sTranslatedMsg) Then
|
||||
sErrorMessage = sTranslatedMsg
|
||||
End If
|
||||
End If
|
||||
AlarmMessage = If(Not String.IsNullOrWhiteSpace(sErrorMessage), sErrorMessage, "")
|
||||
|
||||
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
|
||||
m_ErrCycle.Add(Alarm.CreateAlarm(nIndex, AlarmMessage))
|
||||
Else
|
||||
m_ErrCycle.RemoveAll(Function(x) x.sCode = nIndex)
|
||||
End If
|
||||
|
||||
' forzo aggiornamento allarmi
|
||||
AlarmTimer_Tick()
|
||||
' se non ci sono errori
|
||||
If m_ErrCycle.Count = 0 AndAlso m_Iso.Count = 0 AndAlso m_Message.Count = 0 AndAlso m_ErrSystem.Count = 0 Then
|
||||
' fermo timer degli allarmi
|
||||
m_AlarmTimer.Stop()
|
||||
End If
|
||||
'DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, ErrorTyp, AlarmMessage, AlarmCode, DateTime.Now))
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateAlarmLog(DateTime.Now(), AlarmOperation & LogEvent.cSeparator & nIndex & LogEvent.cSeparator & sErrorMessage, DbControllers.m_SupervisorId))
|
||||
End Sub
|
||||
|
||||
Friend Sub AxisCoordinatesCallbackDlg(AxisValue As Double, AxisIndex As Integer)
|
||||
Map.refAxesPanelVM.AxisCoordinatesCallbackDlg(AxisValue, AxisIndex)
|
||||
End Sub
|
||||
@@ -697,7 +733,7 @@ Public Class MachCommandMessagePanelVM
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
|
||||
Map.refLeftPanelVM.SetOPState(NewState)
|
||||
End Select
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachineStateLog(newOpState, DbControllers.m_SupervisorId))
|
||||
@@ -710,7 +746,7 @@ Public Class MachCommandMessagePanelVM
|
||||
Return
|
||||
End If
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
|
||||
Map.refLeftPanelVM.SetOPMode(NewState)
|
||||
End Select
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachineModeLog(newOpState, DbControllers.m_SupervisorId))
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports ISOCNC.Remoting
|
||||
|
||||
Public Class MachCommandPanelVM
|
||||
|
||||
Private m_AxisList As ObservableCollection(Of Axis)
|
||||
|
||||
Public ReadOnly Property AxisList As ObservableCollection(Of Axis)
|
||||
Get
|
||||
Return m_AxisList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_OPState As MachineOperatingState
|
||||
|
||||
'Public ReadOnly Property OPState As MachineOperatingState
|
||||
' Get
|
||||
' Return m_OPState
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Public ReadOnly Property sOPState As String
|
||||
' Get
|
||||
' Select Case m_OPState
|
||||
' Case MachineOperatingState.Start
|
||||
' Return "START"
|
||||
' Case MachineOperatingState.Stop
|
||||
' Return "STOP"
|
||||
' Case MachineOperatingState.End
|
||||
' Return "RESET"
|
||||
' Case MachineOperatingState.SetPoint
|
||||
' Return "SETPOINT"
|
||||
' Case MachineOperatingState.Pending
|
||||
' Return "PENDING"
|
||||
' Case Else
|
||||
' Return "UNSPECIFIED"
|
||||
' End Select
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Public Sub New()
|
||||
Map.SetRefMachCommandMessagePanelVM(Me)
|
||||
'' impostazioni timer degli allarmi
|
||||
'm_AlarmTimer.Interval = TimeSpan.FromMilliseconds(1500)
|
||||
'AddHandler m_AlarmTimer.Tick, AddressOf AlarmTimer_Tick
|
||||
'' impostazione assi (leggerli da conf macchina)
|
||||
'm_AxisList = New ObservableCollection(Of Axis)({New Axis(ASSE_X),
|
||||
' New Axis(ASSE_Y),
|
||||
' New Axis(ASSE_Z),
|
||||
' New Axis(ASSE_C),
|
||||
' New Axis(ASSE_B)})
|
||||
'' connetto stampante etichette
|
||||
'LabelPrinter.ConnectPrinter()
|
||||
|
||||
'NotifyPropertyChanged(NameOf(Connect_Background))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,55 @@
|
||||
Public Class Axis
|
||||
Inherits VMBase
|
||||
|
||||
Private m_Name As String
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Value As Double
|
||||
Public ReadOnly Property sValue As Double
|
||||
Get
|
||||
Return m_Value
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Sub SetValue(value As Double)
|
||||
m_Value = value
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Sub
|
||||
|
||||
Public Sub New(Name As String)
|
||||
m_Name = Name
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Class Alarm
|
||||
|
||||
Private m_sCode As String
|
||||
Public ReadOnly Property sCode As String
|
||||
Get
|
||||
Return m_sCode
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sMessage As String
|
||||
Public ReadOnly Property sMessage As String
|
||||
Get
|
||||
Return m_sMessage
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected Sub New()
|
||||
End Sub
|
||||
|
||||
Public Shared Function CreateAlarm(Code As String, Message As String) As Alarm
|
||||
Dim NewAlarm As New Alarm
|
||||
NewAlarm.m_sCode = Code
|
||||
NewAlarm.m_sMessage = Message
|
||||
Return NewAlarm
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -20,13 +20,14 @@ Public Class MyMachGroupVM
|
||||
ElseIf m_bToBeProduced OrElse m_bSentToMachine Then
|
||||
Return False
|
||||
' se la macchina e' ferma
|
||||
ElseIf IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
|
||||
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified) Then
|
||||
ElseIf CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 AndAlso
|
||||
(IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
|
||||
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified)) Then
|
||||
' verifico se c'e' un pezzo non finito
|
||||
Dim ToBeRestartedPart As MyMachGroupVM = Map.refSupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x As MyMachGroupVM) x.nProduction_State = Global.EgtBEAMWALL.Core.ItemState.WIP And Not m_bToBeProduced)
|
||||
Dim ToBeRestartedPart As MyMachGroupVM = Map.refSupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x As MyMachGroupVM) x.nProduction_State = Global.EgtBEAMWALL.Core.ItemState.WIP And Not x.m_bToBeProduced)
|
||||
' se c'e', attivo solo il pezzo non finito
|
||||
Return Not (Not IsNothing(ToBeRestartedPart) AndAlso Not ToBeRestartedPart Is Me)
|
||||
Else
|
||||
@@ -46,11 +47,12 @@ Public Class MyMachGroupVM
|
||||
Case ItemState.WIP
|
||||
If Not m_bToBeProduced AndAlso Not m_bSentToMachine Then
|
||||
Return True
|
||||
ElseIf IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
|
||||
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified) Then
|
||||
ElseIf CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 AndAlso
|
||||
(IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
|
||||
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified)) Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
@@ -221,24 +223,43 @@ Public Class MyMachGroupVM
|
||||
End If
|
||||
' se progetto travi e lavorazione interrotta da reset
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM AndAlso (bResetWhileCutting OrElse dtStartTime <> DateTime.MinValue) And Not Map.refLeftPanelVM.bRestart Then
|
||||
' chiedo se riprendere o rifare la barra da zero
|
||||
Select Case EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
|
||||
Dim bRedo As MessageBoxResult = MessageBoxResult.No
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso Not IsNothing(Map.refMachManaging) Then
|
||||
' leggo pinze aperte
|
||||
Dim Open_ClampVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = OPEN_CLAMP)
|
||||
Map.refMachManaging.Siemens_Sharp7.RefreshAllVars()
|
||||
Map.refMachManaging.DebugMessage(1, "Leggo variabile pinze aperte " & Open_ClampVariable.sValue)
|
||||
If Open_ClampVariable.sValue = 1 Then
|
||||
Map.refMachManaging.DebugMessage(1, "Pinze aperte, ripartenza impossibile")
|
||||
bRedo = MessageBoxResult.No
|
||||
MessageBox.Show("Pinze aperte, ripartenza impossibile!!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Else
|
||||
' chiedo se riprendere o rifare la barra da zero
|
||||
bRedo = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
|
||||
End If
|
||||
Else
|
||||
' chiedo se riprendere o rifare la barra da zero
|
||||
bRedo = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
|
||||
End If
|
||||
Select Case bRedo
|
||||
Case MessageBoxResult.Yes
|
||||
' segno da rifare pezzi non completamente lavorati
|
||||
For Each Part As PartVM In PartVMList
|
||||
If Part.dtEndTime <> DateTime.MinValue Then
|
||||
Part.bDO = False
|
||||
Else
|
||||
Part.SetDo(True)
|
||||
End If
|
||||
Next
|
||||
' se ripresa, mostro lista feature e colonne Redo
|
||||
Map.refLeftPanelVM.bRestart = True
|
||||
' blocco produzione di tutti gli altri
|
||||
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
||||
' riabilito bottoni di comunicazione a fine invio programma
|
||||
Map.refMachCommandMessagePanelVM.SetCommBtnIsEnabled(True)
|
||||
Return
|
||||
If CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 Then
|
||||
' segno da rifare pezzi non completamente lavorati
|
||||
For Each Part As PartVM In PartVMList
|
||||
If Part.dtEndTime <> DateTime.MinValue Then
|
||||
Part.bDO = False
|
||||
Else
|
||||
Part.SetDo(True)
|
||||
End If
|
||||
Next
|
||||
' se ripresa, mostro lista feature e colonne Redo
|
||||
Map.refLeftPanelVM.bRestart = True
|
||||
' blocco produzione di tutti gli altri
|
||||
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
||||
' riabilito bottoni di comunicazione a fine invio programma
|
||||
Map.refMachCommandMessagePanelVM.SetCommBtnIsEnabled(True)
|
||||
Return
|
||||
End If
|
||||
Case MessageBoxResult.No
|
||||
' annullo stati dei pezzi gia' fatti
|
||||
For Each Part In PartVMList
|
||||
@@ -273,8 +294,9 @@ Public Class MyMachGroupVM
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL AndAlso (bResetWhileCutting OrElse dtStartTime <> DateTime.MinValue) Then
|
||||
If False Then
|
||||
' chiedo se riprendere o rifare il pannello da zero
|
||||
Dim bRedo As MessageBoxResult = EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62547), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
|
||||
Dim MachIndexVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = MACHINDEX)
|
||||
Select Case EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62547), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
|
||||
Select Case bRedo
|
||||
' se ripresa
|
||||
Case MessageBoxResult.Yes
|
||||
' ripristino indice di lavorazione precedente a reset
|
||||
|
||||
@@ -21,6 +21,7 @@ Module MachCommConst
|
||||
Public Delegate Sub UpdateCallbackDlg(Param As String, Params As String)
|
||||
Public Delegate Sub TPAAlarmCallbackDlg(ByVal AlarmOperation As Integer, ByVal AlarmType As Integer, ByVal AlarmMessage As String, ByVal AlarmCode As String, ByVal AlarmDateTime As String)
|
||||
Public Delegate Sub NUMAlarmCallbackDlg(ByVal CncNumber As Integer, ByVal numberOfError As Integer, ByVal ErrorTyp As String, ByVal ErrorIndex As String, ByVal ErrorNumber As String, ByVal ErrorLine As String, ByVal ErrorMessage As String, ByVal ErrorAdditional As String)
|
||||
Public Delegate Sub SiemensAlarmCallbackDlg(nIndex As Integer, AlarmOperation As Integer)
|
||||
Public Delegate Sub AxisCoordinatesCallbackDlg(ByVal AxisValue As Double, ByVal AxisIndex As Integer)
|
||||
Public Delegate Sub OpStateCallbackDlg(ByVal newOpState As Integer)
|
||||
Public Delegate Sub OpModeCallbackDlg(ByVal newOpState As Integer)
|
||||
@@ -32,6 +33,7 @@ Module MachCommConst
|
||||
Friend m_UpdateCallbackDlg As UpdateCallbackDlg
|
||||
Friend m_TPAAlarmCallbackDlg As TPAAlarmCallbackDlg
|
||||
Friend m_NUMAlarmCallbackDlg As NUMAlarmCallbackDlg
|
||||
Friend m_SiemensAlarmCallbackDlg As SiemensAlarmCallbackDlg
|
||||
Friend m_AxisCoordinatesCallbackDlg As AxisCoordinatesCallbackDlg
|
||||
Friend m_OpStateCallbackDlg As OpStateCallbackDlg
|
||||
Friend m_OpModeCallbackDlg As OpModeCallbackDlg
|
||||
|
||||
@@ -49,6 +49,11 @@ Public Class MachManaging
|
||||
Return m_CN
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Siemens_Sharp7 As SIEMENSSharp7Comm
|
||||
Get
|
||||
Return m_CN
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Shared WithEvents m_CommandList As New ObservableCollection(Of ThreadCommand)
|
||||
Public Shared ReadOnly Property CommandList As ObservableCollection(Of ThreadCommand)
|
||||
@@ -92,7 +97,20 @@ Public Class MachManaging
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' variabile che indica prima barra dopo start (Siemens)
|
||||
Private m_bFirstRaw As Boolean = True
|
||||
|
||||
' variabile che indica se emettere ii messaggi di debug
|
||||
Private m_Debug As Integer = 0
|
||||
Public ReadOnly Property Debug As Integer
|
||||
Get
|
||||
Return m_Debug
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
' leggo variabile debug da ini
|
||||
m_Debug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, CurrentMachine.sMachIniFile)
|
||||
' imposto in Map
|
||||
Map.SetRefMachManaging(Me)
|
||||
AddHandler m_CommandList.CollectionChanged, AddressOf CommandList_CollectionChanged
|
||||
@@ -106,7 +124,7 @@ Public Class MachManaging
|
||||
|
||||
Friend Sub Timer_Tick()
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.TPA, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.TPA, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
|
||||
' eseguo ciclo principale
|
||||
Dim nReset_State As Integer
|
||||
Dim nStart_State As Boolean
|
||||
@@ -119,6 +137,9 @@ Public Class MachManaging
|
||||
Dim nISO_Sent As Integer
|
||||
Dim nRunning As Integer
|
||||
Dim nCurrMachIndex As Integer
|
||||
Dim nDataWrite As Integer
|
||||
Dim nNCStatus As Integer
|
||||
Dim nNCMode As Integer
|
||||
Dim ResetVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESET_STATE)
|
||||
Dim StartVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = START_STATE)
|
||||
Dim StopVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = STOP_STATE)
|
||||
@@ -130,6 +151,11 @@ Public Class MachManaging
|
||||
Dim ISOSentVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_SENT)
|
||||
Dim RunningVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RUNNING)
|
||||
Dim MachIndexVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = MACHINDEX)
|
||||
Dim DataReadedVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = DATAREADED)
|
||||
Dim ResetReadedVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESETREADED)
|
||||
Dim DataToReadVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = DATATOREAD)
|
||||
Dim NCStatusVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NC_STATUS)
|
||||
Dim NCModeVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NC_MODE)
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.TPA
|
||||
' leggo tutte le variabili
|
||||
@@ -302,7 +328,74 @@ Public Class MachManaging
|
||||
ReadPLCMessages()
|
||||
Num_Axium_PCToolkit.ReadCncMode()
|
||||
Num_Axium_PCToolkit.ReadPosition()
|
||||
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
' leggo tutte le variabili
|
||||
Map.refMachManaging.DebugMessage(1, "Leggo tutte le variabili")
|
||||
Siemens_Sharp7.RefreshAllVars()
|
||||
If Not IsNothing(ResetVariable.sValue) Then
|
||||
Integer.TryParse(ResetVariable.sValue, nReset_State)
|
||||
Else
|
||||
nReset_State = 1
|
||||
End If
|
||||
If Not IsNothing(ProdVariable.sValue) Then
|
||||
Integer.TryParse(ProdVariable.sValue, nP_Prod)
|
||||
Else
|
||||
nP_Prod = -1
|
||||
End If
|
||||
If Not IsNothing(MachGroupVariable.sValue) Then
|
||||
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
|
||||
Else
|
||||
nP_Machgroup = -1
|
||||
End If
|
||||
If Not IsNothing(PartVariable.sValue) Then
|
||||
Integer.TryParse(PartVariable.sValue, nP_Part)
|
||||
Else
|
||||
nP_Part = -1
|
||||
End If
|
||||
If Not IsNothing(StateVariable.sValue) Then
|
||||
Integer.TryParse(StateVariable.sValue, nP_State)
|
||||
Else
|
||||
nP_State = -1
|
||||
End If
|
||||
If Not IsNothing(ISONumVariable.sValue) Then
|
||||
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
|
||||
Else
|
||||
nISO_Num = -1
|
||||
End If
|
||||
If Not IsNothing(RunningVariable.sValue) Then
|
||||
Integer.TryParse(RunningVariable.sValue, nRunning)
|
||||
Else
|
||||
nRunning = -1
|
||||
End If
|
||||
If Not IsNothing(DataReadedVariable.sValue) Then
|
||||
Integer.TryParse(DataReadedVariable.sValue, nDataWrite)
|
||||
Else
|
||||
nDataWrite = -1
|
||||
End If
|
||||
If Not IsNothing(NCStatusVariable.sValue) Then
|
||||
Integer.TryParse(NCStatusVariable.sValue, nNCStatus)
|
||||
Else
|
||||
nNCStatus = -1
|
||||
End If
|
||||
If Not IsNothing(NCModeVariable.sValue) Then
|
||||
Integer.TryParse(NCModeVariable.sValue, nNCMode)
|
||||
Else
|
||||
nNCMode = -1
|
||||
End If
|
||||
' leggo messaggi plc
|
||||
Siemens_Sharp7.ReadPLCMessages()
|
||||
End Select
|
||||
' se SiemensSharp7 e reset a 0, verifico che conferma lettura reset sia a zero
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 And ResetReadedVariable.sValue = "1" And ResetVariable.sValue = "0" Then
|
||||
Map.refMachManaging.DebugMessage(1, "Azzero lettura reset")
|
||||
ResetReadedVariable.sValue = "0"
|
||||
End If
|
||||
' se SiemensSharp7 e dati letti a 1 e dati scritti a 0, verifico che dati letti sia a zero
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 And DataReadedVariable.sValue = "1" And DataToReadVariable.sValue = "0" Then
|
||||
Map.refMachManaging.DebugMessage(1, "Azzero lettura dati")
|
||||
DataReadedVariable.sValue = "0"
|
||||
End If
|
||||
' se NUM aggiorno stato della macchina
|
||||
If CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Then
|
||||
Dim OpState As OPStates
|
||||
@@ -330,10 +423,45 @@ Public Class MachManaging
|
||||
If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
|
||||
m_OpStateCallbackDlg(OpState)
|
||||
End If
|
||||
ElseIf CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
Dim OpState As OPStates
|
||||
If nNCStatus > 0 Then
|
||||
Select Case nNCStatus
|
||||
Case 1
|
||||
OpState = OPStates.End
|
||||
Case 2
|
||||
OpState = OPStates.Stop
|
||||
Case 3
|
||||
OpState = OPStates.Start
|
||||
Case Else
|
||||
OpState = OPStates.Unspecified
|
||||
End Select
|
||||
End If
|
||||
If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
|
||||
Map.refMachManaging.DebugMessage(1, "Imposto stato CN: " & OpState)
|
||||
m_OpStateCallbackDlg(OpState)
|
||||
End If
|
||||
Dim OpMode As OPModes
|
||||
If nNCMode > 0 Then
|
||||
Select Case nNCMode
|
||||
Case 1
|
||||
OpMode = OPModes.Manual
|
||||
Case 2
|
||||
OpMode = OPModes.Auto
|
||||
Case 3
|
||||
OpMode = OPModes.Mdi
|
||||
Case 4 ' Reference Point
|
||||
OpMode = OPModes.Home
|
||||
End Select
|
||||
End If
|
||||
If IsNothing(Map.refLeftPanelVM.SelOPMode) OrElse OpMode <> Map.refLeftPanelVM.SelOPMode.Id Then
|
||||
Map.refMachManaging.DebugMessage(1, "Imposto modo CN: " & OpMode)
|
||||
m_OpModeCallbackDlg(OpMode)
|
||||
End If
|
||||
End If
|
||||
' se TPA e non ancora fatto, preparo variabili barra successiva
|
||||
If CurrentMachine.NCType = NCTypes.TPA AndAlso CurrentMachine.Flow = FlowTypes.CONTINUOUS AndAlso m_NextBarId = 0 Then
|
||||
SetNextBarVars()
|
||||
SetNextBarVars(nRunning)
|
||||
' se macchina NUM, non sto gia' spedendo e variabile spedizione me lo permette
|
||||
ElseIf (CurrentMachine.NCType = NCTypes.NUM_FLEXIUM AndAlso
|
||||
Not Num_Flexium.bIsTransferActive AndAlso
|
||||
@@ -343,30 +471,54 @@ Public Class MachManaging
|
||||
nISO_Sent = 1) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso
|
||||
Not Num_Axium_PCToolkit.bIsTransferActive AndAlso
|
||||
nISO_Sent = 1) Then
|
||||
nISO_Sent = 1) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso
|
||||
(nISO_Num = 0 OrElse
|
||||
nISO_Num = nRunning)) Then
|
||||
' verifico se c'e' un programma da lanciare
|
||||
Map.refMachManaging.DebugMessage(1, "Entro in SendNextProgram")
|
||||
SendNextProgram()
|
||||
ElseIf CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso m_NextBarId = 0 Then
|
||||
SetNextBarVars(nRunning)
|
||||
End If
|
||||
' verifico se scattato stato reset
|
||||
If nReset_State <> 0 Then
|
||||
Map.refMachManaging.DebugMessage(1, "Scattato Reset")
|
||||
' resetto tutti i programmi
|
||||
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then Map.refProjectVM.SupervisorMachGroupPanelVM.ResetAllMachGroups()
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
'resetto programma corrente
|
||||
Map.refMachManaging.DebugMessage(1, "Resetto programma corrente")
|
||||
ISONumVariable.sValue = "0"
|
||||
m_bFirstRaw = True
|
||||
Else
|
||||
' resetto variabili P
|
||||
ProdVariable.sValue = "0"
|
||||
MachGroupVariable.sValue = "0"
|
||||
PartVariable.sValue = "0"
|
||||
StateVariable.sValue = "0"
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
RemoveAllProgram() ' rimuovo programma default per pending
|
||||
End If
|
||||
End If
|
||||
' cancello tutti i programmi da memoria CN
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
RemoveAllProgram() ' rimuovo programma default per pending
|
||||
End If
|
||||
' azzero variabile reset
|
||||
ResetVariable.sValue = "0"
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
Map.refMachManaging.DebugMessage(1, "Confermo lettura reset")
|
||||
ResetReadedVariable.sValue = "1"
|
||||
Else
|
||||
ResetVariable.sValue = "0"
|
||||
End If
|
||||
' resetto prossima barra e variabili V
|
||||
If CurrentMachine.NCType = NCTypes.TPA AndAlso CurrentMachine.Flow = FlowTypes.CONTINUOUS Then
|
||||
m_NextBarId = 0
|
||||
For Index As Integer = 1 To 6
|
||||
Tpa.RWVariableManager.WriteVarByName(VPAR & Index.ToString(), 0)
|
||||
Next
|
||||
'For Index As Integer = 1 To 6
|
||||
' Tpa.RWVariableManager.WriteVarByName(VPAR & Index.ToString(), 0)
|
||||
'Next
|
||||
ResetNextBarVars()
|
||||
End If
|
||||
Return
|
||||
' se macchina TPA, e' in pending e non sta tagliando alcun pezzo
|
||||
@@ -382,10 +534,17 @@ Public Class MachManaging
|
||||
' attesa per essere sicuro che abbia scritto e riletto variabili
|
||||
Threading.Thread.Sleep(300)
|
||||
' verifico stati inizio e fine pezzi
|
||||
ElseIf nP_Prod <> 0 AndAlso
|
||||
nP_Machgroup <> 0 AndAlso
|
||||
nP_Part <> 0 Then
|
||||
ElseIf (CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 AndAlso
|
||||
nP_Prod <> 0 AndAlso
|
||||
nP_Machgroup <> 0 AndAlso
|
||||
nP_Part <> 0) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso
|
||||
DataToReadVariable.sValue = "1" AndAlso
|
||||
nP_Prod <> 0 AndAlso
|
||||
nP_Machgroup <> 0 AndAlso
|
||||
nP_Part <> 0) Then
|
||||
If nP_State = PartState.START Then
|
||||
Map.refMachManaging.DebugMessage(1, "Leggo dati start")
|
||||
Dim dtStart As DateTime = DateTime.Now()
|
||||
' recupero gruppo di lavorazione del pezzo
|
||||
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
|
||||
@@ -427,6 +586,9 @@ Public Class MachManaging
|
||||
Tpa.RWVariableManager.WriteVarByName(P_STATE, 0)
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
StateVariable.sValue = "0"
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
Map.refMachManaging.DebugMessage(1, "Confermo lettura dati start")
|
||||
DataReadedVariable.sValue = "1"
|
||||
End Select
|
||||
' se nessun pezzo della barra diverso da quello corrente e' in start
|
||||
If Not MachGroup.PartVMList.Any(Function(x) x.nPartId <> nP_Part AndAlso x.nProduction_State = 1) Then
|
||||
@@ -444,9 +606,11 @@ Public Class MachManaging
|
||||
End If
|
||||
' flag di aggiornamento log macchina
|
||||
Map.refMachineLogPageVM.UpdateMachineLogList(False)
|
||||
DebugMessage(1, "Fine lettura dati start")
|
||||
' attesa per essere sicuro che abbia scritto e riletto variabili
|
||||
Threading.Thread.Sleep(300)
|
||||
ElseIf nP_State = PartState.END_ Then
|
||||
DebugMessage(1, "Leggo dati end")
|
||||
Dim dtEnd As DateTime = DateTime.Now()
|
||||
' recupero gruppo di lavorazione del pezzo
|
||||
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
|
||||
@@ -506,10 +670,16 @@ Public Class MachManaging
|
||||
' scrivo evento fine MachGroup su DB
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(dtEnd, nP_Prod, nP_Machgroup, nP_State, DbControllers.SupervisorId))
|
||||
' azzero tutte le variabilli per iniziare barra successiva
|
||||
ProdVariable.sValue = "0"
|
||||
MachGroupVariable.sValue = "0"
|
||||
PartVariable.sValue = "0"
|
||||
StateVariable.sValue = "0"
|
||||
' azzero variabile per far ripartire macchina
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
DebugMessage(1, "Confermo lettura dati end")
|
||||
DataReadedVariable.sValue = "1"
|
||||
Else
|
||||
ProdVariable.sValue = "0"
|
||||
MachGroupVariable.sValue = "0"
|
||||
PartVariable.sValue = "0"
|
||||
StateVariable.sValue = "0"
|
||||
End If
|
||||
|
||||
' se non impostata data start
|
||||
If MachGroup.dtStartTime = DateTime.MinValue Then
|
||||
@@ -536,7 +706,11 @@ Public Class MachManaging
|
||||
End If
|
||||
Else
|
||||
' azzero variabile per far ripartire macchina
|
||||
StateVariable.sValue = "0"
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
DataReadedVariable.sValue = "1"
|
||||
Else
|
||||
StateVariable.sValue = "0"
|
||||
End If
|
||||
End If
|
||||
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
|
||||
If nP_Part = -1 Then
|
||||
@@ -554,22 +728,26 @@ Public Class MachManaging
|
||||
End If
|
||||
' flag di aggiornamento log macchina
|
||||
Map.refMachineLogPageVM.UpdateMachineLogList(False)
|
||||
DebugMessage(1, "Fine lettura dati end")
|
||||
' attesa per essere sicuro che abbia scritto e riletto variabili
|
||||
Threading.Thread.Sleep(300)
|
||||
End If
|
||||
End If
|
||||
|
||||
End Select
|
||||
|
||||
' funzione che riavvia comunicazione Siemens se necessario
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
Siemens_Sharp7.RefreshConnection()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private m_Lock_SendProgram As New Object
|
||||
|
||||
Private Function SetNextBarVars() As Boolean
|
||||
Private Function SetNextBarVars(nRunning As Integer) As Boolean
|
||||
' verifico se c'e' un programma da lanciare
|
||||
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
For Each MyMachGroup As MyMachGroupVM In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList
|
||||
If Not MyMachGroup.bSentToMachine AndAlso MyMachGroup.dtStartTime = DateTime.MinValue Then
|
||||
If If(CurrentMachine.NCType = NCTypes.TPA, Not MyMachGroup.bSentToMachine, MyMachGroup.bSentToMachine AndAlso nRunning <> 0 AndAlso MyMachGroup.nName <> nRunning) AndAlso MyMachGroup.dtStartTime = DateTime.MinValue Then
|
||||
If MyMachGroup.bReadyForMachining Then
|
||||
' leggo valori parametri V da file
|
||||
Dim dVPars(10) As Double
|
||||
@@ -581,41 +759,109 @@ Public Class MachManaging
|
||||
StringToDoubleAdv(VPar(1), dVPars(VParIndex - 1))
|
||||
Next
|
||||
' li scrivo nel CN
|
||||
For Index As Integer = 1 To 10
|
||||
Dim sValue As String = ""
|
||||
sValue = DoubleToString(dVPars(Index - 1), 2)
|
||||
Tpa.RWVariableManager.WriteVarByName(VPAR & Index.ToString(), sValue)
|
||||
Next
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.TPA
|
||||
For Index As Integer = 1 To 10
|
||||
Dim sValue As String = ""
|
||||
sValue = DoubleToString(dVPars(Index - 1), 2)
|
||||
Tpa.RWVariableManager.WriteVarByName(VPAR & Index.ToString(), sValue)
|
||||
Next
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
' imposto larghezza barra
|
||||
Dim NextPartL As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_L)
|
||||
NextPartL.sValue = DoubleToString(Math.Ceiling(dVPars(0)), 2)
|
||||
Dim NextPartW As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_W)
|
||||
NextPartW.sValue = DoubleToString(dVPars(1), 2)
|
||||
Dim NextPartH As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_H)
|
||||
NextPartH.sValue = DoubleToString(dVPars(2), 2)
|
||||
Dim NextPartPressX1 As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_PRESSX1)
|
||||
NextPartPressX1.sValue = DoubleToString(dVPars(3), 2)
|
||||
Dim NextPartFeed As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_FEED)
|
||||
NextPartFeed.sValue = DoubleToString(dVPars(4), 2)
|
||||
Dim NextPartAcc As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_ACC)
|
||||
NextPartAcc.sValue = DoubleToString(dVPars(5), 2)
|
||||
Dim NextPartRef1 As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_REF1)
|
||||
NextPartRef1.sValue = DoubleToString(dVPars(6), 2)
|
||||
Dim NextPartRef2 As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_REF2)
|
||||
NextPartRef2.sValue = DoubleToString(dVPars(7), 2)
|
||||
'DebugMessage(1, "Imposto larghezza: " & MyMachGroup.dW)
|
||||
End Select
|
||||
m_NextBarId = MyMachGroup.Id
|
||||
Return True
|
||||
Else
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
' metto tutti i valori a 0
|
||||
ResetNextBarVars()
|
||||
End If
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' se ho passato tutte le barre della lista, resetto valori carico barra successiva
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
' metto tutti i valori a 0
|
||||
ResetNextBarVars()
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function ResetNextBarVars() As Boolean
|
||||
' li scrivo nel CN
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.TPA
|
||||
For Index As Integer = 1 To 10
|
||||
Dim sValue As String = ""
|
||||
sValue = DoubleToString(0, 2)
|
||||
Tpa.RWVariableManager.WriteVarByName(VPAR & Index.ToString(), sValue)
|
||||
Next
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
' imposto larghezza barra
|
||||
Dim NextPartL As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_L)
|
||||
NextPartL.sValue = DoubleToString(0, 2)
|
||||
Dim NextPartW As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_W)
|
||||
NextPartW.sValue = DoubleToString(0, 2)
|
||||
Dim NextPartH As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_H)
|
||||
NextPartH.sValue = DoubleToString(0, 2)
|
||||
Dim NextPartPressX1 As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_PRESSX1)
|
||||
NextPartPressX1.sValue = DoubleToString(0, 2)
|
||||
Dim NextPartFeed As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_FEED)
|
||||
NextPartFeed.sValue = DoubleToString(0, 2)
|
||||
Dim NextPartAcc As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_ACC)
|
||||
NextPartAcc.sValue = DoubleToString(0, 2)
|
||||
Dim NextPartRef1 As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_REF1)
|
||||
NextPartRef1.sValue = DoubleToString(0, 2)
|
||||
Dim NextPartRef2 As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NEXTPART_REF2)
|
||||
NextPartRef2.sValue = DoubleToString(0, 2)
|
||||
'DebugMessage(1, "Imposto larghezza: " & MyMachGroup.dW)
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function SendNextProgram() As Boolean
|
||||
Dim bSent As Boolean = False
|
||||
If (CurrentMachine.NCType = NCTypes.TPA AndAlso Not m_bStartPending AndAlso Tpa.opState = MachineOperatingState.Pending) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM AndAlso Not Num_Flexium.bIsTransferActive) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER AndAlso Not Num_Axium_APServer.bIsTransferActive) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso Not Num_Axium_PCToolkit.bIsTransferActive) Then ' Or Tpa.opState = MachineOperatingState.Start) Then
|
||||
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso Not Num_Axium_PCToolkit.bIsTransferActive) OrElse
|
||||
CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then ' Or Tpa.opState = MachineOperatingState.Start) Then
|
||||
' verifico se c'e' un programma da lanciare
|
||||
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
Dim bMachGroupNotReady As Boolean = False
|
||||
SyncLock m_Lock_SendProgram
|
||||
For Each MyMachGroup As MyMachGroupVM In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList
|
||||
If Not MyMachGroup.bSentToMachine AndAlso (MyMachGroup.dtStartTime = DateTime.MinValue OrElse
|
||||
DebugMessage(1, "Ciclo alla ricerca di un programma da mandare")
|
||||
' EgtOutLog("Ciclo su name: " & MyMachGroup.Name & " id: " & MyMachGroup.Id)
|
||||
If Not MyMachGroup.bSentToMachine AndAlso (If(CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7, MyMachGroup.dtStartTime = DateTime.MinValue, MyMachGroup.dtEndTime = DateTime.MinValue) OrElse
|
||||
(Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL AndAlso MyMachGroup.bResetWhileCutting)) Then
|
||||
' verifico se ricalcolo finito
|
||||
If MyMachGroup.bReadyForMachining AndAlso If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER OrElse CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT, Not MyMachGroup.bSendingToMachine, True) Then
|
||||
' lo lancio
|
||||
bSent = SendProgram(MyMachGroup.CnFilePath(), MyMachGroup.Name)
|
||||
DebugMessage(1, "Eseguo SendProgram")
|
||||
bSent = SendProgram(MyMachGroup.CnFilePath(), MyMachGroup.Name, MyMachGroup)
|
||||
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " mandato " & DateTime.Now() & " " & MyMachGroup.Name & " " & bSent.ToString())
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.TPA
|
||||
Case NCTypes.TPA, NCTypes.SIEMENS_SHARP7
|
||||
MyMachGroup.SetSentToMachine(bSent)
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
MyMachGroup.SetSendingToMachine(bSent)
|
||||
@@ -631,9 +877,25 @@ Public Class MachManaging
|
||||
End If
|
||||
Next
|
||||
End SyncLock
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso Not Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State < ItemState.WIP And x.bReadyForMachining) Then
|
||||
Dim ISONumVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_NUM)
|
||||
Dim nISONum As Integer = 0
|
||||
If Not Integer.TryParse(ISONumVariable.sValue, nISONum) Or nISONum <> 0 Then
|
||||
DebugMessage(1, "Resetto programma da inviare")
|
||||
ISONumVariable.sValue = 0
|
||||
' resetto variabili per prossima barra
|
||||
ResetNextBarVars()
|
||||
' do stop working
|
||||
Dim StopWorking As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = STOP_WORKING)
|
||||
StopWorking.sValue = "1"
|
||||
End If
|
||||
End If
|
||||
'If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
' SetNextBarVars()
|
||||
'End If
|
||||
If bMachGroupNotReady Then Return False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return bSent
|
||||
End Function
|
||||
|
||||
@@ -744,6 +1006,24 @@ Public Class MachManaging
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
|
||||
Return
|
||||
End Try
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
Try
|
||||
m_CN = New SIEMENSSharp7Comm(Me)
|
||||
If Siemens_Sharp7.InitConnection() Then
|
||||
m_bConnected = True
|
||||
' imposto stato manuale
|
||||
Dim ManualMode As OPState = Map.refLeftPanelVM.OPModeList.FirstOrDefault(Function(x) x.Id = OPModes.Manual)
|
||||
Map.refLeftPanelVM.SetOPMode(ManualMode)
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
|
||||
Else
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
|
||||
Return
|
||||
End If
|
||||
' creo classe di gestione variabili
|
||||
Catch ex As Exception
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
|
||||
Return
|
||||
End Try
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -773,6 +1053,14 @@ Public Class MachManaging
|
||||
m_ResultCallbackDlg(CommandTypes.DISCONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
|
||||
' chiudo classe Num_Flexium
|
||||
Me.OnDispose()
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
m_bConnected = False
|
||||
If Not IsNothing(Siemens_Sharp7) Then
|
||||
Siemens_Sharp7.CloseConnection()
|
||||
End If
|
||||
m_ResultCallbackDlg(CommandTypes.DISCONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
|
||||
' chiudo classe Num_Flexium
|
||||
Me.OnDispose()
|
||||
End Select
|
||||
' termino thread di comunicazione
|
||||
MachineCommThread.StopThread()
|
||||
@@ -887,7 +1175,7 @@ Public Class MachManaging
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Public Function SendProgram(ProgramPath As String, ProgramId As String) As Boolean
|
||||
Public Function SendProgram(ProgramPath As String, ProgramId As String, Optional MyMachGroup As MyMachGroupVM = Nothing) As Boolean
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.TPA
|
||||
If Tpa.opState = MachineOperatingState.Pending Then
|
||||
@@ -917,6 +1205,39 @@ Public Class MachManaging
|
||||
Num_Axium_PCToolkit.FileDownload(nFileType * 10, ProgramPath)
|
||||
End If
|
||||
Return True
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
' EgtOutLog("Pre Download")
|
||||
Dim nFileType As Integer = 0
|
||||
If Integer.TryParse(ProgramId, nFileType) AndAlso nFileType > 0 Then
|
||||
Dim sDestDir As String = ""
|
||||
GetPrivateProfileString(S_GENERAL, K_ISOFILEDIR, "c:/Saomad/ISO", sDestDir, CurrentMachine.sMachIniFile)
|
||||
DebugMessage(1, "Copio programma")
|
||||
File.Copy(ProgramPath, sDestDir & "\" & nFileType & ".mpf", True)
|
||||
' copio POSIZ file
|
||||
Dim sPosizPath As String = Path.GetDirectoryName(ProgramPath) & "\" & Path.GetFileNameWithoutExtension(ProgramPath) & "_POSIZ.mpf"
|
||||
File.Copy(sPosizPath, sDestDir & "\" & nFileType & "_POSIZ.mpf", True)
|
||||
' se primo dopo start
|
||||
If m_bFirstRaw Then
|
||||
m_bFirstRaw = False
|
||||
DebugMessage(1, "Primo grezzo")
|
||||
' annullo step di ripartenza
|
||||
If Not Map.refMachManaging.Siemens_Sharp7.ResetStep(Not (MyMachGroup.dtStartTime <> DateTime.MinValue OrElse MyMachGroup.nProduction_State = ItemState.WIP)) Then Return False
|
||||
End If
|
||||
' imposto larghezza barra
|
||||
Dim WCarico As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = W_CARICO)
|
||||
WCarico.sValue = DoubleToString(MyMachGroup.dW, 1)
|
||||
DebugMessage(1, "Imposto larghezza: " & MyMachGroup.dW)
|
||||
' resetto eventuale stop working
|
||||
Dim StopWorking As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = STOP_WORKING)
|
||||
If StopWorking.sValue = "1" Then
|
||||
StopWorking.sValue = "0"
|
||||
End If
|
||||
' imposto numero programma scritto
|
||||
Dim ISONumVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_NUM)
|
||||
DebugMessage(1, "Imposto programma inviato: " & nFileType)
|
||||
ISONumVariable.sValue = nFileType
|
||||
End If
|
||||
Return True
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
@@ -1009,6 +1330,13 @@ Public Class MachManaging
|
||||
Case CommVar.Types.CN
|
||||
Num_Axium_PCToolkit.WriteNCVariables(Address, Value)
|
||||
End Select
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
Select Case Type
|
||||
Case CommVar.Types.PLC
|
||||
Siemens_Sharp7.WriteVariable(Address, Value)
|
||||
'Case CommVar.Types.CN
|
||||
' Num_Axium_PCToolkit.WriteNCVariables(Address, Value)
|
||||
End Select
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -1024,6 +1352,8 @@ Public Class MachManaging
|
||||
Return NUMAxiumComm.InitVar(NewVar)
|
||||
Case NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
Return NUMAxiumPcToolkitComm.InitVar(NewVar)
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
Return SIEMENSSharp7Comm.InitVar(NewVar)
|
||||
End Select
|
||||
Return Nothing
|
||||
End Function
|
||||
@@ -1116,4 +1446,14 @@ Public Class MachManaging
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#Region "Debug"
|
||||
|
||||
Friend Sub DebugMessage(nLevel As Integer, sMessage As String)
|
||||
If m_Debug >= nLevel Then
|
||||
EgtOutLog(sMessage)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Debug
|
||||
|
||||
End Class
|
||||
|
||||
@@ -21,7 +21,7 @@ Class MachineCommThread
|
||||
Private Shared sResetVarName As String = "0.FUNM.E80048"
|
||||
|
||||
Public Shared Sub MachManagingThreadFunction(ResultCallbackDlg As ResultCallbackDlg, CloseCallbackDlg As CloseCallbackDlg, UpdateCallbackDlg As UpdateCallbackDlg,
|
||||
TPAAlarmCallbackDlg As TPAAlarmCallbackDlg, NUMAlarmCallbackDlg As NUMAlarmCallbackDlg, AxisCoordinatesCallbackDlg As AxisCoordinatesCallbackDlg,
|
||||
TPAAlarmCallbackDlg As TPAAlarmCallbackDlg, NUMAlarmCallbackDlg As NUMAlarmCallbackDlg, SiemensAlarmCallbackDlg As SiemensAlarmCallbackDlg, AxisCoordinatesCallbackDlg As AxisCoordinatesCallbackDlg,
|
||||
OpStateCallbackDlg As OpStateCallbackDlg, OpModeCallbackDlg As OpModeCallbackDlg, ChannelCallbackDlg As ChannelCallbackDlg,
|
||||
ReadVarCallbackDlg As ReadVarCallbackDlg)
|
||||
' inizializzo callback
|
||||
@@ -30,6 +30,7 @@ Class MachineCommThread
|
||||
m_UpdateCallbackDlg = UpdateCallbackDlg
|
||||
m_TPAAlarmCallbackDlg = TPAAlarmCallbackDlg
|
||||
m_NUMAlarmCallbackDlg = NUMAlarmCallbackDlg
|
||||
m_SiemensAlarmCallbackDlg = SiemensAlarmCallbackDlg
|
||||
m_AxisCoordinatesCallbackDlg = AxisCoordinatesCallbackDlg
|
||||
m_OpStateCallbackDlg = OpStateCallbackDlg
|
||||
m_OpModeCallbackDlg = OpModeCallbackDlg
|
||||
|
||||
@@ -169,7 +169,7 @@ Public Class MainMenuVM
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub SetInputOutputVisibility()
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
If CurrentMachine.NCType = NCTypes.TPA OrElse CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
m_Inputs_Visibility = Visibility.Collapsed
|
||||
m_Outputs_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
|
||||
@@ -70,5 +70,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("3.1.5.1")>
|
||||
<Assembly: AssemblyFileVersion("3.1.5.1")>
|
||||
<Assembly: AssemblyVersion("3.1.4.7")>
|
||||
<Assembly: AssemblyFileVersion("3.1.4.7")>
|
||||
|
||||
@@ -10,8 +10,6 @@ Public Class OpenProjectFileDialogVM
|
||||
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||
m_ProjectType = ProjectType
|
||||
m_GoToProd = GoToProd
|
||||
'' carico colonne
|
||||
'LoadColumns()
|
||||
NotifyPropertyChanged(NameOf(FilterTypeList))
|
||||
m_SelFilterType = m_FilterTypeList(0)
|
||||
' carico lista progetti
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<Window x:Class="RestartRawPartV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:EgtBEAMWALL.Supervisor"
|
||||
mc:Ignorable="d"
|
||||
Title="RestartRawPartV" Height="450" Width="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class RestartRawPartV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class RestartRawPartVM
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,12 @@
|
||||
<Window x:Class="RestartWndV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:EgtBEAMWALL.Supervisor"
|
||||
mc:Ignorable="d"
|
||||
Title="RestartWndV" Height="450" Width="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class RestartWndV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class RestartWndVM
|
||||
|
||||
End Class
|
||||
@@ -60,7 +60,9 @@ Public Class MySceneHostVM
|
||||
' Imposto direttorio ausiliario per import/gestione BTL
|
||||
Dim sBtlAuxDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_IMPORT, K_BTLAUXDIR, "", sBtlAuxDir)
|
||||
EgtSetBtlAuxDir(sBtlAuxDir)
|
||||
If Not EgtSetBtlAuxDir(sBtlAuxDir) Then
|
||||
EgtOutLog("Missing BtlAuxDir path! Will be impossible to load Variant!")
|
||||
End If
|
||||
' inizializzo gestore travi e pareti
|
||||
EgtInitBeamMgr(EIB_FL.TS3_POS + EIB_FL.USEUATTR)
|
||||
' inizializzo gestore lavorazioni
|
||||
|
||||
@@ -182,6 +182,8 @@ Public Module CurrentMachine
|
||||
m_sTs3DataFile = If(File.Exists(sBeamTs3DataFile), sBeamTs3DataFile, sWallTs3DataFile)
|
||||
End If
|
||||
End If
|
||||
' leggo tipo di avanzamento pezzi
|
||||
m_Flow = GetPrivateProfileInt(S_GENERAL, K_FLOW, 1, m_sMachIniFile)
|
||||
' Impostazione path Script dir
|
||||
m_sMachScriptDir = sMachinesRootDir & "\" & sMachineName & "\" & K_SCRIPT
|
||||
' Impostazione path Setup dir
|
||||
@@ -304,6 +306,8 @@ Public Module CurrentMachine
|
||||
Map.refLeftPanelVM.LoadOPModes()
|
||||
' Imposto visibilità variabili E80000
|
||||
Map.refLeftPanelVM.SetE80000Visibility()
|
||||
' Imposto visibilita' assi
|
||||
Map.refLeftPanelVM.SetAxisVisibility()
|
||||
End Sub
|
||||
|
||||
#End Region 'Init
|
||||
|
||||
@@ -45,6 +45,7 @@ Global
|
||||
{4BD87FB8-9D12-46E3-ABCB-6576415BCE9A}.Release|x86.ActiveCfg = Release|x86
|
||||
{4BD87FB8-9D12-46E3-ABCB-6576415BCE9A}.Release|x86.Build.0 = Release|x86
|
||||
{4BD87FB8-9D12-46E3-ABCB-6576415BCE9A}.RemoteDebug|x86.ActiveCfg = Debug|x86
|
||||
{4BD87FB8-9D12-46E3-ABCB-6576415BCE9A}.RemoteDebug|x86.Build.0 = Debug|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user