Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 601471482a | |||
| 8e112dc210 | |||
| 007ad8439c | |||
| 1ffca8b52c | |||
| c96251ba99 | |||
| 19e347412c | |||
| 8ff06da714 | |||
| a18408724c | |||
| 701f1f2b87 | |||
| 2bb53b0b06 |
@@ -67,8 +67,8 @@ 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
|
||||
'' !!!! Temporaneamente in attesa di completamento Frontalini e alzatine !!!!
|
||||
'Return Visibility.Collapsed
|
||||
Return m_AlzAndFront_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
|
||||
@@ -121,6 +121,10 @@ 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 = "DragRettangle"
|
||||
|
||||
Public Const S_SPLIT As String = "Split"
|
||||
Public Const K_MOVE_LEV As String = "MoveLevel"
|
||||
|
||||
Public Const S_CSV As String = "Csv"
|
||||
Public Const K_CSVDIRECT As String = "Direct"
|
||||
|
||||
@@ -659,7 +659,7 @@ Public Class CurrMachWindowVM
|
||||
Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
|
||||
|
||||
If CurrentMachine.bWaterJet And CurrentMachine.bFromDBWaterJet Then
|
||||
For Each Material As Object In MachiningMaterials
|
||||
For Each Material As String In MachiningMaterials
|
||||
Dim Param() As String = Material.Split(",".ToCharArray)
|
||||
If Param.Count() < 2 Then Continue For
|
||||
Dim CurrMatId As String = String.Empty
|
||||
@@ -672,7 +672,8 @@ Public Class CurrMachWindowVM
|
||||
End If
|
||||
Next
|
||||
Dim SubParam() As String = Param(0).Split(".".ToCharArray)
|
||||
If SubParam(0) = CurrentMachine.CurrMat.nId.ToString() AndAlso SubParam.Count > 1 AndAlso SubParam(1) = CurrentMachine.CurrMat.SubId.ToString() Then
|
||||
If Not IsNothing( CurrentMachine.CurrMat) AndAlso SubParam(0) = CurrentMachine.CurrMat.nId.ToString() AndAlso
|
||||
SubParam.Count > 1 AndAlso SubParam(1) = CurrentMachine.CurrMat.SubId.ToString() Then
|
||||
Dim MatMinH As Double = 0
|
||||
StringToDouble(Param(1), MatMinH)
|
||||
Dim MatMaxH As Double = 0
|
||||
|
||||
@@ -717,10 +717,12 @@ Friend Module CamAuto
|
||||
|
||||
|
||||
Private Function SetLuaStandardCamParams(Optional bDripOk As Boolean = True) As Boolean
|
||||
Dim sMaterial As String = CurrentMachine.CurrMat.sName
|
||||
Dim sSawMch As String = CurrentMachine.sCurrSawing
|
||||
Dim sMillMch As String = CurrentMachine.sCurrMilling
|
||||
Dim sDrillMch As String = CurrentMachine.sCurrDrilling
|
||||
Dim sWaterJetMch As String = CurrentMachine.sCurrWaterJetting
|
||||
Dim sWaterJetQual As String = CurrentMachine.sCurrWaterJettingQuality
|
||||
Dim sDripSawMch As String = If(bDripOk, CurrentMachine.sCurrDripSawing, "")
|
||||
Dim sDripDrillMch As String = If(bDripOk, CurrentMachine.sCurrDripDrilling, "")
|
||||
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, CurrentMachine.sMachIniFile)
|
||||
@@ -732,10 +734,12 @@ Friend Module CamAuto
|
||||
Dim bMillingOnCorners As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, 1, CurrentMachine.sMachIniFile) <> 0)
|
||||
Dim bMillingOnSinks As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, CurrentMachine.sMachIniFile) <> 0)
|
||||
Dim dMillingShort As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, CurrentMachine.sMachIniFile)
|
||||
EgtLuaSetGlobStringVar("CAM.MATERIAL", sMaterial)
|
||||
EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch)
|
||||
EgtLuaSetGlobStringVar("CAM.MILLMCH", sMillMch)
|
||||
EgtLuaSetGlobStringVar("CAM.DRILLMCH", sDrillMch)
|
||||
EgtLuaSetGlobStringVar("CAM.WATERJETMCH", sWaterJetMch)
|
||||
EgtLuaSetGlobStringVar("CAM.WATERJETQLTY", sWaterJetQual)
|
||||
EgtLuaSetGlobStringVar("CAM.DRIPSAWMCH", sDripSawMch)
|
||||
EgtLuaSetGlobStringVar("CAM.DRIPDRILLMCH", sDripDrillMch)
|
||||
EgtLuaSetGlobNumVar("CAM.REDUCEDDEPTH", dReducedDepth)
|
||||
|
||||
@@ -1424,7 +1424,6 @@ Friend Property sCurrMillNoTip As String
|
||||
Dim sFilePath As String = sMachDir & EgtWPFLib5.WaterjetDbWindowVM.WATERJETDB_PATH
|
||||
WjMaterialList = EgtWPFLib5.WaterjetDbWindowVM.LoadWjMaterials(sFilePath)
|
||||
' definisco la lista delle qualità
|
||||
m_Qualities.Add("")
|
||||
m_Qualities.Add("Q1")
|
||||
m_Qualities.Add("Q2")
|
||||
m_Qualities.Add("Q3")
|
||||
|
||||
@@ -77,6 +77,8 @@ Module EstCalc
|
||||
End Function
|
||||
|
||||
Public Function UpdateRawPart() As Boolean
|
||||
' Passo al contesto principale
|
||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||
' determino il grezzo (è il primo con fase 1)
|
||||
m_nRawId = CamAuto.GetCurrentRaw()
|
||||
If Not EgtGetRawPartBBox(m_nRawId, m_b3Raw) Then
|
||||
|
||||
+32
-12
@@ -747,35 +747,55 @@ Public Module SplitAuto
|
||||
End Function
|
||||
|
||||
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
|
||||
' Spostamento originale
|
||||
Dim vtOriMove As New Vector3d(vtMove)
|
||||
' Livello di movimento
|
||||
Dim nMoveLevel As Integer = GetPrivateProfileInt(S_SPLIT, K_MOVE_LEV, 5, IniFile.m_sIniFile)
|
||||
Dim nMove As Integer = 1
|
||||
' Se esce dalla tavola, movimento già annullato ed esco con errore
|
||||
If Not EgtMoveRawPart(nRawId, vtMove) Then Return False
|
||||
If Not EgtMoveRawPart(nRawId, vtOriMove) Then Return False
|
||||
' Se interferisce con altri grezzi, annullo movimento ed esco con errore
|
||||
If Not VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
EgtMoveRawPart(nRawId, -vtMove)
|
||||
EgtMoveRawPart(nRawId, -vtOriMove)
|
||||
Return False
|
||||
End If
|
||||
If nMoveLevel < 2 Then Return True
|
||||
' Provo ad aggiungere un altro movimento
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
If EgtMoveRawPart(nRawId, vtOriMove) Then
|
||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
vtMove += vtMove
|
||||
vtMove += vtOriMove
|
||||
nMove += 1
|
||||
If nMoveLevel = nMove Then Return True
|
||||
Else
|
||||
EgtMoveRawPart(nRawId, -vtMove)
|
||||
EgtMoveRawPart(nRawId, -vtOriMove)
|
||||
End If
|
||||
End If
|
||||
' Provo ad aggiungere un altro movimento
|
||||
If EgtMoveRawPart(nRawId, vtOriMove) Then
|
||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
vtMove += vtOriMove
|
||||
nMove += 1
|
||||
If nMoveLevel = nMove Then Return True
|
||||
Else
|
||||
EgtMoveRawPart(nRawId, -vtOriMove)
|
||||
End If
|
||||
End If
|
||||
' Provo ad aggiungere un movimento dimezzato
|
||||
If EgtMoveRawPart(nRawId, 0.5 * vtMove) Then
|
||||
If EgtMoveRawPart(nRawId, 0.5 * vtOriMove) Then
|
||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
vtMove += 0.5 * vtMove
|
||||
vtMove += 0.5 * vtOriMove
|
||||
nMove += 1
|
||||
If nMoveLevel = nMove Then Return True
|
||||
Else
|
||||
EgtMoveRawPart(nRawId, -0.5 * vtMove)
|
||||
EgtMoveRawPart(nRawId, -0.5 * vtOriMove)
|
||||
End If
|
||||
End If
|
||||
' Provo ad aggiunger un movimento 1/4
|
||||
If EgtMoveRawPart(nRawId, 0.25 * vtMove) Then
|
||||
' Provo ad aggiungere un movimento 1/4
|
||||
If EgtMoveRawPart(nRawId, 0.25 * vtOriMove) Then
|
||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
vtMove += 0.25 * vtMove
|
||||
vtMove += 0.25 * vtOriMove
|
||||
Else
|
||||
EgtMoveRawPart(nRawId, -0.25 * vtMove)
|
||||
EgtMoveRawPart(nRawId, -0.25 * vtOriMove)
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
|
||||
@@ -317,6 +317,7 @@ Public Class VeinMatchingWindow
|
||||
MessageBox.Show(Me, EgtMsg(91607) & " " & sMachGrpName, EgtMsg(91122), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
EgtSetCurrentContext(VeinMatchingScene.GetCtx())
|
||||
' Se selezione riuscita, la eseguo anche in VME
|
||||
@@ -1309,6 +1310,9 @@ Friend Module VeinMatching
|
||||
End Function
|
||||
|
||||
Friend Function LinkReferencesOnAlette() As Boolean
|
||||
Dim x As Integer = EgtGetCurrentContext()
|
||||
' forzo il DB geometrico corrente
|
||||
EgtSetCurrentContext(m_nVeinCtx)
|
||||
Dim nId As Integer = EgtGetFirstPart()
|
||||
While nId <> GDB_ID.NULL
|
||||
' escludo dalla ricerca le alette
|
||||
@@ -1344,6 +1348,7 @@ Friend Module VeinMatching
|
||||
End Function
|
||||
|
||||
Friend Function AssemblyParts(ByVal ThicknessRaw As Double) As Boolean
|
||||
Dim CurrContext As Integer = EgtGetCurrentContext()
|
||||
' per definizione un piano cucicina deve avere lo stesso spessore delle alette
|
||||
'(abbiamo dato per scontato che le alette siano realizate sullo stesso grezzo del pinao cucina...)
|
||||
CreateListAlzAndFront()
|
||||
@@ -1374,7 +1379,7 @@ Friend Module VeinMatching
|
||||
Dim nInfo3D As Integer = 0
|
||||
EgtGetInfo(Item.SideId, "Info3D", nInfo3D)
|
||||
If nInfo3D <> 1 Then
|
||||
EgtSetInfo(Item.SideId, "Info3D", 1)
|
||||
' EgtSetInfo(Item.SideId, "Info3D", 1)
|
||||
' creo il solido
|
||||
If Not CreateAlettaSolid(Item, ThicknessRaw) Then Return False
|
||||
'' posiziono il solido
|
||||
@@ -1382,6 +1387,8 @@ Friend Module VeinMatching
|
||||
End If
|
||||
' posiziono il solido
|
||||
If Not MoveAlettaSolid(Item, ThicknessRaw) Then Return False
|
||||
' solo se arrivo fino a qui allora imposto l'info
|
||||
EgtSetInfo(Item.SideId, "Info3D", 1)
|
||||
Next
|
||||
Draw()
|
||||
Return True
|
||||
@@ -1441,12 +1448,12 @@ Friend Module VeinMatching
|
||||
nIdx = newId
|
||||
End While
|
||||
|
||||
Dim nOutloopGrpOrig As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP & ".orig")
|
||||
If nOutloopGrpOrig <> GDB_ID.NULL Then
|
||||
EgtSetStatus(nOutloopGrpOrig, 1)
|
||||
Dim nOutloopGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP)
|
||||
EgtSetStatus(nOutloopGrp, 0)
|
||||
End If
|
||||
'Dim nOutloopGrpOrig As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP & ".orig")
|
||||
'If nOutloopGrpOrig <> GDB_ID.NULL Then
|
||||
' EgtSetStatus(nOutloopGrpOrig, 1)
|
||||
' Dim nOutloopGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP)
|
||||
' EgtSetStatus(nOutloopGrp, 0)
|
||||
'End If
|
||||
|
||||
Return True
|
||||
|
||||
@@ -1496,6 +1503,16 @@ Friend Module VeinMatching
|
||||
EgtInvertSurface(nBottomStm)
|
||||
|
||||
nSolidStm = EgtCreateSurfTmBySewing(nSolidGrp, 3, {nTopStm, nBottomStm, nLateralStm}, True)
|
||||
|
||||
' elimino il layer generato dalla funzione "EgtCalcFlatPartDownRegion" e rinomino quello acceso
|
||||
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup(nPartId, NAME_OUTLOOP & ".orig")
|
||||
If nOutLoopOrig <> GDB_ID.NULL Then
|
||||
Dim nCurrOutLoop As Integer = EgtGetFirstNameInGroup(nPartId, NAME_OUTLOOP)
|
||||
EgtErase(nCurrOutLoop)
|
||||
EgtSetName(nOutLoopOrig, NAME_OUTLOOP)
|
||||
EgtSetStatus(nOutLoopOrig, GDB_ST.ON_)
|
||||
End If
|
||||
|
||||
Return nSolidStm <> GDB_ID.NULL
|
||||
|
||||
End Function
|
||||
@@ -1697,12 +1714,18 @@ Friend Module VeinMatching
|
||||
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
|
||||
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
|
||||
|
||||
' ruoto il solido intorno al lato di riferimento
|
||||
Dim vtRot As Vector3d = ptERef - ptSRef
|
||||
If nType = 1 Then
|
||||
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
|
||||
ElseIf nType = 2 Then
|
||||
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
|
||||
' verifco che sia già stato ruotato
|
||||
Dim nInfo3D As Integer = 0
|
||||
EgtGetInfo(Item.SideId, "Info3D", nInfo3D)
|
||||
|
||||
If nInfo3D <> 1 Then
|
||||
' ruoto il solido intorno al lato di riferimento
|
||||
Dim vtRot As Vector3d = ptERef - ptSRef
|
||||
If nType = 1 Then
|
||||
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
|
||||
ElseIf nType = 2 Then
|
||||
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
|
||||
End If
|
||||
End If
|
||||
|
||||
' punto di riferimento per la traslazione sul solido
|
||||
|
||||
@@ -13,16 +13,17 @@
|
||||
Height="20" Width="150"/>-->
|
||||
|
||||
<Button Command="{Binding ToolDbCommand}" ToolTip="{Binding ToolDBToolTip}"
|
||||
Style="{StaticResource ToolBar_TextButton}" Width="55" Content="{Binding ToolDBMsg}"/>
|
||||
Style="{StaticResource ToolBar_TextButton}" Width="70" Content="{Binding ToolDBMsg}"/>
|
||||
<Button Command="{Binding MachDbCommand}" ToolTip="{Binding MachiningDbToolTip}"
|
||||
Style="{StaticResource ToolBar_TextButton}" Width="55" Content="{Binding MachiningDbMsg}"/>
|
||||
Style="{StaticResource ToolBar_TextButton}" Width="70" Content="{Binding MachiningDbMsg}"/>
|
||||
<Button Command="{Binding SetUpCommand}" ToolTip="{Binding SetUpToolTip}"
|
||||
Style="{StaticResource ToolBar_TextButton}" Width="55" Content="{Binding SetUpMsg}"
|
||||
Style="{StaticResource ToolBar_TextButton}" Width="70" Content="{Binding SetUpMsg}"
|
||||
Background="{Binding SetUp_Background}"/>
|
||||
<Button Command="{Binding WaterjetDbCommand}" ToolTip="{Binding WaterjetDbToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}" Width="70" Content="{Binding WaterjetDbMsg}" Visibility="{Binding WjDb_Visibility}"/>
|
||||
<Button Command="{Binding MachOptionsCommand}" ToolTip="{Binding OptionsToolTip}">
|
||||
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
||||
</Button>
|
||||
<Button Command="{Binding WaterjetDbCommand}" ToolTip="{Binding WaterjetDbToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}" Content="{Binding WaterjetDbMsg}" Visibility="{Binding WjDb_Visibility}"/>
|
||||
|
||||
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -47,7 +47,7 @@ Public Class MyMachinePanelVM
|
||||
End Property
|
||||
Public ReadOnly Property WaterjetDbMsg As String
|
||||
Get
|
||||
Return "WJ" 'EgtMsg(MSG_MACHINEPAGEUC + 7)
|
||||
Return "DB WaterJet" 'EgtMsg(MSG_MACHINEPAGEUC + 7)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ Imports System.Windows
|
||||
<Assembly: AssemblyDescription("OmagOFFICE 32 bit")>
|
||||
#End If
|
||||
#End If
|
||||
<Assembly: AssemblyCompany("EgalTech s.r.l.")>
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("OmagOFFICE")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2017-2021 by EgalTech s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2017-2022 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
'In order to begin building localizable applications, set
|
||||
@@ -69,6 +69,6 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.1.2")>
|
||||
<Assembly: AssemblyFileVersion("2.4.1.2")>
|
||||
<Assembly: AssemblyVersion("2.4.1.3")>
|
||||
<Assembly: AssemblyFileVersion("2.4.1.3")>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
Command="{Binding ImportDxfCommand}">
|
||||
<Image Source="/Resources/NestingTab/ImportDxf.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<ToggleButton Grid.Column="4" Grid.Row="0"
|
||||
<ToggleButton Grid.Column="4" Grid.Row="0"
|
||||
Style="{StaticResource OptionPanel_NestingToggleButton}"
|
||||
IsChecked="{Binding CsvImport_IsChecked}">
|
||||
<Image Source="/Resources/NestingTab/ImportCsv.png" Stretch="Uniform"/>
|
||||
@@ -148,11 +148,24 @@
|
||||
Margin="2.5,0,0,0"/>
|
||||
</UniformGrid>
|
||||
|
||||
<Button Content="{Binding RemovePartMsg}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding RemovePartCommand}"
|
||||
Margin="0,0,0,5"/>
|
||||
<Grid Margin="0,0,-2.5,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<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}"
|
||||
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||
IsChecked="{Binding bDragRettangle}"
|
||||
Margin="2.5,0,2.5,0"/>
|
||||
</Grid>
|
||||
|
||||
|
||||
<UniformGrid Columns="2" Margin="0,0,0,5">
|
||||
<Button Content="{Binding SelectAllMsg}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
|
||||
@@ -35,6 +35,18 @@ Public Class NestingTabVM
|
||||
Private m_bTrfData As Boolean = False
|
||||
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_sTextContent As String = String.Empty
|
||||
|
||||
|
||||
Private m_CsvImportWindow As CsvWindowV
|
||||
Friend ReadOnly Property CsvImportWindow As CsvWindowV
|
||||
Get
|
||||
@@ -161,6 +173,12 @@ Public Class NestingTabVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DragRettangleMsg As String
|
||||
Get
|
||||
Return "Drag Rettangle"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SelectAllMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_NESTPAGEUC + 4)
|
||||
@@ -211,6 +229,13 @@ Public Class NestingTabVM
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
If (GetMainPrivateProfileInt(S_NEST, K_DRAGRETTANGLE, 1) <> 0) Then
|
||||
m_DragRettangle_Visibility = Visibility.Visible
|
||||
Else
|
||||
m_DragRettangle_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
NotifyPropertyChanged("DragRettangle_Visibility")
|
||||
NotifyPropertyChanged("DragRettangle_Cl_Span")
|
||||
' Creo riferimento a questa classe in OmagOFFICEMap
|
||||
OmagOFFICEMap.SetRefNestingTabVM(Me)
|
||||
End Sub
|
||||
@@ -506,8 +531,318 @@ Public Class NestingTabVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#Region "DRAG RETTANGLE"
|
||||
|
||||
' 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
|
||||
' 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_LINE Then
|
||||
' -------------------------------- INIZIO VERIFICHE --------------------------------
|
||||
m_nIdSelectedOutLoopRettangle = nIdParent
|
||||
If Not IsRettangle(m_SideListRettangle) 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")
|
||||
' se non esiste un gruppo di lavorazione associato allora esco
|
||||
If nIdPV = GDB_ID.NULL Then
|
||||
'm_CurrProjPage.ClearMessage()
|
||||
'm_CurrProjPage.SetWarningMessage("Pezzo in parcheggio (1)")
|
||||
Return
|
||||
End If
|
||||
' se esiste ma è vuoto (pezzo scaricato da tavola)
|
||||
If EgtGetFirstInGroup(nIdPV) = GDB_ID.NULL Then
|
||||
'm_CurrProjPage.ClearMessage()
|
||||
'm_CurrProjPage.SetWarningMessage("Pezzo in parcheggio (2)")
|
||||
Return
|
||||
End If
|
||||
' Devo verificare che sia una lavorazione solo di lama?
|
||||
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
|
||||
' -------------------------------- FINE VERIFICHE --------------------------------
|
||||
|
||||
If Not EgtGetGroupObjs(nIdSaw) Then
|
||||
m_nIdSelectedSawRettangle = nIdSaw
|
||||
m_nIdSelectedCurvRettangle = 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)
|
||||
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
|
||||
Else
|
||||
m_nIdSelectedTextRettangle = nCurrId
|
||||
m_sTextContent = GetMyRettangleText(sVal)
|
||||
End If
|
||||
ElseIf EgtGetType(nCurrId) = GDB_TY.SRF_FRGN Then
|
||||
m_nIdSelectedFlatSurfRettangle = nCurrId
|
||||
End If
|
||||
nCurrId = EgtGetNext(nCurrId)
|
||||
End While
|
||||
End If
|
||||
' seleziono ed evidenzio il lato selezionato
|
||||
EgtSelectObj(nIdSaw)
|
||||
EgtSetMark(nIdSaw)
|
||||
EgtSelectObj(nIdMy)
|
||||
EgtDraw()
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
' se le'elemto corrente non è una linea
|
||||
End If
|
||||
' se le'elemto 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
|
||||
' da DrawPageUC.xaml.vb/MultipleInsert
|
||||
Dim sText As String = String.Empty
|
||||
If sTextPz.Contains("<br/>") Then
|
||||
Dim nLastIndex As Integer = sTextPz.LastIndexOf(">")
|
||||
sText = sTextPz.Remove(nLastIndex + 1)
|
||||
Return sText
|
||||
End If
|
||||
If sTextPz.Contains(" ") Then
|
||||
Dim sInfo() As String = sTextPz.Split(" "c)
|
||||
If sInfo.Count > 3 Then
|
||||
Return sText = sInfo(0) & " " & sInfo(1) & " "
|
||||
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
|
||||
' 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 sVal As String = String.Empty
|
||||
Dim dPrevAng As Double = 0
|
||||
EgtGetInfo(IdSideRettangle, "PrevAng", sVal)
|
||||
StringToDouble(sVal, dPrevAng)
|
||||
Dim dNextAng As Double = 0
|
||||
EgtGetInfo(IdSideRettangle, "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
|
||||
nCounter += 1
|
||||
IdSideRettangle = EgtGetNext(IdSideRettangle)
|
||||
End While
|
||||
' verifico che siano solo quattro lati
|
||||
If IdSideRettangle = GDB_ID.NULL And nCounter = 4 Then
|
||||
' solo se la figura ha 4 lati ortogonali
|
||||
Return True
|
||||
End If
|
||||
|
||||
m_nIdSelectedOutLoopRettangle = 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
|
||||
' determino la direzione del lato selezionato
|
||||
Dim vtDirSelectedCurv As New Vector3d
|
||||
EgtStartVector(m_nIdSelectedCurvRettangle, 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
|
||||
' verifico se esiste un lato Precedente altrimenti recupero l'ultimo della lista
|
||||
If Ind = 0 Then
|
||||
Index = 3
|
||||
Else
|
||||
Index = Ind - 1
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' recupero la dimensione del lato
|
||||
EgtCurveLength(m_SideListRettangle(Index), MaxLen)
|
||||
EgtCurveLength(m_nIdSelectedCurvRettangle, MinLen)
|
||||
|
||||
' verifico che il lato selezionato sia il maggiore
|
||||
If MinLen > MaxLen Then Return Nothing
|
||||
|
||||
' determimo il versore dal lato appena calcolato
|
||||
Dim vtDir As New Vector3d
|
||||
|
||||
EgtStartVector(m_SideListRettangle(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)
|
||||
|
||||
Dim vtPerp As New Vector3d(vtDir.x, vtDir.y, vtDir.z)
|
||||
vtPerp.Rotate(Vector3d.Z_AX, 90)
|
||||
|
||||
' determino il Frame corrente
|
||||
frFixed = New Frame3d(ptFixed, vtDir, vtPerp, Vector3d.Z_AX)
|
||||
|
||||
Return vtDir
|
||||
|
||||
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)
|
||||
' 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
|
||||
If m_bDragToStart Then
|
||||
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
|
||||
m_bDragToStart = False
|
||||
End If
|
||||
|
||||
' riferiemento che deve rimanere fisso del rettangolo
|
||||
Dim frFixed As Frame3d = Nothing
|
||||
' lunghezza del lato da modificare
|
||||
Dim MaxLen As Double = 0
|
||||
Dim MinLen As Double = 0
|
||||
' recupero info sul rettangolo selezionato
|
||||
Dim vtDir As Vector3d = GetRettangleInfoScale(frFixed, MaxLen, MinLen)
|
||||
If vtDir.Equals(Vector3d.NULL) Then
|
||||
Return
|
||||
End If
|
||||
|
||||
' Inizio esecuzione di drag
|
||||
m_bDragging = True
|
||||
|
||||
' Ricavo il punto corrente in coordinate mondo
|
||||
Dim ptCurr As Point3d
|
||||
EgtUnProjectPoint(e.Location, ptCurr)
|
||||
' Ricavo il vettore di movimento
|
||||
Dim vtMove As Vector3d = ptCurr - m_ptPrev
|
||||
' ricavo il valore efficace di allungamento (la proiezione)
|
||||
Dim dProjection As Double = vtMove * vtDir
|
||||
vtMove = vtDir * dProjection
|
||||
' recupero il valore di scalatura
|
||||
Dim dScalefactor = dProjection / MaxLen + 1
|
||||
|
||||
' 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)
|
||||
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)
|
||||
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
|
||||
EgtMove(m_nIdSelectedTextTopRettangle, vtMove * 0.5)
|
||||
End If
|
||||
End If
|
||||
|
||||
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) Then
|
||||
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
|
||||
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
|
||||
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)
|
||||
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
|
||||
EgtMove(m_nIdSelectedTextTopRettangle, -vtMove * 0.5)
|
||||
End If
|
||||
End If
|
||||
|
||||
EgtDraw()
|
||||
' Aggiorno il punto precedente
|
||||
m_ptPrev = ptCurr
|
||||
' Terminata esecuzione di drag
|
||||
m_bDragging = False
|
||||
End Sub
|
||||
|
||||
' funzione chiamata da OnMyMouseUp: gestisce il reset di tutti gli indici in uso
|
||||
Public Sub ResetDragRettangleParam()
|
||||
' deseleziono l'elemento corrente
|
||||
EgtDeselectObj(m_nIdSelectedSawRettangle)
|
||||
EgtDeselectObj(m_nIdSelectedCurvRettangle)
|
||||
EgtResetMark(m_nIdSelectedSawRettangle)
|
||||
' 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_sTextContent = String.Empty
|
||||
' disattivo il drag
|
||||
m_bDrag = False
|
||||
' aggiorno le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' Drag Rettangolo
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
Private m_bDragRettangle As Boolean
|
||||
Public Property bDragRettangle As Boolean
|
||||
Get
|
||||
Return m_bDragRettangle
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bDragRettangle = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_DragRettangle_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property DragRettangle_Visibility As Visibility
|
||||
Get
|
||||
Return m_DragRettangle_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DragRettangle_Cl_Span As Integer
|
||||
Get
|
||||
If m_DragRettangle_Visibility = Visibility.Visible Then
|
||||
Return 1
|
||||
End If
|
||||
Return 2
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DrawCommand"
|
||||
@@ -1169,6 +1504,17 @@ 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)
|
||||
' Dati per drag (abilito il Drag)
|
||||
m_locPrev = e.Location
|
||||
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRettangle <> 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
|
||||
' Per default no drag
|
||||
m_bDrag = False
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
@@ -1216,6 +1562,13 @@ Public Class NestingTabVM
|
||||
End If
|
||||
m_bDragToStart = False
|
||||
End If
|
||||
|
||||
' se devo muovere un lato del rettangolo
|
||||
If m_bDragRettangle Then
|
||||
OnMyMouseMoveSawRettangle(sender, e)
|
||||
Return
|
||||
End If
|
||||
|
||||
' Determino cosa muovere
|
||||
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
||||
' Verifico se in tavola o in parcheggio
|
||||
@@ -1304,6 +1657,11 @@ Public Class NestingTabVM
|
||||
End Sub
|
||||
|
||||
Friend Sub OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
If m_bDragRettangle Then
|
||||
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
|
||||
ResetDragRettangleParam()
|
||||
Return
|
||||
End If
|
||||
' Se eseguito drag
|
||||
If Not m_bDragToStart Then
|
||||
' Se movimento con sola verifica finale
|
||||
@@ -1337,11 +1695,11 @@ Public Class NestingTabVM
|
||||
End If
|
||||
End If
|
||||
m_bFromParking = False
|
||||
' altrimenti caso con verifica durante il movimento
|
||||
' altrimenti caso con verifica durante il movimento
|
||||
Else
|
||||
' Basta reset alla fine
|
||||
End If
|
||||
' Se selezione da eseguire
|
||||
' Se selezione da eseguire
|
||||
ElseIf m_nIdToSel <> GDB_ID.NULL Then
|
||||
' Determino se pezzo in tavola o in parcheggio
|
||||
Dim bPartInTable As Boolean = (EgtGetParent(m_nIdToSel) = GetRawId())
|
||||
@@ -1358,7 +1716,7 @@ Public Class NestingTabVM
|
||||
VeinMatching.OnSelectPart(m_nIdToSel)
|
||||
' Set flag posizione selezionati
|
||||
m_nPartPos = If(bPartInTable, PART_POS.IN_TABLE, PART_POS.OUT_TABLE)
|
||||
' Se deselezione da eseguire
|
||||
' Se deselezione da eseguire
|
||||
ElseIf m_nIdToDesel <> GDB_ID.NULL Then
|
||||
EgtDeselectObj(m_nIdToDesel)
|
||||
' Eventuale aggiornamento VeinMatching
|
||||
|
||||
@@ -469,6 +469,7 @@ Public Class SideEntityControlVM
|
||||
Parameter23_Visibility = Windows.Visibility.Hidden
|
||||
Parameter2_Visibility = Visibility.Visible
|
||||
Parameter2ab_Visibility = Visibility.Hidden
|
||||
Parameter4_Visibility = Visibility.Hidden
|
||||
ElseIf m_Mode = ModeOpt.FILOTOP Then
|
||||
Parameter23_Visibility = Windows.Visibility.Hidden
|
||||
Parameter2_Visibility = Visibility.Visible
|
||||
|
||||
Reference in New Issue
Block a user