From 32d9f4fd7a2bf5f5bc9fce8497e1dbddf4797f6e Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Tue, 13 Nov 2018 17:40:30 +0000 Subject: [PATCH] =?UTF-8?q?OmagOFFICE=201.9k1=20:=20-=20aggiunta=20gestion?= =?UTF-8?q?e=20angoli=20di=20fianco=20con=20tallone=20(bisello)=20-=20ora?= =?UTF-8?q?=20angolo=20verso=20esterno=20mantiene=20dimensione=20totale=20?= =?UTF-8?q?del=20pezzo=20-=20gestione=20ventose=20con=20asse=20rotante=20a?= =?UTF-8?q?=20step=20(STEPS=3DVal1,Val2,...=20in=20GEO=20di=20asse)=20-=20?= =?UTF-8?q?aggiunta=20gestione=20accorciamento=20fresate=20negli=20angoli?= =?UTF-8?q?=20-=20sistemazione=20dati=20TRF=20da=20compo=20e=20aggiunta=20?= =?UTF-8?q?codice=20pezzo=20-=20in=20DB=20utensili=20con=20nuova=20lama=20?= =?UTF-8?q?creazione/aggiornamento=20note=20speciali=20Hofmann=20-=20abili?= =?UTF-8?q?tazione=20bottoni=20UnderCut=20e=20DripDrill=20sempre=20da=20ch?= =?UTF-8?q?iave=20-=20aggiunto=20secondo=20offset=20nei=20tagli=20da=20sot?= =?UTF-8?q?to=20-=20modifiche=20a=20componenti=20per=20import=20DXF=20e=20?= =?UTF-8?q?nome=20su=20linea=20separata=20-=20dati=20TRF=20non=20pi=C3=B9?= =?UTF-8?q?=20richiesti=20per=20default=20sui=20componenti?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CompoTrfDataWindow/CompoTrfDataWindowV.xaml | 4 + CompoTrfDataWindow/CompoTrfDataWindowVM.vb | 22 +- CompoWindow/CompoListPage/CompoListPageV.xaml | 2 +- CompoWindow/CompoListPage/CompoListPageVM.vb | 2 + CompoWindow/CompoManager/CompoManagerVM.vb | 77 ++ CompoWindow/CompoWindowVM.vb | 100 +- Constants/ConstIni.vb | 1 + DxfImportWindow/DxfImportWindowV.xaml | 2 +- DxfImportWindow/DxfImportWindowVM.vb | 35 +- EgtStoneLib/CamAuto.vb | 4 +- EgtStoneLib/ConstMach.vb | 5 + EgtStoneLib/ConstMachIni.vb | 2 + EgtStoneLib/CurrentMachine.vb | 21 + EgtStoneLib/EstCalc.vb | 65 ++ EgtStoneLib/VacuumCups.vb | 32 +- MachOptionWindow/MachOptionWindowV.xaml | 10 +- MachOptionWindow/MachOptionWindowVM.vb | 17 + My Project/AssemblyInfo.vb | 4 +- MyToolDbWindow/MyToolDbWindowV.xaml | 920 ++++++++++++++++++ MyToolDbWindow/MyToolDbWindowV.xaml.vb | 3 + MyToolDbWindow/MyToolDbWindowVM.vb | 160 +++ OmagOFFICE.vbproj | 10 +- SideEntityControl/SideEntityControlV.xaml | 26 +- SideEntityControl/SideEntityControlVM.vb | 196 +++- 24 files changed, 1633 insertions(+), 87 deletions(-) create mode 100644 MyToolDbWindow/MyToolDbWindowV.xaml create mode 100644 MyToolDbWindow/MyToolDbWindowV.xaml.vb create mode 100644 MyToolDbWindow/MyToolDbWindowVM.vb diff --git a/CompoTrfDataWindow/CompoTrfDataWindowV.xaml b/CompoTrfDataWindow/CompoTrfDataWindowV.xaml index 91f1590..044254c 100644 --- a/CompoTrfDataWindow/CompoTrfDataWindowV.xaml +++ b/CompoTrfDataWindow/CompoTrfDataWindowV.xaml @@ -23,6 +23,10 @@ Style="{StaticResource OptionTextBlock}"/> + + + diff --git a/CompoTrfDataWindow/CompoTrfDataWindowVM.vb b/CompoTrfDataWindow/CompoTrfDataWindowVM.vb index 56b888f..9f1a833 100644 --- a/CompoTrfDataWindow/CompoTrfDataWindowVM.vb +++ b/CompoTrfDataWindow/CompoTrfDataWindowVM.vb @@ -24,6 +24,16 @@ Public Class CompoTrfDataWindowVM End Set End Property + Private m_PartCode As String + Public Property PartCode As String + Get + Return m_PartCode + End Get + Set(value As String) + m_PartCode = value + End Set + End Property + Private m_MatCode As String Public Property MatCode As String Get @@ -74,6 +84,12 @@ Public Class CompoTrfDataWindowVM End Get End Property + Public ReadOnly Property PartCodeMsg As String + Get + Return EgtMsg(MSG_DRAWPAGEUC + 16) + End Get + End Property + Public ReadOnly Property MatCodeMsg As String Get Return EgtMsg(MSG_DRAWPAGEUC + 12) @@ -106,17 +122,19 @@ Public Class CompoTrfDataWindowVM #Region "METHODS" - Friend Sub SetData(sOrdCode As String, sOrdDesc As String, sMatCode As String, sSurfCode As String, dTh As Double) + Friend Sub SetData(sOrdCode As String, sOrdDesc As String, sPartCode As String, sMatCode As String, sSurfCode As String, dTh As Double) OrdCode = sOrdCode OrdDesc = sOrdDesc + PartCode = sPartCode MatCode = sMatCode SurfCode = sSurfCode Thickness = LenToString(dTh, 2) End Sub - Friend Sub GetData(ByRef sOrdCode As String, ByRef sOrdDesc As String, ByRef sMatCode As String, ByRef sSurfCode As String, ByRef dTh As Double) + Friend Sub GetData(ByRef sOrdCode As String, ByRef sOrdDesc As String, sPartCode As String, ByRef sMatCode As String, ByRef sSurfCode As String, ByRef dTh As Double) sOrdCode = OrdCode sOrdDesc = OrdDesc + sPartCode = PartCode sMatCode = MatCode sSurfCode = SurfCode StringToLen(Thickness, dTh) diff --git a/CompoWindow/CompoListPage/CompoListPageV.xaml b/CompoWindow/CompoListPage/CompoListPageV.xaml index 4161803..23e3e55 100644 --- a/CompoWindow/CompoListPage/CompoListPageV.xaml +++ b/CompoWindow/CompoListPage/CompoListPageV.xaml @@ -16,7 +16,7 @@ IsChecked="{Binding Drip_IsChecked}" Style="{StaticResource CompoWindow_ToggleButton}" Margin="2.5,0,0,0" - IsEnabled="True"/> + IsEnabled="{Binding Drip_IsEnabled}"/> 0) + (GetMainPrivateProfileInt(S_COMPO, K_TRFDATA, 0) <> 0) End Sub #End Region ' CONSTRUCTOR @@ -190,8 +190,75 @@ Public Class CompoWindowVM End While ' Calcolo dimensione ingombro Pezzo tramite OutLoop Dim nOutLoopLayer = EgtGetFirstNameInGroup(Pz, NAME_OUTLOOP) - Dim ptMin, ptMax As Point3d - EgtGetBBoxGlob(nOutLoopLayer, GDB_BB.STANDARD, ptMin, ptMax) + Dim b3Part As New BBox3d + EgtGetBBoxGlob(nOutLoopLayer, GDB_BB.STANDARD, b3Part) + ' Muovo la regione in Z per evitare problemi in visualizzazione + EgtMove(nRegLayId, New Vector3d(0, 0, DELTAZ_REG), GDB_RT.GLOB) + ' Se pezzo con dati normali + If Not m_bTrfData Then + ' Se definito nome lo inserisco nel testo + If Not String.IsNullOrWhiteSpace(sName) Then + Dim nTextId = EgtGetFirstInGroup(nRegLayId) + While nTextId <> GDB_ID.NULL + If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then + Dim sText As String = String.Empty + EgtTextGetContent(nTextId, sText) + Dim sNewText = sName & "
" & sText + EgtModifyText(nTextId, sNewText) + Exit While + End If + nTextId = EgtGetNext(nTextId) + End While + End If + ' altrimenti se pezzo con dati TRF + Else + ' Nome da dati Trf + Dim nTextId = EgtGetFirstInGroup(nRegLayId) + While nTextId <> GDB_ID.NULL + If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then + Dim sText As String = CompoWindowMap.refCompoManagerVM.bTrfOrderCode & "-" & CompoWindowMap.refCompoManagerVM.bTrfOrderDesc + Dim sText2 As String = CompoWindowMap.refCompoManagerVM.bTrfMatCode & "-" & CompoWindowMap.refCompoManagerVM.bTrfSurfCode + Dim sText3 As String = LenToString(b3Part.DimX(), 0) & " x " & LenToString(b3Part.DimY(), 0) & " x " & LenToString(CompoWindowMap.refCompoManagerVM.bTrfThickness, 0) + Dim dRatio As Double = Math.Max(b3Part.DimX(), b3Part.DimY()) / Math.Min(b3Part.DimX(), b3Part.DimY()) + If dRatio < 5 Then + sText = sText & "
" & sText2 & "
" & sText3 + Else + sText = sText & " " & sText2 & " " & sText3 + End If + EgtModifyText(nTextId, sText) + Dim ptCen As Point3d + EgtCenterPoint(nTextId, ptCen) + Dim b3Text As New BBox3d + EgtGetBBoxGlob(nTextId, GDB_BB.STANDARD, b3Text) + Dim dCoeff As Double = Math.Min(b3Part.DimX() / b3Text.DimX(), b3Part.DimY() / b3Text.DimY()) / 1.25 + If dCoeff < 1 Then + EgtScale(nTextId, New Frame3d(ptCen), dCoeff, dCoeff, dCoeff) + End If + Exit While + End If + nTextId = EgtGetNext(nTextId) + End While + ' Info di pezzo da dati Trf + EgtSetInfo(Pz, "OC", CompoWindowMap.refCompoManagerVM.bTrfOrderCode) + EgtSetInfo(Pz, "OD", CompoWindowMap.refCompoManagerVM.bTrfOrderDesc) + EgtSetInfo(Pz, "PC", CompoWindowMap.refCompoManagerVM.bTrfPartCode) + EgtSetInfo(Pz, "MT", CompoWindowMap.refCompoManagerVM.bTrfMatCode) + EgtSetInfo(Pz, "SRF", CompoWindowMap.refCompoManagerVM.bTrfSurfCode) + EgtSetInfo(Pz, "L", DoubleToString(b3Part.DimX(), 1)) + EgtSetInfo(Pz, "W", DoubleToString(b3Part.DimY(), 1)) + EgtSetInfo(Pz, "T", CompoWindowMap.refCompoManagerVM.bTrfThickness) + EgtSetInfo(Pz, "V1", DoubleToString(b3Part.DimX(), 1)) + EgtSetInfo(Pz, "V2", DoubleToString(b3Part.DimY(), 1)) + End If + ' Eventuale testo per indicare il sopra (solo nel caso di rettangolo) + If CompoWindowMap.refCompoManagerVM.Top_Visibility = Visibility.Visible And + CompoWindowMap.refCompoManagerVM.TopIsChecked Then + Dim dDimX As Double = b3Part.DimX() + Dim dDimY As Double = b3Part.DimY() + Dim dH As Double = Math.Min(0.1 * dDimY, 30) + Dim nText As Integer = EgtCreateTextAdv(nRegLayId, New Point3d(dDimX / 2, dDimY - 0.6 * dH, 0), 0, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC) + EgtSetColor(nText, New Color3d()) + End If ' Scrivo testi per nesting SideEntityControlVM.WriteSideAngleForNest(CompoWindowMap.refCompoSceneHostV.CompoScene.GetCtx()) ' Esporto il pezzo in un file temporaneo @@ -212,33 +279,10 @@ Public Class CompoWindowVM EgtInsertFile(sTmpFile) ' Ne recupero l'Id Dim nId2 As Integer = EgtGetLastPart() - ' Muovo la regione in Z per evitare problemi in visualizzazione - Dim nRegId = EgtGetFirstNameInGroup(nId2, NAME_REGION) - EgtMove(nRegId, New Vector3d(0, 0, DELTAZ_REG), GDB_RT.GLOB) - ' Se definito nome lo inserisco nel testo - If Not String.IsNullOrWhiteSpace(sName) Then - Dim nTextId = EgtGetFirstInGroup(nRegId) - While nTextId <> GDB_ID.NULL - If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then - Dim sText As String = String.Empty - EgtTextGetContent(nTextId, sText) - Dim sNewText = sName & " " & sText - EgtModifyText(nTextId, sNewText) - Exit While - End If - nTextId = EgtGetNext(nTextId) - End While - End If - ' Eventuale testo per indicare il sopra (solo nel caso di rettangolo) - If CompoWindowMap.refCompoManagerVM.TopIsChecked Then - Dim dDimX As Double = ptMax.x - ptMin.x - Dim dDimY As Double = ptMax.y - ptMin.y - Dim dH As Double = Math.Min(0.1 * dDimY, 30) - Dim nText As Integer = EgtCreateTextAdv(nRegId, New Point3d(dDimX / 2, dDimY - 0.6 * dH, 0), 0, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC) - EgtSetColor(nText, New Color3d()) - End If ' Aggiusto per lavorazioni AdjustFlatPart(nId2) + ' Se dati Trf assegno nome univoco + If m_bTrfData Then EgtSetInfo(nId2, "CsvPart", CompoWindowMap.refCompoManagerVM.bTrfOrderCode & "-" & nId2.ToString()) ' Inserisco in parcheggio EstCalc.StoreOnePart(nId2, True) ' Aggiungo riferimento e lo inserisco in VeinMatching diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 87f7886..8b7c2d7 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -90,6 +90,7 @@ Module ConstIni Public Const K_MAXSIDEANGLE As String = "MaxSideAngle" Public Const K_SIDEANGLE As String = "SideAngle" Public Const K_DRIPOFFSET As String = "DripOffset" + Public Const K_DRIPOFFSET2 As String = "DripOffset2" Public Const K_DRIPDEPTH As String = "DripDepth" Public Const K_DRIPSHORT As String = "DripShort" Public Const K_UNDERDRILLDEPTH As String = "UnderDrillDepth" diff --git a/DxfImportWindow/DxfImportWindowV.xaml b/DxfImportWindow/DxfImportWindowV.xaml index caaf52f..1e31c63 100644 --- a/DxfImportWindow/DxfImportWindowV.xaml +++ b/DxfImportWindow/DxfImportWindowV.xaml @@ -73,7 +73,7 @@ + IsEnabled="{Binding Drip_IsEnabled}"/> GDB_ID.NULL Dim nPrevOpeId As Integer = EgtGetPrevOperation(nOpeId) - If EgtGetOperationType(nOpeId) = MCH_OY.DISP Then + If EgtGetOperationType(nOpeId) = MCH_OY.DISP AndAlso EgtIsOperationEmpty(nOpeId) Then EgtRemoveLastPhase() Else Exit While @@ -548,6 +548,7 @@ Friend Module CamAuto Dim bOneHoleIntCorner As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, 0, CurrentMachine.sMachIniFile) <> 0) Dim bMillingOnCorners As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, 1, CurrentMachine.sMachIniFile) <> 0) Dim bMillingOnSinks As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, CurrentMachine.sMachIniFile) <> 0) + Dim dMillingShort As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, CurrentMachine.sMachIniFile) dCornerSafety = Math.Max(dCornerSafety, 10 * EPS_SMALL) EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch) EgtLuaSetGlobStringVar("CAM.MILLMCH", sMillMch) @@ -561,6 +562,7 @@ Friend Module CamAuto EgtLuaSetGlobNumVar("CAM.CORNERSAFETY", dCornerSafety) EgtLuaSetGlobBoolVar("CAM.MILLINGONCORNERS", bMillingOnCorners) EgtLuaSetGlobBoolVar("CAM.MILLINGONSINKS", bMillingOnSinks) + EgtLuaSetGlobNumVar("CAM.MILLINGSHORT", dMillingShort) EgtLuaSetGlobNumVar("CAM.RAWHEIGHT", GetRawHeight()) EgtLuaSetGlobNumVar("CAM.REGROT", 0.0) Return True diff --git a/EgtStoneLib/ConstMach.vb b/EgtStoneLib/ConstMach.vb index 3d21dc6..768ff5a 100644 --- a/EgtStoneLib/ConstMach.vb +++ b/EgtStoneLib/ConstMach.vb @@ -29,6 +29,8 @@ Module ConstMach Public Const KEY_VAC_TYPE As String = "VacType" ' Nome gruppo layout in testa con ventose Public Const VACUUM_HEAD_LAYOUT As String = "LAYOUT" + ' Info in asse rotante ventosa per step discreti + Public Const KEY_ROTVAC_STEPS As String = "STEPS" ' Nome oggetto frame prima uscita di una testa Public Const HEAD_FIRST_EXIT As String = "_T1" @@ -117,6 +119,7 @@ Module ConstMach Public Const NAME_PREVIEW As String = "PV" ' Info in entità da tagliare per affondamento Public Const INFO_DEPTH As String = "Depth" + 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 @@ -124,6 +127,8 @@ Module ConstMach Public Const INFO_OFFSET As String = "Offset" Public Const INFO_SIDE_ANGLE2 As String = "SideAng2" Public Const INFO_OFFSET2 As String = "Offset2" + Public Const INFO_HEEL As String = "Heel" + Public Const INFO_ORIG_SIDE_ANGLE As String = "OrigSideAng" ' Info in entità da tagliare per gocciolatoio Public Const INFO_HAVE_DRIP As String = "HaveDrip" ' Info in entità da tagliare per direzione che varia a seconda del tipo (una via o zigzag) diff --git a/EgtStoneLib/ConstMachIni.vb b/EgtStoneLib/ConstMachIni.vb index c056f04..b456996 100644 --- a/EgtStoneLib/ConstMachIni.vb +++ b/EgtStoneLib/ConstMachIni.vb @@ -78,6 +78,7 @@ Public Const K_MILL As String = "Mill" Public Const K_SHOWTOOLCHANGER As String = "ShowToolChanger" Public Const K_SHOWHEADEXIT As String = "ShowHeadExit" + Public Const K_SHOWUSERNOTES As String = "ShowUserNotes" Public Const K_DRILLHOLDER As String = "DrillHolder" Public Const K_SAWBLADEHOLDER As String = "SawBladeHolder" Public Const K_MILLHOLDER As String = "MillHolder" @@ -108,6 +109,7 @@ Public Const K_MACH_INTARCMAXSIDEANG As String = "IntArcMaxSideAng" Public Const K_MACH_MILLING_ON_CORNERS As String = "MillingOnCorners" Public Const K_MACH_MILLING_ON_SINKS As String = "MillingOnSinks" + 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" diff --git a/EgtStoneLib/CurrentMachine.vb b/EgtStoneLib/CurrentMachine.vb index c7797ef..2ba2844 100644 --- a/EgtStoneLib/CurrentMachine.vb +++ b/EgtStoneLib/CurrentMachine.vb @@ -56,6 +56,7 @@ Public Module CurrentMachine ' Dati per fresatura Private m_bCornerCuts As Boolean = False Private m_bInternalCuts As Boolean = False + Private m_dShortCut As Double = 0 ' Abilitazione lavaggio lastra Private m_bWashing As Boolean @@ -76,6 +77,7 @@ Public Module CurrentMachine ' Flag per visualizzazione TcPos e Testa/uscita Private m_bShowToolChanger As Boolean = False Private m_bShowHeadExit As Boolean = False + Private m_nShowUserNotes As Integer = 0 ' 0=no, 1=tutti utensili, 2=solo lame ' Flag che indicano presenza tipologia lavorazioni (attivo/non attivo) Private m_bSawing As Boolean = False @@ -399,6 +401,16 @@ Public Module CurrentMachine End Set End Property + Public Property dShortCut As Double + Get + Return m_dShortCut + End Get + Set(value As Double) + WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_SHORTENING, DoubleToString(value, 2), sMachIniFile) + m_dShortCut = value + End Set + End Property + Public Property bAligned As Boolean Get Return m_bAligned @@ -451,6 +463,12 @@ Public Module CurrentMachine End Get End Property + Friend ReadOnly Property bShowUserNotes As Integer + Get + Return m_nShowUserNotes + End Get + End Property + Public ReadOnly Property bSawing As Boolean Get Return m_bSawing @@ -935,6 +953,8 @@ Public Module CurrentMachine m_bCornerCuts = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, 1, sMachIniFile) <> 0) ' Leggo lavorazione interni con fresa 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 abilitazione lavaggio lastra m_bWashing = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WASHING, 1, sMachIniFile) <> 0) ' Leggo configurazione degli utensili in macchina @@ -949,6 +969,7 @@ Public Module CurrentMachine ' Leggo abilitazione visualizzazione TcPos e Head/exit m_bShowToolChanger = (GetPrivateProfileInt(S_TOOLS, K_SHOWTOOLCHANGER, 0, sMachIniFile) > 0) m_bShowHeadExit = (GetPrivateProfileInt(S_TOOLS, K_SHOWHEADEXIT, 0, sMachIniFile) > 0) + m_nShowUserNotes = GetPrivateProfileInt(S_TOOLS, K_SHOWUSERNOTES, 0, sMachIniFile) ' Leggo limiti diametro lama per altre operazioni m_dMaxSawDiamForVac = GetPrivateProfileDouble(S_TOOLS, K_MAXSAWDIAMFORVAC, 630, sMachIniFile) m_dMaxSawDiamForProbe = GetPrivateProfileDouble(S_TOOLS, K_MAXSAWDIAMFORPROBE, 630, sMachIniFile) diff --git a/EgtStoneLib/EstCalc.vb b/EgtStoneLib/EstCalc.vb index db05355..d07029d 100644 --- a/EgtStoneLib/EstCalc.vb +++ b/EgtStoneLib/EstCalc.vb @@ -393,6 +393,8 @@ Module EstCalc Public Function InsertOnePart(nId As Integer, bAligned As Boolean, bReducedCut As Boolean) As Boolean ' Se esiste grezzo e pezzo in parcheggio, lo metto nella tavola If m_nRawId <> GDB_ID.NULL AndAlso EgtIsPart(nId) Then + ' Sistemazioni per eventuali lati inclinati con tallone + AdjustPartSideAngleHeel(nId, m_b3Raw.DimZ()) ' Sistemazioni per eventuali lati esterni inclinati e/o offsettati EgtCalcFlatPartUpRegion(nId, True) EgtCalcFlatPartDownRegion(nId, m_b3Raw.DimZ()) @@ -436,6 +438,69 @@ Module EstCalc Return False End Function + Private Function AdjustPartSideAngleHeel(nPartId As Integer, dTh As Double) As Boolean + ' Recupero entità del layer esterno e di quelli interni + Dim vEnt As New List(Of Integer) + Dim nEntId As Integer = EgtGetFirstInGroup(EgtGetFirstNameInGroup(nPartId, NAME_OUTLOOP)) + While nEntId <> GDB_ID.NULL + vEnt.Add(nEntId) + nEntId = EgtGetNext(nEntId) + End While + Dim nLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_INLOOP) + While nLayId <> GDB_ID.NULL + nEntId = EgtGetFirstInGroup(nLayId) + While nEntId <> GDB_ID.NULL + vEnt.Add(nEntId) + nEntId = EgtGetNext(nEntId) + End While + nLayId = EgtGetNextName(nLayId, NAME_INLOOP) + End While + ' Aggiorno le entità con tallone e quelle con angolo esterno + Const AGG_DEPTH As Double = 2.0 + For Each nEnt As Integer In vEnt + ' Recupero eventuali tallone ed angolo originale + Dim dHeel As Double = 0 + Dim dSideAng As Double = 0 + EgtGetInfo(nEnt, INFO_HEEL, dHeel) + EgtGetInfo(nEnt, INFO_ORIG_SIDE_ANGLE, dSideAng) + If Math.Abs(dSideAng) > EPS_ANG_SMALL And dHeel > 10 * EPS_SMALL Then + ' Angolo esterno + If dSideAng > 0 Then + ' Se tallone inferiore a spessore + If dHeel < dTh - 10 * EPS_SMALL Then + EgtSetInfo(nEnt, INFO_SIDE_ANGLE, 0.0) + EgtSetInfo(nEnt, INFO_SIDE_ANGLE2, dSideAng) + EgtSetInfo(nEnt, INFO_OFFSET2, -(dTh - dHeel) * Math.Tan(dSideAng * Math.PI / 180)) + EgtSetInfo(nEnt, INFO_DEPTH2, (dTh - dHeel) + AGG_DEPTH) + ' altrimenti, tallone superiore a spessore -> non c'è taglio inclinato + Else + EgtSetInfo(nEnt, INFO_SIDE_ANGLE, 0.0) + EgtSetInfo(nEnt, INFO_SIDE_ANGLE2, 0.0) + EgtRemoveInfo(nEnt, INFO_OFFSET2) + EgtRemoveInfo(nEnt, INFO_DEPTH2) + End If + ' Angolo interno + Else + ' Se tallone inferiore a spessore + If dHeel < dTh - 10 * EPS_SMALL Then + EgtSetInfo(nEnt, INFO_OFFSET, dHeel * Math.Tan(-dSideAng * Math.PI / 180)) + EgtSetInfo(nEnt, INFO_SIDE_ANGLE2, 0.0) + EgtSetInfo(nEnt, INFO_DEPTH2, dHeel + AGG_DEPTH) + ' altrimenti, tallone superiore a spessore -> non c'è taglio inclinato + Else + EgtSetInfo(nEnt, INFO_SIDE_ANGLE, 0.0) + EgtRemoveInfo(nEnt, INFO_OFFSET) + EgtRemoveInfo(nEnt, INFO_SIDE_ANGLE2) + EgtRemoveInfo(nEnt, INFO_DEPTH2) + End If + End If + ElseIf dSideAng > EPS_ANG_SMALL Then + EgtSetInfo(nEnt, INFO_OFFSET, -dTh * Math.Tan(dSideAng * Math.PI / 180)) + End If + Next + Return True + End Function + Public Function StoreOnePart(ByVal nId As Integer, Optional ByVal bForced As Boolean = False) As Boolean ' Se pezzo in grezzo, metto in parcheggio (sempre possibile) If bForced OrElse diff --git a/EgtStoneLib/VacuumCups.vb b/EgtStoneLib/VacuumCups.vb index 3b476bf..85e4b8c 100644 --- a/EgtStoneLib/VacuumCups.vb +++ b/EgtStoneLib/VacuumCups.vb @@ -304,6 +304,23 @@ Module VacuumCups Return True End Function + Private Function GetVacRotAxisSteps(ByRef vAngRot As List(Of Double)) As Boolean + ' Recupero l'asse rotante della testa ventosa + Dim nRotAxId As Integer = EgtGetParent(EgtGetHeadId(VACUUM_HEAD)) + ' Verifico se contiene info con STEPS + Dim sSteps As String = "" + If Not EgtGetInfo(nRotAxId, KEY_ROTVAC_STEPS, sSteps) Then Return False + ' Leggo gli step previsti + Dim vStep() As String = sSteps.Split(",".ToCharArray) + For Each sStep As String In vStep + Dim dStep As Double = 0 + If StringToDouble(sStep, dStep) Then + vAngRot.Add(dStep) + End If + Next + Return True + End Function + Private Function TestVacuumCupSelection(sCups() As String, b3Raw As BBox3d, ptRawCen As Point3d, nOutlineId As Integer, nRawRegId As Integer, ByRef vtMove As Vector3d, ByRef ptRotCen As Point3d, ByRef dRotAngDeg As Double) As Double ' Se definizione mancante, scarto soluzione @@ -347,10 +364,21 @@ Module VacuumCups For nJ As Integer = 0 To sCups.Length() - 1 nCups(nJ) = EgtGetFirstNameInGroup(m_nVacId, sCups(nJ)) Next + ' Angoli di prova + Dim vAngRot As New List(Of Double) + ' Se asse rotante ventosa a step + If GetVacRotAxisSteps(vAngRot) Then + ' Annullo la rotazione di allineamento + dRotAngDeg = 0 + ' altrimenti in continuo + Else + ' Assegno più valori di ricerca e conservo angolo di allineamento + vAngRot.AddRange({0, +5, -5, +12.5, -12.5, +25, -25, +45, -45}) + End If + ' Eseguo verifica delle ventose rispetto al grezzo Dim bVacOk As Boolean = False - Dim vAngRot() As Double = {0, +5, -5, +12.5, -12.5, +25, -25, +45, -45} - For i As Integer = 0 To vAngRot.Length() - 1 + For i As Integer = 0 To vAngRot.Count() - 1 If TestVacuumCups(nCups, nRawRegId, vtMove, ptRotCen, dRotAngDeg + vAngRot(i)) Then dRotAngDeg += vAngRot(i) bVacOk = True diff --git a/MachOptionWindow/MachOptionWindowV.xaml b/MachOptionWindow/MachOptionWindowV.xaml index c8651ee..3299651 100644 --- a/MachOptionWindow/MachOptionWindowV.xaml +++ b/MachOptionWindow/MachOptionWindowV.xaml @@ -18,7 +18,7 @@ - + @@ -140,7 +140,7 @@ - + + + + + + diff --git a/MachOptionWindow/MachOptionWindowVM.vb b/MachOptionWindow/MachOptionWindowVM.vb index 7b05cec..9971d1f 100644 --- a/MachOptionWindow/MachOptionWindowVM.vb +++ b/MachOptionWindow/MachOptionWindowVM.vb @@ -166,6 +166,18 @@ Public Class MachOptionWindowVM End Set End Property + Public Property ShortCut As String + Get + Return LenToString(CurrentMachine.dShortCut, -2) + End Get + Set(value As String) + Dim dShortCut As Double = 0 + If StringToLen(value, dShortCut) Then + CurrentMachine.dShortCut = dShortCut + End If + End Set + End Property + #End Region ' Milling Param #Region "Nesting Param" @@ -377,6 +389,11 @@ Public Class MachOptionWindowVM Return EgtMsg(MSG_ALARMSPAGEUC + 44) End Get End Property + Public ReadOnly Property ShortMsg As String + Get + Return EgtMsg(MSG_ALARMSPAGEUC + 49) + End Get + End Property Public ReadOnly Property InternalCutsMsg As String Get Return EgtMsg(MSG_ALARMSPAGEUC + 30) diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 22d9f09..141a624 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/MyToolDbWindow/MyToolDbWindowV.xaml b/MyToolDbWindow/MyToolDbWindowV.xaml new file mode 100644 index 0000000..3082133 --- /dev/null +++ b/MyToolDbWindow/MyToolDbWindowV.xaml @@ -0,0 +1,920 @@ + + + + + + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + + + + + + + + + + + + + + + + +