OmagCUT 1.9i1 :

- cambio icona
- gestione più copie in import DXF/NGE
- gestione variazione numero pezzi in import CSV
- aggiunto controllo compatibilità diametro lama con ventosa per lavorazioni da sotto.
This commit is contained in:
Dario Sassi
2018-09-08 07:44:55 +00:00
parent c9e00449e1
commit 8b1faad295
14 changed files with 219 additions and 51 deletions
+19 -4
View File
@@ -225,6 +225,7 @@
Style="{StaticResource OmagCut_YellowIconButton}">
<Image Source="Resources/CsvRuinedParts.png" Width="65" Height="65" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Button>
</Grid>
</Grid>
@@ -232,18 +233,32 @@
<!--Lower button grid, sfondo grigio per coprire i bottoni della pagina sottostante-->
<Grid Grid.Column="1" Grid.Row="2" Background="{StaticResource OmagCut_Gray}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="8*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="InsertBtn" Grid.Column="0" Style="{StaticResource OmagCut_YellowTextButton}" />
<Button Name="RemoveBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowTextButton}" />
<Button Name="OkBtn" Grid.Column="3" Style="{StaticResource OmagCut_GradientBlueIconButton}">
<ToggleButton Name="PlusBtn" Grid.Column="0"
Style="{StaticResource OmagCut_YellowIconToggleButton}">
<Image Source="Resources/CsvPlus.png" Width="65" Height="65" HorizontalAlignment="Center" VerticalAlignment="Center" />
</ToggleButton>
<ToggleButton Name="MinusBtn" Grid.Column="1"
Style="{StaticResource OmagCut_YellowIconToggleButton}">
<Image Source="Resources/CsvMinus.png" Width="65" Height="65" HorizontalAlignment="Center" VerticalAlignment="Center" />
</ToggleButton>
<Button Name="InsertBtn" Grid.Column="3" Style="{StaticResource OmagCut_YellowTextButton}" />
<Button Name="RemoveBtn" Grid.Column="4" Style="{StaticResource OmagCut_YellowTextButton}" />
<Button Name="OkBtn" Grid.Column="6" Style="{StaticResource OmagCut_GradientBlueIconButton}">
<Image Source="Resources/V.png" Style="{StaticResource OmagCut_ButtonIcon}" />
</Button>
</Grid>
</Grid>
+52 -3
View File
@@ -17,6 +17,7 @@ Public Class CSVPage
Private m_bFirst As Boolean = True
' Dati lista
Private m_sCsvPath As String = String.Empty
Private m_sFilePath As String = String.Empty
Private m_CsvPartList As New List(Of CsvPart)
Private m_ItemsList As New ObservableCollection(Of PartCathegoryItem)
Private m_sCompoDir As String = String.Empty
@@ -34,6 +35,8 @@ Public Class CSVPage
' Determino se versione semplificata
m_bFull = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.AUTO_NESTING) And
(GetPrivateProfileInt(S_CSV, K_FULL, 1, m_MainWindow.GetIniFile()) <> 0)
PlusBtn.Visibility = If(m_bFull, Windows.Visibility.Visible, Windows.Visibility.Hidden)
MinusBtn.Visibility = If(m_bFull, Windows.Visibility.Visible, Windows.Visibility.Hidden)
RemoveBtn.Visibility = If(m_bFull, Windows.Visibility.Visible, Windows.Visibility.Hidden)
' Determino se gestione pezzi rovinati attiva
If Not m_MainWindow.m_CurrentMachine.bProdLine Or Not m_MainWindow.m_CurrentMachine.nSaveProduced = 0 Then
@@ -62,6 +65,9 @@ Public Class CSVPage
' Recupero dimensioni del grezzo e kerf
m_nRawId = EgtGetFirstRawPart()
GetRawBox(m_ptRawMin, m_ptRawMax)
' Reset bottoni Plus e Minus
PlusBtn.IsChecked = False
MinusBtn.IsChecked = False
End Sub
Private Sub CSVPage_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
@@ -161,6 +167,7 @@ Public Class CSVPage
Private Function LoadCsvFile(sCsvPath As String) As Boolean
' Pulisco path e lista dei pezzi Csv
m_sFilePath = String.Empty
m_sCsvPath = String.Empty
m_CsvPartList.Clear()
' Eseguo la lettura del file Csv
@@ -168,6 +175,7 @@ Public Class CSVPage
m_CurrProjPage.SetErrorMessage(EgtMsg(91206)) 'Errore nella lettura del file CSV
Return False
End If
m_sFilePath = m_sCsvPath
' Elimino pezzi nulli
RemoveWrongParts(m_CsvPartList)
' Aggiorno
@@ -227,6 +235,7 @@ Public Class CSVPage
nCatToNest += CurrPart.m_nToNest
nCatCount += CurrPart.m_nCount
Dim sCount As String = CurrPart.m_nToNest.ToString() & "/" & CurrPart.m_nCount.ToString()
If CurrPart.m_nAdd > 0 Then sCount &= "+" & CurrPart.m_nAdd.ToString()
Dim sDim As String = LenToString(CurrPart.m_dDimX, 1) & "x" & LenToString(CurrPart.m_dDimY, 1)
PartCathegory.Items.Add(New PartCustomItem(CurrPart.m_sName, i, sCount, sDim, CurrPart.m_bActive))
Next
@@ -251,6 +260,7 @@ Public Class CSVPage
For Each PrtItem As PartCustomItem In CatItem.Items
Dim PartData As CsvPart = m_CsvPartList(PrtItem.nType - 1)
Dim sCount As String = PartData.m_nToNest.ToString() & "/" & PartData.m_nCount.ToString()
If PartData.m_nAdd > 0 Then sCount &= "+" & PartData.m_nAdd.ToString()
PrtItem.sText1 = sCount
sCurrMat = PartData.m_sMaterial
dCurrTh = PartData.m_dTh
@@ -286,12 +296,50 @@ Public Class CSVPage
SelectedCathegory.IsSelected = False
ElseIf TypeOf PartsTreeView.SelectedItem Is PartCustomItem Then
Dim SelectedCustom As PartCustomItem = DirectCast(PartsTreeView.SelectedItem, PartCustomItem)
SelectedCustom.bIsActive = Not SelectedCustom.bIsActive
m_CsvPartList(SelectedCustom.nType - 1).m_bActive = SelectedCustom.bIsActive
Dim PartData As CsvPart = m_CsvPartList(SelectedCustom.nType - 1)
Dim nPlusMinus As Integer = GetPlusMinus()
If nPlusMinus <> 0 Then
' Posso sempre aggiungere pezzi in più
If nPlusMinus > 0 Then
PartData.m_nToNest += 1
PartData.m_nAdd += 1
Dim sCount As String = PartData.m_nToNest.ToString() & "/" & PartData.m_nCount.ToString()
If PartData.m_nAdd > 0 Then sCount &= "+" & PartData.m_nAdd.ToString()
SelectedCustom.sText1 = sCount
' Posso togliere solo pezzi aggiunti non ancora inseriti
ElseIf PartData.m_nAdd > 0 And PartData.m_nToNest > 0 Then
PartData.m_nToNest -= 1
PartData.m_nAdd -= 1
Dim sCount As String = PartData.m_nToNest.ToString() & "/" & PartData.m_nCount.ToString()
If PartData.m_nAdd > 0 Then sCount &= "+" & PartData.m_nAdd.ToString()
SelectedCustom.sText1 = sCount
End If
Else
SelectedCustom.bIsActive = Not SelectedCustom.bIsActive
PartData.m_bActive = SelectedCustom.bIsActive
End If
SelectedCustom.IsSelected = False
End If
End Sub
Private Sub PlusBtn_Click(sender As Object, e As RoutedEventArgs) Handles PlusBtn.Click
If MinusBtn.IsChecked Then MinusBtn.IsChecked = False
End Sub
Private Sub MinusBtn_Click(sender As Object, e As RoutedEventArgs) Handles MinusBtn.Click
If PlusBtn.IsChecked Then PlusBtn.IsChecked = False
End Sub
Private Function GetPlusMinus() As Integer
If PlusBtn.IsChecked Then
Return 1
ElseIf MinusBtn.IsChecked Then
Return -1
Else
Return 0
End If
End Function
Private Sub InsertBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertBtn.Click
' Recupero lo spessore della lastra corrente
Dim dRawHeight As Double = GetRawHeight()
@@ -525,7 +573,7 @@ Public Class CSVPage
Return
End If
' Path del file
Dim sFile As String = Path.ChangeExtension(m_sCsvPath, ".epl")
Dim sFile As String = Path.ChangeExtension(m_sFilePath, ".epl")
' Scrittura del file
If WriteCsvPartList(sFile, m_sCsvPath, m_CsvPartList) Then
' Registro in ini path
@@ -541,6 +589,7 @@ Public Class CSVPage
m_CsvPartList.Clear()
' Lettura del file
ReadCsvPartList(sFile, m_sCsvPath, m_CsvPartList)
m_sFilePath = sFile
' Elimino pezzi nulli
RemoveWrongParts(m_CsvPartList)
End Sub
+3 -1
View File
@@ -176,7 +176,9 @@ Public Class CadCutPageUC
' Cancello tutto
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 m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
' Imposto flag di modifica
m_SplitPage.m_bShow = False
End If
+61 -5
View File
@@ -5,8 +5,15 @@ Friend Module CamAuto
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Friend Function AddMachinings(nPartId As Integer) As Boolean
Dim nWarn As Integer = 0
Return AddMachinings(nPartId, nWarn)
End Function
Friend Function AddMachinings(nPartId As Integer, ByRef nWarn As Integer) As Boolean
Dim bDripOk As Boolean = VerifyVacuumsForDrip(nPartId)
If Not bDripOk Then nWarn = 1
EgtLuaCreateGlobTable("CAM")
SetLuaStandardCamParams()
SetLuaStandardCamParams(bDripOk)
EgtLuaSetGlobIntVar("CAM.PARTID", nPartId)
Dim nErr As Integer = 999
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
@@ -41,13 +48,18 @@ Friend Module CamAuto
End Function
Friend Function ResetAllMachinings() As Boolean
Dim nWarn As Integer = 0
Return ResetAllMachinings(nWarn)
End Function
Friend Function ResetAllMachinings(ByRef nWarn As Integer) As Boolean
' Cancello tutte le lavorazioni
EraseMachinings(GDB_ID.NULL)
' Se progetto con pezzi piani
Dim nPrjType As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProjectType()
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS Then
' Reinserisco tutte le lavorazioni piane
AddMachinings(GDB_ID.NULL)
AddMachinings(GDB_ID.NULL, nWarn)
' Se altrimenti progetto con cornici
ElseIf nPrjType = CurrentProjectPageUC.PRJ_TYPE.FRAMES Then
' Reinserisco tutte le lavorazioni delle cornici
@@ -120,6 +132,50 @@ Friend Module CamAuto
Return bOk
End Function
Friend Function VerifyVacuumsForDrip(nPartId As Integer) As Boolean
' Se un pezzo
If nPartId <> GDB_ID.NULL Then
' Verifico contenga layer per lavorazioni da sotto con entità
If EgtGetGroupObjs(EgtGetFirstNameInGroup(nPartId, NAME_DRIPCUT)) = 0 And
EgtGetGroupObjs(EgtGetFirstNameInGroup(nPartId, NAME_UNDERDRILL)) = 0 Then
Return True
End If
' Se tutti i pezzi
Else
' Salvo fase attualmente corrente
Dim nOriPhase As Integer = EgtGetCurrPhase()
' Ciclo su tutti i pezzi presenti nei grezzi dell'ultima fase di lavorazione
EgtSetCurrPhase(EgtGetPhaseCount())
Dim bFound As Boolean = False
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
If EgtVerifyRawPartCurrPhase(nRawId) Then
Dim nMyPartId As Integer = EgtGetFirstPartInRawPart(nRawId)
While nMyPartId <> GDB_ID.NULL
' se ci sono lavorazioni da sotto
If EgtGetGroupObjs(EgtGetFirstNameInGroup(nMyPartId, NAME_DRIPCUT)) > 0 Or
EgtGetGroupObjs(EgtGetFirstNameInGroup(nMyPartId, NAME_UNDERDRILL)) > 0 Then
bFound = True
End If
nMyPartId = EgtGetNextPartInRawPart(nPartId)
End While
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
' Ripristino fase corrente originale
EgtSetCurrPhase(nOriPhase)
' Se non trovate lavorazioni da sotto, esco
If Not bFound Then Return True
End If
' Verifico che il diametro della lama installata permetta l'utilizzo della ventosa
Dim dSawDiam As Double
If EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw) AndAlso
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dSawDiam) Then
Return (dSawDiam <= m_MainWindow.m_CurrentMachine.dMaxSawDiamForVac)
End If
Return False
End Function
Friend Function UpdateVacuumsForDrip() As Boolean
Dim bOk As Boolean = True
' Salvo fase attualmente corrente
@@ -541,12 +597,12 @@ Friend Module CamAuto
Return True
End Function
Private Function SetLuaStandardCamParams() As Boolean
Private Function SetLuaStandardCamParams(Optional bDripOk As Boolean = True) As Boolean
Dim sSawMch As String = m_MainWindow.m_CurrentMachine.sCurrSawing
Dim sMillMch As String = m_MainWindow.m_CurrentMachine.sCurrMilling
Dim sDrillMch As String = m_MainWindow.m_CurrentMachine.sCurrDrilling
Dim sDripSawMch As String = m_MainWindow.m_CurrentMachine.sCurrDripSawing
Dim sDripDrillMch As String = m_MainWindow.m_CurrentMachine.sCurrDripDrilling
Dim sDripSawMch As String = If(bDripOk, m_MainWindow.m_CurrentMachine.sCurrDripSawing, "")
Dim sDripDrillMch As String = If(bDripOk, m_MainWindow.m_CurrentMachine.sCurrDripDrilling, "")
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
Dim dHolesOffset As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OFFSET, 0, m_MainWindow.GetMachIniFile())
Dim dHolesOverlap As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OVERLAP, 0, m_MainWindow.GetMachIniFile())
+17 -3
View File
@@ -1,6 +1,7 @@
<UserControl x:Class="ImportPageUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
@@ -79,9 +80,22 @@
<Button Name="UseRegionBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowTextButton}"/>
<Button Name="ResetBtn" Grid.Column="3" Style="{StaticResource OmagCut_YellowTextButton}"/>
<RadioButton Name="mmBtn" Grid.Column="5" Style="{StaticResource OmagCut_YellowToggleButton}"/>
<RadioButton Name="inchBtn" Grid.Column="6" Style="{StaticResource OmagCut_YellowToggleButton}"/>
<RadioButton Name="mmBtn" Grid.Column="4" Style="{StaticResource OmagCut_YellowToggleButton}"/>
<RadioButton Name="inchBtn" Grid.Column="5" Style="{StaticResource OmagCut_YellowToggleButton}"/>
<Grid Name="PartNumberGrd" Grid.Column="6" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="PartNumTxBl" Grid.Column="0" Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"
TextAlignment="Right"/>
<EgtWPFLib:EgtTextBox Name="PartNumTxBx" Grid.Column="1" Width="60"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
</Grid>
<Button Name="OkBtn" Grid.Column="8" Style="{StaticResource OmagCut_GradientBlueIconButton}">
<Image Source="Resources/V.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
+18 -3
View File
@@ -70,6 +70,7 @@ Public Class ImportPageUC
ResetBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 3) 'Reset
mmBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 4) 'mm
inchBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 5) 'inch
PartNumTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 15) 'Numero
SideAngleBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 7) 'Inclinazione
DripCutBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 8) 'Incisione da sotto
DripDrillBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 14) 'Foro da sotto
@@ -151,12 +152,14 @@ Public Class ImportPageUC
UseClosedCurveBtn.Visibility = Windows.Visibility.Visible
ResetBtn.Visibility = Windows.Visibility.Visible
SideAngleBtn.Visibility = Windows.Visibility.Visible
PartNumberGrd.Visibility = Windows.Visibility.Visible
Else
UseLayerBtn.Visibility = Windows.Visibility.Hidden
UseRegionBtn.Visibility = Windows.Visibility.Hidden
UseClosedCurveBtn.Visibility = Windows.Visibility.Hidden
ResetBtn.Visibility = Windows.Visibility.Hidden
SideAngleBtn.Visibility = Windows.Visibility.Hidden
PartNumberGrd.Visibility = Windows.Visibility.Hidden
End If
mmBtn.IsEnabled = True
inchBtn.IsEnabled = True
@@ -168,6 +171,8 @@ Public Class ImportPageUC
Else
inchBtn.IsChecked = True
End If
' imposto quantità
PartNumTxBx.Text = "1"
' disabilito ok
OkBtn.IsEnabled = False
@@ -333,6 +338,7 @@ Public Class ImportPageUC
ResetBtn.IsEnabled = False
mmBtn.IsEnabled = (m_nFileType = FT.DXF)
inchBtn.IsEnabled = (m_nFileType = FT.DXF)
PartNumberGrd.IsEnabled = True
OkBtn.IsEnabled = False
SideAngleBtn.IsEnabled = False
DripCutBtn.IsEnabled = False
@@ -345,6 +351,7 @@ Public Class ImportPageUC
ResetBtn.IsEnabled = False
mmBtn.IsEnabled = False
inchBtn.IsEnabled = False
PartNumberGrd.IsEnabled = False
OkBtn.IsEnabled = True
SideAngleBtn.IsEnabled = False
DripCutBtn.IsEnabled = False
@@ -663,12 +670,20 @@ Public Class ImportPageUC
Dim bDirect As Boolean = (GetPrivateProfileInt(S_NEST, K_DIRECT, 0, m_MainWindow.GetIniFile()) <> 0)
' Elimino eventuali precedenti pezzi vuoti
EgtEraseEmptyParts()
' Determino numero ripetizioni
Dim nRepeat = 1
StringToInt(PartNumTxBx.Text, nRepeat)
nRepeat = Math.Min(Math.Max(1, nRepeat), 50)
' Inserisco i pezzi nell'ambiente principale e recupero Id primo pezzo inserito
Dim nFirstId As Integer = EgtGetLastPart()
EgtInsertFile(sTmpFile)
For nInd As Integer = 1 To nRepeat
Dim nFirst2Id As Integer = EgtGetLastPart()
EgtInsertFile(sTmpFile)
nFirst2Id = If(nFirst2Id <> GDB_ID.NULL, EgtGetNextPart(nFirst2Id), EgtGetFirstPart())
' Eventuale inserimento pezzi in VeinMatching
VeinMatching.AddParts(sTmpFile, nFirst2Id)
Next
nFirstId = If(nFirstId <> GDB_ID.NULL, EgtGetNextPart(nFirstId), EgtGetFirstPart())
' Eventuale inserimento pezzi in VeinMatching
VeinMatching.AddParts(sTmpFile, nFirstId)
' Cancello il file
If My.Computer.FileSystem.FileExists(sTmpFile) Then
My.Computer.FileSystem.DeleteFile(sTmpFile)
+3 -1
View File
@@ -815,7 +815,9 @@ Public Class NestPageUC
Dim ptP As New Point3d(dRawCenX - 0.5 * b3Part.DimX(), dRawCenY - 0.5 * b3Part.DimY(), m_b3Raw.DimZ())
If EgtAddPartToRawPart(nId, ptP, m_nRawId) Then
' Aggiungo le lavorazioni standard
AddMachinings(nId)
Dim nWarn As Integer = 0
AddMachinings(nId, nWarn)
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
' Eseguo nesting
Dim bFit As Boolean = False
If UpdateNestRegions() Then
+6
View File
@@ -715,6 +715,12 @@
<ItemGroup>
<Resource Include="Resources\CsvRuinedParts.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\CsvMinus.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\CsvPlus.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+3 -1
View File
@@ -211,7 +211,9 @@ Public Class ProjectMgrUC
' Cancello eventuali messaggi
m_CurrProjPage.ClearMessage()
' Ricalcolo tutte le lavorazioni
ResetAllMachinings()
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
' Aggiorno visualizzazione
EgtDraw()
End Sub
+3 -1
View File
@@ -584,7 +584,9 @@ Public Class RawPartPageUC
Dim nPrjType As Integer = m_CurrProjPage.GetCurrentProjectType()
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS Then
' Reinserisco tutte le lavorazioni piane
AddMachinings(GDB_ID.NULL)
Dim nWarn As Integer = 0
AddMachinings(GDB_ID.NULL, nWarn)
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
' Aggiorno regioni per nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateNestRegions()
m_MainWindow.m_CadCutPageUC.m_NestPage.EnableReferenceRegion(False)
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+31 -28
View File
@@ -23,9 +23,10 @@ Public Class SimulationPageUC
Friend Function GetSimExecuting() As Boolean
Return m_bSimExecuting
End Function
' Numero di assi in simulazione
Private m_SimulationAxesNum As Integer = 5
' Flag di abilitazione della stima
Private m_bEstim As Boolean = False
Friend Sub ResetSimulation()
' Termino la simulazione
@@ -42,8 +43,8 @@ Public Class SimulationPageUC
Private Sub SimulationPage_Initialized(sender As Object, e As EventArgs)
' Impostazioni box stime
Dim bEstim As Boolean = (GetPrivateProfileInt(S_MACH_ESTIMATIONS, K_ENABLEEST, 0, m_MainWindow.GetMachIniFile()) <> 0)
If Not bEstim Then EstimGrid.Visibility = Windows.Visibility.Hidden
m_bEstim = (GetPrivateProfileInt(S_MACH_ESTIMATIONS, K_ENABLEEST, 0, m_MainWindow.GetMachIniFile()) <> 0)
If Not m_bEstim Then EstimGrid.Visibility = Windows.Visibility.Hidden
TimeTxBl.Text = EgtMsg(MSG_SIMULATIONPAGEUC + 15) ' Tempo
CutLenTxBl.Text = EgtMsg(MSG_SIMULATIONPAGEUC + 16) ' Lunghezza
NetAreaTxBl.Text = EgtMsg(MSG_SIMULATIONPAGEUC + 17) ' Area pezzi
@@ -114,32 +115,34 @@ Public Class SimulationPageUC
End If
' Costringo ad aggiornare UI
UpdateUI()
' Eseguo la stima di tempi, lunghezze ...
EgtSetCurrPhase(1)
EgtEstimate(m_MainWindow.GetTempDir() & "\MachProj.html", "OmagCut ver." & m_MainWindow.GetVersion())
' Visualizzo i risultati
Dim nTotalTime As Integer = 0
EgtGetInfo(EgtGetCurrMachGroup(), "Ttot", nTotalTime)
Dim tsTotalTime As New TimeSpan(0, 0, nTotalTime)
TimeTxBx.Text = tsTotalTime.ToString("hh\:mm\:ss")
Dim dTotalLength As Double = 0
EgtGetInfo(EgtGetCurrMachGroup(), "Ltot", dTotalLength)
If EgtUiUnitsAreMM() Then
CutLenTxBx.Text = DoubleToString(dTotalLength / 1000, 1) & " m"
Else
CutLenTxBx.Text = DoubleToString(dTotalLength / (ONEINCH * 12), 1) & " ft"
' Se abilitate, eseguo la stima di tempi, lunghezze ...
If m_bEstim Then
EgtSetCurrPhase(1)
EgtEstimate(m_MainWindow.GetTempDir() & "\MachProj.html", "OmagCut ver." & m_MainWindow.GetVersion())
' Visualizzo i risultati
Dim nTotalTime As Integer = 0
EgtGetInfo(EgtGetCurrMachGroup(), "Ttot", nTotalTime)
Dim tsTotalTime As New TimeSpan(0, 0, nTotalTime)
TimeTxBx.Text = tsTotalTime.ToString("hh\:mm\:ss")
Dim dTotalLength As Double = 0
EgtGetInfo(EgtGetCurrMachGroup(), "Ltot", dTotalLength)
If EgtUiUnitsAreMM() Then
CutLenTxBx.Text = DoubleToString(dTotalLength / 1000, 1) & " m"
Else
CutLenTxBx.Text = DoubleToString(dTotalLength / (ONEINCH * 12), 1) & " ft"
End If
Dim dNetArea As Double = 0
EgtGetInfo(EgtGetCurrMachGroup(), "NetArea", dNetArea)
If EgtUiUnitsAreMM() Then
NetAreaTxBx.Text = DoubleToString(dNetArea / 1000000, 2) & ""
Else
NetAreaTxBx.Text = DoubleToString(dNetArea / (ONEINCH * 12 * ONEINCH * 12), 1) & " ft²"
End If
Dim dRawArea As Double = 0
EgtGetInfo(EgtGetCurrMachGroup(), "RawArea", dRawArea)
Dim dUsage As Double = If(dRawArea > EPS_SMALL, dNetArea / dRawArea, 1)
UsageTxBx.Text = DoubleToString(dUsage * 100, 1) & " %"
End If
Dim dNetArea As Double = 0
EgtGetInfo(EgtGetCurrMachGroup(), "NetArea", dNetArea)
If EgtUiUnitsAreMM() Then
NetAreaTxBx.Text = DoubleToString(dNetArea / 1000000, 2) & ""
Else
NetAreaTxBx.Text = DoubleToString(dNetArea / (ONEINCH * 12 * ONEINCH * 12), 1) & " ft²"
End If
Dim dRawArea As Double = 0
EgtGetInfo(EgtGetCurrMachGroup(), "RawArea", dRawArea)
Dim dUsage As Double = If(dRawArea > EPS_SMALL, dNetArea / dRawArea, 1)
UsageTxBx.Text = DoubleToString(dUsage * 100, 1) & " %"
' Salvo il progetto con le lavorazioni
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\MachProj.nge"
m_CurrProjPage.SaveFile(sMchPath, False)
+3 -1
View File
@@ -366,7 +366,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 m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
' Carico ventose
LoadVacuumCups()
' Lancio calcolo separazione