OmagOFFICE 2.2a4 :
- drag diretto del pezzo da parcheggio a lastra - archi lavorati all'esterno con possibilità di inclinazione - possibilità di allungare e accorciare gli estremi dei tagli di una quantità a piacere - possibilità di bloccare la rotazione dei pezzi - possibilità di nesting automatico.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<Window x:Class="AboutBoxV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="AboutBox" Height="320" Width="300" WindowStyle="None" ResizeMode="NoResize"
|
||||
Title="AboutBox" Height="400" Width="360" WindowStyle="None" ResizeMode="NoResize"
|
||||
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Border BorderThickness="2" BorderBrush="LightBlue">
|
||||
@@ -18,7 +18,7 @@
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="2.5*"/>
|
||||
<RowDefinition Height="0.35*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.35*"/>
|
||||
@@ -31,7 +31,7 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Name="LogoBrd" Grid.Column="1" Background="White">
|
||||
<Image Source="/Resources/LogoOmag.jpg" Stretch="Uniform"/>
|
||||
<Image Source="/Resources/AboutBoxImage.png" Stretch="Uniform"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
|
||||
@@ -43,7 +43,7 @@
|
||||
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
|
||||
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="8" IsCancel="True"
|
||||
Margin="1,0"/>
|
||||
Margin="100,0"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -18,11 +18,15 @@ Public Class AboutBoxV
|
||||
Dim sLeftDays As String = ""
|
||||
Dim nLeftDays As Integer
|
||||
if EgtGetKeyLeftDays( nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays= " (" & nLeftDays.ToString() & ")"
|
||||
sInfo = If( EgtIsDebug(), "Debug Libraries" & Environment.NewLine, "")
|
||||
sInfo = sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
|
||||
sInfo &= "User " & Environment.MachineName & "\" & Environment.UserName &
|
||||
" (" & OmagOFFICEMap.refMainWindowVM.MainWindowM.nInstance.ToString() & ")" & Environment.NewLine
|
||||
sInfo &= "DataRoot " & OmagOFFICEMap.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
|
||||
sInfo &= "MachinesRoot " & OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
|
||||
Dim sCPU As String = String.Empty
|
||||
EgtGetCpuInfo( sCPU)
|
||||
sInfo &= sCPU & Environment.NewLine
|
||||
Dim sScene As String = String.Empty
|
||||
EgtGetSceneInfo(sScene)
|
||||
sInfo &= sScene
|
||||
|
||||
@@ -22,6 +22,7 @@ Module ConstGen
|
||||
Public Const LIC_FILE_NAME As String = "OmagOFFICE.lic"
|
||||
Public Const S_LICENCE As String = "Licence"
|
||||
Public Const K_KEY As String = "Key"
|
||||
Public Const K_NESTKEY As String = "NestKey"
|
||||
|
||||
' Abilitazioni licenza
|
||||
Friend Enum KEY_OPT As UInteger
|
||||
|
||||
@@ -105,6 +105,8 @@ Module ConstIni
|
||||
Public Const K_SNAPDIST As String = "SnapDist"
|
||||
Public Const K_TRFTHICKTOLERANCE As String = "TrfThickTolerance"
|
||||
Public Const K_TEXTCOLOR As String = "TextColor"
|
||||
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
|
||||
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
|
||||
|
||||
Public Const S_CSV As String = "Csv"
|
||||
Public Const K_CSVDIRECT As String = "Direct"
|
||||
|
||||
@@ -196,6 +196,8 @@ Module ConstMach
|
||||
Public Const SIDE_ANGLE_LAYER As String = "SideAngle"
|
||||
' Nome layer per regioni selezione percorsi interni
|
||||
Public Const SELECT_REGION_LAYER As String = "SelectRegion"
|
||||
' Info in pezzo per stato rotazione
|
||||
Public Const INFO_PARTROT As String = "ROT"
|
||||
|
||||
' Nome di pezzo che è una cornice
|
||||
Public Const NAME_FRAME As String = "Frame"
|
||||
|
||||
@@ -157,6 +157,7 @@
|
||||
Public Const K_MACH_MILLING_ON_SINKS As String = "MillingOnSinks"
|
||||
Public Const K_MACH_MILLING_SHORTENING As String = "MillingShortening"
|
||||
Public Const K_MACH_NEST_ALIGNED As String = "Aligned"
|
||||
Public Const K_MACH_NEST_AUTOMATIC As String = "Automatic"
|
||||
Public Const K_MACH_WASHING As String = "Washing"
|
||||
Public Const K_MACH_SACPROBE As String = "SacProbe"
|
||||
Public Const K_MACH_ENABLERESTART As String = "EnableRestart"
|
||||
|
||||
@@ -40,6 +40,7 @@ Public Module CurrentMachine
|
||||
' Dati per nesting
|
||||
Private m_bReducedCut As Boolean = True
|
||||
Private m_bAligned As Boolean = True
|
||||
Private m_bAutomatic As Boolean = False
|
||||
|
||||
' Dati per forature
|
||||
Private m_dHolesOffset As Double = 0
|
||||
@@ -451,6 +452,17 @@ Public Module CurrentMachine
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property bAutomatic As Boolean
|
||||
Get
|
||||
Return m_bAutomatic
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If WritePrivateProfileString(S_MACH_NEST, K_MACH_NEST_AUTOMATIC, If(value, "1", "0"), sMachIniFile) Then
|
||||
m_bAutomatic = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nSacProbe As Integer
|
||||
Get
|
||||
Return m_nSacProbe
|
||||
@@ -837,7 +849,7 @@ Public Module CurrentMachine
|
||||
Return m_dFsevLength
|
||||
End Get
|
||||
Set(value As Double)
|
||||
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVLEN, DoubleToString(value, 3), sMachIniFile) Then
|
||||
If WritePrivateProfileString(S_MACH_NEST, K_MACH_CUTFSEVLEN, DoubleToString(value, 3), sMachIniFile) Then
|
||||
m_dFsevLength = value
|
||||
End If
|
||||
End Set
|
||||
@@ -848,7 +860,7 @@ Public Module CurrentMachine
|
||||
Return m_dFsevPerc
|
||||
End Get
|
||||
Set(value As Double)
|
||||
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVPERC, DoubleToString(value, 3), sMachIniFile) Then
|
||||
If WritePrivateProfileString(S_MACH_NEST, K_MACH_CUTFSEVPERC, DoubleToString(value, 3), sMachIniFile) Then
|
||||
m_dFsevPerc = value
|
||||
End If
|
||||
End Set
|
||||
@@ -1066,6 +1078,7 @@ Public Module CurrentMachine
|
||||
' Parametri per nesting dalla macchina
|
||||
m_bReducedCut = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_REDUCEDCUT, 0, sMachIniFile) <> 0)
|
||||
m_bAligned = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_ALIGNED, 0, sMachIniFile) <> 0)
|
||||
m_bAutomatic = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_AUTOMATIC, 0, sMachIniFile) <> 0)
|
||||
' Leggo offset fori
|
||||
m_dHolesOffset = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OFFSET, 0, sMachIniFile)
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTRARONDRIREG, m_dHolesOffset)
|
||||
@@ -1224,9 +1237,9 @@ Public Module CurrentMachine
|
||||
m_bDirectCutsFinalHome = (GetPrivateProfileInt(S_MACH_DIRECTCUTS, K_FINALHOME, 1, sMachIniFile) <> 0)
|
||||
|
||||
' Leggo dati per feed ridotta all'inizio/fine dei tagli
|
||||
m_bFsevEnable = (GetPrivateProfileInt(S_NEST, K_MACH_CUTFSEVENABLE, 0, sMachIniFile) <> 0)
|
||||
m_dFsevLength = GetPrivateProfileDouble(S_NEST, K_MACH_CUTFSEVLEN, 0, sMachIniFile)
|
||||
m_dFsevPerc = GetPrivateProfileDouble(S_NEST, K_MACH_CUTFSEVPERC, 0, sMachIniFile)
|
||||
m_bFsevEnable = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_CUTFSEVENABLE, 0, sMachIniFile) <> 0)
|
||||
m_dFsevLength = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_CUTFSEVLEN, 0, sMachIniFile)
|
||||
m_dFsevPerc = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_CUTFSEVPERC, 0, sMachIniFile)
|
||||
|
||||
' Pulisco la lista dei materiali
|
||||
m_Materials.Clear()
|
||||
|
||||
+67
-48
@@ -490,52 +490,76 @@ Module EstCalc
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function PreInsertOnePart(nId As Integer) As Boolean
|
||||
' Se non esiste grezzo o pezzo non in parcheggio, esco
|
||||
If m_nRawId = GDB_ID.NULL OrElse Not EgtIsPart(nId) Then Return False
|
||||
' Sistemazioni per eventuali lati inclinati con tallone
|
||||
AdjustPartSideAngleHeel(nId, m_b3Raw.DimZ())
|
||||
' Sistemazioni per eventuali lati esterni inclinati e/o offsettati
|
||||
EgtCalcFlatPartUpRegion(nId, True)
|
||||
EgtCalcFlatPartDownRegion(nId, m_b3Raw.DimZ())
|
||||
' Dimensioni del pezzo
|
||||
Dim b3Part As New BBox3d
|
||||
If Not EgtGetBBoxGlob(nId, GDB_BB.IGNORE_DIM + GDB_BB.IGNORE_TEXT, b3Part) Then Return False
|
||||
' Centro del grezzo
|
||||
Dim ptRawCenter As Point3d
|
||||
If Not EgtGetRawPartCenter(m_nRawId, ptRawCenter) Then Return False
|
||||
Dim dRawCenX = ptRawCenter.x - m_b3Raw.Min().x
|
||||
Dim dRawCenY = ptRawCenter.y - m_b3Raw.Min().y
|
||||
' Inserisco il pezzo nel grezzo, in centro in XY e in alto in Z
|
||||
Dim ptP As New Point3d(dRawCenX - 0.5 * b3Part.DimX(), dRawCenY - 0.5 * b3Part.DimY(), m_b3Raw.DimZ())
|
||||
If Not EgtAddPartToRawPart(nId, ptP, m_nRawId) Then Return False
|
||||
' Aggiungo le lavorazioni standard
|
||||
Dim nWarn As Integer = 0
|
||||
AddMachinings(nId, nWarn)
|
||||
' Lama troppo grande per utilizzo ventosa
|
||||
If nWarn = 1 Then OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SPLITPAGEUC + 11), 3, MSG_TYPE.WARNING)
|
||||
Return true
|
||||
End Function
|
||||
|
||||
Public Function PreRemoveOnePart(nId As Integer) As Boolean
|
||||
' Se non esiste il pezzo, esco
|
||||
If nId = GDB_ID.NULL Then Return false
|
||||
' Rimuovo le lavorazioni
|
||||
EraseMachinings(nId)
|
||||
' Elimino eventuali modifiche per lati esterni inclinati e/o offsettati
|
||||
EgtCalcFlatPartUpRegion(nId, False)
|
||||
EgtCalcFlatPartDownRegion(nId, 0)
|
||||
' Eventuale cancellazione solido per taglio da sotto
|
||||
EraseSolidForDrip(nId)
|
||||
' Parcheggio
|
||||
EgtRemovePartFromRawPart(nId)
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
Return true
|
||||
End Function
|
||||
|
||||
Public Function InsertOnePart(nId As Integer, bAligned As Boolean, bReducedCut As Boolean) As Boolean
|
||||
' Se esiste grezzo e pezzo in parcheggio, lo metto nella tavola
|
||||
If m_nRawId <> GDB_ID.NULL AndAlso EgtIsPart(nId) Then
|
||||
' Sistemazioni per eventuali lati inclinati con tallone
|
||||
AdjustPartSideAngleHeel(nId, m_b3Raw.DimZ())
|
||||
' Sistemazioni per eventuali lati esterni inclinati e/o offsettati
|
||||
EgtCalcFlatPartUpRegion(nId, True)
|
||||
EgtCalcFlatPartDownRegion(nId, m_b3Raw.DimZ())
|
||||
' Dimensioni del pezzo
|
||||
Dim ptPartMin, ptPartMax As Point3d
|
||||
If Not EgtGetBBoxGlob(nId, GDB_BB.IGNORE_DIM + GDB_BB.IGNORE_TEXT, ptPartMin, ptPartMax) Then Return False
|
||||
Dim dPartLen As Double = ptPartMax.x - ptPartMin.x
|
||||
Dim dPartHeight As Double = ptPartMax.y - ptPartMin.y
|
||||
' Centro del grezzo
|
||||
Dim nRawCenId = EgtGetFirstNameInGroup(m_nRawId, NAME_RAW_CENTER)
|
||||
Dim ptRawCenter As Point3d
|
||||
EgtStartPoint(nRawCenId, GDB_ID.ROOT, ptRawCenter)
|
||||
Dim dRawCenX = ptRawCenter.x - m_b3Raw.Min().x
|
||||
Dim dRawCenY = ptRawCenter.y - m_b3Raw.Min().y
|
||||
' Inserisco il pezzo nel grezzo, in centro in XY e in alto in Z
|
||||
Dim ptP As New Point3d(dRawCenX - 0.5 * dPartLen, dRawCenY - 0.5 * dPartHeight, m_b3Raw.DimZ())
|
||||
If EgtAddPartToRawPart(nId, ptP, m_nRawId) Then
|
||||
' Aggiungo le lavorazioni standard
|
||||
AddMachinings(nId)
|
||||
' Eseguo nesting
|
||||
Dim bFit As Boolean = False
|
||||
If UpdateNestRegions() Then
|
||||
EnableReferenceRegion(bAligned)
|
||||
If Not EgtExistsInfo(m_nRawId, KEY_RAWBYPOINTS) Then
|
||||
bFit = EgtPackPartInRectangle(nId, bReducedCut, True)
|
||||
End If
|
||||
If Not bFit Then
|
||||
bFit = EgtPackPart(nId, bReducedCut, True)
|
||||
End If
|
||||
' Se il pezzo non è in parcheggio, non si può inserire
|
||||
If Not EgtIsPart(nId) Then Return False
|
||||
' Metto pezzo in centro grezzo con lavorazioni e sistemazioni varie
|
||||
Dim bFit As Boolean = False
|
||||
If PreInsertOnePart( nId) Then
|
||||
' Eseguo nesting
|
||||
If UpdateNestRegions() Then
|
||||
EnableReferenceRegion(bAligned)
|
||||
If Not EgtExistsInfo(m_nRawId, KEY_RAWBYPOINTS) Then
|
||||
bFit = EgtPackPartInRectangle(nId, bReducedCut, True)
|
||||
End If
|
||||
' Gestione risultato nesting
|
||||
If bFit Then
|
||||
Return True
|
||||
Else
|
||||
EraseMachinings(nId)
|
||||
EgtRemovePartFromRawPart(nId)
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
If Not bFit Then
|
||||
bFit = EgtPackPart(nId, bReducedCut, True)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
' Gestione risultato nesting
|
||||
If bFit Then
|
||||
' Eventuale aggiunta solido per taglio da sotto
|
||||
UpdateSolidForDrip(nId)
|
||||
Return True
|
||||
Else
|
||||
' Ripristino lo stato originale
|
||||
PreRemoveOnePart( nId)
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function AdjustPartSideAngleHeel(nPartId As Integer, dTh As Double) As Boolean
|
||||
@@ -608,14 +632,9 @@ Module EstCalc
|
||||
' Se pezzo in grezzo, metto in parcheggio (sempre possibile)
|
||||
If bForced OrElse
|
||||
(m_nRawId <> GDB_ID.NULL AndAlso EgtGetParent(nId) = m_nRawId) Then
|
||||
' Rimuovo le lavorazioni
|
||||
EraseMachinings(nId)
|
||||
' Elimino eventuali modifiche per lati esterni inclinati e/o offsettati
|
||||
EgtCalcFlatPartUpRegion(nId, False)
|
||||
EgtCalcFlatPartDownRegion(nId, 0)
|
||||
' Ripristino lo stato originale
|
||||
PreRemoveOnePart( nId)
|
||||
' Parcheggio
|
||||
EgtRemovePartFromRawPart(nId)
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
PackPartInStore(nId)
|
||||
' Aggiusto la posizione in Z
|
||||
Dim ptPartMin, ptPartMax As Point3d
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Module SplitAuto
|
||||
|
||||
@@ -19,6 +20,7 @@ Public Module SplitAuto
|
||||
Public m_bEndAll As Boolean
|
||||
Public m_bEnabled As Boolean
|
||||
Public m_bPause As Boolean
|
||||
Public m_bInvert As Boolean
|
||||
End Class
|
||||
|
||||
'-----------------------------------------------------------------------------------------------
|
||||
@@ -96,6 +98,15 @@ Public Module SplitAuto
|
||||
Mach.m_bStartAll = False
|
||||
Mach.m_bEndAll = False
|
||||
End If
|
||||
' Waterjet
|
||||
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then
|
||||
Mach.m_nInterf = FMI_TYPE.NONE
|
||||
' recupero l'angolo di fianco
|
||||
EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng)
|
||||
Mach.m_bCanStartAll = False
|
||||
Mach.m_bCanEndAll = False
|
||||
Mach.m_bStartAll = False
|
||||
Mach.m_bEndAll = False
|
||||
' Forature e fresature
|
||||
Else
|
||||
Mach.m_nInterf = FMI_TYPE.NONE
|
||||
@@ -109,6 +120,8 @@ Public Module SplitAuto
|
||||
Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF)
|
||||
' pausa
|
||||
Mach.m_bPause = GetPause(nOperId)
|
||||
' inversione
|
||||
EgtGetMachiningParam(MCH_MP.INVERT, Mach.m_bInvert)
|
||||
' inserisco in lista
|
||||
MachSplitList.Add(Mach)
|
||||
' altrimenti la disattivo
|
||||
@@ -364,7 +377,9 @@ Public Module SplitAuto
|
||||
' Cancello tutte le lavorazioni
|
||||
EraseMachinings(GDB_ID.NULL)
|
||||
' Reinserisco tutte le lavorazioni
|
||||
AddMachinings(GDB_ID.NULL)
|
||||
Dim nWarn As Integer = 0
|
||||
AddMachinings(GDB_ID.NULL, nWarn)
|
||||
If nWarn = 1 Then OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SPLITPAGEUC + 11), MSG_TYPE.WARNING) ' Lama troppo grande per utilizzo ventosa
|
||||
' Carico ventose
|
||||
LoadVacuumCups()
|
||||
' Lancio calcolo separazione
|
||||
@@ -377,8 +392,7 @@ Public Module SplitAuto
|
||||
' Se non finito con successo, verifico se necessario limitare lavorazioni
|
||||
If Not bFinished Then
|
||||
If Not TestMachiningCurrPhaseForStrict() Then
|
||||
' !!! DA SISTEMARE !!!
|
||||
'm_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(90321), MSG_TYPE.WARNING) 'Ridotte alcune lavorazioni per evitare interferenze
|
||||
End If
|
||||
End If
|
||||
EgtSetCurrPhase(1)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<RowDefinition Height="3*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
@@ -166,7 +166,7 @@
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{Binding NestingParamMsg}" Grid.Column="1" Grid.Row="3" Grid.RowSpan="1">
|
||||
<UniformGrid Columns="1" Rows="2">
|
||||
<UniformGrid Columns="1" Rows="3">
|
||||
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding CompleteCutsMsg}"
|
||||
@@ -180,7 +180,13 @@
|
||||
<CheckBox IsChecked="{Binding Aligned}"
|
||||
Style="{StaticResource OptionCheckBox}"/>
|
||||
</Grid>
|
||||
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding AutomaticMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<CheckBox IsChecked="{Binding Automatic}"
|
||||
Style="{StaticResource OptionCheckBox}"/>
|
||||
</Grid>
|
||||
|
||||
</UniformGrid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
@@ -215,6 +215,15 @@ Public Class MachOptionWindowVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Automatic As Boolean
|
||||
Get
|
||||
Return CurrentMachine.bAutomatic
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
CurrentMachine.bAutomatic = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Nesting Param
|
||||
|
||||
Public Property AdditionalTable As String
|
||||
@@ -436,6 +445,11 @@ Public Class MachOptionWindowVM
|
||||
Return EgtMsg(MSG_ALARMSPAGEUC + 32)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property AutomaticMsg As String
|
||||
Get
|
||||
Return EgtMsg(91059)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property AdditionalTableMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_ALARMSPAGEUC + 36)
|
||||
|
||||
@@ -60,6 +60,13 @@ Public Class MainWindowM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_bAutoNestOption As Boolean = False
|
||||
Friend ReadOnly Property AutoNestOption As Boolean
|
||||
Get
|
||||
Return m_bAutoNestOption
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property sVersion As String
|
||||
Get
|
||||
Return My.Application.Info.Version.Major.ToString() & "." &
|
||||
@@ -161,9 +168,14 @@ Public Class MainWindowM
|
||||
Dim sKey As String = String.Empty
|
||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||
EgtSetKey(sKey)
|
||||
Dim sNestKey As String = ""
|
||||
EgtUILib.GetPrivateProfileString( S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
||||
EgtSetNestKey( sNestKey)
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey)
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 19, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 19, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 21, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 21, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
|
||||
@@ -30,7 +30,7 @@ Imports System.Windows
|
||||
#End If
|
||||
<Assembly: AssemblyCompany("EgalTech s.r.l.")>
|
||||
<Assembly: AssemblyProduct("OmagOFFICE")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2017-2019 by EgalTech s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2017-2020 by EgalTech s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
'In order to begin building localizable applications, set
|
||||
@@ -69,5 +69,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.1.11.2")>
|
||||
<Assembly: AssemblyFileVersion("2.1.11.2")>
|
||||
<Assembly: AssemblyVersion("2.2.1.4")>
|
||||
<Assembly: AssemblyFileVersion("2.2.1.4")>
|
||||
|
||||
+24
-1
@@ -219,6 +219,14 @@
|
||||
<DependentUpon>MachiningTabV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OptionPanel\MachiningTab\MachiningTabVM.vb" />
|
||||
<Compile Include="OptionPanel\MachiningTab\ModifStartEndCutWindowV.xaml.vb">
|
||||
<DependentUpon>ModifStartEndCutWindowV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OptionPanel\MachiningTab\ModifStartEndWjWindowV.xaml.vb">
|
||||
<DependentUpon>ModifStartEndWjWindowV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OptionPanel\MachiningTab\ModifStartEndCutWindowVM.vb" />
|
||||
<Compile Include="OptionPanel\MachiningTab\ModifStartEndWjWindowVM.vb" />
|
||||
<Compile Include="OptionPanel\MachiningTab\MoveRawModeV.xaml.vb">
|
||||
<DependentUpon>MoveRawModeV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -375,6 +383,14 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="OptionPanel\MachiningTab\ModifStartEndCutWindowV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OptionPanel\MachiningTab\ModifStartEndWjWindowV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OptionPanel\MachiningTab\MoveRawModeV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -494,6 +510,7 @@
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
@@ -604,10 +621,16 @@
|
||||
<Resource Include="Resources\CsvWindow\CsvOpen.png" />
|
||||
<Resource Include="Resources\CsvWindow\CsvPlus.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\AboutBoxImage.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\OptionWindow\ChangeColor.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NestingTab\PartRotOff.png" />
|
||||
<Resource Include="Resources\NestingTab\PartRotOn.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="ModifStartEndCutWindowV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
IsMinimizable="False"
|
||||
ShowInTaskbar="False"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Height="200" Width="400"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="1" Grid.Row="1" Margin="0,5,0,0"
|
||||
Style="{StaticResource OptionTextBlock}" Text="{Binding ValueMsg}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="2" Grid.Row="1" Margin="10,5,10,0"
|
||||
Style="{StaticResource OptionTextBox}" Text="{Binding sValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.Row="3" Grid.RowSpan="1" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="OkBtn" Content="{Binding OkMsg}" Grid.Column="1"
|
||||
Style="{DynamicResource ToolBar_TextButton}">
|
||||
</Button>
|
||||
<Button Content="{Binding ExitMsg}" Grid.Column="3"
|
||||
IsCancel="True"
|
||||
Style="{DynamicResource ToolBar_TextButton}">
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,6 @@
|
||||
Public Class ModifStartEndCutWindowV
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
DialogResult = True
|
||||
End Sub
|
||||
End Class
|
||||
@@ -0,0 +1,50 @@
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ModifStartEndCutWindowVM
|
||||
|
||||
Public ReadOnly Property ValueMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_SPLITPAGEUC + 35)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OkMsg As String
|
||||
Get
|
||||
Return EgtMsg(91651) 'Ok
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ExitMsg As String
|
||||
Get
|
||||
Return EgtMsg(91652) 'Annulla
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sValue As String
|
||||
Public Property sValue As String
|
||||
Get
|
||||
Return m_sValue
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sValue = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Function SetVal(dVal As Double) As Boolean
|
||||
sValue = DoubleToString(dVal, 3)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function GetVal() As Double
|
||||
Dim dVal As Double = 0
|
||||
StringToDouble(sValue, dVal)
|
||||
Return dVal
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="ModifStartEndWjWindowV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
IsMinimizable="False"
|
||||
ShowInTaskbar="False"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Height="400" Width="400"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="1" Grid.Row="1" Margin="0,5,0,0"
|
||||
Style="{StaticResource OptionTextBlock}" Text="{Binding ValueMsg}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="2" Grid.Row="1" Margin="10,5,10,0"
|
||||
Style="{StaticResource OptionTextBox}" Text="{Binding sValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.Row="7" Grid.RowSpan="1" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Content="{Binding OkMsg}" Grid.Column="1"
|
||||
Style="{DynamicResource ToolBar_TextButton}">
|
||||
</Button>
|
||||
<Button Content="{Binding ExitMsg}" Grid.Column="3"
|
||||
IsCancel="True"
|
||||
Style="{DynamicResource ToolBar_TextButton}">
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--<GroupBox Header="{Binding DirectInsertHdr}"
|
||||
Grid.Row="2" Margin="0,0,5,5">
|
||||
<UniformGrid Rows="2">
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding DIGeneralMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<CheckBox IsChecked="{Binding DIGeneral}"
|
||||
Style="{StaticResource OptionCheckBox}"/>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding DICsvMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<CheckBox IsChecked="{Binding DICsv}"
|
||||
Style="{StaticResource OptionCheckBox}"/>
|
||||
</Grid>
|
||||
</UniformGrid>
|
||||
</GroupBox>-->
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class ModifStartEndWjWindowV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,60 @@
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ModifStartEndWjWindowVM
|
||||
|
||||
Public ReadOnly Property ValueMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_SPLITPAGEUC + 35)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OkMsg As String
|
||||
Get
|
||||
Return EgtMsg(91651) 'Ok
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ExitMsg As String
|
||||
Get
|
||||
Return EgtMsg(91652) 'Annulla
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sValue As String
|
||||
Public Property sValue As String
|
||||
Get
|
||||
Return m_sValue
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sValue = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Function SetVal(dVal As Double) As Boolean
|
||||
sValue = DoubleToString(dVal, 3)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function GetVal() As Double
|
||||
Dim dVal As Double = 0
|
||||
StringToDouble(sValue, dVal)
|
||||
Return dVal
|
||||
End Function
|
||||
|
||||
'Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
' m_sValue = ValueTxBx.Text
|
||||
' DialogResult = True
|
||||
'End Sub
|
||||
|
||||
'Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
' m_sValue = ""
|
||||
' DialogResult = False
|
||||
'End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -151,7 +151,17 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Content="{Binding PauseMsg}" Grid.Column="1"
|
||||
<Button Content="{Binding ModifStartMsg}" Grid.Column="0"
|
||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||
Command="{Binding ModifStartCommand}"
|
||||
Margin="2.5,0,2.5,0"/>
|
||||
|
||||
<Button Content="{Binding ModifEndMsg}" Grid.Column="1"
|
||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||
Command="{Binding ModifEndCommand}"
|
||||
Margin="2.5,0,2.5,0"/>
|
||||
|
||||
<Button Content="{Binding PauseMsg}" Grid.Column="2"
|
||||
Style="{StaticResource OptionPanel_TextWrapButton}"
|
||||
Command="{Binding PauseCommand}"
|
||||
Margin="2.5,0,2.5,0"/>
|
||||
|
||||
@@ -147,6 +147,18 @@ Public Class SplitModeVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ModifStartMsg As String
|
||||
Get
|
||||
Return EgtMsg( 90373) ' Inizio Modif.
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ModifEndMsg As String
|
||||
Get
|
||||
Return EgtMsg( 90374) ' Fine Modif.
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PauseMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_SPLITPAGEUC + 31)
|
||||
@@ -172,6 +184,8 @@ Public Class SplitModeVM
|
||||
Private m_cmdAllCenEnd As ICommand
|
||||
Private m_cmdAllExtend As ICommand
|
||||
Private m_cmdAllReduce As ICommand
|
||||
Private m_cmdModifStart As ICommand
|
||||
Private m_cmdModifEnd As ICommand
|
||||
Private m_cmdPause As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
@@ -1262,6 +1276,116 @@ Public Class SplitModeVM
|
||||
|
||||
#End Region ' AllReduceCommand
|
||||
|
||||
#Region "ModifStartCommand"
|
||||
|
||||
Public ReadOnly Property ModifStartCommand As ICommand
|
||||
Get
|
||||
If m_cmdModifStart Is Nothing Then
|
||||
m_cmdModifStart = New Command(AddressOf ModifStart)
|
||||
End If
|
||||
Return m_cmdModifStart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub ModifStart(ByVal param As Object)
|
||||
' Recupero la lavorazione corrente
|
||||
If m_CurrInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrInd To m_CurrInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
|
||||
' Se taglio con lama
|
||||
If nMachiningType = MCH_MY.SAWING Then
|
||||
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()
|
||||
EgtSetCurrMachining(nOperId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
|
||||
If dAddLen - dOrigUsal < -10 * EPS_SMALL Then Return
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
bGenModif = True
|
||||
End If
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bGenModif Then
|
||||
EgtDraw()
|
||||
m_bModified = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ModifStartCommand
|
||||
|
||||
#Region "ModifEndCommand"
|
||||
|
||||
Public ReadOnly Property ModifEndCommand As ICommand
|
||||
Get
|
||||
If m_cmdModifEnd Is Nothing Then
|
||||
m_cmdModifEnd = New Command(AddressOf ModifEnd)
|
||||
End If
|
||||
Return m_cmdModifEnd
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub ModifEnd(ByVal param As Object)
|
||||
' Recupero la lavorazione corrente
|
||||
If m_CurrInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrInd To m_CurrInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
|
||||
' Se taglio con lama
|
||||
If nMachiningType = MCH_MY.SAWING Then
|
||||
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 dUsal As Double = ModifStartWindowVM.GetVal()
|
||||
EgtSetCurrMachining(nOperId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
||||
If dAddLen - dOrigUeal < -10 * EPS_SMALL Then Return
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUsal - dOrigUeal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUsal)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
bGenModif = True
|
||||
End If
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bGenModif Then
|
||||
EgtDraw()
|
||||
m_bModified = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ModifEndCommand
|
||||
|
||||
#Region "PauseCommand"
|
||||
|
||||
Public ReadOnly Property PauseCommand As ICommand
|
||||
|
||||
@@ -56,11 +56,21 @@
|
||||
|
||||
<!--<TextBlock Name="PositioningLbl" Grid.ColumnSpan="3" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="15" />-->
|
||||
<Button Grid.Column="0" Grid.Row="0"
|
||||
Style="{StaticResource OptionPanel_NestingButton}" Width="48" Height="48"
|
||||
Command="{Binding PartRotOnCommand}">
|
||||
<Image Source="/Resources/NestingTab/PartRotOn.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2" Grid.Row="0"
|
||||
Style="{StaticResource OptionPanel_NestingButton}"
|
||||
Command="{Binding UpCommand}">
|
||||
Style="{StaticResource OptionPanel_NestingButton}"
|
||||
Command="{Binding UpCommand}">
|
||||
<Image Source="/Resources/NestingTab/UpArrow.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="4" Grid.Row="0"
|
||||
Style="{StaticResource OptionPanel_NestingButton}" Width="48" Height="48"
|
||||
Command="{Binding PartRotOffCommand}">
|
||||
<Image Source="/Resources/NestingTab/PartRotOff.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="0" Grid.Row="2"
|
||||
Style="{StaticResource OptionPanel_NestingButton}"
|
||||
Command="{Binding LeftCommand}">
|
||||
|
||||
@@ -25,6 +25,7 @@ Public Class NestingTabVM
|
||||
Private m_bDrag As Boolean = False
|
||||
Private m_bDragToStart As Boolean = False
|
||||
Private m_bVerify As Boolean = False
|
||||
Private m_bFromParking As Boolean = False
|
||||
Private m_bDragging As Boolean = False
|
||||
Private m_locPrev As System.Drawing.Point
|
||||
Private m_ptPrev As Point3d
|
||||
@@ -147,6 +148,8 @@ Public Class NestingTabVM
|
||||
' Definizione comandi
|
||||
Private m_cmdDraw As ICommand
|
||||
Private m_cmdImportDxf As ICommand
|
||||
Private m_cmdPartRotOn As ICommand
|
||||
Private m_cmdPartRotOff As ICommand
|
||||
Private m_cmdUp As ICommand
|
||||
Private m_cmdLeft As ICommand
|
||||
Private m_cmdRight As ICommand
|
||||
@@ -207,6 +210,111 @@ Public Class NestingTabVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub StandardInsert()
|
||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||
Dim bWrongTrf As Boolean = False
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
' Ciclo di inserimento in tavola dei pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Recupero successivo selezionato
|
||||
Dim nNextId = EgtGetNextSelectedObj()
|
||||
' Se pezzo da Trf, verifico compatibilità
|
||||
If Not VerifyTrfData(nId) Then
|
||||
bWrongTrf = True
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
' Passo al successivo selezionato
|
||||
nId = nNextId
|
||||
Continue While
|
||||
End If
|
||||
' Lo metto in tavola, se possibile
|
||||
If EstCalc.InsertOnePart(nId, CurrentMachine.bAligned, CurrentMachine.bReducedCut) Then
|
||||
' Eventuale notifica al VeinMatching
|
||||
VeinMatching.OnInsertPartInRaw(nId)
|
||||
Else
|
||||
VeinMatching.OnDeselectPart(nId)
|
||||
End If
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
' Passo al successivo selezionato
|
||||
nId = nNextId
|
||||
End While
|
||||
' Aggiorno flag selezionati
|
||||
m_nPartPos = If(EgtGetSelectedObjCount() > 0, PART_POS.IN_TABLE, PART_POS.NONE_TABLE)
|
||||
' Aggiorno vista
|
||||
EgtZoom(ZM.ALL)
|
||||
' Eventuale segnalazione di pezzi Trf non adatti
|
||||
If bWrongTrf Then
|
||||
' Pezzi con spessore, materiale o finitura non compatibili
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_NESTPAGEUC + 7), MSG_TYPE.WARNING)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AutomaticInsert()
|
||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage( EgtMsg( 90340)) ' Nesting Automatico in corso
|
||||
Dim bWrongTrf As Boolean = False
|
||||
Dim vParts As New List(Of Integer)
|
||||
' Ciclo di pre-inserimento in tavola dei pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Recupero successivo selezionato
|
||||
Dim nNextId = EgtGetNextSelectedObj()
|
||||
' Se pezzo da Trf, verifico compatibilità
|
||||
If Not VerifyTrfData(nId) Then
|
||||
bWrongTrf = True
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
' Passo al successivo selezionato
|
||||
nId = nNextId
|
||||
Continue While
|
||||
End If
|
||||
' Lo preparo in tavola, se possibile
|
||||
If PreInsertOnePart(nId) Then
|
||||
vParts.Add( nId)
|
||||
Else
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
VeinMatching.OnDeselectPart(nId)
|
||||
End If
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
' Passo al successivo selezionato
|
||||
nId = nNextId
|
||||
End While
|
||||
' Aggiorno le regioni per il nesting
|
||||
UpdateNestRegions()
|
||||
Dim bAligned As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_ALIGNED, 0, CurrentMachine.sMachIniFile) <> 0)
|
||||
EnableReferenceRegion(bAligned)
|
||||
' Eseguo nesting automatico
|
||||
Dim bOpimizeOnX As Boolean = ( GetMainPrivateProfileInt( S_NEST, K_AUTOMATICOPTIMIZE, 2) = 1)
|
||||
Dim nAutomaticMaxTime As Integer = GetMainPrivateProfileInt( S_NEST, K_AUTOMATICMAXTIME, 20)
|
||||
Dim nMaxTime As Integer = Math.Min( 2 + 0.5 * vParts.Count(), nAutomaticMaxTime)
|
||||
EgtAutomaticPackParts( vParts, bOpimizeOnX, CurrentMachine.bReducedCut, nMaxTime)
|
||||
' Sistemo i pezzi
|
||||
For Each nPartId As Integer In vParts
|
||||
' se pezzo inserito
|
||||
If nPartId > 0 Then
|
||||
VeinMatching.OnInsertPartInRaw(nPartId)
|
||||
' Eventuale aggiunta solido per taglio da sotto
|
||||
UpdateSolidForDrip(nPartId)
|
||||
' altrimenti rifiutato
|
||||
else
|
||||
' Ripristino lo stato originale
|
||||
PreRemoveOnePart( Math.Abs( nPartId))
|
||||
VeinMatching.OnDeselectPart( Math.Abs( nPartId))
|
||||
End If
|
||||
Next
|
||||
' Aggiorno flag selezionati
|
||||
m_nPartPos = If(EgtGetSelectedObjCount() > 0, PART_POS.IN_TABLE, PART_POS.NONE_TABLE)
|
||||
' Aggiorno vista
|
||||
EgtZoom(ZM.ALL)
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
' Eventuale segnalazione di pezzi Trf non adatti
|
||||
If bWrongTrf Then
|
||||
' Pezzi con spessore, materiale o finitura non compatibili
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_NESTPAGEUC + 7), MSG_TYPE.WARNING)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function RotateCluster(ByVal dAngRotDeg As Double) As Boolean
|
||||
' Se non ci sono pezzi selezionati, esco
|
||||
If EgtGetSelectedObjCount() = 0 Then Return True
|
||||
@@ -215,31 +323,60 @@ Public Class NestingTabVM
|
||||
If m_nPartPos <> PART_POS.IN_TABLE Then
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Calcolo il centro di rotazione come centro del pezzo
|
||||
Dim ptCen As Point3d
|
||||
If Not EgtGetPartPartClusterCenterGlob(nId, ptCen) Then Return False
|
||||
' Rotazione del pezzo attorno al suo centro
|
||||
EgtRotate(nId, ptCen, Vector3d.Z_AX(), dAngRotDeg, GDB_RT.GLOB)
|
||||
' Sistemazione nel parcheggio
|
||||
PackPartInStore(nId)
|
||||
' Se pezzo con rotazione libera
|
||||
If Not EgtExistsInfo( nId, INFO_PARTROT) Then
|
||||
' Calcolo il centro di rotazione come centro del pezzo
|
||||
Dim ptCen As Point3d
|
||||
If Not EgtGetPartPartClusterCenterGlob(nId, ptCen) Then Return False
|
||||
' Rotazione del pezzo attorno al suo centro
|
||||
EgtRotate(nId, ptCen, Vector3d.Z_AX(), dAngRotDeg, GDB_RT.GLOB)
|
||||
' Sistemazione nel parcheggio
|
||||
PackPartInStore(nId)
|
||||
End If
|
||||
' Passo al successivo selezionato
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
Return True
|
||||
' Altrimenti li ruoto tenendo conto delle collisioni
|
||||
Else
|
||||
' Calcolo il centro di rotazione come centro del cluster
|
||||
Dim ptCen As Point3d
|
||||
If Not EgtGetPartPartClusterCenterGlob(GDB_ID.SEL, ptCen) Then Return False
|
||||
' Aggiorno regioni per nesting
|
||||
UpdateNestRegions()
|
||||
EnableReferenceRegion(False)
|
||||
' Verifico rotazione complessiva
|
||||
EgtRotate(GDB_ID.SEL, ptCen, Vector3d.Z_AX(), dAngRotDeg, GDB_RT.GLOB)
|
||||
If EgtVerifyPart(GDB_ID.SEL, CurrentMachine.bReducedCut) Then Return True
|
||||
' Provo rotazione parziale (dopo aver annullato la complessiva)
|
||||
EgtRotate(GDB_ID.SEL, ptCen, Vector3d.Z_AX(), -dAngRotDeg, GDB_RT.GLOB)
|
||||
Return EgtRotatePart(GDB_ID.SEL, CurrentMachine.bReducedCut, ptCen, dAngRotDeg)
|
||||
' Verifico se ci sono dei pezzi bloccati in rotazione
|
||||
Dim bLockedRot As Boolean = GetLockOnRotation( GDB_ID.SEL)
|
||||
' Se tutti i pezzi possono ruotare
|
||||
If Not bLockedRot Then
|
||||
' Calcolo il centro di rotazione come centro del cluster
|
||||
Dim ptCen As Point3d
|
||||
If Not EgtGetPartPartClusterCenterGlob(GDB_ID.SEL, ptCen) Then Return False
|
||||
' Aggiorno regioni per nesting
|
||||
UpdateNestRegions()
|
||||
EnableReferenceRegion(False)
|
||||
' Verifico rotazione complessiva
|
||||
EgtRotate(GDB_ID.SEL, ptCen, Vector3d.Z_AX(), dAngRotDeg, GDB_RT.GLOB)
|
||||
If EgtVerifyPart(GDB_ID.SEL, CurrentMachine.bReducedCut) Then Return True
|
||||
' Provo rotazione parziale (dopo aver annullato la complessiva)
|
||||
EgtRotate(GDB_ID.SEL, ptCen, Vector3d.Z_AX(), -dAngRotDeg, GDB_RT.GLOB)
|
||||
Return EgtRotatePart(GDB_ID.SEL, CurrentMachine.bReducedCut, ptCen, dAngRotDeg)
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function GetLockOnRotation( nPartId As Integer) As Boolean
|
||||
' Se singolo pezzo
|
||||
If nPartId <> GDB_ID.SEL Then
|
||||
Return EgtExistsInfo( nPartId, INFO_PARTROT)
|
||||
' Altrimenti tutti i selezionati
|
||||
Else
|
||||
Dim bLockedRot As Boolean = False
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
If EgtExistsInfo( nId, INFO_PARTROT) Then
|
||||
bLockedRot = True
|
||||
Exit While
|
||||
End If
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
Return bLockedRot
|
||||
End If
|
||||
End Function
|
||||
|
||||
@@ -348,6 +485,94 @@ Public Class NestingTabVM
|
||||
|
||||
#End Region ' ImportDxfCommand
|
||||
|
||||
#Region "PartRotOnCommand"
|
||||
|
||||
Public ReadOnly Property PartRotOnCommand As ICommand
|
||||
Get
|
||||
If m_cmdPartRotOn Is Nothing Then
|
||||
m_cmdPartRotOn = New Command(AddressOf PartRotOn)
|
||||
End If
|
||||
Return m_cmdPartRotOn
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub PartRotOn(ByVal param As Object)
|
||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||
' Se non ci sono pezzi selezionati o non sono in parcheggio, esco
|
||||
If EgtGetSelectedObjCount() = 0 OrElse m_nPartPos <> PART_POS.OUT_TABLE Then Return
|
||||
' Tolgo blocco rotazione sui pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Se rotazione bloccata, tolgo blocco e aggiorno info
|
||||
If EgtExistsInfo( nId, INFO_PARTROT) Then
|
||||
' Rimuovo flag di rotazione bloccata
|
||||
EgtRemoveInfo( nId, INFO_PARTROT)
|
||||
' Tolgo da info sul pezzo Codice
|
||||
Dim nTextId As Integer = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nId, NAME_REGION))
|
||||
While nTextId <> GDB_ID.NULL
|
||||
If EgtGetType( nTextId) = GDB_TY.EXT_TEXT Then
|
||||
Dim sText As String = ""
|
||||
EgtTextGetContent( nTextId, sText)
|
||||
sText = sText.Replace( "<br/>(X)", "")
|
||||
EgtModifyText( nTextId, sText)
|
||||
Exit While
|
||||
End If
|
||||
nTextId = EgtGetNext( nTextId)
|
||||
End While
|
||||
End If
|
||||
' Passo al successivo selezionato
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' PartRotOnCommand
|
||||
|
||||
#Region "PartRotOffCommand"
|
||||
|
||||
Public ReadOnly Property PartRotOffCommand As ICommand
|
||||
Get
|
||||
If m_cmdPartRotOff Is Nothing Then
|
||||
m_cmdPartRotOff = New Command(AddressOf PartRotOff)
|
||||
End If
|
||||
Return m_cmdPartRotOff
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub PartRotOff(ByVal param As Object)
|
||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||
' Se non ci sono pezzi selezionati o non sono in parcheggio, esco
|
||||
If EgtGetSelectedObjCount() = 0 OrElse m_nPartPos <> PART_POS.OUT_TABLE Then Return
|
||||
' Metto blocco rotazione sui pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Se rotazione libera, applico blocco e aggiorno info
|
||||
If Not EgtExistsInfo( nId, INFO_PARTROT) Then
|
||||
' Imposto flag di rotazione bloccata
|
||||
EgtSetInfo( nId, INFO_PARTROT, 0)
|
||||
' Inserisco in info sul pezzo Codice
|
||||
Dim nTextId As Integer = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nId, NAME_REGION))
|
||||
While nTextId <> GDB_ID.NULL
|
||||
If EgtGetType( nTextId) = GDB_TY.EXT_TEXT Then
|
||||
Dim sText As String = ""
|
||||
EgtTextGetContent( nTextId, sText)
|
||||
sText &= "<br/>(X)"
|
||||
EgtModifyText( nTextId, sText)
|
||||
Exit While
|
||||
End If
|
||||
nTextId = EgtGetNext( nTextId)
|
||||
End While
|
||||
End If
|
||||
' Passo al successivo selezionato
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' PartRotOffCommand
|
||||
|
||||
#Region "UpCommand"
|
||||
|
||||
Public ReadOnly Property UpCommand As ICommand
|
||||
@@ -372,7 +597,9 @@ Public Class NestingTabVM
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
If Not GetLockOnRotation( GDB_ID.SEL) Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
EgtRestoreCollInfo()
|
||||
EgtMovePartToSnapPointOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, m_dSnapDist, bSnapMoved)
|
||||
@@ -414,7 +641,9 @@ Public Class NestingTabVM
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
If Not GetLockOnRotation( GDB_ID.SEL) Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
EgtRestoreCollInfo()
|
||||
EgtMovePartToSnapPointOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, m_dSnapDist, bSnapMoved)
|
||||
@@ -456,7 +685,9 @@ Public Class NestingTabVM
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
If Not GetLockOnRotation( GDB_ID.SEL) Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
EgtRestoreCollInfo()
|
||||
EgtMovePartToSnapPointOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, m_dSnapDist, bSnapMoved)
|
||||
@@ -498,7 +729,9 @@ Public Class NestingTabVM
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
If Not GetLockOnRotation( GDB_ID.SEL) Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
EgtRestoreCollInfo()
|
||||
EgtMovePartToSnapPointOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, m_dSnapDist, bSnapMoved)
|
||||
@@ -580,42 +813,13 @@ Public Class NestingTabVM
|
||||
End Property
|
||||
|
||||
Public Sub InsertPart(ByVal param As Object)
|
||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||
Dim bWrongTrf As Boolean = False
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
' Ciclo di inserimento in tavola dei pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Recupero successivo selezionato
|
||||
Dim nNextId = EgtGetNextSelectedObj()
|
||||
' Se pezzo da Trf, verifico compatibilità
|
||||
If Not VerifyTrfData(nId) Then
|
||||
bWrongTrf = True
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
' Passo al successivo selezionato
|
||||
nId = nNextId
|
||||
Continue While
|
||||
End If
|
||||
' Lo metto in tavola, se possibile
|
||||
If EstCalc.InsertOnePart(nId, CurrentMachine.bAligned, CurrentMachine.bReducedCut) Then
|
||||
' Eventuale notifica al VeinMatching
|
||||
VeinMatching.OnInsertPartInRaw(nId)
|
||||
Else
|
||||
VeinMatching.OnDeselectPart(nId)
|
||||
End If
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
' Passo al successivo selezionato
|
||||
nId = nNextId
|
||||
End While
|
||||
' Aggiorno flag selezionati
|
||||
m_nPartPos = If(EgtGetSelectedObjCount() > 0, PART_POS.IN_TABLE, PART_POS.NONE_TABLE)
|
||||
' Aggiorno vista
|
||||
EgtZoom(ZM.ALL)
|
||||
' Eventuale segnalazione di pezzi Trf non adatti
|
||||
If bWrongTrf Then
|
||||
' Pezzi con spessore, materiale o finitura non compatibili
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_NESTPAGEUC + 7), MSG_TYPE.WARNING)
|
||||
' Se inserimento automatico
|
||||
If CurrentMachine.bAutomatic And
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.AutoNestOption() Then
|
||||
AutomaticInsert()
|
||||
' altrimenti inserimento standard
|
||||
Else
|
||||
StandardInsert()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -879,9 +1083,25 @@ Public Class NestingTabVM
|
||||
End If
|
||||
' Determino cosa muovere
|
||||
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
||||
' Verifico se in tavola
|
||||
' Verifico se in tavola o in parcheggio
|
||||
Dim nTestId = If(nMoveId <> GDB_ID.SEL, nMoveId, EgtGetFirstSelectedObj())
|
||||
If (EgtGetParent(nTestId) <> GetRawId()) Then Return
|
||||
If EgtGetParent(nTestId) <> GetRawId() Then
|
||||
' Dal parcheggio ammesso drag di un singolo pezzo
|
||||
If nMoveId = GDB_ID.SEL Then Return
|
||||
' Applico le lavorazioni al pezzo
|
||||
Dim b3Curr As new BBox3d
|
||||
EgtGetBBoxGlob( EgtGetFirstNameInGroup(nTestId, NAME_REGION), BBFLAG, b3Curr)
|
||||
if Not EstCalc.PreInsertOnePart( nTestId) Then Return
|
||||
Dim b3Ins As new BBox3d
|
||||
EgtGetBBoxGlob( EgtGetFirstNameInGroup( nTestId, NAME_REGION), BBFLAG, b3Ins)
|
||||
Dim vtDiff As new Vector3d( b3Curr.Min().x - b3Ins.Min().x, b3Curr.Min().y - b3Ins.Min().y, 0)
|
||||
EgtMove( nMoveId, vtDiff)
|
||||
' Gestione VeinMatching
|
||||
VeinMatching.OnInsertPartInRaw( nMoveId)
|
||||
' Imposto stato
|
||||
m_bVerify = True
|
||||
m_bFromParking = True
|
||||
End If
|
||||
' Inizio esecuzione di drag
|
||||
m_bDragging = True
|
||||
' Ricavo il punto corrente in coordinate mondo
|
||||
@@ -915,7 +1135,9 @@ Public Class NestingTabVM
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
EgtAlignPartOnCollision(nMoveId, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
If Not GetLockOnRotation( nMoveId) Then
|
||||
EgtAlignPartOnCollision(nMoveId, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
EgtRestoreCollInfo()
|
||||
EgtMovePartToSnapPointOnCollision(nMoveId, CurrentMachine.bReducedCut, m_dSnapDist, bSnapMoved)
|
||||
@@ -936,7 +1158,6 @@ Public Class NestingTabVM
|
||||
End If
|
||||
End If
|
||||
' Aggiorno il punto precedente
|
||||
'm_ptPrev += vtMove
|
||||
m_ptPrev = ptCurr
|
||||
' Terminata esecuzione di drag
|
||||
m_bDragging = False
|
||||
@@ -957,19 +1178,24 @@ Public Class NestingTabVM
|
||||
EstCalc.ResetOrderMachiningFlag()
|
||||
' Non superata riporto alla posizione iniziale
|
||||
Else
|
||||
EgtMove(nMoveId, -m_vtTotMove)
|
||||
EgtDraw()
|
||||
' Eventuale notifica al VeinMatching
|
||||
If nMoveId = GDB_ID.SEL Then
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
VeinMatching.OnMovePartInRaw(nId)
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
If m_bFromParking Then
|
||||
PreRemoveOnePart( nMoveId)
|
||||
VeinMatching.OnRemovePartFromRaw( nMoveId)
|
||||
Else
|
||||
VeinMatching.OnMovePartInRaw(nMoveId)
|
||||
EgtMove(nMoveId, -m_vtTotMove)
|
||||
' Eventuale notifica al VeinMatching
|
||||
If nMoveId = GDB_ID.SEL Then
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
VeinMatching.OnMovePartInRaw(nId)
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
Else
|
||||
VeinMatching.OnMovePartInRaw(nMoveId)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
m_bFromParking = False
|
||||
' altrimenti caso con verifica durante il movimento
|
||||
Else
|
||||
' Basta reset alla fine
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 826 B |
@@ -342,6 +342,9 @@ Public Class SideEntityControlVM
|
||||
LoopId = DxfImportWindowMap.refDxfImportSceneHostV.SelectedLayer
|
||||
End If
|
||||
|
||||
' Determino se loop esterno o interno
|
||||
Dim sLoopName As String = ""
|
||||
Dim bOutLoop As Boolean = ( EgtGetName( LoopId, sLoopName) AndAlso sLoopName = NAME_OUTLOOP)
|
||||
' Calcolo dimensione ingombro Loop
|
||||
Dim ptMin, ptMax As Point3d
|
||||
EgtGetBBoxGlob(LoopId, GDB_BB.STANDARD, ptMin, ptMax)
|
||||
@@ -358,21 +361,28 @@ Public Class SideEntityControlVM
|
||||
Dim CurrLine As Integer = EgtGetFirstInGroup(LoopId)
|
||||
' Creo indice per numerare le entità in ImportPage
|
||||
Dim nEntityIndex As Integer = 1
|
||||
' Ciclo che verifica se possibile inclinare la linea corrente fino alla penultima
|
||||
Dim nOtherIndex As Integer = 1
|
||||
' Ciclo che verifica se possibile inclinare la curva corrente
|
||||
While CurrLine <> GDB_ID.NULL
|
||||
Dim NextLine As Integer = EgtGetNext(CurrLine)
|
||||
If NextLine = GDB_ID.NULL Then NextLine = EgtGetFirstInGroup( LoopId)
|
||||
If m_Mode = ModeOpt.SIDEANGLE Then
|
||||
If VerifyIsSideAnglePossible(PrevLine, CurrLine, NextLine) Then
|
||||
If VerifyIsSideAnglePossible(PrevLine, CurrLine, NextLine, bOutLoop) Then
|
||||
' Aggiungo il lato alla lista di quelli inclinabili e ne azzero l'inclinazione
|
||||
AddSideAngle(CurrLine, TextLayer, dBBoxRad, nEntityIndex)
|
||||
nEntityIndex += 1
|
||||
Else
|
||||
EgtSetName( CurrLine, "B" & nOtherIndex.ToString())
|
||||
nOtherIndex += 1
|
||||
End If
|
||||
Else
|
||||
If VerifyIsSideDripPossible(PrevLine, CurrLine, NextLine) Then
|
||||
' Aggiungo il lato alla lista di quelli su cui è possibile mettere il gocciolatoio
|
||||
AddDripSide(CurrLine, TextLayer, dBBoxRad, nEntityIndex)
|
||||
nEntityIndex += 1
|
||||
Else
|
||||
EgtSetName( CurrLine, "B" & nOtherIndex.ToString())
|
||||
nOtherIndex += 1
|
||||
End If
|
||||
End If
|
||||
PrevLine = CurrLine
|
||||
@@ -488,25 +498,23 @@ Public Class SideEntityControlVM
|
||||
EgtGetBBox(nText, GDB_BB.STANDARD, ptMinBBox, ptMaxBBox)
|
||||
Dim ptMidBBox As Point3d
|
||||
ptMidBBox = Point3d.Media(ptMinBBox, ptMaxBBox)
|
||||
' estremi della CurrLine
|
||||
Dim ptLineStart As Point3d
|
||||
EgtStartPoint(CurrLine, nText, ptLineStart)
|
||||
Dim ptLineEnd As Point3d
|
||||
EgtEndPoint(CurrLine, nText, ptLineEnd)
|
||||
' versore della CurrLine
|
||||
Dim vtCurrLine As Vector3d = ptLineEnd - ptLineStart
|
||||
vtCurrLine.Normalize()
|
||||
' Punto medio della curva
|
||||
Dim ptMid As Point3d
|
||||
EgtMidPoint( CurrLine, nText, ptMid)
|
||||
' Versore sul punto medio della curva
|
||||
Dim vtMid As Vector3d
|
||||
EgtMidVector( CurrLine, nText, vtMid)
|
||||
' versore perpendicolare alla CurrLine che punta verso il testo
|
||||
Dim vtOrtoLine As New Vector3d(vtCurrLine)
|
||||
Dim vtOrto As New Vector3d(vtMid)
|
||||
If bTextExt Then
|
||||
vtOrtoLine.Rotate(Vector3d.Z_AX(), -90)
|
||||
vtOrto.Rotate(Vector3d.Z_AX(), -90)
|
||||
Else
|
||||
vtOrtoLine.Rotate(Vector3d.Z_AX(), 90)
|
||||
vtOrto.Rotate(Vector3d.Z_AX(), 90)
|
||||
End If
|
||||
' eventuale rotazione del testo
|
||||
Dim dRotAng As Double = 0
|
||||
If bRot Then
|
||||
dRotAng = Math.Atan2(vtCurrLine.y, vtCurrLine.x) * 180 / Math.PI
|
||||
dRotAng = Math.Atan2(vtMid.y, vtMid.x) * 180 / Math.PI
|
||||
Dim dSpecRotAng = dRotAng
|
||||
If dSpecRotAng > 91 Then
|
||||
dSpecRotAng -= 180
|
||||
@@ -522,28 +530,28 @@ Public Class SideEntityControlVM
|
||||
vtptExtptMC.Rotate(Vector3d.Z_AX(), dRotAng)
|
||||
Else
|
||||
If bTextExt Then
|
||||
If vtCurrLine.x > 0 Then
|
||||
If vtCurrLine.y > 0 Then
|
||||
If vtMid.x > 0 Then
|
||||
If vtMid.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMinBBox.x, ptMaxBBox.y, 0)
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - ptMaxBBox
|
||||
End If
|
||||
Else
|
||||
If vtCurrLine.y > 0 Then
|
||||
If vtMid.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - ptMinBBox
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMaxBBox.x, ptMinBBox.y, 0)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If vtCurrLine.x > 0 Then
|
||||
If vtCurrLine.y > 0 Then
|
||||
If vtMid.x > 0 Then
|
||||
If vtMid.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMaxBBox.x, ptMinBBox.y, 0)
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - ptMinBBox
|
||||
End If
|
||||
Else
|
||||
If vtCurrLine.y > 0 Then
|
||||
If vtMid.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - ptMaxBBox
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMinBBox.x, ptMaxBBox.y, 0)
|
||||
@@ -552,7 +560,7 @@ Public Class SideEntityControlVM
|
||||
End If
|
||||
End If
|
||||
' Calcolo il centro del testo
|
||||
Dim ptTextMC As Point3d = Point3d.Media(ptLineStart, ptLineEnd) + vtOrtoLine * (dDistance + (vtOrtoLine * vtptExtptMC))
|
||||
Dim ptTextMC As Point3d = ptMid + vtOrto * (dDistance + (vtOrto * vtptExtptMC))
|
||||
EgtMove(nText, (ptTextMC - Point3d.ORIG))
|
||||
Return nText
|
||||
End Function
|
||||
@@ -791,59 +799,78 @@ Public Class SideEntityControlVM
|
||||
End Sub
|
||||
|
||||
' Funzione che verifica se la linea corrente è inclinabile in base al tipo della precedente e successiva
|
||||
Shared Function VerifyIsSideAnglePossible(LastLine As Integer, CurrLine As Integer, NextLine As Integer) As Boolean
|
||||
' Verifico se CurrLine è una linea
|
||||
If EgtGetType(CurrLine) <> GDB_TY.CRV_LINE Then
|
||||
Return False
|
||||
End If
|
||||
Shared Function VerifyIsSideAnglePossible(LastLine As Integer, CurrLine As Integer, NextLine As Integer, bOutLoop As Boolean) As Boolean
|
||||
' Analisi del tipo
|
||||
Select EgtGetType(CurrLine)
|
||||
Case GDB_TY.CRV_LINE
|
||||
' Le linee vanno bene di per sè
|
||||
Case GDB_TY.CRV_ARC
|
||||
' Gli archi devono essere lavorati sul lato esterno
|
||||
Dim dAngCen As Double : EgtArcAngCenter( CurrLine, dAngCen)
|
||||
If ( bOutLoop And dAngCen < 0) Or ( Not bOutLoop And dAngCen > 0) Then Return False
|
||||
Case GDB_TY.CRV_COMPO
|
||||
' Gli archi componenti devono essere lavorati sul lato esterno
|
||||
Dim nCopyId As Integer = EgtCopy( CurrLine, CurrLine, GDB_POS.AFTER)
|
||||
If nCopyId = GDB_ID.NULL Then Return False
|
||||
Dim bOk As Boolean = True
|
||||
Dim nCount As Integer = 0
|
||||
Dim nNewId As Integer = EgtExplodeCurveCompo( nCopyId, nCount)
|
||||
For nI As Integer = 0 To nCount - 1
|
||||
Dim nEntId As Integer = nNewId + nI
|
||||
If EgtGetType( nEntId) = GDB_TY.CRV_ARC Then
|
||||
Dim dAngCen As Double : EgtArcAngCenter( nEntId, dAngCen)
|
||||
If ( bOutLoop And dAngCen < 0) Or ( Not bOutLoop And dAngCen > 0) Then bOk = False
|
||||
End If
|
||||
EgtErase( nEntId)
|
||||
Next
|
||||
If Not bOk Then Return False
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
|
||||
' Se curva chiusa va bene solo se loop esterno
|
||||
if EgtCurveIsClosed( CurrLine) Then Return bOutLoop
|
||||
|
||||
' Delta angolare limite per tangenza
|
||||
Const DELTA_ANG_TG As Double = 5.0
|
||||
|
||||
' Verifico se curva precedente mi permette di inclinare
|
||||
Dim bLastOk As Boolean = False
|
||||
If EgtGetType(LastLine) = GDB_TY.CRV_LINE Then
|
||||
bLastOk = True
|
||||
ElseIf EgtGetType(LastLine) = GDB_TY.CRV_ARC Then
|
||||
' Ricavo direzione finale linea precedente
|
||||
Dim vtLastEnd As Vector3d
|
||||
EgtEndVector(LastLine, vtLastEnd)
|
||||
' Ricavo direzione iniziale linea corrente
|
||||
Dim vtCurrStart As Vector3d
|
||||
EgtStartVector(CurrLine, vtCurrStart)
|
||||
' Confronto direzioni per vedere se sono tangenti
|
||||
Dim dAngDeg As Double = GetAngle( vtLastEnd, vtCurrStart)
|
||||
' verifico se l'angolo è significativo
|
||||
bLastOk = ( dAngDeg > DELTA_ANG_TG)
|
||||
Else
|
||||
EgtOutLog("Error in Compo Outloop: found an entity that is not a line or a arc")
|
||||
End If
|
||||
Select EgtGetType(LastLine)
|
||||
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_COMPO
|
||||
' Ricavo direzione finale linea precedente
|
||||
Dim vtLastEnd As Vector3d
|
||||
EgtEndVector(LastLine, vtLastEnd)
|
||||
' Ricavo direzione iniziale linea corrente
|
||||
Dim vtCurrStart As Vector3d
|
||||
EgtStartVector(CurrLine, vtCurrStart)
|
||||
' Confronto direzioni per vedere se sono tangenti
|
||||
Dim dAngDeg As Double = GetAngle( vtLastEnd, vtCurrStart)
|
||||
' verifico se l'angolo è significativo
|
||||
bLastOk = ( dAngDeg > DELTA_ANG_TG)
|
||||
Case Else
|
||||
EgtOutLog("Error in Compo Outloop: found an entity that is not a line or a arc")
|
||||
End Select
|
||||
|
||||
' Verifico se curva successiva mi permette di inclinare
|
||||
Dim bNextOk As Boolean = False
|
||||
If EgtGetType(NextLine) = GDB_TY.CRV_LINE Then
|
||||
bNextOk = True
|
||||
ElseIf EgtGetType(NextLine) = GDB_TY.CRV_ARC Then
|
||||
' Ricavo direzione finale linea corrente
|
||||
Dim vtCurrEnd As Vector3d
|
||||
EgtEndVector(CurrLine, vtCurrEnd)
|
||||
' Ricavo direzione iniziale linea successiva
|
||||
Dim vtNextStart As Vector3d
|
||||
EgtStartVector(NextLine, vtNextStart)
|
||||
' Confronto direzioni per vedere se sono tangenti
|
||||
Dim dAngDeg As Double = GetAngle( vtCurrEnd, vtNextStart)
|
||||
' verifico se l'angolo è significativo
|
||||
bNextOk = ( dAngDeg > DELTA_ANG_TG)
|
||||
Else
|
||||
EgtOutLog("Error in Compo Outloop: found an entity that is not a line or a arc")
|
||||
End If
|
||||
Select EgtGetType(NextLine)
|
||||
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_COMPO
|
||||
' Ricavo direzione finale linea corrente
|
||||
Dim vtCurrEnd As Vector3d
|
||||
EgtEndVector(CurrLine, vtCurrEnd)
|
||||
' Ricavo direzione iniziale linea successiva
|
||||
Dim vtNextStart As Vector3d
|
||||
EgtStartVector(NextLine, vtNextStart)
|
||||
' Confronto direzioni per vedere se sono tangenti
|
||||
Dim dAngDeg As Double = GetAngle( vtCurrEnd, vtNextStart)
|
||||
' verifico se l'angolo è significativo
|
||||
bNextOk = ( dAngDeg > DELTA_ANG_TG)
|
||||
Case Else
|
||||
EgtOutLog("Error in Compo Outloop: found an entity that is not a line or a arc")
|
||||
End Select
|
||||
|
||||
' Se entrambe me lo permettono restituisco vero
|
||||
If bLastOk And bNextOk Then
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
|
||||
Return ( bLastOk And bNextOk)
|
||||
End Function
|
||||
|
||||
Shared Function AdjustAsTrfParSides( PartId As Integer) As Boolean
|
||||
@@ -947,7 +974,7 @@ Public Class SideEntityControlVM
|
||||
While EntId <> GDB_ID.NULL
|
||||
Dim NextId As Integer = EgtGetNext( EntId)
|
||||
If NextId = GDB_ID.NULL Then NextId = EgtGetFirstInGroup( LoopId)
|
||||
If VerifyIsSideAnglePossible( PrevId, EntId, NextId) Then
|
||||
If VerifyIsSideAnglePossible( PrevId, EntId, NextId, bOutLoop) Then
|
||||
Dim colEnt As Color3d
|
||||
If EgtGetColor( EntId, colEnt) Then
|
||||
Dim dAng As Double
|
||||
|
||||
Reference in New Issue
Block a user