diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index d02fdff..6eee528 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -85,6 +85,7 @@ Module ConstIni Public Const S_FLATPARTS As String = "FlatParts" Public Const K_FLPCURRDIR As String = "CurrDir" + Public Const K_FLPTOLERANCE As String = "Tolerance" Public Const S_SIDES As String = "Sides" Public Const K_MAXSIDEANGLE As String = "MaxSideAngle" @@ -111,6 +112,11 @@ Module ConstIni Public Const K_CSVCURRDIR As String = "CurrDir" Public Const K_CSVLASTFILE As String = "LastFile" + Public Const S_COLORTOSIDEANG As String = "ColorToSideAng" + Public Const K_CTSA_ENABLE As String = "Enable" + Public Const K_CTSA_TOLERANCE As String = "Tolerance" + Public Const K_CTSA As String = "CTSA" + Public Const S_RAWPART As String = "RawPart" Public Const K_RAWCOLOR As String = "RawColor" Public Const K_KERFCOLOR As String = "KerfColor" diff --git a/DxfImportWindow/DxfImportWindowVM.vb b/DxfImportWindow/DxfImportWindowVM.vb index 5e83f28..1e78d28 100644 --- a/DxfImportWindow/DxfImportWindowVM.vb +++ b/DxfImportWindow/DxfImportWindowVM.vb @@ -799,8 +799,12 @@ Public Class DxfImportWindowVM Public Sub UseRegion(ByVal param As Object) ' Creo i pezzi Dim nType As Integer = If(m_nFileType = FT.NGE, FPC_TYPE.NGE, FPC_TYPE.REGION) - EgtCreateFlatParts(nType) - AdjustFlatParts() + Dim dToler As Double = GetPrivateProfileDouble(S_FLATPARTS, K_FLPTOLERANCE, 0.1, IniFile.m_sIniFile) + EgtCreateAdjustFlatParts(nType, dToler) + ' Se prevista gestione colore->angolo di fianco + If GetPrivateProfileInt(S_COLORTOSIDEANG, K_CTSA_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then + SideEntityControlVM.ColorToSideAngle(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx()) + End If ' Eseguo zoom EgtZoom(ZM.ALL) ' disabilito bottoni UseLayer e UseRegion, abilito bottoni Reset e Insert @@ -830,8 +834,12 @@ Public Class DxfImportWindowVM Public Sub UseLayer(ByVal param As Object) ' Creo i pezzi Dim nType As Integer = If(m_nFileType = FT.NGE, FPC_TYPE.NGE, FPC_TYPE.LAYER) - EgtCreateFlatParts(nType) - EstProject.AdjustFlatParts() + Dim dToler As Double = GetPrivateProfileDouble(S_FLATPARTS, K_FLPTOLERANCE, 0.1, IniFile.m_sIniFile) + EgtCreateAdjustFlatParts(nType, dToler) + ' Se prevista gestione colore->angolo di fianco + If GetPrivateProfileInt(S_COLORTOSIDEANG, K_CTSA_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then + SideEntityControlVM.ColorToSideAngle(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx()) + End If ' Eseguo zoom EgtZoom(ZM.ALL) ' disabilito bottoni UseLayer. UseRegion e UseClosedCurve, abilito bottoni Reset e Insert @@ -861,8 +869,12 @@ Public Class DxfImportWindowVM Public Sub UseClosedCurve(ByVal param As Object) ' Creo i pezzi Dim nType As Integer = If(m_nFileType = FT.NGE, FPC_TYPE.NGE, FPC_TYPE.CLOSEDCURVE) - EgtCreateFlatParts(nType) - AdjustFlatParts() + Dim dToler As Double = GetPrivateProfileDouble(S_FLATPARTS, K_FLPTOLERANCE, 0.1, IniFile.m_sIniFile) + EgtCreateAdjustFlatParts(nType, dToler) + ' Se prevista gestione colore->angolo di fianco + If GetPrivateProfileInt(S_COLORTOSIDEANG, K_CTSA_ENABLE, 0, IniFile.m_sIniFile) <> 0 Then + SideEntityControlVM.ColorToSideAngle(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx()) + End If ' Eseguo zoom EgtZoom(ZM.ALL) ' disabilito bottoni UseLayer e UseRegion, abilito bottoni Reset e Insert diff --git a/EgtStoneLib/CamAuto.vb b/EgtStoneLib/CamAuto.vb index 4b2cd48..9dcded0 100644 --- a/EgtStoneLib/CamAuto.vb +++ b/EgtStoneLib/CamAuto.vb @@ -468,9 +468,12 @@ Friend Module CamAuto ' Se attacco cambiato, aggiorno e accorcio della sicurezza sui tagli If nOriLeadIn <> MCH_SAW_LI.STRICT Then EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.STRICT) + Dim dUserAddLen As Double = 0 + EgtGetInfo( nMchId, INFO_MCH_USER_SAL, dUserAddLen) + EgtRemoveInfo( nMchId, INFO_MCH_USER_SAL) Dim dAddLen As Double = 0 EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen) - EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen - dSafeLen) + EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen - dUserAddLen - dSafeLen) bModif = True End If End If @@ -485,9 +488,12 @@ Friend Module CamAuto ' Se uscita cambiata, aggiorno e accorcio della sicurezza sui tagli If nOriLeadOut <> MCH_SAW_LO.STRICT Then EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.STRICT) + Dim dUserAddLen As Double = 0 + EgtGetInfo( nMchId, INFO_MCH_USER_EAL, dUserAddLen) + EgtRemoveInfo( nMchId, INFO_MCH_USER_EAL) Dim dAddLen As Double = 0 EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen) - EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen - dSafeLen) + EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen - dUserAddLen - dSafeLen) bModif = True End If End If @@ -772,7 +778,11 @@ Friend Module CamAuto Dim nRawId As Integer = EgtGetFirstRawPart() If nRawId = GDB_ID.NULL Then Return False ' Se non ci sono pezzi, esco - If EgtGetPartInRawPartCount(nRawId) = 0 Then Return True + Dim nPart1Id As Integer = EgtGetFirstPartInRawPart( nRawId) + If nPart1Id = GDB_ID.NULL Then Return True + ' Verifico se cornice curva + Dim nDir As Integer = 0 + Dim bCurved As Boolean = (EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir) AndAlso nDir >= 2) ' Recupero la lavorazione corrente di sgrossatura con lama Dim sCurrSawRou As String = CurrentMachine.sCurrSawRoughing If String.IsNullOrEmpty(sCurrSawRou) Then Return True @@ -801,6 +811,8 @@ Friend Module CamAuto ' Imposto trim iniziale e finale EgtSetMachiningParam(MCH_MP.STARTADDLEN, -dTrimStart) EgtSetMachiningParam(MCH_MP.ENDADDLEN, -dTrimEnd) + ' Se cornice curva, imposto SCC + If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR) ' Applico la lavorazione Return EgtApplyMachining(False) End Function @@ -813,7 +825,11 @@ Friend Module CamAuto Dim nRawId As Integer = EgtGetFirstRawPart() If nRawId = GDB_ID.NULL Then Return False ' Se non ci sono pezzi, esco - If EgtGetPartInRawPartCount(nRawId) = 0 Then Return True + Dim nPart1Id As Integer = EgtGetFirstPartInRawPart( nRawId) + If nPart1Id = GDB_ID.NULL Then Return True + ' Verifico se cornice curva + Dim nDir As Integer = 0 + Dim bCurved As Boolean = (EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir) AndAlso nDir >= 2) ' Recupero la lavorazione corrente di finitura con lama Dim sCurrSawFin As String = CurrentMachine.sCurrSawFinishing If String.IsNullOrEmpty(sCurrSawFin) Then Return True @@ -852,6 +868,8 @@ Friend Module CamAuto ' Imposto trim iniziale e finale EgtSetMachiningParam(MCH_MP.STARTADDLEN, -dTrimStart) EgtSetMachiningParam(MCH_MP.ENDADDLEN, -dTrimEnd) + ' Se cornice curva, imposto SCC + If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR) ' Applico la lavorazione Return EgtApplyMachining(False) End Function @@ -864,7 +882,11 @@ Friend Module CamAuto Dim nRawId As Integer = EgtGetFirstRawPart() If nRawId = GDB_ID.NULL Then Return False ' Se non ci sono pezzi, esco - If EgtGetPartInRawPartCount(nRawId) = 0 Then Return True + Dim nPart1Id As Integer = EgtGetFirstPartInRawPart( nRawId) + If nPart1Id = GDB_ID.NULL Then Return True + ' Verifico se cornice curva + Dim nDir As Integer = 0 + Dim bCurved As Boolean = (EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir) AndAlso nDir >= 2) ' Recupero la lavorazione corrente di spatolatura con lama Dim sCurrSawSideFin As String = CurrentMachine.sCurrSawSideFinishing If String.IsNullOrEmpty(sCurrSawSideFin) Then Return True @@ -887,6 +909,8 @@ Friend Module CamAuto ' Imposto trim iniziale e finale EgtSetMachiningParam(MCH_MP.STARTADDLEN, -dTrimStart) EgtSetMachiningParam(MCH_MP.ENDADDLEN, -dTrimEnd) + ' Se cornice curva, imposto SCC + If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR) ' Applico la lavorazione Return EgtApplyMachining(False) End Function diff --git a/EgtStoneLib/ConstMach.vb b/EgtStoneLib/ConstMach.vb index 5cb0bb1..9b08c5b 100644 --- a/EgtStoneLib/ConstMach.vb +++ b/EgtStoneLib/ConstMach.vb @@ -34,11 +34,15 @@ Module ConstMach ' Nome oggetto frame prima uscita di una testa Public Const HEAD_FIRST_EXIT As String = "_T1" - ' Costanti per lavorazioni - Public Const MACH_GROUP As String = "Mach01" + ' Nomi tavole principale, seconda e terza Public Const MAIN_TAB As String = "MainTab" Public Const SECOND_TAB As String = "2ndTab" Public Const THIRD_TAB As String = "3rdTab" + ' Nome tavola ausiliaria per spostamento finale pezzi + Public Const AUX_TAB As String = "AuxTab" + + ' Costanti per lavorazioni + Public Const MACH_GROUP As String = "Mach01" Public Const PHOTO_GRP As String = "Photos" Public Const PHOTO_NAME As String = "Raw" Public Const BASE_MACH_GROUP As String = "Mach_" @@ -55,6 +59,8 @@ Module ConstMach Public Const KEY_KERF As String = "Kerf" ' Nome del contorno del grezzo Public Const NAME_RAW_OUTLINE As String = "RawOutline" + ' Nome della regione del grezzo + Public Const NAME_RAW_REGION As String = "RawRegion" ' Nome della regione del kerf grezzo Public Const NAME_KERF_REGION As String = "KerfRegion" ' Nome della regione fuori kerf nel grezzo @@ -71,11 +77,15 @@ Module ConstMach Public Const NAME_DAMAGED_REG As String = "DmgReg" ' Nome gruppo contorno grezzo da fotografia Public Const NAME_RAW_PHOTO_OUTLINE As String = "RawPhotoOutline" + ' Nome testo per Barcode + Public Const NAME_BARCODE As String = "BarCode" ' Contrassegno di progetto OmagCut Public Const NAME_PROJMARK As String = "OmagCut" ' Info per stato flag taglio ridotto Public Const INFO_REDUCEDCUT = "ReducedCut" + ' Info per tastatura tagli con angolo di fianco + Public Const INFO_SACPROBE As String = "SacProbe" ' Info per lavaggio prima di spostamento pezzi con ventosa Public Const INFO_WASHING As String = "Washing" ' Info per lavorazioni già ordinate @@ -111,7 +121,7 @@ Module ConstMach Public Const NAME_INLOOP As String = "InLoop" ' Nome layer percorsi sul pezzo Public Const NAME_ONPATH As String = "OnPath" - ' Nome layer percorsi di taglio da sotto + ' Nome layer percorsi di taglio da sotto (gocciolatoio) Public Const NAME_DRIPCUT As String = "Drip" ' Nome layer percorsi di foratura da sotto Public Const NAME_UNDERDRILL As String = "UnderDrill" @@ -122,7 +132,7 @@ Module ConstMach Public Const INFO_DEPTH2 As String = "Depth2" ' Info in entità da tagliare per taglio ristretto Public Const INFO_STRICT As String = "Strict" - ' Info in entità da tagliare per angolo di lato + ' Info in entità da tagliare per angolo di lato e tallone Public Const INFO_SIDE_ANGLE As String = "SideAng" Public Const INFO_OFFSET As String = "Offset" Public Const INFO_SIDE_ANGLE2 As String = "SideAng2" @@ -148,6 +158,10 @@ Module ConstMach Public Const INFO_MCH_DUPLED As String = "Dupled" ' Info lavorazione per pausa alla fine Public Const INFO_MCH_PAUSE As String = "Pause" + ' Info allungamento iniziale lavorazione imposto dall'utente + Public Const INFO_MCH_USER_SAL As String = "Usal" + ' Info allungamento finale lavorazione imposto dall'utente + Public Const INFO_MCH_USER_EAL As String = "Ueal" ' Nome contorno taglio Public Const NAME_PV_CUT As String = "CUT" ' Nome contorno pre-taglio @@ -187,8 +201,14 @@ Module ConstMach Public Const NAME_GUIDE As String = "Guide" ' Nome del layer con la superficie della cornice Public Const NAME_SURF As String = "Surf" - ' Info con direzione della cornice (0=lungoX,1=lungoY) + ' Nome del layer con la superficie facet della cornice + Public Const NAME_FACET As String = "Facet" + ' Info con direzione della cornice (0=lungoX,1=lungoY,2=arca,3=guida) Public Const INFO_FRAME_DIR As String = "Dir" + ' Info con raggio della cornice ad arco + Public Const INFO_FRAME_ARCRAD As String = "ArcRad" + ' Info con angolo della cornice ad arco + Public Const INFO_FRAME_ARCANG As String = "ArcAng" ' Nome della lavorazione di sgrossatura cornici Public Const NAME_FRAME_SAWROU As String = "FrameSawRou" ' Nome della lavorazione di finitura cornici @@ -202,6 +222,9 @@ Module ConstMach ' Info in pezzo per facet di ultima superficie selezionata Public Const INFO_FRAME_FACET As String = "Facet" + ' Nome di pezzo per tagli diretti + Public Const NAME_DIRECTCUT As String = "DirectCut" + ' Nome di pezzo temporaneo che serve per copia dime Public Const NAME_COPYTEMPLATE As String = "CopyTemplate" @@ -221,17 +244,17 @@ Module ConstMach Public Function COL_MCH_FREE() As Color3d Return New Color3d(0, 0, 255) End Function - Public Function COL_MCH_DRIPCUT() As Color3d - Return New Color3d(255, 165, 0) - End Function Public Function COL_MCH_ONCUT() As Color3d Return New Color3d(255, 165, 0) End Function Public Function COL_MCH_ONFREE() As Color3d Return New Color3d(192, 128, 0) End Function + Public Function COL_MCH_DRIPCUT() As Color3d + Return New Color3d(255, 0, 165) + End Function Public Function COL_MCH_DRIPFREE() As Color3d - Return New Color3d(192, 128, 0) + Return New Color3d(192, 0, 128) End Function Public Function COL_MCH_INTERF() As Color3d Return New Color3d(255, 0, 0) @@ -246,4 +269,9 @@ Module ConstMach Return New Color3d(224, 64, 64) End Function + ' Colore superficie di cornice + Public Function COL_FRAME() As Color3d + Return New Color3d(128, 192, 96) + End Function + End Module diff --git a/EgtStoneLib/ConstMachIni.vb b/EgtStoneLib/ConstMachIni.vb index d2eeb97..504ccc2 100644 --- a/EgtStoneLib/ConstMachIni.vb +++ b/EgtStoneLib/ConstMachIni.vb @@ -50,9 +50,29 @@ Public Const K_SPEEDOVR As String = "SpeedOvr" Public Const K_POWER As String = "Power" Public Const K_SPINDLE As String = "Spindle" - Public Const K_COOLANT As String = "Coolant" Public Const K_LASER As String = "Laser" + Public Const K_COOLANT As String = "Coolant" + Public Const K_INTERNALCOOLANT As String = "InternalCoolant" + Public Const K_EXTERNCOOLANT As String = "ExternCoolant" + Public Const K_CBAXES As String = "CBAxes" + Public Const K_AIRBLOW As String = "AirBlow" + Public Const K_HOME As String = "Home" + Public Const K_TABLEUP As String = "TableUp" + Public Const K_TABLEDOWN As String = "TableDown" + Public Const K_DOORCLOSED As String = "DoorClosed" + Public Const K_LIMITZ As String = "LimitZ" Public Const K_POWEROVR As String = "PowerOvr" + Public Const K_VACUUMPOSITION As String = "VacuumPosition" + Public Const K_VACUUMROT As String = "VacuumRot" + Public Const K_VACUU3STATE As String = "Vacuum3State" + Public Const K_VACUU4STATE As String = "Vacuum4State" + Public Const K_VACUU135STATE As String = "Vacuum135State" + Public Const K_VACUU246STATE As String = "Vacuum246State" + Public Const K_OPENALLSTATE As String = "OpenAllState" + Public Const K_CLOSEALLSTATE As String = "CoseAllState" + Public Const K_BLOWSTATE As String = "BlowState" + Public Const K_VACUUMSTATE As String = "VacuumState" + Public Const K_BYPASSTATE As String = "BypassState" Public Const S_PRODUCTIONLINE As String = "ProductionLine" Public Const K_ACTIVE As String = "Active" @@ -62,11 +82,22 @@ Public Const K_VARPROG2 As String = "VarProg2" Public Const K_LINEDATADIR As String = "DataDir" Public Const K_VARPROJCOPY As String = "VarProjCopy" + Public Const K_SPECIALUNLOAD As String = "SpecialUnload" + Public Const K_SAVEPRODUCED As String = "SaveProduced" + Public Const K_VARPROGTWINS As String = "VarProgTwins" + Public Const K_PRODLIENABLESAWPROBE As String = "EnableSawProbe" + Public Const K_PRODLIPROBINGSTATEVAR As String = "ProbingStateVar" + Public Const K_PRODLIPROBINGTCPOSVAR As String = "ProbingTcPosVar" + Public Const K_PRODLISAWDIAMETERVAR As String = "SawDiameterVar" + Public Const K_PRODLIPROBINGSTATE2VAR As String = "ProbingState2Var" + Public Const K_PRODLIPROBINGTCPOS2VAR As String = "ProbingTcPos2Var" + Public Const K_PRODLISAWDIAMETER2VAR As String = "SawDiameter2Var" Public Const S_TABLE As String = "Table" Public Const K_ADDITIONALTABLE As String = "AdditionalTable" Public Const K_TAB2_ADDITIONALTABLE As String = "Tab2AdditionalTable" Public Const K_TAB3_ADDITIONALTABLE As String = "Tab3AdditionalTable" + Public Const K_CENTER_RAW_ONX As String = "CenterRawOnX" Public Const S_PHOTO As String = "Photo" Public Const K_PHOTO_OFFSETX As String = "OffsetX" @@ -81,6 +112,7 @@ Public Const K_SHOWTOOLCHANGER As String = "ShowToolChanger" Public Const K_SHOWHEADEXIT As String = "ShowHeadExit" Public Const K_SHOWUSERNOTES As String = "ShowUserNotes" + Public Const K_SHOWSPECIALS As String = "ShowSpecials" Public Const K_DRILLHOLDER As String = "DrillHolder" Public Const K_SAWBLADEHOLDER As String = "SawBladeHolder" Public Const K_MILLHOLDER As String = "MillHolder" @@ -114,15 +146,24 @@ Public Const K_MACH_MILLING_SHORTENING As String = "MillingShortening" Public Const K_MACH_NEST_ALIGNED As String = "Aligned" Public Const K_MACH_WASHING As String = "Washing" + Public Const K_MACH_SACPROBE As String = "SacProbe" Public Const K_MACH_ENABLERESTART As String = "EnableRestart" Public Const K_MACH_ENABLEPAUSE As String = "EnablePause" Public Const K_MACH_CUTFSEVENABLE As String = "CutFsevEnable" Public Const K_MACH_CUTFSEVLEN As String = "CutFsevLen" Public Const K_MACH_CUTFSEVPERC As String = "CutFsevPerc" + ' DrillMillC90 + ' CutLongDxSx + ' AngRotMultiCut + ' MinDistHeadsMultiCut + ' MinSawRbHeight Public Const S_MACH_RAWMOVE As String = "RawMove" Public Const K_MACH_RM_ROTATE As String = "Rotate" + Public Const S_MACH_REG As String = "Reg" + Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng" + Public Const S_TOOLCHANGER As String = "ToolChanger" Public Const K_NUMBER As String = "Number" Public Const K_POS As String = "Pos" @@ -135,6 +176,8 @@ Public Const K_FINALHOME As String = "FinalHome" Public Const S_MACHBUTTONS As String = "MachButtons" + Public Const S_CONTROLMACHBUTTONS As String = "ControlMachButtons" + Public Const S_VACUUMMACHBUTTONS As String = "VacuumMachButtons" Public Const K_BUTTON As String = "Button" Public Const S_MACH_INPROGRESS As String = "InProgress" @@ -146,6 +189,9 @@ Public Const K_RAWTHICKNESS As String = "RawThickness" Public Const K_ENABLERAWPROBE As String = "EnableRawProbe" + Public Const S_MACH_BARCODEREADER As String = "BarcodeReader" + Public Const K_ENABLEBCR As String = "EnableBCR" + Public Const S_MACH_ESTIMATIONS As String = "Estimations" Public Const K_ENABLEEST As String = "Enable" diff --git a/EgtStoneLib/CurrentMachine.vb b/EgtStoneLib/CurrentMachine.vb index 4e12ae6..a49a1bd 100644 --- a/EgtStoneLib/CurrentMachine.vb +++ b/EgtStoneLib/CurrentMachine.vb @@ -58,8 +58,11 @@ Public Module CurrentMachine Private m_bInternalCuts As Boolean = False Private m_dShortCut As Double = 0 - ' Abilitazione lavaggio lastra - Private m_bWashing As Boolean + ' Abilitazione tastatura tagli inclinati (-1=non visibile, 0=disabilitato, 1=abilitato) + Private m_nSacProbe As Integer = -1 + + ' Abilitazione lavaggio lastra (-1=non visibile, 0=disabilitato, 1=abilitato) + Private m_nWashing As Integer = -1 ' Massimo diametro lama per utilizzo ventose movimento pezzi Private m_dMaxSawDiamForVac As Double = 630 @@ -430,13 +433,24 @@ Public Module CurrentMachine End Set End Property - Public Property bWashing As Boolean + Public Property nSacProbe As Integer Get - Return m_bWashing + Return m_nSacProbe End Get - Set(value As Boolean) - If WritePrivateProfileString(S_MACH_NEST, K_MACH_WASHING, If(value, "1", "0"), sMachIniFile) Then - m_bWashing = value + Set(value As Integer) + If WritePrivateProfileString(S_MACH_NEST, K_MACH_SACPROBE, value.ToString(), sMachIniFile) Then + m_nSacProbe = value + End If + End Set + End Property + + Public Property nWashing As Integer + Get + Return m_nWashing + End Get + Set(value As Integer) + If WritePrivateProfileString(S_MACH_NEST, K_MACH_WASHING, value.ToString(), sMachIniFile) Then + m_nWashing = value End If End Set End Property @@ -998,8 +1012,10 @@ Public Module CurrentMachine m_bInternalCuts = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, sMachIniFile) <> 0) ' Leggo accorciamento fresate negli angoli m_dShortCut = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, sMachIniFile) + ' Leggo flag tastatura tagli inclinati + m_nSacProbe = GetPrivateProfileInt(S_MACH_NEST, K_MACH_SACPROBE, -1, sMachIniFile) ' Leggo abilitazione lavaggio lastra - m_bWashing = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WASHING, 1, sMachIniFile) <> 0) + m_nWashing = GetPrivateProfileInt(S_MACH_NEST, K_MACH_WASHING, -1, sMachIniFile) ' Leggo configurazione degli utensili in macchina m_MountedToolConfig = DirectCast(GetPrivateProfileInt(S_TOOLS, K_MOUNTEDTOOLCONFIG, 0, sMachIniFile), MountedToolConfigs) ' Leggo flag presenza tipologie utensili diff --git a/EgtStoneLib/EstCalc.vb b/EgtStoneLib/EstCalc.vb index 294ae10..5ee0a2f 100644 --- a/EgtStoneLib/EstCalc.vb +++ b/EgtStoneLib/EstCalc.vb @@ -244,12 +244,35 @@ Module EstCalc End Function Public Function UpdateWashingFlag() As Boolean - Dim bCurrWash As Boolean = CurrentMachine.bWashing + Dim bCurrWash As Boolean = ( CurrentMachine.nWashing <> 0) Dim bProjWash As Boolean = GetWashingFlag() If bCurrWash <> bProjWash Then Return SetWashingFlag(bCurrWash) Return True End Function + Public Function SetSideAngCutProbeFlag(bSacProbe As Boolean) As Boolean + Dim nMGrpId As Integer = EgtGetCurrMachGroup() + If bSacProbe Then + Return EgtSetInfo(nMGrpId, INFO_SACPROBE, True) + Else + Return EgtRemoveInfo(nMGrpId, INFO_SACPROBE) + End If + End Function + + Public Function GetSideAngCutProbeFlag() As Boolean + Dim nMGrpId As Integer = EgtGetCurrMachGroup() + Dim bFlag As Boolean = False + EgtGetInfo(nMGrpId, INFO_SACPROBE, bFlag) + Return bFlag + End Function + + Public Function UpdateSideAngCutProbeFlag() As Boolean + Dim bCurrSacProbe As Boolean = ( CurrentMachine.nSacProbe > 0) + Dim bProjSacProbe As Boolean = GetSideAngCutProbeFlag() + If bCurrSacProbe <> bProjSacProbe Then Return SetSideAngCutProbeFlag(bCurrSacProbe) + Return True + End Function + Public Function SetReducedCut(bReduced As Boolean) As Boolean Dim nMGrpId As Integer = EgtGetCurrMachGroup() Return EgtSetInfo(nMGrpId, INFO_REDUCEDCUT, bReduced) diff --git a/EgtStoneLib/EstProject.vb b/EgtStoneLib/EstProject.vb index f5ab422..00c10a9 100644 --- a/EgtStoneLib/EstProject.vb +++ b/EgtStoneLib/EstProject.vb @@ -41,15 +41,4 @@ Module EstProject Return True End Function - Public Sub AdjustFlatParts() - ' Ciclo sui pezzi - Dim nPartId As Integer = EgtGetFirstPart() - While nPartId <> GDB_ID.NULL - ' Sistemo il pezzo - AdjustFlatPart(nPartId) - ' Passo al pezzo successivo - nPartId = EgtGetNextPart(nPartId) - End While - End Sub - End Module diff --git a/EgtStoneLib/VacuumCups.vb b/EgtStoneLib/VacuumCups.vb index 00ad2bc..87ba68e 100644 --- a/EgtStoneLib/VacuumCups.vb +++ b/EgtStoneLib/VacuumCups.vb @@ -147,7 +147,7 @@ Module VacuumCups ' se non sono riuscito a crearla, allora è nulla e posso uscire If nRKerfId = GDB_ID.NULL Then Return False EgtSetName(nRKerfId, NAME_KERF_REGION) - EgtSetStatus(nRKerfId, GDB_ST.OFF) + EgtSetMode(nRKerfId, GDB_MD.HIDDEN) End If ' Box e baricentro della regione di kerf Dim b3Kerf As New BBox3d @@ -368,6 +368,13 @@ Module VacuumCups Dim vAngRot As New List(Of Double) ' Se asse rotante ventosa a step If GetVacRotAxisSteps(vAngRot) Then + ' Ordino secondo distanza angolare crescente da direzione di allineamento (modulo 180 deg) + Dim dRotRefDeg As Double = dRotAngDeg + vAngRot.Sort(Function(P, Q) + Dim dDiffP = Math.Abs(( P - dRotRefDeg) Mod 180) + Dim dDiffQ = Math.Abs(( Q - dRotRefDeg) Mod 180) + Return ( dDiffP - dDiffQ) + End Function) ' Annullo la rotazione di allineamento dRotAngDeg = 0 ' altrimenti in continuo diff --git a/MachOptionWindow/MachOptionWindowV.xaml b/MachOptionWindow/MachOptionWindowV.xaml index 3299651..3cb1f23 100644 --- a/MachOptionWindow/MachOptionWindowV.xaml +++ b/MachOptionWindow/MachOptionWindowV.xaml @@ -8,7 +8,7 @@ ShowInTaskbar="False" Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStartupLocation="CenterOwner" - MinWidth="270" MinHeight="250" + MinWidth="270" MinHeight="275" ResizeMode="NoResize"> @@ -23,6 +23,7 @@ + @@ -184,17 +185,22 @@ - - + + - - - - + + + - + + + + + + + + + + diff --git a/MachOptionWindow/MachOptionWindowVM.vb b/MachOptionWindow/MachOptionWindowVM.vb index 9971d1f..6e40bf0 100644 --- a/MachOptionWindow/MachOptionWindowVM.vb +++ b/MachOptionWindow/MachOptionWindowVM.vb @@ -230,12 +230,34 @@ Public Class MachOptionWindowVM End Set End Property + Public ReadOnly Property SacProbeVisibility As Visibility + Get + Return If( CurrentMachine.nSacProbe >= 0, Visibility.Visible, Visibility.Hidden) + End Get + End Property + + Public Property SacProbe As Boolean + Get + Return EstCalc.GetSideAngCutProbeFlag() + End Get + Set(value As Boolean) + CurrentMachine.nSacProbe = If( value, 1, 0) + EstCalc.SetSideAngCutProbeFlag(value) + End Set + End Property + + Public ReadOnly Property WashingVisibility As Visibility + Get + Return Visibility.Visible + End Get + End Property + Public Property Washing As Boolean Get Return EstCalc.GetWashingFlag() End Get Set(value As Boolean) - CurrentMachine.bWashing = value + CurrentMachine.nWashing = If( value, 1, 0) EstCalc.SetWashingFlag(value) End Set End Property @@ -419,6 +441,11 @@ Public Class MachOptionWindowVM Return EgtMsg(MSG_ALARMSPAGEUC + 36) End Get End Property + Public ReadOnly Property SacProbeMsg As String + Get + Return EgtMsg(MSG_ALARMSPAGEUC + 50) + End Get + End Property Public ReadOnly Property WashingMsg As String Get Return EgtMsg(MSG_ALARMSPAGEUC + 41) diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 87348b9..383ff79 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -69,5 +69,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/MyMachGroupPanel/MyMachGroupPanelVM.vb b/MyMachGroupPanel/MyMachGroupPanelVM.vb index fc7891c..97ddc62 100644 --- a/MyMachGroupPanel/MyMachGroupPanelVM.vb +++ b/MyMachGroupPanel/MyMachGroupPanelVM.vb @@ -97,8 +97,10 @@ Public Class MyMachGroupPanelVM EstCalc.SetMaterialName() ' Imposto flag tagli ridotti EstCalc.SetReducedCut(CurrentMachine.bReducedCut) + ' Imposto flag tastatura su tagli inclinati + EstCalc.SetSideAngCutProbeFlag( CurrentMachine.nSacProbe > 0) ' Imposto flag lavaggio - EstCalc.SetWashingFlag(CurrentMachine.bWashing) + EstCalc.SetWashingFlag(CurrentMachine.nWashing <> 0) Return True End Function @@ -124,8 +126,10 @@ Public Class MyMachGroupPanelVM CurrentMachine.SetCurrMatByName(EstCalc.GetMaterialName()) ' Aggiorno flag tagli ridotti CurrentMachine.bReducedCut = EstCalc.GetReducedCut() + ' Aggiorno stato flag tastatura tagli inclinati + if CurrentMachine.nSacProbe >= 0 Then CurrentMachine.nSacProbe = If( EstCalc.GetSideAngCutProbeFlag(), 1, 0) ' Aggiorno flag lavaggio - CurrentMachine.bWashing = EstCalc.GetWashingFlag() + if CurrentMachine.nWashing >= 0 Then CurrentMachine.nWashing = If( EstCalc.GetWashingFlag(), 1, 0) ' Verifico compatibilità lavorazioni, setup, materiale e spessore grezzo If Not SetUpUtility.IsValidToolHeadExitInSetUp() Then OmagOFFICEMap.refMachinePanelVM.SetUp_Background = Brushes.Red diff --git a/MySceneHost/MySceneHostVM.vb b/MySceneHost/MySceneHostVM.vb index 30a3106..7aebe45 100644 --- a/MySceneHost/MySceneHostVM.vb +++ b/MySceneHost/MySceneHostVM.vb @@ -277,6 +277,9 @@ Public Class MySceneHostVM Dim nReducedCut As Integer = 1 EgtGetInfo(nMchGrpId, INFO_REDUCEDCUT, nReducedCut) EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut) + Dim nSacProbe As Integer = 0 + EgtGetInfo(nMchGrpId, INFO_SACPROBE, nSacProbe) + EgtSetInfo(nMarkId, INFO_SACPROBE, nSacProbe) Dim nWash As Integer = 1 EgtGetInfo(nMchGrpId, INFO_WASHING, nWash) EgtSetInfo(nMarkId, INFO_WASHING, nWash) diff --git a/SideEntityControl/SideEntityControlVM.vb b/SideEntityControl/SideEntityControlVM.vb index 5562de5..712e62a 100644 --- a/SideEntityControl/SideEntityControlVM.vb +++ b/SideEntityControl/SideEntityControlVM.vb @@ -942,6 +942,49 @@ Public Class SideEntityControlVM Return True End Function + Shared Sub ColorToSideAngle(nCtx As Integer) + ' Leggo dati corrispondenza colore-angolo + Dim CurrCSA As New ColorSideAngs + CurrCSA.Read( IniFile.m_sIniFile) + ' Imposto contesto corrente + EgtSetCurrentContext(nCtx) + ' Ciclo sui pezzi + Dim PartId As Integer = EgtGetFirstPart() + While PartId <> GDB_ID.NULL + ' Ciclo sui layer di contorno + Dim bOutLoop As Boolean = True + Dim LoopId As Integer = EgtGetFirstNameInGroup(PartId, NAME_OUTLOOP) + While LoopId <> GDB_ID.NULL + ' Ciclo sulle curve + Dim EntId As Integer = EgtGetFirstInGroup( LoopId) + While EntId <> GDB_ID.NULL + If EgtGetType(EntId) = GDB_TY.CRV_LINE Then + Dim colEnt As Color3d + If EgtGetColor( EntId, colEnt) Then + Dim dAng As Double + Dim dHeel As Double + If CurrCSA.GetSideAngHeel( colEnt, dAng, dHeel) Then + EgtSetInfo( EntId, INFO_SIDE_ANGLE, dAng) + EgtSetInfo( EntId, INFO_ORIG_SIDE_ANGLE, dAng) + EgtSetInfo( EntId, INFO_HEEL, dHeel) + End If + End If + End If + EntId = EgtGetNext( EntId) + End While + If bOutLoop then + bOutLoop = False + LoopId = EgtGetFirstNameInGroup(PartId, NAME_INLOOP) + Else + LoopId = EgtGetNextName(LoopId, NAME_INLOOP) + End If + End While + PartId = EgtGetNextPart(PartId) + End While + ' Aggiorno scritte per angoli sui lati + WriteSideAngleForNest(nCtx) + End Sub + #End Region ' METHODS End Class @@ -1199,4 +1242,60 @@ Friend Class DripEntity Return Nothing End Function -End Class \ No newline at end of file +End Class + +Friend Class ColorSideAngs + Class CTSA + Friend m_R As Integer + Friend m_G As Integer + Friend m_B As Integer + Friend m_dAng As Double + Friend m_dHeel As Double + End Class + Private m_ListCtsa As New List(Of CTSA) + Private m_nTol As Integer = 10 + + Friend Function Read( sIniFile As String) As Boolean + ' Lettura parametri di conversione + Dim nIndex As Integer = 1 + Dim OneCtsa As CTSA = GetPrivateProfileColorSideAng( S_COLORTOSIDEANG, K_CTSA & nIndex, sIniFile) + While Not IsNothing(OneCtsa) + m_ListCtsa.Add(OneCtsa) + nIndex += 1 + OneCtsa = GetPrivateProfileColorSideAng( S_COLORTOSIDEANG, K_CTSA & nIndex, sIniFile) + End While + ' Lettura tolleranza + m_nTol = GetPrivateProfileInt( S_COLORTOSIDEANG, K_CTSA_TOLERANCE, 10, sIniFile) + Return True + End Function + + Private Function GetPrivateProfileColorSideAng( sSect As String, sKey As String, sIniFile As String) As CTSA + Dim OneCtsa As New CTSA + Dim sVal As String = String.Empty + GetPrivateProfileString(sSect, sKey, "", sVal, sIniFile) + Dim sItems() As String = sVal.Split(",".ToCharArray) + If sItems.Count() = 5 Then + StringToInt( sItems(0), OneCtsa.m_R) + StringToInt( sItems(1), OneCtsa.m_G) + StringToInt( sItems(2), OneCtsa.m_B) + StringToDouble( sItems(3), OneCtsa.m_dAng) + StringToDouble( sItems(4), OneCtsa.m_dHeel) + Return OneCtsa + End If + Return Nothing + End Function + + Friend Function GetSideAngHeel( cCol As Color3d, ByRef dAng As Double, ByRef dHeel As Double) As Boolean + For Each Ctsa In m_ListCtsa + If Math.Abs( cCol.R - Ctsa.m_R) < m_nTol And + Math.Abs( cCol.G - Ctsa.m_G) < m_nTol And + Math.Abs( cCol.B - Ctsa.m_B) < m_nTol Then + dAng = Ctsa.m_dAng + dHeel = Ctsa.m_dHeel + Return True + End If + Next + Return False + End Function + +End Class