OmagCUT 1.6n6 :
- migliorato salvataggio con nome - correzioni a spezzatura grezzo.
This commit is contained in:
@@ -169,6 +169,7 @@ Public Class CadCutPageUC
|
||||
Case 0 ' Annulla
|
||||
Return
|
||||
Case 1 ' Si
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveNameProject()
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveProject()
|
||||
Case 2 ' No
|
||||
' Non devo fare alcunchè
|
||||
@@ -190,6 +191,9 @@ Public Class CadCutPageUC
|
||||
GetPrivateProfileString(S_GENERAL, K_SAVENAMEDIR, "", sSaveNameDir, m_MainWindow.GetIniFile())
|
||||
If sCurrDir = sSaveNameDir Then
|
||||
WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, sCurrFile.Substring(0, sCurrFile.Length - 4), m_MainWindow.GetIniFile())
|
||||
' Salvo equivalente con indice
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetNextProjectIndex()
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveProject()
|
||||
Else
|
||||
WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, String.Empty, m_MainWindow.GetIniFile())
|
||||
End If
|
||||
|
||||
@@ -110,6 +110,9 @@ Module ConstGen
|
||||
Public Function COL_MCH_DISABLED() As Color3d
|
||||
Return New Color3d(192, 192, 192)
|
||||
End Function
|
||||
Public Function COL_MCH_DIS_INTERF() As Color3d
|
||||
Return New Color3d(255, 128, 128)
|
||||
End Function
|
||||
Public Function COL_MCH_FREE() As Color3d
|
||||
Return New Color3d(0, 0, 255)
|
||||
End Function
|
||||
|
||||
+2
-1
@@ -11,7 +11,8 @@
|
||||
Public Const MSG_CADCUTPAGEUC As Integer = MSG_OMAGCUT + 300
|
||||
Public Const MSG_NESTPAGEUC As Integer = MSG_OMAGCUT + 330
|
||||
Public Const MSG_SPLITPAGEUC As Integer = MSG_OMAGCUT + 340
|
||||
Public Const MSG_DRAWPAGEUC As Integer = MSG_OMAGCUT + 350
|
||||
Public Const MSG_MOVERAWPAGEUC As Integer = MSG_OMAGCUT + 360
|
||||
Public Const MSG_DRAWPAGEUC As Integer = MSG_OMAGCUT + 380
|
||||
Public Const MSG_COMPONENTPAGEUC As Integer = MSG_OMAGCUT + 400
|
||||
Public Const MSG_IMPORTPAGEUC As Integer = MSG_OMAGCUT + 450
|
||||
Public Const MSG_OPENPAGEUC As Integer = MSG_OMAGCUT + 490
|
||||
|
||||
@@ -119,7 +119,7 @@ Public Class CurrentProjectPageUC
|
||||
NewProject()
|
||||
End If
|
||||
EgtResetModified()
|
||||
' Altrimenti ne imposto uno nuovo
|
||||
' Altrimenti ne imposto uno nuovo
|
||||
Else
|
||||
m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
|
||||
NewProject()
|
||||
@@ -162,7 +162,7 @@ Public Class CurrentProjectPageUC
|
||||
|
||||
' Gestione progetto
|
||||
|
||||
Private Sub SetNextProjectIndex()
|
||||
Friend Sub SetNextProjectIndex()
|
||||
' se indice negativo, non devo calcolarne uno nuovo
|
||||
If m_nCurrProj < 0 Then
|
||||
Return
|
||||
@@ -357,18 +357,12 @@ Public Class CurrentProjectPageUC
|
||||
Friend Function SaveNameProject() As Boolean
|
||||
' Determino nome del progetto
|
||||
Dim CurrProjName As String = String.Empty
|
||||
If Not IsNothing(m_MainWindow.m_CadCutPageUC.m_SaveNameWD) Then
|
||||
CurrProjName = m_MainWindow.m_CadCutPageUC.m_SaveNameWD.SaveNameTxBx.Text
|
||||
Else
|
||||
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", CurrProjName, m_MainWindow.GetIniFile())
|
||||
End If
|
||||
Dim sPath As String = m_MainWindow.GetSaveNameDir() & "\" & CurrProjName & ".nge"
|
||||
' Aggiorno file Ini
|
||||
WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, CurrProjName, m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", CurrProjName, m_MainWindow.GetIniFile())
|
||||
' Se nome vuoto, non salvo
|
||||
If String.IsNullOrEmpty(CurrProjName) Then
|
||||
Return False
|
||||
End If
|
||||
Dim sPath As String = m_MainWindow.GetSaveNameDir() & "\" & CurrProjName & ".nge"
|
||||
' Rinomino eventuale fotografia
|
||||
Dim nPhotoId As Integer = GetPhoto()
|
||||
If nPhotoId <> GDB_ID.NULL Then
|
||||
|
||||
+9
-10
@@ -75,18 +75,17 @@
|
||||
</Button>
|
||||
|
||||
<Button Name="RotateCounterClockwiseBtn" Grid.Column="0" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
|
||||
</Button>
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}" Visibility="Hidden"/>
|
||||
|
||||
<ToggleButton Name="MagneticPiecesBtn" Grid.Column="1" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_RightGrayYellowIconToggleButton}">
|
||||
</ToggleButton>
|
||||
Style="{StaticResource OmagCut_RightGrayYellowIconToggleButton}" Visibility="Hidden"/>
|
||||
|
||||
<Button Name="RotateClockwiseBtn" Grid.Column="2" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
|
||||
</Button>
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}" Visibility="Hidden"/>
|
||||
|
||||
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
|
||||
<Button Name="InsertPartBtn" Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="StorePartBtn" Style="{StaticResource OmagCut_YellowTextButton}" Padding="1"/>
|
||||
<Button Name="InsertPartBtn" Style="{StaticResource OmagCut_YellowTextButton}" Visibility="Hidden"/>
|
||||
<Button Name="StorePartBtn" Style="{StaticResource OmagCut_YellowTextButton}" Padding="1" Visibility="Hidden"/>
|
||||
</UniformGrid>
|
||||
|
||||
<Button Name="RemovePartBtn" Grid.ColumnSpan="3" Grid.Row="6"
|
||||
@@ -100,8 +99,8 @@
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="BeforeBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowIconButton}"/>
|
||||
<Button Name="AfterBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}"/>
|
||||
<Button Name="BeforeBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowIconButton}" Visibility="Hidden"/>
|
||||
<Button Name="AfterBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}" Visibility="Hidden"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -11,6 +11,11 @@ Public Class MoveRawPartPage
|
||||
' Dati movimento
|
||||
Private m_dStep As Double = 0
|
||||
|
||||
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
PrevBtn.IsEnabled = False
|
||||
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
|
||||
End Sub
|
||||
|
||||
Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
m_bActive = True
|
||||
@@ -187,6 +192,15 @@ Public Class MoveRawPartPage
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
|
||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
EgtRemoveRawPartFromCurrPhase(nRawId)
|
||||
nRawId = EgtGetFirstSelectedObj()
|
||||
End While
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
|
||||
Dim dStep As Double
|
||||
If StringToLen(StepMoveTxBx.Text, dStep) Then
|
||||
|
||||
@@ -14,9 +14,12 @@ Public Class SaveNameWD
|
||||
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||
SaveNameTxbl.Text = "Nome del progetto da salvare"
|
||||
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", SaveNameTxBx.Text, m_MainWindow.GetIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
' Aggiorno file Ini
|
||||
WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, SaveNameTxBx.Text, m_MainWindow.GetIniFile())
|
||||
' Eseguo salvataggio
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveNameProject()
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveProject()
|
||||
|
||||
@@ -48,10 +48,10 @@ Public Class SimulationPageUC
|
||||
bOk = SortAllMachinings()
|
||||
If bOk Then
|
||||
m_CurrProjPage.SetOrderMachiningFlag()
|
||||
Dim bModif As Boolean = TestAllMachiningsForStrict()
|
||||
If bModif Then
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
||||
End If
|
||||
End If
|
||||
Dim bModif As Boolean = TestAllMachiningsForStrict()
|
||||
If bModif Then
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
||||
End If
|
||||
End If
|
||||
' Disabilito impostazione modificato
|
||||
|
||||
+31
-26
@@ -16,6 +16,7 @@ Public Class SplitPageUC
|
||||
Private m_bToNext As Boolean = False
|
||||
|
||||
Private Sub SplitPageUC_Initialized(sender As Object, e As EventArgs)
|
||||
PrevBtn.IsEnabled = False
|
||||
' Collego lista di oggetti a ListBox
|
||||
MachiningLsBx.ItemsSource = m_ItemList
|
||||
' Assegno testi
|
||||
@@ -28,13 +29,11 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub SplitPageUC_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||
' Se non c'è ordine delle lavorazioni, ne faccio uno automatico
|
||||
'If Not m_MainWindow.m_CurrentProjectPageUC.GetOrderMachiningFlag() Then
|
||||
Dim bOk As Boolean = SortAllMachinings()
|
||||
' If bOk Then
|
||||
' m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
|
||||
' End If
|
||||
'End If
|
||||
' Faccio ordine automatico delle lavorazioni
|
||||
Dim bOk As Boolean = SortAllMachinings()
|
||||
If bOk Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
|
||||
End If
|
||||
' Disabilito impostazione modificato
|
||||
EgtDisableModified()
|
||||
' Creo gruppo per numeri identificativi di lavorazione (colore default grigio)
|
||||
@@ -335,20 +334,6 @@ Public Class SplitPageUC
|
||||
ColorMachining(i - 1, True)
|
||||
Next
|
||||
EgtEnableModified()
|
||||
' Affondamento ridotto
|
||||
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
|
||||
' Restringo o rialzo lavorazioni abilitate ma con interferenza
|
||||
Dim bModified As Boolean = False
|
||||
For Each Mach As Machining In m_MachiningList
|
||||
If Mach.m_bEnabled And Mach.m_nInterf <> FMI_TYPE.NONE Then
|
||||
If AdjustMachining(Mach.m_nId, Mach.m_nInterf, dReducedDepth) Then
|
||||
bModified = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If bModified Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
||||
End If
|
||||
' se modificato salvo ordine e stato delle lavorazioni
|
||||
If m_bModified Then
|
||||
' Al primo posto deve rimanere la disposizione della fase
|
||||
@@ -368,6 +353,20 @@ Public Class SplitPageUC
|
||||
' dichiaro ordine salvato
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
|
||||
End If
|
||||
' Affondamento ridotto
|
||||
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
|
||||
' Restringo o rialzo lavorazioni abilitate ma con interferenza
|
||||
Dim bModified As Boolean = False
|
||||
For Each Mach As Machining In m_MachiningList
|
||||
If Mach.m_bEnabled And Mach.m_nInterf <> FMI_TYPE.NONE Then
|
||||
If AdjustMachining(Mach.m_nId, Mach.m_nInterf, dReducedDepth) Then
|
||||
bModified = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If bModified Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Function GetDisabledCutsCount() As Integer
|
||||
@@ -385,7 +384,8 @@ Public Class SplitPageUC
|
||||
' Determino il numero di tagli di separazione
|
||||
Dim nCount As Integer = 0
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
If m_MachiningList(nI).m_bAllStart Or m_MachiningList(nI).m_bAllEnd Then
|
||||
If m_MachiningList(nI).m_bEnabled And
|
||||
(m_MachiningList(nI).m_bAllStart Or m_MachiningList(nI).m_bAllEnd) Then
|
||||
nCount += 1
|
||||
End If
|
||||
Next
|
||||
@@ -393,7 +393,8 @@ Public Class SplitPageUC
|
||||
Dim MyCuts(nCount - 1) As Integer
|
||||
Dim nInd As Integer = 0
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
If m_MachiningList(nI).m_bAllStart Or m_MachiningList(nI).m_bAllEnd Then
|
||||
If m_MachiningList(nI).m_bEnabled And
|
||||
(m_MachiningList(nI).m_bAllStart Or m_MachiningList(nI).m_bAllEnd) Then
|
||||
MyCuts(nInd) = m_MachiningList(nI).m_nId
|
||||
nInd += 1
|
||||
End If
|
||||
@@ -516,8 +517,10 @@ Public Class SplitPageUC
|
||||
Dim nPocId As Integer = EgtGetFirstNameInGroup(nGrpId, NAME_PV_POSTCUT)
|
||||
If Not bEnabled Then
|
||||
EgtSetColor(nCutId, COL_MCH_DISABLED)
|
||||
EgtSetColor(nPrcId, COL_MCH_DISABLED)
|
||||
EgtSetColor(nPocId, COL_MCH_DISABLED)
|
||||
Dim bFreeStart As Boolean = (nInterf And FMI_TYPE.LI) <> FMI_TYPE.LI
|
||||
EgtSetColor(nPrcId, If(bFreeStart, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
|
||||
Dim bFreeEnd As Boolean = (nInterf And FMI_TYPE.LO) <> FMI_TYPE.LO
|
||||
EgtSetColor(nPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
|
||||
Else
|
||||
EgtSetColor(nCutId, COL_MCH_CUT)
|
||||
Dim bFreeStart As Boolean = (nInterf And FMI_TYPE.LI) <> FMI_TYPE.LI
|
||||
@@ -531,8 +534,10 @@ Public Class SplitPageUC
|
||||
|
||||
Private Sub ColorNumber(nI As Integer)
|
||||
If nI < 0 Then Return
|
||||
If Not m_MachiningList(nI).m_bEnabled Then
|
||||
If Not m_MachiningList(nI).m_bEnabled And m_MachiningList(nI).m_nInterf = FMI_TYPE.NONE Then
|
||||
EgtResetColor(m_MachiningList(nI).m_nNbrId)
|
||||
ElseIf Not m_MachiningList(nI).m_bEnabled Then
|
||||
EgtSetColor(m_MachiningList(nI).m_nNbrId, COL_MCH_DIS_INTERF)
|
||||
ElseIf m_MachiningList(nI).m_nInterf = FMI_TYPE.NONE Then
|
||||
EgtSetColor(m_MachiningList(nI).m_nNbrId, COL_MCH_FREE)
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user