Compare commits

..

9 Commits

Author SHA1 Message Date
Emmanuele Sassi 12081cec28 - modifiche per export del 3dm per la macchina 2023-12-19 14:57:46 +01:00
Emmanuele Sassi 27a54b0034 - modifiche per nuova esportazione 3mf 2023-10-24 11:03:04 +02:00
Emmanuele Sassi c1aee47e53 - aggiunto StrandH in json e corretto valore strandW 2023-10-13 15:40:38 +02:00
Emmanuele Sassi e59d50923b Merge branch 'main' into feature/ExportForMachine 2023-09-26 11:41:08 +02:00
Emmanuele Sassi e5fca60809 - aggiunti dati nel json
- evito creazione icrx se generazione andata male
2023-09-26 11:40:21 +02:00
Emmanuele Sassi f7631e5201 - creazione del pacchetto di export per la macchina 2023-09-20 11:14:35 +02:00
Dario Sassi 4604ae3558 Icarus :
- migliorata gestione di progetto modificato.
2023-08-30 12:14:26 +02:00
Dario Sassi 624eb0566f Icarus 2.5h1 :
- modifiche per visualizzare meglio l'area di valido posizionamento dei pezzi.
2023-08-28 19:50:01 +02:00
Emmanuele Sassi f45efb2310 - creazione Json degli strati 2023-08-28 18:05:43 +02:00
15 changed files with 522 additions and 69 deletions
+1
View File
@@ -3,6 +3,7 @@
Public Const TABLE = "Table"
Public Const TABLE_OUTLINE = "TableOutline"
Public Const EXTRUSION_AREA = "ExtrusionArea"
Public Const EXTRUSION_RECT = "ExtrusionRect"
Public Const PART = "Part"
Public Const PRINT_SOLID = "PrintSolid"
Public Const LAY_MACH_START = "MachStart"
+1
View File
@@ -53,6 +53,7 @@ Public Module ConstGen
' Abilitazioni licenza
Friend Enum KEY_OPT As UInteger
BASE = 1 ' Prodotto Icarus
MACHINE_EXPORT = 2 ' opzione per esportare file icrx per macchina
End Enum
' File di log generale
+4
View File
@@ -87,6 +87,9 @@
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework.Aero2" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
@@ -320,6 +323,7 @@
<Compile Include="Utility\DisableModifiedMgr.vb" />
<Compile Include="Utility\EgwCrypto.vb" />
<Compile Include="Utility\GeomEntityColors.vb" />
<Compile Include="Utility\JsonUtility.vb" />
<Compile Include="Utility\LuaExec.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="Utility\MyMachine.vb" />
+2 -2
View File
@@ -191,8 +191,8 @@ Public Class MainWindowM
EgtSetLockId( sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2507, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 2507, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2508, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 2508, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
+2 -2
View File
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.7.1")>
<Assembly: AssemblyFileVersion("2.5.7.1")>
<Assembly: AssemblyVersion("2.5.8.1")>
<Assembly: AssemblyFileVersion("2.5.8.1")>
+30 -1
View File
@@ -2,6 +2,7 @@
Imports System.IO
Imports EgtWPFLib5
Imports EgtUILib
Imports Newtonsoft.Json
Public Class ProjManagerVM
Inherits VMBase
@@ -247,9 +248,37 @@ Public Class ProjManagerVM
''' Execute the Save. This method is invoked by the SaveCommand.
''' </summary>
Public Sub Save()
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
CreateJson()
End If
Map.refSceneHostVM.SaveProject()
End Sub
Private Function CreateJson() As Boolean
' creo json
Dim LayerList As New List(Of JsonLayer)
For Each Layer In Map.refTFSEditorVM.LayerList
LayerList.Add(Layer.ConvertToJsonLayer())
Next
Dim json As String = JsonConvert.SerializeObject(LayerList, Formatting.Indented)
Dim sProjName As String = ""
EgtGetCurrFilePath(sProjName)
If Not String.IsNullOrWhiteSpace(sProjName) Then
sProjName = Path.ChangeExtension(sProjName, ".json")
If File.Exists(sProjName) Then
Try
File.Delete(sProjName)
Catch ex As Exception
End Try
End If
Try
File.AppendAllText(sProjName, json)
Catch ex As Exception
EgtOutLog("Json writing error!")
End Try
End If
End Function
#End Region ' SaveCommand
#Region "SaveAsCommand"
@@ -385,7 +414,7 @@ Public Class ProjManagerVM
Map.refSceneHostVM.SaveProject()
End If
EgtGetCurrFilePath(sCurrProject)
' se modificato, chiedo se si vuole salvare
' se modificato, chiedo se si vuole salvare
Else
If EgtGetModified() Then
If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
+20
View File
@@ -682,6 +682,26 @@ Public Class MySceneHostVM
Return MainController.ExportProject(SaveFileDialog.FileName, False)
End Function
Public Function ExportProjectForMachine(sFilePath As String) As Boolean
' Reset controller e scena
MainController.ResetStatus()
MainController.SetDefaultFilterForExport(EEX_FLT.MODE_HIDDEN + EEX_FLT.MODE_STD + EEX_FLT.STAT_ON + EEX_FLT.STAT_OFF + EEX_FLT.LEV_TEMP)
Return MainController.ExportGeomId(Map.refTopPanelVM.SelPart.nPartId, sFilePath, False)
End Function
Public Function ExportProjectForMachine(sDirPath As String, b3dm As Boolean, ByRef sFilePath As String) As Boolean
sFilePath = sDirPath & "\ProjectSlice" & If(b3dm, ".3dm", ".3mf")
' Reset controller e scena
MainController.ResetStatus()
MainController.SetDefaultFilterForExport(EEX_FLT.MODE_HIDDEN + EEX_FLT.MODE_STD + EEX_FLT.STAT_ON + EEX_FLT.STAT_OFF + EEX_FLT.LEV_TEMP)
Dim nExportGeomId As Integer = 0
If b3dm Then
If Not ExecPrepare3dmExport(nExportGeomId) Then Return False
Else
nExportGeomId = Map.refTopPanelVM.SelPart.nPartId
End If
Return MainController.ExportGeomId(nExportGeomId, sFilePath, False)
End Function
Public Overrides Function ExecScript(sFilePath As String) As Boolean
Dim bOk As Boolean = False
If String.IsNullOrEmpty(sFilePath) Then
+162 -7
View File
@@ -2,6 +2,8 @@
Imports EgtUILib
Imports Microsoft.Win32
Imports System.IO
Imports Ionic.Zip
Imports Newtonsoft.Json
Public Class SliceManagerVM
Inherits VMBase
@@ -705,17 +707,34 @@ Public Class SliceManagerVM
End If
End If
' eseguo calcoli
CalcSlice(True, True)
Dim bOk As Boolean = CalcSlice(True, True)
' se non ho interrotto calcoli
If Not m_bStopScriptToManage Then
If bShiftPressed Then
' Se esiste ne lancio l'editing
If File.Exists(sIsoFilePath) Then
If bOk AndAlso Not m_bStopScriptToManage Then
' Se esiste l'iso
If File.Exists(sIsoFilePath) Then
If bShiftPressed Then
' Se esiste ne lancio l'editing
Process.Start("Notepad.exe", sIsoFilePath)
' altrimenti lo segnalo
Else
MessageBox.Show("Edit failed, missing part program file" & " (" & sIsoFilePath & ")")
End If
' verifico se creare pacchetto
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.MACHINE_EXPORT) Then
'If True Then
If Not CreateProjectForMachine(sIsoFilePath) Then
MessageBox.Show("Icrx file generation failed!!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error)
End If
' riabilito ProjManager, TopPanel e uscita dal programma
Map.refProjManagerVM.SetProjCmdIsEnabled(True)
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True)
Map.refTFSEditorVM.SetTFSEditorIsEnabled(True)
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
SetButtonsIsEnabled(True)
End If
Else
' altrimenti lo segnalo
MessageBox.Show("Part program generation failed!!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
End If
NotifyPropertyChanged(NameOf(Time_Visibility))
NotifyPropertyChanged(NameOf(Mass_Visibility))
@@ -725,6 +744,142 @@ Public Class SliceManagerVM
m_bCalculating = False
End Sub
Private Function CreateProjectForMachine(sIsoFilePath As String) As Boolean
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(False)
Map.refTFSEditorVM.SetTFSEditorIsEnabled(False)
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
SetButtonsIsEnabled(False)
' creo cartella file da esportare in Temp
Dim sExportTempFolderPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\MachineExport"
If Directory.Exists(sExportTempFolderPath) Then
Try
Directory.Delete(sExportTempFolderPath, True)
Catch ex As Exception
EgtOutLog("Error! Impossible deleting folder " & sExportTempFolderPath & "!")
Return False
End Try
End If
Try
Directory.CreateDirectory(sExportTempFolderPath)
Catch ex As Exception
EgtOutLog("Error! Impossible creating folder " & sExportTempFolderPath & "!")
Return False
End Try
' mostro solido per eportazione
Dim SolidCheck As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = ViewLayer.ViewLayerType.SOLID_SLICE)
Dim CurrSolidCheckValue As Boolean? = SolidCheck.bIsVisible
If IsNothing(SolidCheck.bIsVisible) OrElse Not SolidCheck.bIsVisible Then
SolidCheck.bIsVisible = True
End If
' esporto file progetto
Dim sFileExtension As String
If True Then
sFileExtension = ".3dm"
Else
sFileExtension = ".3mf"
End If
Dim s3dFilePath As String = ""
If Not Map.refSceneHostVM.ExportProjectForMachine(sExportTempFolderPath, True, s3dFilePath) Then
EgtOutLog("Error! Impossible exporting 3mf file!")
Return False
End If
'' esporto file 3mf
'Dim s3mfPath As String = sExportTempFolderPath & "\ProjectSlice.3mf"
'If Not Map.refSceneHostVM.ExportProjectForMachine(s3mfPath) Then
' EgtOutLog("Error! Impossible exporting 3mf file!")
' Return False
'End If
' creo file json
Dim sProjName As String = ""
EgtGetCurrFilePath(sProjName)
Dim sJsonPath As String = sExportTempFolderPath & "\ProjectSlice.json"
CreateJson(sJsonPath)
' creo immagine preview
Dim sPreviewImagePath As String = sExportTempFolderPath & "\ProjectSlice.png"
CreatePreviewImage(sPreviewImagePath)
' nascondo solido
If IsNothing(CurrSolidCheckValue) OrElse Not CurrSolidCheckValue Then
SolidCheck.bIsVisible = CurrSolidCheckValue
End If
' creo path dello zip
Dim sZipPath As String = Path.ChangeExtension(sProjName, ".icrx")
' se esiste gia' lo cancello
If File.Exists(sZipPath) Then
Try
File.Delete(sZipPath)
Catch ex As Exception
EgtOutLog("Error! Impossible deleting old icrx file!")
Return False
End Try
End If
Try
Using zip As New Ionic.Zip.ZipFile(sZipPath, Console.Out)
zip.AlternateEncodingUsage = ZipOption.Always
zip.AlternateEncoding = Text.Encoding.UTF8
zip.CompressionMethod = CompressionMethod.None
' aggiungo file Iso
zip.AddItem(sIsoFilePath, "").FileName = "ProjectSlice" & Path.GetExtension(sIsoFilePath)
' aggiungo file 3mf
zip.AddItem(s3dFilePath, "")
' aggiungo json
zip.AddItem(sJsonPath, "")
' aggiungo immagine preview
zip.AddItem(sPreviewImagePath, "")
' salvo lo zip
zip.Save()
End Using
Catch ex As Exception
EgtOutLog("Error! Icrx file generation failed!!")
Return False
End Try
' elimino tutti i file temporanei creati
If Directory.Exists(sExportTempFolderPath) Then
Directory.Delete(sExportTempFolderPath, True)
End If
Return True
End Function
Private Function CreateJson(sJsonPath As String) As Boolean
' creo json
Dim JsonMain As New JsonMain(m_dTime, m_dMass)
Dim json As String = JsonConvert.SerializeObject(JsonMain, Formatting.Indented)
If File.Exists(sJsonPath) Then
Try
File.Delete(sJsonPath)
Catch ex As Exception
EgtOutLog("Error! Impossible deleting file " & sJsonPath & "!")
Return False
End Try
End If
Try
File.AppendAllText(sJsonPath, json)
Catch ex As Exception
EgtOutLog("Error! Impossible writing json file " & sJsonPath & "!")
Return False
End Try
Return True
End Function
Private Function CreatePreviewImage(sPreviewImagePath As String) As Boolean
' recupero posizione vista corrente
Dim nCurrAngVertDeg As Integer = 0
Dim nCurrAngHorizDeg As Integer = 0
EgtGetGenericView(nCurrAngVertDeg, nCurrAngHorizDeg)
EgtSetView(VT.ISO_SW, False)
SetTableVisibility(False)
EgtZoom(ZM.ALL, False)
'EgtExportSvg(GDB_ID.ROOT, sPreviewImagePath)
EgtGetImage(SM.SHADING, New Color3d(255, 255, 255, 255), New Color3d(255, 255, 255, 255), 3000, 3000, sPreviewImagePath)
EgtSetGenericView(nCurrAngVertDeg, nCurrAngHorizDeg, False)
SetTableVisibility(True)
EgtZoom(ZM.ALL, True)
Return True
End Function
#End Region ' Generate
#Region "Simulate"
+47 -45
View File
@@ -20,23 +20,22 @@ Public Class SliderManagerVM
End Get
Set(value As Integer)
If IsNothing(Map.refTopPanelVM.SelPart) Then Return
Dim DisableMgr As New DisableModifiedMgr
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
' se diverso da nullo nascondo precedente
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100
If m_nLayerIndex = 0 Then
For Each Layer In Map.refTopPanelVM.SelPart.LayerList
EgtSetStatus(Layer.nLayerId, GDB_ST.OFF)
Next
ElseIf m_nLayerIndex > 0 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.OFF)
End If
' nascondo precedente
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100
If m_nLayerIndex = 0 Then
For Each Layer In Map.refTopPanelVM.SelPart.LayerList
EgtSetStatus(Layer.nLayerId, GDB_ST.OFF)
Next
ElseIf m_nLayerIndex > 0 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.OFF)
End If
m_nLayerIndex = value
' se diverso da nullo visualizzo corrente
If Not IsNothing(Map.refTopPanelVM.SelPart) AndAlso m_nLayerIndex > 0 Then EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.ON_)
If m_nLayerIndex > 0 Then EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.ON_)
' porto barra nuovo strato a 100
If m_nLayerIndex > 0 Then SetLayerAdvancement(100)
Case ViewSliderType.UNTIL_SELECTED
@@ -64,6 +63,7 @@ Public Class SliderManagerVM
End If
m_nLayerIndex = value
End Select
DisableMgr.ReEnable()
NotifyPropertyChanged(NameOf(ghShowValue))
NotifyPropertyChanged(NameOf(ghValueIndex))
NotifyPropertyChanged(NameOf(ghValueHeight))
@@ -71,47 +71,44 @@ Public Class SliderManagerVM
End Set
End Property
Private Sub SetLayerIndex(value As Integer)
If IsNothing(Map.refTopPanelVM.SelPart) Then Return
Dim DisableMgr As New DisableModifiedMgr
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd = value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
Else
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
End If
Next
End If
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd = value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
Else
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
End If
Next
m_nLayerIndex = value
Case ViewSliderType.UNTIL_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd <= value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
Else
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
End If
Next
End If
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd <= value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
Else
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
End If
Next
m_nLayerIndex = value
Case ViewSliderType.FROM_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd >= value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
Else
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
End If
Next
End If
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd >= value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
Else
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
End If
Next
m_nLayerIndex = value
End Select
DisableMgr.ReEnable()
NotifyPropertyChanged(NameOf(nLayerIndex))
NotifyPropertyChanged(NameOf(ghShowValue))
NotifyPropertyChanged(NameOf(ghValueIndex))
@@ -201,6 +198,8 @@ Public Class SliderManagerVM
Return m_dLayerAdvancement
End Get
Set(value As Double)
If IsNothing(Map.refTopPanelVM.SelPart) Then Return
Dim DisableMgr As New DisableModifiedMgr
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
Dim nTotSolid As Integer = 0
@@ -247,6 +246,7 @@ Public Class SliderManagerVM
End If
m_dLayerAdvancement = value
End Select
DisableMgr.ReEnable()
EgtDraw()
End Set
End Property
@@ -335,6 +335,7 @@ Public Class SliderManagerVM
WriteMainPrivateProfileString(S_PRINTING3D, K_VIEWSLIDER, m_nSelViewSlider)
' ciclo tutti i layer per nasconderli/mostrarli
If IsNothing(Map.refTopPanelVM.SelPart) OrElse IsNothing(Map.refTopPanelVM.SelPart.LayerList) Then Return
Dim DisableMgr As New DisableModifiedMgr
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
For Each Layer In Map.refTopPanelVM.SelPart.LayerList
@@ -361,6 +362,7 @@ Public Class SliderManagerVM
End If
Next
End Select
DisableMgr.ReEnable()
' mostro/nascondo slider orizzontale
m_LayerAdvancement_Visibility = If(m_nSelViewSlider = ViewSliderType.ONLY_SELECTED, Visibility.Visible, Visibility.Hidden)
NotifyPropertyChanged(NameOf(LayerAdvancement_Visibility))
+5 -1
View File
@@ -962,4 +962,8 @@ Public Class TFSLayer
Return If(dHours > 0, dHours.ToString("00") & ":", "") & If(dHours > 0, dMinutes.ToString("00"), dMinutes.ToString()) & ":" & dSeconds.ToString("00")
End Function
End Class
Friend Function ConvertToJsonLayer() As JsonLayer
Return New JsonLayer(nIndex, dLength, dTMin, m_dTTrg, dTMax, dTCurr, m_dTWait, dFCurr, m_dFTrg, m_dFMax, m_dFCurr, dSpeed)
End Function
End Class
+25 -7
View File
@@ -156,19 +156,30 @@ Public Module CurrentMachine
DisableMgr.ReEnable()
End Sub
Public Sub SetTableVisibility(IsVisible As Boolean)
Dim nTableLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
EgtSetStatus(nTableLayerId, If(IsVisible, GDB_ST.ON_, GDB_ST.OFF))
End Sub
Public Sub UpdateExtrusionArea()
Dim DisableMgr As New DisableModifiedMgr
' recupero eventuale vecchia area di estrusione
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
Dim nTabLayerId As Integer = EgtGetFirstNameInGroup(nTabPartId, TABLE)
Dim nExtrusionAreaId As Integer = EgtGetFirstNameInGroup(nTabLayerId, EXTRUSION_AREA)
If nExtrusionAreaId <> GDB_ID.NULL Then
' e la cancello
EgtErase(nExtrusionAreaId)
End If
If nExtrusionAreaId <> GDB_ID.NULL Then EgtErase(nExtrusionAreaId)
Dim nExtrusionRectId As Integer = EgtGetFirstNameInGroup(nTabLayerId, EXTRUSION_RECT)
If nExtrusionRectId <> GDB_ID.NULL Then EgtErase(nExtrusionRectId)
' se lavorazione corrente nulla, esco
If IsNothing(Map.refTopPanelVM.CurrMachining) Then Return
If IsNothing(Map.refTopPanelVM.CurrMachining) Then
DisableMgr.ReEnable()
Return
End If
' se non esiste file dati macchina, esco
If String.IsNullOrWhiteSpace(m_sMachDataIniFile) Then Return
If String.IsNullOrWhiteSpace(m_sMachDataIniFile) Then
DisableMgr.ReEnable()
Return
End If
' recupero tipo di slice
Dim sExtrusionType As String = S_VERTICAL
Dim GeneralCathegory As MachiningCathegory = Map.refTopPanelVM.CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL)
@@ -188,12 +199,19 @@ Public Module CurrentMachine
Dim dExtrXMin = GetPrivateProfileDouble(sExtrusionType, K_MINX, 0, m_sMachDataIniFile)
Dim dExtrYMax = GetPrivateProfileDouble(sExtrusionType, K_MAXY, 0, m_sMachDataIniFile)
Dim dExtrYMin = GetPrivateProfileDouble(sExtrusionType, K_MINY, 0, m_sMachDataIniFile)
nExtrusionAreaId = EgtCreateRectangle2P(nTabLayerId, New Point3d(dExtrXMin, dExtrYMin, 0), New Point3d(dExtrXMax, dExtrYMax, 0))
Const AREA_WIDTH As Double = 10
Dim nAuxRectId As Integer = EgtCreateRectangle2P(nTabLayerId, New Point3d(dExtrXMin - AREA_WIDTH, dExtrYMin - AREA_WIDTH, 0), New Point3d(dExtrXMax + AREA_WIDTH, dExtrYMax + AREA_WIDTH, 0))
nExtrusionRectId = EgtCreateRectangle2P(nTabLayerId, New Point3d(dExtrXMin, dExtrYMin, 0), New Point3d(dExtrXMax, dExtrYMax, 0))
nExtrusionAreaId = EgtCreateSurfTmByRegion( nTabLayerId, { nAuxRectId, nExtrusionRectId}, EPS_STM)
EgtErase( nAuxRectId)
Dim c3Temp As New Color3d
c3Temp.FromColor(System.Drawing.Color.Lime)
EgtSetColor(nExtrusionAreaId, c3Temp)
EgtSetName(nExtrusionAreaId, EXTRUSION_AREA)
EgtSetColor(nExtrusionRectId, c3Temp)
EgtSetName(nExtrusionRectId, EXTRUSION_RECT)
m_b3ExtrusionArea = New BBox3d(New Point3d(dExtrXMin, dExtrYMin, 0), New Point3d(dExtrXMax, dExtrYMax, 0))
DisableMgr.ReEnable()
EgtDraw()
End Sub
+205
View File
@@ -0,0 +1,205 @@
Imports EgtUILib.EgtInterface
Imports EgtWPFLib5
Public Class JsonMain
Private m_StrandW As Double
Public ReadOnly Property StrandW As Double
Get
Return m_StrandW
End Get
End Property
Private m_StrandH As Double
Public ReadOnly Property StrandH As Double
Get
Return m_StrandH
End Get
End Property
Private m_BoxX As Double
Public ReadOnly Property BoxX As Double
Get
Return m_BoxX
End Get
End Property
Private m_BoxY As Double
Public ReadOnly Property BoxY As Double
Get
Return m_BoxY
End Get
End Property
Private m_BoxZ As Double
Public ReadOnly Property BoxZ As Double
Get
Return m_BoxZ
End Get
End Property
Private m_dTime As Double
Public ReadOnly Property dTime As Double
Get
Return m_dTime
End Get
End Property
Private m_dMass As Double = 0
Public ReadOnly Property dMass As Double
Get
Return m_dMass
End Get
End Property
Private m_LayerQty As Double
Public ReadOnly Property LayerQty As Double
Get
Return m_LayerQty
End Get
End Property
Private m_MaterialName As String
Public ReadOnly Property MaterialName As String
Get
Return m_MaterialName
End Get
End Property
Private m_JsonLayerList As New List(Of JsonLayer)
Public ReadOnly Property JsonLayerList As List(Of JsonLayer)
Get
Return m_JsonLayerList
End Get
End Property
Sub New(dTime As Double, dMass As Double)
For Each Layer In Map.refTFSEditorVM.LayerList
m_JsonLayerList.Add(Layer.ConvertToJsonLayer())
Next
m_MaterialName = Map.refTopPanelVM.SelMaterial.sName
Dim GeneralCathegory As MachiningCathegory = Map.refCurrMachiningPanelVM.CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL)
If Not IsNothing(GeneralCathegory) Then
Dim StrandW As CurrNumericMachiningParam = GeneralCathegory.MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.STRANDW)
Dim StrandH As CurrNumericMachiningParam = GeneralCathegory.MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.STRANDH)
If Not IsNothing(StrandW) Then
m_StrandW = StrandW.dValue
End If
If Not IsNothing(StrandH) Then
m_StrandH = StrandH.dValue
End If
End If
m_dTime = dTime
m_dMass = dMass
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
Dim b3Print As BBox3d = Map.refDispositionPanelVM.GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
m_BoxX = b3Print.DimX
m_BoxY = b3Print.DimY
m_BoxZ = b3Print.DimZ
End If
m_LayerQty = Map.refSliderManagerVM.nLayerIndex_Maximum
End Sub
End Class
Public Class JsonLayer
Private m_nIndex As Integer
Public ReadOnly Property Index As Integer
Get
Return m_nIndex
End Get
End Property
Private m_dLength As Double
Public ReadOnly Property Length As Double
Get
Return m_dLength
End Get
End Property
Private m_dTMin As Double
Public ReadOnly Property TMin As Double
Get
Return m_dTMin
End Get
End Property
Private m_dTTrg As Double
Public ReadOnly Property TTrg As Double
Get
Return m_dTTrg
End Get
End Property
Private m_dTMax As Double
Public ReadOnly Property TMax As Double
Get
Return m_dTMax
End Get
End Property
Private m_dTCurr As Double
Public ReadOnly Property TCurr As Double
Get
Return m_dTCurr
End Get
End Property
Private m_dTWait As Double
Public ReadOnly Property TWait As Double
Get
Return m_dTWait
End Get
End Property
Private m_dFMin As Double
Public ReadOnly Property FMin As Double
Get
Return m_dFMin
End Get
End Property
Private m_dFTrg As Double
Public ReadOnly Property FTrg As Double
Get
Return m_dFTrg
End Get
End Property
Private m_dFMax As Double
Public ReadOnly Property FMax As Double
Get
Return m_dFMax
End Get
End Property
Private m_dFCurr As Double
Public ReadOnly Property FCurr As Double
Get
Return m_dFCurr
End Get
End Property
Private m_dSpeed As Double
Public ReadOnly Property Speed As Double
Get
Return m_dSpeed
End Get
End Property
Sub New(nIndex As Integer, dLength As Double, dTMin As Double, dTTrg As Double, dTMax As Double, dTCurr As Double, dTWait As Double, dFMin As Double, dFTrg As Double, dFMax As Double, dFCurr As Double, dSpeed As Double)
m_nIndex = nIndex
m_dLength = dLength
m_dTMin = dTMin
m_dTTrg = dTTrg
m_dTMax = dTMax
m_dTCurr = dTCurr
m_dTWait = dTWait
m_dFMin = dFMin
m_dFTrg = dFTrg
m_dFMax = dFMax
m_dFCurr = dFCurr
m_dSpeed = dSpeed
End Sub
End Class
+14
View File
@@ -115,4 +115,18 @@ Module LuaExec
Return bOk
End Function
Friend Function ExecPrepare3dmExport(ByRef nExportGeomId As Integer) As Boolean
Dim bOk As Boolean = True
EgtLuaCreateGlobTable("PRINT")
EgtLuaSetGlobStringVar("PRINT.BASEDIR", Map.refMainWindowVM.MainWindowM.s3dPrintingDir)
bOk = EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\PrepareExport.lua")
If bOk Then
EgtLuaGetGlobIntVar("PRINT.EXPORTLAYER", nExportGeomId)
End If
' Cancello tavola globale
EgtLuaResetGlobVar("PRINT")
Return bOk
End Function
End Module
@@ -35,7 +35,7 @@ Public Class ViewLayerManagerVM
End Sub
Sub New()
' Creo riferimento a questa classe in EgtCAM5Map
' Creo riferimento a questa classe in Map
Map.SetRefViewLayerManagerVM(Me)
m_LayerList = New ObservableCollection(Of ViewLayer)({New ViewLayer(ViewLayer.ViewLayerType.PRINT_SOLID, "Print", True),
New ViewLayer(ViewLayer.ViewLayerType.REFERENCE, "Origin Point", True),
@@ -150,8 +150,8 @@ Public Class ViewLayer
End Sub
Friend Sub UpdateVisibility(bIsVisible As Boolean)
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr ' se solidi
Dim DisableMgr As New DisableModifiedMgr
' se solidi
If m_Type = ViewLayerType.SOLID_SLICE Then
If Map.refSceneHostVM.MainController.GetStep() = 0 Then
' aggiorno parametro di calcolo solidi sui pezzi
@@ -242,7 +242,6 @@ Public Class ViewLayer
Next
Next
End If
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
End Sub
+1
View File
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Ionic.Zip" version="1.9.1.8" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
</packages>