EgtCAM5 :

- aggiunta gestione drop dei file
- aggiunto aggiornamento disegno utensile all'aggiornamento in batch dei dati utensili.
This commit is contained in:
Dario Sassi
2017-12-27 17:04:25 +00:00
parent 456365a11f
commit 68ee975722
8 changed files with 326 additions and 226 deletions
+51 -1
View File
@@ -101,6 +101,8 @@ Module ToolsUpdate
Private Function ExecUpdate(ByRef vCldTool As List(Of CldTool), bTest As Boolean, ByRef sInfo As String) As Boolean
' Classe di confronto
Dim ToolComp As New CldToolComparer
' Leggo direttorio toolmakers
GetPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", IniFile.m_sToolMakersDir)
' Ciclo su tutti gli utensili nel DB
Const ALL_TOOLS As Integer = MCH_TF.DRILLBIT + MCH_TF.SAWBLADE + MCH_TF.MILL + MCH_TF.MORTISE + MCH_TF.CHISEL + MCH_TF.COMPO
Dim sName As String = String.Empty
@@ -145,6 +147,23 @@ Module ToolsUpdate
Else
EgtTdbSetCurrToolParam(MCH_TP.MAXMAT, dMaxMat + dDeltaL)
End If
' Se non esiste il disegno dell'utensile o modificato
Dim sDrawStat As String = "Ok"
Dim sDraw As String = String.Empty
EgtTdbGetCurrToolParam(MCH_TP.DRAW, sDraw)
Dim sPath As String = String.Empty
EgtTdbGetToolDir(sPath)
sPath = sPath & "\" & sDraw
If Not bTest And (EgtTdbIsCurrToolModified() OrElse Not File.Exists(sPath)) Then
' Se disegno automatico, lo aggiorno
If IsUUID(Path.GetFileNameWithoutExtension(sDraw)) Then
If ExecToolDraw(sDraw) Then
sDrawStat = "Modified"
Else
sDrawStat = "Editing Error"
End If
End If
End If
' Se non è test salvo modifiche utensile
If Not bTest Then EgtTdbSaveCurrTool()
' informazioni
@@ -152,7 +171,8 @@ Module ToolsUpdate
" L=" & dLen.ToString("F3", CultureInfo.InvariantCulture) &
" D=" & dDiam.ToString("F3", CultureInfo.InvariantCulture) &
" NewL=" & vCldTool(nI).dLen.ToString("F3", CultureInfo.InvariantCulture) &
" NewD=" & vCldTool(nI).dDiam.ToString("F3", CultureInfo.InvariantCulture)
" NewD=" & vCldTool(nI).dDiam.ToString("F3", CultureInfo.InvariantCulture) &
" Draw=" & sDrawStat
sInfo &= sOut & vbCrLf
EgtOutLog(sOut)
Else
@@ -172,6 +192,36 @@ Module ToolsUpdate
Return True
End Function
Private Function ExecToolDraw(sName As String) As Boolean
' Recupero dati dell'utensile corrente
EgtTdbGetCurrToolParam(MCH_TP.HEAD, ToolDraw.sHeadName)
Dim nExit As Integer = 0
EgtTdbGetCurrToolParam(MCH_TP.EXIT_, nExit)
ToolDraw.sExitName = nExit.ToString()
EgtTdbGetCurrToolParam(MCH_TP.EXIT_, nExit)
EgtTdbGetCurrToolParam(MCH_TP.TYPE, ToolDraw.nType)
EgtTdbGetCurrToolParam(MCH_TP.TOTLEN, ToolDraw.dTotLen)
EgtTdbGetCurrToolParam(MCH_TP.LEN, ToolDraw.dLen)
EgtTdbGetCurrToolParam(MCH_TP.TOTDIAM, ToolDraw.dTotDiam)
EgtTdbGetCurrToolParam(MCH_TP.DIAM, ToolDraw.dDiam)
EgtTdbGetCurrToolParam(MCH_TP.THICK, ToolDraw.dThick)
EgtTdbGetCurrToolParam(MCH_TP.MAXMAT, ToolDraw.dMaxMat)
EgtTdbGetCurrToolParam(MCH_TP.SIDEANG, ToolDraw.dSideAng)
EgtTdbGetCurrToolParam(MCH_TP.CORNRAD, ToolDraw.dCornRad)
' Creo contesto temporaneo per disegno utensile
Dim nTempCtx As Integer = EgtInitContext()
If nTempCtx = 0 Then Return False
ToolDraw.nToolContext = nTempCtx
' Creo il disegno dell'utensile
If Not ToolDraw.Create() Then Return False
' Salvo il disegno dell'utensile
Dim bOk As Boolean = ToolDraw.Save(sName)
' Cancello il contesto temporaneo e ripristino quello di progetto
EgtDeleteContext(nTempCtx)
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
Return bOk
End Function
Private Function ToolTypeToString(nType As Integer) As String
Select Case nType
Case MCH_TY.DRILL_STD