Compare commits

..

69 Commits

Author SHA1 Message Date
Emmanuele Sassi 238bdbb1ce - Correzione su import/export machining 2022-12-14 11:53:24 +01:00
Emmanuele Sassi 144b8dc66e - aggiunta gestione dis/attivazione wait
- aggiunta modifica con selezione dei tempi wait
2022-12-13 19:05:57 +01:00
Emmanuele Sassi 5f9a01ae2e - aggiunta del parametro G0FeedZ
- aggiunta gestione colori e trasparenze categorie
- corretta creazione nuovo pezzo da superficie in import
- Reintrodotta gestione parametro RibsLink su singole Ribs
2022-12-13 11:01:58 +01:00
Emmanuele Sassi a6386e64d9 Merge remote-tracking branch 'ICARUS/main' into ImportExportMachiningDb&Material 2022-12-09 17:16:55 +01:00
Emmanuele Sassi 551eec6496 - aggiunta gestione spostamento pezzo print quando aggiunto o rimosso e stampa a 45 gradi 2022-12-09 16:45:37 +01:00
Emmanuele Sassi a24c4ada62 - correzione indice di slice 2022-12-09 12:43:00 +01:00
DarioS 2a86d67ca9 Icarus 2.4l3 :
- riportate su StartMach e ShellNumber le modifiche di selezione fatte sui Ribs.
2022-12-07 17:37:36 +01:00
DarioS 5c4a8adf9b Icarus 2.4l2 :
- corretti movimenti e rotazioni di LayerStart, Ribs e Reduce
- bottone impostazioni Grid visibile solo se Grid abilitata
- migliorato controllo esistenza direttorio generazione CN.
2022-12-06 16:56:58 +01:00
DarioS 0cc2534628 Icarus :
- corretta gestione rotazione pezzo (ora default asse Z)
- quando si fa SaveAs si rimuove il nome del CN da generare (per forzare generazione con nuovo nome)
- ora gestita anche estrusione 45deg in Y e riordinate le parti relative compresa abilitazione da Ini macchina.
2022-12-05 11:45:05 +01:00
DarioS 2a861dca1b Icarus 2.4k6 :
- aggiunte versioni a 32bit solo per usi interni (test/debug).
2022-11-28 15:35:15 +01:00
Emmanuele Sassi 16715a8c08 Icarus 2.4k5 :
- cambio di versione
2022-11-23 11:09:03 +01:00
Emmanuele Sassi 4c5500c490 Merge branch 'main' of https://gitlab.steamware.net/egalware/icarus 2022-11-23 11:08:18 +01:00
Emmanuele Sassi 75b4b4e4d0 - correzione se lavorazione nulla 2022-11-23 11:08:15 +01:00
Emmanuele Sassi b643cb5030 - correzione 2022-11-23 10:56:15 +01:00
DarioS f710918411 Icarus :
- aggiunti controlli per evitare crash se progetto senza materiale.
2022-11-22 19:59:51 +01:00
DarioS 1585fc2659 Icarus :
- controllo esistenza direttorio in cui generare CN, altrimenti direttorio del progetto.
2022-11-22 19:25:39 +01:00
Emmanuele Sassi a00170b37a Icarus 2.4k4 :
- cambio di versione
2022-11-22 18:06:24 +01:00
Emmanuele Sassi 00836e0695 - correzione errore su creazione copia materiale
- migliorata gestione cancellazione materiale su con chiave di alto livello
2022-11-22 18:03:35 +01:00
Emmanuele Sassi c06d75e292 Merge branch 'main' into ImportExportMachiningDb&Material 2022-11-22 16:11:50 +01:00
Emmanuele Sassi a6acc66099 - migliorato import export 2022-11-22 16:10:08 +01:00
Emmanuele Sassi c822538fb7 Icarus 2.4k3 :
- cambio versione
2022-11-14 21:14:17 +01:00
Emmanuele Sassi 9072dc3780 - correzioni apertura file con materiale o lavorazione non presenti 2022-11-14 21:11:53 +01:00
Emmanuele Sassi a9ed233d77 Merge branch 'NewImportModifyPart' 2022-11-14 20:14:00 +01:00
Emmanuele Sassi 0635302dac Merge branch 'develop' 2022-11-14 20:13:49 +01:00
Emmanuele Sassi 12de367ba1 - Importazione ed esportazione lavorazioni 2022-11-14 20:12:49 +01:00
Emmanuele Sassi a68dba11a2 Merge branch 'develop' into ImportExportMachiningDb&Material 2022-11-14 13:28:14 +01:00
Emmanuele Sassi 60784d2588 - Cambiato modo di dichiarare materiali da costruttore
- Disabilitato bottone cancella su materiali costruttore
2022-11-14 13:27:58 +01:00
Emmanuele Sassi 5d26914967 Merge branch 'develop' into ImportExportMachiningDb&Material 2022-11-14 09:35:34 +01:00
Emmanuele Sassi 4c4356dac7 - correzione spostamento aggiuntivo riferimento su stampa a 45 gradi 2022-11-14 09:17:23 +01:00
Emmanuele Sassi 50d301e8cc - Evitato contextmenu vuoto
- Migliorata gestione nuovo pezzo
- Correzioni e migliorie
2022-11-12 13:22:54 +01:00
Emmanuele Sassi bfbb85feee - correzioni e miglioramenti
- aggiunto creazione e rimozione pezzi su tasto destro
2022-11-11 21:02:44 +01:00
Emmanuele Sassi 9783731396 - Salvata estensione file di importazione
- Modifica nome Part ed Entity in ManagePartPanel
- gestisce spostamenti entity da menu tasto destro
- correzioni e migliorie
2022-11-10 20:53:56 +01:00
Emmanuele Sassi 9ff14634dd - Unione import e modify part 2022-11-07 23:20:13 +01:00
Emmanuele Sassi 42970892ba - Aggiunto Others a lista di layer da visualizzare/nascondere 2022-11-07 16:31:02 +01:00
Emmanuele Sassi 2bb8cfc4a1 Merge remote-tracking branch 'ICARUS/main' into develop 2022-11-07 15:36:26 +01:00
DarioS 902f610703 Icarus :
- alcune correzioni per reset stato visualizzazione solidi di strand
- corretto salvataggio stato direzione su curve e griglia attiva.
2022-11-03 17:04:41 +01:00
Emmanuele Sassi cb6b2721fc - Aggiunto bottone per mostrare/nascondere griglia
- Aggiunta lettura stati ShowMode e CurveDir
2022-11-03 16:03:02 +01:00
Emmanuele Sassi d7aa5f1739 Merge branch 'main' into develop 2022-11-03 11:10:06 +01:00
Emmanuele Sassi e67f863235 - Annullato flag calcolo solido su apertura progetto 2022-11-03 11:09:34 +01:00
DarioS 5f6660d642 Icarus 2.4k1 :
- tolto log del valore di Progress.
2022-11-02 15:16:32 +01:00
DarioS 437e698d10 Icarus :
- snap point default a griglia.
2022-10-29 10:38:53 +02:00
DarioS 9a187ac36b Icarus :
- parametri in Pu trasformati in parametri in %
- piccole modifiche per parametri con [%] e con [deg].
2022-10-29 10:29:10 +02:00
DarioS 2c04b2e5cc Icarus 2.4j4 :
- aggiunto Grid da Oggetto anche in Start Layer
- corretta gestione tipo slice in DB lavorazioni.
2022-10-28 20:39:40 +02:00
DarioS a6c10569e0 Icarus :
- correzione a Ribs per parametro bool dichiarato string.
2022-10-28 13:29:35 +02:00
DarioS f60be49005 Icarus :
- sistemata Grid da oggetto anche per Ribs.
2022-10-28 13:08:39 +02:00
DarioS b8b42114b6 Icarus :
- modifiche per SLICINGTYPE.DEG45 = 2 e SLICINGTYPE.HORIZONTAL = 3 per facilitare la gestione dei casi con tipi 1 e 3 senza il 3.
2022-10-28 11:56:00 +02:00
Emmanuele Sassi 69b2734987 Merge branch 'develop' 2022-10-28 09:48:37 +02:00
Emmanuele Sassi a52a8dfe36 Merge branch 'SplashScreen' into develop 2022-10-28 09:47:34 +02:00
Emmanuele Sassi b73a4ba6c0 - migliorate posizioni elementi in TFS
- gestito recupero macchina all'apertura progetto
2022-10-28 09:47:14 +02:00
Emmanuele Sassi 98628b887e - Inizio implementazione finestra di import export 2022-10-28 08:33:03 +02:00
Emmanuele Sassi 5152600fd9 Merge remote-tracking branch 'ICARUS/main' into ImportExportMachiningDb&Material 2022-10-27 22:28:40 +02:00
DarioS c9b9646bbb Icarus :
- corretta gestione decimali in lavorazioni per double/len
- cambiato nome CoastingFeed in CoastingFeedPu.
2022-10-27 22:22:14 +02:00
Emmanuele Sassi c6732698e8 Merge branch 'ImportExportMachiningDb&Material' into develop 2022-10-27 20:35:45 +02:00
Emmanuele Sassi 89ab41da44 Merge remote-tracking branch 'ICARUS/main' into develop 2022-10-27 20:35:11 +02:00
Emmanuele Sassi 2b5bb35e21 - introdotti combo e check per i parametri del singolo Rib
- Aggiunto parametro RibType nel singolo Rib
2022-10-27 20:34:28 +02:00
DarioS 68ee954dd3 Icarus :
- modifiche per griglia su oggetto e per terna su griglia.
2022-10-27 20:15:46 +02:00
Emmanuele Sassi a47a5ed09a - Aggiunto RibsType
- Modificata descrizione parametro Feed Coasting
2022-10-27 12:21:35 +02:00
Emmanuele Sassi b272f1f2bb Merge branch 'ModifyPart' into SplashScreen 2022-10-27 11:18:46 +02:00
Emmanuele Sassi 5aba0cf14f Merge branch 'ModifyPart' into develop 2022-10-27 11:16:06 +02:00
Emmanuele Sassi a1c3a9fb30 - Gestita apertura diretta del progetto da file senza SplashScreen
- Impostata versione da note programma in SplashScreen
2022-10-27 11:14:51 +02:00
DarioS 1e61027dbd Icarus :
- corretta gestione generate da ricalcolare.
2022-10-26 12:50:40 +02:00
Emmanuele Sassi 4d26959075 Merge branch 'develop' 2022-10-26 12:21:06 +02:00
Emmanuele Sassi 799c0530be - Aggiornamento splashscreen 2022-10-26 07:06:33 +02:00
Emmanuele Sassi 6cea8cbcf8 Merge branch 'ModifyPart' into SplashScreen 2022-10-25 21:18:28 +02:00
Emmanuele Sassi 85827e5d29 Merge branch 'develop' into SplashScreen 2022-10-25 21:15:55 +02:00
Emmanuele Sassi 96432122a2 Merge branch 'develop' into SplashScreen 2022-10-24 20:29:20 +02:00
Emmanuele Sassi 6e55664281 - Aggiornamento splashscreen 2022-10-24 12:54:36 +02:00
Emmanuele Sassi b348229691 Merge branch 'develop' into SplashScreen 2022-10-24 11:43:09 +02:00
Emmanuele Sassi 8d20b2f190 - aggiunto SplashScreen di test 2022-10-18 17:26:38 +02:00
68 changed files with 4267 additions and 590 deletions
+7 -1
View File
@@ -3,18 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32002.261
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Icarus", "Icarus/Icarus.vbproj", "{BCDE0368-2C69-4948-8723-D0FE71417986}"
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Icarus", "Icarus\Icarus.vbproj", "{BCDE0368-2C69-4948-8723-D0FE71417986}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.ActiveCfg = Debug|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.Build.0 = Debug|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x86.ActiveCfg = Debug|x86
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x86.Build.0 = Debug|x86
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.ActiveCfg = Release|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.Build.0 = Release|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x86.ActiveCfg = Release|x86
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+8
View File
@@ -5,6 +5,14 @@
Protected Overrides Sub OnStartup(e As StartupEventArgs)
MyBase.OnStartup(e)
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
If e.Args.Count = 0 Then
' creo finestra SplashScreen
Dim SplashScreen As New SplashScreen
Me.MainWindow = SplashScreen
Me.MainWindow.Show()
Map.SetRefSplashScreen(SplashScreen)
End If
' Creo la View principale
Me.MainWindow = New MainWindowV
' Mostro la View principale
+6 -2
View File
@@ -3,7 +3,6 @@
Public Const TABLE = "Table"
Public Const TABLE_OUTLINE = "TableOutline"
Public Const PART = "Part"
Public Const ORIGINAL_SOLID = "OriginalSolid"
Public Const PRINT_SOLID = "PrintSolid"
Public Const LAY_MACH_START = "MachStart"
Public Const LAY_REFERENCE = "Frame"
@@ -37,6 +36,7 @@
Public Const KEY_SPEED = "Speed"
Public Const KEY_SLICEID = "SliceId"
Public Const KEY_MASS = "PrintMass"
Public Const KEY_EMITWAITINGTIME = "EmitWaitingTime"
' parametri Materiali
@@ -90,13 +90,15 @@
Public Const MAC_LEADOUTTANGDIST = "LeadOutTangDist"
Public Const MAC_LEADOUTORTHODIST = "LeadOutOrthoDist"
Public Const MAC_COASTINGLEN = "CoastingLen"
Public Const MAC_COASTINGFEED = "CoastingFeed"
Public Const MAC_COASTINGFEEDPU = "CoastingFeedPu"
Public Const MAC_WIPELEN = "WipeLen"
Public Const MAC_WIPEFEEDPU = "WipeFeedPu"
Public Const MAC_WIPEDIR = "WipeDir"
Public Const MAC_FLOORCOUNT = "FloorCount"
Public Const MAC_G0FEED = "G0Feed"
Public Const MAC_G0FEEDZ = "G0FeedZ"
Public Const MAC_TOOLDIAM = "ToolDiam"
Public Const MAC_RIBSTYPE = "RibsType"
Public Const MAC_RIBSOVERLAP = "RibsOverlap"
Public Const MAC_RIBSSTRANDCOUNT = "RibsStrandCount"
Public Const MAC_RIBSLINK = "RibsLink"
@@ -150,5 +152,7 @@
Public Const KEY_ISOFILE_PATH = "IsoFilePath"
Public Const FILE_PATH = "FilePath"
Public Const PART_NAME = "PartName"
Public Const ENTITY_NAME = "EntityName"
End Module
+11
View File
@@ -42,6 +42,7 @@ Public Module ConstIni
Public Const K_MOD_AUXSOLIDS As String = "ModAuxSolids"
Public Const K_MOD_SOLIDSLICE As String = "ModSolidSlice"
Public Const K_MOD_SLICETOOLPATH As String = "ModSliceToolPath"
Public Const K_MOD_OTHERS As String = "ModOthers"
Public Const K_SLC_PRINTSOLID As String = "SlcPrintSolid"
Public Const K_SLC_REFERENCE As String = "SlcReference"
Public Const K_SLC_STARTMACHINING As String = "SlcStartMAchining"
@@ -50,6 +51,7 @@ Public Module ConstIni
Public Const K_SLC_AUXSOLIDS As String = "SlcAuxSolids"
Public Const K_SLC_SOLIDSLICE As String = "SlcSolidSlice"
Public Const K_SLC_SLICETOOLPATH As String = "SlcSliceToolPath"
Public Const K_SLC_OTHERS As String = "SlcOthers"
'Public Const S_LUA As String = "Lua"
'Public Const K_LIBSDIR As String = "LibsDir"
@@ -109,6 +111,15 @@ Public Module ConstIni
Public Const K_CURRMATERIAL As String = "CurrMaterial"
Public Const K_CURRMACHINING As String = "CurrMachining"
Public Const K_VIEWSLIDER As String = "ViewSlider"
Public Const K_IMPORTCURREXTENSION As String = "ImportCurrExtension"
Public Const S_COLORS As String = "Colors"
Public Const K_CLR_PRINTPART As String = "PrintPart"
Public Const K_CLR_RIBS As String = "Ribs"
Public Const K_CLR_SHELLNUMBERS As String = "ShellNumbers"
Public Const K_CLR_AUXSOLIDS As String = "AuxSolids"
Public Const K_CLR_MACHSTART As String = "MachStart"
Public Const K_CLR_OTHERS As String = "Others"
Public Const S_MRUFILES As String = "MruFiles"
Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
+1 -1
View File
@@ -32,7 +32,7 @@
Public Const K_MACH_EXITSCRIPT As String = "ExitScript"
Public Const S_MACH_PRINTING3D As String = "3dPrinting"
Public Const K_HORIZONTAL_PRINT As String = "HorizontalPrint"
Public Const K_SLICINGTYPE As String = "SlicingType"
Public Const K_SPEED_MIN As String = "SpeedMin"
Public Const K_SPEED_MAX As String = "SpeedMax"
+57 -27
View File
@@ -194,8 +194,9 @@ Public Class CurrMachiningCathegory
New CurrComboMachiningParam(MachiningParam.Params.DIRECTION, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEED, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEEDZ, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.CONSTANT, nPartId, nIndex, bForceFromDb)})
New CurrNumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nPartId, nIndex, bForceFromDb)})
Case Cathegories.LINK
m_sName = "Shell"
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.LINKTYPE, nPartId, nIndex, bForceFromDb),
@@ -209,13 +210,14 @@ Public Class CurrMachiningCathegory
New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGLEN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGFEED, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGFEED_PC, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.WIPELEN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.WIPEFEEDPU, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.WIPEFEED_PC, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.WIPEDIR, nPartId, nIndex, bForceFromDb)})
Case Cathegories.RIBS
m_sName = "Ribs"
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nPartId, nIndex, bForceFromDb),
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.RIBSTYPE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLINK, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nPartId, nIndex, bForceFromDb),
@@ -272,13 +274,13 @@ Public Class CurrNumericMachiningParam
Public Overrides Property sValue As String
Get
Return If(m_bIsLen, LenToString(m_dValue, 1), m_dValue)
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get
Set(value As String)
If m_bIsLen Then
StringToLen(value, m_dValue)
Else
m_dValue = value
StringToDouble(value, m_dValue)
End If
NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
@@ -347,15 +349,15 @@ Public Class CurrNumericMachiningParam
Case Params.COASTINGLEN
bReadFromPart = EgtGetInfo(nPartId, MAC_COASTINGLEN, m_dValue)
m_bIsLen = True
Case Params.COASTINGFEED
bReadFromPart = EgtGetInfo(nPartId, MAC_COASTINGFEED, m_dValue)
m_bIsLen = True
Case Params.COASTINGFEED_PC
bReadFromPart = EgtGetInfo(nPartId, MAC_COASTINGFEEDPU, m_dValue)
m_bIsLen = False
Case Params.WIPELEN
bReadFromPart = EgtGetInfo(nPartId, MAC_WIPELEN, m_dValue)
m_bIsLen = True
Case Params.WIPEFEEDPU
Case Params.WIPEFEED_PC
bReadFromPart = EgtGetInfo(nPartId, MAC_WIPEFEEDPU, m_dValue)
m_bIsLen = True
m_bIsLen = False
Case Params.WIPEDIR
bReadFromPart = EgtGetInfo(nPartId, MAC_WIPEDIR, m_dValue)
m_bIsLen = True
@@ -365,6 +367,9 @@ Public Class CurrNumericMachiningParam
Case Params.G0FEED
bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEED, m_dValue)
m_bIsLen = True
Case Params.G0FEEDZ
bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEEDZ, m_dValue)
m_bIsLen = True
Case Params.TOOLDIAM
bReadFromPart = EgtGetInfo(nPartId, MAC_TOOLDIAM, m_dValue)
m_bIsLen = True
@@ -419,7 +424,7 @@ Public Class CurrNumericMachiningParam
Case Params.AUXSOLIDSWIPEDIR
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSWIPEDIR, m_dValue)
m_bIsLen = True
Case Params.CONSTANT
Case Params.FLOWRATE_PC
bReadFromPart = EgtGetInfo(nPartId, MAC_CONSTANT, m_dValue)
m_bIsLen = False
End Select
@@ -427,24 +432,28 @@ Public Class CurrNumericMachiningParam
If nIndex > 0 Then
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
Select Case Type
Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE, Params.FLOORCOUNT, Params.G0FEED, Params.TOOLDIAM, Params.CONSTANT
Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE,
Params.FLOORCOUNT, Params.G0FEED, Params.G0FEEDZ, Params.TOOLDIAM, Params.FLOWRATE_PC
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.LINKPARAM, Params.LINKZUP, Params.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST,
Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED, Params.WIPELEN, Params.WIPEFEEDPU, Params.WIPEDIR
Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED_PC,
Params.WIPELEN, Params.WIPEFEED_PC, Params.WIPEDIR
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LINK).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.RIBSOVERLAP, Params.RIBSSTRANDCOUNT, Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSLEADININVERT,
Params.RIBSLEADINLEN, Params.RIBSLEADOUTINVERT, Params.RIBSLEADOUTLEN, Params.RIBSLEADOUTCOASTING, Params.RIBSLEADOUTWIPE, Params.RIBSLEADOUTWIPEDIR
Case Params.RIBSOVERLAP, Params.RIBSSTRANDCOUNT, Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION,
Params.RIBSLEADININVERT, Params.RIBSLEADINLEN, Params.RIBSLEADOUTINVERT, Params.RIBSLEADOUTLEN, Params.RIBSLEADOUTCOASTING,
Params.RIBSLEADOUTWIPE, Params.RIBSLEADOUTWIPEDIR
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.SHELLNBRDIFFERENCE, Params.SHELLNBRCOASTING, Params.SHELLNBRWIPE, Params.SHELLNBRWIPEDIR
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.SHELL_NUMBER).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.AUXSOLIDSOVERLAP, Params.AUXSOLIDSLINKPARAM, Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE, Params.AUXSOLIDSCOASTINGLEN, Params.AUXSOLIDSWIPELEN, Params.AUXSOLIDSWIPEDIR
Case Params.AUXSOLIDSOVERLAP, Params.AUXSOLIDSLINKPARAM, Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE,
Params.AUXSOLIDSCOASTINGLEN, Params.AUXSOLIDSWIPELEN, Params.AUXSOLIDSWIPEDIR
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.AUX_SOLID).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
End Select
If bForceFromDb OrElse Not bReadFromPart Then
m_dValue = m_DbParam.dOrigValue
m_dOrigValue = m_DbParam.dOrigValue
End If
ElseIf Type = Params.CONSTANT AndAlso Not bReadFromPart Then
ElseIf Type = Params.FLOWRATE_PC AndAlso Not bReadFromPart Then
m_dValue = 100
m_dOrigValue = 100
End If
@@ -486,11 +495,11 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_LEADOUTORTHODIST, sWriteValue)
Case Params.COASTINGLEN
EgtSetInfo(nPartId, MAC_COASTINGLEN, sWriteValue)
Case Params.COASTINGFEED
EgtSetInfo(nPartId, MAC_COASTINGFEED, sWriteValue)
Case Params.COASTINGFEED_PC
EgtSetInfo(nPartId, MAC_COASTINGFEEDPU, sWriteValue)
Case Params.WIPELEN
EgtSetInfo(nPartId, MAC_WIPELEN, sWriteValue)
Case Params.WIPEFEEDPU
Case Params.WIPEFEED_PC
EgtSetInfo(nPartId, MAC_WIPEFEEDPU, sWriteValue)
Case Params.WIPEDIR
EgtSetInfo(nPartId, MAC_WIPEDIR, sWriteValue)
@@ -498,6 +507,8 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_FLOORCOUNT, sWriteValue)
Case Params.G0FEED
EgtSetInfo(nPartId, MAC_G0FEED, sWriteValue)
Case Params.G0FEEDZ
EgtSetInfo(nPartId, MAC_G0FEEDZ, sWriteValue)
Case Params.TOOLDIAM
EgtSetInfo(nPartId, MAC_TOOLDIAM, sWriteValue)
Case Params.RIBSOVERLAP
@@ -534,7 +545,7 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_AUXSOLIDSWIPELEN, sWriteValue)
Case Params.AUXSOLIDSWIPEDIR
EgtSetInfo(nPartId, MAC_AUXSOLIDSWIPEDIR, sWriteValue)
Case Params.CONSTANT
Case Params.FLOWRATE_PC
EgtSetInfo(nPartId, MAC_CONSTANT, sWriteValue)
End Select
End Sub
@@ -672,11 +683,16 @@ Public Class CurrComboMachiningParam
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.SLICINGTYPE
Dim nHorizontalPrint As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_HORIZONTAL_PRINT, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical"),
New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal")})
If nHorizontalPrint > 0 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45°"))
Dim nSlicingType As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_SLICINGTYPE, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical")})
If nSlicingType >= 1 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X"))
If nSlicingType >= 2 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y"))
If nSlicingType >= 3 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
End If
End If
End If
Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_SLICINGTYPE, nSelValue)
@@ -719,6 +735,13 @@ Public Class CurrComboMachiningParam
Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_LEADOUT, nSelValue)
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
Case Params.RIBSTYPE
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_RIBSTYPE.INTERNAL, "Internal"),
New IdNameStruct(Machining.MPAR_RIBSTYPE.EXTERNAL, "External"),
New IdNameStruct(Machining.MPAR_RIBSTYPE.UNBOUNDED, "Unbounded")})
Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSTYPE, nSelValue)
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
Case Params.AUXSOLIDSINFILL
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL.NONE, "None"),
New IdNameStruct(Machining.MPAR_INFILL.OFFSET, "Offset"),
@@ -748,6 +771,8 @@ Public Class CurrComboMachiningParam
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.LINKTYPE, Params.LEADIN, Params.LEADOUT
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LINK).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.RIBSTYPE
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.AUXSOLIDSINFILL, Params.AUXSOLIDSSTRANDORDER, Params.AUXSOLIDSLINKTYPE
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.AUX_SOLID).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
End Select
@@ -755,6 +780,9 @@ Public Class CurrComboMachiningParam
m_SelValue = m_DbParam.OrigSelValue
m_OrigSelValue = m_DbParam.OrigSelValue
End If
ElseIf Type = Params.RIBSTYPE AndAlso Not bReadFromPart Then
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_RIBSTYPE.INTERNAL)
m_SelValue = m_OrigSelValue
End If
End Sub
@@ -772,6 +800,8 @@ Public Class CurrComboMachiningParam
EgtSetInfo(nPartId, MAC_LEADIN, m_SelValue.Id)
Case Params.LEADOUT
EgtSetInfo(nPartId, MAC_LEADOUT, m_SelValue.Id)
Case Params.RIBSTYPE
EgtSetInfo(nPartId, MAC_RIBSTYPE, m_SelValue.Id)
Case Params.AUXSOLIDSINFILL
EgtSetInfo(nPartId, MAC_AUXSOLIDSINFILL, m_SelValue.Id)
Case Params.AUXSOLIDSSTRANDORDER
@@ -186,15 +186,15 @@
<UniformGrid Columns="3">
<RadioButton Content="X"
GroupName="Axes"
IsChecked="{Binding RotAxes[0]}"
IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y"
GroupName="Axes"
IsChecked="{Binding RotAxes[1]}"
IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z"
GroupName="Axes"
IsChecked="{Binding RotAxes[2]}"
IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1"
+46 -18
View File
@@ -21,12 +21,12 @@ Public Class DispositionPanelVM
Dim dNewXPos As Double = ptReference.x
StringToLen(value, dNewXPos)
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference)
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sXPos))
End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set
End Property
@@ -46,12 +46,12 @@ Public Class DispositionPanelVM
Dim dNewYPos As Double = ptReference.y
StringToLen(value, dNewYPos)
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference)
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sYPos))
End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set
End Property
@@ -71,22 +71,38 @@ Public Class DispositionPanelVM
Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference)
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sZPos))
End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set
End Property
Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean()
Private m_RotAxes As Boolean() = { False, False, False}
Public Property RotX As Boolean
Get
Return m_RotAxes
Return m_RotAxes(0)
End Get
Set(value As Boolean())
m_RotAxes = value
Set(value As Boolean)
m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set
End Property
@@ -96,7 +112,7 @@ Public Class DispositionPanelVM
Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then
Else
Return Vector3d.Z_AX
End If
End Get
@@ -109,22 +125,33 @@ Public Class DispositionPanelVM
End Get
Set(value As String)
Dim dNewAngle As Double = 0
If Not StringToLen(value, dNewAngle) Then
If IsNothing( value) OrElse Not StringToLen(value, dNewAngle) Then
m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle))
Return
End If
Dim vtMovedPart As Vector3d
if EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart", vtMovedPart) Then
Dim nEntId = EgtGetFirstInGroup( Map.refTopPanelVM.SelPart.nPrintSolidLayerId)
While nEntId <> GDB_ID.NULL
EgtMove(nEntId, -vtMovedPart, GDB_RT.GLOB)
nEntId = EgtGetNext( nEntId)
End While
EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart")
End If
Dim b3PrintSolid As New BBox3d
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid)
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle) Then
EgtDraw()
RefreshPos()
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
m_sRotAngle = 0
Map.refReferencePanelVM.UpdateFramePosition()
RefreshPos()
EgtDraw()
NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else
m_sRotAngle = value
End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set
End Property
@@ -178,7 +205,8 @@ Public Class DispositionPanelVM
End Sub
Friend Sub Init()
RotZ = True
NotifyPropertyChanged(NameOf(RotZ))
End Sub
Friend Sub RefreshPos()
+56 -17
View File
@@ -53,6 +53,28 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\Debug\</OutputPath>
<DocumentationFile>Icarus.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\Release\</OutputPath>
<DocumentationFile>Icarus.xml</DocumentationFile>
<Optimize>true</Optimize>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtUILib, Version=2.4.7.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -123,11 +145,10 @@
<DependentUpon>DispositionPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="DispositionPanel\DispositionPanelVM.vb" />
<Compile Include="ImportPanel\ImportPanelV.xaml.vb">
<DependentUpon>ImportPanelV.xaml</DependentUpon>
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml.vb">
<DependentUpon>ImportExportMachiningPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ImportPanel\ImportPanelVM.vb" />
<Compile Include="ImportPanel\ImportUtility.vb" />
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelVM.vb" />
<Compile Include="InstrumentPanel\InstrumentPanelV.xaml.vb">
<DependentUpon>InstrumentPanelV.xaml</DependentUpon>
</Compile>
@@ -154,16 +175,16 @@
<DependentUpon>MachSaveInDbWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="MachSaveInDbWnd\MachSaveInDbWndVM.vb" />
<Compile Include="ManagePartPanel\ManagePartPanelV.xaml.vb">
<DependentUpon>ManagePartPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ManagePartPanel\ManagePartPanelVM.vb" />
<Compile Include="ManagePartPanel\ManagePartUtility.vb" />
<Compile Include="MaterialDb\Material.vb" />
<Compile Include="MaterialDb\MaterialDbV.xaml.vb">
<DependentUpon>MaterialDbV.xaml</DependentUpon>
</Compile>
<Compile Include="MaterialDb\MaterialDbVM.vb" />
<Compile Include="ModifyPartPanel\ModifyPartPanelV.xaml.vb">
<DependentUpon>ModifyPartPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ModifyPartPanel\ModifyPartPanelVM.vb" />
<Compile Include="ModifyPartPanel\ModifyPartUtility.vb" />
<Compile Include="OptionsWindow\MachineBox.xaml.vb">
<DependentUpon>MachineBox.xaml</DependentUpon>
</Compile>
@@ -240,6 +261,9 @@
</Compile>
<Compile Include="Special-3dPrinting\Printing3DPanelVM.vb" />
<Compile Include="Special-3dPrinting\Printing3DUtility.vb" />
<Compile Include="SplashScreen\SplashScreen.xaml.vb">
<DependentUpon>SplashScreen.xaml</DependentUpon>
</Compile>
<Compile Include="StartMachPanel\StartMachPanelV.xaml.vb">
<DependentUpon>StartMachPanelV.xaml</DependentUpon>
</Compile>
@@ -301,9 +325,9 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ImportPanel\ImportPanelV.xaml">
<SubType>Designer</SubType>
<Page Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="InstrumentPanel\InstrumentPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -345,14 +369,14 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ManagePartPanel\ManagePartPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MaterialDb\MaterialDbV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ModifyPartPanel\ModifyPartPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="OptionsWindow\MachineBox.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -429,6 +453,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SplashScreen\SplashScreen.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StartMachPanel\StartMachPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -633,10 +661,21 @@
<ItemGroup>
<Resource Include="Resources\TopPanel\Edit.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="Resources\MachiningDb\Export.png" />
<Resource Include="Resources\MachiningDb\Import.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SplashScreen\GoldSplashscreen.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SplashScreen\LogoEgalware.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR32.exe
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Icarus\IcarusD32.exe
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Icarus\IcarusD64.exe</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -0,0 +1,62 @@
<EgtWPFLib5:EgtCustomWindow x:Class="ImportExportMachiningPanelV"
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"
Title="{Binding OkMsg}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
Width="400" Height="500">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="7*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding MachiningList}">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningItem}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Name="ActiveTxBx"
Grid.Column="0"
IsChecked="{Binding Active}"
Height="15"
Width="15"
Margin="0,0,5,0"
VerticalContentAlignment="Center"
Visibility="{Binding Path=DataContext.Active_Visibility,
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
<TextBlock Grid.Column="1"
Text="{Binding sName}"
FontSize="15"
Margin="0,0,5,0"
VerticalAlignment="Center" />
<Ellipse Grid.Column="2"
Width="15"
Height="15"
Fill="DarkOrange"
Visibility="{Binding Overwrite_Visibility}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Command="{Binding OkCommand}"
Content="{Binding OkMsg}"
IsEnabled="{Binding IsEnabledOkBtn, Mode=OneWay}"
Grid.Row="1"
Height="30" Width="100"
Margin="10" />
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class ImportExportMachiningPanelV
Private WithEvents m_ImportExportMachiningPanelVM As ImportExportMachiningPanelVM
Sub New(Owner As Window, ImportExportMachiningPanelVM As ImportExportMachiningPanelVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ImportExportMachiningPanelVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ImportExportMachiningPanelVM = ImportExportMachiningPanelVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ImportExportMachiningPanelVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,441 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class ImportExportMachiningPanelVM
Inherits VMBase
' Modalita' di apertura della finestra
Public Enum WindowModeEnum As Integer
IMPORT
EXPORT
End Enum
Private m_WindowMode As WindowModeEnum
Public ReadOnly Property WindowMode As WindowModeEnum
Get
Return m_WindowMode
End Get
End Property
' Lista delle lavorazioni
Private m_MachiningList As New ObservableCollection(Of ImpExpMachiningItem)
Public Property MachiningList As ObservableCollection(Of ImpExpMachiningItem)
Get
Return m_MachiningList
End Get
Set(value As ObservableCollection(Of ImpExpMachiningItem))
m_MachiningList = value
End Set
End Property
' Percorso del file da cui importare le lavorazioni
Private m_ImportFilePath As String
Public ReadOnly Property ImportFilePath As String
Get
Return m_ImportFilePath
End Get
End Property
' Lista delle lavorazioni presenti nel file da cui importare
Private m_ImportFileMachiningNameList As String()
Public ReadOnly Property ImportFileMachiningNameList As String()
Get
Return m_ImportFileMachiningNameList
End Get
End Property
' Lista delle lavorazioni importate con successo
Private m_vsImported As String()
Public ReadOnly Property vsImported As String()
Get
Return m_vsImported
End Get
End Property
Public ReadOnly Property IsEnabledOkBtn As Boolean
Get
For Each Machining In MachiningList
If Machining.Active Then Return True
Next
Return False
End Get
End Property
Friend Event m_CloseWindow(bDialogResult As Boolean)
' Definizione comandi
Private m_cmdOk As ICommand
#Region "MESSAGES"
Public ReadOnly Property OkMsg As String
Get
If WindowMode = WindowModeEnum.IMPORT Then
Return EgtMsg(31450)
Else
Return EgtMsg(31451)
End If
End Get
End Property
#End Region ' Messages
#Region "CONSTRUCTOR"
' export
Sub New()
m_WindowMode = WindowModeEnum.EXPORT
' carico lista lavorazioni
MachiningList.Clear()
' leggo ed aggiungo le altre
Dim nIndex As Integer = 1
Dim sGUID As String = ""
Dim sName As String = ""
Dim sMaterials As String = ""
While ReadMachiningParamString(nIndex, MAC_GUID, "", sGUID) > 0
Dim Guid As Guid = Guid.Empty
Guid.TryParse(sGUID, Guid)
ReadMachiningParamString(nIndex, MAC_NAME, "", sName)
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, False))
nIndex += 1
End While
ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn
End Sub
' import
Sub New(sImportFilePath As String)
m_WindowMode = WindowModeEnum.IMPORT
m_ImportFilePath = sImportFilePath
' carico lista lavorazioni
MachiningList.Clear()
' leggo ed aggiungo le altre
Dim nIndex As Integer = 1
Dim sGUID As String = ""
Dim sName As String = ""
Dim sMaterials As String = ""
While ReadMachiningParamString(nIndex, MAC_GUID, "", sGUID, sImportFilePath) > 0
Dim Guid As Guid = Guid.Empty
Guid.TryParse(sGUID, Guid)
ReadMachiningParamString(nIndex, MAC_NAME, "", sName, sImportFilePath)
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, AlreadyExist(sName)))
nIndex += 1
End While
ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn
End Sub
#End Region ' Constructor
#Region "METHODS"
Private Sub EnableOkBtn()
NotifyPropertyChanged(NameOf(IsEnabledOkBtn))
End Sub
Private Function AlreadyExist(MachiningName As String) As Boolean
Return Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = MachiningName)
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "OkCommand"
''' <summary>
''' Returns a command that remove the current selected machining.
''' </summary>
Public ReadOnly Property OkCommand() As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf ConfirmImpExpMachinings)
End If
Return m_cmdOk
End Get
End Property
''' <summary>
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
''' </summary>
Public Sub ConfirmImpExpMachinings(param As Object)
Select Case WindowMode
Case WindowModeEnum.IMPORT
Dim OrigFilePath As String = CurrentMachine.sMachiningFilePath
Dim NewMachining As Machining = Nothing
For Each Machining In m_MachiningList
Dim nIndex As Integer = Map.refMachiningDbVM.MachiningList.Max(Function(x) x.nIndex) + 1
If Machining.Active Then
CurrentMachine.SetMachiningFilePath(ImportFilePath)
' leggo lavorazione da file di import
NewMachining = New Machining(Machining.nIndex)
' cambio guid, indice e verifico nome
NewMachining.sGUID = Guid.NewGuid.ToString()
NewMachining.SetIndex(nIndex)
If Machining.AlreadyExist Then
If Machining.ChangeName Then
NewMachining.sName = Machining.sName
End If
End If
Map.refMachiningDbVM.MachiningList.Add(NewMachining)
' ripristino path corretta del Db
CurrentMachine.SetMachiningFilePath(OrigFilePath)
' salvo la lavorazione
NewMachining.Save()
End If
Next
' ripristino path corretta del Db
CurrentMachine.SetMachiningFilePath(OrigFilePath)
' seleziono ultima importata
If Not IsNothing(NewMachining) Then
Map.refMachiningDbVM.SelMachining = NewMachining
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.SelMachining))
End If
Case WindowModeEnum.EXPORT
' recupero le lavorazioni checkate
Dim FinalNameList As New List(Of String)
For Each Machining In MachiningList
If Machining.Active Then
FinalNameList.Add(Machining.sName)
End If
Next
If FinalNameList.Count() = 0 Then Return
Dim FinalNameArray = FinalNameList.ToArray()
' chiedo il nome con cui salvare il file .data
Dim SaveFileDlg As New System.Windows.Forms.SaveFileDialog() With {
.Title = EgtMsg(31451) & " " & EgtMsg(31452),
.Filter = "File data (*.data)|*.data|Tutti i file (*.*)|*.*",
.FileName = String.Empty
}
If SaveFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
Dim sFilePath As String = String.Empty
sFilePath = SaveFileDlg.FileName
' se esiste già lo elimino
If File.Exists(sFilePath) Then
Try
File.Delete(sFilePath)
Catch ex As Exception
End Try
End If
' creo nuovo file
If Not File.Exists(sFilePath) Then
Try
File.WriteAllLines(sFilePath, {"; Commento per evitare BOM con UTF-8"})
Catch ex As Exception
End Try
End If
Dim ActiveMachiningList As List(Of Machining) = (From Machining In Map.refMachiningDbVM.MachiningList
Select Machining
Where m_MachiningList.Any(Function(x) x.sGUID.ToString() = Machining.sGUID AndAlso x.Active)).ToList()
' salvo tutte le lavorazioni sul Db
For Index = 0 To ActiveMachiningList.Count - 1
ActiveMachiningList(Index).WriteParamsOnDb(Index + 1, sFilePath)
Next
End Select
' Chiusura finestra
RaiseEvent m_CloseWindow(True)
End Sub
#End Region ' OkCommand
#End Region ' Commands
End Class
Public Class ImpExpMachiningItem
Inherits VMBase
Public Const IMPEXTNAME As String = "_imp"
' Actions
Friend Shared m_delEnableOkBtn As Action
Private Shared m_Empty As New MachiningIndex(-1, Guid.Empty, "None")
Private m_nIndex As Integer
Public ReadOnly Property nIndex As Integer
Get
Return m_nIndex
End Get
End Property
Private m_sGUID As Guid
Public ReadOnly Property sGUID As Guid
Get
Return m_sGUID
End Get
End Property
Private m_sOrigName As String
Private m_sName As String
Public ReadOnly Property sName As String
Get
Return m_sName
End Get
End Property
Private m_Active As Boolean
Public Property Active As Boolean
Get
Return m_Active
End Get
Set(value As Boolean)
' se esiste gia' chiedo se sovrascriverla
If value Then
If m_AlreadyExist Then
Select Case System.Windows.MessageBox.Show(EgtMsg(31453), "", MessageBoxButton.YesNoCancel)
Case MessageBoxResult.Yes
m_ChangeName = False
m_Active = True
Case MessageBoxResult.No
Dim bImpNameAlreadyInList = False
Dim nImpNameIndex As Integer = 0
If Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXTNAME) Then
nImpNameIndex += 1
While Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXTNAME & "_" & nImpNameIndex)
nImpNameIndex += 1
End While
End If
m_sName = m_sOrigName & IMPEXTNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
NotifyPropertyChanged(NameOf(sName))
m_ChangeName = True
m_Active = True
Case Else
m_Active = False
End Select
NotifyPropertyChanged(NameOf(Active))
Else
m_Active = True
End If
Else
m_ChangeName = False
m_Active = False
m_sName = m_sOrigName
NotifyPropertyChanged(NameOf(sName))
End If
NotifyPropertyChanged(NameOf(Overwrite_Visibility))
If Not IsNothing(m_delEnableOkBtn) Then m_delEnableOkBtn()
End Set
End Property
' Parametro che indica se questo item da importare esiste gia'
Private m_AlreadyExist As Boolean
Friend ReadOnly Property AlreadyExist As Boolean
Get
Return m_AlreadyExist
End Get
End Property
Private m_Overwrite_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Overwrite_Visibility As Visibility
Get
Return If(m_Active AndAlso m_AlreadyExist AndAlso Not m_ChangeName, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
' Parametro che indica se cambiare il nome di un item che esiste gia' o sovrascriverlo
Private m_ChangeName As Boolean
Friend Property ChangeName As Boolean
Get
Return m_ChangeName
End Get
Set(value As Boolean)
m_ChangeName = value
End Set
End Property
Sub New(nIndex As Integer, GUID As Guid, sName As String, AlreadyExist As Boolean)
m_nIndex = nIndex
m_sGUID = GUID
m_sOrigName = sName
m_sName = sName
m_AlreadyExist = AlreadyExist
m_Active = False
End Sub
Friend Shared Function Empty() As MachiningIndex
Return m_Empty
End Function
End Class
Public Class MachiningItem
Inherits VMBase
' Actions
Friend Shared m_delEnableOkBtn As Action
Private m_Name As String
Public Property Name As String
Get
If m_ChangeName Then
Return m_Name & "_imp"
Else
Return m_Name
End If
End Get
Set(value As String)
m_Name = value
End Set
End Property
Private m_Active As Boolean
Public Property Active As Boolean
Get
Return m_Active
End Get
Set(value As Boolean)
' se esiste gia' chiedo se sovrascriverla
If value Then
If m_AlreadyExist Then
Select Case System.Windows.MessageBox.Show(EgtMsg(31453), "", MessageBoxButton.YesNoCancel)
Case MessageBoxResult.Yes
m_ChangeName = False
m_Active = True
Case MessageBoxResult.No
System.Windows.MessageBox.Show(EgtMsg(31454), "", MessageBoxButton.OK)
m_ChangeName = True
m_Active = True
Case Else
m_Active = False
End Select
NotifyPropertyChanged("Active")
Else
m_Active = True
End If
Else
m_ChangeName = False
m_Active = False
End If
If Not IsNothing(m_delEnableOkBtn) Then m_delEnableOkBtn()
End Set
End Property
' Parametro che indica se questo item da importare esiste gia'
Private m_AlreadyExist As Boolean
Friend ReadOnly Property AlreadyExist As Boolean
Get
Return m_AlreadyExist
End Get
End Property
' Parametro che indica se cambiare il nome di un item che esiste gia' o sovrascriverlo
Private m_ChangeName As Boolean
Friend Property ChangeName As Boolean
Get
Return m_ChangeName
End Get
Set(value As Boolean)
m_ChangeName = value
NotifyPropertyChanged("Name")
End Set
End Property
Sub New(Name As String, AlreadyExist As Boolean)
m_Name = Name
m_AlreadyExist = AlreadyExist
End Sub
End Class
+4 -2
View File
@@ -15,7 +15,8 @@
<TabItem Header="NULL">
</TabItem>
<TabItem Header="IMPORT">
<PrintApp:ImportPanelV DataContext="{StaticResource ImportPanelVM}"/>
<!--<PrintApp:ImportPanelV DataContext="{StaticResource ImportPanelVM}"/>-->
<PrintApp:ManagePartPanelV DataContext="{StaticResource ManagePartPanelVM}"/>
</TabItem>
<TabItem Header="DISPOSITION">
<PrintApp:DispositionPanelV DataContext="{StaticResource DispositionPanelVM}"/>
@@ -36,7 +37,8 @@
<Button Height="100"/>
</TabItem>
<TabItem Header="MODIFYPART">
<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>
<!--<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>-->
<PrintApp:ManagePartPanelV DataContext="{StaticResource ManagePartPanelVM}"/>
</TabItem>
</TabControl>
+2 -1
View File
@@ -55,7 +55,8 @@ Public Class LeftPanelVM
Case Panels.SHELLNUMBER
Map.refShellNumberPanelVM.Init()
Case Panels.MODIFYPART
Map.refModifyPartPanelVM.Init()
''Map.refModifyPartPanelVM.Init()
Map.refManagePartPanelVM.Init(ManagePartPanelVM.ManagePartType.MODIFY)
End Select
Map.refViewLayerManagerVM.UpdateForced()
NotifyPropertyChanged(NameOf(SelPanel))
+186 -138
View File
@@ -8,8 +8,9 @@ Public Class Machining
Public Enum MPAR_SLICINGTYPE As Integer
VERTICAL = 1
HORIZONTAL = 2
DEG45 = 3
DEG45 = 2
DEG45_Y = 3
HORIZONTAL = 4
End Enum
Public Enum MPAR_STRANDORDERS As Integer
@@ -34,6 +35,12 @@ Public Class Machining
ARC = 3
End Enum
Public Enum MPAR_RIBSTYPE As Integer
INTERNAL = 1
EXTERNAL = 2
UNBOUNDED = 3
End Enum
Public Enum MPAR_INFILL As Integer
NONE = 1
OFFSET = 2
@@ -64,6 +71,9 @@ Public Class Machining
Return m_nIndex
End Get
End Property
Friend Sub SetIndex(nValue As Integer)
m_nIndex = nValue
End Sub
Protected m_sGUID As String = ""
Public Property sGUID As String
@@ -178,11 +188,11 @@ Public Class Machining
Next
End Sub
Friend Sub WriteParamsOnDb(nIndex As Integer)
WriteMachiningParam(nIndex, MAC_GUID, m_sGUID)
WriteMachiningParam(nIndex, MAC_NAME, m_sName)
Friend Sub WriteParamsOnDb(nIndex As Integer, Optional sFilePath As String = "")
WriteMachiningParam(nIndex, MAC_GUID, m_sGUID, sFilePath)
WriteMachiningParam(nIndex, MAC_NAME, m_sName, sFilePath)
For Each Cathegory In m_CathegoryList
Cathegory.WriteParamOnDb(nIndex)
Cathegory.WriteParamOnDb(nIndex, sFilePath)
Next
End Sub
@@ -297,8 +307,9 @@ Public Class MachiningCathegory
New ComboMachiningParam(MachiningParam.Params.DIRECTION, nIndex),
New NumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nIndex),
New NumericMachiningParam(MachiningParam.Params.G0FEED, nIndex),
New NumericMachiningParam(MachiningParam.Params.G0FEEDZ, nIndex),
New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, nIndex),
New NumericMachiningParam(MachiningParam.Params.CONSTANT, nIndex)})
New NumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nIndex)})
Case Cathegories.LINK
m_sName = "Shell"
m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.LINKTYPE, nIndex),
@@ -312,13 +323,14 @@ Public Class MachiningCathegory
New NumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nIndex),
New NumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nIndex),
New NumericMachiningParam(MachiningParam.Params.COASTINGLEN, nIndex),
New NumericMachiningParam(MachiningParam.Params.COASTINGFEED, nIndex),
New NumericMachiningParam(MachiningParam.Params.COASTINGFEED_PC, nIndex),
New NumericMachiningParam(MachiningParam.Params.WIPELEN, nIndex),
New NumericMachiningParam(MachiningParam.Params.WIPEFEEDPU, nIndex),
New NumericMachiningParam(MachiningParam.Params.WIPEFEED_PC, nIndex),
New NumericMachiningParam(MachiningParam.Params.WIPEDIR, nIndex)})
Case Cathegories.RIBS
m_sName = "Ribs"
m_MachiningParamList = New List(Of MachiningParam)({New NumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nIndex),
m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.RIBSTYPE, nIndex),
New NumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nIndex),
New NumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nIndex),
New CheckMachiningParam(MachiningParam.Params.RIBSLINK, nIndex),
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nIndex),
@@ -371,12 +383,12 @@ Public Class MachiningCathegory
Next
End Sub
Friend Sub WriteParamOnDb(nIndex As Integer)
Friend Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
If Type = Cathegories.MATERIALS Then
WriteMachiningParamSplit(nIndex, MAC_MATERIALS, "")
WriteMachiningParamSplit(nIndex, MAC_MATERIALS, "", sFilePath)
End If
For Each Param In m_MachiningParamList
Param.WriteParamOnDb(nIndex)
Param.WriteParamOnDb(nIndex, sFilePath)
Next
End Sub
@@ -406,41 +418,43 @@ Public MustInherit Class MachiningParam
LEADOUTTANGDIST = 19
LEADOUTORTHODIST = 20
COASTINGLEN = 21
COASTINGFEED = 22
COASTINGFEED_PC = 22
WIPELEN = 23
WIPEFEEDPU = 24
WIPEFEED_PC = 24
FLOORCOUNT = 25
G0FEED = 26
TOOLDIAM = 27
RIBSOVERLAP = 28
RIBSSTRANDCOUNT = 29
RIBSLINK = 30
RIBSINVERTORDER = 31
RIBSINVERTDIRECTION = 32
RIBSLEADININVERT = 33
RIBSLEADINLEN = 34
RIBSLEADOUTINVERT = 35
RIBSLEADOUTLEN = 36
RIBSLEADOUTCOASTING = 37
RIBSLEADOUTWIPE = 38
RIBSLEADOUTWIPEDIR = 39
SHELLNBRDIFFERENCE = 40
SHELLNBRCOASTING = 41
SHELLNBRWIPE = 42
SHELLNBRWIPEDIR = 43
AUXSOLIDSOVERLAP = 44
AUXSOLIDSINFILL = 45
AUXSOLIDSSTRANDORDER = 46
AUXSOLIDSLINKTYPE = 47
AUXSOLIDSLINKPARAM = 48
AUXSOLIDSSTARTPOINTOFFSETONSLICE = 49
AUXSOLIDSCOASTINGLEN = 50
AUXSOLIDSWIPELEN = 51
AUXSOLIDSWIPEDIR = 52
SPIRALVASE = 53
WIPEDIR = 54
STRANDOVERLAP = 55
CONSTANT = 56
G0FEEDZ = 27
TOOLDIAM = 28
RIBSTYPE = 29
RIBSOVERLAP = 30
RIBSSTRANDCOUNT = 31
RIBSLINK = 32
RIBSINVERTORDER = 33
RIBSINVERTDIRECTION = 34
RIBSLEADININVERT = 35
RIBSLEADINLEN = 36
RIBSLEADOUTINVERT = 37
RIBSLEADOUTLEN = 38
RIBSLEADOUTCOASTING = 39
RIBSLEADOUTWIPE = 40
RIBSLEADOUTWIPEDIR = 41
SHELLNBRDIFFERENCE = 42
SHELLNBRCOASTING = 43
SHELLNBRWIPE = 44
SHELLNBRWIPEDIR = 45
AUXSOLIDSOVERLAP = 46
AUXSOLIDSINFILL = 47
AUXSOLIDSSTRANDORDER = 48
AUXSOLIDSLINKTYPE = 49
AUXSOLIDSLINKPARAM = 50
AUXSOLIDSSTARTPOINTOFFSETONSLICE = 51
AUXSOLIDSCOASTINGLEN = 52
AUXSOLIDSWIPELEN = 53
AUXSOLIDSWIPEDIR = 54
SPIRALVASE = 55
WIPEDIR = 56
STRANDOVERLAP = 57
FLOWRATE_PC = 58
MATERIALS = 100
End Enum
@@ -501,20 +515,24 @@ Public MustInherit Class MachiningParam
m_sName = "Lead Out Ortho Dist"
Case Params.COASTINGLEN
m_sName = "Coasting Len"
Case Params.COASTINGFEED
m_sName = "Coasting Feed"
Case Params.COASTINGFEED_PC
m_sName = "Coasting Feed [%]"
Case Params.WIPELEN
m_sName = "Wipe Len"
Case Params.WIPEFEEDPU
m_sName = "Wipe Feed Pu"
Case Params.WIPEFEED_PC
m_sName = "Wipe Feed [%]"
Case Params.FLOORCOUNT
m_sName = "Floor Count"
Case Params.G0FEED
m_sName = "G0 Feed"
Case Params.G0FEEDZ
m_sName = "G0 Feed Z"
Case Params.TOOLDIAM
m_sName = "Nozzle Diameter"
Case Params.RIBSTYPE
m_sName = "Type"
Case Params.RIBSOVERLAP
m_sName = "Overlap"
m_sName = "Overlap [%]"
Case Params.RIBSSTRANDCOUNT
m_sName = "Strand Count"
Case Params.RIBSLINK
@@ -536,7 +554,7 @@ Public MustInherit Class MachiningParam
Case Params.RIBSLEADOUTWIPE
m_sName = "Lead Out Wipe"
Case Params.RIBSLEADOUTWIPEDIR
m_sName = "Lead Out Wipe Dir"
m_sName = "Lead Out Wipe Dir [deg]"
Case Params.SHELLNBRDIFFERENCE
m_sName = "Difference"
Case Params.SHELLNBRCOASTING
@@ -544,9 +562,9 @@ Public MustInherit Class MachiningParam
Case Params.SHELLNBRWIPE
m_sName = "Wipe"
Case Params.SHELLNBRWIPEDIR
m_sName = "Wipe Direction"
m_sName = "Wipe Direction [deg]"
Case Params.AUXSOLIDSOVERLAP
m_sName = "Overlap"
m_sName = "Overlap [%]"
Case Params.AUXSOLIDSINFILL
m_sName = "Infill"
Case Params.AUXSOLIDSSTRANDORDER
@@ -562,15 +580,15 @@ Public MustInherit Class MachiningParam
Case Params.AUXSOLIDSWIPELEN
m_sName = "Wipe Length"
Case Params.AUXSOLIDSWIPEDIR
m_sName = "Wipe Direction"
m_sName = "Wipe Direction [deg]"
Case Params.SPIRALVASE
m_sName = "Spiral Vase"
Case Params.WIPEDIR
m_sName = "Wipe Direction"
m_sName = "Wipe Direction [deg]"
Case Params.STRANDOVERLAP
m_sName = "Strand Overlap"
Case Params.CONSTANT
m_sName = "Constant"
m_sName = "Strand Overlap [%]"
Case Params.FLOWRATE_PC
m_sName = "Flow rate [%]"
End Select
End Sub
@@ -579,7 +597,7 @@ Public MustInherit Class MachiningParam
m_sName = sName
End Sub
Friend MustOverride Sub WriteParamOnDb(nIndex As Integer)
Friend MustOverride Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Friend Overridable Sub WriteParamInPart(nIndex As Integer)
End Sub
Friend MustOverride Sub SaveParam()
@@ -600,15 +618,16 @@ Public Class NumericMachiningParam
End Property
Public Overridable Property sValue As String
Get
Return If(m_bIsLen, LenToString(m_dValue, 1), m_dValue)
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get
Set(value As String)
If m_bIsLen Then
StringToLen(value, m_dValue)
Else
m_dValue = value
StringToDouble(value, m_dValue)
End If
NotifyPropertyChanged(NameOf(sValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -678,24 +697,27 @@ Public Class NumericMachiningParam
Case Params.COASTINGLEN
m_dValue = ReadMachiningParamDouble(nIndex, MAC_COASTINGLEN, 0)
m_bIsLen = True
Case Params.COASTINGFEED
m_dValue = ReadMachiningParamDouble(nIndex, MAC_COASTINGFEED, 0)
m_bIsLen = True
Case Params.COASTINGFEED_PC
m_dValue = ReadMachiningParamDouble(nIndex, MAC_COASTINGFEEDPU, 0)
m_bIsLen = False
Case Params.WIPELEN
m_dValue = ReadMachiningParamDouble(nIndex, MAC_WIPELEN, 0)
m_bIsLen = True
Case Params.WIPEFEEDPU
Case Params.WIPEFEED_PC
m_dValue = ReadMachiningParamDouble(nIndex, MAC_WIPEFEEDPU, 0)
m_bIsLen = True
m_bIsLen = False
Case Params.WIPEDIR
m_dValue = ReadMachiningParamDouble(nIndex, MAC_WIPEDIR, 0)
m_bIsLen = True
Case Params.FLOORCOUNT
m_dValue = ReadMachiningParamDouble(nIndex, MAC_FLOORCOUNT, 0)
m_bIsLen = True
m_bIsLen = False
Case Params.G0FEED
m_dValue = ReadMachiningParamDouble(nIndex, MAC_G0FEED, 0)
m_bIsLen = True
Case Params.G0FEEDZ
m_dValue = ReadMachiningParamDouble(nIndex, MAC_G0FEEDZ, 0)
m_bIsLen = True
Case Params.TOOLDIAM
m_dValue = ReadMachiningParamDouble(nIndex, MAC_TOOLDIAM, 0)
m_bIsLen = True
@@ -750,7 +772,7 @@ Public Class NumericMachiningParam
Case Params.AUXSOLIDSWIPEDIR
m_dValue = ReadMachiningParamDouble(nIndex, MAC_AUXSOLIDSWIPEDIR, 0)
m_bIsLen = True
Case Params.CONSTANT
Case Params.FLOWRATE_PC
m_dValue = ReadMachiningParamDouble(nIndex, MAC_CONSTANT, 100)
m_bIsLen = False
End Select
@@ -758,7 +780,7 @@ Public Class NumericMachiningParam
m_dOrigValue = m_dValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Dim sWriteValue As String = ""
If m_bIsLen Then
sWriteValue = LenToString(m_dValue, 2)
@@ -767,83 +789,85 @@ Public Class NumericMachiningParam
End If
Select Case Type
Case Params.STRANDH
WriteMachiningParam(nIndex, MAC_STRANDH, sWriteValue)
WriteMachiningParam(nIndex, MAC_STRANDH, sWriteValue, sFilePath)
Case Params.STRANDW
WriteMachiningParam(nIndex, MAC_STRANDW, sWriteValue)
WriteMachiningParam(nIndex, MAC_STRANDW, sWriteValue, sFilePath)
Case Params.STRANDCOUNT
WriteMachiningParam(nIndex, MAC_STRANDCOUNT, sWriteValue)
WriteMachiningParam(nIndex, MAC_STRANDCOUNT, sWriteValue, sFilePath)
Case Params.OFFSET
WriteMachiningParam(nIndex, MAC_OFFSET, sWriteValue)
WriteMachiningParam(nIndex, MAC_OFFSET, sWriteValue, sFilePath)
Case Params.STRANDOVERLAP
WriteMachiningParam(nIndex, MAC_STRANDOVERLAP, sWriteValue)
WriteMachiningParam(nIndex, MAC_STRANDOVERLAP, sWriteValue, sFilePath)
Case Params.STARTPOINTOFFSETONSLICE
WriteMachiningParam(nIndex, MAC_STARTPOINTOFFSETONSLICE, sWriteValue)
WriteMachiningParam(nIndex, MAC_STARTPOINTOFFSETONSLICE, sWriteValue, sFilePath)
Case Params.LINKPARAM
WriteMachiningParam(nIndex, MAC_LINKPARAM, sWriteValue)
WriteMachiningParam(nIndex, MAC_LINKPARAM, sWriteValue, sFilePath)
Case Params.LINKZUP
WriteMachiningParam(nIndex, MAC_LINKZUP, sWriteValue)
WriteMachiningParam(nIndex, MAC_LINKZUP, sWriteValue, sFilePath)
Case Params.OFFSETLEADPOINT
WriteMachiningParam(nIndex, MAC_OFFSETLEADPOINT, sWriteValue)
WriteMachiningParam(nIndex, MAC_OFFSETLEADPOINT, sWriteValue, sFilePath)
Case Params.LEADINTANGDIST
WriteMachiningParam(nIndex, MAC_LEADINTANGDIST, sWriteValue)
WriteMachiningParam(nIndex, MAC_LEADINTANGDIST, sWriteValue, sFilePath)
Case Params.LEADINORTHODIST
WriteMachiningParam(nIndex, MAC_LEADINORTHODIST, sWriteValue)
WriteMachiningParam(nIndex, MAC_LEADINORTHODIST, sWriteValue, sFilePath)
Case Params.LEADOUTTANGDIST
WriteMachiningParam(nIndex, MAC_LEADOUTTANGDIST, sWriteValue)
WriteMachiningParam(nIndex, MAC_LEADOUTTANGDIST, sWriteValue, sFilePath)
Case Params.LEADOUTORTHODIST
WriteMachiningParam(nIndex, MAC_LEADOUTORTHODIST, sWriteValue)
WriteMachiningParam(nIndex, MAC_LEADOUTORTHODIST, sWriteValue, sFilePath)
Case Params.COASTINGLEN
WriteMachiningParam(nIndex, MAC_COASTINGLEN, sWriteValue)
Case Params.COASTINGFEED
WriteMachiningParam(nIndex, MAC_COASTINGFEED, sWriteValue)
WriteMachiningParam(nIndex, MAC_COASTINGLEN, sWriteValue, sFilePath)
Case Params.COASTINGFEED_PC
WriteMachiningParam(nIndex, MAC_COASTINGFEEDPU, sWriteValue, sFilePath)
Case Params.WIPELEN
WriteMachiningParam(nIndex, MAC_WIPELEN, sWriteValue)
Case Params.WIPEFEEDPU
WriteMachiningParam(nIndex, MAC_WIPEFEEDPU, sWriteValue)
WriteMachiningParam(nIndex, MAC_WIPELEN, sWriteValue, sFilePath)
Case Params.WIPEFEED_PC
WriteMachiningParam(nIndex, MAC_WIPEFEEDPU, sWriteValue, sFilePath)
Case Params.WIPEDIR
WriteMachiningParam(nIndex, MAC_WIPEDIR, sWriteValue)
WriteMachiningParam(nIndex, MAC_WIPEDIR, sWriteValue, sFilePath)
Case Params.FLOORCOUNT
WriteMachiningParam(nIndex, MAC_FLOORCOUNT, sWriteValue)
WriteMachiningParam(nIndex, MAC_FLOORCOUNT, sWriteValue, sFilePath)
Case Params.G0FEED
WriteMachiningParam(nIndex, MAC_G0FEED, sWriteValue)
WriteMachiningParam(nIndex, MAC_G0FEED, sWriteValue, sFilePath)
Case Params.G0FEEDZ
WriteMachiningParam(nIndex, MAC_G0FEEDZ, sWriteValue, sFilePath)
Case Params.TOOLDIAM
WriteMachiningParam(nIndex, MAC_TOOLDIAM, sWriteValue)
WriteMachiningParam(nIndex, MAC_TOOLDIAM, sWriteValue, sFilePath)
Case Params.RIBSOVERLAP
WriteMachiningParam(nIndex, MAC_RIBSOVERLAP, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSOVERLAP, sWriteValue, sFilePath)
Case Params.RIBSSTRANDCOUNT
WriteMachiningParam(nIndex, MAC_RIBSSTRANDCOUNT, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSSTRANDCOUNT, sWriteValue, sFilePath)
Case Params.RIBSLEADINLEN
WriteMachiningParam(nIndex, MAC_RIBSLEADINLEN, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSLEADINLEN, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTLEN
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTLEN, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTLEN, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTCOASTING
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTCOASTING, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTCOASTING, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTWIPE
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPE, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPE, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTWIPEDIR
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPEDIR, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPEDIR, sWriteValue, sFilePath)
Case Params.SHELLNBRDIFFERENCE
WriteMachiningParam(nIndex, MAC_SHELLNBRDIFFERENCE, sWriteValue)
WriteMachiningParam(nIndex, MAC_SHELLNBRDIFFERENCE, sWriteValue, sFilePath)
Case Params.SHELLNBRCOASTING
WriteMachiningParam(nIndex, MAC_SHELLNBRCOASTING, sWriteValue)
WriteMachiningParam(nIndex, MAC_SHELLNBRCOASTING, sWriteValue, sFilePath)
Case Params.SHELLNBRWIPE
WriteMachiningParam(nIndex, MAC_SHELLNBRWIPE, sWriteValue)
WriteMachiningParam(nIndex, MAC_SHELLNBRWIPE, sWriteValue, sFilePath)
Case Params.SHELLNBRWIPEDIR
WriteMachiningParam(nIndex, MAC_SHELLNBRWIPEDIR, sWriteValue)
WriteMachiningParam(nIndex, MAC_SHELLNBRWIPEDIR, sWriteValue, sFilePath)
Case Params.AUXSOLIDSOVERLAP
WriteMachiningParam(nIndex, MAC_AUXSOLIDSOVERLAP, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSOVERLAP, sWriteValue, sFilePath)
Case Params.AUXSOLIDSLINKPARAM
WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKPARAM, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKPARAM, sWriteValue, sFilePath)
Case Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE
WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, sWriteValue, sFilePath)
Case Params.AUXSOLIDSCOASTINGLEN
WriteMachiningParam(nIndex, MAC_AUXSOLIDSCOASTINGLEN, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSCOASTINGLEN, sWriteValue, sFilePath)
Case Params.AUXSOLIDSWIPELEN
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPELEN, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPELEN, sWriteValue, sFilePath)
Case Params.AUXSOLIDSWIPEDIR
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPEDIR, sWriteValue)
Case Params.CONSTANT
WriteMachiningParam(nIndex, MAC_CONSTANT, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPEDIR, sWriteValue, sFilePath)
Case Params.FLOWRATE_PC
WriteMachiningParam(nIndex, MAC_CONSTANT, sWriteValue, sFilePath)
End Select
End Sub
@@ -869,6 +893,7 @@ Public Class StringMachiningParam
Set(value As String)
m_sValue = value
NotifyPropertyChanged(NameOf(sValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -891,10 +916,10 @@ Public Class StringMachiningParam
m_sOrigValue = m_sValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Select Case Type
Case Params.STRANDH
'WritePrivateProfileString(nIndex, MAC_STRANDH, sWriteValue)
'WritePrivateProfileString(nIndex, MAC_STRANDH, sWriteValue, sFilePath)
End Select
End Sub
@@ -927,6 +952,7 @@ Public Class ComboMachiningParam
Set(value As IdNameStruct)
m_SelValue = value
NotifyPropertyChanged(NameOf(SelValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -943,6 +969,10 @@ Public Class ComboMachiningParam
End Get
End Property
Sub New(Type As Params)
MyBase.New(Type)
End Sub
Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type)
If nIndex = 0 Then
@@ -951,11 +981,16 @@ Public Class ComboMachiningParam
Else
Select Case Type
Case Params.SLICINGTYPE
Dim nHorizontalPrint As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_HORIZONTAL_PRINT, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical"),
New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal")})
If nHorizontalPrint > 0 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45°"))
Dim nSlicingType As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_SLICINGTYPE, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical")})
If nSlicingType >= 1 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X"))
If nSlicingType >= 2 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y"))
If nSlicingType >= 3 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
End If
End If
End If
Dim nSelValue As Double = ReadMachiningParamDouble(nIndex, MAC_SLICINGTYPE, -1)
If nSelValue = -1 Then
@@ -987,6 +1022,11 @@ Public Class ComboMachiningParam
New IdNameStruct(Machining.MPAR_LEADINOUT.LINEAR, "Linear"),
New IdNameStruct(Machining.MPAR_LEADINOUT.ARC, "Arc")})
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = ReadMachiningParamDouble(nIndex, MAC_LEADOUT, 0))
Case Params.RIBSTYPE
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_RIBSTYPE.INTERNAL, "Internal"),
New IdNameStruct(Machining.MPAR_RIBSTYPE.EXTERNAL, "External"),
New IdNameStruct(Machining.MPAR_RIBSTYPE.UNBOUNDED, "Unbounded")})
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = ReadMachiningParamDouble(nIndex, MAC_RIBSTYPE, 1))
Case Params.AUXSOLIDSINFILL
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL.NONE, "None"),
New IdNameStruct(Machining.MPAR_INFILL.OFFSET, "Offset"),
@@ -1006,26 +1046,28 @@ Public Class ComboMachiningParam
m_OrigSelValue = m_SelValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Select Case Type
Case Params.SLICINGTYPE
WriteMachiningParam(nIndex, MAC_SLICING45, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_SLICINGTYPE, m_SelValue.Id, sFilePath)
Case Params.STRANDORDER
WriteMachiningParam(nIndex, MAC_STRANDORDER, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_STRANDORDER, m_SelValue.Id, sFilePath)
Case Params.DIRECTION
WriteMachiningParam(nIndex, MAC_DIRECTION, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_DIRECTION, m_SelValue.Id, sFilePath)
Case Params.LINKTYPE
WriteMachiningParam(nIndex, MAC_LINKTYPE, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_LINKTYPE, m_SelValue.Id, sFilePath)
Case Params.LEADIN
WriteMachiningParam(nIndex, MAC_LEADIN, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_LEADIN, m_SelValue.Id, sFilePath)
Case Params.LEADOUT
WriteMachiningParam(nIndex, MAC_LEADOUT, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_LEADOUT, m_SelValue.Id, sFilePath)
Case Params.RIBSTYPE
WriteMachiningParam(nIndex, MAC_RIBSTYPE, m_SelValue.Id, sFilePath)
Case Params.AUXSOLIDSINFILL
WriteMachiningParam(nIndex, MAC_AUXSOLIDSINFILL, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSINFILL, m_SelValue.Id, sFilePath)
Case Params.AUXSOLIDSSTRANDORDER
WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTRANDORDER, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTRANDORDER, m_SelValue.Id, sFilePath)
Case Params.AUXSOLIDSLINKTYPE
WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKTYPE, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKTYPE, m_SelValue.Id, sFilePath)
End Select
End Sub
@@ -1051,6 +1093,7 @@ Public Class CheckMachiningParam
Set(value As Boolean)
m_bValue = value
NotifyPropertyChanged(NameOf(bValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -1067,6 +1110,10 @@ Public Class CheckMachiningParam
End Get
End Property
Sub New(Type As Params)
MyBase.New(Type)
End Sub
Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type)
If nIndex = 0 Then
@@ -1090,20 +1137,20 @@ Public Class CheckMachiningParam
m_bOrigValue = m_bValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Select Case Type
Case Params.SPIRALVASE
WriteMachiningParam(nIndex, MAC_SPIRALVASE, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_SPIRALVASE, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLINK
WriteMachiningParam(nIndex, MAC_RIBSLINK, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_RIBSLINK, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSINVERTORDER
WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSINVERTDIRECTION
WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLEADININVERT
WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLEADOUTINVERT
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0), sFilePath)
End Select
End Sub
@@ -1139,6 +1186,7 @@ Public Class MaterialMachiningParam
Set(value As Boolean)
m_bValue = value
NotifyPropertyChanged(NameOf(bValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -1162,9 +1210,9 @@ Public Class MaterialMachiningParam
m_bOrigValue = m_bValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Dim sMaterials As String = ""
ReadMachiningParamSplit(nIndex, MAC_MATERIALS, "", sMaterials)
ReadMachiningParamSplit(nIndex, MAC_MATERIALS, "", sMaterials, sFilePath)
Dim MaterialGuidList As New List(Of String)
If Not String.IsNullOrWhiteSpace(sMaterials) Then
MaterialGuidList = sMaterials.Split(";"c).ToList()
@@ -1178,7 +1226,7 @@ Public Class MaterialMachiningParam
For Index = 0 To MaterialGuidList.Count - 1
sMaterials &= MaterialGuidList(Index) & If(Index < MaterialGuidList.Count - 1, ";"c, "")
Next
WriteMachiningParamSplit(nIndex, MAC_MATERIALS, sMaterials)
WriteMachiningParamSplit(nIndex, MAC_MATERIALS, sMaterials, sFilePath)
End Sub
Friend Overrides Sub SaveParam()
+25 -2
View File
@@ -14,20 +14,43 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<UniformGrid Rows="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="New"
Command="{Binding New_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Save"
Grid.Column="1"
Command="{Binding Save_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Delete"
Grid.Column="2"
Command="{Binding Delete_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid>
<Button Grid.Column="3"
Command="{Binding Import_Command}"
ToolTip="{Binding ImportToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/Import.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="4"
Command="{Binding Export_Command}"
ToolTip="{Binding ImportToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/Export.png" Stretch="Uniform"/>
</Button>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
+59 -4
View File
@@ -26,7 +26,7 @@ Public Class MachiningDbVM
' verifico se modificato
If m_SelMachining.bIsModified Then
' chiedo se salvare
Select Case MessageBox.Show("Salvare le modifiche apportate alla lavorazione selezionata?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Select Case MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes
m_SelMachining.Save()
Case MessageBoxResult.No
@@ -50,6 +50,7 @@ Public Class MachiningDbVM
End If
Next
End If
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
End Set
End Property
@@ -105,12 +106,20 @@ Public Class MachiningDbVM
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
End Sub
Public ReadOnly Property ImpExp_IsEnabled As Boolean
Get
Return m_IsEnabled AndAlso (IsNothing(m_SelMachining) OrElse Not m_SelMachining.bIsModified)
End Get
End Property
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdNew As ICommand
Private m_cmdSave As ICommand
Private m_cmdDelete As ICommand
Private m_cmdEditName As ICommand
Private m_cmdImport As ICommand
Private m_cmdExport As ICommand
#End Region ' FIELDS & PROPERTIES
@@ -138,6 +147,7 @@ Public Class MachiningDbVM
GetMainPrivateProfileString(S_PRINTING3D, K_CURRMACHINING, "", sCurrMachining)
m_SelMachining = MachiningList.FirstOrDefault(Function(x) x.sGUID = sCurrMachining)
NotifyPropertyChanged(NameOf(SelMachining))
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
End Sub
Friend Sub SetNameVisibility(bValue As Boolean)
@@ -213,7 +223,7 @@ Public Class MachiningDbVM
' aggiorno combo top
Dim CurrSelTopMachining As MachiningIndex = Map.refTopPanelVM.SelMachining
Map.refTopPanelVM.InitMachiningsList()
Map.refTopPanelVM.SetSelMachining( CurrSelTopMachining)
Map.refTopPanelVM.SetSelMachining(CurrSelTopMachining)
End If
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY
@@ -239,6 +249,7 @@ Public Class MachiningDbVM
m_SelMachining = NewMachining
NotifyPropertyChanged(NameOf(SelMachining))
SetNameVisibility(True)
SetIsModified(True)
End Sub
#End Region ' New
@@ -255,8 +266,9 @@ Public Class MachiningDbVM
End Property
Public Sub Save()
If IsNothing( m_SelMachining) Then Return
If IsNothing(m_SelMachining) Then Return
m_SelMachining.Save()
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
End Sub
#End Region ' Save
@@ -275,7 +287,7 @@ Public Class MachiningDbVM
Public Sub Delete()
If IsNothing(m_SelMachining) Then Return
' chiedo conferma
Select Case MessageBox.Show("Sei sicuro di voler cancellare la lavorazione selezionata?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Select Case MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_MachiningList.Remove(m_SelMachining)
SetIsModified(True)
@@ -305,6 +317,49 @@ Public Class MachiningDbVM
#End Region ' EditName
#Region "Import"
Public ReadOnly Property Import_Command As ICommand
Get
If m_cmdImport Is Nothing Then
m_cmdImport = New Command(AddressOf Import)
End If
Return m_cmdImport
End Get
End Property
Public Sub Import()
' chiedo il nome del file .data da aprire
Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {
.Title = EgtMsg(31451) & " " & EgtMsg(31452),
.Filter = "File data (*.data)|*.data|Tutti i file (*.*)|*.*",
.FileName = String.Empty
}
If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
Dim ImportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(OpenFileDlg.FileName))
ImportWindow.ShowDialog()
End Sub
#End Region ' Import
#Region "Export"
Public ReadOnly Property Export_Command As ICommand
Get
If m_cmdExport Is Nothing Then
m_cmdExport = New Command(AddressOf Export)
End If
Return m_cmdExport
End Get
End Property
Public Sub Export()
Dim ExportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM)
ExportWindow.ShowDialog()
End Sub
#End Region ' Export
#End Region ' COMMANDS
End Class
+2 -2
View File
@@ -195,8 +195,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(3279, 2410, 1, m_nKeyLevel) And
EgtGetKeyOptions(3279, 2410, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2412, 1, m_nKeyLevel) And
EgtGetKeyOptions(3279, 2412, 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())
+9
View File
@@ -19,6 +19,7 @@ Class MainWindowV
AddHandler Me.ContentRendered, AddressOf MainWindowV_ContentRendered
AddHandler Me.Closing, AddressOf MainWindowV_Closing
AddHandler Me.KeyDown, AddressOf MainWindowV_KeyDown
AddHandler Me.StateChanged, AddressOf MainWindowV_StateChanged
End Sub
#End Region ' CONSTRUCTOR
@@ -63,6 +64,14 @@ Class MainWindowV
End If
End Sub
Private Sub MainWindowV_StateChanged(sender As Object, e As EventArgs)
If Not IsNothing(Map.refSecondaryWindowV) AndAlso Not Map.refSecondaryWindowV.WindowChangingState Then
Map.refSecondaryWindowV.WindowState = Me.WindowState
'Application.Current.MainWindow.Topmost = True
'Application.Current.MainWindow.Topmost = False
End If
End Sub
#End Region ' EVENTS
End Class
+5 -1
View File
@@ -285,7 +285,11 @@ Public Class MainWindowVM
' Se non confermata chiusura, esco
If Not bAllowClose Then Return
' salvo modo di visualizzazione
WriteMainPrivateProfileString(S_SCENE, K_SHOWMODE, EgtGetShowMode().ToString)
WriteMainPrivateProfileString(S_SCENE, K_SHOWMODE, EgtGetShowMode().ToString())
' Salvo stato visualizzazione direzione curve
WriteMainPrivateProfileString(S_SCENE, K_CURVEDIR, If(EgtGetShowCurveDirection(), "1", "0"))
' Salvo stato visualizzazione griglia
WriteMainPrivateProfileString(S_GRID, K_SHOWGRID, If(Map.refMyStatusBarVM.bGridVisibility, "1", "0"))
' Termino il Model
m_MainWindowM.Close()
' Termino il programma
@@ -0,0 +1,147 @@
<UserControl x:Class="ManagePartPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Icarus"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Width="150"
Margin="5,0,0,0"
VerticalAlignment="Stretch">
<Grid DockPanel.Dock="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Style="{StaticResource LeftPanelTitle_Border}">
<TextBlock Text="Part Entity List"
FontWeight="DemiBold"
FontSize="14"/>
</Border>
<!--<UniformGrid Grid.Row="1" Rows="1"
IsEnabled="{Binding IsEnabled}">
<Button DockPanel.Dock="Left"
Content="+"
FontSize="20"
Command="{Binding AddPart_Command}"
Style="{StaticResource LeftPanel_Button}"/>
<Button DockPanel.Dock="Left"
Content="-"
FontSize="20"
Command="{Binding RemovePart_Command}"
Style="{StaticResource LeftPanel_Button}"/>
</UniformGrid>-->
<TreeView Grid.Row="2"
ItemsSource="{Binding ManagerPartList}"
MinHeight="200"
IsEnabled="{Binding IsEnabled}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Part}"
ItemsSource="{Binding LayerList}">
<StackPanel Orientation="Horizontal">
<Image Source="/Resources/TreeView/Folder.png"
Height="15"/>
<Grid>
<TextBlock Text="{Binding sName}"
Visibility="{Binding TextBlock_Visibility}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding TextBox_Visibility}"
Style="{StaticResource OptionTextBox}"/>
</Grid>
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Layer}"
ItemsSource="{Binding EntityList, UpdateSourceTrigger=PropertyChanged}">
<StackPanel Orientation="Horizontal">
<Image Source="/Resources/TreeView/Folder.png"
Height="15"/>
<TextBlock Text="{Binding sName}" />
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:PartManager_GeomEntity}">
<Grid>
<TextBlock Text="{Binding sName}" />
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding TextBox_Visibility}"
Style="{StaticResource OptionTextBox}"/>
</Grid>
</HierarchicalDataTemplate>
<!-- Menu' tasto destro -->
<ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
<Setter Property="Header" Value="{Binding sMsg}"/>
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</TreeView.Resources>
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding bIsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<Setter Property="IsExpanded" Value="True"/>
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}"/>
<EventSetter Event="ContextMenuOpening" Handler="Item_ContextMenuOpening"/>
</Style>
</TreeView.ItemContainerStyle>
</TreeView>
<Border Grid.Row="3"
Visibility="{Binding IsImport_Visibility}"
Style="{StaticResource LeftPanelTitle_Border}">
<TextBlock Text="Imported Entity List"
FontWeight="DemiBold"
FontSize="14"/>
</Border>
<ListBox Grid.Row="4"
ItemsSource="{Binding ImportedEntityList, UpdateSourceTrigger=PropertyChanged}"
SelectedItem="{Binding SelImportedEntity}"
MinHeight="100"
IsEnabled="{Binding IsEnabled}"
Visibility="{Binding IsImport_Visibility}">
<ListBox.Resources>
<!-- Menu' tasto destro -->
<ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
<Setter Property="Header" Value="{Binding sMsg}"/>
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch">
<Grid.InputBindings>
<MouseBinding Gesture="LeftDoubleClick"
Command="{Binding GeomEntityDoubleClick_Command}"/>
</Grid.InputBindings>
<TextBlock Text="{Binding ghName}">
</TextBlock>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<UniformGrid Grid.Row="5"
Rows="1"
IsEnabled="{Binding IsEnabled}">
<Button Content="Ok"
Command="{Binding Ok_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Cancel"
Command="{Binding Cancel_Command}"
Visibility="{Binding IsImport_Visibility}"
Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid>
</Grid>
</UserControl>
@@ -0,0 +1,24 @@
Public Class ManagePartPanelV
Protected Sub Item_ContextMenuOpening(sender As Object, e As ContextMenuEventArgs)
Dim PartItem As ManagePart_Part
Dim LayerItem As ManagePart_Layer
Dim EntityItem As PartManager_GeomEntity
Select Case e.OriginalSource.DataContext.GetType()
Case GetType(ManagePart_Part)
PartItem = DirectCast(e.OriginalSource.DataContext, ManagePart_Part)
If PartItem.MenuList.Count = 0 Then
e.Handled = True
End If
Case GetType(ManagePart_Layer)
LayerItem = DirectCast(e.OriginalSource.DataContext, ManagePart_Layer)
e.Handled = True
Case GetType(PartManager_GeomEntity)
EntityItem = DirectCast(e.OriginalSource.DataContext, PartManager_GeomEntity)
If EntityItem.MenuList.Count = 0 Then
e.Handled = True
End If
End Select
End Sub
End Class
+513
View File
@@ -0,0 +1,513 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Public Class ManagePartPanelVM
Inherits VMBase
Public Enum ManagePartType
IMPORT = 1
MODIFY = 2
End Enum
Private m_Type As ManagePartType
Friend ReadOnly Property Type As ManagePartType
Get
Return m_Type
End Get
End Property
Private m_nImportedPartId As Integer = GDB_ID.NULL
Friend ReadOnly Property nImportedPartId As Integer
Get
Return m_nImportedPartId
End Get
End Property
Private m_ImportedEntityList As New ObservableCollection(Of PartManager_GeomEntity)
Public Property ImportedEntityList As ObservableCollection(Of PartManager_GeomEntity)
Get
Return m_ImportedEntityList
End Get
Set(value As ObservableCollection(Of PartManager_GeomEntity))
m_ImportedEntityList = value
End Set
End Property
Private m_SelImportedEntity As PartManager_GeomEntity
Public Property SelImportedEntity As PartManager_GeomEntity
Get
Return m_SelImportedEntity
End Get
Set(value As PartManager_GeomEntity)
m_SelImportedEntity = value
EgtDeselectAll()
If Not IsNothing(m_SelImportedEntity) Then
EgtSelectObj(m_SelImportedEntity.nId)
End If
EgtDraw()
End Set
End Property
Friend Sub SetSelImportedEntity(nId As Integer)
Dim SelEntity As PartManager_GeomEntity = Nothing
' cerco tra entita' importate
SelEntity = m_ImportedEntityList.FirstOrDefault(Function(x) x.nId = nId)
If IsNothing(SelEntity) Then
' cerco tra pezzi creati
For Each ManagePart In m_ManagerPartList
For Each Layer In ManagePart.LayerList
SelEntity = Layer.EntityList.FirstOrDefault(Function(x) x.nId = nId)
If Not IsNothing(SelEntity) Then
SelEntity.bIsSelected = True
SelEntity.NotifyPropertyChanged(NameOf(SelEntity.bIsSelected))
Exit For
End If
Next
If Not IsNothing(SelEntity) Then
Exit For
End If
Next
End If
m_SelImportedEntity = SelEntity
EgtDeselectAll()
If Not IsNothing(m_SelImportedEntity) Then
EgtSelectObj(m_SelImportedEntity.nId)
End If
EgtDraw()
NotifyPropertyChanged(NameOf(SelImportedEntity))
End Sub
Private m_ManagerPartList As New ObservableCollection(Of ManagePart_Part)
Public ReadOnly Property ManagerPartList As ObservableCollection(Of ManagePart_Part)
Get
Return m_ManagerPartList
End Get
End Property
Private m_SelManagerPart As ManagePart_Part
Friend Sub SetSelManagerPart(SelManagePart_Part As ManagePart_Part)
m_SelManagerPart = SelManagePart_Part
m_SelManagerLayer = Nothing
End Sub
Public ReadOnly Property SelManagerPart As ManagePart_Part
Get
Return m_SelManagerPart
End Get
End Property
Private m_SelManagerLayer As ManagePart_Layer
Public ReadOnly Property SelManagerLayer As ManagePart_Layer
Get
Return m_SelManagerLayer
End Get
End Property
Friend Sub SetSelManagerLayer(SelManagePart_Layer As ManagePart_Layer)
m_SelManagerPart = m_ManagerPartList.FirstOrDefault(Function(x) x.LayerList.Contains(SelManagePart_Layer))
m_SelManagerLayer = SelManagePart_Layer
End Sub
Private m_SelPartManager_GeomEntity As PartManager_GeomEntity
Public ReadOnly Property SelPartManager_GeomEntity As PartManager_GeomEntity
Get
Return m_SelPartManager_GeomEntity
End Get
End Property
Friend Sub SetSelPartManager_GeomEntity(SelPartManager_GeomEntity As PartManager_GeomEntity)
For Each CurrPart In m_ManagerPartList
Dim CurrLayer As ManagePart_Layer = CurrPart.LayerList.FirstOrDefault(Function(x) x.EntityList.Contains(SelPartManager_GeomEntity))
If Not IsNothing(CurrLayer) Then
m_SelManagerPart = CurrPart
m_SelManagerLayer = CurrLayer
Exit For
End If
Next
m_SelPartManager_GeomEntity = SelPartManager_GeomEntity
End Sub
Public ReadOnly Property IsImport_Visibility As Visibility
Get
Select Case m_Type
Case ManagePartType.IMPORT
Return Visibility.Visible
Case Else ' ManagePartType.MODIFY
Return Visibility.Collapsed
End Select
End Get
End Property
Private m_IsEnabled As Boolean = True
Public ReadOnly Property IsEnabled As Boolean
Get
Return m_IsEnabled
End Get
End Property
Friend Sub SetIsEnabled(value As Boolean)
m_IsEnabled = value
NotifyPropertyChanged(NameOf(IsEnabled))
End Sub
' Definizione comandi
Private m_cmdSetReference As ICommand
Private m_cmdAddPart As ICommand
Private m_cmdRemovePart As ICommand
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
Sub New()
' Creo riferimento a questa classe in EgtCAM5Map
Map.SetRefManagePartPanelVM(Me)
End Sub
#Region "METHODS"
Friend Sub Init(Type As ManagePartType)
m_Type = Type
Select Case Type
Case ManagePartType.IMPORT
' import
m_ImportedEntityList.Clear()
m_ManagerPartList.Clear()
' aggiungo geometrie importate a lista
m_nImportedPartId = EgtGetLastPart()
Dim nLayerId As Integer = EgtGetFirstLayer(m_nImportedPartId)
Dim nGeometryId As Integer = EgtGetFirstInGroup(nLayerId)
While nGeometryId <> GDB_ID.NULL
Dim sGeometryName As String = ""
EgtGetName(nGeometryId, sGeometryName)
m_ImportedEntityList.Add(New PartManager_GeomEntity(Nothing, nGeometryId))
nGeometryId = EgtGetNext(nGeometryId)
End While
' aggiungo primo pezzo
m_ManagerPartList.Add(New ManagePart_Part(Nothing))
m_ManagerPartList(0).LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID).bIsSelected = True
' aggiorno i contextmenu di tutti gli entity
UpdateAllEntityContextMenu()
Case ManagePartType.MODIFY
' modify
m_ImportedEntityList.Clear()
m_ManagerPartList.Clear()
' carico pezzi in lista
For Each PrintPart In Map.refTopPanelVM.PartList
m_ManagerPartList.Add(New ManagePart_Part(PrintPart))
Next
End Select
NotifyPropertyChanged(NameOf(IsImport_Visibility))
EgtDeselectAll()
End Sub
Friend Sub UpdateAllEntityContextMenu()
' aggiorno i contextmenu di tutti gli entity
For Each ManagePart In m_ManagerPartList
For Each Layer In ManagePart.LayerList
For Each Entity In Layer.EntityList
Entity.UpdateContextMenu()
Next
Next
Next
For Each Entity In ImportedEntityList
Entity.UpdateContextMenu()
Next
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "AddPart"
Public ReadOnly Property AddPart_Command As ICommand
Get
If m_cmdAddPart Is Nothing Then
m_cmdAddPart = New Command(AddressOf AddPart)
End If
Return m_cmdAddPart
End Get
End Property
Public Sub AddPart()
m_ManagerPartList.Add(New ManagePart_Part(Nothing))
' aggiorno i contextmenu di tutti gli entity
UpdateAllEntityContextMenu()
End Sub
#End Region ' AddPart
#Region "RemovePart"
Public ReadOnly Property RemovePart_Command As ICommand
Get
If m_cmdRemovePart Is Nothing Then
m_cmdRemovePart = New Command(AddressOf RemovePart)
End If
Return m_cmdRemovePart
End Get
End Property
Public Sub RemovePart()
If IsNothing(SelManagerLayer) AndAlso m_ManagerPartList.Count > 1 Then
' rimuovo pezzo
m_ManagerPartList.Remove(SelManagerPart)
'Else
' ' rimuovo geometria
' Dim CurrEntity As PartManager_GeomEntity = m_SelPartManager_GeomEntity
' SelManagerLayer.EntityList.Remove(m_SelPartManager_GeomEntity)
' ' la rimetto in lista importati
' ImportedEntityList.Add(CurrEntity)
End If
End Sub
#End Region ' RemovePart
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
Select Case m_Type
Case ManagePartType.IMPORT
Dim sErr As New List(Of String)
' verifico che tutti i pezzi abbiano una superficie da stampare nel layer apposito
For Each CurrPart In m_ManagerPartList
For Each CurrLayer In CurrPart.LayerList
Select Case CurrLayer.Type
Case ManagePart_Layer.LayerType.PRINT_SOLID
If CurrLayer.EntityList.Count = 0 Then
If sErr.Count > 0 Then sErr(sErr.Count - 1) &= Environment.NewLine
sErr.Add(CurrPart.sName & " - No print surface defined!")
End If
End Select
Next
Next
If sErr.Count > 0 Then
MessageBox.Show(String.Concat(sErr), "Error")
Return
Else
' Creo pezzi e layer necessari
For ManagePart_PartIndex = 0 To m_ManagerPartList.Count - 1
Dim ManagePart_Part As ManagePart_Part = m_ManagerPartList(ManagePart_PartIndex)
Dim frImportedPart As New Frame3d
EgtGetGroupGlobFrame(m_nImportedPartId, frImportedPart)
Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT, frImportedPart)
EgtSetName(nPartId, PART)
Dim nFrameId As Integer = GDB_ID.NULL
Dim b3PrintSolid As New BBox3d
Dim nPrintPartLayerId As Integer = GDB_ID.NULL
Dim PrintSolidEntity As PartManager_GeomEntity = Nothing
Dim nRibsLayerId As Integer = GDB_ID.NULL
Dim nShellNumberLayerId As Integer = GDB_ID.NULL
Dim nAuxSolidsLayerId As Integer = GDB_ID.NULL
Dim nMachStartLayerId As Integer = GDB_ID.NULL
Dim nOthersLayerId As Integer = GDB_ID.NULL
For Each ManagePart_Layer In ManagePart_Part.LayerList
Select Case ManagePart_Layer.Type
Case ManagePart_Layer.LayerType.PRINT_SOLID
nPrintPartLayerId = EgtCreateGroup(nPartId)
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
If ManagePart_Layer.EntityList.Count > 0 Then
PrintSolidEntity = ManagePart_Layer.EntityList(0)
EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
' calcolo box superficie per creazione riferimento
EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
' elimino colore entita'
EgtResetColor(PrintSolidEntity.nId)
If PrintSolidEntity.sName <> PrintSolidEntity.nId.ToString() Then
EgtSetInfo(PrintSolidEntity.nId, ENTITY_NAME, PrintSolidEntity.sName)
End If
End If
Case ManagePart_Layer.LayerType.MACH_START
nMachStartLayerId = EgtCreateGroup(nPartId)
EgtSetName(nMachStartLayerId, LAY_MACH_START)
EgtSetColor(nMachStartLayerId, GeomEntityColors.c3MachStart)
Dim nMachStartId As Integer = GDB_ID.NULL
If ManagePart_Layer.EntityList.Count > 0 Then
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
' se punto o curva compo
Dim EntityType As GDB_TY = EgtGetType(PartManager_GeomEntity.nId)
Select Case EntityType
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO
' gli cambio layer
EgtRelocateGlob(PartManager_GeomEntity.nId, nMachStartLayerId, GDB_POS.LAST_SON)
nMachStartId = PartManager_GeomEntity.nId
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
' altrimenti la trasformo in curva compo
nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, PartManager_GeomEntity.nId, True)
End Select
EgtSetName(nMachStartId, START_GEOM)
' elimino colore entita'
EgtResetColor(nMachStartId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
Next
Else
' creo punto di partenza
Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX()
nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
EgtSetName(nMachStartId, START_GEOM)
' elimino colore entita'
EgtResetColor(nMachStartId)
End If
Case ManagePart_Layer.LayerType.RIBS
nRibsLayerId = EgtCreateGroup(nPartId)
EgtSetName(nRibsLayerId, LAY_RIBS)
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
Next
Case ManagePart_Layer.LayerType.SHELL_NUMBER
nShellNumberLayerId = EgtCreateGroup(nPartId)
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
EgtRelocateGlob(PartManager_GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
Next
Case ManagePart_Layer.LayerType.AUX_SOLIDS
nAuxSolidsLayerId = EgtCreateGroup(nPartId)
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtRelocateGlob(PartManager_GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
Next
Case ManagePart_Layer.LayerType.OTHERS
nOthersLayerId = EgtCreateGroup(nPartId)
EgtSetName(nOthersLayerId, LAY_OTHERS)
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
Next
If ManagePart_PartIndex = 0 Then
For Each PartManager_GeomEntity In ImportedEntityList
' se curva
Dim EntityType As GDB_TY = EgtGetType(PartManager_GeomEntity.nId)
Select Case EntityType
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
' la trasformo in curva compo
Dim nOtherId As Integer = EgtCreateCurveCompo(nOthersLayerId, PartManager_GeomEntity.nId, True)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(nOtherId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
Case Else
' altrimenti la sposto solamente
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
End Select
Next
End If
End Select
Next
' aggiungo riferimento
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
' Creo riferimento
Dim ptOrig As New Point3d(b3PrintSolid.Min())
Dim frPrintSolid As New Frame3d(ptOrig)
nFrameId = EgtCreateGeoFrame(nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
If nFrameId Then
EgtSetName(nFrameId, FRAME_PART)
EgtSetMode(nFrameId, GDB_MD.LOCKED)
End If
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
' appoggio il pezzo sulla tavola
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
' lo aggiungo a lista pezzi
Dim sFilePath As String = ""
EgtGetInfo(m_nImportedPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName)
EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
Next
End If
'EgtAddMachGroup("3dPrint")
'EgtSetTable("Tab")
'Dim nRawId As Integer = EgtAddRawPart(b3PrintSolid.Min, b3PrintSolid.DimX, b3PrintSolid.DimY, b3PrintSolid.DimZ, New Color3d(128, 128, 128, 30))
'EgtAddPartToRawPart(nPartId, b3PrintSolid.Min, nRawId)
'EgtMoveToCornerRawPart(nRawId, New Point3d(dPosX, dPosY, 0), MCH_CR.BL)
'EgtResetCurrMachGroup()
' seleziono ultimo pezzo aggiunto
Map.refTopPanelVM.SelLastPart()
' elimino vecchio pezzo d'importazione
EgtErase(m_nImportedPartId)
Case ManagePartType.MODIFY
' nulla da fare
End Select
EgtDeselectAll()
EgtDraw()
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY
End Sub
#End Region ' Ok
#Region "Cancel"
Public ReadOnly Property Cancel_Command As ICommand
Get
If m_cmdCancel Is Nothing Then
m_cmdCancel = New Command(AddressOf Cancel)
End If
Return m_cmdCancel
End Get
End Property
Public Sub Cancel()
' elimino pezzo importato
EgtErase(m_nImportedPartId)
EgtDeselectAll()
EgtDraw()
' se ci sono pezzi
If Map.refTopPanelVM.PartList.Count > 0 Then
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY
Else
Map.refTopPanelVM.SelPage = Pages.NULL
End If
End Sub
#End Region ' Cancel
#End Region ' COMMANDS
End Class
+929
View File
@@ -0,0 +1,929 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Public Class PartManager_GeomEntity
Inherits VMBase
' layer sotto cui e' questa entita'
Private m_OrigLayer As ManagePart_Layer
Friend ReadOnly Property OrigLayer As ManagePart_Layer
Get
Return m_OrigLayer
End Get
End Property
Private m_bIsSelected As Boolean
Public Property bIsSelected As Boolean
Get
Return m_bIsSelected
End Get
Set(value As Boolean)
m_bIsSelected = value
' seleziono in scena
EgtDeselectAll()
If Not IsNothing(value) Then
EgtSelectObj(m_nId)
End If
EgtDraw()
' segno come elemento selezionato in treeview
Map.refManagePartPanelVM.SetSelPartManager_GeomEntity(Me)
End Set
End Property
Private m_nId As Integer = GDB_ID.NULL
Public ReadOnly Property nId As Integer
Get
Return m_nId
End Get
End Property
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
SetTextBoxVisibility(False)
NotifyPropertyChanged(NameOf(sName))
If Map.refManagePartPanelVM.Type = ManagePartPanelVM.ManagePartType.MODIFY Then
EgtSetInfo(m_nId, ENTITY_NAME, value)
End If
Map.refManagePartPanelVM.SetIsEnabled(True)
End Set
End Property
Public ReadOnly Property ghName As String
Get
Return m_nId
End Get
End Property
Private m_MenuList As New ObservableCollection(Of GeomEntity_MenuItem)
Public Property MenuList As ObservableCollection(Of GeomEntity_MenuItem)
Get
Return m_MenuList
End Get
Set(value As ObservableCollection(Of GeomEntity_MenuItem))
m_MenuList = value
End Set
End Property
Private m_UserShouldEditValueNow As Boolean = False
Public Property UserShouldEditValueNow As Boolean
Get
Return m_UserShouldEditValueNow
End Get
Set(value As Boolean)
m_UserShouldEditValueNow = value
End Set
End Property
Friend Sub SetUserShouldEditValueNow()
m_UserShouldEditValueNow = True
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
m_UserShouldEditValueNow = False
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
End Sub
Private m_TextBox_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property TextBox_Visibility As Visibility
Get
Return m_TextBox_Visibility
End Get
End Property
Private m_TextBlock_Visibility As Visibility = Visibility.Visible
Public ReadOnly Property TextBlock_Visibility As Visibility
Get
Return m_TextBlock_Visibility
End Get
End Property
' Definizione comandi
Private m_cmdGeomEntityDoubleClick As ICommand
Sub New(OrigLayer As ManagePart_Layer, nId As Integer)
m_nId = nId
Dim sName As String = ""
EgtGetInfo(m_nId, ENTITY_NAME, sName)
m_sName = If(String.IsNullOrWhiteSpace(sName), m_nId, sName)
m_OrigLayer = OrigLayer
' aggiungo voci layer a contextmenu
UpdateContextMenu()
End Sub
Friend Sub UpdateContextMenu()
m_MenuList.Clear()
Select Case Map.refManagePartPanelVM.Type
Case ManagePartPanelVM.ManagePartType.IMPORT
Dim bIsSurface As Boolean = False
For Each ProjectPart In Map.refManagePartPanelVM.ManagerPartList
' verifico in quali layer puo' andare questo elemento
Dim EntityType As GDB_TY = EgtGetType(nId)
Dim nPrintSolidCount As Integer = 0
Dim ManageLayer As ManagePart_Layer = ProjectPart.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
If Not IsNothing(ManageLayer) Then
nPrintSolidCount = ManageLayer.EntityList.Count
End If
Select Case EntityType
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
If Not IsNothing(OrigLayer) Then
' recupero i layer
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.MACH_START Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.MACH_START, ProjectPart))
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.OTHERS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
Else
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.MACH_START, ProjectPart))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
End If
Case GDB_TY.SRF_MESH
bIsSurface = True
If Not IsNothing(OrigLayer) Then
' verifico se volume chiuso
If nPrintSolidCount = 0 AndAlso (Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.PRINT_SOLID) Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.PRINT_SOLID, ProjectPart))
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.SHELL_NUMBER Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, ProjectPart))
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.AUX_SOLIDS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, ProjectPart))
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.RIBS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.RIBS, ProjectPart))
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.OTHERS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
Else
If nPrintSolidCount = 0 Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.PRINT_SOLID, ProjectPart))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, ProjectPart))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, ProjectPart))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.RIBS, ProjectPart))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
End If
End Select
Next
If bIsSurface Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.NEWPART))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.CHANGENAME))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.DELETE))
Case ManagePartPanelVM.ManagePartType.MODIFY
Dim bIsSurface As Boolean = False
For Each ProjectPart In Map.refTopPanelVM.PartList
' verifico in quali layer puo' andare questo elemento
Dim EntityType As GDB_TY = EgtGetType(nId)
Dim nPrintSolidCount As Integer = EgtGetGroupObjs(ProjectPart.nPrintSolidLayerId)
Select Case EntityType
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
If Not IsNothing(OrigLayer) Then
' recupero i layer
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.MACH_START Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.MACH_START, ProjectPart))
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.OTHERS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
Else
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.MACH_START, ProjectPart))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
End If
Case GDB_TY.SRF_MESH
bIsSurface = True
If Not IsNothing(OrigLayer) Then
' verifico se volume chiuso
If nPrintSolidCount = 0 AndAlso (ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.PRINT_SOLID) Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.PRINT_SOLID, ProjectPart))
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.SHELL_NUMBER Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, ProjectPart))
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.AUX_SOLIDS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, ProjectPart))
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.RIBS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.RIBS, ProjectPart))
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.OTHERS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
Else
If nPrintSolidCount = 0 Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.PRINT_SOLID, ProjectPart))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, ProjectPart))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, ProjectPart))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.RIBS, ProjectPart))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
End If
End Select
Next
If bIsSurface Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.NEWPART))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.CHANGENAME))
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.DELETE))
End Select
End Sub
Friend Sub UpdateOrigLayer(NewLayer As ManagePart_Layer)
m_OrigLayer = NewLayer
End Sub
Friend Sub SetTextBoxVisibility(bValue As Boolean)
m_TextBox_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
m_TextBlock_Visibility = If(Not bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(TextBox_Visibility))
NotifyPropertyChanged(NameOf(TextBlock_Visibility))
If bValue Then SetUserShouldEditValueNow()
End Sub
#Region "COMMANDS"
#Region "GeomEntityDoubleClick"
Public ReadOnly Property GeomEntityDoubleClick_Command As ICommand
Get
If m_cmdGeomEntityDoubleClick Is Nothing Then
m_cmdGeomEntityDoubleClick = New Command(AddressOf GeomEntityDoubleClick)
End If
Return m_cmdGeomEntityDoubleClick
End Get
End Property
Public Sub GeomEntityDoubleClick()
If Not IsNothing(Map.refManagePartPanelVM.SelManagerLayer) Then
Map.refManagePartPanelVM.ImportedEntityList.Remove(Me)
' aggiorno riferimenti layer e context menu
UpdateOrigLayer(Map.refManagePartPanelVM.SelManagerLayer)
UpdateContextMenu()
Map.refManagePartPanelVM.SelManagerLayer.EntityList.Add(Me)
End If
End Sub
#End Region ' ImportedEntity
#End Region ' COMMANDS
End Class
Public Class ManagePart_Part
Inherits VMBase
Private m_bIsSelected As Boolean
Public Property bIsSelected As Boolean
Get
Return m_bIsSelected
End Get
Set(value As Boolean)
m_bIsSelected = value
Map.refManagePartPanelVM.SetSelManagerPart(Me)
End Set
End Property
Private m_nId As Integer
Public ReadOnly Property nId As Integer
Get
Return m_nId
End Get
End Property
Private m_PrintPart As Print3dPartVM
Public ReadOnly Property PrintPart As Print3dPartVM
Get
Return m_PrintPart
End Get
End Property
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
SetTextBoxVisibility(False)
NotifyPropertyChanged(NameOf(sName))
If Map.refManagePartPanelVM.Type = ManagePartPanelVM.ManagePartType.MODIFY Then
m_PrintPart.UpdateName(value)
EgtSetInfo(m_PrintPart.nPartId, PART_NAME, value)
End If
Map.refManagePartPanelVM.SetIsEnabled(True)
End Set
End Property
Private m_MenuList As New List(Of ManagerPart_MenuItem)
Public Property MenuList As List(Of ManagerPart_MenuItem)
Get
Return m_MenuList
End Get
Set(value As List(Of ManagerPart_MenuItem))
m_MenuList = value
End Set
End Property
Private m_LayerList As New ObservableCollection(Of ManagePart_Layer)
Public ReadOnly Property LayerList As ObservableCollection(Of ManagePart_Layer)
Get
Return m_LayerList
End Get
End Property
Private m_UserShouldEditValueNow As Boolean = False
Public Property UserShouldEditValueNow As Boolean
Get
Return m_UserShouldEditValueNow
End Get
Set(value As Boolean)
m_UserShouldEditValueNow = value
End Set
End Property
Friend Sub SetUserShouldEditValueNow()
m_UserShouldEditValueNow = True
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
m_UserShouldEditValueNow = False
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
End Sub
Private m_TextBox_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property TextBox_Visibility As Visibility
Get
Return m_TextBox_Visibility
End Get
End Property
Private m_TextBlock_Visibility As Visibility = Visibility.Visible
Public ReadOnly Property TextBlock_Visibility As Visibility
Get
Return m_TextBlock_Visibility
End Get
End Property
Sub New(PrintPart As Print3dPartVM)
m_PrintPart = PrintPart
'NotifyPropertyChanged(NameOf(sName))
If Map.refManagePartPanelVM.ManagerPartList.Count = 0 Then
m_nId = 1
Else
m_nId = Map.refManagePartPanelVM.ManagerPartList.Max(Function(x) x.nId) + 1
End If
If Not IsNothing(PrintPart) Then
m_sName = m_PrintPart.sName
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.PRINT_SOLID, "Print", PrintPart))
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.MACH_START, "Layer Start", PrintPart))
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.RIBS, "Ribs", PrintPart))
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, "Reduce Shell Number", PrintPart))
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, "Filled Solids", PrintPart))
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.OTHERS, "Others", PrintPart))
Else
m_sName = "Part" & m_nId
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.PRINT_SOLID, "Print"))
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.MACH_START, "Layer Start"))
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.RIBS, "Ribs"))
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, "Reduce Shell Number"))
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, "Filled Solids"))
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.OTHERS, "Others"))
End If
' creo context menu per cambio nome ed eliminazione
m_MenuList.Add(New ManagerPart_MenuItem(Me, ManagerPart_MenuItem.PartMenuCmd.CHANGENAME))
m_MenuList.Add(New ManagerPart_MenuItem(Me, ManagerPart_MenuItem.PartMenuCmd.DELETE))
End Sub
Friend Sub SetTextBoxVisibility(bValue As Boolean)
m_TextBox_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
m_TextBlock_Visibility = If(Not bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(TextBox_Visibility))
NotifyPropertyChanged(NameOf(TextBlock_Visibility))
If bValue Then SetUserShouldEditValueNow()
End Sub
End Class
Public Class ManagePart_Layer
Inherits VMBase
Public Enum LayerType As Integer
PRINT_SOLID = 1
MACH_START = 2
RIBS = 3
SHELL_NUMBER = 4
AUX_SOLIDS = 5
OTHERS = 7
CHANGENAME = 15
DELETE = 16
NEWPART = 17
End Enum
' enita' di origine
Private m_OrigPart As ManagePart_Part
Public ReadOnly Property OrigPart As ManagePart_Part
Get
Return m_OrigPart
End Get
End Property
Private m_nLayerId As Integer
Private m_bIsSelected As Boolean
Public Property bIsSelected As Boolean
Get
Return m_bIsSelected
End Get
Set(value As Boolean)
m_bIsSelected = value
Map.refManagePartPanelVM.SetSelManagerLayer(Me)
End Set
End Property
Private m_Type As LayerType
Public Property Type As LayerType
Get
Return m_Type
End Get
Set(value As LayerType)
m_Type = value
End Set
End Property
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Private m_EntityList As New ObservableCollection(Of PartManager_GeomEntity)
Public Property EntityList As ObservableCollection(Of PartManager_GeomEntity)
Get
Return m_EntityList
End Get
Set(value As ObservableCollection(Of PartManager_GeomEntity))
m_EntityList = value
End Set
End Property
Sub New(OrigPart As ManagePart_Part, Type As LayerType, sName As String)
m_OrigPart = OrigPart
m_Type = Type
m_sName = sName
End Sub
Sub New(OrigPart As ManagePart_Part, Type As LayerType, sName As String, PrintPart As Print3dPartVM)
m_OrigPart = OrigPart
m_Type = Type
m_sName = sName
Select Case Type
Case LayerType.PRINT_SOLID
m_nLayerId = PrintPart.nPrintSolidLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
If nEntityId <> GDB_ID.NULL Then
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
End If
Case LayerType.MACH_START
m_nLayerId = PrintPart.nMachStartLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
While nEntityId <> GDB_ID.NULL
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
nEntityId = EgtGetNext(nEntityId)
End While
Case LayerType.RIBS
m_nLayerId = PrintPart.nRibsLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
While nEntityId <> GDB_ID.NULL
Dim RibType As Integer = RibEntity.RibTypes.FROMDRAW
EgtGetInfo(nEntityId, KEY_RIB_TYPE, RibType)
If RibType = RibEntity.RibTypes.FROMIMPORT Then
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
End If
nEntityId = EgtGetNext(nEntityId)
End While
Case LayerType.SHELL_NUMBER
m_nLayerId = PrintPart.nShellNumberLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
While nEntityId <> GDB_ID.NULL
Dim ShellType As Integer = ShellNumberEntity.ShellNumberTypes.FROMDRAW
EgtGetInfo(nEntityId, KEY_SHELLNBR_TYPE, ShellType)
If ShellType = ShellNumberEntity.ShellNumberTypes.FROMIMPORT Then
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
End If
nEntityId = EgtGetNext(nEntityId)
End While
Case LayerType.AUX_SOLIDS
m_nLayerId = PrintPart.nAuxSolidsLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
While nEntityId <> GDB_ID.NULL
'Dim ShellType As Integer = ShellNumberEntity.ShellNumberTypes.FROMDRAW
'EgtGetInfo(nEntityId, KEY_SHELLNBR_TYPE, ShellType)
'If ShellType = ShellNumberEntity.ShellNumberTypes.FROMIMPORT Then
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
'End If
nEntityId = EgtGetNext(nEntityId)
End While
Case LayerType.OTHERS
m_nLayerId = PrintPart.nOthersLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
While nEntityId <> GDB_ID.NULL
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
nEntityId = EgtGetNext(nEntityId)
End While
End Select
End Sub
End Class
Public Class GeomEntity_MenuItem
Inherits VMBase
' enita' di origine
Private m_OrigEntity As PartManager_GeomEntity
' pezzo in cui spostare
Private m_GeomPart As Print3dPartVM
Private m_Part As ManagePart_Part
' tipo del layer indicato
Private m_Type As ManagePart_Layer.LayerType
Public Property Type As ManagePart_Layer.LayerType
Get
Return m_Type
End Get
Set(value As ManagePart_Layer.LayerType)
m_Type = value
End Set
End Property
Public ReadOnly Property sMsg As String
Get
Dim sType As String = ""
Select Case m_Type
Case ManagePart_Layer.LayerType.PRINT_SOLID
sType = "Print"
Case ManagePart_Layer.LayerType.MACH_START
sType = "Layer Start"
Case ManagePart_Layer.LayerType.RIBS
sType = "Ribs"
Case ManagePart_Layer.LayerType.SHELL_NUMBER
sType = "Reduce shell number"
Case ManagePart_Layer.LayerType.AUX_SOLIDS
sType = "Filled Solids"
Case ManagePart_Layer.LayerType.OTHERS
sType = "Others"
Case ManagePart_Layer.LayerType.NEWPART
Return "Create New Part"
Case ManagePart_Layer.LayerType.CHANGENAME
Return "Change Name"
Case ManagePart_Layer.LayerType.DELETE
Return "Delete Entity"
End Select
Dim PartName As String = ""
If Map.refManagePartPanelVM.ManagerPartList.Count > 1 Then
Dim NewPart As ManagePart_Part = Nothing
Select Case Map.refManagePartPanelVM.Type
Case ManagePartPanelVM.ManagePartType.IMPORT
NewPart = Map.refManagePartPanelVM.ManagerPartList.FirstOrDefault(Function(x) x Is m_Part)
Case ManagePartPanelVM.ManagePartType.MODIFY
NewPart = Map.refManagePartPanelVM.ManagerPartList.FirstOrDefault(Function(x) x.PrintPart.nPartId = m_GeomPart.nPartId)
End Select
If Not IsNothing(NewPart) Then
PartName = " (" & NewPart.sName & ")"
End If
End If
Return "Move to " & sType & PartName
End Get
End Property
' Definizione comando
Private m_cmdCommand As ICommand
Sub New(OrigEntity As PartManager_GeomEntity, Type As ManagePart_Layer.LayerType, GeomPart As Print3dPartVM)
m_OrigEntity = OrigEntity
m_Type = Type
m_GeomPart = GeomPart
End Sub
Sub New(OrigEntity As PartManager_GeomEntity, Type As ManagePart_Layer.LayerType, Part As ManagePart_Part)
m_OrigEntity = OrigEntity
m_Type = Type
m_Part = Part
End Sub
Sub New(OrigEntity As PartManager_GeomEntity, Type As ManagePart_Layer.LayerType)
m_OrigEntity = OrigEntity
m_Type = Type
End Sub
#Region "Command"
Public ReadOnly Property MenuItem_Command As ICommand
Get
If m_cmdCommand Is Nothing Then
m_cmdCommand = New Command(AddressOf Command)
End If
Return m_cmdCommand
End Get
End Property
Public Sub Command()
If m_Type = ManagePart_Layer.LayerType.CHANGENAME Then
m_OrigEntity.SetTextBoxVisibility(True)
Map.refManagePartPanelVM.SetIsEnabled(True)
Return
ElseIf m_Type = ManagePart_Layer.LayerType.DELETE Then
If MessageBox.Show("Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
EgtErase(m_OrigEntity.nId)
' se l'entita' e' gia' in lista pezzi
If Not IsNothing(m_OrigEntity.OrigLayer) Then
' elimino dalla lista pezzi
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
Else
' altrimenti lo elimino dalla lista entita' importate
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
End If
EgtDraw()
' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End If
Return
ElseIf m_Type = ManagePart_Layer.LayerType.NEWPART Then
Select Case Map.refManagePartPanelVM.Type
Case ManagePartPanelVM.ManagePartType.IMPORT
Dim NewPart As ManagePart_Part = New ManagePart_Part(Nothing)
Map.refManagePartPanelVM.ManagerPartList.Add(NewPart)
' se l'entita' e' gia' in lista pezzi
If Not IsNothing(m_OrigEntity.OrigLayer) Then
' elimino dalla lista pezzi
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
Else
' altrimenti lo elimino dalla lista entita' importate
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
End If
If Not IsNothing(NewPart) Then
Dim NewLayer As ManagePart_Layer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
If Not IsNothing(NewLayer) Then
NewLayer.EntityList.Add(m_OrigEntity)
' aggiorno riferimenti nell'entita'
m_OrigEntity.UpdateOrigLayer(NewLayer)
End If
End If
' aggiorno i contextmenu di tutti gli entity
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
Case ManagePartPanelVM.ManagePartType.MODIFY
' recupero path da vecchio pezzo
Dim sFilePath As String = ""
EgtGetInfo(m_OrigEntity.OrigLayer.OrigPart.PrintPart.nPartId, FILE_PATH, sFilePath)
'Dim frImportedPart As New Frame3d
'EgtGetGroupGlobFrame(m_nImportedPartId, frImportedPart)
' creo pezzo
Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT) ', frImportedPart)
EgtSetName(nPartId, PART)
Dim nFrameId As Integer = GDB_ID.NULL
Dim b3PrintSolid As New BBox3d
' creo layer solido di stampa
Dim nPrintPartLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
EgtRelocateGlob(m_OrigEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
' calcolo box superficie per creazione riferimento
EgtGetBBoxGlob(m_OrigEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
' coloro l'entita'
EgtSetColor(m_OrigEntity.nId, GeomEntityColors.c3Print)
' creo layer mach start
Dim nMachStartLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nMachStartLayerId, LAY_MACH_START)
Dim nMachStartId As Integer = GDB_ID.NULL
' creo punto di partenza
Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX()
nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
EgtSetName(nMachStartId, START_GEOM)
' coloro l'entita' di rosso
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
' creo layer ribs
Dim nRibsLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nRibsLayerId, LAY_RIBS)
' creo layer shell number
Dim nShellNumberLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
' creo layer aux
Dim nAuxSolidsLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
' creo layer others
Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nOthersLayerId, LAY_OTHERS)
' aggiungo riferimento
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
' Creo riferimento
Dim ptOrig As New Point3d(b3PrintSolid.Min())
Dim frPrintSolid As New Frame3d(ptOrig)
nFrameId = EgtCreateGeoFrame(nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
If nFrameId Then
EgtSetName(nFrameId, FRAME_PART)
EgtSetMode(nFrameId, GDB_MD.LOCKED)
End If
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
' appoggio il pezzo sulla tavola
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
' lo aggiungo a lista pezzi
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
Dim ManagePart_Part As ManagePart_Part = New ManagePart_Part(NewPart)
' elimino da posizione originale
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName)
' lo aggiungo a lista
Map.refManagePartPanelVM.ManagerPartList.Add(ManagePart_Part)
' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select
'' aggiorno visibilita' da check di categoria
'Dim PrintLayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = ViewLayer.ViewLayerType.PRINT_SOLID)
'EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintLayer.bIsVisible) OrElse PrintLayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF))
Return
End If
Select Case Map.refManagePartPanelVM.Type
Case ManagePartPanelVM.ManagePartType.IMPORT
' se l'entita' e' gia' in lista pezzi
If Not IsNothing(m_OrigEntity.OrigLayer) Then
' elimino dalla lista pezzi
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
Else
' altrimenti lo elimino dalla lista entita' importate
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
End If
Dim NewPart As ManagePart_Part = Map.refManagePartPanelVM.ManagerPartList.FirstOrDefault(Function(x) x Is m_Part)
If Not IsNothing(NewPart) Then
Dim NewLayer As ManagePart_Layer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = m_Type)
If Not IsNothing(NewLayer) Then
NewLayer.EntityList.Add(m_OrigEntity)
' aggiorno riferimenti nell'entita'
m_OrigEntity.UpdateOrigLayer(NewLayer)
End If
End If
' aggiorno riferimenti nel context menu item
m_OrigEntity.UpdateContextMenu()
Case ManagePartPanelVM.ManagePartType.MODIFY
' recupero layer da pezzo
Dim nLayerId As Integer = GDB_ID.NULL
Select Case m_Type
Case ManagePart_Layer.LayerType.PRINT_SOLID
nLayerId = m_GeomPart.nPrintSolidLayerId
Case ManagePart_Layer.LayerType.MACH_START
nLayerId = m_GeomPart.nMachStartLayerId
Case ManagePart_Layer.LayerType.RIBS
nLayerId = m_GeomPart.nRibsLayerId
Case ManagePart_Layer.LayerType.SHELL_NUMBER
nLayerId = m_GeomPart.nShellNumberLayerId
Case ManagePart_Layer.LayerType.AUX_SOLIDS
nLayerId = m_GeomPart.nAuxSolidsLayerId
Case ManagePart_Layer.LayerType.OTHERS
nLayerId = m_GeomPart.nOthersLayerId
End Select
' sposto entita'
If EgtRelocateGlob(m_OrigEntity.nId, nLayerId) Then
' elimino info vecchio layer
Select Case m_OrigEntity.OrigLayer.Type
Case ManagePart_Layer.LayerType.PRINT_SOLID
EgtResetMark(m_OrigEntity.nId)
' se e' presente flag di spostamento a 45 gradi
Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId))
Dim vtMoved As Vector3d
If EgtGetInfo(nPartId, "MovedPart", vtMoved) Then
' lo sposto e rimuovo info
EgtMove(m_OrigEntity.nId, -vtMoved, GDB_RT.GLOB)
EgtRemoveInfo(nPartId, "MovedPart")
End If
Case ManagePart_Layer.LayerType.MACH_START
Case ManagePart_Layer.LayerType.RIBS
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
Case ManagePart_Layer.LayerType.SHELL_NUMBER
EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE)
Case ManagePart_Layer.LayerType.AUX_SOLIDS
EgtRemoveInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE)
Case ManagePart_Layer.LayerType.OTHERS
End Select
' sposto in lista
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
Dim bUpdateAllContextMenu As Boolean = False
Dim NewPart As ManagePart_Part = Map.refManagePartPanelVM.ManagerPartList.FirstOrDefault(Function(x) x.PrintPart.nPartId = m_GeomPart.nPartId)
If Not IsNothing(NewPart) Then
Dim NewLayer As ManagePart_Layer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = m_Type)
If Not IsNothing(NewLayer) Then
NewLayer.EntityList.Add(m_OrigEntity)
bUpdateAllContextMenu = (m_OrigEntity.OrigLayer.Type = ManagePart_Layer.LayerType.PRINT_SOLID) OrElse (NewLayer.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
' aggiorno riferimenti nell'entita'
m_OrigEntity.UpdateOrigLayer(NewLayer)
End If
End If
' aggiungo info nuovo layer
Select Case m_Type
Case ManagePart_Layer.LayerType.PRINT_SOLID
EgtSetName(m_OrigEntity.nId, PRINT_SOLID)
EgtSetColor(m_OrigEntity.nId, c3Print)
' rimuovo eventuale nota spostamento per 45 gradi
EgtRemoveInfo(m_OrigEntity.OrigLayer.OrigPart.nId, "MovedPart")
Case ManagePart_Layer.LayerType.MACH_START
EgtSetName(m_OrigEntity.nId, LAY_MACH_START)
EgtSetColor(m_OrigEntity.nId, c3MachStart)
Case ManagePart_Layer.LayerType.RIBS
EgtSetName(m_OrigEntity.nId, LAY_RIBS)
EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetColor(m_OrigEntity.nId, c3Rib)
Case ManagePart_Layer.LayerType.SHELL_NUMBER
EgtSetName(m_OrigEntity.nId, LAY_SHELL_NBR)
EgtSetInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
EgtSetColor(m_OrigEntity.nId, c3ShellNumber)
Case ManagePart_Layer.LayerType.AUX_SOLIDS
EgtSetName(m_OrigEntity.nId, LAY_AUX_SOLIDS)
EgtSetInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetColor(m_OrigEntity.nId, c3AuxSolids)
Case ManagePart_Layer.LayerType.OTHERS
EgtSetName(m_OrigEntity.nId, LAY_OTHERS)
EgtSetColor(m_OrigEntity.nId, c3Others)
End Select
EgtDraw()
' aggiorno riferimenti nel context menu item
If bUpdateAllContextMenu Then
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
Else
m_OrigEntity.UpdateContextMenu()
End If
End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select
End Sub
#End Region ' Command
End Class
Public Class ManagerPart_MenuItem
Inherits VMBase
Public Enum PartMenuCmd
CHANGENAME = 1
DELETE = 2
End Enum
Private m_OrigPart As ManagePart_Part
' tipo del comando
Private m_Type As PartMenuCmd
Public Property Type As PartMenuCmd
Get
Return m_Type
End Get
Set(value As PartMenuCmd)
m_Type = value
End Set
End Property
Public ReadOnly Property sMsg As String
Get
Select Case m_Type
Case PartMenuCmd.CHANGENAME
Return "Change Name"
Case Else ' PartMenuCmd.DELETE
Return "Delete Part"
End Select
End Get
End Property
' Definizione comando
Private m_cmdCommand As ICommand
Sub New(OrigPart As ManagePart_Part, Type As PartMenuCmd)
m_OrigPart = OrigPart
m_Type = Type
End Sub
#Region "Command"
Public ReadOnly Property MenuItem_Command As ICommand
Get
If m_cmdCommand Is Nothing Then
m_cmdCommand = New Command(AddressOf Command)
End If
Return m_cmdCommand
End Get
End Property
Public Sub Command()
Select Case m_Type
Case PartMenuCmd.CHANGENAME
m_OrigPart.SetTextBoxVisibility(True)
Map.refManagePartPanelVM.SetIsEnabled(True)
Case PartMenuCmd.DELETE
If Map.refManagePartPanelVM.ManagerPartList.Count <= 1 Then Return
Select Case Map.refManagePartPanelVM.Type
Case ManagePartPanelVM.ManagePartType.IMPORT
For Each Layer In m_OrigPart.LayerList
For Each Entity In Layer.EntityList
' le rimuovo da lista entita' pezzo
Layer.EntityList.Remove(Entity)
' la rimetto in lista importati
Map.refManagePartPanelVM.ImportedEntityList.Add(Entity)
Next
Next
' elimino pezzo da lista
Map.refManagePartPanelVM.ManagerPartList.Remove(m_OrigPart)
Case ManagePartPanelVM.ManagePartType.MODIFY
' elimino pezzo geometrico
EgtErase(m_OrigPart.PrintPart.nPartId)
' elimino pezzo da lista
Map.refManagePartPanelVM.ManagerPartList.Remove(m_OrigPart)
Dim bSelFirstPart As Boolean = m_OrigPart.PrintPart.nPartId = Map.refTopPanelVM.SelPart.nPartId
' elimino pezzo da lista Top
Map.refTopPanelVM.PartList.Remove(m_OrigPart.PrintPart)
EgtDraw()
If bSelFirstPart Then Map.refTopPanelVM.SelFirstPart()
End Select
' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select
End Sub
#End Region ' Command
End Class
+38 -12
View File
@@ -204,7 +204,7 @@ Public Class Material
End Sub
Private Sub ReadAllParams()
'm_bSlicing45 = ReadMaterialParamDouble(m_nIndex, MAC_SLICING45, 0, CurrentMachine.sMachiningFilePath)
'm_nSlicingType = ReadMaterialParamDouble(m_nIndex, MAC_SLICINGTYPE, 0, CurrentMachine.sMachiningFilePath)
'm_dStrandH = ReadMaterialParamDouble(m_nIndex, MAC_STRANDH, 0, CurrentMachine.sMachiningFilePath)
'm_dStrandW = ReadMaterialParamDouble(m_nIndex, MAC_STRANDW, 0, CurrentMachine.sMachiningFilePath)
'm_nStrandCount = ReadMaterialParamDouble(m_nIndex, MAC_STRANDCOUNT, 0, CurrentMachine.sMachiningFilePath)
@@ -674,6 +674,8 @@ End Class
Public Class StringMaterialParam
Inherits MaterialParam
Public Const DEFAULT_MATERIAL As String = "***"
Private m_sGUID As String
Public Property sGUID As String
Get
@@ -715,10 +717,10 @@ Public Class StringMaterialParam
End Get
End Property
Private m_bIsReadOnly As Boolean = True
Public ReadOnly Property bIsReadOnly As Boolean
Private m_OrigButton_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property OrigButton_Visibility As Visibility
Get
Return m_bIsReadOnly
Return m_OrigButton_Visibility
End Get
End Property
@@ -729,15 +731,18 @@ Public Class StringMaterialParam
End Get
End Property
' Definizione comandi
Private m_cmdOriginal As ICommand
Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type)
Select Case Type
Case Params.ORIG
Dim sOrigGUID As String = ""
ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID)
If sOrigGUID = "***" Then
m_sGUID = sOrigGUID
m_sValue = sOrigGUID
If sOrigGUID = DEFAULT_MATERIAL Then
m_sGUID = DEFAULT_MATERIAL
m_sValue = DEFAULT_MATERIAL
' se livello alto, lo visualizzo comunque
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
m_String_Visibility = Visibility.Visible
@@ -757,7 +762,7 @@ Public Class StringMaterialParam
End Select
' verifico chiave per assegnare readonly
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
m_bIsReadOnly = False
m_OrigButton_Visibility = Visibility.Visible
End If
m_sOrigValue = m_sValue
End Sub
@@ -777,6 +782,31 @@ Public Class StringMaterialParam
m_sValue = m_sOrigValue
End Sub
#Region "COMMANDS"
#Region "Original"
Public ReadOnly Property Original_Command As ICommand
Get
If m_cmdOriginal Is Nothing Then
m_cmdOriginal = New Command(AddressOf Original)
End If
Return m_cmdOriginal
End Get
End Property
Public Sub Original()
If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
m_sGUID = DEFAULT_MATERIAL
m_sValue = DEFAULT_MATERIAL
NotifyPropertyChanged(NameOf(sValue))
End If
End Sub
#End Region ' Original
#End Region ' COMMANDS
End Class
Public Class ComboMaterialParam
@@ -871,16 +901,12 @@ Public Class CheckMaterialParam
Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type)
Select Case Type
'Case Params.SLICING45
' m_bValue = ReadMaterialParamDouble(nIndex, MAC_SLICING45, 0)
End Select
m_bOrigValue = m_bValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Select Case Type
'Case Params.SLICING45
' WriteMaterialParam(nIndex, MAC_SLICING45, If(m_bValue, 1, 0))
End Select
End Sub
+6 -7
View File
@@ -101,16 +101,15 @@
<TextBlock Text="{Binding sName}"/>
<TextBox Grid.Column="1"
Text="{Binding sValue}"
IsReadOnly="{Binding bIsReadOnly}"/>
<!--<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
IsReadOnly="True"/>
<Button Grid.Column="2"
Content="O"
Command="{Binding Original_Command}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
Visibility="{Binding OrigButton_Visibility}"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:ComboMaterialParam}">
+44 -1
View File
@@ -48,6 +48,9 @@ Public Class MaterialDbVM
m_SelMaterial.CathegoryList(Index).Cathegory_IsExpanded = IsExpandedList(Index)
Next
End If
' verifico abilitazione delete
SetDeleteIsEnabled(Not SelMaterialIsOriginal())
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End Set
End Property
@@ -73,6 +76,21 @@ Public Class MaterialDbVM
m_bIsModified = value
End Sub
Private m_Delete_IsEnabled As Boolean = True
Public ReadOnly Property Delete_IsEnabled As Boolean
Get
Return m_Delete_IsEnabled
End Get
End Property
Friend Sub SetDeleteIsEnabled(value As Boolean)
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
m_Delete_IsEnabled = True
Else
m_Delete_IsEnabled = value
End If
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End Sub
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdCopy As ICommand
@@ -104,9 +122,32 @@ Public Class MaterialDbVM
Dim sCurrMaterial As String = ""
GetMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, "", sCurrMaterial)
m_SelMaterial = MaterialList.FirstOrDefault(Function(x) x.sGUID = sCurrMaterial)
If IsNothing(m_SelMaterial) AndAlso m_MaterialList.Count > 0 Then
m_SelMaterial = m_MaterialList(0)
End If
NotifyPropertyChanged(NameOf(SelMaterial))
' verifico abilitazione delete
If Not IsNothing(m_SelMaterial) Then
SetDeleteIsEnabled(Not SelMaterialIsOriginal())
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End If
End Sub
Private Function SelMaterialIsOriginal() As Boolean
If IsNothing(m_SelMaterial) Then Return False
' verifico abilitazione delete
Dim General As MaterialCathegory = m_SelMaterial.CathegoryList.FirstOrDefault(Function(x) x.Type = MaterialCathegory.Cathegories.GENERAL)
If Not IsNothing(General) Then
Dim Original As MaterialParam = General.MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG)
If Not IsNothing(Original) Then
If DirectCast(Original, StringMaterialParam).sValue = StringMaterialParam.DEFAULT_MATERIAL Then
Return True
End If
End If
End If
Return False
End Function
#End Region ' METHODS
#Region "COMMANDS"
@@ -248,8 +289,10 @@ Public Class MaterialDbVM
End Property
Public Sub Delete()
' se materiale originale, esco
If SelMaterialIsOriginal() Then Return
' chiedo conferma
Select Case MessageBox.Show("Sei sicuro di voler cancellare la lavorazione selezionata?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Select Case MessageBox.Show("Are you sure you want to delete selected material?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_MaterialList.Remove(m_SelMaterial)
' segno Db come modificato
+2 -2
View File
@@ -346,7 +346,7 @@ Public Class MenuItemVm
m_Part = Part
End Sub
#Region "Cancel"
#Region "Command"
Public ReadOnly Property MenuItem_Command As ICommand
Get
@@ -430,6 +430,6 @@ Public Class MenuItemVm
End If
End Sub
#End Region ' Cancel
#End Region ' Command
End Class
+12 -2
View File
@@ -11,6 +11,7 @@ Imports System.Windows
' Review the values of the assembly attributes
#If PLATFORM = "x64" Then
#If DEBUG Then
<Assembly: AssemblyTitle("IcarusD64.exe")>
<Assembly: AssemblyDescription("Icarus Debug 64 bit")>
@@ -18,6 +19,15 @@ Imports System.Windows
<Assembly: AssemblyTitle("IcarusR64.exe")>
<Assembly: AssemblyDescription("Icarus 64 bit")>
#End If
#Else
#If DEBUG Then
<Assembly: AssemblyTitle("IcarusD32.exe")>
<Assembly: AssemblyDescription("Icarus Debug 32 bit")>
#Else
<Assembly: AssemblyTitle("IcarusR32.exe")>
<Assembly: AssemblyDescription("Icarus 32 bit")>
#End If
#End If
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("Icarus")>
<Assembly: AssemblyCopyright("Copyright © 2022 by Egalware s.r.l.")>
@@ -60,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.10.3")>
<Assembly: AssemblyFileVersion("2.4.10.3")>
<Assembly: AssemblyVersion("2.4.12.3")>
<Assembly: AssemblyFileVersion("2.4.12.3")>
+32 -7
View File
@@ -80,13 +80,6 @@
</TabItem>
<TabItem Header="{Binding CADMsg}">
<StackPanel Margin="5,5,5,0">
<!--<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding DefMaterialColorMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding DefMaterialColor}"
Command="{Binding DefMaterialColor_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>-->
<UniformGrid Grid.ColumnSpan="2" Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
@@ -94,6 +87,38 @@
VerticalContentAlignment="Center"
Margin="10,0,0,0"/>
</UniformGrid>
<ItemsControl ItemsSource="{Binding LayerColorList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding Color_Msg}" VerticalAlignment="Center"/>
<Grid Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="35"/>
</Grid.ColumnDefinitions>
<Button Background="{Binding Background}"
Command="{Binding Color_Command}"
Margin="0,0,5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Slider Grid.Column="1"
Value="{Binding dAlpha}"
Minimum="10"
Maximum="100"
TickPlacement="BottomRight"
TickFrequency="10"
IsSnapToTickEnabled="True"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="2"
Text="{Binding sAlpha}"
TextAlignment="Right"/>
</Grid>
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding DimensionMsg}"
Margin="0,0,0,5">
+155 -52
View File
@@ -179,12 +179,16 @@ Public Class OptionWindowVM
End Get
End Property
Public ReadOnly Property DefMaterialColor As Brush
' lista oggetti che gestiscono colori e trasparenze delle catogorie
Private m_LayerColorList As New ObservableCollection(Of LayerColor)({New LayerColor(LayerColor.LayerType.PRINTPART),
New LayerColor(LayerColor.LayerType.RIBS),
New LayerColor(LayerColor.LayerType.SHELLNUMBERS),
New LayerColor(LayerColor.LayerType.AUXSOLIDS),
New LayerColor(LayerColor.LayerType.MACHSTART),
New LayerColor(LayerColor.LayerType.OTHERS)})
Public ReadOnly Property LayerColorList As ObservableCollection(Of LayerColor)
Get
Return New SolidColorBrush(Color.FromArgb(CByte(255),
CByte(OptionModule.m_DefMaterialColor.R),
CByte(OptionModule.m_DefMaterialColor.G),
CByte(OptionModule.m_DefMaterialColor.B)))
Return m_LayerColorList
End Get
End Property
@@ -195,7 +199,7 @@ Public Class OptionWindowVM
Set(value As Boolean)
OptionModule.m_bThickLine = value
WriteMainPrivateProfileString(S_SCENE, K_LINEWIDTH, If(value, "2", "1"))
EgtSetLineAttribs( If( value, 2, 1))
EgtSetLineAttribs(If(value, 2, 1))
End Set
End Property
@@ -510,11 +514,11 @@ Public Class OptionWindowVM
'End Property
' Definizione comandi
Private m_cmdTopSceneBackground As ICommand
Private m_cmdBotSceneBackground As ICommand
Private m_cmdGridColor As ICommand
Private m_cmdUpdateLicenceCmd As ICommand
Private m_cmdDefMaterialColor As ICommand
Private m_cmdAddMachineCmd As ICommand
Private m_cmdExportMachineCmd As ICommand
@@ -583,11 +587,6 @@ Public Class OptionWindowVM
Return EgtMsg(6513)
End Get
End Property
Public ReadOnly Property DefMaterialColorMsg As String
Get
Return EgtMsg(6512)
End Get
End Property
Public ReadOnly Property ImportMsg As String
Get
@@ -747,9 +746,35 @@ Public Class OptionWindowVM
#End Region
Public Function WritePrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Color As Color3d) As Boolean
Dim sColor As String = Color.R & "," & Color.G & "," & Color.B
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean
' Recupero colori custom
Dim sCustomColors As String = ""
GetMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, "", sCustomColors)
Dim CustomColors() As String = sCustomColors.Split(","c)
Dim nCustomColors As New List(Of Integer)
For Each Color In CustomColors
Dim nColor As Integer
If Integer.TryParse(Color, nColor) Then
nCustomColors.Add(nColor)
End If
Next
' Creo dialogo colori
Dim ColorDlg As New System.Windows.Forms.ColorDialog
ColorDlg.FullOpen = True
ColorDlg.CustomColors = nCustomColors.ToArray()
ColorDlg.Color = Col.ToColor()
' Visualizzo dialogo
If ColorDlg.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return False
' Recupero colore scelto
NewCol.FromColor(ColorDlg.Color)
' Salvo eventuali modifiche ai colori custom
sCustomColors = ""
For Each Color In ColorDlg.CustomColors
sCustomColors &= Color.ToString() & ","
Next
sCustomColors = sCustomColors.Trim({" "c, ","c})
WriteMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, sCustomColors)
Return True
End Function
#Region "COMMANDS"
@@ -854,41 +879,6 @@ Public Class OptionWindowVM
#End Region ' GridColor
#Region "DefMaterialColor"
'''' <summary>
'''' Returns a command that remove the current selected machining.
'''' </summary>
'Public ReadOnly Property DefMaterialColor_Command() As ICommand
' Get
' If m_cmdDefMaterialColor Is Nothing Then
' m_cmdDefMaterialColor = New Command(AddressOf DefMaterialColorCmd)
' End If
' Return m_cmdDefMaterialColor
' End Get
'End Property
'''' <summary>
'''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
'''' </summary>
'Public Sub DefMaterialColorCmd()
' ' Recupero colore da Ini
' Dim DefColor As New Color3d(192, 192, 192)
' GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
' ' Eseguo modifica con dialogo
' If SelectColor(DefColor, DefColor) Then
' OptionModule.m_DefMaterialColor = DefColor
' Map.refSceneHostVM.MainScene.SetDefaultMaterial(OptionModule.m_DefMaterialColor)
' WritePrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, OptionModule.m_DefMaterialColor)
' EgtDraw()
' Map.refManageLayerExpanderVM.UpdateHeaderColor(OptionModule.m_DefMaterialColor)
' Map.refManageLayerExpanderVM.LoadObjTree()
' NotifyPropertyChanged("DefMaterialColor")
' End If
'End Sub
#End Region ' DefMaterialColor
#Region "UpdateLicence"
''' <summary>
@@ -1165,10 +1155,94 @@ Public Class OptionWindowVM
#End Region ' COMMANDS
End Class
Public Class LayerColor
Inherits VMBase
Public Enum LayerType As Integer
PRINTPART = 1
RIBS = 2
SHELLNUMBERS = 3
AUXSOLIDS = 4
MACHSTART = 5
OTHERS = 6
End Enum
Private m_Type As LayerType
Public ReadOnly Property c3Color As Color3d
Get
Select Case m_Type
Case LayerType.PRINTPART
Return GeomEntityColors.c3Print
Case LayerType.RIBS
Return GeomEntityColors.c3Rib
Case LayerType.SHELLNUMBERS
Return GeomEntityColors.c3ShellNumber
Case LayerType.AUXSOLIDS
Return GeomEntityColors.c3AuxSolids
Case LayerType.MACHSTART
Return GeomEntityColors.c3MachStart
Case LayerType.OTHERS
Return GeomEntityColors.c3Others
End Select
End Get
End Property
Public ReadOnly Property Background As Brush
Get
Return New SolidColorBrush(Color.FromArgb(CByte(255),
CByte(c3Color.R),
CByte(c3Color.G),
CByte(c3Color.B)))
End Get
End Property
Public Property dAlpha As Double
Get
Return c3Color.A
End Get
Set(value As Double)
GeomEntityColors.SetAlpha(m_Type, value)
NotifyPropertyChanged(NameOf(sAlpha))
End Set
End Property
Public ReadOnly Property sAlpha As String
Get
Return c3Color.A & "%"
End Get
End Property
Public ReadOnly Property Color_Msg As String
Get
Select Case m_Type
Case LayerType.PRINTPART
Return "Print"
Case LayerType.RIBS
Return "Ribs"
Case LayerType.SHELLNUMBERS
Return "Reduce Shell Number"
Case LayerType.AUXSOLIDS
Return "Filled Solids"
Case LayerType.MACHSTART
Return "Layer Start"
Case LayerType.OTHERS
Return "Others"
End Select
End Get
End Property
Private m_cmdColor As ICommand
Sub New(Type As LayerType)
m_Type = Type
End Sub
Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean
' Recupero colori custom
Dim sCustomColors As String = ""
GetMainPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, "", sCustomColors)
GetMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, "", sCustomColors)
Dim CustomColors() As String = sCustomColors.Split(","c)
Dim nCustomColors As New List(Of Integer)
For Each Color In CustomColors
@@ -1192,10 +1266,39 @@ Public Class OptionWindowVM
sCustomColors &= Color.ToString() & ","
Next
sCustomColors = sCustomColors.Trim({" "c, ","c})
WriteMainPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, sCustomColors)
WriteMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, sCustomColors)
Return True
End Function
#Region "Color"
''' <summary>
''' Returns a command that remove the current selected machining.
''' </summary>
Public ReadOnly Property Color_Command() As ICommand
Get
If m_cmdColor Is Nothing Then
m_cmdColor = New Command(AddressOf ColorCmd)
End If
Return m_cmdColor
End Get
End Property
''' <summary>
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
''' </summary>
Public Sub ColorCmd()
' Recupero colore da Ini
Dim c3Print As Color3d = c3Color
' Eseguo modifica con dialogo
If SelectColor(c3Color, c3Print) Then
GeomEntityColors.SetColor(m_Type, c3Print)
NotifyPropertyChanged(NameOf(Background))
End If
End Sub
#End Region ' PrintPartColor
End Class
'Public Class GeomTypeConverter
+7 -4
View File
@@ -162,6 +162,9 @@ Public Class ProjManagerVM
End Sub
Friend Sub NewProject(bDialog As Boolean)
' Gestisco eventuale file corrente modificato
If Not Map.refSceneHostVM.MainController.ManageModified() Then Return
EgtResetModified()
Dim NewProjMachine As Machine
If bDialog AndAlso Map.refMachinePanelVM.MachineList.Count > 0 Then
Dim ChooseMachineWndVM As New ChooseMachineWndVM
@@ -202,7 +205,7 @@ Public Class ProjManagerVM
OpenProject(Nothing)
End Sub
Friend Sub OpenProject(sFilePath As String)
Friend Function OpenProject(sFilePath As String) As Boolean
If String.IsNullOrEmpty(sFilePath) Then
' Recupero cartella dell'ultimo progetto aperto
Dim sDir As String = Map.refSceneHostVM.MainController.GetCurrFile()
@@ -212,11 +215,11 @@ Public Class ProjManagerVM
If Not String.IsNullOrWhiteSpace(sDir) Then
sDir = Path.GetDirectoryName(sDir)
End If
Map.refSceneHostVM.MainController.OpenProject(sDir)
Return Map.refSceneHostVM.MainController.OpenProject(sDir)
Else
Map.refSceneHostVM.MainController.OpenProject(sFilePath, False)
Return Map.refSceneHostVM.MainController.OpenProject(sFilePath, False)
End If
End Sub
End Function
#End Region ' OpenCommand
@@ -103,6 +103,9 @@ Public Class ReferencePanelVM
Case ReferenceBtn.References.MC
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
End Select
Dim vtMovedPart As Vector3d
EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart", vtMovedPart)
ptOrig = ptOrig - vtMovedPart
frPrintSolid = New Frame3d(ptOrig)
End If
Dim nFrameId As Integer = EgtCreateGeoFrame(Map.refTopPanelVM.SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

+8 -19
View File
@@ -206,6 +206,7 @@
Grid.Row="6"
Content="Grid"
IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Style="{StaticResource ToolBar_TextToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="5"
@@ -270,29 +271,17 @@
<Image Source="/Resources/GridViewPanel/CplaneELEVATION.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="7"
Command="{Binding CPlaneRotate_Command}"
ToolTip="{Binding CPlaneRotateToolTip}"
Command="{Binding CPlaneOrigin_Command}"
ToolTip="{Binding CPlaneOriginToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneROTATE.png" Stretch="Uniform"/>
<Image Source="/Resources/GridViewPanel/CplaneORIGIN.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="8"
Command="{Binding CPlane3P_Command}"
ToolTip="{Binding CPlane3PToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CPlane3POINTS.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="9"
Command="{Binding CPlanePerpObj_Command}"
ToolTip="{Binding CPlanePerpObjToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CPlanePERPCURVE.png" Stretch="Uniform"/>
</Button>
<!--<Button Grid.Column="10"
Command="{Binding CPlaneObj_Command}"
ToolTip="{Binding CPlaneObjToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneOBJECT.png" Stretch="Uniform"/>
</Button>-->
</Button>
</Grid>
</Border>
<!--<Popup IsOpen="{Binding IsChecked, ElementName=GridBtn}"
@@ -527,15 +516,15 @@
<UniformGrid Columns="3">
<RadioButton Content="X"
GroupName="Axes"
IsChecked="{Binding RotAxes[0]}"
IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y"
GroupName="Axes"
IsChecked="{Binding RotAxes[1]}"
IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z"
GroupName="Axes"
IsChecked="{Binding RotAxes[2]}"
IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1"
+86 -20
View File
@@ -41,7 +41,7 @@ Public Class RibPanelVM
End Get
Set(value As RibEntity)
m_SelRib = value
EgtDeselectLayerObjs(m_nRibLayerId)
EgtDeselectAll()
If Not IsNothing(value) Then
EgtSelectObj(value.nCurveId)
EgtSelectObj(value.nExtrusionId)
@@ -74,8 +74,8 @@ Public Class RibPanelVM
Dim dNewXPos As Double = b3Reference.Min.x
StringToLen(value, dNewXPos)
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sXPos))
@@ -103,8 +103,8 @@ Public Class RibPanelVM
Dim dNewYPos As Double = b3Reference.Min.y
StringToLen(value, dNewYPos)
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sYPos))
@@ -132,8 +132,8 @@ Public Class RibPanelVM
Dim dNewZPos As Double = b3Reference.Min.y
StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sZPos))
@@ -144,12 +144,28 @@ Public Class RibPanelVM
End Property
Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean()
Public Property RotX As Boolean
Get
Return m_RotAxes
Return m_RotAxes(0)
End Get
Set(value As Boolean())
m_RotAxes = value
Set(value As Boolean)
m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set
End Property
@@ -159,7 +175,7 @@ Public Class RibPanelVM
Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then
Else
Return Vector3d.Z_AX
End If
End Get
@@ -179,20 +195,20 @@ Public Class RibPanelVM
End If
Dim nId As Integer = If(m_SelRib.Type = RibEntity.RibTypes.FROMDRAW, m_SelRib.nCurveId, m_SelRib.nExtrusionId)
Dim b3Rib As New BBox3d
EgtGetBBox(nId, GDB_BB.STANDARD, b3Rib)
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Rib)
Dim bOk As Boolean = False
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle)
If bOk AndAlso m_SelRib.Type = RibEntity.RibTypes.FROMDRAW Then EgtRotate(m_SelRib.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle)
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk AndAlso m_SelRib.Type = RibEntity.RibTypes.FROMDRAW Then EgtRotate(m_SelRib.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk Then
EgtDraw()
RefreshPos()
m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else
m_sRotAngle = value
End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Set
End Property
@@ -264,6 +280,12 @@ Public Class RibPanelVM
End Set
End Property
Public ReadOnly Property bGrid_IsEnabled As Boolean
Get
Return Map.refMyStatusBarVM.bGridVisibility
End Get
End Property
Private m_bMove_IsChecked As Boolean
Public Property bMove_IsChecked As Boolean
Get
@@ -411,6 +433,9 @@ Public Class RibPanelVM
#Region "METHODS"
Friend Sub Init()
' asse rotazione di default
RotZ = True
NotifyPropertyChanged(NameOf(RotZ))
' azzero indice
StartEntity.ResetSharedIndex()
' fisso frame originale
@@ -418,6 +443,10 @@ Public Class RibPanelVM
' recupero dati pezzo selezionato layer ed entita'
m_nPartId = Map.refTopPanelVM.SelPart.nPartId
m_nRibLayerId = Map.refTopPanelVM.SelPart.nRibsLayerId
If m_nRibLayerId = GDB_ID.NULL Then
m_nRibLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(m_nRibLayerId, LAY_RIBS)
End If
'recupero tutte le entita' rib
m_RibList.Clear()
Dim nRibId As Integer = EgtGetFirstInGroup(m_nRibLayerId)
@@ -525,7 +554,8 @@ Public Class RibPanelVM
EgtDraw()
' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull()
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE, Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE,
Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D, Controller.CMD.GRID_OBJ
' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull()
End Select
@@ -612,7 +642,18 @@ Public Class RibPanelVM
Friend Sub OnKeyDown(Key As Forms.Keys)
If Key = Forms.Keys.Escape Then
' se attiva, disattivo griglia su oggetto
If m_bCPlaneObj_IsActive Then
m_bCPlaneObj_IsActive = False
ResetCPlaneObjIsActive()
' ripristino selezioni precedenti
For Each Id In Map.refShellNumberPanelVM.PrevSelObjs
EgtSelectObj(Id)
Next
EgtDraw()
' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull()
End If
End If
End Sub
@@ -1117,6 +1158,22 @@ Public Class RibPanelVM
#Region "CPlaneObj"
Private m_bCPlaneObj_IsActive As Boolean = False
Friend ReadOnly Property bCPlaneObj_IsActive As Boolean
Get
Return m_bCPlaneObj_IsActive
End Get
End Property
Friend Sub ResetCPlaneObjIsActive()
m_bCPlaneObj_IsActive = False
End Sub
Private m_PrevSelObjs As New List(Of Integer)
Friend ReadOnly Property PrevSelObjs As List(Of Integer)
Get
Return m_PrevSelObjs
End Get
End Property
''' <summary>
''' Returns a command that do CPlanepObj.
''' </summary>
@@ -1134,7 +1191,16 @@ Public Class RibPanelVM
''' </summary>
Public Sub CPlaneObj(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ)
' salvo selezione precedente e deseleziono altri oggetti
m_PrevSelObjs.Clear()
Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
While nSelObjId <> GDB_ID.NULL
m_PrevSelObjs.Add(nSelObjId)
nSelObjId = EgtGetNextSelectedObj()
End While
EgtDeselectAll()
m_bCPlaneObj_IsActive = True
' Map.refControllerInputPanelVM.PrepareInputBox("Grid from Selection", "Select the face of the object where to place the grid", "", False, False)
End Sub
#End Region ' CPlaneObj
+2 -2
View File
@@ -58,7 +58,7 @@
<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}"
IsEnabled="{Binding bIsModifiedFromPart}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
@@ -80,7 +80,7 @@
<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}"
IsEnabled="{Binding bIsModifiedFromPart}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
+243 -7
View File
@@ -41,12 +41,14 @@ Public Class RibParamPanelVM
m_Type = Cathegories.RIBS
m_sName = "Ribs"
m_MachiningParamList = New List(Of MachiningParam)({New RibNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nRibId, nPartId),
m_MachiningParamList = New List(Of MachiningParam)({New RibComboMachiningParam(MachiningParam.Params.RIBSTYPE, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nRibId, nPartId),
New RibCheckMachiningParam(MachiningParam.Params.RIBSLINK, nRibId, nPartId),
New RibCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nRibId, nPartId),
New RibCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nRibId, nPartId),
New RibCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nRibId, nPartId),
@@ -70,9 +72,21 @@ Public Class RibParamPanelVM
Friend Sub WriteParamsInRib(nRibId As Integer)
' se parametri modificati
Dim bModified As Boolean = False
For Each Param As RibNumericMachiningParam In m_MachiningParamList
If Param.bIsModified AndAlso Not bModified Then bModified = True
Param.WriteParamInRib(nRibId)
For Each Param In m_MachiningParamList
Select Case Param.GetType()
Case GetType(RibNumericMachiningParam)
Dim NumericParam As RibNumericMachiningParam = TryCast(Param, RibNumericMachiningParam)
If NumericParam.bIsModified AndAlso Not bModified Then bModified = True
NumericParam.WriteParamInRib(nRibId)
Case GetType(RibComboMachiningParam)
Dim ComboParam As RibComboMachiningParam = TryCast(Param, RibComboMachiningParam)
If ComboParam.bIsModified AndAlso Not bModified Then bModified = True
ComboParam.WriteParamInRib(nRibId)
Case GetType(RibCheckMachiningParam)
Dim CheckParam As RibCheckMachiningParam = TryCast(Param, RibCheckMachiningParam)
If CheckParam.bIsModified AndAlso Not bModified Then bModified = True
CheckParam.WriteParamInRib(nRibId)
End Select
Next
If bModified Then
' Imposto flag di ricalcolo slice
@@ -324,4 +338,226 @@ Public Class RibNumericMachiningParam
#End Region ' COMMANDS
End Class
Public Class RibComboMachiningParam
Inherits ComboMachiningParam
Public Overrides Property SelValue As IdNameStruct
Get
Return m_SelValue
End Get
Set(value As IdNameStruct)
m_SelValue = value
NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Set
End Property
Protected m_PartSelValue As IdNameStruct
Public ReadOnly Property PartSelValue As IdNameStruct
Get
Return m_PartSelValue
End Get
End Property
Public ReadOnly Property bIsModifiedFromPart As Boolean
Get
Return m_SelValue.Id <> m_PartSelValue.Id
End Get
End Property
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nRibId As Integer, nPartId As Integer)
MyBase.New(Type)
Dim bReadFromRib As Boolean = False
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.RIBSTYPE
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_RIBSTYPE.INTERNAL, "Internal"),
New IdNameStruct(Machining.MPAR_RIBSTYPE.EXTERNAL, "External"),
New IdNameStruct(Machining.MPAR_RIBSTYPE.UNBOUNDED, "Unbounded")})
Dim nSelValue As Integer = 1
bReadFromRib = EgtGetInfo(nRibId, MAC_RIBSTYPE, nSelValue)
If bReadFromRib Then
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End If
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSTYPE, nSelValue)
m_PartSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End Select
m_OrigSelValue = m_SelValue
If Not bReadFromRib Then
If bReadFromPart Then
m_SelValue = m_PartSelValue
m_OrigSelValue = m_PartSelValue
ElseIf Type = Params.RIBSTYPE Then
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_RIBSTYPE.INTERNAL)
m_SelValue = m_OrigSelValue
End If
End If
End Sub
Friend Sub WriteParamInRib(nRibId As Integer)
Select Case Type
Case Params.RIBSTYPE
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_RIBSTYPE, m_SelValue.Id)
Else
EgtRemoveInfo(nRibId, MAC_RIBSTYPE)
End If
End Select
End Sub
Friend Overrides Sub SaveParam()
m_OrigSelValue = m_SelValue
End Sub
Friend Overrides Sub ResetParam()
m_SelValue = m_OrigSelValue
End Sub
#Region "COMMANDS"
#Region "ResetParam"
Public ReadOnly Property ResetParam_Command As ICommand
Get
If m_cmdResetParam Is Nothing Then
m_cmdResetParam = New Command(AddressOf ResetParamCmd)
End If
Return m_cmdResetParam
End Get
End Property
Public Sub ResetParamCmd()
m_SelValue = m_PartSelValue
NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Sub
#End Region ' ResetParam
#End Region ' COMMANDS
End Class
Public Class RibCheckMachiningParam
Inherits CheckMachiningParam
Public Overrides Property bValue As Boolean
Get
Return m_bValue
End Get
Set(value As Boolean)
m_bValue = value
NotifyPropertyChanged(NameOf(bValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Set
End Property
Protected m_bPartValue As Boolean
Public ReadOnly Property bPartValue As Boolean
Get
Return m_bPartValue
End Get
End Property
Public ReadOnly Property bIsModifiedFromPart As Boolean
Get
Return m_bValue <> m_bPartValue
End Get
End Property
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nRibId As Integer, nPartId As Integer)
MyBase.New(Type)
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.RIBSLINK
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLINK, m_bValue)
EgtGetInfo(nPartId, MAC_RIBSLINK, m_bPartValue)
Case Params.RIBSINVERTDIRECTION
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTDIRECTION, m_bValue)
EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bPartValue)
Case Params.RIBSLEADININVERT
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLEADININVERT, m_bValue)
EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bPartValue)
Case Params.RIBSLEADOUTINVERT
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLEADOUTINVERT, m_bValue)
EgtGetInfo(nPartId, MAC_RIBSLEADOUTINVERT, m_bPartValue)
End Select
m_bOrigValue = m_bValue
If Not bReadFromPart Then
m_bValue = m_bPartValue
m_bOrigValue = m_bPartValue
End If
End Sub
Friend Sub WriteParamInRib(nRibId As Integer)
Select Case Type
Case Params.RIBSLINK
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_RIBSLINK, If(m_bValue, 1, 0))
Else
EgtRemoveInfo(nRibId, MAC_RIBSLINK)
End If
Case Params.RIBSINVERTDIRECTION
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
Else
EgtRemoveInfo(nRibId, MAC_RIBSINVERTDIRECTION)
End If
Case Params.RIBSLEADININVERT
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
Else
EgtRemoveInfo(nRibId, MAC_RIBSLEADININVERT)
End If
Case Params.RIBSLEADOUTINVERT
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0))
Else
EgtRemoveInfo(nRibId, MAC_RIBSLEADOUTINVERT)
End If
End Select
End Sub
Friend Overrides Sub SaveParam()
m_bOrigValue = m_bValue
End Sub
Friend Overrides Sub ResetParam()
m_bValue = m_bOrigValue
NotifyPropertyChanged(NameOf(bValue))
End Sub
#Region "COMMANDS"
#Region "ResetParam"
Public ReadOnly Property ResetParam_Command As ICommand
Get
If m_cmdResetParam Is Nothing Then
m_cmdResetParam = New Command(AddressOf ResetParamCmd)
End If
Return m_cmdResetParam
End Get
End Property
Public Sub ResetParamCmd()
m_bValue = m_bPartValue
NotifyPropertyChanged(NameOf(bValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Sub
#End Region ' ResetParam
#End Region ' COMMANDS
End Class
+154 -69
View File
@@ -11,6 +11,8 @@ Public Class MySceneHostVM
m_bIsFocused = bValue
End Sub
' Flag per distinguere tra Save a SaveAs
Private m_bIsSaveAs As Boolean = False
' Identificativi per pezzo da selezionare/deselezionare
Private m_nIdToSel As Integer = GDB_ID.NULL
Private m_nIdToDesel As Integer = GDB_ID.NULL
@@ -187,12 +189,13 @@ Public Class MySceneHostVM
MainController.SetSurfTmTolerance(0.05)
MainController.SetUseCustomColors(True, S_SCENE, K_CUSTOMCOLORS)
' imposto unità di misura per interfaccia utente
Dim bMmUnits As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
Dim bMmUnits As Boolean = GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0
EgtSetUiUnits(bMmUnits)
'Map.refMyStatusBarVM.SetMeasureUnit(nMeasureUnit <> 0)
' imposto visualizzazione riferimento globale
EgtSetGlobFrameShow(True)
' imposto i dati della griglia
Dim bGridVisibility As Boolean = (GetMainPrivateProfileInt(S_GRID, K_SHOWGRID, 1) <> 0)
Dim dSnapStepMm As Double = GetMainPrivateProfileDouble(S_GRID, K_SNAPSTEP, 10)
Dim dSnapStepInch As Double = GetMainPrivateProfileDouble(S_GRID, K_SNAPSTEPINCH, 10)
Dim nMinLineSStep As Integer = GetMainPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1)
@@ -209,15 +212,15 @@ Public Class MySceneHostVM
EgtSetGridGeo(dSnapStepInch, nMinLineSStep, nMajLineSStep, nExtSStep)
End If
EgtSetGridColor(MinLnColor, MajLnColor)
EgtSetGridShow(True, False)
EgtSetGridShow(bGridVisibility, bGridVisibility)
' imposto tipo coordinate
MainScene.SetGridCursorPos(True)
' modo di visualizzazione
Dim nShowMode As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
'Map.refShowPanelVM.SetShowMode(DirectCast(nShowMode, SM))
' visualizzazione avanzata dei triangoli costituenti le superfici
Dim bShowTriaAdv As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
EgtSetShowTriaAdv(bShowTriaAdv)
' visualizzazione direzione curve
Dim bShowCurveDirection As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_CURVEDIR, 0) <> 0)
EgtSetShowCurveDirection(bShowCurveDirection)
' tipo visualizzazione per Zmap
Dim nShowZmap As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1)
EgtSetShowZmap(DirectCast(nShowZmap, ZSM), False)
@@ -225,7 +228,7 @@ Public Class MySceneHostVM
Dim nTxrMaxLinPix As Integer = GetMainPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
' tipo snap point
MainScene.SetSnapPointType(SP.PT_SKETCH)
MainScene.SetSnapPointType(SP.PT_GRID)
' nascondo input box
'Map.refFreeContourInputVM.ResetInputBox()
End Sub
@@ -292,7 +295,9 @@ Public Class MySceneHostVM
End Sub
Public Overrides Sub SaveAsProject()
m_bIsSaveAs = True
MyBase.SaveAsProject()
m_bIsSaveAs = False
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
End Sub
@@ -308,6 +313,7 @@ Public Class MySceneHostVM
sDir = Path.GetDirectoryName(sDir)
End If
If Not Directory.Exists(sDir) Then sDir = ""
Dim ExtIndex As Integer = GetMainPrivateProfileInt(S_PRINTING3D, K_IMPORTCURREXTENSION, 1)
Dim OpenFileDialog As New OpenFileDialog With {.Title = "Insert",
.Filter = "Stereolithography (*.stl)|*.stl" &
"|Iges files (*.igs;*.iges)|*.igs;*.iges" &
@@ -315,11 +321,12 @@ Public Class MySceneHostVM
"|3D Manufacturing format (*.3mf)|*.3mf" &
"|New geometry EgalTech(*.nge)|*.nge" &
"|All Files (*.*)|*.*",
.FilterIndex = 1,
.FilterIndex = ExtIndex,
.InitialDirectory = sDir}
If Not OpenFileDialog.ShowDialog Then
Return
End If
WriteMainPrivateProfileString(S_PRINTING3D, K_IMPORTCURREXTENSION, OpenFileDialog.FilterIndex)
Dim sFile As String = String.Empty
sFile = OpenFileDialog.FileName
' importo la nuova geometria
@@ -842,11 +849,16 @@ Public Class MySceneHostVM
If Not bOk Then
MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error
End If
Map.refTopPanelVM.PartList.Clear()
Map.refTopPanelVM.SetSelModifyMode(ModifyModes.NULL)
Map.refSliceManagerVM.UpdateTimeAndMass()
Map.refSliderManagerVM.RefreshSlider(0, 0)
Map.refSliderManagerVM.SetLayerIndexToMax()
' resetto calcolo solidi
Map.refViewLayerManagerVM.ResetSolid()
EgtZoom(ZM.ALL)
MainScene.SetStatusNull()
End Sub
@@ -865,9 +877,20 @@ Public Class MySceneHostVM
End If
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
End If
' leggo materiale
' leggo materiale e macchina
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
If nTabPartId <> GDB_ID.NULL Then
Dim sMachineName As String = ""
if Not EgtGetInfo(nTabPartId, KEY_MACHINE_NAME, sMachineName) Then sMachineName = "Cms-Kreator"
Dim ProjectMachine As Machine = Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = sMachineName)
If Not IsNothing(ProjectMachine) Then
' imposto la macchina
Map.refMachinePanelVM.SelectedMachine = ProjectMachine
Else
MessageBox.Show("Project machine not found! Impossible to open the project.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Map.refProjManagerVM.NewProject(False)
Return
End If
Dim sMaterialGuid As String = ""
EgtGetInfo(nTabPartId, KEY_MATERIAL_GUID, sMaterialGuid)
Dim MaterialGuid As Guid
@@ -877,11 +900,12 @@ Public Class MySceneHostVM
ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = sMaterialGuid)
End If
If IsNothing(ProjectMaterial) Then
Dim sMaterialName As String = EgtSetInfo(nTabPartId, KEY_MATERIAL_GUID, Map.refTopPanelVM.SelMaterial.sName)
Dim sMaterialName As String = ""
EgtGetInfo(nTabPartId, KEY_MATERIAL_NAME, sMaterialName)
ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sName = sMaterialName)
End If
If Not IsNothing(ProjectMaterial) Then
Map.refTopPanelVM.SelMaterial = ProjectMaterial
Map.refTopPanelVM.SetSelMaterial(ProjectMaterial, True)
Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.SelMaterial))
End If
End If
@@ -897,7 +921,6 @@ Public Class MySceneHostVM
End If
Dim nPrintPartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, PRINT_SOLID)
Dim nPrintPartId As Integer = EgtGetFirstInGroup(nPrintPartLayerId)
Dim nOriginalPartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, ORIGINAL_SOLID)
Dim nRibsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_RIBS)
Dim nShellNumberLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_SHELL_NBR)
Dim nAuxSolidsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX_SOLIDS)
@@ -907,7 +930,7 @@ Public Class MySceneHostVM
EgtGetInfo(nPartId, FILE_PATH, sFilePath)
Dim nReferenceLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_REFERENCE)
Dim nFrameId As Integer = EgtGetFirstInGroup(nReferenceLayerId)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPrintPartId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
Dim bPartToRecalc As Boolean = False
EgtGetInfo(nPartId, MAC_TORECALC_SLICE, bPartToRecalc)
@@ -917,10 +940,12 @@ Public Class MySceneHostVM
' setto i solidi non calcolati
EgtSetInfo(nPartId, KEY_CALC_SOLIDS, 0)
EgtSetInfo(nPartId, KEY_HAS_SOLIDS, 0)
nPartId = EgtGetNextPart(nPartId)
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
nPartId = EgtGetNextPart(nPartId)
End While
' aggiorno colori entita'
GeomEntityColors.UpdateColors(LayerType.ALL)
' se non e' da ricalcolare, recupero tempo e massa
If Not bProjectToRecalc Then
@@ -932,6 +957,9 @@ Public Class MySceneHostVM
' seleziono primo pezzo trovato
Map.refTopPanelVM.SelFirstPart()
' resetto calcolo solidi
Map.refViewLayerManagerVM.ResetSolid()
' imposto modalita' modifica
Map.refTopPanelVM.SelPage = Pages.MODIFY
@@ -941,6 +969,13 @@ Public Class MySceneHostVM
End Sub
Private Sub OnSavingProject(ByVal sender As Object, sFile As String)
' Se in SaveAs, aggiorno nome CN da generare
If m_bIsSaveAs Then
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
If nTabPartId <> GDB_ID.NULL Then
EgtRemoveInfo(nTabPartId, KEY_ISOFILE_PATH)
End If
End If
End Sub
Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
@@ -1155,7 +1190,7 @@ Public Class MySceneHostVM
While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
If nPartId = Map.refImportPanelVM.nImportedPartId Then
If nPartId = Map.refManagePartPanelVM.nImportedPartId Then
Dim EntityType As GDB_TY = EgtGetType(nId)
Select Case EntityType
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO, GDB_TY.CRV_LINE
@@ -1169,20 +1204,6 @@ Public Class MySceneHostVM
End While
' Memorizzo Id da selezionare
m_nIdToSel = nCurrIdToSel
'While nId <> GDB_ID.NULL
' ' Recupero l'identificativo del pezzo cui appartiene
' Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
' Dim bFound As Boolean = False
' If nPartId = Map.refImportPanelVM.nImportedPartId Then bFound = True
' If Not bFound Then
' nId = EgtGetNextObjInSelWin()
' Continue While
' End If
' ' Memorizzo Id da selezionare
' m_nIdToSel = nId
' Exit While
' nId = EgtGetNextObjInSelWin()
'End While
' Dati per drag
m_bDragToStart = True
End Sub
@@ -1205,7 +1226,7 @@ Public Class MySceneHostVM
If Not m_bDragToStart Then
' Se selezione da eseguire
ElseIf m_nIdToSel <> GDB_ID.NULL Then
Map.refImportPanelVM.SetSelImportedEntity(m_nIdToSel)
Map.refManagePartPanelVM.SetSelImportedEntity(m_nIdToSel)
End If
' Reset
m_bDrag = False
@@ -1224,19 +1245,33 @@ Public Class MySceneHostVM
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
Dim nId As Integer = EgtGetFirstObjInSelWin()
While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(nId)
Dim bFound As Boolean = False
If nPartId = Map.refStartMachPanelVM.nStartMachLayerId Then bFound = True
If Not bFound Then
nId = EgtGetNextObjInSelWin()
Continue While
' Se per Griglia da faccia di oggetto
If Map.refStartMachPanelVM.bCPlaneObj_IsActive Then
If EgtGetType( nId) = GDB_TY.SRF_MESH Then
m_nIdToSel = nId
Exit While
End If
Else
' Recupero l'identificativo del pezzo cui appartiene
Dim nStartMachLayerId As Integer = EgtGetParent(nId)
If nStartMachLayerId = Map.refStartMachPanelVM.nStartMachLayerId Then
m_nIdToSel = nId
Exit While
End If
End If
' Memorizzo Id da selezionare
m_nIdToSel = nId
Exit While
nId = EgtGetNextObjInSelWin()
End While
If Map.refStartMachPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' recupero dati punto di selezione
Dim PtTemp As Point3d
Dim nAux As Integer
If EgtGetPointFromSelect(m_nIdToSel, e.Location, PtTemp, nAux) Then
' eseguo la selezione
EgtSelectObj(m_nIdToSel)
' dati ausiliari
EgtSetSelInfo(m_nIdToSel, nAux, PtTemp)
End If
End If
' Dati per drag
m_bDragToStart = True
End Sub
@@ -1257,10 +1292,22 @@ Public Class MySceneHostVM
Friend Sub StartMach_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Se eseguito drag
If Not m_bDragToStart Then
' Se selezione da eseguire
' Se selezione da eseguire
ElseIf m_nIdToSel <> GDB_ID.NULL Then
' Eseguo la selezione
Map.refStartMachPanelVM.SelStartFromId(m_nIdToSel)
If Map.refStartMachPanelVM.bCPlaneObj_IsActive Then
' eseguo comando
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ)
Map.refStartMachPanelVM.ResetCPlaneObjIsActive()
' ripristino selezioni precedenti
For Each Id In Map.refStartMachPanelVM.PrevSelObjs
EgtSelectObj(Id)
Next
Map.refControllerInputPanelVM.ResetInputBox()
Else
' Eseguo la selezione
Map.refStartMachPanelVM.SelStartFromId(m_nIdToSel)
End If
End If
' Reset
m_bDrag = False
@@ -1280,19 +1327,32 @@ Public Class MySceneHostVM
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
Dim nId As Integer = EgtGetFirstObjInSelWin()
While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(nId)
Dim bFound As Boolean = False
If nPartId = Map.refRibPanelVM.nRibLayerId Then bFound = True
If Not bFound Then
nId = EgtGetNextObjInSelWin()
Continue While
' Se per Griglia da faccia di oggetto
If Map.refRibPanelVM.bCPlaneObj_IsActive Then
If EgtGetType( nId) = GDB_TY.SRF_MESH Then
m_nIdToSel = nId
Exit While
End If
Else
Dim nRibLayerId As Integer = EgtGetParent(nId)
If nRibLayerId = Map.refRibPanelVM.nRibLayerId Then
m_nIdToSel = nId
Exit While
End If
End If
' Memorizzo Id da selezionare
m_nIdToSel = nId
Exit While
nId = EgtGetNextObjInSelWin()
End While
If Map.refRibPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' recupero dati punto di selezione
Dim PtTemp As Point3d
Dim nAux As Integer
If EgtGetPointFromSelect(m_nIdToSel, e.Location, PtTemp, nAux) Then
' eseguo la selezione
EgtSelectObj(m_nIdToSel)
' dati ausiliari
EgtSetSelInfo(m_nIdToSel, nAux, PtTemp)
End If
End If
' Dati per drag
m_bDragToStart = True
End Sub
@@ -1313,10 +1373,22 @@ Public Class MySceneHostVM
Friend Sub Rib_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Se eseguito drag
If Not m_bDragToStart Then
' Se selezione da eseguire
' Se selezione da eseguire
ElseIf m_nIdToSel <> GDB_ID.NULL Then
' Eseguo la selezione
Map.refRibPanelVM.SelStartFromId(m_nIdToSel)
If Map.refRibPanelVM.bCPlaneObj_IsActive Then
' eseguo comando
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ)
Map.refRibPanelVM.ResetCPlaneObjIsActive()
' ripristino selezioni precedenti
For Each Id In Map.refRibPanelVM.PrevSelObjs
EgtSelectObj(Id)
Next
Map.refControllerInputPanelVM.ResetInputBox()
Else
' Eseguo la selezione
Map.refRibPanelVM.SelStartFromId(m_nIdToSel)
End If
End If
' Reset
m_bDrag = False
@@ -1330,25 +1402,39 @@ Public Class MySceneHostVM
#Region "ShellNumber"
Friend Sub ShellNumber_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
m_nIdToSel = GDB_ID.NULL
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(True, True, True, True, True)
Dim nSel As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
Dim nId As Integer = EgtGetFirstObjInSelWin()
While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(nId)
Dim bFound As Boolean = False
If nPartId = Map.refShellNumberPanelVM.nShellNumberLayerId Then bFound = True
If Not bFound Then
nId = EgtGetNextObjInSelWin()
Continue While
' Se per Griglia da faccia di oggetto
If Map.refShellNumberPanelVM.bCPlaneObj_IsActive Then
If EgtGetType( nId) = GDB_TY.SRF_MESH Then
m_nIdToSel = nId
Exit While
End If
Else
Dim nShellNumberLayerId As Integer = EgtGetParent(nId)
If nShellNumberLayerId = Map.refShellNumberPanelVM.nShellNumberLayerId Then
m_nIdToSel = nId
Exit While
End If
End If
' Memorizzo Id da selezionare
m_nIdToSel = nId
Exit While
nId = EgtGetNextObjInSelWin()
End While
If Map.refShellNumberPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' recupero dati punto di selezione
Dim PtTemp As Point3d
Dim nAux As Integer
If EgtGetPointFromSelect(m_nIdToSel, e.Location, PtTemp, nAux) Then
' eseguo la selezione
EgtSelectObj(m_nIdToSel)
' dati ausiliari
EgtSetSelInfo(m_nIdToSel, nAux, PtTemp)
End If
End If
' Dati per drag
m_bDragToStart = True
End Sub
@@ -1369,11 +1455,10 @@ Public Class MySceneHostVM
Friend Sub ShellNumber_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Se eseguito drag
If Not m_bDragToStart Then
' Se selezione da eseguire
' Se selezione da eseguire
ElseIf m_nIdToSel <> GDB_ID.NULL Then
If Map.refShellNumberPanelVM.bCPlaneObj_IsActive Then
' eseguo la selezione
EgtSelectObj(m_nIdToSel)
' eseguo comando
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ)
Map.refShellNumberPanelVM.ResetCPlaneObjIsActive()
@@ -1394,7 +1479,7 @@ Public Class MySceneHostVM
EgtDraw()
End Sub
#End Region ' Rib
#End Region ' ShellNumber
#End Region ' VIEW EVENTS
@@ -4,6 +4,12 @@ Imports EgtUILib
Public Class SecondaryWindowV
Private m_SecondaryWindowVM As SecondaryWindowVM
Private m_WindowChangingState As Boolean = False
Public ReadOnly Property WindowChangingState As Boolean
Get
Return m_WindowChangingState
End Get
End Property
#Region "CONSTRUCTOR"
@@ -55,9 +61,11 @@ Public Class SecondaryWindowV
End Sub
Private Sub SecondaryWindowV_StateChanged(sender As Object, e As EventArgs)
m_WindowChangingState = True
Application.Current.MainWindow.WindowState = Me.WindowState
Application.Current.MainWindow.Topmost = True
Application.Current.MainWindow.Topmost = False
m_WindowChangingState = False
End Sub
#End Region ' CONSTRUCTOR
+47 -2
View File
@@ -1,9 +1,13 @@
Imports EgtWPFLib5
Imports EgtUILib
Imports System.Windows.Threading
Public Class SecondaryWindowVM
Inherits VMBase
Private m_SplashScreen_Timer As New DispatcherTimer
Private m_WaitAfterRender As Integer = 0
' Titolo
Private m_sTitle As String
Public Property sTitle As String
@@ -47,6 +51,12 @@ Public Class SecondaryWindowVM
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefSecondaryWindowVM(Me)
' imposto e avvio contatore SplashScreen
m_SplashScreen_Timer.Interval = New TimeSpan(0, 0, 0, 0, 500)
AddHandler m_SplashScreen_Timer.Tick, AddressOf SplashScreenTimer_Tick
If Not IsNothing(Map.refSplashScreen) Then
m_SplashScreen_Timer.Start()
End If
End Sub
#End Region ' CONSTRUCTOR
@@ -59,14 +69,49 @@ Public Class SecondaryWindowVM
Map.refMyStatusBarVM.SetSnapPointType(Map.refSceneHostVM.SnapType)
Map.refMyStatusBarVM.SetMeasureUnit(EgtUiUnitsAreMM)
EgtSetView(VT.ISO_SW, False)
' creo nuovo progetto di partenza
Map.refProjManagerVM.NewProject(False)
' provo a caricare progetto da linea di comando
If Not ProcessCommandLine() Then
' altrimenti creo nuovo progetto di partenza
Map.refProjManagerVM.NewProject(False)
End If
' leggo stati visualizzazione layer
Map.refViewLayerManagerVM.UpdateIsVisibleFromIni()
' resetto segnalazione modifiche
EgtResetModified()
' segno su contatore splashscreen render finito
m_WaitAfterRender = 1
End Sub
Private Sub SplashScreenTimer_Tick()
If m_WaitAfterRender > 1 Then
' chiudo SplashScreen
Map.refSplashScreen.Close()
ElseIf m_WaitAfterRender > 0 Then
m_WaitAfterRender += 1
End If
End Sub
Friend Function ProcessCommandLine() As Boolean
' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
If Environment.GetCommandLineArgs.Count() <= 1 Then Return False
' Recupero il primo vero parametro che dovrebbe essere il nome con estensione di un file
Dim sFile As String = Environment.GetCommandLineArgs(1)
Dim sExt As String = IO.Path.GetExtension(sFile).ToLower()
If String.IsNullOrWhiteSpace(sFile) OrElse String.IsNullOrWhiteSpace(sExt) Then Return False
Return OpenStdFile(sFile)
End Function
Friend Function OpenStdFile(sFile As String) As Boolean
Dim nFileType As Integer = EgtGetFileType(sFile)
Select Case nFileType
Case FT.NGE
Return Map.refProjManagerVM.OpenProject(sFile)
'Case FT.DXF, FT.STL, FT._3MF, FT.OBJ, FT.CNC, FT.CSF, FT.BTL, FT.BTLX, FT.IMG, FT.PNT, FT.IGES, FT.STEP_, FT.ACIS, FT.PARASOLID, FT.JT, FT.VRML, FT.C3D
' Return m_Controller.ImportProject(sFile, False)
End Select
Return False
End Function
#Region "COMMANDS"
#Region "AboutBoxCommand"
+9 -20
View File
@@ -206,6 +206,7 @@
Grid.Row="6"
Content="Grid"
IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Style="{StaticResource ToolBar_TextToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="5"
@@ -269,30 +270,18 @@
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneELEVATION.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="7"
Command="{Binding CPlaneRotate_Command}"
ToolTip="{Binding CPlaneRotateToolTip}"
<Button Grid.Column="7"
Command="{Binding CPlaneOrigin_Command}"
ToolTip="{Binding CPlaneOriginToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneROTATE.png" Stretch="Uniform"/>
<Image Source="/Resources/GridViewPanel/CPlaneORIGIN.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="8"
Command="{Binding CPlane3P_Command}"
ToolTip="{Binding CPlane3PToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CPlane3POINTS.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="9"
Command="{Binding CPlanePerpObj_Command}"
ToolTip="{Binding CPlanePerpObjToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CPlanePERPCURVE.png" Stretch="Uniform"/>
</Button>
<!--<Button Grid.Column="10"
Command="{Binding CPlaneObj_Command}"
ToolTip="{Binding CPlaneObjToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneOBJECT.png" Stretch="Uniform"/>
</Button>-->
</Button>
</Grid>
</Border>
<!--<Popup IsOpen="{Binding IsChecked, ElementName=GridBtn}"
@@ -527,15 +516,15 @@
<UniformGrid Columns="3">
<RadioButton Content="X"
GroupName="Axes"
IsChecked="{Binding RotAxes[0]}"
IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y"
GroupName="Axes"
IsChecked="{Binding RotAxes[1]}"
IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z"
GroupName="Axes"
IsChecked="{Binding RotAxes[2]}"
IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1"
+52 -21
View File
@@ -41,7 +41,7 @@ Public Class ShellNumberPanelVM
End Get
Set(value As ShellNumberEntity)
m_SelShellNumber = value
EgtDeselectLayerObjs(m_nShellNumberLayerId)
EgtDeselectAll()
If Not IsNothing(value) Then
EgtSelectObj(value.nCurveId)
EgtSelectObj(value.nExtrusionId)
@@ -74,8 +74,8 @@ Public Class ShellNumberPanelVM
Dim dNewXPos As Double = b3Reference.Min.x
StringToLen(value, dNewXPos)
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(m_SelShellNumber.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelShellNumber.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sXPos))
@@ -103,8 +103,8 @@ Public Class ShellNumberPanelVM
Dim dNewYPos As Double = b3Reference.Min.y
StringToLen(value, dNewYPos)
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sYPos))
@@ -132,8 +132,8 @@ Public Class ShellNumberPanelVM
Dim dNewZPos As Double = b3Reference.Min.y
StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sZPos))
@@ -144,12 +144,28 @@ Public Class ShellNumberPanelVM
End Property
Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean()
Public Property RotX As Boolean
Get
Return m_RotAxes
Return m_RotAxes(0)
End Get
Set(value As Boolean())
m_RotAxes = value
Set(value As Boolean)
m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set
End Property
@@ -159,7 +175,7 @@ Public Class ShellNumberPanelVM
Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then
Else
Return Vector3d.Z_AX
End If
End Get
@@ -179,20 +195,20 @@ Public Class ShellNumberPanelVM
End If
Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId)
Dim b3Rib As New BBox3d
EgtGetBBox(nId, GDB_BB.STANDARD, b3Rib)
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Rib)
Dim bOk As Boolean = False
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle)
If bOk AndAlso m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW Then EgtRotate(m_SelShellNumber.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle)
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk AndAlso m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW Then EgtRotate(m_SelShellNumber.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk Then
EgtDraw()
RefreshPos()
m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else
m_sRotAngle = value
End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Set
End Property
@@ -264,6 +280,12 @@ Public Class ShellNumberPanelVM
End Set
End Property
Public ReadOnly Property bGrid_IsEnabled As Boolean
Get
Return Map.refMyStatusBarVM.bGridVisibility
End Get
End Property
Private m_bMove_IsChecked As Boolean
Public Property bMove_IsChecked As Boolean
Get
@@ -411,6 +433,9 @@ Public Class ShellNumberPanelVM
#Region "METHODS"
Friend Sub Init()
' asse rotazione di default
RotZ = True
NotifyPropertyChanged(NameOf(RotZ))
' azzero indice
StartEntity.ResetSharedIndex()
' fisso frame originale
@@ -418,7 +443,11 @@ Public Class ShellNumberPanelVM
' recupero dati pezzo selezionato layer ed entita'
m_nPartId = Map.refTopPanelVM.SelPart.nPartId
m_nShellNumberLayerId = Map.refTopPanelVM.SelPart.nShellNumberLayerId
'recupero tutte le entita' rib
If m_nShellNumberLayerId = GDB_ID.NULL Then
m_nShellNumberLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(m_nShellNumberLayerId, LAY_SHELL_NBR)
End If
'recupero tutte le entita' shell number
m_ShellNumberList.Clear()
Dim nShellNumberId As Integer = EgtGetFirstInGroup(m_nShellNumberLayerId)
While nShellNumberId <> GDB_ID.NULL
@@ -525,7 +554,8 @@ Public Class ShellNumberPanelVM
EgtDraw()
' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull()
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE, Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D, Controller.CMD.GRID_OBJ
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE,
Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D, Controller.CMD.GRID_OBJ
' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull()
End Select
@@ -1166,6 +1196,7 @@ Public Class ShellNumberPanelVM
Public Sub CPlaneObj(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
' salvo selezione precedente e deseleziono altri oggetti
m_PrevSelObjs.Clear()
Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
While nSelObjId <> GDB_ID.NULL
m_PrevSelObjs.Add(nSelObjId)
@@ -1173,7 +1204,7 @@ Public Class ShellNumberPanelVM
End While
EgtDeselectAll()
m_bCPlaneObj_IsActive = True
Map.refControllerInputPanelVM.PrepareInputBox("Grid from Selection", "Select the face of the object where to place the grid", "", False, False)
' Map.refControllerInputPanelVM.PrepareInputBox("Grid from Selection", "Select the face of the object where to place the grid", "", False, False)
End Sub
#End Region ' CPlaneObj
@@ -1308,7 +1339,7 @@ Public Class ShellNumberEntity
Sub New(Type As ShellNumberTypes, nId As Integer)
m_nIndex = nSharedIndex
m_Type = Type
EgtSetInfo(nId, KEY_RIB_TYPE, Type)
EgtSetInfo(nId, KEY_SHELLNBR_TYPE, Type)
Select Case Type
Case ShellNumberTypes.FROMDRAW
m_nCurveId = nId
+2 -2
View File
@@ -14,10 +14,10 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ghTime}"
Visibility="{Binding TimeMass_Visibility}"/>
Visibility="{Binding Time_Visibility}"/>
<TextBlock Grid.Row="1"
Text="{Binding ghMass}"
Visibility="{Binding TimeMass_Visibility}"
Visibility="{Binding Mass_Visibility}"
Margin="0,0,0,5"/>
<TextBlock Grid.Row="2"
Text="{Binding sLoadingText}"
+27 -6
View File
@@ -126,12 +126,18 @@ Public Class SliceManagerVM
End Get
End Property
Public ReadOnly Property TimeMass_Visibility As Visibility
Public ReadOnly Property Time_Visibility As Visibility
Get
Return If(m_dTime > 0, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property Mass_Visibility As Visibility
Get
Return If(m_dMass > 0, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Private m_Buttons_IsEnabled As Boolean = True
Public ReadOnly Property Buttons_IsEnabled As Boolean
Get
@@ -203,11 +209,11 @@ Public Class SliceManagerVM
End If
NotifyPropertyChanged(NameOf(ghTime))
NotifyPropertyChanged(NameOf(ghMass))
NotifyPropertyChanged(NameOf(TimeMass_Visibility))
NotifyPropertyChanged(NameOf(Time_Visibility))
NotifyPropertyChanged(NameOf(Mass_Visibility))
End Sub
Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
EgtOutLog(nProg)
' Se previsto, imposto progress
If nProg >= 0 Then
Dim dPartialProgress As Integer = 0
@@ -335,7 +341,11 @@ Public Class SliceManagerVM
m_bGenerate = bForceGenerate OrElse (bGenerate AndAlso bToRecalcGenerate)
End If
If m_bSlice OrElse m_bCalcTFS Then
EgtSetInfo(nPartId, MAC_TORECALC_GENERATE, True)
nPartId = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
EgtSetInfo(nPartId, MAC_TORECALC_GENERATE, True)
nPartId = EgtGetNextPart(nPartId)
End While
End If
' Aggiorno dati macchina
If m_bCalcTFS Then Map.refTFSEditorVM.UpdateSpeedMinMax()
@@ -496,6 +506,11 @@ Public Class SliceManagerVM
m_bCalculating = False
Return
End If
If IsNothing(Map.refTopPanelVM.SelMaterial) Then
MessageBox.Show("No print material set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False
Return
End If
If IsNothing(Map.refTopPanelVM.SelMachining) OrElse IsNothing(Map.refTopPanelVM.CurrMachining) OrElse Map.refTopPanelVM.CurrMachining.dCurrStrandH <= 0 Then
MessageBox.Show("No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False
@@ -507,7 +522,8 @@ Public Class SliceManagerVM
CalcSlice(False)
Map.refTopPanelVM.SelPage = Pages.SLICE
Map.refSliderManagerVM.SetLayerIndexToMax()
NotifyPropertyChanged(NameOf(TimeMass_Visibility))
NotifyPropertyChanged(NameOf(Time_Visibility))
NotifyPropertyChanged(NameOf(Mass_Visibility))
m_bCalculating = False
End Sub
@@ -535,6 +551,8 @@ Public Class SliceManagerVM
m_bCalculating = True
' eseguo calcoli
CalcSlice(False)
NotifyPropertyChanged(NameOf(Time_Visibility))
NotifyPropertyChanged(NameOf(Mass_Visibility))
m_bCalculating = False
End Sub
@@ -598,9 +616,10 @@ Public Class SliceManagerVM
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
If nTabPartId <> GDB_ID.NULL Then
EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath)
If String.IsNullOrWhiteSpace(sIsoFilePath) Then
If String.IsNullOrWhiteSpace(sIsoFilePath) OrElse Not Directory.Exists(Path.GetDirectoryName(sIsoFilePath)) Then
EgtGetCurrFilePath(sIsoFilePath)
sIsoFilePath = System.IO.Path.ChangeExtension(sIsoFilePath, sExtension)
EgtSetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath)
End If
End If
End If
@@ -615,6 +634,8 @@ Public Class SliceManagerVM
MessageBox.Show("Edit failed, missing part program file" & " (" & sIsoFilePath & ")")
End If
End If
NotifyPropertyChanged(NameOf(Time_Visibility))
NotifyPropertyChanged(NameOf(Mass_Visibility))
m_bCalculating = False
End Sub
+4 -4
View File
@@ -73,7 +73,7 @@ Public Class SliderManagerVM
Case ViewSliderType.ONLY_SELECTED
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 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_)
@@ -88,7 +88,7 @@ Public Class SliderManagerVM
Case ViewSliderType.UNTIL_SELECTED
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 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_)
@@ -103,7 +103,7 @@ Public Class SliderManagerVM
Case ViewSliderType.FROM_SELECTED
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 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_)
@@ -353,7 +353,7 @@ Public Class SliderManagerVM
NotifyPropertyChanged(NameOf(nLayerIndex_Minimum))
NotifyPropertyChanged(NameOf(nLayerIndex_Maximum))
NotifyPropertyChanged(NameOf(ghShowMaximum))
SetLayerIndex(m_nLayerIndex)
SetLayerIndex(If(m_nLayerIndex < nMax, m_nLayerIndex, nMax))
End Sub
Friend Sub SetLayerIndexToMax()
+41
View File
@@ -0,0 +1,41 @@
<Window x:Class="SplashScreen"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
Topmost="True"
ShowInTaskbar="False"
Height="600"
Width="1000">
<Grid>
<Image Source="/Resources/SplashScreen/GoldSplashscreen.png"
Stretch="UniformToFill"/>
<TextBlock Text="ICARUS"
Foreground="#b9984c"
FontSize="47"
FontFamily="/Resources/Fonts/#Roboto"
FontWeight="Light"
Margin="463,125,0,0"/>
<TextBlock x:Name="VersionTxBl"
FontSize="14"
FontFamily="/Resources/Fonts/#Roboto"
Margin="500,175,0,0"/>
<Grid Height="180"
Width="92"
VerticalAlignment="Bottom"
Margin="620,0,0,0">
<Image Source="/Resources/SplashScreen/LogoEgalware.png"
Height="180"
Width="92"
Stretch="UniformToFill"/>
<TextBlock Text="2022"
FontSize="12"
FontFamily="/Resources/Fonts/#Roboto"
HorizontalAlignment="Center"
Margin="0,140,0,0"/>
</Grid>
</Grid>
</Window>
+10
View File
@@ -0,0 +1,10 @@
Public Class SplashScreen
Private Sub SplashScreen_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
VersionTxBl.Text = "Version " & My.Application.Info.Version.Major.ToString() &
"." & My.Application.Info.Version.Minor.ToString() &
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
My.Application.Info.Version.Revision.ToString()
End Sub
End Class
@@ -189,6 +189,7 @@
Grid.Row="6"
Content="Grid"
IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Style="{StaticResource ToolBar_TextToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="5"
@@ -207,6 +208,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Command="{Binding CPlaneTop_Command}"
ToolTip="{Binding CPlaneTopToolTip}"
@@ -255,6 +257,12 @@
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneORIGIN.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="8"
Command="{Binding CPlaneObj_Command}"
ToolTip="{Binding CPlaneObjToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneOBJECT.png" Stretch="Uniform"/>
</Button>
</Grid>
</Border>
<!--<Popup IsOpen="{Binding IsChecked, ElementName=GridBtn}"
+95 -13
View File
@@ -36,7 +36,7 @@ Public Class StartMachPanelVM
End Get
Set(value As StartEntity)
m_SelStart = value
EgtDeselectLayerObjs(m_nStartMachLayerId)
EgtDeselectAll()
If Not IsNothing(value) Then
EgtSelectObj(value.nId)
' aggiorno visibilita' bottoni edit
@@ -66,7 +66,7 @@ Public Class StartMachPanelVM
Dim dNewXPos As Double = ptReference.x
StringToLen(value, dNewXPos)
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(m_SelStart.nId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference)
EgtMove(m_SelStart.nId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sXPos))
@@ -92,7 +92,7 @@ Public Class StartMachPanelVM
Dim dNewYPos As Double = ptReference.y
StringToLen(value, dNewYPos)
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference)
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sYPos))
@@ -118,7 +118,7 @@ Public Class StartMachPanelVM
Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference)
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sZPos))
@@ -129,12 +129,28 @@ Public Class StartMachPanelVM
End Property
Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean()
Public Property RotX As Boolean
Get
Return m_RotAxes
Return m_RotAxes(0)
End Get
Set(value As Boolean())
m_RotAxes = value
Set(value As Boolean)
m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set
End Property
@@ -144,7 +160,7 @@ Public Class StartMachPanelVM
Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then
Else
Return Vector3d.Z_AX
End If
End Get
@@ -164,16 +180,16 @@ Public Class StartMachPanelVM
End If
Dim b3PrintSolid As New BBox3d
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid)
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle) Then
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
EgtDraw()
RefreshPos()
m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else
m_sRotAngle = value
End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Set
End Property
@@ -243,6 +259,12 @@ Public Class StartMachPanelVM
End Set
End Property
Public ReadOnly Property bGrid_IsEnabled As Boolean
Get
Return Map.refMyStatusBarVM.bGridVisibility
End Get
End Property
Private m_bMove_IsChecked As Boolean
Public Property bMove_IsChecked As Boolean
Get
@@ -421,7 +443,18 @@ Public Class StartMachPanelVM
Friend Sub OnKeyDown(Key As Forms.Keys)
If Key = Forms.Keys.Escape Then
' se attiva, disattivo griglia su oggetto
If m_bCPlaneObj_IsActive Then
m_bCPlaneObj_IsActive = False
ResetCPlaneObjIsActive()
' ripristino selezioni precedenti
For Each Id In Map.refShellNumberPanelVM.PrevSelObjs
EgtSelectObj(Id)
Next
EgtDraw()
' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull()
End If
End If
End Sub
@@ -789,6 +822,55 @@ Public Class StartMachPanelVM
#End Region ' CPlaneOrigin
#Region "CPlaneObj"
Private m_bCPlaneObj_IsActive As Boolean = False
Friend ReadOnly Property bCPlaneObj_IsActive As Boolean
Get
Return m_bCPlaneObj_IsActive
End Get
End Property
Friend Sub ResetCPlaneObjIsActive()
m_bCPlaneObj_IsActive = False
End Sub
Private m_PrevSelObjs As New List(Of Integer)
Friend ReadOnly Property PrevSelObjs As List(Of Integer)
Get
Return m_PrevSelObjs
End Get
End Property
''' <summary>
''' Returns a command that do CPlanepObj.
''' </summary>
Public ReadOnly Property CPlaneObj_Command As ICommand
Get
If m_cmdCPlaneObj Is Nothing Then
m_cmdCPlaneObj = New Command(AddressOf CPlaneObj)
End If
Return m_cmdCPlaneObj
End Get
End Property
''' <summary>
''' Execute the CPlaneObj. This method is invoked by the CPlaneObjCommand.
''' </summary>
Public Sub CPlaneObj(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
' salvo selezione precedente e deseleziono altri oggetti
m_PrevSelObjs.Clear()
Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
While nSelObjId <> GDB_ID.NULL
m_PrevSelObjs.Add(nSelObjId)
nSelObjId = EgtGetNextSelectedObj()
End While
EgtDeselectAll()
m_bCPlaneObj_IsActive = True
' Map.refControllerInputPanelVM.PrepareInputBox("Grid from Selection", "Select the face of the object where to place the grid", "", False, False)
End Sub
#End Region ' CPlaneObj
#Region "DragMove"
Public ReadOnly Property DragMove_Command As ICommand
+29 -5
View File
@@ -17,15 +17,31 @@ Public Class MyStatusBarVM
End Get
End Property
'Public ReadOnly Property CurrMachine As String
' Get
' Return If(Not IsNothing(Map.refMachinePanelVM.SelectedMachine), Map.refMachinePanelVM.SelectedMachine.Name, "")
' End Get
'End Property
Private m_bGridVisibility As Boolean
Public Property bGridVisibility As Boolean
Get
Return m_bGridVisibility
End Get
Set(value As Boolean)
If Map.refRibPanelVM.bGrid_IsChecked Or Map.refStartMachPanelVM.bGrid_IsChecked Or Map.refShellNumberPanelVM.bGrid_IsChecked Then Return
m_bGridVisibility = value
EgtSetGridShow(value, value)
EgtDraw()
Map.refRibPanelVM.NotifyPropertyChanged(NameOf(Map.refRibPanelVM.bGrid_IsEnabled))
Map.refStartMachPanelVM.NotifyPropertyChanged(NameOf(Map.refStartMachPanelVM.bGrid_IsEnabled))
Map.refShellNumberPanelVM.NotifyPropertyChanged(NameOf(Map.refShellNumberPanelVM.bGrid_IsEnabled))
End Set
End Property
' Definizione comandi
Private m_cmdStopProgress As ICommand
Public ReadOnly Property GridVisibilityMsg As String
Get
Return "GRID"
End Get
End Property
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefMyStatusBarVM(Me)
@@ -33,6 +49,14 @@ Public Class MyStatusBarVM
EgtSetProcessEvents(m_ProcEventsCallback)
' Installo funzione output testo su status per lua
EgtSetOutText(m_OutTextCallback)
' imposto stato di visualizzazione della griglia
m_bGridVisibility = GetMainPrivateProfileInt(S_GRID, K_SHOWGRID, 1) <> 0
NotifyPropertyChanged(NameOf(bGridVisibility))
' modo di visualizzazione
Dim nShowMode As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
Map.refShowPanelVM.SetShowMode(DirectCast(nShowMode, SM))
' visualizzazione freccia direzione su curve
Map.refShowPanelVM.CurveDirIsChecked = EgtGetShowCurveDirection()
End Sub
Friend Overloads Sub SetSnapPointType(sSnapPntType As SP)
+13 -11
View File
@@ -16,6 +16,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
@@ -121,16 +122,24 @@
<TextBlock Text="{Binding OutputMessage}"
Foreground="{Binding OutputMessage_Foreground}"/>
</StatusBarItem>
<!--Indica il tipo di punto notevole selezionato-->
<!--Indica se la griglia è attiva o disattiva-->
<StatusBarItem Grid.Column="4">
<ToggleButton Content="{Binding GridVisibilityMsg}"
IsChecked="{Binding bGridVisibility}"
Width="80"/>
</StatusBarItem>
<!--Indica il tipo di punto notevole selezionato-->
<StatusBarItem Grid.Column="5">
<Button Content="{Binding SnapPointType}"
Background="{Binding SnapPointType_Background}"
IsHitTestVisible="False"
Width="80"/>
</StatusBarItem>
<!--Indica la posizione del mouse quando è sulla scena-->
<StatusBarItem Grid.Column="5">
<StatusBarItem Grid.Column="6">
<TextBlock Text="{Binding CurrPos}"
TextAlignment="Center"
Foreground="Black"
@@ -138,17 +147,10 @@
</StatusBarItem>
<!--Indica l'unità di misura-->
<StatusBarItem Grid.Column="6">
<StatusBarItem Grid.Column="7">
<TextBlock Text="{Binding MeasureUnit}"
Foreground="Black"
Width="35"/>
</StatusBarItem>
<!--Indica la macchina corrente--><!--
<StatusBarItem Grid.Column="7">
<TextBlock Text="{Binding CurrMachine}"
Foreground="Black"
Margin="0,0,5,0"/>
</StatusBarItem>-->
</StatusBar>
+36 -3
View File
@@ -17,7 +17,7 @@
<WrapPanel Orientation="Horizontal" x:Name="TFSEditorStackPanel">
<ComboBox ItemsSource="{Binding MediaTypeList}"
SelectedIndex="{Binding ghSelMediaType}"
Margin="0,0,10,0"
Margin="0,5,10,5"
Style="{StaticResource PartParam_ComboBox}"/>
<Grid>
<Grid.ColumnDefinitions>
@@ -31,11 +31,13 @@
</Grid.ColumnDefinitions>
<TextBlock Text="Slice Number:"
Visibility="{Binding MediaHeight_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource TSFEditor_TextBlock}"/>
<TextBox Grid.Column="1"
Text="{Binding sMediaHeight}"
Width="50"
Visibility="{Binding MediaHeight_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInputPanel_TextBox}"/>
</Grid>
<Grid>
@@ -45,11 +47,13 @@
</Grid.ColumnDefinitions>
<TextBlock Text="Difference:"
Visibility="{Binding Difference_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource TSFEditor_TextBlock}"/>
<TextBox Grid.Column="1"
Text="{Binding sDifference}"
Width="50"
Visibility="{Binding Difference_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInputPanel_TextBox}"/>
</Grid>
<Grid>
@@ -59,24 +63,46 @@
</Grid.ColumnDefinitions>
<TextBlock Text="F:"
Visibility="{Binding FCurr_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource TSFEditor_TextBlock}"/>
<TextBox Grid.Column="1"
Text="{Binding sFCurr}"
Width="50"
Visibility="{Binding FCurr_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInputPanel_TextBox}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Wait:"
Visibility="{Binding Wait_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource TSFEditor_TextBlock}"/>
<TextBox Grid.Column="1"
Text="{Binding sWait}"
Width="50"
Visibility="{Binding Wait_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInputPanel_TextBox}"/>
</Grid>
<StackPanel Grid.Column="1"
Orientation="Horizontal">
<Button Content="Set"
Command="{Binding Set_Command}"
Visibility="{Binding FCurr_Visibility}"
Visibility="{Binding Set_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Media"
Command="{Binding Media_Command}"
Visibility="{Binding Media_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Reset"
Command="{Binding Reset_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_TextButton}"/>
</StackPanel>
</Grid>
@@ -92,7 +118,7 @@
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5">
Margin="0,5,0,5">
<DataGrid.Columns>
<DataGridTextColumn Header="Index"
Binding="{Binding nIndex}"
@@ -126,6 +152,8 @@
Width="1*"/>
<DataGridTextColumn Header="TWait"
Binding="{Binding sTWait}"
Visibility="{Binding DataContext.ColWait_Visibility,
Source={x:Reference TFSEditorStackPanel}}"
Width="1*"/>
<DataGridTextColumn Header="FMin"
Binding="{Binding sFMin}"
@@ -166,10 +194,15 @@
<StackPanel Grid.Row="2" Orientation="Horizontal">
<ComboBox ItemsSource="{Binding FilterList}"
SelectedIndex="{Binding nSelFilter}"
Margin="0,0,2.5,0"
Style="{StaticResource PartParam_ComboBox}"/>
<Button Content="Extend"
Command="{Binding Extend_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_TextButton}"/>
<CheckBox Content="Wait"
IsChecked="{Binding bWaitingTime}"
VerticalAlignment="Center"/>
</StackPanel>
</Grid>
</Border>
+97 -6
View File
@@ -16,6 +16,7 @@ Public Class TFSEditorVM
HEIGHT = 1
SECTIONCHANGE = 2
SELECTION = 3
SELECTION_WAIT = 4
End Enum
Public Enum Filters As Integer
@@ -58,7 +59,7 @@ Public Class TFSEditorVM
End Set
End Property
Private m_MediaTypeList As New List(Of String)({"Slice Number", "Section change", "Selection"})
Private m_MediaTypeList As New List(Of String)({"Slice Number", "Section change", "Selection", "Selection Wait"})
Public ReadOnly Property MediaTypeList As List(Of String)
Get
Return m_MediaTypeList
@@ -77,14 +78,30 @@ Public Class TFSEditorVM
SetMediaHeightVisibility(True)
SetFCurrVisibility(False)
SetDifference_Visibility(False)
SetWaitVisibility(False)
SetSetVisibility(False)
SetMediaVisibility(True)
Case MediaTypes.SECTIONCHANGE
SetMediaHeightVisibility(False)
SetFCurrVisibility(False)
SetDifference_Visibility(True)
SetWaitVisibility(False)
SetSetVisibility(False)
SetMediaVisibility(True)
Case MediaTypes.SELECTION
SetMediaHeightVisibility(False)
SetFCurrVisibility(True)
SetDifference_Visibility(False)
SetWaitVisibility(False)
SetSetVisibility(True)
SetMediaVisibility(True)
Case MediaTypes.SELECTION_WAIT
SetMediaHeightVisibility(False)
SetFCurrVisibility(False)
SetDifference_Visibility(False)
SetWaitVisibility(True)
SetSetVisibility(True)
SetMediaVisibility(False)
End Select
End Set
End Property
@@ -167,6 +184,54 @@ Public Class TFSEditorVM
NotifyPropertyChanged(NameOf(FCurr_Visibility))
End Sub
Private m_dWait As Double
Public Property sWait As String
Get
Return LenToString(m_dWait, 2)
End Get
Set(value As String)
Dim nNewValue As Integer = 0
If StringToLen(value, nNewValue) Then
m_dWait = nNewValue
Else
NotifyPropertyChanged(NameOf(sWait))
End If
End Set
End Property
Private m_Wait_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Wait_Visibility As Visibility
Get
Return m_Wait_Visibility
End Get
End Property
Private Sub SetWaitVisibility(bValue As Boolean)
m_Wait_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Wait_Visibility))
End Sub
Private m_Media_Visibility As Visibility = Visibility.Visible
Public ReadOnly Property Media_Visibility As Visibility
Get
Return m_Media_Visibility
End Get
End Property
Private Sub SetMediaVisibility(bValue As Boolean)
m_Media_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Media_Visibility))
End Sub
Private m_Set_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Set_Visibility As Visibility
Get
Return m_Set_Visibility
End Get
End Property
Private Sub SetSetVisibility(bValue As Boolean)
m_Set_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Set_Visibility))
End Sub
Private m_FilterList As New List(Of String)({"", "Time Lower", "Time Ok", "Time Upper", "Speed Min", "Speed Max"})
Public ReadOnly Property FilterList As List(Of String)
Get
@@ -208,6 +273,28 @@ Public Class TFSEditorVM
NotifyPropertyChanged(NameOf(bTFSEditor_IsEnabled))
End Sub
Private m_bWaitingTime As Boolean = False
Public Property bWaitingTime As Boolean
Get
Return m_bWaitingTime
End Get
Set(value As Boolean)
m_bWaitingTime = value
Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
If m_bWaitingTime Then
EgtSetInfo(nLayTFSCalcId, KEY_EMITWAITINGTIME, True)
Else
EgtRemoveInfo(nLayTFSCalcId, KEY_EMITWAITINGTIME)
End If
NotifyPropertyChanged(NameOf(ColWait_Visibility))
End Set
End Property
Public ReadOnly Property ColWait_Visibility As Visibility
Get
Return If(m_bWaitingTime, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
' Definizione comandi
Private m_cmdSet As ICommand
Private m_cmdMedia As ICommand
@@ -332,12 +419,16 @@ Public Class TFSEditorVM
For Each Layer In m_SelLayers
Layer.SetFCurr(m_dFCurr)
Next
Case MediaTypes.SELECTION_WAIT
For Each Layer In m_SelLayers
Layer.SetTWait(m_dWait)
Next
End Select
' salvo selezione corrente
Dim SelIndexList As New List(Of Integer)
For Each SelLayer In m_SelLayers
SelIndexList.Add(SelLayer.nIndex)
Next
'' salvo selezione corrente
'Dim SelIndexList As New List(Of Integer)
'For Each SelLayer In m_SelLayers
' SelIndexList.Add(SelLayer.nIndex)
'Next
'' ricalcolo valori
'Map.refSliceManagerVM.CalcSlice(False, True)
'' ripristino layer selezionati
+3 -3
View File
@@ -36,7 +36,7 @@
Grid.Row="1"
ItemsSource="{Binding PartList}"
SelectedItem="{Binding SelPart}"
DisplayMemberPath="sImportedFileName"
DisplayMemberPath="sName"
FontSize="14"
FontFamily="/Resources/Fonts/#Roboto"
FontWeight="Light"
@@ -148,8 +148,8 @@
Style="{StaticResource PrintParam_ToggleButton}">
<Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
+52 -8
View File
@@ -205,8 +205,9 @@ Public Class TopPanelVM
Set(value As MaterialIndex)
' salvo materiale selezionato come ultimo utilizzato
If Not IsNothing(value) Then WriteMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, value.sGUID)
' salvo lavorazione selezionata per riselezionarlo
Dim PrevMachiningGuid As Guid = m_SelMachining.sGUID
' salvo lavorazione selezionata per riselezionarla
Dim PrevMachiningGuid As Guid = Guid.Empty
If Not IsNothing(m_SelMachining) Then PrevMachiningGuid = m_SelMachining.sGUID
' seleziono materiale
m_SelMaterial = value
' scrivo materiale sulla tavola
@@ -223,9 +224,18 @@ Public Class TopPanelVM
SetSelMachining(If(Not IsNothing(PrevMachining), PrevMachining, MachiningIndex.Empty()))
End Set
End Property
Friend Sub SetSelMaterial(value As MaterialIndex)
Friend Sub SetSelMaterial(value As MaterialIndex, Optional bUpdateMaterialList As Boolean = False)
m_SelMaterial = value
NotifyPropertyChanged(NameOf(SelMaterial))
If bUpdateMaterialList Then
' salvo lavorazione selezionata per riselezionarla
Dim PrevMachiningGuid As Guid = Guid.Empty
If Not IsNothing(m_SelMachining) Then PrevMachiningGuid = m_SelMachining.sGUID
' ricarico lista lavorazioni valide per il materiale selezionato
InitMachiningsList()
Dim PrevMachining As MachiningIndex = m_MachiningList.FirstOrDefault(Function(x) x.sGUID = PrevMachiningGuid)
SetSelMachining(If(Not IsNothing(PrevMachining), PrevMachining, MachiningIndex.Empty()))
End If
End Sub
#End Region ' Material
@@ -267,7 +277,7 @@ Public Class TopPanelVM
m_MachiningList.Remove(MachiningIndex.Empty())
End If
' se nuova lavorazione e' none
If SelMachining.sGUID = Guid.Empty AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then
If Not IsNothing(m_SelMachining) AndAlso SelMachining.sGUID = Guid.Empty AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then
' aggiungo lavorazione vuota
MachiningList.Insert(0, MachiningIndex.Empty())
End If
@@ -393,11 +403,25 @@ Public Class TopPanelVM
#Region "Pages"
Private Sub InitIMPORT()
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
Map.refSliceManagerVM.SetButtonsIsEnabled(False)
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
' imposto pagina
Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.IMPORT)
Map.refImportPanelVM.Init()
''Map.refImportPanelVM.Init()
Map.refManagePartPanelVM.Init(ManagePartPanelVM.ManagePartType.IMPORT)
End Sub
Private Function ExitIMPORT()
' riabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
Map.refProjManagerVM.SetProjCmdIsEnabled(True)
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
Map.refSliceManagerVM.SetButtonsIsEnabled(True)
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
Return True
End Function
@@ -509,11 +533,31 @@ Public Class TopPanelVM
End Function
Private Sub InitMODIFYPART()
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
Map.refSliceManagerVM.SetButtonsIsEnabled(False)
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
' tolgo mark da pezzo selezionato
If Not IsNothing(SelPart) Then
EgtResetMark(SelPart.nPrintSolidId)
End If
' imposto pagina
Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.MODIFYPART)
End Sub
Private Function ExitMODIFYPART()
' riabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
Map.refProjManagerVM.SetProjCmdIsEnabled(True)
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
Map.refSliceManagerVM.SetButtonsIsEnabled(True)
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
' ripristino mark su pezzo selezionato
If Not IsNothing(SelPart) Then
EgtSetMark(SelPart.nPrintSolidId)
End If
Return True
End Function
@@ -529,8 +573,8 @@ Public Class TopPanelVM
' rinomino pezzo e layer
Dim nPartId As Integer = EgtGetLastPart()
EgtSetName(nPartId, PART)
Dim nLayerId As Integer = EgtGetFirstInGroup(nPartId)
EgtSetName(nLayerId, ORIGINAL_SOLID)
'Dim nLayerId As Integer = EgtGetFirstInGroup(nPartId)
'EgtSetName(nLayerId, ORIGINAL_SOLID)
'' Recupero o creo layer ausiliario
'Dim nAuxId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX)
+21 -17
View File
@@ -42,6 +42,9 @@ Public Module CurrentMachine
Return m_sMachiningFilePath
End Get
End Property
Friend Sub SetMachiningFilePath(sValue As String)
m_sMachiningFilePath = sValue
End Sub
' Cartella dei materiali
Private m_sMaterialsFilePath As String = String.Empty
Friend ReadOnly Property sMaterialsFilePath As String
@@ -79,7 +82,8 @@ Public Module CurrentMachine
Dim nQqqId = EgtAddMachGroup("qqq")
EgtSetTable("Tab")
EgtGetTableArea(1, m_b3Tab)
EgtRemoveMachGroup(nQqqId Or GDB_ID.NULL)
EgtResetCurrMachGroup()
EgtRemoveMachGroup(nQqqId)
' carico materiali e lavorazioni
Map.refTopPanelVM.InitMaterialList()
Map.refMaterialDbVM.Init()
@@ -125,8 +129,8 @@ Public Module CurrentMachine
DisableMgr.ReEnable()
End Sub
Friend Function ReadMachiningParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String) As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, m_sMachiningFilePath)
Friend Function ReadMachiningParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, Optional sFilePath As String = "") As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
If Not String.IsNullOrWhiteSpace(lpString) Then
lpString = EgwCrypto.PowerDecryptString(lpString, m_Salt)
Else
@@ -135,8 +139,8 @@ Public Module CurrentMachine
Return nResult
End Function
Friend Function ReadMachiningParamSplit(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String) As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, m_sMachiningFilePath)
Friend Function ReadMachiningParamSplit(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, Optional sFilePath As String = "") As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
If Not String.IsNullOrWhiteSpace(lpString) Then
Dim Values() As String = lpString.Split(";"c)
Dim sCryptoValues As String = ""
@@ -150,33 +154,33 @@ Public Module CurrentMachine
Return nResult
End Function
Friend Function ReadMachiningParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double) As Double
Friend Function ReadMachiningParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double, Optional sFilePath As String = "") As Double
Dim sParam As String = ""
Dim dParam As Double = dDefault
ReadMachiningParamString(lpAppName, lpKeyName, dDefault, sParam)
ReadMachiningParamString(lpAppName, lpKeyName, dDefault, sParam, sFilePath)
StringToDouble(sParam, dParam)
Return dParam
End Function
Friend Function WriteMachiningParam(lpAppName As String, lpKeyName As String, lpString As String) As Boolean
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), m_sMachiningFilePath)
Friend Function WriteMachiningParam(lpAppName As String, lpKeyName As String, lpString As String, Optional sFilePath As String = "") As Boolean
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
End Function
Friend Function WriteMachiningParamSplit(lpAppName As String, lpKeyName As String, lpString As String) As Boolean
Friend Function WriteMachiningParamSplit(lpAppName As String, lpKeyName As String, lpString As String, Optional sFilePath As String = "") As Boolean
If Not String.IsNullOrWhiteSpace(lpString) Then
Dim Values() As String = lpString.Split(";"c)
Dim sCryptoValues As String = ""
For ValueIndex = 0 To Values.Count - 1
sCryptoValues += EgwCrypto.PowerEncryptString(Values(ValueIndex), m_Salt) & If(ValueIndex < Values.Count - 1, ";", "")
Next
Return WritePrivateProfileString(lpAppName, lpKeyName, sCryptoValues, m_sMachiningFilePath)
Return WritePrivateProfileString(lpAppName, lpKeyName, sCryptoValues, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
Else
Return False
End If
End Function
Friend Function ReadMaterialParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String) As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpString, m_sMaterialsFilePath)
Friend Function ReadMaterialParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, Optional sFilePath As String = "") As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMaterialsFilePath))
If Not String.IsNullOrWhiteSpace(lpString) Then
lpString = EgwCrypto.PowerDecryptString(lpString, m_Salt)
Else
@@ -185,16 +189,16 @@ Public Module CurrentMachine
Return nResult
End Function
Friend Function ReadMaterialParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double) As Double
Friend Function ReadMaterialParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double, Optional sFilePath As String = "") As Double
Dim sParam As String = ""
Dim dParam As Double = dDefault
ReadMaterialParamString(lpAppName, lpKeyName, dDefault, sParam)
ReadMaterialParamString(lpAppName, lpKeyName, dDefault, sParam, sFilePath)
StringToDouble(sParam, dParam)
Return dParam
End Function
Friend Function WriteMaterialParam(lpAppName As String, lpKeyName As String, lpString As String) As Boolean
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), m_sMaterialsFilePath)
Friend Function WriteMaterialParam(lpAppName As String, lpKeyName As String, lpString As String, Optional sFilePath As String = "") As Boolean
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMaterialsFilePath))
End Function
#End Region 'Methods
+3 -2
View File
@@ -29,7 +29,7 @@
<PrintApp:DispositionPanelVM x:Key="DispositionPanelVM"/>
<PrintApp:StartMachPanelVM x:Key="StartMachPanelVM"/>
<PrintApp:RibPanelVM x:Key="RibPanelVM"/>
<PrintApp:ImportPanelVM x:Key="ImportPanelVM"/>
<!--<PrintApp:ImportPanelVM x:Key="ImportPanelVM"/>-->
<PrintApp:TopPanelVM x:Key="TopPanelVM"/>
<PrintApp:ControllerInputPanelVM x:Key="ControllerInputPanelVM"/>
<PrintApp:SliceManagerVM x:Key="SliceManagerVM"/>
@@ -44,7 +44,8 @@
<PrintApp:SimulationPanelVM x:Key="SimulationPanelVM"/>
<PrintApp:ReferencePanelVM x:Key="ReferencePanelVM"/>
<PrintApp:ViewLayerManagerVM x:Key="ViewLayerManagerVM"/>
<PrintApp:ModifyPartPanelVM x:Key="ModifyPartPanelVM"/>
<!--<PrintApp:ModifyPartPanelVM x:Key="ModifyPartPanelVM"/>-->
<PrintApp:ManagePartPanelVM x:Key="ManagePartPanelVM"/>
<!--<EgtBEAMWALL:CALCPanelVM x:Key="CALCPanelVM"/>
<EgtBEAMWALL:PartParametersVM x:Key="PartParametersVM"/>
<EgtBEAMWALL:LeftPanelVM x:Key="LeftPanelVM"/>
+184 -7
View File
@@ -1,57 +1,234 @@
Imports EgtUILib
Imports EgtWPFLib5
Module GeomEntityColors
Public Enum LayerType As Integer
PRINTPART = 1
RIBS = 2
SHELLNUMBERS = 3
AUXSOLIDS = 4
MACHSTART = 5
OTHERS = 6
ALL = 10
End Enum
Private m_c3Print As Color3d
Public ReadOnly Property c3Print As Color3d
Get
Return m_c3Print
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_PRINTPART, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.Aqua)
End If
Return c3Temp
End Get
End Property
Private m_c3MachStart As Color3d
Public ReadOnly Property c3MachStart As Color3d
Get
Return m_c3MachStart
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_MACHSTART, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.Red)
End If
Return c3Temp
End Get
End Property
Private m_c3Rib As Color3d
Public ReadOnly Property c3Rib As Color3d
Get
Return m_c3Rib
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_RIBS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.MediumOrchid)
End If
Return c3Temp
End Get
End Property
Private m_c3ShellNumber As Color3d
Public ReadOnly Property c3ShellNumber As Color3d
Get
Return m_c3ShellNumber
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_SHELLNUMBERS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.Lime)
End If
Return c3Temp
End Get
End Property
Private m_c3AuxSolids As Color3d
Public ReadOnly Property c3AuxSolids As Color3d
Get
Return m_c3AuxSolids
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_AUXSOLIDS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.DarkGoldenrod)
End If
Return c3Temp
End Get
End Property
Private m_c3Others As Color3d
Public ReadOnly Property c3Others As Color3d
Get
Return m_c3Others
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_OTHERS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.LightGray)
End If
Return c3Temp
End Get
End Property
Sub New()
' imposto colori superfici
m_c3Print.FromColor(System.Drawing.Color.Yellow)
m_c3Print.FromColor(System.Drawing.Color.Aqua)
GetMainPrivateProfileColor(S_COLORS, K_CLR_PRINTPART, m_c3Print)
m_c3MachStart.FromColor(System.Drawing.Color.Red)
GetMainPrivateProfileColor(S_COLORS, K_CLR_MACHSTART, m_c3MachStart)
m_c3Rib.FromColor(System.Drawing.Color.MediumOrchid)
GetMainPrivateProfileColor(S_COLORS, K_CLR_RIBS, m_c3Rib)
m_c3ShellNumber.FromColor(System.Drawing.Color.Lime)
GetMainPrivateProfileColor(S_COLORS, K_CLR_SHELLNUMBERS, m_c3ShellNumber)
m_c3AuxSolids.FromColor(System.Drawing.Color.DarkGoldenrod)
GetMainPrivateProfileColor(S_COLORS, K_CLR_AUXSOLIDS, m_c3AuxSolids)
m_c3Others.FromColor(System.Drawing.Color.LightGray)
GetMainPrivateProfileColor(S_COLORS, K_CLR_OTHERS, m_c3Others)
End Sub
Friend Sub SetColor(Type As LayerType, c3Color As Color3d)
Dim c3Temp As Color3d
Dim sIniKey As String
Select Case Type
Case LayerType.PRINTPART
c3Temp = c3Print
sIniKey = K_CLR_PRINTPART
Case LayerType.RIBS
c3Temp = c3Rib
sIniKey = K_CLR_RIBS
Case LayerType.SHELLNUMBERS
c3Temp = c3ShellNumber
sIniKey = K_CLR_SHELLNUMBERS
Case LayerType.AUXSOLIDS
c3Temp = c3AuxSolids
sIniKey = K_CLR_AUXSOLIDS
Case LayerType.MACHSTART
c3Temp = c3MachStart
sIniKey = K_CLR_MACHSTART
Case LayerType.OTHERS
c3Temp = c3Others
sIniKey = K_CLR_OTHERS
End Select
c3Temp.R = c3Color.R
c3Temp.G = c3Color.G
c3Temp.B = c3Color.B
WritePrivateProfileColor(S_COLORS, sIniKey, c3Temp)
UpdateColors(Type)
End Sub
Friend Sub SetAlpha(Type As LayerType, dAlpha As Double)
Dim c3Temp As Color3d = c3Print
Dim sIniKey As String
Select Case Type
Case LayerType.PRINTPART
c3Temp = c3Print
sIniKey = K_CLR_PRINTPART
Case LayerType.RIBS
c3Temp = c3Rib
sIniKey = K_CLR_RIBS
Case LayerType.SHELLNUMBERS
c3Temp = c3ShellNumber
sIniKey = K_CLR_SHELLNUMBERS
Case LayerType.AUXSOLIDS
c3Temp = c3AuxSolids
sIniKey = K_CLR_AUXSOLIDS
Case LayerType.MACHSTART
c3Temp = c3MachStart
sIniKey = K_CLR_MACHSTART
Case LayerType.OTHERS
c3Temp = c3Others
sIniKey = K_CLR_OTHERS
End Select
c3Temp.A = dAlpha
WritePrivateProfileColor(S_COLORS, sIniKey, c3Temp)
UpdateColors(Type)
End Sub
Public Function WritePrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Color As Color3d) As Boolean
Dim sColor As String = Color.R & "," & Color.G & "," & Color.B & "," & Color.A
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
End Function
Sub UpdateColors(Type As LayerType)
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
Dim nIsOnTable As Integer = 0
If Not EgtGetInfo(nPartId, "PartOnTable", nIsOnTable) OrElse nIsOnTable <> 1 Then
nPartId = EgtGetNextPart(nPartId)
Continue While
End If
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
' rimuovo eventuali colori da entita' e li assegno ai layer
If Type = LayerType.PRINTPART OrElse Type = LayerType.ALL Then
Dim nPrintPartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, PRINT_SOLID)
Dim nPrintPartEntityId = EgtGetFirstInGroup(nPrintPartLayerId)
While nPrintPartEntityId <> GDB_ID.NULL
EgtResetColor(nPrintPartEntityId)
nPrintPartEntityId = EgtGetNext(nPrintPartEntityId)
End While
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
End If
If Type = LayerType.RIBS OrElse Type = LayerType.ALL Then
Dim nRibsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_RIBS)
Dim nRibsEntityId = EgtGetFirstInGroup(nRibsLayerId)
While nRibsEntityId <> GDB_ID.NULL
EgtResetColor(nRibsEntityId)
nRibsEntityId = EgtGetNext(nRibsEntityId)
End While
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
End If
If Type = LayerType.SHELLNUMBERS OrElse Type = LayerType.ALL Then
Dim nShellNumberLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_SHELL_NBR)
Dim nShellNumberEntityId = EgtGetFirstInGroup(nShellNumberLayerId)
While nShellNumberEntityId <> GDB_ID.NULL
EgtResetColor(nShellNumberEntityId)
nShellNumberEntityId = EgtGetNext(nShellNumberEntityId)
End While
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
End If
If Type = LayerType.AUXSOLIDS OrElse Type = LayerType.ALL Then
Dim nAuxSolidsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX_SOLIDS)
Dim nAuxSolidsEntityId = EgtGetFirstInGroup(nAuxSolidsLayerId)
While nAuxSolidsEntityId <> GDB_ID.NULL
EgtResetColor(nAuxSolidsEntityId)
nAuxSolidsEntityId = EgtGetNext(nAuxSolidsEntityId)
End While
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
End If
If Type = LayerType.MACHSTART OrElse Type = LayerType.ALL Then
Dim nMachStartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_MACH_START)
Dim nMachStartEntityId = EgtGetFirstInGroup(nMachStartLayerId)
While nMachStartEntityId <> GDB_ID.NULL
EgtResetColor(nMachStartEntityId)
nMachStartEntityId = EgtGetNext(nMachStartEntityId)
End While
EgtSetColor(nMachStartLayerId, GeomEntityColors.c3MachStart)
End If
If Type = LayerType.OTHERS OrElse Type = LayerType.ALL Then
Dim nOthersLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_OTHERS)
Dim nOthersEntityId = EgtGetFirstInGroup(nOthersLayerId)
While nOthersEntityId <> GDB_ID.NULL
EgtResetColor(nOthersEntityId)
nOthersEntityId = EgtGetNext(nOthersEntityId)
End While
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
End If
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
nPartId = EgtGetNextPart(nPartId)
End While
EgtDraw()
End Sub
End Module
+3 -2
View File
@@ -25,7 +25,7 @@ Module LuaExec
Dim SelMaterialParam As Material = Map.refTopPanelVM.GetSelMaterialData()
Dim dMachiningConstant As Double = 100
If Not IsNothing(Map.refTopPanelVM.CurrMachining) Then
Dim MachiningConstant As CurrNumericMachiningParam = Map.refTopPanelVM.CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.CONSTANT)
Dim MachiningConstant As CurrNumericMachiningParam = Map.refTopPanelVM.CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.FLOWRATE_PC)
If Not IsNothing(MachiningConstant) Then
dMachiningConstant = MachiningConstant.dValue
End If
@@ -69,7 +69,8 @@ Module LuaExec
Dim sIsoFilePath As String = ""
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
If nTabPartId <> GDB_ID.NULL Then
If Not EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath) Then
If Not EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath) OrElse
Not IO.Directory.Exists( IO.Path.GetDirectoryName(sIsoFilePath)) Then
EgtGetCurrFilePath(sIsoFilePath)
Dim sExtension As String = ""
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "", sExtension, CurrentMachine.sMachIniFile)
+45 -21
View File
@@ -47,7 +47,7 @@ Module Map
'Private m_refSplitModeVM As SplitModeVM
'Private m_refMoveRawModeVM As MoveRawModeVM
'Private m_refSimulTabVM As SimulTabVM
Private m_refImportPanelVM As ImportPanelVM
''Private m_refImportPanelVM As ImportPanelVM
Private m_refSliceManagerVM As SliceManagerVM
Private m_refTFSEditorVM As TFSEditorVM
Private m_refCurrMachiningPanelVM As CurrMachiningPanelVM
@@ -60,7 +60,9 @@ Module Map
Private m_refViewLayerManagerVM As ViewLayerManagerVM
Private m_refShellNumberPanelVM As ShellNumberPanelVM
Private m_refShellNumberParamPanelVM As ShellNumberParamPanelVM
Private m_refModifyPartPanelVM As ModifyPartPanelVM
Private m_refSplashScreen As SplashScreen
''Private m_refModifyPartPanelVM As ModifyPartPanelVM
Private m_refManagePartPanelVM As ManagePartPanelVM
#Region "Get"
@@ -105,11 +107,11 @@ Module Map
End Get
End Property
'Public ReadOnly Property refShowPanelVM As ShowPanelVM
' Get
' Return LibMap.refShowPanelVM
' End Get
'End Property
Public ReadOnly Property refShowPanelVM As ShowPanelVM
Get
Return LibMap.refShowPanelVM
End Get
End Property
'Public ReadOnly Property refMainMenuVM As MainMenuVM
' Get
@@ -345,11 +347,11 @@ Module Map
' End Get
'End Property
Public ReadOnly Property refImportPanelVM As ImportPanelVM
Get
Return m_refImportPanelVM
End Get
End Property
'Public ReadOnly Property refImportPanelVM As ImportPanelVM
' Get
' Return m_refImportPanelVM
' End Get
'End Property
Public ReadOnly Property refSliceManagerVM As SliceManagerVM
Get
@@ -423,9 +425,21 @@ Module Map
End Get
End Property
Public ReadOnly Property refModifyPartPanelVM As ModifyPartPanelVM
Public ReadOnly Property refSplashScreen As SplashScreen
Get
Return m_refModifyPartPanelVM
Return m_refSplashScreen
End Get
End Property
''Public ReadOnly Property refModifyPartPanelVM As ModifyPartPanelVM
'' Get
'' Return m_refModifyPartPanelVM
'' End Get
''End Property
Public ReadOnly Property refManagePartPanelVM As ManagePartPanelVM
Get
Return m_refManagePartPanelVM
End Get
End Property
@@ -667,10 +681,10 @@ Module Map
' Return Not IsNothing(m_refSimulTabVM)
'End Function
Friend Function SetRefImportPanelVM(ImportPanelVM As ImportPanelVM) As Boolean
m_refImportPanelVM = ImportPanelVM
Return Not IsNothing(m_refImportPanelVM)
End Function
''Friend Function SetRefImportPanelVM(ImportPanelVM As ImportPanelVM) As Boolean
'' m_refImportPanelVM = ImportPanelVM
'' Return Not IsNothing(m_refImportPanelVM)
''End Function
Friend Function SetRefSliceManagerVM(SliceManagerVM As SliceManagerVM) As Boolean
m_refSliceManagerVM = SliceManagerVM
@@ -732,9 +746,19 @@ Module Map
Return Not IsNothing(m_refShellNumberParamPanelVM)
End Function
Friend Function SetRefModifyPartPanelVM(ModifyPartPanelVM As ModifyPartPanelVM) As Boolean
m_refModifyPartPanelVM = ModifyPartPanelVM
Return Not IsNothing(m_refModifyPartPanelVM)
Friend Function SetRefSplashScreen(SplashScreen As SplashScreen) As Boolean
m_refSplashScreen = SplashScreen
Return Not IsNothing(m_refSplashScreen)
End Function
''Friend Function SetRefModifyPartPanelVM(ModifyPartPanelVM As ModifyPartPanelVM) As Boolean
'' m_refModifyPartPanelVM = ModifyPartPanelVM
'' Return Not IsNothing(m_refModifyPartPanelVM)
''End Function
Friend Function SetRefManagePartPanelVM(ManagePartPanelVM As ManagePartPanelVM) As Boolean
m_refManagePartPanelVM = ManagePartPanelVM
Return Not IsNothing(m_refManagePartPanelVM)
End Function
#End Region ' Set
+45 -1
View File
@@ -44,7 +44,23 @@ Public Class ViewLayerManagerVM
New ViewLayer(ViewLayer.ViewLayerType.SHELL_NUMBER, "Reduce Shell Number", True),
New ViewLayer(ViewLayer.ViewLayerType.AUX_SOLIDS, "Filled Solids", True),
New ViewLayer(ViewLayer.ViewLayerType.SOLID_SLICE, "Solid Slice", True),
New ViewLayer(ViewLayer.ViewLayerType.SLICE_TOOLPATH, "Slice Toolpath", True)})
New ViewLayer(ViewLayer.ViewLayerType.SLICE_TOOLPATH, "Slice Toolpath", True),
New ViewLayer(ViewLayer.ViewLayerType.OTHERS, "Others", True)})
End Sub
Friend Sub ResetSolid()
Dim ViewLayerSolid As ViewLayer = m_LayerList.FirstOrDefault(Function(x) x.Type = ViewLayer.ViewLayerType.SOLID_SLICE)
If Not IsNothing(ViewLayerSolid) Then
ViewLayerSolid.bIsVisible = False
If Map.refTopPanelVM.SelPage = Pages.MODIFY Then
WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, "0")
ElseIf Map.refTopPanelVM.SelPage = Pages.SLICE Then
WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SOLIDSLICE, "0")
ElseIf Map.refTopPanelVM.SelPage = Pages.NULL Then
WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SOLIDSLICE, "0")
WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, "0")
End If
End If
End Sub
Friend Sub UpdateIsVisibleFromIni()
@@ -81,6 +97,7 @@ Public Class ViewLayer
AUX_SOLIDS = 6
SOLID_SLICE = 7
SLICE_TOOLPATH = 8
OTHERS = 9
End Enum
Private m_Type As ViewLayerType
@@ -208,8 +225,27 @@ Public Class ViewLayer
EgtSetStatus(Entity, Status)
Next
Next
Case ViewLayerType.OTHERS
EgtSetStatus(CurrPart.nOthersLayerId, Status)
End Select
Next
'' se sono in importazione, dis/attivo anche queste superfici
'If Map.refTopPanelVM.SelPage = Pages.IMPORT Then
' For Each CurrPart In Map.refManagePartPanelVM.ManagerPartList
' For Each Layer In CurrPart.LayerList
' If (Layer.Type = ManagePart_Layer.LayerType.PRINT_SOLID AndAlso m_Type = ViewLayerType.PRINT_SOLID) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.MACH_START AndAlso m_Type = ViewLayerType.START_MACHINING) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.RIBS AndAlso m_Type = ViewLayerType.RIBS) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.SHELL_NUMBER AndAlso m_Type = ViewLayerType.SHELL_NUMBER) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.AUX_SOLIDS AndAlso m_Type = ViewLayerType.AUX_SOLIDS) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.OTHERS AndAlso m_Type = ViewLayerType.OTHERS) Then
' For Each Entity In Layer.EntityList
' EgtSetStatus(Entity.nId, Status)
' Next
' End If
' Next
' Next
'End If
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
End Sub
@@ -258,6 +294,8 @@ Public Class ViewLayer
nStatus = If(bSolid, GetMainPrivateProfileInt(S_VIEWLAYER, K_MOD_SOLIDSLICE, 1), 0)
Case ViewLayerType.SLICE_TOOLPATH
nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_MOD_SLICETOOLPATH, 1)
Case ViewLayerType.OTHERS
nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_MOD_OTHERS, 1)
End Select
Case Pages.SLICE
Select Case m_Type
@@ -277,6 +315,8 @@ Public Class ViewLayer
nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_SLC_SOLIDSLICE, 1)
Case ViewLayerType.SLICE_TOOLPATH
nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_SLC_SLICETOOLPATH, 1)
Case ViewLayerType.OTHERS
nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_SLC_OTHERS, 1)
End Select
End Select
m_IsVisible = nStatus
@@ -305,6 +345,8 @@ Public Class ViewLayer
WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SOLIDSLICE, nStatus)
Case ViewLayerType.SLICE_TOOLPATH
WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SLICETOOLPATH, nStatus)
Case ViewLayerType.OTHERS
WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_OTHERS, nStatus)
End Select
Case Pages.SLICE
Select Case m_Type
@@ -324,6 +366,8 @@ Public Class ViewLayer
WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, nStatus)
Case ViewLayerType.SLICE_TOOLPATH
WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SLICETOOLPATH, nStatus)
Case ViewLayerType.OTHERS
WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_OTHERS, nStatus)
End Select
End Select
End Sub
+20 -13
View File
@@ -1,7 +1,9 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Public Class Print3dPartVM
Inherits VMBase
Private m_nPartId As Integer
Public ReadOnly Property nPartId As Integer
@@ -17,18 +19,9 @@ Public Class Print3dPartVM
Return m_nPrintSolidLayerId
End Get
End Property
Private m_nPrintSolidId As Integer = GDB_ID.NULL
Public ReadOnly Property nPrintSolidId As Integer
Get
Return m_nPrintSolidId
End Get
End Property
' solido/superficie originale
Private m_nOriginalPartLayerId As Integer = GDB_ID.NULL
Public ReadOnly Property nOriginalPartLayerId As Integer
Get
Return m_nOriginalPartLayerId
Return EgtGetFirstInGroup(m_nPrintSolidLayerId)
End Get
End Property
@@ -87,6 +80,13 @@ Public Class Print3dPartVM
End Get
End Property
Private m_sName As String
Public ReadOnly Property sName As String
Get
Return m_sName
End Get
End Property
Public ReadOnly Property sImportedFileName As String
Get
Return If(Not String.IsNullOrWhiteSpace(m_sImportedFilePath), IO.Path.GetFileName(m_sImportedFilePath), "")
@@ -118,15 +118,14 @@ Public Class Print3dPartVM
Sub New(nPartId As Integer, sImportedFilePath As String)
m_nPartId = nPartId
m_sName = IO.Path.GetFileName(sImportedFilePath)
m_sImportedFilePath = sImportedFilePath
End Sub
Sub New(nPartId As Integer, nPrintSolidLayerId As Integer, nPrintSolidId As Integer, nOriginalPartLayerId As Integer, nReferenceLayerId As Integer, nReferenceId As Integer, nMachStartLayerId As Integer,
Sub New(nPartId As Integer, nPrintSolidLayerId As Integer, nReferenceLayerId As Integer, nReferenceId As Integer, nMachStartLayerId As Integer,
nRibsLayerId As Integer, nShellNumberLayerId As Integer, nAuxSolidsLayerId As Integer, nOthersLayerId As Integer, sImportedFilePath As String)
m_nPartId = nPartId
m_nPrintSolidLayerId = nPrintSolidLayerId
m_nPrintSolidId = nPrintSolidId
m_nOriginalPartLayerId = nOriginalPartLayerId
m_nReferenceLayerId = nReferenceLayerId
m_nReferenceId = nReferenceId
m_nMachStartLayerId = nMachStartLayerId
@@ -134,6 +133,9 @@ Public Class Print3dPartVM
m_nRibsLayerId = nRibsLayerId
m_nShellNumberLayerId = nShellNumberLayerId
m_nOthersLayerId = nOthersLayerId
If Not EgtGetInfo(nPartId, PART_NAME, m_sName) Then
m_sName = IO.Path.GetFileName(sImportedFilePath)
End If
m_sImportedFilePath = sImportedFilePath
RefreshPrintLayers()
End Sub
@@ -159,6 +161,11 @@ Public Class Print3dPartVM
m_nReferenceId = nNewReferenceId
End Sub
Friend Sub UpdateName(Name As String)
m_sName = Name
NotifyPropertyChanged(NameOf(sName))
End Sub
#End Region ' METHODS
End Class