- 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
This commit is contained in:
@@ -95,6 +95,7 @@
|
||||
Public Const MAC_WIPEDIR = "WipeDir"
|
||||
Public Const MAC_FLOORCOUNT = "FloorCount"
|
||||
Public Const MAC_G0FEED = "G0Feed"
|
||||
Public Const MAC_G0FEEDZ = "G0FeedZ"
|
||||
Public Const MAC_TOOLDIAM = "ToolDiam"
|
||||
Public Const MAC_RIBSTYPE = "RibsType"
|
||||
Public Const MAC_RIBSOVERLAP = "RibsOverlap"
|
||||
|
||||
@@ -113,6 +113,14 @@ Public Module ConstIni
|
||||
Public Const K_VIEWSLIDER As String = "ViewSlider"
|
||||
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_MRUIMPORTFILES As String = "MruImportFiles"
|
||||
|
||||
|
||||
@@ -194,6 +194,7 @@ Public Class CurrMachiningCathegory
|
||||
New CurrComboMachiningParam(MachiningParam.Params.DIRECTION, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, 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.FLOWRATE_PC, nPartId, nIndex, bForceFromDb)})
|
||||
Case Cathegories.LINK
|
||||
@@ -273,13 +274,13 @@ Public Class CurrNumericMachiningParam
|
||||
|
||||
Public Overrides Property sValue As String
|
||||
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
|
||||
Set(value As String)
|
||||
If m_bIsLen Then
|
||||
StringToLen(value, m_dValue)
|
||||
Else
|
||||
StringToDouble( value, m_dValue)
|
||||
StringToDouble(value, m_dValue)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
|
||||
@@ -366,6 +367,9 @@ Public Class CurrNumericMachiningParam
|
||||
Case Params.G0FEED
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEED, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.G0FEEDZ
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEEDZ, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.TOOLDIAM
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_TOOLDIAM, m_dValue)
|
||||
m_bIsLen = True
|
||||
@@ -429,7 +433,7 @@ Public Class CurrNumericMachiningParam
|
||||
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
|
||||
Select Case Type
|
||||
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)
|
||||
Case Params.LINKPARAM, Params.LINKZUP, Params.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST,
|
||||
Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED_PC,
|
||||
@@ -503,6 +507,8 @@ Public Class CurrNumericMachiningParam
|
||||
EgtSetInfo(nPartId, MAC_FLOORCOUNT, sWriteValue)
|
||||
Case Params.G0FEED
|
||||
EgtSetInfo(nPartId, MAC_G0FEED, sWriteValue)
|
||||
Case Params.G0FEEDZ
|
||||
EgtSetInfo(nPartId, MAC_G0FEEDZ, sWriteValue)
|
||||
Case Params.TOOLDIAM
|
||||
EgtSetInfo(nPartId, MAC_TOOLDIAM, sWriteValue)
|
||||
Case Params.RIBSOVERLAP
|
||||
|
||||
@@ -307,6 +307,7 @@ Public Class MachiningCathegory
|
||||
New ComboMachiningParam(MachiningParam.Params.DIRECTION, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.G0FEED, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.G0FEEDZ, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nIndex)})
|
||||
Case Cathegories.LINK
|
||||
@@ -422,37 +423,38 @@ Public MustInherit Class MachiningParam
|
||||
WIPEFEED_PC = 24
|
||||
FLOORCOUNT = 25
|
||||
G0FEED = 26
|
||||
TOOLDIAM = 27
|
||||
RIBSTYPE = 28
|
||||
RIBSOVERLAP = 29
|
||||
RIBSSTRANDCOUNT = 30
|
||||
RIBSLINK = 31
|
||||
RIBSINVERTORDER = 32
|
||||
RIBSINVERTDIRECTION = 33
|
||||
RIBSLEADININVERT = 34
|
||||
RIBSLEADINLEN = 35
|
||||
RIBSLEADOUTINVERT = 36
|
||||
RIBSLEADOUTLEN = 37
|
||||
RIBSLEADOUTCOASTING = 38
|
||||
RIBSLEADOUTWIPE = 39
|
||||
RIBSLEADOUTWIPEDIR = 40
|
||||
SHELLNBRDIFFERENCE = 41
|
||||
SHELLNBRCOASTING = 42
|
||||
SHELLNBRWIPE = 43
|
||||
SHELLNBRWIPEDIR = 44
|
||||
AUXSOLIDSOVERLAP = 45
|
||||
AUXSOLIDSINFILL = 46
|
||||
AUXSOLIDSSTRANDORDER = 47
|
||||
AUXSOLIDSLINKTYPE = 48
|
||||
AUXSOLIDSLINKPARAM = 49
|
||||
AUXSOLIDSSTARTPOINTOFFSETONSLICE = 50
|
||||
AUXSOLIDSCOASTINGLEN = 51
|
||||
AUXSOLIDSWIPELEN = 52
|
||||
AUXSOLIDSWIPEDIR = 53
|
||||
SPIRALVASE = 54
|
||||
WIPEDIR = 55
|
||||
STRANDOVERLAP = 56
|
||||
FLOWRATE_PC = 57
|
||||
G0FEEDZ = 27
|
||||
TOOLDIAM = 28
|
||||
RIBSTYPE = 29
|
||||
RIBSOVERLAP = 30
|
||||
RIBSSTRANDCOUNT = 31
|
||||
RIBSLINK = 32
|
||||
RIBSINVERTORDER = 33
|
||||
RIBSINVERTDIRECTION = 34
|
||||
RIBSLEADININVERT = 35
|
||||
RIBSLEADINLEN = 36
|
||||
RIBSLEADOUTINVERT = 37
|
||||
RIBSLEADOUTLEN = 38
|
||||
RIBSLEADOUTCOASTING = 39
|
||||
RIBSLEADOUTWIPE = 40
|
||||
RIBSLEADOUTWIPEDIR = 41
|
||||
SHELLNBRDIFFERENCE = 42
|
||||
SHELLNBRCOASTING = 43
|
||||
SHELLNBRWIPE = 44
|
||||
SHELLNBRWIPEDIR = 45
|
||||
AUXSOLIDSOVERLAP = 46
|
||||
AUXSOLIDSINFILL = 47
|
||||
AUXSOLIDSSTRANDORDER = 48
|
||||
AUXSOLIDSLINKTYPE = 49
|
||||
AUXSOLIDSLINKPARAM = 50
|
||||
AUXSOLIDSSTARTPOINTOFFSETONSLICE = 51
|
||||
AUXSOLIDSCOASTINGLEN = 52
|
||||
AUXSOLIDSWIPELEN = 53
|
||||
AUXSOLIDSWIPEDIR = 54
|
||||
SPIRALVASE = 55
|
||||
WIPEDIR = 56
|
||||
STRANDOVERLAP = 57
|
||||
FLOWRATE_PC = 58
|
||||
MATERIALS = 100
|
||||
End Enum
|
||||
|
||||
@@ -523,6 +525,8 @@ Public MustInherit Class MachiningParam
|
||||
m_sName = "Floor Count"
|
||||
Case Params.G0FEED
|
||||
m_sName = "G0 Feed"
|
||||
Case Params.G0FEEDZ
|
||||
m_sName = "G0 Feed Z"
|
||||
Case Params.TOOLDIAM
|
||||
m_sName = "Nozzle Diameter"
|
||||
Case Params.RIBSTYPE
|
||||
@@ -614,13 +618,13 @@ Public Class NumericMachiningParam
|
||||
End Property
|
||||
Public Overridable Property sValue As String
|
||||
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
|
||||
Set(value As String)
|
||||
If m_bIsLen Then
|
||||
StringToLen(value, m_dValue)
|
||||
Else
|
||||
StringToDouble( value, m_dValue)
|
||||
StringToDouble(value, m_dValue)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
|
||||
@@ -711,6 +715,9 @@ Public Class NumericMachiningParam
|
||||
Case Params.G0FEED
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_G0FEED, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.G0FEEDZ
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_G0FEEDZ, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.TOOLDIAM
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_TOOLDIAM, 0)
|
||||
m_bIsLen = True
|
||||
@@ -821,6 +828,8 @@ Public Class NumericMachiningParam
|
||||
WriteMachiningParam(nIndex, MAC_FLOORCOUNT, sWriteValue, sFilePath)
|
||||
Case Params.G0FEED
|
||||
WriteMachiningParam(nIndex, MAC_G0FEED, sWriteValue, sFilePath)
|
||||
Case Params.G0FEEDZ
|
||||
WriteMachiningParam(nIndex, MAC_G0FEEDZ, sWriteValue, sFilePath)
|
||||
Case Params.TOOLDIAM
|
||||
WriteMachiningParam(nIndex, MAC_TOOLDIAM, sWriteValue, sFilePath)
|
||||
Case Params.RIBSOVERLAP
|
||||
|
||||
@@ -310,13 +310,14 @@ Public Class ManagePartPanelVM
|
||||
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
||||
nPrintPartLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
|
||||
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
|
||||
If ManagePart_Layer.EntityList.Count > 0 Then
|
||||
PrintSolidEntity = ManagePart_Layer.EntityList(0)
|
||||
EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
|
||||
' calcolo box superficie per creazione riferimento
|
||||
EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PrintSolidEntity.nId, GeomEntityColors.c3Print)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PrintSolidEntity.nId)
|
||||
If PrintSolidEntity.sName <> PrintSolidEntity.nId.ToString() Then
|
||||
EgtSetInfo(PrintSolidEntity.nId, ENTITY_NAME, PrintSolidEntity.sName)
|
||||
End If
|
||||
@@ -324,6 +325,7 @@ Public Class ManagePartPanelVM
|
||||
Case ManagePart_Layer.LayerType.MACH_START
|
||||
nMachStartLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nMachStartLayerId, LAY_MACH_START)
|
||||
EgtSetColor(nMachStartLayerId, GeomEntityColors.c3MachStart)
|
||||
Dim nMachStartId As Integer = GDB_ID.NULL
|
||||
If ManagePart_Layer.EntityList.Count > 0 Then
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
@@ -339,8 +341,8 @@ Public Class ManagePartPanelVM
|
||||
nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, PartManager_GeomEntity.nId, True)
|
||||
End Select
|
||||
EgtSetName(nMachStartId, START_GEOM)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(nMachStartId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
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()
|
||||
nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
|
||||
EgtSetName(nMachStartId, START_GEOM)
|
||||
' coloro l'entita' di rosso
|
||||
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(nMachStartId)
|
||||
End If
|
||||
Case ManagePart_Layer.LayerType.RIBS
|
||||
nRibsLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nRibsLayerId, LAY_RIBS)
|
||||
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Rib)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
@@ -368,11 +371,12 @@ Public Class ManagePartPanelVM
|
||||
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
||||
nShellNumberLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
|
||||
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3ShellNumber)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
@@ -380,11 +384,12 @@ Public Class ManagePartPanelVM
|
||||
Case ManagePart_Layer.LayerType.AUX_SOLIDS
|
||||
nAuxSolidsLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
|
||||
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3AuxSolids)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
@@ -392,10 +397,11 @@ Public Class ManagePartPanelVM
|
||||
Case ManagePart_Layer.LayerType.OTHERS
|
||||
nOthersLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nOthersLayerId, LAY_OTHERS)
|
||||
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Others)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
@@ -408,16 +414,16 @@ Public Class ManagePartPanelVM
|
||||
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' la trasformo in curva compo
|
||||
Dim nOtherId As Integer = EgtCreateCurveCompo(nOthersLayerId, PartManager_GeomEntity.nId, True)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(nOtherId, GeomEntityColors.c3Others)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(nOtherId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Case Else
|
||||
' altrimenti la sposto solamente
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Others)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
@@ -464,11 +470,11 @@ Public Class ManagePartPanelVM
|
||||
' elimino vecchio pezzo d'importazione
|
||||
EgtErase(m_nImportedPartId)
|
||||
|
||||
EgtDraw()
|
||||
|
||||
Case ManagePartType.MODIFY
|
||||
' nulla da fare
|
||||
End Select
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
End Sub
|
||||
@@ -489,6 +495,7 @@ Public Class ManagePartPanelVM
|
||||
Public Sub Cancel()
|
||||
' elimino pezzo importato
|
||||
EgtErase(m_nImportedPartId)
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
' se ci sono pezzi
|
||||
If Map.refTopPanelVM.PartList.Count > 0 Then
|
||||
|
||||
@@ -625,8 +625,14 @@ Public Class GeomEntity_MenuItem
|
||||
Case ManagePartPanelVM.ManagePartType.IMPORT
|
||||
Dim NewPart As ManagePart_Part = New ManagePart_Part(Nothing)
|
||||
Map.refManagePartPanelVM.ManagerPartList.Add(NewPart)
|
||||
' elimino entity dalla lista entita' importate
|
||||
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
|
||||
' se l'entita' e' gia' in lista pezzi
|
||||
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
|
||||
Dim NewLayer As ManagePart_Layer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
|
||||
If Not IsNothing(NewLayer) Then
|
||||
@@ -708,6 +714,9 @@ Public Class GeomEntity_MenuItem
|
||||
' Imposto flag di ricalcolo slice
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||
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
|
||||
End If
|
||||
Select Case Map.refManagePartPanelVM.Type
|
||||
|
||||
@@ -80,13 +80,6 @@
|
||||
</TabItem>
|
||||
<TabItem Header="{Binding CADMsg}">
|
||||
<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"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
|
||||
@@ -94,6 +87,38 @@
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,0,0,0"/>
|
||||
</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"
|
||||
Header="{Binding DimensionMsg}"
|
||||
Margin="0,0,0,5">
|
||||
|
||||
@@ -179,12 +179,16 @@ Public Class OptionWindowVM
|
||||
End Get
|
||||
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
|
||||
Return New SolidColorBrush(Color.FromArgb(CByte(255),
|
||||
CByte(OptionModule.m_DefMaterialColor.R),
|
||||
CByte(OptionModule.m_DefMaterialColor.G),
|
||||
CByte(OptionModule.m_DefMaterialColor.B)))
|
||||
Return m_LayerColorList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -195,7 +199,7 @@ Public Class OptionWindowVM
|
||||
Set(value As Boolean)
|
||||
OptionModule.m_bThickLine = value
|
||||
WriteMainPrivateProfileString(S_SCENE, K_LINEWIDTH, If(value, "2", "1"))
|
||||
EgtSetLineAttribs( If( value, 2, 1))
|
||||
EgtSetLineAttribs(If(value, 2, 1))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -510,11 +514,11 @@ Public Class OptionWindowVM
|
||||
'End Property
|
||||
|
||||
' Definizione comandi
|
||||
|
||||
Private m_cmdTopSceneBackground As ICommand
|
||||
Private m_cmdBotSceneBackground As ICommand
|
||||
Private m_cmdGridColor As ICommand
|
||||
Private m_cmdUpdateLicenceCmd As ICommand
|
||||
Private m_cmdDefMaterialColor As ICommand
|
||||
Private m_cmdAddMachineCmd As ICommand
|
||||
Private m_cmdExportMachineCmd As ICommand
|
||||
|
||||
@@ -583,11 +587,6 @@ Public Class OptionWindowVM
|
||||
Return EgtMsg(6513)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DefMaterialColorMsg As String
|
||||
Get
|
||||
Return EgtMsg(6512)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ImportMsg As String
|
||||
Get
|
||||
@@ -747,9 +746,35 @@ Public Class OptionWindowVM
|
||||
|
||||
#End Region
|
||||
|
||||
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
|
||||
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
|
||||
Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean
|
||||
' Recupero colori custom
|
||||
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
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -854,41 +879,6 @@ Public Class OptionWindowVM
|
||||
|
||||
#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"
|
||||
|
||||
''' <summary>
|
||||
@@ -1165,10 +1155,94 @@ Public Class OptionWindowVM
|
||||
|
||||
#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
|
||||
' Recupero colori custom
|
||||
Dim sCustomColors As String = ""
|
||||
GetMainPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, "", sCustomColors)
|
||||
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
|
||||
@@ -1192,10 +1266,39 @@ Public Class OptionWindowVM
|
||||
sCustomColors &= Color.ToString() & ","
|
||||
Next
|
||||
sCustomColors = sCustomColors.Trim({" "c, ","c})
|
||||
WriteMainPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, sCustomColors)
|
||||
WriteMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, sCustomColors)
|
||||
Return True
|
||||
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
|
||||
|
||||
'Public Class GeomTypeConverter
|
||||
|
||||
@@ -44,6 +44,7 @@ Public Class RibParamPanelVM
|
||||
m_MachiningParamList = New List(Of MachiningParam)({New RibComboMachiningParam(MachiningParam.Params.RIBSTYPE, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, 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.RIBSLEADININVERT, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nRibId, nPartId),
|
||||
@@ -477,9 +478,9 @@ Public Class RibCheckMachiningParam
|
||||
MyBase.New(Type)
|
||||
Dim bReadFromPart As Boolean = False
|
||||
Select Case Type
|
||||
'Case Params.RIBSLINK
|
||||
' bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLINK, m_bValue)
|
||||
' EgtGetInfo(nPartId, MAC_RIBSOVERLAP, m_bPartValue)
|
||||
Case Params.RIBSLINK
|
||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLINK, m_bValue)
|
||||
EgtGetInfo(nPartId, MAC_RIBSLINK, m_bPartValue)
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTDIRECTION, m_bValue)
|
||||
EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bPartValue)
|
||||
@@ -499,12 +500,12 @@ Public Class RibCheckMachiningParam
|
||||
|
||||
Friend Sub WriteParamInRib(nRibId As Integer)
|
||||
Select Case Type
|
||||
'Case Params.RIBSLINK
|
||||
' If bIsModifiedFromPart Then
|
||||
' EgtSetInfo(nRibId, MAC_RIBSLINK, If(m_bValue, 1, 0))
|
||||
' Else
|
||||
' EgtRemoveInfo(nRibId, MAC_RIBSLINK)
|
||||
' End If
|
||||
Case Params.RIBSLINK
|
||||
If bIsModifiedFromPart Then
|
||||
EgtSetInfo(nRibId, MAC_RIBSLINK, If(m_bValue, 1, 0))
|
||||
Else
|
||||
EgtRemoveInfo(nRibId, MAC_RIBSLINK)
|
||||
End If
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
If bIsModifiedFromPart Then
|
||||
EgtSetInfo(nRibId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
|
||||
|
||||
@@ -940,10 +940,12 @@ Public Class MySceneHostVM
|
||||
' setto i solidi non calcolati
|
||||
EgtSetInfo(nPartId, KEY_CALC_SOLIDS, 0)
|
||||
EgtSetInfo(nPartId, KEY_HAS_SOLIDS, 0)
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
' Ripristino stato segnalazione modifica
|
||||
DisableMgr.ReEnable()
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
' aggiorno colori entita'
|
||||
GeomEntityColors.UpdateColors(LayerType.ALL)
|
||||
|
||||
' se non e' da ricalcolare, recupero tempo e massa
|
||||
If Not bProjectToRecalc Then
|
||||
|
||||
@@ -1,57 +1,234 @@
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
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
|
||||
Public ReadOnly Property c3Print As Color3d
|
||||
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 Property
|
||||
|
||||
Private m_c3MachStart As Color3d
|
||||
Public ReadOnly Property c3MachStart As Color3d
|
||||
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 Property
|
||||
|
||||
Private m_c3Rib As Color3d
|
||||
Public ReadOnly Property c3Rib As Color3d
|
||||
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 Property
|
||||
|
||||
Private m_c3ShellNumber As Color3d
|
||||
Public ReadOnly Property c3ShellNumber As Color3d
|
||||
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 Property
|
||||
|
||||
Private m_c3AuxSolids As Color3d
|
||||
Public ReadOnly Property c3AuxSolids As Color3d
|
||||
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 Property
|
||||
|
||||
Private m_c3Others As Color3d
|
||||
Public ReadOnly Property c3Others As Color3d
|
||||
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 Property
|
||||
|
||||
Sub New()
|
||||
' imposto colori superfici
|
||||
m_c3Print.FromColor(System.Drawing.Color.Aqua)
|
||||
GetMainPrivateProfileColor(S_COLORS, K_CLR_PRINTPART, m_c3Print)
|
||||
m_c3MachStart.FromColor(System.Drawing.Color.Red)
|
||||
GetMainPrivateProfileColor(S_COLORS, K_CLR_MACHSTART, m_c3MachStart)
|
||||
m_c3Rib.FromColor(System.Drawing.Color.MediumOrchid)
|
||||
GetMainPrivateProfileColor(S_COLORS, K_CLR_RIBS, m_c3Rib)
|
||||
m_c3ShellNumber.FromColor(System.Drawing.Color.Lime)
|
||||
GetMainPrivateProfileColor(S_COLORS, K_CLR_SHELLNUMBERS, m_c3ShellNumber)
|
||||
m_c3AuxSolids.FromColor(System.Drawing.Color.DarkGoldenrod)
|
||||
GetMainPrivateProfileColor(S_COLORS, K_CLR_AUXSOLIDS, m_c3AuxSolids)
|
||||
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 Module
|
||||
|
||||
@@ -56,7 +56,7 @@ Public Class ViewLayerManagerVM
|
||||
WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, "0")
|
||||
ElseIf Map.refTopPanelVM.SelPage = Pages.SLICE Then
|
||||
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_SLC_SOLIDSLICE, "0")
|
||||
End If
|
||||
@@ -229,6 +229,23 @@ Public Class ViewLayer
|
||||
EgtSetStatus(CurrPart.nOthersLayerId, Status)
|
||||
End Select
|
||||
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
|
||||
DisableMgr.ReEnable()
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user