Merge branch 'develop' into NewInterface

This commit is contained in:
Emmanuele Sassi
2023-02-03 09:37:33 +01:00
24 changed files with 909 additions and 96 deletions
+2
View File
@@ -14,6 +14,7 @@
Public Const START_GEOM = "Start"
Public Const RIB_EXTRUSION = "RibExtrusion"
Public Const RIB_CURVE = "RibCurve"
Public Const RIB_ID = "RibId"
Public Const VIEWPARAMS = "ViewParams"
Public Const IMPORTED_SOLID = "ImportedSolid"
Public Const RESULT_READ_PROG = "ResultReadProg"
@@ -127,6 +128,7 @@
Public Const MAC_AUXSOLIDSWIPELEN = "AuxSolidsWipeLen"
Public Const MAC_AUXSOLIDSWIPEDIR = "AuxSolidsWipeDir"
Public Const MAC_DYNAMICMODE = "DynamicMode"
Public Const MAC_PRINTORDER = "PrintOrder"
Public Const MAC_CONSTANT = "Constant"
Public Const MAC_MATERIALS = "Materials"
+110 -8
View File
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports EgtUILib
Imports EgtWPFLib5
@@ -150,7 +151,7 @@ Public Class CurrMachining
Friend Overrides Sub OnMachiningParamPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
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))
NotifyPropertyChanged(NameOf(ghName))
NotifyPropertyChanged(NameOf(sCurrSlicingType))
@@ -158,9 +159,25 @@ Public Class CurrMachining
NotifyPropertyChanged(NameOf(sCurrStrandW))
NotifyPropertyChanged(NameOf(sCurrStrandCount))
NotifyPropertyChanged(NameOf(sCurrOffset))
sender.NotifyPropertyChanged(NameOf(sender.bIsModifiedFromDb))
End Select
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)
EgtSetInfo(nPartId, MAC_GUID, m_sCurrGUID.ToString())
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.TOOLDIAM, 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
m_sName = "Shell"
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.LINKTYPE, nPartId, nIndex, bForceFromDb),
@@ -250,12 +268,6 @@ Public Class CurrMachiningCathegory
End Select
End Sub
Friend Sub SaveCurrParams()
For Each Param In m_MachiningParamList
Param.SaveParam()
Next
End Sub
Friend Sub ResetCurrParams()
For Each Param In m_MachiningParamList
Param.ResetParam()
@@ -975,3 +987,93 @@ Public Class CurrCheckMachiningParam
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_ValueList = New ObservableCollection(Of IdNameStruct)
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()
m_SelValue = Nothing
Value = DbParam.OrigValue
NotifyPropertyChanged(NameOf(Value))
NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
End Sub
#End Region ' ResetParam
#End Region ' COMMANDS
End Class
@@ -135,6 +135,45 @@
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</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="&lt;>"
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>
</Expander>
@@ -59,8 +59,23 @@ Public Class CurrMachiningPanelVM
End Property
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
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
Map.refTopPanelVM.SelPage = Pages.MODIFY
End Sub
+97 -20
View File
@@ -20,13 +20,25 @@ Public Class DispositionPanelVM
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewXPos As Double = ptReference.x
StringToLen(value, dNewXPos)
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sXPos))
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
Dim dMin As Double = 0
Dim dMax As Double = CurrentMachine.b3Tab.DimX
If b3Print.Max.x > ptReference.x Then
dMax -= b3Print.Max.x - ptReference.x
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))
End Set
End Property
@@ -45,13 +57,25 @@ Public Class DispositionPanelVM
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewYPos As Double = ptReference.y
StringToLen(value, dNewYPos)
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sYPos))
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
Dim dMin As Double = 0
Dim dMax As Double = CurrentMachine.b3Tab.DimY
If b3Print.Max.y > ptReference.y Then
dMax -= b3Print.Max.y - ptReference.y
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))
End Set
End Property
@@ -70,16 +94,65 @@ Public Class DispositionPanelVM
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sZPos))
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
' 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))
End Set
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 b3Ribs.Min.x <> INFINITO Then
b3Print.Add(b3Ribs)
End If
End If
Return b3Print
End Function
Private m_RotAxes As Boolean() = { False, False, False}
Public Property RotX As Boolean
Get
@@ -144,6 +217,7 @@ Public Class DispositionPanelVM
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
m_sRotAngle = 0
Map.refReferencePanelVM.UpdateFramePosition()
Map.refDispositionPanelVM.UpdateZPos()
RefreshPos()
EgtDraw()
NotifyPropertyChanged(NameOf(sRotAngle))
@@ -221,6 +295,7 @@ Public Class DispositionPanelVM
' seleziono percorso corrente
EgtDeselectAll()
EgtSelectObj(Map.refTopPanelVM.SelPart.nPartId)
EgtDraw()
End Sub
Friend Sub UpdateUI()
@@ -229,8 +304,9 @@ Public Class DispositionPanelVM
m_bRotating = False
' ripristino griglia
EgtSetGridFrame(m_PrevGridOrigin)
EgtDraw()
End If
EgtDeselectAll()
EgtDraw()
End Sub
Friend Sub OnKeyDown(Key As Forms.Keys)
@@ -239,8 +315,9 @@ Public Class DispositionPanelVM
m_bRotating = False
' ripristino griglia
EgtSetGridFrame(m_PrevGridOrigin)
EgtDraw()
End If
EgtDeselectAll()
EgtDraw()
End If
End Sub
+8
View File
@@ -216,6 +216,10 @@
<DependentUpon>RibPanelV.xaml</DependentUpon>
</Compile>
<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">
<DependentUpon>RibParamPanelV.xaml</DependentUpon>
</Compile>
@@ -417,6 +421,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="RibParamPanel\CopyFromWndV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="RibParamPanel\RibParamPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
+223 -9
View File
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports EgtUILib
Imports EgtWPFLib5
@@ -53,6 +54,14 @@ Public Class Machining
FAST = 2
End Enum
Public Enum MPAR_PRINT_ORDER As Integer
SHELL = 1
EXTRA_SHELL = 2
INFILL = 3
AUX_SOLID = 4
RIB = 5
End Enum
Protected m_CathegoryList As New ObservableCollection(Of MachiningCathegory)
Public ReadOnly Property CathegoryList As ObservableCollection(Of MachiningCathegory)
Get
@@ -160,7 +169,7 @@ Public Class Machining
NotifyPropertyChanged(NameOf(ghName))
End Sub
Friend Sub Save()
Friend Overridable Sub Save()
If bIsModified Then
' salvo tutti i parametri su orig
SaveParams()
@@ -171,7 +180,7 @@ Public Class Machining
End If
End Sub
Private Sub SaveParams()
Protected Overridable Sub SaveParams()
SaveName()
For Each Cathegory In m_CathegoryList
Cathegory.SaveParams()
@@ -204,8 +213,9 @@ Public Class Machining
Friend Overridable Sub OnMachiningParamPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
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()
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Select
End Sub
@@ -316,7 +326,8 @@ Public Class MachiningCathegory
New NumericMachiningParam(MachiningParam.Params.G0FEEDZ, nIndex),
New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, 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
m_sName = "Shell"
m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.LINKTYPE, nIndex),
@@ -463,6 +474,7 @@ Public MustInherit Class MachiningParam
STRANDOVERLAP = 57
FLOWRATE_PC = 58
DYNAMIC_MODE = 59
PRINT_ORDER = 60
MATERIALS = 100
End Enum
@@ -599,6 +611,8 @@ Public MustInherit Class MachiningParam
m_sName = "Flow rate [%]"
Case Params.DYNAMIC_MODE
m_sName = "Dynamic Mode"
Case Params.PRINT_ORDER
m_sName = "Print Order"
End Select
End Sub
@@ -637,7 +651,6 @@ Public Class NumericMachiningParam
StringToDouble(value, m_dValue)
End If
NotifyPropertyChanged(NameOf(sValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -903,7 +916,6 @@ Public Class StringMachiningParam
Set(value As String)
m_sValue = value
NotifyPropertyChanged(NameOf(sValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -962,7 +974,6 @@ Public Class ComboMachiningParam
Set(value As IdNameStruct)
m_SelValue = value
NotifyPropertyChanged(NameOf(SelValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -1110,7 +1121,6 @@ Public Class CheckMachiningParam
Set(value As Boolean)
m_bValue = value
NotifyPropertyChanged(NameOf(bValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -1203,7 +1213,6 @@ Public Class MaterialMachiningParam
Set(value As Boolean)
m_bValue = value
NotifyPropertyChanged(NameOf(bValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -1257,3 +1266,208 @@ Public Class MaterialMachiningParam
End Class
Public Class OrderedMachiningParam
Inherits MachiningParam
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 StandardValueList() As String = {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}
Dim StringValueList() As String = StandardValueList
If value.Length = 9 Then
StringValueList = value.Split(","c)
End If
If StringValueList.Count <> 5 Then
StringValueList = StandardValueList
End If
If Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.SHELL) OrElse
Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL) OrElse
Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.INFILL) OrElse
Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.AUX_SOLID) OrElse
Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB) Then
StringValueList = StandardValueList
End If
m_ValueList.Clear()
For Each StringValue In StringValueList
Dim nValue As Integer = -1
Integer.TryParse(StringValue, nValue)
Dim ItemList As IdNameStruct
Select Case nValue
Case Machining.MPAR_PRINT_ORDER.SHELL
ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell")
Case Machining.MPAR_PRINT_ORDER.EXTRA_SHELL
ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shell")
Case Machining.MPAR_PRINT_ORDER.INFILL
ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infill")
Case Machining.MPAR_PRINT_ORDER.AUX_SOLID
ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids")
Case Machining.MPAR_PRINT_ORDER.RIB
ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB, "Ribs")
End Select
m_ValueList.Add(ItemList)
Next
End Select
End Set
End Property
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
m_ValueList = New ObservableCollection(Of IdNameStruct)
m_SelValue = Nothing
Else
Select Case Type
Case Params.PRINT_ORDER
m_ValueList = New ObservableCollection(Of IdNameStruct)
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
m_ValueList = New ObservableCollection(Of IdNameStruct)(m_ValueList.OrderBy(Function(x) x.Id))
If Value <> CurrValue Then
SelValue = Nothing
NotifyPropertyChanged(NameOf(ValueList))
NotifyPropertyChanged(NameOf(Value))
NotifyPropertyChanged(NameOf(SelValue))
End If
End Sub
#End Region ' ResetOrder
#End Region ' COMMANDS
End Class
+32
View File
@@ -188,6 +188,38 @@
Margin="2.5,0,0,0"/>
</Grid>
</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="&lt;>"
Command="{Binding ResetOrder_Command}"
Style="{StaticResource ToolBar_SmallButton}"/>
</StackPanel>
</Grid>
</Grid>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>
</Expander>
+2 -2
View File
@@ -195,8 +195,8 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2501, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 2501, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2502, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 2502, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
+4 -9
View File
@@ -361,6 +361,7 @@ Public Class ManagePartPanelVM
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetInfo(PartManager_GeomEntity.nId, RIB_ID, RibPanelVM.GetNextRibIndex())
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
@@ -432,17 +433,9 @@ Public Class ManagePartPanelVM
End If
End Select
Next
' aggiungo riferimento
' aggiungo layer riferimento
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
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)
' appoggio il pezzo sulla tavola
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
@@ -454,6 +447,8 @@ Public Class ManagePartPanelVM
EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
' aggiorno riferimento
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
Next
End If
'EgtAddMachGroup("3dPrint")
+18 -12
View File
@@ -684,44 +684,38 @@ Public Class GeomEntity_MenuItem
' creo layer solido di stampa
Dim nPrintPartLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
EgtRelocateGlob(m_OrigEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
' calcolo box superficie per creazione riferimento
EgtGetBBoxGlob(m_OrigEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
' coloro l'entita'
EgtSetColor(m_OrigEntity.nId, GeomEntityColors.c3Print)
' creo layer mach start
Dim nMachStartLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nMachStartLayerId, LAY_MACH_START)
EgtSetColor(nMachStartLayerId, GeomEntityColors.c3MachStart)
Dim nMachStartId As Integer = GDB_ID.NULL
' creo punto di partenza
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)
EgtSetName(nMachStartId, START_GEOM)
' coloro l'entita' di rosso
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
' creo layer ribs
Dim nRibsLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nRibsLayerId, LAY_RIBS)
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
' creo layer shell number
Dim nShellNumberLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
' creo layer aux
Dim nAuxSolidsLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
' creo layer others
Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nOthersLayerId, LAY_OTHERS)
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
' aggiungo riferimento
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
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)
' appoggio il pezzo sulla tavola
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
@@ -730,6 +724,8 @@ Public Class GeomEntity_MenuItem
EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
' aggiorno riferimento
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
Dim ManagePart_Part As ManagePart_Part = New ManagePart_Part(NewPart)
' elimino da posizione originale
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
@@ -768,6 +764,7 @@ Public Class GeomEntity_MenuItem
' aggiorno riferimenti nel context menu item
m_OrigEntity.UpdateContextMenu()
Case ManagePartPanelVM.ManagePartType.MODIFY
Dim bIsMovedRib As Boolean = False
' recupero layer da pezzo
Dim nLayerId As Integer = GDB_ID.NULL
Select Case m_Type
@@ -801,6 +798,8 @@ Public Class GeomEntity_MenuItem
Case ManagePart_Layer.LayerType.MACH_START
Case ManagePart_Layer.LayerType.RIBS
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
EgtRemoveInfo(m_OrigEntity.nId, RIB_ID)
bIsMovedRib = True
Case ManagePart_Layer.LayerType.SHELL_NUMBER
EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE)
Case ManagePart_Layer.LayerType.AUX_SOLIDS
@@ -833,7 +832,9 @@ Public Class GeomEntity_MenuItem
Case ManagePart_Layer.LayerType.RIBS
EgtSetName(m_OrigEntity.nId, LAY_RIBS)
EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetInfo(m_OrigEntity.nId, RIB_ID, RibPanelVM.GetNextRibIndex())
EgtSetColor(m_OrigEntity.nId, c3Rib)
bIsMovedRib = True
Case ManagePart_Layer.LayerType.SHELL_NUMBER
EgtSetName(m_OrigEntity.nId, LAY_SHELL_NBR)
EgtSetInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
@@ -846,6 +847,11 @@ Public Class GeomEntity_MenuItem
EgtSetName(m_OrigEntity.nId, LAY_OTHERS)
EgtSetColor(m_OrigEntity.nId, c3Others)
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()
' aggiorno riferimenti nel context menu item
If bUpdateAllContextMenu Then
+2 -2
View File
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.1.1")>
<Assembly: AssemblyFileVersion("2.5.1.1")>
<Assembly: AssemblyVersion("2.5.2.1")>
<Assembly: AssemblyFileVersion("2.5.2.1")>
+22 -17
View File
@@ -30,6 +30,7 @@ Public Class ReferencePanelVM
End Get
Set(value As ReferenceBtn)
m_SelReference = value.Type
EgtSetInfo(Map.refTopPanelVM.SelPart.nReferenceLayerId, KEY_REFERENCE, value.Type)
UpdateFramePosition()
End Set
End Property
@@ -42,6 +43,7 @@ Public Class ReferencePanelVM
If value Then
m_SelReference = ReferenceBtn.References.FROM_IMPORT
NotifyPropertyChanged(NameOf(ghSelReference))
EgtSetInfo(Map.refTopPanelVM.SelPart.nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.FROM_IMPORT)
UpdateFramePosition()
End If
End Set
@@ -68,41 +70,44 @@ Public Class ReferencePanelVM
End Sub
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
EgtEmptyGroup(SelPart.nReferenceLayerId)
' Creo riferimento
Dim frPrintSolid As New Frame3d()
If m_SelReference = ReferenceBtn.References.FROM_IMPORT Then
If SelReference = ReferenceBtn.References.FROM_IMPORT Then
EgtGetGlobFrame(SelPart.nPrintSolidId, frPrintSolid)
frPrintSolid.Setup(New Point3d(frPrintSolid.Orig.x, frPrintSolid.Orig.y, 0))
Else
Dim b3PrintSolid As New BBox3d
EgtGetBBoxGlob(SelPart.nPrintSolidId, GDB_BB.STANDARD, b3PrintSolid)
Dim b3ToBePrintSolid As BBox3d = Map.refDispositionPanelVM.GetSolidForReferenceBBox(SelPart)
' Creo riferimento
Dim ptOrig As New Point3d(b3PrintSolid.Min())
Select Case m_SelReference
Dim ptOrig As New Point3d(b3ToBePrintSolid.Min())
Select Case SelReference
Case ReferenceBtn.References.TL
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX
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.BR
ptOrig += b3PrintSolid.DimX() * Vector3d.X_AX
ptOrig += b3ToBePrintSolid.DimX() * Vector3d.X_AX
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
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX
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
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
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
ptOrig += b3PrintSolid.DimX() / 2 * Vector3d.X_AX
ptOrig += b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX
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
Dim vtMovedPart As Vector3d
EgtGetInfo(SelPart.nPartId, "MovedPart", vtMovedPart)
@@ -115,7 +120,7 @@ Public Class ReferencePanelVM
EgtSetMode(nFrameId, GDB_MD.LOCKED)
SelPart.UpdateReferenceId(nFrameId)
End If
EgtSetInfo(SelPart.nReferenceLayerId, KEY_REFERENCE, m_SelReference)
Map.refDispositionPanelVM.RefreshPos()
EgtDraw()
End Sub
+42 -5
View File
@@ -1,8 +1,10 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.Globalization
Imports System.Windows.Markup
Imports EgtUILib
Imports EgtWPFLib5
Imports Icarus.RibEntity
Public Class RibPanelVM
Inherits VMBase
@@ -73,7 +75,16 @@ Public Class RibPanelVM
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
Dim dNewXPos As Double = b3Reference.Min.x
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.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
@@ -102,7 +113,16 @@ Public Class RibPanelVM
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
Dim dNewYPos As Double = b3Reference.Min.y
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.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
@@ -131,7 +151,7 @@ Public Class RibPanelVM
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
Dim dNewZPos As Double = b3Reference.Min.y
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.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
@@ -676,6 +696,20 @@ Public Class RibPanelVM
NotifyPropertyChanged(NameOf(SelRib))
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
#Region "COMMANDS"
@@ -1201,7 +1235,7 @@ Public Class RibPanelVM
End While
EgtDeselectAll()
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 Region ' CPlaneObj
@@ -1332,7 +1366,10 @@ Public Class RibEntity
End Property
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
EgtSetInfo(nId, KEY_RIB_TYPE, Type)
Select Case Type
+34
View File
@@ -0,0 +1,34 @@
<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"
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>
+18
View File
@@ -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
+178
View File
@@ -0,0 +1,178 @@
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.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.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.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
+3
View File
@@ -120,6 +120,9 @@
<Button Content="Cancel"
Command="{Binding Cancel_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Copy From"
Command="{Binding CopyFrom_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid>
</Grid>
</Border>
+38
View File
@@ -10,6 +10,7 @@ Public Class RibParamPanelVM
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
Private m_cmdCopyFrom As ICommand
#End Region ' FIELDS & PROPERTIES
@@ -111,6 +112,12 @@ Public Class RibParamPanelVM
Public Sub Ok()
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
Select Case Map.refRibPanelVM.SelRib.Type
Case RibEntity.RibTypes.FROMDRAW
@@ -119,6 +126,12 @@ Public Class RibParamPanelVM
Case RibEntity.RibTypes.FROMIMPORT
WriteParamsInRib(Map.refRibPanelVM.SelRib.nExtrusionId)
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
' ripristino modalita' standard
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
@@ -146,6 +159,26 @@ Public Class RibParamPanelVM
#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 Class
@@ -167,6 +200,11 @@ Public Class RibNumericMachiningParam
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Set
End Property
Friend Sub SetValue(value As Double)
m_dValue = value
NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Sub
Private m_dPartValue As Double
Public ReadOnly Property dPartValue As Double
+5 -4
View File
@@ -451,7 +451,8 @@ Public Class MySceneHostVM
' elimino colore entita'
EgtResetColor(nNewEntityId)
' aggiorno riferimento pezzo
Map.refReferencePanelVM.UpdateFramePosition(MenuItem.OrigLayer.OrigPart.PrintPart)
Map.refReferencePanelVM.UpdateFramePosition()
Map.refDispositionPanelVM.UpdateZPos()
' elimino eventuale flag di spostamento a 45 gradi
EgtRemoveInfo(MenuItem.OrigLayer.OrigPart.PrintPart.nPartId, "MovedPart")
' elimino vecchio elemento ed aggiungo nuovo
@@ -552,10 +553,10 @@ Public Class MySceneHostVM
'Assegnazione nome file con dialogo
Dim SaveFileDialog As New SaveFileDialog With {
.Title = "Export",
.Filter = "Stereolithography (*.stl)|*.stl" &
"|3D Manufacturing format (*.3mf)|*.3mf",
.Filter = "3D Manufacturing format (*.3mf)|*.3mf" &
"|Stereolithography (*.stl)|*.stl",
.FilterIndex = 1,
.FileName = Path.ChangeExtension(MainController.GetCurrFile(), "3mf")
.FileName = Path.ChangeExtension(MainController.GetCurrFile(), "").TrimEnd("."c)
}
Dim DialogResult As Boolean? = SaveFileDialog.ShowDialog
If IsNothing(DialogResult) OrElse Not DialogResult Then Return
@@ -73,7 +73,7 @@ Public Class ShellNumberPanelVM
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
Dim dNewXPos As Double = b3Reference.Min.x
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.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
@@ -102,7 +102,7 @@ Public Class ShellNumberPanelVM
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
Dim dNewYPos As Double = b3Reference.Min.y
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.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
@@ -131,7 +131,7 @@ Public Class ShellNumberPanelVM
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
Dim dNewZPos As Double = b3Reference.Min.y
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.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
+9 -2
View File
@@ -376,7 +376,8 @@ Public Class SliceManagerVM
' verifico esistenza e correttezza machgroup
InitMachGroup(True)
' eseguo generazione CN
bOk = ExecGenerate()
Dim sMsg As String = ""
bOk = ExecGenerate(sMsg)
' leggo stima tempo e la riporto in layer di calcolo
EgtGetInfo(EgtGetFirstMachGroup(), "Ttot", m_dTime)
NotifyPropertyChanged(NameOf(ghTime))
@@ -391,7 +392,13 @@ Public Class SliceManagerVM
nCurrPartId = EgtGetNextPart(nCurrPartId)
End While
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
' Aggiorno intestazione programma
+1 -1
View File
@@ -117,7 +117,7 @@ Public Class StartMachPanelVM
EgtStartPoint(m_SelStart.nId, GDB_ID.ROOT, ptReference)
Dim dNewZPos As Double = ptReference.z
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)
EgtDraw()
Else
+4 -2
View File
@@ -64,7 +64,8 @@ Module LuaExec
Return bOk
End Function
Friend Function ExecGenerate() As Boolean
Friend Function ExecGenerate(ByRef sMsg As String) As Boolean
sMsg = ""
EgtOutLog("-- Start ExecGenerate --")
' eseguo generazione
EgtLuaCreateGlobTable("PRINT")
@@ -74,7 +75,7 @@ Module LuaExec
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
If nTabPartId <> GDB_ID.NULL Then
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)
Dim sExtension As String = ""
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "", sExtension, CurrentMachine.sMachIniFile)
@@ -89,6 +90,7 @@ Module LuaExec
If bOk Then
Dim nErr As Integer = 999
EgtLuaGetGlobIntVar("PRINT.ERR", nErr)
EgtLuaGetGlobStringVar("PRINT.MSG", sMsg)
bOk = (nErr <= 0)
End If
' Cancello tavola globale