Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c343b18571 | |||
| f319409261 | |||
| ad7634f52d | |||
| a788f207af | |||
| 601f66187a | |||
| a92822bb87 | |||
| 1a9045a23f | |||
| fb0d35eddf | |||
| c367f1bfe9 | |||
| d789be4547 | |||
| 20e1e9b41c | |||
| b25f065f3c | |||
| 83cf2646cf | |||
| 11bc92bb10 | |||
| 953083e429 | |||
| 132990d705 | |||
| 0477c42208 | |||
| c11925e90f | |||
| d745119195 | |||
| aa283fd190 | |||
| 243125cbb4 | |||
| 2789051005 | |||
| 0b13379731 | |||
| 6cc7ba8ccd | |||
| 36674aeb65 | |||
| 9aa9b51710 | |||
| 15b87d7911 | |||
| c8bf133113 | |||
| faba640eee | |||
| e9ff1c198b | |||
| abc304e25c | |||
| 80f4dc6b83 | |||
| 8f5ef91890 | |||
| 2cef4e6fd8 | |||
| f2fce7a653 | |||
| 7581ae0bdb | |||
| 661ae9f09c | |||
| 44d411819f | |||
| 46134c10b6 | |||
| 36b7ae4843 | |||
| 63b4977c39 | |||
| ae927719c6 |
@@ -108,6 +108,8 @@ Public Class CompoListPageVM
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If m_SideAngle_IsChecked OrElse m_Drip_IsChecked Then Return
|
||||
CompoWindowMap.refCompoSceneHostV.m_SelListHole.Clear()
|
||||
CompoWindowMap.refCompoSceneHostV.m_DeselectListHole.Clear()
|
||||
m_FiloTop_IsChecked = value
|
||||
If value Then
|
||||
' Se non ci sono loop interni, imposto quello esterno
|
||||
@@ -122,6 +124,7 @@ Public Class CompoListPageVM
|
||||
SideEntityControl = New SideEntityControlV(m_SideEntityControlVM)
|
||||
m_CompoListVisibility = Visibility.Collapsed
|
||||
m_CompoBackVisibility = Visibility.Collapsed
|
||||
CompoWindowMap.refCompoSceneHostV.SetRefSideEntityControlVM(m_SideEntityControlVM)
|
||||
Else
|
||||
m_SideEntityControlVM.Close()
|
||||
m_SideEntityControlVM = Nothing
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
</ToggleButton.Content>
|
||||
</ToggleButton>
|
||||
|
||||
<!--FiloTop--><!--
|
||||
<ToggleButton Padding="0"
|
||||
<!--FiloTop-->
|
||||
<!--<ToggleButton Padding="0"
|
||||
IsChecked="{Binding FiloTop_IsChecked}"
|
||||
Style="{StaticResource CompoWindow_ToggleButton}"
|
||||
Margin="0,0,1.75,0"
|
||||
|
||||
@@ -67,8 +67,6 @@ Public Class CompoParamPageVM
|
||||
Private m_AlzAndFront_Visibility As Visibility
|
||||
Public Property AlzAndFront_Visibility As Visibility
|
||||
Get
|
||||
'' !!!! Temporaneamente in attesa di completamento Frontalini e alzatine !!!!
|
||||
'Return Visibility.Collapsed
|
||||
Return m_AlzAndFront_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
@@ -750,6 +748,50 @@ Public Class CompoParamPageVM
|
||||
NotifyPropertyChanged("MsgColor")
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateInLoopReference(nCmp As Integer)
|
||||
' aggiorno il layer "FiloTop"
|
||||
Dim nIdInLoop As Integer = EgtGetFirstNameInGroup(EgtGetFirstGroupInGroup(GDB_ID.ROOT), "InLoop")
|
||||
While nIdInLoop <> GDB_ID.NULL
|
||||
Dim nCmpInfoIL As Integer = 0
|
||||
If EgtGetInfo(nIdInLoop, "ID", nCmpInfoIL) AndAlso nCmp = nCmpInfoIL Then
|
||||
Dim nLayFiloTop As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(nIdInLoop, "FiloTopRef", nLayFiloTop)
|
||||
If nLayFiloTop <> GDB_ID.NULL Then
|
||||
Dim LocalList As New List(Of Integer) From {nIdInLoop}
|
||||
If IsNothing(m_SideEntityControlVM) Then
|
||||
m_SideEntityControlVM = New SideEntityControlVM(SideEntityControlVM.CallingWindowOpt.COMPO,
|
||||
CompoWindowMap.refCompoSceneHostV.CompoScene,
|
||||
SideEntityControlVM.ModeOpt.FILOTOP)
|
||||
m_SideEntityControlVM.CreateFiloTopPreView(LocalList)
|
||||
Else
|
||||
m_SideEntityControlVM.CreateFiloTopPreView(LocalList)
|
||||
End If
|
||||
EgtSetStatus(nLayFiloTop, GDB_ST.ON_)
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
nIdInLoop = EgtGetNextName(nIdInLoop, "InLoop")
|
||||
End While
|
||||
End Sub
|
||||
|
||||
' riceve la info "ID" della componente
|
||||
Public Sub SetStatusVisibilityInLoopReference(nCmp As Integer, Status As GDB_ST)
|
||||
' aggiorno il layer "FiloTop"
|
||||
Dim nIdInLoop As Integer = EgtGetFirstNameInGroup(EgtGetFirstGroupInGroup(GDB_ID.ROOT), "InLoop")
|
||||
While nIdInLoop <> GDB_ID.NULL
|
||||
Dim nCmpInfoIL As Integer = 0
|
||||
If EgtGetInfo(nIdInLoop, "ID", nCmpInfoIL) AndAlso nCmp = nCmpInfoIL Then
|
||||
Dim nLayFiloTop As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(nIdInLoop, "FiloTopRef", nLayFiloTop)
|
||||
If nLayFiloTop <> GDB_ID.NULL Then
|
||||
EgtSetStatus(nLayFiloTop, Status)
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
nIdInLoop = EgtGetNextName(nIdInLoop, "InLoop")
|
||||
End While
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -867,6 +909,7 @@ Public Class CompoParamPageVM
|
||||
Dim nCmpInfo As Integer = 0
|
||||
If EgtGetInfo(nId, "ID", nCmpInfo) AndAlso nCmp = nCmpInfo Then
|
||||
EgtSetStatus(nId, GDB_ST.OFF)
|
||||
UpdateInLoopReference(nCmp)
|
||||
Exit While
|
||||
End If
|
||||
nId = EgtGetNextName(nId, "HoleLabels")
|
||||
|
||||
@@ -3,6 +3,11 @@ Imports EgtWPFLib5
|
||||
|
||||
Public Class CompoSceneHostV
|
||||
|
||||
Public m_SelListHole As New List(Of Integer)
|
||||
Public m_DeselectListHole As New List(Of Integer)
|
||||
|
||||
Private m_refSideEntityControlVM As SideEntityControlVM
|
||||
|
||||
Private m_SelFromScene As Boolean = False
|
||||
Friend ReadOnly Property SelFromScene As Boolean
|
||||
Get
|
||||
@@ -36,6 +41,10 @@ Public Class CompoSceneHostV
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Public Sub SetRefSideEntityControlVM(refSideEntityControl As SideEntityControlVM)
|
||||
m_refSideEntityControlVM = refSideEntityControl
|
||||
End Sub
|
||||
|
||||
Private Sub PreInitializeScene()
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
@@ -156,6 +165,8 @@ Public Class CompoSceneHostV
|
||||
Dim nCmpInfo As Integer = 0
|
||||
If EgtGetInfo(nHLId, "ID", nCmpInfo) AndAlso nCmp = nCmpInfo Then
|
||||
EgtSetStatus(nHLId, GDB_ST.ON_)
|
||||
' nascondo eventuali FiloTop
|
||||
CompoWindowMap.refCompoParamPageVM.SetStatusVisibilityInLoopReference(nCmp, GDB_ST.OFF)
|
||||
Exit While
|
||||
End If
|
||||
nHLId = EgtGetNextName(nHLId, "HoleLabels")
|
||||
@@ -262,6 +273,8 @@ Public Class CompoSceneHostV
|
||||
EgtRemoveInfo(nLayId, INFO_DEPTH)
|
||||
EgtResetColor(nLayId)
|
||||
End If
|
||||
m_DeselectListHole.Add(nLayId)
|
||||
m_SelListHole.Remove(nLayId)
|
||||
Else
|
||||
Dim sLayName As String = ""
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then
|
||||
@@ -272,12 +285,18 @@ Public Class CompoSceneHostV
|
||||
EgtSetInfo(nLayId, INFO_DEPTH, SideAngleEntity.m_Parameter2)
|
||||
EgtSetColor(nLayId, New Color3d(255, 255, 255))
|
||||
End If
|
||||
m_SelListHole.Add(nLayId)
|
||||
m_DeselectListHole.Remove(nLayId)
|
||||
End If
|
||||
EgtDraw()
|
||||
End If
|
||||
End If
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
If Not IsNothing(m_refSideEntityControlVM) Then
|
||||
m_refSideEntityControlVM.CreateFiloTopPreView(m_SelListHole)
|
||||
m_refSideEntityControlVM.EraseFiloTopPreview(m_DeselectListHole)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Events
|
||||
|
||||
@@ -18,6 +18,7 @@ Module ConstIni
|
||||
Public Const S_GENERAL As String = "General"
|
||||
Public Const K_DEBUG As String = "Debug"
|
||||
Public Const K_LICENCE As String = "Licence"
|
||||
Public Const K_NETKEY As String = "NetKey"
|
||||
Public Const K_USERLEVEL As String = "UserLevel"
|
||||
Public Const K_MAXINST As String = "MaxInstances"
|
||||
Public Const K_INSTANCES As String = "Instances"
|
||||
@@ -103,6 +104,7 @@ Module ConstIni
|
||||
Public Const K_ENGRAVENUMBER2 As String = "EngraveNumber2"
|
||||
Public Const K_ENGRAVEDEPTH As String = "EngraveDepth"
|
||||
Public Const K_ENGRAVESHORT As String = "EngraveShort"
|
||||
Public Const K_ENGRAVEDEPTH2 As String = "EngraveDepth2"
|
||||
Public Const K_DRIPOFFSET As String = "DripOffset"
|
||||
Public Const K_DRIPOFFSET2 As String = "DripOffset2"
|
||||
Public Const K_DRIPDEPTH As String = "DripDepth"
|
||||
@@ -110,6 +112,7 @@ Module ConstIni
|
||||
Public Const K_UNDERDRILLDEPTH As String = "UnderDrillDepth"
|
||||
Public Const K_FILOTOPOFFSET As String = "FiloTopOffset"
|
||||
Public Const K_FILOTOPDEPTH As String = "FiloTopDepth"
|
||||
Public Const K_FILOTOPROUNDOFF As String = "FiloTopRoundOff"
|
||||
|
||||
Public Const S_NEST As String = "Nest"
|
||||
Public Const K_DIRECT As String = "Direct"
|
||||
@@ -121,7 +124,7 @@ Module ConstIni
|
||||
Public Const K_TEXTCOLOR As String = "TextColor"
|
||||
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
|
||||
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
|
||||
Public Const K_DRAGRETTANGLE As String = "DragRectangle"
|
||||
Public Const K_DRAGRECTANGLE As String = "DragRectangle"
|
||||
|
||||
Public Const S_SPLIT As String = "Split"
|
||||
Public Const K_MOVE_LEV As String = "MoveLevel"
|
||||
|
||||
@@ -95,6 +95,74 @@ Friend Module CamAuto
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function ResetAllSplitCurv() As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
Dim nIdPart As Integer = EgtGetFirstPart()
|
||||
While nIdPart <> GDB_ID.NULL
|
||||
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
|
||||
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, "AUX_SPLIT_WJ")
|
||||
EgtErase(IdAuxLayer)
|
||||
' accedo al Layer OutLoop
|
||||
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||
While nIdMy <> GDB_ID.NULL
|
||||
EgtRemoveInfo(nIdMy, "JoinEntity")
|
||||
nIdMy = EgtGetNext(nIdMy)
|
||||
End While
|
||||
nIdPart = EgtGetNextPart(nIdPart)
|
||||
End While
|
||||
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
|
||||
nIdPart = EgtGetFirstPartInRawPart(nRawId)
|
||||
While nIdPart <> GDB_ID.NULL
|
||||
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
|
||||
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, "AUX_SPLIT_WJ")
|
||||
EgtErase(IdAuxLayer)
|
||||
' accedo al Layer OutLoop
|
||||
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||
While nIdMy <> GDB_ID.NULL
|
||||
EgtRemoveInfo(nIdMy, "JoinEntity")
|
||||
nIdMy = EgtGetNext(nIdMy)
|
||||
End While
|
||||
nIdPart = EgtGetNextPartInRawPart(nIdPart)
|
||||
End While
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function ResetAllStartCurv() As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
Dim nIdPart As Integer = EgtGetFirstPart()
|
||||
While nIdPart <> GDB_ID.NULL
|
||||
' accedo al Layer OutLoop
|
||||
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||
EgtRemoveInfo(nIdLayerOutLoop, "Start")
|
||||
nIdPart = EgtGetNextPart(nIdPart)
|
||||
End While
|
||||
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
|
||||
nIdPart = EgtGetFirstPartInRawPart(nRawId)
|
||||
While nIdPart <> GDB_ID.NULL
|
||||
' accedo al Layer OutLoop
|
||||
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||
EgtRemoveInfo(nIdLayerOutLoop, "Start")
|
||||
nIdPart = EgtGetNextPartInRawPart(nIdPart)
|
||||
End While
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
' verifico che il contorno passato non sia stato separato
|
||||
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer) As Boolean
|
||||
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||
While nIdMy <> GDB_ID.NULL
|
||||
Dim nValInfo As Integer = 1
|
||||
If EgtGetInfo(nIdMy, "JoinEntity", nValInfo) Then
|
||||
If nValInfo = 0 Then Return False
|
||||
End If
|
||||
EgtRemoveInfo(nIdMy, "JoinEntity")
|
||||
nIdMy = EgtGetNext(nIdMy)
|
||||
End While
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function RemoveFinalEmptyPhases() As Boolean
|
||||
Dim nOpeId As Integer = EgtGetLastOperation()
|
||||
While nOpeId <> GDB_ID.NULL
|
||||
|
||||
@@ -35,6 +35,8 @@ Module ConstMach
|
||||
Public Const KEY_VACLAY_PREFROT As String = "PreferredRot"
|
||||
Public Const KEY_VACLAY_PREFVROTXMINUS As String = "PrefVertRotXMinus"
|
||||
Public Const KEY_VACLAY_PREFVROTXPLUS As String = "PrefVertRotXPlus"
|
||||
Public Const KEY_VACLAY_PREFVROTYMINUS As String = "PrefVertRotYMinus"
|
||||
Public Const KEY_VACLAY_PREFVROTYPLUS As String = "PrefVertRotYPlus"
|
||||
' Info in gruppo layout per direzione di riferimento ventose per tagli da sotto
|
||||
Public Const KEY_VACLAY_DRIPREFDIR As String = "DripRefDir"
|
||||
' Info in asse rotante ventosa per step discreti
|
||||
@@ -158,6 +160,7 @@ Module ConstMach
|
||||
Public Const NAME_PREVIEW As String = "PV"
|
||||
' Info in layer contorno interno per FiloTop
|
||||
Public Const INFO_FILOTOP As String = "FiloTop"
|
||||
Public Const INFO_ROUNDOFF As String = "RoundOff"
|
||||
' Info in entità da tagliare per affondamento
|
||||
Public Const INFO_DEPTH As String = "Depth"
|
||||
Public Const INFO_DEPTH2 As String = "Depth2"
|
||||
@@ -249,6 +252,12 @@ Module ConstMach
|
||||
Public Const SELECT_REGION_LAYER As String = "SelectRegion"
|
||||
' Info in pezzo per stato rotazione
|
||||
Public Const INFO_PARTROT As String = "ROT"
|
||||
' Info in entità in OutLoop per indicare se è separata WaterJet
|
||||
Public Const INFO_JOINTENTITY As String = "JoinEntity"
|
||||
' Nome layer per "*" inidcanti un lato separato nel taglio WaterJet
|
||||
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
|
||||
' Info in OutLoop per punto inzio lavorazione WaterJet
|
||||
Public Const INFO_START As String = "Start"
|
||||
|
||||
' Nome di pezzo che è una cornice
|
||||
Public Const NAME_FRAME As String = "Frame"
|
||||
|
||||
@@ -198,6 +198,10 @@
|
||||
Public Const S_MACH_RAWMOVE As String = "RawMove"
|
||||
Public Const K_MACH_RM_ROTATE As String = "Rotate"
|
||||
Public Const K_MACH_RM_FINALMOVE As String = "FinalMove"
|
||||
Public Const K_MACH_WEIGHT_SINGLEPLUGGER As String = "MaxWeightSinglePlugger"
|
||||
Public Const K_MACH_WEIGHT_DOUBLEPLUGGER As String = "MaxWeightDoublePlugger"
|
||||
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEY As String = "RotateVacuumForExtraStrokeY"
|
||||
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEX As String = "RotateVacuumForExtraStrokeX"
|
||||
|
||||
Public Const S_MACH_REG As String = "Reg"
|
||||
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
|
||||
@@ -260,6 +264,7 @@
|
||||
Public Const K_CURROFFICEMATERIAL As String = "CurrOfficeMaterial"
|
||||
Public Const K_MATERIAL As String = "Material"
|
||||
Public Const K_FROMDBWATERJET As String = "FromDBWaterJet"
|
||||
Public Const K_AVERAGEDENSITY As String = "AverageDensity"
|
||||
|
||||
Public Const S_SETUP As String = "SetUp"
|
||||
Public Const K_DEFAULT As String = "Default"
|
||||
|
||||
@@ -1415,6 +1415,16 @@ Friend Property sCurrMillNoTip As String
|
||||
OmagOFFICEMap.refMachinePanelVM.NotifyPropertyChanged(NameOf(OmagOFFICEMap.refMachinePanelVM.WjDb_Visibility))
|
||||
End Sub
|
||||
|
||||
' recupro dalla lista delle macchine l'oggetto associato al nome indicato
|
||||
Public Sub GetMachineClass(sMachineName As String)
|
||||
For Each Item In OmagOFFICEMap.refMachinePanelVM.MachineList
|
||||
If Item.Name = sMachineName Then
|
||||
OmagOFFICEMap.refMachinePanelVM.SelectedMachine = Item
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
|
||||
Dim TempCurrMat As Material = CurrMat
|
||||
' Svuoto l'attuale lista di materiali e delle qualità
|
||||
|
||||
+134
-1
@@ -10,7 +10,22 @@ Module VacuumCups
|
||||
Private m_dPreferredRot As Double = 0
|
||||
Private m_dPrefVertRotXMinus As Double = 0
|
||||
Private m_dPrefVertRotXPlus As Double = 0
|
||||
Private m_dPrefVertRotYMinus As Double = 0
|
||||
Private m_dPrefVertRotYPlus As Double = 0
|
||||
Private m_dDripRefAng As Double = 0
|
||||
' dati carico massimo manipolatore
|
||||
Private m_RawDensity As Double = 2500
|
||||
Private m_RawWeight As Double = 0
|
||||
Private m_MaxWeightSinglePlugger As Double = 250
|
||||
Private m_MaxWeightDoublePlugger As Double = 750
|
||||
Public bOverWeight As Boolean = False
|
||||
' dati per rotazione ventose vicono al fine corsa Y e X
|
||||
Private bRotateVacuumNearExtraStrokeY As Boolean = False
|
||||
Private bRotateVacuumNearExtraStrokeX As Boolean = False
|
||||
' dati stroke
|
||||
Public bExtraStroke As Boolean = False
|
||||
Public ptStartPointLift As Point3d
|
||||
Public dDegRotStartAng As Double
|
||||
|
||||
' Nome del gruppo temporaneo per le ventose
|
||||
Private Const VACTMP_GRP As String = "VacTmp"
|
||||
@@ -50,6 +65,20 @@ Module VacuumCups
|
||||
Return m_nVacType
|
||||
End Function
|
||||
|
||||
Friend Sub GetWeightInformation(Density As Double, MaxSingle As Double, MaxDouble As Double)
|
||||
m_RawDensity = Density
|
||||
m_MaxWeightSinglePlugger = MaxSingle
|
||||
m_MaxWeightDoublePlugger = MaxDouble
|
||||
End Sub
|
||||
|
||||
Friend Sub GetRotationForExtraStrokeY(Rotate As Boolean)
|
||||
bRotateVacuumNearExtraStrokeY = Rotate
|
||||
End Sub
|
||||
|
||||
Friend Sub GetRotationForExtraStrokeX(Rotate As Boolean)
|
||||
bRotateVacuumNearExtraStrokeX = Rotate
|
||||
End Sub
|
||||
|
||||
Friend Function GetVacuumId() As Integer
|
||||
Return m_nVacId
|
||||
End Function
|
||||
@@ -66,6 +95,8 @@ Module VacuumCups
|
||||
' Identificativo riferimento della testa nella macchina
|
||||
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
|
||||
If nT1Id = GDB_ID.NULL Then Return False
|
||||
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
||||
EgtSetCalcTool("", "H4", 1)
|
||||
' Creo gruppo temporaneo in cui copiarli
|
||||
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
If m_nTempId = GDB_ID.NULL Then Return False
|
||||
@@ -79,6 +110,8 @@ Module VacuumCups
|
||||
' Angoli di rotazione preferiti per ventosa in verticale (lungo Y) a sinistra e a destra del centro tavola
|
||||
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXMINUS, m_dPrefVertRotXMinus)
|
||||
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
|
||||
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYMINUS, m_dPrefVertRotYMinus)
|
||||
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYPLUS, m_dPrefVertRotYPlus)
|
||||
' Direzione di riferimento per tagli Drip
|
||||
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
|
||||
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
|
||||
@@ -165,6 +198,18 @@ Module VacuumCups
|
||||
EgtGetBBoxGlob(nRKerfId, GDB_BB.STANDARD, b3Kerf)
|
||||
Dim ptKerfCen As Point3d
|
||||
EgtCentroid(nRKerfId, GDB_ID.ROOT, ptKerfCen)
|
||||
|
||||
'-------------------- INIZIO CALCOLO PESO --------------------
|
||||
' recupero l'area del grezzo da muovere
|
||||
Dim RawArea As Double = 0
|
||||
' superficie del grezzo senza considerare eventuali fori
|
||||
EgtSurfFrGrossArea(nRKerfId, RawArea)
|
||||
' volume calcolato in mmc
|
||||
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
|
||||
' peso calolato in kg
|
||||
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
|
||||
'-------------------- FINE CALCOLO PESO --------------------
|
||||
|
||||
' Eseguo ricerca
|
||||
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
|
||||
Return True
|
||||
@@ -266,6 +311,7 @@ Module VacuumCups
|
||||
Dim sCups() As String = Nothing
|
||||
Dim sCups2() As String = Nothing
|
||||
If Not GetVacuumCupSelection(nI, sCups, sCups2) Then Return False
|
||||
bExtraStroke = False
|
||||
' Determino validità soluzioni della configurazione
|
||||
Dim vtMove As New Vector3d
|
||||
Dim ptRotCen As New Point3d
|
||||
@@ -368,6 +414,23 @@ Module VacuumCups
|
||||
If b3Vac.IsEmpty() Then Return INFINITO
|
||||
' Se box maggiore di quello del pezzo, scarto soluzione
|
||||
If b3Vac.Radius() > b3Raw.Radius() Then Return INFINITO
|
||||
'-------------------- INIZIO VERIFICA PESO --------------------
|
||||
bOverWeight = False
|
||||
Select Case GetPluggerFromCameras(sCups)
|
||||
Case 2
|
||||
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
|
||||
If m_RawWeight > m_MaxWeightDoublePlugger Then
|
||||
bOverWeight = True
|
||||
Return INFINITO
|
||||
End If
|
||||
Case 1
|
||||
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
|
||||
If m_RawWeight > m_MaxWeightSinglePlugger Then
|
||||
bOverWeight = True
|
||||
Return INFINITO
|
||||
End If
|
||||
End Select
|
||||
'-------------------- FINE VERIFICA PESO --------------------
|
||||
' Recupero l'area della tavola
|
||||
Dim b3Tab As New BBox3d
|
||||
EgtGetTableArea(1, b3Tab)
|
||||
@@ -383,12 +446,19 @@ Module VacuumCups
|
||||
dRotAngDeg = dAngOrizzDeg
|
||||
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
|
||||
Dim dPreferredRot As Double = m_dPreferredRot
|
||||
If Math.Abs(dRotAngDeg - 90) < 45 Or Math.Abs(dRotAngDeg - 270) < 45 Then
|
||||
If bRotateVacuumNearExtraStrokeX And (Math.Abs(dRotAngDeg - 90) < 45 Or Math.Abs(dRotAngDeg - 270) < 45) Then
|
||||
If frMinRect.Orig().x < b3Tab.Center().x Then
|
||||
dPreferredRot = m_dPrefVertRotXMinus
|
||||
Else
|
||||
dPreferredRot = m_dPrefVertRotXPlus
|
||||
End If
|
||||
ElseIf bRotateVacuumNearExtraStrokeY And (Math.Abs(dRotAngDeg - 90) > 45 Or Math.Abs(dRotAngDeg - 270) > 45) Then
|
||||
' se l'orientemanto è orizzontale e la macchina è stata abilitata
|
||||
If frMinRect.Orig().y < b3Tab.Center().y Then
|
||||
dPreferredRot = m_dPrefVertRotYPlus
|
||||
Else
|
||||
dPreferredRot = m_dPrefVertRotYMinus
|
||||
End If
|
||||
End If
|
||||
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
|
||||
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
|
||||
@@ -446,11 +516,53 @@ Module VacuumCups
|
||||
' Applico movimento e rotazione al punto
|
||||
ptRef.Move(vtMove)
|
||||
ptRef.Rotate(ptRotCen, Vector3d.Z_AX(), dRotAngDeg)
|
||||
' -------------- INIZIO verifica di essere nel limite delle corse macchina --------------
|
||||
If VerifyOutOfStrokes(ptRef, dRotAngDeg) <> 0 Then
|
||||
bExtraStroke = True
|
||||
Return INFINITO
|
||||
End If
|
||||
' se la posizione è accettbaile allora salvo i dati
|
||||
ptStartPointLift = ptRef
|
||||
dDegRotStartAng = dRotAngDeg
|
||||
' -------------- FINE verifica di essere nel limite delle corse macchina --------------
|
||||
' Ne calcolo la distanza dal centro della tavola
|
||||
Dim dDist As Double = Point3d.DistXY(ptRef, b3Tab.Center())
|
||||
Return dDist
|
||||
End Function
|
||||
|
||||
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
|
||||
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
|
||||
Dim dX, dY, dZ As Double
|
||||
Dim nStat As Integer
|
||||
Dim dCHome As Double
|
||||
EgtGetAxisHomePos("C", dCHome)
|
||||
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
||||
EgtSetCalcTool("", "H4", 1)
|
||||
EgtGetCalcPositions(ptRef, dRotAngDeg + dCHome, 0, nStat, dX, dY, dZ)
|
||||
EgtVerifyOutstroke(dX, dY, dZ, dRotAngDeg + dCHome, 0, nStat)
|
||||
Return nStat
|
||||
End Function
|
||||
|
||||
' dall'informazione di extra corsa recupera il valore indicato
|
||||
Public Function GetExtraStrokeValue(sInfo As String) As Double
|
||||
Dim dExtraStroke As Double = 0
|
||||
Dim sItems As String() = sInfo.Split("="c)
|
||||
If sItems.Count = 2 Then
|
||||
Dim nStartIndex As Integer = 0
|
||||
For Each ItemChar As Char In sItems(1)
|
||||
If ItemChar = "("c Then
|
||||
Exit For
|
||||
End If
|
||||
nStartIndex += 1
|
||||
Next
|
||||
If nStartIndex > 0 Then
|
||||
Dim sValue As String = sItems(1).Remove(nStartIndex, sItems(1).Count - nStartIndex)
|
||||
StringToLen(sValue, dExtraStroke)
|
||||
End If
|
||||
End If
|
||||
Return dExtraStroke
|
||||
End Function
|
||||
|
||||
Private Function TestVacuumCups(nCups() As Integer, nRawRegId As Integer,
|
||||
vtMove As Vector3d, ptRotCen As Point3d, dRotAngDeg As Double) As Boolean
|
||||
' Eseguo verifica delle ventose rispetto al grezzo
|
||||
@@ -471,6 +583,27 @@ Module VacuumCups
|
||||
Return bVacOk
|
||||
End Function
|
||||
|
||||
Private Function GetPluggerFromCameras(sCups() As String) As Integer
|
||||
Dim nCountPlunger As Integer = 1
|
||||
Dim bPlugger1 As Boolean = False
|
||||
Dim bPlugger2 As Boolean = False
|
||||
For Each Camera As String In sCups
|
||||
If (Camera.Contains("1") Or Camera.Contains("2") Or Camera.Contains("3")) Then
|
||||
bPlugger1 = True
|
||||
Else
|
||||
bPlugger2 = True
|
||||
End If
|
||||
Next
|
||||
' verifico quali sono le camere attive
|
||||
If bPlugger1 And bPlugger2 Then
|
||||
nCountPlunger = 2
|
||||
ElseIf Not bPlugger1 And Not bPlugger2 Then
|
||||
nCountPlunger = 0
|
||||
End If
|
||||
' restituisco il numero di Plugger in uso
|
||||
Return nCountPlunger
|
||||
End Function
|
||||
|
||||
Friend Function SaveOneMoveInfo(nId As Integer, rmData As RawMoveData) As Boolean
|
||||
' Assegno le informazioni
|
||||
EgtSetInfo(nId, "Id", rmData.m_nId)
|
||||
|
||||
@@ -984,7 +984,8 @@ Friend Module VeinMatching
|
||||
' Esporto il file come immagine
|
||||
EgtSetCurrentContext(m_nVeinCtx)
|
||||
Dim bOk As Boolean = (EgtGetFileType(sFilePath) = FT.IMG)
|
||||
bOk = bOk AndAlso EgtGetImage(EgtGetShowMode(), New Color3d(255, 255, 255), New Color3d(255, 255, 255),
|
||||
bOk = bOk AndAlso EgtGetImage(DirectCast( EgtGetShowMode(), EgtInterface.SM),
|
||||
New Color3d(255, 255, 255), New Color3d(255, 255, 255),
|
||||
m_nImgWidth, m_nImgHeight, sFilePath)
|
||||
' Ripristino il contesto originale
|
||||
EgtSetCurrentContext(nMainCtx)
|
||||
|
||||
@@ -95,8 +95,18 @@ Public Class MyMachinePanelVM
|
||||
OmagOFFICEMap.SetRefMachinePanelVM(Me)
|
||||
' recupero cartella radice delle macchine
|
||||
m_sMachinesRoot = OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot
|
||||
' Carica macchine da cartella delle macchine
|
||||
Machine.MachineListInit(m_sMachinesRoot, MachineList)
|
||||
' trasformo l'elenco dei direttori macchina in una stringa del tipo "..\Dir1\Example01|..\Dir2\|Example02"
|
||||
Dim sMchRoots As String = m_sMachinesRoot
|
||||
|
||||
'' Carica macchine da cartella delle macchine
|
||||
'For Each MachDir In OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRootList
|
||||
' sMchRoots &= MachDir & "|"
|
||||
'Next
|
||||
'' rimuovo dalla stringa l'ultimo carattere inserito
|
||||
'sMchRoots = sMchRoots.Remove(sMchRoots.Length - 1, 1)
|
||||
|
||||
' procedo ad inizializzare la classe → carico la lista "MachineList" che visualizzo per l'inserimento di nuvoi MachGroup
|
||||
Machine.MachineListInit(sMchRoots, MachineList)
|
||||
' Inizializzo valori visibilità parametri Db utensili e lavorazioni
|
||||
OmagOFFICETMDbParamVisibility.Init()
|
||||
End Sub
|
||||
|
||||
@@ -86,13 +86,29 @@ Public Class MainWindowM
|
||||
Return m_sTempDir
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'------------------INIZIO Gestione elenco direttori macchine ------------------
|
||||
|
||||
Private m_sMachinesRootList As New List(Of String)
|
||||
Friend ReadOnly Property sMachinesRootList As List(Of String)
|
||||
Get
|
||||
Return m_sMachinesRootList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'------------------FINE Gestione elenco direttori macchine ------------------
|
||||
|
||||
Private m_sMachinesRoot As String
|
||||
Friend ReadOnly Property sMachinesRoot As String
|
||||
Friend Property sMachinesRoot As String
|
||||
Get
|
||||
Return m_sMachinesRoot
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMachinesRoot = value
|
||||
End Set
|
||||
End Property
|
||||
Private m_sToolMakersDir As String
|
||||
|
||||
Friend ReadOnly Property sToolMakersDir As String
|
||||
Get
|
||||
Return m_sToolMakersDir
|
||||
@@ -172,6 +188,18 @@ Public Class MainWindowM
|
||||
If GetMainPrivateProfileString(S_MACH, K_MACHINESDIR, "", m_sMachinesRoot) = 0 Then
|
||||
m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
|
||||
End If
|
||||
|
||||
' carico eleco dei direttori
|
||||
If Not String.IsNullOrEmpty(m_sMachinesRoot) Then m_sMachinesRootList.Add(m_sMachinesRoot)
|
||||
Dim nIndexDir As Integer = 1
|
||||
Dim sCurrMachineDir As String = String.Empty
|
||||
While GetMainPrivateProfileString(S_MACH, K_MACHINESDIR & nIndexDir.ToString, "", sCurrMachineDir) <> 0
|
||||
If VerifyMachineIsUnique(sCurrMachineDir) Then
|
||||
m_sMachinesRootList.Add(sCurrMachineDir)
|
||||
End If
|
||||
nIndexDir += 1
|
||||
End While
|
||||
|
||||
' Impostazione direttorio per toolmakers
|
||||
If GetMainPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", m_sToolMakersDir) = 0 Then
|
||||
m_sToolMakersDir = m_sDataRoot & "\" & TOOLMAKERS_DFL_DIR
|
||||
@@ -192,11 +220,13 @@ Public Class MainWindowM
|
||||
Dim sNestKey As String = ""
|
||||
EgtUILib.GetPrivateProfileString( S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
||||
EgtSetNestKey( sNestKey)
|
||||
Dim bNetHwKey As Boolean = ( GetMainPrivateProfileInt(S_GENERAL, K_NETKEY, 0) = 1)
|
||||
EgtSetNetHwKey( bNetHwKey)
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey)
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2402, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2402, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2406, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2406, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
@@ -267,12 +297,26 @@ Public Class MainWindowM
|
||||
EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString() & " " & bProd.ToString())
|
||||
EgtPHOTOLib.MainData.SetConfigDir(m_sConfigDir)
|
||||
EgtPHOTOLib.MainData.SetKeyLevel(m_nKeyLevel)
|
||||
EgtPHOTOLib.MainData.SetKeyOptions( CInt( m_nKeyOptions))
|
||||
EgtPHOTOLib.MainData.SetKeyOptions(CInt(m_nKeyOptions))
|
||||
EgtPHOTOLib.MainData.SetPhotoDir(m_sPhotoDir)
|
||||
EgtPHOTOLib.MainData.SetBackUpDir(m_sBackUpDir)
|
||||
EgtPHOTOLib.MainData.SetIsOmagOFFICE(True)
|
||||
EgtPHOTOLib.MainData.SetUser(Environment.MachineName & "\" & Environment.UserName & " (" & nInstance.ToString() & ")")
|
||||
Dim sIdKey As String = String.Empty
|
||||
EgtGetKeyInfo(sIdKey)
|
||||
EgtPHOTOLib.MainData.SetKey(sIdKey)
|
||||
End Sub
|
||||
|
||||
' verifico che il nome da inserire non esista già in elenco
|
||||
Private Function VerifyMachineIsUnique(sMachDir As String) As Boolean
|
||||
For Each sDir As String In m_sMachinesRootList
|
||||
If sDir.ToLower.Trim = sMachDir.ToLower.Trim Then
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub ManageInstance()
|
||||
Dim bCreated As Boolean
|
||||
Try
|
||||
|
||||
@@ -69,6 +69,6 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.2.3")>
|
||||
<Assembly: AssemblyFileVersion("2.4.2.3")>
|
||||
<Assembly: AssemblyVersion("2.4.6.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.6.1")>
|
||||
|
||||
|
||||
@@ -38,8 +38,7 @@ Public Class MyMachGroupPanelVM
|
||||
GetMainPrivateProfileString(S_MACH, K_CURRMACH, "", sDefaultMachine)
|
||||
' Creo riferimento a questa classe in OmagOFFICEMap
|
||||
OmagOFFICEMap.SetRefMachGroupPanelVM(Me)
|
||||
InitMachGroupPanel(True, OmagOFFICEMap.refMachinePanelVM.MachineList.ToList(),
|
||||
sDefaultMachine, BASE_MACH_GROUP & "1")
|
||||
InitMachGroupPanel(True, OmagOFFICEMap.refMachinePanelVM.MachineList.ToList(), sDefaultMachine, BASE_MACH_GROUP & "1")
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -99,6 +98,8 @@ Public Class MyMachGroupPanelVM
|
||||
' Salvo macchina del gruppo come nuovo default
|
||||
Dim sCurrMachName As String = String.Empty
|
||||
EgtGetCurrMachineName(sCurrMachName)
|
||||
CurrentMachine.GetMachineClass(sCurrMachName)
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
|
||||
WriteMainPrivateProfileString(S_MACH, K_CURRMACH, sCurrMachName)
|
||||
' Ricarico la macchina corrente
|
||||
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, sCurrMachName,
|
||||
@@ -111,7 +112,7 @@ Public Class MyMachGroupPanelVM
|
||||
Dim nTabInd As Integer = 1
|
||||
Dim nTabCnt As Integer = CamAuto.GetTableCount()
|
||||
If nTabCnt > 1 And nTabCnt <= 3 Then
|
||||
Dim dlg As New SelectTableWindowV(Application.Current.MainWindow, New SelectTableWindowVM(nTabCnt))
|
||||
Dim dlg As New SelectTableWindowV(Application.Current.MainWindow, New SelectTableWindowVM(DirectCast(nTabCnt, SelectTableWindowVM.TableNumOpt)))
|
||||
dlg.ShowDialog()
|
||||
nTabInd = dlg.m_SelTable
|
||||
End If
|
||||
@@ -152,6 +153,8 @@ Public Class MyMachGroupPanelVM
|
||||
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
|
||||
' Imposto vista solo tavola
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
CurrentMachine.GetMachineClass(SelectedMachGroup.Machine)
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
|
||||
' Ricarico la macchina corrente
|
||||
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, SelectedMachGroup.Machine,
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
|
||||
@@ -248,6 +251,10 @@ Public Class MyMachGroupPanelVM
|
||||
' aggiungo alla lista delle lastre correnti/orig
|
||||
Dim sSlabNameDB As String = GetSlabName()
|
||||
LoadSlabsList(sSlabNameDB)
|
||||
|
||||
' imposto la visibilità dei comandi per il waterjet
|
||||
OmagOFFICEMap.refNestingTabVM.Set_WJ_Cmd_Visibility()
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
@@ -223,6 +223,8 @@ Public Class MySceneHostVM
|
||||
End Sub
|
||||
|
||||
Private Function ExecExport(sDirDest As String) As Boolean
|
||||
' salvo il nome della macchina correntemente selezionata
|
||||
Dim CurrentSelectedMachGroup As String = OmagOFFICEMap.refMachGroupPanelVM.SelectedMachGroup.Machine
|
||||
' Path completa del progetto corrente
|
||||
Dim sFilePath As String = String.Empty
|
||||
EgtGetCurrFilePath(sFilePath)
|
||||
@@ -282,10 +284,10 @@ Public Class MySceneHostVM
|
||||
File.Copy(sOriPath, sNewPath, True)
|
||||
Catch ex As Exception
|
||||
bOk = False
|
||||
EgtOutLog( "Slab image not found :" & sOriPath)
|
||||
EgtOutLog("Slab image not found :" & sOriPath)
|
||||
End Try
|
||||
EgtSetName(nPhotoId, PHOTO_NAME)
|
||||
EgtChangePhotoCenterAsFlatScan( nPhotoId)
|
||||
EgtChangePhotoCenterAsFlatScan(nPhotoId)
|
||||
End If
|
||||
' Elimino gli altri gruppi di lavorazioni
|
||||
For Each nMGrpId As Integer In vMchGrps
|
||||
@@ -308,6 +310,27 @@ Public Class MySceneHostVM
|
||||
Dim nMarkId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nMarkId, NAME_PROJMARK)
|
||||
EgtSetLevel(nMarkId, GDB_LV.SYSTEM)
|
||||
' Imposto la macchina: salvo l'altezza della sovratavola
|
||||
Dim sMachine As String = String.Empty
|
||||
EgtGetInfo(nMchGrpId, "Machine", sMachine)
|
||||
If Not String.IsNullOrEmpty(sMachine) Then
|
||||
CurrentMachine.GetMachineClass(sMachine)
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
|
||||
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, sMachine,
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_MILL),
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_POLISHING),
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_WJ),
|
||||
True)
|
||||
Select Case GetCurrentTable()
|
||||
Case 3
|
||||
EgtSetInfo(nMarkId, K_TAB3_ADDITIONALTABLE, CurrentMachine.dAdditionalTable)
|
||||
Case 2
|
||||
EgtSetInfo(nMarkId, K_TAB2_ADDITIONALTABLE, CurrentMachine.dAdditionalTable)
|
||||
Case Else
|
||||
EgtSetInfo(nMarkId, K_ADDITIONALTABLE, CurrentMachine.dAdditionalTable)
|
||||
End Select
|
||||
End If
|
||||
Dim nReducedCut As Integer = 1
|
||||
EgtGetInfo(nMchGrpId, INFO_REDUCEDCUT, nReducedCut)
|
||||
EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut)
|
||||
@@ -326,6 +349,15 @@ Public Class MySceneHostVM
|
||||
' Salvo il file
|
||||
If Not EgtSaveFile(sFileDest, NGE.CMPTEXT) Then bOk = False
|
||||
Next
|
||||
CurrentMachine.GetMachineClass(CurrentSelectedMachGroup)
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
|
||||
' reimposto la macchina corrente
|
||||
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, CurrentSelectedMachGroup,
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_MILL),
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_POLISHING),
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_WJ),
|
||||
True)
|
||||
' Distruggo il contesto corrente e ripristino quello originale
|
||||
EgtSetCurrentContext(nCurrCtx)
|
||||
EgtDeleteContext(nCtx)
|
||||
|
||||
@@ -224,13 +224,17 @@ Public Class MachiningTabVM
|
||||
End Property
|
||||
|
||||
Public Sub Prev(ByVal param As Object)
|
||||
Dim bOk As Boolean = True
|
||||
' Dichiaro solo visualizzazione
|
||||
m_bIsShow = True
|
||||
If m_MachiningMode = MachiningModeOpt.SPLIT Then
|
||||
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
|
||||
Else
|
||||
OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
|
||||
' verifico collisione dei pezzi in fase di scarico
|
||||
bOk = OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
|
||||
End If
|
||||
' se trovata interferenza tra grezzi (dopo movimentazione) esco
|
||||
If Not bOk Then Return
|
||||
' Torno alla fase precedente
|
||||
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
|
||||
' Si va sempre in Split
|
||||
@@ -255,19 +259,22 @@ Public Class MachiningTabVM
|
||||
End Property
|
||||
|
||||
Public Sub NextCmd(ByVal param As Object)
|
||||
Dim bOk As Boolean = True
|
||||
If m_MachiningMode = MachiningModeOpt.SPLIT Then
|
||||
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
|
||||
MachiningMode = MachiningModeOpt.MOVERAWPART
|
||||
AutoVisibility = Visibility.Hidden
|
||||
OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
|
||||
bOk = OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
|
||||
Else
|
||||
OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
|
||||
' se verificata una interferenza allora esco
|
||||
bOk = OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
|
||||
If Not bOk Then Return
|
||||
MachiningMode = MachiningModeOpt.SPLIT
|
||||
AutoVisibility = Visibility.Visible
|
||||
OmagOFFICEMap.refSplitModeVM.InitSplitRaw()
|
||||
End If
|
||||
' Aggiorno possibilità di uscire
|
||||
ManageExit()
|
||||
' Se non ci sono interferenze tra i grezzi -> aggiorno possibilità di uscire
|
||||
If bOk Then ManageExit()
|
||||
End Sub
|
||||
|
||||
#End Region ' NextCommand
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
IsMinimizable="False"
|
||||
ShowInTaskbar="False"
|
||||
Title="{Binding Title}"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Height="200" Width="400"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
@@ -3,6 +3,15 @@ Imports EgtUILib
|
||||
|
||||
Public Class ModifStartEndCutWindowVM
|
||||
|
||||
Private m_Title As String = String.Empty
|
||||
Public Property Title As String
|
||||
Get
|
||||
Return m_Title
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Title = value
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property ValueMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_SPLITPAGEUC + 35)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
IsMinimizable="False"
|
||||
ShowInTaskbar="False"
|
||||
Title="{Binding Title}"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Height="400" Width="400"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
@@ -6,6 +6,15 @@ Imports EgtWPFLib5
|
||||
Public Class ModifStartEndWjWindowVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_Title As String = String.Empty
|
||||
Public Property Title As String
|
||||
Get
|
||||
Return m_Title
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Title = value
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property ValueMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_SPLITPAGEUC + 35)
|
||||
|
||||
@@ -17,6 +17,7 @@ Public Class MoveRawModeVM
|
||||
Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi
|
||||
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_CurrRawOnVacuum As Integer = GDB_ID.NULL ' identificativo pezzo correntemente attaccato alle ventose
|
||||
|
||||
Private m_dMoveStep As Double
|
||||
Public Property MoveStep As String
|
||||
@@ -108,6 +109,17 @@ Public Class MoveRawModeVM
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Function InitMoveRaw() As Boolean
|
||||
'' verifico che il pezzo sia depositabile
|
||||
'If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||
' ' mantengo la selezione del pezzo
|
||||
' EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||
' OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
||||
' EgtDraw()
|
||||
' ' non cambio pagina
|
||||
' Return False
|
||||
'End If
|
||||
' resetto l'inidice del pezzo da mnovimentare
|
||||
m_CurrRawOnVacuum = GDB_ID.NULL
|
||||
' Deseleziono tutto
|
||||
EgtDeselectAll()
|
||||
' Recupero i tagli allungati prima definiti
|
||||
@@ -158,14 +170,14 @@ Public Class MoveRawModeVM
|
||||
' Distanza iniziale
|
||||
m_dCurrDist = 0
|
||||
End If
|
||||
' Non dovrebbe mai accadere, ma inizializzo con default
|
||||
' Non dovrebbe mai accadere, ma inizializzo con default
|
||||
Else
|
||||
m_vtDir = Vector3d.Y_AX()
|
||||
m_ptMid = Point3d.ORIG()
|
||||
m_dOrigDist = 0
|
||||
m_dCurrDist = 0
|
||||
End If
|
||||
' Altrimenti movimento con ventose
|
||||
' Altrimenti movimento con ventose
|
||||
Else
|
||||
m_bRemovedRaw = False
|
||||
m_bRawWithCups = False
|
||||
@@ -182,7 +194,7 @@ Public Class MoveRawModeVM
|
||||
If OmagOFFICEMap.refMachiningTabVM.ByHand Then
|
||||
LRArrowVisibility = Visibility.Hidden
|
||||
RotationVisibility = Visibility.Hidden
|
||||
' Altrimenti per movimento con ventose
|
||||
' Altrimenti per movimento con ventose
|
||||
Else
|
||||
LRArrowVisibility = Visibility.Visible
|
||||
RotationVisibility = If(CurrentMachine.bRawSplMovRotate, Visibility.Visible, Visibility.Hidden)
|
||||
@@ -195,6 +207,17 @@ Public Class MoveRawModeVM
|
||||
End Function
|
||||
|
||||
Friend Function ExitMoveRaw() As Boolean
|
||||
' verifico che il pezzo sia depositabile
|
||||
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||
' mantengo la selezione del pezzo
|
||||
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
||||
EgtDraw()
|
||||
' non cambio pagina
|
||||
Return False
|
||||
End If
|
||||
' resetto l'inidice del pezzo da mnovimentare
|
||||
m_CurrRawOnVacuum = GDB_ID.NULL
|
||||
' Deseleziono tutto
|
||||
EgtDeselectAll()
|
||||
' Se movimento con ventose
|
||||
@@ -249,6 +272,141 @@ Public Class MoveRawModeVM
|
||||
NotifyPropertyChanged("MoveStep")
|
||||
End Sub
|
||||
|
||||
' verifica che la posizione di rialascio sia corretta, altrimenti coreggo il vettore di posizione
|
||||
Private Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
' determino il punto finale dello spostamento
|
||||
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
|
||||
ptEndPointLift.x += vtMove.x
|
||||
ptEndPointLift.y += vtMove.y
|
||||
Dim sInfo As String = String.Empty
|
||||
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, VacuumCups.dDegRotStartAng)
|
||||
Case 1
|
||||
' extra corsa sulla x-: devo ridurre del valore di extra corsa
|
||||
EgtGetOutstrokeInfo(sInfo)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||
ptEndPointLift.x -= vtMove.x
|
||||
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
|
||||
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
|
||||
vtMove.x = 0
|
||||
Else
|
||||
vtMove.x -= dMaxMove - EPS_SMALL * 100
|
||||
End If
|
||||
ptEndPointLift.x += vtMove.x
|
||||
bOk = False
|
||||
Case 2
|
||||
' extra corsa sulla x+: devo ridurre del valore di extra corsa
|
||||
EgtGetOutstrokeInfo(sInfo)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||
ptEndPointLift.x -= vtMove.x
|
||||
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
|
||||
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
|
||||
vtMove.x = 0
|
||||
Else
|
||||
vtMove.x -= dMaxMove + EPS_SMALL * 100
|
||||
End If
|
||||
ptEndPointLift.x += vtMove.x
|
||||
bOk = False
|
||||
Case 4
|
||||
' extra corsa sulla y-
|
||||
EgtGetOutstrokeInfo(sInfo)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||
ptEndPointLift.y -= vtMove.y
|
||||
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
|
||||
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
|
||||
vtMove.y = 0
|
||||
Else
|
||||
vtMove.y -= dMaxMove - EPS_SMALL * 100
|
||||
End If
|
||||
ptEndPointLift.y += vtMove.y
|
||||
bOk = False
|
||||
Case 8
|
||||
' extra corsa sulla y+
|
||||
EgtGetOutstrokeInfo(sInfo)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||
ptEndPointLift.y -= vtMove.y
|
||||
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
|
||||
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
|
||||
vtMove.y = 0
|
||||
Else
|
||||
vtMove.y -= dMaxMove + EPS_SMALL * 100
|
||||
End If
|
||||
ptEndPointLift.y += vtMove.y
|
||||
bOk = False
|
||||
End Select
|
||||
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
|
||||
VacuumCups.ptStartPointLift = ptEndPointLift
|
||||
Return bOk
|
||||
End Function
|
||||
' verifica che la posizione di rialascio sia corretta, altrimenti coreggo l'angolo di posizione
|
||||
Private Function VerifyReleasdAngleIsValid(ByRef dAngDeg As Double, ByVal ptCenter As Point3d) As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
' determino il punto finale dello spostamento
|
||||
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
|
||||
Dim dDegRotEndAng As Double = VacuumCups.dDegRotStartAng + dAngDeg
|
||||
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
|
||||
Dim sInfo As String = String.Empty
|
||||
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, dDegRotEndAng)
|
||||
Case 16
|
||||
' extra corsa sulla c-
|
||||
EgtGetOutstrokeInfo(sInfo)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
|
||||
dDegRotEndAng -= dAngDeg
|
||||
dAngDeg += VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
|
||||
dDegRotEndAng += dAngDeg
|
||||
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
|
||||
bOk = False
|
||||
Case 34
|
||||
' extra corsa sulla c+
|
||||
EgtGetOutstrokeInfo(sInfo)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
|
||||
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
|
||||
dDegRotEndAng -= dAngDeg
|
||||
dAngDeg -= VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
|
||||
dDegRotEndAng += dAngDeg
|
||||
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
|
||||
bOk = False
|
||||
End Select
|
||||
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
|
||||
VacuumCups.ptStartPointLift = ptEndPointLift
|
||||
VacuumCups.dDegRotStartAng = dDegRotEndAng
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
' Veririfica che il grezzo non entri in colliosione con altri pezzi
|
||||
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
|
||||
If nIdOnVacumm = GDB_ID.NULL Then Return False
|
||||
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
|
||||
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
||||
If m_nTempId = GDB_ID.NULL Then Return False
|
||||
EgtSetName(m_nTempId, "RawTemp")
|
||||
Dim nIdActualRawOutLine As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawOutline")
|
||||
Dim ActualRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdActualRawOutLine)
|
||||
Dim nCurrPhase As Integer = EgtGetCurrPhase()
|
||||
Dim nRawGroupId = EgtGetParent(EgtGetFirstRawPart())
|
||||
Dim nIdRaw As Integer = EgtGetFirstRawPart()
|
||||
' ciclo su tutti i grezzi per veririficare eventuali collisioni
|
||||
While nIdRaw <> GDB_ID.NULL
|
||||
' verifico la fase del grezzo
|
||||
If EgtVerifyRawPartCurrPhase(nIdRaw) And nIdOnVacumm <> nIdRaw Then
|
||||
' recupero il contorno del pezzo
|
||||
Dim nIdRawOutLine As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawOutline")
|
||||
Dim nIdRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdRawOutLine)
|
||||
If EgtSurfFrIntersect(nIdRawFlatRegion, ActualRawFlatRegion) Then
|
||||
If EgtExistsObj(nIdRawFlatRegion) Then
|
||||
EgtErase(m_nTempId)
|
||||
' esiste una intersezione delle superfici
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
nIdRaw = EgtGetNextRawPart(nIdRaw)
|
||||
End While
|
||||
EgtErase(m_nTempId)
|
||||
Return False
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -286,9 +444,15 @@ Public Class MoveRawModeVM
|
||||
Else
|
||||
If m_bRawWithCups Then
|
||||
Dim vtMove As New Vector3d(0, m_dMoveStep, 0)
|
||||
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
VerifyReleasdPositionIsValid(vtMove)
|
||||
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.y -= vtMove.y
|
||||
End If
|
||||
Else
|
||||
' Pezzo troppo piccolo : non si può muovere
|
||||
@@ -320,9 +484,15 @@ Public Class MoveRawModeVM
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If m_bRawWithCups Then
|
||||
Dim vtMove As New Vector3d(-m_dMoveStep, 0, 0)
|
||||
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
VerifyReleasdPositionIsValid(vtMove)
|
||||
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.x -= vtMove.x
|
||||
End If
|
||||
Else
|
||||
' Pezzo troppo piccolo : non si può muovere
|
||||
@@ -353,9 +523,15 @@ Public Class MoveRawModeVM
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If m_bRawWithCups Then
|
||||
Dim vtMove As New Vector3d(m_dMoveStep, 0, 0)
|
||||
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
VerifyReleasdPositionIsValid(vtMove)
|
||||
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.x -= vtMove.x
|
||||
End If
|
||||
Else
|
||||
' Pezzo troppo piccolo : non si può muovere
|
||||
@@ -403,9 +579,15 @@ Public Class MoveRawModeVM
|
||||
Else
|
||||
If m_bRawWithCups Then
|
||||
Dim vtMove As New Vector3d(0, -m_dMoveStep, 0)
|
||||
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
VerifyReleasdPositionIsValid(vtMove)
|
||||
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.y -= vtMove.y
|
||||
End If
|
||||
Else
|
||||
' Pezzo troppo piccolo : non si può muovere
|
||||
@@ -437,12 +619,19 @@ Public Class MoveRawModeVM
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If m_bRawWithCups Then
|
||||
Dim dAng As Double = m_dRotationStep
|
||||
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||
' Recupero il centro del grezzo
|
||||
Dim ptRawCen As Point3d
|
||||
EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
VerifyReleasdAngleIsValid(dAng, ptRawCen)
|
||||
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
|
||||
' Recupero il centro del grezzo
|
||||
Dim ptRawCen As Point3d
|
||||
EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
|
||||
VacuumCups.dDegRotStartAng -= dAng
|
||||
End If
|
||||
Else
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
||||
@@ -472,12 +661,19 @@ Public Class MoveRawModeVM
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If m_bRawWithCups Then
|
||||
Dim dAng As Double = -m_dRotationStep
|
||||
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||
' Recupero il centro del grezzo
|
||||
Dim ptRawCen As Point3d
|
||||
EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
VerifyReleasdAngleIsValid(dAng, ptRawCen)
|
||||
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
|
||||
' Recupero il centro del grezzo
|
||||
Dim ptRawCen As Point3d
|
||||
EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
|
||||
VacuumCups.dDegRotStartAng -= dAng
|
||||
End If
|
||||
Else
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
||||
@@ -545,17 +741,49 @@ Public Class MoveRawModeVM
|
||||
' Se trovato il grezzo
|
||||
If nParentId = nRawGroupId Then
|
||||
Dim nStat As Integer = GDB_ST.ON_
|
||||
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
|
||||
EgtGetStatus(nId, nStat)
|
||||
If nStat = GDB_ST.SEL Then
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
' Se con ventose, le nascondo
|
||||
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola
|
||||
If VerifyCollisionWithOtherRawPart(nId) Then
|
||||
' mantengo la selezione del pezzo
|
||||
EgtSetStatus(nId, GDB_ST.SEL)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
||||
Else
|
||||
' Se con ventose, le nascondo
|
||||
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
' verifico che il pezzo precedente possa essere depositato correttamente
|
||||
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||
' mantengo la selezione del pezzo
|
||||
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
||||
EgtDraw()
|
||||
' esco dal ciclo, prima devo depositare correttamente il pezzo
|
||||
Exit While
|
||||
End If
|
||||
' salvo l'indice del pezzo correntemente attaccato alle ventose
|
||||
m_CurrRawOnVacuum = nId
|
||||
|
||||
EgtDeselectAll()
|
||||
EgtSetStatus(nId, GDB_ST.SEL)
|
||||
' Se con ventose, le posiziono sul grezzo
|
||||
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then
|
||||
Dim rmData As New RawMoveData
|
||||
' inizializzo i dati del grezzo per il cacolo del peso
|
||||
Dim MaxSinglePlugger As Double = 250
|
||||
MaxSinglePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_SINGLEPLUGGER, MaxSinglePlugger, sMachIniFile)
|
||||
Dim MaxDoublePlugger As Double = 750
|
||||
MaxDoublePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_DOUBLEPLUGGER, MaxDoublePlugger, sMachIniFile)
|
||||
Dim AverageDensity As Double = 2700
|
||||
AverageDensity = GetPrivateProfileDouble(S_MATERIALS, K_AVERAGEDENSITY, AverageDensity, sMachIniFile)
|
||||
VacuumCups.GetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
|
||||
VacuumCups.GetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, sMachIniFile) <> 0)
|
||||
VacuumCups.GetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, sMachIniFile) <> 0)
|
||||
If PutVacuumCupsOnRaw(nId, rmData) Then
|
||||
' Visualizzo le ventose
|
||||
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
||||
@@ -565,10 +793,19 @@ Public Class MoveRawModeVM
|
||||
' Reset eventuale messaggio
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
Else
|
||||
' Visualizzo le ventose
|
||||
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||
' Aggiorno i dati
|
||||
m_bRawWithCups = False
|
||||
' Messaggio di avvertimento (Pezzo troppo piccolo : non si può muovere)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
||||
If VacuumCups.bOverWeight Then
|
||||
' Messaggio di avvertimento (Pezzo troppo piccolo : non si può muovere)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 4), 3, MSG_TYPE.WARNING)
|
||||
ElseIf VacuumCups.bExtraStroke Then
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 5), 3, MSG_TYPE.WARNING) 'Pezzo oltre le corse : non si può muovere
|
||||
Else
|
||||
' Messaggio di avvertimento (Pezzo troppo piccolo : non si può muovere)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -577,6 +814,15 @@ Public Class MoveRawModeVM
|
||||
End If
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
|
||||
' clicco su un oggetto che non è un grezzo -> verifico che il pezzo precedente possa essere depositato correttamente
|
||||
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||
' mantengo la selezione del pezzo
|
||||
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
||||
EgtDraw()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
@@ -29,11 +29,13 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Grid.Column="1"
|
||||
IsEnabled="{Binding bEnabledCommandMove}"
|
||||
Style="{StaticResource OptionPanel_Button}"
|
||||
Command="{Binding MoveUpCommand}">
|
||||
<Image Source="/Resources/MachiningTab/UpArrow.png"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
IsEnabled="{Binding bEnabledCommandMove}"
|
||||
Style="{StaticResource OptionPanel_Button}"
|
||||
Command="{Binding MoveDownCommand}">
|
||||
<Image Source="/Resources/MachiningTab/DownArrow.png"/>
|
||||
|
||||
@@ -42,6 +42,17 @@ Public Class SplitModeVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_bEnabledCommandMove As Boolean = False
|
||||
Public Property bEnabledCommandMove As Boolean
|
||||
Get
|
||||
Return m_bEnabledCommandMove
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bEnabledCommandMove = value
|
||||
NotifyPropertyChanged("bEnabledCommandMove")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SplitModeIsEnabled As Boolean
|
||||
Public Property SplitModeIsEnabled As Boolean
|
||||
Get
|
||||
@@ -584,8 +595,32 @@ Public Class SplitModeVM
|
||||
' assegno numerazione
|
||||
NumberDirectionMachining(nI)
|
||||
Next
|
||||
' -------------------- Recupero le lavorazioni indicate come attive --------------------
|
||||
Dim ActiveMachLst As New List(Of Integer)
|
||||
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
||||
ActiveMachLst.Add(ItemSplitMach.Ind)
|
||||
Next
|
||||
' -------------------- Recupero le lavorazioni indicate come attive --------------------
|
||||
' Preparo la lista degli Item
|
||||
ShowMachiningList()
|
||||
' -------------------- Riattivo le lavorazioni precedenti --------------------
|
||||
For Each Item As SplitMach In m_MachiningList
|
||||
EgtSetInfo(Item.m_nId, INFO_MCH_USER_OFF, True)
|
||||
Next
|
||||
|
||||
For nIndex As Integer = 0 To ActiveMachLst.Count - 1
|
||||
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
||||
If ItemSplitMach.Ind = ActiveMachLst(nIndex) Then
|
||||
EgtRemoveInfo(m_MachiningList(ItemSplitMach.Ind).m_nId, INFO_MCH_USER_OFF)
|
||||
m_MachiningList(ItemSplitMach.Ind).m_bEnabled = True
|
||||
ItemSplitMach.bIsActive = True
|
||||
' sistemo colore
|
||||
ColorMachining(m_MachiningList(ItemSplitMach.Ind))
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
' -------------------- Riattivo le lavorazioni precedenti --------------------
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
' Aggiono abilitazione bottoni
|
||||
@@ -786,6 +821,15 @@ Public Class SplitModeVM
|
||||
vtXY.Normalize()
|
||||
Dim ptCen As Point3d = Point3d.Media(ptMin, ptMax) + vtXY * If(Not b2ndLav, -0.8, 0.8) * dHtxt
|
||||
ptCen.z = ptMax.z + 1
|
||||
|
||||
' ricavo la posizione del punto (se waterjet separata)
|
||||
If m_MachiningList(nI).m_nType = MCH_OY.WATERJETTING Or m_MachiningList(nI).m_nType = MCH_OY.MILLING Then
|
||||
Dim ptMid As Point3d
|
||||
Dim vVers As Vector3d
|
||||
MidPointOfCurve(m_MachiningList(nI).m_nId, ptMid, vVers)
|
||||
ptCen = ptMid ' + vVers * If(Not b2ndLav, -0.8, 0.8) * dHtxt
|
||||
End If
|
||||
|
||||
If bNumber Then
|
||||
Dim nNbrId As Integer = EgtCreateTextAdv(m_nNbrGrpId, ptCen, 0, (nI + 1).ToString(), "",
|
||||
300, False, dHtxt, dRat, 0, INS_POS.MC)
|
||||
@@ -840,6 +884,36 @@ Public Class SplitModeVM
|
||||
Return EgtGetBBoxGlob(nPvId, GDB_BB.STANDARD, ptMin, ptMax)
|
||||
End Function
|
||||
|
||||
Private Function MidPointOfCurve(nOperId As Integer, ByRef ptMid As Point3d, ByRef vVers As Vector3d) As Boolean
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
' creo un layer ausiliario per creare la curva composita
|
||||
Dim AuxLayer As Integer = EgtCreateGroup(nPvId)
|
||||
' imposto la lavorazione corrente
|
||||
EgtSetCurrMachining(nOperId)
|
||||
' recupero tutte le entità della lavorazione corrente
|
||||
Dim nInd As Integer = 0
|
||||
Dim nIdCurr As Integer
|
||||
Dim nSub As Integer
|
||||
Dim CurveCompoList As New List(Of Integer)
|
||||
While EgtGetMachiningGeometry(nInd, nIdCurr, nSub)
|
||||
CurveCompoList.Add(nIdCurr)
|
||||
nInd += 1
|
||||
End While
|
||||
Dim PtNearStart As Point3d
|
||||
Dim nIdCutPath As Integer = EgtCreateCurveCompoByChain(AuxLayer, CurveCompoList.ToArray, PtNearStart, False)
|
||||
Dim dLength As Double = 0
|
||||
EgtCurveLength(nIdCutPath, dLength)
|
||||
Dim dParam As Double = 0
|
||||
EgtCurveParamAtLength(nIdCutPath, dLength / 2, dParam)
|
||||
EgtAtParamPoint(nIdCutPath, dParam, GDB_RT.GLOB, ptMid)
|
||||
EgtAtParamVector(nIdCutPath, dParam, -1, vVers)
|
||||
vVers.Normalize()
|
||||
vVers.Rotate(Vector3d.Z_AX, 90)
|
||||
EgtErase(AuxLayer)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function AddMachiningDirection(ptStart As Point3d, vtDir As Vector3d, dLen As Double, bTwin As Boolean) As Integer
|
||||
Dim dArrX As Double = dLen * Math.Cos(30 * Math.PI / 180)
|
||||
Dim dArrY As Double = dLen * Math.Sin(30 * Math.PI / 180)
|
||||
@@ -1054,16 +1128,21 @@ Public Class SplitModeVM
|
||||
Public Sub OnOff(ByVal param As Object)
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_bEnabled Then
|
||||
m_MachiningList(nI).m_bEnabled = False
|
||||
m_ItemList(Index).bIsActive = False
|
||||
Else
|
||||
m_MachiningList(nI).m_bEnabled = True
|
||||
m_ItemList(Index).bIsActive = True
|
||||
If m_ItemList(Index).IsSelected Then
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_bEnabled Then
|
||||
m_MachiningList(nI).m_bEnabled = False
|
||||
m_ItemList(Index).bIsActive = False
|
||||
Else
|
||||
m_MachiningList(nI).m_bEnabled = True
|
||||
m_ItemList(Index).bIsActive = True
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
Next
|
||||
EgtDraw()
|
||||
' Imposto flag di modifica
|
||||
@@ -1156,6 +1235,9 @@ Public Class SplitModeVM
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
' Provo ad entrambi gli estremi
|
||||
Dim bModif As Boolean = AdjustBothCuts(nI)
|
||||
@@ -1190,6 +1272,9 @@ Public Class SplitModeVM
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
' Eseguo
|
||||
If AdjustStartCut(nI) Then
|
||||
@@ -1218,6 +1303,9 @@ Public Class SplitModeVM
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
' Eseguo
|
||||
If AdjustEndCut(nI) Then
|
||||
@@ -1359,6 +1447,9 @@ Public Class SplitModeVM
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
@@ -1496,6 +1587,9 @@ Public Class SplitModeVM
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
@@ -1698,10 +1792,24 @@ Public Class SplitModeVM
|
||||
End Property
|
||||
|
||||
Public Sub ModifStart(ByVal param As Object)
|
||||
Dim bFirstInd As Boolean = True
|
||||
Dim bFirstMill As Boolean = True
|
||||
Dim bFirstWJ As Boolean = True
|
||||
' elenco delle variabili : MCH_MY.SAWING/MCH_MY.MILLING
|
||||
Dim dUsal As Double = 0
|
||||
' elenco delle variabili : MCH_MY.WATERJETTING
|
||||
Dim dWJAddLen As Double = 0
|
||||
Dim bWJLiHole As Boolean = True
|
||||
Dim nWJTangDist As Double = 0
|
||||
Dim nWJPerpDist As Double = 0
|
||||
Dim nWJLeadInType As Integer = 0
|
||||
' Recupero la lavorazione corrente
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
|
||||
@@ -1710,14 +1818,19 @@ Public Class SplitModeVM
|
||||
Dim dOrigUsal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||
' Dialogo richiesta valore
|
||||
Dim ModifStartWindow As New ModifStartEndCutWindowV
|
||||
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
|
||||
ModifStartWindow.DataContext = ModifStartWindowVM
|
||||
ModifStartWindow.Owner = Application.Current.MainWindow
|
||||
ModifStartWindowVM.SetVal(dOrigUsal)
|
||||
If Not ModifStartWindow.ShowDialog() Then Return
|
||||
' Modifica della lavorazione
|
||||
Dim dUsal As Double = ModifStartWindowVM.GetVal()
|
||||
If bFirstInd Then
|
||||
Dim ModifStartWindow As New ModifStartEndCutWindowV
|
||||
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
|
||||
ModifStartWindowVM.Title = "Sawing"
|
||||
ModifStartWindow.DataContext = ModifStartWindowVM
|
||||
ModifStartWindow.Owner = Application.Current.MainWindow
|
||||
ModifStartWindowVM.SetVal(dOrigUsal)
|
||||
If Not ModifStartWindow.ShowDialog() Then Return
|
||||
' Modifica della lavorazione
|
||||
dUsal = ModifStartWindowVM.GetVal()
|
||||
bFirstInd = False
|
||||
End If
|
||||
|
||||
Dim bRepeat As Boolean = False
|
||||
Do
|
||||
EgtSetCurrMachining(nOperId)
|
||||
@@ -1739,41 +1852,81 @@ Public Class SplitModeVM
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
' se altrimenti getto d'acqua
|
||||
ElseIf nMachiningType = MCH_MY.WATERJETTING Then
|
||||
' Recupero i valori attuali della lavorazione
|
||||
Dim dAddLen As Double = 0
|
||||
Dim bLiHole As Boolean = True
|
||||
Dim nTangDist As Double = 0
|
||||
Dim nPerpDist As Double = 0
|
||||
Dim LeadInTypeId As Integer = 0
|
||||
EgtSetCurrMachining(nOperId)
|
||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
|
||||
EgtGetMachiningParam(MCH_MP.LIHOLE, bLiHole)
|
||||
EgtGetMachiningParam(MCH_MP.LITANG, nTangDist)
|
||||
EgtGetMachiningParam(MCH_MP.LIPERP, nPerpDist)
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, LeadInTypeId)
|
||||
' Dialogo richiesta valori
|
||||
Dim ModifStartWnd As New ModifStartEndWjWindowV
|
||||
Dim ModifStartWndVM As New ModifStartEndWjWindowVM
|
||||
ModifStartWnd.DataContext = ModifStartWndVM
|
||||
ModifStartWnd.Owner = Application.Current.MainWindow
|
||||
ModifStartWndVM.HoleVisibility = Visibility.Visible
|
||||
ModifStartWndVM.LeadInVisibility = Visibility.Visible
|
||||
ModifStartWndVM.LeadOutVisibility = Visibility.Hidden
|
||||
ModifStartWndVM.SetVal(dAddLen)
|
||||
ModifStartWndVM.SetHole(bLiHole)
|
||||
ModifStartWndVM.SetLeadInType(LeadInTypeId)
|
||||
ModifStartWndVM.SetLiTangDist(nTangDist)
|
||||
ModifStartWndVM.SetLiPerpDist(nPerpDist)
|
||||
If Not ModifStartWnd.ShowDialog() Then Return
|
||||
|
||||
ElseIf nMachiningType = MCH_MY.MILLING Then ' And m_MachiningList(nI).m_sLay = NAME_ONPATH
|
||||
|
||||
' leggo il valore salvato nella geometria
|
||||
Dim dOrigUsal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||
' Dialogo richiesta valore
|
||||
If bFirstMill Then
|
||||
Dim ModifStartWindow As New ModifStartEndCutWindowV
|
||||
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
|
||||
ModifStartWindowVM.Title = "Milling"
|
||||
ModifStartWindow.DataContext = ModifStartWindowVM
|
||||
ModifStartWindow.Owner = Application.Current.MainWindow
|
||||
ModifStartWindowVM.SetVal(dOrigUsal)
|
||||
If Not ModifStartWindow.ShowDialog() Then Return
|
||||
' Modifica della lavorazione
|
||||
dUsal = ModifStartWindowVM.GetVal()
|
||||
bFirstMill = False
|
||||
End If
|
||||
' Modifica della lavorazione
|
||||
EgtSetCurrMachining(nOperId)
|
||||
EgtSetMachiningParam(MCH_MP.LIHOLE, ModifStartWndVM.GetHole())
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, ModifStartWndVM.GetVal())
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, ModifStartWndVM.GetLeadInType().Id)
|
||||
EgtSetMachiningParam(MCH_MP.LITANG, ModifStartWndVM.GetLiTangDist())
|
||||
EgtSetMachiningParam(MCH_MP.LIPERP, ModifStartWndVM.GetLiPerpDist())
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
bGenModif = True
|
||||
|
||||
' se altrimenti getto d'acqua
|
||||
ElseIf nMachiningType = MCH_MY.WATERJETTING Then
|
||||
' Recupero i valori attuali della lavorazione
|
||||
If bFirstWJ Then
|
||||
Dim bOriginalIsLeadIn As Boolean = True
|
||||
Dim dOriginalAddLen As Double = 0
|
||||
Dim bOriginalLiHole As Boolean = True
|
||||
Dim nOriginalTangDist As Double = 0
|
||||
Dim nOriginalPerpDist As Double = 0
|
||||
Dim nOriginalLeadInType As Integer = 0
|
||||
EgtSetCurrMachining(nOperId)
|
||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dOriginalAddLen)
|
||||
EgtGetMachiningParam(MCH_MP.LIHOLE, bOriginalLiHole)
|
||||
EgtGetMachiningParam(MCH_MP.LITANG, nOriginalTangDist)
|
||||
EgtGetMachiningParam(MCH_MP.LIPERP, nOriginalPerpDist)
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nOriginalLeadInType)
|
||||
' Dialogo richiesta valori
|
||||
Dim ModifStartWnd As New ModifStartEndWjWindowV
|
||||
Dim ModifStartWndVM As New ModifStartEndWjWindowVM
|
||||
ModifStartWndVM.Title = "Water jetting"
|
||||
ModifStartWnd.DataContext = ModifStartWndVM
|
||||
ModifStartWnd.Owner = Application.Current.MainWindow
|
||||
ModifStartWndVM.HoleVisibility = Visibility.Visible
|
||||
ModifStartWndVM.LeadInVisibility = Visibility.Visible
|
||||
ModifStartWndVM.LeadOutVisibility = Visibility.Hidden
|
||||
ModifStartWndVM.SetVal(dOriginalAddLen)
|
||||
ModifStartWndVM.SetHole(bOriginalLiHole)
|
||||
ModifStartWndVM.SetLeadInType(nOriginalLeadInType)
|
||||
ModifStartWndVM.SetLiTangDist(nOriginalTangDist)
|
||||
ModifStartWndVM.SetLiPerpDist(nOriginalPerpDist)
|
||||
If Not ModifStartWnd.ShowDialog() Then Return
|
||||
|
||||
dWJAddLen = ModifStartWndVM.GetVal()
|
||||
bWJLiHole = ModifStartWndVM.GetHole()
|
||||
nWJTangDist = ModifStartWndVM.GetLiTangDist()
|
||||
nWJPerpDist = ModifStartWndVM.GetLiPerpDist()
|
||||
nWJLeadInType = ModifStartWndVM.GetLeadInType().Id
|
||||
bFirstWJ = False
|
||||
End If
|
||||
|
||||
' Modifica della lavorazione
|
||||
EgtSetCurrMachining(nOperId)
|
||||
EgtSetMachiningParam(MCH_MP.LIHOLE, bWJLiHole)
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dWJAddLen)
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, nWJLeadInType)
|
||||
EgtSetMachiningParam(MCH_MP.LITANG, nWJTangDist)
|
||||
EgtSetMachiningParam(MCH_MP.LIPERP, nWJPerpDist)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
@@ -1803,10 +1956,24 @@ Public Class SplitModeVM
|
||||
End Property
|
||||
|
||||
Public Sub ModifEnd(ByVal param As Object)
|
||||
Dim bFirstInd As Boolean = True
|
||||
Dim bFirstMill As Boolean = True
|
||||
Dim bFirstWJ As Boolean = True
|
||||
' elenco delle variabili : MCH_MY.SAWING/MCH_MY.MILLING
|
||||
Dim dUeal As Double = 0
|
||||
' elenco delle variabili : MCH_MY.WATERJETTING
|
||||
Dim dWJAddLen As Double = 0
|
||||
Dim nWJTangDist As Double = 0
|
||||
Dim nWJPerpDist As Double = 0
|
||||
Dim nWJLeadInType As Integer = 0
|
||||
|
||||
' Recupero la lavorazione corrente
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
|
||||
@@ -1815,14 +1982,18 @@ Public Class SplitModeVM
|
||||
Dim dOrigUeal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||
' Dialogo richiesta valore
|
||||
Dim ModifStartWindow As New ModifStartEndCutWindowV
|
||||
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
|
||||
ModifStartWindow.DataContext = ModifStartWindowVM
|
||||
ModifStartWindow.Owner = Application.Current.MainWindow
|
||||
ModifStartWindowVM.SetVal(dOrigUeal)
|
||||
If Not ModifStartWindow.ShowDialog() Then Return
|
||||
' Modifica della lavorazione
|
||||
Dim dUeal As Double = ModifStartWindowVM.GetVal()
|
||||
If bFirstInd Then
|
||||
Dim ModifStartWindow As New ModifStartEndCutWindowV
|
||||
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
|
||||
ModifStartWindowVM.Title = "Sawing"
|
||||
ModifStartWindow.DataContext = ModifStartWindowVM
|
||||
ModifStartWindow.Owner = Application.Current.MainWindow
|
||||
ModifStartWindowVM.SetVal(dOrigUeal)
|
||||
If Not ModifStartWindow.ShowDialog() Then Return
|
||||
' Modifica della lavorazione
|
||||
dUeal = ModifStartWindowVM.GetVal()
|
||||
bFirstInd = False
|
||||
End If
|
||||
Dim bRepeat As Boolean = False
|
||||
Do
|
||||
EgtSetCurrMachining(nOperId)
|
||||
@@ -1846,37 +2017,75 @@ Public Class SplitModeVM
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
ElseIf nMachiningType = MCH_MY.MILLING Then ' And m_MachiningList(nI).m_sLay = NAME_ONPATH
|
||||
|
||||
Dim dOrigUeal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||
If bFirstMill Then
|
||||
Dim ModifStartWindow As New ModifStartEndCutWindowV
|
||||
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
|
||||
ModifStartWindowVM.Title = "Milling"
|
||||
ModifStartWindow.DataContext = ModifStartWindowVM
|
||||
ModifStartWindow.Owner = Application.Current.MainWindow
|
||||
ModifStartWindowVM.SetVal(dOrigUeal)
|
||||
If Not ModifStartWindow.ShowDialog() Then Return
|
||||
' Modifica della lavorazione
|
||||
dUeal = ModifStartWindowVM.GetVal()
|
||||
bFirstMill = False
|
||||
End If
|
||||
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||
' Modifica della lavorazione
|
||||
EgtSetCurrMachining(nOperId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUeal)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
bGenModif = True
|
||||
|
||||
' se altrimenti getto d'acqua
|
||||
ElseIf nMachiningType = MCH_MY.WATERJETTING Then
|
||||
' Recupero i valori attuali della lavorazione
|
||||
Dim dAddLen As Double = 0
|
||||
Dim nTangDist As Double = 0
|
||||
Dim nPerpDist As Double = 0
|
||||
Dim LeadOutTypeId As Integer = 0
|
||||
EgtSetCurrMachining(nOperId)
|
||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
||||
EgtGetMachiningParam(MCH_MP.LOTANG, nTangDist)
|
||||
EgtGetMachiningParam(MCH_MP.LOPERP, nPerpDist)
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, LeadOutTypeId)
|
||||
' Dialogo richiesta valori
|
||||
Dim ModifStartWnd As New ModifStartEndWjWindowV()
|
||||
Dim ModifStartWndVM As New ModifStartEndWjWindowVM
|
||||
ModifStartWnd.DataContext = ModifStartWndVM
|
||||
ModifStartWnd.Owner = Application.Current.MainWindow
|
||||
ModifStartWndVM.HoleVisibility = Visibility.Hidden
|
||||
ModifStartWndVM.LeadInVisibility = Visibility.Hidden
|
||||
ModifStartWndVM.LeadOutVisibility = Visibility.Visible
|
||||
ModifStartWndVM.SetVal(dAddLen)
|
||||
ModifStartWndVM.SetLeadOutType(LeadOutTypeId)
|
||||
ModifStartWndVM.SetLoTangDist(nTangDist)
|
||||
ModifStartWndVM.SetLoPerpDist(nPerpDist)
|
||||
If Not ModifStartWnd.ShowDialog() Then Return
|
||||
If bFirstWJ Then
|
||||
Dim dAddLen As Double = 0
|
||||
Dim nTangDist As Double = 0
|
||||
Dim nPerpDist As Double = 0
|
||||
Dim LeadOutTypeId As Integer = 0
|
||||
EgtSetCurrMachining(nOperId)
|
||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
||||
EgtGetMachiningParam(MCH_MP.LOTANG, nTangDist)
|
||||
EgtGetMachiningParam(MCH_MP.LOPERP, nPerpDist)
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, LeadOutTypeId)
|
||||
' Dialogo richiesta valori
|
||||
Dim ModifStartWnd As New ModifStartEndWjWindowV()
|
||||
Dim ModifStartWndVM As New ModifStartEndWjWindowVM
|
||||
ModifStartWndVM.Title = "Water jetting"
|
||||
ModifStartWnd.DataContext = ModifStartWndVM
|
||||
ModifStartWnd.Owner = Application.Current.MainWindow
|
||||
ModifStartWndVM.HoleVisibility = Visibility.Hidden
|
||||
ModifStartWndVM.LeadInVisibility = Visibility.Hidden
|
||||
ModifStartWndVM.LeadOutVisibility = Visibility.Visible
|
||||
ModifStartWndVM.SetVal(dAddLen)
|
||||
ModifStartWndVM.SetLeadOutType(LeadOutTypeId)
|
||||
ModifStartWndVM.SetLoTangDist(nTangDist)
|
||||
ModifStartWndVM.SetLoPerpDist(nPerpDist)
|
||||
If Not ModifStartWnd.ShowDialog() Then Return
|
||||
|
||||
dWJAddLen = ModifStartWndVM.GetVal()
|
||||
nWJTangDist = ModifStartWndVM.GetLoTangDist()
|
||||
nWJPerpDist = ModifStartWndVM.GetLoPerpDist()
|
||||
nWJLeadInType = ModifStartWndVM.GetLeadOutType().Id
|
||||
|
||||
bFirstWJ = False
|
||||
End If
|
||||
' Modifica della lavorazione
|
||||
EgtSetCurrMachining(nOperId)
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, ModifStartWndVM.GetVal())
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, ModifStartWndVM.GetLeadOutType().Id)
|
||||
EgtSetMachiningParam(MCH_MP.LOTANG, ModifStartWndVM.GetLoTangDist())
|
||||
EgtSetMachiningParam(MCH_MP.LOPERP, ModifStartWndVM.GetLoPerpDist())
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dWJAddLen)
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, nWJLeadInType)
|
||||
EgtSetMachiningParam(MCH_MP.LOTANG, nWJTangDist)
|
||||
EgtSetMachiningParam(MCH_MP.LOPERP, nWJPerpDist)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
@@ -1908,6 +2117,9 @@ Public Class SplitModeVM
|
||||
Public Sub Pause(ByVal param As Object)
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
If GetPause(nOperId) Then
|
||||
@@ -1940,6 +2152,9 @@ Public Class SplitModeVM
|
||||
Public Sub Invert(ByVal param As Object)
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
' Si possono invertire solo i tagli di lama
|
||||
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING Then Continue For
|
||||
@@ -2252,29 +2467,34 @@ Public Class SplitModeVM
|
||||
' ------------------------ verifico che le lavorazioni siano dello stesso tipo ------------------------
|
||||
OmagOFFICEMap.refSplitModeVM.VerifyHomogenousMachining(ItemList)
|
||||
' -----------------------------------------------------------------------------------------------------
|
||||
' riordino l'elenco delle lavorazioni
|
||||
ItemList.Sort(Function(x, y) Comparer(Of Integer).Default.Compare(OmagOFFICEMap.refSplitModeVM.m_ItemList.IndexOf(x), OmagOFFICEMap.refSplitModeVM.m_ItemList.IndexOf(y)))
|
||||
' ------------------------ verifico che le lavorazioni siano contigue ---------------------------------
|
||||
OmagOFFICEMap.refSplitModeVM.bEnabledCommandMove = VerifyContinuity(ItemList)
|
||||
' -----------------------------------------------------------------------------------------------------
|
||||
|
||||
'If Not My.Computer.Keyboard.ShiftKeyDown And (My.Computer.Keyboard.CtrlKeyDown And value) Then
|
||||
' ' verifico che siano contigui
|
||||
' Dim bContigus As Boolean = False
|
||||
' Dim LastSel As NameIdLsBxItem = OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList(OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count - 1)
|
||||
' If OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count = 1 Then
|
||||
' bContigus = True
|
||||
' Else
|
||||
' For Each Item In ItemList
|
||||
' If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then
|
||||
' bContigus = True
|
||||
' End If
|
||||
' Next
|
||||
' End If
|
||||
' ' se non contiguo, elimino dai selezionati il primo(che è l'ultimo ad essere stato selezionato)
|
||||
' If Not bContigus Then
|
||||
' ItemList.Remove(LastSel)
|
||||
' OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.RemoveAt(OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count - 1)
|
||||
' OmagOFFICEMap.refSplitModeVM.ItemList(LastSel.Ind).IsSelected = Not value 'm_IsSelected = Not value
|
||||
' ' disabilito il pulsanti per spostare le lavorazioni
|
||||
' End If
|
||||
'End If
|
||||
|
||||
ItemList.Sort(Function(x, y) Comparer(Of Integer).Default.Compare(OmagOFFICEMap.refSplitModeVM.m_ItemList.IndexOf(x),
|
||||
OmagOFFICEMap.refSplitModeVM.m_ItemList.IndexOf(y)))
|
||||
If Not My.Computer.Keyboard.ShiftKeyDown And (My.Computer.Keyboard.CtrlKeyDown And value) Then
|
||||
' verifico che siano contigui
|
||||
Dim bContigus As Boolean = False
|
||||
Dim LastSel As NameIdLsBxItem = OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList(OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count - 1)
|
||||
If OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count = 1 Then
|
||||
bContigus = True
|
||||
Else
|
||||
For Each Item In ItemList
|
||||
If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then
|
||||
bContigus = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' se non contiguo, elimino dai selezionati il primo(che è l'ultimo ad essere stato selezionato)
|
||||
If Not bContigus Then
|
||||
ItemList.Remove(LastSel)
|
||||
OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.RemoveAt(OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count - 1)
|
||||
OmagOFFICEMap.refSplitModeVM.ItemList(LastSel.Ind).IsSelected = Not value 'm_IsSelected = Not value
|
||||
End If
|
||||
End If
|
||||
' resetto marcatura lavorazioni
|
||||
If OmagOFFICEMap.refSplitModeVM.m_CurrFirstInd > -1 Then
|
||||
For Index = OmagOFFICEMap.refSplitModeVM.m_CurrFirstInd To OmagOFFICEMap.refSplitModeVM.m_CurrLastInd
|
||||
@@ -2298,6 +2518,20 @@ Public Class SplitModeVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Function VerifyContinuity(ItemList As List(Of NameIdLsBxItem)) As Boolean
|
||||
If ItemList.Count < 2 Then Return True
|
||||
Dim bContigus As Boolean = False
|
||||
For Index As Integer = 0 To ItemList.Count - 2
|
||||
If ItemList(Index).Ind = ItemList(Index + 1).Ind + 1 Or ItemList(Index).Ind = ItemList(Index + 1).Ind - 1 Then
|
||||
bContigus = True
|
||||
Else
|
||||
bContigus = False
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Return bContigus
|
||||
End Function
|
||||
|
||||
Public Property Type As Integer
|
||||
Get
|
||||
Return m_nType
|
||||
|
||||
@@ -137,34 +137,49 @@
|
||||
|
||||
</Border>
|
||||
|
||||
<UniformGrid Grid.Column="0" Columns="2" Margin="0,0,0,5">
|
||||
<Button Content="{Binding InsertPartMsg}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding InsertPartCommand}"
|
||||
Margin="0,0,2.5,0"/>
|
||||
<Button Content="{Binding StorePartMsg}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding StorePartCommand}"
|
||||
Margin="2.5,0,0,0"/>
|
||||
<UniformGrid Grid.Column="0" Columns="2" Margin="0,0,0,5">
|
||||
<Button Content="{Binding InsertPartMsg}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding InsertPartCommand}"
|
||||
Margin="0,0,2.5,0"/>
|
||||
<Button Content="{Binding StorePartMsg}" Grid.Column="1"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding StorePartCommand}"
|
||||
Margin="2.5,0,0,0"/>
|
||||
<!--<ToggleButton Content="{Binding StartCurvWJMsg}" Grid.Column="2"
|
||||
Visibility="{Binding StartCurvWJ_Visibility}"
|
||||
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||
IsChecked="{Binding bStartCurvWJ}"
|
||||
Margin="2.5,0,2.5,0"/>-->
|
||||
</UniformGrid>
|
||||
|
||||
<Grid Margin="0,0,-2.5,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<UniformGrid Grid.Column="0" Columns="{Binding CountColumn}" Margin="0,0,0,5">
|
||||
<Button Content="{Binding RemovePartMsg}"
|
||||
Grid.ColumnSpan="{Binding DragRettangle_Cl_Span}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding RemovePartCommand}"
|
||||
Margin="0,0,2.5,0"/>
|
||||
<ToggleButton Content="{Binding DragRettangleMsg}" Grid.Column="1"
|
||||
Visibility="{Binding DragRettangle_Visibility}"
|
||||
<ToggleButton Content="{Binding DragRectangleMsg}" Grid.Column="1"
|
||||
Visibility="{Binding DragRectangle_Visibility}"
|
||||
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||
IsChecked="{Binding bDragRettangle}"
|
||||
IsChecked="{Binding bDragRectangle}"
|
||||
Margin="2.5,0,2.5,0"/>
|
||||
</Grid>
|
||||
<!--<ToggleButton Content="{Binding SplitCurvWJMsg}" Grid.Column="2"
|
||||
Visibility="{Binding SplitCurvWJ_Visibility}"
|
||||
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||
IsChecked="{Binding bSplitCurvWJ}"
|
||||
Margin="2.5,0,2.5,0"/>-->
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Grid.Column="0" Columns="2" Margin="0,0,0,5" Visibility="{Binding WJ_Cmd_Visibility}">
|
||||
<ToggleButton Content="{Binding SplitCurvWJMsg}" Grid.Column="2"
|
||||
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||
IsChecked="{Binding bSplitCurvWJ}"
|
||||
Margin="2.5,0,2.5,0"/>
|
||||
<ToggleButton Content="{Binding StartCurvWJMsg}" Grid.Column="2"
|
||||
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||
IsChecked="{Binding bStartCurvWJ}"
|
||||
Margin="2.5,0,2.5,0"/>
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Columns="2" Margin="0,0,0,5">
|
||||
<Button Content="{Binding SelectAllMsg}"
|
||||
|
||||
@@ -36,16 +36,19 @@ Public Class NestingTabVM
|
||||
Private m_bCsvData As Boolean = False
|
||||
|
||||
' Id del rettangolo, del traglio e della curva da modificare tramite Drag
|
||||
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedRegionRettangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedSawRettangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedCurvRettangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedTextRettangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedTextTopRettangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedFlatSurfRettangle As Integer = GDB_ID.NULL
|
||||
Private m_SideListRettangle(4) As Integer
|
||||
Private m_nIdSelectedOutLoopRectangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedRegionRectangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedSawRectangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedCurvRectangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedTextRectangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedTextTopRectangle As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedFlatSurfRectangle As Integer = GDB_ID.NULL
|
||||
Private m_SideListRectangle(4) As Integer
|
||||
Private m_sTextContent As String = String.Empty
|
||||
|
||||
' Id dei lato WJ da separare tramite comando ON_OFF
|
||||
Private m_nIdSelectedSideWJ As Integer = GDB_ID.NULL
|
||||
Private m_nIdSelectedWaterJet As Integer = GDB_ID.NULL
|
||||
|
||||
Private m_CsvImportWindow As CsvWindowV
|
||||
Friend ReadOnly Property CsvImportWindow As CsvWindowV
|
||||
@@ -152,6 +155,13 @@ Public Class NestingTabVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CountColumn As Integer = 1
|
||||
Public ReadOnly Property CountColumn As Integer
|
||||
Get
|
||||
Return m_CountColumn
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property InsertPartMsg As String
|
||||
@@ -172,12 +182,26 @@ Public Class NestingTabVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DragRettangleMsg As String
|
||||
Public ReadOnly Property DragRectangleMsg As String
|
||||
Get
|
||||
Return "Drag Rectangle"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SplitCurvWJMsg As String
|
||||
Get
|
||||
'91133=Separa
|
||||
Return EgtMsg(91133)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property StartCurvWJMsg As String
|
||||
Get
|
||||
'91132=Start
|
||||
Return EgtMsg(91132)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SelectAllMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_NESTPAGEUC + 4)
|
||||
@@ -198,7 +222,7 @@ Public Class NestingTabVM
|
||||
|
||||
Public ReadOnly Property CsvDataMsg As String
|
||||
Get
|
||||
Return EgtMsg( 90398) 'Dati Csv
|
||||
Return EgtMsg(90398) 'Dati Csv
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -228,13 +252,14 @@ Public Class NestingTabVM
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
If (GetMainPrivateProfileInt(S_NEST, K_DRAGRETTANGLE, 1) <> 0) Then
|
||||
m_DragRettangle_Visibility = Visibility.Visible
|
||||
If GetMainPrivateProfileInt(S_NEST, K_DRAGRECTANGLE, 1) <> 0 Then
|
||||
m_DragRectangle_Visibility = Visibility.Visible
|
||||
m_CountColumn += 1
|
||||
Else
|
||||
m_DragRettangle_Visibility = Visibility.Collapsed
|
||||
m_DragRectangle_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
NotifyPropertyChanged("DragRettangle_Visibility")
|
||||
NotifyPropertyChanged("DragRettangle_Cl_Span")
|
||||
NotifyPropertyChanged("DragRectangle_Visibility")
|
||||
NotifyPropertyChanged("CountColumn")
|
||||
' Creo riferimento a questa classe in OmagOFFICEMap
|
||||
OmagOFFICEMap.SetRefNestingTabVM(Me)
|
||||
End Sub
|
||||
@@ -551,14 +576,12 @@ Public Class NestingTabVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#Region "DRAG RETTANGLE"
|
||||
#Region "DRAG RECTANGLE"
|
||||
|
||||
' funzione chiamata da OnMyMouseMoveScene: verifica che la selezione sia corretta (deve essere il lato di una figura rettangolare)
|
||||
Private Sub OnMyMouseDownSceneSelSideRettangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Then
|
||||
Return
|
||||
End If
|
||||
Private Sub OnMyMouseDownSceneSelSideRectangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Si può selezionare solo con il tasto sinistro
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Then Return
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||
Dim nSelMy As Integer
|
||||
@@ -574,15 +597,15 @@ Public Class NestingTabVM
|
||||
If sLayer = NAME_OUTLOOP Then
|
||||
If EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
|
||||
' -------------------------------- INIZIO VERIFICHE --------------------------------
|
||||
m_nIdSelectedOutLoopRettangle = nIdParent
|
||||
If Not IsRettangle(m_SideListRettangle) Then
|
||||
m_nIdSelectedOutLoopRectangle = nIdParent
|
||||
If Not IsRectangle(m_SideListRectangle) Then
|
||||
'm_CurrProjPage.ClearMessage()
|
||||
'm_CurrProjPage.SetWarningMessage("Non è un rettangolo (0)")
|
||||
Return
|
||||
End If
|
||||
' recupero il gruppo della lavorazione associata
|
||||
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
||||
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
|
||||
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
|
||||
' se non esiste un gruppo di lavorazione associato allora esco
|
||||
If nIdPV = GDB_ID.NULL Then
|
||||
'm_CurrProjPage.ClearMessage()
|
||||
@@ -599,26 +622,26 @@ Public Class NestingTabVM
|
||||
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
|
||||
' -------------------------------- FINE VERIFICHE --------------------------------
|
||||
|
||||
If Not EgtGetGroupObjs(nIdSaw) Then
|
||||
m_nIdSelectedSawRettangle = nIdSaw
|
||||
m_nIdSelectedCurvRettangle = nIdMy
|
||||
If EgtGetGroupObjs(nIdSaw) <> 0 Then
|
||||
m_nIdSelectedSawRectangle = nIdSaw
|
||||
m_nIdSelectedCurvRectangle = nIdMy
|
||||
|
||||
m_nIdSelectedRegionRettangle = EgtGetFirstNameInGroup(nIdParentPart, NAME_REGION)
|
||||
' recupero i testi cintenuti nel layer Region
|
||||
If m_nIdSelectedRegionRettangle <> GDB_ID.NULL Then
|
||||
Dim nCurrId As Integer = EgtGetFirstInGroup(m_nIdSelectedRegionRettangle)
|
||||
m_nIdSelectedRegionRectangle = EgtGetFirstNameInGroup(nIdParentPart, NAME_REGION)
|
||||
' recupero i testi contenuti nel layer Region
|
||||
If m_nIdSelectedRegionRectangle <> GDB_ID.NULL Then
|
||||
Dim nCurrId As Integer = EgtGetFirstInGroup(m_nIdSelectedRegionRectangle)
|
||||
While nCurrId <> GDB_ID.NULL
|
||||
If EgtGetType(nCurrId) = GDB_TY.EXT_TEXT Then
|
||||
Dim sVal As String = String.Empty
|
||||
EgtTextGetContent(nCurrId, sVal)
|
||||
If sVal = "*TOP*" Then
|
||||
m_nIdSelectedTextTopRettangle = nCurrId
|
||||
m_nIdSelectedTextTopRectangle = nCurrId
|
||||
Else
|
||||
m_nIdSelectedTextRettangle = nCurrId
|
||||
m_sTextContent = GetMyRettangleText(sVal)
|
||||
m_nIdSelectedTextRectangle = nCurrId
|
||||
m_sTextContent = GetMyRectangleText(sVal)
|
||||
End If
|
||||
ElseIf EgtGetType(nCurrId) = GDB_TY.SRF_FRGN Then
|
||||
m_nIdSelectedFlatSurfRettangle = nCurrId
|
||||
m_nIdSelectedFlatSurfRectangle = nCurrId
|
||||
End If
|
||||
nCurrId = EgtGetNext(nCurrId)
|
||||
End While
|
||||
@@ -631,15 +654,15 @@ Public Class NestingTabVM
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
' se le'elemto corrente non è una linea
|
||||
' se l'elemento corrente non è una linea
|
||||
End If
|
||||
' se le'elemto corrente non appartiene al layer OutLoop passo al prossimo elemento dell'elenco
|
||||
' se l'elemento corrente non appartiene al layer OutLoop passo al prossimo elemento dell'elenco
|
||||
nIdMy = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
End Sub
|
||||
|
||||
' restituisce il valore del Text ripulito dalle dimensioni
|
||||
Private Function GetMyRettangleText(sTextPz As String) As String
|
||||
Private Function GetMyRectangleText(sTextPz As String) As String
|
||||
' da DrawPageUC.xaml.vb/MultipleInsert
|
||||
Dim sText As String = String.Empty
|
||||
If sTextPz.Contains("<br/>") Then
|
||||
@@ -650,56 +673,57 @@ Public Class NestingTabVM
|
||||
If sTextPz.Contains(" ") Then
|
||||
Dim sInfo() As String = sTextPz.Split(" "c)
|
||||
If sInfo.Count > 3 Then
|
||||
Return sText = sInfo(0) & " " & sInfo(1) & " "
|
||||
sText = sInfo(0) & " " & sInfo(1) & " "
|
||||
Return sText
|
||||
End If
|
||||
End If
|
||||
Return sText
|
||||
End Function
|
||||
|
||||
' verifico che la figura selezionata sia realmente un rettangolo
|
||||
Private Function IsRettangle(ByRef IdSideList() As Integer) As Boolean
|
||||
Private Function IsRectangle(ByRef IdSideList() As Integer) As Boolean
|
||||
' creo una lista con i lati del rettangolo
|
||||
Dim nCounter As Integer = 0
|
||||
' recupero i lati dal leyer "OutLoop"
|
||||
Dim IdSideRettangle As Integer = EgtGetFirstInGroup(m_nIdSelectedOutLoopRettangle)
|
||||
While IdSideRettangle <> GDB_ID.NULL And nCounter < 4
|
||||
Dim IdSideRectangle As Integer = EgtGetFirstInGroup(m_nIdSelectedOutLoopRectangle)
|
||||
While IdSideRectangle <> GDB_ID.NULL And nCounter < 4
|
||||
Dim sVal As String = String.Empty
|
||||
Dim dPrevAng As Double = 0
|
||||
EgtGetInfo(IdSideRettangle, "PrevAng", sVal)
|
||||
EgtGetInfo(IdSideRectangle, "PrevAng", sVal)
|
||||
StringToDouble(sVal, dPrevAng)
|
||||
Dim dNextAng As Double = 0
|
||||
EgtGetInfo(IdSideRettangle, "NextAng", sVal)
|
||||
EgtGetInfo(IdSideRectangle, "NextAng", sVal)
|
||||
StringToDouble(sVal, dNextAng)
|
||||
' se gli angoli non sono retti allora esco senza caricare il lato corrente
|
||||
If Math.Abs(dPrevAng - 90) > EPS_ANG_SMALL OrElse Math.Abs(dNextAng - 90) > EPS_ANG_SMALL Then
|
||||
Exit While
|
||||
End If
|
||||
IdSideList(nCounter) = IdSideRettangle
|
||||
IdSideList(nCounter) = IdSideRectangle
|
||||
nCounter += 1
|
||||
IdSideRettangle = EgtGetNext(IdSideRettangle)
|
||||
IdSideRectangle = EgtGetNext(IdSideRectangle)
|
||||
End While
|
||||
' verifico che siano solo quattro lati
|
||||
If IdSideRettangle = GDB_ID.NULL And nCounter = 4 Then
|
||||
If IdSideRectangle = GDB_ID.NULL And nCounter = 4 Then
|
||||
' solo se la figura ha 4 lati ortogonali
|
||||
Return True
|
||||
End If
|
||||
|
||||
m_nIdSelectedOutLoopRettangle = GDB_ID.NULL
|
||||
m_nIdSelectedOutLoopRectangle = GDB_ID.NULL
|
||||
' la figura presenta più/meno di 4 lati
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' recupero le informazioni correnti per sapere se la figura è mdificabile
|
||||
Private Function GetRettangleInfoScale(ByRef frFixed As Frame3d, ByRef MaxLen As Double, ByRef MinLen As Double) As Vector3d
|
||||
Private Function GetRectangleInfoScale(ByRef frFixed As Frame3d, ByRef MaxLen As Double, ByRef MinLen As Double) As Vector3d
|
||||
' determino la direzione del lato selezionato
|
||||
Dim vtDirSelectedCurv As New Vector3d
|
||||
EgtStartVector(m_nIdSelectedCurvRettangle, GDB_ID.ROOT, vtDirSelectedCurv)
|
||||
EgtStartVector(m_nIdSelectedCurvRectangle, GDB_ID.ROOT, vtDirSelectedCurv)
|
||||
|
||||
' recupero il lato successivo a quello selezionato
|
||||
Dim Index As Integer = 0
|
||||
Dim Len As Double = 0
|
||||
For Ind As Integer = 0 To 3
|
||||
If m_SideListRettangle(Ind) = m_nIdSelectedCurvRettangle Then
|
||||
If m_SideListRectangle(Ind) = m_nIdSelectedCurvRectangle Then
|
||||
' verifico se esiste un lato Precedente altrimenti recupero l'ultimo della lista
|
||||
If Ind = 0 Then
|
||||
Index = 3
|
||||
@@ -709,8 +733,8 @@ Public Class NestingTabVM
|
||||
End If
|
||||
Next
|
||||
' recupero la dimensione del lato
|
||||
EgtCurveLength(m_SideListRettangle(Index), MaxLen)
|
||||
EgtCurveLength(m_nIdSelectedCurvRettangle, MinLen)
|
||||
EgtCurveLength(m_SideListRectangle(Index), MaxLen)
|
||||
EgtCurveLength(m_nIdSelectedCurvRectangle, MinLen)
|
||||
|
||||
' verifico che il lato selezionato sia il maggiore
|
||||
If MinLen > MaxLen Then Return Nothing
|
||||
@@ -718,11 +742,11 @@ Public Class NestingTabVM
|
||||
' determimo il versore dal lato appena calcolato
|
||||
Dim vtDir As New Vector3d
|
||||
|
||||
EgtStartVector(m_SideListRettangle(Index), GDB_ID.ROOT, vtDir)
|
||||
EgtStartVector(m_SideListRectangle(Index), GDB_ID.ROOT, vtDir)
|
||||
vtDir.Normalize()
|
||||
Dim dProjectionBaseX As Double = vtDir * Vector3d.X_AX
|
||||
Dim ptFixed As New Point3d
|
||||
EgtStartPoint(m_SideListRettangle(Index), GDB_ID.ROOT, ptFixed)
|
||||
EgtStartPoint(m_SideListRectangle(Index), GDB_ID.ROOT, ptFixed)
|
||||
|
||||
Dim vtPerp As New Vector3d(vtDir.x, vtDir.y, vtDir.z)
|
||||
vtPerp.Rotate(Vector3d.Z_AX, 90)
|
||||
@@ -735,7 +759,7 @@ Public Class NestingTabVM
|
||||
End Function
|
||||
|
||||
' funzione chiamata da OnMyMouseMoveScene: gestisce la modifica lungo una dimensione del rettangolo selezionato
|
||||
Private Sub OnMyMouseMoveSawRettangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Private Sub OnMyMouseMoveSawRectangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Se drag non abilitato o già in esecuzione, esco
|
||||
If Not m_bDrag Or m_bDragging Then Return
|
||||
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
|
||||
@@ -753,7 +777,7 @@ Public Class NestingTabVM
|
||||
Dim MaxLen As Double = 0
|
||||
Dim MinLen As Double = 0
|
||||
' recupero info sul rettangolo selezionato
|
||||
Dim vtDir As Vector3d = GetRettangleInfoScale(frFixed, MaxLen, MinLen)
|
||||
Dim vtDir As Vector3d = GetRectangleInfoScale(frFixed, MaxLen, MinLen)
|
||||
If vtDir.Equals(Vector3d.NULL) Then
|
||||
Return
|
||||
End If
|
||||
@@ -774,34 +798,34 @@ Public Class NestingTabVM
|
||||
|
||||
' Modifico dimensione figura
|
||||
If Math.Abs(dScalefactor) > EPS_SMALL * EPS_SMALL Then
|
||||
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, dScalefactor, 1, 1, GDB_ID.ROOT)
|
||||
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, dScalefactor, 1, 1, GDB_ID.ROOT)
|
||||
EgtScale(m_nIdSelectedOutLoopRectangle, frFixed, dScalefactor, 1, 1, GDB_RT.GLOB)
|
||||
EgtScale(m_nIdSelectedFlatSurfRectangle, frFixed, dScalefactor, 1, 1, GDB_RT.GLOB)
|
||||
Dim ptCen As Point3d
|
||||
EgtCenterPoint(m_nIdSelectedTextRettangle, ptCen)
|
||||
EgtModifyText(m_nIdSelectedTextRettangle, m_sTextContent & LenToString(MaxLen + dProjection, 2) & " x " & LenToString(MinLen, 2))
|
||||
EgtMove(m_nIdSelectedTextRettangle, vtMove * 0.5, GDB_ID.ROOT)
|
||||
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
|
||||
EgtMove(m_nIdSelectedTextTopRettangle, vtMove * 0.5, GDB_ID.ROOT)
|
||||
EgtCenterPoint(m_nIdSelectedTextRectangle, ptCen)
|
||||
EgtModifyText(m_nIdSelectedTextRectangle, m_sTextContent & LenToString(MaxLen + dProjection, 2) & " x " & LenToString(MinLen, 2))
|
||||
EgtMove(m_nIdSelectedTextRectangle, vtMove * 0.5, GDB_RT.GLOB)
|
||||
If m_nIdSelectedTextTopRectangle <> GDB_ID.NULL Then
|
||||
EgtMove(m_nIdSelectedTextTopRectangle, vtMove * 0.5, GDB_RT.GLOB)
|
||||
End If
|
||||
End If
|
||||
|
||||
' verifico che il il lato maggiore rimanga semore il lato maggiore
|
||||
Dim bRettangleCorrect As Boolean = False
|
||||
If (MaxLen + dProjection - MinLen) > EPS_SMALL Then bRettangleCorrect = True
|
||||
Dim bRectangleCorrect As Boolean = False
|
||||
If (MaxLen + dProjection - MinLen) > EPS_SMALL Then bRectangleCorrect = True
|
||||
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
EnableReferenceRegion(False)
|
||||
' se la modifica genera un errore allora ripristino la figura prima della defomrazione
|
||||
If Not EgtVerifyPart(EgtGetParent(m_nIdSelectedOutLoopRettangle), True) Or Not bRettangleCorrect Then
|
||||
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
|
||||
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
|
||||
If Not EgtVerifyPart(EgtGetParent(m_nIdSelectedOutLoopRectangle), True) Or Not bRectangleCorrect Then
|
||||
EgtScale(m_nIdSelectedOutLoopRectangle, frFixed, 1 / dScalefactor, 1, 1, GDB_RT.GLOB)
|
||||
EgtScale(m_nIdSelectedFlatSurfRectangle, frFixed, 1 / dScalefactor, 1, 1, GDB_RT.GLOB)
|
||||
Dim ptCen As Point3d
|
||||
EgtCenterPoint(m_nIdSelectedTextRettangle, ptCen)
|
||||
EgtModifyText(m_nIdSelectedTextRettangle, m_sTextContent & LenToString(MaxLen, 2) & " x " & LenToString(MinLen, 2))
|
||||
EgtMove(m_nIdSelectedTextRettangle, -vtMove * 0.5, GDB_ID.ROOT)
|
||||
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
|
||||
EgtMove(m_nIdSelectedTextTopRettangle, -vtMove * 0.5, GDB_ID.ROOT)
|
||||
EgtCenterPoint(m_nIdSelectedTextRectangle, ptCen)
|
||||
EgtModifyText(m_nIdSelectedTextRectangle, m_sTextContent & LenToString(MaxLen, 2) & " x " & LenToString(MinLen, 2))
|
||||
EgtMove(m_nIdSelectedTextRectangle, -vtMove * 0.5, GDB_RT.GLOB)
|
||||
If m_nIdSelectedTextTopRectangle <> GDB_ID.NULL Then
|
||||
EgtMove(m_nIdSelectedTextTopRectangle, -vtMove * 0.5, GDB_RT.GLOB)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -813,20 +837,20 @@ Public Class NestingTabVM
|
||||
End Sub
|
||||
|
||||
' funzione chiamata da OnMyMouseUp: gestisce il reset di tutti gli indici in uso
|
||||
Public Sub ResetDragRettangleParam()
|
||||
Public Sub ResetDragRectangleParam()
|
||||
' deseleziono l'elemento corrente
|
||||
EgtDeselectObj(m_nIdSelectedSawRettangle)
|
||||
EgtDeselectObj(m_nIdSelectedCurvRettangle)
|
||||
EgtResetMark(m_nIdSelectedSawRettangle)
|
||||
EgtDeselectObj(m_nIdSelectedSawRectangle)
|
||||
EgtDeselectObj(m_nIdSelectedCurvRectangle)
|
||||
EgtResetMark(m_nIdSelectedSawRectangle)
|
||||
' resetto gli indici
|
||||
m_nIdSelectedOutLoopRettangle = GDB_ID.NULL
|
||||
m_nIdSelectedRegionRettangle = GDB_ID.NULL
|
||||
m_nIdSelectedSawRettangle = GDB_ID.NULL
|
||||
m_nIdSelectedCurvRettangle = GDB_ID.NULL
|
||||
m_nIdSelectedTextRettangle = GDB_ID.NULL
|
||||
m_nIdSelectedTextTopRettangle = GDB_ID.NULL
|
||||
m_nIdSelectedFlatSurfRettangle = GDB_ID.NULL
|
||||
m_SideListRettangle = {GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL}
|
||||
m_nIdSelectedOutLoopRectangle = GDB_ID.NULL
|
||||
m_nIdSelectedRegionRectangle = GDB_ID.NULL
|
||||
m_nIdSelectedSawRectangle = GDB_ID.NULL
|
||||
m_nIdSelectedCurvRectangle = GDB_ID.NULL
|
||||
m_nIdSelectedTextRectangle = GDB_ID.NULL
|
||||
m_nIdSelectedTextTopRectangle = GDB_ID.NULL
|
||||
m_nIdSelectedFlatSurfRectangle = GDB_ID.NULL
|
||||
m_SideListRectangle = {GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL}
|
||||
m_sTextContent = String.Empty
|
||||
' disattivo il drag
|
||||
m_bDrag = False
|
||||
@@ -840,32 +864,424 @@ Public Class NestingTabVM
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
Private m_bDragRettangle As Boolean
|
||||
Public Property bDragRettangle As Boolean
|
||||
Private m_bDragRectangle As Boolean
|
||||
Public Property bDragRectangle As Boolean
|
||||
Get
|
||||
Return m_bDragRettangle
|
||||
Return m_bDragRectangle
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bDragRettangle = value
|
||||
m_bDragRectangle = value
|
||||
m_bSplitCurvWJ = False
|
||||
ResetSplitCurvWJParam(True)
|
||||
m_bStartCurvWJ = False
|
||||
ResetStartCurvWJParam(True)
|
||||
NotifyPropertyChanged("bSplitCurvWJ")
|
||||
NotifyPropertyChanged("bStartCurvWJ")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_DragRettangle_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property DragRettangle_Visibility As Visibility
|
||||
Private m_DragRectangle_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property DragRectangle_Visibility As Visibility
|
||||
Get
|
||||
Return m_DragRettangle_Visibility
|
||||
Return m_DragRectangle_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DragRettangle_Cl_Span As Integer
|
||||
Get
|
||||
If m_DragRettangle_Visibility = Visibility.Visible Then
|
||||
Return 1
|
||||
#Region "WATERJET SPLIT CURVE"
|
||||
|
||||
' funzione per la selezione dei lati su cui operare la separazione del tagli waterjet
|
||||
Private Sub OnMyMouseDownSceneSplitCurv(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
||||
Not m_bSplitCurvWJ Then
|
||||
Return
|
||||
End If
|
||||
' Se esiste un elemento selezionato
|
||||
EgtResetMark(m_nIdSelectedWaterJet)
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||
Dim nSelMy As Integer
|
||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
|
||||
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
|
||||
While nIdMy <> GDB_ID.NULL
|
||||
Dim sLayer As String = String.Empty
|
||||
' layer di origine
|
||||
Dim nIdParent As Integer = EgtGetParent(nIdMy)
|
||||
' recupero il nome del Layer
|
||||
EgtGetName(nIdParent, sLayer)
|
||||
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
|
||||
If sLayer = NAME_OUTLOOP Then
|
||||
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
|
||||
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
|
||||
EgtDeselectObj(m_nIdSelectedSideWJ)
|
||||
End If
|
||||
' recupero il gruppo della lavorazione associata
|
||||
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
||||
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
|
||||
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet associate a questo Part
|
||||
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
|
||||
' VERIFICA: se esistono delle lavorazioni associate al percorso OutLoop di tipo Saw allora non procedo
|
||||
Dim ListGroupSaw As List(Of Integer) = ResearchGropuSaw(nIdParent, nIdPV)
|
||||
' se non esiste almeno 1 Preview di tipo WaterJet
|
||||
If ListGroup.Count > 0 And ListGroupSaw.Count = 0 Then
|
||||
m_nIdSelectedSideWJ = nIdMy
|
||||
Dim nValInfo As Integer = 1
|
||||
Dim nNewValInfo As Integer = nValInfo
|
||||
If EgtGetInfo(nIdMy, INFO_JOINTENTITY, nValInfo) Then
|
||||
If nValInfo = 1 Then
|
||||
nNewValInfo = 0
|
||||
Else
|
||||
nNewValInfo = 1
|
||||
End If
|
||||
Else
|
||||
' se manca l'info allora il taglio sValInfo = "1" quindi separo il taglio
|
||||
nNewValInfo = 0
|
||||
End If
|
||||
EgtSetInfo(nIdMy, INFO_JOINTENTITY, nNewValInfo)
|
||||
' Ricalcolo tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
|
||||
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
|
||||
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
|
||||
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
|
||||
' assegno un identificativo grafico per inidcare che è un taglio separato
|
||||
If nNewValInfo = 0 Then
|
||||
AssignFlagOnGraphic(nIdMy, nIdParentPart)
|
||||
Else
|
||||
EraseFlagOnGraphic(nIdMy, nIdParentPart)
|
||||
End If
|
||||
' salvo il valore del PreView evidenziato
|
||||
m_nIdSelectedWaterJet = nIdWJ
|
||||
EgtSetMark(nIdWJ)
|
||||
EgtSelectObj(nIdMy)
|
||||
EgtDraw()
|
||||
Exit While
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
Return 2
|
||||
nIdMy = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
Return
|
||||
End Sub
|
||||
|
||||
' restituisce l'elenco dei Gruppi Waterjet associati al contorno indicato
|
||||
Public Function ResearchGropuWJ(nIdOutLoop As Integer, nIdPV As Integer) As List(Of Integer)
|
||||
Dim ListOfGroupPV As New List(Of Integer)
|
||||
Dim nIdGroup As Integer = GDB_ID.NULL
|
||||
Dim nIdMy As Integer = GDB_ID.NULL
|
||||
' recupero il primo lato dall'elenco dei lati della figura
|
||||
nIdMy = EgtGetFirstInGroup(nIdOutLoop)
|
||||
' altrimenti cerco all'interno del layer OutLoop per ogni lato la lavorazione associata
|
||||
While nIdMy <> GDB_ID.NULL
|
||||
' verifico se esiste una Preview associata al lato
|
||||
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Waterjet" & nIdMy.ToString & "S")
|
||||
If nIdGroup <> GDB_ID.NULL Then
|
||||
ListOfGroupPV.Add(nIdGroup)
|
||||
End If
|
||||
nIdMy = EgtGetNext(nIdMy)
|
||||
End While
|
||||
Return ListOfGroupPV
|
||||
End Function
|
||||
|
||||
' restituisce l'elenco dei Gruppi Saw associati al contorno indicato
|
||||
Public Function ResearchGropuSaw(nIdOutLoop As Integer, nIdPV As Integer) As List(Of Integer)
|
||||
Dim ListOfGroupPV As New List(Of Integer)
|
||||
Dim nIdGroup As Integer = GDB_ID.NULL
|
||||
Dim nIdMy As Integer = GDB_ID.NULL
|
||||
' recupero il primo lato dall'elenco dei lati della figura
|
||||
nIdMy = EgtGetFirstInGroup(nIdOutLoop)
|
||||
' altrimenti cerco all'interno del layer OutLoop per ogni lato la lavorazione associata
|
||||
While nIdMy <> GDB_ID.NULL
|
||||
' verifico se esiste una Preview associata al lato
|
||||
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
|
||||
If nIdGroup <> GDB_ID.NULL Then
|
||||
ListOfGroupPV.Add(nIdGroup)
|
||||
End If
|
||||
nIdMy = EgtGetNext(nIdMy)
|
||||
End While
|
||||
Return ListOfGroupPV
|
||||
End Function
|
||||
|
||||
Public Function GetPVIdFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer) As Integer
|
||||
Dim IdWaterjetPV As Integer = GDB_ID.NULL
|
||||
For Each nIdItem As Integer In ListGroup
|
||||
Dim sName As String = String.Empty
|
||||
If EgtGetName(nIdItem, sName) Then
|
||||
If sName.Contains(nIdMy.ToString) Then
|
||||
IdWaterjetPV = nIdItem
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return IdWaterjetPV
|
||||
End Function
|
||||
|
||||
Public Sub GetCurrentPVFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, nIdParent As Integer)
|
||||
Dim nObjInGroup As Integer = EgtGetGroupObjs(nIdParent)
|
||||
Dim nCount As Integer = 0
|
||||
GetNextSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
|
||||
If nIdWj <> GDB_ID.NULL Then Return
|
||||
GetPrevSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
|
||||
End Sub
|
||||
|
||||
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
|
||||
Private Sub GetNextSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
|
||||
Dim nValInfo As Integer = 1
|
||||
' espressione di controllo per evitare di generare Loop infinito
|
||||
If nCount > nObjInGroup Then Return
|
||||
If nIdWj = GDB_ID.NULL Then
|
||||
Dim nIdWJNext As Integer = EgtGetNext(nIdMy)
|
||||
If nIdWJNext = GDB_ID.NULL Then nIdWJNext = EgtGetFirstInGroup(EgtGetParent(nIdMy))
|
||||
nCount += 1
|
||||
EgtGetInfo(nIdWJNext, "JoinEntity", nValInfo)
|
||||
If nValInfo = 1 Then
|
||||
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJNext)
|
||||
If nIdWj <> GDB_ID.NULL Then Return
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
'nIdWJNext = EgtGetNext(nIdWJNext)
|
||||
GetNextSideJoint(ListGroup, nIdWJNext, nIdWj, nCount, nObjInGroup)
|
||||
If nIdWj <> GDB_ID.NULL Then Return
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
|
||||
Private Sub GetPrevSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
|
||||
Dim nValInfo As Integer = 1
|
||||
' espressione di controllo per evitare di generare Loop infinito
|
||||
If nCount > nObjInGroup Then Return
|
||||
If nIdWj = GDB_ID.NULL Then
|
||||
Dim nIdWJPrev As Integer = EgtGetPrev(nIdMy)
|
||||
' se arrivato al primo valore allora continuo la ricerca dall'ultimo
|
||||
If nIdWJPrev = GDB_ID.NULL Then nIdWJPrev = EgtGetLastInGroup(EgtGetParent(nIdMy))
|
||||
nCount += 1
|
||||
EgtGetInfo(nIdWJPrev, INFO_JOINTENTITY, nValInfo)
|
||||
If nValInfo = 1 Then
|
||||
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJPrev)
|
||||
If nIdWj <> GDB_ID.NULL Then Return
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
'nIdWJPrev = EgtGetPrev(nIdWJPrev)
|
||||
GetPrevSideJoint(ListGroup, nIdWJPrev, nIdWj, nCount, nObjInGroup)
|
||||
If nIdWj <> GDB_ID.NULL Then Return
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub ResetSplitCurvWJParam(Optional bAllParam As Boolean = True)
|
||||
If bAllParam Then
|
||||
EgtDeselectObj(m_nIdSelectedSideWJ)
|
||||
EgtResetMark(m_nIdSelectedWaterJet)
|
||||
End If
|
||||
m_nIdSelectedSideWJ = GDB_ID.NULL
|
||||
m_nIdSelectedWaterJet = GDB_ID.NULL
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
' ricevo l'ID del percorso di lavorazione WJ al quale associo una etichetta grafica con scritto "S"
|
||||
Private Sub AssignFlagOnGraphic(nIdMy As Integer, IdParentPart As Integer)
|
||||
' cerco se esiste già un layer nominato "AUX_SPLIT_WJ", altrimenti lo creo
|
||||
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(IdParentPart, INFO_AUX_SPLIT_WJ)
|
||||
If IdAuxLayer = GDB_ID.NULL Then
|
||||
IdAuxLayer = EgtCreateGroup(IdParentPart)
|
||||
EgtSetName(IdAuxLayer, INFO_AUX_SPLIT_WJ)
|
||||
End If
|
||||
' recupero il punto medio del segmento selezionato
|
||||
Dim MidPoint As Point3d
|
||||
EgtMidPoint(nIdMy, GDB_RT.GLOB, MidPoint)
|
||||
'Dim nIdTextFlag As Integer = EgtCreateText(IdAuxLayer, MidPoint, "*", 20, GDB_RT.GLOB)
|
||||
Dim nIdTextFlag As Integer = GetCreateFlagText(nIdMy, IdAuxLayer)
|
||||
EgtSetColor(nIdTextFlag, New Color3d(255, 0, 0))
|
||||
EgtSetName(nIdTextFlag, "RefSide_" & nIdMy.ToString)
|
||||
End Sub
|
||||
|
||||
Private Function GetCreateFlagText(nId As Integer, nIdLayer As Integer, Optional sText As String = "*") As Integer
|
||||
' recupero il punto medio
|
||||
Dim MidPoint As Point3d
|
||||
EgtMidPoint(nId, GDB_RT.GLOB, MidPoint)
|
||||
' recupero la direzione del vettore nel punto medio
|
||||
Dim vVers As Vector3d
|
||||
EgtMidVector(nId, GDB_RT.GLOB, vVers)
|
||||
vVers.Normalize()
|
||||
vVers.Rotate(Vector3d.Z_AX, 90)
|
||||
' Ingombro complessivo della lavorazione
|
||||
Dim ptMin, ptMax As Point3d
|
||||
EgtStartPoint(nId, GDB_RT.GLOB, ptMin)
|
||||
EgtEndPoint(nId, GDB_RT.GLOB, ptMax)
|
||||
' Metto il numero nel centro
|
||||
Dim dRadXY = Point3d.DistXY(ptMin, ptMax)
|
||||
Dim dHtxt As Double = 50
|
||||
Dim dRat As Double = 0.75
|
||||
If dRadXY < 200 Then
|
||||
dHtxt = 40
|
||||
dRat = 0.6
|
||||
ElseIf dRadXY < 25 Then
|
||||
dHtxt = 25
|
||||
dRat = 0.5
|
||||
End If
|
||||
' determino la posizione del flag
|
||||
MidPoint.x += vVers.x * dHtxt / 2
|
||||
MidPoint.y += vVers.y * dHtxt / 2
|
||||
|
||||
Return EgtCreateTextAdv(nIdLayer, MidPoint, 0, sText, "", 300, False, dHtxt, dRat, 0, INS_POS.MC, GDB_RT.GLOB)
|
||||
End Function
|
||||
|
||||
Private Sub EraseFlagOnGraphic(nIdMy As Integer, IdParentPart As Integer)
|
||||
' cerco se esiste già un layer nominato "AUX_SPLIT_WJ", altrimenti lo creo
|
||||
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(IdParentPart, INFO_AUX_SPLIT_WJ)
|
||||
If IdAuxLayer = GDB_ID.NULL Then Return
|
||||
Dim nIdTextFlag As Integer = EgtGetFirstNameInGroup(IdAuxLayer, "RefSide_" & nIdMy.ToString)
|
||||
EgtErase(nIdTextFlag)
|
||||
End Sub
|
||||
|
||||
#End Region ' WaterJet Section and StartPoint
|
||||
|
||||
Private m_bSplitCurvWJ As Boolean
|
||||
Public Property bSplitCurvWJ As Boolean
|
||||
Get
|
||||
Return m_bSplitCurvWJ
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bSplitCurvWJ = value
|
||||
If Not m_bSplitCurvWJ Then
|
||||
' resetto i parametri di selezione dei lati
|
||||
ResetSplitCurvWJParam(True)
|
||||
End If
|
||||
m_bDragRectangle = False
|
||||
m_bStartCurvWJ = False
|
||||
ResetStartCurvWJParam(True)
|
||||
NotifyPropertyChanged("bDragRectangle")
|
||||
NotifyPropertyChanged("bStartCurvWJ")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_WJ_Cmd_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property WJ_Cmd_Visibility As Visibility
|
||||
Get
|
||||
Return m_WJ_Cmd_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' in funzione della macchinata attiva predispone la visualizzazione del bottone SplitCurv (abilitato solo per WaterJet Machine)
|
||||
Public Sub Set_WJ_Cmd_Visibility()
|
||||
' gestisco la visualizzazione del comando ON_OFF (per i tagli waterjet)
|
||||
If CurrentMachine.WaterJettingActive Then
|
||||
m_WJ_Cmd_Visibility = Visibility.Visible
|
||||
Else
|
||||
m_WJ_Cmd_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
NotifyPropertyChanged("WJ_Cmd_Visibility")
|
||||
End Sub
|
||||
|
||||
#Region "WATERJET START POINT"
|
||||
|
||||
' funzione per la selezione del punto di inizio tagli waterjet (percorso chiuso)
|
||||
Private Sub OnMyMouseDownSceneStartCurv(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
||||
Not m_bStartCurvWJ Then
|
||||
Return
|
||||
End If
|
||||
|
||||
' Acquisisco punto da disegno
|
||||
Dim ptStartCurv As New Point3d
|
||||
EgtUnProjectPoint(e.Location, ptStartCurv)
|
||||
' Aggiusto Z punto acquisito (è in globale)
|
||||
Dim ptRawMax As New Point3d
|
||||
Dim ptRawMin As New Point3d
|
||||
If GetRawBox(ptRawMin, ptRawMax) Then
|
||||
ptStartCurv.z = ptRawMax.z
|
||||
End If
|
||||
|
||||
' Se esiste un elemento selezionato
|
||||
EgtResetMark(m_nIdSelectedWaterJet)
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||
Dim nSelMy As Integer
|
||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
|
||||
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
|
||||
While nIdMy <> GDB_ID.NULL
|
||||
Dim sLayer As String = String.Empty
|
||||
' layer di origine
|
||||
Dim nIdParent As Integer = EgtGetParent(nIdMy)
|
||||
' recupero il nome del Layer
|
||||
EgtGetName(nIdParent, sLayer)
|
||||
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
|
||||
If sLayer = NAME_OUTLOOP Or sLayer = NAME_INLOOP Then
|
||||
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
|
||||
' verifico che il contorno sia chiuso, altrimenti esco
|
||||
If Not VerifyOutLoopIsClosed(nIdParent) Then
|
||||
'91131=Il contorno non è chiuso
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(91131), MSG_TYPE.WARNING)
|
||||
Exit While
|
||||
End If
|
||||
' recupero il gruppo della lavorazione associata
|
||||
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
||||
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
|
||||
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet_n_S associate a questo Part
|
||||
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
|
||||
' VERIFICA: se esistono delle lavorazioni associate al percorso OutLoop di tipo Saw allora non procedo
|
||||
Dim ListGroupSaw As List(Of Integer) = ResearchGropuSaw(nIdParent, nIdPV)
|
||||
' se non esiste almeno 1 Preview di tipo WaterJet
|
||||
If ListGroup.Count = 1 And ListGroupSaw.Count = 0 Then
|
||||
EgtSetInfo(nIdParent, INFO_START, ptStartCurv)
|
||||
' Ricalcolo tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
|
||||
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
|
||||
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
|
||||
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
|
||||
m_nIdSelectedWaterJet = nIdWJ
|
||||
EgtSetMark(nIdWJ)
|
||||
EgtDraw()
|
||||
Exit While
|
||||
Else
|
||||
'91131=Il contorno non è chiuso
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(91131), MSG_TYPE.WARNING)
|
||||
Exit While
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
nIdMy = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
Return
|
||||
End Sub
|
||||
|
||||
#End Region ' Water Start Point
|
||||
|
||||
Private m_bStartCurvWJ As Boolean
|
||||
Public Property bStartCurvWJ As Boolean
|
||||
Get
|
||||
Return m_bStartCurvWJ
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bStartCurvWJ = value
|
||||
If Not m_bStartCurvWJ Then
|
||||
ResetStartCurvWJParam(True)
|
||||
End If
|
||||
m_bDragRectangle = False
|
||||
m_bSplitCurvWJ = False
|
||||
ResetSplitCurvWJParam(True)
|
||||
NotifyPropertyChanged("bDragRectangle")
|
||||
NotifyPropertyChanged("bSplitCurvWJ")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub ResetStartCurvWJParam(Optional bAllParam As Boolean = True)
|
||||
If bAllParam Then
|
||||
EgtDeselectObj(m_nIdSelectedSideWJ)
|
||||
EgtResetMark(m_nIdSelectedWaterJet)
|
||||
End If
|
||||
m_nIdSelectedSideWJ = GDB_ID.NULL
|
||||
m_nIdSelectedWaterJet = GDB_ID.NULL
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
@@ -1451,6 +1867,10 @@ Public Class NestingTabVM
|
||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||
' Cancello eventuali messaggi
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
' cancello tutti i tagli di separazione
|
||||
ResetAllSplitCurv()
|
||||
' cancello tutti i punti di inizio (Waterjet)
|
||||
ResetAllStartCurv()
|
||||
' Cancello tutte le lavorazioni
|
||||
CamAuto.EraseMachinings(GDB_ID.NULL)
|
||||
' Reinserisco tutte le lavorazioni piane
|
||||
@@ -1513,8 +1933,8 @@ Public Class NestingTabVM
|
||||
EgtTextGetContent( nTextId, sText)
|
||||
Dim nPos As Integer = sText.IndexOf( sCsvName)
|
||||
Dim sNewText As String
|
||||
If nPos < 0 Then
|
||||
sNewText = sNewName & "<br/>" & sText
|
||||
If nPos <0 Then
|
||||
sNewText= sNewName & "<br/>" & sText
|
||||
Else
|
||||
sNewText = sText.Remove( nPos, sCsvName.Length()).Insert( nPos, sNewName)
|
||||
End If
|
||||
@@ -1537,17 +1957,28 @@ Public Class NestingTabVM
|
||||
#Region "EVENTS"
|
||||
|
||||
Friend Sub OnMouseDownScene(sender As Object, e As Windows.Forms.MouseEventArgs)
|
||||
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
|
||||
If m_bDragRettangle Then
|
||||
OnMyMouseDownSceneSelSideRettangle(sender, e)
|
||||
' se in modalità DragRectangle (deformazione delle componenti rettangolari)
|
||||
If m_bDragRectangle Then
|
||||
OnMyMouseDownSceneSelSideRectangle(sender, e)
|
||||
' Dati per drag (abilito il Drag)
|
||||
m_locPrev = e.Location
|
||||
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRettangle <> GDB_ID.NULL
|
||||
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRectangle <> GDB_ID.NULL
|
||||
m_bDragToStart = m_bDrag
|
||||
m_bVerify = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) > 0
|
||||
m_vtTotMove = Vector3d.NULL()
|
||||
Return
|
||||
End If
|
||||
' se in modalità separazione curve WaterJet
|
||||
If m_bSplitCurvWJ Then
|
||||
OnMyMouseDownSceneSplitCurv(sender, e)
|
||||
Return
|
||||
End If
|
||||
' se in modalità punto inizio curve WaterJet
|
||||
If m_bStartCurvWJ Then
|
||||
OnMyMouseDownSceneStartCurv(sender, e)
|
||||
Return
|
||||
End If
|
||||
|
||||
' Per default no drag
|
||||
m_bDrag = False
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
@@ -1570,7 +2001,7 @@ Public Class NestingTabVM
|
||||
If NameLayer = INFO_COUNTERLY Then
|
||||
Dim sText As String = String.Empty
|
||||
If EgtTextGetContent(nId, sText) Then
|
||||
Dim sItems() As String = sText.Split("#")
|
||||
Dim sItems() As String = sText.Split("#"c)
|
||||
If sItems.Count > 1 Then
|
||||
m_nCurrNubrOfParts = 0
|
||||
If StringToInt(sItems(1), m_nCurrNubrOfParts) Then
|
||||
@@ -1611,7 +2042,7 @@ Public Class NestingTabVM
|
||||
If Not m_bDrag Or m_bDragging Then Return
|
||||
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
|
||||
If m_bDragToStart Then
|
||||
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
|
||||
If Math.Abs(e.Location.X - m_locPrev.X) <m_nRestRadius And
|
||||
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Return
|
||||
End If
|
||||
@@ -1619,8 +2050,8 @@ Public Class NestingTabVM
|
||||
End If
|
||||
|
||||
' se devo muovere un lato del rettangolo
|
||||
If m_bDragRettangle Then
|
||||
OnMyMouseMoveSawRettangle(sender, e)
|
||||
If m_bDragRectangle Then
|
||||
OnMyMouseMoveSawRectangle(sender, e)
|
||||
Return
|
||||
End If
|
||||
|
||||
@@ -1725,11 +2156,22 @@ Public Class NestingTabVM
|
||||
End Sub
|
||||
|
||||
Friend Sub OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
If m_bDragRettangle Then
|
||||
If m_bDragRectangle Then
|
||||
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
|
||||
ResetDragRettangleParam()
|
||||
ResetDragRectangleParam()
|
||||
Return
|
||||
End If
|
||||
' verifico che sia attivo il comando di modifica tagli waterjet
|
||||
If m_bSplitCurvWJ Then
|
||||
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
|
||||
' ResetSplitCurvWJParam(False)
|
||||
Return
|
||||
End If
|
||||
If m_bStartCurvWJ Then
|
||||
' ResetStartCurvWJParam(False)
|
||||
Return
|
||||
End If
|
||||
|
||||
' Se eseguito drag
|
||||
If Not m_bDragToStart Then
|
||||
' Se movimento con sola verifica finale
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Imports System.IO
|
||||
Imports System.Threading
|
||||
Imports System.Windows.Threading
|
||||
Imports System.IO
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtPHOTOLib
|
||||
@@ -7,6 +9,10 @@ Imports EgtUILib
|
||||
Public Class RawPartTabVM
|
||||
Inherits VMBase
|
||||
|
||||
' Timer
|
||||
Private m_TimerIsBusy As Boolean = False
|
||||
Private m_RefreshTimer As New DispatcherTimer
|
||||
|
||||
Friend OmagPhoto As OmagPhotoV
|
||||
|
||||
Private m_OmagPhotoVM As OmagPhotoVM
|
||||
@@ -2034,11 +2040,17 @@ Public Class RawPartTabVM
|
||||
' inserisco in elenco solo i materiali della macchina corrente
|
||||
AddHandler PhotoMap.refOptionPanelVM.SlabIsSelectedOFFICE, AddressOf OmagOFFICEMap.refRawPartTabVM.ClosePhotoWnd
|
||||
|
||||
' Dim OmagPhotoWnd As New OmagPhotoV(Application.Current.MainWindow(), New OmagPhotoVM)
|
||||
'OmagPhotoWnd.ShowDialog()
|
||||
' lancio il timer di aggiornamento dell'interfaccia, per la gestione di due OmagPHOTO che accedono allo stesso SQL
|
||||
AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_Tick
|
||||
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(2000)
|
||||
m_RefreshTimer.Start()
|
||||
|
||||
' apro la finestra per accedere al DB delle lastre
|
||||
Me.OmagPhoto = New OmagPhotoV
|
||||
OmagPhoto.ShowDialog()
|
||||
|
||||
m_RefreshTimer.Stop()
|
||||
|
||||
EgtSetCurrentContext(EgtPHOTOLib.MainData.PreviousContext)
|
||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||
|
||||
@@ -2156,6 +2168,17 @@ Public Class RawPartTabVM
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
' per la gestione di due OmagPHOTO che accedono allo stesso SQL
|
||||
Private Sub RefreshTimer_Tick()
|
||||
If Not m_TimerIsBusy And PhotoMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.LIST Then
|
||||
m_TimerIsBusy = True
|
||||
m_RefreshTimer.Stop()
|
||||
EgtPHOTOLib.PhotoMap.refListPageVM.RefreshLisPage()
|
||||
m_TimerIsBusy = False
|
||||
m_RefreshTimer.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' PhotoCommand
|
||||
|
||||
#Region "ConfirmPhotoCommand"
|
||||
|
||||
@@ -71,7 +71,7 @@ Public Class OptionWindowVM
|
||||
OmagOFFICEMap.refRawPartTabVM.Refresh(PrevMeasureUnit)
|
||||
OmagOFFICEMap.refNestingTabVM.Refresh(PrevMeasureUnit)
|
||||
OmagOFFICEMap.refMoveRawModeVM.Refresh(PrevMeasureUnit)
|
||||
OmagOFFICEMap.refSimulTabVM.MySimul.Refresh(PrevMeasureUnit)
|
||||
If Not IsNothing(OmagOFFICEMap.refSimulTabVM.MySimul) Then OmagOFFICEMap.refSimulTabVM.MySimul.Refresh(PrevMeasureUnit)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -172,6 +172,19 @@
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
<Grid Visibility="{Binding Parameter5_Visibility}"
|
||||
Grid.Row="5"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.8*"/>
|
||||
<ColumnDefinition Width="1.2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding Parameter5Msg}" Grid.Row="2"/>
|
||||
<CheckBox IsChecked="{Binding Parameter5ChBx}" HorizontalAlignment="Center"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -143,6 +143,7 @@ Public Class SideEntityControlVM
|
||||
StringToLen(value, m_Parameter1)
|
||||
' Recupero il valore
|
||||
StringToLen(value, m_dDripOffset)
|
||||
StringToLen(value, m_dOffsetFiloTop)
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
' Aggiorno i dati delle alette
|
||||
@@ -203,6 +204,7 @@ Public Class SideEntityControlVM
|
||||
RefreshSideAngleText()
|
||||
Else
|
||||
m_dDripOffset2 = m_Parameter2
|
||||
m_dDepthFiloTop = m_Parameter2
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
End If
|
||||
@@ -347,11 +349,16 @@ Public Class SideEntityControlVM
|
||||
Return LenToString(m_Parameter4, 2)
|
||||
End Get
|
||||
Set(value As String)
|
||||
If m_Mode <> ModeOpt.SIDEANGLE Then
|
||||
If m_Mode = ModeOpt.DRIP Then
|
||||
StringToLen(value, m_Parameter4)
|
||||
m_dDripShort = m_Parameter4
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
ElseIf m_Mode = ModeOpt.ENGRAVE Then
|
||||
StringToLen(value, m_Parameter4)
|
||||
m_dEngraveDepth2 = m_Parameter4
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -362,6 +369,41 @@ Public Class SideEntityControlVM
|
||||
|
||||
#End Region 'Parameter 4
|
||||
|
||||
#Region "Parameter 5"
|
||||
|
||||
Private m_Parameter5_Visibility As Visibility
|
||||
Public Property Parameter5_Visibility As Visibility
|
||||
Get
|
||||
Return m_Parameter5_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_Parameter5_Visibility = value
|
||||
NotifyPropertyChanged(NameOf(Parameter5_Visibility))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Parameter5ChBx As Boolean
|
||||
Public Property Parameter5ChBx As Boolean
|
||||
Get
|
||||
Return m_Parameter5ChBx
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If m_Mode = ModeOpt.FILOTOP Then
|
||||
m_bCornerRadius = value
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
m_Parameter5ChBx = m_bCornerRadius
|
||||
End If
|
||||
NotifyPropertyChanged("Parameter5ChBx")
|
||||
End Set
|
||||
End Property
|
||||
Private Sub SetParameter5(value As Boolean)
|
||||
m_Parameter5ChBx = value
|
||||
NotifyPropertyChanged("Parameter5ChBx")
|
||||
End Sub
|
||||
|
||||
#End Region 'Parameter 5
|
||||
|
||||
Private m_dSideAngle As Double = 0
|
||||
|
||||
Private m_HeightA As Double = 0
|
||||
@@ -369,13 +411,16 @@ Public Class SideEntityControlVM
|
||||
Private m_DeltaAngF As Double = 0
|
||||
Private m_DeltaAngA As Double = 0
|
||||
|
||||
Private m_SelList As New List(Of Integer)
|
||||
Private m_dOffsetFiloTop As Double = 5
|
||||
Private m_dDepthFiloTop As Double = 5
|
||||
Private m_bCornerRadius As Boolean = False
|
||||
|
||||
Private m_dDripOffset As Double = 10
|
||||
Private m_dDripOffset2 As Double = 0
|
||||
Private m_nEngrNbr2 As Integer = 1
|
||||
Private m_dDripDepth As Double = 10
|
||||
Private m_dEngraveDepth2 As Double = 5
|
||||
Private m_dDripShort As Double = 0
|
||||
|
||||
Private m_CallingWndScene As Scene
|
||||
@@ -415,16 +460,26 @@ Public Class SideEntityControlVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Parameter4Msg As String = EgtMsg(MSG_IMPORTPAGEUC + 12)
|
||||
Private m_Parameter4Msg As String = EgtMsg(MSG_IMPORTPAGEUC + 11) & "2"
|
||||
Public Property Parameter4Msg As String
|
||||
Get
|
||||
Return m_Parameter4Msg ' Accorciamento
|
||||
Return m_Parameter4Msg ' Affondamento2
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Parameter4Msg = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Parameter5Msg As String = "RoundOff"
|
||||
Public Property Parameter5Msg As String
|
||||
Get
|
||||
Return m_Parameter5Msg ' Arrotonda
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Parameter5Msg = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -470,21 +525,26 @@ Public Class SideEntityControlVM
|
||||
Parameter2_Visibility = Visibility.Visible
|
||||
Parameter2ab_Visibility = Visibility.Hidden
|
||||
Parameter4_Visibility = Visibility.Hidden
|
||||
Parameter5_Visibility = Visibility.Hidden
|
||||
ElseIf m_Mode = ModeOpt.FILOTOP Then
|
||||
Parameter23_Visibility = Windows.Visibility.Hidden
|
||||
Parameter2_Visibility = Visibility.Visible
|
||||
Parameter2ab_Visibility = Visibility.Hidden
|
||||
Parameter4_Visibility = Visibility.Hidden
|
||||
Parameter5_Visibility = Visibility.Visible
|
||||
ElseIf m_Mode = ModeOpt.ALZANDFRONT Then
|
||||
Parameter2_Visibility = Visibility.Hidden
|
||||
Parameter23_Visibility = Windows.Visibility.Visible
|
||||
Parameter2ab_Visibility = Visibility.Visible
|
||||
Parameter4_Visibility = Visibility.Hidden
|
||||
Parameter5_Visibility = Visibility.Hidden
|
||||
Else
|
||||
' Temporaneamente lo disabilito
|
||||
Parameter23_Visibility = Windows.Visibility.Visible
|
||||
Parameter4_Visibility = Visibility.Collapsed
|
||||
Parameter4_Visibility = Visibility.Visible
|
||||
Parameter2ab_Visibility = Visibility.Visible
|
||||
Parameter2_Visibility = Visibility.Hidden
|
||||
Parameter5_Visibility = Visibility.Hidden
|
||||
End If
|
||||
|
||||
'------------------ VALORI E TITOLI PARAMETRI
|
||||
@@ -497,12 +557,15 @@ Public Class SideEntityControlVM
|
||||
|
||||
ElseIf m_Mode = ModeOpt.FILOTOP Then
|
||||
Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
|
||||
Dim x As String = EgtMsg(MSG_IMPORTPAGEUC + 11)
|
||||
Parameter2Msg = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Depth
|
||||
Parameter5Msg = "Round Off"
|
||||
m_dOffsetFiloTop = GetMainPrivateProfileDouble(S_SIDES, K_FILOTOPOFFSET, 5)
|
||||
m_dDepthFiloTop = GetMainPrivateProfileDouble(S_SIDES, K_FILOTOPDEPTH, 5)
|
||||
m_bCornerRadius = GetMainPrivateProfileInt(S_SIDES, K_FILOTOPROUNDOFF, 0) <> 0
|
||||
SetParameter1(m_dOffsetFiloTop)
|
||||
SetParameter2(m_dDepthFiloTop)
|
||||
SetParameter5(m_bCornerRadius)
|
||||
m_SelList.Clear()
|
||||
|
||||
ElseIf m_Mode = ModeOpt.ENGRAVE Or m_Mode = ModeOpt.DRIP Then
|
||||
Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
|
||||
@@ -512,12 +575,13 @@ Public Class SideEntityControlVM
|
||||
m_nEngrNbr2 = GetMainPrivateProfileInt(S_SIDES, K_ENGRAVENUMBER2, 1)
|
||||
m_dDripDepth = GetMainPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10)
|
||||
m_dDripShort = GetMainPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0)
|
||||
m_dEngraveDepth2 = GetMainPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0)
|
||||
SetParameter1(m_dDripOffset)
|
||||
SetParameter2(m_dDripOffset2)
|
||||
SetParameter2a(m_nEngrNbr2)
|
||||
SetParameter2b(m_dDripOffset2)
|
||||
SetParameter3(m_dDripDepth)
|
||||
SetParameter4(m_dDripShort)
|
||||
SetParameter4(m_dEngraveDepth2)
|
||||
|
||||
ElseIf m_Mode = ModeOpt.ALZANDFRONT Then
|
||||
' definisco i nomi dei campi
|
||||
@@ -536,6 +600,9 @@ Public Class SideEntityControlVM
|
||||
LoadCurrentCompo()
|
||||
End If
|
||||
|
||||
' aggiorno i testi sui lati della figura
|
||||
RefreshSideAngleText()
|
||||
|
||||
' Aggiorno visualizzazione
|
||||
If CallingWindow = CallingWindowOpt.COMPO Then
|
||||
EgtZoom(ZM.ALL)
|
||||
@@ -609,7 +676,9 @@ Public Class SideEntityControlVM
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
CreateDripGeom(PartId)
|
||||
ElseIf m_Mode = ModeOpt.ENGRAVE Then
|
||||
'--- ??? ---
|
||||
' --- ??? ---
|
||||
ElseIf m_Mode = ModeOpt.FILOTOP Then
|
||||
CreateFiloTopPreView(m_SelList, False)
|
||||
End If
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
@@ -717,7 +786,7 @@ Public Class SideEntityControlVM
|
||||
End If
|
||||
|
||||
' Aggiorno interfaccia
|
||||
If m_CallingWindow = CallingWindowOpt.DXFIMPORT Then
|
||||
If m_CallingWindow = CallingWindowOpt.DXFIMPORT Or m_CallingWindow = CallingWindowOpt.COMPO Then
|
||||
If m_Mode = ModeOpt.SIDEANGLE Then
|
||||
For Each Entity In m_SideEntityList
|
||||
If DirectCast(Entity, SideAngleEntity).dSideAngle <> 0 Then
|
||||
@@ -1101,6 +1170,9 @@ Public Class SideEntityControlVM
|
||||
Dim nCrvId = EgtGetFirstInGroup(DripLayer)
|
||||
While nCrvId <> GDB_ID.NULL
|
||||
EgtOffsetCurve(nCrvId, -m_dDripOffset, OFF_TYPE.EXTEND)
|
||||
If m_Mode = ModeOpt.ENGRAVE Then
|
||||
EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
|
||||
End If
|
||||
nCrvId = EgtGetNext(nCrvId)
|
||||
End While
|
||||
' Eventuali curve aggiuntive con offset2
|
||||
@@ -1111,10 +1183,14 @@ Public Class SideEntityControlVM
|
||||
For i As Integer = 1 To m_nEngrNbr2
|
||||
Dim nNewId As Integer = EgtCopy(nCrvId, nCrvId, GDB_POS.AFTER)
|
||||
EgtOffsetCurve(nNewId, -i * m_dDripOffset2, OFF_TYPE.EXTEND)
|
||||
If m_Mode = ModeOpt.ENGRAVE Then
|
||||
EgtSetInfo(nNewId, INFO_DEPTH, m_dEngraveDepth2)
|
||||
End If
|
||||
Next
|
||||
nCrvId = nNextCrvId
|
||||
End While
|
||||
End If
|
||||
|
||||
If m_Mode = ModeOpt.DRIP Then
|
||||
' Esplodo nelle curve componenti
|
||||
nCrvId = EgtGetFirstInGroup(DripLayer)
|
||||
@@ -1137,7 +1213,7 @@ Public Class SideEntityControlVM
|
||||
nCrvId = EgtGetFirstInGroup(DripLayer)
|
||||
While nCrvId <> GDB_ID.NULL
|
||||
EgtSetColor(nCrvId, COL_MCH_DRIPCUT())
|
||||
EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
|
||||
' EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
|
||||
EgtSetInfo(nCrvId, INFO_STRICT, If(m_dDripShort > EPS_SMALL, "3", "0"))
|
||||
nCrvId = EgtGetNext(nCrvId)
|
||||
End While
|
||||
@@ -1266,8 +1342,9 @@ Public Class SideEntityControlVM
|
||||
If m_Mode = ModeOpt.SIDEANGLE Then
|
||||
WriteMainPrivateProfileString(S_SIDES, K_SIDEANGLE, DoubleToString(m_Parameter1, 3))
|
||||
ElseIf m_Mode = ModeOpt.FILOTOP Then
|
||||
WriteMainPrivateProfileString(S_SIDES, K_FILOTOPOFFSET, DoubleToString(m_Parameter1, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_FILOTOPDEPTH, DoubleToString(m_Parameter2, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_FILOTOPOFFSET, LenToString(m_Parameter1, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_FILOTOPDEPTH, LenToString(m_Parameter2, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_FILOTOPROUNDOFF, If(m_Parameter5ChBx, "1", "0"))
|
||||
' Aggiorno affondamento del profilo
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
@@ -1283,10 +1360,10 @@ Public Class SideEntityControlVM
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
ElseIf m_Mode = ModeOpt.DRIP Then
|
||||
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))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_DRIPOFFSET, LenToString(m_dDripOffset, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_DRIPOFFSET2, LenToString(m_dDripOffset2, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_DRIPDEPTH, LenToString(m_dDripDepth, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_DRIPSHORT, LenToString(m_dDripShort, 3))
|
||||
For Each objEntity In m_SideEntityList
|
||||
If TypeOf objEntity Is DripEntity Then
|
||||
Dim CurrEntity As DripEntity = DirectCast(objEntity, DripEntity)
|
||||
@@ -1295,11 +1372,12 @@ Public Class SideEntityControlVM
|
||||
End If
|
||||
Next
|
||||
ElseIf m_Mode = ModeOpt.ENGRAVE Then
|
||||
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVEOFFSET, DoubleToString(m_dDripOffset, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVEOFFSET2, DoubleToString(m_dDripOffset2, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVEOFFSET, LenToString(m_dDripOffset, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVEOFFSET2, LenToString(m_dDripOffset2, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVENUMBER2, m_nEngrNbr2.ToString)
|
||||
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, DoubleToString(m_dDripDepth, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVESHORT, DoubleToString(m_dDripShort, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVESHORT, LenToString(m_dDripShort, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3))
|
||||
For Each objEntity In m_SideEntityList
|
||||
If TypeOf objEntity Is DripEntity Then
|
||||
Dim CurrEntity As DripEntity = DirectCast(objEntity, DripEntity)
|
||||
@@ -1736,8 +1814,146 @@ Public Class SideEntityControlVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' ----------------------- FILO TOP -----------------------
|
||||
Public Sub CreateFiloTopPreView(SelList As List(Of Integer), Optional bReadInfo As Boolean = True)
|
||||
m_SelList = SelList
|
||||
If m_SelList.Count < 1 Then Return
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
|
||||
While nLayId <> GDB_ID.NULL
|
||||
Dim sLayName As String = ""
|
||||
' verifico che lemento corrente appartenga all'elenco degli elementi selezionati
|
||||
Dim bIsSelected As Boolean = m_SelList.Find(Function(value As Integer)
|
||||
Return value = nLayId
|
||||
End Function) <> 0
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) AndAlso bIsSelected Then
|
||||
' ---------------------- Inizio GESTIONE PREVIEW percorso -------------------------------
|
||||
Dim nLayFiloTop As Integer = GDB_ID.NULL
|
||||
Dim nInLoopRef As Integer = GDB_ID.NULL
|
||||
nLayFiloTop = EgtGetFirstNameInGroup(nPartId, "FiloTop")
|
||||
EgtGetInfo(nLayFiloTop, "InLoopRef", nInLoopRef)
|
||||
' verifico il Layer "FiloTop" sia associato all'InLoop corrente
|
||||
While (nLayFiloTop <> GDB_ID.NULL AndAlso nInLoopRef <> nLayId)
|
||||
nLayFiloTop = EgtGetNextName(nLayFiloTop, "FiloTop")
|
||||
EgtGetInfo(nLayFiloTop, "InLoopRef", nInLoopRef)
|
||||
End While
|
||||
|
||||
' se non esiste il Layer "FiloTop"
|
||||
If nLayFiloTop = GDB_ID.NULL Then
|
||||
' lo creo
|
||||
nLayFiloTop = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayFiloTop, "FiloTop")
|
||||
EgtSetInfo(nLayFiloTop, "InLoopRef", nLayId)
|
||||
EgtSetInfo(nLayId, "FiloTopRef", nLayFiloTop)
|
||||
End If
|
||||
|
||||
' carico i dati del filo top selezionato
|
||||
If bReadInfo Then
|
||||
EgtGetInfo(nLayFiloTop, INFO_OFFSET, m_dOffsetFiloTop)
|
||||
EgtGetInfo(nLayFiloTop, INFO_DEPTH, m_dDepthFiloTop)
|
||||
Dim nVal As Integer = If(m_bCornerRadius, 1, 0)
|
||||
EgtGetInfo(nLayFiloTop, INFO_ROUNDOFF, nVal)
|
||||
m_bCornerRadius = If(nVal = 1, True, False)
|
||||
SetParameter1(m_dOffsetFiloTop)
|
||||
SetParameter2(m_dDepthFiloTop)
|
||||
SetParameter5(m_bCornerRadius)
|
||||
End If
|
||||
|
||||
' procedo alla creazione della curva
|
||||
Dim nIdCompoCurve As Integer = GDB_ID.NULL
|
||||
' cancello un eventuale curva composita creata in precedenza
|
||||
nIdCompoCurve = EgtGetFirstNameInGroup(nLayFiloTop, "OffsetPreView")
|
||||
If nIdCompoCurve <> GDB_ID.NULL Then
|
||||
EgtErase(nIdCompoCurve)
|
||||
End If
|
||||
Dim nCompoCurve As New List(Of Integer)
|
||||
' costruisco il percorso chiuso dati i lati di contorno
|
||||
Dim nLine As Integer = EgtGetFirstInGroup(nLayId)
|
||||
While nLine <> GDB_ID.NULL
|
||||
nCompoCurve.Add(nLine)
|
||||
nLine = EgtGetNext(nLine)
|
||||
End While
|
||||
Dim PtNearStart As Point3d
|
||||
Dim nInfoRoundOff As Integer = If(m_bCornerRadius, 1, 0)
|
||||
|
||||
nIdCompoCurve = EgtCreateCurveCompoByChain(nLayFiloTop, nCompoCurve.ToArray, PtNearStart, False)
|
||||
EgtSetName(nIdCompoCurve, "OffsetPreView")
|
||||
|
||||
' salvo i dati nel layer FiloTop
|
||||
EgtSetInfo(nLayFiloTop, INFO_OFFSET, m_dOffsetFiloTop)
|
||||
EgtSetInfo(nLayFiloTop, INFO_DEPTH, m_dDepthFiloTop)
|
||||
EgtSetInfo(nLayFiloTop, INFO_ROUNDOFF, nInfoRoundOff)
|
||||
|
||||
Dim bOk As Boolean = False
|
||||
' leggo che tipo di offset applicare (Round, Extend)
|
||||
If nInfoRoundOff <> 1 Then
|
||||
bOk = EgtOffsetCurve(nIdCompoCurve, -m_dOffsetFiloTop, OFF_TYPE.EXTEND)
|
||||
Else
|
||||
bOk = EgtOffsetCurve(nIdCompoCurve, -m_dOffsetFiloTop, OFF_TYPE.FILLET)
|
||||
End If
|
||||
|
||||
' se la generazione della curva non va a buon fine
|
||||
If Not bOk Then
|
||||
EgtErase(nLayFiloTop)
|
||||
EgtRemoveInfo(nLayId, "FiloTopRef")
|
||||
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
|
||||
End If
|
||||
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
|
||||
End If
|
||||
nLayId = EgtGetNextLayer(nLayId)
|
||||
End While
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
' riceve la lista dei LayerFiloTop che devono essere eliminati
|
||||
Public Sub EraseFiloTopPreview(EraseList As List(Of Integer))
|
||||
Dim m_EraseList As List(Of Integer) = EraseList
|
||||
If m_EraseList.Count < 1 Then Return
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
|
||||
While nLayId <> GDB_ID.NULL
|
||||
Dim sLayName As String = ""
|
||||
Dim bIsSelected As Boolean = m_EraseList.Find(Function(value As Integer)
|
||||
Return value = nLayId
|
||||
End Function) <> 0
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso bIsSelected Then
|
||||
' ---------------------- Inizio GESTIONE PREVIEW percorso -------------------------------
|
||||
Dim nLayFiloTop As Integer = GDB_ID.NULL
|
||||
Dim nInLoopRef As Integer = GDB_ID.NULL
|
||||
nLayFiloTop = EgtGetFirstNameInGroup(nPartId, "FiloTop")
|
||||
EgtGetInfo(nLayFiloTop, "InLoopRef", nInLoopRef)
|
||||
' cerco il Layer associato all'InLoop corrente
|
||||
While (nLayFiloTop <> GDB_ID.NULL AndAlso nInLoopRef <> nLayId)
|
||||
nLayFiloTop = EgtGetNextName(nLayFiloTop, "FiloTop")
|
||||
EgtGetInfo(nLayFiloTop, "InLoopRef", nInLoopRef)
|
||||
End While
|
||||
|
||||
' se non esiste il Layer
|
||||
If nLayFiloTop = GDB_ID.NULL Then
|
||||
' esco
|
||||
Return
|
||||
Else
|
||||
' lo elimino
|
||||
EgtErase(nLayFiloTop)
|
||||
EraseList.Remove(nLayId)
|
||||
End If
|
||||
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
|
||||
End If
|
||||
nLayId = EgtGetNextLayer(nLayId)
|
||||
End While
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Public MustInherit Class SideEntity
|
||||
|
||||
@@ -128,9 +128,9 @@ Public Class TopCommandBarVM
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Friend Sub NewCmd(Optional bUseDefaults As Boolean = False)
|
||||
Friend Sub NewCmd()
|
||||
OmagOFFICEMap.refSceneHostVM.NewProject()
|
||||
OmagOFFICEMap.refMachGroupPanelVM.InitMachGroupList(bUseDefaults)
|
||||
OmagOFFICEMap.refMachGroupPanelVM.InitMachGroupList(False)
|
||||
End Sub
|
||||
|
||||
#End Region ' NewCommand
|
||||
|
||||
@@ -120,7 +120,6 @@ Module OmagOFFICEMap
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
'Public ReadOnly Property refProjectVM As ProjectLibVM
|
||||
' Get
|
||||
' Return PhotoMap.refProjectVM
|
||||
|
||||
Reference in New Issue
Block a user