Compare commits

..

31 Commits

Author SHA1 Message Date
Emmanuele Sassi 238bdbb1ce - Correzione su import/export machining 2022-12-14 11:53:24 +01:00
Emmanuele Sassi 144b8dc66e - aggiunta gestione dis/attivazione wait
- aggiunta modifica con selezione dei tempi wait
2022-12-13 19:05:57 +01:00
Emmanuele Sassi 5f9a01ae2e - aggiunta del parametro G0FeedZ
- aggiunta gestione colori e trasparenze categorie
- corretta creazione nuovo pezzo da superficie in import
- Reintrodotta gestione parametro RibsLink su singole Ribs
2022-12-13 11:01:58 +01:00
Emmanuele Sassi a6386e64d9 Merge remote-tracking branch 'ICARUS/main' into ImportExportMachiningDb&Material 2022-12-09 17:16:55 +01:00
Emmanuele Sassi 551eec6496 - aggiunta gestione spostamento pezzo print quando aggiunto o rimosso e stampa a 45 gradi 2022-12-09 16:45:37 +01:00
Emmanuele Sassi a24c4ada62 - correzione indice di slice 2022-12-09 12:43:00 +01:00
DarioS 2a86d67ca9 Icarus 2.4l3 :
- riportate su StartMach e ShellNumber le modifiche di selezione fatte sui Ribs.
2022-12-07 17:37:36 +01:00
DarioS 5c4a8adf9b Icarus 2.4l2 :
- corretti movimenti e rotazioni di LayerStart, Ribs e Reduce
- bottone impostazioni Grid visibile solo se Grid abilitata
- migliorato controllo esistenza direttorio generazione CN.
2022-12-06 16:56:58 +01:00
DarioS 0cc2534628 Icarus :
- corretta gestione rotazione pezzo (ora default asse Z)
- quando si fa SaveAs si rimuove il nome del CN da generare (per forzare generazione con nuovo nome)
- ora gestita anche estrusione 45deg in Y e riordinate le parti relative compresa abilitazione da Ini macchina.
2022-12-05 11:45:05 +01:00
DarioS 2a861dca1b Icarus 2.4k6 :
- aggiunte versioni a 32bit solo per usi interni (test/debug).
2022-11-28 15:35:15 +01:00
Emmanuele Sassi 16715a8c08 Icarus 2.4k5 :
- cambio di versione
2022-11-23 11:09:03 +01:00
Emmanuele Sassi 4c5500c490 Merge branch 'main' of https://gitlab.steamware.net/egalware/icarus 2022-11-23 11:08:18 +01:00
Emmanuele Sassi 75b4b4e4d0 - correzione se lavorazione nulla 2022-11-23 11:08:15 +01:00
Emmanuele Sassi b643cb5030 - correzione 2022-11-23 10:56:15 +01:00
DarioS f710918411 Icarus :
- aggiunti controlli per evitare crash se progetto senza materiale.
2022-11-22 19:59:51 +01:00
DarioS 1585fc2659 Icarus :
- controllo esistenza direttorio in cui generare CN, altrimenti direttorio del progetto.
2022-11-22 19:25:39 +01:00
Emmanuele Sassi a00170b37a Icarus 2.4k4 :
- cambio di versione
2022-11-22 18:06:24 +01:00
Emmanuele Sassi 00836e0695 - correzione errore su creazione copia materiale
- migliorata gestione cancellazione materiale su con chiave di alto livello
2022-11-22 18:03:35 +01:00
Emmanuele Sassi c06d75e292 Merge branch 'main' into ImportExportMachiningDb&Material 2022-11-22 16:11:50 +01:00
Emmanuele Sassi a6acc66099 - migliorato import export 2022-11-22 16:10:08 +01:00
Emmanuele Sassi c822538fb7 Icarus 2.4k3 :
- cambio versione
2022-11-14 21:14:17 +01:00
Emmanuele Sassi 9072dc3780 - correzioni apertura file con materiale o lavorazione non presenti 2022-11-14 21:11:53 +01:00
Emmanuele Sassi a9ed233d77 Merge branch 'NewImportModifyPart' 2022-11-14 20:14:00 +01:00
Emmanuele Sassi 0635302dac Merge branch 'develop' 2022-11-14 20:13:49 +01:00
Emmanuele Sassi 12de367ba1 - Importazione ed esportazione lavorazioni 2022-11-14 20:12:49 +01:00
Emmanuele Sassi a68dba11a2 Merge branch 'develop' into ImportExportMachiningDb&Material 2022-11-14 13:28:14 +01:00
Emmanuele Sassi 60784d2588 - Cambiato modo di dichiarare materiali da costruttore
- Disabilitato bottone cancella su materiali costruttore
2022-11-14 13:27:58 +01:00
Emmanuele Sassi 5d26914967 Merge branch 'develop' into ImportExportMachiningDb&Material 2022-11-14 09:35:34 +01:00
Emmanuele Sassi 4c4356dac7 - correzione spostamento aggiuntivo riferimento su stampa a 45 gradi 2022-11-14 09:17:23 +01:00
Emmanuele Sassi 98628b887e - Inizio implementazione finestra di import export 2022-10-28 08:33:03 +02:00
Emmanuele Sassi 5152600fd9 Merge remote-tracking branch 'ICARUS/main' into ImportExportMachiningDb&Material 2022-10-27 22:28:40 +02:00
45 changed files with 1762 additions and 397 deletions
+7 -1
View File
@@ -3,18 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 16
VisualStudioVersion = 16.0.32002.261 VisualStudioVersion = 16.0.32002.261
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Icarus", "Icarus/Icarus.vbproj", "{BCDE0368-2C69-4948-8723-D0FE71417986}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Icarus", "Icarus\Icarus.vbproj", "{BCDE0368-2C69-4948-8723-D0FE71417986}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64 Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.ActiveCfg = Debug|x64 {BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.ActiveCfg = Debug|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.Build.0 = Debug|x64 {BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.Build.0 = Debug|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x86.ActiveCfg = Debug|x86
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x86.Build.0 = Debug|x86
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.ActiveCfg = Release|x64 {BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.ActiveCfg = Release|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.Build.0 = Release|x64 {BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.Build.0 = Release|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x86.ActiveCfg = Release|x86
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x86.Build.0 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
+2
View File
@@ -36,6 +36,7 @@
Public Const KEY_SPEED = "Speed" Public Const KEY_SPEED = "Speed"
Public Const KEY_SLICEID = "SliceId" Public Const KEY_SLICEID = "SliceId"
Public Const KEY_MASS = "PrintMass" Public Const KEY_MASS = "PrintMass"
Public Const KEY_EMITWAITINGTIME = "EmitWaitingTime"
' parametri Materiali ' parametri Materiali
@@ -95,6 +96,7 @@
Public Const MAC_WIPEDIR = "WipeDir" Public Const MAC_WIPEDIR = "WipeDir"
Public Const MAC_FLOORCOUNT = "FloorCount" Public Const MAC_FLOORCOUNT = "FloorCount"
Public Const MAC_G0FEED = "G0Feed" Public Const MAC_G0FEED = "G0Feed"
Public Const MAC_G0FEEDZ = "G0FeedZ"
Public Const MAC_TOOLDIAM = "ToolDiam" Public Const MAC_TOOLDIAM = "ToolDiam"
Public Const MAC_RIBSTYPE = "RibsType" Public Const MAC_RIBSTYPE = "RibsType"
Public Const MAC_RIBSOVERLAP = "RibsOverlap" Public Const MAC_RIBSOVERLAP = "RibsOverlap"
+8
View File
@@ -113,6 +113,14 @@ Public Module ConstIni
Public Const K_VIEWSLIDER As String = "ViewSlider" Public Const K_VIEWSLIDER As String = "ViewSlider"
Public Const K_IMPORTCURREXTENSION As String = "ImportCurrExtension" Public Const K_IMPORTCURREXTENSION As String = "ImportCurrExtension"
Public Const S_COLORS As String = "Colors"
Public Const K_CLR_PRINTPART As String = "PrintPart"
Public Const K_CLR_RIBS As String = "Ribs"
Public Const K_CLR_SHELLNUMBERS As String = "ShellNumbers"
Public Const K_CLR_AUXSOLIDS As String = "AuxSolids"
Public Const K_CLR_MACHSTART As String = "MachStart"
Public Const K_CLR_OTHERS As String = "Others"
Public Const S_MRUFILES As String = "MruFiles" Public Const S_MRUFILES As String = "MruFiles"
Public Const S_MRUIMPORTFILES As String = "MruImportFiles" Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
+1 -1
View File
@@ -32,7 +32,7 @@
Public Const K_MACH_EXITSCRIPT As String = "ExitScript" Public Const K_MACH_EXITSCRIPT As String = "ExitScript"
Public Const S_MACH_PRINTING3D As String = "3dPrinting" Public Const S_MACH_PRINTING3D As String = "3dPrinting"
Public Const K_HORIZONTAL_PRINT As String = "HorizontalPrint" Public Const K_SLICINGTYPE As String = "SlicingType"
Public Const K_SPEED_MIN As String = "SpeedMin" Public Const K_SPEED_MIN As String = "SpeedMin"
Public Const K_SPEED_MAX As String = "SpeedMax" Public Const K_SPEED_MAX As String = "SpeedMax"
+19 -8
View File
@@ -194,6 +194,7 @@ Public Class CurrMachiningCathegory
New CurrComboMachiningParam(MachiningParam.Params.DIRECTION, nPartId, nIndex, bForceFromDb), New CurrComboMachiningParam(MachiningParam.Params.DIRECTION, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nPartId, nIndex, bForceFromDb), New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEED, nPartId, nIndex, bForceFromDb), New CurrNumericMachiningParam(MachiningParam.Params.G0FEED, 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)})
Case Cathegories.LINK Case Cathegories.LINK
@@ -273,13 +274,13 @@ Public Class CurrNumericMachiningParam
Public Overrides Property sValue As String Public Overrides Property sValue As String
Get Get
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString( m_dValue, 2)) Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get End Get
Set(value As String) Set(value As String)
If m_bIsLen Then If m_bIsLen Then
StringToLen(value, m_dValue) StringToLen(value, m_dValue)
Else Else
StringToDouble( value, m_dValue) StringToDouble(value, m_dValue)
End If End If
NotifyPropertyChanged(NameOf(sValue)) NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb)) NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
@@ -366,6 +367,9 @@ Public Class CurrNumericMachiningParam
Case Params.G0FEED Case Params.G0FEED
bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEED, m_dValue) bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEED, m_dValue)
m_bIsLen = True m_bIsLen = True
Case Params.G0FEEDZ
bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEEDZ, m_dValue)
m_bIsLen = True
Case Params.TOOLDIAM Case Params.TOOLDIAM
bReadFromPart = EgtGetInfo(nPartId, MAC_TOOLDIAM, m_dValue) bReadFromPart = EgtGetInfo(nPartId, MAC_TOOLDIAM, m_dValue)
m_bIsLen = True m_bIsLen = True
@@ -429,7 +433,7 @@ Public Class CurrNumericMachiningParam
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex) Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
Select Case Type Select Case Type
Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE, Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE,
Params.FLOORCOUNT, Params.G0FEED, Params.TOOLDIAM, Params.FLOWRATE_PC Params.FLOORCOUNT, Params.G0FEED, Params.G0FEEDZ, Params.TOOLDIAM, Params.FLOWRATE_PC
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.LINKPARAM, Params.LINKZUP, Params.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST, Case Params.LINKPARAM, Params.LINKZUP, Params.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST,
Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED_PC, Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED_PC,
@@ -503,6 +507,8 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_FLOORCOUNT, sWriteValue) EgtSetInfo(nPartId, MAC_FLOORCOUNT, sWriteValue)
Case Params.G0FEED Case Params.G0FEED
EgtSetInfo(nPartId, MAC_G0FEED, sWriteValue) EgtSetInfo(nPartId, MAC_G0FEED, sWriteValue)
Case Params.G0FEEDZ
EgtSetInfo(nPartId, MAC_G0FEEDZ, sWriteValue)
Case Params.TOOLDIAM Case Params.TOOLDIAM
EgtSetInfo(nPartId, MAC_TOOLDIAM, sWriteValue) EgtSetInfo(nPartId, MAC_TOOLDIAM, sWriteValue)
Case Params.RIBSOVERLAP Case Params.RIBSOVERLAP
@@ -677,11 +683,16 @@ Public Class CurrComboMachiningParam
Dim bReadFromPart As Boolean = False Dim bReadFromPart As Boolean = False
Select Case Type Select Case Type
Case Params.SLICINGTYPE Case Params.SLICINGTYPE
Dim nHorizontalPrint As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_HORIZONTAL_PRINT, 0, CurrentMachine.sMachIniFile) Dim nSlicingType As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_SLICINGTYPE, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical"), m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical")})
New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45°")}) If nSlicingType >= 1 Then
If nHorizontalPrint > 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X"))
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal")) If nSlicingType >= 2 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y"))
If nSlicingType >= 3 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
End If
End If
End If End If
Dim nSelValue As Integer = 0 Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_SLICINGTYPE, nSelValue) bReadFromPart = EgtGetInfo(nPartId, MAC_SLICINGTYPE, nSelValue)
@@ -186,15 +186,15 @@
<UniformGrid Columns="3"> <UniformGrid Columns="3">
<RadioButton Content="X" <RadioButton Content="X"
GroupName="Axes" GroupName="Axes"
IsChecked="{Binding RotAxes[0]}" IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/> Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y" <RadioButton Content="Y"
GroupName="Axes" GroupName="Axes"
IsChecked="{Binding RotAxes[1]}" IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/> Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z" <RadioButton Content="Z"
GroupName="Axes" GroupName="Axes"
IsChecked="{Binding RotAxes[2]}" IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/> Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid> </UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1" <EgtWPFLib5:EgtTextBox Grid.Row="1"
+46 -18
View File
@@ -21,12 +21,12 @@ Public Class DispositionPanelVM
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 If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference) EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sXPos)) NotifyPropertyChanged(NameOf(sXPos))
End If End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set End Set
End Property End Property
@@ -46,12 +46,12 @@ Public Class DispositionPanelVM
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 If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference) EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sYPos)) NotifyPropertyChanged(NameOf(sYPos))
End If End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set End Set
End Property End Property
@@ -71,22 +71,38 @@ Public Class DispositionPanelVM
Dim dNewZPos As Double = ptReference.z Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos) StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then If dNewZPos >= 0 Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference) EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sZPos)) NotifyPropertyChanged(NameOf(sZPos))
End If End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set End Set
End Property End Property
Private m_RotAxes() As Boolean = {False, False, True} Private m_RotAxes As Boolean() = { False, False, False}
Public Property RotAxes As Boolean() Public Property RotX As Boolean
Get Get
Return m_RotAxes Return m_RotAxes(0)
End Get End Get
Set(value As Boolean()) Set(value As Boolean)
m_RotAxes = value m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set End Set
End Property End Property
@@ -96,7 +112,7 @@ Public Class DispositionPanelVM
Return Vector3d.X_AX Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then Else
Return Vector3d.Z_AX Return Vector3d.Z_AX
End If End If
End Get End Get
@@ -109,22 +125,33 @@ Public Class DispositionPanelVM
End Get End Get
Set(value As String) Set(value As String)
Dim dNewAngle As Double = 0 Dim dNewAngle As Double = 0
If Not StringToLen(value, dNewAngle) Then If IsNothing( value) OrElse Not StringToLen(value, dNewAngle) Then
m_sRotAngle = 0 m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle)) NotifyPropertyChanged(NameOf(sRotAngle))
Return Return
End If End If
Dim vtMovedPart As Vector3d
if EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart", vtMovedPart) Then
Dim nEntId = EgtGetFirstInGroup( Map.refTopPanelVM.SelPart.nPrintSolidLayerId)
While nEntId <> GDB_ID.NULL
EgtMove(nEntId, -vtMovedPart, GDB_RT.GLOB)
nEntId = EgtGetNext( nEntId)
End While
EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart")
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) Then If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
EgtDraw()
RefreshPos()
m_sRotAngle = 0 m_sRotAngle = 0
Map.refReferencePanelVM.UpdateFramePosition()
RefreshPos()
EgtDraw()
NotifyPropertyChanged(NameOf(sRotAngle)) NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else Else
m_sRotAngle = value m_sRotAngle = value
End If End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set End Set
End Property End Property
@@ -178,7 +205,8 @@ Public Class DispositionPanelVM
End Sub End Sub
Friend Sub Init() Friend Sub Init()
RotZ = True
NotifyPropertyChanged(NameOf(RotZ))
End Sub End Sub
Friend Sub RefreshPos() Friend Sub RefreshPos()
+37 -1
View File
@@ -53,6 +53,28 @@
<PropertyGroup> <PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\Debug\</OutputPath>
<DocumentationFile>Icarus.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\Release\</OutputPath>
<DocumentationFile>Icarus.xml</DocumentationFile>
<Optimize>true</Optimize>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="EgtUILib, Version=2.4.7.1, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="EgtUILib, Version=2.4.7.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@@ -123,6 +145,10 @@
<DependentUpon>DispositionPanelV.xaml</DependentUpon> <DependentUpon>DispositionPanelV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="DispositionPanel\DispositionPanelVM.vb" /> <Compile Include="DispositionPanel\DispositionPanelVM.vb" />
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml.vb">
<DependentUpon>ImportExportMachiningPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelVM.vb" />
<Compile Include="InstrumentPanel\InstrumentPanelV.xaml.vb"> <Compile Include="InstrumentPanel\InstrumentPanelV.xaml.vb">
<DependentUpon>InstrumentPanelV.xaml</DependentUpon> <DependentUpon>InstrumentPanelV.xaml</DependentUpon>
</Compile> </Compile>
@@ -299,6 +325,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="InstrumentPanel\InstrumentPanelV.xaml"> <Page Include="InstrumentPanel\InstrumentPanelV.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@@ -631,6 +661,10 @@
<ItemGroup> <ItemGroup>
<Resource Include="Resources\TopPanel\Edit.png" /> <Resource Include="Resources\TopPanel\Edit.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Resources\MachiningDb\Export.png" />
<Resource Include="Resources\MachiningDb\Import.png" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\SplashScreen\GoldSplashscreen.png" /> <Resource Include="Resources\SplashScreen\GoldSplashscreen.png" />
</ItemGroup> </ItemGroup>
@@ -639,7 +673,9 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe <PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR32.exe
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Icarus\IcarusD32.exe
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Icarus\IcarusD64.exe</PostBuildEvent> IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Icarus\IcarusD64.exe</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
@@ -0,0 +1,62 @@
<EgtWPFLib5:EgtCustomWindow x:Class="ImportExportMachiningPanelV"
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"
Title="{Binding OkMsg}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
Width="400" Height="500">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="7*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding MachiningList}">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningItem}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Name="ActiveTxBx"
Grid.Column="0"
IsChecked="{Binding Active}"
Height="15"
Width="15"
Margin="0,0,5,0"
VerticalContentAlignment="Center"
Visibility="{Binding Path=DataContext.Active_Visibility,
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
<TextBlock Grid.Column="1"
Text="{Binding sName}"
FontSize="15"
Margin="0,0,5,0"
VerticalAlignment="Center" />
<Ellipse Grid.Column="2"
Width="15"
Height="15"
Fill="DarkOrange"
Visibility="{Binding Overwrite_Visibility}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Command="{Binding OkCommand}"
Content="{Binding OkMsg}"
IsEnabled="{Binding IsEnabledOkBtn, Mode=OneWay}"
Grid.Row="1"
Height="30" Width="100"
Margin="10" />
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class ImportExportMachiningPanelV
Private WithEvents m_ImportExportMachiningPanelVM As ImportExportMachiningPanelVM
Sub New(Owner As Window, ImportExportMachiningPanelVM As ImportExportMachiningPanelVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ImportExportMachiningPanelVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ImportExportMachiningPanelVM = ImportExportMachiningPanelVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ImportExportMachiningPanelVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,441 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class ImportExportMachiningPanelVM
Inherits VMBase
' Modalita' di apertura della finestra
Public Enum WindowModeEnum As Integer
IMPORT
EXPORT
End Enum
Private m_WindowMode As WindowModeEnum
Public ReadOnly Property WindowMode As WindowModeEnum
Get
Return m_WindowMode
End Get
End Property
' Lista delle lavorazioni
Private m_MachiningList As New ObservableCollection(Of ImpExpMachiningItem)
Public Property MachiningList As ObservableCollection(Of ImpExpMachiningItem)
Get
Return m_MachiningList
End Get
Set(value As ObservableCollection(Of ImpExpMachiningItem))
m_MachiningList = value
End Set
End Property
' Percorso del file da cui importare le lavorazioni
Private m_ImportFilePath As String
Public ReadOnly Property ImportFilePath As String
Get
Return m_ImportFilePath
End Get
End Property
' Lista delle lavorazioni presenti nel file da cui importare
Private m_ImportFileMachiningNameList As String()
Public ReadOnly Property ImportFileMachiningNameList As String()
Get
Return m_ImportFileMachiningNameList
End Get
End Property
' Lista delle lavorazioni importate con successo
Private m_vsImported As String()
Public ReadOnly Property vsImported As String()
Get
Return m_vsImported
End Get
End Property
Public ReadOnly Property IsEnabledOkBtn As Boolean
Get
For Each Machining In MachiningList
If Machining.Active Then Return True
Next
Return False
End Get
End Property
Friend Event m_CloseWindow(bDialogResult As Boolean)
' Definizione comandi
Private m_cmdOk As ICommand
#Region "MESSAGES"
Public ReadOnly Property OkMsg As String
Get
If WindowMode = WindowModeEnum.IMPORT Then
Return EgtMsg(31450)
Else
Return EgtMsg(31451)
End If
End Get
End Property
#End Region ' Messages
#Region "CONSTRUCTOR"
' export
Sub New()
m_WindowMode = WindowModeEnum.EXPORT
' 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) > 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
ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn
End Sub
' import
Sub New(sImportFilePath As String)
m_WindowMode = WindowModeEnum.IMPORT
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
ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn
End Sub
#End Region ' Constructor
#Region "METHODS"
Private Sub EnableOkBtn()
NotifyPropertyChanged(NameOf(IsEnabledOkBtn))
End Sub
Private Function AlreadyExist(MachiningName As String) As Boolean
Return Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = MachiningName)
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "OkCommand"
''' <summary>
''' Returns a command that remove the current selected machining.
''' </summary>
Public ReadOnly Property OkCommand() As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf ConfirmImpExpMachinings)
End If
Return m_cmdOk
End Get
End Property
''' <summary>
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
''' </summary>
Public Sub ConfirmImpExpMachinings(param As Object)
Select Case WindowMode
Case WindowModeEnum.IMPORT
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
End If
End If
Map.refMachiningDbVM.MachiningList.Add(NewMachining)
' ripristino path corretta del Db
CurrentMachine.SetMachiningFilePath(OrigFilePath)
' salvo la lavorazione
NewMachining.Save()
End If
Next
' ripristino path corretta del Db
CurrentMachine.SetMachiningFilePath(OrigFilePath)
' seleziono ultima importata
If Not IsNothing(NewMachining) Then
Map.refMachiningDbVM.SelMachining = NewMachining
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.SelMachining))
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 {
.Title = EgtMsg(31451) & " " & EgtMsg(31452),
.Filter = "File data (*.data)|*.data|Tutti i file (*.*)|*.*",
.FileName = String.Empty
}
If SaveFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
Dim sFilePath As String = String.Empty
sFilePath = SaveFileDlg.FileName
' se esiste già lo elimino
If File.Exists(sFilePath) Then
Try
File.Delete(sFilePath)
Catch ex As Exception
End Try
End If
' creo nuovo file
If Not File.Exists(sFilePath) Then
Try
File.WriteAllLines(sFilePath, {"; Commento per evitare BOM con UTF-8"})
Catch ex As Exception
End Try
End If
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
' Chiusura finestra
RaiseEvent m_CloseWindow(True)
End Sub
#End Region ' OkCommand
#End Region ' Commands
End Class
Public Class ImpExpMachiningItem
Inherits VMBase
Public Const IMPEXTNAME As String = "_imp"
' Actions
Friend Shared m_delEnableOkBtn As Action
Private Shared m_Empty As New MachiningIndex(-1, Guid.Empty, "None")
Private m_nIndex As Integer
Public ReadOnly Property nIndex As Integer
Get
Return m_nIndex
End Get
End Property
Private m_sGUID As Guid
Public ReadOnly Property sGUID As Guid
Get
Return m_sGUID
End Get
End Property
Private m_sOrigName As String
Private m_sName As String
Public ReadOnly Property sName As String
Get
Return m_sName
End Get
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
Dim bImpNameAlreadyInList = False
Dim nImpNameIndex As Integer = 0
If Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXTNAME) Then
nImpNameIndex += 1
While Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXTNAME & "_" & nImpNameIndex)
nImpNameIndex += 1
End While
End If
m_sName = m_sOrigName & IMPEXTNAME & 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
NotifyPropertyChanged(NameOf(Active))
Else
m_Active = True
End If
Else
m_ChangeName = False
m_Active = False
m_sName = m_sOrigName
NotifyPropertyChanged(NameOf(sName))
End If
NotifyPropertyChanged(NameOf(Overwrite_Visibility))
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
Private m_Overwrite_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Overwrite_Visibility As Visibility
Get
Return If(m_Active AndAlso m_AlreadyExist AndAlso Not m_ChangeName, Visibility.Visible, Visibility.Collapsed)
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
End Set
End Property
Sub New(nIndex As Integer, GUID As Guid, sName As String, AlreadyExist As Boolean)
m_nIndex = nIndex
m_sGUID = GUID
m_sOrigName = sName
m_sName = sName
m_AlreadyExist = AlreadyExist
m_Active = False
End Sub
Friend Shared Function Empty() As MachiningIndex
Return m_Empty
End Function
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
+133 -110
View File
@@ -9,7 +9,8 @@ Public Class Machining
Public Enum MPAR_SLICINGTYPE As Integer Public Enum MPAR_SLICINGTYPE As Integer
VERTICAL = 1 VERTICAL = 1
DEG45 = 2 DEG45 = 2
HORIZONTAL = 3 DEG45_Y = 3
HORIZONTAL = 4
End Enum End Enum
Public Enum MPAR_STRANDORDERS As Integer Public Enum MPAR_STRANDORDERS As Integer
@@ -70,6 +71,9 @@ Public Class Machining
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
Protected m_sGUID As String = "" Protected m_sGUID As String = ""
Public Property sGUID As String Public Property sGUID As String
@@ -184,11 +188,11 @@ Public Class Machining
Next Next
End Sub End Sub
Friend Sub WriteParamsOnDb(nIndex As Integer) Friend Sub WriteParamsOnDb(nIndex As Integer, Optional sFilePath As String = "")
WriteMachiningParam(nIndex, MAC_GUID, m_sGUID) WriteMachiningParam(nIndex, MAC_GUID, m_sGUID, sFilePath)
WriteMachiningParam(nIndex, MAC_NAME, m_sName) WriteMachiningParam(nIndex, MAC_NAME, m_sName, sFilePath)
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
@@ -303,6 +307,7 @@ Public Class MachiningCathegory
New ComboMachiningParam(MachiningParam.Params.DIRECTION, nIndex), New ComboMachiningParam(MachiningParam.Params.DIRECTION, nIndex),
New NumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nIndex), New NumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nIndex),
New NumericMachiningParam(MachiningParam.Params.G0FEED, nIndex), New NumericMachiningParam(MachiningParam.Params.G0FEED, 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)})
Case Cathegories.LINK Case Cathegories.LINK
@@ -378,12 +383,12 @@ Public Class MachiningCathegory
Next Next
End Sub End Sub
Friend Sub WriteParamOnDb(nIndex As Integer) Friend Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
If Type = Cathegories.MATERIALS Then If Type = Cathegories.MATERIALS Then
WriteMachiningParamSplit(nIndex, MAC_MATERIALS, "") WriteMachiningParamSplit(nIndex, MAC_MATERIALS, "", sFilePath)
End If End If
For Each Param In m_MachiningParamList For Each Param In m_MachiningParamList
Param.WriteParamOnDb(nIndex) Param.WriteParamOnDb(nIndex, sFilePath)
Next Next
End Sub End Sub
@@ -418,37 +423,38 @@ Public MustInherit Class MachiningParam
WIPEFEED_PC = 24 WIPEFEED_PC = 24
FLOORCOUNT = 25 FLOORCOUNT = 25
G0FEED = 26 G0FEED = 26
TOOLDIAM = 27 G0FEEDZ = 27
RIBSTYPE = 28 TOOLDIAM = 28
RIBSOVERLAP = 29 RIBSTYPE = 29
RIBSSTRANDCOUNT = 30 RIBSOVERLAP = 30
RIBSLINK = 31 RIBSSTRANDCOUNT = 31
RIBSINVERTORDER = 32 RIBSLINK = 32
RIBSINVERTDIRECTION = 33 RIBSINVERTORDER = 33
RIBSLEADININVERT = 34 RIBSINVERTDIRECTION = 34
RIBSLEADINLEN = 35 RIBSLEADININVERT = 35
RIBSLEADOUTINVERT = 36 RIBSLEADINLEN = 36
RIBSLEADOUTLEN = 37 RIBSLEADOUTINVERT = 37
RIBSLEADOUTCOASTING = 38 RIBSLEADOUTLEN = 38
RIBSLEADOUTWIPE = 39 RIBSLEADOUTCOASTING = 39
RIBSLEADOUTWIPEDIR = 40 RIBSLEADOUTWIPE = 40
SHELLNBRDIFFERENCE = 41 RIBSLEADOUTWIPEDIR = 41
SHELLNBRCOASTING = 42 SHELLNBRDIFFERENCE = 42
SHELLNBRWIPE = 43 SHELLNBRCOASTING = 43
SHELLNBRWIPEDIR = 44 SHELLNBRWIPE = 44
AUXSOLIDSOVERLAP = 45 SHELLNBRWIPEDIR = 45
AUXSOLIDSINFILL = 46 AUXSOLIDSOVERLAP = 46
AUXSOLIDSSTRANDORDER = 47 AUXSOLIDSINFILL = 47
AUXSOLIDSLINKTYPE = 48 AUXSOLIDSSTRANDORDER = 48
AUXSOLIDSLINKPARAM = 49 AUXSOLIDSLINKTYPE = 49
AUXSOLIDSSTARTPOINTOFFSETONSLICE = 50 AUXSOLIDSLINKPARAM = 50
AUXSOLIDSCOASTINGLEN = 51 AUXSOLIDSSTARTPOINTOFFSETONSLICE = 51
AUXSOLIDSWIPELEN = 52 AUXSOLIDSCOASTINGLEN = 52
AUXSOLIDSWIPEDIR = 53 AUXSOLIDSWIPELEN = 53
SPIRALVASE = 54 AUXSOLIDSWIPEDIR = 54
WIPEDIR = 55 SPIRALVASE = 55
STRANDOVERLAP = 56 WIPEDIR = 56
FLOWRATE_PC = 57 STRANDOVERLAP = 57
FLOWRATE_PC = 58
MATERIALS = 100 MATERIALS = 100
End Enum End Enum
@@ -519,6 +525,8 @@ Public MustInherit Class MachiningParam
m_sName = "Floor Count" m_sName = "Floor Count"
Case Params.G0FEED Case Params.G0FEED
m_sName = "G0 Feed" m_sName = "G0 Feed"
Case Params.G0FEEDZ
m_sName = "G0 Feed Z"
Case Params.TOOLDIAM Case Params.TOOLDIAM
m_sName = "Nozzle Diameter" m_sName = "Nozzle Diameter"
Case Params.RIBSTYPE Case Params.RIBSTYPE
@@ -589,7 +597,7 @@ Public MustInherit Class MachiningParam
m_sName = sName m_sName = sName
End Sub End Sub
Friend MustOverride Sub WriteParamOnDb(nIndex As Integer) Friend MustOverride Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Friend Overridable Sub WriteParamInPart(nIndex As Integer) Friend Overridable Sub WriteParamInPart(nIndex As Integer)
End Sub End Sub
Friend MustOverride Sub SaveParam() Friend MustOverride Sub SaveParam()
@@ -610,15 +618,16 @@ Public Class NumericMachiningParam
End Property End Property
Public Overridable Property sValue As String Public Overridable Property sValue As String
Get Get
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString( m_dValue, 2)) Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get End Get
Set(value As String) Set(value As String)
If m_bIsLen Then If m_bIsLen Then
StringToLen(value, m_dValue) StringToLen(value, m_dValue)
Else Else
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
@@ -706,6 +715,9 @@ Public Class NumericMachiningParam
Case Params.G0FEED Case Params.G0FEED
m_dValue = ReadMachiningParamDouble(nIndex, MAC_G0FEED, 0) m_dValue = ReadMachiningParamDouble(nIndex, MAC_G0FEED, 0)
m_bIsLen = True m_bIsLen = True
Case Params.G0FEEDZ
m_dValue = ReadMachiningParamDouble(nIndex, MAC_G0FEEDZ, 0)
m_bIsLen = True
Case Params.TOOLDIAM Case Params.TOOLDIAM
m_dValue = ReadMachiningParamDouble(nIndex, MAC_TOOLDIAM, 0) m_dValue = ReadMachiningParamDouble(nIndex, MAC_TOOLDIAM, 0)
m_bIsLen = True m_bIsLen = True
@@ -768,7 +780,7 @@ Public Class NumericMachiningParam
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, 2) sWriteValue = LenToString(m_dValue, 2)
@@ -777,83 +789,85 @@ Public Class NumericMachiningParam
End If End If
Select Case Type Select Case Type
Case Params.STRANDH Case Params.STRANDH
WriteMachiningParam(nIndex, MAC_STRANDH, sWriteValue) WriteMachiningParam(nIndex, MAC_STRANDH, sWriteValue, sFilePath)
Case Params.STRANDW Case Params.STRANDW
WriteMachiningParam(nIndex, MAC_STRANDW, sWriteValue) WriteMachiningParam(nIndex, MAC_STRANDW, sWriteValue, sFilePath)
Case Params.STRANDCOUNT Case Params.STRANDCOUNT
WriteMachiningParam(nIndex, MAC_STRANDCOUNT, sWriteValue) WriteMachiningParam(nIndex, MAC_STRANDCOUNT, sWriteValue, sFilePath)
Case Params.OFFSET Case Params.OFFSET
WriteMachiningParam(nIndex, MAC_OFFSET, sWriteValue) WriteMachiningParam(nIndex, MAC_OFFSET, sWriteValue, sFilePath)
Case Params.STRANDOVERLAP Case Params.STRANDOVERLAP
WriteMachiningParam(nIndex, MAC_STRANDOVERLAP, sWriteValue) WriteMachiningParam(nIndex, MAC_STRANDOVERLAP, sWriteValue, sFilePath)
Case Params.STARTPOINTOFFSETONSLICE Case Params.STARTPOINTOFFSETONSLICE
WriteMachiningParam(nIndex, MAC_STARTPOINTOFFSETONSLICE, sWriteValue) WriteMachiningParam(nIndex, MAC_STARTPOINTOFFSETONSLICE, sWriteValue, sFilePath)
Case Params.LINKPARAM Case Params.LINKPARAM
WriteMachiningParam(nIndex, MAC_LINKPARAM, sWriteValue) WriteMachiningParam(nIndex, MAC_LINKPARAM, sWriteValue, sFilePath)
Case Params.LINKZUP Case Params.LINKZUP
WriteMachiningParam(nIndex, MAC_LINKZUP, sWriteValue) WriteMachiningParam(nIndex, MAC_LINKZUP, sWriteValue, sFilePath)
Case Params.OFFSETLEADPOINT Case Params.OFFSETLEADPOINT
WriteMachiningParam(nIndex, MAC_OFFSETLEADPOINT, sWriteValue) WriteMachiningParam(nIndex, MAC_OFFSETLEADPOINT, sWriteValue, sFilePath)
Case Params.LEADINTANGDIST Case Params.LEADINTANGDIST
WriteMachiningParam(nIndex, MAC_LEADINTANGDIST, sWriteValue) WriteMachiningParam(nIndex, MAC_LEADINTANGDIST, sWriteValue, sFilePath)
Case Params.LEADINORTHODIST Case Params.LEADINORTHODIST
WriteMachiningParam(nIndex, MAC_LEADINORTHODIST, sWriteValue) WriteMachiningParam(nIndex, MAC_LEADINORTHODIST, sWriteValue, sFilePath)
Case Params.LEADOUTTANGDIST Case Params.LEADOUTTANGDIST
WriteMachiningParam(nIndex, MAC_LEADOUTTANGDIST, sWriteValue) WriteMachiningParam(nIndex, MAC_LEADOUTTANGDIST, sWriteValue, sFilePath)
Case Params.LEADOUTORTHODIST Case Params.LEADOUTORTHODIST
WriteMachiningParam(nIndex, MAC_LEADOUTORTHODIST, sWriteValue) WriteMachiningParam(nIndex, MAC_LEADOUTORTHODIST, sWriteValue, sFilePath)
Case Params.COASTINGLEN Case Params.COASTINGLEN
WriteMachiningParam(nIndex, MAC_COASTINGLEN, sWriteValue) WriteMachiningParam(nIndex, MAC_COASTINGLEN, sWriteValue, sFilePath)
Case Params.COASTINGFEED_PC Case Params.COASTINGFEED_PC
WriteMachiningParam(nIndex, MAC_COASTINGFEEDPU, sWriteValue) WriteMachiningParam(nIndex, MAC_COASTINGFEEDPU, sWriteValue, sFilePath)
Case Params.WIPELEN Case Params.WIPELEN
WriteMachiningParam(nIndex, MAC_WIPELEN, sWriteValue) WriteMachiningParam(nIndex, MAC_WIPELEN, sWriteValue, sFilePath)
Case Params.WIPEFEED_PC Case Params.WIPEFEED_PC
WriteMachiningParam(nIndex, MAC_WIPEFEEDPU, sWriteValue) WriteMachiningParam(nIndex, MAC_WIPEFEEDPU, sWriteValue, sFilePath)
Case Params.WIPEDIR Case Params.WIPEDIR
WriteMachiningParam(nIndex, MAC_WIPEDIR, sWriteValue) WriteMachiningParam(nIndex, MAC_WIPEDIR, sWriteValue, sFilePath)
Case Params.FLOORCOUNT Case Params.FLOORCOUNT
WriteMachiningParam(nIndex, MAC_FLOORCOUNT, sWriteValue) WriteMachiningParam(nIndex, MAC_FLOORCOUNT, sWriteValue, sFilePath)
Case Params.G0FEED Case Params.G0FEED
WriteMachiningParam(nIndex, MAC_G0FEED, sWriteValue) WriteMachiningParam(nIndex, MAC_G0FEED, sWriteValue, sFilePath)
Case Params.G0FEEDZ
WriteMachiningParam(nIndex, MAC_G0FEEDZ, sWriteValue, sFilePath)
Case Params.TOOLDIAM Case Params.TOOLDIAM
WriteMachiningParam(nIndex, MAC_TOOLDIAM, sWriteValue) WriteMachiningParam(nIndex, MAC_TOOLDIAM, sWriteValue, sFilePath)
Case Params.RIBSOVERLAP Case Params.RIBSOVERLAP
WriteMachiningParam(nIndex, MAC_RIBSOVERLAP, sWriteValue) WriteMachiningParam(nIndex, MAC_RIBSOVERLAP, sWriteValue, sFilePath)
Case Params.RIBSSTRANDCOUNT Case Params.RIBSSTRANDCOUNT
WriteMachiningParam(nIndex, MAC_RIBSSTRANDCOUNT, sWriteValue) WriteMachiningParam(nIndex, MAC_RIBSSTRANDCOUNT, sWriteValue, sFilePath)
Case Params.RIBSLEADINLEN Case Params.RIBSLEADINLEN
WriteMachiningParam(nIndex, MAC_RIBSLEADINLEN, sWriteValue) WriteMachiningParam(nIndex, MAC_RIBSLEADINLEN, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTLEN Case Params.RIBSLEADOUTLEN
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTLEN, sWriteValue) WriteMachiningParam(nIndex, MAC_RIBSLEADOUTLEN, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTCOASTING Case Params.RIBSLEADOUTCOASTING
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTCOASTING, sWriteValue) WriteMachiningParam(nIndex, MAC_RIBSLEADOUTCOASTING, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTWIPE Case Params.RIBSLEADOUTWIPE
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPE, sWriteValue) WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPE, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTWIPEDIR Case Params.RIBSLEADOUTWIPEDIR
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPEDIR, sWriteValue) WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPEDIR, sWriteValue, sFilePath)
Case Params.SHELLNBRDIFFERENCE Case Params.SHELLNBRDIFFERENCE
WriteMachiningParam(nIndex, MAC_SHELLNBRDIFFERENCE, sWriteValue) WriteMachiningParam(nIndex, MAC_SHELLNBRDIFFERENCE, sWriteValue, sFilePath)
Case Params.SHELLNBRCOASTING Case Params.SHELLNBRCOASTING
WriteMachiningParam(nIndex, MAC_SHELLNBRCOASTING, sWriteValue) WriteMachiningParam(nIndex, MAC_SHELLNBRCOASTING, sWriteValue, sFilePath)
Case Params.SHELLNBRWIPE Case Params.SHELLNBRWIPE
WriteMachiningParam(nIndex, MAC_SHELLNBRWIPE, sWriteValue) WriteMachiningParam(nIndex, MAC_SHELLNBRWIPE, sWriteValue, sFilePath)
Case Params.SHELLNBRWIPEDIR Case Params.SHELLNBRWIPEDIR
WriteMachiningParam(nIndex, MAC_SHELLNBRWIPEDIR, sWriteValue) WriteMachiningParam(nIndex, MAC_SHELLNBRWIPEDIR, sWriteValue, sFilePath)
Case Params.AUXSOLIDSOVERLAP Case Params.AUXSOLIDSOVERLAP
WriteMachiningParam(nIndex, MAC_AUXSOLIDSOVERLAP, sWriteValue) WriteMachiningParam(nIndex, MAC_AUXSOLIDSOVERLAP, sWriteValue, sFilePath)
Case Params.AUXSOLIDSLINKPARAM Case Params.AUXSOLIDSLINKPARAM
WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKPARAM, sWriteValue) WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKPARAM, sWriteValue, sFilePath)
Case Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE Case Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE
WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, sWriteValue) WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, sWriteValue, sFilePath)
Case Params.AUXSOLIDSCOASTINGLEN Case Params.AUXSOLIDSCOASTINGLEN
WriteMachiningParam(nIndex, MAC_AUXSOLIDSCOASTINGLEN, sWriteValue) WriteMachiningParam(nIndex, MAC_AUXSOLIDSCOASTINGLEN, sWriteValue, sFilePath)
Case Params.AUXSOLIDSWIPELEN Case Params.AUXSOLIDSWIPELEN
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPELEN, sWriteValue) WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPELEN, sWriteValue, sFilePath)
Case Params.AUXSOLIDSWIPEDIR Case Params.AUXSOLIDSWIPEDIR
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPEDIR, sWriteValue) WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPEDIR, sWriteValue, sFilePath)
Case Params.FLOWRATE_PC Case Params.FLOWRATE_PC
WriteMachiningParam(nIndex, MAC_CONSTANT, sWriteValue) WriteMachiningParam(nIndex, MAC_CONSTANT, sWriteValue, sFilePath)
End Select End Select
End Sub End Sub
@@ -879,6 +893,7 @@ 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
@@ -901,10 +916,10 @@ Public Class StringMachiningParam
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.STRANDH Case Params.STRANDH
'WritePrivateProfileString(nIndex, MAC_STRANDH, sWriteValue) 'WritePrivateProfileString(nIndex, MAC_STRANDH, sWriteValue, sFilePath)
End Select End Select
End Sub End Sub
@@ -937,6 +952,7 @@ 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
@@ -965,11 +981,16 @@ Public Class ComboMachiningParam
Else Else
Select Case Type Select Case Type
Case Params.SLICINGTYPE Case Params.SLICINGTYPE
Dim nHorizontalPrint As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_HORIZONTAL_PRINT, 0, CurrentMachine.sMachIniFile) Dim nSlicingType As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_SLICINGTYPE, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical"), m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical")})
New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45°")}) If nSlicingType >= 1 Then
If nHorizontalPrint > 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X"))
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal")) If nSlicingType >= 2 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y"))
If nSlicingType >= 3 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
End If
End If
End If End If
Dim nSelValue As Double = ReadMachiningParamDouble(nIndex, MAC_SLICINGTYPE, -1) Dim nSelValue As Double = ReadMachiningParamDouble(nIndex, MAC_SLICINGTYPE, -1)
If nSelValue = -1 Then If nSelValue = -1 Then
@@ -1025,28 +1046,28 @@ Public Class ComboMachiningParam
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.SLICINGTYPE Case Params.SLICINGTYPE
WriteMachiningParam(nIndex, MAC_SLICINGTYPE, m_SelValue.Id) WriteMachiningParam(nIndex, MAC_SLICINGTYPE, m_SelValue.Id, sFilePath)
Case Params.STRANDORDER Case Params.STRANDORDER
WriteMachiningParam(nIndex, MAC_STRANDORDER, m_SelValue.Id) WriteMachiningParam(nIndex, MAC_STRANDORDER, m_SelValue.Id, sFilePath)
Case Params.DIRECTION Case Params.DIRECTION
WriteMachiningParam(nIndex, MAC_DIRECTION, m_SelValue.Id) WriteMachiningParam(nIndex, MAC_DIRECTION, m_SelValue.Id, sFilePath)
Case Params.LINKTYPE Case Params.LINKTYPE
WriteMachiningParam(nIndex, MAC_LINKTYPE, m_SelValue.Id) WriteMachiningParam(nIndex, MAC_LINKTYPE, m_SelValue.Id, sFilePath)
Case Params.LEADIN Case Params.LEADIN
WriteMachiningParam(nIndex, MAC_LEADIN, m_SelValue.Id) WriteMachiningParam(nIndex, MAC_LEADIN, m_SelValue.Id, sFilePath)
Case Params.LEADOUT Case Params.LEADOUT
WriteMachiningParam(nIndex, MAC_LEADOUT, m_SelValue.Id) WriteMachiningParam(nIndex, MAC_LEADOUT, m_SelValue.Id, sFilePath)
Case Params.RIBSTYPE Case Params.RIBSTYPE
WriteMachiningParam(nIndex, MAC_RIBSTYPE, m_SelValue.Id) WriteMachiningParam(nIndex, MAC_RIBSTYPE, m_SelValue.Id, sFilePath)
Case Params.AUXSOLIDSINFILL Case Params.AUXSOLIDSINFILL
WriteMachiningParam(nIndex, MAC_AUXSOLIDSINFILL, m_SelValue.Id) WriteMachiningParam(nIndex, MAC_AUXSOLIDSINFILL, m_SelValue.Id, sFilePath)
Case Params.AUXSOLIDSSTRANDORDER Case Params.AUXSOLIDSSTRANDORDER
WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTRANDORDER, m_SelValue.Id) WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTRANDORDER, m_SelValue.Id, sFilePath)
Case Params.AUXSOLIDSLINKTYPE Case Params.AUXSOLIDSLINKTYPE
WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKTYPE, m_SelValue.Id) WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKTYPE, m_SelValue.Id, sFilePath)
End Select End Select
End Sub End Sub
@@ -1072,6 +1093,7 @@ 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
@@ -1115,20 +1137,20 @@ Public Class CheckMachiningParam
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
Case Params.SPIRALVASE Case Params.SPIRALVASE
WriteMachiningParam(nIndex, MAC_SPIRALVASE, If(m_bValue, 1, 0)) WriteMachiningParam(nIndex, MAC_SPIRALVASE, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLINK Case Params.RIBSLINK
WriteMachiningParam(nIndex, MAC_RIBSLINK, If(m_bValue, 1, 0)) WriteMachiningParam(nIndex, MAC_RIBSLINK, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSINVERTORDER Case Params.RIBSINVERTORDER
WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0)) 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)) WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLEADININVERT Case Params.RIBSLEADININVERT
WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0)) WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLEADOUTINVERT Case Params.RIBSLEADOUTINVERT
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0)) WriteMachiningParam(nIndex, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0), sFilePath)
End Select End Select
End Sub End Sub
@@ -1164,6 +1186,7 @@ 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
@@ -1187,9 +1210,9 @@ Public Class MaterialMachiningParam
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 = "")
Dim sMaterials As String = "" Dim sMaterials As String = ""
ReadMachiningParamSplit(nIndex, MAC_MATERIALS, "", sMaterials) ReadMachiningParamSplit(nIndex, MAC_MATERIALS, "", sMaterials, sFilePath)
Dim MaterialGuidList As New List(Of String) Dim MaterialGuidList As New List(Of String)
If Not String.IsNullOrWhiteSpace(sMaterials) Then If Not String.IsNullOrWhiteSpace(sMaterials) Then
MaterialGuidList = sMaterials.Split(";"c).ToList() MaterialGuidList = sMaterials.Split(";"c).ToList()
@@ -1203,7 +1226,7 @@ Public Class MaterialMachiningParam
For Index = 0 To MaterialGuidList.Count - 1 For Index = 0 To MaterialGuidList.Count - 1
sMaterials &= MaterialGuidList(Index) & If(Index < MaterialGuidList.Count - 1, ";"c, "") sMaterials &= MaterialGuidList(Index) & If(Index < MaterialGuidList.Count - 1, ";"c, "")
Next Next
WriteMachiningParamSplit(nIndex, MAC_MATERIALS, sMaterials) WriteMachiningParamSplit(nIndex, MAC_MATERIALS, sMaterials, sFilePath)
End Sub End Sub
Friend Overrides Sub SaveParam() Friend Overrides Sub SaveParam()
+25 -2
View File
@@ -14,20 +14,43 @@
<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="New" <Button Content="New"
Command="{Binding New_Command}" Command="{Binding New_Command}"
IsEnabled="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/> Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Save" <Button Content="Save"
Grid.Column="1"
Command="{Binding Save_Command}" Command="{Binding Save_Command}"
IsEnabled="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/> Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Delete" <Button Content="Delete"
Grid.Column="2"
Command="{Binding Delete_Command}" Command="{Binding Delete_Command}"
IsEnabled="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/> Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid> <Button Grid.Column="3"
Command="{Binding Import_Command}"
ToolTip="{Binding ImportToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/Import.png" Stretch="Uniform"/>
</Button>
<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 Grid.Row="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
+59 -4
View File
@@ -26,7 +26,7 @@ Public Class MachiningDbVM
' verifico se modificato ' verifico se modificato
If m_SelMachining.bIsModified Then If m_SelMachining.bIsModified Then
' chiedo se salvare ' chiedo se salvare
Select Case MessageBox.Show("Salvare le modifiche apportate alla lavorazione selezionata?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) Select Case MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes Case MessageBoxResult.Yes
m_SelMachining.Save() m_SelMachining.Save()
Case MessageBoxResult.No Case MessageBoxResult.No
@@ -50,6 +50,7 @@ Public Class MachiningDbVM
End If End If
Next Next
End If End If
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
End Set End Set
End Property End Property
@@ -105,12 +106,20 @@ Public Class MachiningDbVM
NotifyPropertyChanged(NameOf(UserShouldEditValueNow)) NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
End Sub End Sub
Public ReadOnly Property ImpExp_IsEnabled As Boolean
Get
Return m_IsEnabled AndAlso (IsNothing(m_SelMachining) OrElse Not m_SelMachining.bIsModified)
End Get
End Property
' Definizione comandi ' Definizione comandi
Private m_cmdOk As ICommand Private m_cmdOk As ICommand
Private m_cmdNew As ICommand Private m_cmdNew 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_cmdEditName As ICommand
Private m_cmdImport As ICommand
Private m_cmdExport As ICommand
#End Region ' FIELDS & PROPERTIES #End Region ' FIELDS & PROPERTIES
@@ -138,6 +147,7 @@ Public Class MachiningDbVM
GetMainPrivateProfileString(S_PRINTING3D, K_CURRMACHINING, "", sCurrMachining) GetMainPrivateProfileString(S_PRINTING3D, K_CURRMACHINING, "", sCurrMachining)
m_SelMachining = MachiningList.FirstOrDefault(Function(x) x.sGUID = sCurrMachining) m_SelMachining = MachiningList.FirstOrDefault(Function(x) x.sGUID = sCurrMachining)
NotifyPropertyChanged(NameOf(SelMachining)) NotifyPropertyChanged(NameOf(SelMachining))
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
End Sub End Sub
Friend Sub SetNameVisibility(bValue As Boolean) Friend Sub SetNameVisibility(bValue As Boolean)
@@ -213,7 +223,7 @@ Public Class MachiningDbVM
' aggiorno combo top ' aggiorno combo top
Dim CurrSelTopMachining As MachiningIndex = Map.refTopPanelVM.SelMachining Dim CurrSelTopMachining As MachiningIndex = Map.refTopPanelVM.SelMachining
Map.refTopPanelVM.InitMachiningsList() Map.refTopPanelVM.InitMachiningsList()
Map.refTopPanelVM.SetSelMachining( CurrSelTopMachining) Map.refTopPanelVM.SetSelMachining(CurrSelTopMachining)
End If End If
' ripristino modalita' standard ' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY Map.refTopPanelVM.SelPage = Pages.MODIFY
@@ -239,6 +249,7 @@ Public Class MachiningDbVM
m_SelMachining = NewMachining m_SelMachining = NewMachining
NotifyPropertyChanged(NameOf(SelMachining)) NotifyPropertyChanged(NameOf(SelMachining))
SetNameVisibility(True) SetNameVisibility(True)
SetIsModified(True)
End Sub End Sub
#End Region ' New #End Region ' New
@@ -255,8 +266,9 @@ Public Class MachiningDbVM
End Property End Property
Public Sub Save() Public Sub Save()
If IsNothing( m_SelMachining) Then Return If IsNothing(m_SelMachining) Then Return
m_SelMachining.Save() m_SelMachining.Save()
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
End Sub End Sub
#End Region ' Save #End Region ' Save
@@ -275,7 +287,7 @@ Public Class MachiningDbVM
Public Sub Delete() Public Sub Delete()
If IsNothing(m_SelMachining) Then Return If IsNothing(m_SelMachining) Then Return
' chiedo conferma ' chiedo conferma
Select Case MessageBox.Show("Sei sicuro di voler cancellare la lavorazione selezionata?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) Select Case MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes Case MessageBoxResult.Yes
m_MachiningList.Remove(m_SelMachining) m_MachiningList.Remove(m_SelMachining)
SetIsModified(True) SetIsModified(True)
@@ -305,6 +317,49 @@ Public Class MachiningDbVM
#End Region ' EditName #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 = "File data (*.data)|*.data|Tutti i file (*.*)|*.*",
.FileName = String.Empty
}
If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
Dim ImportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(OpenFileDlg.FileName))
ImportWindow.ShowDialog()
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 ExportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM)
ExportWindow.ShowDialog()
End Sub
#End Region ' Export
#End Region ' COMMANDS #End Region ' COMMANDS
End Class End Class
+2 -2
View File
@@ -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(3279, 2410, 1, m_nKeyLevel) And Dim bKey As Boolean = EgtGetKeyLevel(3279, 2412, 1, m_nKeyLevel) And
EgtGetKeyOptions(3279, 2410, 1, m_nKeyOptions) EgtGetKeyOptions(3279, 2412, 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())
+27 -20
View File
@@ -310,13 +310,14 @@ Public Class ManagePartPanelVM
Case ManagePart_Layer.LayerType.PRINT_SOLID Case ManagePart_Layer.LayerType.PRINT_SOLID
nPrintPartLayerId = EgtCreateGroup(nPartId) nPrintPartLayerId = EgtCreateGroup(nPartId)
EgtSetName(nPrintPartLayerId, PRINT_SOLID) EgtSetName(nPrintPartLayerId, PRINT_SOLID)
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
If ManagePart_Layer.EntityList.Count > 0 Then If ManagePart_Layer.EntityList.Count > 0 Then
PrintSolidEntity = ManagePart_Layer.EntityList(0) PrintSolidEntity = ManagePart_Layer.EntityList(0)
EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
' calcolo box superficie per creazione riferimento ' calcolo box superficie per creazione riferimento
EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid) EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
' coloro l'entita' ' elimino colore entita'
EgtSetColor(PrintSolidEntity.nId, GeomEntityColors.c3Print) EgtResetColor(PrintSolidEntity.nId)
If PrintSolidEntity.sName <> PrintSolidEntity.nId.ToString() Then If PrintSolidEntity.sName <> PrintSolidEntity.nId.ToString() Then
EgtSetInfo(PrintSolidEntity.nId, ENTITY_NAME, PrintSolidEntity.sName) EgtSetInfo(PrintSolidEntity.nId, ENTITY_NAME, PrintSolidEntity.sName)
End If End If
@@ -324,6 +325,7 @@ Public Class ManagePartPanelVM
Case ManagePart_Layer.LayerType.MACH_START Case ManagePart_Layer.LayerType.MACH_START
nMachStartLayerId = EgtCreateGroup(nPartId) nMachStartLayerId = 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
If ManagePart_Layer.EntityList.Count > 0 Then If ManagePart_Layer.EntityList.Count > 0 Then
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
@@ -339,8 +341,8 @@ Public Class ManagePartPanelVM
nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, PartManager_GeomEntity.nId, True) nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, PartManager_GeomEntity.nId, True)
End Select End Select
EgtSetName(nMachStartId, START_GEOM) EgtSetName(nMachStartId, START_GEOM)
' coloro l'entita' ' elimino colore entita'
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart) EgtResetColor(nMachStartId)
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
@@ -350,17 +352,18 @@ Public Class ManagePartPanelVM
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 ' elimino colore entita'
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart) EgtResetColor(nMachStartId)
End If End If
Case ManagePart_Layer.LayerType.RIBS Case ManagePart_Layer.LayerType.RIBS
nRibsLayerId = EgtCreateGroup(nPartId) nRibsLayerId = EgtCreateGroup(nPartId)
EgtSetName(nRibsLayerId, LAY_RIBS) EgtSetName(nRibsLayerId, LAY_RIBS)
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
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)
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
' coloro l'entita' ' elimino colore entita'
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Rib) 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
@@ -368,11 +371,12 @@ Public Class ManagePartPanelVM
Case ManagePart_Layer.LayerType.SHELL_NUMBER Case ManagePart_Layer.LayerType.SHELL_NUMBER
nShellNumberLayerId = EgtCreateGroup(nPartId) nShellNumberLayerId = EgtCreateGroup(nPartId)
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR) EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT) EgtSetInfo(PartManager_GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
EgtRelocateGlob(PartManager_GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PartManager_GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
' coloro l'entita' ' elimino colore entita'
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3ShellNumber) 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
@@ -380,11 +384,12 @@ Public Class ManagePartPanelVM
Case ManagePart_Layer.LayerType.AUX_SOLIDS Case ManagePart_Layer.LayerType.AUX_SOLIDS
nAuxSolidsLayerId = EgtCreateGroup(nPartId) nAuxSolidsLayerId = EgtCreateGroup(nPartId)
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS) EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT) EgtSetInfo(PartManager_GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtRelocateGlob(PartManager_GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PartManager_GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
' coloro l'entita' ' elimino colore entita'
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3AuxSolids) 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
@@ -392,10 +397,11 @@ Public Class ManagePartPanelVM
Case ManagePart_Layer.LayerType.OTHERS Case ManagePart_Layer.LayerType.OTHERS
nOthersLayerId = EgtCreateGroup(nPartId) nOthersLayerId = EgtCreateGroup(nPartId)
EgtSetName(nOthersLayerId, LAY_OTHERS) EgtSetName(nOthersLayerId, LAY_OTHERS)
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' coloro l'entita' ' elimino colore entita'
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Others) 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
@@ -408,16 +414,16 @@ Public Class ManagePartPanelVM
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
' la trasformo in curva compo ' la trasformo in curva compo
Dim nOtherId As Integer = EgtCreateCurveCompo(nOthersLayerId, PartManager_GeomEntity.nId, True) Dim nOtherId As Integer = EgtCreateCurveCompo(nOthersLayerId, PartManager_GeomEntity.nId, True)
' coloro l'entita' ' elimino colore entita'
EgtSetColor(nOtherId, GeomEntityColors.c3Others) EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(nOtherId, ENTITY_NAME, PartManager_GeomEntity.sName) EgtSetInfo(nOtherId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If End If
Case Else Case Else
' altrimenti la sposto solamente ' altrimenti la sposto solamente
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' coloro l'entita' ' elimino colore entita'
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Others) 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
@@ -464,11 +470,11 @@ Public Class ManagePartPanelVM
' elimino vecchio pezzo d'importazione ' elimino vecchio pezzo d'importazione
EgtErase(m_nImportedPartId) EgtErase(m_nImportedPartId)
EgtDraw()
Case ManagePartType.MODIFY Case ManagePartType.MODIFY
' nulla da fare ' nulla da fare
End Select End Select
EgtDeselectAll()
EgtDraw()
' ripristino modalita' standard ' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY Map.refTopPanelVM.SelPage = Pages.MODIFY
End Sub End Sub
@@ -489,6 +495,7 @@ Public Class ManagePartPanelVM
Public Sub Cancel() Public Sub Cancel()
' elimino pezzo importato ' elimino pezzo importato
EgtErase(m_nImportedPartId) EgtErase(m_nImportedPartId)
EgtDeselectAll()
EgtDraw() EgtDraw()
' se ci sono pezzi ' se ci sono pezzi
If Map.refTopPanelVM.PartList.Count > 0 Then If Map.refTopPanelVM.PartList.Count > 0 Then
+33 -11
View File
@@ -614,6 +614,10 @@ Public Class GeomEntity_MenuItem
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity) Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
End If End If
EgtDraw() EgtDraw()
' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End If End If
Return Return
ElseIf m_Type = ManagePart_Layer.LayerType.NEWPART Then ElseIf m_Type = ManagePart_Layer.LayerType.NEWPART Then
@@ -621,8 +625,14 @@ Public Class GeomEntity_MenuItem
Case ManagePartPanelVM.ManagePartType.IMPORT Case ManagePartPanelVM.ManagePartType.IMPORT
Dim NewPart As ManagePart_Part = New ManagePart_Part(Nothing) Dim NewPart As ManagePart_Part = New ManagePart_Part(Nothing)
Map.refManagePartPanelVM.ManagerPartList.Add(NewPart) Map.refManagePartPanelVM.ManagerPartList.Add(NewPart)
' elimino entity dalla lista entita' importate ' se l'entita' e' gia' in lista pezzi
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity) If Not IsNothing(m_OrigEntity.OrigLayer) Then
' elimino dalla lista pezzi
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
Else
' altrimenti lo elimino dalla lista entita' importate
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
End If
If Not IsNothing(NewPart) Then If Not IsNothing(NewPart) Then
Dim NewLayer As ManagePart_Layer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID) Dim NewLayer As ManagePart_Layer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
If Not IsNothing(NewLayer) Then If Not IsNothing(NewLayer) Then
@@ -696,19 +706,17 @@ Public Class GeomEntity_MenuItem
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)
'Dim bUpdateAllContextMenu As Boolean = False
'Dim NewLayer As ManagePart_Layer = ManagePart_Part.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
'If Not IsNothing(NewLayer) Then
' NewLayer.EntityList.Add(m_OrigEntity)
' ' aggiorno riferimenti nell'entita'
' m_OrigEntity.UpdateOrigLayer(NewLayer)
'End If
EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName) EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName)
' lo aggiungo a lista ' lo aggiungo a lista
Map.refManagePartPanelVM.ManagerPartList.Add(ManagePart_Part) Map.refManagePartPanelVM.ManagerPartList.Add(ManagePart_Part)
' aggiorno riferimenti nel context menu item ' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu() Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select End Select
'' aggiorno visibilita' da check di categoria
'Dim PrintLayer 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))
Return Return
End If End If
Select Case Map.refManagePartPanelVM.Type Select Case Map.refManagePartPanelVM.Type
@@ -755,6 +763,14 @@ Public Class GeomEntity_MenuItem
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
Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId))
Dim vtMoved As Vector3d
If EgtGetInfo(nPartId, "MovedPart", vtMoved) Then
' lo sposto e rimuovo info
EgtMove(m_OrigEntity.nId, -vtMoved, GDB_RT.GLOB)
EgtRemoveInfo(nPartId, "MovedPart")
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)
@@ -782,6 +798,8 @@ Public Class GeomEntity_MenuItem
Case ManagePart_Layer.LayerType.PRINT_SOLID Case ManagePart_Layer.LayerType.PRINT_SOLID
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
EgtRemoveInfo(m_OrigEntity.OrigLayer.OrigPart.nId, "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)
@@ -809,6 +827,8 @@ Public Class GeomEntity_MenuItem
m_OrigEntity.UpdateContextMenu() m_OrigEntity.UpdateContextMenu()
End If End If
End If End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select End Select
End Sub End Sub
@@ -856,7 +876,7 @@ Public Class ManagerPart_MenuItem
m_Type = Type m_Type = Type
End Sub End Sub
#Region "Cancel" #Region "Command"
Public ReadOnly Property MenuItem_Command As ICommand Public ReadOnly Property MenuItem_Command As ICommand
Get Get
@@ -899,9 +919,11 @@ Public Class ManagerPart_MenuItem
End Select End Select
' aggiorno riferimenti nel context menu item ' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu() Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select End Select
End Sub End Sub
#End Region ' Cancel #End Region ' Command
End Class End Class
+37 -7
View File
@@ -674,6 +674,8 @@ 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
@@ -715,10 +717,10 @@ Public Class StringMaterialParam
End Get End Get
End Property End Property
Private m_bIsReadOnly As Boolean = True Private m_OrigButton_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property bIsReadOnly As Boolean Public ReadOnly Property OrigButton_Visibility As Visibility
Get Get
Return m_bIsReadOnly Return m_OrigButton_Visibility
End Get End Get
End Property End Property
@@ -729,15 +731,18 @@ Public Class StringMaterialParam
End Get End Get
End Property End Property
' Definizione comandi
Private m_cmdOriginal As ICommand
Sub New(Type As Params, nIndex As Integer) Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type) MyBase.New(Type)
Select Case Type Select Case Type
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 = "***" Then If sOrigGUID = DEFAULT_MATERIAL Then
m_sGUID = sOrigGUID m_sGUID = DEFAULT_MATERIAL
m_sValue = sOrigGUID m_sValue = DEFAULT_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
@@ -757,7 +762,7 @@ Public Class StringMaterialParam
End Select End Select
' verifico chiave per assegnare readonly ' verifico chiave per assegnare readonly
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
m_bIsReadOnly = False m_OrigButton_Visibility = Visibility.Visible
End If End If
m_sOrigValue = m_sValue m_sOrigValue = m_sValue
End Sub End Sub
@@ -777,6 +782,31 @@ Public Class StringMaterialParam
m_sValue = m_sOrigValue m_sValue = m_sOrigValue
End Sub End Sub
#Region "COMMANDS"
#Region "Original"
Public ReadOnly Property Original_Command As ICommand
Get
If m_cmdOriginal Is Nothing Then
m_cmdOriginal = New Command(AddressOf Original)
End If
Return m_cmdOriginal
End Get
End Property
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
m_sGUID = DEFAULT_MATERIAL
m_sValue = DEFAULT_MATERIAL
NotifyPropertyChanged(NameOf(sValue))
End If
End Sub
#End Region ' Original
#End Region ' COMMANDS
End Class End Class
Public Class ComboMaterialParam Public Class ComboMaterialParam
+6 -7
View File
@@ -101,16 +101,15 @@
<TextBlock Text="{Binding sName}"/> <TextBlock Text="{Binding sName}"/>
<TextBox Grid.Column="1" <TextBox Grid.Column="1"
Text="{Binding sValue}" Text="{Binding sValue}"
IsReadOnly="{Binding bIsReadOnly}"/> IsReadOnly="True"/>
<!--<Button Grid.Column="2" <Button Grid.Column="2"
Content="R" Content="O"
Command="{Binding ResetParam_Command}" Command="{Binding Original_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
Margin="5,0,0,0" Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>--> Visibility="{Binding OrigButton_Visibility}"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:ComboMaterialParam}"> <DataTemplate DataType="{x:Type PrintApp:ComboMaterialParam}">
+44 -1
View File
@@ -48,6 +48,9 @@ Public Class MaterialDbVM
m_SelMaterial.CathegoryList(Index).Cathegory_IsExpanded = IsExpandedList(Index) m_SelMaterial.CathegoryList(Index).Cathegory_IsExpanded = IsExpandedList(Index)
Next Next
End If End If
' verifico abilitazione delete
SetDeleteIsEnabled(Not SelMaterialIsOriginal())
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End Set End Set
End Property End Property
@@ -73,6 +76,21 @@ Public Class MaterialDbVM
m_bIsModified = value m_bIsModified = value
End Sub End Sub
Private m_Delete_IsEnabled As Boolean = True
Public ReadOnly Property Delete_IsEnabled As Boolean
Get
Return m_Delete_IsEnabled
End Get
End Property
Friend Sub SetDeleteIsEnabled(value As Boolean)
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
m_Delete_IsEnabled = True
Else
m_Delete_IsEnabled = value
End If
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End Sub
' Definizione comandi ' Definizione comandi
Private m_cmdOk As ICommand Private m_cmdOk As ICommand
Private m_cmdCopy As ICommand Private m_cmdCopy As ICommand
@@ -104,9 +122,32 @@ Public Class MaterialDbVM
Dim sCurrMaterial As String = "" Dim sCurrMaterial As String = ""
GetMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, "", sCurrMaterial) GetMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, "", sCurrMaterial)
m_SelMaterial = MaterialList.FirstOrDefault(Function(x) x.sGUID = sCurrMaterial) m_SelMaterial = MaterialList.FirstOrDefault(Function(x) x.sGUID = sCurrMaterial)
If IsNothing(m_SelMaterial) AndAlso m_MaterialList.Count > 0 Then
m_SelMaterial = m_MaterialList(0)
End If
NotifyPropertyChanged(NameOf(SelMaterial)) NotifyPropertyChanged(NameOf(SelMaterial))
' verifico abilitazione delete
If Not IsNothing(m_SelMaterial) Then
SetDeleteIsEnabled(Not SelMaterialIsOriginal())
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End If
End Sub End Sub
Private Function SelMaterialIsOriginal() As Boolean
If IsNothing(m_SelMaterial) Then Return False
' verifico abilitazione delete
Dim General As MaterialCathegory = m_SelMaterial.CathegoryList.FirstOrDefault(Function(x) x.Type = MaterialCathegory.Cathegories.GENERAL)
If Not IsNothing(General) Then
Dim Original As MaterialParam = General.MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG)
If Not IsNothing(Original) Then
If DirectCast(Original, StringMaterialParam).sValue = StringMaterialParam.DEFAULT_MATERIAL Then
Return True
End If
End If
End If
Return False
End Function
#End Region ' METHODS #End Region ' METHODS
#Region "COMMANDS" #Region "COMMANDS"
@@ -248,8 +289,10 @@ Public Class MaterialDbVM
End Property End Property
Public Sub Delete() Public Sub Delete()
' se materiale originale, esco
If SelMaterialIsOriginal() Then Return
' chiedo conferma ' chiedo conferma
Select Case MessageBox.Show("Sei sicuro di voler cancellare la lavorazione selezionata?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) Select Case MessageBox.Show("Are you sure you want to delete selected material?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes Case MessageBoxResult.Yes
m_MaterialList.Remove(m_SelMaterial) m_MaterialList.Remove(m_SelMaterial)
' segno Db come modificato ' segno Db come modificato
+2 -2
View File
@@ -346,7 +346,7 @@ Public Class MenuItemVm
m_Part = Part m_Part = Part
End Sub End Sub
#Region "Cancel" #Region "Command"
Public ReadOnly Property MenuItem_Command As ICommand Public ReadOnly Property MenuItem_Command As ICommand
Get Get
@@ -430,6 +430,6 @@ Public Class MenuItemVm
End If End If
End Sub End Sub
#End Region ' Cancel #End Region ' Command
End Class End Class
+12 -2
View File
@@ -11,6 +11,7 @@ Imports System.Windows
' Review the values of the assembly attributes ' Review the values of the assembly attributes
#If PLATFORM = "x64" Then
#If DEBUG Then #If DEBUG Then
<Assembly: AssemblyTitle("IcarusD64.exe")> <Assembly: AssemblyTitle("IcarusD64.exe")>
<Assembly: AssemblyDescription("Icarus Debug 64 bit")> <Assembly: AssemblyDescription("Icarus Debug 64 bit")>
@@ -18,6 +19,15 @@ Imports System.Windows
<Assembly: AssemblyTitle("IcarusR64.exe")> <Assembly: AssemblyTitle("IcarusR64.exe")>
<Assembly: AssemblyDescription("Icarus 64 bit")> <Assembly: AssemblyDescription("Icarus 64 bit")>
#End If #End If
#Else
#If DEBUG Then
<Assembly: AssemblyTitle("IcarusD32.exe")>
<Assembly: AssemblyDescription("Icarus Debug 32 bit")>
#Else
<Assembly: AssemblyTitle("IcarusR32.exe")>
<Assembly: AssemblyDescription("Icarus 32 bit")>
#End If
#End If
<Assembly: AssemblyCompany("Egalware s.r.l.")> <Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("Icarus")> <Assembly: AssemblyProduct("Icarus")>
<Assembly: AssemblyCopyright("Copyright © 2022 by Egalware s.r.l.")> <Assembly: AssemblyCopyright("Copyright © 2022 by Egalware s.r.l.")>
@@ -60,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.4.11.1")> <Assembly: AssemblyVersion("2.4.12.3")>
<Assembly: AssemblyFileVersion("2.4.11.1")> <Assembly: AssemblyFileVersion("2.4.12.3")>
+32 -7
View File
@@ -80,13 +80,6 @@
</TabItem> </TabItem>
<TabItem Header="{Binding CADMsg}"> <TabItem Header="{Binding CADMsg}">
<StackPanel Margin="5,5,5,0"> <StackPanel Margin="5,5,5,0">
<!--<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding DefMaterialColorMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding DefMaterialColor}"
Command="{Binding DefMaterialColor_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>-->
<UniformGrid Grid.ColumnSpan="2" Columns="2" <UniformGrid Grid.ColumnSpan="2" Columns="2"
Margin="0,0,0,5"> Margin="0,0,0,5">
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
@@ -94,6 +87,38 @@
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Margin="10,0,0,0"/> Margin="10,0,0,0"/>
</UniformGrid> </UniformGrid>
<ItemsControl ItemsSource="{Binding LayerColorList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding Color_Msg}" VerticalAlignment="Center"/>
<Grid Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="35"/>
</Grid.ColumnDefinitions>
<Button Background="{Binding Background}"
Command="{Binding Color_Command}"
Margin="0,0,5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Slider Grid.Column="1"
Value="{Binding dAlpha}"
Minimum="10"
Maximum="100"
TickPlacement="BottomRight"
TickFrequency="10"
IsSnapToTickEnabled="True"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="2"
Text="{Binding sAlpha}"
TextAlignment="Right"/>
</Grid>
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2" <!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding DimensionMsg}" Header="{Binding DimensionMsg}"
Margin="0,0,0,5"> Margin="0,0,0,5">
+155 -52
View File
@@ -179,12 +179,16 @@ Public Class OptionWindowVM
End Get End Get
End Property End Property
Public ReadOnly Property DefMaterialColor As Brush ' lista oggetti che gestiscono colori e trasparenze delle catogorie
Private m_LayerColorList As New ObservableCollection(Of LayerColor)({New LayerColor(LayerColor.LayerType.PRINTPART),
New LayerColor(LayerColor.LayerType.RIBS),
New LayerColor(LayerColor.LayerType.SHELLNUMBERS),
New LayerColor(LayerColor.LayerType.AUXSOLIDS),
New LayerColor(LayerColor.LayerType.MACHSTART),
New LayerColor(LayerColor.LayerType.OTHERS)})
Public ReadOnly Property LayerColorList As ObservableCollection(Of LayerColor)
Get Get
Return New SolidColorBrush(Color.FromArgb(CByte(255), Return m_LayerColorList
CByte(OptionModule.m_DefMaterialColor.R),
CByte(OptionModule.m_DefMaterialColor.G),
CByte(OptionModule.m_DefMaterialColor.B)))
End Get End Get
End Property End Property
@@ -195,7 +199,7 @@ Public Class OptionWindowVM
Set(value As Boolean) Set(value As Boolean)
OptionModule.m_bThickLine = value OptionModule.m_bThickLine = value
WriteMainPrivateProfileString(S_SCENE, K_LINEWIDTH, If(value, "2", "1")) WriteMainPrivateProfileString(S_SCENE, K_LINEWIDTH, If(value, "2", "1"))
EgtSetLineAttribs( If( value, 2, 1)) EgtSetLineAttribs(If(value, 2, 1))
End Set End Set
End Property End Property
@@ -510,11 +514,11 @@ Public Class OptionWindowVM
'End Property 'End Property
' Definizione comandi ' Definizione comandi
Private m_cmdTopSceneBackground As ICommand Private m_cmdTopSceneBackground As ICommand
Private m_cmdBotSceneBackground As ICommand Private m_cmdBotSceneBackground As ICommand
Private m_cmdGridColor As ICommand Private m_cmdGridColor As ICommand
Private m_cmdUpdateLicenceCmd As ICommand Private m_cmdUpdateLicenceCmd As ICommand
Private m_cmdDefMaterialColor As ICommand
Private m_cmdAddMachineCmd As ICommand Private m_cmdAddMachineCmd As ICommand
Private m_cmdExportMachineCmd As ICommand Private m_cmdExportMachineCmd As ICommand
@@ -583,11 +587,6 @@ Public Class OptionWindowVM
Return EgtMsg(6513) Return EgtMsg(6513)
End Get End Get
End Property End Property
Public ReadOnly Property DefMaterialColorMsg As String
Get
Return EgtMsg(6512)
End Get
End Property
Public ReadOnly Property ImportMsg As String Public ReadOnly Property ImportMsg As String
Get Get
@@ -747,9 +746,35 @@ Public Class OptionWindowVM
#End Region #End Region
Public Function WritePrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Color As Color3d) As Boolean Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean
Dim sColor As String = Color.R & "," & Color.G & "," & Color.B ' Recupero colori custom
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile) Dim sCustomColors As String = ""
GetMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, "", sCustomColors)
Dim CustomColors() As String = sCustomColors.Split(","c)
Dim nCustomColors As New List(Of Integer)
For Each Color In CustomColors
Dim nColor As Integer
If Integer.TryParse(Color, nColor) Then
nCustomColors.Add(nColor)
End If
Next
' Creo dialogo colori
Dim ColorDlg As New System.Windows.Forms.ColorDialog
ColorDlg.FullOpen = True
ColorDlg.CustomColors = nCustomColors.ToArray()
ColorDlg.Color = Col.ToColor()
' Visualizzo dialogo
If ColorDlg.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return False
' Recupero colore scelto
NewCol.FromColor(ColorDlg.Color)
' Salvo eventuali modifiche ai colori custom
sCustomColors = ""
For Each Color In ColorDlg.CustomColors
sCustomColors &= Color.ToString() & ","
Next
sCustomColors = sCustomColors.Trim({" "c, ","c})
WriteMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, sCustomColors)
Return True
End Function End Function
#Region "COMMANDS" #Region "COMMANDS"
@@ -854,41 +879,6 @@ Public Class OptionWindowVM
#End Region ' GridColor #End Region ' GridColor
#Region "DefMaterialColor"
'''' <summary>
'''' Returns a command that remove the current selected machining.
'''' </summary>
'Public ReadOnly Property DefMaterialColor_Command() As ICommand
' Get
' If m_cmdDefMaterialColor Is Nothing Then
' m_cmdDefMaterialColor = New Command(AddressOf DefMaterialColorCmd)
' End If
' Return m_cmdDefMaterialColor
' End Get
'End Property
'''' <summary>
'''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
'''' </summary>
'Public Sub DefMaterialColorCmd()
' ' Recupero colore da Ini
' Dim DefColor As New Color3d(192, 192, 192)
' GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
' ' Eseguo modifica con dialogo
' If SelectColor(DefColor, DefColor) Then
' OptionModule.m_DefMaterialColor = DefColor
' Map.refSceneHostVM.MainScene.SetDefaultMaterial(OptionModule.m_DefMaterialColor)
' WritePrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, OptionModule.m_DefMaterialColor)
' EgtDraw()
' Map.refManageLayerExpanderVM.UpdateHeaderColor(OptionModule.m_DefMaterialColor)
' Map.refManageLayerExpanderVM.LoadObjTree()
' NotifyPropertyChanged("DefMaterialColor")
' End If
'End Sub
#End Region ' DefMaterialColor
#Region "UpdateLicence" #Region "UpdateLicence"
''' <summary> ''' <summary>
@@ -1165,10 +1155,94 @@ Public Class OptionWindowVM
#End Region ' COMMANDS #End Region ' COMMANDS
End Class
Public Class LayerColor
Inherits VMBase
Public Enum LayerType As Integer
PRINTPART = 1
RIBS = 2
SHELLNUMBERS = 3
AUXSOLIDS = 4
MACHSTART = 5
OTHERS = 6
End Enum
Private m_Type As LayerType
Public ReadOnly Property c3Color As Color3d
Get
Select Case m_Type
Case LayerType.PRINTPART
Return GeomEntityColors.c3Print
Case LayerType.RIBS
Return GeomEntityColors.c3Rib
Case LayerType.SHELLNUMBERS
Return GeomEntityColors.c3ShellNumber
Case LayerType.AUXSOLIDS
Return GeomEntityColors.c3AuxSolids
Case LayerType.MACHSTART
Return GeomEntityColors.c3MachStart
Case LayerType.OTHERS
Return GeomEntityColors.c3Others
End Select
End Get
End Property
Public ReadOnly Property Background As Brush
Get
Return New SolidColorBrush(Color.FromArgb(CByte(255),
CByte(c3Color.R),
CByte(c3Color.G),
CByte(c3Color.B)))
End Get
End Property
Public Property dAlpha As Double
Get
Return c3Color.A
End Get
Set(value As Double)
GeomEntityColors.SetAlpha(m_Type, value)
NotifyPropertyChanged(NameOf(sAlpha))
End Set
End Property
Public ReadOnly Property sAlpha As String
Get
Return c3Color.A & "%"
End Get
End Property
Public ReadOnly Property Color_Msg As String
Get
Select Case m_Type
Case LayerType.PRINTPART
Return "Print"
Case LayerType.RIBS
Return "Ribs"
Case LayerType.SHELLNUMBERS
Return "Reduce Shell Number"
Case LayerType.AUXSOLIDS
Return "Filled Solids"
Case LayerType.MACHSTART
Return "Layer Start"
Case LayerType.OTHERS
Return "Others"
End Select
End Get
End Property
Private m_cmdColor As ICommand
Sub New(Type As LayerType)
m_Type = Type
End Sub
Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean
' Recupero colori custom ' Recupero colori custom
Dim sCustomColors As String = "" Dim sCustomColors As String = ""
GetMainPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, "", sCustomColors) GetMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, "", sCustomColors)
Dim CustomColors() As String = sCustomColors.Split(","c) Dim CustomColors() As String = sCustomColors.Split(","c)
Dim nCustomColors As New List(Of Integer) Dim nCustomColors As New List(Of Integer)
For Each Color In CustomColors For Each Color In CustomColors
@@ -1192,10 +1266,39 @@ Public Class OptionWindowVM
sCustomColors &= Color.ToString() & "," sCustomColors &= Color.ToString() & ","
Next Next
sCustomColors = sCustomColors.Trim({" "c, ","c}) sCustomColors = sCustomColors.Trim({" "c, ","c})
WriteMainPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, sCustomColors) WriteMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, sCustomColors)
Return True Return True
End Function End Function
#Region "Color"
''' <summary>
''' Returns a command that remove the current selected machining.
''' </summary>
Public ReadOnly Property Color_Command() As ICommand
Get
If m_cmdColor Is Nothing Then
m_cmdColor = New Command(AddressOf ColorCmd)
End If
Return m_cmdColor
End Get
End Property
''' <summary>
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
''' </summary>
Public Sub ColorCmd()
' Recupero colore da Ini
Dim c3Print As Color3d = c3Color
' Eseguo modifica con dialogo
If SelectColor(c3Color, c3Print) Then
GeomEntityColors.SetColor(m_Type, c3Print)
NotifyPropertyChanged(NameOf(Background))
End If
End Sub
#End Region ' PrintPartColor
End Class End Class
'Public Class GeomTypeConverter 'Public Class GeomTypeConverter
@@ -103,6 +103,9 @@ Public Class ReferencePanelVM
Case ReferenceBtn.References.MC Case ReferenceBtn.References.MC
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
End Select End Select
Dim vtMovedPart As Vector3d
EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart", vtMovedPart)
ptOrig = ptOrig - vtMovedPart
frPrintSolid = New Frame3d(ptOrig) frPrintSolid = New Frame3d(ptOrig)
End If End If
Dim nFrameId As Integer = EgtCreateGeoFrame(Map.refTopPanelVM.SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB) Dim nFrameId As Integer = EgtCreateGeoFrame(Map.refTopPanelVM.SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

+4 -3
View File
@@ -206,6 +206,7 @@
Grid.Row="6" Grid.Row="6"
Content="Grid" Content="Grid"
IsChecked="{Binding bGrid_IsChecked}" IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Style="{StaticResource ToolBar_TextToggleButton}"/> Style="{StaticResource ToolBar_TextToggleButton}"/>
<Border Grid.Column="1" <Border Grid.Column="1"
Grid.Row="5" Grid.Row="5"
@@ -515,15 +516,15 @@
<UniformGrid Columns="3"> <UniformGrid Columns="3">
<RadioButton Content="X" <RadioButton Content="X"
GroupName="Axes" GroupName="Axes"
IsChecked="{Binding RotAxes[0]}" IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/> Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y" <RadioButton Content="Y"
GroupName="Axes" GroupName="Axes"
IsChecked="{Binding RotAxes[1]}" IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/> Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z" <RadioButton Content="Z"
GroupName="Axes" GroupName="Axes"
IsChecked="{Binding RotAxes[2]}" IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/> Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid> </UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1" <EgtWPFLib5:EgtTextBox Grid.Row="1"
+49 -18
View File
@@ -41,7 +41,7 @@ Public Class RibPanelVM
End Get End Get
Set(value As RibEntity) Set(value As RibEntity)
m_SelRib = value m_SelRib = value
EgtDeselectLayerObjs(m_nRibLayerId) EgtDeselectAll()
If Not IsNothing(value) Then If Not IsNothing(value) Then
EgtSelectObj(value.nCurveId) EgtSelectObj(value.nCurveId)
EgtSelectObj(value.nExtrusionId) EgtSelectObj(value.nExtrusionId)
@@ -74,8 +74,8 @@ Public Class RibPanelVM
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 >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min) 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) EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sXPos)) NotifyPropertyChanged(NameOf(sXPos))
@@ -103,8 +103,8 @@ Public Class RibPanelVM
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 >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min) 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) EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sYPos)) NotifyPropertyChanged(NameOf(sYPos))
@@ -132,8 +132,8 @@ Public Class RibPanelVM
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 >= 0 Then
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min) 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) EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sZPos)) NotifyPropertyChanged(NameOf(sZPos))
@@ -144,12 +144,28 @@ Public Class RibPanelVM
End Property End Property
Private m_RotAxes() As Boolean = {False, False, True} Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean() Public Property RotX As Boolean
Get Get
Return m_RotAxes Return m_RotAxes(0)
End Get End Get
Set(value As Boolean()) Set(value As Boolean)
m_RotAxes = value m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set End Set
End Property End Property
@@ -159,7 +175,7 @@ Public Class RibPanelVM
Return Vector3d.X_AX Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then Else
Return Vector3d.Z_AX Return Vector3d.Z_AX
End If End If
End Get End Get
@@ -179,20 +195,20 @@ Public Class RibPanelVM
End If End If
Dim nId As Integer = If(m_SelRib.Type = RibEntity.RibTypes.FROMDRAW, m_SelRib.nCurveId, m_SelRib.nExtrusionId) Dim nId As Integer = If(m_SelRib.Type = RibEntity.RibTypes.FROMDRAW, m_SelRib.nCurveId, m_SelRib.nExtrusionId)
Dim b3Rib As New BBox3d Dim b3Rib As New BBox3d
EgtGetBBox(nId, GDB_BB.STANDARD, b3Rib) EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Rib)
Dim bOk As Boolean = False Dim bOk As Boolean = False
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle) bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk AndAlso m_SelRib.Type = RibEntity.RibTypes.FROMDRAW Then EgtRotate(m_SelRib.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle) If bOk AndAlso m_SelRib.Type = RibEntity.RibTypes.FROMDRAW Then EgtRotate(m_SelRib.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk Then If bOk Then
EgtDraw() EgtDraw()
RefreshPos() RefreshPos()
m_sRotAngle = 0 m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle)) NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else Else
m_sRotAngle = value m_sRotAngle = value
End If End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Set End Set
End Property End Property
@@ -264,6 +280,12 @@ Public Class RibPanelVM
End Set End Set
End Property End Property
Public ReadOnly Property bGrid_IsEnabled As Boolean
Get
Return Map.refMyStatusBarVM.bGridVisibility
End Get
End Property
Private m_bMove_IsChecked As Boolean Private m_bMove_IsChecked As Boolean
Public Property bMove_IsChecked As Boolean Public Property bMove_IsChecked As Boolean
Get Get
@@ -411,6 +433,9 @@ Public Class RibPanelVM
#Region "METHODS" #Region "METHODS"
Friend Sub Init() Friend Sub Init()
' asse rotazione di default
RotZ = True
NotifyPropertyChanged(NameOf(RotZ))
' azzero indice ' azzero indice
StartEntity.ResetSharedIndex() StartEntity.ResetSharedIndex()
' fisso frame originale ' fisso frame originale
@@ -418,6 +443,10 @@ Public Class RibPanelVM
' recupero dati pezzo selezionato layer ed entita' ' recupero dati pezzo selezionato layer ed entita'
m_nPartId = Map.refTopPanelVM.SelPart.nPartId m_nPartId = Map.refTopPanelVM.SelPart.nPartId
m_nRibLayerId = Map.refTopPanelVM.SelPart.nRibsLayerId m_nRibLayerId = Map.refTopPanelVM.SelPart.nRibsLayerId
If m_nRibLayerId = GDB_ID.NULL Then
m_nRibLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(m_nRibLayerId, LAY_RIBS)
End If
'recupero tutte le entita' rib 'recupero tutte le entita' rib
m_RibList.Clear() m_RibList.Clear()
Dim nRibId As Integer = EgtGetFirstInGroup(m_nRibLayerId) Dim nRibId As Integer = EgtGetFirstInGroup(m_nRibLayerId)
@@ -525,7 +554,8 @@ Public Class RibPanelVM
EgtDraw() EgtDraw()
' rimetto la selezione scena a null ' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull() Map.refSceneHostVM.MainScene.SetStatusNull()
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE, Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE,
Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D, Controller.CMD.GRID_OBJ
' rimetto la selezione scena a null ' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull() Map.refSceneHostVM.MainScene.SetStatusNull()
End Select End Select
@@ -1162,6 +1192,7 @@ Public Class RibPanelVM
Public Sub CPlaneObj(ByVal param As Object) Public Sub CPlaneObj(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
' salvo selezione precedente e deseleziono altri oggetti ' salvo selezione precedente e deseleziono altri oggetti
m_PrevSelObjs.Clear()
Dim nSelObjId As Integer = EgtGetFirstSelectedObj() Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
While nSelObjId <> GDB_ID.NULL While nSelObjId <> GDB_ID.NULL
m_PrevSelObjs.Add(nSelObjId) m_PrevSelObjs.Add(nSelObjId)
+10 -9
View File
@@ -44,6 +44,7 @@ Public Class RibParamPanelVM
m_MachiningParamList = New List(Of MachiningParam)({New RibComboMachiningParam(MachiningParam.Params.RIBSTYPE, nRibId, nPartId), m_MachiningParamList = New List(Of MachiningParam)({New RibComboMachiningParam(MachiningParam.Params.RIBSTYPE, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nRibId, nPartId), New RibNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nRibId, nPartId),
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.RIBSINVERTDIRECTION, nRibId, nPartId), New RibCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, 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),
@@ -477,9 +478,9 @@ Public Class RibCheckMachiningParam
MyBase.New(Type) MyBase.New(Type)
Dim bReadFromPart As Boolean = False Dim bReadFromPart As Boolean = False
Select Case Type Select Case Type
'Case Params.RIBSLINK Case Params.RIBSLINK
' bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLINK, m_bValue) bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLINK, m_bValue)
' EgtGetInfo(nPartId, MAC_RIBSOVERLAP, m_bPartValue) EgtGetInfo(nPartId, MAC_RIBSLINK, m_bPartValue)
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)
@@ -499,12 +500,12 @@ Public Class RibCheckMachiningParam
Friend Sub WriteParamInRib(nRibId As Integer) Friend Sub WriteParamInRib(nRibId As Integer)
Select Case Type Select Case Type
'Case Params.RIBSLINK Case Params.RIBSLINK
' If bIsModifiedFromPart Then If bIsModifiedFromPart Then
' EgtSetInfo(nRibId, MAC_RIBSLINK, If(m_bValue, 1, 0)) EgtSetInfo(nRibId, MAC_RIBSLINK, If(m_bValue, 1, 0))
' Else Else
' EgtRemoveInfo(nRibId, MAC_RIBSLINK) EgtRemoveInfo(nRibId, MAC_RIBSLINK)
' End If End If
Case Params.RIBSINVERTDIRECTION Case Params.RIBSINVERTDIRECTION
If bIsModifiedFromPart Then If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0)) EgtSetInfo(nRibId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
+36 -36
View File
@@ -11,6 +11,8 @@ Public Class MySceneHostVM
m_bIsFocused = bValue m_bIsFocused = bValue
End Sub End Sub
' Flag per distinguere tra Save a SaveAs
Private m_bIsSaveAs As Boolean = False
' Identificativi per pezzo da selezionare/deselezionare ' Identificativi per pezzo da selezionare/deselezionare
Private m_nIdToSel As Integer = GDB_ID.NULL Private m_nIdToSel As Integer = GDB_ID.NULL
Private m_nIdToDesel As Integer = GDB_ID.NULL Private m_nIdToDesel As Integer = GDB_ID.NULL
@@ -293,7 +295,9 @@ Public Class MySceneHostVM
End Sub End Sub
Public Overrides Sub SaveAsProject() Public Overrides Sub SaveAsProject()
m_bIsSaveAs = True
MyBase.SaveAsProject() MyBase.SaveAsProject()
m_bIsSaveAs = False
' Imposto stato gestione mouse diretto della scena a nessuno ' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull() MainScene.SetStatusNull()
End Sub End Sub
@@ -896,7 +900,8 @@ Public Class MySceneHostVM
ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = sMaterialGuid) ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = sMaterialGuid)
End If End If
If IsNothing(ProjectMaterial) Then If IsNothing(ProjectMaterial) Then
Dim sMaterialName As String = EgtSetInfo(nTabPartId, KEY_MATERIAL_GUID, Map.refTopPanelVM.SelMaterial.sName) Dim sMaterialName As String = ""
EgtGetInfo(nTabPartId, KEY_MATERIAL_NAME, sMaterialName)
ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sName = sMaterialName) ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sName = sMaterialName)
End If End If
If Not IsNothing(ProjectMaterial) Then If Not IsNothing(ProjectMaterial) Then
@@ -935,10 +940,12 @@ Public Class MySceneHostVM
' setto i solidi non calcolati ' setto i solidi non calcolati
EgtSetInfo(nPartId, KEY_CALC_SOLIDS, 0) EgtSetInfo(nPartId, KEY_CALC_SOLIDS, 0)
EgtSetInfo(nPartId, KEY_HAS_SOLIDS, 0) EgtSetInfo(nPartId, KEY_HAS_SOLIDS, 0)
nPartId = EgtGetNextPart(nPartId)
' Ripristino stato segnalazione modifica ' Ripristino stato segnalazione modifica
DisableMgr.ReEnable() DisableMgr.ReEnable()
nPartId = EgtGetNextPart(nPartId)
End While End While
' aggiorno colori entita'
GeomEntityColors.UpdateColors(LayerType.ALL)
' se non e' da ricalcolare, recupero tempo e massa ' se non e' da ricalcolare, recupero tempo e massa
If Not bProjectToRecalc Then If Not bProjectToRecalc Then
@@ -962,6 +969,13 @@ Public Class MySceneHostVM
End Sub End Sub
Private Sub OnSavingProject(ByVal sender As Object, sFile As String) Private Sub OnSavingProject(ByVal sender As Object, sFile As String)
' Se in SaveAs, aggiorno nome CN da generare
If m_bIsSaveAs Then
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
If nTabPartId <> GDB_ID.NULL Then
EgtRemoveInfo(nTabPartId, KEY_ISOFILE_PATH)
End If
End If
End Sub End Sub
Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean) Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
@@ -1190,20 +1204,6 @@ Public Class MySceneHostVM
End While End While
' Memorizzo Id da selezionare ' Memorizzo Id da selezionare
m_nIdToSel = nCurrIdToSel m_nIdToSel = nCurrIdToSel
'While nId <> GDB_ID.NULL
' ' Recupero l'identificativo del pezzo cui appartiene
' Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
' Dim bFound As Boolean = False
' If nPartId = Map.refImportPanelVM.nImportedPartId Then bFound = True
' If Not bFound Then
' nId = EgtGetNextObjInSelWin()
' Continue While
' End If
' ' Memorizzo Id da selezionare
' m_nIdToSel = nId
' Exit While
' nId = EgtGetNextObjInSelWin()
'End While
' Dati per drag ' Dati per drag
m_bDragToStart = True m_bDragToStart = True
End Sub End Sub
@@ -1253,17 +1253,15 @@ Public Class MySceneHostVM
End If End If
Else Else
' Recupero l'identificativo del pezzo cui appartiene ' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(nId) Dim nStartMachLayerId As Integer = EgtGetParent(nId)
Dim bFound As Boolean = False If nStartMachLayerId = Map.refStartMachPanelVM.nStartMachLayerId Then
If nPartId = Map.refStartMachPanelVM.nStartMachLayerId Then bFound = True
If bFound Then
m_nIdToSel = nId m_nIdToSel = nId
Exit While Exit While
End If End If
End If End If
nId = EgtGetNextObjInSelWin() nId = EgtGetNextObjInSelWin()
End While End While
If m_nIdToSel <> GDB_ID.NULL Then If Map.refStartMachPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' recupero dati punto di selezione ' recupero dati punto di selezione
Dim PtTemp As Point3d Dim PtTemp As Point3d
Dim nAux As Integer Dim nAux As Integer
@@ -1336,18 +1334,15 @@ Public Class MySceneHostVM
Exit While Exit While
End If End If
Else Else
' Recupero l'identificativo del pezzo cui appartiene Dim nRibLayerId As Integer = EgtGetParent(nId)
Dim nPartId As Integer = EgtGetParent(nId) If nRibLayerId = Map.refRibPanelVM.nRibLayerId Then
Dim bFound As Boolean = False
If nPartId = Map.refRibPanelVM.nRibLayerId Then bFound = True
If bFound Then
m_nIdToSel = nId m_nIdToSel = nId
Exit While Exit While
End If End If
End If End If
nId = EgtGetNextObjInSelWin() nId = EgtGetNextObjInSelWin()
End While End While
If m_nIdToSel <> GDB_ID.NULL Then If Map.refRibPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' recupero dati punto di selezione ' recupero dati punto di selezione
Dim PtTemp As Point3d Dim PtTemp As Point3d
Dim nAux As Integer Dim nAux As Integer
@@ -1414,17 +1409,22 @@ Public Class MySceneHostVM
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel) EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
Dim nId As Integer = EgtGetFirstObjInSelWin() Dim nId As Integer = EgtGetFirstObjInSelWin()
While nId <> GDB_ID.NULL While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene ' Se per Griglia da faccia di oggetto
Dim nPartId As Integer = EgtGetParent(nId) If Map.refShellNumberPanelVM.bCPlaneObj_IsActive Then
Dim bFound As Boolean = False If EgtGetType( nId) = GDB_TY.SRF_MESH Then
If nPartId = Map.refShellNumberPanelVM.nShellNumberLayerId Then bFound = True m_nIdToSel = nId
If bFound Then Exit While
m_nIdToSel = nId End If
Exit While Else
Dim nShellNumberLayerId As Integer = EgtGetParent(nId)
If nShellNumberLayerId = Map.refShellNumberPanelVM.nShellNumberLayerId Then
m_nIdToSel = nId
Exit While
End If
End If End If
nId = EgtGetNextObjInSelWin() nId = EgtGetNextObjInSelWin()
End While End While
If m_nIdToSel <> GDB_ID.NULL Then If Map.refShellNumberPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' recupero dati punto di selezione ' recupero dati punto di selezione
Dim PtTemp As Point3d Dim PtTemp As Point3d
Dim nAux As Integer Dim nAux As Integer
@@ -1479,7 +1479,7 @@ Public Class MySceneHostVM
EgtDraw() EgtDraw()
End Sub End Sub
#End Region ' Rib #End Region ' ShellNumber
#End Region ' VIEW EVENTS #End Region ' VIEW EVENTS
@@ -206,6 +206,7 @@
Grid.Row="6" Grid.Row="6"
Content="Grid" Content="Grid"
IsChecked="{Binding bGrid_IsChecked}" IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Style="{StaticResource ToolBar_TextToggleButton}"/> Style="{StaticResource ToolBar_TextToggleButton}"/>
<Border Grid.Column="1" <Border Grid.Column="1"
Grid.Row="5" Grid.Row="5"
@@ -515,15 +516,15 @@
<UniformGrid Columns="3"> <UniformGrid Columns="3">
<RadioButton Content="X" <RadioButton Content="X"
GroupName="Axes" GroupName="Axes"
IsChecked="{Binding RotAxes[0]}" IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/> Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y" <RadioButton Content="Y"
GroupName="Axes" GroupName="Axes"
IsChecked="{Binding RotAxes[1]}" IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/> Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z" <RadioButton Content="Z"
GroupName="Axes" GroupName="Axes"
IsChecked="{Binding RotAxes[2]}" IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/> Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid> </UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1" <EgtWPFLib5:EgtTextBox Grid.Row="1"
+51 -20
View File
@@ -41,7 +41,7 @@ Public Class ShellNumberPanelVM
End Get End Get
Set(value As ShellNumberEntity) Set(value As ShellNumberEntity)
m_SelShellNumber = value m_SelShellNumber = value
EgtDeselectLayerObjs(m_nShellNumberLayerId) EgtDeselectAll()
If Not IsNothing(value) Then If Not IsNothing(value) Then
EgtSelectObj(value.nCurveId) EgtSelectObj(value.nCurveId)
EgtSelectObj(value.nExtrusionId) EgtSelectObj(value.nExtrusionId)
@@ -74,8 +74,8 @@ Public Class ShellNumberPanelVM
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 >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(m_SelShellNumber.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min) 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) EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sXPos)) NotifyPropertyChanged(NameOf(sXPos))
@@ -103,8 +103,8 @@ Public Class ShellNumberPanelVM
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 >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min) 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) EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sYPos)) NotifyPropertyChanged(NameOf(sYPos))
@@ -132,8 +132,8 @@ Public Class ShellNumberPanelVM
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 >= 0 Then
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min) 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) EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sZPos)) NotifyPropertyChanged(NameOf(sZPos))
@@ -144,12 +144,28 @@ Public Class ShellNumberPanelVM
End Property End Property
Private m_RotAxes() As Boolean = {False, False, True} Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean() Public Property RotX As Boolean
Get Get
Return m_RotAxes Return m_RotAxes(0)
End Get End Get
Set(value As Boolean()) Set(value As Boolean)
m_RotAxes = value m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set End Set
End Property End Property
@@ -159,7 +175,7 @@ Public Class ShellNumberPanelVM
Return Vector3d.X_AX Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then Else
Return Vector3d.Z_AX Return Vector3d.Z_AX
End If End If
End Get End Get
@@ -179,20 +195,20 @@ Public Class ShellNumberPanelVM
End If End If
Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId) Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId)
Dim b3Rib As New BBox3d Dim b3Rib As New BBox3d
EgtGetBBox(nId, GDB_BB.STANDARD, b3Rib) EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Rib)
Dim bOk As Boolean = False Dim bOk As Boolean = False
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle) bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk AndAlso m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW Then EgtRotate(m_SelShellNumber.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle) If bOk AndAlso m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW Then EgtRotate(m_SelShellNumber.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk Then If bOk Then
EgtDraw() EgtDraw()
RefreshPos() RefreshPos()
m_sRotAngle = 0 m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle)) NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else Else
m_sRotAngle = value m_sRotAngle = value
End If End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Set End Set
End Property End Property
@@ -264,6 +280,12 @@ Public Class ShellNumberPanelVM
End Set End Set
End Property End Property
Public ReadOnly Property bGrid_IsEnabled As Boolean
Get
Return Map.refMyStatusBarVM.bGridVisibility
End Get
End Property
Private m_bMove_IsChecked As Boolean Private m_bMove_IsChecked As Boolean
Public Property bMove_IsChecked As Boolean Public Property bMove_IsChecked As Boolean
Get Get
@@ -411,6 +433,9 @@ Public Class ShellNumberPanelVM
#Region "METHODS" #Region "METHODS"
Friend Sub Init() Friend Sub Init()
' asse rotazione di default
RotZ = True
NotifyPropertyChanged(NameOf(RotZ))
' azzero indice ' azzero indice
StartEntity.ResetSharedIndex() StartEntity.ResetSharedIndex()
' fisso frame originale ' fisso frame originale
@@ -418,7 +443,11 @@ Public Class ShellNumberPanelVM
' recupero dati pezzo selezionato layer ed entita' ' recupero dati pezzo selezionato layer ed entita'
m_nPartId = Map.refTopPanelVM.SelPart.nPartId m_nPartId = Map.refTopPanelVM.SelPart.nPartId
m_nShellNumberLayerId = Map.refTopPanelVM.SelPart.nShellNumberLayerId m_nShellNumberLayerId = Map.refTopPanelVM.SelPart.nShellNumberLayerId
'recupero tutte le entita' rib If m_nShellNumberLayerId = GDB_ID.NULL Then
m_nShellNumberLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(m_nShellNumberLayerId, LAY_SHELL_NBR)
End If
'recupero tutte le entita' shell number
m_ShellNumberList.Clear() m_ShellNumberList.Clear()
Dim nShellNumberId As Integer = EgtGetFirstInGroup(m_nShellNumberLayerId) Dim nShellNumberId As Integer = EgtGetFirstInGroup(m_nShellNumberLayerId)
While nShellNumberId <> GDB_ID.NULL While nShellNumberId <> GDB_ID.NULL
@@ -525,7 +554,8 @@ Public Class ShellNumberPanelVM
EgtDraw() EgtDraw()
' rimetto la selezione scena a null ' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull() Map.refSceneHostVM.MainScene.SetStatusNull()
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE, Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D, Controller.CMD.GRID_OBJ Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE,
Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D, Controller.CMD.GRID_OBJ
' rimetto la selezione scena a null ' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull() Map.refSceneHostVM.MainScene.SetStatusNull()
End Select End Select
@@ -1166,6 +1196,7 @@ Public Class ShellNumberPanelVM
Public Sub CPlaneObj(ByVal param As Object) Public Sub CPlaneObj(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
' salvo selezione precedente e deseleziono altri oggetti ' salvo selezione precedente e deseleziono altri oggetti
m_PrevSelObjs.Clear()
Dim nSelObjId As Integer = EgtGetFirstSelectedObj() Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
While nSelObjId <> GDB_ID.NULL While nSelObjId <> GDB_ID.NULL
m_PrevSelObjs.Add(nSelObjId) m_PrevSelObjs.Add(nSelObjId)
@@ -1308,7 +1339,7 @@ Public Class ShellNumberEntity
Sub New(Type As ShellNumberTypes, nId As Integer) Sub New(Type As ShellNumberTypes, nId As Integer)
m_nIndex = nSharedIndex m_nIndex = nSharedIndex
m_Type = Type m_Type = Type
EgtSetInfo(nId, KEY_RIB_TYPE, Type) EgtSetInfo(nId, KEY_SHELLNBR_TYPE, Type)
Select Case Type Select Case Type
Case ShellNumberTypes.FROMDRAW Case ShellNumberTypes.FROMDRAW
m_nCurveId = nId m_nCurveId = nId
+7 -1
View File
@@ -506,6 +506,11 @@ Public Class SliceManagerVM
m_bCalculating = False m_bCalculating = False
Return Return
End If End If
If IsNothing(Map.refTopPanelVM.SelMaterial) Then
MessageBox.Show("No print material set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False
Return
End If
If IsNothing(Map.refTopPanelVM.SelMachining) OrElse IsNothing(Map.refTopPanelVM.CurrMachining) OrElse Map.refTopPanelVM.CurrMachining.dCurrStrandH <= 0 Then If IsNothing(Map.refTopPanelVM.SelMachining) OrElse IsNothing(Map.refTopPanelVM.CurrMachining) OrElse Map.refTopPanelVM.CurrMachining.dCurrStrandH <= 0 Then
MessageBox.Show("No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) MessageBox.Show("No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False m_bCalculating = False
@@ -611,9 +616,10 @@ Public Class SliceManagerVM
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
EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath) EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath)
If String.IsNullOrWhiteSpace(sIsoFilePath) Then If String.IsNullOrWhiteSpace(sIsoFilePath) OrElse Not Directory.Exists(Path.GetDirectoryName(sIsoFilePath)) Then
EgtGetCurrFilePath(sIsoFilePath) EgtGetCurrFilePath(sIsoFilePath)
sIsoFilePath = System.IO.Path.ChangeExtension(sIsoFilePath, sExtension) sIsoFilePath = System.IO.Path.ChangeExtension(sIsoFilePath, sExtension)
EgtSetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath)
End If End If
End If End If
End If End If
+4 -4
View File
@@ -73,7 +73,7 @@ Public Class SliderManagerVM
Case ViewSliderType.ONLY_SELECTED Case ViewSliderType.ONLY_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi ' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100 If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1 For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd = value - 1 Then If nLayerInd = value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_) EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
@@ -88,7 +88,7 @@ Public Class SliderManagerVM
Case ViewSliderType.UNTIL_SELECTED Case ViewSliderType.UNTIL_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi ' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100 If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1 For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd <= value - 1 Then If nLayerInd <= value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_) EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
@@ -103,7 +103,7 @@ Public Class SliderManagerVM
Case ViewSliderType.FROM_SELECTED Case ViewSliderType.FROM_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi ' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100 If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1 For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd >= value - 1 Then If nLayerInd >= value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_) EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
@@ -353,7 +353,7 @@ Public Class SliderManagerVM
NotifyPropertyChanged(NameOf(nLayerIndex_Minimum)) NotifyPropertyChanged(NameOf(nLayerIndex_Minimum))
NotifyPropertyChanged(NameOf(nLayerIndex_Maximum)) NotifyPropertyChanged(NameOf(nLayerIndex_Maximum))
NotifyPropertyChanged(NameOf(ghShowMaximum)) NotifyPropertyChanged(NameOf(ghShowMaximum))
SetLayerIndex(m_nLayerIndex) SetLayerIndex(If(m_nLayerIndex < nMax, m_nLayerIndex, nMax))
End Sub End Sub
Friend Sub SetLayerIndexToMax() Friend Sub SetLayerIndexToMax()
@@ -189,6 +189,7 @@
Grid.Row="6" Grid.Row="6"
Content="Grid" Content="Grid"
IsChecked="{Binding bGrid_IsChecked}" IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Style="{StaticResource ToolBar_TextToggleButton}"/> Style="{StaticResource ToolBar_TextToggleButton}"/>
<Border Grid.Column="1" <Border Grid.Column="1"
Grid.Row="5" Grid.Row="5"
+35 -12
View File
@@ -36,7 +36,7 @@ Public Class StartMachPanelVM
End Get End Get
Set(value As StartEntity) Set(value As StartEntity)
m_SelStart = value m_SelStart = value
EgtDeselectLayerObjs(m_nStartMachLayerId) EgtDeselectAll()
If Not IsNothing(value) Then If Not IsNothing(value) Then
EgtSelectObj(value.nId) EgtSelectObj(value.nId)
' aggiorno visibilita' bottoni edit ' aggiorno visibilita' bottoni edit
@@ -66,7 +66,7 @@ Public Class StartMachPanelVM
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 If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(m_SelStart.nId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference) EgtMove(m_SelStart.nId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sXPos)) NotifyPropertyChanged(NameOf(sXPos))
@@ -92,7 +92,7 @@ Public Class StartMachPanelVM
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 If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference) EgtMove(m_SelStart.nId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sYPos)) NotifyPropertyChanged(NameOf(sYPos))
@@ -118,7 +118,7 @@ Public Class StartMachPanelVM
Dim dNewZPos As Double = ptReference.z Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos) StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then If dNewZPos >= 0 Then
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference) EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
EgtDraw() EgtDraw()
Else Else
NotifyPropertyChanged(NameOf(sZPos)) NotifyPropertyChanged(NameOf(sZPos))
@@ -129,12 +129,28 @@ Public Class StartMachPanelVM
End Property End Property
Private m_RotAxes() As Boolean = {False, False, True} Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean() Public Property RotX As Boolean
Get Get
Return m_RotAxes Return m_RotAxes(0)
End Get End Get
Set(value As Boolean()) Set(value As Boolean)
m_RotAxes = value m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set End Set
End Property End Property
@@ -144,7 +160,7 @@ Public Class StartMachPanelVM
Return Vector3d.X_AX Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then Else
Return Vector3d.Z_AX Return Vector3d.Z_AX
End If End If
End Get End Get
@@ -164,16 +180,16 @@ Public Class StartMachPanelVM
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) Then If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
EgtDraw() EgtDraw()
RefreshPos() RefreshPos()
m_sRotAngle = 0 m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle)) NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else Else
m_sRotAngle = value m_sRotAngle = value
End If End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Set End Set
End Property End Property
@@ -243,6 +259,12 @@ Public Class StartMachPanelVM
End Set End Set
End Property End Property
Public ReadOnly Property bGrid_IsEnabled As Boolean
Get
Return Map.refMyStatusBarVM.bGridVisibility
End Get
End Property
Private m_bMove_IsChecked As Boolean Private m_bMove_IsChecked As Boolean
Public Property bMove_IsChecked As Boolean Public Property bMove_IsChecked As Boolean
Get Get
@@ -836,6 +858,7 @@ Public Class StartMachPanelVM
Public Sub CPlaneObj(ByVal param As Object) Public Sub CPlaneObj(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
' salvo selezione precedente e deseleziono altri oggetti ' salvo selezione precedente e deseleziono altri oggetti
m_PrevSelObjs.Clear()
Dim nSelObjId As Integer = EgtGetFirstSelectedObj() Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
While nSelObjId <> GDB_ID.NULL While nSelObjId <> GDB_ID.NULL
m_PrevSelObjs.Add(nSelObjId) m_PrevSelObjs.Add(nSelObjId)
+4
View File
@@ -23,9 +23,13 @@ Public Class MyStatusBarVM
Return m_bGridVisibility Return m_bGridVisibility
End Get End Get
Set(value As Boolean) Set(value As Boolean)
If Map.refRibPanelVM.bGrid_IsChecked Or Map.refStartMachPanelVM.bGrid_IsChecked Or Map.refShellNumberPanelVM.bGrid_IsChecked Then Return
m_bGridVisibility = value m_bGridVisibility = value
EgtSetGridShow(value, value) EgtSetGridShow(value, value)
EgtDraw() EgtDraw()
Map.refRibPanelVM.NotifyPropertyChanged(NameOf(Map.refRibPanelVM.bGrid_IsEnabled))
Map.refStartMachPanelVM.NotifyPropertyChanged(NameOf(Map.refStartMachPanelVM.bGrid_IsEnabled))
Map.refShellNumberPanelVM.NotifyPropertyChanged(NameOf(Map.refShellNumberPanelVM.bGrid_IsEnabled))
End Set End Set
End Property End Property
+23 -1
View File
@@ -72,15 +72,32 @@
Margin="2.5,0,2.5,0" Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInputPanel_TextBox}"/> Style="{StaticResource ControllerInputPanel_TextBox}"/>
</Grid> </Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Wait:"
Visibility="{Binding Wait_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource TSFEditor_TextBlock}"/>
<TextBox Grid.Column="1"
Text="{Binding sWait}"
Width="50"
Visibility="{Binding Wait_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInputPanel_TextBox}"/>
</Grid>
<StackPanel Grid.Column="1" <StackPanel Grid.Column="1"
Orientation="Horizontal"> Orientation="Horizontal">
<Button Content="Set" <Button Content="Set"
Command="{Binding Set_Command}" Command="{Binding Set_Command}"
Visibility="{Binding FCurr_Visibility}" Visibility="{Binding Set_Visibility}"
Margin="2.5,0,2.5,0" Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_TextButton}"/> Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Media" <Button Content="Media"
Command="{Binding Media_Command}" Command="{Binding Media_Command}"
Visibility="{Binding Media_Visibility}"
Margin="2.5,0,2.5,0" Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_TextButton}"/> Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Reset" <Button Content="Reset"
@@ -135,6 +152,8 @@
Width="1*"/> Width="1*"/>
<DataGridTextColumn Header="TWait" <DataGridTextColumn Header="TWait"
Binding="{Binding sTWait}" Binding="{Binding sTWait}"
Visibility="{Binding DataContext.ColWait_Visibility,
Source={x:Reference TFSEditorStackPanel}}"
Width="1*"/> Width="1*"/>
<DataGridTextColumn Header="FMin" <DataGridTextColumn Header="FMin"
Binding="{Binding sFMin}" Binding="{Binding sFMin}"
@@ -181,6 +200,9 @@
Command="{Binding Extend_Command}" Command="{Binding Extend_Command}"
Margin="2.5,0,2.5,0" Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_TextButton}"/> Style="{StaticResource ToolBar_TextButton}"/>
<CheckBox Content="Wait"
IsChecked="{Binding bWaitingTime}"
VerticalAlignment="Center"/>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Border> </Border>
+97 -6
View File
@@ -16,6 +16,7 @@ Public Class TFSEditorVM
HEIGHT = 1 HEIGHT = 1
SECTIONCHANGE = 2 SECTIONCHANGE = 2
SELECTION = 3 SELECTION = 3
SELECTION_WAIT = 4
End Enum End Enum
Public Enum Filters As Integer Public Enum Filters As Integer
@@ -58,7 +59,7 @@ Public Class TFSEditorVM
End Set End Set
End Property End Property
Private m_MediaTypeList As New List(Of String)({"Slice Number", "Section change", "Selection"}) Private m_MediaTypeList As New List(Of String)({"Slice Number", "Section change", "Selection", "Selection Wait"})
Public ReadOnly Property MediaTypeList As List(Of String) Public ReadOnly Property MediaTypeList As List(Of String)
Get Get
Return m_MediaTypeList Return m_MediaTypeList
@@ -77,14 +78,30 @@ Public Class TFSEditorVM
SetMediaHeightVisibility(True) SetMediaHeightVisibility(True)
SetFCurrVisibility(False) SetFCurrVisibility(False)
SetDifference_Visibility(False) SetDifference_Visibility(False)
SetWaitVisibility(False)
SetSetVisibility(False)
SetMediaVisibility(True)
Case MediaTypes.SECTIONCHANGE Case MediaTypes.SECTIONCHANGE
SetMediaHeightVisibility(False) SetMediaHeightVisibility(False)
SetFCurrVisibility(False) SetFCurrVisibility(False)
SetDifference_Visibility(True) SetDifference_Visibility(True)
SetWaitVisibility(False)
SetSetVisibility(False)
SetMediaVisibility(True)
Case MediaTypes.SELECTION Case MediaTypes.SELECTION
SetMediaHeightVisibility(False) SetMediaHeightVisibility(False)
SetFCurrVisibility(True) SetFCurrVisibility(True)
SetDifference_Visibility(False) SetDifference_Visibility(False)
SetWaitVisibility(False)
SetSetVisibility(True)
SetMediaVisibility(True)
Case MediaTypes.SELECTION_WAIT
SetMediaHeightVisibility(False)
SetFCurrVisibility(False)
SetDifference_Visibility(False)
SetWaitVisibility(True)
SetSetVisibility(True)
SetMediaVisibility(False)
End Select End Select
End Set End Set
End Property End Property
@@ -167,6 +184,54 @@ Public Class TFSEditorVM
NotifyPropertyChanged(NameOf(FCurr_Visibility)) NotifyPropertyChanged(NameOf(FCurr_Visibility))
End Sub End Sub
Private m_dWait As Double
Public Property sWait As String
Get
Return LenToString(m_dWait, 2)
End Get
Set(value As String)
Dim nNewValue As Integer = 0
If StringToLen(value, nNewValue) Then
m_dWait = nNewValue
Else
NotifyPropertyChanged(NameOf(sWait))
End If
End Set
End Property
Private m_Wait_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Wait_Visibility As Visibility
Get
Return m_Wait_Visibility
End Get
End Property
Private Sub SetWaitVisibility(bValue As Boolean)
m_Wait_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Wait_Visibility))
End Sub
Private m_Media_Visibility As Visibility = Visibility.Visible
Public ReadOnly Property Media_Visibility As Visibility
Get
Return m_Media_Visibility
End Get
End Property
Private Sub SetMediaVisibility(bValue As Boolean)
m_Media_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Media_Visibility))
End Sub
Private m_Set_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Set_Visibility As Visibility
Get
Return m_Set_Visibility
End Get
End Property
Private Sub SetSetVisibility(bValue As Boolean)
m_Set_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Set_Visibility))
End Sub
Private m_FilterList As New List(Of String)({"", "Time Lower", "Time Ok", "Time Upper", "Speed Min", "Speed Max"}) Private m_FilterList As New List(Of String)({"", "Time Lower", "Time Ok", "Time Upper", "Speed Min", "Speed Max"})
Public ReadOnly Property FilterList As List(Of String) Public ReadOnly Property FilterList As List(Of String)
Get Get
@@ -208,6 +273,28 @@ Public Class TFSEditorVM
NotifyPropertyChanged(NameOf(bTFSEditor_IsEnabled)) NotifyPropertyChanged(NameOf(bTFSEditor_IsEnabled))
End Sub End Sub
Private m_bWaitingTime As Boolean = False
Public Property bWaitingTime As Boolean
Get
Return m_bWaitingTime
End Get
Set(value As Boolean)
m_bWaitingTime = value
Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
If m_bWaitingTime Then
EgtSetInfo(nLayTFSCalcId, KEY_EMITWAITINGTIME, True)
Else
EgtRemoveInfo(nLayTFSCalcId, KEY_EMITWAITINGTIME)
End If
NotifyPropertyChanged(NameOf(ColWait_Visibility))
End Set
End Property
Public ReadOnly Property ColWait_Visibility As Visibility
Get
Return If(m_bWaitingTime, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
' Definizione comandi ' Definizione comandi
Private m_cmdSet As ICommand Private m_cmdSet As ICommand
Private m_cmdMedia As ICommand Private m_cmdMedia As ICommand
@@ -332,12 +419,16 @@ Public Class TFSEditorVM
For Each Layer In m_SelLayers For Each Layer In m_SelLayers
Layer.SetFCurr(m_dFCurr) Layer.SetFCurr(m_dFCurr)
Next Next
Case MediaTypes.SELECTION_WAIT
For Each Layer In m_SelLayers
Layer.SetTWait(m_dWait)
Next
End Select End Select
' salvo selezione corrente '' salvo selezione corrente
Dim SelIndexList As New List(Of Integer) 'Dim SelIndexList As New List(Of Integer)
For Each SelLayer In m_SelLayers 'For Each SelLayer In m_SelLayers
SelIndexList.Add(SelLayer.nIndex) ' SelIndexList.Add(SelLayer.nIndex)
Next 'Next
'' ricalcolo valori '' ricalcolo valori
'Map.refSliceManagerVM.CalcSlice(False, True) 'Map.refSliceManagerVM.CalcSlice(False, True)
'' ripristino layer selezionati '' ripristino layer selezionati
+1 -1
View File
@@ -277,7 +277,7 @@ Public Class TopPanelVM
m_MachiningList.Remove(MachiningIndex.Empty()) m_MachiningList.Remove(MachiningIndex.Empty())
End If End If
' se nuova lavorazione e' none ' se nuova lavorazione e' none
If SelMachining.sGUID = Guid.Empty AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then If Not IsNothing(m_SelMachining) AndAlso SelMachining.sGUID = Guid.Empty AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then
' aggiungo lavorazione vuota ' aggiungo lavorazione vuota
MachiningList.Insert(0, MachiningIndex.Empty()) MachiningList.Insert(0, MachiningIndex.Empty())
End If End If
+19 -16
View File
@@ -42,6 +42,9 @@ Public Module CurrentMachine
Return m_sMachiningFilePath Return m_sMachiningFilePath
End Get End Get
End Property End Property
Friend Sub SetMachiningFilePath(sValue As String)
m_sMachiningFilePath = sValue
End Sub
' Cartella dei materiali ' Cartella dei materiali
Private m_sMaterialsFilePath As String = String.Empty Private m_sMaterialsFilePath As String = String.Empty
Friend ReadOnly Property sMaterialsFilePath As String Friend ReadOnly Property sMaterialsFilePath As String
@@ -126,8 +129,8 @@ Public Module CurrentMachine
DisableMgr.ReEnable() DisableMgr.ReEnable()
End Sub End Sub
Friend Function ReadMachiningParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String) As Integer Friend Function ReadMachiningParamString(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, "", lpString, m_sMachiningFilePath) Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
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
@@ -136,8 +139,8 @@ Public Module CurrentMachine
Return nResult Return nResult
End Function End Function
Friend Function ReadMachiningParamSplit(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String) As Integer Friend Function ReadMachiningParamSplit(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, "", lpString, m_sMachiningFilePath) Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
If Not String.IsNullOrWhiteSpace(lpString) Then If Not String.IsNullOrWhiteSpace(lpString) Then
Dim Values() As String = lpString.Split(";"c) Dim Values() As String = lpString.Split(";"c)
Dim sCryptoValues As String = "" Dim sCryptoValues As String = ""
@@ -151,33 +154,33 @@ Public Module CurrentMachine
Return nResult Return nResult
End Function End Function
Friend Function ReadMachiningParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double) As Double Friend Function ReadMachiningParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double, Optional sFilePath As String = "") As Double
Dim sParam As String = "" Dim sParam As String = ""
Dim dParam As Double = dDefault Dim dParam As Double = dDefault
ReadMachiningParamString(lpAppName, lpKeyName, dDefault, sParam) ReadMachiningParamString(lpAppName, lpKeyName, dDefault, sParam, sFilePath)
StringToDouble(sParam, dParam) StringToDouble(sParam, dParam)
Return dParam Return dParam
End Function End Function
Friend Function WriteMachiningParam(lpAppName As String, lpKeyName As String, lpString As String) As Boolean Friend Function WriteMachiningParam(lpAppName As String, lpKeyName As String, lpString As String, Optional sFilePath As String = "") As Boolean
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), m_sMachiningFilePath) Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
End Function End Function
Friend Function WriteMachiningParamSplit(lpAppName As String, lpKeyName As String, lpString As String) As Boolean Friend Function WriteMachiningParamSplit(lpAppName As String, lpKeyName As String, lpString As String, Optional sFilePath As String = "") As Boolean
If Not String.IsNullOrWhiteSpace(lpString) Then If Not String.IsNullOrWhiteSpace(lpString) Then
Dim Values() As String = lpString.Split(";"c) Dim Values() As String = lpString.Split(";"c)
Dim sCryptoValues As String = "" Dim sCryptoValues As String = ""
For ValueIndex = 0 To Values.Count - 1 For ValueIndex = 0 To Values.Count - 1
sCryptoValues += EgwCrypto.PowerEncryptString(Values(ValueIndex), m_Salt) & If(ValueIndex < Values.Count - 1, ";", "") sCryptoValues += EgwCrypto.PowerEncryptString(Values(ValueIndex), m_Salt) & If(ValueIndex < Values.Count - 1, ";", "")
Next Next
Return WritePrivateProfileString(lpAppName, lpKeyName, sCryptoValues, m_sMachiningFilePath) Return WritePrivateProfileString(lpAppName, lpKeyName, sCryptoValues, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
Else Else
Return False Return False
End If End If
End Function End Function
Friend Function ReadMaterialParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString 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, m_sMaterialsFilePath) Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMaterialsFilePath))
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
@@ -186,16 +189,16 @@ Public Module CurrentMachine
Return nResult Return nResult
End Function End Function
Friend Function ReadMaterialParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double) As Double Friend Function ReadMaterialParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double, Optional sFilePath As String = "") As Double
Dim sParam As String = "" Dim sParam As String = ""
Dim dParam As Double = dDefault Dim dParam As Double = dDefault
ReadMaterialParamString(lpAppName, lpKeyName, dDefault, sParam) ReadMaterialParamString(lpAppName, lpKeyName, dDefault, sParam, sFilePath)
StringToDouble(sParam, dParam) StringToDouble(sParam, dParam)
Return dParam Return dParam
End Function End Function
Friend Function WriteMaterialParam(lpAppName As String, lpKeyName As String, lpString 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), m_sMaterialsFilePath) Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMaterialsFilePath))
End Function End Function
#End Region 'Methods #End Region 'Methods
+183 -6
View File
@@ -1,57 +1,234 @@
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib5
Module GeomEntityColors Module GeomEntityColors
Public Enum LayerType As Integer
PRINTPART = 1
RIBS = 2
SHELLNUMBERS = 3
AUXSOLIDS = 4
MACHSTART = 5
OTHERS = 6
ALL = 10
End Enum
Private m_c3Print As Color3d Private m_c3Print As Color3d
Public ReadOnly Property c3Print As Color3d Public ReadOnly Property c3Print As Color3d
Get Get
Return m_c3Print Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_PRINTPART, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.Aqua)
End If
Return c3Temp
End Get End Get
End Property End Property
Private m_c3MachStart As Color3d Private m_c3MachStart As Color3d
Public ReadOnly Property c3MachStart As Color3d Public ReadOnly Property c3MachStart As Color3d
Get Get
Return m_c3MachStart Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_MACHSTART, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.Red)
End If
Return c3Temp
End Get End Get
End Property End Property
Private m_c3Rib As Color3d Private m_c3Rib As Color3d
Public ReadOnly Property c3Rib As Color3d Public ReadOnly Property c3Rib As Color3d
Get Get
Return m_c3Rib Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_RIBS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.MediumOrchid)
End If
Return c3Temp
End Get End Get
End Property End Property
Private m_c3ShellNumber As Color3d Private m_c3ShellNumber As Color3d
Public ReadOnly Property c3ShellNumber As Color3d Public ReadOnly Property c3ShellNumber As Color3d
Get Get
Return m_c3ShellNumber Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_SHELLNUMBERS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.Lime)
End If
Return c3Temp
End Get End Get
End Property End Property
Private m_c3AuxSolids As Color3d Private m_c3AuxSolids As Color3d
Public ReadOnly Property c3AuxSolids As Color3d Public ReadOnly Property c3AuxSolids As Color3d
Get Get
Return m_c3AuxSolids Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_AUXSOLIDS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.DarkGoldenrod)
End If
Return c3Temp
End Get End Get
End Property End Property
Private m_c3Others As Color3d Private m_c3Others As Color3d
Public ReadOnly Property c3Others As Color3d Public ReadOnly Property c3Others As Color3d
Get Get
Return m_c3Others Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_OTHERS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.LightGray)
End If
Return c3Temp
End Get End Get
End Property End Property
Sub New() Sub New()
' imposto colori superfici ' imposto colori superfici
m_c3Print.FromColor(System.Drawing.Color.Aqua) m_c3Print.FromColor(System.Drawing.Color.Aqua)
GetMainPrivateProfileColor(S_COLORS, K_CLR_PRINTPART, m_c3Print)
m_c3MachStart.FromColor(System.Drawing.Color.Red) m_c3MachStart.FromColor(System.Drawing.Color.Red)
GetMainPrivateProfileColor(S_COLORS, K_CLR_MACHSTART, m_c3MachStart)
m_c3Rib.FromColor(System.Drawing.Color.MediumOrchid) m_c3Rib.FromColor(System.Drawing.Color.MediumOrchid)
GetMainPrivateProfileColor(S_COLORS, K_CLR_RIBS, m_c3Rib)
m_c3ShellNumber.FromColor(System.Drawing.Color.Lime) m_c3ShellNumber.FromColor(System.Drawing.Color.Lime)
GetMainPrivateProfileColor(S_COLORS, K_CLR_SHELLNUMBERS, m_c3ShellNumber)
m_c3AuxSolids.FromColor(System.Drawing.Color.DarkGoldenrod) m_c3AuxSolids.FromColor(System.Drawing.Color.DarkGoldenrod)
GetMainPrivateProfileColor(S_COLORS, K_CLR_AUXSOLIDS, m_c3AuxSolids)
m_c3Others.FromColor(System.Drawing.Color.LightGray) m_c3Others.FromColor(System.Drawing.Color.LightGray)
GetMainPrivateProfileColor(S_COLORS, K_CLR_OTHERS, m_c3Others)
End Sub
Friend Sub SetColor(Type As LayerType, c3Color As Color3d)
Dim c3Temp As Color3d
Dim sIniKey As String
Select Case Type
Case LayerType.PRINTPART
c3Temp = c3Print
sIniKey = K_CLR_PRINTPART
Case LayerType.RIBS
c3Temp = c3Rib
sIniKey = K_CLR_RIBS
Case LayerType.SHELLNUMBERS
c3Temp = c3ShellNumber
sIniKey = K_CLR_SHELLNUMBERS
Case LayerType.AUXSOLIDS
c3Temp = c3AuxSolids
sIniKey = K_CLR_AUXSOLIDS
Case LayerType.MACHSTART
c3Temp = c3MachStart
sIniKey = K_CLR_MACHSTART
Case LayerType.OTHERS
c3Temp = c3Others
sIniKey = K_CLR_OTHERS
End Select
c3Temp.R = c3Color.R
c3Temp.G = c3Color.G
c3Temp.B = c3Color.B
WritePrivateProfileColor(S_COLORS, sIniKey, c3Temp)
UpdateColors(Type)
End Sub
Friend Sub SetAlpha(Type As LayerType, dAlpha As Double)
Dim c3Temp As Color3d = c3Print
Dim sIniKey As String
Select Case Type
Case LayerType.PRINTPART
c3Temp = c3Print
sIniKey = K_CLR_PRINTPART
Case LayerType.RIBS
c3Temp = c3Rib
sIniKey = K_CLR_RIBS
Case LayerType.SHELLNUMBERS
c3Temp = c3ShellNumber
sIniKey = K_CLR_SHELLNUMBERS
Case LayerType.AUXSOLIDS
c3Temp = c3AuxSolids
sIniKey = K_CLR_AUXSOLIDS
Case LayerType.MACHSTART
c3Temp = c3MachStart
sIniKey = K_CLR_MACHSTART
Case LayerType.OTHERS
c3Temp = c3Others
sIniKey = K_CLR_OTHERS
End Select
c3Temp.A = dAlpha
WritePrivateProfileColor(S_COLORS, sIniKey, c3Temp)
UpdateColors(Type)
End Sub
Public Function WritePrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Color As Color3d) As Boolean
Dim sColor As String = Color.R & "," & Color.G & "," & Color.B & "," & Color.A
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
End Function
Sub UpdateColors(Type As LayerType)
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
Dim nIsOnTable As Integer = 0
If Not EgtGetInfo(nPartId, "PartOnTable", nIsOnTable) OrElse nIsOnTable <> 1 Then
nPartId = EgtGetNextPart(nPartId)
Continue While
End If
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
' rimuovo eventuali colori da entita' e li assegno ai layer
If Type = LayerType.PRINTPART OrElse Type = LayerType.ALL Then
Dim nPrintPartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, PRINT_SOLID)
Dim nPrintPartEntityId = EgtGetFirstInGroup(nPrintPartLayerId)
While nPrintPartEntityId <> GDB_ID.NULL
EgtResetColor(nPrintPartEntityId)
nPrintPartEntityId = EgtGetNext(nPrintPartEntityId)
End While
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
End If
If Type = LayerType.RIBS OrElse Type = LayerType.ALL Then
Dim nRibsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_RIBS)
Dim nRibsEntityId = EgtGetFirstInGroup(nRibsLayerId)
While nRibsEntityId <> GDB_ID.NULL
EgtResetColor(nRibsEntityId)
nRibsEntityId = EgtGetNext(nRibsEntityId)
End While
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
End If
If Type = LayerType.SHELLNUMBERS OrElse Type = LayerType.ALL Then
Dim nShellNumberLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_SHELL_NBR)
Dim nShellNumberEntityId = EgtGetFirstInGroup(nShellNumberLayerId)
While nShellNumberEntityId <> GDB_ID.NULL
EgtResetColor(nShellNumberEntityId)
nShellNumberEntityId = EgtGetNext(nShellNumberEntityId)
End While
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
End If
If Type = LayerType.AUXSOLIDS OrElse Type = LayerType.ALL Then
Dim nAuxSolidsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX_SOLIDS)
Dim nAuxSolidsEntityId = EgtGetFirstInGroup(nAuxSolidsLayerId)
While nAuxSolidsEntityId <> GDB_ID.NULL
EgtResetColor(nAuxSolidsEntityId)
nAuxSolidsEntityId = EgtGetNext(nAuxSolidsEntityId)
End While
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
End If
If Type = LayerType.MACHSTART OrElse Type = LayerType.ALL Then
Dim nMachStartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_MACH_START)
Dim nMachStartEntityId = EgtGetFirstInGroup(nMachStartLayerId)
While nMachStartEntityId <> GDB_ID.NULL
EgtResetColor(nMachStartEntityId)
nMachStartEntityId = EgtGetNext(nMachStartEntityId)
End While
EgtSetColor(nMachStartLayerId, GeomEntityColors.c3MachStart)
End If
If Type = LayerType.OTHERS OrElse Type = LayerType.ALL Then
Dim nOthersLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_OTHERS)
Dim nOthersEntityId = EgtGetFirstInGroup(nOthersLayerId)
While nOthersEntityId <> GDB_ID.NULL
EgtResetColor(nOthersEntityId)
nOthersEntityId = EgtGetNext(nOthersEntityId)
End While
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
End If
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
nPartId = EgtGetNextPart(nPartId)
End While
EgtDraw()
End Sub End Sub
End Module End Module
+2 -1
View File
@@ -69,7 +69,8 @@ Module LuaExec
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) Then If Not EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath) OrElse
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)
+18 -1
View File
@@ -56,7 +56,7 @@ Public Class ViewLayerManagerVM
WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, "0") WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, "0")
ElseIf Map.refTopPanelVM.SelPage = Pages.SLICE Then ElseIf Map.refTopPanelVM.SelPage = Pages.SLICE Then
WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SOLIDSLICE, "0") WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SOLIDSLICE, "0")
ElseIf Map.refTopPanelVM.SelPage = Pages.NULL then ElseIf Map.refTopPanelVM.SelPage = Pages.NULL Then
WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SOLIDSLICE, "0") WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SOLIDSLICE, "0")
WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, "0") WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, "0")
End If End If
@@ -229,6 +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
'If Map.refTopPanelVM.SelPage = Pages.IMPORT Then
' For Each CurrPart In Map.refManagePartPanelVM.ManagerPartList
' For Each Layer In CurrPart.LayerList
' 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.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.AUX_SOLIDS AndAlso m_Type = ViewLayerType.AUX_SOLIDS) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.OTHERS AndAlso m_Type = ViewLayerType.OTHERS) Then
' For Each Entity In Layer.EntityList
' EgtSetStatus(Entity.nId, Status)
' Next
' End If
' Next
' Next
'End If
' Ripristino stato segnalazione modifica ' Ripristino stato segnalazione modifica
DisableMgr.ReEnable() DisableMgr.ReEnable()
End Sub End Sub