OmagOFFICE 1.8g1 :
- gestione fotografie con scalatura pixel di MapaScan - riportate le modifiche di OmagCUT per rotazione grezzi in Split & Move - correzioni in posizionamento fotografia.
This commit is contained in:
@@ -287,7 +287,7 @@ Public Class CompoParamPageVM
|
||||
CompoWindowMap.refCompoSceneHostV.CompoScene.ZoomAll()
|
||||
' Imposto messaggio aggiungi
|
||||
AddMsg = EgtMsg(MSG_COMPONENTPAGEUC + 48)
|
||||
' altrimenti se è un compo interno
|
||||
' altrimenti se è un compo interno
|
||||
Else
|
||||
If Not bOk Then
|
||||
EgtOutLog("Error in Component " & CompoWindowMap.refCompoWindowVM.m_SelInternalCompo.LuaPath)
|
||||
|
||||
@@ -112,6 +112,7 @@ Module ConstIni
|
||||
|
||||
Public Const S_RAWMOVE As String = "RawMove"
|
||||
Public Const K_RAWSTEP As String = "Step"
|
||||
Public Const K_RAWROTATION As String = "Rotation"
|
||||
Public Const K_PERPENDICULAR As String = "Perpendicular"
|
||||
|
||||
Public Const S_CAMERA As String = "Camera"
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
Public Const MSG_OPTIONPANEL As Integer = MSG_OMAGOFFICE
|
||||
Public Const MSG_MYMACHININGDBWINDOW As Integer = MSG_OMAGOFFICE + 50
|
||||
Public Const MSG_TOPCMDBAR As Integer = MSG_OMAGOFFICE + 100
|
||||
Public Const MSG_RAWPARTTAB As Integer = MSG_OMAGOFFICE + 150
|
||||
|
||||
Public Const MSG_EGTWPFLIB5 As Integer = 30000
|
||||
Public Const MSG_TOPCOMMANDBAR As Integer = MSG_EGTWPFLIB5 + 500
|
||||
|
||||
@@ -337,7 +337,7 @@ Public Class CurrMachWindowVM
|
||||
sToolList.RemoveAt(ToolIndex)
|
||||
' Impossibile trovare l'utensile xxx nel DB utensili
|
||||
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 3) & " " & sSearchedTool & " " & EgtMsg(MSG_SETUPERRORS + 4), EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Altrimenti lo inserisco nelle liste a seconda del tipo
|
||||
' Altrimenti lo inserisco nelle liste a seconda del tipo
|
||||
Else
|
||||
EgtTdbSetCurrTool(sSearchedTool)
|
||||
Dim ToolType As Integer = 0
|
||||
|
||||
@@ -528,6 +528,7 @@ Friend Module CamAuto
|
||||
Dim dHolesOverlap As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OVERLAP, 0, CurrentMachine.sMachIniFile)
|
||||
Dim dCornerSafety As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, CurrentMachine.sMachIniFile)
|
||||
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)
|
||||
dCornerSafety = Math.Max(dCornerSafety, 10 * EPS_SMALL)
|
||||
EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch)
|
||||
@@ -539,6 +540,7 @@ Friend Module CamAuto
|
||||
EgtLuaSetGlobNumVar("CAM.HOLESOVERLAP", dHolesOverlap)
|
||||
EgtLuaSetGlobBoolVar("CAM.ONEHOLEINTCORNER", bOneHoleIntCorner)
|
||||
EgtLuaSetGlobNumVar("CAM.CORNERSAFETY", dCornerSafety)
|
||||
EgtLuaSetGlobBoolVar("CAM.MILLINGONCORNERS", bMillingOnCorners)
|
||||
EgtLuaSetGlobBoolVar("CAM.MILLINGONSINKS", bMillingOnSinks)
|
||||
EgtLuaSetGlobNumVar("CAM.RAWHEIGHT", GetRawHeight())
|
||||
Return True
|
||||
|
||||
@@ -102,10 +102,14 @@
|
||||
Public Const K_MACH_REDUCEDDEPTH As String = "ReducedDepth"
|
||||
Public Const K_MACH_EXTARCMINRAD As String = "ExtArcMinRad"
|
||||
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_NEST_ALIGNED As String = "Aligned"
|
||||
Public Const K_MACH_WASHING As String = "Washing"
|
||||
|
||||
Public Const S_MACH_RAWMOVE As String = "RawMove"
|
||||
Public Const K_MACH_RM_ROTATE As String = "Rotate"
|
||||
|
||||
Public Const S_TOOLCHANGER As String = "ToolChanger"
|
||||
Public Const K_NUMBER As String = "Number"
|
||||
Public Const K_POS As String = "Pos"
|
||||
|
||||
@@ -54,6 +54,7 @@ Public Module CurrentMachine
|
||||
Private m_dIntArcMaxSideAng As Double = 0
|
||||
|
||||
' Dati per fresatura
|
||||
Private m_bCornerCuts As Boolean = False
|
||||
Private m_bInternalCuts As Boolean = False
|
||||
|
||||
' Abilitazione lavaggio lastra
|
||||
@@ -64,6 +65,9 @@ Public Module CurrentMachine
|
||||
' Massimo diametro lama per tastatura grezzo
|
||||
Private m_dMaxSawDiamForProbe As Double = 630
|
||||
|
||||
' Possibilità di ruotare i grezzi durante separa e muovi
|
||||
Private m_bRawSplMovRotate As Boolean = False
|
||||
|
||||
' Flag che indicano stato tipologia utensili (attivo/non attivo)
|
||||
Private m_bSaw As Boolean = False
|
||||
Private m_bDrill As Boolean = False
|
||||
@@ -241,6 +245,12 @@ Public Module CurrentMachine
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property bRawSplMovRotate As Boolean
|
||||
Get
|
||||
Return m_bRawSplMovRotate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property dSafeZ As Double
|
||||
Get
|
||||
If EgtMdbGetGeneralParam(MCH_GP.SAFEZ, m_dSafeZ) Then
|
||||
@@ -364,11 +374,21 @@ Public Module CurrentMachine
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property bInternalCuts As Double
|
||||
Public Property bCornerCuts As Boolean
|
||||
Get
|
||||
Return m_bCornerCuts
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, If(value, "1", "0"), sMachIniFile)
|
||||
m_bCornerCuts = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property bInternalCuts As Boolean
|
||||
Get
|
||||
Return m_bInternalCuts
|
||||
End Get
|
||||
Set(value As Double)
|
||||
Set(value As Boolean)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, If(value, "1", "0"), sMachIniFile)
|
||||
m_bInternalCuts = value
|
||||
End Set
|
||||
@@ -851,6 +871,8 @@ Public Module CurrentMachine
|
||||
' Leggo angolo di fianco massimo arco interno
|
||||
m_dIntArcMaxSideAng = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_INTARCMAXSIDEANG, 45, sMachIniFile)
|
||||
EgtMdbSetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, m_dIntArcMaxSideAng)
|
||||
' Leggo lavorazione angoli con fresa
|
||||
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 abilitazione lavaggio lastra
|
||||
@@ -870,6 +892,8 @@ Public Module CurrentMachine
|
||||
' 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)
|
||||
' Leggo flag abilitazione rotazione grezzi durante spezza e muovi
|
||||
m_bRawSplMovRotate = (GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_RM_ROTATE, 0, sMachIniFile) <> 0)
|
||||
' Leggo flag presenza tipologie lavorazioni
|
||||
' lama
|
||||
m_bSawing = (GetPrivateProfileInt(S_MACHININGS, K_SAWING, 0, sMachIniFile) > 0)
|
||||
|
||||
+28
-15
@@ -25,7 +25,8 @@ Module EstPhoto
|
||||
Dim ptOri As New Point3d(0, 0, 0)
|
||||
Dim ptCen As New Point3d(0, 0, INFINITO)
|
||||
Dim dMMxPixel As Double = 1
|
||||
ReadAuxData(sPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel)
|
||||
Dim dCoeff As Double = 1
|
||||
If Not ReadAuxData(sPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff) Then Return False
|
||||
' Aggiungo eventuali offset
|
||||
ptOri += CurrentMachine.PhotoOffset
|
||||
ptCen += CurrentMachine.PhotoOffset
|
||||
@@ -73,7 +74,8 @@ Module EstPhoto
|
||||
Dim ptOri As New Point3d(0, 0, 0)
|
||||
Dim ptCen As New Point3d(0, 0, INFINITO)
|
||||
Dim dMMxPixel As Double = 1
|
||||
ReadAuxData(sPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel)
|
||||
Dim dCoeff As Double = 1
|
||||
If Not ReadAuxData(sPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff) Then Return False
|
||||
' Aggiungo eventuali offset
|
||||
ptOri += CurrentMachine.PhotoOffset
|
||||
ptCen += CurrentMachine.PhotoOffset
|
||||
@@ -97,14 +99,19 @@ Module EstPhoto
|
||||
If Not EgtGetTableRef(1, ptTab) Then Return False
|
||||
ptOri.ToGlob(New Frame3d(ptTab))
|
||||
ptCen.ToGlob(New Frame3d(ptTab))
|
||||
' Verifico coefficiente scalatura Pixel (per MapaScan, normalmente 1)
|
||||
If dCoeff < EPS_SMALL Then
|
||||
EgtOutLog("ReadContour : coefficiente di scalatura pixel nullo")
|
||||
Return False
|
||||
End If
|
||||
|
||||
' Se esiste file dxf lancio lettore standard, altrimenti quello personalizzato
|
||||
Dim nCrvId As Integer = GDB_ID.NULL
|
||||
Dim sCntPath As String = Path.ChangeExtension(sPath, ".dxf")
|
||||
If My.Computer.FileSystem.FileExists(sCntPath) Then
|
||||
nCrvId = LoadStandardContour(sCntPath, ptOri, dMMxPixel, nPixelY)
|
||||
nCrvId = LoadStandardContour(sCntPath, ptOri, dMMxPixel, nPixelY, dCoeff)
|
||||
Else
|
||||
nCrvId = LoadCustomContour(sPath, ptOri, dMMxPixel, nPixelY)
|
||||
nCrvId = LoadCustomContour(sPath, ptOri, dMMxPixel, nPixelY, dCoeff)
|
||||
End If
|
||||
' Eseguo le semplificazioni
|
||||
Dim nApprType As Integer = APP_TYPE.RIGHT_LINES
|
||||
@@ -117,7 +124,7 @@ Module EstPhoto
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function LoadStandardContour(sPath As String, ptOri As Point3d, dMMxPixel As Double, nPixelY As Integer) As Integer
|
||||
Private Function LoadStandardContour(sPath As String, ptOri As Point3d, dMMxPixel As Double, nPixelY As Integer, dCoeff As Double) As Integer
|
||||
' Carico Dxf del contorno
|
||||
If Not EgtImportDxf(sPath, 1) Then Return GDB_ID.NULL
|
||||
Dim nPartId As Integer = EgtGetLastPart()
|
||||
@@ -126,9 +133,10 @@ Module EstPhoto
|
||||
EgtSetLevel(nPartId, GDB_LV.SYSTEM)
|
||||
If nPartId = GDB_ID.NULL Or nLayerId = GDB_ID.NULL Then Return GDB_ID.NULL
|
||||
' Ribalto rispetto a YZ locale (i contorni da CW diventano CCW)
|
||||
EgtMirror(nLayerId, New Point3d(0, nPixelY / 2, 0), Vector3d.Y_AX(), GDB_RT.GLOB)
|
||||
EgtMirror(nLayerId, New Point3d(0, nPixelY * dCoeff / 2, 0), Vector3d.Y_AX(), GDB_RT.GLOB)
|
||||
' Eseguo scalatura
|
||||
EgtScale(nLayerId, New Frame3d(), dMMxPixel, dMMxPixel, dMMxPixel, GDB_RT.GLOB)
|
||||
Dim dScaCoeff As Double = dMMxPixel / dCoeff
|
||||
EgtScale(nLayerId, New Frame3d(), dScaCoeff, dScaCoeff, dScaCoeff, GDB_RT.GLOB)
|
||||
' Eseguo spostamento
|
||||
EgtMove(nLayerId, (ptOri - Point3d.ORIG()), GDB_RT.GLOB)
|
||||
' Eseguo concatenamento
|
||||
@@ -155,7 +163,7 @@ Module EstPhoto
|
||||
Return nCrvId
|
||||
End Function
|
||||
|
||||
Private Function LoadCustomContour(sPath As String, ptOri As Point3d, dMMxPixel As Double, nPixelY As Integer) As Integer
|
||||
Private Function LoadCustomContour(sPath As String, ptOri As Point3d, dMMxPixel As Double, nPixelY As Integer, dCoeff As Double) As Integer
|
||||
' Definizione variabili
|
||||
EgtLuaCreateGlobTable("RCT")
|
||||
EgtLuaSetGlobStringVar("RCT.FILE", sPath)
|
||||
@@ -178,12 +186,14 @@ Module EstPhoto
|
||||
EgtSetLevel(nPartId, GDB_LV.SYSTEM)
|
||||
Dim nCrvId As Integer = GDB_ID.NULL
|
||||
EgtLuaGetGlobIntVar("RCT.CRVID", nCrvId)
|
||||
EgtLuaResetGlobVar("RCT")
|
||||
If nCrvId = GDB_ID.NULL Then Return GDB_ID.NULL
|
||||
EgtSetColor(nCrvId, New Color3d(0, 255, 0))
|
||||
' Ribalto rispetto a YZ locale (i contorni da CW diventano CCW)
|
||||
EgtMirror(nCrvId, New Point3d(0, nPixelY / 2, 0), Vector3d.Y_AX(), GDB_RT.GLOB)
|
||||
EgtMirror(nCrvId, New Point3d(0, nPixelY * dCoeff / 2, 0), Vector3d.Y_AX(), GDB_RT.GLOB)
|
||||
' Eseguo scalatura
|
||||
EgtScale(nCrvId, New Frame3d(), dMMxPixel, dMMxPixel, dMMxPixel, GDB_RT.GLOB)
|
||||
Dim dScaCoeff As Double = dMMxPixel / dCoeff
|
||||
EgtScale(nCrvId, New Frame3d(), dScaCoeff, dScaCoeff, dScaCoeff, GDB_RT.GLOB)
|
||||
' Eseguo spostamento
|
||||
EgtMove(nCrvId, (ptOri - Point3d.ORIG()), GDB_RT.GLOB)
|
||||
' Deve essere CCW
|
||||
@@ -196,22 +206,23 @@ Module EstPhoto
|
||||
|
||||
Private Function ReadAuxData(sPath As String,
|
||||
ByRef nSlabId As Integer, ByRef sSlabName As String, ByRef sMat As String,
|
||||
ByRef ptOri As Point3d, ByRef ptCen As Point3d, ByRef dMMxPixel As Double) As Boolean
|
||||
ByRef ptOri As Point3d, ByRef ptCen As Point3d, ByRef dMMxPixel As Double, ByRef dCoeff As Double) As Boolean
|
||||
' Se esiste file txt lancio lettore standard, altrimenti quello personalizzato
|
||||
Dim sAuxPath As String = Path.ChangeExtension(sPath, ".txt")
|
||||
If My.Computer.FileSystem.FileExists(sAuxPath) Then
|
||||
Return ReadStandardAuxData(sAuxPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel)
|
||||
Return ReadStandardAuxData(sAuxPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff)
|
||||
Else
|
||||
Return ReadCustomAuxData(sPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel)
|
||||
Return ReadCustomAuxData(sPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff)
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function ReadStandardAuxData(sAuxPath As String,
|
||||
ByRef nSlabId As Integer, ByRef sSlabName As String, ByRef sMat As String,
|
||||
ByRef ptOri As Point3d, ByRef ptCen As Point3d, ByRef dMMxPixel As Double) As Boolean
|
||||
ByRef ptOri As Point3d, ByRef ptCen As Point3d, ByRef dMMxPixel As Double, ByRef dCoeff As Double) As Boolean
|
||||
nSlabId = 0
|
||||
sSlabName = String.Empty
|
||||
sMat = String.Empty
|
||||
dCoeff = 1
|
||||
Try
|
||||
Dim sLine As String = String.Empty
|
||||
Dim sr As StreamReader = New StreamReader(sAuxPath)
|
||||
@@ -248,7 +259,7 @@ Module EstPhoto
|
||||
|
||||
Private Function ReadCustomAuxData(sPath As String,
|
||||
ByRef nSlabId As Integer, ByRef sSlabName As String, ByRef sMat As String,
|
||||
ByRef ptOri As Point3d, ByRef ptCen As Point3d, ByRef dMMxPixel As Double) As Boolean
|
||||
ByRef ptOri As Point3d, ByRef ptCen As Point3d, ByRef dMMxPixel As Double, ByRef dCoeff As Double) As Boolean
|
||||
' Definizione variabili
|
||||
EgtLuaCreateGlobTable("RDT")
|
||||
EgtLuaSetGlobStringVar("RDT.FILE", sPath)
|
||||
@@ -271,7 +282,9 @@ Module EstPhoto
|
||||
EgtLuaGetGlobNumVar("RDT.TH", dThick)
|
||||
EgtLuaGetGlobPointVar("RDT.ORI", ptOri)
|
||||
EgtLuaGetGlobPointVar("RDT.CEN", ptCen)
|
||||
EgtLuaGetGlobNumVar("RDT.COEFF", dCoeff)
|
||||
EgtLuaGetGlobNumVar("RDT.MMXPIXEL", dMMxPixel)
|
||||
EgtLuaResetGlobVar("RDT")
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ Public Module SplitAuto
|
||||
Dim nOpeId = EgtGetFirstOperation()
|
||||
While nOpeId <> GDB_ID.NULL
|
||||
If EgtGetOperationType(nOpeId) <> MCH_OY.DISP And
|
||||
(EgtGetOperationMode(nOpeId) OrElse EgtExistsInfo(nOpeId, INFO_MCH_DUPLED)) Then
|
||||
(EgtGetOperationMode(nOpeId) OrElse EgtExistsInfo(nOpeId, INFO_MCH_USER_OFF) OrElse EgtExistsInfo(nOpeId, INFO_MCH_DUPLED)) Then
|
||||
Dim nStatus As Integer = If(EgtGetOperationPhase(nOpeId) = nPhase, GDB_ST.ON_, GDB_ST.OFF)
|
||||
' Lavorazione principale
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
@@ -224,7 +224,7 @@ Public Module SplitAuto
|
||||
Dim nOpeId = EgtGetFirstOperation()
|
||||
While nOpeId <> GDB_ID.NULL
|
||||
If EgtGetOperationType(nOpeId) <> MCH_OY.DISP And
|
||||
(EgtGetOperationMode(nOpeId) OrElse EgtExistsInfo(nOpeId, INFO_MCH_DUPLED)) Then
|
||||
(EgtGetOperationMode(nOpeId) OrElse EgtExistsInfo(nOpeId, INFO_MCH_USER_OFF) OrElse EgtExistsInfo(nOpeId, INFO_MCH_DUPLED)) Then
|
||||
Dim nStatus As Integer = GDB_ST.ON_
|
||||
' Lavorazione principale
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
@@ -692,12 +692,12 @@ Public Module SplitAuto
|
||||
Dim rmData As New RawMoveData
|
||||
If PutVacuumCupsOnRaw(vNewRaws(1), rmData) AndAlso
|
||||
SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
|
||||
rmData.m_vtMove = vtMove
|
||||
rmData.m_vtRawMove = vtMove
|
||||
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
||||
Return True
|
||||
ElseIf PutVacuumCupsOnRaw(vNewRaws(0), rmData) AndAlso
|
||||
SafeMoveRawPart(vNewRaws(0), vtMove2, dMinMove) Then
|
||||
rmData.m_vtMove = vtMove2
|
||||
rmData.m_vtRawMove = vtMove2
|
||||
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
||||
Return True
|
||||
Else
|
||||
|
||||
+31
-17
@@ -15,14 +15,16 @@ Module VacuumCups
|
||||
Friend Class RawMoveData
|
||||
|
||||
Public m_nId As Integer
|
||||
Public m_vtMove As Vector3d
|
||||
Public m_vtRawMove As Vector3d
|
||||
Public m_dRawAngRotDeg As Double
|
||||
Public m_vtDelta As Vector3d
|
||||
Public m_dAngRotDeg As Double
|
||||
Public m_sCups As String
|
||||
|
||||
Sub New()
|
||||
m_nId = GDB_ID.NULL
|
||||
m_vtMove = Vector3d.NULL()
|
||||
m_vtRawMove = Vector3d.NULL()
|
||||
m_dRawAngRotDeg = 0
|
||||
m_vtDelta = Vector3d.NULL()
|
||||
m_dAngRotDeg = 0
|
||||
m_sCups = String.Empty
|
||||
@@ -30,7 +32,8 @@ Module VacuumCups
|
||||
|
||||
Sub New(nId As Integer)
|
||||
m_nId = nId
|
||||
m_vtMove = Vector3d.NULL()
|
||||
m_vtRawMove = Vector3d.NULL()
|
||||
m_dRawAngRotDeg = 0
|
||||
m_vtDelta = Vector3d.NULL()
|
||||
m_dAngRotDeg = 0
|
||||
m_sCups = String.Empty
|
||||
@@ -260,7 +263,7 @@ Module VacuumCups
|
||||
Dim vtDelta As Vector3d = frCurrRef.Orig() - ptRawCen
|
||||
' Assegno dati noti al movimento del grezzo
|
||||
rmData.m_nId = nRawId
|
||||
rmData.m_vtMove = Vector3d.NULL()
|
||||
rmData.m_vtRawMove = Vector3d.NULL()
|
||||
rmData.m_vtDelta = vtDelta
|
||||
rmData.m_dAngRotDeg = dRotAngDeg
|
||||
Dim sVal As String = String.Empty
|
||||
@@ -314,10 +317,7 @@ Module VacuumCups
|
||||
Next
|
||||
If b3Vac.IsEmpty() Then Return INFINITO
|
||||
' Se box maggiore di quello del pezzo, scarto soluzione
|
||||
If Not ((b3Vac.DimX() < b3Raw.DimX() And b3Vac.DimY() < b3Raw.DimY()) Or
|
||||
(b3Vac.DimX() < b3Raw.DimY() And b3Vac.DimY() < b3Raw.DimX())) Then
|
||||
Return INFINITO
|
||||
End If
|
||||
If b3Vac.Radius() > b3Raw.Radius() Then Return INFINITO
|
||||
' Determino il movimento
|
||||
vtMove = ptRawCen - b3Vac.Center()
|
||||
b3Vac.Move(vtMove)
|
||||
@@ -395,7 +395,8 @@ Module VacuumCups
|
||||
Friend Function SaveOneMoveInfo(nId As Integer, rmData As RawMoveData) As Boolean
|
||||
' Assegno le informazioni
|
||||
EgtSetInfo(nId, "Id", rmData.m_nId)
|
||||
EgtSetInfo(nId, "Mv", rmData.m_vtMove)
|
||||
EgtSetInfo(nId, "Mv", rmData.m_vtRawMove)
|
||||
EgtSetInfo(nId, "Rr", rmData.m_dRawAngRotDeg)
|
||||
EgtSetInfo(nId, "Dt", rmData.m_vtDelta)
|
||||
EgtSetInfo(nId, "Ad", rmData.m_dAngRotDeg)
|
||||
EgtSetInfo(nId, "Vc", rmData.m_sCups)
|
||||
@@ -404,9 +405,10 @@ Module VacuumCups
|
||||
End Function
|
||||
|
||||
Friend Function RemoveOneMoveInfo(nId As Integer) As Boolean
|
||||
' Assegno le informazioni
|
||||
' Rimuovo le informazioni
|
||||
EgtRemoveInfo(nId, "Id")
|
||||
EgtRemoveInfo(nId, "Mv")
|
||||
EgtRemoveInfo(nId, "Rr")
|
||||
EgtRemoveInfo(nId, "Dt")
|
||||
EgtRemoveInfo(nId, "Ad")
|
||||
EgtRemoveInfo(nId, "Vc")
|
||||
@@ -415,8 +417,8 @@ Module VacuumCups
|
||||
End Function
|
||||
|
||||
Friend Function SaveOneMoveInfoInDisposition(nDispId As Integer, rmData As RawMoveData) As Boolean
|
||||
' Se movimento trascurabile, inutile salvare
|
||||
If rmData.m_vtMove.IsSmall() Then Return True
|
||||
' Se movimento e rotazione trascurabili, inutile salvare
|
||||
If rmData.m_vtRawMove.IsSmall() AndAlso Math.Abs(rmData.m_dRawAngRotDeg) < EPS_ANG_SMALL Then Return True
|
||||
' Creo il gruppo
|
||||
Dim nRpmId As Integer = EgtCreateGroup(nDispId)
|
||||
If nRpmId = GDB_ID.NULL Then Return False
|
||||
@@ -445,7 +447,8 @@ Module VacuumCups
|
||||
' Recupero le informazioni
|
||||
Dim rmData As New RawMoveData
|
||||
EgtGetInfo(nRpmId, "Id", rmData.m_nId)
|
||||
EgtGetInfo(nRpmId, "Mv", rmData.m_vtMove)
|
||||
EgtGetInfo(nRpmId, "Mv", rmData.m_vtRawMove)
|
||||
EgtGetInfo(nRpmId, "Rr", rmData.m_dRawAngRotDeg)
|
||||
EgtGetInfo(nRpmId, "Dt", rmData.m_vtDelta)
|
||||
EgtGetInfo(nRpmId, "Ad", rmData.m_dAngRotDeg)
|
||||
EgtGetInfo(nRpmId, "Vc", rmData.m_sCups)
|
||||
@@ -494,7 +497,16 @@ Module VacuumCups
|
||||
Dim nInd As Integer = AddRawMoveData(nRawId, rmList)
|
||||
If nInd = -1 Then Return -1
|
||||
' Aggiorno i valori
|
||||
rmList(nInd).m_vtMove += vtMove
|
||||
rmList(nInd).m_vtRawMove += vtMove
|
||||
Return nInd
|
||||
End Function
|
||||
|
||||
Friend Function AddRawMoveData(nRawId As Integer, dRawAngRotDeg As Double, ByRef rmList As List(Of RawMoveData)) As Integer
|
||||
' Recupero o creo record con dati del grezzo indicato
|
||||
Dim nInd As Integer = AddRawMoveData(nRawId, rmList)
|
||||
If nInd = -1 Then Return -1
|
||||
' Aggiorno i valori
|
||||
rmList(nInd).m_dRawAngRotDeg += dRawAngRotDeg
|
||||
Return nInd
|
||||
End Function
|
||||
|
||||
@@ -502,9 +514,11 @@ Module VacuumCups
|
||||
' Recupero o creo record con dati del grezzo indicato
|
||||
Dim nInd As Integer = AddRawMoveData(rmData.m_nId, rmList)
|
||||
If nInd = -1 Then Return -1
|
||||
' Aggiorno i valori
|
||||
rmList(nInd).m_vtDelta = rmData.m_vtDelta
|
||||
rmList(nInd).m_dAngRotDeg = rmData.m_dAngRotDeg
|
||||
' Aggiorno i valori (tengo conto di quanto già ruotato il pezzo)
|
||||
Dim vtDeltaRot As New Vector3d(rmData.m_vtDelta)
|
||||
vtDeltaRot.Rotate(Vector3d.Z_AX(), -rmList(nInd).m_dRawAngRotDeg)
|
||||
rmList(nInd).m_vtDelta = vtDeltaRot
|
||||
rmList(nInd).m_dAngRotDeg = rmData.m_dAngRotDeg - rmList(nInd).m_dRawAngRotDeg
|
||||
rmList(nInd).m_sCups = rmData.m_sCups
|
||||
Return nInd
|
||||
End Function
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="3*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
@@ -141,18 +140,25 @@
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{Binding MillingParamMsg}" Grid.Column="0" Grid.Row="1">
|
||||
<Grid>
|
||||
|
||||
<TextBlock Text="{Binding InternalCutsMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<CheckBox IsChecked="{Binding InternalCuts}"
|
||||
Style="{StaticResource OptionCheckBox}"/>
|
||||
|
||||
</Grid>
|
||||
<UniformGrid Rows="2">
|
||||
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding CornerCutsMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<CheckBox IsChecked="{Binding CornerCuts}"
|
||||
Style="{StaticResource OptionCheckBox}"/>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding InternalCutsMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<CheckBox IsChecked="{Binding InternalCuts}"
|
||||
Style="{StaticResource OptionCheckBox}"/>
|
||||
</Grid>
|
||||
</UniformGrid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{Binding NestingParamMsg}" Grid.Column="1" Grid.Row="3" Grid.RowSpan="2">
|
||||
<GroupBox Header="{Binding NestingParamMsg}" Grid.Column="1" Grid.Row="3" Grid.RowSpan="1">
|
||||
<UniformGrid Columns="1" Rows="2">
|
||||
|
||||
<Grid>
|
||||
@@ -172,7 +178,7 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<Border Grid.Column="1" Grid.Row="6" Style="{StaticResource DefaultBorder}">
|
||||
<Border Grid.Column="1" Grid.Row="5" Style="{StaticResource DefaultBorder}">
|
||||
<UniformGrid Columns="2">
|
||||
|
||||
<TextBlock Text="{Binding AdditionalTableMsg}"
|
||||
@@ -182,7 +188,7 @@
|
||||
</UniformGrid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="1" Grid.Row="5" Style="{StaticResource DefaultBorder}">
|
||||
<Border Grid.Column="1" Grid.Row="4" Style="{StaticResource DefaultBorder}">
|
||||
<Grid >
|
||||
|
||||
<TextBlock Text="{Binding WashingMsg}"
|
||||
|
||||
@@ -148,6 +148,15 @@ Public Class MachOptionWindowVM
|
||||
|
||||
#Region "Milling Param"
|
||||
|
||||
Public Property CornerCuts As Boolean
|
||||
Get
|
||||
Return CurrentMachine.bCornerCuts
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
CurrentMachine.bCornerCuts = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property InternalCuts As Boolean
|
||||
Get
|
||||
Return CurrentMachine.bInternalCuts
|
||||
@@ -210,9 +219,10 @@ Public Class MachOptionWindowVM
|
||||
|
||||
Public Property Washing As Boolean
|
||||
Get
|
||||
Return EstCalc.GetWashingFlag
|
||||
Return EstCalc.GetWashingFlag()
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
CurrentMachine.bWashing = value
|
||||
EstCalc.SetWashingFlag(value)
|
||||
End Set
|
||||
End Property
|
||||
@@ -361,6 +371,11 @@ Public Class MachOptionWindowVM
|
||||
Return EgtMsg(MSG_ALARMSPAGEUC + 29)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property CornerCutsMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_ALARMSPAGEUC + 44)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property InternalCutsMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_ALARMSPAGEUC + 30)
|
||||
@@ -424,16 +439,16 @@ Public Class MachOptionWindowVM
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in OmagOFFICEMap
|
||||
'OmagOFFICEMap.SetRefMachinePanelVM(Me)
|
||||
' Riempio lista attrezzaggi salvati
|
||||
m_ArchivedSetUpList.Add(String.Empty)
|
||||
Dim SetUpFileNames() As String = Directory.GetFiles(CurrentMachine.sMachDir & "\SetUp")
|
||||
For FileIndex = 0 To SetUpFileNames.Count - 1
|
||||
If Path.GetExtension(SetUpFileNames(FileIndex)).ToLower = ".stu" Then
|
||||
m_ArchivedSetUpList.Add(Path.GetFileNameWithoutExtension(SetUpFileNames(FileIndex)))
|
||||
End If
|
||||
Next
|
||||
If Directory.Exists(CurrentMachine.sMachDir & "\SetUp") Then
|
||||
Dim SetUpFileNames() As String = Directory.GetFiles(CurrentMachine.sMachDir & "\SetUp")
|
||||
For FileIndex = 0 To SetUpFileNames.Count - 1
|
||||
If Path.GetExtension(SetUpFileNames(FileIndex)).ToLower = ".stu" Then
|
||||
m_ArchivedSetUpList.Add(Path.GetFileNameWithoutExtension(SetUpFileNames(FileIndex)))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' Leggo attrezzaggio predefinito
|
||||
If EgtUILib.GetPrivateProfileString(S_SETUP, K_DEFAULT, "", m_sSelectedDefaultSetUp, CurrentMachine.sMachIniFile) <= 0 Then
|
||||
SelectedDefaultSetUp = Nothing
|
||||
|
||||
@@ -69,5 +69,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.8.6.5")>
|
||||
<Assembly: AssemblyFileVersion("1.8.6.5")>
|
||||
<Assembly: AssemblyVersion("1.8.7.1")>
|
||||
<Assembly: AssemblyFileVersion("1.8.7.1")>
|
||||
|
||||
@@ -562,6 +562,12 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TopCommandBar\Export.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\SimulTab\HeadMode.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\SimulTab\ToolMode.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button Grid.Column="2" Grid.Row="0"
|
||||
@@ -36,7 +38,7 @@
|
||||
</Button>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="2" Grid.Row="2" Width="40"
|
||||
Text="{Binding StepMove}"
|
||||
Text="{Binding MoveStep}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalContentAlignment="Right"/>
|
||||
|
||||
@@ -53,6 +55,36 @@
|
||||
<Image Source="/Resources/NestingTab/DownArrow.png"/>
|
||||
</Button>
|
||||
|
||||
<Button Grid.Column="0" Grid.Row="6"
|
||||
Style="{StaticResource OptionPanel_NestingButton}"
|
||||
Command="{Binding CcwRotCommand}"
|
||||
Visibility="{Binding RotationVisibility}">
|
||||
<Image Source="/Resources/NestingTab/CounterClockwiseRotate.png"
|
||||
Width="64" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
|
||||
<Grid Name="RotationAngle" Grid.Column="2" Grid.Row="6"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Visibility="{Binding RotationVisibility}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding RotationStep}" Width="40"/>
|
||||
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
|
||||
Text="°"/>
|
||||
</Grid>
|
||||
|
||||
<Button Grid.Column="4" Grid.Row="6"
|
||||
Style="{StaticResource OptionPanel_NestingButton}"
|
||||
Command="{Binding CwRotCommand}"
|
||||
Visibility="{Binding RotationVisibility}">
|
||||
<Image Source="/Resources/NestingTab/ClockwiseRotate.png"
|
||||
Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Button Grid.Column="2" Grid.Row="4"
|
||||
|
||||
@@ -18,13 +18,23 @@ Public Class MoveRawModeVM
|
||||
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
|
||||
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
|
||||
|
||||
Private m_dStepMove As Double
|
||||
Public Property StepMove As String
|
||||
Private m_dMoveStep As Double
|
||||
Public Property MoveStep As String
|
||||
Get
|
||||
Return LenToString(m_dStepMove, 2)
|
||||
Return LenToString(m_dMoveStep, 2)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_dStepMove)
|
||||
StringToLen(value, m_dMoveStep)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dRotationStep As Double
|
||||
Public Property RotationStep As String
|
||||
Get
|
||||
Return DoubleToString(m_dRotationStep, 2)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToDouble(value, m_dRotationStep)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -52,6 +62,19 @@ Public Class MoveRawModeVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_RotationVisibility As Visibility
|
||||
Public Property RotationVisibility As Visibility
|
||||
Get
|
||||
Return m_RotationVisibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
If value <> m_RotationVisibility Then
|
||||
m_RotationVisibility = value
|
||||
NotifyPropertyChanged("RotationVisibility")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property RemoveMsg As String
|
||||
@@ -67,6 +90,8 @@ Public Class MoveRawModeVM
|
||||
Private m_cmdLeft As ICommand
|
||||
Private m_cmdRight As ICommand
|
||||
Private m_cmdDown As ICommand
|
||||
Private m_cmdCcwRot As ICommand
|
||||
Private m_cmdCwRot As ICommand
|
||||
Private m_cmdRemovePart As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
@@ -102,8 +127,10 @@ Public Class MoveRawModeVM
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
' Carico i parametri di movimento
|
||||
m_dStepMove = GetMainPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50)
|
||||
NotifyPropertyChanged("StepMove")
|
||||
m_dMoveStep = GetMainPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50)
|
||||
NotifyPropertyChanged("MoveStep")
|
||||
m_dRotationStep = GetMainPrivateProfileDouble(S_RAWMOVE, K_RAWROTATION, 30)
|
||||
NotifyPropertyChanged("RotationStep")
|
||||
' Se movimento manuale perpendicolare
|
||||
If OmagOFFICEMap.refMachiningTabVM.ByHand Then
|
||||
' Se esiste taglio passante determino direzione di movimento
|
||||
@@ -154,9 +181,11 @@ Public Class MoveRawModeVM
|
||||
' Aggiorno interfaccia per taglio perpendicolare
|
||||
If OmagOFFICEMap.refMachiningTabVM.ByHand Then
|
||||
LRArrowVisibility = Visibility.Hidden
|
||||
RotationVisibility = Visibility.Hidden
|
||||
' Altrimenti per movimento con ventose
|
||||
Else
|
||||
LRArrowVisibility = Visibility.Visible
|
||||
RotationVisibility = If(CurrentMachine.bRawSplMovRotate, Visibility.Visible, Visibility.Hidden)
|
||||
End If
|
||||
' Ritorno a precedente sempre abilitato
|
||||
OmagOFFICEMap.refMachiningTabVM.PrevIsEnabled = True
|
||||
@@ -217,7 +246,7 @@ Public Class MoveRawModeVM
|
||||
End Sub
|
||||
|
||||
Friend Sub Refresh(PrevMeasureUnit As MeasureUnitOpt)
|
||||
NotifyPropertyChanged("StepMove")
|
||||
NotifyPropertyChanged("MoveStep")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
@@ -244,7 +273,7 @@ Public Class MoveRawModeVM
|
||||
Dim ptRawCen As Point3d
|
||||
GetRawCenter(nRawId, ptRawCen)
|
||||
' Calcolo la distanza di movimento
|
||||
Dim dMove As Double = m_dStepMove
|
||||
Dim dMove As Double = m_dMoveStep
|
||||
If m_dCurrDist < EPS_SMALL Then
|
||||
dMove -= m_dOrigDist
|
||||
End If
|
||||
@@ -256,7 +285,7 @@ Public Class MoveRawModeVM
|
||||
' Altrimenti movimento Y +
|
||||
Else
|
||||
If m_bRawWithCups Then
|
||||
Dim vtMove As New Vector3d(0, m_dStepMove, 0)
|
||||
Dim vtMove As New Vector3d(0, m_dMoveStep, 0)
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
@@ -290,7 +319,7 @@ Public Class MoveRawModeVM
|
||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If m_bRawWithCups Then
|
||||
Dim vtMove As New Vector3d(-m_dStepMove, 0, 0)
|
||||
Dim vtMove As New Vector3d(-m_dMoveStep, 0, 0)
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
@@ -323,7 +352,7 @@ Public Class MoveRawModeVM
|
||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If m_bRawWithCups Then
|
||||
Dim vtMove As New Vector3d(m_dStepMove, 0, 0)
|
||||
Dim vtMove As New Vector3d(m_dMoveStep, 0, 0)
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
@@ -361,8 +390,8 @@ Public Class MoveRawModeVM
|
||||
Dim ptRawCen As Point3d
|
||||
GetRawCenter(nRawId, ptRawCen)
|
||||
' Calcolo la distanza di movimento
|
||||
Dim dMove As Double = m_dStepMove
|
||||
If m_dCurrDist < m_dStepMove Then
|
||||
Dim dMove As Double = m_dMoveStep
|
||||
If m_dCurrDist < m_dMoveStep Then
|
||||
dMove -= m_dOrigDist
|
||||
End If
|
||||
If (m_vtDir * (ptRawCen - m_ptMid) > 0) Then dMove *= -1
|
||||
@@ -373,7 +402,7 @@ Public Class MoveRawModeVM
|
||||
' Altrimenti movimento Y -
|
||||
Else
|
||||
If m_bRawWithCups Then
|
||||
Dim vtMove As New Vector3d(0, -m_dStepMove, 0)
|
||||
Dim vtMove As New Vector3d(0, -m_dMoveStep, 0)
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
@@ -390,6 +419,76 @@ Public Class MoveRawModeVM
|
||||
|
||||
#End Region ' DownCommand
|
||||
|
||||
#Region "CcwRotCommand"
|
||||
|
||||
Public ReadOnly Property CcwRotCommand As ICommand
|
||||
Get
|
||||
If m_cmdCcwRot Is Nothing Then
|
||||
m_cmdCcwRot = New Command(AddressOf CcwRot)
|
||||
End If
|
||||
Return m_cmdCcwRot
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub CcwRot(ByVal param As Object)
|
||||
' Solo movimento con ventose
|
||||
If OmagOFFICEMap.refMachiningTabVM.ByHand Then Return
|
||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If m_bRawWithCups Then
|
||||
Dim dAng As Double = m_dRotationStep
|
||||
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
|
||||
' Recupero il centro del grezzo
|
||||
Dim ptRawCen As Point3d
|
||||
GetRawCenter(nRawId, ptRawCen)
|
||||
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
||||
End If
|
||||
Else
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
||||
End If
|
||||
nRawId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' CcwRotCommand
|
||||
|
||||
#Region "CwRotCommand"
|
||||
|
||||
Public ReadOnly Property CwRotCommand As ICommand
|
||||
Get
|
||||
If m_cmdCwRot Is Nothing Then
|
||||
m_cmdCwRot = New Command(AddressOf CwRot)
|
||||
End If
|
||||
Return m_cmdCwRot
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub CwRot(ByVal param As Object)
|
||||
' Solo movimento con ventose
|
||||
If OmagOFFICEMap.refMachiningTabVM.ByHand Then Return
|
||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If m_bRawWithCups Then
|
||||
Dim dAng As Double = -m_dRotationStep
|
||||
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
|
||||
' Recupero il centro del grezzo
|
||||
Dim ptRawCen As Point3d
|
||||
GetRawCenter(nRawId, ptRawCen)
|
||||
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
||||
End If
|
||||
Else
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
||||
End If
|
||||
nRawId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' CwRotCommand
|
||||
|
||||
#Region "RemovePartCommand"
|
||||
|
||||
Public ReadOnly Property RemovePartCommand As ICommand
|
||||
|
||||
@@ -890,6 +890,9 @@ Public Class RawPartTabVM
|
||||
CamAuto.AddMachinings(GDB_ID.NULL, True, False)
|
||||
' Aggiorno regioni per nesting
|
||||
EstCalc.UpdateNestRegions()
|
||||
EstCalc.EnableReferenceRegion(False)
|
||||
' Visualizzo i pezzi parcheggiati (per inserire correttamente in parcheggio i pezzi del grezzo)
|
||||
EstCalc.ShowParkedParts()
|
||||
' Verifico ogni singolo pezzo
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(EstCalc.GetRawId())
|
||||
While nPartId <> GDB_ID.NULL
|
||||
@@ -900,7 +903,11 @@ Public Class RawPartTabVM
|
||||
End If
|
||||
nPartId = nNextPartId
|
||||
End While
|
||||
' Nascondo i pezzi parcheggiati
|
||||
EstCalc.HideParkedParts()
|
||||
End If
|
||||
' Disabiliti movimento foto con mouse
|
||||
PhotoWithMouse = False
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -1051,6 +1058,8 @@ Public Class RawPartTabVM
|
||||
ElseIf m_dHeight < EPS_SMALL Then
|
||||
' Se ci sono pezzi
|
||||
If EgtGetFirstPartInRawPart(EstCalc.GetRawId()) <> GDB_ID.NULL Then
|
||||
' Visualizzo i pezzi parcheggiati (per inserire correttamente in parcheggio i pezzi del grezzo)
|
||||
EstCalc.ShowParkedParts()
|
||||
' Parcheggio pezzi presenti nel grezzo e li tolgo da VeinMatcing
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(EstCalc.GetRawId())
|
||||
While nPartId <> GDB_ID.NULL
|
||||
@@ -1449,7 +1458,10 @@ Public Class RawPartTabVM
|
||||
Dim sSlabName As String = String.Empty
|
||||
Dim sMat As String = String.Empty
|
||||
' Carico immagine
|
||||
EstPhoto.LoadPhoto(sPhoto, nSlabId, sSlabName, sMat)
|
||||
If Not EstPhoto.LoadPhoto(sPhoto, nSlabId, sSlabName, sMat) Then
|
||||
' Errore nel caricamento della fotografia
|
||||
MessageBox.Show(EgtMsg(MSG_RAWPARTTAB + 1), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
' Imposto nome lastra
|
||||
SetSlabName(sSlabName)
|
||||
' Carico contorno
|
||||
@@ -1460,6 +1472,8 @@ Public Class RawPartTabVM
|
||||
If m_TypeList.Count = 3 Then m_TypeList.Remove(2)
|
||||
Else
|
||||
If m_TypeList.Count = 2 Then m_TypeList.Add(EgtMsg(MSG_RAWPARTPAGEUC + 35))
|
||||
SelType = Type.FROM_PHOTO
|
||||
NotifyPropertyChanged("SelType")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1672,16 +1686,34 @@ Public Class RawPartTabVM
|
||||
' Determino vettore movimento
|
||||
Dim vtMove As Vector3d = ptCurr - m_ptPrev
|
||||
vtMove.z = 0
|
||||
' In presenza di contorno, verifico non esca dalla tavola
|
||||
Dim nCrvId As Integer = EstPhoto.GetContour()
|
||||
If nCrvId <> GDB_ID.NULL Then
|
||||
Dim b3Crv As New BBox3d
|
||||
EgtGetBBoxGlob(nCrvId, GDB_BB.STANDARD, b3Crv)
|
||||
b3Crv.Move(vtMove)
|
||||
If b3Crv.Min().x < m_ptTableMin.x + 10 * EPS_SMALL Then
|
||||
vtMove.x += m_ptTableMin.x + 10 * EPS_SMALL - b3Crv.Min().x
|
||||
ElseIf b3Crv.Max().x > m_ptTableMin.x + m_dTableLength + 10 * EPS_SMALL Then
|
||||
vtMove.x += m_ptTableMin.x + m_dTableLength - 10 * EPS_SMALL - b3Crv.Max().x
|
||||
End If
|
||||
If b3Crv.Min().y < m_ptTableMin.y + 10 * EPS_SMALL Then
|
||||
vtMove.y += m_ptTableMin.y + 10 * EPS_SMALL - b3Crv.Min().y
|
||||
ElseIf b3Crv.Max().y > m_ptTableMin.y + m_dTableWidth + 10 * EPS_SMALL Then
|
||||
vtMove.y += m_ptTableMin.y + m_dTableWidth - 10 * EPS_SMALL - b3Crv.Max().y
|
||||
End If
|
||||
End If
|
||||
' Muovo eventuale grezzo se da fotografia
|
||||
If SelType = Type.FROM_PHOTO Then
|
||||
If Not EgtMoveRawPart(EstCalc.GetRawId(), vtMove) Then Return
|
||||
End If
|
||||
' Incremento opportunamente l'offset della fotografia
|
||||
Dim dPhotoOffsetX As Double = m_dPhotoOffsetX + vtMove.x
|
||||
Dim dPhotoOffsetY As Double = m_dPhotoOffsetY + vtMove.y
|
||||
Dim dPhotoRot As Double = m_dPhotoRot + 0
|
||||
EstPhoto.UpdatePhoto(dPhotoOffsetX, dPhotoOffsetY, dPhotoRot)
|
||||
' Muovo eventuale contorno
|
||||
Dim nCrvId As Integer = GetContour()
|
||||
If nCrvId <> GDB_ID.NULL Then
|
||||
EgtMove(nCrvId, vtMove, GDB_RT.GLOB)
|
||||
End If
|
||||
If nCrvId <> GDB_ID.NULL Then EgtMove(nCrvId, vtMove, GDB_RT.GLOB)
|
||||
EgtDraw()
|
||||
' Aggiorno interfaccia
|
||||
SetPhotoOffsetX(dPhotoOffsetX)
|
||||
@@ -1705,7 +1737,7 @@ Public Class RawPartTabVM
|
||||
NotifyPropertyChanged("OffsetX")
|
||||
NotifyPropertyChanged("OffsetY")
|
||||
End If
|
||||
' se sposto lato sotto
|
||||
' se sposto lato sotto
|
||||
ElseIf m_nDragEnt = 1 Then
|
||||
Dim dDelta = ptCurr.y - m_ptPrev.y
|
||||
If m_dWidth - dDelta > MIN_RAW_DIM And m_dOffsetY + dDelta > m_dKerf Then
|
||||
@@ -1721,7 +1753,7 @@ Public Class RawPartTabVM
|
||||
NotifyPropertyChanged("Width")
|
||||
NotifyPropertyChanged("OffsetY")
|
||||
End If
|
||||
' se sposto lato a destra
|
||||
' se sposto lato a destra
|
||||
ElseIf m_nDragEnt = 2 Then
|
||||
Dim dDelta = ptCurr.x - m_ptPrev.x
|
||||
If m_dLength + dDelta > MIN_RAW_DIM And
|
||||
@@ -1733,7 +1765,7 @@ Public Class RawPartTabVM
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged("Length")
|
||||
End If
|
||||
' se sposto lato sopra
|
||||
' se sposto lato sopra
|
||||
ElseIf m_nDragEnt = 3 Then
|
||||
Dim dDelta = ptCurr.y - m_ptPrev.y
|
||||
If m_dWidth + dDelta > MIN_RAW_DIM And
|
||||
@@ -1745,7 +1777,7 @@ Public Class RawPartTabVM
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged("Width")
|
||||
End If
|
||||
' se sposto lato a sinistra
|
||||
' se sposto lato a sinistra
|
||||
ElseIf m_nDragEnt = 4 Then
|
||||
Dim dDelta = ptCurr.x - m_ptPrev.x
|
||||
If m_dLength - dDelta > MIN_RAW_DIM And m_dOffsetX + dDelta > m_dKerf Then
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
<GroupBox Header="{Binding MachViewMsg}" Margin="0,0,0,5">
|
||||
<UniformGrid Columns="3">
|
||||
|
||||
<Button Content="{Binding MachModeMsg}"
|
||||
Command="{Binding ToolModeCommand}"
|
||||
Style="{StaticResource OptionPanel_NestingButton}"/>
|
||||
<Button Content="{Binding MachModeMsg}"
|
||||
Command="{Binding HeadModeCommand}"
|
||||
Style="{StaticResource OptionPanel_NestingButton}"/>
|
||||
<Button Command="{Binding ToolModeCommand}"
|
||||
Style="{StaticResource OptionPanel_NestingButton}">
|
||||
<Image Source="/Resources/SimulTab/ToolMode.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding HeadModeCommand}"
|
||||
Style="{StaticResource OptionPanel_NestingButton}">
|
||||
<Image Source="/Resources/SimulTab/HeadMode.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding MachModeCommand}"
|
||||
Style="{StaticResource OptionPanel_NestingButton}">
|
||||
<Image Source="/Resources/SimulTab/MachMode.png" Stretch="Uniform"/>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
@@ -337,10 +337,11 @@ Public Class TopCommandBarVM
|
||||
Dim OtherFiles As New List(Of String)
|
||||
If Not String.IsNullOrWhiteSpace(sCurrProject) Then
|
||||
Dim sCurrProjectDir As String = Path.GetDirectoryName(sCurrProject)
|
||||
If Not String.IsNullOrWhiteSpace(sCurrProjectDir) Then
|
||||
If Not String.IsNullOrWhiteSpace(sCurrProjectDir) AndAlso Directory.Exists(sCurrProjectDir) Then
|
||||
Dim sTitleName As String = Path.GetFileNameWithoutExtension(sCurrProject)
|
||||
Dim TempFiles() As String = Directory.GetFiles(sCurrProjectDir)
|
||||
For FileIndex = 0 To TempFiles.Count - 1
|
||||
If Path.GetFileNameWithoutExtension(TempFiles(FileIndex)).Contains(Path.GetFileNameWithoutExtension(sCurrProject)) AndAlso TempFiles(FileIndex) <> sCurrProject Then
|
||||
If Path.GetFileNameWithoutExtension(TempFiles(FileIndex)).Contains(sTitleName) AndAlso TempFiles(FileIndex) <> sCurrProject Then
|
||||
OtherFiles.Add(TempFiles(FileIndex))
|
||||
End If
|
||||
Next
|
||||
|
||||
Reference in New Issue
Block a user