Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ccb7fb96f | |||
| 9a751d0524 | |||
| 58c00878a8 | |||
| 992686a5a2 | |||
| 5b2b39789d | |||
| ad74579ee6 | |||
| f3f9db7bb7 | |||
| 2900aa98f8 | |||
| 153374cd5d | |||
| 1076abd8de | |||
| 0e260a570e | |||
| 59176a1269 | |||
| 2e2de2ade4 | |||
| b6f19b04cb | |||
| 7289e84d7b | |||
| c5757cb3c7 | |||
| 311f6fca99 | |||
| 0efe5b51e4 | |||
| 38bf52893b | |||
| d4b49699c8 | |||
| 09e8c0f6b4 | |||
| 03fdc33be0 |
@@ -37,6 +37,7 @@
|
||||
Public Const K_PATH_HMI As String = "PathHmi"
|
||||
Public Const K_USENEWMDI As String = "UseNewMDI"
|
||||
Public Const K_ISSIEMENSONE As String = "IsSiemensOne"
|
||||
Public Const K_ISACTIVEMODESUBSCR As String = "IsActiveModeSubscr"
|
||||
Public Const K_DBVARPATH As String = "DBVarPath"
|
||||
Public Const K_NEWWRITECNCMODE As String = "NewWriteCNCMode"
|
||||
|
||||
|
||||
@@ -671,8 +671,6 @@ Public Class FlatteningCut
|
||||
End If
|
||||
UpdateSimulOkBtn()
|
||||
|
||||
|
||||
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
|
||||
@@ -550,7 +550,11 @@ Public Class MachineButtonsUC
|
||||
End Sub
|
||||
|
||||
Friend Sub DoorStateChanged(DoorState As Integer)
|
||||
' recupero le asscociazioni con i bottoni
|
||||
If IsNothing(DoorState) Then
|
||||
EgtOutLog("Error: door state null!")
|
||||
Return
|
||||
End If
|
||||
' recupero le associazioni con i bottoni
|
||||
Dim nIndex As Integer = Array.IndexOf(StateFlagArray, BTN_STATE_DOOR_OPENED)
|
||||
If nIndex = -1 Then Return
|
||||
' bottone di apertura porte
|
||||
@@ -560,7 +564,7 @@ Public Class MachineButtonsUC
|
||||
' bottone di chiusura porte
|
||||
Dim DoorClosedButton As Primitives.ToggleButton = GetToggleButton(nIndex + 1)
|
||||
' modifico il colore dei bottoni
|
||||
If Not IsNothing(DoorState) Then
|
||||
If Not IsNothing(DoorState) AndAlso Not IsNothing(DoorClosedButton) Then
|
||||
Select Case DoorState
|
||||
Case 0
|
||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
|
||||
@@ -568,7 +572,7 @@ Public Class MachineButtonsUC
|
||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||
End Select
|
||||
End If
|
||||
If Not IsNothing(DoorState) Then
|
||||
If Not IsNothing(DoorState) AndAlso Not IsNothing(DoorOpenedButton) Then
|
||||
Select Case DoorState
|
||||
Case 0
|
||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports EgtUILib
|
||||
Imports System.Collections.ObjectModel
|
||||
Public Class SingleDrillUC
|
||||
' Riferimenti a pagine
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
@@ -37,6 +38,8 @@ Public Class SingleDrillUC
|
||||
|
||||
Private m_dDiameter As Double = 0
|
||||
|
||||
Private m_sCurrDrill As String = String.Empty
|
||||
|
||||
' Costanti
|
||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||
Private Const MIN_CUT_LEN As Double = 10.0
|
||||
@@ -67,8 +70,11 @@ Public Class SingleDrillUC
|
||||
End Sub
|
||||
|
||||
Private Sub SingleDrill_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
m_sCurrDrill = m_CurrentMachine.sCurrDrill
|
||||
GetDrillFromDrilling(m_sCurrDrill)
|
||||
|
||||
' recupero informazioni del foretto usato
|
||||
EgtTdbSetCurrTool(m_CurrentMachine.sCurrDrill)
|
||||
EgtTdbSetCurrTool(m_sCurrDrill)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_dDiameter)
|
||||
|
||||
' Attivo la pagina
|
||||
@@ -215,7 +221,7 @@ Public Class SingleDrillUC
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
|
||||
' Ricavo dati Foretto corrente
|
||||
Dim sDrill As String = m_MainWindow.m_CurrentMachine.sCurrDrill
|
||||
Dim sDrill As String = m_sCurrDrill
|
||||
' Se punto da laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
@@ -245,9 +251,9 @@ Public Class SingleDrillUC
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrDrill
|
||||
Dim sDrill As String = m_sCurrDrill
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
If Not EgtSetCalcTool(sDrill, "H1", 1) Then Return
|
||||
End If
|
||||
|
||||
' Disegno il taglio
|
||||
@@ -261,6 +267,42 @@ Public Class SingleDrillUC
|
||||
Point1Btn.IsChecked = True
|
||||
End Sub
|
||||
|
||||
Private Sub GetDrillFromDrilling(ByRef sCurrDrill As String)
|
||||
If String.IsNullOrEmpty(sCurrDrill) Or String.IsNullOrWhiteSpace(sCurrDrill) Then
|
||||
' creo l'elenco degli utensili di foratura
|
||||
Dim sToolName As String = String.Empty
|
||||
Dim nType As Integer = MCH_TY.NONE
|
||||
Dim DrillToolList As New ObservableCollection(Of String)
|
||||
DrillToolList.Clear()
|
||||
If EgtTdbGetFirstTool(MCH_TF.DRILLBIT, sToolName, nType) Then
|
||||
DrillToolList.Add(sToolName)
|
||||
While EgtTdbGetNextTool(MCH_TF.DRILLBIT, sToolName, nType)
|
||||
DrillToolList.Add(sToolName)
|
||||
End While
|
||||
End If
|
||||
' recupero l'utensile associato alla lavorazione
|
||||
Dim sCurrDrilling As String = m_MainWindow.m_CurrentMachine.sCurrDrilling
|
||||
Dim ToolString As String = String.Empty
|
||||
EgtMdbSetCurrMachining(sCurrDrilling)
|
||||
' Recupero nome utensile tramite TUUID
|
||||
Dim sTuuid As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
EgtTdbGetToolFromUUID(sTuuid, ToolString)
|
||||
Dim bToolExist As Boolean = False
|
||||
For Each CurrTool As IEnumerable In DrillToolList
|
||||
If CurrTool.ToString() = ToolString Then
|
||||
bToolExist = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If bToolExist Then
|
||||
sCurrDrill = ToolString
|
||||
Else
|
||||
sCurrDrill = String.Empty
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub XcoordTxBx_EgtClosed(sender As Object, e As EventArgs) Handles XcoordTxBx.EgtClosed
|
||||
' Recupero il valore della coordinata (in 0 Tab)
|
||||
Dim dXcoord As Double = 0
|
||||
@@ -354,10 +396,11 @@ Public Class SingleDrillUC
|
||||
' Spessore grezzo
|
||||
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
|
||||
' Recupero spessore lama corrente
|
||||
Dim sDrill As String = m_MainWindow.m_CurrentMachine.sCurrDrill
|
||||
Dim sDrill As String = m_sCurrDrill
|
||||
GetDrillFromDrilling(sDrill)
|
||||
EgtTdbSetCurrTool(sDrill)
|
||||
Dim dThick As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
Dim dDiam As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dDiam)
|
||||
' Rimuovo eventuale vecchio pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
|
||||
@@ -141,72 +141,41 @@ Public Class AlzFrontUC
|
||||
|
||||
' inserisco il lato nella lista
|
||||
While CurrLine <> GDB_ID.NULL
|
||||
|
||||
Dim NextId As Integer = EgtGetNext(CurrLine)
|
||||
If NextId = GDB_ID.NULL Then NextId = EgtGetFirstInGroup(LoopId)
|
||||
If VerifySideAnglePossible(PrevLine, CurrLine, NextId, bOutLoop) Then
|
||||
' Aggiungo il lato alla lista di quelli su cui è possibile mettere una alzatina o un frontalino
|
||||
Dim sNameCurrLine As String = String.Empty
|
||||
Dim nInfo As Integer = 0
|
||||
Dim dSideAng As Integer = 0
|
||||
EgtSetName(CurrLine, "A" & nEntityIndex.ToString)
|
||||
EgtGetName(CurrLine, sNameCurrLine)
|
||||
' inserisco la numerazione dei lati della figura
|
||||
AddTextToLine(sNameCurrLine, LabelId, CurrLine, 20, m_dBBoxRad, True)
|
||||
' recupero l'informazione
|
||||
EgtGetInfo(CurrLine, INFO_ALZFRONT, nInfo)
|
||||
If nInfo = 1 Then
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.ALZATINA))
|
||||
ElseIf nInfo = 2 Then
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.FRONTALINO))
|
||||
|
||||
If ApprovedSideToAlzFront(CurrLine) Then
|
||||
' Aggiungo il lato alla lista di quelli su cui è possibile mettere una alzatina o un frontalino
|
||||
Dim sNameCurrLine As String = String.Empty
|
||||
Dim nInfo As Integer = 0
|
||||
Dim dSideAng As Integer = 0
|
||||
EgtSetName(CurrLine, "A" & nEntityIndex.ToString)
|
||||
EgtGetName(CurrLine, sNameCurrLine)
|
||||
' inserisco la numerazione dei lati della figura
|
||||
AddTextToLine(sNameCurrLine, LabelId, CurrLine, 20, m_dBBoxRad, True)
|
||||
' recupero l'informazione
|
||||
EgtGetInfo(CurrLine, INFO_ALZFRONT, nInfo)
|
||||
If nInfo = 1 Then
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.ALZATINA))
|
||||
ElseIf nInfo = 2 Then
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.FRONTALINO))
|
||||
Else
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine))
|
||||
End If
|
||||
' inserisco riferimento univoco al lato (solo se non esiste)
|
||||
Dim sInfoRef As String = String.Empty
|
||||
EgtGetInfo(CurrLine, "RefAF", sInfoRef)
|
||||
If String.IsNullOrEmpty(sInfoRef) Then
|
||||
Dim sRefGUID As String = System.Guid.NewGuid().ToString()
|
||||
EgtSetInfo(CurrLine, "RefAF", sRefGUID)
|
||||
End If
|
||||
nEntityIndex += 1
|
||||
Else
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine))
|
||||
EgtSetName(CurrLine, "B" & nOtherIndex.ToString)
|
||||
nOtherIndex = nOtherIndex + 1
|
||||
End If
|
||||
' inserisco riferimento univoco al lato (solo se non esiste)
|
||||
Dim sInfoRef As String = String.Empty
|
||||
EgtGetInfo(CurrLine, "RefAF", sInfoRef)
|
||||
If String.IsNullOrEmpty(sInfoRef) Then
|
||||
Dim sRefGUID As String = System.Guid.NewGuid().ToString()
|
||||
EgtSetInfo(CurrLine, "RefAF", sRefGUID)
|
||||
End If
|
||||
nEntityIndex += 1
|
||||
Else
|
||||
EgtSetName(CurrLine, "B" & nOtherIndex.ToString)
|
||||
nOtherIndex = nOtherIndex + 1
|
||||
End If
|
||||
|
||||
' ' escludo tutte le forme che non sono delle linee
|
||||
' If EgtGetType(CurrLine) = GDB_TY.CRV_LINE Then
|
||||
' ' Aggiungo il lato alla lista di quelli su cui è possibile mettere una alzatina o un frontalino
|
||||
' Dim sNameCurrLine As String = String.Empty
|
||||
' Dim nInfo As Integer = 0
|
||||
' Dim dSideAng As Integer = 0
|
||||
' EgtSetName(CurrLine, "A" & nEntityIndex.ToString)
|
||||
' EgtGetName(CurrLine, sNameCurrLine)
|
||||
' ' inserisco la numerazione dei lati della figura
|
||||
' AddTextToLine(sNameCurrLine, LabelId, CurrLine, 20, m_dBBoxRad, True)
|
||||
' ' recupero l'informazione
|
||||
' EgtGetInfo(CurrLine, INFO_ALZFRONT, nInfo)
|
||||
' If nInfo = 1 Then
|
||||
' AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.ALZATINA))
|
||||
' ElseIf nInfo = 2 Then
|
||||
' AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.FRONTALINO))
|
||||
' Else
|
||||
' AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine))
|
||||
' End If
|
||||
' ' inserisco riferimento univoco al lato (solo se non esiste)
|
||||
' Dim sInfoRef As String = String.Empty
|
||||
' EgtGetInfo(CurrLine, "RefAF", sInfoRef)
|
||||
' If String.IsNullOrEmpty(sInfoRef) Then
|
||||
' Dim sRefGUID As String = System.Guid.NewGuid().ToString()
|
||||
' EgtSetInfo(CurrLine, "RefAF", sRefGUID)
|
||||
' End If
|
||||
' nEntityIndex += 1
|
||||
'Else
|
||||
' EgtSetName(CurrLine, "B" & nOtherIndex.ToString)
|
||||
' nOtherIndex = nOtherIndex + 1
|
||||
'End If
|
||||
|
||||
PrevLine = CurrLine
|
||||
CurrLine = EgtGetNext(CurrLine)
|
||||
End While
|
||||
@@ -310,6 +279,44 @@ Public Class AlzFrontUC
|
||||
bInternalSelection = False
|
||||
End Sub
|
||||
|
||||
' restituisce vero se il lato possiede delle info legate al sideangle
|
||||
Private Function VerifyIsThereSideAngle(nCurrLine As Integer) As Boolean
|
||||
Dim sInfoSideAngle As String = String.Empty
|
||||
EgtGetInfo(nCurrLine, INFO_SIDE_ANGLE, sInfoSideAngle)
|
||||
If Not String.IsNullOrWhiteSpace(sInfoSideAngle) Or Not String.IsNullOrEmpty(sInfoSideAngle) Then
|
||||
' verifico che il dato salvato sia un double
|
||||
Try
|
||||
Dim dSideAngle As Double = 0
|
||||
StringToDouble(sInfoSideAngle, dSideAngle)
|
||||
If dSideAngle <> 0 Then
|
||||
Return True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' restituisce vero se il lato possiede delle info legate alle alette
|
||||
Private Function VerifyIsThereAlzFront(nCurrLine As Integer) As Boolean
|
||||
Dim sInfoAlzFront As String = String.Empty
|
||||
EgtGetInfo(nCurrLine, INFO_ALZFRONT, sInfoAlzFront)
|
||||
If Not String.IsNullOrWhiteSpace(sInfoAlzFront) Or Not String.IsNullOrEmpty(sInfoAlzFront) Then
|
||||
If sInfoAlzFront.Trim <> "0" Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' approvo la costruzione dell'aletta sul lato indicato
|
||||
Private Function ApprovedSideToAlzFront(nCurrLine As Integer) As Boolean
|
||||
If VerifyIsThereSideAngle(nCurrLine) And Not VerifyIsThereAlzFront(nCurrLine) Then
|
||||
' se esiste SideAngle e un'aletta allora NON approvo
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Permette di aggiugere accanto alla linea passata
|
||||
Friend Function AddTextToLine(sText As String, TextLayer As Integer, CurrLine As Integer, dDistance As Double,
|
||||
|
||||
@@ -105,6 +105,9 @@ Public Class DrawPageUC
|
||||
Return m_nSelectedLayer
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetCurrLayer(ByVal nCurrLayer As Integer)
|
||||
m_nSelectedLayer = nCurrLayer
|
||||
End Sub
|
||||
|
||||
Enum Pages
|
||||
MainComponent
|
||||
|
||||
@@ -75,10 +75,12 @@ Public Class SideAngleUC
|
||||
|
||||
' Inizializzo lati per angoli e per gocciolatoi (ne compilo la lista e aggiungo la scritta nel disegno)
|
||||
InitSides()
|
||||
' Aggiorno testi nel disegno e creo i gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
'' Aggiorno testi nel disegno e creo i gocciolatoi
|
||||
'RefreshSideAngleText()
|
||||
' Aggiorno check e valori
|
||||
RefreshCheckAndValue()
|
||||
' Aggiorno testi nel disegno e creo i gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
|
||||
' Gestisco visualizzazione di tutti i parametri
|
||||
If m_Mode = ModeOpt.SIDEANGLE Then
|
||||
@@ -179,6 +181,10 @@ Public Class SideAngleUC
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
||||
' Ricavo nome primo pezzo e lo sistemo
|
||||
If m_Mode = ModeOpt.ENGRAVE And m_MainWindow.m_DrawPageUC.SelectedLayer = GDB_ID.NULL Then
|
||||
PartId = EgtGetFirstPart()
|
||||
m_MainWindow.m_DrawPageUC.SetCurrLayer(EgtGetFirstNameInGroup(PartId, NAME_OUTLOOP))
|
||||
End If
|
||||
PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL)
|
||||
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
|
||||
LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer
|
||||
@@ -275,8 +281,8 @@ Public Class SideAngleUC
|
||||
' Attualmente il vaore m_nCount è inizializzato ad "1"..
|
||||
' Bottoni Prev Next
|
||||
If m_nCount <= MAX_LINES Then
|
||||
PrevBtn.Visibility = Windows.Visibility.Hidden
|
||||
NextBtn.Visibility = Windows.Visibility.Hidden
|
||||
PrevBtn.Visibility= Windows.Visibility.Hidden
|
||||
NextBtn.Visibility= Windows.Visibility.Hidden
|
||||
Else
|
||||
Grid.SetRow(PrevBtn, MAX_LINES - m_nShow)
|
||||
PrevBtn.Visibility = Windows.Visibility.Visible
|
||||
@@ -497,11 +503,10 @@ Public Class SideAngleUC
|
||||
If m_CallingPage = MainWindow.Pages.Draw Then
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
||||
' Ricavo nome primo pezzo
|
||||
PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL)
|
||||
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
|
||||
LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer
|
||||
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
||||
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
|
||||
' Recupero nome pezzo
|
||||
@@ -568,8 +573,20 @@ Public Class SideAngleUC
|
||||
' verifico se l'entità ha un gocciolatoio
|
||||
GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip
|
||||
' aggiorno i valore delle caselle di testo per le entità caricate (Start/End)
|
||||
GetAngleTxBxFromIndex(nChIndex).Text = DoubleToString(Entity.dShortStart, 1)
|
||||
GetHeelTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortStart, 1)
|
||||
If m_Mode = ModeOpt.ENGRAVE Then
|
||||
Dim dVal As Double = 0
|
||||
If StringToLen(GetPrivateProfileDouble(S_SIDES, K_ENGRAVESHORT & "A" & nIndex.ToString & "_Start", 0, m_MainWindow.GetIniFile()), dVal) Then
|
||||
Entity.dShortStart = dVal
|
||||
End If
|
||||
If StringToLen(GetPrivateProfileDouble(S_SIDES, K_ENGRAVESHORT & "A" & nIndex.ToString & "_End", 0, m_MainWindow.GetIniFile()), dVal) Then
|
||||
Entity.dShortEnd = dVal
|
||||
End If
|
||||
Else
|
||||
'GetAngleTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_Start", 0, m_MainWindow.GetIniFile())
|
||||
'GetHeelTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_End", 0, m_MainWindow.GetIniFile())
|
||||
End If
|
||||
GetAngleTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortStart, 1)
|
||||
GetHeelTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortEnd, 1)
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
<Window x:Class="ImportExportMachiningWindowWD"
|
||||
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:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
FontFamily="{DynamicResource OmagCut_Font}"
|
||||
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
|
||||
Title="SaveNameWD" Height="350" Width="426.5" ShowInTaskbar="False">
|
||||
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
|
||||
<Border Style="{DynamicResource OmagCut_Border}">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="7*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ScrollViewer Grid.Row="0" Margin="20">
|
||||
<TreeView ItemsSource="{Binding FamilyList}" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningFamily}" ItemsSource="{Binding MachiningList}">
|
||||
|
||||
<Grid Height="20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Image Grid.Column="0" Source="{Binding PictureString}" Height="20" Width="20" Margin="0,0,5,0" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="0,-2,5,0" VerticalAlignment="Center" />
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- multibinding quando sono attivi.-->
|
||||
<HierarchicalDataTemplate.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}" >
|
||||
<Setter Property="Foreground" Value="{DynamicResource OmagCut_TreeViewTextColor}" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TreeViewItem}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="19" Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Border>
|
||||
<ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1"/>
|
||||
<Rectangle Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Stretch" VerticalAlignment="Top" Fill="{DynamicResource OmagCut_TreeViewDelimiterColor}" Height="1" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsExpanded" Value="false">
|
||||
<Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource OmagCut_TreeViewSelectedItemBackground}" />
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource OmagCut_TreeViewSelectedItemBorder}"/>
|
||||
<Setter Property="BorderThickness" TargetName="Bd" Value="1"/>
|
||||
<!--<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>-->
|
||||
</Trigger>
|
||||
<!--<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="true"/>
|
||||
<Condition Property="IsSelectionActive" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
</MultiTrigger>-->
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</HierarchicalDataTemplate.ItemContainerStyle>
|
||||
</HierarchicalDataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningItem}">
|
||||
<Grid Height="20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Margin="0,8,6,4" />-->
|
||||
<CheckBox Name="ActiveTxBx" Grid.Column="0" Height="15" Width="15"
|
||||
Margin="-15,0,5,0" VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding Active}"
|
||||
Visibility="{Binding Path=DataContext.Active_Visibility,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}"
|
||||
Style="{StaticResource OmagCut_ListBoxTextBlock}" />
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
</TreeView.Resources>
|
||||
</TreeView>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Column="1" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="OkBtn" Grid.Row="0" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}"
|
||||
Margin="5,-10,5,15"
|
||||
Command="{Binding OkCommand}">
|
||||
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="ExitBtn" Grid.Row="0" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}"
|
||||
Margin="5,-10,5,15"
|
||||
IsCancel="True">
|
||||
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Window>
|
||||
@@ -0,0 +1,33 @@
|
||||
Imports EgtWPFLib5
|
||||
Public Class ImportExportMachiningWindowWD
|
||||
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
Private WithEvents m_ImportExportMachiningWindowVM As ImportExportMachiningWindowVM
|
||||
|
||||
Private m_OkResult As Boolean = False
|
||||
Public ReadOnly Property OkResult As Boolean
|
||||
Get
|
||||
Return m_OkResult
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(Owner As Window, ImportExportToolWindowVM As ImportExportMachiningWindowVM)
|
||||
Me.Owner = Owner
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = ImportExportToolWindowVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_ImportExportMachiningWindowVM = ImportExportToolWindowVM
|
||||
End Sub
|
||||
Private Sub OkCloseDialogWD() Handles OkBtn.Click
|
||||
m_OkResult = True
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub CancelCloseDialogWD() Handles ExitBtn.Click
|
||||
m_OkResult = False
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -18,7 +18,7 @@
|
||||
<ScrollViewer Grid.Row="0" Margin="20">
|
||||
<TreeView ItemsSource="{Binding FamilyList}" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:ImpExpFamily}" ItemsSource="{Binding ToolList}">
|
||||
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:ImpExpToolFamily}" ItemsSource="{Binding ToolList}">
|
||||
|
||||
<Grid Height="20">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -88,7 +88,7 @@
|
||||
</HierarchicalDataTemplate.ItemContainerStyle>
|
||||
</HierarchicalDataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpItem}">
|
||||
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpToolItem}">
|
||||
<Grid Height="20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
|
||||
@@ -5,6 +5,13 @@ Public Class ImportExportToolWD
|
||||
|
||||
Private WithEvents m_ImportExportToolWindowVM As ImportExportToolWindowVM
|
||||
|
||||
Private m_OkResult As Boolean = False
|
||||
Public ReadOnly Property OkResult As Boolean
|
||||
Get
|
||||
Return m_OkResult
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(Owner As Window, ImportExportToolWindowVM As ImportExportToolWindowVM)
|
||||
Me.Owner = Owner
|
||||
' This call is required by the designer.
|
||||
@@ -17,4 +24,15 @@ Public Class ImportExportToolWD
|
||||
'Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ImportExportToolWindowVM.m_CloseWindow
|
||||
' Me.DialogResult = bDialogResult
|
||||
'End Sub
|
||||
|
||||
Private Sub OkCloseDialogWD() Handles OkBtn.Click
|
||||
m_OkResult = True
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub CancelCloseDialogWD() Handles ExitBtn.Click
|
||||
m_OkResult = False
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -931,14 +931,16 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="11*"/>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="NewBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
|
||||
<Button Name="SaveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
|
||||
<Button Name="RemoveBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
||||
|
||||
<Button Name="ExportBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
|
||||
<Button Name="ImportBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -3,6 +3,7 @@ Imports System.ComponentModel
|
||||
Imports OmagCUT.TreeViewItem
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MachiningDbPageUC
|
||||
|
||||
@@ -78,6 +79,8 @@ Public Class MachiningDbPageUC
|
||||
NewBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 16)
|
||||
SaveBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 17)
|
||||
RemoveBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 18)
|
||||
ExportBtn.Content = "Export"
|
||||
ImportBtn.Content = "Import"
|
||||
|
||||
NameTxBl.Text = EgtMsg(MSG_MACHININGSDBPAGEUC + 1)
|
||||
DepthTxBl.Text = EgtMsg(MSG_MACHININGSDBPAGEUC + 2)
|
||||
@@ -321,6 +324,193 @@ Public Class MachiningDbPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ExportBtn_Click(Sender As Object, e As RoutedEventArgs) Handles ExportBtn.Click
|
||||
' contesto corrente
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
|
||||
' creo lista lavorazioni per esportazione
|
||||
Dim MachiningToExportList As New ObservableCollection(Of ImpExpMachiningFamily)
|
||||
Dim Family As CathegoryItem
|
||||
Dim Machining As CustomItem
|
||||
For Each Family In MachiningsList
|
||||
Dim ImpExpMachiningFamily As New ImpExpMachiningFamily(Family.Name, Family.nTType)
|
||||
For Each Machining In Family.Items
|
||||
ImpExpMachiningFamily.MachiningList.Add(New ImpExpMachiningItem(Machining.Name, False))
|
||||
Next
|
||||
MachiningToExportList.Add(ImpExpMachiningFamily)
|
||||
Next
|
||||
Dim ExportWndVM As New ImportExportMachiningWindowVM(MachiningToExportList)
|
||||
Dim ExportWnd As New ImportExportMachiningWindowWD(Application.Current.MainWindow, ExportWndVM)
|
||||
|
||||
ExportWnd.ShowDialog()
|
||||
End Sub
|
||||
|
||||
Private Sub ImoportBtn_Click() Handles ImportBtn.Click
|
||||
' contesto corrente
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
' apro dialogo di scelta file
|
||||
Dim ImportFileDlg As New Microsoft.Win32.OpenFileDialog() With {
|
||||
.Title = EgtMsg(31161) & " " & EgtMsg(31163),
|
||||
.DefaultExt = ".data",
|
||||
.Filter = "Machinings (.data)|*.data",
|
||||
.CheckFileExists = True,
|
||||
.ValidateNames = True
|
||||
}
|
||||
If ImportFileDlg.ShowDialog() <> True Then Return
|
||||
Dim ImportFilePath As String = ImportFileDlg.FileName
|
||||
' recupero liste utensili da importare
|
||||
Dim ImportFileMachiningNameList As String() = Nothing
|
||||
Dim ImportFileMachiningFamilyList As Integer() = Nothing
|
||||
If Not EgtMdbToBeImported(ImportFilePath, ImportFileMachiningNameList, ImportFileMachiningFamilyList) Then Return
|
||||
' li inserisco in lista per finestra di scelta
|
||||
Dim MachinigToImportList As New ObservableCollection(Of ImpExpMachiningFamily)
|
||||
' creo famiglie di utensili in base a quelle trovate in lista importata
|
||||
For MachiningIndex As Integer = 0 To ImportFileMachiningNameList.Count - 1
|
||||
Dim MachiningName As String = ImportFileMachiningNameList(MachiningIndex)
|
||||
Dim MachiningFamily As Integer = ImportFileMachiningFamilyList(MachiningIndex)
|
||||
MachiningFamily = MachiningFamily And
|
||||
(MCH_MY.DRILLING Or
|
||||
MCH_MY.SAWING Or
|
||||
MCH_MY.MILLING Or
|
||||
MCH_MY.POCKETING Or
|
||||
MCH_MY.MORTISING Or
|
||||
MCH_MY.SAWROUGHING Or
|
||||
MCH_MY.SAWFINISHING Or
|
||||
MCH_MY.GENMACHINING Or
|
||||
MCH_MY.CHISELING Or
|
||||
MCH_MY.SURFROUGHING Or
|
||||
MCH_MY.SURFFINISHING Or
|
||||
MCH_MY.WATERJETTING)
|
||||
Dim bFounded As Boolean = False
|
||||
Dim MachinigToImportFamily As ImpExpMachiningFamily
|
||||
For Each MachinigToImportFamily In MachinigToImportList
|
||||
If (MachiningFamily = MachinigToImportFamily.FamilyType) Then
|
||||
MachinigToImportFamily.MachiningList.Add(New ImpExpMachiningItem(MachiningName, AlreadyExist(MachiningName)))
|
||||
bFounded = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not bFounded Then
|
||||
Dim NewFamily As New ImpExpMachiningFamily(GetMachiningFamilyName(MachiningFamily), MachiningFamily)
|
||||
NewFamily.MachiningList.Add(New ImpExpMachiningItem(MachiningName, AlreadyExist(MachiningName)))
|
||||
MachinigToImportList.Add(NewFamily)
|
||||
End If
|
||||
Next
|
||||
Dim ImportWndVM As New ImportExportMachiningWindowVM(MachinigToImportList, ImportFilePath, ImportFileMachiningNameList)
|
||||
Dim ImportWnd As New ImportExportMachiningWindowWD(Application.Current.MainWindow, ImportWndVM)
|
||||
|
||||
ImportWnd.ShowDialog()
|
||||
' Aggiungo all'albero visualizzato gli utensili appena importati
|
||||
If ImportWnd.OkResult Then
|
||||
LoadImportedMachineMachinings(ImportWndVM.vsImported)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function AlreadyExist(MachiningName As String) As Boolean
|
||||
Dim MachiningFamily As CathegoryItem
|
||||
For Each MachiningFamily In MachiningsList
|
||||
Dim MachiningItem As CustomItem
|
||||
For Each MachiningItem In MachiningFamily.Items
|
||||
If MachiningName = MachiningItem.Name Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function GetMachiningFamilyName(NewMachinigFamily As Integer) As String
|
||||
Dim MachiningFamily As CathegoryItem
|
||||
For Each MachiningFamily In MachiningsList
|
||||
If NewMachinigFamily = MachiningFamily.nTType Then
|
||||
Return MachiningFamily.Name
|
||||
End If
|
||||
Next
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
Private Sub LoadImportedMachineMachinings(vsImportedMachinings As String())
|
||||
' Leggo tutte le lavorazioni presenti nella Macchina (quindi anche quelli appena importati).
|
||||
Dim ActiveMachiningsFamilies() As MachiningsType = MyReadMachiningFamilies(m_MainWindow.m_CurrentMachine.sMachIniFile)
|
||||
Dim MachiningsFamilyIndex As Integer = 0
|
||||
Dim MachiningsFamilyItem As MachiningsType
|
||||
For Each MachiningsFamilyItem In ActiveMachiningsFamilies
|
||||
Dim FamilyTreeView As New CathegoryItem(MachiningsFamilyItem.Name, MachiningsFamilyItem.Id)
|
||||
Dim MachiningFamilyItem = MachiningsList.FirstOrDefault(Function(MachiningFamily) MachiningsFamilyItem.Id = MachiningFamily.nTType)
|
||||
If IsNothing(MachiningFamilyItem) Then
|
||||
MachiningsList.Insert(MachiningsFamilyIndex, FamilyTreeView)
|
||||
End If
|
||||
Dim nType As Integer = 0
|
||||
Dim MachiningName As String = String.Empty
|
||||
Dim MachiningIndex As Integer = 0
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
Dim bFound As Boolean = EgtMdbGetFirstMachining(MachiningsFamilyItem.Id, MachiningName)
|
||||
While bFound
|
||||
Dim MachiningItem = MachiningsList(MachiningsFamilyIndex).Items.FirstOrDefault(Function(Machining) Machining.Name = MachiningName)
|
||||
Dim bInList As Boolean = vsImportedMachinings.Contains(MachiningName)
|
||||
If bInList Then
|
||||
' Se una lavorazione è presente nella MachiningsList visualizzata ma nel contempo è nell'array vsImported
|
||||
' vuol dire che è stata sovrascritta perciò la rimuovo
|
||||
MachiningsList(MachiningsFamilyIndex).Items.Remove(MachiningsList(MachiningsFamilyIndex).Items.FirstOrDefault(Function(Machining) Machining.Name = MachiningName))
|
||||
End If
|
||||
If bInList OrElse IsNothing(MachiningItem) Then
|
||||
' recupero tuuid
|
||||
EgtMdbSetCurrMachining(MachiningName)
|
||||
Dim sCurrMachTUUID As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sCurrMachTUUID)
|
||||
' aggiungo la lavorazione importata
|
||||
MachiningsList(MachiningsFamilyIndex).Items.Insert(MachiningIndex, New CustomItem(MachiningName, MachiningsFamilyItem.Id, ToolDbUtility.IsToolInDb(sCurrMachTUUID)))
|
||||
' eventualmente evidezio l'ultimo elemento inserito (ERRORE: non espando l'albero)
|
||||
'MachiningsList(MachiningsFamilyIndex).Items(MachiningIndex).IsSelected = True
|
||||
End If
|
||||
MachiningIndex += 1
|
||||
bFound = EgtMdbGetNextMachining(MachiningsFamilyItem.Id, MachiningName)
|
||||
End While
|
||||
MachiningsFamilyIndex += 1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Function MyReadMachiningFamilies(sMachineIniPath As String) As MachiningsType()
|
||||
Dim ActiveMachiningsFamiliesList As New List(Of MachiningsType)
|
||||
' Se il materiale lavorato è Marmo l'ordine di lettura e inserimento di Foratura e Taglio di lama nelle famiglie di lavorazioni attive è invertito
|
||||
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.SAWING, .Name = EgtMsg(31200 + 2)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_DRILLING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.DRILLING, .Name = EgtMsg(31200 + 1)})
|
||||
End If
|
||||
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_MILLING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.MILLING, .Name = EgtMsg(31200 + 3)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_POCKETING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.POCKETING, .Name = EgtMsg(31200 + 4)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_MORTISING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.MORTISING, .Name = EgtMsg(31200 + 5)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWROUGHING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.SAWROUGHING, .Name = EgtMsg(31200 + 6)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWFINISHING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.SAWFINISHING, .Name = EgtMsg(31200 + 7)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_GENMACHINING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.GENMACHINING, .Name = EgtMsg(31200 + 8)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_CHISELING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.CHISELING, .Name = EgtMsg(31200 + 9)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SURFFINISHING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.SURFFINISHING, .Name = EgtMsg(31211)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_WATERJETTING, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.WATERJETTING, .Name = EgtMsg(31210)})
|
||||
End If
|
||||
Return ActiveMachiningsFamiliesList.ToArray
|
||||
End Function
|
||||
|
||||
Private Sub InitializeMachiningFamily(bEnabled As Boolean, nFType As Integer, sFName As String)
|
||||
If Not bEnabled Then Return
|
||||
' Inserisco categoria ed eventuali elementi
|
||||
|
||||
@@ -434,17 +434,16 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="9*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="NewBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
|
||||
<Button Name="SaveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
|
||||
<Button Name="RemoveBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
||||
<Button Name="ExportBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
||||
<Button Name="ImportBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
||||
<Button Name="ExportBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
||||
<Button Name="ImportBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -177,8 +177,8 @@ Public Class ToolsDbPageUC
|
||||
End If
|
||||
' Verifico se macchina con nuovo SawbladeMaker
|
||||
Dim sSawBladeMaker As String = ""
|
||||
GetPrivateProfileString( S_TOOLS, K_SAWBLADEMAKER, "", sSawBladeMaker, m_MainWindow.GetIniFile())
|
||||
m_bNewSawbladeMaker = String.Compare( sSawBladeMaker, "MakeStoneSawBlade.lua", True)
|
||||
GetPrivateProfileString(S_TOOLS, K_SAWBLADEMAKER, "", sSawBladeMaker, m_MainWindow.GetIniFile())
|
||||
m_bNewSawbladeMaker = String.Compare(sSawBladeMaker, "MakeStoneSawBlade.lua", True)
|
||||
m_bFirst = False
|
||||
Else
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
@@ -493,17 +493,17 @@ Public Class ToolsDbPageUC
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
|
||||
' creo lista utensili per esportazione
|
||||
Dim ToolToExportList = New ObservableCollection(Of ImpExpFamily)
|
||||
Dim ToolToExportList = New ObservableCollection(Of ImpExpToolFamily)
|
||||
Dim Family As CathegoryItem
|
||||
Dim Tool As CustomItem
|
||||
For Each Family In ToolsList
|
||||
Dim ImpExpFamily As New ImpExpFamily(Family.Name, Family.nTType)
|
||||
ImpExpFamily.PictureString = "/Resources/ToolsTreeviewImages/Folder.png"
|
||||
Dim ImpExpToolFamily As New ImpExpToolFamily(Family.Name, Family.nTType)
|
||||
ImpExpToolFamily.PictureString = "/Resources/ToolsTreeviewImages/Folder.png"
|
||||
For Each Tool In Family.Items
|
||||
Dim CurrTool = New ImpExpItem(Tool.Name, False)
|
||||
ImpExpFamily.ToolList.Add(CurrTool)
|
||||
Dim CurrTool = New ImpExpToolItem(Tool.Name, False)
|
||||
ImpExpToolFamily.ToolList.Add(CurrTool)
|
||||
Next
|
||||
ToolToExportList.Add(ImpExpFamily)
|
||||
ToolToExportList.Add(ImpExpToolFamily)
|
||||
Next
|
||||
|
||||
Dim ExportWndVM As New ImportExportToolWindowVM(ToolToExportList)
|
||||
@@ -528,9 +528,9 @@ Public Class ToolsDbPageUC
|
||||
' recupero liste utensili da importare
|
||||
Dim ImportFileToolNameList As String() = Nothing
|
||||
Dim ImportFileToolFamilyList As Integer() = Nothing
|
||||
EgtTdbToBeImported(ImportFilePath, ImportFileToolNameList, ImportFileToolFamilyList)
|
||||
If Not EgtTdbToBeImported(ImportFilePath, ImportFileToolNameList, ImportFileToolFamilyList) Then Return
|
||||
' li inserisco in lista per finestra di scelta
|
||||
Dim ToolToImportList As New ObservableCollection(Of ImpExpFamily)
|
||||
Dim ToolToImportList As New ObservableCollection(Of ImpExpToolFamily)
|
||||
' creo famiglie di utensili in base a quelle trovate in lista importata
|
||||
For ToolIndex As Integer = 0 To ImportFileToolNameList.Count - 1
|
||||
Dim ToolName As String = ImportFileToolNameList(ToolIndex)
|
||||
@@ -544,25 +544,26 @@ Public Class ToolsDbPageUC
|
||||
MCH_TF.WATERJET Or
|
||||
MCH_TF.COMPO)
|
||||
Dim bFounded As Boolean = False
|
||||
Dim ToolToImportFamily As ImpExpFamily
|
||||
Dim ToolToImportFamily As ImpExpToolFamily
|
||||
For Each ToolToImportFamily In ToolToImportList
|
||||
If (ToolFamily = ToolToImportFamily.FamilyType) Then
|
||||
ToolToImportFamily.ToolList.Add(New ImpExpItem(ToolName, AlreadyExist(ToolName)))
|
||||
ToolToImportFamily.ToolList.Add(New ImpExpToolItem(ToolName, AlreadyExist(ToolName)))
|
||||
bFounded = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not bFounded Then
|
||||
Dim NewFamily As New ImpExpFamily(GetToolFamilyName(ToolFamily), ToolFamily)
|
||||
NewFamily.ToolList.Add(New ImpExpItem(ToolName, AlreadyExist(ToolName)))
|
||||
Dim NewFamily As New ImpExpToolFamily(GetToolFamilyName(ToolFamily), ToolFamily)
|
||||
NewFamily.ToolList.Add(New ImpExpToolItem(ToolName, AlreadyExist(ToolName)))
|
||||
ToolToImportList.Add(NewFamily)
|
||||
End If
|
||||
Next
|
||||
Dim ImportWndVM As New ImportExportToolWindowVM(ToolToImportList, ImportFilePath, ImportFileToolNameList)
|
||||
Dim ImportWnd As New ImportExportToolWD(Application.Current.MainWindow, ImportWndVM)
|
||||
|
||||
If ImportWnd.ShowDialog() Then
|
||||
' Aggiungo all'albero visualizzato gli utensili appena importati
|
||||
ImportWnd.ShowDialog()
|
||||
' Aggiungo all'albero visualizzato gli utensili appena importati
|
||||
If ImportWnd.OkResult Then
|
||||
LoadImportedMachineTools(ImportWndVM.vsImported)
|
||||
End If
|
||||
End Sub
|
||||
@@ -592,31 +593,38 @@ Public Class ToolsDbPageUC
|
||||
|
||||
Private Sub LoadImportedMachineTools(vsImportedTools As String())
|
||||
' Leggo tutti gli utensili presenti nella Macchina (quindi anche quelli appena importati).
|
||||
Dim ActiveToolsFamilies() As ToolsFamily = MachineUtility.ReadToolFamilies(m_CurrMachine.sMachIniFile)
|
||||
Dim ActiveToolsFamilies() As ToolsFamily = MyReadToolFamilies(m_CurrMachine.sMachIniFile)
|
||||
Dim ToolsFamilyIndex As Integer = 0
|
||||
Dim ToolsFamilyItem As ToolsFamily
|
||||
For Each ToolsFamilyItem In ActiveToolsFamilies
|
||||
' dalla lista che ho ricavato dalla libreria recupero gli utensili associati
|
||||
Dim FamilyTreeView As New CathegoryItem(ToolsFamilyItem.Name, ToolsFamilyItem.Id)
|
||||
Dim ToolFamilyItem = ToolsList.FirstOrDefault(Function(ToolFamily) ToolsFamilyItem.Id = FamilyTreeView.nTType)
|
||||
Dim ToolFamilyItem = ToolsList.FirstOrDefault(Function(ToolFamily) ToolFamily.nTType = ToolsFamilyItem.Id)
|
||||
If IsNothing(ToolFamilyItem) Then
|
||||
ToolsList.Insert(ToolsFamilyIndex, FamilyTreeView)
|
||||
Else
|
||||
' ricerco l'indice nella lista Tools
|
||||
|
||||
End If
|
||||
Dim nType As Integer = 0
|
||||
Dim ToolName As String = String.Empty
|
||||
Dim ToolIndex As Integer = 0
|
||||
EgtSetCurrentContext(ToolScene.GetCtx())
|
||||
'EgtSetCurrentContext(ToolScene.GetCtx())
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
If EgtTdbGetFirstTool(ToolsFamilyItem.Id, ToolName, nType) Then
|
||||
Dim ToolItem = ToolsList(ToolsFamilyIndex).Items.FirstOrDefault(Function(Tool) Tool.Name = ToolName)
|
||||
If IsNothing(ToolItem) Then
|
||||
' Se leggo un utensile non presente nella ToolsList visualizzata lo aggiungo ad essa.
|
||||
Dim NewToolName As New CustomItem(ToolName, nType)
|
||||
ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName)
|
||||
'NewToolName.IsSelected = True
|
||||
ElseIf vsImportedTools.Contains(ToolName) Then
|
||||
' Se un utensile è presente nella ToolsList visualizzata ma nel contempo è nell'array vsImported
|
||||
' vuol dire che è stato sovrascritto perciò lo rimuovo e lo riaggiungo alla ToolsList.
|
||||
ToolsList(ToolsFamilyIndex).Items.Remove(ToolsList(ToolsFamilyIndex).Items.FirstOrDefault(Function(Tool) Tool.Name = ToolName))
|
||||
Dim NewToolName As New CustomItem(ToolName, nType)
|
||||
ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName)
|
||||
'NewToolName.IsSelected = True
|
||||
End If
|
||||
ToolIndex += 1
|
||||
While EgtTdbGetNextTool(ToolsFamilyItem.Id, ToolName, nType)
|
||||
@@ -625,20 +633,60 @@ Public Class ToolsDbPageUC
|
||||
' Se leggo un utensile non presente nella ToolsList visualizzata lo aggiungo ad essa.
|
||||
Dim NewToolName As New CustomItem(ToolName, nType)
|
||||
ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName)
|
||||
'NewToolName.IsSelected = True
|
||||
ElseIf vsImportedTools.Contains(ToolName) Then
|
||||
' Se un utensile è presente nella ToolsList visualizzata ma nel contempo è nell'array vsImported
|
||||
' vuol dire che è stato sovrascritto perciò lo rimuovo e lo riaggiungo alla ToolsList.
|
||||
ToolsList(ToolsFamilyIndex).Items.Remove(ToolsList(ToolsFamilyIndex).Items.FirstOrDefault(Function(Tool) Tool.Name = ToolName))
|
||||
Dim NewToolName As New CustomItem(ToolName, nType)
|
||||
ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName)
|
||||
'NewToolName.IsSelected = True
|
||||
End If
|
||||
ToolIndex += 1
|
||||
End While
|
||||
End If
|
||||
ToolsFamilyIndex += 1
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function MyReadToolFamilies(sMachineIniPath As String) As ToolsFamily()
|
||||
Dim ActiveToolsFamiliesList As New List(Of ToolsFamily)
|
||||
|
||||
' Se il materiale lavorato è Marmo l'ordine di lettura e inserimento di Punta e Lama nelle famiglie di utensili attivi è invertito
|
||||
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_SAWBLADE, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.SAWBLADE, EgtMsg(31000 + 2)))
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_DRILLBIT, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.DRILLBIT, EgtMsg(31000 + 1)))
|
||||
End If
|
||||
|
||||
|
||||
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_MILL, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.MILL, EgtMsg(31000 + 3)))
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_TOOLS, "CupWheel", 0, sMachineIniPath) <> 0 Then
|
||||
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.MILL, EgtMsg(90754)))
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_TOOLS, "PolishingWheel", 0, sMachineIniPath) <> 0 Then
|
||||
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.MILL, EgtMsg(90756)))
|
||||
End If
|
||||
|
||||
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_MORTISE, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.MORTISE, EgtMsg(31000 + 4)))
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_CHISEL, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.CHISEL, EgtMsg(31000 + 9)))
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_COMPO, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.COMPO, EgtMsg(31000 + 5)))
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_WATERJET, 0, sMachineIniPath) <> 0 Then
|
||||
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.WATERJET, EgtMsg(31010)))
|
||||
End If
|
||||
Return ActiveToolsFamiliesList.ToArray
|
||||
End Function
|
||||
|
||||
Friend Sub InitializeToolGroup(bEnabled As Boolean, nTType As Integer, sFName As String)
|
||||
If Not bEnabled Then Return
|
||||
' Inserisco categoria ed eventuali elementi
|
||||
@@ -1035,7 +1083,7 @@ Public Class ToolsDbPageUC
|
||||
Dim dCore, dTh As Double
|
||||
If EgtTdbGetCurrToolParam(MCH_TP.CORE, dCore) AndAlso
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dTh) Then
|
||||
Dim dL As Double = Math.Max( dVal, 0.0) + ((dCore + dTh) / 2)
|
||||
Dim dL As Double = Math.Max(dVal, 0.0) + ((dCore + dTh) / 2)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, dL + 1)
|
||||
Return EgtTdbSetCurrToolParam(MCH_TP.LEN, dL)
|
||||
Else
|
||||
@@ -1122,7 +1170,7 @@ Public Class ToolsDbPageUC
|
||||
Dim dToolCore As Double
|
||||
EgtTdbGetCurrToolParam(MCH_TP.CORE, dToolCore)
|
||||
If dToolCore < EPS_SMALL Then
|
||||
dToolCore = If( dToolLen >= dToolThick, dToolThick - 1, 2 * dToolLen - dToolThick)
|
||||
dToolCore = If(dToolLen >= dToolThick, dToolThick - 1, 2 * dToolLen - dToolThick)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.CORE, dToolCore)
|
||||
EgtOutLog("ToolCore too small ->" & DoubleToString(dToolCore, 1))
|
||||
End If
|
||||
|
||||
+2
-2
@@ -323,8 +323,8 @@ Class MainWindow
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2310, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2310, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2312, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2312, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
|
||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.3.10.4")>
|
||||
<Assembly: AssemblyFileVersion("2.3.10.4")>
|
||||
<Assembly: AssemblyVersion("2.3.12.1")>
|
||||
<Assembly: AssemblyFileVersion("2.3.12.1")>
|
||||
|
||||
@@ -11,6 +11,8 @@ Public Class CNCommunication
|
||||
Private m_AlarmsPage As AlarmsPageUC = m_MainWindow.m_MachinePageUC.m_AlarmsPageUC
|
||||
Private m_CurrProjPage As CurrentProjectPageUC = m_MainWindow.m_CurrentProjectPageUC
|
||||
|
||||
Friend m_nCountRefresh As Integer = 0
|
||||
|
||||
' Variabile per tipologia CN
|
||||
Friend m_nNCType As Integer
|
||||
|
||||
@@ -379,6 +381,7 @@ Public Class CNCommunication
|
||||
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
|
||||
Process.Start(m_sCNSiemensHMIPath, sArg)
|
||||
m_CN.m_IsSiemensOne = GetPrivateProfileInt(S_NCSIEMENS, K_ISSIEMENSONE, 0, m_MainWindow.GetMachIniFile()) > 0
|
||||
m_CN.m_IsActiveModeSubscription = GetPrivateProfileInt(S_NCSIEMENS, K_ISACTIVEMODESUBSCR, 0, m_MainWindow.GetMachIniFile()) > 0
|
||||
If m_CN.m_IsSiemensOne Then
|
||||
' stati bottoni parte 1
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.Laser), VarType.TInteger, 0)
|
||||
@@ -395,6 +398,8 @@ Public Class CNCommunication
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.SpeedOvr), VarType.TDouble, 1)
|
||||
|
||||
GetPrivateProfileString(S_NCSIEMENS, K_DBVARPATH, "", m_CN.m_DbVarPath, m_MainWindow.GetMachIniFile)
|
||||
ElseIf m_CN.m_IsActiveModeSubscription Then
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.BlowState), VarType.TInteger, 3)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error starting Process -> NcLink=True type=0")
|
||||
@@ -698,12 +703,17 @@ Public Class CNCommunication
|
||||
m_MachineStatus.DisplayVar()
|
||||
'EgtOutLog("Modo attivato: " & m_CN.read_active_mode & " modo attivo: " & m_nCurrMode)
|
||||
|
||||
Dim TempCurrMode As Short = m_CN.read_active_mode()
|
||||
'EgtOutLog("Machine status: " & TempCurrMode)
|
||||
If TempCurrMode <> m_nCurrMode Then
|
||||
'EgtOutLog("Modo attivo: " & m_CN.read_active_mode)
|
||||
m_nCurrMode = CInt(TempCurrMode)
|
||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||
If m_nCountRefresh > 10 Then
|
||||
Dim TempCurrMode As Short = m_CN.read_active_mode()
|
||||
'EgtOutLog("Machine status: " & TempCurrMode)
|
||||
If TempCurrMode <> m_nCurrMode Then
|
||||
'EgtOutLog("Modo attivo: " & m_CN.read_active_mode)
|
||||
m_nCurrMode = CInt(TempCurrMode)
|
||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||
End If
|
||||
m_nCountRefresh = 0
|
||||
Else
|
||||
m_nCountRefresh = m_nCountRefresh + 1
|
||||
End If
|
||||
|
||||
If m_CN.b_NC_error Then
|
||||
|
||||
@@ -131,7 +131,7 @@ Public Class CN_Siemens
|
||||
|
||||
Public Overrides Function read_active_mode() As Short
|
||||
'EgtOutLog("Modo attivo: " & M_MMFiles.SiemensRet.n_param2)
|
||||
If m_IsSiemensOne Then
|
||||
If m_IsSiemensOne Or m_IsActiveModeSubscription Then
|
||||
Select Case n_data(3)
|
||||
Case 1
|
||||
Return 0
|
||||
@@ -144,7 +144,7 @@ Public Class CN_Siemens
|
||||
End Select
|
||||
Else
|
||||
' per verificare che la comunicazione funzioni correttamente
|
||||
'EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
|
||||
EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
|
||||
Return M_MMFiles.read_active_mode()
|
||||
'Return CShort(M_MMFiles.SiemensRet.n_param2)
|
||||
End If
|
||||
|
||||
@@ -88,6 +88,8 @@ Public MustInherit Class CN_generico
|
||||
#Region " Interface"
|
||||
|
||||
Friend m_IsSiemensOne As Boolean = False
|
||||
Friend m_IsActiveModeSubscription As Boolean = False
|
||||
|
||||
Friend m_DbVarPath As String = ""
|
||||
|
||||
Public IsFlexiumPlus As Boolean = False
|
||||
|
||||
+20
-20
@@ -476,6 +476,7 @@ Module M_MMFiles
|
||||
SiemensSend.n_param1 = nChannel
|
||||
|
||||
execute_command()
|
||||
|
||||
'EgtOutLog("MDI_command end dell'm_mmFiles")
|
||||
Return SiemensRet.n_result
|
||||
|
||||
@@ -614,7 +615,6 @@ Module M_MMFiles
|
||||
'----------------------------------------------------------------------------------------------------------
|
||||
'
|
||||
Sub execute_command()
|
||||
|
||||
Try
|
||||
' Attesa eventuale busy iniziale
|
||||
Dim nCount As Integer = 0
|
||||
@@ -641,25 +641,25 @@ Module M_MMFiles
|
||||
bEnd = False
|
||||
While Not bEnd
|
||||
Select Case nState
|
||||
Case State.Command_on ' alzato il comando attendo il busy
|
||||
If SiemensRet.b_busy Then
|
||||
nState = State.Busy_On
|
||||
Else
|
||||
System.Threading.Thread.Sleep(50)
|
||||
End If
|
||||
Case State.Busy_On ' trovato il busy abbasso il comando
|
||||
SiemensSend.n_Flag = COMMAND_OFF ' abbasso il comando
|
||||
' scrivo !!!!!
|
||||
Marshal.StructureToPtr(SiemensSend, pView, False)
|
||||
nState = State.Command_off
|
||||
Case State.Command_off ' abbassato il comando attendo il busy basso
|
||||
If SiemensRet.b_busy Then
|
||||
System.Threading.Thread.Sleep(50)
|
||||
Else
|
||||
nState = State.Busy_Off
|
||||
End If
|
||||
Case State.Busy_Off
|
||||
bEnd = True
|
||||
Case State.Command_on ' alzato il comando attendo il busy
|
||||
If SiemensRet.b_busy Then
|
||||
nState = State.Busy_On
|
||||
Else
|
||||
System.Threading.Thread.Sleep(50)
|
||||
End If
|
||||
Case State.Busy_On ' trovato il busy abbasso il comando
|
||||
SiemensSend.n_Flag = COMMAND_OFF ' abbasso il comando
|
||||
' scrivo !!!!!
|
||||
Marshal.StructureToPtr(SiemensSend, pView, False)
|
||||
nState = State.Command_off
|
||||
Case State.Command_off ' abbassato il comando attendo il busy basso
|
||||
If SiemensRet.b_busy Then
|
||||
System.Threading.Thread.Sleep(50)
|
||||
Else
|
||||
nState = State.Busy_Off
|
||||
End If
|
||||
Case State.Busy_Off
|
||||
bEnd = True
|
||||
End Select
|
||||
' controllo massimo numero di cicli
|
||||
nCount += 1
|
||||
|
||||
+9
-7
@@ -1578,14 +1578,16 @@ Namespace Num
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub DPlcVariables_WriteVariables(sz_var_names As String, sz_values As String)
|
||||
Try
|
||||
Dim shortNumber As Short = CShort(sz_values)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Errore di conversione dato: " & sz_var_names)
|
||||
EgtOutLog(ex.ToString)
|
||||
Dim value As Short = 0
|
||||
If Not Short.TryParse(sz_values, value) Then
|
||||
If Not IsNothing( sz_values) then
|
||||
EgtOutLog("Write variable: " & sz_var_names & ", value:" & sz_values & " failed!")
|
||||
Else
|
||||
EgtOutLog("Write variable: " & sz_var_names & ", value:nothing failed!")
|
||||
End If
|
||||
Return
|
||||
End Try
|
||||
Dim _ret As Short = objDPlcVariables.WriteVariables(sz_var_names, CShort(sz_values))
|
||||
End If
|
||||
Dim _ret As Short = objDPlcVariables.WriteVariables(sz_var_names, value)
|
||||
If _ret <> 0 Then
|
||||
EgtOutLog("Scrittura " & sz_var_names & " fallita")
|
||||
Else
|
||||
|
||||
@@ -196,6 +196,9 @@
|
||||
<DependentUpon>CadCutPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CAM\CamAuto.vb" />
|
||||
<Compile Include="Machine\ImportExportMachiningWindowWD.xaml.vb">
|
||||
<DependentUpon>ImportExportMachiningWindowWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Machine\ImportExportToolWD.xaml.vb">
|
||||
<DependentUpon>ImportExportToolWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -434,6 +437,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Machine\ImportExportMachiningWindowWD.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Machine\ImportExportToolWD.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
|
||||
@@ -50,6 +50,7 @@ Namespace TreeViewItem
|
||||
Private m_sPictureString As String
|
||||
Private m_nTType As Integer
|
||||
Private m_Items As ObservableCollection(Of CustomItem)
|
||||
Friend m_IsValidTool As Boolean
|
||||
|
||||
Public ReadOnly Property PictureString As String
|
||||
Get
|
||||
@@ -86,12 +87,13 @@ Namespace TreeViewItem
|
||||
'Private m_sTitle As String
|
||||
Private m_nType As Integer
|
||||
|
||||
'Private m_sName As String
|
||||
'Public Property Name As String
|
||||
' Get
|
||||
' Return m_sTitle
|
||||
' Return m_sName
|
||||
' End Get
|
||||
' Set(value As String)
|
||||
' m_sTitle = value
|
||||
' m_sName = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
@@ -101,11 +103,31 @@ Namespace TreeViewItem
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend m_IsValidTool As Boolean = True
|
||||
|
||||
Public Property IsValidTool As Boolean
|
||||
Get
|
||||
Return m_IsValidTool
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value <> m_IsValidTool Then
|
||||
m_IsValidTool = value
|
||||
NotifyPropertyChanged("ToolColor")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Title As String, nType As Integer)
|
||||
Me.Name = Title
|
||||
m_nType = nType
|
||||
End Sub
|
||||
|
||||
Sub New(sName As String, nType As Integer, bIsValidTool As Boolean)
|
||||
MyBase.Name = sName
|
||||
m_nType = nType
|
||||
m_IsValidTool = bIsValidTool
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class PartCathegoryItem
|
||||
|
||||
@@ -9,7 +9,8 @@ Public Class OptionsPageUC
|
||||
Private UnitsList() As String = {"inch", "mm"}
|
||||
Private ThemesList() As String = {"Classic", "Dark"}
|
||||
|
||||
Private StartLauncherList() As String = {"Last Project", "New Project", "Open Folder", "Show Window"}
|
||||
' "Last Project", "New Project", "Open Folder", "Show Window"
|
||||
Private StartLauncherList() As String = {EgtMsg(91013), EgtMsg(91014), EgtMsg(91015), EgtMsg(91016)}
|
||||
|
||||
Private Sub OptionsPageUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
|
||||
@@ -109,7 +110,7 @@ Public Class OptionsPageUC
|
||||
ToleranceEMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 21)
|
||||
AffondamentoMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 27)
|
||||
LarghezzaMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 28)
|
||||
StartLauncherGpBx.Header = "Avvio Programma"
|
||||
StartLauncherGpBx.Header = EgtMsg(91009)
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateSlabDxf()
|
||||
|
||||
@@ -457,7 +457,7 @@ Public Class ProjectMgrUC
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
' Se macchina normale
|
||||
If Not m_CurrMachine.bProdLine Or Not m_CurrMachine.bDemo Then
|
||||
If Not (m_CurrMachine.bProdLine Or m_CurrMachine.bDemo) Then
|
||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||
If m_CurrNcComm.SendProgram(sCncPath, 900) Then
|
||||
' copio il progetto corrente come progetto in lavorazione
|
||||
|
||||
@@ -111,9 +111,12 @@ Public Class StartLauncherWD
|
||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||
|
||||
' imopposto il messaggio di avvio
|
||||
SlectLauncherTxbl.Text = "Seleziona modalità di avvio"
|
||||
FileName.Text = "Progetti recenti"
|
||||
DataFile.Text = "Ultima apertura"
|
||||
SlectLauncherTxbl.Text = EgtMsg(91010) ' Seleziona modalità di avvio
|
||||
FileName.Text = EgtMsg(91011) ' Progetti recenti
|
||||
DataFile.Text = EgtMsg(91012) ' Ultima apertura
|
||||
LastProject.ToolTip = EgtMsg(91013)
|
||||
NewProject.ToolTip = EgtMsg(91014)
|
||||
OpenFolder.ToolTip = EgtMsg(91015)
|
||||
End Sub
|
||||
|
||||
' lancio l'apertura della pagina dei progetti
|
||||
|
||||
+112
-12
@@ -41,6 +41,7 @@ Public Class RawPartPageUC
|
||||
Private m_RawOffsX As Double = 0
|
||||
Private m_RawOffsY As Double = 0
|
||||
Private m_RawKerf As Double = 0
|
||||
Private m_PrecKerf As Double = 0
|
||||
' Layer per crocette temporanee
|
||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||
' Definizione lista modalità di definizione grezzo per ComboBox
|
||||
@@ -234,6 +235,7 @@ Public Class RawPartPageUC
|
||||
m_RawOffsX = GetPrivateProfileDouble(S_RAWPART, K_RAWOFFSX, 100, m_MainWindow.GetIniFile())
|
||||
m_RawOffsY = GetPrivateProfileDouble(S_RAWPART, K_RAWOFFSY, 100, m_MainWindow.GetIniFile())
|
||||
m_RawKerf = GetPrivateProfileDouble(S_RAWPART, K_RAWKERF, 50, m_MainWindow.GetIniFile())
|
||||
m_PrecKerf = m_RawKerf
|
||||
' Richiedo ricalcolo quota eventuale foto
|
||||
UpdateRawPart(True)
|
||||
' Eventuale gestione dati lastra
|
||||
@@ -270,7 +272,14 @@ Public Class RawPartPageUC
|
||||
m_ActiveRawMode = RAWMODE.RECTANGLE
|
||||
RawModeCmBx.SelectedIndex = RAWMODE.RECTANGLE
|
||||
PointsGpBx.Visibility = Windows.Visibility.Hidden
|
||||
AdjustRawPartPosition()
|
||||
If dInvertKerf < 1 Then
|
||||
AdjustRawPartPositionNegativeKerf()
|
||||
' assegno il giosto colore al kerf
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
EgtSetColor(nKerfId, m_KerfCol)
|
||||
Else
|
||||
AdjustRawPartPosition()
|
||||
End If
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
' Imposto il materiale corrente nella combobox
|
||||
@@ -1171,6 +1180,8 @@ Public Class RawPartPageUC
|
||||
' box grezzo
|
||||
Dim ptMin, ptMax As Point3d
|
||||
GetRawBox(ptMin, ptMax)
|
||||
Dim Lenght As Double = ptMax.x - ptMin.x
|
||||
Dim Width As Double = ptMax.y - ptMin.y
|
||||
ptMin.x += m_RawKerf
|
||||
ptMin.y += m_RawKerf
|
||||
ptMin.z = ptMax.z
|
||||
@@ -1185,6 +1196,41 @@ Public Class RawPartPageUC
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#Region "Negative Kerf"
|
||||
|
||||
Private Function AdjustRawPartNegativeKerf(Optional NegativeOffset As Boolean = True) As Boolean
|
||||
' Se non c'è il grezzo, esco
|
||||
If m_CurrProjPage.m_nRawId = GDB_ID.NULL Then Return False
|
||||
' Cancello eventuale vecchio contorno di kerf
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
Dim nInvert As Double = 1
|
||||
If Not NegativeOffset Then
|
||||
nInvert = -1
|
||||
End If
|
||||
EgtOffsetCurve(nKerfId, (-m_RawKerf - m_PrecKerf) * nInvert, OFF_TYPE.EXTEND)
|
||||
EgtSetColor(nKerfId, m_KerfCol)
|
||||
' Salvo il valore del kerf (sempre in mm)
|
||||
EgtSetInfo(m_CurrProjPage.m_nRawId, KEY_KERF, m_RawKerf)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function AdjustRawPartPositionNegativeKerf() As Boolean
|
||||
' Sistemo la posizione
|
||||
Dim ptRef As New Point3d(m_RawOffsX, m_RawOffsY, m_CurrentMachine.dAdditionalTable)
|
||||
If EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL) Then
|
||||
OkBtn.IsEnabled = True
|
||||
m_CurrProjPage.ClearMessage()
|
||||
Else
|
||||
OkBtn.IsEnabled = False
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 47)) ' Errore nella posizione o dimensione del grezzo
|
||||
End If
|
||||
' Aggiorno visualizzazione
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' Negative Kerf
|
||||
|
||||
Private Sub UpdateRawPartHeight()
|
||||
' Se da creare
|
||||
If m_CurrProjPage.m_nRawId = GDB_ID.NULL Then
|
||||
@@ -1514,8 +1560,10 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
Dim dMinOffsetX = m_RawKerf
|
||||
If dKerf < 0 And dOffsetX >= 0 Then
|
||||
m_RawOffsX = dOffsetX + m_RawKerf
|
||||
UpdateRawPart()
|
||||
'm_RawOffsX = dOffsetX + m_RawKerf
|
||||
'UpdateRawPart()
|
||||
m_RawOffsX = dOffsetX
|
||||
AdjustRawPartPositionNegativeKerf()
|
||||
ElseIf dKerf >= 0 And dOffsetX >= dMinOffsetX Then
|
||||
m_RawOffsX = dOffsetX
|
||||
UpdateRawPart()
|
||||
@@ -1534,8 +1582,10 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
Dim dMinOffsetY = m_RawKerf
|
||||
If dKerf < 0 And dOffsetY >= 0 Then
|
||||
m_RawOffsY = dOffsetY + m_RawKerf
|
||||
UpdateRawPart()
|
||||
'm_RawOffsY = dOffsetY + m_RawKerf
|
||||
'UpdateRawPart()
|
||||
m_RawOffsY = dOffsetY
|
||||
AdjustRawPartPositionNegativeKerf()
|
||||
ElseIf dKerf >= 0 And dOffsetY >= dMinOffsetY Then
|
||||
m_RawOffsY = dOffsetY
|
||||
UpdateRawPart()
|
||||
@@ -1554,9 +1604,23 @@ Public Class RawPartPageUC
|
||||
Dim dMaxKerf = Math.Min(Math.Min(m_RawOffsX, m_RawOffsY),
|
||||
Math.Min(m_dTableLength - m_RawLength - m_RawOffsX, m_dTableWidth - m_RawWidth - m_RawOffsY))
|
||||
Dim dMinKerf = -Math.Min(m_RawLength, m_RawWidth) / 2
|
||||
' recuper il segno del valore del Kerf precedente
|
||||
Dim dInvertKerf As Double = 1
|
||||
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf)
|
||||
m_PrecKerf = Math.Abs(m_RawKerf)
|
||||
m_PrecKerf = m_PrecKerf * dInvertKerf
|
||||
' Sostituisco: dKerf >= dMinKerf And dKerf <= dMaxKerf
|
||||
If dKerf >= 0 And dKerf <= dMaxKerf Then
|
||||
m_RawKerf = dKerf
|
||||
If m_PrecKerf < 0 Then
|
||||
' definsco la dimensione del grezzo pari a quella del kerf
|
||||
m_RawKerf = 0
|
||||
AdjustRawPartNegativeKerf()
|
||||
UpdateCircles()
|
||||
UpdateRawPartKerf()
|
||||
m_RawKerf = dKerf
|
||||
m_PrecKerf = 0
|
||||
End If
|
||||
If m_ActiveRawMode <> RAWMODE.FROM_PHOTO Then
|
||||
StringToLen(LengthTxBx.Text, m_RawLength)
|
||||
StringToLen(WidthTxBx.Text, m_RawWidth)
|
||||
@@ -1576,20 +1640,56 @@ Public Class RawPartPageUC
|
||||
' Ridisegno
|
||||
EgtDraw()
|
||||
ElseIf dKerf >= dMinKerf And dKerf < 0 Then
|
||||
' aggiorno il valore del Kerf corrente
|
||||
m_RawKerf = dKerf
|
||||
If m_ActiveRawMode <> RAWMODE.FROM_PHOTO Then
|
||||
' aggiorno dati grezzo
|
||||
' recupero dati grezzo
|
||||
StringToLen(LengthTxBx.Text, m_RawLength)
|
||||
m_RawLength = m_RawLength + 2 * m_RawKerf
|
||||
StringToLen(WidthTxBx.Text, m_RawWidth)
|
||||
m_RawWidth = m_RawWidth + 2 * m_RawKerf
|
||||
StringToLen(OffsetXTxBx.Text, m_RawOffsX)
|
||||
m_RawOffsX = m_RawOffsX - m_RawKerf
|
||||
StringToLen(OffsetYTxBx.Text, m_RawOffsY)
|
||||
m_RawOffsY = m_RawOffsY - m_RawKerf
|
||||
' UpdateRawPart()
|
||||
|
||||
If m_PrecKerf >= 0 Then
|
||||
m_RawLength = m_RawLength + 2 * m_RawKerf
|
||||
m_RawWidth = m_RawWidth + 2 * m_RawKerf
|
||||
m_RawOffsX = m_RawOffsX - m_RawKerf
|
||||
m_RawOffsY = m_RawOffsY - m_RawKerf
|
||||
End If
|
||||
m_RawKerf = -m_RawKerf
|
||||
UpdateRawPartKerf()
|
||||
' esegue l'aggiornamento della dimensione del grezzo solo quando passo dal kerf positivo a quello negativo
|
||||
|
||||
If m_PrecKerf >= 0 Then
|
||||
' definsco la dimensione del grezzo pari a quella del kerf
|
||||
m_RawKerf = 0
|
||||
AdjustRawPartNegativeKerf(False)
|
||||
UpdateCircles()
|
||||
UpdateRawPartKerf()
|
||||
m_RawKerf = -dKerf
|
||||
m_PrecKerf = 0
|
||||
End If
|
||||
AdjustRawPartNegativeKerf()
|
||||
UpdateCircles()
|
||||
'If m_PrecKerf > 0 And m_RawKerf < 0 Then
|
||||
' m_RawLength = m_RawLength + 2 * m_RawKerf
|
||||
' m_RawWidth = m_RawWidth + 2 * m_RawKerf
|
||||
' m_RawOffsX = m_RawOffsX - m_RawKerf - m_PrecKerf
|
||||
' m_RawOffsY = m_RawOffsY - m_RawKerf - m_PrecKerf
|
||||
' m_RawKerf = -m_RawKerf
|
||||
' UpdateRawPartKerf()
|
||||
'If m_PrecKerf >=0 And m_RawKerf < 0 Then
|
||||
' m_RawOffsX = m_RawOffsX - m_PrecKerf
|
||||
' m_RawOffsY = m_RawOffsY - m_PrecKerf
|
||||
' UpdateNegativeRawPart()
|
||||
'Else
|
||||
' UpdateNegativeRawPart()
|
||||
'End If
|
||||
|
||||
'UpdateRawPart()
|
||||
'UpdateNegativeRawPart()
|
||||
|
||||
'm_RawKerf = -m_RawKerf
|
||||
'UpdateRawPartKerf()
|
||||
|
||||
' Recupero id contorno kerf
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
' Modifico il colore
|
||||
|
||||
@@ -614,6 +614,14 @@ Friend Module VeinMatching
|
||||
' Sistemo il colore
|
||||
Dim colAqua As New Color3d(0, 255, 255, 25)
|
||||
EgtSetColor(nRegId, colAqua)
|
||||
|
||||
' ripeto per il solido
|
||||
Dim nSolidId As Integer = GetVeinPartSolidId(nId)
|
||||
EgtRemoveTextureData(nSolidId)
|
||||
Dim colSolid As Color3d
|
||||
EgtGetColor(EgtGetParent(nRegId), colSolid)
|
||||
EgtSetColor(nSolidId, colSolid)
|
||||
|
||||
' Se richiesto, eseguo deselezione
|
||||
If bDeselect Then EgtDeselectObj(nId)
|
||||
End If
|
||||
@@ -698,6 +706,21 @@ Friend Module VeinMatching
|
||||
LinkReferencesOnAlette()
|
||||
|
||||
EgtSetCurrentContext(m_nVeinCtx)
|
||||
|
||||
' costruisco tutti i piani cucina
|
||||
Dim nId As Integer = EgtGetFirstPart()
|
||||
While nId <> GDB_ID.NULL
|
||||
Dim sInfoName As String = String.Empty
|
||||
EgtGetInfo(nId, "CMP", sInfoName)
|
||||
' verifico che il pezzo sia una piano cucina
|
||||
If sInfoName.Contains("PCucina") Then
|
||||
If Not CreateKitchenTop(nId, ThicknessRaw) Then Return False
|
||||
End If
|
||||
' altrimenti passo al pezzo successivo
|
||||
nId = EgtGetNextPart(nId)
|
||||
End While
|
||||
|
||||
' costruisco alzatine e frontalini
|
||||
Dim Item As Aletta
|
||||
For Each Item In m_ListAlzFront
|
||||
' verifico che il disegno 3D non sia già stato fatto
|
||||
@@ -706,16 +729,207 @@ Friend Module VeinMatching
|
||||
If nInfo3D <> 1 Then
|
||||
EgtSetInfo(Item.SideId, "Info3D", 1)
|
||||
' creo il solido
|
||||
If Not CreateSolid(Item, ThicknessRaw) Then Return False
|
||||
If Not CreateAlettaSolid(Item, ThicknessRaw) Then Return False
|
||||
' posiziono il solido
|
||||
If Not MoveSolid(Item, ThicknessRaw) Then Return False
|
||||
If Not MoveAlettaSolid(Item, ThicknessRaw) Then Return False
|
||||
End If
|
||||
Next
|
||||
Draw()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function CreateSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||
Friend Function CreateKitchenTop(ByRef nId As Integer, ByRef ThicknessRaw As Double) As Boolean
|
||||
|
||||
' creo o svuoto layer per facce del solido
|
||||
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_VM_SOLID)
|
||||
If nSolidGrp <> GDB_ID.NULL Then
|
||||
EgtEmptyGroup(nSolidGrp)
|
||||
Else
|
||||
nSolidGrp = EgtCreateGroup(nId)
|
||||
EgtSetName(nSolidGrp, NAME_VM_SOLID)
|
||||
End If
|
||||
|
||||
' recupero faccia top
|
||||
Dim nRegGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_REGION)
|
||||
Dim nTopFr As Integer = EgtGetFirstInGroup(nRegGrp)
|
||||
While nTopFr <> GDB_ID.NULL
|
||||
If EgtGetType(nTopFr) = GDB_TY.SRF_FRGN Then Exit While
|
||||
nTopFr = EgtGetNext(nTopFr)
|
||||
End While
|
||||
If nTopFr = GDB_ID.NULL Then Return False
|
||||
EgtSetStatus(nTopFr, 0)
|
||||
|
||||
' setto colore per il solido
|
||||
Dim cCol As New Color3d
|
||||
EgtGetColor(nTopFr, cCol)
|
||||
EgtSetColor(nSolidGrp, cCol)
|
||||
|
||||
' creo il solido
|
||||
Dim bSameLoopsNbr As Boolean
|
||||
Dim nSolidId As Integer
|
||||
If Not CreateKitchenBaseSolid(nTopFr, nSolidGrp, ThicknessRaw, nSolidId, bSameLoopsNbr) Then Return False
|
||||
|
||||
' aggiungo componenti interni
|
||||
If Not AddInternalComponents(nSolidId, nTopFr, bSameLoopsNbr, ThicknessRaw) Then Return False
|
||||
|
||||
' setto eventuale texture
|
||||
Dim sTextName As String = String.Empty
|
||||
EgtGetTextureName(nTopFr, sTextName)
|
||||
If sTextName <> String.Empty Then
|
||||
Dim frText As New Frame3d
|
||||
EgtGetTextureFrame(nTopFr, nRegGrp, frText)
|
||||
EgtSetTextureName(nSolidId, sTextName)
|
||||
EgtSetTextureFrame(nSolidId, frText)
|
||||
End If
|
||||
|
||||
' elimino curve ausiliarie
|
||||
Dim nIdx As Integer = EgtGetFirstInGroup(nSolidGrp)
|
||||
While nIdx <> GDB_ID.NULL
|
||||
Dim newId As Integer = EgtGetNext(nIdx)
|
||||
If EgtGetType(nIdx) <> GDB_TY.SRF_MESH Then
|
||||
EgtErase(nIdx)
|
||||
End If
|
||||
nIdx = newId
|
||||
End While
|
||||
|
||||
Dim nOutloopGrpOrig As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP & ".orig")
|
||||
If nOutloopGrpOrig <> GDB_ID.NULL Then
|
||||
EgtSetStatus(nOutloopGrpOrig, 1)
|
||||
Dim nOutloopGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP)
|
||||
EgtSetStatus(nOutloopGrp, 0)
|
||||
End If
|
||||
|
||||
Return True
|
||||
|
||||
End Function
|
||||
|
||||
Friend Function CreateKitchenBaseSolid(ByRef nTopFr As Integer, ByRef nSolidGrp As Integer, ByRef ThicknessRaw As Double,
|
||||
ByRef nSolidStm As Integer, ByRef bSameLoopsNbr As Boolean) As Boolean
|
||||
|
||||
' creo la faccia bottom
|
||||
Dim nBottomFr As Integer
|
||||
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nTopFr))
|
||||
If Not EgtCalcFlatPartDownRegion(nPartId, ThicknessRaw) Then Return False
|
||||
Dim nDwnRegGrp As Integer = EgtGetFirstNameInGroup(nPartId, "DwnReg")
|
||||
If nDwnRegGrp <> GDB_ID.NULL Then
|
||||
EgtSetStatus(nDwnRegGrp, 0)
|
||||
nBottomFr = EgtGetFirstInGroup(nDwnRegGrp)
|
||||
If nBottomFr = GDB_ID.NULL Then Return False
|
||||
Else
|
||||
nBottomFr = EgtCopy(nTopFr, nSolidGrp)
|
||||
End If
|
||||
Dim vtMove As Vector3d = -ThicknessRaw * Vector3d.Z_AX()
|
||||
EgtMove(nBottomFr, vtMove)
|
||||
EgtSetStatus(nBottomFr, 0)
|
||||
|
||||
' superficie laterale
|
||||
Dim nTopCrvCount, nBottomCrvCount As Integer
|
||||
Dim nTopCrv, nBottomCrv As Integer
|
||||
nTopCrv = EgtExtractSurfFrChunkLoops(nTopFr, 0, nSolidGrp, nTopCrvCount)
|
||||
nBottomCrv = EgtExtractSurfFrChunkLoops(nBottomFr, 0, nSolidGrp, nBottomCrvCount)
|
||||
' modifico il punto iniziale della curva bottom per ottenere una buona superficie rigata
|
||||
Dim ptStartTop As Point3d
|
||||
EgtStartPoint(nTopCrv, ptStartTop)
|
||||
EgtChangeClosedCurveStartPoint(nBottomCrv, ptStartTop - vtMove)
|
||||
Dim nLateralStm As Integer = EgtCreateSurfTmRuled(nSolidGrp, nBottomCrv, nTopCrv, 0, EPS_STM)
|
||||
|
||||
' superfici trimesh per faccia top e bottom
|
||||
Dim nTopStm, nBottomStm As Integer
|
||||
bSameLoopsNbr = (nTopCrvCount = nBottomCrvCount)
|
||||
If bSameLoopsNbr Then
|
||||
If Not GetSrfTmFromFlatRegion(nTopFr, nSolidGrp, nTopStm) Then Return False
|
||||
If Not GetSrfTmFromFlatRegion(nBottomFr, nSolidGrp, nBottomStm) Then Return False
|
||||
Else
|
||||
' creo le facce top e bottom dimenticando eventuali aperture
|
||||
nTopStm = EgtCreateSurfTmByFlatContour(nSolidGrp, nTopCrv, EPS_STM)
|
||||
nBottomStm = EgtCreateSurfTmByFlatContour(nSolidGrp, nBottomCrv, EPS_STM)
|
||||
End If
|
||||
EgtInvertSurface(nBottomStm)
|
||||
|
||||
nSolidStm = EgtCreateSurfTmBySewing(nSolidGrp, 3, {nTopStm, nBottomStm, nLateralStm}, True)
|
||||
Return nSolidStm <> GDB_ID.NULL
|
||||
|
||||
End Function
|
||||
|
||||
Friend Function AddInternalComponents(ByRef nSolidStm As Integer, ByRef nTopFr As Integer, ByRef bSameLoopsNbr As Boolean,
|
||||
ByRef ThicknessRaw As Double) As Boolean
|
||||
|
||||
Dim nSolidGrp = EgtGetParent(nSolidStm)
|
||||
|
||||
' aperture interne
|
||||
Dim nTopCrvCount As Integer
|
||||
Dim nTopCrv As Integer = EgtExtractSurfFrChunkLoops(nTopFr, 0, nSolidGrp, nTopCrvCount)
|
||||
If bSameLoopsNbr Then
|
||||
Dim FacesStm(nTopCrvCount - 1) As Integer
|
||||
FacesStm(0) = nSolidStm
|
||||
' creo le superfici laterali definite dalle aperture
|
||||
For i As Integer = 1 To nTopCrvCount - 1
|
||||
FacesStm(i) = EgtCreateSurfTmByExtrusion(nSolidGrp, 1, {nTopCrv + i}, -ThicknessRaw * Vector3d.Z_AX(), EPS_STM)
|
||||
EgtInvertSurface(FacesStm(i))
|
||||
Next
|
||||
nSolidStm = EgtCreateSurfTmBySewing(nSolidGrp, nTopCrvCount, FacesStm, True)
|
||||
Else
|
||||
' creo le aperture per sottrazione di solidi
|
||||
For i As Integer = 1 To nTopCrvCount - 1
|
||||
Dim nComponentSrf As Integer = EgtCreateSurfTmByRegionExtrusion(nSolidGrp, 1, {nTopCrv + i}, -(ThicknessRaw + 10) * Vector3d.Z_AX(), EPS_STM)
|
||||
EgtSurfTmSubtract(nSolidStm, nComponentSrf)
|
||||
EgtErase(nComponentSrf)
|
||||
Next
|
||||
End If
|
||||
|
||||
' ribassi
|
||||
Dim nId As Integer = EgtGetFirstGroupInGroup(EgtGetParent(nSolidGrp))
|
||||
While nId <> GDB_ID.NULL
|
||||
Dim sName As String = ""
|
||||
EgtGetName(nId, sName)
|
||||
If sName <> "Pocket" Then
|
||||
nId = EgtGetNextGroup(nId)
|
||||
Continue While
|
||||
End If
|
||||
' cerco curva composita che definisce il ribasso
|
||||
Dim nCrvCompoId As Integer = EgtGetFirstInGroup(nId)
|
||||
While nCrvCompoId <> GDB_ID.NULL
|
||||
If EgtGetType(nCrvCompoId) = GDB_TY.CRV_COMPO Then Exit While
|
||||
nCrvCompoId = EgtGetNext(nCrvCompoId)
|
||||
End While
|
||||
|
||||
Dim dThick As Double
|
||||
EgtCurveThickness(nCrvCompoId, dThick)
|
||||
Dim vtExtr As Vector3d
|
||||
EgtCurveExtrusion(nCrvCompoId, vtExtr)
|
||||
Dim nRecessSrf As Integer = EgtCreateSurfTmByRegionExtrusion(nId, 1, {nCrvCompoId}, (dThick + 100) * vtExtr, EPS_STM)
|
||||
EgtSurfTmSubtract(nSolidStm, nRecessSrf)
|
||||
EgtErase(nRecessSrf)
|
||||
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextGroup(nId)
|
||||
End While
|
||||
|
||||
Return True
|
||||
End Function
|
||||
Friend Function GetSrfTmFromFlatRegion(ByRef nFlatRegion As Integer, ByRef nSolidGrp As Integer, ByRef nSrfTmId As Integer) As Boolean
|
||||
|
||||
If nFlatRegion = GDB_ID.NULL Then Return False
|
||||
' curve che delimitano la superficie
|
||||
Dim nCrvCount As Integer
|
||||
Dim nCrv As Integer = EgtExtractSurfFrChunkLoops(nFlatRegion, 0, nSolidGrp, nCrvCount)
|
||||
If nCrv = GDB_ID.NULL Then Return False
|
||||
' creo array con gli indici delle curve
|
||||
Dim CrvList(nCrvCount - 1) As Integer
|
||||
For i As Integer = 0 To nCrvCount - 1
|
||||
CrvList(i) = nCrv + i
|
||||
Next
|
||||
nSrfTmId = EgtCreateSurfTmByRegion(nSolidGrp, CrvList, EPS_STM)
|
||||
' cancello le curve create
|
||||
For i As Integer = 0 To nCrvCount - 1
|
||||
EgtErase(CrvList(i))
|
||||
Next
|
||||
|
||||
Return nSrfTmId <> GDB_ID.NULL
|
||||
|
||||
End Function
|
||||
|
||||
Friend Function CreateAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||
|
||||
' angoli per i tagli
|
||||
Dim dAngL, dAngR, dAng As Double
|
||||
@@ -775,7 +989,7 @@ Friend Module VeinMatching
|
||||
|
||||
Dim nFrontSrf, nBackSrf, nBottomSrf, nRightSrf, nLeftSrf As Integer
|
||||
' Front Face
|
||||
If Not CreateSolidFace(nSolidGrp, {pt1, pt2, pt3, pt4}, nFrontSrf) Then Return False
|
||||
If Not CreateSolidFace(nSolidGrp, {pt1, pt2, pt3, pt4}, nFrontSrf, False) Then Return False
|
||||
' Back Face
|
||||
If Not CreateSolidFace(nSolidGrp, {ptB1, ptB4, ptB3, ptB2}, nBackSrf) Then Return False
|
||||
' Bottom face
|
||||
@@ -786,21 +1000,26 @@ Friend Module VeinMatching
|
||||
If Not CreateSolidFace(nSolidGrp, {ptB2, ptB3, pt3, pt2}, nLeftSrf) Then Return False
|
||||
|
||||
' creo il solido
|
||||
Dim n As Integer = EgtCreateSurfTmBySewing(nSolidGrp, 6, {nTopSrf, nFrontSrf, nBackSrf, nBottomSrf, nRightSrf, nLeftSrf}, True)
|
||||
' setto eventuale la texture
|
||||
Dim nSolidSrf As Integer = EgtCreateSurfTmBySewing(nSolidGrp, 6, {nTopSrf, nFrontSrf, nBackSrf, nBottomSrf, nRightSrf, nLeftSrf}, True)
|
||||
|
||||
' setto eventuale texture
|
||||
Dim sTextName As String = String.Empty
|
||||
EgtGetTextureName(nTopSrfFR, sTextName)
|
||||
If sTextName <> String.Empty Then
|
||||
Dim frText As New Frame3d
|
||||
EgtGetTextureFrame(nTopSrfFR, nRegionGrp, frText)
|
||||
EgtSetTextureName(n, sTextName)
|
||||
EgtSetTextureFrame(n, frText)
|
||||
EgtSetTextureName(nSolidSrf, sTextName)
|
||||
EgtSetTextureFrame(nSolidSrf, frText)
|
||||
End If
|
||||
|
||||
Dim nOutloopGrp As Integer = EgtGetParent(Item.SideId)
|
||||
EgtSetStatus(nOutloopGrp, 0)
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function CreateSolidFace(ByRef nSrfGrp As Integer, ByRef Points As Point3d(), ByRef nSrfId As Integer) As Integer
|
||||
Friend Function CreateSolidFace(ByRef nSrfGrp As Integer, ByRef Points As Point3d(), ByRef nSrfId As Integer,
|
||||
Optional ByRef bDeleteCrv As Boolean = True) As Boolean
|
||||
|
||||
If Points.Count() <> 4 Then Return False
|
||||
|
||||
@@ -810,12 +1029,16 @@ Friend Module VeinMatching
|
||||
EgtCreateLine(nSrfGrp, Points(3), Points(0))}, True)
|
||||
|
||||
If nCrvId = GDB_ID.NULL Then Return False
|
||||
EgtSetStatus(nCrvId, GDB_ST.OFF)
|
||||
nSrfId = EgtCreateSurfTmByRegion(nSrfGrp, {nCrvId}, EPS_SMALL)
|
||||
If bDeleteCrv Then
|
||||
EgtErase(nCrvId)
|
||||
Else
|
||||
EgtSetStatus(nCrvId, GDB_ST.OFF)
|
||||
End If
|
||||
Return nSrfId <> GDB_ID.NULL
|
||||
End Function
|
||||
|
||||
Friend Function MoveSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||
|
||||
Dim nType As Integer
|
||||
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
|
||||
|
||||
Reference in New Issue
Block a user