Compare commits

...

95 Commits

Author SHA1 Message Date
DarioS 3f2888f5d3 EgtCAM5 :
- aggiornato codice di protezione mensile.
2023-05-17 08:53:20 +02:00
DarioS 17e8be7ab4 EgtCAM5 2.5e2 :
- ricompilazione con cambio versione.
2023-05-17 08:49:35 +02:00
DarioS 958a2f005f EgtCAM5 2.5d3 :
- ricompilazione con cambio versione.
2023-04-11 19:39:42 +02:00
DarioS 3f02f139fa EgtCAM5 2.5d1 :
- ricompilazione con cambio versione.
2023-04-05 12:02:13 +02:00
DarioS f8291c6da0 EgtCAM5 :
- corretta modifica precedente su immagini bottoni per estensioni.
2023-03-22 08:32:58 +01:00
DarioS dc9dc9a916 EgtCAM5 :
- aggiunta abilitazione utente e aggiornamento per le estensioni permesse dai codici chiave.
2023-03-21 10:24:57 +01:00
DarioS 562497bfe7 EgtCAM5 2.5c1 :
- ricompilazione con cambio versione.
2023-03-13 08:19:45 +01:00
DarioS f3eb475348 EgtCAM5 :
- aggiunta visualizzazione Estensioni caricate (Beam, Wall, Doors, Gunstock) con versione e direttorio di installazione.
2023-02-27 17:26:16 +01:00
DarioS b428469294 EgtCAM5 :
- esportazione macchine non salvano i file di git.
2023-02-27 09:24:20 +01:00
DarioS 9bd1da86b6 EgtCAM5 2.5b3 :
- ricompilazione con cambio versione.
2023-02-23 15:27:58 +01:00
Emmanuele Sassi 495a8a9f66 - adattamento per cambiamento assi in simulazione 2023-02-23 10:49:43 +01:00
DarioS cbd4f6c810 EgtCAM5 2.5b2 :
- a stampa si associa per UI il testo EgtCAM5-Print.
2023-02-20 15:39:43 +01:00
DarioS e72d30c392 EgtCAM5 :
- aggiunto comando stampa.
2023-02-13 08:20:56 +01:00
DarioS 82a8ee2230 EgtCAM5 2.5b1 :
- ricompilazione con cambio versione.
2023-02-09 10:43:11 +01:00
DarioS ccf74a8644 EgtCAM5 2.5a4 :
- ricompilazione con cambio versione.
2023-02-01 11:54:30 +01:00
DarioS f0e95a97d7 EgtCAM5 2.5a3 :
- ricompilazione con cambio versione.
2023-01-26 11:56:28 +01:00
DarioS 4fc98f419b EgtCAM5 2.5a2 :
- ricompilazione con cambio versione.
2023-01-17 11:34:04 +01:00
DarioS 6123aced14 EgtCAM5 :
- in Hide/Show ora si garantisce la congruenza tra stato dell'albero e stato del progetto.
2023-01-11 17:44:45 +01:00
DarioS bec2d24aac EgtCAM5 :
- velocizzato comando spegni/accendi gruppo e tutti i suoi discendenti individualmente (Shift su lampadina in TreeView).
2023-01-11 16:10:26 +01:00
DarioS 3b73ee84fd EgtCAM5 2.5a1 :
- ricompilazione con cambio versione.
2023-01-03 08:52:26 +01:00
DarioS a019f5cce4 EgtCAM5 2.4l2 :
- ricompilazione con cambio versione.
2022-12-22 15:25:10 +01:00
DarioS 9d420795d8 EgtCAM5 2.4l1 :
- in ingresso simulazione spostata prima visualizzazione dopo EgtSimInit e EgtSimStart.
2022-12-07 08:17:51 +01:00
DarioS 5c0a68bfcc EgtCAM5 2.4k6 :
- ricompilazione con cambio versione.
2022-12-01 07:49:13 +01:00
DarioS a7c8701512 EgtCAM5 2.4k5 :
- ricompilazione con cambio versione.
2022-11-30 09:50:26 +01:00
DarioS 67a769e1fb EgtCAM5 2.4k4 :
- ricompilazione con cambio versione.
2022-11-22 08:48:18 +01:00
DarioS da7d6da74c EgtCAM5 2.4k3 :
- ricompilazione con cambio versione.
2022-11-12 07:58:17 +01:00
DarioS 3ed56120e2 EgtCAM5 2.4k2 :
- per la chiamata a DMACH si imposta DGD.BASEDIR.
2022-11-07 19:01:16 +01:00
DarioS c6aba04921 EgtCAM5 2.4k1 :
- aggiunto bottone e comando ApproxSurf
- aggiunto comando SurfTmToTriangles come Shift di ExplodeSurf.
2022-11-04 19:26:31 +01:00
Emmanuele Sassi fabfdf026a EgtCAM5 2.4j4 : - ricompilazione con cambio versione 2022-10-24 20:27:48 +02:00
Emmanuele Sassi 954ea2f120 Merge branch 'master' of https://gitlab.steamware.net/egaltech/EgtCAM5 2022-10-24 12:14:08 +02:00
Emmanuele Sassi 18883cdbb3 - Modifica per file Lua compilati 2022-10-24 12:14:06 +02:00
DarioS 5ecfb960b5 EgtCAM5 2.4j3 :
- aggiunta gestione sThreeJSLibDir da INI.
2022-10-24 08:47:36 +02:00
DarioS 6caf32aa67 EgtCAM5 2.4j2 :
- ricompilazione con cambio versione.
2022-10-20 10:20:39 +02:00
DarioS 0125a5b7c7 EgtCAM5 2.4j1 :
- ricompilazione con cambio versione.
2022-10-18 07:07:37 +02:00
DarioS 35735866a6 EgtCAM5 2.4i2 :
- eliminato modulo MachineAxis.vb già presente in EgtWPFLib5.
2022-09-24 18:55:06 +02:00
DarioS cf13d51a84 EgtCAM5 :
- piccola correzione per caso di caricamento gruppo di lavoro non riuscito.
2022-09-13 09:00:33 +02:00
DarioS 173145ade7 EgtCAM5 2.4i1 :
- miglioria per lancio script InitMach della macchina corretta.
2022-09-12 10:08:30 +02:00
DarioS 07b9ff800d EgtCAM5 2.4h3 :
- modifiche per entrare in modalità LAVORA senza pezzi in modo corretto
2022-08-29 07:29:31 +02:00
DarioS 9e2a9fa1ec EgtCAM5 2.4h2 :
- aggiunto comando Modifica Raggio di Arco o di Circonferenza.
2022-08-21 16:27:04 +02:00
DarioS ef0c2b1f74 EgtCAM5 2.4h1 :
- ricompilazione con cambio versione
- piccola modifica in deseleziona tutto (per evitare di deselezionare oggetti in modifica).
2022-08-17 19:10:51 +02:00
DarioS f42b9c5399 EgtCAM5 2.4g7 :
- ricompilazione con cambio versione.
2022-08-09 18:35:21 +02:00
DarioS 827871073b EgtCAM5 2.4g6 :
- ricompilazione con cambio versione.
2022-08-03 10:28:31 +02:00
DarioS 53ace07386 EgtCAM5 2.4g5 :
- ricompilazione con cambio versione.
2022-08-01 14:49:40 +02:00
DarioS f24c18d0c2 EgtAM5 2.4g4 :
- ricompilazione con cambio versione.
2022-07-29 15:11:45 +02:00
DarioS 1f1e7d6d70 EgtCAM5 2.4g3 :
- ricompilazione con cambio versione.
2022-07-15 07:40:56 +02:00
DarioS 797d1dd70f EgtCAM5 2.4g2 :
- ricompilazione con cambio versione.
2022-07-14 06:39:19 +02:00
DarioS e2a14a746a EgtCAM5 2.4g1 :
- ricompilazione con cambio versione.
2022-07-05 15:18:09 +02:00
DarioS be6eea1054 EgtCAM5 2.4f6 :
- aggiunta possibilità di comando Copia a GunStock.
2022-07-03 18:59:10 +02:00
DarioS 2e70a7c944 EgtCAM5 2.4f5 :
- ricompilazione con cambio versione.
2022-06-27 09:55:59 +02:00
DarioS 6a9885d365 EgtCAM5 2.4f4 :
- ricopilazione e aggiustamenti per nuget.
2022-06-19 12:34:20 +02:00
DarioS 52b08d92b2 EgtCAM5 2.4f3 :
- ricompilazione con cambio versione.
2022-06-17 07:40:11 +02:00
DarioS 2ca14c2fce EgtCAM5 2.4f2 :
- ricompilazione con cambio versione.
2022-06-13 16:31:16 +02:00
Emmanuele Sassi 1c870d55d7 - Modifica per scroll posizioni con tante uscite in SetUp 2022-06-06 19:28:31 +02:00
DarioS 2dd55286c1 EgtCAM5 2.4f1 :
- quando si apre una lavorazione per modificarne i parametri si imposta sempre anche la sua fase.
2022-06-06 07:05:36 +02:00
DarioS 55aca03daa EgtCAM5 :
- non si possono selezionare con mouse oggetti in modo Locked
- aggiunta gestione materiale Additive come Wood.
2022-05-30 07:31:14 +02:00
DarioS 3fa1c51129 EgtCAM5 2.4e4 :
- ricompilazione con cambio versione.
2022-05-21 10:26:21 +02:00
DarioS 455f3c6949 EgtCAM5 2.4e3 :
- ricompilazione con cambio di versione.
2022-05-20 15:54:27 +02:00
DarioS 3ed7a3593c EgtCAM5 2.4e2 :
- modifiche per lancio script Beam e Wall con parametro BW (per ottimizzazioni)
- modifiche per passare agli stessi script il direttorio di esecuzione
- possibilità di settare direttori a parte per 64 bit per esecuzione script Beam e Wall (solo uso interno).
2022-05-09 19:38:25 +02:00
DarioS f9d459134a EgtCAM5 2.4e1 :
- nelle info di generazione CN indico anche se programma a 64 bit.
2022-04-30 11:13:13 +02:00
Emmanuele Sassi 00d2054cd3 - Modifica per segnalare a LUA travi e pareti che comando arriva da BeamWall 2022-04-29 19:09:50 +02:00
DarioS 2b6a9d49ff EgtCAM5 2.4d4 :
- ricompilazione per nuova versione
- aggiunto bit di controllo a chiave per 3dPrinting.
2022-04-27 00:14:39 +02:00
DarioS ac8577206e EgtCAM5 2.4d3 :
- ricompilazione con cambio versione.
2022-04-22 08:54:59 +02:00
DarioS d6395f6b9b EgtCAM5 :
- ricompilazione con cambio versione.
2022-04-19 11:25:10 +02:00
DarioS 3c96fec59b EgtCAM5 2.4d1 :
- ricompilazione con cambio versione.
2022-04-07 11:07:59 +02:00
Emmanuele Sassi 320c5ab1c6 - Introduzione barra per stampa 3d 2022-03-26 14:36:38 +01:00
DarioS 3bf58d9069 EgtCam5 2.4c3 :
- ricompilazione con cambio versione.
2022-03-26 11:30:49 +01:00
DarioS 4ad745b7ce EgtCAM5 :
- corretto errore comando Aggiorna Macchina introdotto aggiungendo comando Aggiorna Licenza in Opzioni.
2022-03-21 09:47:28 +01:00
DarioS 86e30a0cc0 EgtCAM5 2.4c2 :
- ricompilazione con cambio versione.
2022-03-20 18:31:07 +01:00
DarioS f1096b3f15 EgtCAM5 2.4c1 :
- versione 2403
- aggiunto comando per aggiornare licenza in Opzioni-Generale.
2022-03-08 15:07:23 +01:00
DarioS bc2603436f EgtCAM5 2.4b6 :
- aggiunte info su User Level e Debug Level in AboutBox e Log.
2022-02-26 17:54:21 +01:00
DarioS 65b01a750b EgtCAM5 2.4b5 :
- ricompilazione con cambio versione.
2022-02-23 10:54:31 +01:00
DarioS f607d7e12c EgtCAM5 2.4b4 :
- ricompilazione con cambio versione.
2022-02-17 22:29:58 +01:00
DarioS 534fa33a09 EgtCAM5 2.3b3 :
- ricompilazione con cambio versione.
2022-02-15 08:21:00 +01:00
DarioS 9dbd69b0bd Merge branch 'master' of https://gitlab.steamware.net/egaltech/EgtCAM5 2022-02-14 17:48:40 +01:00
DarioS d0412f4e07 EgtCAM5 2.4b2 :
- ricompilazione con cambio versione.
2022-02-14 17:47:01 +01:00
RenzoL 8b9c4c63c3 Merge remote-tracking branch 'origin/RenzoL' 2022-02-09 09:42:55 +01:00
RenzoL 687933571d - Aggiunti i campi Raggio Epicicli e Distanza Epicicli al MachiningParameterExpander, visibili per Pocketing nel caso di Macchina Stone e utensile Polishing 2022-02-09 09:41:43 +01:00
DarioS 5b01e4ebfe EgtCAM5 2.4b1 :
- ricompilazione con cambio versione.
2022-02-03 21:45:32 +01:00
DarioS 211eb17c49 EgtCAM5 2.4a4 :
- quando si sposta una lavorazione da una fase all'altra si aggiorna la fase corrente.
2022-01-26 08:55:32 +01:00
Emmanuele Sassi 4d898e6423 - Ripristinata generazione cnc per ddf con flag opportuno
- Aggiornata versione
2022-01-20 20:02:35 +01:00
RenzoL bc97e3599f Merge branch 'RenzoL' 2022-01-20 14:39:54 +01:00
RenzoL 8eae142985 - VM della Tabella delle lavorazioni delle travi spostato in EgtWPFLib5 2022-01-20 14:38:10 +01:00
DarioS 921996c39c EgtCAM5 2.4a2 :
- aggiunta gestione file OBJ (Alias-Wavefront).
2022-01-14 18:57:26 +01:00
DarioS 747a34d443 EgtCAM5 2.4a1 :
- ricompilazione per cambio versione.
2022-01-04 08:20:06 +01:00
DarioS e338d3d9ea EgtCAM5 2.3l2 :
- ricompilazione per cambio versione.
2021-12-21 05:36:17 +01:00
DarioS 12c65ff40c EgtCAM5 2.3l1 :
- ricompilazione per cambio versione.
2021-12-08 16:47:23 +01:00
DarioS 672686978d EgtCAM5 2.3k5:
- ricompilazione per cambio versione.
2021-11-22 22:58:43 +01:00
RenzoL dca32c5dcc Merge branch 'develop' 2021-11-17 12:14:53 +01:00
DarioS bc7b5d1da3 EgtCAM5 2.3k4 :
- ricompilazione per cambio versione.
2021-11-15 09:56:24 +01:00
DarioS 908d0bf187 EgtCAM5 2.3k3 :
- ricompilazione per cambio versione.
2021-11-08 19:00:45 +01:00
DarioS fee8a11358 EgtCAM5 2.3k2 :
- ricompilazione per cambio versione.
2021-11-04 10:02:53 +01:00
DarioS 8cbb54a541 EgtCAM5 2.3k1 :
- ricompilazione con cambio versione.
2021-11-03 13:26:30 +01:00
DarioS fdf1661f78 EgtCAM5 2.3j7 :
- ricompilazione per cambio versione.
2021-11-02 08:24:51 +01:00
NicolaP 63a7ea25ba Merge branch 'develop' 2021-10-27 19:34:33 +02:00
Emmanuele Sassi 00b02e3a6b Merge branch 'develop' 2021-10-25 19:21:57 +02:00
54 changed files with 1303 additions and 1000 deletions
+1
View File
@@ -16,3 +16,4 @@
/bin
/obj
/.vs
/packages
+31 -6
View File
@@ -4,10 +4,7 @@ Public Class AboutBoxWndV
Private Sub AboutBoxWD_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
DescriptionLbl.Text = My.Application.Info.Description.ToString()
VersionLbl.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()
VersionLbl.Text = "Version : " & GetProgramVersion()
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
Dim sInfo As String = String.Empty
Dim sKey As String = String.Empty
@@ -19,7 +16,8 @@ Public Class AboutBoxWndV
if EgtGetKeyLeftDays( nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays= " (" & nLeftDays.ToString() & ")"
sInfo = If( EgtIsDebug(), "*** Debug Libraries ***" & Environment.NewLine, "")
sInfo &= "User " & Environment.MachineName & "\" & Environment.UserName &
" (" & IniFile.m_nInstance.ToString() & ")" & Environment.NewLine
" Inst" & IniFile.m_nInstance.ToString() &
" Ulv" & IniFile.m_nUserLevel.ToString() & " Dbg" & Map.refMainWindowVM.DebugLevel().ToString() & Environment.NewLine
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
sInfo &= "DataRoot " & IniFile.m_sDataRoot & Environment.NewLine
If IniFile.m_ProjectMode <> ProjectModeOpt.ONLYDRAW Then
@@ -27,7 +25,6 @@ Public Class AboutBoxWndV
Else
sInfo &= "Only Draw Mode" & Environment.NewLine
End If
If IniFile.IsActiveDoors() Then sInfo &= "Doors " & IniFile.m_sDoorsDirPath & Environment.NewLine
Dim sOpSys As String = String.Empty
EgtGetOsInfo( sOpSys)
sInfo &= sOpSys & Environment.NewLine
@@ -40,6 +37,34 @@ Public Class AboutBoxWndV
Dim sScene As String = String.Empty
EgtGetSceneInfo(sScene)
sInfo &= sScene
' Extensions
sInfo &= Environment.NewLine & "Extensions :"
Dim bExtensions As Boolean = False
If IniFile.IsActiveBeam() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sBeamDirPath, sVersion)
sInfo &= Environment.NewLine & "Beam ver. " & sVersion & " " & IniFile.m_sBeamDirPath
End If
If IniFile.IsActiveWall() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sWallDirPath, sVersion)
sInfo &= Environment.NewLine & "Wall ver. " & sVersion & " " & IniFile.m_sWallDirPath
End If
If IniFile.IsActiveDoors() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sDoorsDirPath, sVersion)
sInfo &= Environment.NewLine & "Doors ver. " & sVersion & " " & IniFile.m_sDoorsDirPath
End If
If IniFile.IsActiveGunStock() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sGunstockDirPath, sVersion)
sInfo &= Environment.NewLine & "Gunstock ver. " & sVersion & " " & IniFile.m_sGunstockDirPath
End If
If Not bExtensions Then sInfo &= Environment.NewLine & "---"
InfoLbl.Text = sInfo
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
End Sub
+1
View File
@@ -107,6 +107,7 @@ Class Application
Friend Const SWEPT As String = "Swept"
Friend Const MERGESURF As String = "MergeSurf"
Friend Const EXPLODESURF As String = "ExplodeSurf"
Friend Const APPROXSURF As String = "ApproxSurf"
Friend Const INVERTSURF As String = "InvertSurf"
Friend Const DELETE As String = "Delete"
Friend Const CHANGELAYER As String = "ChangeLayer"
@@ -1,4 +1,6 @@
Public Class BeamMachiningsWindowV
Imports EgtWPFLib5
Public Class BeamMachiningsWindowV
Private WithEvents m_BeamMachiningsWindowVM As BeamMachiningsWindowVM
@@ -1,543 +0,0 @@
Imports System.IO
Imports System.Collections.ObjectModel
Imports EgtUILib
Public Class BeamMachiningsWindowVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private Const MACH_CUT As String = "Cut"
Private Const MACH_DRILL As String = "Drill"
Private Const MACH_MILLING As String = "Milling"
Private Const MACH_POCKETING As String = "Pocketing"
Private Const MACH_SAWING As String = "Sawing"
Private Const MACH_SURFACING As String = "Surfacing"
Private Const ONCONST As String = "On"
Private Const NAME As String = "Name"
Private Const TYPE As String = "Type"
Private Const DATETIME As String = "%DATE_TIME%"
Private Const TABLENAME As String = "%TABLE_NAME%"
Friend Event m_CloseWindow(bDialogResult As Boolean)
Private m_MachiningList As New ObservableCollection(Of String)({MACH_CUT, MACH_DRILL, MACH_MILLING, MACH_POCKETING, MACH_SAWING})
Public ReadOnly Property MachiningList As ObservableCollection(Of String)
Get
Return m_MachiningList
End Get
End Property
Private m_SelMachining As String
Public Property SelMachining As String
Get
Return m_SelMachining
End Get
Set(value As String)
' verifico se pagina precedente modificata
Dim TableModified As Boolean = False
For Each Line In m_TableRowList
If Line.IsModified Then
TableModified = True
Exit For
End If
Next
' se modificata, chiedo se salvare
If TableModified Then
' Salvare le modifiche apportate? - Salva
Select Case MessageBox.Show(EgtMsg(9007), EgtMsg(9006), MessageBoxButton.YesNo, MessageBoxImage.Question)
Case MessageBoxResult.Yes
Save()
Case MessageBoxResult.No
' non devo fare nulla
End Select
End If
m_SelMachining = value
LoadMachiningList()
LoadTypeList()
ReadTableFile()
NotifyPropertyChanged("SelMachining")
End Set
End Property
Private Sub SetSelMachining(value As String)
m_SelMachining = value
LoadMachiningList()
LoadTypeList()
ReadTableFile()
NotifyPropertyChanged("SelMachining")
End Sub
Private m_TableRowList As ObservableCollection(Of GridLine)
Public Property TableRowList As ObservableCollection(Of GridLine)
Get
Return m_TableRowList
End Get
Set(value As ObservableCollection(Of GridLine))
m_TableRowList = value
End Set
End Property
Private m_SelRowIndex As Integer = -1
Public Property SelRowIndex As Integer
Get
Return m_SelRowIndex
End Get
Set(value As Integer)
m_SelRowIndex = value
End Set
End Property
Private m_sTitle As String
Private m_BaseDir As String
Private m_MachTypeFilePath As String
Private m_TableTemplateFilePath As String
Private m_IsBeam As Boolean = True
#Region "Messages"
Public ReadOnly Property Title As String
Get
Return m_sTitle
End Get
End Property
Public ReadOnly Property OnHdr As String
Get
Return EgtMsg( 9001) 'On
End Get
End Property
Public ReadOnly Property NameHdr As String
Get
Return EgtMsg( 9002) 'Nome
End Get
End Property
Public ReadOnly Property TypeHdr As String
Get
Return EgtMsg( 9003) 'Tipo
End Get
End Property
Public ReadOnly Property AddRowMsg As String
Get
Return EgtMsg( 9004) 'Aggiungi
End Get
End Property
Public ReadOnly Property DeleteRowMsg As String
Get
Return EgtMsg( 9005) 'Elimina
End Get
End Property
Public ReadOnly Property SaveMsg As String
Get
Return EgtMsg( 9006) 'Salva
End Get
End Property
#End Region ' Messages
' Definizione comandi
Private m_cmdMoveRowUp As ICommand
Private m_cmdMoveRowDown As ICommand
Private m_cmdAddRow As ICommand
Private m_cmdDeleteRow As ICommand
Private m_cmdSave As ICommand
Private m_cmdClose As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New( sTitle As String, sBaseDir As String, sMachTypePath As String, sTabTemplPath As String, Optional bIsBeam As Boolean = True)
' Titolo del dialogo
m_sTitle = sTitle
' Imposto direttorio base e nomi dei file
m_BaseDir = sBaseDir
m_MachTypeFilePath = sMachTypePath
m_TableTemplateFilePath = sTabTemplPath
' Imposto se per travi o pareti
m_IsBeam = bIsBeam
' Se previste, aggiungo lavorazioni di superfici
Dim sDummy As String = ""
If EgtUILib.GetPrivateProfileString( MACH_SURFACING, "1", "", sDummy, m_MachTypeFilePath) > 0 Then
m_MachiningList.Add(MACH_SURFACING)
End If
' Seleziono la prima lavorazione
If m_MachiningList.Count > 0 Then
SetSelMachining( m_MachiningList(0))
End If
NotifyPropertyChanged( "MachiningList")
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Private Function LoadMachiningList() As Boolean
Dim MachiningList As New List(Of String)
Select Case SelMachining
Case MACH_CUT
If m_IsBeam Then
LoadMachiningListByType(MachiningList, MCH_MY.MILLING, MCH_TF.SAWBLADE)
Else
LoadMachiningListByType(MachiningList, MCH_MY.SAWING, 0)
End If
Case MACH_DRILL
LoadMachiningListByType(MachiningList, MCH_MY.DRILLING, 0)
LoadMachiningListByType(MachiningList, MCH_MY.POCKETING, 0, False)
LoadMachiningListByType(MachiningList, MCH_MY.MILLING, MCH_TF.MILL, False)
Case MACH_MILLING
LoadMachiningListByType(MachiningList, MCH_MY.MILLING, MCH_TF.MILL)
Case MACH_POCKETING
LoadMachiningListByType(MachiningList, MCH_MY.POCKETING, 0)
Case MACH_SAWING
LoadMachiningListByType(MachiningList, MCH_MY.MORTISING, 0)
Case MACH_SURFACING
LoadMachiningListByType(MachiningList, MCH_MY.SURFROUGHING, 0)
LoadMachiningListByType(MachiningList, MCH_MY.SURFFINISHING, 0, False)
End Select
GridLine.SetNamesList(New ObservableCollection(Of String)(MachiningList))
Return True
End Function
Private Function LoadTypeList() As Boolean
Dim TypeList As New List(Of String)
Dim Index As Integer = 1
Dim Type As String = ""
While EgtUILib.GetPrivateProfileString( SelMachining, Index.ToString, "", Type, m_MachTypeFilePath) > 0
TypeList.Add(Type)
Index += 1
End While
GridLine.SetTypeList( New ObservableCollection(Of String)( TypeList))
Return True
End Function
Private Function ReadTableFile() As Boolean
' svuoto la lista
m_TableRowList = New ObservableCollection(Of GridLine)
Dim FilePath As String = m_BaseDir & "\" & SelMachining & "Data.lua"
If Not File.Exists(FilePath) Then Return False
Dim FileContent As String() = File.ReadAllLines(FilePath)
Dim FoundTableName As Boolean = False
For LineIndex As Integer = 0 To FileContent.Count - 1
If FileContent(LineIndex).Contains(SelMachining & "Data") Then
FoundTableName = True
End If
Dim Open As Integer = CountCharacter(FileContent(LineIndex), "{"c)
Dim Close As Integer = CountCharacter(FileContent(LineIndex), "}"c)
If Close > Open Then
If FoundTableName Then
FoundTableName = False
End If
End If
If FoundTableName Then
Dim sOn As String = SearchKey(FileContent(LineIndex), ONCONST)
Dim sName As String = SearchKey(FileContent(LineIndex), NAME)
Dim sType As String = SearchKey(FileContent(LineIndex), TYPE)
If Not String.IsNullOrWhiteSpace(sOn) AndAlso Not String.IsNullOrWhiteSpace(sName) AndAlso Not String.IsNullOrWhiteSpace(sType) Then
If String.Compare(sOn, "true", True) = 0 Then
TableRowList.Add(New GridLine(True, sName, sType))
ElseIf String.Compare(sOn, "false", True) = 0 Then
TableRowList.Add(New GridLine(False, sName, sType))
Else
Continue For
End If
End If
End If
Next
NotifyPropertyChanged("TableRowList")
Return True
End Function
Private Function WriteTableFile() As Boolean
' inizio routine di scrittura
Dim FileContent As String() = File.ReadAllLines(m_TableTemplateFilePath)
Dim NewTableFileContent As New List(Of String)
Dim bBeamTable As Boolean = False
For LineIndex As Integer = 0 To FileContent.Count - 1
Dim sCurrLine As String = FileContent(LineIndex)
sCurrLine = sCurrLine.Replace(DATETIME, System.DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"))
sCurrLine = sCurrLine.Replace(TABLENAME, SelMachining & "Data")
If sCurrLine.Contains(SelMachining & "Data") AndAlso sCurrLine.Contains("=") Then
bBeamTable = True
NewTableFileContent.Add(sCurrLine)
PrintActiveMachiningList(NewTableFileContent)
End If
If Not bBeamTable Then
NewTableFileContent.Add(sCurrLine)
Else
bBeamTable = False
End If
Next
Dim FilePath As String = m_BaseDir & "\" & SelMachining & "Data.lua"
File.WriteAllLines(FilePath, NewTableFileContent, Text.Encoding.UTF8)
Return True
End Function
Private Sub PrintActiveMachiningList(NewTableFileContent As List(Of String))
For Index As Integer = 0 To m_TableRowList.Count - 1
If String.IsNullOrEmpty(m_TableRowList(Index).Name) Then Continue For
Dim CurrentLine As String = " { On = " & If(m_TableRowList(Index).OnPar, "true", "false") & ", Name = '" & m_TableRowList(Index).Name & "', Type = '" & m_TableRowList(Index).Type & "'}"
If Index < m_TableRowList.Count - 1 Then
CurrentLine &= ","
End If
NewTableFileContent.Add(CurrentLine)
Next
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "MoveRowUp"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property MoveRowUp_Command As ICommand
Get
If m_cmdMoveRowUp Is Nothing Then
m_cmdMoveRowUp = New Command(AddressOf MoveRowUp)
End If
Return m_cmdMoveRowUp
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub MoveRowUp()
If SelRowIndex > 0 Then
m_TableRowList.Move(SelRowIndex, SelRowIndex - 1)
End If
End Sub
#End Region ' MoveRowUp
#Region "MoveRowDown"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property MoveRowDown_Command As ICommand
Get
If m_cmdMoveRowDown Is Nothing Then
m_cmdMoveRowDown = New Command(AddressOf MoveRowDown)
End If
Return m_cmdMoveRowDown
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub MoveRowDown()
If SelRowIndex < m_TableRowList.Count - 1 Then
m_TableRowList.Move(SelRowIndex, SelRowIndex + 1)
End If
End Sub
#End Region ' MoveRowDown
#Region "AddRow"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property AddRow_Command As ICommand
Get
If m_cmdAddRow Is Nothing Then
m_cmdAddRow = New Command(AddressOf AddRow)
End If
Return m_cmdAddRow
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub AddRow()
m_TableRowList.Insert(SelRowIndex + 1, New GridLine(False, "", ""))
End Sub
#End Region ' AddRow
#Region "DeleteRow"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property DeleteRow_Command As ICommand
Get
If m_cmdDeleteRow Is Nothing Then
m_cmdDeleteRow = New Command(AddressOf DeleteRow)
End If
Return m_cmdDeleteRow
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub DeleteRow()
m_TableRowList.RemoveAt(SelRowIndex)
End Sub
#End Region ' DeleteRow
#Region "Save"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property Save_Command As ICommand
Get
If m_cmdSave Is Nothing Then
m_cmdSave = New Command(AddressOf Save)
End If
Return m_cmdSave
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub Save()
' scrivo il file
WriteTableFile()
' resetto le modifiche
For Each Line In m_TableRowList
Line.ResetIsModified()
Next
End Sub
#End Region ' Save
#Region "Close"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property Close_Command As ICommand
Get
If m_cmdClose Is Nothing Then
m_cmdClose = New Command(AddressOf Close)
End If
Return m_cmdClose
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub Close()
' verifico se pagina precedente modificata
Dim TableModified As Boolean = False
For Each Line In m_TableRowList
If Line.IsModified Then
TableModified = True
Exit For
End If
Next
' se modificata, chiedo se salvare
If TableModified Then
' Salvare le modifiche apportate? - Salva
Select Case MessageBox.Show( EgtMsg( 9007), EgtMsg( 9006), MessageBoxButton.YesNo, MessageBoxImage.Question)
Case MessageBoxResult.Yes
Save()
Case MessageBoxResult.No
' non devo fare nulla
End Select
End If
RaiseEvent m_CloseWindow(True)
End Sub
#End Region ' Close
#End Region ' COMMANDS
End Class
Public Class GridLine
Inherits VMBase
Friend ReadOnly Property IsModified As Boolean
Get
Return m_IsOnModified Or m_IsNameModified Or m_IsTypeModified
End Get
End Property
Friend Sub ResetIsModified()
m_IsOnModified = False
m_IsNameModified = False
m_IsTypeModified = False
End Sub
Private m_IsOnModified As Boolean = False
Private m_On As Boolean
Public Property OnPar As Boolean
Get
Return m_On
End Get
Set(value As Boolean)
m_On = value
m_IsOnModified = True
End Set
End Property
Private Shared m_NamesList As ObservableCollection(Of String)
Public ReadOnly Property NamesList As ObservableCollection(Of String)
Get
Return m_NamesList
End Get
End Property
Friend Shared Sub SetNamesList(NamesList As ObservableCollection(Of String))
m_NamesList = NamesList
End Sub
Private m_IsNameModified As Boolean = False
Private m_Name As String
Public Property Name As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
m_IsNameModified = True
End Set
End Property
Private Shared m_TypeList As ObservableCollection(Of String)
Public ReadOnly Property TypeList As ObservableCollection(Of String)
Get
Return m_TypeList
End Get
End Property
Friend Shared Sub SetTypeList(TypeList As ObservableCollection(Of String))
m_TypeList = TypeList
End Sub
Private m_IsTypeModified As Boolean = False
Private m_Type As String
Public Property Type As String
Get
Return m_Type
End Get
Set(value As String)
m_Type = value
m_IsTypeModified = True
End Set
End Property
Sub New(bOnPar As Boolean, sName As String, sType As String)
m_On = bOnPar
m_Name = sName
m_Type = sType
End Sub
End Class
+10 -1
View File
@@ -45,6 +45,7 @@ Module ConstIni
Public Const K_LIBSDIR As String = "LibsDir"
Public Const K_LIBSDIR64 As String = "LibsDir64"
Public Const K_BASELIB As String = "BaseLib"
Public Const K_BWSIM As String = "BWSim"
Public Const S_GEOMDB As String = "GeomDB"
Public Const K_DEFAULTFONT As String = "DefaultFont"
@@ -109,6 +110,7 @@ Module ConstIni
Public Const K_DXFFLAG As String = "DxfFlag"
Public Const K_IMGWIDTH As String = "ImgWidth"
Public Const K_IMGHEIGHT As String = "ImgHeight"
Public Const K_THREEJSLIBDIR As String = "ThreeJSLibDir"
Public Const S_SPECIAL As String = "Special"
Public Const K_SPECIALENABLE As String = "SpecialEnable"
@@ -117,6 +119,7 @@ Module ConstIni
Public Const S_BEAM As String = "Beam"
Public Const K_BEAMENABLE As String = "BtlEnable"
Public Const K_BEAMBASEDIR As String = "BaseDir"
Public Const K_BEAMBASEDIR64 As String = "BaseDir64"
Public Const K_BEAMBTLEXEC As String = "BtlExec"
Public Const K_BEAMBWEEXEC As String = "BweExec"
Public Const K_BEAMMACHINES As String = "Machines"
@@ -125,15 +128,19 @@ Module ConstIni
Public Const S_WALL As String = "Wall"
Public Const K_WALLENABLE As String = "BtlEnable"
Public Const K_WALLBASEDIR As String = "BaseDir"
Public Const K_WALLBASEDIR64 As String = "BaseDir64"
Public Const K_WALLBTLEXEC As String = "BtlExec"
Public Const K_WALLBWEEXEC As String = "BweExec"
Public Const K_WALLBUTTON As String = "Button"
Public Const S_BEAMWALL As String = "BeamWall"
Public Const K_BEAMWALLENABLE As String = "BtlEnable"
Public Const K_BEAMWALLBASEDIR As String = "BaseDir"
Public Const K_BEAMWALLBUTTON As String = "Button"
Public Const S_PRINTING3D As String = "3dPrinting"
Public Const K_ENABLE As String = "Enable"
Public Const K_3PRNBASEDIR As String = "BaseDir"
Public Const S_DOORS As String = "Doors"
Public Const K_DDFENABLE As String = "DdfEnable"
Public Const K_BASEDIR As String = "BaseDir"
@@ -153,8 +160,10 @@ Module ConstIni
Public Const K_WRITEPEZFUNCTION As String = "WritePezFun"
Public Const K_READPEZFUNCTION As String = "ReadPezFun"
Public Const K_CREATEFUNCTION As String = "CreateFun"
Public Const K_COPYFUNCTION As String = "CopyFun"
Public Const K_MODDIR As String = "ModDir"
Public Const K_PEZDIR As String = "PezDir"
Public Const K_COPYDIR As String = "CopyDir"
Public Const S_MACH As String = "Mach"
Public Const K_MACHINESDIR As String = "MachinesDir"
+10
View File
@@ -170,6 +170,11 @@
Command="{Binding InvertSurfCommand}" IsEnabled="{Binding bSelOk}">
<Image Source="/Resources/DrawPanel/InvertSurf.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding ApproxSurfToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding ApproxSurfCommand}" IsEnabled="{Binding bSelOk}">
<Image Source="/Resources/DrawPanel/ApproxSurf.png" Stretch="Uniform"/>
</Button>
</UniformGrid>
</Expander>
<Expander Name="Modify" Style="{StaticResource ExpanderStyle}" Grid.Row="2" IsExpanded="{Binding ModifyIsExpanded}">
@@ -284,6 +289,11 @@
Command="{Binding ApproxCurveCommand}" IsEnabled="{Binding bSelOk}">
<Image Source="/Resources/DrawPanel/ApproxCurve.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding ModifyArcRadiusToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding ModifyArcRadiusCommand}" IsEnabled="{Binding bSelOk}">
<Image Source="/Resources/DrawPanel/ModifyArcRadius.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding ModifyTextToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding ModifyTextCommand}" IsEnabled="{Binding bSelOk}">
+62 -4
View File
@@ -146,6 +146,11 @@ Public Class DrawPanelVM
Return EgtMsg( 5221) 'Esplodi Superfici e Regioni Piane
End Get
End Property
Public ReadOnly Property ApproxSurfToolTip As String
Get
Return EgtMsg( 5165) 'Approssima Superfici e Regioni Piane
End Get
End Property
Public ReadOnly Property ExtractSurfFacetToolTip As String
Get
Return EgtMsg( 5158) 'Estrai Faccia da Superficie
@@ -289,12 +294,17 @@ Public Class DrawPanelVM
End Property
Public ReadOnly Property ApproxCurveToolTip As String
Get
Return EgtMsg( 5163)
Return EgtMsg(5163)
End Get
End Property
Public ReadOnly Property ModifyArcRadiusToolTip As String
Get
Return EgtMsg(5164)
End Get
End Property
Public ReadOnly Property ModifyTextToolTip As String
Get
Return EgtMsg(MSG_DRAWPANEL + 49)
Return EgtMsg(5249)
End Get
End Property
@@ -443,6 +453,7 @@ Public Class DrawPanelVM
Private m_cmdRuled As ICommand
Private m_cmdMergeSurf As ICommand
Private m_cmdExplodeSurf As ICommand
Private m_cmdApproxSurf As ICommand
Private m_cmdExtractSurfFacet As ICommand
Private m_cmdInvertSurf As ICommand
Private m_cmdExtractLoops As ICommand
@@ -467,6 +478,7 @@ Public Class DrawPanelVM
Private m_cmdFillet As ICommand
Private m_cmdChamfer As ICommand
Private m_cmdArcFlip As ICommand
Private m_cmdModifyArcRadius As ICommand
Private m_cmdModifyText As ICommand
Private m_cmdMove As ICommand
Private m_cmdRotate As ICommand
@@ -1140,7 +1152,7 @@ Public Class DrawPanelVM
''' </summary>
Public Sub ExplodeSurf(ByVal param As Object)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.EXTRACTSURFFACET)
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.SURFTMTOTRIANGLES)
Else
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.EXPLODESURF)
End If
@@ -1148,6 +1160,29 @@ Public Class DrawPanelVM
#End Region ' ExplodeSurfCommand
#Region "ApproxSurfCommand"
''' <summary>
''' Returns a command that do ApproxSurf.
''' </summary>
Public ReadOnly Property ApproxSurfCommand As ICommand
Get
If m_cmdApproxSurf Is Nothing Then
m_cmdApproxSurf = New RelayCommand(AddressOf ApproxSurf)
End If
Return m_cmdApproxSurf
End Get
End Property
''' <summary>
''' Execute the ApproxSurf. This method is invoked by the ApproxSurfCommand.
''' </summary>
Public Sub ApproxSurf(ByVal param As Object)
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.APPROXSURF)
End Sub
#End Region ' ApproxSurfCommand
#Region "ExtractSurfFacetCommand"
''' <summary>
@@ -1169,7 +1204,7 @@ Public Class DrawPanelVM
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.EXTRACTSURFFACET)
End Sub
#End Region ' ExplodeSurfCommand
#End Region ' ExtractSurfFacetCommand
#Region "InvertSurfCommand"
@@ -1726,6 +1761,29 @@ Public Class DrawPanelVM
#End Region ' ArcFlipCommand
#Region "ModifyArcRadiusCommand"
''' <summary>
''' Returns a command that do ModifyArcRadius.
''' </summary>
Public ReadOnly Property ModifyArcRadiusCommand As ICommand
Get
If m_cmdModifyArcRadius Is Nothing Then
m_cmdModifyArcRadius = New RelayCommand(AddressOf ModifyArcRadius)
End If
Return m_cmdModifyArcRadius
End Get
End Property
''' <summary>
''' Execute the ModifyArcRadius. This method is invoked by the ModifyArcRadiusCommand.
''' </summary>
Public Sub ModifyArcRadius(ByVal param As Object)
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.MODIFYARCRADIUS)
End Sub
#End Region ' ModifyTextCommand
#Region "ModifyTextCommand"
''' <summary>
+27 -8
View File
@@ -97,13 +97,17 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtUILib">
<Reference Include="EgtUILib, Version=2.4.6.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="EgtWPFLib5">
<Reference Include="EgtWPFLib, Version=2.4.5.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\DllD32\EgtWPFLib.dll</HintPath>
</Reference>
<Reference Include="EgtWPFLib5, Version=2.4.6.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\DllD32\EgtWPFLib5.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Ionic.Zip">
<HintPath>..\..\EgtProg\EgtCAM5\Ionic.Zip.dll</HintPath>
@@ -116,8 +120,7 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\EgtCAM5\System.Windows.Interactivity.dll</HintPath>
<HintPath>packages\EgtWPFLib5.2.4.6.1\lib\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@@ -150,7 +153,6 @@
<Compile Include="BeamMachiningsWindow\BeamMachiningsWindowV.xaml.vb">
<DependentUpon>BeamMachiningsWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="BeamMachiningsWindow\BeamMachiningsWindowVM.vb" />
<Compile Include="CurrSetUp\CurrSetUpV.xaml.vb">
<DependentUpon>CurrSetUpV.xaml</DependentUpon>
</Compile>
@@ -234,6 +236,10 @@
<DependentUpon>SetUpV.xaml</DependentUpon>
</Compile>
<Compile Include="SetUp\SetUpVM.vb" />
<Compile Include="Special-3dPrinting\Printing3DPanelV.xaml.vb">
<DependentUpon>Printing3DPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="Special-3dPrinting\Printing3DPanelVM.vb" />
<Compile Include="Special-BeamWall\Beam.vb" />
<Compile Include="Command\Command.vb" />
<Compile Include="Command\RelayCommand.vb" />
@@ -344,7 +350,6 @@
<DependentUpon>MachiningParameterExpanderV.xaml</DependentUpon>
</Compile>
<Compile Include="OptionPanel\MachiningOptionPanel\OperationExpander\OperationListBoxItem\OperationListBoxItem.vb" />
<Compile Include="OptionPanel\MachiningOptionPanel\SimulationExpander\MachineAxis.vb" />
<Compile Include="PopUpGridPanel\PopUpGridPanelV.xaml.vb">
<DependentUpon>PopUpGridPanelV.xaml</DependentUpon>
</Compile>
@@ -523,6 +528,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Special-3dPrinting\Printing3DPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Special-BeamWall\BeamWallPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -720,6 +729,7 @@
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<AppDesigner Include="My Project\" />
<None Include="packages.config" />
<Resource Include="Resources\Fonts\gothic.ttf" />
</ItemGroup>
<ItemGroup>
@@ -943,6 +953,15 @@
<ItemGroup>
<Resource Include="Resources\DrawPanel\ApproxCurve.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\DrawPanel\ModifyArcRadius.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\DrawPanel\ApproxSurf.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopCommandBar\Print.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtCAM5\EgtCAM5R32.exe
+5 -5
View File
@@ -59,7 +59,7 @@ Public Class MruList
End Sub
'---------------------------------------------------------------------------
Public Sub Add(ByVal sFileName As String)
Public Sub Add(sFileName As String)
' Gestione '_'
Dim sMyFileName As String = sFileName.Replace("_", "__")
' Se stringa vuota, esco subito
@@ -84,7 +84,7 @@ Public Class MruList
End Sub
'---------------------------------------------------------------------------
Private Function FileNameIndex(ByVal sFileName As String) As Integer
Private Function FileNameIndex(sFileName As String) As Integer
For i As Integer = 0 To m_FileNames.Count - 1
If String.Compare(m_FileNames(i).ToString, sFileName, True) = 0 Then
Return i
@@ -94,7 +94,7 @@ Public Class MruList
End Function
'---------------------------------------------------------------------------
Public Sub Remove(ByVal sFileName As String)
Public Sub Remove(sFileName As String)
' Gestione '_'
Dim sMyFileName As String = sFileName.Replace("_", "__")
' Rimozione
@@ -108,8 +108,8 @@ Public Class MruList
End Sub
'---------------------------------------------------------------------------
Public Function GetFileName(ByVal nInd As Integer, ByRef sFileName As String) As Boolean
If nInd > 0 And nInd <= m_FileNames.Count() Then
Public Function GetFileName(nInd As Integer, ByRef sFileName As String) As Boolean
If nInd >= 0 And nInd < m_FileNames.Count() Then
' Gestione '_'
sFileName = m_FileNames(nInd).ToString().Replace("__", "_")
Return True
+13 -4
View File
@@ -99,16 +99,16 @@ Public Class MyMachGroupPanelVM
Return -2
End If
End If
' Se non ci sono pezzi selezionati
' Se non ci sono pezzi selezionati
Else
' se ci sono gruppi di lavorazione
If bMachGroup Then
nGroupId = EgtGetLastMachGroup()
Return If(EgtSetCurrMachGroup(nGroupId), 0, 1)
' se altrimenti ammessi gruppi di lavoro vuoti
' se altrimenti ammessi gruppi di lavoro vuoti
ElseIf bAllowEmpty Then
Return If(AddNewMachGroup(nGroupId, vPart), 0, 1)
' altrimenti esco
' altrimenti esco
Else
Return -1
End If
@@ -208,6 +208,13 @@ Public Class MyMachGroupPanelVM
EgtOutLog("Errore nel posizionamento dei pezzi")
Return False
End If
Else
Dim sTabNames As String = ""
EgtGetAllTablesNames(sTabNames)
Dim sItems() As String = sTabNames.Split(","c).ToArray
If sItems.Count() > 0 Then
EgtSetTable( sItems(0))
End If
End If
Else
EgtOutLog("Machine without InitDisp script.")
@@ -290,8 +297,10 @@ Public Class MyMachGroupPanelVM
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD
Case "Beam"
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.BEAM
Case "Additive"
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD
Case Else
' Se il materiale spcificato nel file INI della macchina non corrisponde ai 2 sopracitati viene emesso un messaggio di errore
' Se il materiale specificato nel file INI della macchina non corrisponde ai 4 sopracitati viene emesso un messaggio di errore
EgtWPFLib5.MachiningTreeViewItem.m_MatType = Nothing
MsgBox(EgtMsg(31409), MsgBoxStyle.Exclamation, EgtMsg(31551))
End Select
+25 -17
View File
@@ -14,13 +14,15 @@ Public Class MainWindowVM
Private m_objMutex As Mutex
Private m_sDataRoot As String = String.Empty
Private m_sConfigDir As String = String.Empty
Private m_nDebug As Integer = 0
' EGALTECH ENVIRONMENT FIELDS WITH PROPERTY
' GRAPHICAL FIELDS
' Event commands
' MainWindow ContentRendered Event
Private m_nDebug As Integer = 0
Public ReadOnly Property DebugLevel As Integer
Get
Return m_nDebug
End Get
End Property
Private m_sVersion As String = "1.1a1"
Public ReadOnly Property Version As String
@@ -65,7 +67,6 @@ Public Class MainWindowVM
End Property
' GRAPHICAL FIELDS WITH PROPERTY
Private m_StatusBar As StatusBarV
Private m_bfirst As Boolean = True
Public ReadOnly Property StatusBar As StatusBarV
@@ -354,8 +355,10 @@ Public Class MainWindowVM
EgtUILib.GetPrivateProfileString( S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
EgtSetNestKey( sNestKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2310, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2310, 1, IniFile.m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2505, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2505, 1, IniFile.m_nKeyOptions)
' Leggo e imposto livello utilizzatore
IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
' Inizializzazione generale di EgtInterface
m_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sVersion = My.Application.Info.Version.Major.ToString() & "." &
@@ -363,9 +366,12 @@ Public Class MainWindowVM
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
My.Application.Info.Version.Revision.ToString()
IniFile.m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", IniFile.m_nInstance.ToString())
Dim sLogMsg As String = "User " & Environment.MachineName & "\" & Environment.UserName & " (" & IniFile.m_nInstance.ToString() & ")" & vbLf &
Dim sLogMsg As String = "User " & Environment.MachineName & "\" & Environment.UserName &
" Inst" & IniFile.m_nInstance.ToString() &
" Ulv" & IniFile.m_nUserLevel.ToString() & " Dbg" & DebugLevel().ToString() & vbLf &
My.Application.Info.Title.ToString() & " ver. " & m_sVersion
EgtInit(m_nDebug, IniFile.m_sLogFile, sLogMsg)
EgtSetUserLevel( IniFile.m_nUserLevel)
' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione)
Dim sMsgDir As String = String.Empty
If GetPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
@@ -378,18 +384,20 @@ Public Class MainWindowVM
If Not EgtLoadMessages(sMsgFilePath) Then
EgtOutLog("Error in EgtLoadMessages")
End If
' Leggo e imposto livello utilizzatore
IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
' imposto dir font Nfe e font default
' Imposto dir font Nfe e font default
Dim sNfeDir As String = String.Empty
GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
GetPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", OptionModule.m_sFontText)
EgtSetFont(sNfeDir, OptionModule.m_sFontText)
' imposto direttorio ausiliario per import/gestione BTL
' Imposto direttorio ausiliario per import/gestione BTL
Dim sBtlAuxDir As String = String.Empty
GetPrivateProfileString(S_IMPORT, K_BTLAUXDIR, "", sBtlAuxDir)
EgtSetBtlAuxDir(sBtlAuxDir)
' imposto dir di default per libreria Lua e lancio libreria di base
' Imposto direttorio libreria per export ThreeJs
Dim sThreeJSLibDir As String = String.Empty
GetPrivateProfileString(S_EXPORT, K_THREEJSLIBDIR, "", sThreeJSLibDir)
EgtSetThreeJSLibDir(sThreeJSLibDir)
' Imposto dir di default per libreria Lua e lancio libreria di base
Dim sLuaLibsDir As String = String.Empty
GetPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
#If PLATFORM = "x64" Then
@@ -399,11 +407,11 @@ Public Class MainWindowVM
Dim sLuaBaseLib As String = String.Empty
GetPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
EgtLuaRequire(sLuaBaseLib)
' imposto direttorio temporaneo a EgtInterface
' Imposto direttorio temporaneo a EgtInterface
EgtSetTempDir(m_sTempDir)
' imposto IniFile a EgtInterface
' Imposto IniFile a EgtInterface
EgtSetIniFile(m_sIniFile)
' verifico se avviare programma in modalità CAD-ONLY
' Verifico se avviare programma in modalità CAD-ONLY
IniFile.m_ProjectMode = If(GetPrivateProfileInt(S_GENERAL, K_ONLYDRAW, 0) = 0, ProjectModeOpt.DRAW, ProjectModeOpt.ONLYDRAW)
' Impostazioni MruLists
m_MruFiles.Init(S_MRUFILES, 8)
@@ -448,7 +456,7 @@ Public Class MainWindowVM
Dim nTmp As Integer = GetPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
IniFile.m_nInstance = 1
Dim nMask As Integer = 1
While (nTmp And nMask) <> 0 And IniFile.m_nInstance < MAX_INST
While (nTmp And nMask) <> 0 And IniFile.m_nInstance <= MAX_INST
IniFile.m_nInstance += 1
nMask *= 2
End While
+5 -5
View File
@@ -28,9 +28,9 @@ Imports System.Windows
<Assembly: AssemblyDescription("EgtCAM5 32 bit")>
#End If
#End If
<Assembly: AssemblyCompany("EgalTech s.r.l.")>
<Assembly: AssemblyProduct("EgtCAM5")>
<Assembly: AssemblyCopyright("Copyright © 2016-2021 by EgalTech s.r.l.")>
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgtCAM5")>
<Assembly: AssemblyCopyright("Copyright © 2016-2023 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
@@ -70,6 +70,6 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.3.10.6")>
<Assembly: AssemblyFileVersion("2.3.10.6")>
<Assembly: AssemblyVersion("2.5.5.2")>
<Assembly: AssemblyFileVersion("2.5.5.2")>
@@ -69,6 +69,7 @@ Public Class LayerTreeViewItem
Return m_bOnOff
End Get
Set(value As Boolean)
If Map.refProjectVM.GetController().GetStep() <> 0 Then Return
If m_bOnOff <> value Then
m_bOnOff = value
' se abilitato, eseguo operazione
@@ -82,20 +83,24 @@ Public Class LayerTreeViewItem
End If
Dim bOnOffGroup As Boolean = ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) AndAlso Items.Count > 0
If bOnOffGroup Then
EgtEnableCommandLogger()
' abilito/disabilito tutti i nodi del livello sotto di esso (e non oltre)
For Each Node In Items
Node.m_bOnOff = value
' se abilitato, eseguo operazione
If m_SendCmd Then
Map.refProjectVM.SetLastInteger(Node.Id)
If value Then
Map.refProjectVM.ExecuteCommand(Controller.CMD.SHOW)
Else
Map.refProjectVM.ExecuteCommand(Controller.CMD.HIDE)
Dim nStat As Integer
EgtGetStatus(Node.Id, nStat)
If value AndAlso nStat <> GDB_ST.ON_ Then
EgtSetStatus(Node.Id, GDB_ST.ON_)
ElseIf nStat <> GDB_ST.OFF Then
EgtSetStatus(Node.Id, GDB_ST.OFF)
End If
End If
Node.NotifyPropertyChanged(NameOf(OnOff))
Next
EgtDisableCommandLogger()
EgtDraw()
End If
End If
End Set
@@ -168,6 +168,18 @@ Public Class MachiningParameterExpanderVM
StoneSawFinishParamExpanderV.DataContext = m_CurrOperation
Return StoneSawFinishParamExpanderV
Case MCH_OY.POCKETING
If MatType = MaterialType.STONE Or MatType = MaterialType.STONE5 Then
' se macchina di tipo STONE ricavo il tipo di utensile
Dim sMachiningToolName = String.Empty
EgtMdbSetCurrMachining(sName)
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sMachiningToolName)
EgtTdbSetCurrTool(sMachiningToolName)
Dim dValue As Double = 0
Dim nToolType As Integer
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nToolType)
' se utensile di tipo POLISHING rendo visibili i campi sugli epicicli
If nToolType = MCH_TY.MILL_POLISHING Then m_CurrOperation.Epicycles_Visibility = Visibility.Visible
End If
PocketParamExpanderV.DataContext = m_CurrOperation
Return PocketParamExpanderV
Case MCH_OY.MORTISING
@@ -402,9 +414,10 @@ Public Class MachiningParameterExpanderVM
Dim sInfo As String = String.Empty
EgtGetOutstrokeInfo(sInfo)
If Not String.IsNullOrEmpty(sInfo) Then sErr &= " " & sInfo
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
' Errore nel calcolo della lavorazione!
MessageBox.Show(EgtMsg(5345), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Else
If EgtGetMachMgrWarningId(0) <> 0 Then
@@ -146,6 +146,20 @@
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:StringParamV
ParamTxBl="{Binding EpicyclesRadTxBl}"
ParamTxBx="{Binding Path=EpicyclesRad,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"
Visibility="{Binding Epicycles_Visibility}"/>
<EgtWPFLib5:StringParamV
ParamTxBl="{Binding EpicyclesDistTxBl}"
ParamTxBx="{Binding Path=EpicyclesDist,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"
Visibility="{Binding Epicycles_Visibility}"/>
<EgtWPFLib5:StringParamV
ParamTxBl="{Binding SideAngleTxBl}"
ParamTxBx="{Binding Path=SideAngle,
@@ -109,6 +109,7 @@ Public Class OperationParametersExpanderVM
Exit For
End If
Next
If IsNothing(selOperation) Then Return False
If IsValidDispositionType(selOperation.m_Type) Then
ParametersExpanderName = selOperation.Name
@@ -136,6 +137,8 @@ Public Class OperationParametersExpanderVM
End While
EgtDraw()
ElseIf IsValidMachiningType(selOperation.m_Type) Then
' Imposto la fase di lavorazione corrente
EgtSetCurrPhase(EgtGetOperationPhase(selOperation.m_Id))
' Leggo il tipo di operazione per impostare il tipo di selezione
EgtSetCurrMachining(selOperation.m_Id)
Dim sOpMach As String = String.Empty
@@ -488,6 +488,7 @@ Public Class OperationsListExpanderVM
OnPropertyChanged( "MoveDown_IsEnabled")
Map.refProjectVM.EmitTitle()
Else
Dim nCurrPhase As Integer = EgtGetOperationPhase(LastSelectedId)
For index As Integer = 0 To indexes.Count - 1
Dim nOpeId As Integer = OperationList( indexes( index) - 1).Id
If EgtGetOperationType( nOpeId) <> MCH_OY.DISP Then
@@ -500,6 +501,8 @@ Public Class OperationsListExpanderVM
EgtSetCurrMachining( PreviousId)
EgtApplyMachining( False)
End If
Dim nNewPhase As Integer = EgtGetOperationPhase(LastSelectedId)
If nNewPhase <> nCurrPhase Then EgtSetCurrPhase( nNewPhase)
EgtDraw()
OnPropertyChanged( NameOf(MoveUp_IsEnabled))
OnPropertyChanged( NameOf(MoveDown_IsEnabled))
@@ -1,129 +0,0 @@
Imports System.ComponentModel
Imports EgtUILib
Public Class MachineAxis
Implements INotifyPropertyChanged
Private m_IsReadOnlyAxesValue As Boolean
Public Property IsReadOnlyAxesValue As Boolean
Get
Return m_IsReadOnlyAxesValue
End Get
Set(value As Boolean)
If value <> m_IsReadOnlyAxesValue Then
m_IsReadOnlyAxesValue = value
NotifyPropertyChanged("IsReadOnlyAxesValue")
NotifyPropertyChanged("IsEnabledAxesValue")
End If
End Set
End Property
Public ReadOnly Property IsEnabledAxesValue As Boolean
Get
Return Not m_IsReadOnlyAxesValue
End Get
End Property
' Definizione comandi
Private m_cmdManualAxisModify As ICommand
Private m_Name As String
Public Property Name As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
UpdateInvert()
End Set
End Property
Private m_Token As String
Public Property Token As String
Get
Return m_Token
End Get
Set(value As String)
If value <> m_Token Then
m_Token = value
NotifyPropertyChanged("Token")
End If
End Set
End Property
Private m_bLinear As Boolean = True
Public WriteOnly Property Linear As Boolean
Set(value As Boolean)
m_bLinear = value
End Set
End Property
Private m_bInvert As Boolean = False
Private Function UpdateInvert() As Boolean
Return EgtGetAxisInvert(m_Name, m_bInvert)
End Function
Private m_Value As String
Public Property Value As String
Get
Return m_Value
End Get
Set(value As String)
m_Value = value
NotifyPropertyChanged("Value")
End Set
End Property
Sub New()
IsReadOnlyAxesValue = True
End Sub
#Region "COMMANDS"
#Region "ManualAxisModifyCommand"
''' <summary>
''' Returns a command that create a new tool.
''' </summary>
Public ReadOnly Property ManualAxisModifyCommand As ICommand
Get
If m_cmdManualAxisModify Is Nothing Then
m_cmdManualAxisModify = New Command(AddressOf ManualAxisModify)
End If
Return m_cmdManualAxisModify
End Get
End Property
''' <summary>
''' Creata the new tool. This method is invoked by the NewCommand.
''' </summary>
Public Sub ManualAxisModify(ByVal param As Object)
Dim dVal As Double
If m_bLinear Then
StringToLen(m_Value, dVal)
Else
StringToDouble(m_Value, dVal)
End If
If m_bInvert Then dVal = -dVal
EgtSetAxisPos(m_Name, dVal)
EgtGetAxisPos(m_Name, dVal)
If m_bInvert Then dVal = -dVal
If m_bLinear Then
Value = LenToString(dVal, -3)
Else
Value = DoubleToString(dVal, -3)
End If
EgtDraw()
End Sub
#End Region ' ManualAxisModifyCommand
#End Region
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Public Sub NotifyPropertyChanged(propName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
End Sub
End Class
@@ -87,14 +87,12 @@
<TextBlock Text="{Binding Token}" FontSize="15"
HorizontalAlignment="Center" VerticalAlignment="Center"
TextWrapping="Wrap" TextAlignment="Center"/>
<TextBox Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1"
IsReadOnly="{Binding IsReadOnlyAxesValue}"
IsEnabled="{Binding IsEnabledAxesValue}"
TextAlignment="Right">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding ManualAxisModifyCommand}"/>
</TextBox.InputBindings>
</TextBox>
<EgtWPFLib5:EgtTextBox Text="{Binding Value, UpdateSourceTrigger=Explicit}" Grid.Column="1"
ExplicitUpdateSource="EnterKeyPress"
IsReadOnly="{Binding IsReadOnlyAxesValue}"
IsEnabled="{Binding IsEnabledAxesValue}"
TextAlignment="Right">
</EgtWPFLib5:EgtTextBox>
</Grid>
</DataTemplate>
@@ -198,10 +198,12 @@ Public Class SimulationExpanderVM
Dim nPhase As Integer = EgtGetCurrPhase()
' Aggiorno le lavorazioni
If Not UpdateAllMachinings() Then EgtSetCurrPhase(If(nPhase = 0, 1, nPhase), True)
' Inizio simulazione
Dim bOk As Boolean = EgtSimInit() AndAlso EgtSimStart()
' Costringo ad aggiornare UI
UpdateUI()
' Inizio simulazione
If Not EgtSimInit() OrElse Not EgtSimStart() Then
' Messaggio in caso di errore
If Not bOk Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
@@ -385,7 +387,11 @@ Public Class SimulationExpanderVM
End If
End If
sCncFile = ""
sInfo = "EgtCAM5 ver." & Map.refMainWindowVM.Version() & " - " & sCurrFilePath
#If PLATFORM = "x64" Then
sInfo = "EgtCAM5 64bit ver." & Map.refMainWindowVM.Version() & " - " & sCurrFilePath
#Else
sInfo = "EgtCAM5 ver." & Map.refMainWindowVM.Version() & " - " & sCurrFilePath
#End If
If EgtGetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_NCNAME, sCncFile) AndAlso Not String.IsNullOrWhiteSpace(sCncFile) Then
sCncFile = Path.GetDirectoryName(sCurrFilePath) & "\" & sCncFile
Else
+17 -4
View File
@@ -59,6 +59,13 @@ Friend Module OptionModule
' Variabile che indica se usare lo script per calcolare automaticamente la disposizione quando si passa in lavorazione
Friend m_bUseDispositionScript As Boolean
' Variabili per gli Extra
Friend m_bSpecialOn As Boolean
Friend m_bBeamOn As Boolean
Friend m_bWallOn As Boolean
Friend m_bDoorsOn As Boolean
Friend m_bGunstockOn As Boolean
' inizializzazione lettura variabili ad inizio programma
Friend Sub InitOptionModule()
' Leggo elenco lingue disponibili da file ini
@@ -95,9 +102,9 @@ Friend Module OptionModule
GetPrivateProfileColor(S_GRID, K_MINLNCOLOR, GridColor)
m_GridColor = GridColor
' Inizializzo flag linee ingrossate
m_bThickLine = GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1
m_bThickLine = ( GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1)
' Inizializzo flag visualizzazione smussata delle superfici
m_bSmoothTriMesh = GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0
m_bSmoothTriMesh = ( GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
' Inizio colore di default in disegno
Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
@@ -136,9 +143,15 @@ Friend Module OptionModule
m_SelGeomSurfFinishing = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
m_SelGeomWaterJetting = SceneSelModeOpt.PARTCURVES
' Inizializzo variabile che indica posizione nuova operazione di lavorazione
m_bNewMachiningIsLastOne = If(GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0, True, False)
m_bNewMachiningIsLastOne = (GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0)
' Inizializzo variabile che indica se usare script di disposizione
m_bUseDispositionScript = If(GetPrivateProfileInt(S_OPTIONS, K_USEDISPOSITIONSCRIPT, 0) <> 0, True, False)
m_bUseDispositionScript = (GetPrivateProfileInt(S_OPTIONS, K_USEDISPOSITIONSCRIPT, 0) <> 0)
' Inizializzo variabili per Extra
m_bSpecialOn = (GetPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) <> 0)
m_bBeamOn = (GetPrivateProfileInt(S_BEAM, K_BEAMENABLE, 0) <> 0)
m_bWallOn = (GetPrivateProfileInt(S_WALL, K_WALLENABLE, 0) <> 0)
m_bDoorsOn = (GetPrivateProfileInt(S_DOORS, K_DDFENABLE, 0) <> 0)
m_bGunstockOn = (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0)
End Sub
End Module
+51 -2
View File
@@ -8,8 +8,8 @@
BorderBrush="{StaticResource EgaltechBlue1}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
MinWidth="400" MinHeight="372"
Width="400" Height="402"
MinWidth="400" MinHeight="382"
Width="400" Height="412"
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<EgtWPFLib5:EgtCustomWindow.Resources>
@@ -75,6 +75,9 @@
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}">
@@ -297,6 +300,52 @@
</Grid>
</StackPanel>
</TabItem>
<TabItem Header="{Binding ExtraMsg}">
<StackPanel>
<Grid Margin="5,20,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding SpecialMsg}"
Grid.Row="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding SpecialOn}"
Grid.Row="0" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding BeamMsg}"
Grid.Row="1" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding BeamOn}" IsEnabled="{Binding BeamEnabled}"
Grid.Row="1" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<Button Content="{Binding UpdateMsg}" IsEnabled="{Binding BeamActive}"
Command="{Binding UpdateBeam_Command}"
Grid.Row="1" Grid.Column="2" Height="26"/>
<TextBlock Text="{Binding WallMsg}"
Grid.Row="2" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding WallOn}" IsEnabled="{Binding WallEnabled}"
Grid.Row="2" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<Button Content="{Binding UpdateMsg}" IsEnabled="{Binding WallActive}"
Command="{Binding UpdateWall_Command}"
Grid.Row="2" Grid.Column="2" Height="26"/>
<TextBlock Text="{Binding DoorsMsg}" VerticalAlignment="Center"
Grid.Row="3" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding DoorsOn}" IsEnabled="{Binding DoorsEnabled}"
Grid.Row="3" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding GunstockMsg}" VerticalAlignment="Center"
Grid.Row="4" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding GunstockOn}" IsEnabled="{Binding GunstockEnabled}"
Grid.Row="4" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
</Grid>
</StackPanel>
</TabItem>
</TabControl>
</EgtWPFLib5:EgtCustomWindow>
+396 -23
View File
@@ -528,14 +528,98 @@ Public Class OptionWindowVM
End Set
End Property
Public Property SpecialOn As Boolean
Get
Return OptionModule.m_bSpecialOn
End Get
Set(value As Boolean)
OptionModule.m_bSpecialOn = value
WritePrivateProfileString(S_SPECIAL, K_SPECIALENABLE, If( value, "1", "0"))
End Set
End Property
Public ReadOnly Property BeamEnabled As Boolean
Get
Return (IniFile.m_nKeyOptions And KEY_OPT.BEAM) <> 0
End Get
End Property
Public ReadOnly Property BeamActive As Boolean
Get
Return IniFile.IsActiveBeam()
End Get
End Property
Public Property BeamOn As Boolean
Get
Return BeamEnabled AndAlso OptionModule.m_bBeamOn
End Get
Set(value As Boolean)
OptionModule.m_bBeamOn = value
WritePrivateProfileString(S_BEAM, K_BEAMENABLE, If( value, "1", "0"))
End Set
End Property
Public ReadOnly Property WallEnabled As Boolean
Get
Return (IniFile.m_nKeyOptions And KEY_OPT.WALL) <> 0
End Get
End Property
Public ReadOnly Property WallActive As Boolean
Get
Return IniFile.IsActiveWall()
End Get
End Property
Public Property WallOn As Boolean
Get
Return WallEnabled AndAlso OptionModule.m_bWallOn
End Get
Set(value As Boolean)
OptionModule.m_bWallOn = value
WritePrivateProfileString(S_WALL, K_WALLENABLE, If( value, "1", "0"))
End Set
End Property
Public ReadOnly Property DoorsEnabled As Boolean
Get
Return (IniFile.m_nKeyOptions And KEY_OPT.DOORS) <> 0
End Get
End Property
Public Property DoorsOn As Boolean
Get
Return DoorsEnabled AndAlso OptionModule.m_bDoorsOn
End Get
Set(value As Boolean)
OptionModule.m_bDoorsOn = value
WritePrivateProfileString(S_DOORS, K_DDFENABLE, If( value, "1", "0"))
End Set
End Property
Public ReadOnly Property GunstockEnabled As Boolean
Get
Return (IniFile.m_nKeyOptions And KEY_OPT.GUNSTOCK) <> 0
End Get
End Property
Public Property GunstockOn As Boolean
Get
Return OptionModule.m_bGunstockOn
End Get
Set(value As Boolean)
OptionModule.m_bGunstockOn = value
WritePrivateProfileString(S_GUNSTOCK, K_GUNSTOCKENABLE, If( value, "1", "0"))
End Set
End Property
' Definizione comandi
Private m_cmdCloseOptions As ICommand
Private m_cmdTopSceneBackground As ICommand
Private m_cmdBotSceneBackground As ICommand
Private m_cmdGridColor As ICommand
Private m_cmdUpdateLicenceCmd As ICommand
Private m_cmdDefMaterialColor As ICommand
Private m_cmdAddMachineCmd As ICommand
Private m_cmdExportMachineCmd As ICommand
Private m_cmdUpdateBeamCmd As ICommand
Private m_cmdUpdateWallCmd As ICommand
#Region "Messages"
@@ -586,6 +670,11 @@ Public Class OptionWindowVM
Return EgtMsg( 6518) ' Superfici smussate
End Get
End Property
Public ReadOnly Property UpdateLicenceMsg As String
Get
Return EgtMsg( 6553) ' Aggiorna licenza
End Get
End Property
Public ReadOnly Property CADMsg As String
Get
@@ -602,6 +691,46 @@ Public Class OptionWindowVM
Return EgtMsg(MSG_OPTIONPAGE + 12)
End Get
End Property
Public ReadOnly Property DimensionMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 44) ' Quotatura
End Get
End Property
Public ReadOnly Property ExtLineLenMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 37) ' Estensione linea
End Get
End Property
Public ReadOnly Property ArrowLenMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 38) ' Dimensione freccia
End Get
End Property
Public ReadOnly Property TextDistMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 39) ' Distanza messaggio
End Get
End Property
Public ReadOnly Property LenIsMMMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 40) ' Unità di misura
End Get
End Property
Public ReadOnly Property DecDigitMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 41) ' Numero dicmali
End Get
End Property
Public ReadOnly Property FontMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 42) ' Caretteri
End Get
End Property
Public ReadOnly Property TextHeightMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 43) ' Dimensione testo
End Get
End Property
Public ReadOnly Property ImportMsg As String
Get
@@ -710,52 +839,45 @@ Public Class OptionWindowVM
Return EgtMsg(MSG_OPTIONPAGE + 27) ' Aggiungi macchina
End Get
End Property
Public ReadOnly Property ExportMachineMsg As String
Get
Return EgtMsg(6549) ' Esporta macchina
End Get
End Property
Public ReadOnly Property DimensionMsg As String
Public ReadOnly Property ExtraMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 44) ' Quotatura
Return "Extra"
End Get
End Property
Public ReadOnly Property ExtLineLenMsg As String
Public ReadOnly Property SpecialMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 37) ' Estensione linea
Return "Special"
End Get
End Property
Public ReadOnly Property ArrowLenMsg As String
Public ReadOnly Property BeamMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 38) ' Dimensione freccia
Return "Beam"
End Get
End Property
Public ReadOnly Property TextDistMsg As String
Public ReadOnly Property WallMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 39) ' Distanza messaggio
Return "Wall"
End Get
End Property
Public ReadOnly Property LenIsMMMsg As String
Public ReadOnly Property DoorsMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 40) ' Unità di misura
Return "Doors"
End Get
End Property
Public ReadOnly Property DecDigitMsg As String
Public ReadOnly Property GunstockMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 41) ' Numero dicmali
Return "Gunstock"
End Get
End Property
Public ReadOnly Property FontMsg As String
Public ReadOnly Property UpdateMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 42) ' Caretteri
End Get
End Property
Public ReadOnly Property TextHeightMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 43) ' Dimensione testo
Return EgtMsg(6554) ' Aggiorna
End Get
End Property
@@ -898,6 +1020,49 @@ Public Class OptionWindowVM
#End Region ' DefMaterialColor
#Region "UpdateLicence"
''' <summary>
''' Returns a command that update the licence.
''' </summary>
Public ReadOnly Property UpdateLicence_Command() As ICommand
Get
If m_cmdUpdateLicenceCmd Is Nothing Then
m_cmdUpdateLicenceCmd = New RelayCommand(AddressOf UpdateLicenceCmd)
End If
Return m_cmdUpdateLicenceCmd
End Get
End Property
''' <summary>
''' Update the licence.
''' </summary>
Public Sub UpdateLicenceCmd()
' Apro dialogo per richiesta file licenza
Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With {
.DefaultExt = ".lic",
.Filter = "Licences (.lic)|*.lic",
.CheckFileExists = True,
.ValidateNames = True
}
If LicDlg.ShowDialog() = True Then
' Recupero il direttorio del file
Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName)
' Se il file non è già nel direttorio di configurazione lo copio
If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(IniFile.m_sConfigDir), StringComparison.OrdinalIgnoreCase) Then
Try
File.Copy(LicDlg.FileName, Path.Combine(IniFile.m_sConfigDir, LicDlg.SafeFileName), True)
Catch ex As Exception
Return
End Try
End If
' Imposto il nuovo file di licenza nell'Ini
WritePrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
End If
End Sub
#End Region ' AddMachine
#Region "AddMachine"
''' <summary>
@@ -1099,11 +1264,11 @@ Public Class OptionWindowVM
File.Delete(sZipToCreate)
End If
Try
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
Using zip As New Ionic.Zip.ZipFile(sZipToCreate)
' aggiungo i file della Macchina
Dim sMachineDir As String = IniFile.m_sMachinesRoot & "\" & sCurrMachineName
If Directory.Exists(sMachineDir) Then
zip.AddItem(sMachineDir, sCurrMachineName)
zip.AddSelectedFiles( "name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True)
End If
' salvo lo zip
zip.Save()
@@ -1114,6 +1279,7 @@ Public Class OptionWindowVM
Dim sKo As String = String.Format(EgtMsg(6551), sCurrMachineName)
EgtOutLog(sKo)
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
return
End Try
'La macchina "{0}" è stata esportata con successo.
Dim sOk As String = String.Format(EgtMsg(6552), sCurrMachineName)
@@ -1123,6 +1289,213 @@ Public Class OptionWindowVM
#End Region ' ExportMachine
#Region "UpdateBeam"
Public ReadOnly Property UpdateBeam_Command() As ICommand
Get
If m_cmdUpdateBeamCmd Is Nothing Then
m_cmdUpdateBeamCmd = New RelayCommand(AddressOf UpdateBeamCmd)
End If
Return m_cmdUpdateBeamCmd
End Get
End Property
Public Sub UpdateBeamCmd()
' Recupero la versione del programma in esecuzione
Dim sExeVer As String = IniFile.GetProgramVersion()
' Verifico presenza di una precedente installazione del Beam
Dim sBeamVer As String = ""
IniFile.GetSpecialLuaVersion( IniFile.m_sBeamDirPath, sBeamVer)
If String.IsNullOrEmpty( sBeamVer) Then
' Il modulo "{0}" non è stato trovato, impossibile aggiornare. - Avviso
Dim sOut As String = String.Format(EgtMsg(6555), "Beam")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Esco
Return
End If
' Apro dialogo per richiesta file zip del Beam
Dim BeamDlg As New Microsoft.Win32.OpenFileDialog() With {
.DefaultExt = ".zip",
.Filter = "Beam (.zip)|*.zip",
.CheckFileExists = True,
.ValidateNames = True
}
If BeamDlg.ShowDialog() <> True Then Return
Dim sBeamZip As String = BeamDlg.FileName
' Preparo direttorio temporaneo
Dim sTempDir As String = Path.Combine(IniFile.m_sTempDir, "Beam")
If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CreateDirectory( sTempDir)
' Unzip nel direttorio temporaneo
Using zip As New Ionic.Zip.ZipFile(sBeamZip)
zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
End Using
' Recupero i dati del nuovo Beam
Dim sNewName = ""
Dim sNewVer = ""
Dim sNewMinExe = ""
IniFile.GetSpecialLuaData( sTempDir, sNewName, sNewVer, sNewMinExe)
' Verifico che sia veramente il Beam
If String.Compare(sNewName, "Beam") <> 0 Then
' Il file zip non contiene il modulo "{0}". - Avviso
Dim sOut As String = String.Format(EgtMsg(6556), "Beam")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Verifico la versione minima del programma
If String.Compare(sExeVer, sNewMinExe) < 0 Then
' Il nuovo modulo "{0}" richiede un programma con versione minima {1}. - Avviso
Dim sOut As String = String.Format(EgtMsg(6557), "Beam", sNewMinExe)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Verifico la versione del Beam e se più vecchia chiedo cosa fare
If String.Compare(sNewVer, sBeamVer) < 0 Then
' La versione del nuovo modulo "{0}" è più vecchia dell'attuale. Vuoi sovrascrivere lo stesso ?
Dim sOut As String = String.Format(EgtMsg(6558), "Beam")
if MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
End If
' Faccio una copia di backup del Beam corrente
Dim sBackupDir As String = IniFile.m_sBeamDirPath & ".old"
If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
Try
My.Computer.FileSystem.MoveDirectory( IniFile.m_sBeamDirPath, sBackupDir, True)
Catch ex As Exception
' Ripristino lo stato originale ed esco
My.Computer.FileSystem.MoveDirectory( sBackupDir, IniFile.m_sBeamDirPath, True)
' L'aggiornamento del modulo "{0}" non è riuscito. - Errore
Dim sOut As String = String.Format(EgtMsg(6559), "Beam")
EgtOutLog( sOut)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End Try
' Installo il Beam
My.Computer.FileSystem.MoveDirectory( sTempDir, IniFile.m_sBeamDirPath, True)
' Il modulo "{0}" è stata aggiornato con successo. - Info
Dim sOk As String = String.Format(EgtMsg(6560), "Beam")
EgtOutLog( sOk)
MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
End Sub
#End Region ' UpdateBeam
#Region "UpdateWall"
Public ReadOnly Property UpdateWall_Command() As ICommand
Get
If m_cmdUpdateWallCmd Is Nothing Then
m_cmdUpdateWallCmd = New RelayCommand(AddressOf UpdateWallCmd)
End If
Return m_cmdUpdateWallCmd
End Get
End Property
Public Sub UpdateWallCmd()
' Recupero la versione del programma in esecuzione
Dim sExeVer As String = IniFile.GetProgramVersion()
' Verifico presenza di una precedente installazione del Wall
Dim sWallVer As String = ""
IniFile.GetSpecialLuaVersion( IniFile.m_sWallDirPath, sWallVer)
If String.IsNullOrEmpty( sWallVer) Then
' Il modulo "{0}" non è stato trovato, impossibile aggiornare. - Avviso
Dim sOut As String = String.Format(EgtMsg(6555), "Wall")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Esco
Return
End If
' Apro dialogo per richiesta file zip del Wall
Dim WallDlg As New Microsoft.Win32.OpenFileDialog() With {
.DefaultExt = ".zip",
.Filter = "Wall (.zip)|*.zip",
.CheckFileExists = True,
.ValidateNames = True
}
If WallDlg.ShowDialog() <> True Then Return
Dim sWallZip As String = WallDlg.FileName
' Preparo direttorio temporaneo
Dim sTempDir As String = Path.Combine(IniFile.m_sTempDir, "Wall")
If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CreateDirectory( sTempDir)
' Unzip nel direttorio temporaneo
Using zip As New Ionic.Zip.ZipFile(sWallZip)
zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
End Using
' Recupero i dati del nuovo Wall
Dim sNewName = ""
Dim sNewVer = ""
Dim sNewMinExe = ""
IniFile.GetSpecialLuaData( sTempDir, sNewName, sNewVer, sNewMinExe)
' Verifico che sia veramente il Wall
If String.Compare(sNewName, "Wall") <> 0 Then
' Il file zip non contiene il modulo "{0}". - Avviso
Dim sOut As String = String.Format(EgtMsg(6556), "Wall")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Verifico la versione minima del programma
If String.Compare(sExeVer, sNewMinExe) < 0 Then
' Il nuovo modulo "{0}" richiede un programma con versione minima {1}. - Avviso
Dim sOut As String = String.Format(EgtMsg(6557), "Wall", sNewMinExe)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Verifico la versione del Wall e se più vecchia chiedo cosa fare
If String.Compare(sNewVer, sWallVer) < 0 Then
' La versione del nuovo modulo "{0}" è più vecchia dell'attuale. Vuoi sovrascrivere lo stesso ?
Dim sOut As String = String.Format(EgtMsg(6558), "Wall")
if MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
End If
' Faccio una copia di backup del Wall corrente
Dim sBackupDir As String = IniFile.m_sWallDirPath & ".old"
If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
Try
My.Computer.FileSystem.MoveDirectory( IniFile.m_sWallDirPath, sBackupDir, True)
Catch ex As Exception
' Ripristino lo stato originale ed esco
My.Computer.FileSystem.MoveDirectory( sBackupDir, IniFile.m_sWallDirPath, True)
' L'aggiornamento del modulo "{0}" non è riuscito. - Errore
Dim sOut As String = String.Format(EgtMsg(6559), "Wall")
EgtOutLog( sOut)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End Try
' Installo il Wall
My.Computer.FileSystem.MoveDirectory( sTempDir, IniFile.m_sWallDirPath, True)
' Il modulo "{0}" è stata aggiornato con successo. - Info
Dim sOk As String = String.Format(EgtMsg(6560), "Wall")
EgtOutLog( sOk)
MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
End Sub
#End Region ' UpdateWall
#Region "CloseOptionsCommand"
''' <summary>
+80 -73
View File
@@ -6,96 +6,103 @@
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="Loaded">
<interactivity:InvokeCommandAction Command="{Binding LoadedCommand}"/>
</interactivity:EventTrigger>
</interactivity:Interaction.Triggers>
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="Loaded">
<interactivity:InvokeCommandAction Command="{Binding LoadedCommand}"/>
</interactivity:EventTrigger>
</interactivity:Interaction.Triggers>
<EgtFloating:EgtFloatingManager>
<EgtFloating:EgtFloatingTray x:Name="TOPTRAY" DockPanel.Dock="Top">
<WrapPanel Orientation="Horizontal" Width="{Binding ActualWidth, ElementName=TOPTRAY}">
<EgtFloating:EgtFloatingPanel Name="ShowPanel"
<EgtFloating:EgtFloatingManager>
<EgtFloating:EgtFloatingTray x:Name="TOPTRAY" DockPanel.Dock="Top">
<WrapPanel Orientation="Horizontal" Width="{Binding ActualWidth, ElementName=TOPTRAY}">
<EgtFloating:EgtFloatingPanel Name="ShowPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:ShowPanelV DataContext="{StaticResource ShowPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="ViewPanel"
<local:ShowPanelV DataContext="{StaticResource ShowPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="ViewPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:ViewPanelV DataContext="{StaticResource ViewPanelViewModel}"/>
<local:PopUpViewPanelV DataContext="{StaticResource PopUpViewPanelViewModel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
</EgtFloating:EgtFloatingPanel>
<!--<EgtFloating:EgtFloatingPanel Name="InstrumentPanel"
<local:ViewPanelV DataContext="{StaticResource ViewPanelViewModel}"/>
<local:PopUpViewPanelV DataContext="{StaticResource PopUpViewPanelViewModel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
</EgtFloating:EgtFloatingPanel>
<!--<EgtFloating:EgtFloatingPanel Name="InstrumentPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">-->
<local:InstrumentPanelV DataContext="{StaticResource InstrumentPanelViewModel}"/>
<!--</EgtFloating:EgtFloatingPanel>-->
<EgtFloating:EgtFloatingPanel Name="GridPanel"
<local:InstrumentPanelV DataContext="{StaticResource InstrumentPanelViewModel}"/>
<!--</EgtFloating:EgtFloatingPanel>-->
<EgtFloating:EgtFloatingPanel Name="GridPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:GridPanelV DataContext="{StaticResource GridPanelViewModel}"/>
<local:PopUpGridPanelV DataContext="{StaticResource PopUpGridPanelViewModel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="DbPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:MachinePanelV DataContext="{StaticResource DbPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="ExecutePanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:ExecutePanelV DataContext="{StaticResource ExecutePanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="SpecialPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:SpecialPanelV DataContext="{StaticResource SpecialPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="BeamPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:BeamPanelV DataContext="{StaticResource BeamPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="WallPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:WallPanelV DataContext="{StaticResource WallPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="BeamWallPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:BeamWallPanelV DataContext="{StaticResource BeamWallPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="DoorsPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:DoorPanelV DataContext="{StaticResource DoorsPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="GunStockPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:GunStockPanelV DataContext="{StaticResource GunStockPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
</WrapPanel>
</EgtFloating:EgtFloatingTray>
<EgtFloating:EgtFloatingTray x:Name="LEFTTRAY" DockPanel.Dock="Left">
<EgtFloating:EgtFloatingPanel Name="DrawPanel" TitleBarOrientation="Vertical"
IsTopDockable="False" IsBottomDockable="False" IsLeftDockable="True" IsRightDockable="True">
<local:DrawPanelV DataContext="{StaticResource DrawPanelViewModel}"/>
<local:GridPanelV DataContext="{StaticResource GridPanelViewModel}"/>
<local:PopUpGridPanelV DataContext="{StaticResource PopUpGridPanelViewModel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
</EgtFloating:EgtFloatingPanel>
</EgtFloating:EgtFloatingTray>
<EgtFloating:EgtFloatingTray x:Name="RIGHTTRAY" DockPanel.Dock="Right">
<EgtFloating:EgtFloatingPanel Name="OptionPanel" TitleBarOrientation="Vertical"
IsTopDockable="False" IsBottomDockable="False" IsLeftDockable="True" IsRightDockable="True">
<local:OptionPanelV DataContext="{StaticResource OptionPanelViewModel}"/>
<EgtFloating:EgtFloatingPanel Name="DbPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:MachinePanelV DataContext="{StaticResource DbPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
</EgtFloating:EgtFloatingTray>
<!--<EgtFloating:EgtFloatingTray x:Name="BOTTOMTRAY" DockPanel.Dock="Bottom">
<EgtFloating:EgtFloatingPanel Name="ExecutePanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:ExecutePanelV DataContext="{StaticResource ExecutePanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="SpecialPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:SpecialPanelV DataContext="{StaticResource SpecialPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="BeamPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:BeamPanelV DataContext="{StaticResource BeamPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="WallPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:WallPanelV DataContext="{StaticResource WallPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="BeamWallPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:BeamWallPanelV DataContext="{StaticResource BeamWallPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="DoorsPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:DoorPanelV DataContext="{StaticResource DoorsPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="GunStockPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:GunStockPanelV DataContext="{StaticResource GunStockPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="PrintingPanel"
IsTopDockable="True"
IsBottomDockable="True"
IsLeftDockable="False"
IsRightDockable="False">
<local:Printing3DPanelV DataContext="{StaticResource Printing3DPanelVM}"/>
</EgtFloating:EgtFloatingPanel>
</WrapPanel>
</EgtFloating:EgtFloatingTray>
<EgtFloating:EgtFloatingTray x:Name="LEFTTRAY" DockPanel.Dock="Left">
<EgtFloating:EgtFloatingPanel Name="DrawPanel" TitleBarOrientation="Vertical"
IsTopDockable="False" IsBottomDockable="False" IsLeftDockable="True" IsRightDockable="True">
<local:DrawPanelV DataContext="{StaticResource DrawPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
</EgtFloating:EgtFloatingTray>
<EgtFloating:EgtFloatingTray x:Name="RIGHTTRAY" DockPanel.Dock="Right">
<EgtFloating:EgtFloatingPanel Name="OptionPanel" TitleBarOrientation="Vertical"
IsTopDockable="False" IsBottomDockable="False" IsLeftDockable="True" IsRightDockable="True">
<local:OptionPanelV DataContext="{StaticResource OptionPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
</EgtFloating:EgtFloatingTray>
<!--<EgtFloating:EgtFloatingTray x:Name="BOTTOMTRAY" DockPanel.Dock="Bottom">
<EgtFloating:EgtFloatingPanel Name="MachGroupPanel"
IsToolBar="False"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:MachGroupPanelV DataContext="{StaticResource MachGroupPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
</EgtFloating:EgtFloatingTray>-->
<EgtFloating:EgtFloatingTray x:Name="BOTTOMTRAY" DockPanel.Dock="Bottom">
<EgtWPFLib5:EgtMachGroupPanelV DataContext="{StaticResource MachGroupPanelViewModel}"
<EgtFloating:EgtFloatingTray x:Name="BOTTOMTRAY" DockPanel.Dock="Bottom">
<EgtWPFLib5:EgtMachGroupPanelV DataContext="{StaticResource MachGroupPanelViewModel}"
RepaetButtonStyle="{StaticResource CustomScrollBarButton}"
MachGroupButtonStyle="{StaticResource {x:Type ToggleButton}}"
IsToolBar="False"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False"
IsRightDockable="False" />
</EgtFloating:EgtFloatingTray>
<!--ContentControl che ospita la scena restituita sotto forma di WindowsFormsHost-->
<ContentControl Content="{Binding ProjectSceneHost}"/>
</EgtFloating:EgtFloatingManager>
</EgtFloating:EgtFloatingTray>
<!--ContentControl che ospita la scena restituita sotto forma di WindowsFormsHost-->
<ContentControl Content="{Binding ProjectSceneHost}"/>
</EgtFloating:EgtFloatingManager>
</UserControl>
+5
View File
@@ -7,6 +7,7 @@ Public Class ProjectV
Private m_bWall As Boolean = False
Private m_bDoors As Boolean = False
Private m_bGunStock As Boolean = False
Private m_bPrinting3d As Boolean = False
Private Sub UserControl_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Creo riferimento a questa classe in Map
@@ -16,6 +17,7 @@ Public Class ProjectV
WallPanel.Visibility = Visibility.Collapsed
DoorsPanel.Visibility = Visibility.Collapsed
GunStockPanel.Visibility = Visibility.Collapsed
PrintingPanel.Visibility = Visibility.Collapsed
Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(False) ' MachGroupPanel.Visibility = Visibility.Collapsed
End Sub
@@ -46,6 +48,7 @@ Public Class ProjectV
m_bWall = IniFile.IsActiveWall()
m_bDoors = IniFile.IsActiveDoors()
m_bGunStock = IniFile.IsActiveGunStock()
m_bPrinting3d = IniFile.IsActivePrinting3d()
End Sub
Private Sub PanelPositioning(FloatingPanel As EgtFloatingPanel, sState As String, nIndex As Integer, nLeft As Integer, nTop As Integer)
@@ -79,6 +82,7 @@ Public Class ProjectV
WallPanel.Visibility = Visibility.Collapsed
BeamWallPanel.Visibility = Visibility.Collapsed
DoorsPanel.Visibility = If(m_bDoors, Visibility.Visible, Visibility.Collapsed)
PrintingPanel.Visibility = Visibility.Collapsed
GunStockPanel.Visibility = Visibility.Collapsed
DrawPanel.Visibility = Visibility.Collapsed
OptionPanel.Visibility = Visibility.Visible
@@ -98,6 +102,7 @@ Public Class ProjectV
WallPanel.Visibility = If(m_bWall, Visibility.Visible, Visibility.Collapsed)
BeamWallPanel.Visibility = If(m_bBeam Or m_bWall, Visibility.Visible, Visibility.Collapsed)
DoorsPanel.Visibility = If(m_bDoors, Visibility.Visible, Visibility.Collapsed)
PrintingPanel.Visibility = If(m_bPrinting3d, Visibility.Visible, Visibility.Collapsed)
GunStockPanel.Visibility = If(m_bGunStock, Visibility.Visible, Visibility.Collapsed)
DrawPanel.Visibility = Visibility.Visible
OptionPanel.Visibility = Visibility.Visible
+89 -30
View File
@@ -11,6 +11,9 @@ Public Class ProjectVM
#Region "FIELDS"
Friend Event OnPreControllerExec(sFilePath As String)
Friend Event OnPostControllerExec()
' Variabili in cui salvo i filtri di selezione della modalità Draw e che poi ripristino all'uscita dalla modalità Machining
Private m_bSelZeroDim As Boolean = True
Private m_bSelCurve As Boolean = True
@@ -64,8 +67,9 @@ Public Class ProjectVM
#Region "CONSTRUCTOR"
Sub New()
' Creo riferimento a questa classe in EgtCAM5Map
' Creo riferimento a questa classe in EgtCAM5Map e in ButtonItem
Map.SetRefProjectVM(Me)
ButtonItem.m_ProjectVM = Me
' Creo classe di supporto per la visualizzazione dei parametri utensile e di lavorazione per Db e operazioni
TMDbParamVisibility.bFirst = True
' Inizializza i parametri della scena
@@ -129,6 +133,38 @@ Public Class ProjectVM
Dim nFlag As Integer = GetPrivateProfileInt( S_IMPORT, K_BTLFLAG, EIB_FL.NONE)
EgtInitBeamMgr( nFlag)
End If
' Log di eventuali estensioni
EgtOutLog( "Extensions :")
Dim bExtensions As Boolean = False
If IniFile.IsActiveBeam() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sBeamDirPath, sVersion)
Dim sOut As String = "Beam ver. " & sVersion & " " & IniFile.m_sBeamDirPath
EgtOutLog( sOut)
End If
If IniFile.IsActiveWall() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sWallDirPath, sVersion)
Dim sOut As String = "Wall ver. " & sVersion & " " & IniFile.m_sWallDirPath
EgtOutLog( sOut)
End If
If IniFile.IsActiveDoors() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sDoorsDirPath, sVersion)
Dim sOut As String = "Doors ver. " & sVersion & " " & IniFile.m_sDoorsDirPath
EgtOutLog( sOut)
End If
If IniFile.IsActiveGunStock() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sGunstockDirPath, sVersion)
Dim sOut As String = "Gunstock ver. " & sVersion & " " & IniFile.m_sGunstockDirPath
EgtOutLog( sOut)
End If
If Not bExtensions Then EgtOutLog( "---")
' Apro progetto vuoto
Map.refTopCommandBarVM.NewCmd()
' Seleziono la macchina impostata nel file ini
@@ -161,17 +197,17 @@ Public Class ProjectVM
.ValidateNames = True
}
If LicDlg.ShowDialog() = True Then
' Recupero il direttorio del file
Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName)
' Se il file non è già nel direttorio di configurazione lo copio
If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(IniFile.m_sConfigDir), StringComparison.OrdinalIgnoreCase) Then
Try
File.Copy(LicDlg.FileName, Path.Combine(IniFile.m_sConfigDir, LicDlg.SafeFileName), True)
Catch ex As Exception
End Try
End If
' Imposto il nuovo file di licenza nell'Ini
WritePrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
' Recupero il direttorio del file
Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName)
' Se il file non è già nel direttorio di configurazione lo copio
If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(IniFile.m_sConfigDir), StringComparison.OrdinalIgnoreCase) Then
Try
File.Copy(LicDlg.FileName, Path.Combine(IniFile.m_sConfigDir, LicDlg.SafeFileName), True)
Catch ex As Exception
End Try
End If
' Imposto il nuovo file di licenza nell'Ini
WritePrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
End If
End If
End If
@@ -228,7 +264,6 @@ Public Class ProjectVM
Private Sub PostInitializeScene()
' Impostazioni Controller
m_Controller.SetUserLevel( IniFile.m_nUserLevel)
m_Controller.SetScene(m_ProjectScene)
Dim bLuaReg As Boolean = (GetPrivateProfileInt(S_GENERAL, K_COMMANDLOG, 0) <> 0)
Dim sCmdLogFile As String = CMDLOG_FILE_NAME.Replace("#", IniFile.m_nInstance.ToString())
@@ -236,7 +271,7 @@ Public Class ProjectVM
EgtOutLog("Command log not started")
If Environment.GetCommandLineArgs.Count() <= 1 Then
MessageBox.Show("Command log not started", "EgtCAM5 Warning",
MessageBoxButton.OK, MessageBoxImage.Warning)
MessageBoxButton.OK, MessageBoxImage.Warning)
End If
End If
m_Controller.SetSurfTmTolerance(OptionModule.m_dGeometryTolerance)
@@ -353,7 +388,7 @@ Public Class ProjectVM
' Verifico se travi o pareti (dal nome della macchina)
Dim sBeamMachines As String = ""
GetPrivateProfileString(S_BEAM, K_BEAMMACHINES, "", sBeamMachines)
Dim vsBMachs() As String = sBeamMachines.Split(","c).ToArray
Dim vsBMachs() As String = sBeamMachines.Split(","c)
Dim bBeam As Boolean = False
For Each sBMach In vsBMachs
If Not String.IsNullOrWhiteSpace(sBMach) AndAlso sMachine.StartsWith(sBMach, True, CultureInfo.InvariantCulture) Then
@@ -499,7 +534,7 @@ Public Class ProjectVM
Select Case nFileType
Case FT.NGE, FT.NFE
Return m_Controller.OpenProject(sFile, False)
Case FT.DXF, FT.STL, FT._3MF, 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
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)
Case FT.TSC, FT.LUA
Return m_Controller.Exec(sFile, False)
@@ -511,7 +546,7 @@ Public Class ProjectVM
Dim nErr As Integer = 0
' Formato descrizione porte
If Path.GetExtension(sFile).ToLower() = ".ddf" Then
nErr = ExecDoors(m_ProjectScene, sFile)
nErr = ExecDoors(m_ProjectScene, sFile, bNcGen, bBatch, nProbing)
'CreateDoors(sFile, bNcGen, bBatch, nProbing)
Map.refProjectVM.EmitTitle()
Return True
@@ -644,13 +679,15 @@ Public Class ProjectVM
m_bScriptInMru = bScriptInMru
End Sub
Friend Sub ExecScript(sFilePath As String)
Friend Sub ExecScript(sFilePath As String, Optional bRaiseEvent As Boolean = False)
If String.IsNullOrEmpty(sFilePath) Then
Dim sDir As String = String.Empty
GetPrivateProfileString(S_GENERAL, K_LASTLUADIR, "", sDir)
m_Controller.Exec(sDir)
Else
If bRaiseEvent Then RaiseEvent OnPreControllerExec( sFilePath)
m_Controller.Exec(sFilePath, False)
If bRaiseEvent Then RaiseEvent OnPostControllerExec()
End If
Dim bMachiningMode As Boolean = EgtGetCurrMachGroup() <> GDB_ID.NULL
If Not bMachiningMode And EgtGetCurrLayer() = GDB_ID.NULL Then
@@ -714,7 +751,7 @@ Public Class ProjectVM
Try
Dim sErrFilePath As String = Path.ChangeExtension(IniFile.m_PEZFilePath, ".txt")
Dim Lines() As String = File.ReadAllLines(sErrFilePath)
Dim values() As String = Lines(0).Split("="c).ToArray
Dim values() As String = Lines(0).Split("="c)
Lines(0) = EgtMsg(MSG_DOORSERRORS + 1) & " " & Convert.ToInt32(values(1))
Dim sErrMsg As String = String.Empty
For Index = 1 To Lines.Count - 1
@@ -765,6 +802,20 @@ Public Class ProjectVM
End If
End Sub
Friend Sub GunStockCopy(sFilePath As String, sDirDest As String)
Dim bOk As Boolean
bOk = ExecGunStockCopy(m_ProjectScene, sFilePath, sDirDest)
If bOk Then
' Copia dei file terminata con successo ...
Dim sMsg As String = EgtMsg(8216) & vbCrLf & sFilePath & vbCrLf & "->" & sDirDest
MessageBox.Show(sMsg, EgtMsg(8214), MessageBoxButton.OK, MessageBoxImage.Information)
else
' Errore nella copia dei file ...
Dim sMsg As String = EgtMsg(8255) & vbCrLf & sFilePath & vbCrLf & "->" & sDirDest
MessageBox.Show(sMsg, EgtMsg(8251), MessageBoxButton.OK, MessageBoxImage.Error)
End If
End Sub
#End Region
#Region "DrawOptionPanel Commands"
@@ -919,12 +970,12 @@ Public Class ProjectVM
End Sub
Private Sub OnMouseDeselectedAll(ByVal sender As Object) Handles m_ProjectScene.OnMouseDeselectedAll
' Se in modalità Draw seleziono tutto
' Se in modalità Draw deseleziono tutto
If IniFile.m_ProjectMode = ProjectModeOpt.DRAW OrElse IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW Then
m_Controller.MouseDeselectedAll()
m_Controller.MouseDeselectedAll(True)
Return
End If
' Sono in modalità Machining, se la modalità di selezione è NULL non seleziono nulla ed esco
' Sono in modalità Machining, se la modalità di selezione è NULL non deseleziono nulla ed esco
If m_SceneSelMode = SceneSelModeOpt.NULL Then Return
' Se sono in lavorazione
If IniFile.m_ProjectMode = ProjectModeOpt.MACHINING Then
@@ -1156,6 +1207,13 @@ Public Class ProjectVM
Private Sub OnMouseSelectingObj(ByVal sender As Object, ByVal nId As Integer, ByRef bOk As Boolean) Handles m_ProjectScene.OnMouseSelectingObj
' Se oggetto già rifiutato non faccio le verifiche
If Not bOk Then Return
' Impedisco la selezione di oggetti in modo Locked o Hidden
Dim nMode As Integer = GDB_MD.STD
EgtGetCalcMode( nId, nMode)
If nMode <> GDB_MD.STD Then
bOk = False
Return
End If
' Se in modalità Draw accetto tutto
If IniFile.m_ProjectMode = ProjectModeOpt.DRAW OrElse IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW Then Return
' Sono in modalità Machining
@@ -1177,13 +1235,11 @@ Public Class ProjectVM
Private Sub OnMouseSelectedObj(ByVal sender As Object, ByVal nId As Integer, ByVal bLast As Boolean) Handles m_ProjectScene.OnMouseSelectedObj
If IniFile.m_ProjectMode = ProjectModeOpt.MACHINING And m_SceneSelType = SceneSelTypeOpt.MACHPATH Then
Map.refOperationsListExpanderVM.SelOperationItemFromId(nId)
Else
If IniFile.m_ProjectMode = ProjectModeOpt.MACHINING And m_SceneSelType = SceneSelTypeOpt.MACHINING And
ElseIf IniFile.m_ProjectMode = ProjectModeOpt.MACHINING And m_SceneSelType = SceneSelTypeOpt.MACHINING And
(EgtGetType(nId) = GDB_TY.SRF_MESH Or EgtGetType(nId) = GDB_TY.SRF_FRGN) Then
If Not EgtIsSelectedObj(nId) Then m_Controller.MouseSelectedObj(nId, bLast)
Else
m_Controller.MouseSelectedObj(nId, bLast)
End If
If Not EgtIsSelectedObj(nId) Then m_Controller.MouseSelectedObj(nId, bLast)
Else
m_Controller.MouseSelectedObj(nId, bLast)
End If
End Sub
@@ -1283,14 +1339,17 @@ Public Class ProjectVM
If e.KeyData = System.Windows.Forms.Keys.Delete AndAlso Map.refTopCommandBarVM.DrawIsChecked Then
m_Controller.SetLastInteger(GDB_ID.SEL)
m_Controller.ExecuteCommand(Controller.CMD.DELETE)
' Con END eseguo deselezione di tutto
ElseIf e.KeyData = System.Windows.Forms.Keys.End Then
m_Controller.MouseDeselectedAll( True)
' Con SPAZIO ripeto l'ultimo comando
ElseIf e.KeyData = System.Windows.Forms.Keys.Space Then
m_Controller.RepeatLastCommand()
' Con 'A' e in modalità continuazione, forzo il passaggio ad arco
ElseIf e.KeyData = System.Windows.Forms.Keys.A And m_Controller.GetContinue() Then
ElseIf e.KeyData = System.Windows.Forms.Keys.A AndAlso m_Controller.GetContinue() Then
m_Controller.ContinueArcPDP()
' Con 'L' e in modalità continuazione, forzo il passaggio a retta
ElseIf e.KeyData = System.Windows.Forms.Keys.L And m_Controller.GetContinue() Then
ElseIf e.KeyData = System.Windows.Forms.Keys.L AndAlso m_Controller.GetContinue() Then
m_Controller.ContinueLine2P()
' Con 'V' cambio lo stato del check
ElseIf e.KeyData = System.Windows.Forms.Keys.V Then
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 B

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

+4 -3
View File
@@ -75,7 +75,7 @@
<Image Source="{Binding SetUpImage}" MaxWidth="300"/>
<ItemsControl Grid.Column="1" ItemsSource="{Binding PositionGroupList}"
Style="{StaticResource HorizontalScrollViewerItemsControlStyle}">
Style="{StaticResource HorizontalScrollViewerItemsControlStyle}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
@@ -100,7 +100,8 @@
<TextBlock Text="{Binding TcPos}"/>
<ItemsControl Grid.Column="1" ItemsSource="{Binding ExitToolAssociationList}"
HorizontalAlignment="Left">
HorizontalAlignment="Left"
Style="{StaticResource VerticalScrollViewerItemsControlStyle}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<!--<WrapPanel Orientation="Horizontal" MaxWidth="200"/>-->
@@ -123,7 +124,7 @@
Background="{Binding ExitBtnBackgroundCol}"
Style="{StaticResource EgtCAM5_SetUpToggleButton}"/>
<Border x:Name="ToolBorder" Grid.Column="1" BorderBrush="{StaticResource EgaltechBlue1}"
BorderThickness="1" ToolTip="{Binding ToolTipMsg}">
BorderThickness="1" ToolTip="{Binding ToolTipMsg}" Margin="0,0,5,0">
<Border.Style>
<Style TargetType="{x:Type Border}">
<Setter Property="Visibility" Value="Hidden"/>
+3 -3
View File
@@ -345,7 +345,7 @@ Public Class SetUpVM
Dim sToolList As New List(Of String)
Dim sToolNameList As New List(Of String)
' la spezzo sui ;
Dim sItems() As String = sPosition.Split(";".ToCharArray)
Dim sItems() As String = sPosition.Split(";"c)
' se c'è almeno un elemento sono sicuro che ci sia la T
If sItems.Count() >= 1 Then
Dim nGroup As Integer = 0
@@ -365,13 +365,13 @@ Public Class SetUpVM
' se ci sono almeno tre elementi sono sicuro che ci sia almeno un'uscita attrezzata
If sItems.Count >= 3 Then
' separo le uscite divise dalla ,
Dim sExitToolAssList() As String = sItems(2).Split(",".ToCharArray)
Dim sExitToolAssList() As String = sItems(2).Split(","c)
sExitList.Clear()
sToolList.Clear()
sToolNameList.Clear()
' creo le liste di uscite e utensili attrezzati ricavati
For AssIndex = 0 To sExitToolAssList.Count() - 1
Dim sExitToolAssItem() As String = sExitToolAssList(AssIndex).Split("/".ToCharArray)
Dim sExitToolAssItem() As String = sExitToolAssList(AssIndex).Split("/"c)
If sExitToolAssItem.Count > 1 Then
sExitList.Add(sExitToolAssItem(0))
sToolList.Add(sExitToolAssItem(1))
+20
View File
@@ -0,0 +1,20 @@
<UserControl x:Class="Printing3DPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ItemsControl ItemsSource="{Binding ButtonList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}">
<Image Source="{Binding ImagePath}"/>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</UserControl>
@@ -0,0 +1,3 @@
Public Class Printing3DPanelV
End Class
+26
View File
@@ -0,0 +1,26 @@
Imports System.IO
Imports EgtUILib
Public Class Printing3DPanelVM
Private m_ButtonList As New List(Of ButtonItem)
Public ReadOnly Property ButtonList As List(Of ButtonItem)
Get
Return m_ButtonList
End Get
End Property
Sub New()
' Se attivo, inizializzo i bottoni leggendoli da file ini
If IniFile.IsActivePrinting3d() Then
' Inizializzo i bottoni leggendoli da file ini
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonItem = Nothing
While GetPrivateProfileButton(S_PRINTING3D, K_BUTTON & BtnIndex, IniFile.m_sPrinting3dDirPath, CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
End While
End If
End Sub
End Class
+11 -8
View File
@@ -1,6 +1,7 @@
Imports System.IO
Imports System.Globalization
Imports EgtUILib
Imports EgtWPFLib5
Module Beam
@@ -20,10 +21,9 @@ Module Beam
Friend Function ExecBeam(sFile As String, sMachine As String, nFlag As Integer, bBtl As Boolean) As Boolean
EgtOutLog("-- Start ExecBeam --")
' Recupero lo script da eseguire
Dim sExecPath As String = ""
Dim sExecName As String = ""
GetPrivateProfileString(S_BEAM, If( bBtl, K_BEAMBTLEXEC, K_BEAMBWEEXEC), "", sExecName)
sExecPath = (IniFile.m_sBeamDirPath & "\" & sExecName).TrimEnd({"\"c})
GetPrivateProfileString(S_BEAM, If(bBtl, K_BEAMBTLEXEC, K_BEAMBWEEXEC), "", sExecName)
Dim sExecPath As String = (IniFile.m_sBeamDirPath & "\" & sExecName).TrimEnd({"\"c})
If Not My.Computer.FileSystem.FileExists(sExecPath) Then
EgtOutLog("Not found BeamExec script " & sExecPath)
Return False
@@ -32,9 +32,12 @@ Module Beam
Map.refManageLayerExpanderVM.ClearObjTree()
' Assegno i dati
EgtLuaCreateGlobTable("BEAM")
EgtLuaSetGlobStringVar("BEAM.BASEDIR", IniFile.m_sBeamDirPath)
EgtLuaSetGlobStringVar("BEAM.FILE", sFile)
EgtLuaSetGlobStringVar("BEAM.MACHINE", sMachine)
EgtLuaSetGlobIntVar("BEAM.FLAG", nFlag)
' variabile che comunica al lua che e' stato avviato da interfaccia BEAMWALL (per gestione messaggi errore lua)
If Not bBtl Then EgtLuaSetGlobBoolVar("BEAM.BW", True)
' Eseguo lo script
Dim bOk As Boolean = False
If EgtLuaExecFile(sExecPath) Then
@@ -67,15 +70,15 @@ Module Beam
' verifico se ci sono i file ini
Dim sMachTypePath As String = sBaseDir & "\MachiningTypes.ini"
Dim sTabTemplPath As String = sBaseDir & "\BeamTableTemplate.ini"
If File.Exists( sMachTypePath) AndAlso File.Exists( sTabTemplPath) Then
If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then
' apro finestra di gestione lavorazioni travi
Dim sTitle = EgtMsg( 9000) 'Tabelle delle lavorazioni delle travi
Dim BeamMchsWinVM As New BeamMachiningsWindowVM( sTitle, sBaseDir, sMachTypePath, sTabTemplPath)
Dim BeamMchsWinV As New BeamMachiningsWindowV( Application.Current.MainWindow, BeamMchsWinVM)
Dim sTitle = EgtMsg(9000) 'Tabelle delle lavorazioni delle travi
Dim BeamMchsWinVM As New BeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath)
Dim BeamMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, BeamMchsWinVM)
BeamMchsWinV.ShowDialog()
Else
' Impossibile aprire l'Editor delle lavorazioni delle travi.<br/>Mancano i file di configurazione. - Errore
MessageBox.Show( EgtMsg( 9009), EgtMsg( 9008), MessageBoxButton.OK, MessageBoxImage.Stop)
MessageBox.Show(EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
End If
Return True
End Function
+1
View File
@@ -3,6 +3,7 @@ Imports EgtUILib
Public Class BeamPanelVM
Friend Const BEAM_PROCESS As String = "Beam\Process.lua"
Friend Const BEAM_MACHININGS As String = "BeamMachinings"
Private m_ButtonList As New List(Of ButtonItem)
+10 -6
View File
@@ -1,6 +1,7 @@
Imports System.IO
Imports System.Globalization
Imports EgtUILib
Imports EgtWPFLib5
Module Wall
@@ -22,7 +23,7 @@ Module Wall
' Recupero lo script da eseguire
Dim sExecPath As String = ""
Dim sExecName As String = ""
GetPrivateProfileString(S_WALL, If( bBtl, K_WALLBTLEXEC, K_WALLBWEEXEC), "", sExecName)
GetPrivateProfileString(S_WALL, If(bBtl, K_WALLBTLEXEC, K_WALLBWEEXEC), "", sExecName)
sExecPath = (IniFile.m_sWallDirPath & "\" & sExecName).TrimEnd({"\"c})
If Not My.Computer.FileSystem.FileExists(sExecPath) Then
EgtOutLog("Not found WallExec script " & sExecPath)
@@ -32,9 +33,12 @@ Module Wall
Map.refManageLayerExpanderVM.ClearObjTree()
' Assegno i dati
EgtLuaCreateGlobTable("WALL")
EgtLuaSetGlobStringVar("WALL.BASEDIR", IniFile.m_sWallDirPath)
EgtLuaSetGlobStringVar("WALL.FILE", sFile)
EgtLuaSetGlobStringVar("WALL.MACHINE", sMachine)
EgtLuaSetGlobIntVar("WALL.FLAG", nFlag)
' variabile che comunica al lua che e' stato avviato da interfaccia BEAMWALL (per gestione messaggi errore lua)
If Not bBtl Then EgtLuaSetGlobBoolVar("WALL.BW", True)
' Eseguo lo script
Dim bOk As Boolean = False
If EgtLuaExecFile(sExecPath) Then
@@ -67,15 +71,15 @@ Module Wall
' verifico se ci sono i file ini
Dim sMachTypePath As String = sBaseDir & "\MachiningTypes.ini"
Dim sTabTemplPath As String = sBaseDir & "\WallTableTemplate.ini"
If File.Exists( sMachTypePath) AndAlso File.Exists( sTabTemplPath) Then
If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then
' apro finestra di gestione lavorazioni pareti
Dim sTitle = EgtMsg( 9010) 'Tabelle delle lavorazioni delle pareti
Dim WallMchsWinVM As New BeamMachiningsWindowVM( sTitle, sBaseDir, sMachTypePath, sTabTemplPath, False)
Dim WallMchsWinV As New BeamMachiningsWindowV( Application.Current.MainWindow, WallMchsWinVM)
Dim sTitle = EgtMsg(9010) 'Tabelle delle lavorazioni delle pareti
Dim WallMchsWinVM As New BeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, False)
Dim WallMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, WallMchsWinVM)
WallMchsWinV.ShowDialog()
Else
' Impossibile aprire l'Editor delle lavorazioni delle pareti.<br/>Mancano i file di configurazione. - Errore
MessageBox.Show( EgtMsg( 9011), EgtMsg( 9008), MessageBoxButton.OK, MessageBoxImage.Stop)
MessageBox.Show(EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
End If
Return True
End Function
+11 -2
View File
@@ -17,7 +17,7 @@ Imports EgtUILib
Public Module Doors
Function ExecDoors(ByRef scene As Scene, sFilePath As String) As Integer
Function ExecDoors(ByRef scene As Scene, sFilePath As String, Optional bNcGen As Boolean = False, Optional bBatch As Boolean = False, Optional nProbing As Integer = 0) As Integer
' Scelta file DDF
Dim sFile As String
' Se sFilePath non vuoto apro questo file
@@ -44,7 +44,7 @@ Public Module Doors
' Cursore attesa
scene.Cursor = System.Windows.Forms.Cursors.WaitCursor
' Creazione porta
Dim nErr As Integer = CreateDoors(sFile, False, False, 0)
Dim nErr As Integer = CreateDoors(sFile, bNcGen, bBatch, nProbing)
' Scrivo il nome del file aperto in una variabile globale per averlo in caso di errore
IniFile.m_DDFFilePath = sFile
EgtResetCurrPartLayer()
@@ -63,6 +63,8 @@ Public Module Doors
GetPrivateProfileString(S_DOORS, K_DDFEXEC, "", sExecName)
sExecPath = IniFile.m_sDoorsDirPath & "\" & sExecName
Dim nErr As Integer = 999
EgtLuaCreateGlobTable("DGD")
EgtLuaSetGlobStringVar("DGD.BASEDIR", IniFile.m_sDoorsDirPath & "\")
If Not EgtLuaExecFile(sExecPath) Then Return nErr
' Lancio la creazione
EgtLuaSetGlobStringVar("DGD.FILE", sDdfFile)
@@ -111,7 +113,14 @@ Public Module Doors
Dim sExecName As String = String.Empty
GetPrivateProfileString(S_DOORS, K_DDFMACHEXEC, "", sExecName)
sExecPath = IniFile.m_sDoorsDirPath & "\" & sExecName
Dim nErr As Integer = 999
EgtLuaCreateGlobTable("DGD")
EgtLuaSetGlobStringVar("DGD.BASEDIR", IniFile.m_sDoorsDirPath & "\")
Dim bOk As Boolean = EgtLuaExecFile(sExecPath)
If bOk Then EgtLuaGetGlobIntVar("DGD.ERR", nErr)
EgtOutLog("Doors Err=" & nErr.ToString())
' Cancello variabile globale
EgtLuaResetGlobVar("DGD")
' Cursore standard
scene.Cursor = System.Windows.Forms.Cursors.Default
Return bOk
-14
View File
@@ -193,20 +193,6 @@ Public Class MTableListBoxItem
Return ReadDoorsTable(Me)
End Function
Private Function SearchKey(sLine As String, sKey As String) As String
Dim x = Regex.Match(sLine, "[,|{|\s]" & sKey & "\s*=\s*['|\""]?(.*?)\s*?[,|}|'|\""]").Groups(1).Value
Return Regex.Match(sLine, "[,|{|\s]" & sKey & "\s*=\s*['|\""]?(.*?)\s*?[,|}|'|\""]").Groups(1).Value
End Function
Public Function CountCharacter(ByVal sLine As String, ByVal cValue As Char) As Integer
Dim nCount As Integer = 0
Dim cArray() As Char = sLine.ToCharArray
For Index As Integer = 0 To cArray.Count - 1
If cArray(Index) = cValue Then nCount += 1
Next
Return nCount
End Function
Public Function IsModified() As Boolean
Dim CurrIsModified As Boolean = False
' verifico se ci sono stati cambiamenti nell'ordine delle lavorazioni
+1 -13
View File
@@ -2,6 +2,7 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Module TableUtility
@@ -278,19 +279,6 @@ Module TableUtility
End If
End Sub
Friend Function SearchKey(sLine As String, sKey As String) As String
Return Regex.Match(sLine, "[,|{|\s]" & sKey & "\s*=\s*['|\""]?(.*?)\s*?[,|}|'|\""]").Groups(1).Value
End Function
Public Function CountCharacter(ByVal sLine As String, ByVal cValue As Char) As Integer
Dim nCount As Integer = 0
Dim cArray() As Char = sLine.ToCharArray
For Index As Integer = 0 To cArray.Count - 1
If cArray(Index) = cValue Then nCount += 1
Next
Return nCount
End Function
Friend Sub WriteDoorTable(SelectedTable As MTableListBoxItem, sTableNamePath As String)
' controllo e correggo indici gruppi
CheckGroupIndex(SelectedTable)
+26
View File
@@ -167,6 +167,32 @@ Module GunStock
Return bOk
End Function
Function ExecGunStockCopy(ByRef scene As Scene, sFilePath As String, sDirDest As String) As Boolean
' Carico ambiente lua per Gunstock
If Not LoadGunStock() Then
MessageBox.Show(EgtMsg(8252), EgtMsg(8251), MessageBoxButton.OK, MessageBoxImage.Error)
EgtOutLog("Error in LoadGunStock")
Return False
End If
' Eseguo la copia
scene.Cursor = System.Windows.Forms.Cursors.WaitCursor
EgtLuaSetGlobStringVar("GGD.PEZFILE", sFilePath)
EgtLuaSetGlobStringVar("GGD.COPYDIR", sDirDest)
Dim sFunction As String = String.Empty
GetPrivateProfileString(S_GUNSTOCK, K_COPYFUNCTION, "", sFunction)
Dim bOk As Boolean = EgtLuaExecLine(sFunction)
Dim nErr As Integer = 999
If Not EgtLuaGetGlobIntVar("GGD.ERR", nErr) Or nErr <> 0 Then bOk = False
EgtOutLog("Gunstock Err=" & nErr.ToString())
' Cancello variabile globale
EgtLuaResetGlobVar("GGD")
scene.Cursor = System.Windows.Forms.Cursors.Default
Return bOk
End Function
Private Function LoadGunStock() As Boolean
' Cancello ambiente Gunstock globale
EgtLuaResetGlobVar("GGD")
+4 -7
View File
@@ -3,13 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel Background="Transparent" Orientation="Horizontal">
<!--<Button Command="{Binding GunStockCommand}" Style="{StaticResource GridViewPanelButton}"
Width="70" Content="GUNSTOCK" ContextMenuService.Placement="Bottom">
<Button.ContextMenu>
<ContextMenu ItemsSource="{Binding MruGunStockNames}" ItemContainerStyle="{StaticResource MruGunStockItem}">
</ContextMenu>
</Button.ContextMenu>
</Button>-->
<Button Command="{Binding NewGunStockCommand}" Style="{StaticResource GridViewPanelButton}"
Width="70" Content="{Binding NewGunStockMsg}" ContextMenuService.Placement="Bottom"
ToolTip="{Binding NewGunStockToolTip}">
@@ -28,6 +21,10 @@
</ContextMenu>
</Button.ContextMenu>
</Button>
<Button Command="{Binding CopyGunStockCommand}" Style="{StaticResource GridViewPanelButton}"
Width="70" Content="{Binding CopyGunStockMsg}" ContextMenuService.Placement="Bottom"
ToolTip="{Binding CopyGunStockToolTip}" Visibility="{Binding CopyGunStock_Visibility}">
</Button>
</StackPanel>
</UserControl>
+51 -4
View File
@@ -20,12 +20,17 @@ Public Class GunStockPanelVM
Public ReadOnly Property NewGunStockMsg As String
Get
Return EgtMsg(MSG_GUNSTOCK + 1)
Return EgtMsg(8201)
End Get
End Property
Public ReadOnly Property ModifyGunStockMsg As String
Get
Return EgtMsg(MSG_GUNSTOCK + 3)
Return EgtMsg(8203)
End Get
End Property
Public ReadOnly Property CopyGunStockMsg As String
Get
Return EgtMsg(8214)
End Get
End Property
@@ -35,20 +40,35 @@ Public Class GunStockPanelVM
Public ReadOnly Property NewGunStockToolTip As String
Get
Return EgtMsg(MSG_GUNSTOCK + 2)
Return EgtMsg(8202)
End Get
End Property
Public ReadOnly Property ModifyGunStockToolTip As String
Get
Return EgtMsg(MSG_GUNSTOCK + 4)
Return EgtMsg(8204)
End Get
End Property
Public ReadOnly Property CopyGunStockToolTip As String
Get
Return EgtMsg(8215)
End Get
End Property
#End Region ' ToolTip
Public ReadOnly Property CopyGunStock_Visibility As Visibility
Get
Dim sFunction As String = String.Empty
GetPrivateProfileString(S_GUNSTOCK, K_COPYFUNCTION, "", sFunction)
Return If( String.IsNullOrWhiteSpace( sFunction), Visibility.Collapsed, Visibility.Visible)
End Get
End Property
' Definizione comandi
Private m_cmdNewGunStock As ICommand
Private m_cmdModifyGunStock As ICommand
Private m_cmdCopyGunStock As ICommand
Private Shared m_cmdOpenMruNewGunStock As ICommand
Private Shared m_cmdOpenMruModifyGunStock As ICommand
@@ -100,6 +120,33 @@ Public Class GunStockPanelVM
#End Region ' ModifyGunStockCommand
#Region "CopyGunStockCommand"
''' <summary>
''' Returns a command that Copy Part Program files.
''' </summary>
Public ReadOnly Property CopyGunStockCommand As ICommand
Get
If m_cmdCopyGunStock Is Nothing Then
m_cmdCopyGunStock = New RelayCommand(AddressOf CopyGunStock)
End If
Return m_cmdCopyGunStock
End Get
End Property
''' <summary>
''' Copy Part Program files. This method is invoked by the CopyGunStockCommand.
''' </summary>
Public Sub CopyGunStock(ByVal param As Object)
Dim sFilePath As String = ""
IniFile.m_MruModifyGunStock.GetFileName(0, sFilePath)
Dim sDirDest As String = ""
GetPrivateProfileString(S_GUNSTOCK, K_COPYDIR, "", sDirDest)
Map.refProjectVM.GunStockCopy(sFilePath, sDirDest)
End Sub
#End Region ' CopyGunStockCommand
#Region "OpenMruNewGunStockCommand"
''' <summary>
+39 -4
View File
@@ -59,6 +59,10 @@ End Class
Public Class ButtonItem
Inherits ViewModelBase
Friend Shared WithEvents m_ProjectVM As ProjectVM
Private Shared m_sCurrBarName As String
Private m_sBarName As String
Private m_sImagePath As String
Public ReadOnly Property ImagePath As String
Get
@@ -95,9 +99,16 @@ Public Class ButtonItem
' Definizione comandi
Private m_cmdLuaExec As ICommand
Sub New(sLuaCmdPath As String, sImagePath As String, sToolTip As String, sDrawMachOrBoth As String)
Sub New( sBarName As String, sLuaCmdPath As String, sImagePath As String, sToolTip As String, sDrawMachOrBoth As String)
m_sBarName = sBarName
If File.Exists(sImagePath) Then
m_sImagePath = sImagePath
' per lasciare libere le immagini le copio (potrebbe fallire perchè bloccate da altro eseguibile)
Dim sNewPath As String = Path.Combine(IniFile.m_sResourcesRoot, sBarName & "_" & Path.GetFileName( sImagePath))
Try
File.Copy( sImagePath, sNewPath, True)
Catch ex As Exception
End Try
m_sImagePath = sNewPath
Else
m_sImagePath = IniFile.m_sResourcesRoot & "\" & sImagePath
End If
@@ -131,16 +142,40 @@ Public Class ButtonItem
If m_sLuaCmdPath = BeamPanelVM.BEAM_MACHININGS Then
Beam.BeamMachDb()
Return
' se altrimenti per pareti
' se altrimenti per pareti
ElseIf m_sLuaCmdPath = WallPanelVM.WALL_MACHININGS Then
Wall.WallMachDb()
Return
End If
If Not File.Exists(m_sLuaCmdPath) Then Return
If Not Path.GetExtension(m_sLuaCmdPath).ToLower = ".lua" Then Return
' Abilito eventi se comando lua termina con Beam\Process.lua
m_sCurrBarName = m_sBarName
Dim bRaiseEvent As Boolean = ( m_sBarName = "Beam" OrElse m_sBarName = "Wall")
' eseguo file Lua
Map.refProjectVM.PreExecScript(False)
Map.refProjectVM.ExecScript(m_sLuaCmdPath)
Map.refProjectVM.ExecScript(m_sLuaCmdPath, bRaiseEvent)
m_sCurrBarName = Nothing
End Sub
Private Shared Sub OnPreControllerExec(sFilePath As String) Handles m_ProjectVM.OnPreControllerExec
If m_sCurrBarName = "Beam" Then
EgtLuaCreateGlobTable("BEAM")
EgtLuaSetGlobStringVar("BEAM.BASEDIR", IniFile.m_sBeamDirPath)
If EgtGetUserLevel() >= 9 AndAlso GetPrivateProfileInt(S_LUA, K_BWSIM, 0) = 1 then EgtLuaSetGlobBoolVar("BEAM.BW", true)
ElseIf m_sCurrBarName = "Wall" Then
EgtLuaCreateGlobTable("WALL")
EgtLuaSetGlobStringVar("WALL.BASEDIR", IniFile.m_sWallDirPath)
If EgtGetUserLevel() >= 9 AndAlso GetPrivateProfileInt(S_LUA, K_BWSIM, 0) = 1 then EgtLuaSetGlobBoolVar("WALL.BW", true)
End If
End Sub
Private Shared Sub OnPostControllerExec() Handles m_ProjectVM.OnPostControllerExec
If m_sCurrBarName = "Beam" Then
EgtLuaResetGlobVar("BEAM")
ElseIf m_sCurrBarName = "Wall" Then
EgtLuaResetGlobVar("WALL")
End If
End Sub
#End Region ' LuaExecCommand
+1 -1
View File
@@ -76,7 +76,7 @@ Module ToolsUpdate
' Leggo la linea
Dim sLine As String = sr.ReadLine()
' La divido usando come separatore ';'
Dim sItems() As String = sLine.Split(";".ToCharArray)
Dim sItems() As String = sLine.Split(";"c)
' Ci devono essere almeno tre parti
If sItems.Count() < 3 Then Continue Do
' Leggo i valori
+8 -4
View File
@@ -44,11 +44,15 @@
IsEnabled="{Binding DrawIsChecked}">
<Image Source="/Resources/TopCommandBar/Export.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding OptionsCommand}" ToolTip="{Binding OptionsToolTip}"
<Button Command="{Binding PrintCommand}" ToolTip="{Binding PrintToolTip}"
IsEnabled="True">
<Image Source="/Resources/TopCommandBar/Print.png" Height="22" />
</Button>
<Button Command="{Binding OptionsCommand}" ToolTip="{Binding OptionsToolTip}"
IsEnabled="{Binding SaveIsEnabled}">
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
</Button>
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}"
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
</Button>
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}"
IsEnabled="{Binding SaveIsEnabled}">
<Image Source="/Resources/TopCommandBar/Send.png" Height="22" Margin="3,0,3,0" />
</Button>
+92 -7
View File
@@ -24,6 +24,7 @@ Public Class TopCommandBarVM
Private m_cmdInsert As ICommand
Private m_cmdImport As ICommand
Private m_cmdExport As ICommand
Private m_cmdPrint As ICommand
Private m_cmdOptions As ICommand
Private m_cmdSendFeedback As ICommand
@@ -80,6 +81,11 @@ Public Class TopCommandBarVM
Return EgtMsg(MSG_TOPCOMMANDBAR + 7)
End Get
End Property
Public ReadOnly Property PrintToolTip As String
Get
Return EgtMsg(MSG_TOPCOMMANDBAR + 15)
End Get
End Property
Public ReadOnly Property OptionsToolTip As String
Get
Return EgtMsg(MSG_TOPCOMMANDBAR + 9)
@@ -191,10 +197,18 @@ Public Class TopCommandBarVM
Private Sub SetMachiningMode(value As Boolean)
If value Then
' Flag creazione nuovo gruppo vuoto
Dim bAllowEmpty As Boolean = (Keyboard.IsKeyDown(Key.LeftShift) OrElse Keyboard.IsKeyDown(Key.RightShift))
' Cerco di preimpostare come corrente la macchina opportuna
If Not bAllowEmpty AndAlso EgtGetSelectedObjCount() = 0 AndAlso EgtGetMachGroupCount() > 0 Then
Dim sMachineName As String = ""
if EgtGetMachGroupMachineName( EgtGetLastMachGroup(), sMachineName) Then
Map.refMachinePanelVM.SelectedMachine = Map.refMachinePanelVM.MachinesList.FirstOrDefault(Function(x) x.Name = sMachineName)
End If
End If
' Eventuale esecuzione script prima di inizio Mach
ExecInitMachScript()
' Inizializzazione gruppo/i di lavoro
Dim bAllowEmpty As Boolean = (Keyboard.IsKeyDown(Key.LeftShift) OrElse Keyboard.IsKeyDown(Key.RightShift))
Map.refMachGroupPanelVM.InitMachGroupList(bAllowEmpty)
' Se non riuscito il passaggio al Machining, lancio lo script di uscita
If EgtGetCurrMachGroup() = GDB_ID.NULL Then
@@ -203,7 +217,7 @@ Public Class TopCommandBarVM
' altrimenti, aggiusto...
Else
' se parametri di una lavorazione aperti, disattivo database utensili, lavorazioni e setup
Dim bIsEnabled As Boolean = Not Map.refOperationParametersExpanderVM.ParametersIsExpanded
Dim bIsEnabled As Boolean = Not IsNothing(Map.refOperationParametersExpanderVM) AndAlso Not Map.refOperationParametersExpanderVM.ParametersIsExpanded
Map.refMachinePanelVM.ToolMachSetUpIsEnabled(bIsEnabled, bIsEnabled, bIsEnabled)
' se parametri di una lavorazione aperti, disattivo MTable e SpecialPanel
Map.refDoorPanelVM.MTableIsEnabled(bIsEnabled)
@@ -471,10 +485,81 @@ Public Class TopCommandBarVM
#End Region ' ExportCommand
#Region "PrintCommand"
''' <summary>
''' Returns a command that do Print.
''' </summary>
Public ReadOnly Property PrintCommand As ICommand
Get
If m_cmdPrint Is Nothing Then
m_cmdPrint = New RelayCommand(AddressOf Print)
End If
Return m_cmdPrint
End Get
End Property
''' <summary>
''' Execute the Print. This method is invoked by the PrintCommand.
''' </summary>
Public Sub Print(ByVal param As Object)
Dim printDlg As New PrintDialog
Dim sPath = IniFile.m_sTempDir & "\Image.png"
If printDlg.ShowDialog() Then
' Recupero le dimensioni dell'area di stampa
Dim dW As Double = printDlg.PrintableAreaWidth
Dim dH As Double = printDlg.PrintableAreaHeight
Try
'Prendo l'immagine per la stampa
Dim colWhite As New Color3d(255, 255, 255)
Dim nImgW As Integer = 3000
Dim nImgH As Integer = 2000
' recupero lo stile di visualizzazione
Dim SM_Select As SM = CType(EgtGetShowMode(), SM)
If SM_Select <> SM.SHADING Then EgtSetLineAttribs(3)
' eseguo cattura immagine
Dim bOk As Boolean = EgtGetImage(SM_Select, colWhite, colWhite, nImgW, nImgH, sPath)
' ripristino spessore linee
Dim nLineWidth As Integer = GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1)
EgtSetLineAttribs(nLineWidth)
' in caso di errore
If Not bOk Then
' Error in creating the print image
EgtOutLog(EgtMsg(50181))
Return
End If
'Metodo complesso di stampa che permette di rilasciare il file :
' carico la bitmap e la metto in uno stream in memoria
Dim stream As System.IO.Stream = New System.IO.MemoryStream()
Dim bitmap As System.Drawing.Bitmap = New System.Drawing.Bitmap(sPath)
bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png)
bitmap.Dispose()
' la sposto in una BitmapImage
Dim bitImage As New System.Windows.Media.Imaging.BitmapImage()
bitImage.BeginInit()
bitImage.StreamSource = stream
bitImage.EndInit()
' la sposto in un Visual Control
Dim tmpImg As New Image
tmpImg.BeginInit()
tmpImg.Source = bitImage
tmpImg.Stretch = Stretch.Uniform
tmpImg.EndInit()
' eseguo la stampa
printDlg.PrintVisual(tmpImg, "EgtCam5-Print")
Catch
' Error in executing print
EgtOutLog(EgtMsg(50182))
End Try
End If
End Sub
#End Region ' PrintCommand
#Region "OptionsCommand"
''' <summary>
''' Returns a command that do Export.
''' Returns a command that display Options.
''' </summary>
Public ReadOnly Property OptionsCommand As ICommand
Get
@@ -486,7 +571,7 @@ Public Class TopCommandBarVM
End Property
''' <summary>
''' Execute the Export. This method is invoked by the ExportCommand.
''' Execute the display Options. This method is invoked by the OptionsCommand.
''' </summary>
Public Sub Options(ByVal param As Object)
Dim OptionsWindow As New OptionWindowV
@@ -581,12 +666,12 @@ Public Class TopCommandBarVM
File.Delete(sZipToCreate)
End If
Try
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
Using zip As New Ionic.Zip.ZipFile(sZipToCreate)
' aggiungo file macchine
For Each sMachineName As String In Machines
Dim sMachineDir As String = IniFile.m_sMachinesRoot & "\" & sMachineName
If Directory.Exists(sMachineDir) Then
zip.AddItem(sMachineDir, sMachineName)
zip.AddSelectedFiles( "name != *\.git\*.* and name != *.git*", sMachineDir, sMachineName, True)
End If
Next
' aggiungo progetto corrente
@@ -615,7 +700,7 @@ Public Class TopCommandBarVM
' preparo la mail per il supporto
Dim bEx As Boolean = False
Try
Dim sAddressArray As String() = sSupportAddress.Split(CType(",", Char()))
Dim sAddressArray As String() = sSupportAddress.Split(","c)
Dim SendFeedbackWindow As New EgtWPFLib5.MapiMailMessage("EgtCAM5 Feedback - " & sKey)
SendFeedbackWindow.Recipients.Add(sAddressArray(0))
For index As Integer = 1 To sAddressArray.Length() - 1
+20
View File
@@ -37,6 +37,7 @@
<EgtCAM5:BeamWallPanelVM x:Key="BeamWallPanelViewModel"/>
<EgtCAM5:DoorPanelVM x:Key="DoorsPanelViewModel"/>
<EgtCAM5:GunStockPanelVM x:Key="GunStockPanelViewModel"/>
<EgtCAM5:Printing3DPanelVM x:Key="Printing3DPanelVM"/>
<EgtCAM5:MyMachGroupPanelVM x:Key="MachGroupPanelViewModel"/>
<!--<EgtCAM5:MachGroupPanelVM x:Key="MachGroupPanelViewModel"/>-->
<!--<EgtCAM5:OperationExpanderVM x:Key="OperationExpanderViewModel"/>-->
@@ -1045,6 +1046,25 @@
</Setter>
</Style>
<Style x:Key="VerticalScrollViewerItemsControlStyle" TargetType="{x:Type ItemsControl}">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ItemsControl}">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" >
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- ToolTip that Hide itself if is empty (not working if the content is not a string, but a control; Ex: a TextBlock) -->
+74 -12
View File
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Public Module IniFile
@@ -50,6 +51,7 @@ Public Module IniFile
CAD2D = 128
STEELDORS = 256
WALL = 512
_3DPRINT = 1024
End Enum
Friend m_sDataRoot As String
Friend m_sConfigDir As String
@@ -63,10 +65,14 @@ Public Module IniFile
Friend m_sBeamDirPath As String
' path della cartella WALL
Friend m_sWallDirPath As String
' path della cartella BEALWALL
' path della cartella BEAMWALL
Friend m_sBeamWallDirPath As String
' path della cartella DOORS
Friend m_sDoorsDirPath As String
' path della cartella GUNSTOCK
Friend m_sGunstockDirPath As String
' path della cartella Printing3d
Friend m_sPrinting3dDirPath As String
Friend m_ProjectMode As ProjectModeOpt
Friend m_bMmUnits As Boolean
@@ -148,7 +154,7 @@ Public Module IniFile
Public Function GetPrivateProfileFloatingWinPos(lpAppName As String, lpKeyName As String, ByRef nState As String, ByRef nIndex As Integer, ByRef nLeft As Integer, ByRef nTop As Integer) As Boolean
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
Dim sItems() As String = sVal.Split(",".ToCharArray)
Dim sItems() As String = sVal.Split(","c)
If sItems.Count() >= 4 Then
nState = sItems(0)
nIndex = CInt(sItems(1))
@@ -165,7 +171,7 @@ Public Module IniFile
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
Dim sItems() As String = sVal.Split(",".ToCharArray)
Dim sItems() As String = sVal.Split(","c)
If sItems.Count() = 2 Then
Return New Language(sItems(0), sItems(1))
End If
@@ -179,7 +185,7 @@ Public Module IniFile
Dim sVal As String = String.Empty
EgtUILib.GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, m_sCurrMachIniFilePath)
Dim sItems() As String = sVal.Split(",".ToCharArray)
Dim sItems() As String = sVal.Split(","c)
If sItems.Count() = 2 Then
sName = sItems(0)
nTot = CInt(sItems(1))
@@ -193,7 +199,7 @@ Public Module IniFile
ByVal lpKeyName As String, ByRef sTcPos As String, ByRef sHead As String, ByRef nGroup As Integer) As Boolean
Dim sVal As String = String.Empty
EgtUILib.GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, m_sCurrMachIniFilePath)
Dim sItems() As String = sVal.Split(";".ToCharArray)
Dim sItems() As String = sVal.Split(";"c)
If sItems.Count() >= 2 Then
sTcPos = sItems(0)
sHead = sItems(1)
@@ -207,12 +213,12 @@ Public Module IniFile
Return False
End Function
Public Function GetPrivateProfileButton(sSection As String, sKey As String, sBaseDir As String, ByRef ReadedButtonItem As ButtonItem) As Boolean
ReadedButtonItem = Nothing
Public Function GetPrivateProfileButton(sSection As String, sKey As String, sBaseDir As String, ByRef ReadButtonItem As ButtonItem) As Boolean
ReadButtonItem = Nothing
Dim sVal As String = String.Empty
GetPrivateProfileString(sSection, sKey, "", sVal)
If String.IsNullOrWhiteSpace(sVal) Then Return False
Dim sItems() As String = sVal.Split(",".ToCharArray)
Dim sItems() As String = sVal.Split(","c)
If sItems.Count() >= 1 Then
Dim sLuaPath As String = sItems(0)
Dim sImagePath As String = If(sItems.Count() >= 2, sItems(1), "")
@@ -222,7 +228,7 @@ Public Module IniFile
If sLuaPath.Contains(".lua") Then sLuaPath = sBaseDir & "\" & sLuaPath
If Not String.IsNullOrWhiteSpace(sImagePath) Then sImagePath = sBaseDir & "\" & sImagePath
End If
ReadedButtonItem = New ButtonItem(sLuaPath, sImagePath, sToolTip, sDrawMachOrBoth)
ReadButtonItem = New ButtonItem(sSection, sLuaPath, sImagePath, sToolTip, sDrawMachOrBoth)
Return True
End If
Return False
@@ -245,15 +251,44 @@ Public Module IniFile
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
End Function
Friend Function GetProgramVersion() As String
Return 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 Function
Friend Function IsActiveBeam() As Boolean
Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.BEAM) <> 0 And (GetPrivateProfileInt(S_BEAM, K_BEAMENABLE, 0) <> 0)
If bIsActive Then GetPrivateProfileString(S_BEAM, K_BEAMBASEDIR, "", m_sBeamDirPath)
If bIsActive Then
Dim sTemp As String = ""
GetPrivateProfileString(S_BEAM, K_BEAMBASEDIR, "", sTemp)
#If PLATFORM = "x64" Then
GetPrivateProfileString(S_BEAM, K_BEAMBASEDIR64, sTemp, sTemp)
#End If
m_sBeamDirPath = sTemp.TrimEnd( "\"c)
End If
Return bIsActive
End Function
Friend Function IsActiveWall() As Boolean
Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.WALL) <> 0 And (GetPrivateProfileInt(S_WALL, K_WALLENABLE, 0) <> 0)
If bIsActive Then GetPrivateProfileString(S_WALL, K_WALLBASEDIR, "", m_sWallDirPath)
If bIsActive Then
Dim sTemp As String = ""
GetPrivateProfileString(S_WALL, K_WALLBASEDIR, "", sTemp)
#If PLATFORM = "x64" Then
GetPrivateProfileString(S_WALL, K_WALLBASEDIR64, sTemp, sTemp)
#End If
m_sWallDirPath = sTemp.TrimEnd( "\"c)
End If
Return bIsActive
End Function
Friend Function IsActivePrinting3d() As Boolean
Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT._3DPRINT) <> 0 And (GetPrivateProfileInt(S_PRINTING3D, K_ENABLE, 0) <> 0)
If bIsActive Then
GetPrivateProfileString(S_PRINTING3D, K_3PRNBASEDIR, "", m_sPrinting3dDirPath)
End If
Return bIsActive
End Function
@@ -264,7 +299,13 @@ Public Module IniFile
End Function
Friend Function IsActiveGunStock() As Boolean
Return (IniFile.m_nKeyOptions And KEY_OPT.GUNSTOCK) <> 0 And (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0)
Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.GUNSTOCK) <> 0 And (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0)
If bIsActive Then
Dim sTemp As String = ""
GetPrivateProfileString(S_GUNSTOCK, K_GUNSTOCKEXEC, "", sTemp)
m_sGunstockDirPath = Path.GetDirectoryName( sTemp)
End If
Return bIsActive
End Function
Friend Function IsKeyEnabledVirtualMilling() As Boolean
@@ -276,4 +317,25 @@ Public Module IniFile
Return GetPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) <> 0 AndAlso GetPrivateProfileButton(S_SPECIAL, K_BUTTON & "1", "", btDummy)
End Function
Friend Function GetSpecialLuaVersion( sSpecialLuaDir As String, ByRef sVersion As String) As Boolean
Dim sExecPath As String = (sSpecialLuaDir & "\Version.lua")
If Not EgtLuaExecFile(sExecPath, False) Then Return False
If Not EgtLuaGetGlobStringVar("VERSION", sVersion) Then Return False
EgtLuaResetGlobVar("VERSION")
Return True
End Function
Friend Function GetSpecialLuaData( sSpecialLuaDir As String,
ByRef sName As String, ByRef sVersion As String, ByRef sMinExe As String) As Boolean
Dim sExecPath As String = (sSpecialLuaDir & "\Version.lua")
If Not EgtLuaExecFile(sExecPath, False) Then Return False
If Not EgtLuaGetGlobStringVar("NAME", sName) Then Return False
If Not EgtLuaGetGlobStringVar("VERSION", sVersion) Then Return False
If Not EgtLuaGetGlobStringVar("MIN_EXE", sMinExe) Then Return False
EgtLuaResetGlobVar("NAME")
EgtLuaResetGlobVar("VERSION")
EgtLuaResetGlobVar("MIN_EXE")
Return True
End Function
End Module
-37
View File
@@ -82,43 +82,6 @@ Public Module MachineModel
Return ActiveMachiningsFamiliesList.ToArray
End Function
Friend Sub LoadMachiningListByType(MachiningList As List(Of String), nType As MCH_MY)
MachiningList.Clear()
Dim MachiningName As String = String.Empty
EgtMdbGetFirstMachining(nType, MachiningName)
While Not String.IsNullOrWhiteSpace(MachiningName)
MachiningList.Add(MachiningName)
EgtMdbGetNextMachining(nType, MachiningName)
End While
End Sub
Friend Sub LoadMachiningListByType(MachiningList As List(Of String), nMachiningType As MCH_MY, nToolType As MCH_TF, Optional bClearList As Boolean = True)
If bClearList Then MachiningList.Clear()
Dim MachiningName As String = String.Empty
EgtMdbGetFirstMachining(nMachiningType, MachiningName)
While Not String.IsNullOrWhiteSpace(MachiningName)
' se il tipo di utensile è nullo, prendo tutte le lavorazioni
If IsNothing(nToolType) OrElse nToolType = 0 Then
MachiningList.Add(MachiningName)
Else
' recupero l'utensile utilizzato
EgtMdbSetCurrMachining(MachiningName)
Dim sCurrTool As String = String.Empty
Dim sTUUID As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTUUID)
EgtTdbGetToolFromUUID(sTUUID, sCurrTool)
EgtTdbSetCurrTool(sCurrTool)
Dim ToolType As Integer = MCH_TY.NONE
EgtTdbGetCurrToolParam(MCH_TP.TYPE, ToolType)
' se il tipo di utensile coincide, aggiungo la lavorazione
If (ToolType And nToolType) <> 0 Then
MachiningList.Add(MachiningName)
End If
End If
EgtMdbGetNextMachining(nMachiningType, MachiningName)
End While
End Sub
' Funzione che imposta la macchina corrente se la trova, altrimenti chiede se ricaricarla o annullare
Friend Function EgtTrySettingCurrMachine(sMachineName As String) As Boolean
If EgtSetCurrMachine(sMachineName) Then
+1 -2
View File
@@ -46,7 +46,7 @@ Module Map
Return m_refTopCommandBarVM
End Get
End Property
Public ReadOnly Property refProjectVM As ProjectVM
Public ReadOnly Property refProjectVM As ProjectVM
Get
Return m_refProjectVM
End Get
@@ -146,7 +146,6 @@ Module Map
Return m_refDoorPanelVM
End Get
End Property
Public ReadOnly Property refSpecialPanelVM As SpecialPanelVM
Get
Return m_refSpecialPanelVM
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EgtUILib" version="2.4.6.1" targetFramework="net40-client" />
<package id="EgtWPFLib" version="2.3.12.1" targetFramework="net40-client" />
<package id="EgtWPFLib5" version="2.4.6.1" targetFramework="net40-client" />
</packages>