OmagOFFICE :
- aggiornamenti per conservazione pezzi nestati in modifica grezzo - aggiunta gestione materiale per ogni gruppo di lavoro - CsvM trasformato in modulo.
This commit is contained in:
@@ -261,6 +261,7 @@ Public Class CompoParamPageVM
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function UpdateVariables() As Boolean
|
||||
|
||||
@@ -20,7 +20,7 @@ Public Class CsvWindowV
|
||||
Dim TreeViewItem As TreeViewItem = DirectCast(sender, TreeViewItem)
|
||||
If TypeOf TreeViewItem.DataContext Is CsvPartItem Then
|
||||
Dim CsvPartItem As CsvPartItem = DirectCast(TreeViewItem.DataContext, CsvPartItem)
|
||||
OmagOFFICEMap.refCsvM.CsvPartList(CsvPartItem.nType - 1).m_bActive = CsvPartItem.bIsActive
|
||||
CsvM.CsvPartList(CsvPartItem.nType - 1).m_bActive = CsvPartItem.bIsActive
|
||||
CsvPartItem.bIsActive = Not CsvPartItem.bIsActive
|
||||
e.Handled = True
|
||||
End If
|
||||
@@ -40,7 +40,7 @@ Public Class CsvWindowV
|
||||
' Aggiorno stato
|
||||
For Each Item As CsvPartItem In CsvPartType.CsvPartList
|
||||
Item.bIsActive = bActivate
|
||||
OmagOFFICEMap.refCsvM.CsvPartList(Item.nType - 1).m_bActive = Item.bIsActive
|
||||
CsvM.CsvPartList(Item.nType - 1).m_bActive = Item.bIsActive
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -7,9 +7,6 @@ Public Class CsvWindowVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
' Riferimento alla classe CsvM
|
||||
Private m_refCsvM As CsvM
|
||||
|
||||
Private m_CsvPath As String
|
||||
Public Property CsvPath As String
|
||||
Get
|
||||
@@ -76,8 +73,6 @@ Public Class CsvWindowVM
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' recupero riferimento alla classe CsvM
|
||||
m_refCsvM = OmagOFFICEMap.refCsvM
|
||||
' Visualizzazione lista
|
||||
ShowTreeView()
|
||||
End Sub
|
||||
@@ -89,7 +84,7 @@ Public Class CsvWindowVM
|
||||
Private Sub ShowTreeView()
|
||||
' Path del file Csv
|
||||
Dim TempPath As New Text.StringBuilder(260)
|
||||
PathCompactPathEx(TempPath, OmagOFFICEMap.refCsvM.CsvPath, 28, 0)
|
||||
PathCompactPathEx(TempPath, CsvM.CsvPath, 28, 0)
|
||||
CsvPath = TempPath.ToString()
|
||||
' Pezzi del file Csv
|
||||
m_CsvTypeList.Clear()
|
||||
@@ -98,9 +93,9 @@ Public Class CsvWindowVM
|
||||
Dim nCatToNest As Integer = 0
|
||||
Dim nCatCount As Integer = 0
|
||||
Dim PartCathegory As New CsvPartType("", 0)
|
||||
For i As Integer = 1 To OmagOFFICEMap.refCsvM.CsvPartList.Count()
|
||||
For i As Integer = 1 To CsvM.CsvPartList.Count()
|
||||
' Dati pezzo corrente
|
||||
Dim CurrPart As CsvPart = OmagOFFICEMap.refCsvM.CsvPartList(i - 1)
|
||||
Dim CurrPart As CsvPart = CsvM.CsvPartList(i - 1)
|
||||
' Gestione categoria
|
||||
If i = 1 Then
|
||||
sCurrMat = CurrPart.m_sMaterial
|
||||
@@ -137,7 +132,7 @@ Public Class CsvWindowVM
|
||||
Private Sub UpdateTreeView()
|
||||
For Each CatItem As CsvPartType In m_CsvTypeList
|
||||
For Each PrtItem As CsvPartItem In CatItem.CsvPartList
|
||||
Dim PartData As CsvPart = OmagOFFICEMap.refCsvM.CsvPartList(PrtItem.nType - 1)
|
||||
Dim PartData As CsvPart = CsvM.CsvPartList(PrtItem.nType - 1)
|
||||
Dim sCount As String = PartData.m_nToNest.ToString() & "/" & PartData.m_nCount.ToString()
|
||||
PrtItem.sText1 = sCount
|
||||
Next
|
||||
@@ -160,7 +155,7 @@ Public Class CsvWindowVM
|
||||
End Property
|
||||
|
||||
Public Sub NewCmd(ByVal param As Object)
|
||||
OmagOFFICEMap.refCsvM.NewCmd()
|
||||
CsvM.NewCmd()
|
||||
' Visualizzazione lista
|
||||
ShowTreeView()
|
||||
End Sub
|
||||
@@ -179,7 +174,7 @@ Public Class CsvWindowVM
|
||||
End Property
|
||||
|
||||
Public Sub Open(ByVal param As Object)
|
||||
OmagOFFICEMap.refCsvM.Open()
|
||||
CsvM.Open()
|
||||
' Visualizzazione lista
|
||||
ShowTreeView()
|
||||
End Sub
|
||||
@@ -198,7 +193,7 @@ Public Class CsvWindowVM
|
||||
End Property
|
||||
|
||||
Public Sub Insert(ByVal param As Object)
|
||||
OmagOFFICEMap.refCsvM.Insert()
|
||||
CsvM.Insert()
|
||||
' Aggiorno TreeView
|
||||
UpdateTreeView()
|
||||
End Sub
|
||||
@@ -220,7 +215,7 @@ Public Class CsvWindowVM
|
||||
' Elenco eventuali altre liste Csv riferite dai pezzi
|
||||
Dim bOther As Boolean = False
|
||||
Dim sOtherCsv As String = String.Empty
|
||||
OmagOFFICEMap.refCsvM.Remove(bOther, sOtherCsv)
|
||||
CsvM.Remove(bOther, sOtherCsv)
|
||||
' Aggiorno TreeView
|
||||
UpdateTreeView()
|
||||
' Eventuale messaggi di pezzi liberi o da altre liste
|
||||
@@ -231,7 +226,7 @@ Public Class CsvWindowVM
|
||||
' o di altre liste Csv
|
||||
sOut &= EgtMsg(MSG_EGTMSGBOX + 14) & " (" & sOtherCsv.TrimEnd(", ".ToCharArray()) & ")"
|
||||
End If
|
||||
MessageBox.Show("", sOut, MessageBoxButton.OK)
|
||||
MessageBox.Show(sOut, "", MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Public Class CurrMachWindowVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelCurrSawing As String
|
||||
Private m_SelCurrSawing As String = String.Empty
|
||||
Public Property SelCurrSawing As String
|
||||
Get
|
||||
Return m_SelCurrSawing
|
||||
@@ -25,8 +25,8 @@ Public Class CurrMachWindowVM
|
||||
Set(value As String)
|
||||
If value <> m_SelCurrSawing Then
|
||||
m_SelCurrSawing = value
|
||||
CurrentMachine.sCurrSawing = m_SelCurrSawing
|
||||
End If
|
||||
CurrentMachine.sCurrSawing = m_SelCurrSawing
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -323,7 +323,8 @@ Public Class CurrMachWindowVM
|
||||
For Each Material In MachiningMaterials
|
||||
Dim Param() As String = Material.Split(",".ToCharArray)
|
||||
If Param(0) = CurrentMachine.CurrMat.nId.ToString() Then
|
||||
Dim dRawHeight = EstCalc.GetRawHeight() '!!!
|
||||
Dim dRawHeight As Double = -1
|
||||
StringToDouble(OmagOFFICEMap.refRawPartTabVM.Height, dRawHeight)
|
||||
Dim MatMinH As Double = 0
|
||||
StringToDouble(Param(1), MatMinH)
|
||||
Dim MatMaxH As Double = 0
|
||||
|
||||
@@ -486,10 +486,10 @@ Friend Module CamAuto
|
||||
End Function
|
||||
|
||||
Private Function SetLuaStandardCamParams() As Boolean
|
||||
Dim sSawMch As String = sCurrSawing
|
||||
Dim sMillMch As String = sCurrMilling
|
||||
Dim sDrillMch As String = sCurrDrilling
|
||||
Dim sDripSawMch As String = sCurrDripSawing
|
||||
Dim sSawMch As String = CurrentMachine.sCurrSawing
|
||||
Dim sMillMch As String = CurrentMachine.sCurrMilling
|
||||
Dim sDrillMch As String = CurrentMachine.sCurrDrilling
|
||||
Dim sDripSawMch As String = CurrentMachine.sCurrDripSawing
|
||||
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, sMachIniFile)
|
||||
Dim dHolesOffset As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OFFSET, 0, sMachIniFile)
|
||||
Dim dHolesOverlap As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OVERLAP, 0, sMachIniFile)
|
||||
|
||||
@@ -3,47 +3,37 @@ Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class CsvM
|
||||
Module CsvM
|
||||
|
||||
' Dati lista
|
||||
Private m_sCsvPath As String = String.Empty
|
||||
Friend ReadOnly Property CsvPath As String
|
||||
Public ReadOnly Property CsvPath As String
|
||||
Get
|
||||
Return m_sCsvPath
|
||||
End Get
|
||||
End Property
|
||||
Private m_CsvPartList As New List(Of CsvPart)
|
||||
Friend ReadOnly Property CsvPartList As List(Of CsvPart)
|
||||
Public ReadOnly Property CsvPartList As List(Of CsvPart)
|
||||
Get
|
||||
Return m_CsvPartList
|
||||
End Get
|
||||
End Property
|
||||
Private m_sCompoDir As String = String.Empty
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in OmagOFFICEMap
|
||||
OmagOFFICEMap.SetRefCsvM(Me)
|
||||
InitCsvM()
|
||||
' Leggo direttorio componenti
|
||||
GetMainPrivateProfileString(S_COMPO, K_COMPODIR, "", m_sCompoDir)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitCsvM()
|
||||
Public Sub InitCsvM()
|
||||
' Leggo direttorio componenti
|
||||
GetMainPrivateProfileString(S_COMPO, K_COMPODIR, "", m_sCompoDir)
|
||||
' Leggo lista pezzi corrente
|
||||
Dim sCsvFile As String = String.Empty
|
||||
GetmainPrivateProfileString(S_CSV, K_CSVLASTFILE, "", sCsvFile)
|
||||
GetMainPrivateProfileString(S_CSV, K_CSVLASTFILE, "", sCsvFile)
|
||||
If Not String.IsNullOrEmpty(sCsvFile) Then
|
||||
LoadCsvPartList(sCsvFile)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub NewCmd()
|
||||
Public Sub NewCmd()
|
||||
' Salvo lista dei pezzi attuale
|
||||
SaveCsvPartList()
|
||||
' Pulisco path e lista dei pezzi Csv
|
||||
@@ -53,7 +43,7 @@ Public Class CsvM
|
||||
WriteMainPrivateProfileString(S_CSV, K_CSVLASTFILE, "")
|
||||
End Sub
|
||||
|
||||
Friend Sub Open()
|
||||
Public Sub Open()
|
||||
' Salvo lista dei pezzi attuale
|
||||
SaveCsvPartList()
|
||||
' Leggo direttorio corrente dei file CSV
|
||||
@@ -75,7 +65,7 @@ Public Class CsvM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub Insert()
|
||||
Public Sub Insert()
|
||||
' Recupero lo spessore della lastra corrente
|
||||
Dim dRawHeight As Double = EstCalc.GetRawHeight()
|
||||
If dRawHeight < EPS_SMALL Then Return
|
||||
@@ -236,7 +226,7 @@ Public Class CsvM
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Sub Remove(ByRef bOther As Boolean, ByRef sOtherCsv As String)
|
||||
Public Sub Remove(ByRef bOther As Boolean, ByRef sOtherCsv As String)
|
||||
' Rimuovo i pezzi selezionati della lista CSV corrente e ne aggiorno i contatori
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
@@ -257,9 +247,7 @@ Public Class CsvM
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Function RemoveOnePart(nId As Integer) As Boolean
|
||||
' Verifico sia nel grezzo
|
||||
If EgtGetParent(nId) <> EstCalc.GetRawId() Then Return False
|
||||
Public Function RemoveOnePart(nId As Integer) As Boolean
|
||||
' Recupero identificativi da Info
|
||||
Dim sCsvPath As String = String.Empty
|
||||
EgtGetInfo(nId, INFO_CSV_PATH, sCsvPath)
|
||||
@@ -271,10 +259,13 @@ Public Class CsvM
|
||||
For i = 1 To m_CsvPartList.Count()
|
||||
Dim CurrPart As CsvPart = m_CsvPartList(i - 1)
|
||||
If String.Compare(sName, CurrPart.m_sName, True) = 0 Then
|
||||
' Rimuovo le lavorazioni
|
||||
EraseMachinings(nId)
|
||||
' Rimuovo dal grezzo
|
||||
EgtRemovePartFromRawPart(nId)
|
||||
' Se era nel grezzo
|
||||
If EgtGetParent(nId) = EstCalc.GetRawId() Then
|
||||
' Rimuovo le lavorazioni
|
||||
EraseMachinings(nId)
|
||||
' Rimuovo dal grezzo
|
||||
EgtRemovePartFromRawPart(nId)
|
||||
End If
|
||||
' Cancello il pezzo
|
||||
EgtErase(nId)
|
||||
' Aggiorno il contatore
|
||||
@@ -355,7 +346,7 @@ Public Class CsvM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Sub SaveCsvPartList()
|
||||
Public Sub SaveCsvPartList()
|
||||
' Se non c'è nulla di attivo, non faccio alcunché
|
||||
If String.IsNullOrEmpty(m_sCsvPath) Then
|
||||
EgtOutLog("CSV List missing")
|
||||
@@ -478,9 +469,9 @@ Public Class CsvM
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
End Module
|
||||
|
||||
Friend Class CsvPart
|
||||
Public Class CsvPart
|
||||
Public m_sName As String = String.Empty
|
||||
Public m_sMaterial As String = String.Empty
|
||||
Public m_bActive As Boolean = True
|
||||
@@ -538,7 +538,7 @@ Public Module CurrentMachine
|
||||
Next
|
||||
WritePrivateProfileMaterial(S_MATERIALS, K_MATERIAL & m_MaxIdMat + 1, value, sMachIniFile)
|
||||
m_MaxIdMat += 1
|
||||
Materials.Add(value)
|
||||
m_Materials.Add(value)
|
||||
End Sub
|
||||
|
||||
Public Sub RemoveMaterial(value As Material)
|
||||
@@ -616,6 +616,16 @@ Public Module CurrentMachine
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Function SetCurrMatByName(sMat As String) As Boolean
|
||||
' Cerco il nome nella lista dei materiali
|
||||
For Index = 0 To Materials.Count - 1
|
||||
If String.Compare(Materials(Index).sName, sMat, True) = 0 Then
|
||||
CurrMat = Materials(Index)
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public ReadOnly Property bHasRawProbe As Boolean
|
||||
Get
|
||||
Return m_HasRawProbe
|
||||
@@ -625,7 +635,7 @@ Public Module CurrentMachine
|
||||
#End Region
|
||||
|
||||
Sub InitCurrentMachine(sMachinesRootDir As String, sMachineName As String, bKeyProdLine As Boolean, bKeyMill As Boolean)
|
||||
'Nome macchina corrente
|
||||
' Nome macchina corrente
|
||||
m_sMachineName = sMachineName
|
||||
' Impostazione direttorio macchina
|
||||
m_sMachDir = sMachinesRootDir & "\" & sMachineName
|
||||
@@ -736,8 +746,9 @@ Public Module CurrentMachine
|
||||
' Leggo flag per posizione home alla fine dei tagli diretti
|
||||
m_bDirectCutsFinalHome = (GetPrivateProfileInt(S_MACH_DIRECTCUTS, K_FINALHOME, 1, sMachIniFile) <> 0)
|
||||
|
||||
' Creo materiale di default e lo aggiungo alla lista
|
||||
' m_Materials.Add(New Material(0, "Generico"))
|
||||
' Pulisco la lista dei materiali
|
||||
m_Materials.Clear()
|
||||
m_MaxIdMat = 0
|
||||
' Leggo la lista dei materiali
|
||||
Dim Material As Material = Nothing
|
||||
Dim nIndex As Integer = 1
|
||||
@@ -756,7 +767,7 @@ Public Module CurrentMachine
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' leggo se la macchina ha il tastatore dello spessore tavola
|
||||
' Leggo se la macchina ha il tastatore dello spessore lastra
|
||||
m_HasRawProbe = (GetPrivateProfileInt(S_MACH_PROBING, K_ENABLERAWPROBE, 1, sMachIniFile) <> 0)
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -89,6 +89,19 @@ Module EstCalc
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'--------------------------------------------------------------------------------------------------
|
||||
Public Function SetMaterialName() As Boolean
|
||||
Dim nMGrpId As Integer = EgtGetCurrMachGroup()
|
||||
Return EgtSetInfo(nMGrpId, INFO_PROJMAT, CurrentMachine.CurrMat.sName)
|
||||
End Function
|
||||
|
||||
Friend Function GetMaterialName() As String
|
||||
Dim nMGrpId As Integer = EgtGetCurrMachGroup()
|
||||
Dim sName As String = String.Empty
|
||||
EgtGetInfo(nMGrpId, INFO_PROJMAT, sName)
|
||||
Return sName
|
||||
End Function
|
||||
|
||||
'--------------------------------------------------------------------------------------------------
|
||||
Public Function SetOrderMachiningFlag() As Boolean
|
||||
Dim nMGrpId As Integer = EgtGetCurrMachGroup()
|
||||
|
||||
@@ -54,6 +54,8 @@ Public Class MachGroupPanelVM
|
||||
OmagOFFICEMap.refOptionPanelVM.SelItem = OptionPanelVM.Tabs.NESTING
|
||||
' Aggiorno grezzo iniziale
|
||||
EstCalc.UpdateRawPart()
|
||||
' Aggiorno materiale corrente
|
||||
CurrentMachine.SetCurrMatByName(EstCalc.GetMaterialName())
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
@@ -94,6 +94,8 @@ Public Class MainWindowVM
|
||||
' Nuovo progetto
|
||||
OmagOFFICEMap.refTopCommandBarVM.NewCmd()
|
||||
End If
|
||||
' Inizializzo gestore CSV
|
||||
InitCsvM()
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
+1
-1
@@ -157,7 +157,7 @@
|
||||
<Compile Include="Constants\ConstGen.vb" />
|
||||
<Compile Include="Constants\ConstIni.vb" />
|
||||
<Compile Include="Constants\ConstMsg.vb" />
|
||||
<Compile Include="CsvWindow\CsvM.vb" />
|
||||
<Compile Include="EgtStoneLib\CsvM.vb" />
|
||||
<Compile Include="CsvWindow\CsvWindowV.xaml.vb">
|
||||
<DependentUpon>CsvWindowV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -617,17 +617,15 @@ Public Class NestingTabVM
|
||||
' Chiedo se si vogliono cancellare anche questi pezzi
|
||||
Dim bEraseCsvParts As Boolean = False
|
||||
If bCsvParts Then
|
||||
'' Vuoi cancellare anche i pezzi da lista Csv ?
|
||||
'Dim EraseCsvParts As New EgtMsgBox(m_MainWindow, "", EgtMsg(MSG_EGTMSGBOX + 12),
|
||||
' EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL)
|
||||
'Select Case EraseCsvParts.DialogResult
|
||||
'Case 0 ' Annulla
|
||||
' Return
|
||||
'Case 1 ' Si
|
||||
' bEraseCsvParts = True
|
||||
'Case 2 ' No
|
||||
' bEraseCsvParts = False
|
||||
'End Select
|
||||
' Vuoi cancellare anche i pezzi da lista Csv ?
|
||||
Select Case MessageBox.Show(EgtMsg(MSG_EGTMSGBOX + 12), "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
|
||||
Case MessageBoxResult.Cancel
|
||||
Return
|
||||
Case MessageBoxResult.Yes
|
||||
bEraseCsvParts = True
|
||||
Case MessageBoxResult.No
|
||||
bEraseCsvParts = False
|
||||
End Select
|
||||
End If
|
||||
' Ciclo di cancellazione dei pezzi selezionati
|
||||
nId = EgtGetFirstSelectedObj()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
IsTopDockable="False" IsBottomDockable="False" IsLeftDockable="True"
|
||||
IsRightDockable="False" Style="{StaticResource Option_EgtFloatingPanel}">
|
||||
|
||||
<TabControl SelectedIndex="{Binding SelItem}">
|
||||
<TabControl Name="Tabs" SelectedIndex="{Binding SelItem}">
|
||||
<TabItem Header="{Binding RawPartTabMsg}" IsEnabled="{Binding RawTabIsEnabled}">
|
||||
<TabItem.Content>
|
||||
<OmagOFFICE:RawPartTabV DataContext="{StaticResource RawPartTabVM}"/>
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
Public Class OptionPanelV
|
||||
|
||||
'Sub New()
|
||||
|
||||
' ' This call is required by the designer.
|
||||
' InitializeComponent()
|
||||
|
||||
' ' Add any initialization after the InitializeComponent() call.
|
||||
' Dim TabView As ComponentModel.ICollectionView = CollectionViewSource.GetDefaultView(Tabs.ItemsSource)
|
||||
' AddHandler TabView.CurrentChanging, AddressOf TabChanging
|
||||
'End Sub
|
||||
|
||||
'Private Sub TabChanging(sender As Object, e As ComponentModel.CurrentChangingEventArgs)
|
||||
|
||||
'End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -391,8 +391,11 @@ Public Class RawPartTabVM
|
||||
Return CurrentMachine.CurrMat
|
||||
End Get
|
||||
Set(value As Material)
|
||||
CurrentMachine.CurrMat = value
|
||||
UpdateTabState()
|
||||
If Not IsNothing(value) Then
|
||||
CurrentMachine.CurrMat = value
|
||||
EstCalc.SetMaterialName()
|
||||
UpdateTabState()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -705,25 +708,11 @@ Public Class RawPartTabVM
|
||||
End If
|
||||
' Assegno identificativo del grezzo
|
||||
EstCalc.UpdateRawPart()
|
||||
' Parcheggio pezzi presenti nel grezzo
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(GetRawId())
|
||||
While nPartId <> GDB_ID.NULL
|
||||
' Recupero identificativo del successivo
|
||||
Dim nNextPartId As Integer = EgtGetNextPartInRawPart(nPartId)
|
||||
' Metto in parcheggio
|
||||
StoreOnePart(nPartId)
|
||||
' Eventuale notifica al VeinMatching
|
||||
VeinMatching.OnRemovePartFromRaw(nPartId)
|
||||
' Passo al successivo
|
||||
nPartId = nNextPartId
|
||||
End While
|
||||
' Nascondo eventuali pezzi in parcheggio
|
||||
HideParkedParts()
|
||||
' Deseleziono pezzi
|
||||
EgtDeselectAll()
|
||||
VeinMatching.OnDeselectAll()
|
||||
' Cancello tutte le lavorazioni
|
||||
EraseMachinings(GDB_ID.NULL)
|
||||
' Visualizzo eventuale foto
|
||||
ShowPhoto(True)
|
||||
Dim bHeightModified As Boolean = False
|
||||
@@ -792,6 +781,25 @@ Public Class RawPartTabVM
|
||||
WriteMainPrivateProfileString(S_RAWPART, K_RAWOFFSX, DoubleToString(m_dOffsetX, 2))
|
||||
WriteMainPrivateProfileString(S_RAWPART, K_RAWOFFSY, DoubleToString(m_dOffsetY, 2))
|
||||
WriteMainPrivateProfileString(S_RAWPART, K_RAWKERF, DoubleToString(m_dKerf, 2))
|
||||
' Se ci sono pezzi nel grezzo
|
||||
If EgtGetFirstPartInRawPart(EstCalc.GetRawId()) <> GDB_ID.NULL Then
|
||||
' Cancello tutte le lavorazioni
|
||||
CamAuto.EraseMachinings(GDB_ID.NULL)
|
||||
' Reinserisco tutte le lavorazioni piane
|
||||
CamAuto.AddMachinings(GDB_ID.NULL, True, False)
|
||||
' Aggiorno regioni per nesting
|
||||
EstCalc.UpdateNestRegions()
|
||||
' Verifico ogni singolo pezzo
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(EstCalc.GetRawId())
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim nNextPartId = EgtGetNextPartInRawPart(nPartId)
|
||||
If Not EgtVerifyPart(nPartId, CurrentMachine.bReducedCut) Then
|
||||
EstCalc.StoreOnePart(nPartId)
|
||||
VeinMatching.OnRemovePartFromRaw(nPartId)
|
||||
End If
|
||||
nPartId = nNextPartId
|
||||
End While
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -882,7 +890,7 @@ Public Class RawPartTabVM
|
||||
' in presenza di foto rendo molto più trasparente
|
||||
If GetPhoto() <> GDB_ID.NULL Then Col.A = 20
|
||||
' Se non esiste già il grezzo e richiesto, lo inserisco
|
||||
Dim nRawId As Integer = GetRawId()
|
||||
Dim nRawId As Integer = EstCalc.GetRawId()
|
||||
If nRawId = GDB_ID.NULL And m_dHeight > EPS_SMALL Then
|
||||
EgtAddRawPart(Point3d.ORIG(), m_dLength + 2 * m_dKerf, m_dWidth + 2 * m_dKerf, m_dHeight, Col)
|
||||
' se esiste e da cancellare
|
||||
@@ -900,10 +908,8 @@ Public Class RawPartTabVM
|
||||
Dim ptRef As New Point3d(m_dOffsetX - m_dKerf, m_dOffsetY - m_dKerf, CurrentMachine.dAdditionalTable)
|
||||
If EgtMoveToCornerRawPart(GetRawId(), ptRef, MCH_CR.BL) Then
|
||||
EstCalc.UpdateRawPart()
|
||||
'OkBtn.IsEnabled = True
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
Else
|
||||
'OkBtn.IsEnabled = False
|
||||
Dim sMsg As String = "Errore nella posizione o dimensione del grezzo"
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(sMsg, MSG_TYPE.ERROR_)
|
||||
End If
|
||||
@@ -937,24 +943,47 @@ Public Class RawPartTabVM
|
||||
|
||||
Private Sub UpdateRawPartHeight()
|
||||
' Se da creare
|
||||
If GetRawId() = GDB_ID.NULL Then
|
||||
If EstCalc.GetRawId() = GDB_ID.NULL Then
|
||||
UpdateRawPart(True)
|
||||
Return
|
||||
' se da cancellare
|
||||
ElseIf m_dHeight < EPS_SMALL Then
|
||||
EgtRemoveRawPart(GetRawId())
|
||||
' Se ci sono pezzi
|
||||
If EgtGetFirstPartInRawPart(EstCalc.GetRawId()) <> GDB_ID.NULL Then
|
||||
' Parcheggio pezzi presenti nel grezzo e li tolgo da VeinMatcing
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(EstCalc.GetRawId())
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim nNextPartId As Integer = EgtGetNextPartInRawPart(nPartId)
|
||||
EstCalc.StoreOnePart(nPartId)
|
||||
VeinMatching.OnRemovePartFromRaw(nPartId)
|
||||
nPartId = nNextPartId
|
||||
End While
|
||||
' Cancello tutte le lavorazioni
|
||||
CamAuto.EraseMachinings(GDB_ID.NULL)
|
||||
' Nascondo i pezzi parcheggiati
|
||||
EstCalc.HideParkedParts()
|
||||
End If
|
||||
' Elimino il grezzo
|
||||
EgtRemoveRawPart(EstCalc.GetRawId())
|
||||
' altrimenti da aggiornare
|
||||
Else
|
||||
' Salvo vecchia altezza
|
||||
Dim dOldHeight As Double = EstCalc.GetRawHeight()
|
||||
' Aggiorno solido
|
||||
EgtModifyRawPartHeight(GetRawId(), m_dHeight)
|
||||
EgtModifyRawPartHeight(EstCalc.GetRawId(), m_dHeight)
|
||||
' Vettore spostamento
|
||||
Dim vtMove As New Vector3d(0, 0, m_dHeight - dOldHeight)
|
||||
' Aggiorno quota kerf
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(GetRawId(), NAME_KERF)
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(EstCalc.GetRawId(), NAME_KERF)
|
||||
If nKerfId <> GDB_ID.NULL Then
|
||||
Dim ptStart As Point3d
|
||||
EgtStartPoint(nKerfId, GDB_ID.ROOT, ptStart)
|
||||
Dim dKerfHeight = ptStart.z - m_ptTableMin.z - CurrentMachine.dAdditionalTable
|
||||
EgtMove(nKerfId, New Vector3d(0, 0, m_dHeight - dKerfHeight))
|
||||
EgtMove(nKerfId, vtMove)
|
||||
End If
|
||||
' Se ci sono pezzi ne aggiorno la quota
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(EstCalc.GetRawId())
|
||||
While nPartId <> GDB_ID.NULL
|
||||
EgtMovePartInRawPart(nPartId, vtMove)
|
||||
nPartId = EgtGetNextPartInRawPart(nPartId)
|
||||
End While
|
||||
End If
|
||||
EstCalc.UpdateRawPart()
|
||||
' Se c'è foto, aggiorno quota fotografia
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
' Oggetto che gestisce il Csv durante tutto il programma
|
||||
Private m_CsvM As CsvM
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -13,8 +10,6 @@
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in OmagOFFICEMap
|
||||
OmagOFFICEMap.SetRefProjectVM(Me)
|
||||
' Creo oggetto che gestisce Csv
|
||||
m_CsvM = New CsvM
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
@@ -240,6 +240,7 @@ Public Class SceneHostV
|
||||
|
||||
Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean) Handles m_Controller.OnSavedProject
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile)
|
||||
CsvM.SaveCsvPartList()
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseDownScene(sender As Object, e As Windows.Forms.MouseEventArgs) Handles OmagOFFICEScene.OnMouseDownScene
|
||||
|
||||
@@ -18,7 +18,6 @@ Module OmagOFFICEMap
|
||||
Private m_refSplitModeVM As SplitModeVM
|
||||
Private m_refMoveRawModeVM As MoveRawModeVM
|
||||
Private m_refSimulTabVM As SimulTabVM
|
||||
Private m_refCsvM As CsvM
|
||||
|
||||
#Region "Get"
|
||||
|
||||
@@ -118,12 +117,6 @@ Module OmagOFFICEMap
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refCsvM As CsvM
|
||||
Get
|
||||
Return m_refCsvM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Get
|
||||
|
||||
#Region "Set"
|
||||
@@ -203,11 +196,6 @@ Module OmagOFFICEMap
|
||||
Return Not IsNothing(m_refSimulTabVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefCsvM(CsvM As CsvM) As Boolean
|
||||
m_refCsvM = CsvM
|
||||
Return Not IsNothing(m_refCsvM)
|
||||
End Function
|
||||
|
||||
#End Region ' Set
|
||||
|
||||
#Region "Init"
|
||||
@@ -225,7 +213,7 @@ Module OmagOFFICEMap
|
||||
Not IsNothing(m_refMachinePanelVM) AndAlso Not IsNothing(m_refMachGroupPanelVM) AndAlso
|
||||
Not IsNothing(m_refOptionPanelVM) AndAlso Not IsNothing(m_refRawPartTabVM) AndAlso
|
||||
Not IsNothing(m_refNestingTabVM) AndAlso Not IsNothing(m_refSimulTabVM) AndAlso
|
||||
Not IsNothing(m_refMachiningTabVM) AndAlso Not IsNothing(m_refCsvM)
|
||||
Not IsNothing(m_refMachiningTabVM)
|
||||
End Function
|
||||
|
||||
#End Region ' Init
|
||||
|
||||
Reference in New Issue
Block a user