Merge branch 'FlowDocument'
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
Public Const TABLE = "Table"
|
||||
Public Const TABLE_OUTLINE = "TableOutline"
|
||||
Public Const EXTRUSION_AREA = "ExtrusionArea"
|
||||
Public Const PART = "Part"
|
||||
Public Const PRINT_SOLID = "PrintSolid"
|
||||
Public Const LAY_MACH_START = "MachStart"
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' EgalTech 2015-2015
|
||||
'----------------------------------------------------------------------------
|
||||
' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
|
||||
' Contenuto : Modulo costanti sezione e chiavi per file Ini.
|
||||
'
|
||||
'
|
||||
'
|
||||
' Modifiche : 12.02.15 DS Creazione modulo.
|
||||
'
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
|
||||
Public Module ConstMachDataIni
|
||||
|
||||
Public Const MACHDATA_INI_FILE_NAME As String = "Data.ini"
|
||||
|
||||
Public Const S_TABLE As String = "Table"
|
||||
Public Const K_DIMX As String = "DimX"
|
||||
Public Const K_DIMY As String = "DimY"
|
||||
Public Const K_POSX As String = "PosX"
|
||||
Public Const K_POSY As String = "PosY"
|
||||
Public Const K_POSZ As String = "PosZ"
|
||||
|
||||
Public Const S_VERTICAL As String = "Vertical"
|
||||
Public Const S_45DEGX As String = "45DegX"
|
||||
Public Const S_45DEGY As String = "45DegY"
|
||||
Public Const S_HORIZONTAL As String = "Horizontal"
|
||||
Public Const K_MINX As String = "MinX"
|
||||
Public Const K_MAXX As String = "MaxX"
|
||||
Public Const K_MINY As String = "MinY"
|
||||
Public Const K_MAXY As String = "MaxY"
|
||||
|
||||
|
||||
End Module
|
||||
@@ -722,6 +722,10 @@ Public Class CurrComboMachiningParam
|
||||
NotifyPropertyChanged(NameOf(SelValue))
|
||||
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
|
||||
ManageDependencyParam()
|
||||
' se aggiorno SlicingType
|
||||
If m_Type = Params.SLICINGTYPE Then
|
||||
CurrentMachine.UpdateExtrusionArea()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -893,6 +897,7 @@ Public Class CurrComboMachiningParam
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_SelValue = m_OrigSelValue
|
||||
NotifyPropertyChanged(NameOf(SelValue))
|
||||
CurrentMachine.UpdateExtrusionArea()
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -912,6 +917,7 @@ Public Class CurrComboMachiningParam
|
||||
m_SelValue = DbParam.OrigSelValue
|
||||
NotifyPropertyChanged(NameOf(SelValue))
|
||||
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
|
||||
CurrentMachine.UpdateExtrusionArea()
|
||||
End Sub
|
||||
|
||||
#End Region ' ResetParam
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
<Compile Include="Constants\ConstDataGridColumnsIni.vb" />
|
||||
<Compile Include="Constants\ConstDims.vb" />
|
||||
<Compile Include="Constants\ConstGen.vb" />
|
||||
<Compile Include="Constants\ConstMachDataIni.vb" />
|
||||
<Compile Include="Constants\ConstIni.vb" />
|
||||
<Compile Include="Constants\ConstMachComm.vb" />
|
||||
<Compile Include="Constants\ConstMachIni.vb" />
|
||||
|
||||
@@ -1014,11 +1014,11 @@ Public Class OptionWindowVM
|
||||
' Se è un aggiornamento, recupero utensili, lavorazioni, attrezzaggi e dati per travi
|
||||
If bOldExists And bUpdate Then
|
||||
Dim sBackupDir As String = sMachDir & ".old"
|
||||
If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Tools") Then
|
||||
If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Tools") Then
|
||||
My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Tools", FileIO.DeleteDirectoryOption.DeleteAllContents)
|
||||
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Tools") Then
|
||||
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Tools") Then
|
||||
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\Tools", FileIO.DeleteDirectoryOption.DeleteAllContents)
|
||||
End If
|
||||
My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Tools", sMachDir & "\Tools", True)
|
||||
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\Tools", sMachDir & "\Tools", True)
|
||||
End If
|
||||
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Machinings") Then
|
||||
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Machinings") Then
|
||||
@@ -1038,50 +1038,12 @@ Public Class OptionWindowVM
|
||||
End If
|
||||
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\SetUp", sMachDir & "\SetUp", True)
|
||||
End If
|
||||
'If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Beam") Then
|
||||
' ' Flag per sovrascrivere vecchio file BeamData.lua con nuovo
|
||||
' Dim bBeamDataExists As Boolean = False
|
||||
' Const sBeamData As String = "\BeamData.lua"
|
||||
' ' Flag per sovrascrivere vecchio file MachiningTypes.ini
|
||||
' Dim bMchgTypesExists As Boolean = False
|
||||
' Const sMchgTypes As String = "\MachiningTypes.ini"
|
||||
' If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Beam") Then
|
||||
' If My.Computer.FileSystem.FileExists( sMachDir & "\Beam" & sBeamData) Then
|
||||
' bBeamDataExists = True
|
||||
' My.Computer.FileSystem.MoveFile( sMachDir & "\Beam" & sBeamData, sMachDir & sBeamData, True)
|
||||
' End If
|
||||
' If My.Computer.FileSystem.FileExists( sMachDir & "\Beam" & sMchgTypes) Then
|
||||
' bMchgTypesExists = True
|
||||
' My.Computer.FileSystem.MoveFile( sMachDir & "\Beam" & sMchgTypes, sMachDir & sMchgTypes, True)
|
||||
' End If
|
||||
' My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Beam", FileIO.DeleteDirectoryOption.DeleteAllContents)
|
||||
' End If
|
||||
' My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Beam", sMachDir & "\Beam", True)
|
||||
' If bBeamDataExists Then My.Computer.FileSystem.MoveFile( sMachDir & sBeamData, sMachDir & "\Beam" & sBeamData, True)
|
||||
' If bMchgTypesExists Then My.Computer.FileSystem.MoveFile( sMachDir & sMchgTypes, sMachDir & "\Beam" & sMchgTypes, True)
|
||||
'End If
|
||||
'If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Wall") Then
|
||||
' ' Flag per sovrascrittura vecchio file WallData.lua con nuovo
|
||||
' Dim bWallDataExists As Boolean = False
|
||||
' Const sWallData As String = "\WallData.lua"
|
||||
' ' Flag per sovrascrivere vecchio file MachiningTypes.ini
|
||||
' Dim bMchgTypesExists As Boolean = False
|
||||
' Const sMchgTypes As String = "\MachiningTypes.ini"
|
||||
' If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Wall") Then
|
||||
' If My.Computer.FileSystem.FileExists( sMachDir & "\Wall" & sWallData) Then
|
||||
' bWallDataExists = True
|
||||
' My.Computer.FileSystem.MoveFile( sMachDir & "\Wall" & sWallData, sMachDir & sWallData, True)
|
||||
' End If
|
||||
' If My.Computer.FileSystem.FileExists( sMachDir & "\Wall" & sMchgTypes) Then
|
||||
' bMchgTypesExists = True
|
||||
' My.Computer.FileSystem.MoveFile( sMachDir & "\Wall" & sMchgTypes, sMachDir & sMchgTypes, True)
|
||||
' End If
|
||||
' My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Wall", FileIO.DeleteDirectoryOption.DeleteAllContents)
|
||||
' End If
|
||||
' My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Wall", sMachDir & "\Wall", True)
|
||||
' If bWallDataExists Then My.Computer.FileSystem.MoveFile( sMachDir & sWallData, sMachDir & "\Wall" & sWallData, True)
|
||||
' If bMchgTypesExists Then My.Computer.FileSystem.MoveFile( sMachDir & sMchgTypes, sMachDir & "\Wall" & sMchgTypes, True)
|
||||
'End If
|
||||
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\CustomData") Then
|
||||
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\CustomData") Then
|
||||
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\CustomData", FileIO.DeleteDirectoryOption.DeleteAllContents)
|
||||
End If
|
||||
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\CustomData", sMachDir & "\CustomData", True)
|
||||
End If
|
||||
End If
|
||||
'La macchina "{0}" è stata aggiornata con successo.
|
||||
Dim sOk As String = String.Format(EgtMsg(6530), sMachName)
|
||||
|
||||
@@ -543,6 +543,12 @@ Public Class SliceManagerVM
|
||||
m_bCalculating = False
|
||||
Return
|
||||
End If
|
||||
Dim b3Print As BBox3d = Map.refDispositionPanelVM.GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
|
||||
If Not String.IsNullOrWhiteSpace(CurrentMachine.sMachDataIniFile) AndAlso Not CurrentMachine.b3ExtrusionArea.EnclosesXY(b3Print) Then
|
||||
MessageBox.Show("Part outside the extrusion area!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
m_bCalculating = False
|
||||
Return
|
||||
End If
|
||||
' eseguo calcoli
|
||||
CalcSlice(False)
|
||||
' se non ho interrotto calcoli
|
||||
|
||||
@@ -171,10 +171,8 @@ Public Class TopPanelVM
|
||||
End If
|
||||
m_SelPart = value
|
||||
If Not IsNothing(value) Then
|
||||
' Eseguo la selezione
|
||||
' deseleziono tutto
|
||||
EgtDeselectAll()
|
||||
' EgtSetMark(m_SelPart.nPrintSolidId)
|
||||
EgtDraw()
|
||||
' imposto lavorazione e materiale del pezzo selezionato
|
||||
Map.refCurrMachiningPanelVM.ReadMachParamFromSelPart()
|
||||
Dim DbMachining As MachiningIndex = MachiningList.FirstOrDefault(Function(x) x.sGUID = Map.refCurrMachiningPanelVM.CurrMachining.sCurrGUID)
|
||||
@@ -183,6 +181,9 @@ Public Class TopPanelVM
|
||||
' notifico posizione pezzo
|
||||
Map.refDispositionPanelVM.RefreshPos()
|
||||
Map.refSliceManagerVM.UpdateDimensions()
|
||||
' aggiorno area di estrusione
|
||||
CurrentMachine.UpdateExtrusionArea()
|
||||
EgtDraw()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -28,6 +28,13 @@ Public Module CurrentMachine
|
||||
Return m_sMachIniFile
|
||||
End Get
|
||||
End Property
|
||||
' File ini dei dati della macchina
|
||||
Private m_sMachDataIniFile As String = String.Empty
|
||||
Friend ReadOnly Property sMachDataIniFile As String
|
||||
Get
|
||||
Return m_sMachDataIniFile
|
||||
End Get
|
||||
End Property
|
||||
' File script della macchina
|
||||
Private m_sMachScriptDir As String = String.Empty
|
||||
Friend ReadOnly Property sMachScriptDir As String
|
||||
@@ -64,6 +71,14 @@ Public Module CurrentMachine
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' box dell'area di estrusione
|
||||
Private m_b3ExtrusionArea As New BBox3d
|
||||
Friend ReadOnly Property b3ExtrusionArea As BBox3d
|
||||
Get
|
||||
Return m_b3ExtrusionArea
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Init"
|
||||
|
||||
Sub InitCurrentMachine(sMachinesRootDir As String, sMachineName As String)
|
||||
@@ -73,6 +88,9 @@ Public Module CurrentMachine
|
||||
m_sMachDir = sMachinesRootDir & "\" & sMachineName
|
||||
' Impostazione path MachIni file
|
||||
m_sMachIniFile = sMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
|
||||
' Impostazione path MachData Ini file
|
||||
m_sMachDataIniFile = sMachinesRootDir & "\" & sMachineName & "\" & "CustomData" & "\" & MACHDATA_INI_FILE_NAME
|
||||
If Not File.Exists(m_sMachDataIniFile) Then m_sMachDataIniFile = ""
|
||||
' impostazione cartella script
|
||||
m_sMachScriptDir = sMachinesRootDir & "\" & sMachineName & "\Scripts"
|
||||
' impostazione cartella lavorazioni
|
||||
@@ -103,14 +121,8 @@ Public Module CurrentMachine
|
||||
Public Sub CreateMachineTable()
|
||||
' Disabilito segnalazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
' Recupero dati tavola (creando gruppo di lavoro temporaneo)
|
||||
Dim nTempId = EgtAddMachGroup("qqq")
|
||||
EgtSetTable("Tab")
|
||||
Dim b3Tab As New BBox3d
|
||||
EgtGetTableArea(1, b3Tab)
|
||||
Dim dTabX = b3Tab.DimX
|
||||
Dim dTabY = b3Tab.DimY()
|
||||
EgtRemoveMachGroup(nTempId)
|
||||
' Disegno tavola
|
||||
Dim nTabPartId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetLevel(nTabPartId, GDB_LV.SYSTEM)
|
||||
@@ -128,10 +140,53 @@ Public Module CurrentMachine
|
||||
EgtSetInfo(nTabPartId, KEY_MATERIAL_GUID, Map.refTopPanelVM.SelMaterial.sGUID)
|
||||
EgtSetInfo(nTabPartId, KEY_MATERIAL_NAME, Map.refTopPanelVM.SelMaterial.sName)
|
||||
End If
|
||||
'' creo area di estrusione
|
||||
UpdateExtrusionArea()
|
||||
' Ripristino stato segnalazione modifica
|
||||
DisableMgr.ReEnable()
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateExtrusionArea()
|
||||
' recupero eventuale vecchia area di estrusione
|
||||
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
|
||||
Dim nTabLayerId As Integer = EgtGetFirstNameInGroup(nTabPartId, TABLE)
|
||||
Dim nExtrusionAreaId As Integer = EgtGetFirstNameInGroup(nTabLayerId, EXTRUSION_AREA)
|
||||
If nExtrusionAreaId <> GDB_ID.NULL Then
|
||||
' e la cancello
|
||||
EgtErase(nExtrusionAreaId)
|
||||
End If
|
||||
' se lavorazione corrente nulla, esco
|
||||
If IsNothing(Map.refTopPanelVM.CurrMachining) Then Return
|
||||
' se non esiste file dati macchina, esco
|
||||
If String.IsNullOrWhiteSpace(m_sMachDataIniFile) Then Return
|
||||
' recupero tipo di slice
|
||||
Dim sExtrusionType As String
|
||||
Dim GeneralCathegory As MachiningCathegory = Map.refTopPanelVM.CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL)
|
||||
Dim SlicingTypeParam As ComboMachiningParam = GeneralCathegory.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.SLICINGTYPE)
|
||||
Dim SlicingTypeValue As Machining.MPAR_SLICINGTYPE = SlicingTypeParam.SelValue.Id
|
||||
Select Case SlicingTypeValue
|
||||
Case Machining.MPAR_SLICINGTYPE.VERTICAL
|
||||
sExtrusionType = S_VERTICAL
|
||||
Case Machining.MPAR_SLICINGTYPE.DEG45
|
||||
sExtrusionType = S_45DEGX
|
||||
Case Machining.MPAR_SLICINGTYPE.DEG45_Y
|
||||
sExtrusionType = S_45DEGY
|
||||
Case Machining.MPAR_SLICINGTYPE.HORIZONTAL
|
||||
sExtrusionType = S_HORIZONTAL
|
||||
End Select
|
||||
Dim dExtrXMax = GetPrivateProfileDouble(sExtrusionType, K_MAXX, 0, m_sMachDataIniFile)
|
||||
Dim dExtrXMin = GetPrivateProfileDouble(sExtrusionType, K_MINX, 0, m_sMachDataIniFile)
|
||||
Dim dExtrYMax = GetPrivateProfileDouble(sExtrusionType, K_MAXY, 0, m_sMachDataIniFile)
|
||||
Dim dExtrYMin = GetPrivateProfileDouble(sExtrusionType, K_MINY, 0, m_sMachDataIniFile)
|
||||
nExtrusionAreaId = EgtCreateRectangle2P(nTabLayerId, New Point3d(dExtrXMin, dExtrYMin, 0), New Point3d(dExtrXMax, dExtrYMax, 0))
|
||||
Dim c3Temp As New Color3d
|
||||
c3Temp.FromColor(System.Drawing.Color.Lime)
|
||||
EgtSetColor(nExtrusionAreaId, c3Temp)
|
||||
EgtSetName(nExtrusionAreaId, EXTRUSION_AREA)
|
||||
m_b3ExtrusionArea = New BBox3d(New Point3d(dExtrXMin, dExtrYMin, 0), New Point3d(dExtrXMax, dExtrYMax, 0))
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Friend Function ReadMachiningParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, Optional sFilePath As String = "") As Integer
|
||||
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
|
||||
If Not String.IsNullOrWhiteSpace(lpString) Then
|
||||
|
||||
Reference in New Issue
Block a user