Compare commits

..

15 Commits

Author SHA1 Message Date
Dario Sassi b5f9bc3a14 OmagOFFICE 3.1d2 :
- ricompilazione con cambio versione e piccoli aggiustamenti.
2026-04-23 17:00:31 +02:00
Dario Sassi 586b72848c Merge commit '1e1e9eab39f1f722e0c59b01f72fef58ffab0320' 2025-10-22 15:38:57 +02:00
Demetrio Cassarino 1e1e9eab39 -rinserimento pulsante cancel in finestra scegli tavola 2025-10-22 15:38:10 +02:00
Dario Sassi 36d01fa535 Merge commit '4a42bd30672b8a1b859054317090709e271f5003' 2025-10-22 15:32:24 +02:00
Demetrio Cassarino 4a42bd3067 -aggiornato finestra selezione tavola nuova macchina 2025-10-22 15:31:18 +02:00
Dario Sassi fbfaad64cf OmagOFFICE 2.7j2 :
- correzioni per spostamento pezzi tra tavole con e senza rotazioni (per immagine lastra).
2025-10-22 11:01:09 +02:00
Dario Sassi 33b09fdc4d Merge commit 'efd2d5d8c9c7ab390efb62a4a7fd4bb575b3ecdf' 2025-10-21 11:01:21 +02:00
Dario Sassi 4407d36165 OmagOFFICE 2.7j1 :
- correzione per bordi fotografie.
2025-10-16 20:07:13 +02:00
Dario Sassi 15ceb6159f OmagOFFICE 2.8h1 :
- ricompilazione con cambio versione.
2025-08-05 18:18:49 +02:00
Nicola Pievani 6070516cd5 Merge branch 'develop' 2025-07-28 09:57:07 +02:00
Demetrio Cassarino efd2d5d8c9 -Gestione completa cambio tavola 2025-07-22 14:29:19 +02:00
Nicola Pievani da178396f5 Inizio gestione cambio tavola 2025-07-22 12:19:24 +02:00
Nicola Pievani 5e824bf894 Merge branch 'master' into develop 2025-07-21 11:56:32 +02:00
Nicola Pievani 0b24324001 Aggiornamento versione 2.7g1 2025-07-14 08:52:32 +02:00
Nicola Pievani c827a89d94 Merge remote-tracking branch 'origin/Features/Manage_Msg' 2025-07-14 08:48:49 +02:00
24 changed files with 724 additions and 108 deletions
+2
View File
@@ -77,5 +77,7 @@ Module ConstGen
Public Const SETUP_LUA As String = "SetUp.lua"
' Sottodirettorio per BackUp
Public Const BACKUP_DIR As String = "BackUp"
' Info per rotazione in registrazione grezzo
Public Const INFO_REGROT As String = "RegRot"
End Module
+10
View File
@@ -1444,4 +1444,14 @@ Friend Module CamAuto
Return EgtApplyMachining(False)
End Function
Friend Function GetRegistrationRotation() As Double
Dim dRegRot As Double = 0
EgtGetInfo(GetCurrentRaw(), INFO_REGROT, dRegRot)
Return dRegRot
End Function
Friend Function SetRegistrationRotation(dRegRot As Double) As Boolean
Return EgtSetInfo(GetCurrentRaw(), INFO_REGROT, dRegRot)
End Function
End Module
+1
View File
@@ -122,6 +122,7 @@
Public Const K_TAB2_ADDITIONALTABLE As String = "Tab2AdditionalTable"
Public Const K_TAB3_ADDITIONALTABLE As String = "Tab3AdditionalTable"
Public Const K_CENTER_RAW_ONX As String = "CenterRawOnX"
Public Const K_CHANGETABWD As String = "ChangeTabWD"
Public Const S_PHOTO As String = "Photo"
Public Const K_PHOTO_OFFSETX As String = "OffsetX"
+20 -11
View File
@@ -340,7 +340,7 @@ Module EstCalc
Return (nFlag <> 0)
End Function
Public Function AdjustAdditionalTable() As Boolean
Public Function AdjustAdditionalTable(Optional bForced As Boolean = False) As Boolean
' Recupero altezza sottotavola corrente
Dim nFixtId As Integer = EgtGetFirstNameInGroup(EgtGetCurrMachGroup(), MACH_FIXT_GROUP)
Dim nAddTabId As Integer = EgtGetFirstNameInGroup(nFixtId, MACH_ADD_TABLE)
@@ -351,18 +351,27 @@ Module EstCalc
dCurrAddTab = b3AddTab.DimZ()
End If
' Se valore cambiato, aggiorno...
Dim dDeltaZ As Double = dAdditionalTable - dCurrAddTab
If Math.Abs(dDeltaZ) > EPS_SMALL Then
Dim dDeltaZ As Double = CurrentMachine.dAdditionalTable - dCurrAddTab
Dim bChanged As Boolean = (Math.Abs(dDeltaZ) > EPS_SMALL)
If bChanged Or bForced Then
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If Not bChanged AndAlso bOldEnMod Then EgtDisableModified()
AddAdditionalTable()
UpdateAllRawsZ(dDeltaZ)
' !!! FOTO DA GESTIRE !!!
'If GetPhoto() <> GDB_ID.NULL Then
' UpdatePhoto()
' UpdateContour()
' If EgtGetRawPartCount() > 0 Then
' ShowPhoto(False)
' End If
'End If
If GetPhoto() <> GDB_ID.NULL Then
UpdatePhoto()
UpdateContour()
If EgtGetRawPartCount() > 0 Then
ShowPhoto(False)
Dim nRawGrpId As Integer = EgtGetFirstRawPart()
While nRawGrpId <> GDB_ID.NULL
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup(nRawGrpId, NAME_RAW_SOLID)
If nRawSolidId <> GDB_ID.NULL Then EgtSetTextureName(nRawSolidId, GetPhotoName())
nRawGrpId = EgtGetNextRawPart(nRawGrpId)
End While
End If
End If
If Not bChanged AndAlso bOldEnMod Then EgtEnableModified()
End If
Return True
End Function
+4 -2
View File
@@ -54,7 +54,7 @@ Module EstPhoto
' Recupero le dimensioni della tavola
Dim b3Tab As New BBox3d
If Not EgtGetTableArea(1, b3Tab) Then Return False
b3Tab.Expand(100, 100, 0)
b3Tab.Expand(1000, 1000, 0)
' Elimino eventuale precedente foto
Dim nOldPhotoId = GetPhoto()
If nOldPhotoId <> GDB_ID.NULL Then EgtErase(nOldPhotoId)
@@ -428,7 +428,9 @@ Module EstPhoto
Dim nNewPhotoId As Integer = EgtAddPhoto2(GetPhotoName(), sPath, ptOri, ptCen, dDimX, dDimY, nPhGrpId, ptMin, ptMax)
If nNewPhotoId = GDB_ID.NULL Then Return False
' Eseguo eventuale rotazione attorno all'origine
EgtRotatePhoto(nNewPhotoId, ptOri, Vector3d.Z_AX(), dRot)
If Math.Abs( dRot) > EPS_ANG_ZERO then
EgtRotatePhoto(nNewPhotoId, ptOri, Vector3d.Z_AX(), dRot)
End If
' Salvo gli offset
EgtSetInfo(nNewPhotoId, "OffsX", dOffsetX)
EgtSetInfo(nNewPhotoId, "OffsY", dOffsetY)
+2 -2
View File
@@ -228,8 +228,8 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2706, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2706, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 3104, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 3104, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
' Inizializzazione generale di EgtInterface
+3 -3
View File
@@ -30,7 +30,7 @@ Imports System.Windows
#End If
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("OmagOFFICE")>
<Assembly: AssemblyCopyright("Copyright © 2017-2025 by Egalware s.r.l.")>
<Assembly: AssemblyCopyright("Copyright © 2017-2026 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
'In order to begin building localizable applications, set
@@ -69,6 +69,6 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.7.6.1")>
<Assembly: AssemblyFileVersion("2.7.6.1")>
<Assembly: AssemblyVersion("3.1.4.2")>
<Assembly: AssemblyFileVersion("3.1.4.2")>
+5 -4
View File
@@ -117,10 +117,11 @@ Public Class MyMachGroupPanelVM
' Se macchina con più tavole, chiedo quale usare
Dim nTabInd As Integer = 1
Dim nTabCnt As Integer = CamAuto.GetTableCount()
If nTabCnt > 1 And nTabCnt <= 3 Then
Dim dlg As New SelectTableWindowV(Application.Current.MainWindow, New SelectTableWindowVM(DirectCast(nTabCnt, SelectTableWindowVM.TableNumOpt)))
dlg.ShowDialog()
nTabInd = dlg.m_SelTable
Dim SelectTableWindowVM As New SelectTableWindowVM()
If nTabCnt > 1 And nTabCnt <= 4 Then
Dim SelectTableWindowV As New SelectTableWindowV(Application.Current.MainWindow, SelectTableWindowVM)
SelectTableWindowV.ShowDialog()
nTabInd = SelectTableWindowVM.nSelectedTable
End If
EgtSetTable(GetTableName(nTabInd))
' leggo nome attrezzaggio di default
@@ -13,7 +13,7 @@ Public Class MyMachiningDbWindowV
m_MachiningDbWindowVM = MachiningDbWindowVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_MachiningDbWindowVM.m_CloseWindow
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_MachiningDbWindowVM.OnCloseWindow
Me.DataContext = Nothing
Me.DialogResult = bDialogResult
End Sub
+1 -1
View File
@@ -22,7 +22,7 @@ Public Class MySetUpWindowV
End If
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_SetUpWindowVM.m_CloseWindow
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_SetUpWindowVM.OnCloseWindow
Me.DialogResult = bDialogResult
End Sub
+1 -1
View File
@@ -13,7 +13,7 @@ Public Class MyToolDbWindowV
m_ToolDbWindowVM = ToolDbWindowVM
End Sub
Private Sub ToolsDbView_Closed(bDialogResult As Boolean) Handles m_ToolDbWindowVM.m_CloseWindow
Private Sub ToolsDbView_Closed(bDialogResult As Boolean) Handles m_ToolDbWindowVM.OnCloseWindow
' Imposto contesto generale
EgtSetCurrentContext(EgtWPFLib5.ToolDbWindowVM.ProjectSceneContext)
' Cancello contesto di visualizzazione utensile
@@ -13,7 +13,7 @@ Public Class MyWaterjetDbWindowV
m_WaterjetDbWindowVM = WaterjetDbWindowVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_WaterjetDbWindowVM.m_CloseWindow
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_WaterjetDbWindowVM.OnCloseWindow
Me.DialogResult = bDialogResult
End Sub
+14
View File
@@ -293,6 +293,10 @@
<DependentUpon>SplitModeV.xaml</DependentUpon>
</Compile>
<Compile Include="OptionPanel\MachiningTab\SplitModeVM.vb" />
<Compile Include="OptionPanel\NestingTab\ChangeTableV.xaml.vb">
<DependentUpon>ChangeTableV.xaml</DependentUpon>
</Compile>
<Compile Include="OptionPanel\NestingTab\ChangeTableVM.vb" />
<Compile Include="OptionPanel\NestingTab\MultiSelectionV.xaml.vb">
<DependentUpon>MultiSelectionV.xaml</DependentUpon>
</Compile>
@@ -499,6 +503,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OptionPanel\NestingTab\ChangeTableV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OptionPanel\NestingTab\MultiSelectionV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -982,6 +990,12 @@
<Resource Include="Resources\NewIcons\LightArrowOff.png" />
<Resource Include="Resources\NewIcons\LightArrowOn.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\table.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\tableS.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe
+62
View File
@@ -0,0 +1,62 @@
<EgtWPFLib5:EgtCustomWindow x:Class="ChangeTableV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" IsClosable="False"
Title="{Binding sTitle}" Height="150" Width="320">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ItemsControl ItemsSource="{Binding CurrTableList}">
<!--Definisco l'organizzazione dei comandi-->
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!--Definisco il contenuto del comando-->
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton GroupName="TabGrp"
IsChecked="{Binding IsActive}"
Width="60" Height="60"
Style="{DynamicResource ChangeTable_ToggleButton}">
<Grid>
<!--Nome della tavole: Tab #-->
<TextBlock Text="{Binding sName}"
HorizontalAlignment="Center"
Background="Transparent">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{StaticResource Omag_LightGray}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource AncestorType=RadioButton}}" Value="True">
<Setter Property="Foreground" Value="{StaticResource Omag_White}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<!--Rappresentazione di una tavola di lavoro-->
<Image Source="{Binding ImgTab}" Margin="0,20,0,0"/>
</Grid>
</RadioButton>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<UniformGrid Grid.Row="1" Columns="2">
<Button Content="Ok" Margin="5" Command="{Binding OkCommand}"
Style="{StaticResource OptionPanel_TextButton}"/>
<Button Content="Cancel" Margin="5" Command="{Binding CancelCommand}"
Style="{StaticResource OptionPanel_TextButton}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,3 @@
Public Class ChangeTableV
End Class
+177
View File
@@ -0,0 +1,177 @@
Public Class ChangeTableVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private m_refChanTableV As ChangeTableV
Public Enum EnumDialogResult
OK
CANCEL
End Enum
Private m_MyDialogResult As EnumDialogResult
Public ReadOnly Property MyDialogResult As EnumDialogResult
Get
Return m_MyDialogResult
End Get
End Property
Private m_sTitle As String = "Seleziona tavola di lavoro"
Public ReadOnly Property sTitle As String
Get
Return m_sTitle
End Get
End Property
Private m_nSelectedTable As Integer = 0
Public ReadOnly Property nSelectedTable As Integer
Get
Return m_nSelectedTable
End Get
End Property
Private m_CurrTableList As New List(Of TableToChange)
Public ReadOnly Property CurrTableList As List(Of TableToChange)
Get
Return m_CurrTableList
End Get
End Property
' Definizione Comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(refV As ChangeTableV)
m_refChanTableV = refV
' Procedo alla creazione della lista delle tavole disponibili
Initialized()
End Sub
#End Region ' Constructor
#Region "METHODS"
Private Sub Initialized()
' recuepero l'inidce della tavola corrente
Dim nIndeXCurrTab As Integer = GetCurrentTable()
' creo la lista delle tavole disponibili (attivo il bottone della tavola attualmente in uso)
For nInd As Integer = 0 To GetTableCount() - 1
m_CurrTableList.Add(New TableToChange("Tab", (nInd + 1), ((nInd + 1) = nIndeXCurrTab)))
Next
End Sub
#End Region ' Methods
#Region "COMMANDS"
#Region "OkCommand"
Public ReadOnly Property OkCommand() As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Private Sub Ok()
' recupero l'indice della tavola impostata
For Each ItemTab As TableToChange In CurrTableList
If ItemTab.IsActive Then
m_nSelectedTable = ItemTab.nIndex
Exit For
End If
Next
m_MyDialogResult = EnumDialogResult.OK
' procedo alla chiusura della finetra
m_refChanTableV.Close()
End Sub
#End Region ' OkCommand
#Region "CancelCommand"
Public ReadOnly Property CancelCommand() As ICommand
Get
If m_cmdCancel Is Nothing Then
m_cmdCancel = New Command(AddressOf Cancel)
End If
Return m_cmdCancel
End Get
End Property
Private Sub Cancel()
m_MyDialogResult = EnumDialogResult.CANCEL
' procedo alla chiusura della finetra
m_refChanTableV.Close()
End Sub
#End Region ' CancelCommand
#End Region ' Commands
End Class
Public Class TableToChange
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private Property m_sName As String = "Tab"
Public ReadOnly Property sName As String
Get
Return m_sName
End Get
End Property
Private m_sImgTab As String = "\Resources\NewIcons\table.png"
Public ReadOnly Property ImgTab As String
Get
Return If(m_bIsActive, "\Resources\NewIcons\table.png", "\Resources\NewIcons\tableS.png")
End Get
End Property
Private Property m_nIndex As Integer = 3
Public ReadOnly Property nIndex As Integer
Get
Return m_nIndex
End Get
End Property
Private m_bIsActive As Boolean = False
Public Property IsActive As Boolean
Get
Return m_bIsActive
End Get
Set(value As Boolean)
m_bIsActive = value
If m_bIsActive Then
m_sImgTab = "\Resources\NewIcons\table.png"
Else
m_sImgTab = "\Resources\NewIcons\tableS.png"
End If
NotifyPropertyChanged(NameOf(IsActive))
NotifyPropertyChanged(NameOf(ImgTab))
End Set
End Property
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Public Sub New(Name As String, Ind As Integer, IsCurrent As Boolean)
m_sName = Name & " " & Ind.ToString
m_nIndex = Ind
m_bIsActive = IsCurrent
NotifyPropertyChanged(NameOf(IsActive))
End Sub
#End Region ' Constructor
End Class
+319 -2
View File
@@ -1,5 +1,7 @@
Imports EgtWPFLib5
Imports System.Drawing
Imports EgtUILib
Imports EgtWPFLib5
Imports OmagOFFICE.ChangeTableVM
Public Class NestingTabVM
Inherits VMBase
@@ -584,6 +586,212 @@ Public Class NestingTabVM
m_bStartRot = False
End Sub
Friend Function RotateAllRawParts(dAngDeg As Double) As Boolean
' Recupero il centro del grezzo iniziale per usarlo come centro della rotazione
Dim ptCen As New Point3d
GetRawCenter(ptCen)
' Provo la rotazione
Dim bMoveOk As Boolean = True
Dim nPhase As Integer = 1
Dim nRawId As Integer = GDB_ID.NULL
While nPhase <= EgtGetPhaseCount()
EgtSetCurrPhase(nPhase)
nRawId = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
' Rotazione del centro come spostamento grezzo più rotazione grezzo attorno al suo centro
Dim ptRawCen As New Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
Dim ptMovCen As New Point3d(ptRawCen)
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), dAngDeg)
If Not EgtMoveRawPart(nRawId, ptMovCen - ptRawCen) Then
bMoveOk = False
Exit While
End If
If Not EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngDeg) Then
EgtMoveRawPart(nRawId, -(ptMovCen - ptRawCen))
bMoveOk = False
Exit While
End If
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
If Not bMoveOk Then Exit While
nPhase += 1
End While
' Se rotazione impossibile, ripristino posizione dei grezzi già spostati
If Not bMoveOk Then
Dim nRevPhase As Integer = 1
Dim nRevRawId As Integer = GDB_ID.NULL
While nRevPhase <= nPhase
EgtSetCurrPhase(nRevPhase)
nRevRawId = EgtGetFirstRawPart()
While nRevRawId <> GDB_ID.NULL And (nRevPhase < nPhase Or nRevRawId <> nRawId)
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
' Eseguo al contrario
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
Dim ptRawCen As New Point3d
EgtGetRawPartCenter(nRevRawId, ptRawCen)
Dim ptMovCen As New Point3d(ptRawCen)
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
End If
nRevRawId = EgtGetNextRawPart(nRevRawId)
End While
nRevPhase += 1
End While
' Altrimenti eseguo sistemazioni
Else
' Origine della tavola
Dim ptOri As Point3d
EgtGetTableRef(1, ptOri)
' Annullo rotazioni dei grezzi e le rifaccio sulle parti componenti
Dim nRevPhase As Integer = 1
Dim nRevRawId As Integer = GDB_ID.NULL
While nRevPhase <= EgtGetPhaseCount()
EgtSetCurrPhase(nRevPhase)
nRevRawId = EgtGetFirstRawPart()
While nRevRawId <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
' Eseguo al contrario
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
Dim ptRawCen As New Point3d
EgtGetRawPartCenter(nRevRawId, ptRawCen)
Dim ptMovCen As New Point3d(ptRawCen)
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
' Rifaccio sugli oggetti contenuti nel grezzo
Dim nId As Integer = EgtGetFirstInGroup(nRevRawId)
While nId <> GDB_ID.NULL
EgtRotate(nId, ptCen, Vector3d.Z_AX(), dAngDeg, GDB_RT.GLOB)
nId = EgtGetNext(nId)
End While
' Imposto posizione esatta del grezzo dopo rotazione
Dim b3Raw As New BBox3d
EgtGetRawPartBBox(nRevRawId, b3Raw)
EgtMoveToCornerRawPart(nRevRawId, (b3Raw.Min() - ptOri) + Point3d.ORIG(), MCH_CR.BL)
End If
nRevRawId = EgtGetNextRawPart(nRevRawId)
End While
nRevPhase += 1
End While
' Ruoto opportunamente anche i dati di movimento
Dim nOpeId As Integer = EgtGetFirstActiveOperation()
While nOpeId <> GDB_ID.NULL
If EgtGetOperationType(nOpeId) = MCH_OY.DISP Then
' Recupero i gruppi con i dati
Dim nRpmId As Integer = EgtGetFirstNameInGroup(nOpeId, "Rpm*")
While nRpmId <> GDB_ID.NULL
' Recupero le informazioni
Dim vtRawMove As New Vector3d
If EgtGetInfo(nRpmId, "Mv", vtRawMove) Then
vtRawMove.Rotate(Vector3d.Z_AX(), dAngDeg)
EgtSetInfo(nRpmId, "Mv", vtRawMove)
End If
Dim vtDelta As New Vector3d
If EgtGetInfo(nRpmId, "Dt", vtDelta) Then
vtDelta.Rotate(Vector3d.Z_AX(), dAngDeg)
EgtSetInfo(nRpmId, "Dt", vtDelta)
End If
Dim dAngRotDeg As Double = 0
If EgtGetInfo(nRpmId, "Ad", dAngRotDeg) Then
EgtSetInfo(nRpmId, "Ad", dAngRotDeg + dAngDeg)
End If
' Cerco un altro gruppo
nRpmId = EgtGetNextName(nRpmId, "Rpm*")
End While
End If
nOpeId = EgtGetNextActiveOperation(nOpeId)
End While
' Ruoto anche l'eventuale foto della lastra e sistemo il riferimento sul grezzo
Dim nPhotoId = EstPhoto.GetPhoto()
If nPhotoId <> GDB_ID.NULL then
Dim dOldRot As Double = 0
EgtGetInfo(nPhotoId, "Rot", dOldRot)
EgtRotatePhoto(nPhotoId, ptCen, Vector3d.Z_AX(), dAngDeg)
EgtSetInfo(nPhotoId, "Rot", dOldRot + dAngDeg)
Dim refTxr As New Frame3d
GetPhotoTextureRef(refTxr)
Dim nSolidId = EgtGetFirstNameInGroup(EgtGetFirstRawPart(), NAME_RAW_SOLID)
EgtSetTextureFrame(nSolidId, refTxr, GDB_RT.GLOB)
End If
' Aggiorno rotazione totale
CamAuto.SetRegistrationRotation(0)
' Dichiaro grezzo per punti
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
End If
' Ruoto i punti SpotReg disegnati in Office
If bMoveOk Then
RotateAllSpotRegistration(dAngDeg, ptCen)
End If
' Ripristino lo stato iniziale
EgtSetCurrPhase(1)
HideAllMachinings()
Return bMoveOk
End Function
' Ruoto solo gli elementi SpotReg creati nel programma OFFICE
Private Sub RotateAllSpotRegistration(dAngRot As Double, ptCen As Point3d)
Dim nId As Integer = EgtGetFirstInGroup(OmagOFFICEMap.refRawPartTabVM.m_nRegGroupId)
While nId <> GDB_ID.NULL
Dim sName As String = String.Empty
EgtGetName(nId, sName)
If Not sName.Contains("CUT") Then
EgtRotate(nId, ptCen, Vector3d.Z_AX, dAngRot)
End If
nId = EgtGetNext(nId)
End While
EgtDraw()
End Sub
Private Sub MoveAllRawParts(vtMove As Vector3d)
' Provo il movimento
Dim bMoveOk As Boolean = True
Dim nPhase As Integer = 1
Dim nRawId As Integer = GDB_ID.NULL
While nPhase <= EgtGetPhaseCount()
EgtSetCurrPhase(nPhase)
nRawId = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
If Not EgtMoveRawPart(nRawId, vtMove) Then
bMoveOk = False
Exit While
End If
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
If Not bMoveOk Then Exit While
nPhase += 1
End While
' Se movimento impossibile, ripristino posizione dei grezzi già spostati
If Not bMoveOk Then
Dim nRevPhase As Integer = 1
Dim nRevRawId As Integer = GDB_ID.NULL
While nRevPhase <= nPhase
EgtSetCurrPhase(nRevPhase)
nRevRawId = EgtGetFirstRawPart()
While nRevRawId <> GDB_ID.NULL And (nRevPhase < nPhase Or nRevRawId <> nRawId)
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
EgtMoveRawPart(nRevRawId, -vtMove)
End If
nRevRawId = EgtGetNextRawPart(nRevRawId)
End While
nRevPhase += 1
End While
End If
If bMoveOk Then
' Traslo anche l'eventuale foto della lastra
Dim nPhotoId = EstPhoto.GetPhoto()
If nPhotoId <> GDB_ID.NULL then EgtMovePhoto(nPhotoId, vtMove)
' Muovo i punti SpotReg generati nel programma OFFICE
OmagOFFICEMap.refRawPartTabVM.MoveAllSpotRegistration(vtMove)
End If
' Ripristino lo stato iniziale
EgtSetCurrPhase(1)
HideAllMachinings()
End Sub
' verifica che la rotazione sia ammessa
Private Function RotatePartInsideBond(dAngRotDeg As Double, nIdMove As Integer) As Boolean
' Verifico se ci sono dei pezzi bloccati in rotazione
@@ -2204,12 +2412,14 @@ Public Class NestingTabVM
While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
Dim sNamePartId As String = String.Empty
EgtGetName(nPartId, sNamePartId)
Dim bPartInTable As Boolean = (EgtGetParent(nPartId) = GetRawId())
If EgtIsPart(nPartId) Or bPartInTable Then
Dim nStat As Integer = GDB_ST.ON_
EgtGetStatus(nPartId, nStat)
' verifico se l'lemento selezionato è il numero di pezzi
' verifico se l'elemento selezionato è il numero di pezzi
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
Dim NameLayer As String = String.Empty
EgtGetName(EgtGetParent(nId), NameLayer)
@@ -2241,6 +2451,113 @@ Public Class NestingTabVM
' Drag possibile
m_bDrag = True
Exit While
Else
' verifico se l'elemento selezionato è il nome della tavola
If EgtGetType(nId) = GDB_TY.EXT_TEXT AndAlso (sNamePartId = MAIN_TAB Or
sNamePartId = SECOND_TAB Or
sNamePartId = THIRD_TAB Or
sNamePartId = FORTH_TAB) Then
' Apro la finestra per la selezione della tavola da usare
Dim ChgTbV As New ChangeTableV
Dim ChgTbVM As New ChangeTableVM(ChgTbV)
ChgTbV.DataContext = ChgTbVM
ChgTbV.ShowDialog()
' se non è stata eseguita nessuna scelta esco dal ciclo
If ChgTbVM.MyDialogResult = EnumDialogResult.CANCEL Or ChgTbVM.nSelectedTable = 0 Then Exit While
' salvo l'origine della precente tavola
Dim ptOldTabOri As Point3d
EgtGetTableRef( 1, ptOldTabOri)
' recupero il nome della nuova tavola corrente
Dim sOtherTab As String = GetTableName(ChgTbVM.nSelectedTable)
EgtChangeTable(sOtherTab, True)
' Traslo anche l'eventuale foto della lastra
Dim nPhotoId = EstPhoto.GetPhoto()
If nPhotoId <> GDB_ID.NULL then
Dim ptTabOri As Point3d
EgtGetTableRef( 1, ptTabOri)
EgtMovePhoto(nPhotoId, ptTabOri - ptOldTabOri)
End If
EstCalc.AdjustAdditionalTable(True)
EgtSetMachineLook(MCH_LOOK.TAB)
' aggiorno le lavorazioni
UpdateAllMachiningsToolpaths()
' aggiorno i movimenti pezzi tra disposizioni
For nI As Integer = 1 To EgtGetPhaseCount()
EgtSetCurrPhase(nI)
Dim nDispId As Integer = EgtGetPhaseDisposition(nI)
SpecialApplyDisposition(nDispId, True)
Next
' aggiorno posizionamento ventose per lavorazioni da sotto
UpdateVacuumsForDrip()
' dichiaro tutto aggiornato
EstCalc.SetOrderMachiningFlag()
EgtSetCurrPhase(1)
' aggiorno posizione pezzi in parcheggio
Dim nPPId As Integer = EgtGetFirstPart()
While nPPId <> GDB_ID.NULL
PackPartInStore(nPPId)
nPPId = EgtGetNextPart(nPPId)
End While
' se prevista rotazione
If GetPrivateProfileInt(S_TABLE, K_CHANGETABWD, 0, CurrentMachine.sMachIniFile) = 2 Then
' Dati tavola
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
' Box lastra
Dim b3OrigRaw As New BBox3d
GetRawBox(b3OrigRaw)
' Allargo i limiti della tavola in tutte le fasi
Const TAB_OFFS As Double = 3000
For nI As Integer = 1 To EgtGetPhaseCount()
EgtSetCurrPhase(nI)
EgtSetTableAreaOffset(TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
Next
' aggiorno posizionamento ventose per lavorazioni da sotto
UpdateVacuumsForDrip()
' dichiaro tutto aggiornato
EstCalc.SetOrderMachiningFlag()
EgtSetCurrPhase(1)
' Rotazione
Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
If Not RotateAllRawParts(dAngRot) Then
'm_CurrProjPage.SetWarningMessage(EgtMsg(90339)) 'Rotazione impossibile
End If
' Traslazione per riportare la lastra nella stessa posizione rispetto all'angolo BL che diventa TR e viceversa
Dim b3Raw As New BBox3d
GetRawBox(b3Raw)
Dim vtMove As Vector3d
If sOtherTab = SECOND_TAB Then
Dim vtDiffIni As Vector3d = b3OrigRaw.Min() - b3Tab.Min()
Dim vtDiffFin As Vector3d = b3Tab.Max() - b3Raw.Max()
vtMove = vtDiffFin - vtDiffIni
Else
Dim vtDiffIni As Vector3d = b3Tab.Max() - b3OrigRaw.Max()
Dim vtDiffFin As Vector3d = b3Raw.Min() - b3Tab.Min()
vtMove = -(vtDiffFin - vtDiffIni)
End If
vtMove.z = 0
MoveAllRawParts(vtMove)
' Ripristino i limiti della tavola in tutte le fasi
For nI As Integer = 1 To EgtGetPhaseCount()
EgtSetCurrPhase(nI)
EgtSetTableAreaOffset(0, 0, 0, 0)
Next
EgtSetCurrPhase(1)
HideAllMachinings()
End If
' visualizzazione
EgtZoom(ZM.ALL)
' Elimino il datacontext della finestra per la selezione della tavola
ChgTbVM = Nothing
Exit While
End If
End If
nId = EgtGetNextObjInSelWin()
End While
+8 -4
View File
@@ -43,7 +43,7 @@ Public Class RawPartTabVM
Private m_nTempLay As Integer = GDB_ID.NULL
' Layer per crocette dei punti REG
Private m_nRegGroupId As Integer = GDB_ID.NULL
Friend m_nRegGroupId As Integer = GDB_ID.NULL
' Numero di spot inseriti nel grezzo corrente
Private m_nCountSpot As Integer = 0
' Gruppo Spot attualmente selezionato
@@ -1978,10 +1978,14 @@ Public Class RawPartTabVM
Return True
End Function
Private Sub MoveAllSpotRegistration(vtMove As Vector3d)
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
Friend Sub MoveAllSpotRegistration(vtMove As Vector3d, Optional bOnlyOfficeSpot As Boolean = True)
Dim nId As Integer = EgtGetFirstInGroup(OmagOFFICEMap.refRawPartTabVM.m_nRegGroupId)
While nId <> GDB_ID.NULL
EgtMove(nId, vtMove)
Dim sName As String = String.Empty
EgtGetName(nId, sName)
If Not sName.Contains("CUT") Or Not bOnlyOfficeSpot Then
EgtMove(nId, vtMove)
End If
nId = EgtGetNext(nId)
End While
EgtDraw()
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

+51 -47
View File
@@ -1,56 +1,60 @@
<EgtWPFLib5:EgtCustomWindow x:Class="SelectTableWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
IsClosable="False"
IsMinimizable="False"
ShowInTaskbar="False"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
SizeToContent="WidthAndHeight"
Title="{Binding Title}"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" IsClosable="False"
Title="{Binding Title}" Height="150" Width="320">
<Grid HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="10,10,10,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ItemsControl ItemsSource="{Binding CurrTableList}">
<!--Definisco l'organizzazione dei comandi-->
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!--Definisco il contenuto del comando-->
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton GroupName="TabGrp"
IsChecked="{Binding IsActive}"
Width="60" Height="60"
Style="{DynamicResource ChangeTable_ToggleButton}">
<Grid>
<!--Nome della tavole: Tab #-->
<TextBlock Text="{Binding sName}"
HorizontalAlignment="Center"
Background="Transparent">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{StaticResource Omag_LightGray}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource AncestorType=RadioButton}}" Value="True">
<Setter Property="Foreground" Value="{StaticResource Omag_White}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<!--Rappresentazione di una tavola di lavoro-->
<Image Source="{Binding ImgTab}" Margin="0,20,0,0"/>
</Grid>
<TextBlock Text="{Binding WndMsg}"
FontSize="18"
Grid.ColumnSpan="3"
Margin="0,0,0,10"/>
<Button Grid.Column="0" Grid.Row="1"
Content="1" FontSize="40"
Style="{StaticResource OptionPanel_NestingButton}"
Command="{Binding Table_Command}"
CommandParameter="1"
Margin="10,0,10,0">
</Button>
<Button Grid.Column="1" Grid.Row="1"
Content="2" FontSize="40"
Style="{StaticResource OptionPanel_NestingButton}"
Command="{Binding Table_Command}"
CommandParameter="2"
Margin="10,0,10,0">
</Button>
<Button Grid.Column="2" Grid.Row="1"
Content="3" FontSize="40"
Style="{StaticResource OptionPanel_NestingButton}"
Command="{Binding Table_Command}"
CommandParameter="3"
Visibility="{Binding Table3_Visibility}"
Margin="10,0,10,0">
</Button>
</RadioButton>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Button Grid.Row="1" Content="Ok" Margin="5"
Command="{Binding OkCommand}"
Style="{StaticResource OptionPanel_TextButton}"/>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -1,7 +1,6 @@
Public Class SelectTableWindowV
Private WithEvents m_SelectTableWindowVM As SelectTableWindowVM
Public m_SelTable As Integer
Sub New(Owner As Window, SelectTableWindowVM As SelectTableWindowVM)
MyBase.New(Owner)
@@ -13,7 +12,6 @@
End Sub
Private Sub CloseWindow(DialogResult As Integer) Handles m_SelectTableWindowVM.m_CloseWindow
m_SelTable = DialogResult
Me.DialogResult = True
End Sub
+33 -27
View File
@@ -1,26 +1,24 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class SelectTableWindowVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public Enum TableNumOpt As Integer
TWO = 2
THREE = 3
End Enum
Friend Event m_CloseWindow(DialogResult As Integer)
Private m_Table3_Visibility As Visibility
Public Property Table3_Visibility As Visibility
Private m_nSelectedTable As Integer = 0
Public ReadOnly Property nSelectedTable As Integer
Get
Return m_Table3_Visibility
Return m_nSelectedTable
End Get
End Property
Private m_CurrTableList As New List(Of TableToChange)
Public ReadOnly Property CurrTableList As List(Of TableToChange)
Get
Return m_CurrTableList
End Get
Set(value As Visibility)
m_Table3_Visibility = value
End Set
End Property
#Region "Messages"
@@ -40,41 +38,49 @@ Public Class SelectTableWindowVM
#End Region
' Definizione comandi
Private m_cmdTable As ICommand
Private m_cmdOk As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(nTableNum As TableNumOpt)
If nTableNum = TableNumOpt.TWO Then
m_Table3_Visibility = Visibility.Collapsed
Else
m_Table3_Visibility = Visibility.Visible
End If
NotifyPropertyChanged("Table3_Visibility")
Sub New()
' recuepero l'inidce della tavola corrente
Dim nIndeXCurrTab As Integer = GetCurrentTable()
' creo la lista delle tavole disponibili (attivo il bottone della tavola attualmente in uso)
For nInd As Integer = 0 To GetTableCount() - 1
m_CurrTableList.Add(New TableToChange("Tab", (nInd + 1), ((nInd + 1) = nIndeXCurrTab)))
Next
End Sub
#End Region ' CONSTRUCTOR
#Region "COMMANDS"
#Region "Table"
#Region "OkCommand"
Public ReadOnly Property Table_Command As ICommand
Public ReadOnly Property OkCommand() As ICommand
Get
If m_cmdTable Is Nothing Then
m_cmdTable = New Command(AddressOf Table)
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdTable
Return m_cmdOk
End Get
End Property
Public Sub Table(ByVal param As Object)
Private Sub Ok(ByVal param As Object)
' recupero l'indice della tavola impostata
For Each ItemTab As TableToChange In CurrTableList
If ItemTab.IsActive Then
m_nSelectedTable = ItemTab.nIndex
Exit For
End If
Next
' procedo alla chiusura della finetra
RaiseEvent m_CloseWindow(CInt(param))
End Sub
#End Region ' DrawCommand
#End Region ' OkCommand
#End Region ' COMMANDS
+6
View File
@@ -595,6 +595,12 @@
<Setter Property="Height" Value="40"/>
</Style>
<Style x:Key="ChangeTable_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="50"/>
<Setter Property="Width" Value="50"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style x:Key="Option_ColorButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Padding" Value="5"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>