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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MyToolDbWindow/MyToolDbWindowV.xaml.vb b/MyToolDbWindow/MyToolDbWindowV.xaml.vb
new file mode 100644
index 0000000..6910b73
--- /dev/null
+++ b/MyToolDbWindow/MyToolDbWindowV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class MyToolDbWindowV
+
+End Class
diff --git a/MyToolDbWindow/MyToolDbWindowVM.vb b/MyToolDbWindow/MyToolDbWindowVM.vb
new file mode 100644
index 0000000..b07e072
--- /dev/null
+++ b/MyToolDbWindow/MyToolDbWindowVM.vb
@@ -0,0 +1,160 @@
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class MyToolDbWindowVM
+ Inherits ToolDbWindowVM
+
+#Region "CONSTRUCTOR"
+
+ Sub New(sMachineDirPath As String, sMachineIniPath As String, ProjectSceneContext As Integer)
+ MyBase.New(sMachineDirPath, sMachineIniPath, ProjectSceneContext)
+ End Sub
+
+#End Region ' Constructor
+
+ Private Sub ManageSpecialSawNotes()
+ ' Note utente devono essere visualizzate
+ If CurrentMachine.bShowUserNotes = 0 Then Return
+ ' Utensile deve essere lama
+ Dim nType As Integer
+ EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
+ If nType <> MCH_TY.SAW_STD Then Return
+ ' Recupero le note utente
+ Dim sUserNotes As String = ""
+ EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, sUserNotes)
+ ' Se esistono
+ If Not String.IsNullOrEmpty(sUserNotes) Then
+ ' Le divido in parti
+ Dim bIsCode As Boolean = False
+ Dim bIsSuppl As Boolean = False
+ Dim bIsSN As Boolean = False
+ Dim sItems() As String = sUserNotes.Split(";".ToCharArray)
+ For i As Integer = 0 To sItems.Count() - 1
+ If sItems(i).Contains("CODE=") Then
+ bIsCode = True
+ ElseIf sItems(i).Contains("SUPPL=") Then
+ bIsSuppl = True
+ ElseIf sItems(i).Contains("S/N=") Then
+ bIsSN = True
+ ElseIf sItems(i).Contains("START=") Then
+ sItems(i) = ""
+ ElseIf sItems(i).Contains("PROD=") Then
+ sItems(i) = ""
+ End If
+ Next
+ sUserNotes = ""
+ For i As Integer = 0 To sItems.Count() - 1
+ If Not String.IsNullOrWhiteSpace(sItems(i)) Then
+ sUserNotes &= sItems(i) & ";"
+ End If
+ Next
+ If Not bIsCode Then sUserNotes &= "CODE= ;"
+ If Not bIsSuppl Then sUserNotes &= "SUPPL= ;"
+ If Not bIsSN Then sUserNotes &= "S/N= ;"
+ Else
+ sUserNotes = "CODE= ; SUPPL= ; S/N= ;"
+ End If
+ sUserNotes &= "START=" & My.Computer.Clock.LocalTime.ToString("dd.MM.yyyy HH:mm:ss") & ";"
+ sUserNotes &= "PROD=0;"
+ EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, sUserNotes)
+ End Sub
+
+
+#Region "COMMANDS"
+
+#Region "NewCommand"
+
+ '''
+ ''' Creata the new tool. This method is invoked by the NewCommand.
+ '''
+ Public Overrides Sub NewPar(ByVal param As Object)
+ EgtSetCurrentContext(ToolDbWindowVM.ProjectSceneContext)
+ ' Verifico se sia selezionata una famiglia
+ Dim NewToolItem As ToolTreeViewItem
+ If TypeOf param Is FamilyToolTreeViewItem Then
+ Dim ToolFamily As FamilyToolTreeViewItem = DirectCast(param, FamilyToolTreeViewItem)
+ Dim NewName As String = ToolFamily.Name
+ EgtTdbGetToolNewName(NewName)
+ If EgtTdbAddTool(NewName, ToolFamily.ToolType) Then
+ NewToolItem = New ToolTreeViewItem(NewName)
+ ToolFamily.Items.Add(NewToolItem)
+ EgtTdbSaveCurrTool()
+ NewToolItem.NewTool = True
+ ' Determino il tipo di utensile
+ Dim nType As Integer
+ EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
+ Dim bSaw As Boolean = ((nType And MCH_TF.SAWBLADE) <> 0)
+ ' Imposto testa e uscita
+ ' Sempre lame su H1.1 e altri utensili su H1.2
+ EgtTdbSetCurrToolParam(MCH_TP.HEAD, "H1")
+ EgtTdbSetCurrToolParam(MCH_TP.EXIT_, If(bSaw, 1, 2))
+ ' Per macchine senza ToolChanger, resetto la posizione su questo
+ If CurrentMachine.bShowToolChanger = 0 Then
+ EgtTdbSetCurrToolParam(MCH_TP.TCPOS, "")
+ End If
+ ' Imposto dimensioni standard
+ If (nType And MCH_TF.DRILLBIT) <> 0 Then
+ EgtTdbSetCurrToolParam(MCH_TP.LEN, 80.0)
+ EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, 80.0)
+ EgtTdbSetCurrToolParam(MCH_TP.DIAM, 20.0)
+ EgtTdbSetCurrToolParam(MCH_TP.TOTDIAM, 20.0)
+ EgtTdbSetCurrToolParam(MCH_TP.MAXMAT, 40.0)
+ ElseIf (nType And MCH_TF.SAWBLADE) <> 0 Then
+ EgtTdbSetCurrToolParam(MCH_TP.LEN, 80.0)
+ EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, 80.0)
+ EgtTdbSetCurrToolParam(MCH_TP.DIAM, 600.0)
+ EgtTdbSetCurrToolParam(MCH_TP.TOTDIAM, 600.0)
+ EgtTdbSetCurrToolParam(MCH_TP.THICK, 5.0)
+ EgtTdbSetCurrToolParam(MCH_TP.MAXMAT, 40.0)
+ ElseIf (nType And MCH_TF.MILL) <> 0 Then
+ EgtTdbSetCurrToolParam(MCH_TP.LEN, 80.0)
+ EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, 80.0)
+ EgtTdbSetCurrToolParam(MCH_TP.DIAM, 20.0)
+ EgtTdbSetCurrToolParam(MCH_TP.TOTDIAM, 20.0)
+ EgtTdbSetCurrToolParam(MCH_TP.MAXMAT, 40.0)
+ End If
+ ' Gestione speciale eventuali note tipo Hofmann
+ ManageSpecialSawNotes()
+ ' Salvo e aggiorno interfaccia utente
+ EgtTdbSaveCurrTool()
+ ' Seleziono il nuovo utensile
+ If Not ToolFamily.IsExpanded Then ToolFamily.IsExpanded = True
+ NewToolItem.IsSelected = True
+ NewToolItem.NotifyPropertyChanged("IsSelected")
+ End If
+ ' Verifico se sia selezionato un utensile
+ ElseIf TypeOf param Is ToolTreeViewItem Then
+ Dim ToolCopied As ToolTreeViewItem = DirectCast(param, ToolTreeViewItem)
+ Dim NewName As String = ToolCopied.Name
+ EgtTdbGetToolNewName(NewName)
+ If EgtTdbCopyTool(ToolCopied.Name, NewName) Then
+ ' Gestione speciale eventuali note tipo Hofmann
+ ManageSpecialSawNotes()
+ ' Elimino disegno che non deve essere copiato
+ EgtTdbSetCurrToolParam(MCH_TP.DRAW, String.Empty)
+ Dim CurrType As Integer
+ EgtTdbGetCurrToolParam(MCH_TP.TYPE, CurrType)
+ For Each ToolFamily In ToolsList
+ If (ToolFamily.ToolType And CurrType) <> 0 Then
+ NewToolItem = New ToolTreeViewItem(NewName)
+ ToolFamily.Items.Add(NewToolItem)
+ EgtTdbSaveCurrTool()
+ NewToolItem.NewTool = True
+ ' Reimposto l'utensile vecchio nel Db per deselezionarlo e fare le verifiche correttamente
+ EgtTdbSetCurrTool(ToolCopied.Name)
+ ToolCopied.IsSelected = False
+ ToolCopied.NotifyPropertyChanged("IsSelected")
+ NewToolItem.IsSelected = True
+ Exit For
+ End If
+ Next
+ End If
+ End If
+
+ End Sub
+
+#End Region ' NewCommand
+
+#End Region ' Commands
+
+End Class
diff --git a/OmagOFFICE.vbproj b/OmagOFFICE.vbproj
index 86f7df3..adeb7d4 100644
--- a/OmagOFFICE.vbproj
+++ b/OmagOFFICE.vbproj
@@ -71,7 +71,7 @@
true41999,42016None
- x86
+ x64MinimumRecommendedRules.rulesettrue
@@ -211,6 +211,10 @@
+
+ MyToolDbWindowV.xaml
+
+ MachiningTabV.xaml
@@ -363,6 +367,10 @@
MainWindowV.xamlCode
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
diff --git a/SideEntityControl/SideEntityControlV.xaml b/SideEntityControl/SideEntityControlV.xaml
index 14a3e5e..e6774ca 100644
--- a/SideEntityControl/SideEntityControlV.xaml
+++ b/SideEntityControl/SideEntityControlV.xaml
@@ -18,9 +18,14 @@
Grid.Column="1"
Visibility="{Binding Check_Visibility}"
HorizontalAlignment="Center"/>
-
+
+
+
+
@@ -63,7 +68,20 @@
Grid.Column="1"/>
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SideEntityControl/SideEntityControlVM.vb b/SideEntityControl/SideEntityControlVM.vb
index 0bba5b6..29d406a 100644
--- a/SideEntityControl/SideEntityControlVM.vb
+++ b/SideEntityControl/SideEntityControlVM.vb
@@ -84,7 +84,7 @@ Public Class SideEntityControlVM
RefreshSideAngleText()
Else
' Recupero il valore
- StringToDouble(value, m_dDripOffset)
+ StringToLen(value, m_dDripOffset)
' Creo le geometrie dei gocciolatoi
RefreshSideAngleText()
End If
@@ -102,7 +102,12 @@ Public Class SideEntityControlVM
Return LenToString(m_Parameter2, -2)
End Get
Set(value As String)
- StringToLen(value, m_Parameter2)
+ If m_Mode = ModeOpt.DRIP Then
+ StringToLen(value, m_Parameter2)
+ m_dDripOffset2 = m_Parameter2
+ ' Creo le geometrie dei gocciolatoi
+ RefreshSideAngleText()
+ End If
End Set
End Property
Private Sub SetParameter2(value As Double)
@@ -116,7 +121,12 @@ Public Class SideEntityControlVM
Return LenToString(m_Parameter3, -2)
End Get
Set(value As String)
- StringToLen(value, m_Parameter3)
+ If m_Mode = ModeOpt.DRIP Then
+ StringToLen(value, m_Parameter3)
+ m_dDripDepth = m_Parameter3
+ ' Creo le geometrie dei gocciolatoi
+ RefreshSideAngleText()
+ End If
End Set
End Property
Private Sub SetParameter3(value As Double)
@@ -124,7 +134,27 @@ Public Class SideEntityControlVM
NotifyPropertyChanged("Parameter3")
End Sub
+ Private m_Parameter4 As Double
+ Public Property Parameter4 As String
+ Get
+ Return LenToString(m_Parameter4, -2)
+ End Get
+ Set(value As String)
+ If m_Mode = ModeOpt.DRIP Then
+ StringToLen(value, m_Parameter4)
+ m_dDripShort = m_Parameter4
+ ' Creo le geometrie dei gocciolatoi
+ RefreshSideAngleText()
+ End If
+ End Set
+ End Property
+ Private Sub SetParameter4(value As Double)
+ m_Parameter4 = value
+ NotifyPropertyChanged("Parameter4")
+ End Sub
+
Private m_dDripOffset As Double = 10
+ Private m_dDripOffset2 As Double = 0
Private m_dDripDepth As Double = 10
Private m_dDripShort As Double = 0
@@ -145,10 +175,15 @@ Public Class SideEntityControlVM
End Property
Public ReadOnly Property Parameter2Msg As String
Get
- Return EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
+ Return EgtMsg(MSG_IMPORTPAGEUC + 16) ' Offset 2
End Get
End Property
Public ReadOnly Property Parameter3Msg As String
+ Get
+ Return EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
+ End Get
+ End Property
+ Public ReadOnly Property Parameter4Msg As String
Get
Return EgtMsg(MSG_IMPORTPAGEUC + 12) ' Accorciamento
End Get
@@ -161,6 +196,7 @@ Public Class SideEntityControlVM
Sub New(CallingWindow As CallingWindowOpt, CallingWndScene As Scene, Mode As ModeOpt)
SideAngleEntity.m_ModifySideAngle = AddressOf ModifySideAngle
+ SideAngleEntity.m_ModifySideHeel = AddressOf ModifySideHeel
SideAngleEntity.m_RefreshSideAngleText = AddressOf RefreshSideAngleText
DripEntity.m_ModifyDrip = AddressOf ModifyDrip
DripEntity.m_RefreshSideAngleText = AddressOf RefreshSideAngleText
@@ -202,11 +238,13 @@ Public Class SideEntityControlVM
Else
Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
m_dDripOffset = GetMainPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20)
+ m_dDripOffset2 = GetMainPrivateProfileDouble(S_SIDES, K_DRIPOFFSET2, 0)
m_dDripDepth = GetMainPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10)
m_dDripShort = GetMainPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0)
SetParameter1(m_dDripOffset)
- SetParameter2(m_dDripDepth)
- SetParameter3(m_dDripShort)
+ SetParameter2(m_dDripOffset2)
+ SetParameter3(m_dDripDepth)
+ SetParameter4(m_dDripShort)
End If
' Aggiorno visualizzazione
@@ -257,7 +295,9 @@ Public Class SideEntityControlVM
If m_Mode = ModeOpt.SIDEANGLE Then
' Per ogni entità, creo testo con nome e angolo di inclinazione
For Each Entity In m_SideEntityList
- Dim sText As String = Entity.sEntityName & " = " & DoubleToString(DirectCast(Entity, SideAngleEntity).dSideAngle, 1) & "°"
+ Dim SideEntity As SideAngleEntity = TryCast(Entity, SideAngleEntity)
+ Dim sText As String = Entity.sEntityName & " = " & DoubleToString(SideEntity.dSideAngle, 1) & "°"
+ If SideEntity.dSideHeel > 10 * EPS_SMALL Then sText += "; " & LenToString(SideEntity.dSideHeel, 1)
AddTextToLine(sText, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True)
Next
' Altrimenti modalità gocciolatoio
@@ -462,12 +502,17 @@ Public Class SideEntityControlVM
' Ricavo angolo dell'entità
Dim dSideAngleVal As Double
If Not EgtGetInfo(CurrLine, INFO_SIDE_ANGLE, dSideAngleVal) Then dSideAngleVal = 0
+ ' Ricavo tallone dell'entità
+ Dim dSideHeelVal As Double
+ If Not EgtGetInfo(CurrLine, INFO_HEEL, dSideHeelVal) Then dSideHeelVal = 0
' Aggiungo entità all'elenco di quelle inclinabili
Dim sEntityName As String = String.Empty
EgtGetName(CurrLine, sEntityName)
- m_SideEntityList.Add(New SideAngleEntity(CurrLine, sEntityName, TextLayer, dSideAngleVal, m_Mode))
- ' Creo testo con angolo di inclinazione 0
- AddTextToLine(sEntityName & " = " & DoubleToString(dSideAngleVal, 1) & "°", TextLayer, CurrLine, 20, dBBoxRad, True)
+ m_SideEntityList.Add(New SideAngleEntity(CurrLine, sEntityName, TextLayer, dSideAngleVal, dSideHeelVal, m_Mode))
+ ' Creo testo con angolo di inclinazione ed eventuale tallone
+ Dim sText As String = sEntityName & " = " & DoubleToString(dSideAngleVal, 1) & "°"
+ If dSideHeelVal > 10 * EPS_SMALL Then sText += "; " & LenToString(dSideHeelVal, 1)
+ AddTextToLine(sText, TextLayer, CurrLine, 20, dBBoxRad, True)
End Sub
' Funzione che gestisce le operazioni sull'entità con gocciolatoio
@@ -590,23 +635,60 @@ Public Class SideEntityControlVM
vSelId.Add(nNewId)
End If
Next
- ' Concateno le curve
- EgtCreateCurveCompoByReorder(DripLayer, vSelId.Count(), vSelId.ToArray(), New Point3d(), True)
- ' Eseguo offset dei risultati ed eventuali accorciamenti iniziali e finali
+ ' Eseguo eventuali allungamenti iniziali e finali
Dim nCrvId As Integer = EgtGetFirstInGroup(DripLayer)
While nCrvId <> GDB_ID.NULL
- EgtOffsetCurve(nCrvId, -m_dDripOffset, OFF_TYPE.EXTEND)
- EgtSetColor(nCrvId, New Color3d(255, 165, 0))
- EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
- If m_dDripShort > EPS_SMALL Then
+ If m_dDripShort < -EPS_SMALL Then
+ EgtExtendCurveStartByLen(nCrvId, -m_dDripShort)
+ EgtExtendCurveEndByLen(nCrvId, -m_dDripShort)
+ End If
+ nCrvId = EgtGetNext(nCrvId)
+ End While
+ ' Concateno le curve
+ EgtCreateCurveCompoByReorder(DripLayer, vSelId.Count(), vSelId.ToArray(), New Point3d(), True)
+ ' Eseguo eventuali accorciamenti iniziali e finali
+ nCrvId = EgtGetFirstInGroup(DripLayer)
+ While nCrvId <> GDB_ID.NULL
+ If m_dDripShort > EPS_SMALL AndAlso Not EgtCurveIsClosed(nCrvId) Then
Dim dLen As Double
EgtCurveLength(nCrvId, dLen)
EgtTrimCurveEndAtLen(nCrvId, dLen - m_dDripShort)
EgtTrimCurveStartAtLen(nCrvId, m_dDripShort)
- EgtSetInfo(nCrvId, INFO_STRICT, "1")
End If
nCrvId = EgtGetNext(nCrvId)
End While
+ ' Eseguo offset dei risultati
+ nCrvId = EgtGetFirstInGroup(DripLayer)
+ While nCrvId <> GDB_ID.NULL
+ EgtOffsetCurve(nCrvId, -m_dDripOffset, OFF_TYPE.EXTEND)
+ nCrvId = EgtGetNext(nCrvId)
+ End While
+ ' Eventuali curve aggiuntive con offset2
+ If m_dDripOffset2 > EPS_SMALL Then
+ nCrvId = EgtGetFirstInGroup(DripLayer)
+ While nCrvId <> GDB_ID.NULL
+ Dim nNextCrvId As Integer = EgtGetNext(nCrvId)
+ Dim nNewId As Integer = EgtCopy(nCrvId, nCrvId, GDB_POS.AFTER)
+ EgtOffsetCurve(nNewId, -m_dDripOffset2, OFF_TYPE.EXTEND)
+ nCrvId = nNextCrvId
+ End While
+ End If
+ ' Esplodo nelle curve componenti
+ nCrvId = EgtGetFirstInGroup(DripLayer)
+ While nCrvId <> GDB_ID.NULL
+ Dim nNextCrvId = EgtGetNext(nCrvId)
+ Dim nCount As Integer
+ EgtExplodeCurveCompo(nCrvId, nCount)
+ nCrvId = nNextCrvId
+ End While
+ ' Assegno colore e attributi
+ nCrvId = EgtGetFirstInGroup(DripLayer)
+ While nCrvId <> GDB_ID.NULL
+ EgtSetColor(nCrvId, New Color3d(255, 165, 0))
+ EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
+ If m_dDripShort > EPS_SMALL Then EgtSetInfo(nCrvId, INFO_STRICT, "1")
+ nCrvId = EgtGetNext(nCrvId)
+ End While
End Sub
' Funzione che modifica l'inclinazione di un lato
@@ -629,6 +711,26 @@ Public Class SideEntityControlVM
Return True
End Function
+ ' Funzione che modifica il tallone di un lato
+ Friend Function ModifySideHeel(sEntityName As String, dSideHeel As Double) As Boolean
+ ' Ricavo CurrEntity dal nome
+ Dim CurrEntity As SideAngleEntity = SideAngleEntity.FindEntity(sEntityName, m_SideEntityList)
+ If IsNothing(CurrEntity) Then
+ EgtOutLog("Error in side angle definition: selected line not found in SideAngleList")
+ Return False
+ End If
+ ' Scrivo nuovo tallone nelle info
+ If dSideHeel > 10 * EPS_SMALL Then
+ EgtSetInfo(CurrEntity.nGeomId, INFO_HEEL, dSideHeel)
+ ' Cancello inclinazione nell'apposito campo info
+ Else
+ EgtRemoveInfo(CurrEntity.nGeomId, INFO_HEEL)
+ End If
+ ' Aggiorno lista entità con nuova inclinazione
+ CurrEntity.dSideHeel = dSideHeel
+ Return True
+ End Function
+
' Funzione che modifica l'inclinazione di un lato
Friend Function ModifyDrip(sEntityName As String, bVal As Boolean) As Boolean
' Ricavo CurrEntity dal nome
@@ -683,11 +785,13 @@ Public Class SideEntityControlVM
Else
Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
m_dDripOffset = GetMainPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20)
+ m_dDripOffset2 = GetMainPrivateProfileDouble(S_SIDES, K_DRIPOFFSET2, 0)
m_dDripDepth = GetMainPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10)
m_dDripShort = GetMainPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0)
SetParameter1(m_dDripOffset)
- SetParameter2(m_dDripDepth)
- SetParameter3(m_dDripShort)
+ SetParameter2(m_dDripOffset2)
+ SetParameter3(m_dDripDepth)
+ SetParameter4(m_dDripShort)
End If
End Sub
@@ -704,6 +808,7 @@ Public Class SideEntityControlVM
WriteMainPrivateProfileString(S_SIDES, K_SIDEANGLE, DoubleToString(m_Parameter1, 3))
Else
WriteMainPrivateProfileString(S_SIDES, K_DRIPOFFSET, DoubleToString(m_dDripOffset, 3))
+ WriteMainPrivateProfileString(S_SIDES, K_DRIPOFFSET2, DoubleToString(m_dDripOffset2, 3))
WriteMainPrivateProfileString(S_SIDES, K_DRIPDEPTH, DoubleToString(m_dDripDepth, 3))
WriteMainPrivateProfileString(S_SIDES, K_DRIPSHORT, DoubleToString(m_dDripShort, 3))
End If
@@ -746,13 +851,15 @@ Public Class SideEntityControlVM
While LineId <> GDB_ID.NULL
Dim dSideAngle As Double = 0
Dim bSA As Boolean = EgtGetInfo(LineId, INFO_SIDE_ANGLE, dSideAngle)
- Dim dSideAngle2 As Double = 0
- Dim bSA2 As Boolean = EgtGetInfo(LineId, INFO_SIDE_ANGLE2, dSideAngle2)
- If Math.Abs(dSideAngle) > EPS_ANG_SMALL Or bSA2 Then
+ Dim dSideHeel As Double = 0
+ Dim bSH As Boolean = EgtGetInfo(LineId, INFO_HEEL, dSideHeel)
+ If Math.Abs(dSideAngle) > EPS_ANG_SMALL Or bSH Then
' Creo testo con angolo di inclinazione
Dim sText As String = DoubleToString(dSideAngle, 1) & "°"
- If bSA2 Then sText &= "; " & DoubleToString(dSideAngle2, 1) & "°"
+ If dSideHeel > 10 * EPS_SMALL Then sText &= "; " & LenToString(dSideHeel, 1) & "°"
SideEntityControlVM.AddTextToLine(sText, TextLayId, LineId, 15, dBBoxRad, False, True)
+ ' Imposto angolo originale
+ EgtSetInfo(LineId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
End If
LineId = EgtGetNext(LineId)
End While
@@ -845,6 +952,7 @@ Friend Class SideAngleEntity
Friend Shared m_Parameter1 As Double
Friend Shared m_ModifySideAngle As Action(Of String, Double)
+ Friend Shared m_ModifySideHeel As Action(Of String, Double)
Friend Shared m_RefreshSideAngleText As Action
Private m_dSideAngle As Double
@@ -889,6 +997,43 @@ Friend Class SideAngleEntity
End Set
End Property
+ Private m_dSideHeel As Double
+ Public Property GrphSideHeel As String
+ Get
+ Return DoubleToString(m_dSideHeel, 2)
+ End Get
+ Set(value As String)
+ Dim dVal As Double = 0
+ If Not String.IsNullOrWhiteSpace(value) Then StringToDouble(value, dVal)
+ If dVal <> m_dSideHeel Then
+ ' Verifico stia nei limiti
+ If dVal < 0 Then
+ m_dSideHeel = 0
+ NotifyPropertyChanged("GrphSideHeel")
+ Else
+ m_dSideHeel = dVal
+ End If
+ ' Lo modifico nella geometria e nella lista inclinazioni
+ m_ModifySideHeel(sEntityName, dSideHeel)
+ ' Aggiorno tutti i testi
+ m_RefreshSideAngleText()
+ End If
+ End Set
+ End Property
+ Public Property dSideHeel As Double
+ Get
+ Return m_dSideHeel
+ End Get
+ Set(value As Double)
+ ' Verifico stia nei limiti
+ If value < 0 Then
+ m_dSideHeel = 0
+ Else
+ m_dSideHeel = value
+ End If
+ End Set
+ End Property
+
Public Overrides Property bIsChecked As Boolean
Get
Return Not m_dSideAngle = 0
@@ -910,9 +1055,10 @@ Friend Class SideAngleEntity
End Set
End Property
- Sub New(nId As Integer, sEntityName As String, nTextId As Integer, dSideAngle As Double, Mode As SideEntityControlVM.ModeOpt)
+ Sub New(nId As Integer, sEntityName As String, nTextId As Integer, dSideAngle As Double, dSideHeel As Double, Mode As SideEntityControlVM.ModeOpt)
MyBase.New(nId, sEntityName, nTextId, Mode)
m_dSideAngle = dSideAngle
+ m_dSideHeel = dSideHeel
End Sub
Friend Shared Function FindEntity(sEntityName As String, EntityList As ObservableCollection(Of SideEntity)) As SideAngleEntity