Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f0fd32470 | |||
| a257412294 | |||
| daabc36730 | |||
| 503616820b | |||
| 84863dc5d5 | |||
| 0e09b44db3 | |||
| ef883cb163 | |||
| 7934ad8fd5 | |||
| 2631c94c03 | |||
| 5db3c25d77 | |||
| ba92a9098d | |||
| ee58cd36f0 | |||
| 1fae546b34 | |||
| 00dbe5f522 | |||
| e4b20c596a | |||
| b76ddfd303 | |||
| fa120a280c | |||
| 99bcefcfe8 | |||
| 704a4becb4 | |||
| b3d50be2f9 | |||
| 629d16b4f1 | |||
| ea551e25e5 | |||
| ff180ec2a4 | |||
| 3b6accaa20 | |||
| 80bcd2f225 | |||
| 40970b417a |
@@ -14,6 +14,7 @@
|
|||||||
Public Const START_GEOM = "Start"
|
Public Const START_GEOM = "Start"
|
||||||
Public Const RIB_EXTRUSION = "RibExtrusion"
|
Public Const RIB_EXTRUSION = "RibExtrusion"
|
||||||
Public Const RIB_CURVE = "RibCurve"
|
Public Const RIB_CURVE = "RibCurve"
|
||||||
|
Public Const RIB_ID = "RibId"
|
||||||
Public Const VIEWPARAMS = "ViewParams"
|
Public Const VIEWPARAMS = "ViewParams"
|
||||||
Public Const IMPORTED_SOLID = "ImportedSolid"
|
Public Const IMPORTED_SOLID = "ImportedSolid"
|
||||||
Public Const RESULT_READ_PROG = "ResultReadProg"
|
Public Const RESULT_READ_PROG = "ResultReadProg"
|
||||||
@@ -106,6 +107,7 @@
|
|||||||
Public Const MAC_RIBSLINK = "RibsLink"
|
Public Const MAC_RIBSLINK = "RibsLink"
|
||||||
Public Const MAC_RIBSINVERTORDER = "RibsInvertOrder"
|
Public Const MAC_RIBSINVERTORDER = "RibsInvertOrder"
|
||||||
Public Const MAC_RIBSINVERTDIRECTION = "RibsInvertDirection"
|
Public Const MAC_RIBSINVERTDIRECTION = "RibsInvertDirection"
|
||||||
|
Public Const MAC_RIBSINVERTSTRANDORDER = "RibsInvertStrandOrder"
|
||||||
Public Const MAC_RIBSLEADININVERT = "RibsLeadInInvert"
|
Public Const MAC_RIBSLEADININVERT = "RibsLeadInInvert"
|
||||||
Public Const MAC_RIBSLEADINLEN = "RibsLeadInLen"
|
Public Const MAC_RIBSLEADINLEN = "RibsLeadInLen"
|
||||||
Public Const MAC_RIBSLEADOUTINVERT = "RibsLeadOutInvert"
|
Public Const MAC_RIBSLEADOUTINVERT = "RibsLeadOutInvert"
|
||||||
@@ -127,6 +129,7 @@
|
|||||||
Public Const MAC_AUXSOLIDSWIPELEN = "AuxSolidsWipeLen"
|
Public Const MAC_AUXSOLIDSWIPELEN = "AuxSolidsWipeLen"
|
||||||
Public Const MAC_AUXSOLIDSWIPEDIR = "AuxSolidsWipeDir"
|
Public Const MAC_AUXSOLIDSWIPEDIR = "AuxSolidsWipeDir"
|
||||||
Public Const MAC_DYNAMICMODE = "DynamicMode"
|
Public Const MAC_DYNAMICMODE = "DynamicMode"
|
||||||
|
Public Const MAC_PRINTORDER = "PrintOrder"
|
||||||
Public Const MAC_CONSTANT = "Constant"
|
Public Const MAC_CONSTANT = "Constant"
|
||||||
Public Const MAC_MATERIALS = "Materials"
|
Public Const MAC_MATERIALS = "Materials"
|
||||||
|
|
||||||
@@ -151,11 +154,19 @@
|
|||||||
' materiale in progetto
|
' materiale in progetto
|
||||||
Public Const KEY_MATERIAL_GUID = "MaterialGuid"
|
Public Const KEY_MATERIAL_GUID = "MaterialGuid"
|
||||||
Public Const KEY_MATERIAL_NAME = "MaterialName"
|
Public Const KEY_MATERIAL_NAME = "MaterialName"
|
||||||
|
|
||||||
' nome file cn in progetto
|
' nome file cn in progetto
|
||||||
Public Const KEY_ISOFILE_PATH = "IsoFilePath"
|
Public Const KEY_ISOFILE_PATH = "IsoFilePath"
|
||||||
|
|
||||||
|
' info di spostamento pezzo per 45 gradi
|
||||||
|
Public Const KEY_MOVEDPART = "MovedPart"
|
||||||
|
Public Const KEY_MOVEDPART2 = "MovedPart2"
|
||||||
|
|
||||||
Public Const FILE_PATH = "FilePath"
|
Public Const FILE_PATH = "FilePath"
|
||||||
Public Const PART_NAME = "PartName"
|
Public Const PART_NAME = "PartName"
|
||||||
Public Const ENTITY_NAME = "EntityName"
|
Public Const ENTITY_NAME = "EntityName"
|
||||||
|
|
||||||
|
' stringa che identifica il materiale come originale del costruttore
|
||||||
|
Public Const ORIG_MATERIAL As String = "***"
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports System.Collections.Specialized
|
||||||
Imports System.ComponentModel
|
Imports System.ComponentModel
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
@@ -150,7 +151,7 @@ Public Class CurrMachining
|
|||||||
|
|
||||||
Friend Overrides Sub OnMachiningParamPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
Friend Overrides Sub OnMachiningParamPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||||
Select Case e.PropertyName
|
Select Case e.PropertyName
|
||||||
Case NameOf(sender.dValue), NameOf(sender.sValue), NameOf(sender.bValue), NameOf(sender.SelValue)
|
Case NameOf(sender.dValue), NameOf(sender.sValue), NameOf(sender.bValue), NameOf(sender.SelValue), NameOf(sender.Value)
|
||||||
m_bIsModified = m_CathegoryList.Any(Function(x) x.MachiningParamList.Any(Function(y) y.bIsModified))
|
m_bIsModified = m_CathegoryList.Any(Function(x) x.MachiningParamList.Any(Function(y) y.bIsModified))
|
||||||
NotifyPropertyChanged(NameOf(ghName))
|
NotifyPropertyChanged(NameOf(ghName))
|
||||||
NotifyPropertyChanged(NameOf(sCurrSlicingType))
|
NotifyPropertyChanged(NameOf(sCurrSlicingType))
|
||||||
@@ -158,9 +159,25 @@ Public Class CurrMachining
|
|||||||
NotifyPropertyChanged(NameOf(sCurrStrandW))
|
NotifyPropertyChanged(NameOf(sCurrStrandW))
|
||||||
NotifyPropertyChanged(NameOf(sCurrStrandCount))
|
NotifyPropertyChanged(NameOf(sCurrStrandCount))
|
||||||
NotifyPropertyChanged(NameOf(sCurrOffset))
|
NotifyPropertyChanged(NameOf(sCurrOffset))
|
||||||
|
sender.NotifyPropertyChanged(NameOf(sender.bIsModifiedFromDb))
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Friend Overrides Sub Save()
|
||||||
|
If bIsModified Then
|
||||||
|
' salvo tutti i parametri su orig
|
||||||
|
SaveParams()
|
||||||
|
' resetto stato di modificata
|
||||||
|
UpdateIsModified()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Overrides Sub SaveParams()
|
||||||
|
For Each Cathegory In m_CathegoryList
|
||||||
|
Cathegory.SaveParams()
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Sub WriteCurrParamInPart(nPartId As Integer)
|
Friend Sub WriteCurrParamInPart(nPartId As Integer)
|
||||||
EgtSetInfo(nPartId, MAC_GUID, m_sCurrGUID.ToString())
|
EgtSetInfo(nPartId, MAC_GUID, m_sCurrGUID.ToString())
|
||||||
For Each Cathegory As CurrMachiningCathegory In m_CathegoryList
|
For Each Cathegory As CurrMachiningCathegory In m_CathegoryList
|
||||||
@@ -197,7 +214,8 @@ Public Class CurrMachiningCathegory
|
|||||||
New CurrNumericMachiningParam(MachiningParam.Params.G0FEEDZ, nPartId, nIndex, bForceFromDb),
|
New CurrNumericMachiningParam(MachiningParam.Params.G0FEEDZ, nPartId, nIndex, bForceFromDb),
|
||||||
New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, nPartId, nIndex, bForceFromDb),
|
New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, nPartId, nIndex, bForceFromDb),
|
||||||
New CurrNumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nPartId, nIndex, bForceFromDb),
|
New CurrNumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nPartId, nIndex, bForceFromDb),
|
||||||
New CurrComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nPartId, nIndex, bForceFromDb)})
|
New CurrComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nPartId, nIndex, bForceFromDb),
|
||||||
|
New CurrOrderedMachiningParam(MachiningParam.Params.PRINT_ORDER, nPartId, nIndex, bForceFromDb)})
|
||||||
Case Cathegories.LINK
|
Case Cathegories.LINK
|
||||||
m_sName = "Shell"
|
m_sName = "Shell"
|
||||||
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.LINKTYPE, nPartId, nIndex, bForceFromDb),
|
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.LINKTYPE, nPartId, nIndex, bForceFromDb),
|
||||||
@@ -223,6 +241,7 @@ Public Class CurrMachiningCathegory
|
|||||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLINK, nPartId, nIndex, bForceFromDb),
|
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLINK, nPartId, nIndex, bForceFromDb),
|
||||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nPartId, nIndex, bForceFromDb),
|
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nPartId, nIndex, bForceFromDb),
|
||||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nPartId, nIndex, bForceFromDb),
|
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nPartId, nIndex, bForceFromDb),
|
||||||
|
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTSTRANDORDER, nPartId, nIndex, bForceFromDb),
|
||||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nPartId, nIndex, bForceFromDb),
|
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nPartId, nIndex, bForceFromDb),
|
||||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nPartId, nIndex, bForceFromDb),
|
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nPartId, nIndex, bForceFromDb),
|
||||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nPartId, nIndex, bForceFromDb),
|
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nPartId, nIndex, bForceFromDb),
|
||||||
@@ -250,12 +269,6 @@ Public Class CurrMachiningCathegory
|
|||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub SaveCurrParams()
|
|
||||||
For Each Param In m_MachiningParamList
|
|
||||||
Param.SaveParam()
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub ResetCurrParams()
|
Friend Sub ResetCurrParams()
|
||||||
For Each Param In m_MachiningParamList
|
For Each Param In m_MachiningParamList
|
||||||
Param.ResetParam()
|
Param.ResetParam()
|
||||||
@@ -903,6 +916,8 @@ Public Class CurrCheckMachiningParam
|
|||||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTORDER, m_bValue)
|
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTORDER, m_bValue)
|
||||||
Case Params.RIBSINVERTDIRECTION
|
Case Params.RIBSINVERTDIRECTION
|
||||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bValue)
|
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bValue)
|
||||||
|
Case Params.RIBSINVERTSTRANDORDER
|
||||||
|
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTSTRANDORDER, m_bValue)
|
||||||
Case Params.RIBSLEADININVERT
|
Case Params.RIBSLEADININVERT
|
||||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bValue)
|
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bValue)
|
||||||
Case Params.RIBSLEADOUTINVERT
|
Case Params.RIBSLEADOUTINVERT
|
||||||
@@ -914,7 +929,7 @@ Public Class CurrCheckMachiningParam
|
|||||||
Select Case Type
|
Select Case Type
|
||||||
Case Params.SPIRALVASE
|
Case Params.SPIRALVASE
|
||||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||||
Case Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT
|
Case Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSINVERTSTRANDORDER, Params.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT
|
||||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||||
End Select
|
End Select
|
||||||
If bForceFromDb OrElse Not bReadFromPart Then
|
If bForceFromDb OrElse Not bReadFromPart Then
|
||||||
@@ -934,6 +949,8 @@ Public Class CurrCheckMachiningParam
|
|||||||
EgtSetInfo(nPartId, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0))
|
EgtSetInfo(nPartId, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0))
|
||||||
Case Params.RIBSINVERTDIRECTION
|
Case Params.RIBSINVERTDIRECTION
|
||||||
EgtSetInfo(nPartId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
|
EgtSetInfo(nPartId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
|
||||||
|
Case Params.RIBSINVERTSTRANDORDER
|
||||||
|
EgtSetInfo(nPartId, MAC_RIBSINVERTSTRANDORDER, If(m_bValue, 1, 0))
|
||||||
Case Params.RIBSLEADININVERT
|
Case Params.RIBSLEADININVERT
|
||||||
EgtSetInfo(nPartId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
|
EgtSetInfo(nPartId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
|
||||||
Case Params.RIBSLEADOUTINVERT
|
Case Params.RIBSLEADOUTINVERT
|
||||||
@@ -975,3 +992,107 @@ Public Class CurrCheckMachiningParam
|
|||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
Public Class CurrOrderedMachiningParam
|
||||||
|
Inherits OrderedMachiningParam
|
||||||
|
|
||||||
|
Private m_DbParam As OrderedMachiningParam
|
||||||
|
Public ReadOnly Property DbParam As OrderedMachiningParam
|
||||||
|
Get
|
||||||
|
Return m_DbParam
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property bIsModifiedFromDb As Boolean
|
||||||
|
Get
|
||||||
|
Return If(Map.refTopPanelVM.SelMachining.sGUID <> Guid.Empty, Value <> m_DbParam.Value, False)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' Definizione comandi
|
||||||
|
Private m_cmdResetParam As ICommand
|
||||||
|
|
||||||
|
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
|
||||||
|
MyBase.New(Type, nIndex)
|
||||||
|
Dim bReadFromPart As Boolean = False
|
||||||
|
Select Case Type
|
||||||
|
Case Params.PRINT_ORDER
|
||||||
|
m_StandardValueOrderList = New List(Of Integer)({Machining.MPAR_PRINT_ORDER.SHELL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.EXTRA_SHELL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.INFILL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.AUX_SOLID,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_INTERNAL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_SUPPORT})
|
||||||
|
m_ValueList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shells"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infills"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Ribs"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Ribs"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Ribs"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Ribs")})
|
||||||
|
Dim sValue As String = ""
|
||||||
|
bReadFromPart = EgtGetInfo(nPartId, MAC_PRINTORDER, sValue)
|
||||||
|
Value = sValue
|
||||||
|
End Select
|
||||||
|
m_OrigValue = Value
|
||||||
|
If nIndex > 0 Then
|
||||||
|
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
|
||||||
|
Select Case Type
|
||||||
|
Case Params.PRINT_ORDER
|
||||||
|
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||||
|
End Select
|
||||||
|
If bForceFromDb OrElse Not bReadFromPart Then
|
||||||
|
Value = m_DbParam.OrigValue
|
||||||
|
m_OrigValue = m_DbParam.OrigValue
|
||||||
|
End If
|
||||||
|
ElseIf Type = Params.PRINT_ORDER AndAlso Not bReadFromPart Then
|
||||||
|
Value = ""
|
||||||
|
m_OrigValue = Value
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Overrides Sub WriteParamInPart(nPartId As Integer)
|
||||||
|
Select Case Type
|
||||||
|
Case Params.PRINT_ORDER
|
||||||
|
EgtSetInfo(nPartId, MAC_PRINTORDER, Value)
|
||||||
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Overrides Sub SaveParam()
|
||||||
|
m_OrigValue = Value
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Overrides Sub ResetParam()
|
||||||
|
Value = m_OrigValue
|
||||||
|
m_SelValue = Nothing
|
||||||
|
NotifyPropertyChanged(NameOf(ValueList))
|
||||||
|
NotifyPropertyChanged(NameOf(SelValue))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#Region "COMMANDS"
|
||||||
|
|
||||||
|
#Region "ResetParam"
|
||||||
|
|
||||||
|
Public ReadOnly Property ResetParam_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdResetParam Is Nothing Then
|
||||||
|
m_cmdResetParam = New Command(AddressOf ResetParamCmd)
|
||||||
|
End If
|
||||||
|
Return m_cmdResetParam
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub ResetParamCmd()
|
||||||
|
Value = DbParam.OrigValue
|
||||||
|
NotifyPropertyChanged(NameOf(Value))
|
||||||
|
NotifyPropertyChanged(NameOf(SelValue))
|
||||||
|
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' ResetParam
|
||||||
|
|
||||||
|
#End Region ' COMMANDS
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
<ItemsControl ItemsSource="{Binding MachiningParamList}">
|
<ItemsControl ItemsSource="{Binding MachiningParamList}">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<UniformGrid Columns="1"
|
<StackPanel Orientation="Vertical"/>
|
||||||
HorizontalAlignment="Stretch"/>
|
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.Resources>
|
<ItemsControl.Resources>
|
||||||
@@ -118,6 +117,44 @@
|
|||||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Text="{Binding sName}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<ListBox Grid.Column="1"
|
||||||
|
ItemsSource="{Binding ValueList}"
|
||||||
|
SelectedItem="{Binding SelValue}"/>
|
||||||
|
<StackPanel Grid.Column="2"
|
||||||
|
Orientation="Vertical"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Margin="5,0,0,0">
|
||||||
|
<Button Content="˄"
|
||||||
|
Command="{Binding MoveUpOrder_Command}"
|
||||||
|
Margin="0"
|
||||||
|
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||||
|
<Button Content="˅"
|
||||||
|
Command="{Binding MoveDownOrder_Command}"
|
||||||
|
Margin="0"
|
||||||
|
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||||
|
<Button Content="<>"
|
||||||
|
Command="{Binding ResetOrder_Command}"
|
||||||
|
Margin="0"
|
||||||
|
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||||
|
<Button Content="R"
|
||||||
|
Command="{Binding ResetParam_Command}"
|
||||||
|
IsEnabled="{Binding bIsModifiedFromDb}"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
Margin="0"
|
||||||
|
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
</ItemsControl.Resources>
|
</ItemsControl.Resources>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</Expander>
|
</Expander>
|
||||||
|
|||||||
@@ -59,8 +59,23 @@ Public Class CurrMachiningPanelVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub Ok()
|
Public Sub Ok()
|
||||||
|
' verifico se modificata tipologia Ribs
|
||||||
|
Dim bIsModifiedRibsType As Boolean = False
|
||||||
|
Dim RibsCathegory As MachiningCathegory = CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.RIBS)
|
||||||
|
If Not IsNothing(RibsCathegory) Then
|
||||||
|
Dim RibsTypeParam As MachiningParam = RibsCathegory.MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.RIBSTYPE)
|
||||||
|
If Not IsNothing(RibsTypeParam) Then
|
||||||
|
bIsModifiedRibsType = RibsTypeParam.bIsModified
|
||||||
|
End If
|
||||||
|
End If
|
||||||
' scrivo i parametri modificati
|
' scrivo i parametri modificati
|
||||||
m_CurrMachining.WriteCurrParamInPart(Map.refTopPanelVM.SelPart.nPartId)
|
m_CurrMachining.WriteCurrParamInPart(Map.refTopPanelVM.SelPart.nPartId)
|
||||||
|
m_CurrMachining.Save()
|
||||||
|
' se modificata tipologia Ribs, aggiorno posizione riferimento
|
||||||
|
If bIsModifiedRibsType Then
|
||||||
|
Map.refReferencePanelVM.UpdateFramePosition()
|
||||||
|
Map.refDispositionPanelVM.UpdateZPos()
|
||||||
|
End If
|
||||||
' ripristino modalita' standard
|
' ripristino modalita' standard
|
||||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -28,12 +28,6 @@
|
|||||||
Content="Move"
|
Content="Move"
|
||||||
IsChecked="{Binding bMove_IsChecked}"
|
IsChecked="{Binding bMove_IsChecked}"
|
||||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||||
<!--<Border Background="Red"
|
|
||||||
Grid.Column="1"
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.RowSpan="5"
|
|
||||||
Width="50"
|
|
||||||
VerticalAlignment="Stretch"/>-->
|
|
||||||
|
|
||||||
<Border x:Name="PopupBrd"
|
<Border x:Name="PopupBrd"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
@@ -97,77 +91,12 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=MoveBtn}"
|
|
||||||
PlacementTarget="{Binding ElementName=MoveBtn}"
|
|
||||||
Style="{StaticResource LeftPanel_Popup}">
|
|
||||||
<Border x:Name="PopupBrd" Style="{StaticResource LeftPanelPopup_Border}">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid Margin="0,0,0,2.5">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Text="X"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
<EgtWPFLib5:EgtTextBox Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
|
||||||
</Grid>
|
|
||||||
<Grid Grid.Row="1"
|
|
||||||
Margin="0,2.5,0,2.5">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Text="Y"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
<EgtWPFLib5:EgtTextBox Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
|
||||||
</Grid>
|
|
||||||
<Grid Grid.Row="2"
|
|
||||||
Margin="0,2.5,0,0">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Text="Z"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
<EgtWPFLib5:EgtTextBox Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
|
||||||
</Grid>
|
|
||||||
<Grid Grid.Row="3"
|
|
||||||
Margin="0,2.5,0,0">
|
|
||||||
<Button Content="Drag"
|
|
||||||
Command="{Binding DragMove_Command}"
|
|
||||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</Popup>-->
|
|
||||||
|
|
||||||
<ToggleButton x:Name="RotateBtn"
|
<ToggleButton x:Name="RotateBtn"
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
Content="Rotate"
|
Content="Rotate"
|
||||||
IsChecked="{Binding bRotate_IsChecked}"
|
IsChecked="{Binding bRotate_IsChecked}"
|
||||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||||
<!--<Border Background="Blue"
|
|
||||||
Grid.Column="2"
|
|
||||||
Grid.Row="2"
|
|
||||||
Grid.RowSpan="5"
|
|
||||||
Width="50"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
HorizontalAlignment="Stretch"/>-->
|
|
||||||
|
|
||||||
<Border Grid.Column="1"
|
<Border Grid.Column="1"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
@@ -209,42 +138,4 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=RotateBtn}"
|
|
||||||
Grid.Column="1"
|
|
||||||
PlacementTarget="{Binding ElementName=RotateBtn}"
|
|
||||||
Style="{StaticResource LeftPanel_Popup}">
|
|
||||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<UniformGrid Columns="3">
|
|
||||||
<RadioButton Content="X"
|
|
||||||
GroupName="Axes"
|
|
||||||
IsChecked="{Binding RotAxes[0]}"
|
|
||||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
|
||||||
<RadioButton Content="Y"
|
|
||||||
GroupName="Axes"
|
|
||||||
IsChecked="{Binding RotAxes[1]}"
|
|
||||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
|
||||||
<RadioButton Content="Z"
|
|
||||||
GroupName="Axes"
|
|
||||||
IsChecked="{Binding RotAxes[2]}"
|
|
||||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
|
||||||
</UniformGrid>
|
|
||||||
<EgtWPFLib5:EgtTextBox Grid.Row="1"
|
|
||||||
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
|
|
||||||
Margin="0,5,0,0"/>
|
|
||||||
<Grid Grid.Row="2"
|
|
||||||
Margin="0,2.5,0,0">
|
|
||||||
<Button Content="Drag"
|
|
||||||
Command="{Binding DragRotate_Command}"
|
|
||||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</Popup>-->
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -20,13 +20,27 @@ Public Class DispositionPanelVM
|
|||||||
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
|
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
|
||||||
Dim dNewXPos As Double = ptReference.x
|
Dim dNewXPos As Double = ptReference.x
|
||||||
StringToLen(value, dNewXPos)
|
StringToLen(value, dNewXPos)
|
||||||
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
|
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
|
||||||
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
|
Dim dMin As Double = 0
|
||||||
Map.refReferencePanelVM.UpdateFramePosition()
|
Dim dMax As Double = CurrentMachine.b3Tab.DimX
|
||||||
EgtDraw()
|
If b3Print.Max.x > ptReference.x Then
|
||||||
Else
|
dMax -= b3Print.Max.x - ptReference.x
|
||||||
NotifyPropertyChanged(NameOf(sXPos))
|
|
||||||
End If
|
End If
|
||||||
|
If b3Print.Min.x < ptReference.x Then
|
||||||
|
dMin += ptReference.x - b3Print.Min.x
|
||||||
|
End If
|
||||||
|
' riduco a spostamento massimo
|
||||||
|
If dNewXPos < dMin Then
|
||||||
|
dNewXPos = dMin
|
||||||
|
ElseIf dNewXPos > dMax Then
|
||||||
|
dNewXPos = dMax
|
||||||
|
End If
|
||||||
|
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
|
||||||
|
Map.refReferencePanelVM.UpdateFramePosition()
|
||||||
|
EgtDraw()
|
||||||
|
NotifyPropertyChanged(NameOf(sXPos))
|
||||||
|
' Imposto flag di ricalcolo part-program
|
||||||
|
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -45,13 +59,27 @@ Public Class DispositionPanelVM
|
|||||||
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
|
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
|
||||||
Dim dNewYPos As Double = ptReference.y
|
Dim dNewYPos As Double = ptReference.y
|
||||||
StringToLen(value, dNewYPos)
|
StringToLen(value, dNewYPos)
|
||||||
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
|
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
|
||||||
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
|
Dim dMin As Double = 0
|
||||||
Map.refReferencePanelVM.UpdateFramePosition()
|
Dim dMax As Double = CurrentMachine.b3Tab.DimY
|
||||||
EgtDraw()
|
If b3Print.Max.y > ptReference.y Then
|
||||||
Else
|
dMax -= b3Print.Max.y - ptReference.y
|
||||||
NotifyPropertyChanged(NameOf(sYPos))
|
|
||||||
End If
|
End If
|
||||||
|
If b3Print.Min.y < ptReference.y Then
|
||||||
|
dMin += ptReference.y - b3Print.Min.y
|
||||||
|
End If
|
||||||
|
' riduco a spostamento massimo
|
||||||
|
If dNewYPos < dMin Then
|
||||||
|
dNewYPos = dMin
|
||||||
|
ElseIf dNewyPos > dMax Then
|
||||||
|
dNewYPos = dMax
|
||||||
|
End If
|
||||||
|
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
|
||||||
|
Map.refReferencePanelVM.UpdateFramePosition()
|
||||||
|
EgtDraw()
|
||||||
|
NotifyPropertyChanged(NameOf(sYPos))
|
||||||
|
' Imposto flag di ricalcolo part-program
|
||||||
|
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -70,16 +98,67 @@ Public Class DispositionPanelVM
|
|||||||
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
|
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
|
||||||
Dim dNewZPos As Double = ptReference.z
|
Dim dNewZPos As Double = ptReference.z
|
||||||
StringToLen(value, dNewZPos)
|
StringToLen(value, dNewZPos)
|
||||||
If dNewZPos >= 0 Then
|
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
|
||||||
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
|
Dim dMin As Double = 0
|
||||||
Map.refReferencePanelVM.UpdateFramePosition()
|
If b3Print.Min.z < ptReference.z Then
|
||||||
EgtDraw()
|
dMin += ptReference.z - b3Print.Min.z
|
||||||
Else
|
|
||||||
NotifyPropertyChanged(NameOf(sZPos))
|
|
||||||
End If
|
End If
|
||||||
|
' riduco a spostamento massimo
|
||||||
|
If dNewZPos < dMin Then
|
||||||
|
dNewZPos = dMin
|
||||||
|
End If
|
||||||
|
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
|
||||||
|
Map.refReferencePanelVM.UpdateFramePosition()
|
||||||
|
EgtDraw()
|
||||||
|
NotifyPropertyChanged(NameOf(sZPos))
|
||||||
|
' Imposto flag di ricalcolo part-program
|
||||||
|
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Friend Sub UpdateZPos()
|
||||||
|
Dim ptReference As New Point3d
|
||||||
|
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
|
||||||
|
Dim dNewZPos As Double = ptReference.z
|
||||||
|
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
|
||||||
|
Dim dMin As Double = 0
|
||||||
|
If b3Print.Min.z < ptReference.z Then
|
||||||
|
dMin += ptReference.z - b3Print.Min.z
|
||||||
|
End If
|
||||||
|
If ptReference.z < dMin Then
|
||||||
|
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dMin) - ptReference, GDB_RT.GLOB)
|
||||||
|
Map.refDispositionPanelVM.RefreshPos()
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
|
NotifyPropertyChanged(NameOf(sZPos))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' funzione che calcola il box totale del solido da stampare piu' ribs esterne ed unbounded
|
||||||
|
Friend Function GetSolidForReferenceBBox(SelPart As Print3dPartVM) As BBox3d
|
||||||
|
Dim b3Print As New BBox3d
|
||||||
|
EgtGetBBoxGlob(SelPart.nPrintSolidId, GDB_BB.EXACT, b3Print)
|
||||||
|
If EgtGetGroupObjs(SelPart.nRibsLayerId) > 0 Then
|
||||||
|
Dim b3Ribs As New BBox3d()
|
||||||
|
Dim nRibId As Integer = EgtGetFirstInGroup(SelPart.nRibsLayerId)
|
||||||
|
While nRibId <> GDB_ID.NULL
|
||||||
|
Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
|
||||||
|
If Not EgtGetInfo(nRibId, MAC_RIBSTYPE, nRibType) Then
|
||||||
|
EgtGetInfo(SelPart.nPartId, MAC_RIBSTYPE, nRibType)
|
||||||
|
End If
|
||||||
|
If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
|
||||||
|
Dim b3Rib As New BBox3d
|
||||||
|
EgtGetBBoxGlob(nRibId, GDB_BB.EXACT, b3Rib)
|
||||||
|
b3Ribs.Add(b3Rib)
|
||||||
|
End If
|
||||||
|
nRibId = EgtGetNext(nRibId)
|
||||||
|
End While
|
||||||
|
If Not b3Ribs.IsEmpty() Then
|
||||||
|
b3Print.Add(b3Ribs)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return b3Print
|
||||||
|
End Function
|
||||||
|
|
||||||
Private m_RotAxes As Boolean() = { False, False, False}
|
Private m_RotAxes As Boolean() = { False, False, False}
|
||||||
Public Property RotX As Boolean
|
Public Property RotX As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -131,19 +210,25 @@ Public Class DispositionPanelVM
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
Dim vtMovedPart As Vector3d
|
Dim vtMovedPart As Vector3d
|
||||||
if EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart", vtMovedPart) Then
|
If EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART, vtMovedPart) Then
|
||||||
Dim nEntId = EgtGetFirstInGroup( Map.refTopPanelVM.SelPart.nPrintSolidLayerId)
|
Dim nEntId = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.nPrintSolidLayerId)
|
||||||
While nEntId <> GDB_ID.NULL
|
While nEntId <> GDB_ID.NULL
|
||||||
EgtMove(nEntId, -vtMovedPart, GDB_RT.GLOB)
|
EgtMove(nEntId, -vtMovedPart, GDB_RT.GLOB)
|
||||||
nEntId = EgtGetNext( nEntId)
|
nEntId = EgtGetNext(nEntId)
|
||||||
End While
|
End While
|
||||||
EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart")
|
EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART)
|
||||||
|
End If
|
||||||
|
If EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART2, vtMovedPart) Then
|
||||||
|
EgtMove(Map.refTopPanelVM.SelPart.nPartId, -vtMovedPart, GDB_RT.GLOB)
|
||||||
|
EgtMove(Map.refTopPanelVM.SelPart.nReferenceId, vtMovedPart, GDB_RT.GLOB)
|
||||||
|
EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART2)
|
||||||
End If
|
End If
|
||||||
Dim b3PrintSolid As New BBox3d
|
Dim b3PrintSolid As New BBox3d
|
||||||
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid)
|
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid)
|
||||||
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
|
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
|
||||||
m_sRotAngle = 0
|
m_sRotAngle = 0
|
||||||
Map.refReferencePanelVM.UpdateFramePosition()
|
Map.refReferencePanelVM.UpdateFramePosition()
|
||||||
|
Map.refDispositionPanelVM.UpdateZPos()
|
||||||
RefreshPos()
|
RefreshPos()
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
NotifyPropertyChanged(NameOf(sRotAngle))
|
NotifyPropertyChanged(NameOf(sRotAngle))
|
||||||
@@ -221,6 +306,7 @@ Public Class DispositionPanelVM
|
|||||||
' seleziono percorso corrente
|
' seleziono percorso corrente
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
EgtSelectObj(Map.refTopPanelVM.SelPart.nPartId)
|
EgtSelectObj(Map.refTopPanelVM.SelPart.nPartId)
|
||||||
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub UpdateUI()
|
Friend Sub UpdateUI()
|
||||||
@@ -229,8 +315,9 @@ Public Class DispositionPanelVM
|
|||||||
m_bRotating = False
|
m_bRotating = False
|
||||||
' ripristino griglia
|
' ripristino griglia
|
||||||
EgtSetGridFrame(m_PrevGridOrigin)
|
EgtSetGridFrame(m_PrevGridOrigin)
|
||||||
EgtDraw()
|
|
||||||
End If
|
End If
|
||||||
|
EgtDeselectAll()
|
||||||
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub OnKeyDown(Key As Forms.Keys)
|
Friend Sub OnKeyDown(Key As Forms.Keys)
|
||||||
@@ -239,8 +326,9 @@ Public Class DispositionPanelVM
|
|||||||
m_bRotating = False
|
m_bRotating = False
|
||||||
' ripristino griglia
|
' ripristino griglia
|
||||||
EgtSetGridFrame(m_PrevGridOrigin)
|
EgtSetGridFrame(m_PrevGridOrigin)
|
||||||
EgtDraw()
|
|
||||||
End If
|
End If
|
||||||
|
EgtDeselectAll()
|
||||||
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -209,6 +209,10 @@
|
|||||||
<DependentUpon>RibPanelV.xaml</DependentUpon>
|
<DependentUpon>RibPanelV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="RibPanel\RibPanelVM.vb" />
|
<Compile Include="RibPanel\RibPanelVM.vb" />
|
||||||
|
<Compile Include="RibParamPanel\CopyFromWndV.xaml.vb">
|
||||||
|
<DependentUpon>CopyFromWndV.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="RibParamPanel\CopyFromWndVM.vb" />
|
||||||
<Compile Include="RibParamPanel\RibParamPanelV.xaml.vb">
|
<Compile Include="RibParamPanel\RibParamPanelV.xaml.vb">
|
||||||
<DependentUpon>RibParamPanelV.xaml</DependentUpon>
|
<DependentUpon>RibParamPanelV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -401,6 +405,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="RibParamPanel\CopyFromWndV.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="RibParamPanel\RibParamPanelV.xaml">
|
<Page Include="RibParamPanel\RibParamPanelV.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -1,15 +1,45 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports System.Drawing
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
|
Imports System.Reflection
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
|
Imports Icarus.ImportExportMachiningPanelVM
|
||||||
|
|
||||||
Public Class ImportExportMachiningPanelVM
|
Public Class ImportExportMachiningPanelVM
|
||||||
Inherits VMBase
|
Inherits VMBase
|
||||||
|
|
||||||
|
Private Const m_MaterialDataExtension As String = ".mtd"
|
||||||
|
Public Shared ReadOnly Property MaterialDataExtension As String
|
||||||
|
Get
|
||||||
|
Return m_MaterialDataExtension
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Private Const m_OriginalMaterialDataExtension As String = ".omtd"
|
||||||
|
Public Shared ReadOnly Property OriginalMaterialDataExtension As String
|
||||||
|
Get
|
||||||
|
Return m_OriginalMaterialDataExtension
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Private Const m_MachiningDataExtension As String = ".mcd"
|
||||||
|
Public Shared ReadOnly Property MachiningDataExtension As String
|
||||||
|
Get
|
||||||
|
Return m_MachiningDataExtension
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
' Modalita' di apertura della finestra
|
' Modalita' di apertura della finestra
|
||||||
Public Enum WindowModeEnum As Integer
|
Public Enum WindowModeEnum As Integer
|
||||||
IMPORT
|
IMPORT = 1
|
||||||
EXPORT
|
EXPORT = 2
|
||||||
|
IMPORT_ORIG = 3
|
||||||
|
EXPORT_ORIG = 4
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
' Tipo da importare/esportare
|
||||||
|
Public Enum WindowTypeEnum As Integer
|
||||||
|
MATERIAL = 1
|
||||||
|
MACHINING = 2
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
Private m_WindowMode As WindowModeEnum
|
Private m_WindowMode As WindowModeEnum
|
||||||
@@ -19,6 +49,13 @@ Public Class ImportExportMachiningPanelVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private m_WindowType As WindowTypeEnum
|
||||||
|
Public ReadOnly Property WindowType As WindowTypeEnum
|
||||||
|
Get
|
||||||
|
Return m_WindowType
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
' Lista delle lavorazioni
|
' Lista delle lavorazioni
|
||||||
Private m_MachiningList As New ObservableCollection(Of ImpExpMachiningItem)
|
Private m_MachiningList As New ObservableCollection(Of ImpExpMachiningItem)
|
||||||
Public Property MachiningList As ObservableCollection(Of ImpExpMachiningItem)
|
Public Property MachiningList As ObservableCollection(Of ImpExpMachiningItem)
|
||||||
@@ -85,22 +122,112 @@ Public Class ImportExportMachiningPanelVM
|
|||||||
#Region "CONSTRUCTOR"
|
#Region "CONSTRUCTOR"
|
||||||
|
|
||||||
' export
|
' export
|
||||||
Sub New()
|
Sub New(Type As WindowTypeEnum, Mode As WindowModeEnum, Optional sImportFilePath As String = "")
|
||||||
m_WindowMode = WindowModeEnum.EXPORT
|
m_WindowType = Type
|
||||||
|
ImpExpMachiningItem.SetWindowType(m_WindowType)
|
||||||
|
m_WindowMode = Mode
|
||||||
' carico lista lavorazioni
|
' carico lista lavorazioni
|
||||||
MachiningList.Clear()
|
MachiningList.Clear()
|
||||||
' leggo ed aggiungo le altre
|
Select Case Mode
|
||||||
Dim nIndex As Integer = 1
|
Case WindowModeEnum.IMPORT
|
||||||
Dim sGUID As String = ""
|
Select Case Type
|
||||||
Dim sName As String = ""
|
Case WindowTypeEnum.MATERIAL
|
||||||
Dim sMaterials As String = ""
|
m_ImportFilePath = sImportFilePath
|
||||||
While ReadMachiningParamString(nIndex, MAC_GUID, "", sGUID) > 0
|
' carico lista lavorazioni
|
||||||
Dim Guid As Guid = Guid.Empty
|
MachiningList.Clear()
|
||||||
Guid.TryParse(sGUID, Guid)
|
' leggo ed aggiungo le altre
|
||||||
ReadMachiningParamString(nIndex, MAC_NAME, "", sName)
|
Dim nIndex As Integer = 1
|
||||||
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, False))
|
Dim sGUID As String = ""
|
||||||
nIndex += 1
|
Dim sName As String = ""
|
||||||
End While
|
Dim sMaterials As String = ""
|
||||||
|
Dim bIsOriginal = False
|
||||||
|
Dim bIsCustom = False
|
||||||
|
While ReadMachiningParamString(nIndex, MAT_GUID, "", sGUID, sImportFilePath) > 0
|
||||||
|
Dim Guid As Guid = Guid.Empty
|
||||||
|
Guid.TryParse(sGUID, Guid)
|
||||||
|
ReadMachiningParamString(nIndex, MAT_NAME, "", sName, sImportFilePath)
|
||||||
|
Dim sOrigGUID As String = ""
|
||||||
|
ReadMachiningParamString(nIndex, MAT_ORIG, "", sOrigGUID, sImportFilePath)
|
||||||
|
If sOrigGUID = ORIG_MATERIAL Then
|
||||||
|
If Not bIsOriginal Then bIsOriginal = True
|
||||||
|
Else
|
||||||
|
If Not bIsCustom Then bIsCustom = True
|
||||||
|
End If
|
||||||
|
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, AlreadyExist(sName)))
|
||||||
|
nIndex += 1
|
||||||
|
End While
|
||||||
|
If bIsOriginal AndAlso bIsCustom Then
|
||||||
|
MessageBox.Show("Corrupted file! Impossible to import it!")
|
||||||
|
ElseIf bIsOriginal Then
|
||||||
|
LoadOriginalMaterial()
|
||||||
|
End If
|
||||||
|
Case WindowTypeEnum.MACHINING
|
||||||
|
m_ImportFilePath = sImportFilePath
|
||||||
|
' carico lista lavorazioni
|
||||||
|
MachiningList.Clear()
|
||||||
|
' leggo ed aggiungo le altre
|
||||||
|
Dim nIndex As Integer = 1
|
||||||
|
Dim sGUID As String = ""
|
||||||
|
Dim sName As String = ""
|
||||||
|
Dim sMaterials As String = ""
|
||||||
|
While ReadMachiningParamString(nIndex, MAC_GUID, "", sGUID, sImportFilePath) > 0
|
||||||
|
Dim Guid As Guid = Guid.Empty
|
||||||
|
Guid.TryParse(sGUID, Guid)
|
||||||
|
ReadMachiningParamString(nIndex, MAC_NAME, "", sName, sImportFilePath)
|
||||||
|
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, AlreadyExist(sName)))
|
||||||
|
nIndex += 1
|
||||||
|
End While
|
||||||
|
End Select
|
||||||
|
Case WindowModeEnum.EXPORT
|
||||||
|
Select Case Type
|
||||||
|
Case WindowTypeEnum.MATERIAL
|
||||||
|
' leggo ed aggiungo le altre
|
||||||
|
Dim nIndex As Integer = 1
|
||||||
|
Dim sGUID As String = ""
|
||||||
|
Dim sName As String = ""
|
||||||
|
While ReadMaterialParamString(nIndex, MAC_GUID, "", sGUID) > 0
|
||||||
|
Dim sOrigGUID As String = ""
|
||||||
|
ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID)
|
||||||
|
If sOrigGUID <> ORIG_MATERIAL Then
|
||||||
|
Dim Guid As Guid = Guid.Empty
|
||||||
|
Guid.TryParse(sGUID, Guid)
|
||||||
|
ReadMaterialParamString(nIndex, MAC_NAME, "", sName)
|
||||||
|
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, False))
|
||||||
|
End If
|
||||||
|
nIndex += 1
|
||||||
|
End While
|
||||||
|
Case WindowTypeEnum.MACHINING
|
||||||
|
' leggo ed aggiungo le altre
|
||||||
|
Dim nIndex As Integer = 1
|
||||||
|
Dim sGUID As String = ""
|
||||||
|
Dim sName As String = ""
|
||||||
|
While ReadMachiningParamString(nIndex, MAC_GUID, "", sGUID) > 0
|
||||||
|
Dim Guid As Guid = Guid.Empty
|
||||||
|
Guid.TryParse(sGUID, Guid)
|
||||||
|
ReadMachiningParamString(nIndex, MAC_NAME, "", sName)
|
||||||
|
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, False))
|
||||||
|
nIndex += 1
|
||||||
|
End While
|
||||||
|
End Select
|
||||||
|
Case WindowModeEnum.EXPORT_ORIG
|
||||||
|
If Type = WindowTypeEnum.MATERIAL Then
|
||||||
|
' leggo ed aggiungo le altre
|
||||||
|
Dim nIndex As Integer = 1
|
||||||
|
Dim sGUID As String = ""
|
||||||
|
Dim sName As String = ""
|
||||||
|
While ReadMaterialParamString(nIndex, MAC_GUID, "", sGUID) > 0
|
||||||
|
Dim sOrigGUID As String = ""
|
||||||
|
ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID)
|
||||||
|
If sOrigGUID = ORIG_MATERIAL Then
|
||||||
|
Dim Guid As Guid = Guid.Empty
|
||||||
|
Guid.TryParse(sGUID, Guid)
|
||||||
|
ReadMaterialParamString(nIndex, MAC_NAME, "", sName)
|
||||||
|
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, False))
|
||||||
|
End If
|
||||||
|
nIndex += 1
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
End Select
|
||||||
ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn
|
ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -134,9 +261,104 @@ Public Class ImportExportMachiningPanelVM
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function AlreadyExist(MachiningName As String) As Boolean
|
Private Function AlreadyExist(MachiningName As String) As Boolean
|
||||||
Return Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = MachiningName)
|
Select Case m_WindowType
|
||||||
|
Case WindowTypeEnum.MATERIAL
|
||||||
|
Return Map.refMaterialDbVM.MaterialList.Any(Function(x) x.sName = MachiningName)
|
||||||
|
Case WindowTypeEnum.MACHINING
|
||||||
|
Return Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = MachiningName)
|
||||||
|
End Select
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Enum MaterialState As Integer
|
||||||
|
NOTFOUND = 1
|
||||||
|
FOUND = 2
|
||||||
|
NOTORIGSAMENAME = 3
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Private Sub LoadOriginalMaterial()
|
||||||
|
m_WindowMode = WindowModeEnum.IMPORT_ORIG
|
||||||
|
' verifico se esistono materiali con lo stesso nome ma non originali
|
||||||
|
Dim ImportedMaterialList As New List(Of MaterialState)
|
||||||
|
For Each ImpExpMaterial In m_MachiningList
|
||||||
|
Dim IsNotOrigSameName As MaterialState = MaterialState.NOTFOUND
|
||||||
|
For Each DbMaterial In Map.refMaterialDbVM.MaterialList
|
||||||
|
If DbMaterial.sName = ImpExpMaterial.sName Then
|
||||||
|
Dim sOrigGUID As String = ""
|
||||||
|
ReadMaterialParamString(DbMaterial.nIndex, MAT_ORIG, "", sOrigGUID)
|
||||||
|
If sOrigGUID <> ORIG_MATERIAL Then
|
||||||
|
If Not IsNotOrigSameName Then IsNotOrigSameName = MaterialState.NOTORIGSAMENAME
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
IsNotOrigSameName = MaterialState.FOUND
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
ImportedMaterialList.Add(IsNotOrigSameName)
|
||||||
|
Next
|
||||||
|
If ImportedMaterialList.Contains(True) Then
|
||||||
|
Dim sDuplicatedMaterialList As String = ""
|
||||||
|
For Index = 0 To ImportedMaterialList.Count - 1
|
||||||
|
If ImportedMaterialList(Index) = MaterialState.NOTORIGSAMENAME Then
|
||||||
|
sDuplicatedMaterialList &= " - " & m_MachiningList(Index).sName & Environment.NewLine
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
MessageBox.Show("Impossible to import the package because materials named:" & Environment.NewLine &
|
||||||
|
sDuplicatedMaterialList & Environment.NewLine &
|
||||||
|
"Please modify the names of these machining and then retry to import the materials.")
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' aggiorno/aggiungo materiali
|
||||||
|
Dim OrigFilePath As String = CurrentMachine.sMaterialFilePath
|
||||||
|
Dim NewMaterial As Material = Nothing
|
||||||
|
For Each Material In m_MachiningList
|
||||||
|
Dim nIndex As Integer = Map.refMaterialDbVM.MaterialList.Max(Function(x) x.nIndex) + 1
|
||||||
|
If Material.Active Then
|
||||||
|
CurrentMachine.SetMaterialFilePath(ImportFilePath)
|
||||||
|
' leggo lavorazione da file di import
|
||||||
|
NewMaterial = New Material(Material.nIndex)
|
||||||
|
' cambio guid, indice e verifico nome
|
||||||
|
NewMaterial.sGUID = Guid.NewGuid.ToString()
|
||||||
|
NewMaterial.SetIndex(nIndex)
|
||||||
|
If Material.AlreadyExist Then
|
||||||
|
If Material.ChangeName Then
|
||||||
|
NewMaterial.sName = Material.sName
|
||||||
|
Map.refMaterialDbVM.MaterialList.Add(NewMaterial)
|
||||||
|
Else
|
||||||
|
' sostituisco lavorazione gia' presente con stesso nome
|
||||||
|
Dim ToSubstituteMaterial As Material = Map.refMaterialDbVM.MaterialList.FirstOrDefault(Function(x) x.sName = Material.sName)
|
||||||
|
NewMaterial.SetIndex(ToSubstituteMaterial.nIndex)
|
||||||
|
NewMaterial.sGUID = ToSubstituteMaterial.sGUID
|
||||||
|
Dim nToReplaceIndex As Integer = Map.refMaterialDbVM.MaterialList.IndexOf(ToSubstituteMaterial)
|
||||||
|
Map.refMaterialDbVM.MaterialList(nToReplaceIndex) = NewMaterial
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Map.refMaterialDbVM.MaterialList.Add(NewMaterial)
|
||||||
|
End If
|
||||||
|
' ripristino path corretta del Db
|
||||||
|
CurrentMachine.SetMaterialFilePath(OrigFilePath)
|
||||||
|
' salvo la lavorazione
|
||||||
|
NewMaterial.Save()
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
' ripristino path corretta del Db
|
||||||
|
CurrentMachine.SetMaterialFilePath(OrigFilePath)
|
||||||
|
' seleziono ultima importata
|
||||||
|
If Not IsNothing(NewMaterial) Then
|
||||||
|
Map.refMaterialDbVM.SelMaterial = NewMaterial
|
||||||
|
Map.refMaterialDbVM.NotifyPropertyChanged(NameOf(Map.refMaterialDbVM.SelMaterial))
|
||||||
|
End If
|
||||||
|
' imposto Db modificato
|
||||||
|
Map.refMaterialDbVM.SetIsModified(True)
|
||||||
|
' messaggio con modifiche
|
||||||
|
Dim sMaterialList As String = ""
|
||||||
|
For Index = 0 To ImportedMaterialList.Count - 1
|
||||||
|
sMaterialList &= " - " & m_MachiningList(Index).sName & " (" & If(ImportedMaterialList(Index) = MaterialState.NOTFOUND, "New", "Updated") & ")" & Environment.NewLine
|
||||||
|
Next
|
||||||
|
MessageBox.Show("List of the materials:" & Environment.NewLine &
|
||||||
|
sMaterialList & Environment.NewLine &
|
||||||
|
"Import successfully completed.")
|
||||||
|
Return
|
||||||
|
End Sub
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|
||||||
#Region "COMMANDS"
|
#Region "COMMANDS"
|
||||||
@@ -159,52 +381,109 @@ Public Class ImportExportMachiningPanelVM
|
|||||||
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
|
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Sub ConfirmImpExpMachinings(param As Object)
|
Public Sub ConfirmImpExpMachinings(param As Object)
|
||||||
Select Case WindowMode
|
Select Case m_WindowMode
|
||||||
Case WindowModeEnum.IMPORT
|
Case WindowModeEnum.IMPORT
|
||||||
Dim OrigFilePath As String = CurrentMachine.sMachiningFilePath
|
Select Case m_WindowType
|
||||||
Dim NewMachining As Machining = Nothing
|
Case WindowTypeEnum.MATERIAL
|
||||||
For Each Machining In m_MachiningList
|
Dim OrigFilePath As String = CurrentMachine.sMaterialFilePath
|
||||||
Dim nIndex As Integer = Map.refMachiningDbVM.MachiningList.Max(Function(x) x.nIndex) + 1
|
Dim NewMaterial As Material = Nothing
|
||||||
If Machining.Active Then
|
For Each Material In m_MachiningList
|
||||||
CurrentMachine.SetMachiningFilePath(ImportFilePath)
|
Dim nIndex As Integer = Map.refMaterialDbVM.MaterialList.Max(Function(x) x.nIndex) + 1
|
||||||
' leggo lavorazione da file di import
|
If Material.Active Then
|
||||||
NewMachining = New Machining(Machining.nIndex)
|
CurrentMachine.SetMaterialFilePath(ImportFilePath)
|
||||||
' cambio guid, indice e verifico nome
|
' leggo lavorazione da file di import
|
||||||
NewMachining.sGUID = Guid.NewGuid.ToString()
|
NewMaterial = New Material(Material.nIndex)
|
||||||
NewMachining.SetIndex(nIndex)
|
' cambio guid, indice e verifico nome
|
||||||
If Machining.AlreadyExist Then
|
NewMaterial.sGUID = Guid.NewGuid.ToString()
|
||||||
If Machining.ChangeName Then
|
NewMaterial.SetIndex(nIndex)
|
||||||
NewMachining.sName = Machining.sName
|
If Material.AlreadyExist Then
|
||||||
|
If Material.ChangeName Then
|
||||||
|
NewMaterial.sName = Material.sName
|
||||||
|
Map.refMaterialDbVM.MaterialList.Add(NewMaterial)
|
||||||
|
Else
|
||||||
|
' sostituisco lavorazione gia' presente con stesso nome
|
||||||
|
Dim ToSubstituteMaterial As Material = Map.refMaterialDbVM.MaterialList.FirstOrDefault(Function(x) x.sName = Material.sName)
|
||||||
|
NewMaterial.SetIndex(ToSubstituteMaterial.nIndex)
|
||||||
|
NewMaterial.sGUID = ToSubstituteMaterial.sGUID
|
||||||
|
Dim nToReplaceIndex As Integer = Map.refMaterialDbVM.MaterialList.IndexOf(ToSubstituteMaterial)
|
||||||
|
Map.refMaterialDbVM.MaterialList(nToReplaceIndex) = NewMaterial
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Map.refMaterialDbVM.MaterialList.Add(NewMaterial)
|
||||||
|
End If
|
||||||
|
' ripristino path corretta del Db
|
||||||
|
CurrentMachine.SetMaterialFilePath(OrigFilePath)
|
||||||
|
' salvo la lavorazione
|
||||||
|
NewMaterial.Save()
|
||||||
End If
|
End If
|
||||||
|
Next
|
||||||
|
' ripristino path corretta del Db
|
||||||
|
CurrentMachine.SetMaterialFilePath(OrigFilePath)
|
||||||
|
' seleziono ultima importata
|
||||||
|
If Not IsNothing(NewMaterial) Then
|
||||||
|
Map.refMaterialDbVM.SelMaterial = NewMaterial
|
||||||
|
Map.refMaterialDbVM.NotifyPropertyChanged(NameOf(Map.refMaterialDbVM.SelMaterial))
|
||||||
End If
|
End If
|
||||||
Map.refMachiningDbVM.MachiningList.Add(NewMachining)
|
' imposto Db modificato
|
||||||
|
Map.refMaterialDbVM.SetIsModified(True)
|
||||||
|
Case WindowTypeEnum.MACHINING
|
||||||
|
Dim OrigFilePath As String = CurrentMachine.sMachiningFilePath
|
||||||
|
Dim NewMachining As Machining = Nothing
|
||||||
|
For Each Machining In m_MachiningList
|
||||||
|
Dim nIndex As Integer = Map.refMachiningDbVM.MachiningList.Max(Function(x) x.nIndex) + 1
|
||||||
|
If Machining.Active Then
|
||||||
|
CurrentMachine.SetMachiningFilePath(ImportFilePath)
|
||||||
|
' leggo lavorazione da file di import
|
||||||
|
NewMachining = New Machining(Machining.nIndex)
|
||||||
|
' cambio guid, indice e verifico nome
|
||||||
|
NewMachining.sGUID = Guid.NewGuid.ToString()
|
||||||
|
NewMachining.SetIndex(nIndex)
|
||||||
|
If Machining.AlreadyExist Then
|
||||||
|
If Machining.ChangeName Then
|
||||||
|
NewMachining.sName = Machining.sName
|
||||||
|
Map.refMachiningDbVM.MachiningList.Add(NewMachining)
|
||||||
|
Else
|
||||||
|
' sostituisco lavorazione gia' presente con stesso nome
|
||||||
|
Dim ToSubstituteMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.sName = Machining.sName)
|
||||||
|
NewMachining.SetIndex(ToSubstituteMachining.nIndex)
|
||||||
|
NewMachining.sGUID = ToSubstituteMachining.sGUID
|
||||||
|
Dim nToReplaceIndex As Integer = Map.refMachiningDbVM.MachiningList.IndexOf(ToSubstituteMachining)
|
||||||
|
Map.refMachiningDbVM.MachiningList(nToReplaceIndex) = NewMachining
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Map.refMachiningDbVM.MachiningList.Add(NewMachining)
|
||||||
|
End If
|
||||||
|
' ripristino path corretta del Db
|
||||||
|
CurrentMachine.SetMachiningFilePath(OrigFilePath)
|
||||||
|
' salvo la lavorazione
|
||||||
|
NewMachining.Save()
|
||||||
|
End If
|
||||||
|
Next
|
||||||
' ripristino path corretta del Db
|
' ripristino path corretta del Db
|
||||||
CurrentMachine.SetMachiningFilePath(OrigFilePath)
|
CurrentMachine.SetMachiningFilePath(OrigFilePath)
|
||||||
' salvo la lavorazione
|
' seleziono ultima importata
|
||||||
NewMachining.Save()
|
If Not IsNothing(NewMachining) Then
|
||||||
|
Map.refMachiningDbVM.SelMachining = NewMachining
|
||||||
|
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.SelMachining))
|
||||||
|
End If
|
||||||
|
' imposto Db modificato
|
||||||
|
Map.refMachiningDbVM.SetIsModified(True)
|
||||||
|
End Select
|
||||||
|
Case WindowModeEnum.EXPORT, WindowModeEnum.EXPORT_ORIG
|
||||||
|
' chiedo il nome con cui salvare il file
|
||||||
|
Dim sExtension As String =""
|
||||||
|
If m_WindowType = WindowTypeEnum.MATERIAL Then
|
||||||
|
If m_WindowMode = WindowModeEnum.EXPORT_ORIG Then
|
||||||
|
sExtension = OriginalMaterialDataExtension
|
||||||
|
Else
|
||||||
|
sExtension = MaterialDataExtension
|
||||||
End If
|
End If
|
||||||
Next
|
Else
|
||||||
' ripristino path corretta del Db
|
sExtension = MachiningDataExtension
|
||||||
CurrentMachine.SetMachiningFilePath(OrigFilePath)
|
|
||||||
' seleziono ultima importata
|
|
||||||
If Not IsNothing(NewMachining) Then
|
|
||||||
Map.refMachiningDbVM.SelMachining = NewMachining
|
|
||||||
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.SelMachining))
|
|
||||||
End If
|
End If
|
||||||
Case WindowModeEnum.EXPORT
|
|
||||||
' recupero le lavorazioni checkate
|
|
||||||
Dim FinalNameList As New List(Of String)
|
|
||||||
For Each Machining In MachiningList
|
|
||||||
If Machining.Active Then
|
|
||||||
FinalNameList.Add(Machining.sName)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
If FinalNameList.Count() = 0 Then Return
|
|
||||||
Dim FinalNameArray = FinalNameList.ToArray()
|
|
||||||
' chiedo il nome con cui salvare il file .data
|
|
||||||
Dim SaveFileDlg As New System.Windows.Forms.SaveFileDialog() With {
|
Dim SaveFileDlg As New System.Windows.Forms.SaveFileDialog() With {
|
||||||
.Title = EgtMsg(31451) & " " & EgtMsg(31452),
|
.Title = EgtMsg(31451) & " " & EgtMsg(31452),
|
||||||
.Filter = "File data (*.data)|*.data|Tutti i file (*.*)|*.*",
|
.Filter = "File data (*" & sExtension & ")|*" & sExtension,
|
||||||
.FileName = String.Empty
|
.FileName = String.Empty
|
||||||
}
|
}
|
||||||
If SaveFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
|
If SaveFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
|
||||||
@@ -224,15 +503,25 @@ Public Class ImportExportMachiningPanelVM
|
|||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
Dim ActiveMachiningList As List(Of Machining) = (From Machining In Map.refMachiningDbVM.MachiningList
|
Select Case m_WindowType
|
||||||
Select Machining
|
Case WindowTypeEnum.MATERIAL
|
||||||
Where m_MachiningList.Any(Function(x) x.sGUID.ToString() = Machining.sGUID AndAlso x.Active)).ToList()
|
Dim ActiveMachiningList As List(Of Material) = (From Material In Map.refMaterialDbVM.MaterialList
|
||||||
' salvo tutte le lavorazioni sul Db
|
Select Material
|
||||||
For Index = 0 To ActiveMachiningList.Count - 1
|
Where m_MachiningList.Any(Function(x) x.sGUID.ToString() = Material.sGUID AndAlso x.Active)).ToList()
|
||||||
ActiveMachiningList(Index).WriteParamsOnDb(Index + 1, sFilePath)
|
' salvo tutti i materiali sul Db
|
||||||
Next
|
For Index = 0 To ActiveMachiningList.Count - 1
|
||||||
|
ActiveMachiningList(Index).WriteParamsOnDb(Index + 1, sFilePath)
|
||||||
|
Next
|
||||||
|
Case WindowTypeEnum.MACHINING
|
||||||
|
Dim ActiveMachiningList As List(Of Machining) = (From Machining In Map.refMachiningDbVM.MachiningList
|
||||||
|
Select Machining
|
||||||
|
Where m_MachiningList.Any(Function(x) x.sGUID.ToString() = Machining.sGUID AndAlso x.Active)).ToList()
|
||||||
|
' salvo tutte le lavorazioni sul Db
|
||||||
|
For Index = 0 To ActiveMachiningList.Count - 1
|
||||||
|
ActiveMachiningList(Index).WriteParamsOnDb(Index + 1, sFilePath)
|
||||||
|
Next
|
||||||
|
End Select
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
' Chiusura finestra
|
' Chiusura finestra
|
||||||
RaiseEvent m_CloseWindow(True)
|
RaiseEvent m_CloseWindow(True)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -246,13 +535,18 @@ End Class
|
|||||||
Public Class ImpExpMachiningItem
|
Public Class ImpExpMachiningItem
|
||||||
Inherits VMBase
|
Inherits VMBase
|
||||||
|
|
||||||
Public Const IMPEXTNAME As String = "_imp"
|
Public Const IMPEXPNAME As String = "_imp"
|
||||||
|
|
||||||
' Actions
|
' Actions
|
||||||
Friend Shared m_delEnableOkBtn As Action
|
Friend Shared m_delEnableOkBtn As Action
|
||||||
|
|
||||||
Private Shared m_Empty As New MachiningIndex(-1, Guid.Empty, "None")
|
Private Shared m_Empty As New MachiningIndex(-1, Guid.Empty, "None")
|
||||||
|
|
||||||
|
Private Shared m_WindowType As WindowTypeEnum
|
||||||
|
Friend Shared Sub SetWindowType(value As WindowTypeEnum)
|
||||||
|
m_WindowType = value
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private m_nIndex As Integer
|
Private m_nIndex As Integer
|
||||||
Public ReadOnly Property nIndex As Integer
|
Public ReadOnly Property nIndex As Integer
|
||||||
Get
|
Get
|
||||||
@@ -284,26 +578,51 @@ Public Class ImpExpMachiningItem
|
|||||||
' se esiste gia' chiedo se sovrascriverla
|
' se esiste gia' chiedo se sovrascriverla
|
||||||
If value Then
|
If value Then
|
||||||
If m_AlreadyExist Then
|
If m_AlreadyExist Then
|
||||||
Select Case System.Windows.MessageBox.Show(EgtMsg(31453), "", MessageBoxButton.YesNoCancel)
|
Select Case m_WindowType
|
||||||
Case MessageBoxResult.Yes
|
Case WindowTypeEnum.MATERIAL
|
||||||
m_ChangeName = False
|
Select Case System.Windows.MessageBox.Show("Material already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
|
||||||
m_Active = True
|
Case MessageBoxResult.Yes
|
||||||
Case MessageBoxResult.No
|
m_ChangeName = False
|
||||||
Dim bImpNameAlreadyInList = False
|
m_Active = True
|
||||||
Dim nImpNameIndex As Integer = 0
|
Case MessageBoxResult.No
|
||||||
If Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXTNAME) Then
|
Dim bImpNameAlreadyInList = False
|
||||||
nImpNameIndex += 1
|
Dim nImpNameIndex As Integer = 0
|
||||||
While Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXTNAME & "_" & nImpNameIndex)
|
If Map.refMaterialDbVM.MaterialList.Any(Function(x) x.sName = m_sOrigName & IMPEXPNAME) Then
|
||||||
nImpNameIndex += 1
|
nImpNameIndex += 1
|
||||||
End While
|
While Map.refMaterialDbVM.MaterialList.Any(Function(x) x.sName = m_sOrigName & IMPEXPNAME & "_" & nImpNameIndex)
|
||||||
End If
|
nImpNameIndex += 1
|
||||||
m_sName = m_sOrigName & IMPEXTNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
|
End While
|
||||||
System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
|
End If
|
||||||
NotifyPropertyChanged(NameOf(sName))
|
m_sName = m_sOrigName & IMPEXPNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
|
||||||
m_ChangeName = True
|
System.Windows.MessageBox.Show("Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
|
||||||
m_Active = True
|
NotifyPropertyChanged(NameOf(sName))
|
||||||
Case Else
|
m_ChangeName = True
|
||||||
m_Active = False
|
m_Active = True
|
||||||
|
Case Else
|
||||||
|
m_Active = False
|
||||||
|
End Select
|
||||||
|
Case WindowTypeEnum.MACHINING
|
||||||
|
Select Case System.Windows.MessageBox.Show("Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
|
||||||
|
Case MessageBoxResult.Yes
|
||||||
|
m_ChangeName = False
|
||||||
|
m_Active = True
|
||||||
|
Case MessageBoxResult.No
|
||||||
|
Dim bImpNameAlreadyInList = False
|
||||||
|
Dim nImpNameIndex As Integer = 0
|
||||||
|
If Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXPNAME) Then
|
||||||
|
nImpNameIndex += 1
|
||||||
|
While Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXPNAME & "_" & nImpNameIndex)
|
||||||
|
nImpNameIndex += 1
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
m_sName = m_sOrigName & IMPEXPNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
|
||||||
|
System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
|
||||||
|
NotifyPropertyChanged(NameOf(sName))
|
||||||
|
m_ChangeName = True
|
||||||
|
m_Active = True
|
||||||
|
Case Else
|
||||||
|
m_Active = False
|
||||||
|
End Select
|
||||||
End Select
|
End Select
|
||||||
NotifyPropertyChanged(NameOf(Active))
|
NotifyPropertyChanged(NameOf(Active))
|
||||||
Else
|
Else
|
||||||
@@ -360,82 +679,3 @@ Public Class ImpExpMachiningItem
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Class MachiningItem
|
|
||||||
Inherits VMBase
|
|
||||||
|
|
||||||
' Actions
|
|
||||||
Friend Shared m_delEnableOkBtn As Action
|
|
||||||
|
|
||||||
Private m_Name As String
|
|
||||||
Public Property Name As String
|
|
||||||
Get
|
|
||||||
If m_ChangeName Then
|
|
||||||
Return m_Name & "_imp"
|
|
||||||
Else
|
|
||||||
Return m_Name
|
|
||||||
End If
|
|
||||||
End Get
|
|
||||||
Set(value As String)
|
|
||||||
m_Name = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_Active As Boolean
|
|
||||||
Public Property Active As Boolean
|
|
||||||
Get
|
|
||||||
Return m_Active
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
' se esiste gia' chiedo se sovrascriverla
|
|
||||||
If value Then
|
|
||||||
If m_AlreadyExist Then
|
|
||||||
Select Case System.Windows.MessageBox.Show(EgtMsg(31453), "", MessageBoxButton.YesNoCancel)
|
|
||||||
Case MessageBoxResult.Yes
|
|
||||||
m_ChangeName = False
|
|
||||||
m_Active = True
|
|
||||||
Case MessageBoxResult.No
|
|
||||||
System.Windows.MessageBox.Show(EgtMsg(31454), "", MessageBoxButton.OK)
|
|
||||||
m_ChangeName = True
|
|
||||||
m_Active = True
|
|
||||||
Case Else
|
|
||||||
m_Active = False
|
|
||||||
End Select
|
|
||||||
NotifyPropertyChanged("Active")
|
|
||||||
Else
|
|
||||||
m_Active = True
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
m_ChangeName = False
|
|
||||||
m_Active = False
|
|
||||||
End If
|
|
||||||
If Not IsNothing(m_delEnableOkBtn) Then m_delEnableOkBtn()
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
' Parametro che indica se questo item da importare esiste gia'
|
|
||||||
Private m_AlreadyExist As Boolean
|
|
||||||
Friend ReadOnly Property AlreadyExist As Boolean
|
|
||||||
Get
|
|
||||||
Return m_AlreadyExist
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
' Parametro che indica se cambiare il nome di un item che esiste gia' o sovrascriverlo
|
|
||||||
Private m_ChangeName As Boolean
|
|
||||||
Friend Property ChangeName As Boolean
|
|
||||||
Get
|
|
||||||
Return m_ChangeName
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
m_ChangeName = value
|
|
||||||
NotifyPropertyChanged("Name")
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Sub New(Name As String, AlreadyExist As Boolean)
|
|
||||||
m_Name = Name
|
|
||||||
m_AlreadyExist = AlreadyExist
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
End Class
|
|
||||||
|
|||||||
+266
-10
@@ -1,4 +1,5 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports System.Collections.Specialized
|
||||||
Imports System.ComponentModel
|
Imports System.ComponentModel
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
@@ -53,6 +54,17 @@ Public Class Machining
|
|||||||
FAST = 2
|
FAST = 2
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
|
Public Enum MPAR_PRINT_ORDER As Integer
|
||||||
|
SHELL = 1
|
||||||
|
EXTRA_SHELL = 2
|
||||||
|
INFILL = 3
|
||||||
|
AUX_SOLID = 4
|
||||||
|
RIB_UNBOUNDED = 5
|
||||||
|
RIB_EXTERNAL = 6
|
||||||
|
RIB_INTERNAL = 7
|
||||||
|
RIB_SUPPORT = 8
|
||||||
|
End Enum
|
||||||
|
|
||||||
Protected m_CathegoryList As New ObservableCollection(Of MachiningCathegory)
|
Protected m_CathegoryList As New ObservableCollection(Of MachiningCathegory)
|
||||||
Public ReadOnly Property CathegoryList As ObservableCollection(Of MachiningCathegory)
|
Public ReadOnly Property CathegoryList As ObservableCollection(Of MachiningCathegory)
|
||||||
Get
|
Get
|
||||||
@@ -125,7 +137,7 @@ Public Class Machining
|
|||||||
Else
|
Else
|
||||||
nIndex = -1
|
nIndex = -1
|
||||||
m_sGUID = Guid.NewGuid.ToString()
|
m_sGUID = Guid.NewGuid.ToString()
|
||||||
m_sName = "PrintingParam"
|
m_sName = "New Machining"
|
||||||
End If
|
End If
|
||||||
m_sOrigName = m_sName
|
m_sOrigName = m_sName
|
||||||
m_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nIndex))
|
m_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nIndex))
|
||||||
@@ -160,7 +172,7 @@ Public Class Machining
|
|||||||
NotifyPropertyChanged(NameOf(ghName))
|
NotifyPropertyChanged(NameOf(ghName))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub Save()
|
Friend Overridable Sub Save()
|
||||||
If bIsModified Then
|
If bIsModified Then
|
||||||
' salvo tutti i parametri su orig
|
' salvo tutti i parametri su orig
|
||||||
SaveParams()
|
SaveParams()
|
||||||
@@ -171,7 +183,7 @@ Public Class Machining
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SaveParams()
|
Protected Overridable Sub SaveParams()
|
||||||
SaveName()
|
SaveName()
|
||||||
For Each Cathegory In m_CathegoryList
|
For Each Cathegory In m_CathegoryList
|
||||||
Cathegory.SaveParams()
|
Cathegory.SaveParams()
|
||||||
@@ -204,8 +216,9 @@ Public Class Machining
|
|||||||
|
|
||||||
Friend Overridable Sub OnMachiningParamPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
Friend Overridable Sub OnMachiningParamPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||||
Select Case e.PropertyName
|
Select Case e.PropertyName
|
||||||
Case NameOf(sender.dValue), NameOf(sender.sValue), NameOf(sender.bValue), NameOf(sender.SelValue)
|
Case NameOf(sender.dValue), NameOf(sender.sValue), NameOf(sender.bValue), NameOf(sender.SelValue), NameOf(sender.Value)
|
||||||
UpdateIsModified()
|
UpdateIsModified()
|
||||||
|
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -316,7 +329,8 @@ Public Class MachiningCathegory
|
|||||||
New NumericMachiningParam(MachiningParam.Params.G0FEEDZ, nIndex),
|
New NumericMachiningParam(MachiningParam.Params.G0FEEDZ, nIndex),
|
||||||
New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, nIndex),
|
New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, nIndex),
|
||||||
New NumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nIndex),
|
New NumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nIndex),
|
||||||
New ComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nIndex)})
|
New ComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nIndex),
|
||||||
|
New OrderedMachiningParam(MachiningParam.Params.PRINT_ORDER, nIndex)})
|
||||||
Case Cathegories.LINK
|
Case Cathegories.LINK
|
||||||
m_sName = "Shell"
|
m_sName = "Shell"
|
||||||
m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.LINKTYPE, nIndex),
|
m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.LINKTYPE, nIndex),
|
||||||
@@ -342,6 +356,7 @@ Public Class MachiningCathegory
|
|||||||
New CheckMachiningParam(MachiningParam.Params.RIBSLINK, nIndex),
|
New CheckMachiningParam(MachiningParam.Params.RIBSLINK, nIndex),
|
||||||
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nIndex),
|
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nIndex),
|
||||||
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nIndex),
|
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nIndex),
|
||||||
|
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTSTRANDORDER, nIndex),
|
||||||
New CheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nIndex),
|
New CheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nIndex),
|
||||||
New NumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nIndex),
|
New NumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nIndex),
|
||||||
New CheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nIndex),
|
New CheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nIndex),
|
||||||
@@ -463,6 +478,8 @@ Public MustInherit Class MachiningParam
|
|||||||
STRANDOVERLAP = 57
|
STRANDOVERLAP = 57
|
||||||
FLOWRATE_PC = 58
|
FLOWRATE_PC = 58
|
||||||
DYNAMIC_MODE = 59
|
DYNAMIC_MODE = 59
|
||||||
|
PRINT_ORDER = 60
|
||||||
|
RIBSINVERTSTRANDORDER = 61
|
||||||
MATERIALS = 100
|
MATERIALS = 100
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
@@ -549,6 +566,8 @@ Public MustInherit Class MachiningParam
|
|||||||
m_sName = "Invert Order"
|
m_sName = "Invert Order"
|
||||||
Case Params.RIBSINVERTDIRECTION
|
Case Params.RIBSINVERTDIRECTION
|
||||||
m_sName = "Invert Direction"
|
m_sName = "Invert Direction"
|
||||||
|
Case Params.RIBSINVERTSTRANDORDER
|
||||||
|
m_sName = "Invert Strand Order"
|
||||||
Case Params.RIBSLEADININVERT
|
Case Params.RIBSLEADININVERT
|
||||||
m_sName = "Lead In Invert"
|
m_sName = "Lead In Invert"
|
||||||
Case Params.RIBSLEADINLEN
|
Case Params.RIBSLEADINLEN
|
||||||
@@ -599,6 +618,8 @@ Public MustInherit Class MachiningParam
|
|||||||
m_sName = "Flow rate [%]"
|
m_sName = "Flow rate [%]"
|
||||||
Case Params.DYNAMIC_MODE
|
Case Params.DYNAMIC_MODE
|
||||||
m_sName = "Dynamic Mode"
|
m_sName = "Dynamic Mode"
|
||||||
|
Case Params.PRINT_ORDER
|
||||||
|
m_sName = "Print Order"
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -637,7 +658,6 @@ Public Class NumericMachiningParam
|
|||||||
StringToDouble(value, m_dValue)
|
StringToDouble(value, m_dValue)
|
||||||
End If
|
End If
|
||||||
NotifyPropertyChanged(NameOf(sValue))
|
NotifyPropertyChanged(NameOf(sValue))
|
||||||
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
|
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -903,7 +923,6 @@ Public Class StringMachiningParam
|
|||||||
Set(value As String)
|
Set(value As String)
|
||||||
m_sValue = value
|
m_sValue = value
|
||||||
NotifyPropertyChanged(NameOf(sValue))
|
NotifyPropertyChanged(NameOf(sValue))
|
||||||
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
|
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -962,7 +981,6 @@ Public Class ComboMachiningParam
|
|||||||
Set(value As IdNameStruct)
|
Set(value As IdNameStruct)
|
||||||
m_SelValue = value
|
m_SelValue = value
|
||||||
NotifyPropertyChanged(NameOf(SelValue))
|
NotifyPropertyChanged(NameOf(SelValue))
|
||||||
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
|
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -1110,7 +1128,6 @@ Public Class CheckMachiningParam
|
|||||||
Set(value As Boolean)
|
Set(value As Boolean)
|
||||||
m_bValue = value
|
m_bValue = value
|
||||||
NotifyPropertyChanged(NameOf(bValue))
|
NotifyPropertyChanged(NameOf(bValue))
|
||||||
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
|
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -1145,6 +1162,8 @@ Public Class CheckMachiningParam
|
|||||||
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTORDER, 0)
|
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTORDER, 0)
|
||||||
Case Params.RIBSINVERTDIRECTION
|
Case Params.RIBSINVERTDIRECTION
|
||||||
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTDIRECTION, 0)
|
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTDIRECTION, 0)
|
||||||
|
Case Params.RIBSINVERTSTRANDORDER
|
||||||
|
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTSTRANDORDER, 0)
|
||||||
Case Params.RIBSLEADININVERT
|
Case Params.RIBSLEADININVERT
|
||||||
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADININVERT, 0)
|
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADININVERT, 0)
|
||||||
Case Params.RIBSLEADOUTINVERT
|
Case Params.RIBSLEADOUTINVERT
|
||||||
@@ -1164,6 +1183,8 @@ Public Class CheckMachiningParam
|
|||||||
WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0), sFilePath)
|
WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0), sFilePath)
|
||||||
Case Params.RIBSINVERTDIRECTION
|
Case Params.RIBSINVERTDIRECTION
|
||||||
WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0), sFilePath)
|
WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0), sFilePath)
|
||||||
|
Case Params.RIBSINVERTSTRANDORDER
|
||||||
|
WriteMachiningParam(nIndex, MAC_RIBSINVERTSTRANDORDER, If(m_bValue, 1, 0), sFilePath)
|
||||||
Case Params.RIBSLEADININVERT
|
Case Params.RIBSLEADININVERT
|
||||||
WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0), sFilePath)
|
WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0), sFilePath)
|
||||||
Case Params.RIBSLEADOUTINVERT
|
Case Params.RIBSLEADOUTINVERT
|
||||||
@@ -1203,7 +1224,6 @@ Public Class MaterialMachiningParam
|
|||||||
Set(value As Boolean)
|
Set(value As Boolean)
|
||||||
m_bValue = value
|
m_bValue = value
|
||||||
NotifyPropertyChanged(NameOf(bValue))
|
NotifyPropertyChanged(NameOf(bValue))
|
||||||
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
|
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -1257,3 +1277,239 @@ Public Class MaterialMachiningParam
|
|||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
Public Class OrderedMachiningParam
|
||||||
|
Inherits MachiningParam
|
||||||
|
|
||||||
|
Protected m_StandardValueOrderList As List(Of Integer)
|
||||||
|
|
||||||
|
Protected m_ValueList As ObservableCollection(Of IdNameStruct)
|
||||||
|
Public ReadOnly Property ValueList As ObservableCollection(Of IdNameStruct)
|
||||||
|
Get
|
||||||
|
Return m_ValueList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Protected m_SelValue As IdNameStruct
|
||||||
|
Public Overridable Property SelValue As IdNameStruct
|
||||||
|
Get
|
||||||
|
Return m_SelValue
|
||||||
|
End Get
|
||||||
|
Set(value As IdNameStruct)
|
||||||
|
m_SelValue = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Protected m_OrigValue As String
|
||||||
|
Public ReadOnly Property OrigValue As String
|
||||||
|
Get
|
||||||
|
Return m_OrigValue
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Property Value As String
|
||||||
|
Get
|
||||||
|
Dim Temp As String = ""
|
||||||
|
For Each Item In m_ValueList
|
||||||
|
Temp &= Item.Id & ","
|
||||||
|
Next
|
||||||
|
Return Temp.TrimEnd(","c)
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
Select Case Type
|
||||||
|
Case Params.PRINT_ORDER
|
||||||
|
Dim StringValueList() As String
|
||||||
|
Dim IntegerValueList As New List(Of Integer)
|
||||||
|
If value.Length = 15 Then
|
||||||
|
StringValueList = value.Split(","c)
|
||||||
|
For Each StringValue In StringValueList
|
||||||
|
Dim IntegerValue As Integer = 0
|
||||||
|
If Integer.TryParse(StringValue, IntegerValue) Then
|
||||||
|
IntegerValueList.Add(IntegerValue)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
If IntegerValueList.Count <> 8 Then
|
||||||
|
IntegerValueList = m_StandardValueOrderList
|
||||||
|
End If
|
||||||
|
If Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.SHELL) OrElse
|
||||||
|
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL) OrElse
|
||||||
|
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.INFILL) OrElse
|
||||||
|
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.AUX_SOLID) OrElse
|
||||||
|
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED) OrElse
|
||||||
|
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL) OrElse
|
||||||
|
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL) OrElse
|
||||||
|
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT) Then
|
||||||
|
IntegerValueList = m_StandardValueOrderList
|
||||||
|
End If
|
||||||
|
OrderByReference(m_ValueList, IntegerValueList)
|
||||||
|
End Select
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Shared Sub OrderByReference(collection As ObservableCollection(Of IdNameStruct), comparison As List(Of Integer))
|
||||||
|
For i As Integer = 0 To comparison.Count - 1
|
||||||
|
Dim Index As Integer = i
|
||||||
|
If Not comparison.ElementAt(i).Equals(collection.ElementAt(i)) Then
|
||||||
|
collection.Move(collection.IndexOf(collection.FirstOrDefault(Function(x) x.Id = comparison(Index))), i)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Overrides ReadOnly Property bIsModified As Boolean
|
||||||
|
Get
|
||||||
|
Return Value <> m_OrigValue
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' Definizione comandi
|
||||||
|
Private m_cmdMoveUpOrder As ICommand
|
||||||
|
Private m_cmdMoveDownOrder As ICommand
|
||||||
|
Private m_cmdResetOrder As ICommand
|
||||||
|
|
||||||
|
Sub New(Type As Params)
|
||||||
|
MyBase.New(Type)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub New(Type As Params, nIndex As Integer)
|
||||||
|
MyBase.New(Type)
|
||||||
|
If nIndex = 0 Then
|
||||||
|
Select Case Type
|
||||||
|
Case Params.PRINT_ORDER
|
||||||
|
m_StandardValueOrderList = New List(Of Integer)({Machining.MPAR_PRINT_ORDER.SHELL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.EXTRA_SHELL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.INFILL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.AUX_SOLID,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_INTERNAL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_SUPPORT})
|
||||||
|
m_ValueList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shells"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infills"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Ribs"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Ribs"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Ribs"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Ribs")})
|
||||||
|
m_SelValue = Nothing
|
||||||
|
End Select
|
||||||
|
Else
|
||||||
|
Select Case Type
|
||||||
|
Case Params.PRINT_ORDER
|
||||||
|
m_StandardValueOrderList = New List(Of Integer)({Machining.MPAR_PRINT_ORDER.SHELL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.EXTRA_SHELL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.INFILL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.AUX_SOLID,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_INTERNAL,
|
||||||
|
Machining.MPAR_PRINT_ORDER.RIB_SUPPORT})
|
||||||
|
m_ValueList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shells"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infills"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Ribs"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Ribs"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Ribs"),
|
||||||
|
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Ribs")})
|
||||||
|
ReadMachiningParamString(nIndex, MAC_PRINTORDER, "", Value)
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
m_OrigValue = Value
|
||||||
|
m_SelValue = Nothing
|
||||||
|
NotifyPropertyChanged(NameOf(SelValue))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||||
|
Select Case Type
|
||||||
|
Case Params.PRINT_ORDER
|
||||||
|
WriteMachiningParam(nIndex, MAC_PRINTORDER, Value, sFilePath)
|
||||||
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Overrides Sub SaveParam()
|
||||||
|
m_OrigValue = Value
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Overrides Sub ResetParam()
|
||||||
|
Value = m_OrigValue
|
||||||
|
m_SelValue = Nothing
|
||||||
|
NotifyPropertyChanged(NameOf(ValueList))
|
||||||
|
NotifyPropertyChanged(NameOf(SelValue))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#Region "COMMANDS"
|
||||||
|
|
||||||
|
#Region "MoveUpOrder"
|
||||||
|
|
||||||
|
Public ReadOnly Property MoveUpOrder_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdMoveUpOrder Is Nothing Then
|
||||||
|
m_cmdMoveUpOrder = New Command(AddressOf MoveUpOrder)
|
||||||
|
End If
|
||||||
|
Return m_cmdMoveUpOrder
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub MoveUpOrder()
|
||||||
|
If IsNothing(m_SelValue) Then Return
|
||||||
|
Dim nIndex As Integer = m_ValueList.IndexOf(m_SelValue)
|
||||||
|
If nIndex < 0 Then Return
|
||||||
|
If nIndex > 0 Then
|
||||||
|
m_ValueList.Move(nIndex, nIndex - 1)
|
||||||
|
NotifyPropertyChanged(NameOf(Value))
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' MoveUpOrder
|
||||||
|
|
||||||
|
#Region "MoveDownOrder"
|
||||||
|
|
||||||
|
Public ReadOnly Property MoveDownOrder_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdMoveDownOrder Is Nothing Then
|
||||||
|
m_cmdMoveDownOrder = New Command(AddressOf MoveDownOrder)
|
||||||
|
End If
|
||||||
|
Return m_cmdMoveDownOrder
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub MoveDownOrder()
|
||||||
|
If IsNothing(m_SelValue) Then Return
|
||||||
|
Dim nIndex As Integer = m_ValueList.IndexOf(m_SelValue)
|
||||||
|
If nIndex < 0 Then Return
|
||||||
|
If nIndex < m_ValueList.Count - 1 Then
|
||||||
|
m_ValueList.Move(nIndex, nIndex + 1)
|
||||||
|
NotifyPropertyChanged(NameOf(Value))
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' MoveDownOrder
|
||||||
|
|
||||||
|
#Region "ResetOrder"
|
||||||
|
|
||||||
|
Public ReadOnly Property ResetOrder_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdResetOrder Is Nothing Then
|
||||||
|
m_cmdResetOrder = New Command(AddressOf ResetOrder)
|
||||||
|
End If
|
||||||
|
Return m_cmdResetOrder
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub ResetOrder()
|
||||||
|
Dim CurrValue As String = Value
|
||||||
|
OrderByReference(m_ValueList, m_StandardValueOrderList)
|
||||||
|
m_ValueList = New ObservableCollection(Of IdNameStruct)(m_ValueList.OrderBy(Function(x) x.Id))
|
||||||
|
If Value <> CurrValue Then
|
||||||
|
NotifyPropertyChanged(NameOf(ValueList))
|
||||||
|
NotifyPropertyChanged(NameOf(Value))
|
||||||
|
NotifyPropertyChanged(NameOf(SelValue))
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' ResetOrder
|
||||||
|
|
||||||
|
#End Region ' COMMANDS
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
Style="{StaticResource RightPanel_Border}">
|
Style="{StaticResource RightPanel_Border}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
@@ -63,6 +62,7 @@
|
|||||||
Visibility="{Binding Combo_Visibility}"
|
Visibility="{Binding Combo_Visibility}"
|
||||||
Style="{StaticResource FeatureComboBox}"/>
|
Style="{StaticResource FeatureComboBox}"/>
|
||||||
<EgtWPFLib5:EgtTextBox Text="{Binding SelectedItem.sName, ElementName=MachiningCombo, UpdateSourceTrigger=Explicit}"
|
<EgtWPFLib5:EgtTextBox Text="{Binding SelectedItem.sName, ElementName=MachiningCombo, UpdateSourceTrigger=Explicit}"
|
||||||
|
ExplicitUpdateSource="EnterKeyPressOrLostFocus"
|
||||||
IsExplicitFocused="{Binding UserShouldEditValueNow}"
|
IsExplicitFocused="{Binding UserShouldEditValueNow}"
|
||||||
Visibility="{Binding Name_Visibility}"
|
Visibility="{Binding Name_Visibility}"
|
||||||
Style="{StaticResource OptionTextBox}"/>
|
Style="{StaticResource OptionTextBox}"/>
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
<Image Source="/Resources/TopPanel/Edit.png"/>
|
<Image Source="/Resources/TopPanel/Edit.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<ScrollViewer Grid.Row="3"
|
<ScrollViewer Grid.Row="2"
|
||||||
VerticalScrollBarVisibility="Auto"
|
VerticalScrollBarVisibility="Auto"
|
||||||
HorizontalScrollBarVisibility="Disabled">
|
HorizontalScrollBarVisibility="Disabled">
|
||||||
<ItemsControl Grid.Row="1"
|
<ItemsControl Grid.Row="1"
|
||||||
@@ -91,8 +91,7 @@
|
|||||||
<ItemsControl ItemsSource="{Binding MachiningParamList}">
|
<ItemsControl ItemsSource="{Binding MachiningParamList}">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<UniformGrid Columns="1"
|
<StackPanel Orientation="Vertical"/>
|
||||||
HorizontalAlignment="Stretch"/>
|
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.Resources>
|
<ItemsControl.Resources>
|
||||||
@@ -186,6 +185,38 @@
|
|||||||
Style="{StaticResource ToolBar_SmallButton}"/>-->
|
Style="{StaticResource ToolBar_SmallButton}"/>-->
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Text="{Binding sName}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<Grid Grid.Column="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ListBox ItemsSource="{Binding ValueList}"
|
||||||
|
SelectedItem="{Binding SelValue}"/>
|
||||||
|
<StackPanel Grid.Column="1"
|
||||||
|
Orientation="Vertical"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Margin="5,0,0,0">
|
||||||
|
<Button Content="˄"
|
||||||
|
Command="{Binding MoveUpOrder_Command}"
|
||||||
|
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||||
|
<Button Content="˅"
|
||||||
|
Command="{Binding MoveDownOrder_Command}"
|
||||||
|
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||||
|
<Button Content="<>"
|
||||||
|
Command="{Binding ResetOrder_Command}"
|
||||||
|
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
</ItemsControl.Resources>
|
</ItemsControl.Resources>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</Expander>
|
</Expander>
|
||||||
@@ -193,7 +224,7 @@
|
|||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<UniformGrid Grid.Row="4" Rows="1">
|
<UniformGrid Grid.Row="3" Rows="1">
|
||||||
<Button Content="Ok"
|
<Button Content="Ok"
|
||||||
Command="{Binding Ok_Command}"
|
Command="{Binding Ok_Command}"
|
||||||
IsEnabled="{Binding IsEnabled}"
|
IsEnabled="{Binding IsEnabled}"
|
||||||
|
|||||||
@@ -291,6 +291,9 @@ Public Class MachiningDbVM
|
|||||||
Case MessageBoxResult.Yes
|
Case MessageBoxResult.Yes
|
||||||
m_MachiningList.Remove(m_SelMachining)
|
m_MachiningList.Remove(m_SelMachining)
|
||||||
SetIsModified(True)
|
SetIsModified(True)
|
||||||
|
If m_MachiningList.Count > 0 Then
|
||||||
|
SelMachining = m_MachiningList(0)
|
||||||
|
End If
|
||||||
Case MessageBoxResult.No
|
Case MessageBoxResult.No
|
||||||
Return
|
Return
|
||||||
End Select
|
End Select
|
||||||
@@ -330,13 +333,11 @@ Public Class MachiningDbVM
|
|||||||
|
|
||||||
Public Sub Import()
|
Public Sub Import()
|
||||||
' chiedo il nome del file .data da aprire
|
' chiedo il nome del file .data da aprire
|
||||||
Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {
|
Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {.Title = EgtMsg(31451) & " " & EgtMsg(31452),
|
||||||
.Title = EgtMsg(31451) & " " & EgtMsg(31452),
|
.Filter = "File data (*" & ImportExportMachiningPanelVM.MachiningDataExtension & ")|*" & ImportExportMachiningPanelVM.MachiningDataExtension,
|
||||||
.Filter = "File data (*.data)|*.data|Tutti i file (*.*)|*.*",
|
.FileName = String.Empty}
|
||||||
.FileName = String.Empty
|
|
||||||
}
|
|
||||||
If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
|
If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
|
||||||
Dim ImportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(OpenFileDlg.FileName))
|
Dim ImportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MACHINING, ImportExportMachiningPanelVM.WindowModeEnum.IMPORT, OpenFileDlg.FileName))
|
||||||
ImportWindow.ShowDialog()
|
ImportWindow.ShowDialog()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -354,7 +355,7 @@ Public Class MachiningDbVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub Export()
|
Public Sub Export()
|
||||||
Dim ExportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM)
|
Dim ExportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MACHINING, ImportExportMachiningPanelVM.WindowModeEnum.EXPORT))
|
||||||
ExportWindow.ShowDialog()
|
ExportWindow.ShowDialog()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -195,8 +195,8 @@ Public Class MainWindowM
|
|||||||
' Verifico abilitazione nesting automatico
|
' Verifico abilitazione nesting automatico
|
||||||
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
|
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||||
' Recupero livello e opzioni della chiave
|
' Recupero livello e opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2501, 1, m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2502, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(5583, 2501, 1, m_nKeyOptions)
|
EgtGetKeyOptions(5583, 2502, 1, m_nKeyOptions)
|
||||||
' Inizializzazione generale di EgtInterface
|
' Inizializzazione generale di EgtInterface
|
||||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||||
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||||
|
|||||||
@@ -359,14 +359,17 @@ Public Class ManagePartPanelVM
|
|||||||
nRibsLayerId = EgtCreateGroup(nPartId)
|
nRibsLayerId = EgtCreateGroup(nPartId)
|
||||||
EgtSetName(nRibsLayerId, LAY_RIBS)
|
EgtSetName(nRibsLayerId, LAY_RIBS)
|
||||||
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
|
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
|
||||||
|
Dim nRibsIndex As Integer = 1
|
||||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||||
EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||||
|
EgtSetInfo(PartManager_GeomEntity.nId, RIB_ID, nRibsIndex)
|
||||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
|
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
|
||||||
' elimino colore entita'
|
' elimino colore entita'
|
||||||
EgtResetColor(PartManager_GeomEntity.nId)
|
EgtResetColor(PartManager_GeomEntity.nId)
|
||||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||||
End If
|
End If
|
||||||
|
nRibsIndex += 1
|
||||||
Next
|
Next
|
||||||
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
||||||
nShellNumberLayerId = EgtCreateGroup(nPartId)
|
nShellNumberLayerId = EgtCreateGroup(nPartId)
|
||||||
@@ -432,17 +435,9 @@ Public Class ManagePartPanelVM
|
|||||||
End If
|
End If
|
||||||
End Select
|
End Select
|
||||||
Next
|
Next
|
||||||
' aggiungo riferimento
|
' aggiungo layer riferimento
|
||||||
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
|
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
|
||||||
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
|
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
|
||||||
' Creo riferimento
|
|
||||||
Dim ptOrig As New Point3d(b3PrintSolid.Min())
|
|
||||||
Dim frPrintSolid As New Frame3d(ptOrig)
|
|
||||||
nFrameId = EgtCreateGeoFrame(nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
|
|
||||||
If nFrameId Then
|
|
||||||
EgtSetName(nFrameId, FRAME_PART)
|
|
||||||
EgtSetMode(nFrameId, GDB_MD.LOCKED)
|
|
||||||
End If
|
|
||||||
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
|
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
|
||||||
' appoggio il pezzo sulla tavola
|
' appoggio il pezzo sulla tavola
|
||||||
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
|
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
|
||||||
@@ -454,6 +449,8 @@ Public Class ManagePartPanelVM
|
|||||||
EgtSetInfo(nPartId, "PartOnTable", 1)
|
EgtSetInfo(nPartId, "PartOnTable", 1)
|
||||||
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
|
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
|
||||||
Map.refTopPanelVM.PartList.Add(NewPart)
|
Map.refTopPanelVM.PartList.Add(NewPart)
|
||||||
|
' aggiorno riferimento
|
||||||
|
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
'EgtAddMachGroup("3dPrint")
|
'EgtAddMachGroup("3dPrint")
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
@@ -375,10 +376,11 @@ Public Class ManagePart_Layer
|
|||||||
|
|
||||||
Public Enum LayerType As Integer
|
Public Enum LayerType As Integer
|
||||||
PRINT_SOLID = 1
|
PRINT_SOLID = 1
|
||||||
MACH_START = 2
|
'REFERENCE = 2
|
||||||
RIBS = 3
|
MACH_START = 3
|
||||||
SHELL_NUMBER = 4
|
RIBS = 4
|
||||||
AUX_SOLIDS = 5
|
SHELL_NUMBER = 5
|
||||||
|
AUX_SOLIDS = 6
|
||||||
OTHERS = 7
|
OTHERS = 7
|
||||||
CHANGENAME = 15
|
CHANGENAME = 15
|
||||||
DELETE = 16
|
DELETE = 16
|
||||||
@@ -639,7 +641,7 @@ Public Class GeomEntity_MenuItem
|
|||||||
End If
|
End If
|
||||||
' se e' presente elimino flag di spostamento a 45 gradi
|
' se e' presente elimino flag di spostamento a 45 gradi
|
||||||
Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId))
|
Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId))
|
||||||
EgtRemoveInfo(nPartId, "MovedPart")
|
EgtRemoveInfo(nPartId, KEY_MOVEDPART)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
' aggiorno riferimenti nel context menu item
|
' aggiorno riferimenti nel context menu item
|
||||||
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
|
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
|
||||||
@@ -666,6 +668,8 @@ Public Class GeomEntity_MenuItem
|
|||||||
NewLayer.EntityList.Add(m_OrigEntity)
|
NewLayer.EntityList.Add(m_OrigEntity)
|
||||||
' aggiorno riferimenti nell'entita'
|
' aggiorno riferimenti nell'entita'
|
||||||
m_OrigEntity.UpdateOrigLayer(NewLayer)
|
m_OrigEntity.UpdateOrigLayer(NewLayer)
|
||||||
|
' aggiorno colore
|
||||||
|
EgtSetColor(m_OrigEntity.nId, GetColor(LayerType.PRINTPART))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' aggiorno i contextmenu di tutti gli entity
|
' aggiorno i contextmenu di tutti gli entity
|
||||||
@@ -684,44 +688,38 @@ Public Class GeomEntity_MenuItem
|
|||||||
' creo layer solido di stampa
|
' creo layer solido di stampa
|
||||||
Dim nPrintPartLayerId As Integer = EgtCreateGroup(nPartId)
|
Dim nPrintPartLayerId As Integer = EgtCreateGroup(nPartId)
|
||||||
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
|
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
|
||||||
|
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
|
||||||
EgtRelocateGlob(m_OrigEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
|
EgtRelocateGlob(m_OrigEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
|
||||||
' calcolo box superficie per creazione riferimento
|
' calcolo box superficie per creazione riferimento
|
||||||
EgtGetBBoxGlob(m_OrigEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
|
EgtGetBBoxGlob(m_OrigEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
|
||||||
' coloro l'entita'
|
|
||||||
EgtSetColor(m_OrigEntity.nId, GeomEntityColors.c3Print)
|
|
||||||
' creo layer mach start
|
' creo layer mach start
|
||||||
Dim nMachStartLayerId As Integer = EgtCreateGroup(nPartId)
|
Dim nMachStartLayerId As Integer = EgtCreateGroup(nPartId)
|
||||||
EgtSetName(nMachStartLayerId, LAY_MACH_START)
|
EgtSetName(nMachStartLayerId, LAY_MACH_START)
|
||||||
|
EgtSetColor(nMachStartLayerId, GeomEntityColors.c3MachStart)
|
||||||
Dim nMachStartId As Integer = GDB_ID.NULL
|
Dim nMachStartId As Integer = GDB_ID.NULL
|
||||||
' creo punto di partenza
|
' creo punto di partenza
|
||||||
Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX()
|
Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX()
|
||||||
nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
|
nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
|
||||||
EgtSetName(nMachStartId, START_GEOM)
|
EgtSetName(nMachStartId, START_GEOM)
|
||||||
' coloro l'entita' di rosso
|
|
||||||
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
|
|
||||||
' creo layer ribs
|
' creo layer ribs
|
||||||
Dim nRibsLayerId As Integer = EgtCreateGroup(nPartId)
|
Dim nRibsLayerId As Integer = EgtCreateGroup(nPartId)
|
||||||
EgtSetName(nRibsLayerId, LAY_RIBS)
|
EgtSetName(nRibsLayerId, LAY_RIBS)
|
||||||
|
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
|
||||||
' creo layer shell number
|
' creo layer shell number
|
||||||
Dim nShellNumberLayerId As Integer = EgtCreateGroup(nPartId)
|
Dim nShellNumberLayerId As Integer = EgtCreateGroup(nPartId)
|
||||||
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
|
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
|
||||||
|
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
|
||||||
' creo layer aux
|
' creo layer aux
|
||||||
Dim nAuxSolidsLayerId As Integer = EgtCreateGroup(nPartId)
|
Dim nAuxSolidsLayerId As Integer = EgtCreateGroup(nPartId)
|
||||||
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
|
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
|
||||||
|
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
|
||||||
' creo layer others
|
' creo layer others
|
||||||
Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId)
|
Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId)
|
||||||
EgtSetName(nOthersLayerId, LAY_OTHERS)
|
EgtSetName(nOthersLayerId, LAY_OTHERS)
|
||||||
|
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
|
||||||
' aggiungo riferimento
|
' aggiungo riferimento
|
||||||
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
|
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
|
||||||
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
|
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
|
||||||
' Creo riferimento
|
|
||||||
Dim ptOrig As New Point3d(b3PrintSolid.Min())
|
|
||||||
Dim frPrintSolid As New Frame3d(ptOrig)
|
|
||||||
nFrameId = EgtCreateGeoFrame(nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
|
|
||||||
If nFrameId Then
|
|
||||||
EgtSetName(nFrameId, FRAME_PART)
|
|
||||||
EgtSetMode(nFrameId, GDB_MD.LOCKED)
|
|
||||||
End If
|
|
||||||
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
|
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
|
||||||
' appoggio il pezzo sulla tavola
|
' appoggio il pezzo sulla tavola
|
||||||
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
|
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
|
||||||
@@ -730,6 +728,8 @@ Public Class GeomEntity_MenuItem
|
|||||||
EgtSetInfo(nPartId, "PartOnTable", 1)
|
EgtSetInfo(nPartId, "PartOnTable", 1)
|
||||||
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
|
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
|
||||||
Map.refTopPanelVM.PartList.Add(NewPart)
|
Map.refTopPanelVM.PartList.Add(NewPart)
|
||||||
|
' aggiorno riferimento
|
||||||
|
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
|
||||||
Dim ManagePart_Part As ManagePart_Part = New ManagePart_Part(NewPart)
|
Dim ManagePart_Part As ManagePart_Part = New ManagePart_Part(NewPart)
|
||||||
' elimino da posizione originale
|
' elimino da posizione originale
|
||||||
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
|
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
|
||||||
@@ -741,9 +741,10 @@ Public Class GeomEntity_MenuItem
|
|||||||
' Imposto flag di ricalcolo slice
|
' Imposto flag di ricalcolo slice
|
||||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||||
End Select
|
End Select
|
||||||
'' aggiorno visibilita' da check di categoria
|
' aggiorno visibilita' da check di categoria
|
||||||
'Dim PrintLayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = ViewLayer.ViewLayerType.PRINT_SOLID)
|
Dim PrintViewlayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = ViewLayer.ViewLayerType.PRINT_SOLID)
|
||||||
'EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintLayer.bIsVisible) OrElse PrintLayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF))
|
EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintViewlayer.bIsVisible) OrElse PrintViewlayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF))
|
||||||
|
EgtDraw()
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
Select Case Map.refManagePartPanelVM.Type
|
Select Case Map.refManagePartPanelVM.Type
|
||||||
@@ -763,11 +764,18 @@ Public Class GeomEntity_MenuItem
|
|||||||
NewLayer.EntityList.Add(m_OrigEntity)
|
NewLayer.EntityList.Add(m_OrigEntity)
|
||||||
' aggiorno riferimenti nell'entita'
|
' aggiorno riferimenti nell'entita'
|
||||||
m_OrigEntity.UpdateOrigLayer(NewLayer)
|
m_OrigEntity.UpdateOrigLayer(NewLayer)
|
||||||
|
' aggiorno colore
|
||||||
|
EgtSetColor(m_OrigEntity.nId, GetColor(m_Type))
|
||||||
|
' aggiorno visibilita' da check di categoria
|
||||||
|
Dim PrintViewlayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = m_Type)
|
||||||
|
EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintViewlayer.bIsVisible) OrElse PrintViewlayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF))
|
||||||
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' aggiorno riferimenti nel context menu item
|
' aggiorno riferimenti nel context menu item
|
||||||
m_OrigEntity.UpdateContextMenu()
|
m_OrigEntity.UpdateContextMenu()
|
||||||
Case ManagePartPanelVM.ManagePartType.MODIFY
|
Case ManagePartPanelVM.ManagePartType.MODIFY
|
||||||
|
Dim bIsMovedRib As Boolean = False
|
||||||
' recupero layer da pezzo
|
' recupero layer da pezzo
|
||||||
Dim nLayerId As Integer = GDB_ID.NULL
|
Dim nLayerId As Integer = GDB_ID.NULL
|
||||||
Select Case m_Type
|
Select Case m_Type
|
||||||
@@ -789,18 +797,20 @@ Public Class GeomEntity_MenuItem
|
|||||||
' elimino info vecchio layer
|
' elimino info vecchio layer
|
||||||
Select Case m_OrigEntity.OrigLayer.Type
|
Select Case m_OrigEntity.OrigLayer.Type
|
||||||
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
||||||
EgtResetMark(m_OrigEntity.nId)
|
'EgtResetMark(m_OrigEntity.nId)
|
||||||
' se e' presente flag di spostamento a 45 gradi
|
' se e' presente flag di spostamento a 45 gradi
|
||||||
Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId))
|
Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId))
|
||||||
Dim vtMoved As Vector3d
|
Dim vtMoved As Vector3d
|
||||||
If EgtGetInfo(nPartId, "MovedPart", vtMoved) Then
|
If EgtGetInfo(nPartId, KEY_MOVEDPART, vtMoved) Then
|
||||||
' lo sposto e rimuovo info
|
' lo sposto e rimuovo info
|
||||||
EgtMove(m_OrigEntity.nId, -vtMoved, GDB_RT.GLOB)
|
EgtMove(m_OrigEntity.nId, -vtMoved, GDB_RT.GLOB)
|
||||||
EgtRemoveInfo(nPartId, "MovedPart")
|
EgtRemoveInfo(nPartId, KEY_MOVEDPART)
|
||||||
End If
|
End If
|
||||||
Case ManagePart_Layer.LayerType.MACH_START
|
Case ManagePart_Layer.LayerType.MACH_START
|
||||||
Case ManagePart_Layer.LayerType.RIBS
|
Case ManagePart_Layer.LayerType.RIBS
|
||||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
|
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
|
||||||
|
EgtRemoveInfo(m_OrigEntity.nId, RIB_ID)
|
||||||
|
bIsMovedRib = True
|
||||||
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
||||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE)
|
EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE)
|
||||||
Case ManagePart_Layer.LayerType.AUX_SOLIDS
|
Case ManagePart_Layer.LayerType.AUX_SOLIDS
|
||||||
@@ -826,14 +836,16 @@ Public Class GeomEntity_MenuItem
|
|||||||
EgtSetName(m_OrigEntity.nId, PRINT_SOLID)
|
EgtSetName(m_OrigEntity.nId, PRINT_SOLID)
|
||||||
EgtSetColor(m_OrigEntity.nId, c3Print)
|
EgtSetColor(m_OrigEntity.nId, c3Print)
|
||||||
' rimuovo eventuale nota spostamento per 45 gradi
|
' rimuovo eventuale nota spostamento per 45 gradi
|
||||||
EgtRemoveInfo(m_OrigEntity.OrigLayer.OrigPart.nId, "MovedPart")
|
EgtRemoveInfo(m_OrigEntity.OrigLayer.OrigPart.nId, KEY_MOVEDPART)
|
||||||
Case ManagePart_Layer.LayerType.MACH_START
|
Case ManagePart_Layer.LayerType.MACH_START
|
||||||
EgtSetName(m_OrigEntity.nId, LAY_MACH_START)
|
EgtSetName(m_OrigEntity.nId, LAY_MACH_START)
|
||||||
EgtSetColor(m_OrigEntity.nId, c3MachStart)
|
EgtSetColor(m_OrigEntity.nId, c3MachStart)
|
||||||
Case ManagePart_Layer.LayerType.RIBS
|
Case ManagePart_Layer.LayerType.RIBS
|
||||||
EgtSetName(m_OrigEntity.nId, LAY_RIBS)
|
EgtSetName(m_OrigEntity.nId, LAY_RIBS)
|
||||||
EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||||
|
EgtSetInfo(m_OrigEntity.nId, RIB_ID, RibPanelVM.GetNextRibIndex())
|
||||||
EgtSetColor(m_OrigEntity.nId, c3Rib)
|
EgtSetColor(m_OrigEntity.nId, c3Rib)
|
||||||
|
bIsMovedRib = True
|
||||||
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
||||||
EgtSetName(m_OrigEntity.nId, LAY_SHELL_NBR)
|
EgtSetName(m_OrigEntity.nId, LAY_SHELL_NBR)
|
||||||
EgtSetInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
|
EgtSetInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
|
||||||
@@ -846,6 +858,11 @@ Public Class GeomEntity_MenuItem
|
|||||||
EgtSetName(m_OrigEntity.nId, LAY_OTHERS)
|
EgtSetName(m_OrigEntity.nId, LAY_OTHERS)
|
||||||
EgtSetColor(m_OrigEntity.nId, c3Others)
|
EgtSetColor(m_OrigEntity.nId, c3Others)
|
||||||
End Select
|
End Select
|
||||||
|
' se spostato un Rib, aggiorno posizione riferimento e pezzo
|
||||||
|
If bIsMovedRib Then
|
||||||
|
Map.refReferencePanelVM.UpdateFramePosition(NewPart.PrintPart)
|
||||||
|
Map.refDispositionPanelVM.UpdateZPos()
|
||||||
|
End If
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
' aggiorno riferimenti nel context menu item
|
' aggiorno riferimenti nel context menu item
|
||||||
If bUpdateAllContextMenu Then
|
If bUpdateAllContextMenu Then
|
||||||
@@ -924,7 +941,8 @@ Public Class ManagerPart_MenuItem
|
|||||||
Select Case Map.refManagePartPanelVM.Type
|
Select Case Map.refManagePartPanelVM.Type
|
||||||
Case ManagePartPanelVM.ManagePartType.IMPORT
|
Case ManagePartPanelVM.ManagePartType.IMPORT
|
||||||
For Each Layer In m_OrigPart.LayerList
|
For Each Layer In m_OrigPart.LayerList
|
||||||
For Each Entity In Layer.EntityList
|
For EntityIndex = Layer.EntityList.Count - 1 To 0 Step -1
|
||||||
|
Dim Entity As PartManager_GeomEntity = Layer.EntityList(EntityIndex)
|
||||||
' le rimuovo da lista entita' pezzo
|
' le rimuovo da lista entita' pezzo
|
||||||
Layer.EntityList.Remove(Entity)
|
Layer.EntityList.Remove(Entity)
|
||||||
' la rimetto in lista importati
|
' la rimetto in lista importati
|
||||||
@@ -947,7 +965,9 @@ Public Class ManagerPart_MenuItem
|
|||||||
' aggiorno riferimenti nel context menu item
|
' aggiorno riferimenti nel context menu item
|
||||||
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
|
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
|
||||||
' Imposto flag di ricalcolo slice
|
' Imposto flag di ricalcolo slice
|
||||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
If Not IsNothing(Map.refTopPanelVM.SelPart) Then ' in prima importazione non c'e' alcun pezzo selezionato
|
||||||
|
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||||
|
End If
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Public Class Material
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Friend Sub UpdateIsModified()
|
Friend Sub UpdateIsModified()
|
||||||
m_bIsModified = m_CathegoryList.Any(Function(x) x.MaterialParamList.Any(Function(y) y.bIsModified))
|
m_bIsModified = m_CathegoryList.Any(Function(x) x.MaterialParamList.Any(Function(y) y.bIsModified)) OrElse bIsModifiedName
|
||||||
NotifyPropertyChanged(NameOf(ghName))
|
NotifyPropertyChanged(NameOf(ghName))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -31,23 +31,32 @@ Public Class Material
|
|||||||
Return m_nIndex
|
Return m_nIndex
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Friend Sub SetIndex(nValue As Integer)
|
||||||
|
m_nIndex = nValue
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private m_sGUID As String
|
Private m_sGUID As String
|
||||||
Public ReadOnly Property sGUID As String
|
Public Property sGUID As String
|
||||||
Get
|
Get
|
||||||
Return m_sGUID
|
Return m_sGUID
|
||||||
End Get
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sGUID = value
|
||||||
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private m_sOrigName As String = ""
|
||||||
Private m_sName As String
|
Private m_sName As String
|
||||||
Public Property sName As String
|
Public Property sName As String
|
||||||
Get
|
Get
|
||||||
Return m_sName
|
Return m_sName
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
|
Dim bIsModified As Boolean = m_sName <> value
|
||||||
m_sName = value
|
m_sName = value
|
||||||
Map.refMaterialDbVM.SetNameVisibility(False)
|
Map.refMaterialDbVM.SetNameVisibility(False)
|
||||||
NotifyPropertyChanged(NameOf(ghName))
|
If bIsModified Then UpdateIsModified()
|
||||||
|
Map.refMaterialDbVM.SetIsEnabled(True)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public ReadOnly Property ghName As String
|
Public ReadOnly Property ghName As String
|
||||||
@@ -55,12 +64,18 @@ Public Class Material
|
|||||||
Return m_sName & If(m_bIsModified, "*", "")
|
Return m_sName & If(m_bIsModified, "*", "")
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Public ReadOnly Property bIsModifiedName As Boolean
|
||||||
|
Get
|
||||||
|
Return m_sName <> m_sOrigName
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
' per lettura da file
|
' per lettura da file
|
||||||
Sub New(nIndex As Integer)
|
Sub New(nIndex As Integer)
|
||||||
m_nIndex = nIndex
|
m_nIndex = nIndex
|
||||||
ReadMaterialParamString(nIndex, MAT_GUID, "", m_sGUID)
|
ReadMaterialParamString(nIndex, MAT_GUID, "", m_sGUID)
|
||||||
ReadMaterialParamString(nIndex, MAT_NAME, "", m_sName)
|
ReadMaterialParamString(nIndex, MAT_NAME, "", m_sName)
|
||||||
|
m_sOrigName = m_sName
|
||||||
'EgtGetStringUtf8FromIni(nIndex, MAT_NAME, "", m_sName, sMatIniFilePath)
|
'EgtGetStringUtf8FromIni(nIndex, MAT_NAME, "", m_sName, sMatIniFilePath)
|
||||||
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.GENERAL, nIndex))
|
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.GENERAL, nIndex))
|
||||||
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.TEMPERATURES, nIndex))
|
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.TEMPERATURES, nIndex))
|
||||||
@@ -76,7 +91,8 @@ Public Class Material
|
|||||||
Sub New()
|
Sub New()
|
||||||
m_nIndex = Map.refMaterialDbVM.MaterialList.Max(Function(x) x.nIndex) + 1
|
m_nIndex = Map.refMaterialDbVM.MaterialList.Max(Function(x) x.nIndex) + 1
|
||||||
m_sGUID = Guid.NewGuid.ToString()
|
m_sGUID = Guid.NewGuid.ToString()
|
||||||
m_sName = "New Material Param"
|
m_sName = "New Material"
|
||||||
|
m_sOrigName = m_sName
|
||||||
Dim nCopyIndex As Integer = Map.refMaterialDbVM.SelMaterial.m_nIndex
|
Dim nCopyIndex As Integer = Map.refMaterialDbVM.SelMaterial.m_nIndex
|
||||||
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.GENERAL, nCopyIndex))
|
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.GENERAL, nCopyIndex))
|
||||||
Dim Orig As StringMaterialParam = m_CathegoryList(0).MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG)
|
Dim Orig As StringMaterialParam = m_CathegoryList(0).MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG)
|
||||||
@@ -133,6 +149,16 @@ Public Class Material
|
|||||||
'm_dRibsLeadOutWipeDir = ReadMaterialParamDouble(m_nIndex, MAC_RIBSLEADOUTWIPEDIR, 0, CurrentMachine.sMachiningFilePath)
|
'm_dRibsLeadOutWipeDir = ReadMaterialParamDouble(m_nIndex, MAC_RIBSLEADOUTWIPEDIR, 0, CurrentMachine.sMachiningFilePath)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SaveName()
|
||||||
|
m_sOrigName = m_sName
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ResetName()
|
||||||
|
m_sName = m_sOrigName
|
||||||
|
NotifyPropertyChanged(NameOf(ghName))
|
||||||
|
NotifyPropertyChanged(NameOf(sName))
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Sub Save()
|
Friend Sub Save()
|
||||||
If bIsModified Then
|
If bIsModified Then
|
||||||
' salvo tutti i parametri su orig
|
' salvo tutti i parametri su orig
|
||||||
@@ -145,15 +171,17 @@ Public Class Material
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SaveParams()
|
Private Sub SaveParams()
|
||||||
|
SaveName()
|
||||||
For Each Cathegory In m_CathegoryList
|
For Each Cathegory In m_CathegoryList
|
||||||
Cathegory.SaveParams()
|
Cathegory.SaveParams()
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub ResetModification()
|
Friend Sub ResetModification()
|
||||||
|
ResetName()
|
||||||
If bIsModified Then
|
If bIsModified Then
|
||||||
' annullo le modifiche di tutti i parametri
|
' annullo le modifiche di tutti i parametri
|
||||||
SaveParams()
|
ResetParams()
|
||||||
' resetto stato di modificata
|
' resetto stato di modificata
|
||||||
UpdateIsModified()
|
UpdateIsModified()
|
||||||
End If
|
End If
|
||||||
@@ -165,12 +193,12 @@ Public Class Material
|
|||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub WriteParamsOnDb(nIndex As Integer)
|
Friend Sub WriteParamsOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||||
WriteMaterialParam(nIndex, MAT_GUID, m_sGUID)
|
WriteMaterialParam(nIndex, MAT_GUID, m_sGUID, sFilePath)
|
||||||
WriteMaterialParam(nIndex, MAT_NAME, m_sName)
|
WriteMaterialParam(nIndex, MAT_NAME, m_sName, sFilePath)
|
||||||
' EgtWriteStringUtf8toIni(nIndex, MAT_NAME, m_sName)
|
' EgtWriteStringUtf8toIni(nIndex, MAT_NAME, m_sName)
|
||||||
For Each Cathegory In m_CathegoryList
|
For Each Cathegory In m_CathegoryList
|
||||||
Cathegory.WriteParamOnDb(nIndex)
|
Cathegory.WriteParamOnDb(nIndex, sFilePath)
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -215,6 +243,7 @@ Public Class MaterialIndex
|
|||||||
|
|
||||||
Friend Function GetSelMaterialData(Param As MaterialParam.Params) As Double
|
Friend Function GetSelMaterialData(Param As MaterialParam.Params) As Double
|
||||||
Dim sParamKey As String = ""
|
Dim sParamKey As String = ""
|
||||||
|
Dim dDefault As Double = 0
|
||||||
Select Case Param
|
Select Case Param
|
||||||
Case MaterialParam.Params.T1
|
Case MaterialParam.Params.T1
|
||||||
sParamKey = MAT_T1
|
sParamKey = MAT_T1
|
||||||
@@ -228,8 +257,10 @@ Public Class MaterialIndex
|
|||||||
sParamKey = MAT_T5
|
sParamKey = MAT_T5
|
||||||
Case MaterialParam.Params.K_EXTRUSION
|
Case MaterialParam.Params.K_EXTRUSION
|
||||||
sParamKey = MAT_KEXTRUSION
|
sParamKey = MAT_KEXTRUSION
|
||||||
|
dDefault = 100
|
||||||
Case MaterialParam.Params.K_LAY_TIME
|
Case MaterialParam.Params.K_LAY_TIME
|
||||||
sParamKey = MAT_KLAYERTIME
|
sParamKey = MAT_KLAYERTIME
|
||||||
|
dDefault = 100
|
||||||
Case MaterialParam.Params.C1
|
Case MaterialParam.Params.C1
|
||||||
sParamKey = MAT_C1
|
sParamKey = MAT_C1
|
||||||
Case MaterialParam.Params.C2
|
Case MaterialParam.Params.C2
|
||||||
@@ -255,7 +286,7 @@ Public Class MaterialIndex
|
|||||||
Case MaterialParam.Params.KN
|
Case MaterialParam.Params.KN
|
||||||
sParamKey = MAT_KN
|
sParamKey = MAT_KN
|
||||||
End Select
|
End Select
|
||||||
Return ReadMaterialParamDouble(m_nIndex, sParamKey, 0)
|
Return ReadMaterialParamDouble(m_nIndex, sParamKey, dDefault)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -355,9 +386,9 @@ Public Class MaterialCathegory
|
|||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub WriteParamOnDb(nIndex As Integer)
|
Friend Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||||
For Each Param In m_MaterialParamList
|
For Each Param In m_MaterialParamList
|
||||||
Param.WriteParamOnDb(nIndex)
|
Param.WriteParamOnDb(nIndex, sFilePath)
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -453,7 +484,7 @@ Public MustInherit Class MaterialParam
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Friend MustOverride Sub WriteParamOnDb(nIndex As Integer)
|
Friend MustOverride Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||||
Friend MustOverride Sub SaveParam()
|
Friend MustOverride Sub SaveParam()
|
||||||
Friend MustOverride Sub ResetParam()
|
Friend MustOverride Sub ResetParam()
|
||||||
|
|
||||||
@@ -556,7 +587,7 @@ Public Class NumericMaterialParam
|
|||||||
m_dOrigValue = m_dValue
|
m_dOrigValue = m_dValue
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||||
Dim sWriteValue As String = ""
|
Dim sWriteValue As String = ""
|
||||||
If m_bIsLen Then
|
If m_bIsLen Then
|
||||||
sWriteValue = LenToString(m_dValue, 5)
|
sWriteValue = LenToString(m_dValue, 5)
|
||||||
@@ -565,43 +596,43 @@ Public Class NumericMaterialParam
|
|||||||
End If
|
End If
|
||||||
Select Case Type
|
Select Case Type
|
||||||
Case Params.T1
|
Case Params.T1
|
||||||
WriteMaterialParam(nIndex, MAT_T1, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_T1, sWriteValue, sFilePath)
|
||||||
Case Params.T2
|
Case Params.T2
|
||||||
WriteMaterialParam(nIndex, MAT_T2, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_T2, sWriteValue, sFilePath)
|
||||||
Case Params.T3
|
Case Params.T3
|
||||||
WriteMaterialParam(nIndex, MAT_T3, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_T3, sWriteValue, sFilePath)
|
||||||
Case Params.T4
|
Case Params.T4
|
||||||
WriteMaterialParam(nIndex, MAT_T4, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_T4, sWriteValue, sFilePath)
|
||||||
Case Params.T5
|
Case Params.T5
|
||||||
WriteMaterialParam(nIndex, MAT_T5, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_T5, sWriteValue, sFilePath)
|
||||||
Case Params.K_EXTRUSION
|
Case Params.K_EXTRUSION
|
||||||
WriteMaterialParam(nIndex, MAT_KEXTRUSION, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_KEXTRUSION, sWriteValue, sFilePath)
|
||||||
Case Params.K_LAY_TIME
|
Case Params.K_LAY_TIME
|
||||||
WriteMaterialParam(nIndex, MAT_KLAYERTIME, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_KLAYERTIME, sWriteValue, sFilePath)
|
||||||
Case Params.C1
|
Case Params.C1
|
||||||
WriteMaterialParam(nIndex, MAT_C1, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_C1, sWriteValue, sFilePath)
|
||||||
Case Params.C2
|
Case Params.C2
|
||||||
WriteMaterialParam(nIndex, MAT_C2, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_C2, sWriteValue, sFilePath)
|
||||||
Case Params.DENSITY
|
Case Params.DENSITY
|
||||||
WriteMaterialParam(nIndex, MAT_DENSITY, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_DENSITY, sWriteValue, sFilePath)
|
||||||
Case Params.AMAX
|
Case Params.AMAX
|
||||||
WriteMaterialParam(nIndex, MAT_AMAX, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_AMAX, sWriteValue, sFilePath)
|
||||||
Case Params.ATRG
|
Case Params.ATRG
|
||||||
WriteMaterialParam(nIndex, MAT_ATRG, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_ATRG, sWriteValue, sFilePath)
|
||||||
Case Params.AMIN
|
Case Params.AMIN
|
||||||
WriteMaterialParam(nIndex, MAT_AMIN, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_AMIN, sWriteValue, sFilePath)
|
||||||
Case Params.BMAX
|
Case Params.BMAX
|
||||||
WriteMaterialParam(nIndex, MAT_BMAX, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_BMAX, sWriteValue, sFilePath)
|
||||||
Case Params.BTRG
|
Case Params.BTRG
|
||||||
WriteMaterialParam(nIndex, MAT_BTRG, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_BTRG, sWriteValue, sFilePath)
|
||||||
Case Params.BMIN
|
Case Params.BMIN
|
||||||
WriteMaterialParam(nIndex, MAT_BMIN, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_BMIN, sWriteValue, sFilePath)
|
||||||
Case Params.KW
|
Case Params.KW
|
||||||
WriteMaterialParam(nIndex, MAT_KW, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_KW, sWriteValue, sFilePath)
|
||||||
Case Params.KZ
|
Case Params.KZ
|
||||||
WriteMaterialParam(nIndex, MAT_KZ, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_KZ, sWriteValue, sFilePath)
|
||||||
Case Params.KN
|
Case Params.KN
|
||||||
WriteMaterialParam(nIndex, MAT_KN, sWriteValue)
|
WriteMaterialParam(nIndex, MAT_KN, sWriteValue, sFilePath)
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -618,8 +649,6 @@ End Class
|
|||||||
Public Class StringMaterialParam
|
Public Class StringMaterialParam
|
||||||
Inherits MaterialParam
|
Inherits MaterialParam
|
||||||
|
|
||||||
Public Const DEFAULT_MATERIAL As String = "***"
|
|
||||||
|
|
||||||
Private m_sGUID As String
|
Private m_sGUID As String
|
||||||
Public Property sGUID As String
|
Public Property sGUID As String
|
||||||
Get
|
Get
|
||||||
@@ -684,9 +713,9 @@ Public Class StringMaterialParam
|
|||||||
Case Params.ORIG
|
Case Params.ORIG
|
||||||
Dim sOrigGUID As String = ""
|
Dim sOrigGUID As String = ""
|
||||||
ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID)
|
ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID)
|
||||||
If sOrigGUID = DEFAULT_MATERIAL Then
|
If sOrigGUID = ORIG_MATERIAL Then
|
||||||
m_sGUID = DEFAULT_MATERIAL
|
m_sGUID = ORIG_MATERIAL
|
||||||
m_sValue = DEFAULT_MATERIAL
|
m_sValue = ORIG_MATERIAL
|
||||||
' se livello alto, lo visualizzo comunque
|
' se livello alto, lo visualizzo comunque
|
||||||
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
|
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
|
||||||
m_String_Visibility = Visibility.Visible
|
m_String_Visibility = Visibility.Visible
|
||||||
@@ -711,10 +740,10 @@ Public Class StringMaterialParam
|
|||||||
m_sOrigValue = m_sValue
|
m_sOrigValue = m_sValue
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||||
Select Case Type
|
Select Case Type
|
||||||
Case Params.ORIG
|
Case Params.ORIG
|
||||||
WriteMaterialParam(nIndex, MAT_ORIG, m_sGUID)
|
WriteMaterialParam(nIndex, MAT_ORIG, m_sGUID, sFilePath)
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -741,8 +770,8 @@ Public Class StringMaterialParam
|
|||||||
|
|
||||||
Public Sub Original()
|
Public Sub Original()
|
||||||
If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
|
If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
|
||||||
m_sGUID = DEFAULT_MATERIAL
|
m_sGUID = ORIG_MATERIAL
|
||||||
m_sValue = DEFAULT_MATERIAL
|
m_sValue = ORIG_MATERIAL
|
||||||
NotifyPropertyChanged(NameOf(sValue))
|
NotifyPropertyChanged(NameOf(sValue))
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -798,10 +827,10 @@ Public Class ComboMaterialParam
|
|||||||
m_OrigSelValue = m_SelValue
|
m_OrigSelValue = m_SelValue
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||||
Select Case Type
|
Select Case Type
|
||||||
'Case Params.STRANDORDER
|
'Case Params.STRANDORDER
|
||||||
' WriteMaterialParam(nIndex, MAC_STRANDORDER, m_SelValue.Id)
|
' WriteMaterialParam(nIndex, MAC_STRANDORDER, m_SelValue.Id, sFilePath)
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -849,7 +878,7 @@ Public Class CheckMaterialParam
|
|||||||
m_bOrigValue = m_bValue
|
m_bOrigValue = m_bValue
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||||
Select Case Type
|
Select Case Type
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -13,39 +13,70 @@
|
|||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<UniformGrid Rows="1">
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
<Button Content="Copy"
|
<Button Content="Copy"
|
||||||
Command="{Binding Copy_Command}"
|
Command="{Binding Copy_Command}"
|
||||||
|
IsEnabled="{Binding IsEnabled}"
|
||||||
Style="{StaticResource ToolBar_TextButton}"/>
|
Style="{StaticResource ToolBar_TextButton}"/>
|
||||||
<Button Content="Save"
|
<Button Grid.Column="1"
|
||||||
|
Content="Save"
|
||||||
Command="{Binding Save_Command}"
|
Command="{Binding Save_Command}"
|
||||||
|
IsEnabled="{Binding IsEnabled}"
|
||||||
Style="{StaticResource ToolBar_TextButton}"/>
|
Style="{StaticResource ToolBar_TextButton}"/>
|
||||||
<Button Content="Delete"
|
<Button Grid.Column="2" Content="Delete"
|
||||||
Command="{Binding Delete_Command}"
|
Command="{Binding Delete_Command}"
|
||||||
IsEnabled="{Binding Delete_IsEnabled}"
|
IsEnabled="{Binding Delete_IsEnabled}"
|
||||||
Style="{StaticResource ToolBar_TextButton}"/>
|
Style="{StaticResource ToolBar_TextButton}"/>
|
||||||
</UniformGrid>
|
<Button Grid.Column="3"
|
||||||
<ComboBox Grid.Row="1"
|
Command="{Binding Import_Command}"
|
||||||
Name="MaterialCombo"
|
ToolTip="{Binding ImportToolTip}"
|
||||||
ItemsSource="{Binding MaterialList}"
|
IsEnabled="{Binding ImpExp_IsEnabled}"
|
||||||
SelectedItem="{Binding SelMaterial}"
|
Style="{StaticResource ToolBar_Button}">
|
||||||
DisplayMemberPath="ghName"/>
|
<Image Source="/Resources/MachiningDB/Import.png" Stretch="Uniform"/>
|
||||||
<Grid Grid.Row="2"
|
</Button>
|
||||||
Visibility="{Binding Name_Visibility}">
|
<Button Grid.Column="4"
|
||||||
|
Command="{Binding Export_Command}"
|
||||||
|
ToolTip="{Binding ImportToolTip}"
|
||||||
|
IsEnabled="{Binding ImpExp_IsEnabled}"
|
||||||
|
Style="{StaticResource ToolBar_Button}">
|
||||||
|
<Image Source="/Resources/MachiningDB/Export.png" Stretch="Uniform"/>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2*"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="{Binding Name_Msg}"/>
|
<ComboBox Grid.Row="1"
|
||||||
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
Name="MaterialCombo"
|
||||||
Text="{Binding SelectedItem.sName, ElementName=MaterialCombo, UpdateSourceTrigger=Explicit}"/>
|
ItemsSource="{Binding MaterialList}"
|
||||||
|
SelectedItem="{Binding SelMaterial}"
|
||||||
|
DisplayMemberPath="ghName"
|
||||||
|
Visibility="{Binding Combo_Visibility}"
|
||||||
|
Style="{StaticResource FeatureComboBox}"/>
|
||||||
|
<EgtWPFLib5:EgtTextBox Text="{Binding SelectedItem.sName, ElementName=MaterialCombo, UpdateSourceTrigger=Explicit}"
|
||||||
|
ExplicitUpdateSource="EnterKeyPressOrLostFocus"
|
||||||
|
IsExplicitFocused="{Binding UserShouldEditValueNow}"
|
||||||
|
Visibility="{Binding Name_Visibility}"/>
|
||||||
|
<Button Grid.Column="1"
|
||||||
|
Command="{Binding EditName_Command}"
|
||||||
|
Style="{StaticResource ToolBar_Button}">
|
||||||
|
<Image Source="/Resources/TopPanel/Edit.png"/>
|
||||||
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<ScrollViewer Grid.Row="3"
|
<ScrollViewer Grid.Row="2"
|
||||||
VerticalScrollBarVisibility="Auto"
|
VerticalScrollBarVisibility="Auto"
|
||||||
HorizontalScrollBarVisibility="Disabled">
|
HorizontalScrollBarVisibility="Disabled">
|
||||||
<ItemsControl Grid.Row="1"
|
<ItemsControl Grid.Row="1"
|
||||||
ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MaterialCombo}">
|
ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MaterialCombo}"
|
||||||
|
IsEnabled="{Binding IsEnabled}">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<StackPanel Orientation="Vertical"/>
|
<StackPanel Orientation="Vertical"/>
|
||||||
@@ -80,15 +111,6 @@
|
|||||||
<TextBlock Text="{Binding sName}"/>
|
<TextBlock Text="{Binding sName}"/>
|
||||||
<TextBox Grid.Column="1"
|
<TextBox Grid.Column="1"
|
||||||
Text="{Binding dValue}"/>
|
Text="{Binding dValue}"/>
|
||||||
<!--<Button Grid.Column="2"
|
|
||||||
Content="R"
|
|
||||||
Command="{Binding ResetParam_Command}"
|
|
||||||
CommandParameter="dCurrStrandH"
|
|
||||||
IsEnabled="{Binding bCurrStrandH_IsModified}"
|
|
||||||
VerticalContentAlignment="Center"
|
|
||||||
HorizontalContentAlignment="Center"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
Style="{StaticResource ToolBar_SmallButton}"/>-->
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type PrintApp:StringMaterialParam}">
|
<DataTemplate DataType="{x:Type PrintApp:StringMaterialParam}">
|
||||||
@@ -117,22 +139,12 @@
|
|||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<!--<ColumnDefinition Width="Auto"/>-->
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="{Binding sName}"/>
|
<TextBlock Text="{Binding sName}"/>
|
||||||
<ComboBox Grid.Column="1"
|
<ComboBox Grid.Column="1"
|
||||||
ItemsSource="{Binding ValueList}"
|
ItemsSource="{Binding ValueList}"
|
||||||
SelectedItem="{Binding SelValue}"
|
SelectedItem="{Binding SelValue}"
|
||||||
HorizontalAlignment="Stretch"/>
|
HorizontalAlignment="Stretch"/>
|
||||||
<!--<Button Grid.Column="1"
|
|
||||||
Content="R"
|
|
||||||
Command="{Binding ResetParam_Command}"
|
|
||||||
CommandParameter="dCurrStrandH"
|
|
||||||
IsEnabled="{Binding bCurrStrandH_IsModified}"
|
|
||||||
VerticalContentAlignment="Center"
|
|
||||||
HorizontalContentAlignment="Center"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
Style="{StaticResource ToolBar_SmallButton}"/>-->
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type PrintApp:CheckMaterialParam}">
|
<DataTemplate DataType="{x:Type PrintApp:CheckMaterialParam}">
|
||||||
@@ -140,22 +152,12 @@
|
|||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<!--<ColumnDefinition Width="Auto"/>-->
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="{Binding sName}"/>
|
<TextBlock Text="{Binding sName}"/>
|
||||||
<CheckBox Grid.Column="1"
|
<CheckBox Grid.Column="1"
|
||||||
IsChecked="{Binding bValue}"
|
IsChecked="{Binding bValue}"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"/>
|
VerticalAlignment="Center"/>
|
||||||
<!--<Button Grid.Column="1"
|
|
||||||
Content="R"
|
|
||||||
Command="{Binding ResetParam_Command}"
|
|
||||||
CommandParameter="dCurrStrandH"
|
|
||||||
IsEnabled="{Binding bCurrStrandH_IsModified}"
|
|
||||||
VerticalContentAlignment="Center"
|
|
||||||
HorizontalContentAlignment="Center"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
Style="{StaticResource ToolBar_SmallButton}"/>-->
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.Resources>
|
</ItemsControl.Resources>
|
||||||
@@ -165,9 +167,10 @@
|
|||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<UniformGrid Grid.Row="4" Rows="1">
|
<UniformGrid Grid.Row="3" Rows="1">
|
||||||
<Button Content="Ok"
|
<Button Content="Ok"
|
||||||
Command="{Binding Ok_Command}"
|
Command="{Binding Ok_Command}"
|
||||||
|
IsEnabled="{Binding IsEnabled}"
|
||||||
Style="{StaticResource ToolBar_TextButton}"/>
|
Style="{StaticResource ToolBar_TextButton}"/>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -60,10 +60,13 @@ Public Class MaterialDbVM
|
|||||||
Return m_Name_Visibility
|
Return m_Name_Visibility
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Friend Sub SetNameVisibility(bValue As Boolean)
|
|
||||||
m_Name_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
|
Private m_Combo_Visibility As Visibility = Visibility.Visible
|
||||||
NotifyPropertyChanged(NameOf(Name_Visibility))
|
Public ReadOnly Property Combo_Visibility As Visibility
|
||||||
End Sub
|
Get
|
||||||
|
Return m_Combo_Visibility
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
' variabile che indica se una qualunque lavorazione e' stata modificata
|
' variabile che indica se una qualunque lavorazione e' stata modificata
|
||||||
Private m_bIsModified As Boolean
|
Private m_bIsModified As Boolean
|
||||||
@@ -76,10 +79,22 @@ Public Class MaterialDbVM
|
|||||||
m_bIsModified = value
|
m_bIsModified = value
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private m_IsEnabled As Boolean = True
|
||||||
|
Public ReadOnly Property IsEnabled As Boolean
|
||||||
|
Get
|
||||||
|
Return m_IsEnabled
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Friend Sub SetIsEnabled(value As Boolean)
|
||||||
|
m_IsEnabled = value
|
||||||
|
NotifyPropertyChanged(NameOf(IsEnabled))
|
||||||
|
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private m_Delete_IsEnabled As Boolean = True
|
Private m_Delete_IsEnabled As Boolean = True
|
||||||
Public ReadOnly Property Delete_IsEnabled As Boolean
|
Public ReadOnly Property Delete_IsEnabled As Boolean
|
||||||
Get
|
Get
|
||||||
Return m_Delete_IsEnabled
|
Return m_IsEnabled AndAlso m_Delete_IsEnabled
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Friend Sub SetDeleteIsEnabled(value As Boolean)
|
Friend Sub SetDeleteIsEnabled(value As Boolean)
|
||||||
@@ -91,11 +106,36 @@ Public Class MaterialDbVM
|
|||||||
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
|
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private m_UserShouldEditValueNow As Boolean = False
|
||||||
|
Public Property UserShouldEditValueNow As Boolean
|
||||||
|
Get
|
||||||
|
Return m_UserShouldEditValueNow
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
m_UserShouldEditValueNow = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
Friend Sub SetUserShouldEditValueNow()
|
||||||
|
m_UserShouldEditValueNow = True
|
||||||
|
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
|
||||||
|
m_UserShouldEditValueNow = False
|
||||||
|
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public ReadOnly Property ImpExp_IsEnabled As Boolean
|
||||||
|
Get
|
||||||
|
Return m_IsEnabled AndAlso (IsNothing(m_SelMaterial) OrElse Not m_SelMaterial.bIsModified)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
' Definizione comandi
|
' Definizione comandi
|
||||||
Private m_cmdOk As ICommand
|
Private m_cmdOk As ICommand
|
||||||
Private m_cmdCopy As ICommand
|
Private m_cmdCopy As ICommand
|
||||||
Private m_cmdSave As ICommand
|
Private m_cmdSave As ICommand
|
||||||
Private m_cmdDelete As ICommand
|
Private m_cmdDelete As ICommand
|
||||||
|
Private m_cmdEditName As ICommand
|
||||||
|
Private m_cmdImport As ICommand
|
||||||
|
Private m_cmdExport As ICommand
|
||||||
|
|
||||||
#End Region ' FIELDS & PROPERTIES
|
#End Region ' FIELDS & PROPERTIES
|
||||||
|
|
||||||
@@ -133,6 +173,14 @@ Public Class MaterialDbVM
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub SetNameVisibility(bValue As Boolean)
|
||||||
|
m_Name_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
|
||||||
|
m_Combo_Visibility = If(Not bValue, Visibility.Visible, Visibility.Collapsed)
|
||||||
|
NotifyPropertyChanged(NameOf(Name_Visibility))
|
||||||
|
NotifyPropertyChanged(NameOf(Combo_Visibility))
|
||||||
|
If bValue Then SetUserShouldEditValueNow()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Function SelMaterialIsOriginal() As Boolean
|
Private Function SelMaterialIsOriginal() As Boolean
|
||||||
If IsNothing(m_SelMaterial) Then Return False
|
If IsNothing(m_SelMaterial) Then Return False
|
||||||
' verifico abilitazione delete
|
' verifico abilitazione delete
|
||||||
@@ -140,7 +188,7 @@ Public Class MaterialDbVM
|
|||||||
If Not IsNothing(General) Then
|
If Not IsNothing(General) Then
|
||||||
Dim Original As MaterialParam = General.MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG)
|
Dim Original As MaterialParam = General.MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG)
|
||||||
If Not IsNothing(Original) Then
|
If Not IsNothing(Original) Then
|
||||||
If DirectCast(Original, StringMaterialParam).sValue = StringMaterialParam.DEFAULT_MATERIAL Then
|
If DirectCast(Original, StringMaterialParam).sValue = ORIG_MATERIAL Then
|
||||||
Return True
|
Return True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -176,7 +224,7 @@ Public Class MaterialDbVM
|
|||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
If m_bIsModified Then
|
If m_bIsModified Then
|
||||||
Dim sBakMatIniFilePath As String = Path.ChangeExtension(CurrentMachine.sMaterialsFilePath, ".bak")
|
Dim sBakMatIniFilePath As String = Path.ChangeExtension(CurrentMachine.sMaterialFilePath, ".bak")
|
||||||
If File.Exists(sBakMatIniFilePath) Then
|
If File.Exists(sBakMatIniFilePath) Then
|
||||||
Try
|
Try
|
||||||
' cambio estensione in bak a file Db vecchio
|
' cambio estensione in bak a file Db vecchio
|
||||||
@@ -184,24 +232,24 @@ Public Class MaterialDbVM
|
|||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
If File.Exists(CurrentMachine.sMaterialsFilePath) Then
|
If File.Exists(CurrentMachine.sMaterialFilePath) Then
|
||||||
Try
|
Try
|
||||||
' cambio estensione in bak a file Db vecchio
|
' cambio estensione in bak a file Db vecchio
|
||||||
File.Move(CurrentMachine.sMaterialsFilePath, sBakMatIniFilePath)
|
File.Move(CurrentMachine.sMaterialFilePath, sBakMatIniFilePath)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
' se ancora esiste lo elimino
|
' se ancora esiste lo elimino
|
||||||
If File.Exists(CurrentMachine.sMaterialsFilePath) Then
|
If File.Exists(CurrentMachine.sMaterialFilePath) Then
|
||||||
Try
|
Try
|
||||||
File.Delete(CurrentMachine.sMaterialsFilePath)
|
File.Delete(CurrentMachine.sMaterialFilePath)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
' creo nuovo file
|
' creo nuovo file
|
||||||
If Not File.Exists(CurrentMachine.sMaterialsFilePath) Then
|
If Not File.Exists(CurrentMachine.sMaterialFilePath) Then
|
||||||
Try
|
Try
|
||||||
File.WriteAllLines(CurrentMachine.sMaterialsFilePath, {"; Commento per evitare BOM con UTF-8"})
|
File.WriteAllLines(CurrentMachine.sMaterialFilePath, {"; Commento per evitare BOM con UTF-8"})
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
@@ -291,12 +339,28 @@ Public Class MaterialDbVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub Delete()
|
Public Sub Delete()
|
||||||
|
Dim sCheckMessage As String = "Are you sure you want to delete selected material?"
|
||||||
' se materiale originale, esco
|
' se materiale originale, esco
|
||||||
If SelMaterialIsOriginal() Then Return
|
If SelMaterialIsOriginal() Then
|
||||||
|
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
|
||||||
|
If MessageBox.Show("Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
sCheckMessage = "Trying to delete an Original Material! Are you ABSOLUTELY sure you want to delete it?"
|
||||||
|
Else
|
||||||
|
MessageBox.Show("Original material impossible to delete!")
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
End If
|
||||||
' chiedo conferma
|
' chiedo conferma
|
||||||
Select Case MessageBox.Show("Are you sure you want to delete selected material?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
|
Select Case MessageBox.Show(sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
|
||||||
Case MessageBoxResult.Yes
|
Case MessageBoxResult.Yes
|
||||||
m_MaterialList.Remove(m_SelMaterial)
|
m_MaterialList.Remove(m_SelMaterial)
|
||||||
|
SetIsModified(True)
|
||||||
|
If m_MaterialList.Count > 0 Then
|
||||||
|
SelMaterial = m_MaterialList(0)
|
||||||
|
NotifyPropertyChanged(NameOf(SelMaterial))
|
||||||
|
End If
|
||||||
' segno Db come modificato
|
' segno Db come modificato
|
||||||
Map.refMaterialDbVM.SetIsModified(True)
|
Map.refMaterialDbVM.SetIsModified(True)
|
||||||
Case MessageBoxResult.No
|
Case MessageBoxResult.No
|
||||||
@@ -306,6 +370,78 @@ Public Class MaterialDbVM
|
|||||||
|
|
||||||
#End Region ' Delete
|
#End Region ' Delete
|
||||||
|
|
||||||
|
#Region "EditName"
|
||||||
|
|
||||||
|
Public ReadOnly Property EditName_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdEditName Is Nothing Then
|
||||||
|
m_cmdEditName = New Command(AddressOf EditName)
|
||||||
|
End If
|
||||||
|
Return m_cmdEditName
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub EditName()
|
||||||
|
If IsNothing(m_SelMaterial) Then Return
|
||||||
|
SetNameVisibility(True)
|
||||||
|
SetIsEnabled(False)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' EditName
|
||||||
|
|
||||||
|
#Region "Import"
|
||||||
|
|
||||||
|
Public ReadOnly Property Import_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdImport Is Nothing Then
|
||||||
|
m_cmdImport = New Command(AddressOf Import)
|
||||||
|
End If
|
||||||
|
Return m_cmdImport
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub Import()
|
||||||
|
' chiedo il nome del file .data da aprire
|
||||||
|
Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {.Title = EgtMsg(31451) & " " & EgtMsg(31452),
|
||||||
|
.Filter = "Material file data (*" & ImportExportMachiningPanelVM.MaterialDataExtension & ")|*" & ImportExportMachiningPanelVM.MaterialDataExtension &
|
||||||
|
"|Original Material file data (*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & ")|*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension &
|
||||||
|
"|All Material file data (*" & ImportExportMachiningPanelVM.MaterialDataExtension & "," & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & ")|*" &
|
||||||
|
ImportExportMachiningPanelVM.MaterialDataExtension & ";*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension,
|
||||||
|
.FilterIndex = 3,
|
||||||
|
.FileName = String.Empty}
|
||||||
|
If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
|
||||||
|
Dim ImportWindowVM As New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MATERIAL, ImportExportMachiningPanelVM.WindowModeEnum.IMPORT, OpenFileDlg.FileName)
|
||||||
|
If ImportWindowVM.WindowMode <> ImportExportMachiningPanelVM.WindowModeEnum.IMPORT_ORIG Then
|
||||||
|
Dim ImportWindowV As New ImportExportMachiningPanelV(Application.Current.MainWindow, ImportWindowVM)
|
||||||
|
ImportWindowV.ShowDialog()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' Import
|
||||||
|
|
||||||
|
#Region "Export"
|
||||||
|
|
||||||
|
Public ReadOnly Property Export_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdExport Is Nothing Then
|
||||||
|
m_cmdExport = New Command(AddressOf Export)
|
||||||
|
End If
|
||||||
|
Return m_cmdExport
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub Export()
|
||||||
|
Dim ExportMode As ImportExportMachiningPanelVM.WindowModeEnum = ImportExportMachiningPanelVM.WindowModeEnum.EXPORT
|
||||||
|
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
|
||||||
|
ExportMode = ImportExportMachiningPanelVM.WindowModeEnum.EXPORT_ORIG
|
||||||
|
End If
|
||||||
|
Dim ExportWindowVM As New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MATERIAL, ExportMode)
|
||||||
|
Dim ExportWindowV As New ImportExportMachiningPanelV(Application.Current.MainWindow, ExportWindowVM)
|
||||||
|
ExportWindowV.ShowDialog()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' Export
|
||||||
|
|
||||||
#End Region ' COMMANDS
|
#End Region ' COMMANDS
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -70,5 +70,5 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.5.1.1")>
|
<Assembly: AssemblyVersion("2.5.2.2")>
|
||||||
<Assembly: AssemblyFileVersion("2.5.1.1")>
|
<Assembly: AssemblyFileVersion("2.5.2.2")>
|
||||||
|
|||||||
@@ -1162,11 +1162,12 @@ Public Class LayerColor
|
|||||||
|
|
||||||
Public Enum LayerType As Integer
|
Public Enum LayerType As Integer
|
||||||
PRINTPART = 1
|
PRINTPART = 1
|
||||||
RIBS = 2
|
'REFERENCE = 2
|
||||||
SHELLNUMBERS = 3
|
MACHSTART = 3
|
||||||
AUXSOLIDS = 4
|
RIBS = 4
|
||||||
MACHSTART = 5
|
SHELLNUMBERS = 5
|
||||||
OTHERS = 6
|
AUXSOLIDS = 6
|
||||||
|
OTHERS = 7
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
Private m_Type As LayerType
|
Private m_Type As LayerType
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ Public Class ReferencePanelVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As ReferenceBtn)
|
Set(value As ReferenceBtn)
|
||||||
m_SelReference = value.Type
|
m_SelReference = value.Type
|
||||||
|
EgtSetInfo(Map.refTopPanelVM.SelPart.nReferenceLayerId, KEY_REFERENCE, value.Type)
|
||||||
UpdateFramePosition()
|
UpdateFramePosition()
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -42,6 +43,7 @@ Public Class ReferencePanelVM
|
|||||||
If value Then
|
If value Then
|
||||||
m_SelReference = ReferenceBtn.References.FROM_IMPORT
|
m_SelReference = ReferenceBtn.References.FROM_IMPORT
|
||||||
NotifyPropertyChanged(NameOf(ghSelReference))
|
NotifyPropertyChanged(NameOf(ghSelReference))
|
||||||
|
EgtSetInfo(Map.refTopPanelVM.SelPart.nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.FROM_IMPORT)
|
||||||
UpdateFramePosition()
|
UpdateFramePosition()
|
||||||
End If
|
End If
|
||||||
End Set
|
End Set
|
||||||
@@ -68,45 +70,51 @@ Public Class ReferencePanelVM
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub UpdateFramePosition(Optional SelPart As Print3dPartVM = Nothing)
|
Friend Sub UpdateFramePosition(Optional SelPart As Print3dPartVM = Nothing)
|
||||||
If IsNothing(SelPart) Then SelPart = Map.refTopPanelVM.SelPart
|
Dim SelReference As Integer = ReferenceBtn.References.BL
|
||||||
|
If IsNothing(SelPart) Then
|
||||||
|
SelPart = Map.refTopPanelVM.SelPart
|
||||||
|
End If
|
||||||
|
EgtGetInfo(SelPart.nReferenceLayerId, KEY_REFERENCE, SelReference)
|
||||||
' elimino precedente
|
' elimino precedente
|
||||||
EgtEmptyGroup(SelPart.nReferenceLayerId)
|
EgtEmptyGroup(SelPart.nReferenceLayerId)
|
||||||
' Creo riferimento
|
' Creo riferimento
|
||||||
Dim frPrintSolid As New Frame3d()
|
Dim frPrintSolid As New Frame3d()
|
||||||
If m_SelReference = ReferenceBtn.References.FROM_IMPORT Then
|
If SelReference = ReferenceBtn.References.FROM_IMPORT Then
|
||||||
EgtGetGlobFrame(SelPart.nPrintSolidId, frPrintSolid)
|
EgtGetGlobFrame(SelPart.nPrintSolidId, frPrintSolid)
|
||||||
frPrintSolid.Setup(New Point3d(frPrintSolid.Orig.x, frPrintSolid.Orig.y, 0))
|
frPrintSolid.Setup(New Point3d(frPrintSolid.Orig.x, frPrintSolid.Orig.y, 0))
|
||||||
Else
|
Else
|
||||||
Dim b3PrintSolid As New BBox3d
|
Dim b3ToBePrintSolid As BBox3d = Map.refDispositionPanelVM.GetSolidForReferenceBBox(SelPart)
|
||||||
EgtGetBBoxGlob(SelPart.nPrintSolidId, GDB_BB.STANDARD, b3PrintSolid)
|
|
||||||
' Creo riferimento
|
' Creo riferimento
|
||||||
Dim ptOrig As New Point3d(b3PrintSolid.Min())
|
Dim ptOrig As New Point3d(b3ToBePrintSolid.Min())
|
||||||
Select Case m_SelReference
|
Select Case SelReference
|
||||||
Case ReferenceBtn.References.TL
|
Case ReferenceBtn.References.TL
|
||||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX
|
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX
|
||||||
Case ReferenceBtn.References.TR
|
Case ReferenceBtn.References.TR
|
||||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX + b3ToBePrintSolid.DimX() * Vector3d.X_AX
|
||||||
Case ReferenceBtn.References.BL
|
Case ReferenceBtn.References.BL
|
||||||
Case ReferenceBtn.References.BR
|
Case ReferenceBtn.References.BR
|
||||||
ptOrig += b3PrintSolid.DimX() * Vector3d.X_AX
|
ptOrig += b3ToBePrintSolid.DimX() * Vector3d.X_AX
|
||||||
Case ReferenceBtn.References.TC
|
Case ReferenceBtn.References.TC
|
||||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX + b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||||
Case ReferenceBtn.References.ML
|
Case ReferenceBtn.References.ML
|
||||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX
|
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX
|
||||||
Case ReferenceBtn.References.MR
|
Case ReferenceBtn.References.MR
|
||||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX + b3ToBePrintSolid.DimX() * Vector3d.X_AX
|
||||||
Case ReferenceBtn.References.TC
|
Case ReferenceBtn.References.TC
|
||||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX + b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||||
Case ReferenceBtn.References.MR
|
Case ReferenceBtn.References.MR
|
||||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX + b3ToBePrintSolid.DimX() * Vector3d.X_AX
|
||||||
Case ReferenceBtn.References.BC
|
Case ReferenceBtn.References.BC
|
||||||
ptOrig += b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
ptOrig += b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||||
Case ReferenceBtn.References.MC
|
Case ReferenceBtn.References.MC
|
||||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX + b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||||
End Select
|
End Select
|
||||||
Dim vtMovedPart As Vector3d
|
Dim vtMovedPart As Vector3d
|
||||||
EgtGetInfo(SelPart.nPartId, "MovedPart", vtMovedPart)
|
If EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART, vtMovedPart) Then
|
||||||
ptOrig = ptOrig - vtMovedPart
|
ptOrig = ptOrig - vtMovedPart
|
||||||
|
ElseIf EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART2, vtMovedPart) Then
|
||||||
|
ptOrig = ptOrig - vtMovedPart
|
||||||
|
End If
|
||||||
frPrintSolid = New Frame3d(ptOrig)
|
frPrintSolid = New Frame3d(ptOrig)
|
||||||
End If
|
End If
|
||||||
Dim nFrameId As Integer = EgtCreateGeoFrame(SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
|
Dim nFrameId As Integer = EgtCreateGeoFrame(SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
|
||||||
@@ -115,7 +123,7 @@ Public Class ReferencePanelVM
|
|||||||
EgtSetMode(nFrameId, GDB_MD.LOCKED)
|
EgtSetMode(nFrameId, GDB_MD.LOCKED)
|
||||||
SelPart.UpdateReferenceId(nFrameId)
|
SelPart.UpdateReferenceId(nFrameId)
|
||||||
End If
|
End If
|
||||||
EgtSetInfo(SelPart.nReferenceLayerId, KEY_REFERENCE, m_SelReference)
|
Map.refDispositionPanelVM.RefreshPos()
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports System.Collections.Specialized
|
Imports System.Collections.Specialized
|
||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
|
Imports System.Windows.Markup
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
|
Imports Icarus.RibEntity
|
||||||
|
|
||||||
Public Class RibPanelVM
|
Public Class RibPanelVM
|
||||||
Inherits VMBase
|
Inherits VMBase
|
||||||
@@ -73,7 +75,16 @@ Public Class RibPanelVM
|
|||||||
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
||||||
Dim dNewXPos As Double = b3Reference.Min.x
|
Dim dNewXPos As Double = b3Reference.Min.x
|
||||||
StringToLen(value, dNewXPos)
|
StringToLen(value, dNewXPos)
|
||||||
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
|
Dim dMin As Double = 0
|
||||||
|
Dim dMax As Double = CurrentMachine.b3Tab.DimX
|
||||||
|
Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
|
||||||
|
EgtGetInfo(m_SelRib.nExtrusionId, MAC_RIBSTYPE, nRibType)
|
||||||
|
If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
|
||||||
|
dMax -= b3Reference.DimX
|
||||||
|
Else
|
||||||
|
dMin -= b3Reference.DimX
|
||||||
|
End If
|
||||||
|
If dNewXPos >= dMin AndAlso dNewXPos <= dMax Then
|
||||||
EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -102,7 +113,16 @@ Public Class RibPanelVM
|
|||||||
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
||||||
Dim dNewYPos As Double = b3Reference.Min.y
|
Dim dNewYPos As Double = b3Reference.Min.y
|
||||||
StringToLen(value, dNewYPos)
|
StringToLen(value, dNewYPos)
|
||||||
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
|
Dim dMin As Double = 0
|
||||||
|
Dim dMax As Double = CurrentMachine.b3Tab.DimY
|
||||||
|
Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
|
||||||
|
EgtGetInfo(m_SelRib.nExtrusionId, MAC_RIBSTYPE, nRibType)
|
||||||
|
If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
|
||||||
|
dMax -= b3Reference.DimY
|
||||||
|
Else
|
||||||
|
dMin -= b3Reference.DimY
|
||||||
|
End If
|
||||||
|
If dNewYPos >= dMin AndAlso dNewYPos <= dMax Then
|
||||||
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -131,7 +151,7 @@ Public Class RibPanelVM
|
|||||||
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
||||||
Dim dNewZPos As Double = b3Reference.Min.y
|
Dim dNewZPos As Double = b3Reference.Min.y
|
||||||
StringToLen(value, dNewZPos)
|
StringToLen(value, dNewZPos)
|
||||||
If dNewZPos >= 0 Then
|
If dNewZPos >= -1000 Then
|
||||||
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -676,6 +696,20 @@ Public Class RibPanelVM
|
|||||||
NotifyPropertyChanged(NameOf(SelRib))
|
NotifyPropertyChanged(NameOf(SelRib))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Friend Shared Function GetNextRibIndex()
|
||||||
|
Dim nRibIndex As Integer = 0
|
||||||
|
Dim nRibId As Integer = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.nRibsLayerId)
|
||||||
|
While nRibId <> GDB_ID.NULL
|
||||||
|
Dim nCurrIndex As Integer = GDB_ID.NULL
|
||||||
|
EgtGetInfo(nRibId, RIB_ID, nCurrIndex)
|
||||||
|
If nCurrIndex > nRibIndex Then
|
||||||
|
nRibIndex = nCurrIndex
|
||||||
|
End If
|
||||||
|
nRibId = EgtGetNext(nRibId)
|
||||||
|
End While
|
||||||
|
Return nRibIndex + 1
|
||||||
|
End Function
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|
||||||
#Region "COMMANDS"
|
#Region "COMMANDS"
|
||||||
@@ -1201,7 +1235,7 @@ Public Class RibPanelVM
|
|||||||
End While
|
End While
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
m_bCPlaneObj_IsActive = True
|
m_bCPlaneObj_IsActive = True
|
||||||
' Map.refControllerInputPanelVM.PrepareInputBox("Grid from Selection", "Select the face of the object where to place the grid", "", False, False)
|
' Map.refControllerInputPanelVM.PrepareInputBox("Grid from Selection", "Select the face of the object where to place the grid", "", False, False)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CPlaneObj
|
#End Region ' CPlaneObj
|
||||||
@@ -1332,7 +1366,10 @@ Public Class RibEntity
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Sub New(Type As RibTypes, nId As Integer)
|
Sub New(Type As RibTypes, nId As Integer)
|
||||||
m_nIndex = nSharedIndex
|
If Not EgtGetInfo(nId, RIB_ID, m_nIndex) Then
|
||||||
|
m_nIndex = RibPanelVM.GetNextRibIndex()
|
||||||
|
EgtSetInfo(nId, RIB_ID, m_nIndex)
|
||||||
|
End If
|
||||||
m_Type = Type
|
m_Type = Type
|
||||||
EgtSetInfo(nId, KEY_RIB_TYPE, Type)
|
EgtSetInfo(nId, KEY_RIB_TYPE, Type)
|
||||||
Select Case Type
|
Select Case Type
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<EgtWPFLib5:EgtCustomWindow x:Class="CopyFromWndV"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||||
|
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||||
|
Title="{Binding sTitle}" Icon="/Resources/Icarus.ico"
|
||||||
|
WindowStyle="None" ResizeMode="NoResize" IsClosable="False"
|
||||||
|
WindowStartupLocation="CenterOwner"
|
||||||
|
SizeToContent="WidthAndHeight">
|
||||||
|
<Grid Margin="5">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Text="Select Rib to Copy"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Margin="0,0,0,2.5"/>
|
||||||
|
<ComboBox Grid.Row="1"
|
||||||
|
ItemsSource="{Binding RibList}"
|
||||||
|
SelectedItem="{Binding SelRib}"
|
||||||
|
DisplayMemberPath="ghName"
|
||||||
|
Margin="0,2.5,0,2.5"/>
|
||||||
|
<UniformGrid Grid.Row="2"
|
||||||
|
Rows="1"
|
||||||
|
Margin="0,2.5,0,0">
|
||||||
|
<Button Content="Ok"
|
||||||
|
Command="{Binding Ok_Command}"
|
||||||
|
Style="{StaticResource ToolBar_TextButton}"/>
|
||||||
|
<Button Content="Cancel"
|
||||||
|
Command="{Binding Cancel_Command}"
|
||||||
|
Style="{StaticResource ToolBar_TextButton}"/>
|
||||||
|
</UniformGrid>
|
||||||
|
</Grid>
|
||||||
|
</EgtWPFLib5:EgtCustomWindow>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Public Class CopyFromWndV
|
||||||
|
|
||||||
|
Private WithEvents m_CopyFromWndVM As CopyFromWndVM
|
||||||
|
|
||||||
|
Sub New(Owner As Window, CopyFromWndVM As CopyFromWndVM)
|
||||||
|
MyBase.New(Owner)
|
||||||
|
' This call is required by the designer.
|
||||||
|
InitializeComponent()
|
||||||
|
Me.DataContext = CopyFromWndVM
|
||||||
|
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||||
|
m_CopyFromWndVM = CopyFromWndVM
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_CopyFromWndVM.m_CloseWindow
|
||||||
|
Me.DialogResult = bDialogResult
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -0,0 +1,182 @@
|
|||||||
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
|
Public Class CopyFromWndVM
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
|
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||||
|
|
||||||
|
Private m_RibList As ObservableCollection(Of RibEntity)
|
||||||
|
Public ReadOnly Property RibList As ObservableCollection(Of RibEntity)
|
||||||
|
Get
|
||||||
|
Return m_RibList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_SelRib As RibEntity
|
||||||
|
Public Property SelRib As RibEntity
|
||||||
|
Get
|
||||||
|
Return m_SelRib
|
||||||
|
End Get
|
||||||
|
Set(value As RibEntity)
|
||||||
|
m_SelRib = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' Definizione comandi
|
||||||
|
Private m_cmdOk As ICommand
|
||||||
|
Private m_cmdCancel As ICommand
|
||||||
|
|
||||||
|
Sub New()
|
||||||
|
m_RibList = New ObservableCollection(Of RibEntity)(Map.refRibPanelVM.RibList)
|
||||||
|
m_RibList.Remove(m_RibList.FirstOrDefault(Function(x) x.nExtrusionId = Map.refRibPanelVM.SelRib.nExtrusionId))
|
||||||
|
If m_RibList.Count > 0 Then
|
||||||
|
m_SelRib = m_RibList(0)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#Region "COMMANDS"
|
||||||
|
|
||||||
|
#Region "Ok"
|
||||||
|
|
||||||
|
Public ReadOnly Property Ok_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdOk Is Nothing Then
|
||||||
|
m_cmdOk = New Command(AddressOf Ok)
|
||||||
|
End If
|
||||||
|
Return m_cmdOk
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub Ok()
|
||||||
|
If IsNothing(m_SelRib) Then
|
||||||
|
MessageBox.Show("Please select the rib from which to copy the parameters!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' copio i parametri nella rib corrente
|
||||||
|
Dim ParamList As New List(Of MachiningParam.Params)({MachiningParam.Params.RIBSTYPE,
|
||||||
|
MachiningParam.Params.RIBSOVERLAP,
|
||||||
|
MachiningParam.Params.RIBSSTRANDCOUNT,
|
||||||
|
MachiningParam.Params.RIBSLINK,
|
||||||
|
MachiningParam.Params.RIBSINVERTDIRECTION,
|
||||||
|
MachiningParam.Params.RIBSINVERTSTRANDORDER,
|
||||||
|
MachiningParam.Params.RIBSLEADININVERT,
|
||||||
|
MachiningParam.Params.RIBSLEADINLEN,
|
||||||
|
MachiningParam.Params.RIBSLEADOUTINVERT,
|
||||||
|
MachiningParam.Params.RIBSLEADOUTLEN,
|
||||||
|
MachiningParam.Params.RIBSLEADOUTCOASTING,
|
||||||
|
MachiningParam.Params.RIBSLEADOUTWIPE,
|
||||||
|
MachiningParam.Params.RIBSLEADOUTWIPEDIR})
|
||||||
|
For Each Param In ParamList
|
||||||
|
Select Case Map.refRibPanelVM.SelRib.Type
|
||||||
|
'Case RibEntity.RibTypes.FROMDRAW
|
||||||
|
' CopyParam(Param, m_SelRib.nExtrusionId, Map.refRibPanelVM.SelRib.nCurveId)
|
||||||
|
' CopyParam(Param, m_SelRib.nExtrusionId, Map.refRibPanelVM.SelRib.nExtrusionId)
|
||||||
|
Case RibEntity.RibTypes.FROMIMPORT
|
||||||
|
CopyParam(Param, m_SelRib.nExtrusionId, Map.refRibPanelVM.SelRib.nExtrusionId)
|
||||||
|
End Select
|
||||||
|
Next
|
||||||
|
'' ricarico i parametri
|
||||||
|
'Map.refRibParamPanelVM.Init()
|
||||||
|
RaiseEvent m_CloseWindow(True)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CopyParam(Type As MachiningParam.Params, nFromId As Integer, nToId As Integer)
|
||||||
|
Dim bRead As Boolean = False
|
||||||
|
Select Case Type
|
||||||
|
Case MachiningParam.Params.RIBSTYPE
|
||||||
|
Dim RibTypeParam As RibComboMachiningParam = Nothing
|
||||||
|
Dim nRibParam As Integer = 0
|
||||||
|
Select Case Type
|
||||||
|
Case MachiningParam.Params.RIBSTYPE
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSTYPE)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSTYPE, nRibParam)
|
||||||
|
End Select
|
||||||
|
If Not IsNothing(RibTypeParam) AndAlso bRead Then
|
||||||
|
RibTypeParam.SelValue = RibTypeParam.ValueList.FirstOrDefault(Function(x) x.Id = nRibParam)
|
||||||
|
Else
|
||||||
|
RibTypeParam.SelValue = RibTypeParam.PartSelValue
|
||||||
|
End If
|
||||||
|
Case MachiningParam.Params.RIBSOVERLAP, MachiningParam.Params.RIBSSTRANDCOUNT, MachiningParam.Params.RIBSLEADINLEN, MachiningParam.Params.RIBSLEADOUTLEN,
|
||||||
|
MachiningParam.Params.RIBSLEADOUTCOASTING, MachiningParam.Params.RIBSLEADOUTWIPE, MachiningParam.Params.RIBSLEADOUTWIPEDIR
|
||||||
|
Dim RibTypeParam As RibNumericMachiningParam = Nothing
|
||||||
|
Dim dRibParam As Double = 0
|
||||||
|
Select Case Type
|
||||||
|
Case MachiningParam.Params.RIBSOVERLAP
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSOVERLAP)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSOVERLAP, dRibParam)
|
||||||
|
Case MachiningParam.Params.RIBSSTRANDCOUNT
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSSTRANDCOUNT)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSSTRANDCOUNT, dRibParam)
|
||||||
|
Case MachiningParam.Params.RIBSLEADINLEN
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADINLEN)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADINLEN, dRibParam)
|
||||||
|
Case MachiningParam.Params.RIBSLEADOUTLEN
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADOUTLEN)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADOUTLEN, dRibParam)
|
||||||
|
Case MachiningParam.Params.RIBSLEADOUTCOASTING
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADOUTCOASTING)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADOUTCOASTING, dRibParam)
|
||||||
|
Case MachiningParam.Params.RIBSLEADOUTWIPE
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADOUTWIPE)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADOUTWIPE, dRibParam)
|
||||||
|
Case MachiningParam.Params.RIBSLEADOUTWIPEDIR
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADOUTWIPEDIR)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADOUTWIPEDIR, dRibParam)
|
||||||
|
End Select
|
||||||
|
If Not IsNothing(RibTypeParam) AndAlso bRead Then
|
||||||
|
RibTypeParam.SetValue(dRibParam)
|
||||||
|
Else
|
||||||
|
RibTypeParam.SetValue(RibTypeParam.dPartValue)
|
||||||
|
End If
|
||||||
|
Case MachiningParam.Params.RIBSLINK, MachiningParam.Params.RIBSINVERTDIRECTION, MachiningParam.Params.RIBSINVERTSTRANDORDER, MachiningParam.Params.RIBSLEADININVERT, MachiningParam.Params.RIBSLEADOUTINVERT
|
||||||
|
Dim RibTypeParam As RibCheckMachiningParam = Nothing
|
||||||
|
Dim bRibParam As Boolean = False
|
||||||
|
Select Case Type
|
||||||
|
Case MachiningParam.Params.RIBSLINK
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLINK)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSLINK, bRibParam)
|
||||||
|
Case MachiningParam.Params.RIBSINVERTDIRECTION
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSINVERTDIRECTION)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSINVERTDIRECTION, bRibParam)
|
||||||
|
Case MachiningParam.Params.RIBSINVERTSTRANDORDER
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSINVERTSTRANDORDER)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSINVERTSTRANDORDER, bRibParam)
|
||||||
|
Case MachiningParam.Params.RIBSLEADININVERT
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADININVERT)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADININVERT, bRibParam)
|
||||||
|
Case MachiningParam.Params.RIBSLEADOUTINVERT
|
||||||
|
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADOUTINVERT)
|
||||||
|
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADOUTINVERT, bRibParam)
|
||||||
|
End Select
|
||||||
|
If Not IsNothing(RibTypeParam) AndAlso bRead Then
|
||||||
|
RibTypeParam.bValue = bRibParam
|
||||||
|
Else
|
||||||
|
RibTypeParam.bValue = RibTypeParam.bPartValue
|
||||||
|
End If
|
||||||
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' Ok
|
||||||
|
|
||||||
|
#Region "Cancel"
|
||||||
|
|
||||||
|
Public ReadOnly Property Cancel_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdCancel Is Nothing Then
|
||||||
|
m_cmdCancel = New Command(AddressOf Cancel)
|
||||||
|
End If
|
||||||
|
Return m_cmdCancel
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub Cancel()
|
||||||
|
RaiseEvent m_CloseWindow(False)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' Cancel
|
||||||
|
|
||||||
|
#End Region ' COMMANDS
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -120,6 +120,9 @@
|
|||||||
<Button Content="Cancel"
|
<Button Content="Cancel"
|
||||||
Command="{Binding Cancel_Command}"
|
Command="{Binding Cancel_Command}"
|
||||||
Style="{StaticResource ToolBar_TextButton}"/>
|
Style="{StaticResource ToolBar_TextButton}"/>
|
||||||
|
<Button Content="Copy From"
|
||||||
|
Command="{Binding CopyFrom_Command}"
|
||||||
|
Style="{StaticResource ToolBar_TextButton}"/>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Public Class RibParamPanelVM
|
|||||||
' Definizione comandi
|
' Definizione comandi
|
||||||
Private m_cmdOk As ICommand
|
Private m_cmdOk As ICommand
|
||||||
Private m_cmdCancel As ICommand
|
Private m_cmdCancel As ICommand
|
||||||
|
Private m_cmdCopyFrom As ICommand
|
||||||
|
|
||||||
#End Region ' FIELDS & PROPERTIES
|
#End Region ' FIELDS & PROPERTIES
|
||||||
|
|
||||||
@@ -46,6 +47,7 @@ Public Class RibParamPanelVM
|
|||||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nRibId, nPartId),
|
New RibNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nRibId, nPartId),
|
||||||
New RibCheckMachiningParam(MachiningParam.Params.RIBSLINK, nRibId, nPartId),
|
New RibCheckMachiningParam(MachiningParam.Params.RIBSLINK, nRibId, nPartId),
|
||||||
New RibCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nRibId, nPartId),
|
New RibCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nRibId, nPartId),
|
||||||
|
New RibCheckMachiningParam(MachiningParam.Params.RIBSINVERTSTRANDORDER, nRibId, nPartId),
|
||||||
New RibCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nRibId, nPartId),
|
New RibCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nRibId, nPartId),
|
||||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nRibId, nPartId),
|
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nRibId, nPartId),
|
||||||
New RibCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nRibId, nPartId),
|
New RibCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nRibId, nPartId),
|
||||||
@@ -111,6 +113,12 @@ Public Class RibParamPanelVM
|
|||||||
|
|
||||||
Public Sub Ok()
|
Public Sub Ok()
|
||||||
If Not IsNothing(Map.refRibPanelVM.SelRib) Then
|
If Not IsNothing(Map.refRibPanelVM.SelRib) Then
|
||||||
|
' verifico se modificata tipologia Ribs
|
||||||
|
Dim bIsModifiedRibsType As Boolean = False
|
||||||
|
Dim RibsTypeParam As MachiningParam = MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.RIBSTYPE)
|
||||||
|
If Not IsNothing(RibsTypeParam) Then
|
||||||
|
bIsModifiedRibsType = RibsTypeParam.bIsModified
|
||||||
|
End If
|
||||||
' scrivo i parametri modificati
|
' scrivo i parametri modificati
|
||||||
Select Case Map.refRibPanelVM.SelRib.Type
|
Select Case Map.refRibPanelVM.SelRib.Type
|
||||||
Case RibEntity.RibTypes.FROMDRAW
|
Case RibEntity.RibTypes.FROMDRAW
|
||||||
@@ -119,6 +127,12 @@ Public Class RibParamPanelVM
|
|||||||
Case RibEntity.RibTypes.FROMIMPORT
|
Case RibEntity.RibTypes.FROMIMPORT
|
||||||
WriteParamsInRib(Map.refRibPanelVM.SelRib.nExtrusionId)
|
WriteParamsInRib(Map.refRibPanelVM.SelRib.nExtrusionId)
|
||||||
End Select
|
End Select
|
||||||
|
SaveCurrParams()
|
||||||
|
' se modificata tipologia Ribs, aggiorno posizione riferimento e pezzo
|
||||||
|
If bIsModifiedRibsType Then
|
||||||
|
Map.refReferencePanelVM.UpdateFramePosition()
|
||||||
|
Map.refDispositionPanelVM.UpdateZPos()
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
' ripristino modalita' standard
|
' ripristino modalita' standard
|
||||||
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
|
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
|
||||||
@@ -146,6 +160,26 @@ Public Class RibParamPanelVM
|
|||||||
|
|
||||||
#End Region ' Cancel
|
#End Region ' Cancel
|
||||||
|
|
||||||
|
#Region "CopyFrom"
|
||||||
|
|
||||||
|
Public ReadOnly Property CopyFrom_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdCopyFrom Is Nothing Then
|
||||||
|
m_cmdCopyFrom = New Command(AddressOf CopyFrom)
|
||||||
|
End If
|
||||||
|
Return m_cmdCopyFrom
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub CopyFrom()
|
||||||
|
Dim CopyFromWndVM As New CopyFromWndVM
|
||||||
|
Dim CopyFromWndV As New CopyFromWndV(Application.Current.MainWindow, CopyFromWndVM)
|
||||||
|
CopyFromWndV.ShowDialog()
|
||||||
|
Dim x = CopyFromWndVM.SelRib
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' CopyFrom
|
||||||
|
|
||||||
#End Region ' COMMANDS
|
#End Region ' COMMANDS
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -167,6 +201,11 @@ Public Class RibNumericMachiningParam
|
|||||||
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
|
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Friend Sub SetValue(value As Double)
|
||||||
|
m_dValue = value
|
||||||
|
NotifyPropertyChanged(NameOf(sValue))
|
||||||
|
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private m_dPartValue As Double
|
Private m_dPartValue As Double
|
||||||
Public ReadOnly Property dPartValue As Double
|
Public ReadOnly Property dPartValue As Double
|
||||||
@@ -200,6 +239,10 @@ Public Class RibNumericMachiningParam
|
|||||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTDIRECTION, m_dValue)
|
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTDIRECTION, m_dValue)
|
||||||
EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_dPartValue)
|
EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_dPartValue)
|
||||||
m_bIsLen = True
|
m_bIsLen = True
|
||||||
|
Case Params.RIBSINVERTSTRANDORDER
|
||||||
|
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTSTRANDORDER, m_dValue)
|
||||||
|
EgtGetInfo(nPartId, MAC_RIBSINVERTSTRANDORDER, m_dPartValue)
|
||||||
|
m_bIsLen = True
|
||||||
Case Params.RIBSLEADININVERT
|
Case Params.RIBSLEADININVERT
|
||||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLEADININVERT, m_dValue)
|
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLEADININVERT, m_dValue)
|
||||||
EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_dPartValue)
|
EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_dPartValue)
|
||||||
@@ -262,6 +305,12 @@ Public Class RibNumericMachiningParam
|
|||||||
Else
|
Else
|
||||||
EgtRemoveInfo(nRibId, MAC_RIBSINVERTDIRECTION)
|
EgtRemoveInfo(nRibId, MAC_RIBSINVERTDIRECTION)
|
||||||
End If
|
End If
|
||||||
|
Case Params.RIBSINVERTSTRANDORDER
|
||||||
|
If bIsModifiedFromPart Then
|
||||||
|
EgtSetInfo(nRibId, MAC_RIBSINVERTSTRANDORDER, sWriteValue)
|
||||||
|
Else
|
||||||
|
EgtRemoveInfo(nRibId, MAC_RIBSINVERTSTRANDORDER)
|
||||||
|
End If
|
||||||
Case Params.RIBSLEADININVERT
|
Case Params.RIBSLEADININVERT
|
||||||
If bIsModifiedFromPart Then
|
If bIsModifiedFromPart Then
|
||||||
EgtSetInfo(nRibId, MAC_RIBSLEADININVERT, sWriteValue)
|
EgtSetInfo(nRibId, MAC_RIBSLEADININVERT, sWriteValue)
|
||||||
@@ -485,6 +534,9 @@ Public Class RibCheckMachiningParam
|
|||||||
Case Params.RIBSINVERTDIRECTION
|
Case Params.RIBSINVERTDIRECTION
|
||||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTDIRECTION, m_bValue)
|
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTDIRECTION, m_bValue)
|
||||||
EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bPartValue)
|
EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bPartValue)
|
||||||
|
Case Params.RIBSINVERTSTRANDORDER
|
||||||
|
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTSTRANDORDER, m_bValue)
|
||||||
|
EgtGetInfo(nPartId, MAC_RIBSINVERTSTRANDORDER, m_bPartValue)
|
||||||
Case Params.RIBSLEADININVERT
|
Case Params.RIBSLEADININVERT
|
||||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLEADININVERT, m_bValue)
|
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLEADININVERT, m_bValue)
|
||||||
EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bPartValue)
|
EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bPartValue)
|
||||||
@@ -513,6 +565,12 @@ Public Class RibCheckMachiningParam
|
|||||||
Else
|
Else
|
||||||
EgtRemoveInfo(nRibId, MAC_RIBSINVERTDIRECTION)
|
EgtRemoveInfo(nRibId, MAC_RIBSINVERTDIRECTION)
|
||||||
End If
|
End If
|
||||||
|
Case Params.RIBSINVERTSTRANDORDER
|
||||||
|
If bIsModifiedFromPart Then
|
||||||
|
EgtSetInfo(nRibId, MAC_RIBSINVERTSTRANDORDER, If(m_bValue, 1, 0))
|
||||||
|
Else
|
||||||
|
EgtRemoveInfo(nRibId, MAC_RIBSINVERTSTRANDORDER)
|
||||||
|
End If
|
||||||
Case Params.RIBSLEADININVERT
|
Case Params.RIBSLEADININVERT
|
||||||
If bIsModifiedFromPart Then
|
If bIsModifiedFromPart Then
|
||||||
EgtSetInfo(nRibId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
|
EgtSetInfo(nRibId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
|
||||||
|
|||||||
@@ -451,9 +451,10 @@ Public Class MySceneHostVM
|
|||||||
' elimino colore entita'
|
' elimino colore entita'
|
||||||
EgtResetColor(nNewEntityId)
|
EgtResetColor(nNewEntityId)
|
||||||
' aggiorno riferimento pezzo
|
' aggiorno riferimento pezzo
|
||||||
Map.refReferencePanelVM.UpdateFramePosition(MenuItem.OrigLayer.OrigPart.PrintPart)
|
Map.refReferencePanelVM.UpdateFramePosition()
|
||||||
|
Map.refDispositionPanelVM.UpdateZPos()
|
||||||
' elimino eventuale flag di spostamento a 45 gradi
|
' elimino eventuale flag di spostamento a 45 gradi
|
||||||
EgtRemoveInfo(MenuItem.OrigLayer.OrigPart.PrintPart.nPartId, "MovedPart")
|
EgtRemoveInfo(MenuItem.OrigLayer.OrigPart.PrintPart.nPartId, KEY_MOVEDPART)
|
||||||
' elimino vecchio elemento ed aggiungo nuovo
|
' elimino vecchio elemento ed aggiungo nuovo
|
||||||
MenuItem.OrigLayer.EntityList.Clear()
|
MenuItem.OrigLayer.EntityList.Clear()
|
||||||
MenuItem.OrigLayer.EntityList.Add(New PartManager_GeomEntity(MenuItem.OrigLayer, nNewEntityId))
|
MenuItem.OrigLayer.EntityList.Add(New PartManager_GeomEntity(MenuItem.OrigLayer, nNewEntityId))
|
||||||
@@ -552,10 +553,10 @@ Public Class MySceneHostVM
|
|||||||
'Assegnazione nome file con dialogo
|
'Assegnazione nome file con dialogo
|
||||||
Dim SaveFileDialog As New SaveFileDialog With {
|
Dim SaveFileDialog As New SaveFileDialog With {
|
||||||
.Title = "Export",
|
.Title = "Export",
|
||||||
.Filter = "Stereolithography (*.stl)|*.stl" &
|
.Filter = "3D Manufacturing format (*.3mf)|*.3mf" &
|
||||||
"|3D Manufacturing format (*.3mf)|*.3mf",
|
"|Stereolithography (*.stl)|*.stl",
|
||||||
.FilterIndex = 0,
|
.FilterIndex = 1,
|
||||||
.FileName = Path.ChangeExtension(MainController.GetCurrFile(), "stl")
|
.FileName = Path.ChangeExtension(MainController.GetCurrFile(), "").TrimEnd("."c)
|
||||||
}
|
}
|
||||||
Dim DialogResult As Boolean? = SaveFileDialog.ShowDialog
|
Dim DialogResult As Boolean? = SaveFileDialog.ShowDialog
|
||||||
If IsNothing(DialogResult) OrElse Not DialogResult Then Return
|
If IsNothing(DialogResult) OrElse Not DialogResult Then Return
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ Public Class ShellNumberPanelVM
|
|||||||
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
||||||
Dim dNewXPos As Double = b3Reference.Min.x
|
Dim dNewXPos As Double = b3Reference.Min.x
|
||||||
StringToLen(value, dNewXPos)
|
StringToLen(value, dNewXPos)
|
||||||
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
|
If dNewXPos >= -b3Reference.DimX AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX - b3Reference.DimX Then
|
||||||
EgtMove(m_SelShellNumber.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelShellNumber.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -102,7 +102,7 @@ Public Class ShellNumberPanelVM
|
|||||||
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
||||||
Dim dNewYPos As Double = b3Reference.Min.y
|
Dim dNewYPos As Double = b3Reference.Min.y
|
||||||
StringToLen(value, dNewYPos)
|
StringToLen(value, dNewYPos)
|
||||||
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
|
If dNewYPos >= -b3Reference.DimY AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY - b3Reference.DimY Then
|
||||||
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -131,7 +131,7 @@ Public Class ShellNumberPanelVM
|
|||||||
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
||||||
Dim dNewZPos As Double = b3Reference.Min.y
|
Dim dNewZPos As Double = b3Reference.Min.y
|
||||||
StringToLen(value, dNewZPos)
|
StringToLen(value, dNewZPos)
|
||||||
If dNewZPos >= 0 Then
|
If dNewZPos >= -1000 Then
|
||||||
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
|
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
|||||||
@@ -376,7 +376,8 @@ Public Class SliceManagerVM
|
|||||||
' verifico esistenza e correttezza machgroup
|
' verifico esistenza e correttezza machgroup
|
||||||
InitMachGroup(True)
|
InitMachGroup(True)
|
||||||
' eseguo generazione CN
|
' eseguo generazione CN
|
||||||
bOk = ExecGenerate()
|
Dim sMsg As String = ""
|
||||||
|
bOk = ExecGenerate(sMsg)
|
||||||
' leggo stima tempo e la riporto in layer di calcolo
|
' leggo stima tempo e la riporto in layer di calcolo
|
||||||
EgtGetInfo(EgtGetFirstMachGroup(), "Ttot", m_dTime)
|
EgtGetInfo(EgtGetFirstMachGroup(), "Ttot", m_dTime)
|
||||||
NotifyPropertyChanged(NameOf(ghTime))
|
NotifyPropertyChanged(NameOf(ghTime))
|
||||||
@@ -391,7 +392,13 @@ Public Class SliceManagerVM
|
|||||||
nCurrPartId = EgtGetNextPart(nCurrPartId)
|
nCurrPartId = EgtGetNextPart(nCurrPartId)
|
||||||
End While
|
End While
|
||||||
Else
|
Else
|
||||||
MessageBox.Show("Error in NC code generation! See log file.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
Dim sOut As String = "Error in NC code generation : "
|
||||||
|
If String.IsNullOrWhiteSpace(sMsg) Then
|
||||||
|
sOut &= "See log file."
|
||||||
|
Else
|
||||||
|
sOut &= sMsg
|
||||||
|
End If
|
||||||
|
MessageBox.Show(sOut, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' Aggiorno intestazione programma
|
' Aggiorno intestazione programma
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ Public Class StartMachPanelVM
|
|||||||
EgtStartPoint(m_SelStart.nId, GDB_ID.ROOT, ptReference)
|
EgtStartPoint(m_SelStart.nId, GDB_ID.ROOT, ptReference)
|
||||||
Dim dNewZPos As Double = ptReference.z
|
Dim dNewZPos As Double = ptReference.z
|
||||||
StringToLen(value, dNewZPos)
|
StringToLen(value, dNewZPos)
|
||||||
If dNewZPos >= 0 Then
|
If dNewZPos >= -1000 Then
|
||||||
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
|
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -166,14 +166,14 @@ Public Class TopPanelVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As Print3dPartVM)
|
Set(value As Print3dPartVM)
|
||||||
If Not IsNothing(m_SelPart) Then
|
If Not IsNothing(m_SelPart) Then
|
||||||
' deseleziono eventuale pezzo precedente
|
'' deseleziono eventuale pezzo precedente
|
||||||
EgtResetMark(m_SelPart.nPrintSolidId)
|
'EgtResetMark(m_SelPart.nPrintSolidId)
|
||||||
End If
|
End If
|
||||||
m_SelPart = value
|
m_SelPart = value
|
||||||
If Not IsNothing(value) Then
|
If Not IsNothing(value) Then
|
||||||
' Eseguo la selezione
|
' Eseguo la selezione
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
EgtSetMark(m_SelPart.nPrintSolidId)
|
' EgtSetMark(m_SelPart.nPrintSolidId)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
' imposto lavorazione e materiale del pezzo selezionato
|
' imposto lavorazione e materiale del pezzo selezionato
|
||||||
Map.refCurrMachiningPanelVM.ReadMachParamFromSelPart()
|
Map.refCurrMachiningPanelVM.ReadMachParamFromSelPart()
|
||||||
@@ -553,10 +553,10 @@ Public Class TopPanelVM
|
|||||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
|
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
|
||||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
|
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
|
||||||
Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(False)
|
Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(False)
|
||||||
' tolgo mark da pezzo selezionato
|
'' tolgo mark da pezzo selezionato
|
||||||
If Not IsNothing(SelPart) Then
|
'If Not IsNothing(SelPart) Then
|
||||||
EgtResetMark(SelPart.nPrintSolidId)
|
' EgtResetMark(SelPart.nPrintSolidId)
|
||||||
End If
|
'End If
|
||||||
' imposto pagina
|
' imposto pagina
|
||||||
Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.MODIFYPART)
|
Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.MODIFYPART)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -569,10 +569,10 @@ Public Class TopPanelVM
|
|||||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
|
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
|
||||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
|
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
|
||||||
Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(True)
|
Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(True)
|
||||||
' ripristino mark su pezzo selezionato
|
'' ripristino mark su pezzo selezionato
|
||||||
If Not IsNothing(SelPart) Then
|
'If Not IsNothing(SelPart) Then
|
||||||
EgtSetMark(SelPart.nPrintSolidId)
|
' EgtSetMark(SelPart.nPrintSolidId)
|
||||||
End If
|
'End If
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -46,12 +46,15 @@ Public Module CurrentMachine
|
|||||||
m_sMachiningFilePath = sValue
|
m_sMachiningFilePath = sValue
|
||||||
End Sub
|
End Sub
|
||||||
' Cartella dei materiali
|
' Cartella dei materiali
|
||||||
Private m_sMaterialsFilePath As String = String.Empty
|
Private m_sMaterialFilePath As String = String.Empty
|
||||||
Friend ReadOnly Property sMaterialsFilePath As String
|
Friend ReadOnly Property sMaterialFilePath As String
|
||||||
Get
|
Get
|
||||||
Return m_sMaterialsFilePath
|
Return m_sMaterialFilePath
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Friend Sub SetMaterialFilePath(sValue As String)
|
||||||
|
m_sMaterialFilePath = sValue
|
||||||
|
End Sub
|
||||||
|
|
||||||
' box della tavola macchina
|
' box della tavola macchina
|
||||||
Private m_b3Tab As New BBox3d
|
Private m_b3Tab As New BBox3d
|
||||||
@@ -75,7 +78,7 @@ Public Module CurrentMachine
|
|||||||
' impostazione cartella lavorazioni
|
' impostazione cartella lavorazioni
|
||||||
m_sMachiningFilePath = sMachinesRootDir & "\" & sMachineName & "\Machinings\Machinings.ini"
|
m_sMachiningFilePath = sMachinesRootDir & "\" & sMachineName & "\Machinings\Machinings.ini"
|
||||||
' impostazione cartella materiali
|
' impostazione cartella materiali
|
||||||
m_sMaterialsFilePath = sMachinesRootDir & "\" & sMachineName & "\Materials\Materials.ini"
|
m_sMaterialFilePath = sMachinesRootDir & "\" & sMachineName & "\Materials\Materials.ini"
|
||||||
' Disabilito segnalazione modificato
|
' Disabilito segnalazione modificato
|
||||||
Dim DisableMgr As New DisableModifiedMgr
|
Dim DisableMgr As New DisableModifiedMgr
|
||||||
' recupero box macchina
|
' recupero box macchina
|
||||||
@@ -180,7 +183,7 @@ Public Module CurrentMachine
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function ReadMaterialParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, Optional sFilePath As String = "") As Integer
|
Friend Function ReadMaterialParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, Optional sFilePath As String = "") As Integer
|
||||||
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMaterialsFilePath))
|
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMaterialFilePath))
|
||||||
If Not String.IsNullOrWhiteSpace(lpString) Then
|
If Not String.IsNullOrWhiteSpace(lpString) Then
|
||||||
lpString = EgwCrypto.PowerDecryptString(lpString, m_Salt)
|
lpString = EgwCrypto.PowerDecryptString(lpString, m_Salt)
|
||||||
Else
|
Else
|
||||||
@@ -198,7 +201,7 @@ Public Module CurrentMachine
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function WriteMaterialParam(lpAppName As String, lpKeyName As String, lpString As String, Optional sFilePath As String = "") As Boolean
|
Friend Function WriteMaterialParam(lpAppName As String, lpKeyName As String, lpString As String, Optional sFilePath As String = "") As Boolean
|
||||||
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMaterialsFilePath))
|
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMaterialFilePath))
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#End Region 'Methods
|
#End Region 'Methods
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ Module GeomEntityColors
|
|||||||
|
|
||||||
Public Enum LayerType As Integer
|
Public Enum LayerType As Integer
|
||||||
PRINTPART = 1
|
PRINTPART = 1
|
||||||
RIBS = 2
|
'REFERENCE = 2
|
||||||
SHELLNUMBERS = 3
|
MACHSTART = 3
|
||||||
AUXSOLIDS = 4
|
RIBS = 4
|
||||||
MACHSTART = 5
|
SHELLNUMBERS = 5
|
||||||
OTHERS = 6
|
AUXSOLIDS = 6
|
||||||
|
OTHERS = 7
|
||||||
ALL = 10
|
ALL = 10
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
@@ -124,6 +125,23 @@ Module GeomEntityColors
|
|||||||
WritePrivateProfileColor(S_COLORS, sIniKey, c3Temp)
|
WritePrivateProfileColor(S_COLORS, sIniKey, c3Temp)
|
||||||
UpdateColors(Type)
|
UpdateColors(Type)
|
||||||
End Sub
|
End Sub
|
||||||
|
Friend Function GetColor(Type As LayerType) As Color3d
|
||||||
|
Dim sIniKey As String = ""
|
||||||
|
Select Case Type
|
||||||
|
Case LayerType.PRINTPART
|
||||||
|
Return c3Print
|
||||||
|
Case LayerType.RIBS
|
||||||
|
Return c3Rib
|
||||||
|
Case LayerType.SHELLNUMBERS
|
||||||
|
Return c3ShellNumber
|
||||||
|
Case LayerType.AUXSOLIDS
|
||||||
|
Return c3AuxSolids
|
||||||
|
Case LayerType.MACHSTART
|
||||||
|
Return c3MachStart
|
||||||
|
Case LayerType.OTHERS
|
||||||
|
Return c3Others
|
||||||
|
End Select
|
||||||
|
End Function
|
||||||
Friend Sub SetAlpha(Type As LayerType, dAlpha As Double)
|
Friend Sub SetAlpha(Type As LayerType, dAlpha As Double)
|
||||||
Dim c3Temp As Color3d = c3Print
|
Dim c3Temp As Color3d = c3Print
|
||||||
Dim sIniKey As String = ""
|
Dim sIniKey As String = ""
|
||||||
@@ -222,12 +240,21 @@ Module GeomEntityColors
|
|||||||
End While
|
End While
|
||||||
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
|
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Ripristino stato segnalazione modifica
|
' Ripristino stato segnalazione modifica
|
||||||
DisableMgr.ReEnable()
|
DisableMgr.ReEnable()
|
||||||
|
|
||||||
nPartId = EgtGetNextPart(nPartId)
|
nPartId = EgtGetNextPart(nPartId)
|
||||||
End While
|
End While
|
||||||
|
' se in import, aggiorno anche i pezzi di import
|
||||||
|
If Map.refTopPanelVM.SelPage = Pages.IMPORT Then
|
||||||
|
For Each ImportPart In Map.refManagePartPanelVM.ManagerPartList
|
||||||
|
Dim Layer As ManagePart_Layer = ImportPart.LayerList.FirstOrDefault(Function(x) x.Type = Type)
|
||||||
|
If Not IsNothing(Layer) Then
|
||||||
|
For Each Entity In Layer.EntityList
|
||||||
|
EgtSetColor(Entity.nId, GetColor(Type))
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Module LuaExec
|
|||||||
If bSlice Then
|
If bSlice Then
|
||||||
EgtLuaCreateGlobTable("PRINT")
|
EgtLuaCreateGlobTable("PRINT")
|
||||||
EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1)
|
EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1)
|
||||||
|
EgtLuaSetGlobStringVar("PRINT.BASEDIR", Map.refMainWindowVM.MainWindowM.s3dPrintingDir)
|
||||||
bOk = bOk AndAlso EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\Slicing.lua")
|
bOk = bOk AndAlso EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\Slicing.lua")
|
||||||
' Cancello tavola globale
|
' Cancello tavola globale
|
||||||
EgtLuaResetGlobVar("PRINT")
|
EgtLuaResetGlobVar("PRINT")
|
||||||
@@ -29,6 +30,9 @@ Module LuaExec
|
|||||||
dMachiningConstant = MachiningConstant.dValue
|
dMachiningConstant = MachiningConstant.dValue
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
EgtLuaCreateGlobTable("PRINT")
|
||||||
|
EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1)
|
||||||
|
EgtLuaSetGlobStringVar("PRINT.BASEDIR", Map.refMainWindowVM.MainWindowM.s3dPrintingDir)
|
||||||
EgtLuaCreateGlobTable("MACHINING")
|
EgtLuaCreateGlobTable("MACHINING")
|
||||||
EgtLuaSetGlobNumVar("MACHINING.K", dMachiningConstant)
|
EgtLuaSetGlobNumVar("MACHINING.K", dMachiningConstant)
|
||||||
EgtLuaCreateGlobTable("MATERIAL")
|
EgtLuaCreateGlobTable("MATERIAL")
|
||||||
@@ -49,30 +53,29 @@ Module LuaExec
|
|||||||
' Eseguo lo script
|
' Eseguo lo script
|
||||||
If EgtLuaExecFile(sExecPath) Then
|
If EgtLuaExecFile(sExecPath) Then
|
||||||
bOk = True
|
bOk = True
|
||||||
'' Recupero i risultati
|
|
||||||
'Dim nErr As Integer = 999
|
|
||||||
'EgtLuaGetGlobIntVar("MATERIAL.ERR", nErr)
|
|
||||||
'bOk = (nErr <= 0)
|
|
||||||
'If Not bOk Then EgtOutLog("ExecSlice Err=" & nErr.ToString())
|
|
||||||
Else
|
Else
|
||||||
EgtOutLog("Error executing Slice Exec script " & sExecPath)
|
EgtOutLog("Error executing Slice Exec script " & sExecPath)
|
||||||
bOk = False
|
bOk = False
|
||||||
End If
|
End If
|
||||||
' Cancello tavola globale
|
' Cancello tavola globale
|
||||||
EgtLuaResetGlobVar("MATERIAL")
|
EgtLuaResetGlobVar("MATERIAL")
|
||||||
|
EgtLuaResetGlobVar("MACHINING")
|
||||||
|
EgtLuaResetGlobVar("PRINT")
|
||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function ExecGenerate() As Boolean
|
Friend Function ExecGenerate(ByRef sMsg As String) As Boolean
|
||||||
|
sMsg = ""
|
||||||
EgtOutLog("-- Start ExecGenerate --")
|
EgtOutLog("-- Start ExecGenerate --")
|
||||||
' eseguo generazione
|
' eseguo generazione
|
||||||
EgtLuaCreateGlobTable("PRINT")
|
EgtLuaCreateGlobTable("PRINT")
|
||||||
EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1)
|
EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1)
|
||||||
|
EgtLuaSetGlobStringVar("PRINT.BASEDIR", Map.refMainWindowVM.MainWindowM.s3dPrintingDir)
|
||||||
Dim sIsoFilePath As String = ""
|
Dim sIsoFilePath As String = ""
|
||||||
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
|
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
|
||||||
If nTabPartId <> GDB_ID.NULL Then
|
If nTabPartId <> GDB_ID.NULL Then
|
||||||
If Not EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath) OrElse
|
If Not EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath) OrElse
|
||||||
Not IO.Directory.Exists( IO.Path.GetDirectoryName(sIsoFilePath)) Then
|
Not IO.Directory.Exists(IO.Path.GetDirectoryName(sIsoFilePath)) Then
|
||||||
EgtGetCurrFilePath(sIsoFilePath)
|
EgtGetCurrFilePath(sIsoFilePath)
|
||||||
Dim sExtension As String = ""
|
Dim sExtension As String = ""
|
||||||
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "", sExtension, CurrentMachine.sMachIniFile)
|
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "", sExtension, CurrentMachine.sMachIniFile)
|
||||||
@@ -87,6 +90,7 @@ Module LuaExec
|
|||||||
If bOk Then
|
If bOk Then
|
||||||
Dim nErr As Integer = 999
|
Dim nErr As Integer = 999
|
||||||
EgtLuaGetGlobIntVar("PRINT.ERR", nErr)
|
EgtLuaGetGlobIntVar("PRINT.ERR", nErr)
|
||||||
|
EgtLuaGetGlobStringVar("PRINT.MSG", sMsg)
|
||||||
bOk = (nErr <= 0)
|
bOk = (nErr <= 0)
|
||||||
End If
|
End If
|
||||||
' Cancello tavola globale
|
' Cancello tavola globale
|
||||||
@@ -98,6 +102,8 @@ Module LuaExec
|
|||||||
EgtOutLog("-- Start ExecSolid --")
|
EgtOutLog("-- Start ExecSolid --")
|
||||||
' eseguo generazione
|
' eseguo generazione
|
||||||
EgtLuaCreateGlobTable("PRINT")
|
EgtLuaCreateGlobTable("PRINT")
|
||||||
|
EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1)
|
||||||
|
EgtLuaSetGlobStringVar("PRINT.BASEDIR", Map.refMainWindowVM.MainWindowM.s3dPrintingDir)
|
||||||
Dim bOk As Boolean = EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\CalcSolids.lua")
|
Dim bOk As Boolean = EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\CalcSolids.lua")
|
||||||
If bOk Then
|
If bOk Then
|
||||||
Dim nErr As Integer = 999
|
Dim nErr As Integer = 999
|
||||||
|
|||||||
@@ -95,9 +95,9 @@ Public Class ViewLayer
|
|||||||
RIBS = 4
|
RIBS = 4
|
||||||
SHELL_NUMBER = 5
|
SHELL_NUMBER = 5
|
||||||
AUX_SOLIDS = 6
|
AUX_SOLIDS = 6
|
||||||
SOLID_SLICE = 7
|
OTHERS = 7
|
||||||
SLICE_TOOLPATH = 8
|
SOLID_SLICE = 8
|
||||||
OTHERS = 9
|
SLICE_TOOLPATH = 9
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
Private m_Type As ViewLayerType
|
Private m_Type As ViewLayerType
|
||||||
@@ -229,23 +229,23 @@ Public Class ViewLayer
|
|||||||
EgtSetStatus(CurrPart.nOthersLayerId, Status)
|
EgtSetStatus(CurrPart.nOthersLayerId, Status)
|
||||||
End Select
|
End Select
|
||||||
Next
|
Next
|
||||||
'' se sono in importazione, dis/attivo anche queste superfici
|
' se sono in importazione, dis/attivo anche queste superfici
|
||||||
'If Map.refTopPanelVM.SelPage = Pages.IMPORT Then
|
If Map.refTopPanelVM.SelPage = Pages.IMPORT Then
|
||||||
' For Each CurrPart In Map.refManagePartPanelVM.ManagerPartList
|
For Each CurrPart In Map.refManagePartPanelVM.ManagerPartList
|
||||||
' For Each Layer In CurrPart.LayerList
|
For Each Layer In CurrPart.LayerList
|
||||||
' If (Layer.Type = ManagePart_Layer.LayerType.PRINT_SOLID AndAlso m_Type = ViewLayerType.PRINT_SOLID) OrElse
|
If (Layer.Type = ManagePart_Layer.LayerType.PRINT_SOLID AndAlso m_Type = ViewLayerType.PRINT_SOLID) OrElse
|
||||||
' (Layer.Type = ManagePart_Layer.LayerType.MACH_START AndAlso m_Type = ViewLayerType.START_MACHINING) OrElse
|
(Layer.Type = ManagePart_Layer.LayerType.MACH_START AndAlso m_Type = ViewLayerType.START_MACHINING) OrElse
|
||||||
' (Layer.Type = ManagePart_Layer.LayerType.RIBS AndAlso m_Type = ViewLayerType.RIBS) OrElse
|
(Layer.Type = ManagePart_Layer.LayerType.RIBS AndAlso m_Type = ViewLayerType.RIBS) OrElse
|
||||||
' (Layer.Type = ManagePart_Layer.LayerType.SHELL_NUMBER AndAlso m_Type = ViewLayerType.SHELL_NUMBER) OrElse
|
(Layer.Type = ManagePart_Layer.LayerType.SHELL_NUMBER AndAlso m_Type = ViewLayerType.SHELL_NUMBER) OrElse
|
||||||
' (Layer.Type = ManagePart_Layer.LayerType.AUX_SOLIDS AndAlso m_Type = ViewLayerType.AUX_SOLIDS) OrElse
|
(Layer.Type = ManagePart_Layer.LayerType.AUX_SOLIDS AndAlso m_Type = ViewLayerType.AUX_SOLIDS) OrElse
|
||||||
' (Layer.Type = ManagePart_Layer.LayerType.OTHERS AndAlso m_Type = ViewLayerType.OTHERS) Then
|
(Layer.Type = ManagePart_Layer.LayerType.OTHERS AndAlso m_Type = ViewLayerType.OTHERS) Then
|
||||||
' For Each Entity In Layer.EntityList
|
For Each Entity In Layer.EntityList
|
||||||
' EgtSetStatus(Entity.nId, Status)
|
EgtSetStatus(Entity.nId, Status)
|
||||||
' Next
|
Next
|
||||||
' End If
|
End If
|
||||||
' Next
|
Next
|
||||||
' Next
|
Next
|
||||||
'End If
|
End If
|
||||||
' Ripristino stato segnalazione modifica
|
' Ripristino stato segnalazione modifica
|
||||||
DisableMgr.ReEnable()
|
DisableMgr.ReEnable()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user