diff --git a/Icarus/Constants/Const3dPrint.vb b/Icarus/Constants/Const3dPrint.vb index 69f4636..b95500c 100644 --- a/Icarus/Constants/Const3dPrint.vb +++ b/Icarus/Constants/Const3dPrint.vb @@ -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" diff --git a/Icarus/Constants/ConstIni.vb b/Icarus/Constants/ConstIni.vb index 2042fb3..ad144a5 100644 --- a/Icarus/Constants/ConstIni.vb +++ b/Icarus/Constants/ConstIni.vb @@ -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" diff --git a/Icarus/CurrMachiningPanel/CurrMachining.vb b/Icarus/CurrMachiningPanel/CurrMachining.vb index 25916df..dcb26a4 100644 --- a/Icarus/CurrMachiningPanel/CurrMachining.vb +++ b/Icarus/CurrMachiningPanel/CurrMachining.vb @@ -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 diff --git a/Icarus/MachiningDb/Machining.vb b/Icarus/MachiningDb/Machining.vb index d07ca6a..87ddebb 100644 --- a/Icarus/MachiningDb/Machining.vb +++ b/Icarus/MachiningDb/Machining.vb @@ -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 diff --git a/Icarus/ManagePartPanel/ManagePartPanelVM.vb b/Icarus/ManagePartPanel/ManagePartPanelVM.vb index 9913742..1d74712 100644 --- a/Icarus/ManagePartPanel/ManagePartPanelVM.vb +++ b/Icarus/ManagePartPanel/ManagePartPanelVM.vb @@ -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 diff --git a/Icarus/ManagePartPanel/ManagePartUtility.vb b/Icarus/ManagePartPanel/ManagePartUtility.vb index 99925f2..eeb9ba3 100644 --- a/Icarus/ManagePartPanel/ManagePartUtility.vb +++ b/Icarus/ManagePartPanel/ManagePartUtility.vb @@ -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 diff --git a/Icarus/OptionsWindow/OptionWindowV.xaml b/Icarus/OptionsWindow/OptionWindowV.xaml index e1c8ef6..c2db194 100644 --- a/Icarus/OptionsWindow/OptionWindowV.xaml +++ b/Icarus/OptionsWindow/OptionWindowV.xaml @@ -80,13 +80,6 @@ - @@ -94,6 +87,38 @@ VerticalContentAlignment="Center" Margin="10,0,0,0"/> + + + + + + + + + + + +