Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 50d301e8cc | |||
| bfbb85feee | |||
| 9783731396 | |||
| 9ff14634dd | |||
| 42970892ba | |||
| 2bb8cfc4a1 | |||
| 902f610703 | |||
| cb6b2721fc | |||
| d7aa5f1739 | |||
| e67f863235 | |||
| 5f6660d642 | |||
| 437e698d10 | |||
| 9a187ac36b | |||
| 2c04b2e5cc | |||
| a6c10569e0 | |||
| f60be49005 | |||
| b8b42114b6 | |||
| 69b2734987 | |||
| a52a8dfe36 | |||
| b73a4ba6c0 | |||
| c9b9646bbb | |||
| c6732698e8 | |||
| 89ab41da44 | |||
| 2b5bb35e21 | |||
| 68ee954dd3 | |||
| a47a5ed09a | |||
| b272f1f2bb | |||
| 5aba0cf14f | |||
| a1c3a9fb30 | |||
| 90adb8b200 | |||
| 1e61027dbd | |||
| 4d26959075 | |||
| d41f20d95e | |||
| 799c0530be | |||
| 6cea8cbcf8 | |||
| 85827e5d29 | |||
| 042d308648 | |||
| c13122198e | |||
| 96432122a2 | |||
| 8201c93a8e | |||
| 1d7e26f18d | |||
| 6e55664281 | |||
| b348229691 | |||
| 82fd57d838 | |||
| 708ffc576d | |||
| bd6327586e | |||
| 8d20b2f190 | |||
| ff5ce8be86 | |||
| 83568d12a3 | |||
| ce7cd01012 | |||
| 054d21c625 | |||
| c5d236b379 | |||
| db217222de |
@@ -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
|
||||
|
||||
@@ -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"
|
||||
@@ -64,16 +63,20 @@
|
||||
|
||||
' parametri Lavorazione
|
||||
Public Const MAC_TORECALC_SLICE = "ToRecalcSlice"
|
||||
Public Const MAC_TORECALC_TFS = "ToRecalcTFS"
|
||||
Public Const MAC_TORECALC_GENERATE = "ToRecalcGenerate"
|
||||
Public Const MAC_GUID = "GUID"
|
||||
Public Const MAC_NAME = "Name"
|
||||
Public Const MAC_SLICING45 = "Slicing45"
|
||||
Public Const MAC_SLICINGTYPE = "SlicingType"
|
||||
Public Const MAC_SPIRALVASE = "SpiralVase"
|
||||
Public Const MAC_STRANDH = "StrandH"
|
||||
Public Const MAC_STRANDW = "StrandW"
|
||||
Public Const MAC_STRANDCOUNT = "StrandCount"
|
||||
Public Const MAC_OFFSET = "Offset"
|
||||
Public Const MAC_STARTPOINTOFFSETONSLICE = "StartPointOffsetOnSlice"
|
||||
Public Const MAC_STRANDORDER = "StrandOrder"
|
||||
Public Const MAC_STRANDOVERLAP = "StrandOverlap"
|
||||
Public Const MAC_DIRECTION = "Direction"
|
||||
Public Const MAC_LINKTYPE = "LinkType"
|
||||
Public Const MAC_LINKPARAM = "LinkParam"
|
||||
@@ -86,12 +89,14 @@
|
||||
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_TOOLDIAM = "ToolDiam"
|
||||
Public Const MAC_RIBSTYPE = "RibsType"
|
||||
Public Const MAC_RIBSOVERLAP = "RibsOverlap"
|
||||
Public Const MAC_RIBSSTRANDCOUNT = "RibsStrandCount"
|
||||
Public Const MAC_RIBSLINK = "RibsLink"
|
||||
@@ -117,6 +122,7 @@
|
||||
Public Const MAC_AUXSOLIDSCOASTINGLEN = "AuxSolidsCoastingLen"
|
||||
Public Const MAC_AUXSOLIDSWIPELEN = "AuxSolidsWipeLen"
|
||||
Public Const MAC_AUXSOLIDSWIPEDIR = "AuxSolidsWipeDir"
|
||||
Public Const MAC_CONSTANT = "Constant"
|
||||
Public Const MAC_MATERIALS = "Materials"
|
||||
|
||||
' parametri StartMach
|
||||
@@ -137,6 +143,14 @@
|
||||
' macchina in progetto
|
||||
Public Const KEY_MACHINE_NAME = "MachineName"
|
||||
|
||||
' materiale in progetto
|
||||
Public Const KEY_MATERIAL_GUID = "MaterialGuid"
|
||||
Public Const KEY_MATERIAL_NAME = "MaterialName"
|
||||
' nome file cn in progetto
|
||||
Public Const KEY_ISOFILE_PATH = "IsoFilePath"
|
||||
|
||||
Public Const FILE_PATH = "FilePath"
|
||||
Public Const PART_NAME = "PartName"
|
||||
Public Const ENTITY_NAME = "EntityName"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -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"
|
||||
@@ -60,6 +62,7 @@ Public Module ConstIni
|
||||
'Public Const K_NFEFONTDIR As String = "NfeFontDir"
|
||||
'Public Const K_DEFAULTCOLOR As String = "DefaultColor"
|
||||
'Public Const K_SAVETYPE As String = "SaveType"
|
||||
Public Const K_SURFTMTOLER As String = "SurfTmToler"
|
||||
|
||||
'Public Const S_OPENGL As String = "OpenGL"
|
||||
'Public Const K_DOUBLEBUFFER As String = "DoubleBuffer"
|
||||
@@ -95,6 +98,8 @@ Public Module ConstIni
|
||||
'Public Const K_MAJLNCOLOR As String = "MajLnColor"
|
||||
|
||||
Public Const S_IMPORT As String = "Import"
|
||||
Public Const K_DXFSCALE As String = "DxfScale"
|
||||
Public Const K_STLSCALE As String = "StlScale"
|
||||
Public Const K_CNCFLAG As String = "CncFlag"
|
||||
|
||||
'Public Const S_SIMUL As String = "Simul"
|
||||
@@ -106,6 +111,7 @@ 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_MRUFILES As String = "MruFiles"
|
||||
Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
Public Const S_CHANNELS As String = "Channels"
|
||||
|
||||
Public Const S_PARTPROGRAM As String = "PartProgram"
|
||||
Public Const S_EXTENSION As String = "Extension"
|
||||
|
||||
' Variables della macchina corrente
|
||||
Public Const S_MAINVARIABLES As String = "MainVariables"
|
||||
Public Const S_VARIABLES As String = "Variables"
|
||||
@@ -29,6 +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_SPEED_MIN As String = "SpeedMin"
|
||||
Public Const K_SPEED_MAX As String = "SpeedMax"
|
||||
|
||||
|
||||
@@ -16,11 +16,21 @@ Public Class CurrMachining
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property bCurrSlicing45 As Boolean
|
||||
Public ReadOnly Property dCurrSlicingType As Machining.MPAR_SLICINGTYPE
|
||||
Get
|
||||
Dim Slicing45 As CurrCheckMachiningParam = m_CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.SLICING45)
|
||||
Dim SlicingType As CurrComboMachiningParam = m_CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.SLICINGTYPE)
|
||||
If Not IsNothing(SlicingType) Then
|
||||
Return SlicingType.SelValue.Id
|
||||
Else
|
||||
Return 0
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property sCurrSlicingType As String
|
||||
Get
|
||||
Dim Slicing45 As CurrComboMachiningParam = m_CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.SLICINGTYPE)
|
||||
If Not IsNothing(Slicing45) Then
|
||||
Return Slicing45.bValue
|
||||
Return Slicing45.SelValue.Name
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
@@ -97,11 +107,6 @@ Public Class CurrMachining
|
||||
End If
|
||||
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nPartId, m_nIndex, False))
|
||||
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.LINK, nPartId, m_nIndex, False))
|
||||
'm_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.LEADIN, nPartId, m_nIndex, False))
|
||||
'm_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.LEADOUT, nPartId, m_nIndex, False))
|
||||
'm_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.COASTING, nPartId, m_nIndex, False))
|
||||
'm_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.WIPE, nPartId, m_nIndex, False))
|
||||
'm_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.TOOL, nPartId, m_nIndex, False))
|
||||
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.RIBS, nPartId, m_nIndex, False))
|
||||
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.SHELL_NUMBER, nPartId, m_nIndex, False))
|
||||
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.AUX_SOLID, nPartId, m_nIndex, False))
|
||||
@@ -119,11 +124,6 @@ Public Class CurrMachining
|
||||
m_sCurrGUID = CurrMachiningInDb.sGUID
|
||||
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nPartId, m_nIndex, True))
|
||||
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.LINK, nPartId, m_nIndex, True))
|
||||
'm_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.LEADIN, nPartId, m_nIndex, True))
|
||||
'm_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.LEADOUT, nPartId, m_nIndex, True))
|
||||
'm_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.COASTING, nPartId, m_nIndex, True))
|
||||
'm_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.WIPE, nPartId, m_nIndex, True))
|
||||
'm_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.TOOL, nPartId, m_nIndex, True))
|
||||
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.RIBS, nPartId, m_nIndex, True))
|
||||
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.SHELL_NUMBER, nPartId, m_nIndex, True))
|
||||
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.AUX_SOLID, nPartId, m_nIndex, True))
|
||||
@@ -153,7 +153,7 @@ Public Class CurrMachining
|
||||
Case NameOf(sender.dValue), NameOf(sender.sValue), NameOf(sender.bValue), NameOf(sender.SelValue)
|
||||
m_bIsModified = m_CathegoryList.Any(Function(x) x.MachiningParamList.Any(Function(y) y.bIsModified))
|
||||
NotifyPropertyChanged(NameOf(ghName))
|
||||
NotifyPropertyChanged(NameOf(bCurrSlicing45))
|
||||
NotifyPropertyChanged(NameOf(sCurrSlicingType))
|
||||
NotifyPropertyChanged(NameOf(sCurrStrandH))
|
||||
NotifyPropertyChanged(NameOf(sCurrStrandW))
|
||||
NotifyPropertyChanged(NameOf(sCurrStrandCount))
|
||||
@@ -182,17 +182,20 @@ Public Class CurrMachiningCathegory
|
||||
Select Case m_Type
|
||||
Case Cathegories.GENERAL
|
||||
m_sName = "General"
|
||||
m_MachiningParamList = New List(Of MachiningParam)({New CurrCheckMachiningParam(MachiningParam.Params.SLICING45, nPartId, nIndex, bForceFromDb),
|
||||
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.SLICINGTYPE, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.SPIRALVASE, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.STRANDH, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.STRANDW, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.STRANDCOUNT, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.OFFSET, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.STRANDOVERLAP, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.STARTPOINTOFFSETONSLICE, nPartId, nIndex, bForceFromDb),
|
||||
New CurrComboMachiningParam(MachiningParam.Params.STRANDORDER, nPartId, nIndex, bForceFromDb),
|
||||
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.TOOLDIAM, nPartId, nIndex, bForceFromDb)})
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, 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),
|
||||
@@ -206,41 +209,21 @@ 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)})
|
||||
'Case Cathegories.LEADIN
|
||||
' m_sName = "Lead In"
|
||||
' m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.OFFSETLEADPOINT, nPartId, nIndex, bForceFromDb),
|
||||
' New CurrComboMachiningParam(MachiningParam.Params.LEADIN, nPartId, nIndex, bForceFromDb),
|
||||
' New CurrNumericMachiningParam(MachiningParam.Params.LEADINTANGDIST, nPartId, nIndex, bForceFromDb),
|
||||
' New CurrNumericMachiningParam(MachiningParam.Params.LEADINORTHODIST, nPartId, nIndex, bForceFromDb)})
|
||||
'Case Cathegories.LEADOUT
|
||||
' m_sName = "Lead Out"
|
||||
' m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.LEADOUT, nPartId, nIndex, bForceFromDb),
|
||||
' New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nPartId, nIndex, bForceFromDb),
|
||||
' New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nPartId, nIndex, bForceFromDb)})
|
||||
'Case Cathegories.COASTING
|
||||
' m_sName = "Coasting"
|
||||
' m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.COASTINGLEN, nPartId, nIndex, bForceFromDb),
|
||||
' New CurrNumericMachiningParam(MachiningParam.Params.COASTINGFEED, nPartId, nIndex, bForceFromDb)})
|
||||
'Case Cathegories.WIPE
|
||||
' m_sName = "Wipe"
|
||||
' m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.WIPELEN, nPartId, nIndex, bForceFromDb),
|
||||
' New CurrNumericMachiningParam(MachiningParam.Params.WIPEFEEDPU, nPartId, nIndex, bForceFromDb)})
|
||||
'Case Cathegories.TOOL
|
||||
' m_sName = "Tool"
|
||||
' m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, 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 CurrNumericMachiningParam(MachiningParam.Params.RIBSLINK, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLINK, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nPartId, nIndex, bForceFromDb),
|
||||
@@ -290,13 +273,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))
|
||||
@@ -335,6 +318,9 @@ Public Class CurrNumericMachiningParam
|
||||
Case Params.OFFSET
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_OFFSET, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.STRANDOVERLAP
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_STRANDOVERLAP, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.STARTPOINTOFFSETONSLICE
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_STARTPOINTOFFSETONSLICE, m_dValue)
|
||||
m_bIsLen = True
|
||||
@@ -362,14 +348,17 @@ 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 = False
|
||||
Case Params.WIPEDIR
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_WIPEDIR, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.FLOORCOUNT
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_FLOORCOUNT, m_dValue)
|
||||
@@ -386,24 +375,9 @@ Public Class CurrNumericMachiningParam
|
||||
Case Params.RIBSSTRANDCOUNT
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSSTRANDCOUNT, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLINK
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLINK, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSINVERTORDER
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTORDER, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLEADININVERT
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLEADINLEN
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADINLEN, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADOUTINVERT, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLEADOUTLEN
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADOUTLEN, m_dValue)
|
||||
m_bIsLen = True
|
||||
@@ -446,38 +420,38 @@ Public Class CurrNumericMachiningParam
|
||||
Case Params.AUXSOLIDSWIPEDIR
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSWIPEDIR, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.FLOWRATE_PC
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_CONSTANT, m_dValue)
|
||||
m_bIsLen = False
|
||||
End Select
|
||||
m_dOrigValue = m_dValue
|
||||
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.STARTPOINTOFFSETONSLICE, Params.FLOORCOUNT, Params.G0FEED, Params.TOOLDIAM
|
||||
Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE,
|
||||
Params.FLOORCOUNT, Params.G0FEED, 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.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.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST
|
||||
' m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LEADIN).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
'Case Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST
|
||||
' m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LEADOUT).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
'Case Params.COASTINGLEN, Params.COASTINGFEED
|
||||
' m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.COASTING).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
'Case Params.WIPELEN, Params.WIPEFEEDPU
|
||||
' m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.WIPE).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
'Case Params.TOOLDIAM
|
||||
' m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.TOOL).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.FLOWRATE_PC AndAlso Not bReadFromPart Then
|
||||
m_dValue = 100
|
||||
m_dOrigValue = 100
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -497,6 +471,8 @@ Public Class CurrNumericMachiningParam
|
||||
EgtSetInfo(nPartId, MAC_STRANDCOUNT, sWriteValue)
|
||||
Case Params.OFFSET
|
||||
EgtSetInfo(nPartId, MAC_OFFSET, sWriteValue)
|
||||
Case Params.STRANDOVERLAP
|
||||
EgtSetInfo(nPartId, MAC_STRANDOVERLAP, sWriteValue)
|
||||
Case Params.STARTPOINTOFFSETONSLICE
|
||||
EgtSetInfo(nPartId, MAC_STARTPOINTOFFSETONSLICE, sWriteValue)
|
||||
Case Params.LINKPARAM
|
||||
@@ -515,12 +491,14 @@ 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)
|
||||
Case Params.FLOORCOUNT
|
||||
EgtSetInfo(nPartId, MAC_FLOORCOUNT, sWriteValue)
|
||||
Case Params.G0FEED
|
||||
@@ -531,18 +509,8 @@ Public Class CurrNumericMachiningParam
|
||||
EgtSetInfo(nPartId, MAC_RIBSOVERLAP, sWriteValue)
|
||||
Case Params.RIBSSTRANDCOUNT
|
||||
EgtSetInfo(nPartId, MAC_RIBSSTRANDCOUNT, sWriteValue)
|
||||
Case Params.RIBSLINK
|
||||
EgtSetInfo(nPartId, MAC_RIBSLINK, sWriteValue)
|
||||
Case Params.RIBSINVERTORDER
|
||||
EgtSetInfo(nPartId, MAC_RIBSINVERTORDER, sWriteValue)
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
EgtSetInfo(nPartId, MAC_RIBSINVERTDIRECTION, sWriteValue)
|
||||
Case Params.RIBSLEADININVERT
|
||||
EgtSetInfo(nPartId, MAC_RIBSLEADININVERT, sWriteValue)
|
||||
Case Params.RIBSLEADINLEN
|
||||
EgtSetInfo(nPartId, MAC_RIBSLEADINLEN, sWriteValue)
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
EgtSetInfo(nPartId, MAC_RIBSLEADOUTINVERT, sWriteValue)
|
||||
Case Params.RIBSLEADOUTLEN
|
||||
EgtSetInfo(nPartId, MAC_RIBSLEADOUTLEN, sWriteValue)
|
||||
Case Params.RIBSLEADOUTCOASTING
|
||||
@@ -571,6 +539,8 @@ Public Class CurrNumericMachiningParam
|
||||
EgtSetInfo(nPartId, MAC_AUXSOLIDSWIPELEN, sWriteValue)
|
||||
Case Params.AUXSOLIDSWIPEDIR
|
||||
EgtSetInfo(nPartId, MAC_AUXSOLIDSWIPEDIR, sWriteValue)
|
||||
Case Params.FLOWRATE_PC
|
||||
EgtSetInfo(nPartId, MAC_CONSTANT, sWriteValue)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -580,6 +550,7 @@ Public Class CurrNumericMachiningParam
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_dValue = m_dOrigValue
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -645,6 +616,7 @@ Public Class CurrStringMachiningParam
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_sValue = m_sOrigValue
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -704,6 +676,21 @@ Public Class CurrComboMachiningParam
|
||||
MyBase.New(Type, nIndex)
|
||||
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.DEG45, "45°")})
|
||||
If nHorizontalPrint > 0 Then
|
||||
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
|
||||
End If
|
||||
Dim nSelValue As Integer = 0
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_SLICINGTYPE, nSelValue)
|
||||
If Not bReadFromPart Then
|
||||
Dim nSlicing45 As Integer = 0
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_SLICING45, nSlicing45)
|
||||
nSelValue = If(nSlicing45 = 0, Machining.MPAR_SLICINGTYPE.VERTICAL, Machining.MPAR_SLICINGTYPE.DEG45)
|
||||
End If
|
||||
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
|
||||
Case Params.STRANDORDER
|
||||
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_STRANDORDERS.OUTTOIN, "From Outside To Inside"),
|
||||
New IdNameStruct(Machining.MPAR_STRANDORDERS.INTOOUT, "From Inside To Outside")})
|
||||
@@ -737,6 +724,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"),
|
||||
@@ -762,14 +756,12 @@ Public Class CurrComboMachiningParam
|
||||
If nIndex > 0 Then
|
||||
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
|
||||
Select Case Type
|
||||
Case Params.STRANDORDER, Params.DIRECTION
|
||||
Case Params.SLICINGTYPE, Params.STRANDORDER, Params.DIRECTION
|
||||
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.LEADIN
|
||||
' m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LEADIN).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
'Case Params.LEADOUT
|
||||
' m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LEADOUT).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
|
||||
@@ -777,11 +769,16 @@ 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
|
||||
|
||||
Friend Overrides Sub WriteParamInPart(nPartId As Integer)
|
||||
Select Case Type
|
||||
Case Params.SLICINGTYPE
|
||||
EgtSetInfo(nPartId, MAC_SLICINGTYPE, m_SelValue.Id)
|
||||
Case Params.STRANDORDER
|
||||
EgtSetInfo(nPartId, MAC_STRANDORDER, m_SelValue.Id)
|
||||
Case Params.DIRECTION
|
||||
@@ -792,6 +789,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
|
||||
@@ -807,6 +806,7 @@ Public Class CurrComboMachiningParam
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_SelValue = m_OrigSelValue
|
||||
NotifyPropertyChanged(NameOf(SelValue))
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -868,15 +868,27 @@ Public Class CurrCheckMachiningParam
|
||||
MyBase.New(Type, nIndex)
|
||||
Dim bReadFromPart As Boolean = False
|
||||
Select Case Type
|
||||
Case Params.SLICING45
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_SLICING45, m_bValue)
|
||||
Case Params.SPIRALVASE
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_SPIRALVASE, m_bValue)
|
||||
Case Params.RIBSLINK
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLINK, m_bValue)
|
||||
Case Params.RIBSINVERTORDER
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTORDER, m_bValue)
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bValue)
|
||||
Case Params.RIBSLEADININVERT
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bValue)
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADOUTINVERT, m_bValue)
|
||||
End Select
|
||||
m_bOrigValue = m_bValue
|
||||
If nIndex > 0 Then
|
||||
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
|
||||
Select Case Type
|
||||
Case Params.SLICING45
|
||||
Case Params.SPIRALVASE
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
Case Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
End Select
|
||||
If bForceFromDb OrElse Not bReadFromPart Then
|
||||
m_bValue = m_DbParam.bOrigValue
|
||||
@@ -887,8 +899,18 @@ Public Class CurrCheckMachiningParam
|
||||
|
||||
Friend Overrides Sub WriteParamInPart(nPartId As Integer)
|
||||
Select Case Type
|
||||
Case Params.SLICING45
|
||||
EgtSetInfo(nPartId, MAC_SLICING45, If(m_bValue, 1, 0))
|
||||
Case Params.SPIRALVASE
|
||||
EgtSetInfo(nPartId, MAC_SPIRALVASE, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSLINK
|
||||
EgtSetInfo(nPartId, MAC_RIBSLINK, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSINVERTORDER
|
||||
EgtSetInfo(nPartId, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
EgtSetInfo(nPartId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSLEADININVERT
|
||||
EgtSetInfo(nPartId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
EgtSetInfo(nPartId, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0))
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -898,6 +920,7 @@ Public Class CurrCheckMachiningParam
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_bValue = m_bOrigValue
|
||||
NotifyPropertyChanged(NameOf(bValue))
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
@@ -79,6 +79,8 @@ Public Class CurrMachiningPanelVM
|
||||
End Property
|
||||
|
||||
Public Sub Cancel()
|
||||
' ripristino i parametri modificati
|
||||
m_CurrMachining.ResetModification()
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
End Sub
|
||||
|
||||
@@ -1,17 +1,103 @@
|
||||
<StackPanel x:Class="DispositionPanelV"
|
||||
<Grid x:Class="DispositionPanelV"
|
||||
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"
|
||||
xmlns:PrintApp="clr-namespace:Icarus"
|
||||
VerticalAlignment="Stretch"
|
||||
Margin="5">
|
||||
<StackPanel.Resources>
|
||||
<Grid.Resources>
|
||||
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
|
||||
</StackPanel.Resources>
|
||||
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ToggleButton x:Name="MoveBtn"
|
||||
Grid.Row="3"
|
||||
Content="Move"
|
||||
IsChecked="{Binding bMove_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=MoveBtn}"
|
||||
<!--<Border Background="Red"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="5"
|
||||
Width="50"
|
||||
VerticalAlignment="Stretch"/>-->
|
||||
|
||||
<Border x:Name="PopupBrd"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="5"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=MoveBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="0,0,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="X"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,2.5,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Y"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,2.5,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Z"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Drag"
|
||||
Command="{Binding DragMove_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=MoveBtn}"
|
||||
PlacementTarget="{Binding ElementName=MoveBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border x:Name="PopupBrd" Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -68,12 +154,62 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
|
||||
<ToggleButton x:Name="RotateBtn"
|
||||
Grid.Row="4"
|
||||
Content="Rotate"
|
||||
IsChecked="{Binding bRotate_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=RotateBtn}"
|
||||
<!--<Border Background="Blue"
|
||||
Grid.Column="2"
|
||||
Grid.Row="2"
|
||||
Grid.RowSpan="5"
|
||||
Width="50"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"/>-->
|
||||
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Grid.RowSpan="5"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=RotateBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<UniformGrid Columns="3">
|
||||
<RadioButton Content="X"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[0]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
<RadioButton Content="Y"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[1]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
<RadioButton Content="Z"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[2]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
</UniformGrid>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Row="1"
|
||||
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
|
||||
Margin="0,5,0,0"/>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Drag"
|
||||
Command="{Binding DragRotate_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=RotateBtn}"
|
||||
Grid.Column="1"
|
||||
PlacementTarget="{Binding ElementName=RotateBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
@@ -110,5 +246,5 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</StackPanel>
|
||||
</Popup>-->
|
||||
</Grid>
|
||||
|
||||
@@ -298,3 +298,19 @@ Public Class CenterToolTipConverter
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Class FromBooleanToVisibility
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert
|
||||
If IsNothing(value) OrElse TypeOf value IsNot Boolean Then
|
||||
Return Visibility.Collapsed
|
||||
End If
|
||||
Return If(CBool(value), Visibility.Visible, Visibility.Collapsed)
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||
Throw New NotSupportedException()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
+39
-9
@@ -123,11 +123,6 @@
|
||||
<DependentUpon>DispositionPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DispositionPanel\DispositionPanelVM.vb" />
|
||||
<Compile Include="ImportPanel\ImportPanelV.xaml.vb">
|
||||
<DependentUpon>ImportPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ImportPanel\ImportPanelVM.vb" />
|
||||
<Compile Include="ImportPanel\ImportUtility.vb" />
|
||||
<Compile Include="InstrumentPanel\InstrumentPanelV.xaml.vb">
|
||||
<DependentUpon>InstrumentPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -154,11 +149,24 @@
|
||||
<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="OptionsWindow\MachineBox.xaml.vb">
|
||||
<DependentUpon>MachineBox.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OptionsWindow\OptionModule.vb" />
|
||||
<Compile Include="OptionsWindow\OptionWindowV.xaml.vb">
|
||||
<DependentUpon>OptionWindowV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OptionsWindow\OptionWindowVM.vb" />
|
||||
<Compile Include="Project\ProjectV.xaml.vb">
|
||||
<DependentUpon>ProjectV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -227,6 +235,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>
|
||||
@@ -249,6 +260,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Utility\DisableModifiedMgr.vb" />
|
||||
<Compile Include="Utility\EgwCrypto.vb" />
|
||||
<Compile Include="Utility\GeomEntityColors.vb" />
|
||||
<Compile Include="Utility\LuaExec.vb" />
|
||||
<Compile Include="Utility\Map.vb" />
|
||||
<Compile Include="Utility\MyMachine.vb" />
|
||||
@@ -287,10 +299,6 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ImportPanel\ImportPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="InstrumentPanel\InstrumentPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -331,10 +339,22 @@
|
||||
<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="OptionsWindow\MachineBox.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OptionsWindow\OptionWindowV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Project\ProjectV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -403,6 +423,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>
|
||||
@@ -607,6 +631,12 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TopPanel\Edit.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
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource LeftPanelTitle_Border}">
|
||||
<TextBlock Text="Lista nuovi pezzi"
|
||||
<TextBlock Text="New part list"
|
||||
FontWeight="DemiBold"
|
||||
FontSize="14"/>
|
||||
</Border>
|
||||
@@ -70,7 +70,7 @@
|
||||
</TreeView>
|
||||
<Border Grid.Row="3"
|
||||
Style="{StaticResource LeftPanelTitle_Border}">
|
||||
<TextBlock Text="Lista entità importate"
|
||||
<TextBlock Text="Imported entity list"
|
||||
FontWeight="DemiBold"
|
||||
FontSize="14"/>
|
||||
</Border>
|
||||
|
||||
@@ -224,7 +224,8 @@ Public Class ImportPanelVM
|
||||
Return
|
||||
Else
|
||||
' Creo pezzi e layer necessari
|
||||
For Each ImportPart In m_ImportPartList
|
||||
For ImportPartIndex = 0 To m_ImportPartList.Count - 1
|
||||
Dim ImportPart As ImportPart = m_ImportPartList(ImportPartIndex)
|
||||
Dim frImportedPart As New Frame3d
|
||||
EgtGetGroupGlobFrame(m_nImportedPartId, frImportedPart)
|
||||
Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT, frImportedPart)
|
||||
@@ -238,6 +239,7 @@ Public Class ImportPanelVM
|
||||
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 ImportLayer In ImportPart.LayerList
|
||||
Select Case ImportLayer.Type
|
||||
Case ImportLayer.LayerType.PRINT_SOLID
|
||||
@@ -322,11 +324,25 @@ Public Class ImportPanelVM
|
||||
EgtSetColor(GeomEntity.nId, c3LightBlue)
|
||||
Next
|
||||
Case ImportLayer.LayerType.OTHERS
|
||||
Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
nOthersLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nOthersLayerId, LAY_OTHERS)
|
||||
For Each GeomEntity In ImportLayer.EntityList
|
||||
EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
Next
|
||||
If ImportPartIndex = 0 Then
|
||||
For Each GeomEntity In ImportedEntityList
|
||||
' se curva
|
||||
Dim EntityType As GDB_TY = EgtGetType(GeomEntity.nId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' la trasformo in curva compo
|
||||
EgtCreateCurveCompo(nOthersLayerId, GeomEntity.nId, True)
|
||||
Case Else
|
||||
' altrimenti la sposto solamente
|
||||
EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
End Select
|
||||
Next
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
' aggiungo riferimento
|
||||
@@ -365,13 +381,13 @@ Public Class ImportPanelVM
|
||||
End If
|
||||
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, PrintSolidEntity.Reference)
|
||||
' appoggio il pezzo sulla tavola
|
||||
EgtMove( nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
|
||||
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, "PartOnTable", 1)
|
||||
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, sFilePath)
|
||||
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
|
||||
Map.refTopPanelVM.PartList.Add(NewPart)
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<UserControl x:Class="LeftPanelV"
|
||||
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"
|
||||
xmlns:PrintApp="clr-namespace:Icarus"
|
||||
Margin="5">
|
||||
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"
|
||||
xmlns:PrintApp="clr-namespace:Icarus"
|
||||
Margin="5">
|
||||
<TabControl SelectedIndex="{Binding SelPanel}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0">
|
||||
@@ -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:ImportPanelV DataContext="{StaticResource ImportPanelVM}"/>
|
||||
<!--<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>-->
|
||||
<PrintApp:ManagePartPanelV DataContext="{StaticResource ManagePartPanelVM}"/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
|
||||
@@ -54,6 +54,9 @@ Public Class LeftPanelVM
|
||||
Map.refRibPanelVM.Init()
|
||||
Case Panels.SHELLNUMBER
|
||||
Map.refShellNumberPanelVM.Init()
|
||||
Case Panels.MODIFYPART
|
||||
''Map.refModifyPartPanelVM.Init()
|
||||
Map.refManagePartPanelVM.Init(ManagePartPanelVM.ManagePartType.MODIFY)
|
||||
End Select
|
||||
Map.refViewLayerManagerVM.UpdateForced()
|
||||
NotifyPropertyChanged(NameOf(SelPanel))
|
||||
|
||||
+188
-171
@@ -6,6 +6,12 @@ Imports EgtWPFLib5
|
||||
Public Class Machining
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum MPAR_SLICINGTYPE As Integer
|
||||
VERTICAL = 1
|
||||
DEG45 = 2
|
||||
HORIZONTAL = 3
|
||||
End Enum
|
||||
|
||||
Public Enum MPAR_STRANDORDERS As Integer
|
||||
OUTTOIN = 1
|
||||
INTOOUT = 2
|
||||
@@ -28,6 +34,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
|
||||
@@ -48,7 +60,7 @@ Public Class Machining
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub UpdateIsModified()
|
||||
m_bIsModified = m_CathegoryList.Any(Function(x) x.MachiningParamList.Any(Function(y) y.bIsModified))
|
||||
m_bIsModified = m_CathegoryList.Any(Function(x) x.MachiningParamList.Any(Function(y) y.bIsModified)) OrElse bIsModifiedName
|
||||
NotifyPropertyChanged(NameOf(ghName))
|
||||
End Sub
|
||||
|
||||
@@ -69,6 +81,7 @@ Public Class Machining
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sOrigName As String = ""
|
||||
Protected m_sName As String = ""
|
||||
Public Property sName As String
|
||||
Get
|
||||
@@ -77,7 +90,8 @@ Public Class Machining
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
Map.refMachiningDbVM.SetNameVisibility(False)
|
||||
NotifyPropertyChanged(NameOf(ghName))
|
||||
UpdateIsModified()
|
||||
Map.refMachiningDbVM.SetIsEnabled(True)
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property ghName As String
|
||||
@@ -85,6 +99,11 @@ Public Class Machining
|
||||
Return m_sName & If(m_bIsModified, "*", "")
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property bIsModifiedName As Boolean
|
||||
Get
|
||||
Return m_sName <> m_sOrigName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
End Sub
|
||||
@@ -98,13 +117,9 @@ Public Class Machining
|
||||
m_sGUID = Guid.NewGuid.ToString()
|
||||
m_sName = "PrintingParam"
|
||||
End If
|
||||
m_sOrigName = m_sName
|
||||
m_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nIndex))
|
||||
m_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.LINK, nIndex))
|
||||
'm_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.LEADIN, nIndex))
|
||||
'm_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.LEADOUT, nIndex))
|
||||
'm_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.COASTING, nIndex))
|
||||
'm_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.WIPE, nIndex))
|
||||
'm_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.TOOL, nIndex))
|
||||
m_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.RIBS, nIndex))
|
||||
m_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.SHELL_NUMBER, nIndex))
|
||||
m_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.AUX_SOLID, nIndex))
|
||||
@@ -116,13 +131,6 @@ Public Class Machining
|
||||
Next
|
||||
End Sub
|
||||
|
||||
'Sub New(nIndex As Integer, sGUID As String, sName As String)
|
||||
' m_nIndex = nIndex
|
||||
' m_sName = sName
|
||||
' m_sGUID = sGUID
|
||||
' ReadAllParams()
|
||||
'End Sub
|
||||
|
||||
Sub New(sName As String, bSlicing45 As Boolean, dStrandH As Double, dStrandW As Double, nStrandCount As Integer, dOffset As Double, dStartPointOffsetOnSlice As Double,
|
||||
dStrandOrder As MPAR_STRANDORDERS, dDirection As MPAR_DIRECTIONS, dLinkType As MPAR_LINKTYPES, dLinkParam As Double, dLinkZup As Double, dOffsetLeadPoint As Double,
|
||||
dLeadIn As MPAR_LEADINOUT, dLeadInTangDist As Double, dLeadInOrthoDist As Double, dLeadOut As MPAR_LEADINOUT, dLeadOutTangDist As Double, dLeadOutOrthoDist As Double,
|
||||
@@ -133,45 +141,14 @@ Public Class Machining
|
||||
|
||||
End Sub
|
||||
|
||||
'Private Sub ReadAllParams()
|
||||
' m_bSlicing45 = ReadMachiningParamDouble(m_nIndex, MAC_SLICING45, 0)
|
||||
' m_dStrandH = ReadMachiningParamDouble(m_nIndex, MAC_STRANDH, 0)
|
||||
' m_dStrandW = ReadMachiningParamDouble(m_nIndex, MAC_STRANDW, 0)
|
||||
' m_nStrandCount = ReadMachiningParamDouble(m_nIndex, MAC_STRANDCOUNT, 0)
|
||||
' m_dOffset = ReadMachiningParamDouble(m_nIndex, MAC_OFFSET, 0)
|
||||
' m_dStartPointOffsetOnSlice = ReadMachiningParamDouble(m_nIndex, MAC_STARTPOINTOFFSETONSLICE, 0)
|
||||
' m_dStrandOrder = ReadMachiningParamDouble(m_nIndex, MAC_STRANDORDER, 0)
|
||||
' m_dDirection = ReadMachiningParamDouble(m_nIndex, MAC_DIRECTION, 0)
|
||||
' m_dLinkType = ReadMachiningParamDouble(m_nIndex, MAC_LINKTYPE, 0)
|
||||
' m_dLinkParam = ReadMachiningParamDouble(m_nIndex, MAC_LINKPARAM, 0)
|
||||
' m_dLinkZup = ReadMachiningParamDouble(m_nIndex, MAC_LINKZUP, 0)
|
||||
' m_dOffsetLeadPoint = ReadMachiningParamDouble(m_nIndex, MAC_OFFSETLEADPOINT, 0)
|
||||
' m_dLeadIn = ReadMachiningParamDouble(m_nIndex, MAC_LEADIN, 0)
|
||||
' m_dLeadInTangDist = ReadMachiningParamDouble(m_nIndex, MAC_LEADINTANGDIST, 0)
|
||||
' m_dLeadInOrthoDist = ReadMachiningParamDouble(m_nIndex, MAC_LEADINORTHODIST, 0)
|
||||
' m_dLeadOut = ReadMachiningParamDouble(m_nIndex, MAC_LEADOUT, 0)
|
||||
' m_dLeadOutTangDist = ReadMachiningParamDouble(m_nIndex, MAC_LEADOUTTANGDIST, 0)
|
||||
' m_dLeadOutOrthoDist = ReadMachiningParamDouble(m_nIndex, MAC_LEADOUTORTHODIST, 0)
|
||||
' m_dCoastingLen = ReadMachiningParamDouble(m_nIndex, MAC_COASTINGLEN, 0)
|
||||
' m_dCoastingFeed = ReadMachiningParamDouble(m_nIndex, MAC_COASTINGFEED, 0)
|
||||
' m_dWipeLen = ReadMachiningParamDouble(m_nIndex, MAC_WIPELEN, 0)
|
||||
' m_dWipeFeedPu = ReadMachiningParamDouble(m_nIndex, MAC_WIPEFEEDPU, 0)
|
||||
' m_dFloorCount = ReadMachiningParamDouble(m_nIndex, MAC_FLOORCOUNT, 0)
|
||||
' m_dG0Feed = ReadMachiningParamDouble(m_nIndex, MAC_G0FEED, 0)
|
||||
' m_dToolDiam = ReadMachiningParamDouble(m_nIndex, MAC_TOOLDIAM, 0)
|
||||
' m_dRibsOverlap = ReadMachiningParamDouble(m_nIndex, MAC_RIBSOVERLAP, 0)
|
||||
' m_dRibsStrandCount = ReadMachiningParamDouble(m_nIndex, MAC_RIBSSTRANDCOUNT, 0)
|
||||
' m_dRibsLink = ReadMachiningParamDouble(m_nIndex, MAC_RIBSLINK, 0)
|
||||
' m_dRibsInvertOrder = ReadMachiningParamDouble(m_nIndex, MAC_RIBSINVERTORDER, 0)
|
||||
' m_dRibsInvertDirection = ReadMachiningParamDouble(m_nIndex, MAC_RIBSINVERTDIRECTION, 0)
|
||||
' m_dRibsLeadInInvert = ReadMachiningParamDouble(m_nIndex, MAC_RIBSLEADININVERT, 0)
|
||||
' m_dRibsLeadInLen = ReadMachiningParamDouble(m_nIndex, MAC_RIBSLEADINLEN, 0)
|
||||
' m_dRibsLeadOutInvert = ReadMachiningParamDouble(m_nIndex, MAC_RIBSLEADOUTINVERT, 0)
|
||||
' m_dRibsLeadOutLen = ReadMachiningParamDouble(m_nIndex, MAC_RIBSLEADOUTLEN, 0)
|
||||
' m_dRibsLeadOutCoasting = ReadMachiningParamDouble(m_nIndex, MAC_RIBSLEADOUTCOASTING, 0)
|
||||
' m_dRibsLeadOutWipe = ReadMachiningParamDouble(m_nIndex, MAC_RIBSLEADOUTWIPE, 0)
|
||||
' m_dRibsLeadOutWipeDir = ReadMachiningParamDouble(m_nIndex, MAC_RIBSLEADOUTWIPEDIR, 0)
|
||||
'End Sub
|
||||
Private Sub SaveName()
|
||||
m_sOrigName = m_sName
|
||||
End Sub
|
||||
|
||||
Private Sub ResetName()
|
||||
m_sName = m_sOrigName
|
||||
NotifyPropertyChanged(NameOf(ghName))
|
||||
End Sub
|
||||
|
||||
Friend Sub Save()
|
||||
If bIsModified Then
|
||||
@@ -185,15 +162,17 @@ Public Class Machining
|
||||
End Sub
|
||||
|
||||
Private Sub SaveParams()
|
||||
SaveName()
|
||||
For Each Cathegory In m_CathegoryList
|
||||
Cathegory.SaveParams()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub ResetModification()
|
||||
ResetName()
|
||||
If bIsModified Then
|
||||
' annullo le modifiche di tutti i parametri
|
||||
SaveParams()
|
||||
ResetParams()
|
||||
' resetto stato di modificata
|
||||
UpdateIsModified()
|
||||
End If
|
||||
@@ -216,8 +195,7 @@ Public Class Machining
|
||||
Friend Overridable Sub OnMachiningParamPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
Case NameOf(sender.dValue), NameOf(sender.sValue), NameOf(sender.bValue), NameOf(sender.SelValue)
|
||||
m_bIsModified = m_CathegoryList.Any(Function(x) x.MachiningParamList.Any(Function(y) y.bIsModified))
|
||||
NotifyPropertyChanged(NameOf(ghName))
|
||||
UpdateIsModified()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -267,11 +245,6 @@ Public Class MachiningCathegory
|
||||
Public Enum Cathegories As Integer
|
||||
GENERAL = 1
|
||||
LINK = 2
|
||||
'LEADIN = 3
|
||||
'LEADOUT = 4
|
||||
'COASTING = 5
|
||||
'WIPE = 6
|
||||
'TOOL = 7
|
||||
RIBS = 8
|
||||
SHELL_NUMBER = 9
|
||||
AUX_SOLID = 10
|
||||
@@ -318,17 +291,20 @@ Public Class MachiningCathegory
|
||||
Select Case m_Type
|
||||
Case Cathegories.GENERAL
|
||||
m_sName = "General"
|
||||
m_MachiningParamList = New List(Of MachiningParam)({New CheckMachiningParam(MachiningParam.Params.SLICING45, nIndex),
|
||||
m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.SLICINGTYPE, nIndex),
|
||||
New CheckMachiningParam(MachiningParam.Params.SPIRALVASE, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.STRANDH, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.STRANDW, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.STRANDCOUNT, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.OFFSET, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.STRANDOVERLAP, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.STARTPOINTOFFSETONSLICE, nIndex),
|
||||
New ComboMachiningParam(MachiningParam.Params.STRANDORDER, nIndex),
|
||||
New ComboMachiningParam(MachiningParam.Params.DIRECTION, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.G0FEED, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, nIndex)})
|
||||
New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, 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),
|
||||
@@ -342,41 +318,21 @@ 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)})
|
||||
'Case Cathegories.LEADIN
|
||||
' m_sName = "Lead In"
|
||||
' m_MachiningParamList = New List(Of MachiningParam)({New NumericMachiningParam(MachiningParam.Params.OFFSETLEADPOINT, nIndex),
|
||||
' New ComboMachiningParam(MachiningParam.Params.LEADIN, nIndex),
|
||||
' New NumericMachiningParam(MachiningParam.Params.LEADINTANGDIST, nIndex),
|
||||
' New NumericMachiningParam(MachiningParam.Params.LEADINORTHODIST, nIndex)})
|
||||
'Case Cathegories.LEADOUT
|
||||
' m_sName = "Lead Out"
|
||||
' m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.LEADOUT, nIndex),
|
||||
' New NumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nIndex),
|
||||
' New NumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nIndex)})
|
||||
'Case Cathegories.COASTING
|
||||
' m_sName = "Coasting"
|
||||
' m_MachiningParamList = New List(Of MachiningParam)({New NumericMachiningParam(MachiningParam.Params.COASTINGLEN, nIndex),
|
||||
' New NumericMachiningParam(MachiningParam.Params.COASTINGFEED, nIndex)})
|
||||
'Case Cathegories.WIPE
|
||||
' m_sName = "Wipe"
|
||||
' m_MachiningParamList = New List(Of MachiningParam)({New NumericMachiningParam(MachiningParam.Params.WIPELEN, nIndex),
|
||||
' New NumericMachiningParam(MachiningParam.Params.WIPEFEEDPU, nIndex)})
|
||||
'Case Cathegories.TOOL
|
||||
' m_sName = "Tool"
|
||||
' m_MachiningParamList = New List(Of MachiningParam)({New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, 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 NumericMachiningParam(MachiningParam.Params.RIBSLINK, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nIndex),
|
||||
New CheckMachiningParam(MachiningParam.Params.RIBSLINK, nIndex),
|
||||
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nIndex),
|
||||
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nIndex),
|
||||
New CheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nIndex),
|
||||
New CheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nIndex),
|
||||
New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nIndex),
|
||||
@@ -438,7 +394,7 @@ Public MustInherit Class MachiningParam
|
||||
|
||||
Public Enum Params As Integer
|
||||
NAME = 2
|
||||
SLICING45 = 3
|
||||
SLICINGTYPE = 3
|
||||
STRANDH = 4
|
||||
STRANDW = 5
|
||||
STRANDCOUNT = 6
|
||||
@@ -457,37 +413,42 @@ 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
|
||||
RIBSTYPE = 28
|
||||
RIBSOVERLAP = 29
|
||||
RIBSSTRANDCOUNT = 30
|
||||
RIBSLINK = 31
|
||||
RIBSINVERTORDER = 32
|
||||
RIBSINVERTDIRECTION = 33
|
||||
RIBSLEADININVERT = 34
|
||||
RIBSLEADINLEN = 35
|
||||
RIBSLEADOUTINVERT = 36
|
||||
RIBSLEADOUTLEN = 37
|
||||
RIBSLEADOUTCOASTING = 38
|
||||
RIBSLEADOUTWIPE = 39
|
||||
RIBSLEADOUTWIPEDIR = 40
|
||||
SHELLNBRDIFFERENCE = 41
|
||||
SHELLNBRCOASTING = 42
|
||||
SHELLNBRWIPE = 43
|
||||
SHELLNBRWIPEDIR = 44
|
||||
AUXSOLIDSOVERLAP = 45
|
||||
AUXSOLIDSINFILL = 46
|
||||
AUXSOLIDSSTRANDORDER = 47
|
||||
AUXSOLIDSLINKTYPE = 48
|
||||
AUXSOLIDSLINKPARAM = 49
|
||||
AUXSOLIDSSTARTPOINTOFFSETONSLICE = 50
|
||||
AUXSOLIDSCOASTINGLEN = 51
|
||||
AUXSOLIDSWIPELEN = 52
|
||||
AUXSOLIDSWIPEDIR = 53
|
||||
SPIRALVASE = 54
|
||||
WIPEDIR = 55
|
||||
STRANDOVERLAP = 56
|
||||
FLOWRATE_PC = 57
|
||||
MATERIALS = 100
|
||||
End Enum
|
||||
|
||||
@@ -510,8 +471,8 @@ Public MustInherit Class MachiningParam
|
||||
Sub New(Type As Params)
|
||||
m_Type = Type
|
||||
Select Case m_Type
|
||||
Case Params.SLICING45
|
||||
m_sName = "Slicing 45°"
|
||||
Case Params.SLICINGTYPE
|
||||
m_sName = "Slicing direction"
|
||||
Case Params.STRANDH
|
||||
m_sName = "Strand Height"
|
||||
Case Params.STRANDW
|
||||
@@ -548,20 +509,22 @@ 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.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
|
||||
@@ -583,7 +546,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
|
||||
@@ -591,9 +554,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
|
||||
@@ -609,7 +572,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 [deg]"
|
||||
Case Params.STRANDOVERLAP
|
||||
m_sName = "Strand Overlap [%]"
|
||||
Case Params.FLOWRATE_PC
|
||||
m_sName = "Flow rate [%]"
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -639,13 +610,13 @@ 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))
|
||||
End Set
|
||||
@@ -687,6 +658,9 @@ Public Class NumericMachiningParam
|
||||
Case Params.OFFSET
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_OFFSET, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.STRANDOVERLAP
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_STRANDOVERLAP, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.STARTPOINTOFFSETONSLICE
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_STARTPOINTOFFSETONSLICE, 0)
|
||||
m_bIsLen = True
|
||||
@@ -714,18 +688,21 @@ 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 = 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
|
||||
@@ -738,24 +715,9 @@ Public Class NumericMachiningParam
|
||||
Case Params.RIBSSTRANDCOUNT
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_RIBSSTRANDCOUNT, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLINK
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLINK, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSINVERTORDER
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTORDER, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTDIRECTION, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLEADININVERT
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADININVERT, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLEADINLEN
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADINLEN, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADOUTINVERT, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLEADOUTLEN
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADOUTLEN, 0)
|
||||
m_bIsLen = True
|
||||
@@ -798,6 +760,9 @@ Public Class NumericMachiningParam
|
||||
Case Params.AUXSOLIDSWIPEDIR
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_AUXSOLIDSWIPEDIR, 0)
|
||||
m_bIsLen = True
|
||||
Case Params.FLOWRATE_PC
|
||||
m_dValue = ReadMachiningParamDouble(nIndex, MAC_CONSTANT, 100)
|
||||
m_bIsLen = False
|
||||
End Select
|
||||
End If
|
||||
m_dOrigValue = m_dValue
|
||||
@@ -819,6 +784,8 @@ Public Class NumericMachiningParam
|
||||
WriteMachiningParam(nIndex, MAC_STRANDCOUNT, sWriteValue)
|
||||
Case Params.OFFSET
|
||||
WriteMachiningParam(nIndex, MAC_OFFSET, sWriteValue)
|
||||
Case Params.STRANDOVERLAP
|
||||
WriteMachiningParam(nIndex, MAC_STRANDOVERLAP, sWriteValue)
|
||||
Case Params.STARTPOINTOFFSETONSLICE
|
||||
WriteMachiningParam(nIndex, MAC_STARTPOINTOFFSETONSLICE, sWriteValue)
|
||||
Case Params.LINKPARAM
|
||||
@@ -837,12 +804,14 @@ Public Class NumericMachiningParam
|
||||
WriteMachiningParam(nIndex, MAC_LEADOUTORTHODIST, sWriteValue)
|
||||
Case Params.COASTINGLEN
|
||||
WriteMachiningParam(nIndex, MAC_COASTINGLEN, sWriteValue)
|
||||
Case Params.COASTINGFEED
|
||||
WriteMachiningParam(nIndex, MAC_COASTINGFEED, sWriteValue)
|
||||
Case Params.COASTINGFEED_PC
|
||||
WriteMachiningParam(nIndex, MAC_COASTINGFEEDPU, sWriteValue)
|
||||
Case Params.WIPELEN
|
||||
WriteMachiningParam(nIndex, MAC_WIPELEN, sWriteValue)
|
||||
Case Params.WIPEFEEDPU
|
||||
Case Params.WIPEFEED_PC
|
||||
WriteMachiningParam(nIndex, MAC_WIPEFEEDPU, sWriteValue)
|
||||
Case Params.WIPEDIR
|
||||
WriteMachiningParam(nIndex, MAC_WIPEDIR, sWriteValue)
|
||||
Case Params.FLOORCOUNT
|
||||
WriteMachiningParam(nIndex, MAC_FLOORCOUNT, sWriteValue)
|
||||
Case Params.G0FEED
|
||||
@@ -853,18 +822,8 @@ Public Class NumericMachiningParam
|
||||
WriteMachiningParam(nIndex, MAC_RIBSOVERLAP, sWriteValue)
|
||||
Case Params.RIBSSTRANDCOUNT
|
||||
WriteMachiningParam(nIndex, MAC_RIBSSTRANDCOUNT, sWriteValue)
|
||||
Case Params.RIBSLINK
|
||||
WriteMachiningParam(nIndex, MAC_RIBSLINK, sWriteValue)
|
||||
Case Params.RIBSINVERTORDER
|
||||
WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, sWriteValue)
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, sWriteValue)
|
||||
Case Params.RIBSLEADININVERT
|
||||
WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, sWriteValue)
|
||||
Case Params.RIBSLEADINLEN
|
||||
WriteMachiningParam(nIndex, MAC_RIBSLEADINLEN, sWriteValue)
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTINVERT, sWriteValue)
|
||||
Case Params.RIBSLEADOUTLEN
|
||||
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTLEN, sWriteValue)
|
||||
Case Params.RIBSLEADOUTCOASTING
|
||||
@@ -893,6 +852,8 @@ Public Class NumericMachiningParam
|
||||
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPELEN, sWriteValue)
|
||||
Case Params.AUXSOLIDSWIPEDIR
|
||||
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPEDIR, sWriteValue)
|
||||
Case Params.FLOWRATE_PC
|
||||
WriteMachiningParam(nIndex, MAC_CONSTANT, sWriteValue)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -902,6 +863,7 @@ Public Class NumericMachiningParam
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_dValue = m_dOrigValue
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -952,6 +914,7 @@ Public Class StringMachiningParam
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_sValue = m_sOrigValue
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -990,6 +953,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
|
||||
@@ -997,6 +964,20 @@ Public Class ComboMachiningParam
|
||||
m_SelValue = Nothing
|
||||
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.DEG45, "45°")})
|
||||
If nHorizontalPrint > 0 Then
|
||||
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
|
||||
End If
|
||||
Dim nSelValue As Double = ReadMachiningParamDouble(nIndex, MAC_SLICINGTYPE, -1)
|
||||
If nSelValue = -1 Then
|
||||
Dim dSlicing45 As Double = 0
|
||||
dSlicing45 = ReadMachiningParamDouble(nIndex, MAC_SLICING45, 0)
|
||||
nSelValue = If(dSlicing45 = 0, Machining.MPAR_SLICINGTYPE.VERTICAL, Machining.MPAR_SLICINGTYPE.DEG45)
|
||||
End If
|
||||
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
|
||||
Case Params.STRANDORDER
|
||||
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_STRANDORDERS.OUTTOIN, "From Outside To Inside"),
|
||||
New IdNameStruct(Machining.MPAR_STRANDORDERS.INTOOUT, "From Inside To Outside")})
|
||||
@@ -1020,6 +1001,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"),
|
||||
@@ -1041,6 +1027,8 @@ Public Class ComboMachiningParam
|
||||
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
||||
Select Case Type
|
||||
Case Params.SLICINGTYPE
|
||||
WriteMachiningParam(nIndex, MAC_SLICINGTYPE, m_SelValue.Id)
|
||||
Case Params.STRANDORDER
|
||||
WriteMachiningParam(nIndex, MAC_STRANDORDER, m_SelValue.Id)
|
||||
Case Params.DIRECTION
|
||||
@@ -1051,6 +1039,8 @@ Public Class ComboMachiningParam
|
||||
WriteMachiningParam(nIndex, MAC_LEADIN, m_SelValue.Id)
|
||||
Case Params.LEADOUT
|
||||
WriteMachiningParam(nIndex, MAC_LEADOUT, m_SelValue.Id)
|
||||
Case Params.RIBSTYPE
|
||||
WriteMachiningParam(nIndex, MAC_RIBSTYPE, m_SelValue.Id)
|
||||
Case Params.AUXSOLIDSINFILL
|
||||
WriteMachiningParam(nIndex, MAC_AUXSOLIDSINFILL, m_SelValue.Id)
|
||||
Case Params.AUXSOLIDSSTRANDORDER
|
||||
@@ -1066,6 +1056,7 @@ Public Class ComboMachiningParam
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_SelValue = m_OrigSelValue
|
||||
NotifyPropertyChanged(NameOf(SelValue))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1097,14 +1088,28 @@ 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
|
||||
m_bValue = 0
|
||||
Else
|
||||
Select Case Type
|
||||
Case Params.SLICING45
|
||||
m_bValue = ReadMachiningParamDouble(nIndex, MAC_SLICING45, 0)
|
||||
Case Params.SPIRALVASE
|
||||
m_bValue = ReadMachiningParamDouble(nIndex, MAC_SPIRALVASE, 0)
|
||||
Case Params.RIBSLINK
|
||||
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLINK, 0)
|
||||
Case Params.RIBSINVERTORDER
|
||||
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTORDER, 0)
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTDIRECTION, 0)
|
||||
Case Params.RIBSLEADININVERT
|
||||
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADININVERT, 0)
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADOUTINVERT, 0)
|
||||
End Select
|
||||
End If
|
||||
m_bOrigValue = m_bValue
|
||||
@@ -1112,8 +1117,18 @@ Public Class CheckMachiningParam
|
||||
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
||||
Select Case Type
|
||||
Case Params.SLICING45
|
||||
WriteMachiningParam(nIndex, MAC_SLICING45, If(m_bValue, 1, 0))
|
||||
Case Params.SPIRALVASE
|
||||
WriteMachiningParam(nIndex, MAC_SPIRALVASE, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSLINK
|
||||
WriteMachiningParam(nIndex, MAC_RIBSLINK, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSINVERTORDER
|
||||
WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSLEADININVERT
|
||||
WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0))
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -1123,6 +1138,7 @@ Public Class CheckMachiningParam
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_bValue = m_bOrigValue
|
||||
NotifyPropertyChanged(NameOf(bValue))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1196,6 +1212,7 @@ Public Class MaterialMachiningParam
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_bValue = m_bOrigValue
|
||||
NotifyPropertyChanged(NameOf(bValue))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -17,44 +17,44 @@
|
||||
<UniformGrid Rows="1">
|
||||
<Button Content="New"
|
||||
Command="{Binding New_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Save"
|
||||
Command="{Binding Save_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Delete"
|
||||
Command="{Binding Delete_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
</UniformGrid>
|
||||
<ComboBox Grid.Row="1"
|
||||
Name="MachiningCombo"
|
||||
ItemsSource="{Binding MachiningList}"
|
||||
SelectedItem="{Binding SelMachining}"
|
||||
DisplayMemberPath="ghName"/>
|
||||
<Grid Grid.Row="2"
|
||||
Visibility="{Binding Name_Visibility}">
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Name_Msg}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
||||
Text="{Binding SelectedItem.sName, ElementName=MachiningCombo, UpdateSourceTrigger=Explicit}"/>
|
||||
<!--<Button Grid.Column="2"
|
||||
Content="R"
|
||||
Command="{Binding ResetParam_Command}"
|
||||
CommandParameter="dCurrStrandH"
|
||||
IsEnabled="{Binding bCurrStrandH_IsModified}"
|
||||
VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>-->
|
||||
<ComboBox Name="MachiningCombo"
|
||||
ItemsSource="{Binding MachiningList}"
|
||||
SelectedItem="{Binding SelMachining}"
|
||||
DisplayMemberPath="ghName"
|
||||
Visibility="{Binding Combo_Visibility}"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SelectedItem.sName, ElementName=MachiningCombo, UpdateSourceTrigger=Explicit}"
|
||||
IsExplicitFocused="{Binding UserShouldEditValueNow}"
|
||||
Visibility="{Binding Name_Visibility}"
|
||||
Style="{StaticResource OptionTextBox}"/>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding EditName_Command}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/TopPanel/Edit.png"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<ScrollViewer Grid.Row="3"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled">
|
||||
<ItemsControl Grid.Row="1"
|
||||
ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MachiningCombo}">
|
||||
ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MachiningCombo}"
|
||||
IsEnabled="{Binding IsEnabled}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
@@ -173,6 +173,7 @@
|
||||
<UniformGrid Grid.Row="4" Rows="1">
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
|
||||
@@ -59,10 +59,13 @@ Public Class MachiningDbVM
|
||||
Return m_Name_Visibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetNameVisibility(bValue As Boolean)
|
||||
m_Name_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(Name_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_Combo_Visibility As Visibility = Visibility.Visible
|
||||
Public ReadOnly Property Combo_Visibility As Visibility
|
||||
Get
|
||||
Return m_Combo_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' variabile che indica se una qualunque lavorazione e' stata modificata
|
||||
Private m_bIsModified As Boolean = False
|
||||
@@ -75,11 +78,39 @@ Public Class MachiningDbVM
|
||||
m_bIsModified = value
|
||||
End Sub
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
' 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
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
@@ -109,6 +140,14 @@ Public Class MachiningDbVM
|
||||
NotifyPropertyChanged(NameOf(SelMachining))
|
||||
End Sub
|
||||
|
||||
Friend Sub SetNameVisibility(bValue As Boolean)
|
||||
m_Name_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
m_Combo_Visibility = If(Not bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(Name_Visibility))
|
||||
NotifyPropertyChanged(NameOf(Combo_Visibility))
|
||||
If bValue Then SetUserShouldEditValueNow()
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -125,7 +164,7 @@ Public Class MachiningDbVM
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
If m_SelMachining.bIsModified Then
|
||||
If Not IsNothing(m_SelMachining) AndAlso m_SelMachining.bIsModified Then
|
||||
' chiedo se salvare
|
||||
Select Case MessageBox.Show("Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
|
||||
Case MessageBoxResult.Yes
|
||||
@@ -170,6 +209,11 @@ Public Class MachiningDbVM
|
||||
For Index = 0 To m_MachiningList.Count - 1
|
||||
m_MachiningList(Index).WriteParamsOnDb(Index + 1)
|
||||
Next
|
||||
m_bIsModified = False
|
||||
' aggiorno combo top
|
||||
Dim CurrSelTopMachining As MachiningIndex = Map.refTopPanelVM.SelMachining
|
||||
Map.refTopPanelVM.InitMachiningsList()
|
||||
Map.refTopPanelVM.SetSelMachining( CurrSelTopMachining)
|
||||
End If
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
@@ -211,6 +255,7 @@ Public Class MachiningDbVM
|
||||
End Property
|
||||
|
||||
Public Sub Save()
|
||||
If IsNothing( m_SelMachining) Then Return
|
||||
m_SelMachining.Save()
|
||||
End Sub
|
||||
|
||||
@@ -228,10 +273,12 @@ Public Class MachiningDbVM
|
||||
End Property
|
||||
|
||||
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)
|
||||
Case MessageBoxResult.Yes
|
||||
m_MachiningList.Remove(m_SelMachining)
|
||||
SetIsModified(True)
|
||||
Case MessageBoxResult.No
|
||||
Return
|
||||
End Select
|
||||
@@ -239,6 +286,25 @@ Public Class MachiningDbVM
|
||||
|
||||
#End Region ' Delete
|
||||
|
||||
#Region "EditName"
|
||||
|
||||
Public ReadOnly Property EditName_Command As ICommand
|
||||
Get
|
||||
If m_cmdEditName Is Nothing Then
|
||||
m_cmdEditName = New Command(AddressOf EditName)
|
||||
End If
|
||||
Return m_cmdEditName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub EditName()
|
||||
If IsNothing(m_SelMachining) Then Return
|
||||
SetNameVisibility(True)
|
||||
SetIsEnabled(False)
|
||||
End Sub
|
||||
|
||||
#End Region ' EditName
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -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, 2405, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2405, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2410, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2410, 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())
|
||||
@@ -214,6 +214,8 @@ Public Class MainWindowM
|
||||
If GetMainPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
|
||||
sMsgDir = m_sConfigDir
|
||||
End If
|
||||
' Inizializzo OptionModule
|
||||
OptionModule.InitOptionModule()
|
||||
' Leggo lingua corrente
|
||||
Dim sLanguage As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sLanguage)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,506 @@
|
||||
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)
|
||||
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)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PrintSolidEntity.nId, GeomEntityColors.c3Print)
|
||||
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)
|
||||
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)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
|
||||
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)
|
||||
' coloro l'entita' di rosso
|
||||
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
|
||||
End If
|
||||
Case ManagePart_Layer.LayerType.RIBS
|
||||
nRibsLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nRibsLayerId, LAY_RIBS)
|
||||
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)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Rib)
|
||||
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)
|
||||
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)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3ShellNumber)
|
||||
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)
|
||||
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)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3AuxSolids)
|
||||
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)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Others)
|
||||
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)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(nOtherId, GeomEntityColors.c3Others)
|
||||
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)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Others)
|
||||
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)
|
||||
|
||||
EgtDraw()
|
||||
|
||||
Case ManagePartType.MODIFY
|
||||
' nulla da fare
|
||||
End Select
|
||||
' 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)
|
||||
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
|
||||
@@ -0,0 +1,907 @@
|
||||
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()
|
||||
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)
|
||||
' elimino entity dalla lista entita' importate
|
||||
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
|
||||
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)
|
||||
'Dim bUpdateAllContextMenu As Boolean = False
|
||||
'Dim NewLayer As ManagePart_Layer = ManagePart_Part.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
|
||||
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()
|
||||
End Select
|
||||
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)
|
||||
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)
|
||||
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
|
||||
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 "Cancel"
|
||||
|
||||
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()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
End Class
|
||||
@@ -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)
|
||||
@@ -871,16 +871,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
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<UserControl x:Class="ModifyPartPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Icarus"
|
||||
Width="150"
|
||||
Margin="5,0,0,0">
|
||||
<Grid DockPanel.Dock="Left">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<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>
|
||||
<!--<DockPanel Grid.Row="1">
|
||||
<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}"/>
|
||||
<Button Content="Reference"
|
||||
Command="{Binding SetReference_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</DockPanel>-->
|
||||
<TreeView Grid.Row="2"
|
||||
ItemsSource="{Binding ModifyPartList}"
|
||||
MinHeight="300">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ModifyPart}"
|
||||
ItemsSource="{Binding LayerList}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Resources/TreeView/Folder.png"
|
||||
Height="15"/>
|
||||
<TextBlock Text="{Binding ghName}" />
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ModifyLayer}"
|
||||
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:ModifyEntity}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!--<Image Source="/WpfTutorialSamples;component/Images/user.png" Margin="0,0,5,0" />-->
|
||||
<TextBlock Text="{Binding ghName}" />
|
||||
<TextBlock Text="{Binding ghReference, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</StackPanel>
|
||||
</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="CommandParameter" 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}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
<!--<Border Grid.Row="3"
|
||||
Style="{StaticResource LeftPanelTitle_Border}">
|
||||
<TextBlock Text="Lista entità importate"
|
||||
FontWeight="DemiBold"
|
||||
FontSize="14"/>
|
||||
</Border>
|
||||
<ListBox Grid.Row="4"
|
||||
ItemsSource="{Binding ImportedEntityList, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding SelImportedEntity}"
|
||||
MinHeight="200">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid HorizontalAlignment="Stretch">
|
||||
<Grid.InputBindings>
|
||||
<MouseBinding Gesture="LeftDoubleClick"
|
||||
Command="{Binding ImportedEntity_DoubleClick}"/>
|
||||
</Grid.InputBindings>
|
||||
<TextBlock Text="{Binding ghName}">
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>-->
|
||||
<UniformGrid Grid.Row="5"
|
||||
Rows="1">
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
<!--<Button Content="Cancel"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>-->
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class ModifyPartPanelV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,407 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ModifyPartPanelVM
|
||||
Inherits VMBase
|
||||
|
||||
'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 GeomEntity)
|
||||
'Public Property ImportedEntityList As ObservableCollection(Of GeomEntity)
|
||||
' Get
|
||||
' Return m_ImportedEntityList
|
||||
' End Get
|
||||
' Set(value As ObservableCollection(Of GeomEntity))
|
||||
' m_ImportedEntityList = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
'Private m_SelImportedEntity As GeomEntity
|
||||
'Public Property SelImportedEntity As GeomEntity
|
||||
' Get
|
||||
' Return m_SelImportedEntity
|
||||
' End Get
|
||||
' Set(value As 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)
|
||||
' m_SelImportedEntity = Map.refImportPanelVM.ImportedEntityList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
' EgtDeselectAll()
|
||||
' If Not IsNothing(m_SelImportedEntity) Then
|
||||
' EgtSelectObj(m_SelImportedEntity.nId)
|
||||
' End If
|
||||
' EgtDraw()
|
||||
' NotifyPropertyChanged(NameOf(SelImportedEntity))
|
||||
'End Sub
|
||||
|
||||
Private m_ModifyPartList As New ObservableCollection(Of ModifyPart)
|
||||
Public ReadOnly Property ModifyPartList As ObservableCollection(Of ModifyPart)
|
||||
Get
|
||||
Return m_ModifyPartList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelModifyPart As ModifyPart
|
||||
Friend Sub SetSelModifyPart(SelModifyPart As ModifyPart)
|
||||
m_SelModifyPart = SelModifyPart
|
||||
m_SelModifyLayer = Nothing
|
||||
End Sub
|
||||
Public ReadOnly Property SelModifyPart As ModifyPart
|
||||
Get
|
||||
Return m_SelModifyPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelModifyLayer As ModifyLayer
|
||||
Public ReadOnly Property SelModifyLayer As ModifyLayer
|
||||
Get
|
||||
Return m_SelModifyLayer
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSelModifyLayer(SelModifyLayer As ModifyLayer)
|
||||
m_SelModifyPart = m_ModifyPartList.FirstOrDefault(Function(x) x.LayerList.Contains(SelModifyLayer))
|
||||
m_SelModifyLayer = SelModifyLayer
|
||||
End Sub
|
||||
|
||||
Private m_SelModifyEntity As ModifyEntity
|
||||
Public ReadOnly Property SelModifyEntity As ModifyEntity
|
||||
Get
|
||||
Return m_SelModifyEntity
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSelModifyEntity(SelModifyEntity As ModifyEntity)
|
||||
For Each CurrPart In m_ModifyPartList
|
||||
Dim CurrLayer As ModifyLayer = CurrPart.LayerList.FirstOrDefault(Function(x) x.EntityList.Contains(SelModifyEntity))
|
||||
If Not IsNothing(CurrLayer) Then
|
||||
m_SelModifyPart = CurrPart
|
||||
m_SelModifyLayer = CurrLayer
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
m_SelModifyEntity = SelModifyEntity
|
||||
End Sub
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in EgtCAM5Map
|
||||
Map.SetRefModifyPartPanelVM(Me)
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub Init()
|
||||
m_ModifyPartList.Clear()
|
||||
' carico pezzi in lista
|
||||
For Each PrintPart In Map.refTopPanelVM.PartList
|
||||
m_ModifyPartList.Add(New ModifyPart(PrintPart))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
'#Region "SetReference"
|
||||
|
||||
' Public ReadOnly Property SetReference_Command As ICommand
|
||||
' Get
|
||||
' If m_cmdSetReference Is Nothing Then
|
||||
' m_cmdSetReference = New Command(AddressOf SetReference)
|
||||
' End If
|
||||
' Return m_cmdSetReference
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' Public Sub SetReference()
|
||||
' If Not IsNothing(SelGeomEntity) Then
|
||||
' Dim ChooseReferenceWndVM As New ChooseReferenceWndVM
|
||||
' Dim ChooseReferenceWndV As New ChooseReferenceWndV(Application.Current.MainWindow, ChooseReferenceWndVM)
|
||||
' If Not ChooseReferenceWndV.ShowDialog() Then Return
|
||||
' SelGeomEntity.Reference = ChooseReferenceWndVM.SelReference
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
'#End Region ' SetReference
|
||||
|
||||
'#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_ImportPartList.Add(New ImportPart)
|
||||
' 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(SelImportLayer) Then
|
||||
' ' rimuovo pezzo
|
||||
' m_ImportPartList.Remove(SelImportPart)
|
||||
' Else
|
||||
' ' rimuovo geometria
|
||||
' Dim CurrEntity As GeomEntity = m_SelGeomEntity
|
||||
' SelImportLayer.EntityList.Remove(m_SelGeomEntity)
|
||||
' ' 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()
|
||||
'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_ImportPartList
|
||||
' For Each CurrLayer In CurrPart.LayerList
|
||||
' Select Case CurrLayer.Type
|
||||
' Case ImportLayer.LayerType.PRINT_SOLID
|
||||
' If CurrLayer.EntityList.Count = 0 Then
|
||||
' If sErr.Count > 0 Then sErr(sErr.Count - 1) &= Environment.NewLine
|
||||
' sErr.Add(CurrPart.ghName & " - 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 Each ImportPart In m_ImportPartList
|
||||
' 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 GeomEntity = Nothing
|
||||
' Dim nOriginalPartLayerId As Integer = GDB_ID.NULL
|
||||
' 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 ImportLayer In ImportPart.LayerList
|
||||
' Select Case ImportLayer.Type
|
||||
' Case ImportLayer.LayerType.PRINT_SOLID
|
||||
' nPrintPartLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nPrintPartLayerId, PRINT_SOLID)
|
||||
' If ImportLayer.EntityList.Count > 0 Then
|
||||
' PrintSolidEntity = ImportLayer.EntityList(0)
|
||||
' EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
|
||||
' ' calcolo box superficie per creazione riferimento
|
||||
' EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
|
||||
' End If
|
||||
' 'Case ImportLayer.LayerType.ORIGINAL_SOLID
|
||||
' ' nOriginalPartLayerId = EgtCreateGroup(nPartId)
|
||||
' ' EgtSetName(nOriginalPartLayerId, ORIGINAL_SOLID)
|
||||
' ' For Each GeomEntity In ImportLayer.EntityList
|
||||
' ' EgtRelocateGlob(GeomEntity.nId, nOriginalPartLayerId, GDB_POS.LAST_SON)
|
||||
' ' Next
|
||||
' Case ImportLayer.LayerType.MACH_START
|
||||
' nMachStartLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nMachStartLayerId, LAY_MACH_START)
|
||||
' Dim nMachStartId As Integer = GDB_ID.NULL
|
||||
' If ImportLayer.EntityList.Count > 0 Then
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' ' se punto o curva compo
|
||||
' Dim EntityType As GDB_TY = EgtGetType(GeomEntity.nId)
|
||||
' Select Case EntityType
|
||||
' Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO
|
||||
' ' gli cambio layer
|
||||
' EgtRelocateGlob(GeomEntity.nId, nMachStartLayerId, GDB_POS.LAST_SON)
|
||||
' nMachStartId = GeomEntity.nId
|
||||
' Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' ' altrimenti la trasformo in curva compo
|
||||
' nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, GeomEntity.nId, True)
|
||||
' End Select
|
||||
' EgtSetName(nMachStartId, START_GEOM)
|
||||
' ' coloro l'entita' di rosso
|
||||
' Dim c3Red As Color3d
|
||||
' c3Red.FromColor(System.Drawing.Color.Red)
|
||||
' EgtSetColor(nMachStartId, c3Red)
|
||||
' 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)
|
||||
' ' coloro l'entita' di rosso
|
||||
' Dim c3Red As Color3d
|
||||
' c3Red.FromColor(System.Drawing.Color.Red)
|
||||
' EgtSetColor(nMachStartId, c3Red)
|
||||
' End If
|
||||
' Case ImportLayer.LayerType.RIBS
|
||||
' nRibsLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nRibsLayerId, LAY_RIBS)
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' EgtSetInfo(GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
' EgtRelocateGlob(GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
|
||||
' ' coloro l'entita' di viola
|
||||
' Dim c3LightBlue As Color3d
|
||||
' c3LightBlue.FromColor(System.Drawing.Color.MediumOrchid)
|
||||
' EgtSetColor(GeomEntity.nId, c3LightBlue)
|
||||
' Next
|
||||
' Case ImportLayer.LayerType.SHELL_NUMBER
|
||||
' nShellNumberLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' EgtSetInfo(GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
|
||||
' EgtRelocateGlob(GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
|
||||
' ' coloro l'entita' di verde
|
||||
' Dim c3LightBlue As Color3d
|
||||
' c3LightBlue.FromColor(System.Drawing.Color.Lime)
|
||||
' EgtSetColor(GeomEntity.nId, c3LightBlue)
|
||||
' Next
|
||||
' Case ImportLayer.LayerType.AUX_SOLIDS
|
||||
' nAuxSolidsLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' EgtSetInfo(GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
' EgtRelocateGlob(GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
|
||||
' ' coloro l'entita' di oro
|
||||
' Dim c3LightBlue As Color3d
|
||||
' c3LightBlue.FromColor(System.Drawing.Color.DarkGoldenrod)
|
||||
' EgtSetColor(GeomEntity.nId, c3LightBlue)
|
||||
' Next
|
||||
' Case ImportLayer.LayerType.OTHERS
|
||||
' nOthersLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nOthersLayerId, LAY_OTHERS)
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
' Next
|
||||
' End Select
|
||||
' Next
|
||||
' ' aggiungo riferimento
|
||||
' Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nReferenceLayerId, LAY_REFERENCE)
|
||||
' ' Creo riferimento
|
||||
' Dim ptOrig As New Point3d(b3PrintSolid.Min())
|
||||
' Select Case PrintSolidEntity.Reference
|
||||
' Case ChooseReferenceWndVM.References.TL
|
||||
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX
|
||||
' Case ChooseReferenceWndVM.References.TR
|
||||
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.BL
|
||||
' Case ChooseReferenceWndVM.References.BR
|
||||
' ptOrig += b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.TC
|
||||
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.ML
|
||||
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX
|
||||
' Case ChooseReferenceWndVM.References.MR
|
||||
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.TC
|
||||
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.MR
|
||||
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.BC
|
||||
' ptOrig += b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.MC
|
||||
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
' End Select
|
||||
' 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, PrintSolidEntity.Reference)
|
||||
' ' 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, "PartOnTable", 1)
|
||||
' Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, 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)
|
||||
|
||||
'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()
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,435 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ModifyEntity
|
||||
Inherits VMBase
|
||||
|
||||
' layer sotto cui e' questa entita'
|
||||
Private m_OrigLayer As ModifyLayer
|
||||
Friend ReadOnly Property OrigLayer As ModifyLayer
|
||||
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.refModifyPartPanelVM.SetSelModifyEntity(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 ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ghName As String
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_MenuList As New List(Of MenuItemVm)
|
||||
Public Property MenuList As List(Of MenuItemVm)
|
||||
Get
|
||||
Return m_MenuList
|
||||
End Get
|
||||
Set(value As List(Of MenuItemVm))
|
||||
m_MenuList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(nId As Integer, sName As String, OrigLayer As ModifyLayer)
|
||||
m_nId = nId
|
||||
m_sName = sName
|
||||
m_OrigLayer = OrigLayer
|
||||
' aggiungo voci layer a contextmenu
|
||||
CreateContextMenu(OrigLayer)
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateContextMenu(OrigLayer As ModifyLayer)
|
||||
m_MenuList.Clear()
|
||||
' aggiungo voci layer a contextmenu
|
||||
CreateContextMenu(OrigLayer)
|
||||
End Sub
|
||||
|
||||
Friend Sub CreateContextMenu(OrigLayer As ModifyLayer)
|
||||
For Each ProjectPart In Map.refTopPanelVM.PartList
|
||||
' verifico in quali layer puo' andare questo elemento
|
||||
Dim EntityType As GDB_TY = EgtGetType(nId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' recupero i layer
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.MACH_START Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.MACH_START, ProjectPart))
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.OTHERS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.OTHERS, ProjectPart))
|
||||
Case GDB_TY.SRF_MESH
|
||||
' verifico se volume chiuso
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.PRINT_SOLID Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.PRINT_SOLID, ProjectPart))
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.SHELL_NUMBER Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.SHELL_NUMBER, ProjectPart))
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.AUX_SOLIDS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.AUX_SOLIDS, ProjectPart))
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.RIBS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.RIBS, ProjectPart))
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.OTHERS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.OTHERS, ProjectPart))
|
||||
End Select
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateOrigLayer(NewLayer As ModifyLayer)
|
||||
m_OrigLayer = NewLayer
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ModifyPart
|
||||
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.refModifyPartPanelVM.SetSelModifyPart(Me)
|
||||
End Set
|
||||
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
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ghName As String
|
||||
Get
|
||||
Return m_PrintPart.sImportedFileName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_LayerList As New ObservableCollection(Of ModifyLayer)
|
||||
Public ReadOnly Property LayerList As ObservableCollection(Of ModifyLayer)
|
||||
Get
|
||||
Return m_LayerList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(PrintPart As Print3dPartVM)
|
||||
m_PrintPart = PrintPart
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.PRINT_SOLID, "Print", PrintPart))
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.MACH_START, "Layer Start", PrintPart))
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.RIBS, "Ribs", PrintPart))
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.SHELL_NUMBER, "Reduce Shell Number", PrintPart))
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.AUX_SOLIDS, "Filled Solids", PrintPart))
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.OTHERS, "Others", PrintPart))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ModifyLayer
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum LayerType As Integer
|
||||
PRINT_SOLID = 1
|
||||
MACH_START = 2
|
||||
RIBS = 3
|
||||
SHELL_NUMBER = 4
|
||||
AUX_SOLIDS = 5
|
||||
OTHERS = 6
|
||||
End Enum
|
||||
|
||||
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.refModifyPartPanelVM.SetSelModifyLayer(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 ModifyEntity)
|
||||
Public Property EntityList As ObservableCollection(Of ModifyEntity)
|
||||
Get
|
||||
Return m_EntityList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of ModifyEntity))
|
||||
m_EntityList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Type As LayerType, sName As String)
|
||||
m_Type = Type
|
||||
m_sName = sName
|
||||
End Sub
|
||||
|
||||
Sub New(Type As LayerType, sName As String, PrintPart As Print3dPartVM)
|
||||
m_Type = Type
|
||||
m_sName = sName
|
||||
Select Case Type
|
||||
Case LayerType.PRINT_SOLID
|
||||
m_nLayerId = PrintPart.nPrintSolidLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
Case LayerType.MACH_START
|
||||
m_nLayerId = PrintPart.nMachStartLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
While nEntityId <> GDB_ID.NULL
|
||||
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
End While
|
||||
Case LayerType.RIBS
|
||||
m_nLayerId = PrintPart.nRibsLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
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 ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
End If
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
End While
|
||||
Case LayerType.SHELL_NUMBER
|
||||
m_nLayerId = PrintPart.nShellNumberLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
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 ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
End If
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
End While
|
||||
Case LayerType.AUX_SOLIDS
|
||||
m_nLayerId = PrintPart.nAuxSolidsLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
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 ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
'End If
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
End While
|
||||
Case LayerType.OTHERS
|
||||
m_nLayerId = PrintPart.nOthersLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
While nEntityId <> GDB_ID.NULL
|
||||
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
End While
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class MenuItemVm
|
||||
Inherits VMBase
|
||||
|
||||
' enita' di origine
|
||||
Private m_OrigEntity As ModifyEntity
|
||||
Private m_OrigLayer As ModifyLayer
|
||||
|
||||
' pezzo in cui spostare
|
||||
Private m_Part As Print3dPartVM
|
||||
|
||||
' tipo del layer indicato
|
||||
Private m_Type As ModifyLayer.LayerType
|
||||
Public Property Type As ModifyLayer.LayerType
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
Set(value As ModifyLayer.LayerType)
|
||||
m_Type = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sMsg As String
|
||||
Get
|
||||
Dim sType As String = ""
|
||||
Select Case m_Type
|
||||
Case ModifyLayer.LayerType.PRINT_SOLID
|
||||
sType = "Print"
|
||||
Case ModifyLayer.LayerType.MACH_START
|
||||
sType = "Layer Start"
|
||||
Case ModifyLayer.LayerType.RIBS
|
||||
sType = "Ribs"
|
||||
Case ModifyLayer.LayerType.SHELL_NUMBER
|
||||
sType = "Reduce shell number"
|
||||
Case ModifyLayer.LayerType.AUX_SOLIDS
|
||||
sType = "Filled Solids"
|
||||
Case ModifyLayer.LayerType.OTHERS
|
||||
sType = "Others"
|
||||
End Select
|
||||
Return "Move to " & sType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comando
|
||||
Private m_cmdCommand As ICommand
|
||||
|
||||
Sub New(OrigEntity As ModifyEntity, OrigLayer As ModifyLayer, Type As ModifyLayer.LayerType, Part As Print3dPartVM)
|
||||
m_OrigEntity = OrigEntity
|
||||
m_OrigLayer = OrigLayer
|
||||
m_Type = Type
|
||||
m_Part = Part
|
||||
End Sub
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
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()
|
||||
' recupero layer da pezzo
|
||||
Dim nLayerId As Integer = GDB_ID.NULL
|
||||
Select Case m_Type
|
||||
Case ModifyLayer.LayerType.PRINT_SOLID
|
||||
nLayerId = m_Part.nPrintSolidLayerId
|
||||
Case ModifyLayer.LayerType.MACH_START
|
||||
nLayerId = m_Part.nMachStartLayerId
|
||||
Case ModifyLayer.LayerType.RIBS
|
||||
nLayerId = m_Part.nRibsLayerId
|
||||
Case ModifyLayer.LayerType.SHELL_NUMBER
|
||||
nLayerId = m_Part.nShellNumberLayerId
|
||||
Case ModifyLayer.LayerType.AUX_SOLIDS
|
||||
nLayerId = m_Part.nAuxSolidsLayerId
|
||||
Case ModifyLayer.LayerType.OTHERS
|
||||
nLayerId = m_Part.nOthersLayerId
|
||||
End Select
|
||||
' sposto entita'
|
||||
If EgtRelocateGlob(m_OrigEntity.nId, nLayerId) Then
|
||||
' elimino info vecchio layer
|
||||
Select Case m_OrigLayer.Type
|
||||
Case ModifyLayer.LayerType.PRINT_SOLID
|
||||
EgtResetMark(m_OrigEntity.nId)
|
||||
Case ModifyLayer.LayerType.MACH_START
|
||||
Case ModifyLayer.LayerType.RIBS
|
||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
|
||||
Case ModifyLayer.LayerType.SHELL_NUMBER
|
||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE)
|
||||
Case ModifyLayer.LayerType.AUX_SOLIDS
|
||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE)
|
||||
Case ModifyLayer.LayerType.OTHERS
|
||||
End Select
|
||||
' sposto in lista
|
||||
m_OrigLayer.EntityList.Remove(m_OrigEntity)
|
||||
Dim NewPart As ModifyPart = Map.refModifyPartPanelVM.ModifyPartList.FirstOrDefault(Function(x) x.PrintPart.nPartId = m_Part.nPartId)
|
||||
If Not IsNothing(NewPart) Then
|
||||
Dim NewLayer As ModifyLayer = 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
|
||||
' aggiungo info nuovo layer
|
||||
Select Case m_Type
|
||||
Case ModifyLayer.LayerType.PRINT_SOLID
|
||||
EgtSetName(m_OrigEntity.nId, PRINT_SOLID)
|
||||
EgtSetColor(m_OrigEntity.nId, c3Print)
|
||||
Case ModifyLayer.LayerType.MACH_START
|
||||
EgtSetName(m_OrigEntity.nId, LAY_MACH_START)
|
||||
EgtSetColor(m_OrigEntity.nId, c3MachStart)
|
||||
Case ModifyLayer.LayerType.RIBS
|
||||
EgtSetName(m_OrigEntity.nId, LAY_RIBS)
|
||||
EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtSetColor(m_OrigEntity.nId, c3Rib)
|
||||
Case ModifyLayer.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 ModifyLayer.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 ModifyLayer.LayerType.OTHERS
|
||||
EgtSetName(m_OrigEntity.nId, LAY_OTHERS)
|
||||
EgtSetColor(m_OrigEntity.nId, c3Others)
|
||||
End Select
|
||||
EgtDraw()
|
||||
' aggiorno riferimenti nel context menu item
|
||||
m_OrigEntity.UpdateContextMenu(m_OrigEntity.OrigLayer)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
End Class
|
||||
@@ -60,5 +60,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.10.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.10.1")>
|
||||
<Assembly: AssemblyVersion("2.4.11.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.11.1")>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="MachineBox"
|
||||
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"
|
||||
Height="160" Width="380" WindowStyle="None" ResizeMode="NoResize"
|
||||
TitleBarHeight="30" IsResizable="False" IsMinimizable="False"
|
||||
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Border BorderThickness="2" BorderBrush="LightBlue">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.25*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="0.25*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="MessageLbl" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
<UniformGrid Grid.Column="1" Grid.Row="3" Columns="3">
|
||||
<Button Name="ReplaceBtn" Height="26" Margin="0,0,5,0"/>
|
||||
<Button Name="UpdateBtn" Height="26" Margin="5,0,5,0"/>
|
||||
<Button Name="CancelBtn" IsDefault="True" Height="26" Margin="5,0,0,0"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,45 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class MachineBox
|
||||
|
||||
Public Shadows DialogResult As MessageBoxResult = MessageBoxResult.Cancel
|
||||
|
||||
Public Sub New( Owner As Window, sMachName As String)
|
||||
|
||||
InitializeComponent()
|
||||
|
||||
Me.Owner = Owner
|
||||
|
||||
Title = EgtMsg( 6534) ' Avviso
|
||||
|
||||
MessageLbl.Text = String.Format( EgtMsg( 6528), sMachName) ' La macchina "{0}" esiste già,<br/> cosa vuoi fare ?
|
||||
|
||||
ReplaceBtn.Content = EgtMsg( 6531) ' Sostituisci
|
||||
|
||||
UpdateBtn.Content = EgtMsg( 6532) ' Aggiorna
|
||||
|
||||
CancelBtn.Content = EgtMsg( 6533) ' Annulla
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ReplaceBtn_Click( sender As Object, e As RoutedEventArgs) Handles ReplaceBtn.Click
|
||||
DialogResult = MessageBoxResult.Yes
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateBtn_Click( sender As Object, e As RoutedEventArgs) Handles UpdateBtn.Click
|
||||
DialogResult = MessageBoxResult.No
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub CancelBtn_Click( sender As Object, e As RoutedEventArgs) Handles CancelBtn.Click
|
||||
DialogResult = MessageBoxResult.Cancel
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Public Overloads Function ShowDialog() As MessageBoxResult
|
||||
MyBase.ShowDialog()
|
||||
Return DialogResult
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,113 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Friend Module OptionModule
|
||||
|
||||
' Parametri che contengono lista delle lingue disponibili e lingua selezionata
|
||||
Friend m_LanguageList As New ObservableCollection(Of Language)
|
||||
Friend m_SelectedLanguage As Language
|
||||
' Colori di sfondo della vista e della griglia
|
||||
Friend m_TopSceneBackground As Color3d
|
||||
Friend m_BotSceneBackground As Color3d
|
||||
Friend m_GridColor As Color3d
|
||||
' Flag per visualizzazione spessa delle linee
|
||||
Friend m_bThickLine As Boolean
|
||||
' Flag per visualizzazione smussata delle superfici
|
||||
Friend m_bSmoothTriMesh As Boolean
|
||||
|
||||
' Colore di default in disegno
|
||||
Friend m_DefMaterialColor As Color3d
|
||||
' Tolleranza geometrica
|
||||
Friend m_dGeometryTolerance As Double
|
||||
|
||||
' Parametri per import
|
||||
Friend m_dDxfScaleFactor As Double
|
||||
Friend m_dStlScaleFactor As Double
|
||||
Friend m_dImgScaleFactor As Double
|
||||
|
||||
' Parametri per export
|
||||
Friend m_nExportDxfFlag As Integer
|
||||
Friend m_nImgWidth As Integer
|
||||
Friend m_nImgHeight As Integer
|
||||
|
||||
' Font di testo
|
||||
Friend m_sFontText As String
|
||||
|
||||
' Parametri per le quotature
|
||||
Friend m_dExtLineLen As Double
|
||||
Friend m_dArrowLen As Double
|
||||
Friend m_dTextDist As Double
|
||||
Friend m_nLenIsMM As Integer
|
||||
Friend m_nDecDigit As Integer
|
||||
Friend m_sFont As String
|
||||
Friend m_dTextHeight As Double
|
||||
|
||||
' Variabili che indicano per ogni tipo di lavorazione quale geometria è selezionabile
|
||||
'Friend m_SelGeomSawing As SceneSelModeOpt
|
||||
'Friend m_SelGeomDrilling As SceneSelModeOpt
|
||||
'Friend m_SelGeomMilling As SceneSelModeOpt
|
||||
'Friend m_SelGeomPocketing As SceneSelModeOpt
|
||||
'Friend m_SelGeomMortising As SceneSelModeOpt
|
||||
'Friend m_SelGeomSawRoughing As SceneSelModeOpt
|
||||
'Friend m_SelGeomSawFinishing As SceneSelModeOpt
|
||||
'Friend m_SelGeomGenMachining As SceneSelModeOpt
|
||||
'Friend m_SelGeomChiseling As SceneSelModeOpt
|
||||
'Friend m_SelGeomSurfFinishing As SceneSelModeOpt
|
||||
'Friend m_SelGeomWaterJetting As SceneSelModeOpt
|
||||
' Flag per aggiungere una nuova lavorazione alla fine della fase o subito dopo la lavorazione selezionata
|
||||
Friend m_bNewMachiningIsLastOne As Boolean
|
||||
' Variabile che indica se usare lo script per calcolare automaticamente la disposizione quando si passa in lavorazione
|
||||
Friend m_bUseDispositionScript As Boolean
|
||||
|
||||
' inizializzazione lettura variabili ad inizio programma
|
||||
Friend Sub InitOptionModule()
|
||||
' Leggo elenco lingue disponibili da file ini
|
||||
Dim nIndex As Integer = 1
|
||||
'Dim ReadLanguage As Language = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
|
||||
'While Not IsNothing(ReadLanguage)
|
||||
' OptionModule.m_LanguageList.Add(ReadLanguage)
|
||||
' nIndex += 1
|
||||
' ReadLanguage = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
|
||||
'End While
|
||||
'If nIndex = 1 Then
|
||||
' EgtOutLog("Error missing languages section in Config.ini")
|
||||
' MessageBox.Show( "Error : missing languages informations", "EgtCAM5", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' End
|
||||
'End If
|
||||
'' Inizializzo la lingua corrente
|
||||
'OptionModule.m_SelectedLanguage = OptionModule.m_LanguageList(0)
|
||||
'Dim sMsgName As String = String.Empty
|
||||
'GetPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgName)
|
||||
'For Each Language In OptionModule.m_LanguageList
|
||||
' If Language.Name = sMsgName Then
|
||||
' OptionModule.m_SelectedLanguage = Language
|
||||
' Exit For
|
||||
' End If
|
||||
'Next
|
||||
' Inizializzo variabili colori di sfondo scena, griglia
|
||||
Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
|
||||
m_TopSceneBackground = BackTopColor
|
||||
Dim BackBotColor As New Color3d(BackTopColor)
|
||||
GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
|
||||
m_BotSceneBackground = BackBotColor
|
||||
Dim GridColor As New Color3d(0, 0, 0)
|
||||
GetMainPrivateProfileColor(S_GRID, K_MINLNCOLOR, GridColor)
|
||||
m_GridColor = GridColor
|
||||
' Inizializzo flag linee ingrossate
|
||||
m_bThickLine = GetMainPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1
|
||||
' Inizializzo flag visualizzazione smussata delle superfici
|
||||
m_bSmoothTriMesh = GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0
|
||||
' Inizio colore di default in disegno
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
|
||||
m_DefMaterialColor = DefColor
|
||||
' Inizializzo tolleranza geometrica
|
||||
m_dGeometryTolerance = GetMainPrivateProfileDouble(S_GEOMDB, K_SURFTMTOLER, 0.05)
|
||||
' Inizializzo variabili per import
|
||||
m_dDxfScaleFactor = GetMainPrivateProfileDouble(S_IMPORT, K_DXFSCALE, 1)
|
||||
m_dStlScaleFactor = GetMainPrivateProfileDouble(S_IMPORT, K_STLSCALE, 1)
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,303 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="OptionWindowV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Icarus="clr-namespace:Icarus"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Title="{Binding Title}" Icon="/Resources/Icarus.ico"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
MinWidth="400" MinHeight="382"
|
||||
Width="400" Height="412">
|
||||
|
||||
<!--<EgtWPFLib5:EgtCustomWindow.Resources>
|
||||
<local:GeomTypeConverter x:Key="GeomTypeConverter"/>
|
||||
</EgtWPFLib5:EgtCustomWindow.Resources>-->
|
||||
|
||||
<TabControl Margin="5,5,5,5">
|
||||
<TabItem Header="{Binding GenericMsg}">
|
||||
<StackPanel Margin="5,5,5,0">
|
||||
<!--<GroupBox Header="{Binding CurrentLanguageMsg}"
|
||||
Margin="0,0,0,5">
|
||||
<UniformGrid Rows="2" Margin="3,3,3,3">
|
||||
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
|
||||
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
|
||||
Margin="0,0,0,5"/>
|
||||
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap"
|
||||
TextAlignment="Center"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>-->
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding TopSceneBackgroundMsg}" VerticalAlignment="Center"/>
|
||||
<Button Background="{Binding TopSceneBackground}"
|
||||
Command="{Binding TopSceneBackground_Command}"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding BotSceneBackgroundMsg}" VerticalAlignment="Center"/>
|
||||
<Button Background="{Binding BotSceneBackground}"
|
||||
Command="{Binding BotSceneBackground_Command}"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding GridColorMsg}" VerticalAlignment="Center"/>
|
||||
<Button Background="{Binding GridColor}"
|
||||
Command="{Binding GridColor_Command}"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</UniformGrid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding ThickLineMsg}" VerticalAlignment="Center"
|
||||
Grid.Row="0" Margin="0,5,0,5"/>
|
||||
<CheckBox IsChecked="{Binding ThickLine}"
|
||||
Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding SmoothTriMeshMsg}" VerticalAlignment="Center"
|
||||
Grid.Row="1" Margin="0,5,0,5"/>
|
||||
<CheckBox IsChecked="{Binding SmoothTriMesh}"
|
||||
Grid.Column="1" Grid.Row="1" Margin="22,5,0,5" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<!--<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding FontMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding FontList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedTextFont}" Height="25"
|
||||
Margin="10,5,0,0"/>
|
||||
</UniformGrid>-->
|
||||
<Grid Margin="5,5,5,5">
|
||||
<Button Content="{Binding UpdateLicenceMsg}" Command="{Binding UpdateLicence_Command}" Height="26" Margin="100,1"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</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"/>
|
||||
<TextBox Text="{Binding GeometryTolerance}" Height="25"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,0,0,0"/>
|
||||
</UniformGrid>
|
||||
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
|
||||
Header="{Binding DimensionMsg}"
|
||||
Margin="0,0,0,5">
|
||||
<UniformGrid Grid.ColumnSpan="2" Columns="2">
|
||||
<TextBlock Text="{Binding ExtLineLenMsg}" VerticalAlignment="Center"/>
|
||||
<TextBox Text="{Binding ExtLineLen}" Height="25"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,5,0,0"/>
|
||||
<TextBlock Text="{Binding ArrowLenMsg}" VerticalAlignment="Center"/>
|
||||
<TextBox Text="{Binding ArrowLen}" Height="25"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,5,0,0"/>
|
||||
<TextBlock Text="{Binding TextDistMsg}" VerticalAlignment="Center"/>
|
||||
<TextBox Text="{Binding TextDist}" Height="25"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,5,0,0"/>
|
||||
<TextBlock Text="{Binding LenIsMMMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedUnitMeasure}" Height="25"
|
||||
Margin="10,5,0,0"/>
|
||||
<TextBlock Text="{Binding DecDigitMsg}" VerticalAlignment="Center"/>
|
||||
<TextBox Text="{Binding DecDigit}" Height="25"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,5,0,0"/>
|
||||
<TextBlock Text="{Binding FontMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding FontList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedFont}" Height="25"
|
||||
Margin="10,5,0,0"/>
|
||||
<TextBlock Text="{Binding TextHeightMsg}" VerticalAlignment="Center"/>
|
||||
<TextBox Text="{Binding TextHeight}" Height="25"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,5,0,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>-->
|
||||
</StackPanel>
|
||||
|
||||
</TabItem>
|
||||
<TabItem Header="{Binding ImportMsg}">
|
||||
<StackPanel Margin="5,5,5,0">
|
||||
<Grid Margin="0,5,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.8*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Text="{Binding UnitScaleMsg}" />
|
||||
<TextBlock Grid.Row="0" Grid.Column="2"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Text="{Binding FactorScaleMsg}"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0"
|
||||
Text="{Binding DxfScaleFactorMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox Grid.Row="1" Grid.Column="1"
|
||||
ItemsSource="{Binding ScaleDXFList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedDXFScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
|
||||
Margin="10,0,0,5"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="2"
|
||||
Text="{Binding DxfScaleFactor}" Height="25"
|
||||
IsEnabled="{Binding DXFScaleEnable, UpdateSourceTrigger=LostFocus}"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,0,0,5"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0"
|
||||
Text="{Binding StlScaleFactorMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox Grid.Row="2" Grid.Column="1"
|
||||
ItemsSource="{Binding ScaleSTLList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedSTLScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
|
||||
Margin="10,0,0,5"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="2"
|
||||
Text="{Binding StlScaleFactor}" Height="25"
|
||||
IsEnabled="{Binding STLScaleEnable, UpdateSourceTrigger=LostFocus}"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,0,0,5"/>
|
||||
<!--<TextBlock Grid.Row="3" Grid.Column="0"
|
||||
Text="{Binding ImageScaleFactorMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox Grid.Row="3" Grid.Column="1"
|
||||
ItemsSource="{Binding ScaleImageList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedImageScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
|
||||
Margin="10,0,0,5"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="2"
|
||||
Text="{Binding ImageScaleFactor}" Height="25"
|
||||
IsEnabled="{Binding ImageScaleEnable, UpdateSourceTrigger=LostFocus}"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,0,0,5"/>-->
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<!--<TabItem Header="{Binding ExportMsg}">
|
||||
<StackPanel>
|
||||
<GroupBox Grid.Column="1" Grid.RowSpan="2"
|
||||
Header="{Binding ImageMsg}"
|
||||
Margin="5,5,5,0">
|
||||
<UniformGrid Grid.ColumnSpan="2" Columns="2">
|
||||
<TextBlock Text="{Binding ImageWidthMsg}" VerticalAlignment="Center"/>
|
||||
<TextBox Text="{Binding ImageWidth}" Height="25"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,0,0,5"/>
|
||||
<TextBlock Text="{Binding ImageHeightMsg}" VerticalAlignment="Center"/>
|
||||
<TextBox Text="{Binding ImageHeight}" Height="25"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,0,0,5"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</TabItem>-->
|
||||
<TabItem Header="{Binding CAMMsg}">
|
||||
<StackPanel>
|
||||
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
|
||||
Header="{Binding MachiningSelGeomMsg}"
|
||||
Margin="5,5,5,0">
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="{Binding GeomTypeDrillingMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedDrillingGeomType}" Height="25">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBlock Text="{Binding GeomTypeSawingMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedSawingGeomType}" Height="25">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBlock Text="{Binding GeomTypeMillingMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedMillingGeomType}" Height="25"
|
||||
Margin="0,0,0,5">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBlock Text="{Binding GeomTypePocketingMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedPocketingGeomType}" Height="25">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBlock Text="{Binding GeomTypeMortisingMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedMortisingGeomType}" Height="25">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBlock Text="{Binding GeomTypeChiselingMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedChiselingGeomType}" Height="25">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</UniformGrid>
|
||||
</GroupBox>-->
|
||||
|
||||
<!--<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding NewMachiningPosMsg}" VerticalAlignment="Center"
|
||||
Grid.Row="0" Margin="0,0,0,5"/>
|
||||
<CheckBox IsChecked="{Binding NewMachiningIsLastOne}"
|
||||
Grid.Column="1" Grid.Row="0" Margin="4,0,0,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding UseDispositionScriptMsg}" VerticalAlignment="Center"
|
||||
Grid.Row="1" Margin="0,0,0,5"/>
|
||||
<CheckBox IsChecked="{Binding UseDispositionScript}"
|
||||
Grid.Column="1" Grid.Row="1" Margin="4,0,0,0" VerticalAlignment="Center"/>
|
||||
</Grid>-->
|
||||
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,1"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class OptionWindowV
|
||||
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
@@ -334,10 +337,10 @@ Public Class ProjManagerVM
|
||||
''' Execute the Export. This method is invoked by the ExportCommand.
|
||||
''' </summary>
|
||||
Public Sub Options(ByVal param As Object)
|
||||
'Dim OptionsWindow As New OptionWindowV
|
||||
'OptionsWindow.DataContext = New OptionWindowVM
|
||||
'OptionsWindow.Owner = Application.Current.MainWindow
|
||||
'OptionsWindow.ShowDialog()
|
||||
Dim OptionsWindow As New OptionWindowV
|
||||
OptionsWindow.DataContext = New OptionWindowVM
|
||||
OptionsWindow.Owner = Application.Current.MainWindow
|
||||
OptionsWindow.ShowDialog()
|
||||
End Sub
|
||||
|
||||
#End Region ' Options
|
||||
|
||||
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 |
+302
-19
@@ -1,22 +1,71 @@
|
||||
<StackPanel x:Class="RibPanelV"
|
||||
<Grid x:Class="RibPanelV"
|
||||
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"
|
||||
xmlns:PrintApp="clr-namespace:Icarus"
|
||||
Margin="5">
|
||||
<StackPanel.Resources>
|
||||
<Grid.Resources>
|
||||
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
|
||||
</StackPanel.Resources>
|
||||
<ComboBox ItemsSource="{Binding RibList}"
|
||||
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ComboBox Grid.Row="3"
|
||||
ItemsSource="{Binding RibList}"
|
||||
SelectedItem="{Binding SelRib}"
|
||||
IsEnabled="{Binding RibList_IsEnabled}"
|
||||
DisplayMemberPath="ghName"/>
|
||||
DisplayMemberPath="ghName"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<!--Add Button-->
|
||||
<ToggleButton x:Name="AddBtn"
|
||||
Grid.Row="4"
|
||||
Content="Add"
|
||||
IsChecked="{Binding bAdd_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=AddBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
Grid.RowSpan="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=AddBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0"
|
||||
Command="{Binding Import_Command}"
|
||||
ToolTip="{Binding Import_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding Line2P_Command}"
|
||||
ToolTip="{Binding Line2P_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Line2P.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=AddBtn}"
|
||||
PlacementTarget="{Binding ElementName=AddBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -39,13 +88,68 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<!--Edit Button-->
|
||||
<ToggleButton x:Name="EditBtn"
|
||||
Grid.Row="5"
|
||||
Content="Edit"
|
||||
IsChecked="{Binding bEdit_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=EditBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="4"
|
||||
Grid.RowSpan="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=EditBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0"
|
||||
Command="{Binding Delete_Command}"
|
||||
ToolTip="{Binding Delete_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Delete.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding ModifyCurve_Command}"
|
||||
ToolTip="{Binding ModifyCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/ModifyCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
Command="{Binding AddPointCurve_Command}"
|
||||
ToolTip="{Binding AddPointCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/AddPointCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3"
|
||||
Command="{Binding RemovePointCurve_Command}"
|
||||
ToolTip="{Binding RemovePointCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/RemovePointCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="4"
|
||||
Command="{Binding Extrude_Command}"
|
||||
ToolTip="{Binding Extrude_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Extrude.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=EditBtn}"
|
||||
PlacementTarget="{Binding ElementName=EditBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -96,13 +200,90 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<!--Grid Button-->
|
||||
<ToggleButton x:Name="GridBtn"
|
||||
Grid.Row="6"
|
||||
Content="Grid"
|
||||
IsChecked="{Binding bGrid_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=GridBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
Grid.RowSpan="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=GridBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Command="{Binding CPlaneTop_Command}"
|
||||
ToolTip="{Binding CPlaneTopToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneTOP.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding CPlaneFront_Command}"
|
||||
ToolTip="{Binding CPlaneFrontToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneFRONT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
Command="{Binding CPlaneRight_Command}"
|
||||
ToolTip="{Binding CPlaneRightToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneRIGHT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3"
|
||||
Command="{Binding CPlaneBack_Command}"
|
||||
ToolTip="{Binding CPlaneBackToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneBACK.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="4"
|
||||
Command="{Binding CPlaneLeft_Command}"
|
||||
ToolTip="{Binding CPlaneLeftToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneLEFT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="5"
|
||||
Command="{Binding CPlaneBottom_Command}"
|
||||
ToolTip="{Binding CPlaneBottomToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneBOTTOM.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="6"
|
||||
Command="{Binding CPlaneElevation_Command}"
|
||||
ToolTip="{Binding CPlaneElevationToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneELEVATION.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="7"
|
||||
Command="{Binding CPlaneOrigin_Command}"
|
||||
ToolTip="{Binding CPlaneOriginToolTip}"
|
||||
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}"
|
||||
PlacementTarget="{Binding ElementName=GridBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -179,21 +360,82 @@
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CPlanePERPCURVE.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<!--<Button Grid.Column="10"
|
||||
--><!--<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>
|
||||
</Popup>-->
|
||||
<!--Move Button-->
|
||||
<ToggleButton x:Name="MoveBtn"
|
||||
<ToggleButton x:Name="MoveBtn"
|
||||
Grid.Row="7"
|
||||
Content="Move"
|
||||
IsChecked="{Binding bMove_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=MoveBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
Grid.RowSpan="5"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=MoveBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="0,0,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="X"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,2.5,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Y"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,2.5,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Z"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Drag"
|
||||
Command="{Binding DragMove_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=MoveBtn}"
|
||||
PlacementTarget="{Binding ElementName=MoveBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -250,12 +492,52 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<ToggleButton x:Name="RotateBtn"
|
||||
Grid.Row="8"
|
||||
Content="Rotate"
|
||||
IsChecked="{Binding bRotate_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=RotateBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="6"
|
||||
Grid.RowSpan="5"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=RotateBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<UniformGrid Columns="3">
|
||||
<RadioButton Content="X"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[0]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
<RadioButton Content="Y"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[1]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
<RadioButton Content="Z"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[2]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
</UniformGrid>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Row="1"
|
||||
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
|
||||
Margin="0,5,0,0"/>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Drag"
|
||||
Command="{Binding DragRotate_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=RotateBtn}"
|
||||
Grid.Column="1"
|
||||
PlacementTarget="{Binding ElementName=RotateBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
@@ -292,9 +574,10 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<ToggleButton Content="Parameters"
|
||||
Grid.Row="9"
|
||||
IsChecked="{Binding bMachParam_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -612,7 +612,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 +1128,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 +1161,15 @@ 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
|
||||
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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -41,12 +41,13 @@ 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.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 +71,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 +337,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_RIBSOVERLAP, 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
|
||||
|
||||
@@ -187,12 +187,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 +210,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 +226,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
|
||||
@@ -307,6 +308,8 @@ Public Class MySceneHostVM
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
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" &
|
||||
@@ -314,11 +317,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
|
||||
@@ -343,6 +347,7 @@ Public Class MySceneHostVM
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
If Not Directory.Exists(sDir) Then sDir = ""
|
||||
Dim OpenFileDialog As New OpenFileDialog With {.Title = "Insert",
|
||||
.Filter = "Stereolithography (*.stl)|*.stl" &
|
||||
"|Iges files (*.igs;*.iges)|*.igs;*.iges" &
|
||||
@@ -415,6 +420,7 @@ Public Class MySceneHostVM
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
If Not Directory.Exists(sDir) Then sDir = ""
|
||||
Dim OpenFileDialog As New OpenFileDialog With {.Title = "Insert",
|
||||
.Filter = "Stereolithography (*.stl)|*.stl" &
|
||||
"|Iges files (*.igs;*.iges)|*.igs;*.iges" &
|
||||
@@ -839,9 +845,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
|
||||
@@ -860,6 +873,37 @@ Public Class MySceneHostVM
|
||||
End If
|
||||
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
|
||||
End If
|
||||
' 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
|
||||
Dim ProjectMaterial As MaterialIndex = Nothing
|
||||
If Guid.TryParse(sMaterialGuid, MaterialGuid) Then
|
||||
' cerco materiale in lista
|
||||
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)
|
||||
ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sName = sMaterialName)
|
||||
End If
|
||||
If Not IsNothing(ProjectMaterial) Then
|
||||
Map.refTopPanelVM.SetSelMaterial(ProjectMaterial, True)
|
||||
Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.SelMaterial))
|
||||
End If
|
||||
End If
|
||||
' leggo pezzi
|
||||
Map.refTopPanelVM.PartList.Clear()
|
||||
Dim bProjectToRecalc As Boolean = False
|
||||
@@ -872,16 +916,16 @@ 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)
|
||||
Dim nMachStartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_MACH_START)
|
||||
Dim nOthersLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_OTHERS)
|
||||
Dim sFilePath As String = ""
|
||||
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, 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)
|
||||
@@ -901,9 +945,14 @@ Public Class MySceneHostVM
|
||||
Map.refSliceManagerVM.UpdateTimeAndMass()
|
||||
End If
|
||||
|
||||
Map.refSliderManagerVM.SetLayerIndexToMax()
|
||||
|
||||
' seleziono primo pezzo trovato
|
||||
Map.refTopPanelVM.SelFirstPart()
|
||||
|
||||
' resetto calcolo solidi
|
||||
Map.refViewLayerManagerVM.ResetSolid()
|
||||
|
||||
' imposto modalita' modifica
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
|
||||
@@ -1127,7 +1176,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
|
||||
@@ -1177,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
|
||||
@@ -1196,19 +1245,35 @@ 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 nPartId As Integer = EgtGetParent(nId)
|
||||
Dim bFound As Boolean = False
|
||||
If nPartId = Map.refStartMachPanelVM.nStartMachLayerId Then bFound = True
|
||||
If bFound Then
|
||||
m_nIdToSel = nId
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
' Memorizzo Id da selezionare
|
||||
m_nIdToSel = nId
|
||||
Exit While
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
If 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
|
||||
@@ -1229,10 +1294,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
|
||||
@@ -1252,19 +1329,35 @@ 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
|
||||
' 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 bFound Then
|
||||
m_nIdToSel = nId
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
' Memorizzo Id da selezionare
|
||||
m_nIdToSel = nId
|
||||
Exit While
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
If 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
|
||||
@@ -1285,10 +1378,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
|
||||
@@ -1302,6 +1407,7 @@ 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
|
||||
@@ -1312,15 +1418,23 @@ Public Class MySceneHostVM
|
||||
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
|
||||
If bFound Then
|
||||
m_nIdToSel = nId
|
||||
Exit While
|
||||
End If
|
||||
' Memorizzo Id da selezionare
|
||||
m_nIdToSel = nId
|
||||
Exit While
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
If 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
|
||||
@@ -1341,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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,22 +1,71 @@
|
||||
<StackPanel x:Class="ShellNumberPanelV"
|
||||
<Grid x:Class="ShellNumberPanelV"
|
||||
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"
|
||||
xmlns:PrintApp="clr-namespace:Icarus"
|
||||
Margin="5">
|
||||
<StackPanel.Resources>
|
||||
<Grid.Resources>
|
||||
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
|
||||
</StackPanel.Resources>
|
||||
<ComboBox ItemsSource="{Binding ShellNumberList}"
|
||||
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ComboBox Grid.Row="3"
|
||||
ItemsSource="{Binding ShellNumberList}"
|
||||
SelectedItem="{Binding SelShellNumber}"
|
||||
IsEnabled="{Binding ShellNumberList_IsEnabled}"
|
||||
DisplayMemberPath="ghName"/>
|
||||
DisplayMemberPath="ghName"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<!--Add Button-->
|
||||
<ToggleButton x:Name="AddBtn"
|
||||
Grid.Row="4"
|
||||
Content="Add"
|
||||
IsChecked="{Binding bAdd_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=AddBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
Grid.RowSpan="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=AddBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0"
|
||||
Command="{Binding Import_Command}"
|
||||
ToolTip="{Binding Import_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding Line2P_Command}"
|
||||
ToolTip="{Binding Line2P_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Line2P.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=AddBtn}"
|
||||
PlacementTarget="{Binding ElementName=AddBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -39,13 +88,68 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<!--Edit Button-->
|
||||
<ToggleButton x:Name="EditBtn"
|
||||
Grid.Row="5"
|
||||
Content="Edit"
|
||||
IsChecked="{Binding bEdit_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=EditBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="4"
|
||||
Grid.RowSpan="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=EditBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0"
|
||||
Command="{Binding Delete_Command}"
|
||||
ToolTip="{Binding Delete_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Delete.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding ModifyCurve_Command}"
|
||||
ToolTip="{Binding ModifyCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/ModifyCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
Command="{Binding AddPointCurve_Command}"
|
||||
ToolTip="{Binding AddPointCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/AddPointCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3"
|
||||
Command="{Binding RemovePointCurve_Command}"
|
||||
ToolTip="{Binding RemovePointCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/RemovePointCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="4"
|
||||
Command="{Binding Extrude_Command}"
|
||||
ToolTip="{Binding Extrude_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Extrude.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=EditBtn}"
|
||||
PlacementTarget="{Binding ElementName=EditBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -96,13 +200,90 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<!--Grid Button-->
|
||||
<ToggleButton x:Name="GridBtn"
|
||||
Grid.Row="6"
|
||||
Content="Grid"
|
||||
IsChecked="{Binding bGrid_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=GridBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
Grid.RowSpan="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=GridBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Command="{Binding CPlaneTop_Command}"
|
||||
ToolTip="{Binding CPlaneTopToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneTOP.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding CPlaneFront_Command}"
|
||||
ToolTip="{Binding CPlaneFrontToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneFRONT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
Command="{Binding CPlaneRight_Command}"
|
||||
ToolTip="{Binding CPlaneRightToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneRIGHT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3"
|
||||
Command="{Binding CPlaneBack_Command}"
|
||||
ToolTip="{Binding CPlaneBackToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneBACK.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="4"
|
||||
Command="{Binding CPlaneLeft_Command}"
|
||||
ToolTip="{Binding CPlaneLeftToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneLEFT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="5"
|
||||
Command="{Binding CPlaneBottom_Command}"
|
||||
ToolTip="{Binding CPlaneBottomToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneBOTTOM.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="6"
|
||||
Command="{Binding CPlaneElevation_Command}"
|
||||
ToolTip="{Binding CPlaneElevationToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneELEVATION.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="7"
|
||||
Command="{Binding CPlaneOrigin_Command}"
|
||||
ToolTip="{Binding CPlaneOriginToolTip}"
|
||||
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}"
|
||||
PlacementTarget="{Binding ElementName=GridBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -179,21 +360,82 @@
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CPlanePERPCURVE.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<!--<Button Grid.Column="10"
|
||||
--><!--<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>
|
||||
</Popup>-->
|
||||
<!--Move Button-->
|
||||
<ToggleButton x:Name="MoveBtn"
|
||||
Grid.Row="7"
|
||||
Content="Move"
|
||||
IsChecked="{Binding bMove_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=MoveBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
Grid.RowSpan="5"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=MoveBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="0,0,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="X"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,2.5,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Y"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,2.5,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Z"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Drag"
|
||||
Command="{Binding DragMove_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=MoveBtn}"
|
||||
PlacementTarget="{Binding ElementName=MoveBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -250,12 +492,52 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<ToggleButton x:Name="RotateBtn"
|
||||
Grid.Row="8"
|
||||
Content="Rotate"
|
||||
IsChecked="{Binding bRotate_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=RotateBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="6"
|
||||
Grid.RowSpan="5"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=RotateBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<UniformGrid Columns="3">
|
||||
<RadioButton Content="X"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[0]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
<RadioButton Content="Y"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[1]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
<RadioButton Content="Z"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[2]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
</UniformGrid>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Row="1"
|
||||
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
|
||||
Margin="0,5,0,0"/>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Drag"
|
||||
Command="{Binding DragRotate_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=RotateBtn}"
|
||||
Grid.Column="1"
|
||||
PlacementTarget="{Binding ElementName=RotateBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
@@ -292,9 +574,10 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<ToggleButton Content="Parameters"
|
||||
Grid.Row="9"
|
||||
IsChecked="{Binding bMachParam_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -1173,7 +1173,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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<UserControl x:Class="SliceManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Width="260">
|
||||
Width="320">
|
||||
<Border VerticalAlignment="Bottom"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
@@ -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}"
|
||||
@@ -44,6 +44,11 @@
|
||||
Style="{StaticResource ToolBar_TextButton}"
|
||||
IsEnabled="{Binding Buttons_IsEnabled}"
|
||||
Visibility="{Binding ModifyMode_Visibility}"/>
|
||||
<Button Content="Update"
|
||||
Command="{Binding Update_Command}"
|
||||
Style="{StaticResource ToolBar_TextButton}"
|
||||
IsEnabled="{Binding Buttons_IsEnabled}"
|
||||
Visibility="{Binding SliceMode_Visibility}"/>
|
||||
<Button Content="Generate"
|
||||
Command="{Binding Generate_Command}"
|
||||
Style="{StaticResource ToolBar_TextButton}"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
Imports Microsoft.Win32
|
||||
Imports System.IO
|
||||
|
||||
Public Class SliceManagerVM
|
||||
Inherits VMBase
|
||||
@@ -124,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
|
||||
@@ -158,6 +166,7 @@ Public Class SliceManagerVM
|
||||
' Definizione comandi
|
||||
Private m_cmdSlice As ICommand
|
||||
Private m_cmdSimulate As ICommand
|
||||
Private m_cmdUpdate As ICommand
|
||||
Private m_cmdGenerate As ICommand
|
||||
Private m_cmdExit As ICommand
|
||||
|
||||
@@ -200,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
|
||||
@@ -278,10 +287,18 @@ Public Class SliceManagerVM
|
||||
Return 0
|
||||
End Function
|
||||
|
||||
Friend Function CalcSlice(bSlice As Boolean, bCalcTFS As Boolean, bGenerate As Boolean) As Boolean
|
||||
m_bSlice = bSlice
|
||||
m_bCalcTFS = bCalcTFS
|
||||
m_bGenerate = bGenerate
|
||||
Friend Function CalcSlice(bGenerate As Boolean, Optional bForceGenerate As Boolean = False) As Boolean
|
||||
' Verifico nome progetto
|
||||
Dim sCurrProject As String = String.Empty
|
||||
EgtGetCurrFilePath(sCurrProject)
|
||||
If String.IsNullOrWhiteSpace(sCurrProject) Or EgtGetFileType(sCurrProject) <> FT.NGE Then
|
||||
Map.refSceneHostVM.SaveAsProject()
|
||||
End If
|
||||
EgtGetCurrFilePath(sCurrProject)
|
||||
If String.IsNullOrWhiteSpace(sCurrProject) Or EgtGetFileType(sCurrProject) <> FT.NGE Then
|
||||
MessageBox.Show("Save project before calculating slices!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
' mostro barre di caricamento
|
||||
SetLoadingVisibility(True)
|
||||
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
@@ -293,44 +310,58 @@ Public Class SliceManagerVM
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
|
||||
SetButtonsIsEnabled(False)
|
||||
' verifico se eseguire slice
|
||||
m_bSlice = False
|
||||
m_bCalcTFS = False
|
||||
m_bGenerate = bGenerate
|
||||
Dim bOk As Boolean = True
|
||||
Dim bToRecalcSlice As Boolean = False
|
||||
Dim bToRecalcTFS As Boolean = False
|
||||
Dim bToRecalcGenerate As Boolean = False
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim bTemp As Boolean = False
|
||||
If EgtGetInfo(nPartId, MAC_TORECALC_SLICE, bTemp) AndAlso bTemp Then
|
||||
bToRecalcSlice = True
|
||||
End If
|
||||
If EgtGetInfo(nPartId, MAC_TORECALC_GENERATE, bTemp) AndAlso bTemp Then
|
||||
If EgtGetInfo(nPartId, MAC_TORECALC_TFS, bTemp) AndAlso bTemp Then
|
||||
bToRecalcTFS = True
|
||||
End If
|
||||
If EgtGetInfo(nPartId, MAC_TORECALC_GENERATE, bTemp) AndAlso bTemp Then
|
||||
bToRecalcGenerate = True
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
If bToRecalcSlice Then
|
||||
m_bSlice = True
|
||||
m_bCalcTFS = True
|
||||
m_bGenerate = True
|
||||
m_bGenerate = bForceGenerate OrElse (bGenerate AndAlso bToRecalcGenerate)
|
||||
Else
|
||||
m_bSlice = False
|
||||
m_bCalcTFS = bToRecalcTFS
|
||||
m_bGenerate = bToRecalcTFS
|
||||
m_bGenerate = bForceGenerate OrElse (bGenerate AndAlso bToRecalcGenerate)
|
||||
End If
|
||||
' aggiorno dati macchina
|
||||
If m_bSlice OrElse m_bCalcTFS Then
|
||||
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()
|
||||
' eseguo calcolo slicing, toolpath e solidi
|
||||
bOk = ExecSlice(m_bSlice, m_bCalcTFS)
|
||||
' se calcolo andato a buon fine, rimuovo flag richiesta ricalcolo
|
||||
' se calcolo andato a buon fine
|
||||
If bOk Then
|
||||
' rimuovo flag richiesta ricalcolo
|
||||
Dim nCurrPartId As Integer = EgtGetFirstPart()
|
||||
While nCurrPartId <> GDB_ID.NULL
|
||||
' eseguo rimozione flag
|
||||
EgtRemoveInfo(nPartId, MAC_TORECALC_SLICE)
|
||||
If m_bSlice Then EgtRemoveInfo(nCurrPartId, MAC_TORECALC_SLICE)
|
||||
If m_bCalcTFS Then EgtRemoveInfo(nCurrPartId, MAC_TORECALC_TFS)
|
||||
nCurrPartId = EgtGetNextPart(nCurrPartId)
|
||||
End While
|
||||
End If
|
||||
' aggiorno massa
|
||||
If bOk Then
|
||||
' aggiorno massa
|
||||
Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
|
||||
EgtGetInfo(nLayTFSCalcId, KEY_MASS, m_dMass)
|
||||
NotifyPropertyChanged(NameOf(ghMass))
|
||||
@@ -351,8 +382,6 @@ Public Class SliceManagerVM
|
||||
NotifyPropertyChanged(NameOf(ghTime))
|
||||
Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
|
||||
EgtSetInfo(nLayTFSCalcId, "Ttot", m_dTime)
|
||||
'' eseguo script di uscita da machgroup corrente
|
||||
'ExecExitMachScript()
|
||||
' se calcolo andato a buon fine, rimuovo flag richiesta ricalcolo
|
||||
If bOk Then
|
||||
Dim nCurrPartId As Integer = EgtGetFirstPart()
|
||||
@@ -477,7 +506,7 @@ Public Class SliceManagerVM
|
||||
m_bCalculating = False
|
||||
Return
|
||||
End If
|
||||
If IsNothing(Map.refTopPanelVM.SelMachining) Then
|
||||
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
|
||||
Return
|
||||
@@ -485,15 +514,45 @@ Public Class SliceManagerVM
|
||||
' esco da altre pagine
|
||||
Map.refTopPanelVM.SelPage = Pages.NULL
|
||||
' eseguo calcoli
|
||||
CalcSlice(True, True, True)
|
||||
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
|
||||
|
||||
#End Region ' Slice
|
||||
|
||||
#Region "Update"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do CPlaneTop.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Update_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
|
||||
''' </summary>
|
||||
Public Sub Update()
|
||||
If m_bCalculating Then Return
|
||||
m_bCalculating = True
|
||||
' eseguo calcoli
|
||||
CalcSlice(False)
|
||||
NotifyPropertyChanged(NameOf(Time_Visibility))
|
||||
NotifyPropertyChanged(NameOf(Mass_Visibility))
|
||||
m_bCalculating = False
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#Region "Generate"
|
||||
|
||||
''' <summary>
|
||||
@@ -514,8 +573,63 @@ Public Class SliceManagerVM
|
||||
Public Sub Generate()
|
||||
If m_bCalculating Then Return
|
||||
m_bCalculating = True
|
||||
Dim bShiftPressed As Boolean = (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift
|
||||
Dim bCtrlPressed As Boolean = (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control
|
||||
' se shift chiedo nome
|
||||
Dim sIsoFilePath As String = ""
|
||||
Dim sExtension As String = ""
|
||||
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "", sExtension, CurrentMachine.sMachIniFile)
|
||||
If String.IsNullOrWhiteSpace(sExtension) Then
|
||||
sExtension = ".cnc"
|
||||
End If
|
||||
If bShiftPressed Then
|
||||
Dim sCurrFilePath As String = ""
|
||||
Dim sInitialDirectory As String = ""
|
||||
EgtGetCurrFilePath(sCurrFilePath)
|
||||
If Not IsNothing(sCurrFilePath) Then
|
||||
sInitialDirectory = System.IO.Path.ChangeExtension(sCurrFilePath, sExtension)
|
||||
End If
|
||||
Dim NewSaveFileDialog As New Windows.Forms.SaveFileDialog With {.Title = "ISO File Name",
|
||||
.Filter = "|*" & sExtension,
|
||||
.FilterIndex = 1,
|
||||
.InitialDirectory = System.IO.Path.GetDirectoryName(sInitialDirectory),
|
||||
.FileName = sInitialDirectory,
|
||||
.CreatePrompt = True,
|
||||
.OverwritePrompt = True,
|
||||
.ValidateNames = False}
|
||||
Dim bResult As Boolean? = NewSaveFileDialog.ShowDialog()
|
||||
If IsNothing(bResult) OrElse Not bResult Then
|
||||
m_bCalculating = False
|
||||
Return
|
||||
End If
|
||||
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
|
||||
If nTabPartId <> GDB_ID.NULL Then
|
||||
EgtSetInfo(nTabPartId, KEY_ISOFILE_PATH, NewSaveFileDialog.FileName)
|
||||
sIsoFilePath = NewSaveFileDialog.FileName
|
||||
End If
|
||||
Else
|
||||
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
|
||||
EgtGetCurrFilePath(sIsoFilePath)
|
||||
sIsoFilePath = System.IO.Path.ChangeExtension(sIsoFilePath, sExtension)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' eseguo calcoli
|
||||
CalcSlice(True, True, True)
|
||||
CalcSlice(True, True)
|
||||
If bCtrlPressed Then
|
||||
' Se esiste ne lancio l'editing
|
||||
If File.Exists(sIsoFilePath) Then
|
||||
Process.Start("Notepad.exe", sIsoFilePath)
|
||||
' altrimenti lo segnalo
|
||||
Else
|
||||
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
|
||||
|
||||
@@ -539,6 +653,10 @@ Public Class SliceManagerVM
|
||||
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
|
||||
''' </summary>
|
||||
Public Sub Simulate()
|
||||
m_bCalculating = True
|
||||
' eseguo calcoli
|
||||
CalcSlice(True)
|
||||
m_bCalculating = False
|
||||
' verifico esistenza e correttezza machgroup
|
||||
InitMachGroup(False)
|
||||
' apro simulazione
|
||||
|
||||
@@ -123,7 +123,7 @@ Public Class SliderManagerVM
|
||||
Get
|
||||
Dim dH As Double = 0
|
||||
If Not IsNothing(Map.refTopPanelVM.CurrMachining) Then
|
||||
If Map.refTopPanelVM.CurrMachining.bCurrSlicing45 Then
|
||||
If Map.refTopPanelVM.CurrMachining.dCurrSlicingType = Machining.MPAR_SLICINGTYPE.DEG45 Then
|
||||
Return m_nLayerIndex
|
||||
Else
|
||||
Return m_nLayerIndex & " (" & DoubleToString(m_nLayerIndex * Map.refTopPanelVM.CurrMachining.dCurrStrandH, 0) & "mm)"
|
||||
@@ -138,7 +138,7 @@ Public Class SliderManagerVM
|
||||
Get
|
||||
Dim dH As Double = 0
|
||||
If Not IsNothing(Map.refTopPanelVM.CurrMachining) Then
|
||||
If Map.refTopPanelVM.CurrMachining.bCurrSlicing45 Then
|
||||
If Map.refTopPanelVM.CurrMachining.dCurrSlicingType = Machining.MPAR_SLICINGTYPE.DEG45 Then
|
||||
Return m_nLayerIndex_Maximum
|
||||
Else
|
||||
Return m_nLayerIndex_Maximum & " (" & DoubleToString(m_nLayerIndex_Maximum * Map.refTopPanelVM.CurrMachining.dCurrStrandH, 0) & "mm)"
|
||||
|
||||
@@ -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>
|
||||
@@ -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
|
||||
@@ -1,21 +1,68 @@
|
||||
<StackPanel x:Class="StartMachPanelV"
|
||||
<Grid x:Class="StartMachPanelV"
|
||||
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"
|
||||
xmlns:PrintApp="clr-namespace:Icarus"
|
||||
Margin="5">
|
||||
<StackPanel.Resources>
|
||||
<Grid.Resources>
|
||||
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
|
||||
</StackPanel.Resources>
|
||||
<ComboBox ItemsSource="{Binding StartList}"
|
||||
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ComboBox Grid.Row="3"
|
||||
ItemsSource="{Binding StartList}"
|
||||
SelectedItem="{Binding SelStart}"
|
||||
DisplayMemberPath="ghName"/>
|
||||
DisplayMemberPath="ghName"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<!-- Add Button -->
|
||||
<ToggleButton x:Name="AddBtn"
|
||||
<ToggleButton x:Name="AddBtn"
|
||||
Grid.Row="4"
|
||||
Content="Add"
|
||||
IsChecked="{Binding bAdd_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=AddBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
Grid.RowSpan="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=AddBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0"
|
||||
Command="{Binding Point_Command}"
|
||||
ToolTip="{Binding Point_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Point.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding Line2P_Command}"
|
||||
ToolTip="{Binding Line2P_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Line2P.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=AddBtn}"
|
||||
PlacementTarget="{Binding ElementName=AddBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -38,13 +85,61 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<!-- Edit Button -->
|
||||
<ToggleButton x:Name="EditBtn"
|
||||
Grid.Row="5"
|
||||
Content="Edit"
|
||||
IsChecked="{Binding bEdit_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=EditBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="4"
|
||||
Grid.RowSpan="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=EditBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0"
|
||||
Command="{Binding Delete_Command}"
|
||||
ToolTip="{Binding Delete_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Delete.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding ModifyCurve_Command}"
|
||||
ToolTip="{Binding ModifyCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/ModifyCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
Command="{Binding AddPointCurve_Command}"
|
||||
ToolTip="{Binding AddPointCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/AddPointCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3"
|
||||
Command="{Binding RemovePointCurve_Command}"
|
||||
ToolTip="{Binding RemovePointCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/RemovePointCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=EditBtn}"
|
||||
PlacementTarget="{Binding ElementName=EditBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -88,13 +183,88 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<!-- Grid Button -->
|
||||
<ToggleButton x:Name="GridBtn"
|
||||
Grid.Row="6"
|
||||
Content="Grid"
|
||||
IsChecked="{Binding bGrid_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=GridBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
Grid.RowSpan="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=GridBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Command="{Binding CPlaneTop_Command}"
|
||||
ToolTip="{Binding CPlaneTopToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneTOP.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding CPlaneFront_Command}"
|
||||
ToolTip="{Binding CPlaneFrontToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneFRONT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
Command="{Binding CPlaneRight_Command}"
|
||||
ToolTip="{Binding CPlaneRightToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneRIGHT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3"
|
||||
Command="{Binding CPlaneBack_Command}"
|
||||
ToolTip="{Binding CPlaneBackToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneBACK.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="4"
|
||||
Command="{Binding CPlaneLeft_Command}"
|
||||
ToolTip="{Binding CPlaneLeftToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneLEFT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="5"
|
||||
Command="{Binding CPlaneBottom_Command}"
|
||||
ToolTip="{Binding CPlaneBottomToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneBOTTOM.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="6"
|
||||
Command="{Binding CPlaneElevation_Command}"
|
||||
ToolTip="{Binding CPlaneElevationToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneELEVATION.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="7"
|
||||
Command="{Binding CPlaneOrigin_Command}"
|
||||
ToolTip="{Binding CPlaneOriginToolTip}"
|
||||
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}"
|
||||
PlacementTarget="{Binding ElementName=GridBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -158,13 +328,74 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
<!-- Move Button -->
|
||||
<ToggleButton x:Name="MoveBtn"
|
||||
Grid.Row="7"
|
||||
Content="Move"
|
||||
IsChecked="{Binding bMove_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=MoveBtn}"
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
Grid.RowSpan="5"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Visibility="{Binding IsChecked, ElementName=MoveBtn, Converter={StaticResource FromBooleanToVisibility}}"
|
||||
Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="0,0,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="X"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,2.5,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Y"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,2.5,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Z"
|
||||
VerticalAlignment="Center"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Drag"
|
||||
Command="{Binding DragMove_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=MoveBtn}"
|
||||
PlacementTarget="{Binding ElementName=MoveBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
@@ -221,6 +452,6 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Popup>-->
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -421,7 +421,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 +800,54 @@ 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
|
||||
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
|
||||
|
||||
@@ -17,15 +17,27 @@ 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)
|
||||
m_bGridVisibility = value
|
||||
EgtSetGridShow(value, value)
|
||||
EgtDraw()
|
||||
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 +45,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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,11 +63,13 @@
|
||||
</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>
|
||||
<StackPanel Grid.Column="1"
|
||||
@@ -71,12 +77,15 @@
|
||||
<Button Content="Set"
|
||||
Command="{Binding Set_Command}"
|
||||
Visibility="{Binding FCurr_Visibility}"
|
||||
Margin="2.5,0,2.5,0"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Media"
|
||||
Command="{Binding Media_Command}"
|
||||
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 +101,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}"
|
||||
@@ -166,9 +175,11 @@
|
||||
<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}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -465,9 +465,9 @@ Public Class TFSEditorVM
|
||||
Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
|
||||
EgtEmptyGroup(nLayTFSCalcId)
|
||||
For Each CurrPart In Map.refTopPanelVM.PartList
|
||||
EgtSetInfo(CurrPart.nPartId, MAC_TORECALC_GENERATE, True)
|
||||
EgtSetInfo(CurrPart.nPartId, MAC_TORECALC_TFS, True)
|
||||
Next
|
||||
Map.refSliceManagerVM.CalcSlice(False, True, True)
|
||||
Map.refSliceManagerVM.CalcSlice(False)
|
||||
End Sub
|
||||
|
||||
#End Region ' Reset
|
||||
@@ -585,7 +585,7 @@ Public Class TFSLayer
|
||||
EgtSetInfo(nId, "WaitingTime", m_dTWait)
|
||||
m_bTWait_IsModified = True
|
||||
' Imposto flag di ricalcolo generate
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True)
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_TFS, True)
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sTWait))
|
||||
@@ -597,7 +597,7 @@ Public Class TFSLayer
|
||||
EgtSetInfo(nId, "WaitingTime", m_dTWait)
|
||||
m_bTWait_IsModified = True
|
||||
' Imposto flag di ricalcolo generate
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True)
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_TFS, True)
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
NotifyPropertyChanged(NameOf(sTWait))
|
||||
End Sub
|
||||
@@ -642,7 +642,7 @@ Public Class TFSLayer
|
||||
EgtSetInfo(nId, "FCur", m_dFCurr)
|
||||
m_bFCurr_IsModified = True
|
||||
' Imposto flag di ricalcolo generate
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True)
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_TFS, True)
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sFCurr))
|
||||
@@ -654,7 +654,7 @@ Public Class TFSLayer
|
||||
EgtSetInfo(nId, "FCur", m_dFCurr)
|
||||
m_bFCurr_IsModified = True
|
||||
' Imposto flag di ricalcolo generate
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True)
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_TFS, True)
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
NotifyPropertyChanged(NameOf(sFCurr))
|
||||
End Sub
|
||||
|
||||
@@ -36,17 +36,17 @@
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding PartList}"
|
||||
SelectedItem="{Binding SelPart}"
|
||||
DisplayMemberPath="sImportedFileName"
|
||||
DisplayMemberPath="sName"
|
||||
FontSize="14"
|
||||
FontFamily="/Resources/Fonts/#Roboto"
|
||||
FontWeight="Light"
|
||||
VerticalContentAlignment="Center">
|
||||
</ComboBox>
|
||||
<!--<Button Grid.Column="1"
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding PartModify_Command}"
|
||||
Style="{StaticResource PrintParamDb_Button}">
|
||||
<Image Source="/Resources/TopPanel/Edit.png"/>
|
||||
</Button>-->
|
||||
</Button>
|
||||
</Grid>
|
||||
<ToggleButton x:Name="ModifyBtn"
|
||||
Content="{Binding SelectedItem.sName, ElementName=ModifyModeListBox}"
|
||||
@@ -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*"/>
|
||||
@@ -159,10 +159,10 @@
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="45°:"
|
||||
<TextBlock Text="Slicing direction:"
|
||||
HorizontalAlignment="Right"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding CurrMachining.bCurrSlicing45}"
|
||||
Text="{Binding CurrMachining.sCurrSlicingType}"
|
||||
HorizontalAlignment="Left"/>
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="StrandH:"
|
||||
|
||||
+106
-12
@@ -205,19 +205,37 @@ 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 selezionato 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
|
||||
If Not IsNothing(m_SelMaterial) Then
|
||||
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
|
||||
If nTabPartId <> GDB_ID.NULL Then
|
||||
EgtSetInfo(nTabPartId, KEY_MATERIAL_GUID, Map.refTopPanelVM.SelMaterial.sGUID)
|
||||
EgtSetInfo(nTabPartId, KEY_MATERIAL_NAME, Map.refTopPanelVM.SelMaterial.sName)
|
||||
End If
|
||||
End If
|
||||
' 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, Nothing))
|
||||
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
|
||||
@@ -259,7 +277,7 @@ Public Class TopPanelVM
|
||||
m_MachiningList.Remove(MachiningIndex.Empty())
|
||||
End If
|
||||
' se nuova lavorazione e' none
|
||||
If SelMachining.sGUID = Guid.Empty Then
|
||||
If 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
|
||||
@@ -385,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
|
||||
|
||||
@@ -432,38 +464,100 @@ Public Class TopPanelVM
|
||||
End Function
|
||||
|
||||
Private Sub InitMATERIALDB()
|
||||
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
|
||||
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(False)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
|
||||
' imposto pagina
|
||||
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.MATERIALDB)
|
||||
End Sub
|
||||
|
||||
Private Function ExitMATERIALDB()
|
||||
|
||||
' riabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(True)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
|
||||
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub InitMACHININGDB()
|
||||
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
|
||||
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(False)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
|
||||
' imposto pagina
|
||||
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.PRINTPARAMDB)
|
||||
End Sub
|
||||
|
||||
Private Function ExitMACHININGDB()
|
||||
|
||||
' riabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(True)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
|
||||
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub InitCURRMACHINING()
|
||||
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
|
||||
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(False)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
|
||||
' imposto pagina
|
||||
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.CURRPRINTPARAM)
|
||||
End Sub
|
||||
|
||||
Private Function ExitCURRMACHINING()
|
||||
|
||||
' riabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(True)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
|
||||
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
|
||||
Return True
|
||||
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
|
||||
|
||||
@@ -479,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)
|
||||
|
||||
@@ -79,7 +79,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()
|
||||
@@ -116,33 +117,36 @@ Public Module CurrentMachine
|
||||
EgtSetName(nTabOutlineId, TABLE_OUTLINE)
|
||||
' scrivo il nome macchina sulla tavola
|
||||
EgtSetInfo(nTabPartId, KEY_MACHINE_NAME, CurrentMachine.sMachineName)
|
||||
' scrivo materiale sulla tavola
|
||||
If Not IsNothing(Map.refTopPanelVM.SelMaterial) Then
|
||||
EgtSetInfo(nTabPartId, KEY_MATERIAL_GUID, Map.refTopPanelVM.SelMaterial.sGUID)
|
||||
EgtSetInfo(nTabPartId, KEY_MATERIAL_NAME, Map.refTopPanelVM.SelMaterial.sName)
|
||||
End If
|
||||
' Ripristino stato segnalazione modifica
|
||||
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, lpDefault, lpString, m_sMachiningFilePath)
|
||||
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, m_sMachiningFilePath)
|
||||
If Not String.IsNullOrWhiteSpace(lpString) Then
|
||||
' lpString = EgwCrypto.DecryptString(lpString, m_Salt)
|
||||
lpString = EgwCrypto.PowerDecryptString(lpString, m_Salt)
|
||||
Else
|
||||
lpString = ""
|
||||
lpString = lpDefault
|
||||
End If
|
||||
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, lpDefault, lpString, m_sMachiningFilePath)
|
||||
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, m_sMachiningFilePath)
|
||||
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.PowerDecryptString(Values(ValueIndex), m_Salt) & If(ValueIndex < Values.Count - 1, ";", "")
|
||||
'sCryptoValues += EgwCrypto.DecryptString(Values(ValueIndex), m_Salt) & If(ValueIndex < Values.Count - 1, ";", "")
|
||||
Next
|
||||
lpString = sCryptoValues
|
||||
Else
|
||||
lpString = ""
|
||||
lpString = lpDefault
|
||||
End If
|
||||
Return nResult
|
||||
End Function
|
||||
@@ -175,7 +179,6 @@ Public Module CurrentMachine
|
||||
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)
|
||||
If Not String.IsNullOrWhiteSpace(lpString) Then
|
||||
'lpString = EgwCrypto.DecryptString(lpString, m_Salt)
|
||||
lpString = EgwCrypto.PowerDecryptString(lpString, m_Salt)
|
||||
Else
|
||||
lpString = ""
|
||||
|
||||
@@ -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,6 +44,8 @@
|
||||
<PrintApp:SimulationPanelVM x:Key="SimulationPanelVM"/>
|
||||
<PrintApp:ReferencePanelVM x:Key="ReferencePanelVM"/>
|
||||
<PrintApp:ViewLayerManagerVM x:Key="ViewLayerManagerVM"/>
|
||||
<!--<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"/>
|
||||
|
||||
@@ -66,7 +66,11 @@ Public Module EgwCrypto
|
||||
|
||||
Public Function PowerDecryptString(ByVal Message As String, ByVal Passphrase As String) As String
|
||||
Dim sTransformMessage As String = DecryptString(Message, Passphrase)
|
||||
Return sTransformMessage.Substring(8, sTransformMessage.Length - 16)
|
||||
If sTransformMessage.Length() >= 16 Then
|
||||
Return sTransformMessage.Substring(8, sTransformMessage.Length - 16)
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Function
|
||||
|
||||
'Public Function getHashStringMD5(ByVal Message As String) As String
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Module GeomEntityColors
|
||||
|
||||
Private m_c3Print As Color3d
|
||||
Public ReadOnly Property c3Print As Color3d
|
||||
Get
|
||||
Return m_c3Print
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_c3MachStart As Color3d
|
||||
Public ReadOnly Property c3MachStart As Color3d
|
||||
Get
|
||||
Return m_c3MachStart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_c3Rib As Color3d
|
||||
Public ReadOnly Property c3Rib As Color3d
|
||||
Get
|
||||
Return m_c3Rib
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_c3ShellNumber As Color3d
|
||||
Public ReadOnly Property c3ShellNumber As Color3d
|
||||
Get
|
||||
Return m_c3ShellNumber
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_c3AuxSolids As Color3d
|
||||
Public ReadOnly Property c3AuxSolids As Color3d
|
||||
Get
|
||||
Return m_c3AuxSolids
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_c3Others As Color3d
|
||||
Public ReadOnly Property c3Others As Color3d
|
||||
Get
|
||||
Return m_c3Others
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
' imposto colori superfici
|
||||
m_c3Print.FromColor(System.Drawing.Color.Aqua)
|
||||
m_c3MachStart.FromColor(System.Drawing.Color.Red)
|
||||
m_c3Rib.FromColor(System.Drawing.Color.MediumOrchid)
|
||||
m_c3ShellNumber.FromColor(System.Drawing.Color.Lime)
|
||||
m_c3AuxSolids.FromColor(System.Drawing.Color.DarkGoldenrod)
|
||||
m_c3Others.FromColor(System.Drawing.Color.LightGray)
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
@@ -23,8 +23,15 @@ Module LuaExec
|
||||
End If
|
||||
' Assegno i dati
|
||||
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.FLOWRATE_PC)
|
||||
If Not IsNothing(MachiningConstant) Then
|
||||
dMachiningConstant = MachiningConstant.dValue
|
||||
End If
|
||||
End If
|
||||
EgtLuaCreateGlobTable("MATERIAL")
|
||||
EgtLuaSetGlobNumVar("MATERIAL.K", SelMaterialParam.dK)
|
||||
EgtLuaSetGlobNumVar("MATERIAL.K", dMachiningConstant)
|
||||
EgtLuaSetGlobNumVar("MATERIAL.C1", SelMaterialParam.dC1)
|
||||
EgtLuaSetGlobNumVar("MATERIAL.C2", SelMaterialParam.dC2)
|
||||
EgtLuaSetGlobNumVar("MATERIAL.Density", SelMaterialParam.dDensity)
|
||||
@@ -59,6 +66,20 @@ Module LuaExec
|
||||
' eseguo generazione
|
||||
EgtLuaCreateGlobTable("PRINT")
|
||||
EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1)
|
||||
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
|
||||
EgtGetCurrFilePath(sIsoFilePath)
|
||||
Dim sExtension As String = ""
|
||||
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "", sExtension, CurrentMachine.sMachIniFile)
|
||||
If String.IsNullOrWhiteSpace(sExtension) Then
|
||||
sExtension = ".cnc"
|
||||
End If
|
||||
sIsoFilePath = System.IO.Path.ChangeExtension(sIsoFilePath, sExtension)
|
||||
End If
|
||||
End If
|
||||
EgtLuaSetGlobStringVar("PRINT.ISOFILEPATH", sIsoFilePath)
|
||||
Dim bOk As Boolean = EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\GcodeGenerate.lua")
|
||||
If bOk Then
|
||||
Dim nErr As Integer = 999
|
||||
@@ -71,7 +92,7 @@ Module LuaExec
|
||||
End Function
|
||||
|
||||
Friend Function ExecSolid() As Boolean
|
||||
EgtOutLog("-- Start ExecGenerate --")
|
||||
EgtOutLog("-- Start ExecSolid --")
|
||||
' eseguo generazione
|
||||
EgtLuaCreateGlobTable("PRINT")
|
||||
Dim bOk As Boolean = EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\CalcSolids.lua")
|
||||
|
||||
+51
-15
@@ -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,6 +60,9 @@ Module Map
|
||||
Private m_refViewLayerManagerVM As ViewLayerManagerVM
|
||||
Private m_refShellNumberPanelVM As ShellNumberPanelVM
|
||||
Private m_refShellNumberParamPanelVM As ShellNumberParamPanelVM
|
||||
Private m_refSplashScreen As SplashScreen
|
||||
''Private m_refModifyPartPanelVM As ModifyPartPanelVM
|
||||
Private m_refManagePartPanelVM As ManagePartPanelVM
|
||||
|
||||
#Region "Get"
|
||||
|
||||
@@ -104,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
|
||||
@@ -344,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
|
||||
@@ -422,6 +425,24 @@ Module Map
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSplashScreen As SplashScreen
|
||||
Get
|
||||
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
|
||||
|
||||
#End Region ' Get
|
||||
|
||||
#Region "Set"
|
||||
@@ -660,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
|
||||
@@ -725,6 +746,21 @@ Module Map
|
||||
Return Not IsNothing(m_refShellNumberParamPanelVM)
|
||||
End Function
|
||||
|
||||
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
|
||||
|
||||
#Region "Init"
|
||||
|
||||
@@ -31,4 +31,27 @@ Public Class MyMachine
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Shared Function InsertMachine(sPath As String, MachineList As IList(Of Machine)) As Boolean
|
||||
' Verifico presenza file caratteristici
|
||||
Dim sName As String = Path.GetFileName(sPath)
|
||||
Dim MachineIniPath As String = sPath & "\" & sName & ".ini"
|
||||
Dim MachineMldePath As String = sPath & "\" & sName & ".mlde"
|
||||
If Not File.Exists(MachineIniPath) Or Not File.Exists(MachineMldePath) Then Return False
|
||||
' Cerco la posizione di inserimento
|
||||
Dim nPos As Integer = 0
|
||||
For nI As Integer = 0 To MachineList.Count() - 1
|
||||
Dim nRes As Integer = String.Compare(sName, MachineList(nI).Name, True)
|
||||
If nRes = 0 Then
|
||||
Return True
|
||||
ElseIf nRes < 0 Then
|
||||
Exit For
|
||||
Else
|
||||
nPos += 1
|
||||
End If
|
||||
Next
|
||||
' Inserisco nella lista
|
||||
MachineList.Insert(nPos, New MyMachine(sPath, MachineIniPath))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -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,6 +225,8 @@ Public Class ViewLayer
|
||||
EgtSetStatus(Entity, Status)
|
||||
Next
|
||||
Next
|
||||
Case ViewLayerType.OTHERS
|
||||
EgtSetStatus(CurrPart.nOthersLayerId, Status)
|
||||
End Select
|
||||
Next
|
||||
' Ripristino stato segnalazione modifica
|
||||
@@ -258,6 +277,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 +298,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 +328,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 +349,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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -79,7 +72,21 @@ Public Class Print3dPartVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sImportedFileName As String
|
||||
' gruppo others
|
||||
Private m_nOthersLayerId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nOthersLayerId As Integer
|
||||
Get
|
||||
Return m_nOthersLayerId
|
||||
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), "")
|
||||
@@ -111,22 +118,24 @@ Public Class Print3dPartVM
|
||||
|
||||
Sub New(nPartId As Integer, sImportedFilePath As String)
|
||||
m_nPartId = nPartId
|
||||
m_sName = IO.Path.GetFileName(sImportedFilePath)
|
||||
m_sImportedFilePath = sImportedFilePath
|
||||
m_sImportedFileName = IO.Path.GetFileName(m_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,
|
||||
nRibsLayerId As Integer, nShellNumberLayerId As Integer, nAuxSolidsLayerId As Integer, sImportedFilePath As String)
|
||||
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
|
||||
m_nAuxSolidsLayerId = nAuxSolidsLayerId
|
||||
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
|
||||
@@ -152,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
|
||||
|
||||
Reference in New Issue
Block a user