Compare commits

..

119 Commits

Author SHA1 Message Date
Demetrio Cassarino 5d1a24b5a1 -aggiunto OnlyProdNewOpenProjectFileDialogV e OnlyProdOpenProjectFileDialogV per nuova interfaccia
-sistemato Notify
2024-04-19 16:06:16 +02:00
Demetrio Cassarino e6741228f8 -aggiunto visualizza tutti i pezzi nella nuova pagina se MachGroupVMList e' vuota 2024-04-19 09:21:35 +02:00
Demetrio Cassarino 09e6b4a633 -creato nuova finestra OnlyProdMovePartInRawPartWnd,
-pulizia codice
2024-04-18 16:49:06 +02:00
Demetrio Cassarino ca0e3cab8b -gestito currproj su nuova pagina 2024-04-17 15:30:36 +02:00
Demetrio Cassarino 021aca8847 -aggiornato codice
- aggiunto pagina OnlyProdProjectType
2024-04-16 16:58:37 +02:00
Demetrio Cassarino 19f0ed75a4 -modifiche su proj nuova pagina 2024-04-12 17:28:26 +02:00
Demetrio Cassarino 05bf06d1e2 - aggiunta immagine non presente 2024-04-10 16:30:26 +02:00
Demetrio Cassarino 957ad00657 -aggiunte pagine per nuova grafica interfaccia 2024-04-10 10:05:02 +02:00
Demetrio Cassarino 5be9816bbd -gestito configuration page per nuova pagina 2024-04-08 17:29:49 +02:00
Demetrio Cassarino 3064e3c9bf -creazione finestre per nuova grafica pagina nuova 2024-04-08 16:22:52 +02:00
Demetrio Cassarino 088b9ce3cf -aggiunto selezione checkbox FeatureInPartInRawPartListVM
-istemata visibilità spèecial panel
2024-04-05 17:01:25 +02:00
Demetrio Cassarino e2f9d0f508 -aggiornato gestione visualizzazione pdf e pdf preview 2024-04-05 09:07:00 +02:00
Demetrio Cassarino f43fac953e -aggiunto rimozione machgroup su scelta macchina onlyprodpage 2024-03-29 17:28:15 +01:00
Demetrio Cassarino bf521d11b3 -implementazione controllo su scelta macchina
-gestito importazione progetto su nuova pagina
2024-03-28 16:05:44 +01:00
Demetrio Cassarino ec20f9db1c - aggiunto pulsante parametri macchina
- aggiunto controllo su scelta macchina, nuova pagina
2024-03-20 14:14:01 +01:00
Demetrio Cassarino 59afa97425 -ripristinato pulsante selezione macchina
-ripristinato aggiornamento tempo
2024-03-07 17:49:59 +01:00
Demetrio Cassarino 30f625ad77 -sistemato controllo su macro creazione nuovo progetto 2024-03-04 09:26:13 +01:00
Demetrio Cassarino a428a170c9 Merge branch 'feature/AddNewFeature' into feature/NewPage 2024-02-23 14:55:14 +01:00
Demetrio Cassarino a6cd836e0d -aggiornato grafica visualizzazione colonne rotazione, inversione 2024-02-23 14:44:44 +01:00
Demetrio Cassarino fbb0e948b3 -aggiunto controllo su visualizzazione rotazione e inversione su nuova pagina 2024-02-23 11:10:41 +01:00
Demetrio Cassarino 9bb1b49883 -aggiornato nomi macro list 2024-02-23 09:38:34 +01:00
Demetrio Cassarino 5d4bd85f85 -aggiornato nomi variabili macro 2024-02-22 17:46:42 +01:00
Demetrio Cassarino 8169b5298a -pulizia codice
-aggornato lista maco custom
2024-02-22 16:58:17 +01:00
Demetrio Cassarino cfda9196be -aggiunto all'aggiunta di una nova macro, la macro custom
-aggiunta nuove finestre NewMacroFeatureWnd e NewAddFeatureWnd
-ripristinato SpecialPanel per OnlyProdPage
2024-02-20 17:16:51 +01:00
Demetrio Cassarino d5a2a25ade -aggiunto processo Variant 2024-02-13 09:58:35 +01:00
Demetrio Cassarino 3e9f6c546d -sistemato merge errato 2024-02-13 09:11:14 +01:00
Demetrio Cassarino c151ed09f8 Merge branch 'feature/RotationBEAM' into feature/NewPage 2024-02-12 17:20:21 +01:00
Demetrio Cassarino d1c5ab7093 Merge branch 'feature/ReportConfigWnd' into feature/NewPage 2024-02-12 17:12:09 +01:00
Demetrio Cassarino f6641c858e -cambio nome pagina nuova feature 2024-02-12 16:45:46 +01:00
Demetrio Cassarino 6fe32752e1 -Ottimizzato codice aggiunta nuova macro 2024-02-12 16:44:33 +01:00
Demetrio Cassarino 4fead794f3 - creato nuova pagina aggiungi nuova feature,
-creato macro con relativi template
2024-02-09 17:12:30 +01:00
Demetrio Cassarino 827c955d1d -modifica finestra feature con templete macro 2024-02-01 17:08:34 +01:00
Demetrio Cassarino 8b96a07386 - pulizia codice
- aggoirnato controllo su errore script aggiunta nuovo pezzo
2024-01-31 12:03:54 +01:00
Demetrio Cassarino 3d957138ee -aggiunto controllo su errore esecuzione execbeam
-aggiunto messaggio per rotazione e inversione
2024-01-24 17:22:54 +01:00
Demetrio Cassarino 12efe7f0ee -aggiunto messaggi per rotazione e inversione 2024-01-24 15:32:18 +01:00
Demetrio Cassarino 8315c6925c -aggiunto rotazion per travi 2024-01-24 14:39:41 +01:00
Demetrio Cassarino c38f9305c6 -aggiornata funzione addpart 2024-01-24 12:24:58 +01:00
Demetrio Cassarino 923757bd8c -sistemato controllo sul currproi e sulla scrittura del proj 2024-01-24 12:20:22 +01:00
Demetrio Cassarino f34b58a636 -aggiornato controllo newrawpart 2024-01-24 12:10:44 +01:00
Demetrio Cassarino 138499fdf4 -gestito controllo sul proj 2024-01-24 11:40:25 +01:00
Demetrio Cassarino edfe32daed -sistemato controlli funzioni 2024-01-24 10:47:36 +01:00
Demetrio Cassarino ecaedb0ed2 controllo errore script aggiunta pezzo 2024-01-24 10:31:25 +01:00
Demetrio Cassarino 9a0f478529 -aggiunto controllo quando execbeam fallisce 2024-01-18 17:52:24 +01:00
Demetrio Cassarino 70761248ff aggiunto a travi, rotazione e inversione 2024-01-17 09:17:16 +01:00
Demetrio Cassarino a723d3caee -aggiunto preview pdf per new page e migliorie codice 2024-01-11 12:14:21 +01:00
Demetrio Cassarino 3646c5832c sistemato pdfhelper 2024-01-10 14:24:34 +01:00
Demetrio Cassarino 2de010d596 sistemato merge errato 2024-01-10 12:55:03 +01:00
Demetrio Cassarino 18db57fca9 Merge branch 'feature/NewPage' into feature/ReportConfigWnd 2024-01-10 12:44:02 +01:00
Demetrio Cassarino c76b8550f8 -sistemato cambio versione nuova/vecchia pagina per supervisor
-ripristinato pulsante showsolid per new page
-rimosso selezione contorno per vecchia pagina
2024-01-10 12:33:46 +01:00
Demetrio Cassarino 804dee9236 modifica abilitazione e disabilitazione pulsanti verify e reset 2024-01-09 11:26:13 +01:00
Demetrio Cassarino 1acf67aaa0 sistemato merge dizionario 2024-01-08 10:49:58 +01:00
Demetrio Cassarino b86ea9b7f8 Merge branch 'master' into feature/NewPage 2024-01-08 10:16:50 +01:00
Demetrio Cassarino 891045ec4e Merge remote-tracking branch 'origin/master' into feature/ReportConfigWnd 2024-01-08 09:49:52 +01:00
Demetrio Cassarino 641b1eb6d3 -aggiunto delete duplo a onlyprodpage, e visualizzazione pezzo 2023-12-22 14:54:42 +01:00
Demetrio Cassarino 10f1420395 -Sistemato visualizzazione preview pdf immagine e tasto chiudi preview 2023-12-14 18:05:29 +01:00
Demetrio Cassarino 20357a3ebc -portato BeamMachiningsWindowV in Core 2023-12-14 14:42:42 +01:00
Demetrio Cassarino a6ef84ab32 -Aggiunto PrintLabel_Msg al ConfigurationPageV del Supervisore 2023-12-13 16:17:49 +01:00
Demetrio Cassarino a8eb4910bc -diviso pagina ConfigurationPageV in 3 pagine General_ConfigurationPageV, QParameter_ConfigurationPageV e Machine_ConfigurationPageV
-Spostato queste finestre nel Core
2023-12-13 16:09:38 +01:00
Demetrio Cassarino 6e4da2e5ff -cambio bottoni su statistic da togle button a button
-aggiunto buttone setup e flag relativo per la visualizzazione del pulsante
-suddiviso configurationpage in tre pagine
2023-12-12 10:41:28 +01:00
Demetrio Cassarino 192839961b -gestito visibilita' pulsanti in Supervisor
-gestito comunicazione db-supervisor-viweroptimizer
2023-12-07 17:42:37 +01:00
Demetrio Cassarino dd2cbb696f Merge branch 'feature/NewPage' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewPage 2023-12-05 11:26:41 +01:00
Demetrio Cassarino dd0071244e - ottimizzazione codice
- aggiunta pulsante progettazione in Supervisor
2023-12-05 11:26:35 +01:00
Emmanuele Sassi c73bd50beb - correzione rimando a BottomPanel 2023-12-04 11:00:22 +01:00
Emmanuele Sassi f2c5325e67 - correzione apertura MRU in OnlyProd 2023-12-02 14:52:59 +01:00
Demetrio Cassarino 9a01374845 -sistemato visualizzazione pezzo in showbulding e reso non visibile tabella feature 2023-11-29 11:34:43 +01:00
Emmanuele Sassi 4f29587989 Merge branch 'feature/NewPage' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewPage 2023-11-27 10:02:38 +01:00
Emmanuele Sassi aac9b09da7 - modifiche selezione, da rivedere 2023-11-27 10:00:41 +01:00
Demetrio Cassarino 9caa404aa5 -crezione pagina contenente il tabcontrol
-creazione pagine PartInRawPartManagerWnd e RawPartManagerWnd
2023-11-24 10:14:38 +01:00
Demetrio Cassarino d06929d1dd - sistemato stampa pdf ottimizzatore 2023-11-21 09:48:06 +01:00
Emmanuele Sassi 970aabee17 - smontaggio assemblato prima di passare a grezzo o pezzo del grezzo
- riapertura progetto dopo creazione Prod
2023-11-20 16:35:28 +01:00
Demetrio Cassarino b181396c87 -sistemato pulsanti visualizzatore e ottimizzatore per la stampa del pdf 2023-11-20 12:22:45 +01:00
Demetrio Cassarino 5132c3af81 Merge branch 'feature/NewPage' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewPage 2023-11-20 11:26:01 +01:00
Demetrio Cassarino b87faa551f -creazione pagine BTLPartManager, FeatureListManager, PartInRawPArtManager e RawPartManager
-Ottimizzazione codice
2023-11-20 11:25:53 +01:00
Emmanuele Sassi 76169b0516 - modifica selezione su tabella 2023-11-16 18:53:37 +01:00
Demetrio Cassarino 922d648ecc -creazione pagine optimizestatistics e statistics e relativi pulsanti 2023-11-15 14:48:05 +01:00
Demetrio Cassarino f229e08ecf Merge branch 'feature/NewPage' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewPage 2023-11-14 17:39:33 +01:00
Demetrio Cassarino 5bc70f9ff6 - aggiunta finestre BTLDataWnd e PartParametersWnd
- Aggiunto controllo visibilita' su comando showall
2023-11-14 17:39:26 +01:00
Emmanuele Sassi 97957e0365 - aggiunta selezione BtlPart quando selezionato pezzo in grezzo
- correzione verifica modifiche progetto su ImportBTL
2023-11-14 17:32:44 +01:00
Emmanuele Sassi df46f3b5a5 - correzioni per gestione selezione in OnlyProd
- gestione comune del CurrProj e CurrProd
2023-11-13 17:46:27 +01:00
Demetrio Cassarino 7e88899e05 -aggiunta dai di esempio nella preview del pdf e miglioria immagine 2023-11-10 17:30:10 +01:00
Emmanuele Sassi 408b59ee9c - miglioramento selezione BTLPart e MachGroup 2023-11-09 09:19:42 +01:00
Demetrio Cassarino 860e47c0a3 Merge remote-tracking branch 'origin/feature/ReportConfigWnd' into feature/ReportConfigWnd 2023-11-09 08:35:07 +01:00
Emmanuele Sassi 5017e96cde - correzioni ProjectManager
- correzioni selezione pezzi e machgroup
2023-11-09 08:28:55 +01:00
Dario Sassi 9b34053fde EgtBEAMWALL :
- piccole modifiche per gestire process Variant (per ora limitato al code 2).
2023-11-08 18:19:02 +01:00
Dario Sassi 3588ea8e41 Merge remote-tracking branch 'origin/feature/ReportConfigWnd' into feature/ReportConfigWnd 2023-11-08 18:10:53 +01:00
Emmanuele Sassi f359184505 Merge remote-tracking branch 'gitlab.seriate/master' into feature/NewPage 2023-11-08 10:50:28 +01:00
Demetrio Cassarino 293f007f2e aggiornato metodo per la visualizzazione della preview del PDF 2023-11-08 09:08:28 +01:00
Demetrio Cassarino 2c3e3f74f9 Modifica pagina onlyprod 2023-11-06 16:48:49 +01:00
Demetrio Cassarino 91d943d0a7 Aggiunta tab vuoto a tab prod/proj e controllo pulsanti 2023-10-30 12:28:58 +01:00
Demetrio Cassarino e1954b3731 Aggiunta View per onlyprod 2023-10-27 17:34:39 +02:00
Demetrio Cassarino fe0db46b69 Creazione nuova pagina che unisce visualizzatore e ottimizzatore 2023-10-24 18:08:57 +02:00
Demetrio Cassarino 3fc4c235f7 Merge remote-tracking branch 'origin/feature/NewOpenWindow' into feature/ReportConfigWnd 2023-10-13 17:19:54 +02:00
Emmanuele Sassi 23b2606cbc - aggiunta Action a ProdItem per gestire update Nome su DB
- rimosso ProdItem da  ViewerOptimizer
2023-10-09 11:14:02 +02:00
Demetrio Cassarino 7cd0fdd14a Modifica procedura web browser 2023-10-04 17:24:35 +02:00
Emmanuele Sassi ce20fa0eb3 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into feature/NewOpenWindow 2023-10-02 09:49:39 +02:00
Samuele Locatelli c32715a4b5 fix ricerca contains 2023-10-02 09:43:46 +02:00
Emmanuele Sassi 52c0b6b194 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into feature/NewOpenWindow 2023-10-02 09:04:13 +02:00
Samuele Locatelli a83752e565 Aggiunta ulteriore metodo con filtro completo x
- BtlName
- ListName
- Machine
- tipo data
2023-09-30 10:36:50 +02:00
Emmanuele Sassi 60e72aaf22 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into feature/NewOpenWindow 2023-09-29 17:55:16 +02:00
Samuele Locatelli ec2ce96b3b Aggiunta in coda dei proj "orfani" 2023-09-29 17:48:11 +02:00
Samuele Locatelli d131e0b42d Merge remote-tracking branch 'origin/feature/NewOpenWindow' into DataLayer 2023-09-29 17:38:40 +02:00
Emmanuele Sassi efea14db89 - aggiunto metodo per creare ProItem con solo ProjFileM 2023-09-29 17:33:29 +02:00
Emmanuele Sassi c09d8a6b0f Merge remote-tracking branch 'gitlab.seriate/DataLayer' into feature/NewOpenWindow 2023-09-29 17:15:09 +02:00
Samuele Locatelli 946ad1d29c Modifica output: Prod --> prodItem list 2023-09-29 17:13:53 +02:00
Emmanuele Sassi c5f1d1669f Merge remote-tracking branch 'gitlab.seriate/DataLayer' into feature/NewOpenWindow 2023-09-29 16:38:06 +02:00
Samuele Locatelli 689e81219b Modifica x gestione lettura proj insieme a prod (da testare) 2023-09-29 16:37:25 +02:00
Samuele Locatelli 05ec565f84 Merge remote-tracking branch 'origin/feature/NewOpenWindow' into DataLayer 2023-09-29 15:57:27 +02:00
Samuele Locatelli 0e7866922d Merge branch 'master' into DataLayer 2023-09-29 15:57:13 +02:00
Samuele Locatelli fb92f9faea typo 2023-09-29 15:56:26 +02:00
Emmanuele Sassi f65d07ab22 - aggiunta lista ProjFileM in ProdFileM 2023-09-29 15:53:47 +02:00
Demetrio Cassarino bc7381de63 Modifica nomi tabella in PDF Editor 2023-09-29 12:39:24 +02:00
Emmanuele Sassi f140b6df54 - correzione funzionamento OpenProject su BTL aggiunti direttamente a Prod 2023-09-29 11:44:50 +02:00
Demetrio Cassarino b6d22cca55 Merge remote-tracking branch 'origin/master' into feature/ReportConfigWnd 2023-09-29 09:33:40 +02:00
Demetrio Cassarino 7bfd834b0e Migliorie codice preview PDF 2023-09-28 17:19:38 +02:00
Demetrio Cassarino 947c776d83 Migliorie grafiche preview 2023-09-28 15:46:52 +02:00
Emmanuele Sassi 441ddc4397 Merge branch 'master' into feature/NewOpenWindow 2023-09-27 18:14:45 +02:00
Demetrio Cassarino f7a7b80bd0 Creazione preview PDF 2023-09-27 16:07:13 +02:00
Demetrio Cassarino b77a893f12 Creazione pagina pdf editor e aggiunta logo in PDF 2023-09-15 11:27:40 +02:00
Samuele Locatelli 8c42493382 Merge remote-tracking branch 'origin/HEAD' into DataLayer 2023-08-31 08:57:41 +02:00
336 changed files with 22164 additions and 6754 deletions
+12 -55
View File
@@ -1,5 +1,4 @@
Imports System.Collections.ObjectModel
Imports System.Globalization
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Media
@@ -132,16 +131,6 @@ Public Class BTLFeatureM
End Set
End Property
Protected m_VARIANTList As New ObservableCollection(Of Integer)()
Public Property VARIANTList As ObservableCollection(Of Integer)
Get
Return m_VARIANTList
End Get
Set(value As ObservableCollection(Of Integer))
m_VARIANTList = value
End Set
End Property
Protected m_sDES As String = String.Empty
Public Property sDES As String
Get
@@ -152,16 +141,6 @@ Public Class BTLFeatureM
End Set
End Property
Public Overridable Property nSelVARIANT As Integer
Get
Dim nDes As Integer = 0
Return If(Integer.TryParse(m_sDES, nDes), nDes, 0)
End Get
Set(value As Integer)
m_sDES = value.ToString()
End Set
End Property
Protected m_frFRAME As New Frame3d
Public Property frFRAME As Frame3d
Get
@@ -265,7 +244,6 @@ Public Class BTLFeatureM
#Region "CONSTRUCTOR"
Protected Sub New()
CreateVariantList()
End Sub
Public Shared Function CreateNewBTLFeature() As BTLFeatureM
@@ -280,7 +258,7 @@ Public Class BTLFeatureM
EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.m_nSelGRP)
EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.m_nPRC)
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE)
EgtGetInfo(nFeatureId, BTL_FTR_PRIORITY, NewBTLFeature.m_nPriority)
EgtGetInfo(nFeatureId, BTL_FTR_PRIORITY, NewBTLFeature.m_nPRIORITY)
Dim nDO As Integer = 1
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
NewBTLFeature.m_bDO = (nDO <> 0)
@@ -338,28 +316,18 @@ Public Class BTLFeatureM
End Function
Public Shared Function CreateBTLFeature(nPRC As Integer, nGRP As Integer, nSIDE As Integer) As BTLFeatureM
Dim NewBTLFeature As New BTLFeatureM
NewBTLFeature.m_nPRC = nPRC
NewBTLFeature.m_nSelGRP = nGRP
NewBTLFeature.m_nSelSIDE = nSIDE
NewBTLFeature.m_nPriority = 0
NewBTLFeature.m_bDO = True
NewBTLFeature.nSelVARIANT = 0
Dim NewBTLFeature As New BTLFeatureM With {
.m_nPRC = nPRC,
.m_nSelGRP = nGRP,
.m_nSelSIDE = nSIDE,
.m_nPriority = 0,
.m_bDO = True
}
' crea parametri per questa feature da file ini
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
Return NewBTLFeature
End Function
Private Sub CreateVariantList()
Dim sMaxIndex As String = ""
Dim nMaxIndex As Integer = 0
EgtUILib.GetPrivateProfileString([VARIANT], K_MAXINDEX, "", sMaxIndex, m_sBTLIniFile)
Integer.TryParse(sMaxIndex, nMaxIndex)
For Index As Integer = 0 To nMaxIndex
m_VARIANTList.Add(Index)
Next
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
@@ -395,21 +363,15 @@ Public Class BTLFeatureM
Dim TempList As New List(Of BTLParamM)
Dim NewBTLParam As BTLParamM = Nothing
' leggo tutti i P della feature
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, nSelVARIANT, True, ParamIndex, Me, NewBTLParam)
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, True, ParamIndex, Me, NewBTLParam)
TempList.Add(NewBTLParam)
ParamIndex += 1
End While
If TempList.Count <= 0 Then
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, 0, True, ParamIndex, Me, NewBTLParam)
TempList.Add(NewBTLParam)
ParamIndex += 1
End While
End If
NewBTLFeature.PBTLParamMList = TempList
' leggo tutti i Q della feature
ParamIndex = 1
TempList = New List(Of BTLParamM)
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, nSelVARIANT, False, ParamIndex, Me, NewBTLParam)
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, False, ParamIndex, Me, NewBTLParam)
TempList.Add(NewBTLParam)
ParamIndex += 1
End While
@@ -584,10 +546,10 @@ Public Class BTLFeatureM
For Each QPar In QBTLParamMList
If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1)
Next
EgtSetInfo(nFeatureId, BTL_FTR_PRIORITY, nPriority)
EgtSetInfo( nFeatureId, BTL_FTR_PRIORITY, nPriority)
SetFeatureId(nFeatureId)
' imposto modificato per copie
EgtDuploSetModified(ParentPart.nPartId)
MyMachGroupPanelM.SetDuploModified(ParentPart.nPartId)
bOk = True
Else
' Impossibile creare una feature con questi valori - ERRORE
@@ -637,11 +599,6 @@ Public Class BTLFeatureM
Return True
End Function
' funzione che restituisce se la feature è un Variant
Public Function IsVariant() As Boolean
Return m_nPRC = 900
End Function
#End Region ' METHODS
End Class
+2 -2
View File
@@ -1242,7 +1242,7 @@ Public Class BTLPartM
m_nROTATED = If(dNewRotation >= 0, dNewRotation, 360 + dNewRotation)
EgtSetInfo(nPartId, BTL_PRT_ROTATED, m_nROTATED)
' imposto modificato per copie
EgtDuploSetModified(nPartId)
MyMachGroupPanelM.SetDuploModified(nPartId)
End If
' se era invertito
If bInverted Then
@@ -1275,7 +1275,7 @@ Public Class BTLPartM
m_nINVERTED = If(m_nINVERTED = 0, 180, 0)
EgtSetInfo(nPartId, BTL_PRT_INVERTED, m_nINVERTED)
' imposto modificato per copie
EgtDuploSetModified(nPartId)
MyMachGroupPanelM.SetDuploModified(nPartId)
End If
End Sub
@@ -64,15 +64,6 @@ Public Class BTLFeatureVM
End Set
End Property
Public Overridable Property nSelVARIANT As Integer
Get
Return m_BTLFeatureM.nSelVARIANT
End Get
Set(value As Integer)
m_BTLFeatureM.nSelVARIANT = value
End Set
End Property
Public ReadOnly Property sName As String
Get
Return m_BTLFeatureM.sName
@@ -273,6 +264,9 @@ Public Class BTLFeatureVM
End If
End Sub
Public Overridable Sub RefreshFeature()
End Sub
#End Region ' METHODS
End Class
@@ -0,0 +1,155 @@
<EgtWPFLib5:EgtCustomWindow x:Class="BeamMachiningsWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize"
Width="500" Height="450"
IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TabControl ItemsSource="{Binding MachiningList}"
SelectedItem="{Binding SelMachining}"
IsSynchronizedWithCurrentItem="True"
Margin="5,0,5,0"
Style="{StaticResource TabControl_OnlyHeaders}"/>
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
ItemsSource="{Binding TableRowList}"
SelectedIndex="{Binding SelRowIndex}"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5"
BindingColumns="{Binding BeamMachiningsColumns}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Height" Value="25"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<Style x:Key="DataGridCheckBoxColumn_Style"
TargetType="{x:Type DataGridCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Colonna On-->
<DataGridCheckBoxColumn x:Key="colON" Binding="{Binding OnPar, UpdateSourceTrigger=PropertyChanged}"
CellStyle="{StaticResource DataGridCheckBoxColumn_Style}">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.OnHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<!--Colonna Name-->
<DataGridTemplateColumn x:Key="colNAME">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.NameHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=NamesList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Margin="5,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Style-->
<DataGridTemplateColumn x:Key="colTYPE">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.TypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=TypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Margin="5,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Resources>
</EgtBEAMWALL:EgtDataGrid>
<Grid Grid.Row="2"
Margin="0,0,0,5"
HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="/\"
Command="{Binding MoveRowUp_Command}"
Grid.Column="0"
Margin="0,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="\/"
Command="{Binding MoveRowDown_Command}"
Grid.Column="1"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding AddRowMsg}"
Command="{Binding AddRow_Command}"
Grid.Column="2"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding DeleteRowMsg}"
Command="{Binding DeleteRow_Command}"
Grid.Column="3"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding SaveMsg}"
Command="{Binding Save_Command}"
Grid.Column="4"
Margin="2.5,0,0,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,20 @@
Imports System.Windows
Public Class BeamMachiningsWindowV
Private WithEvents m_BeamMachiningsWindowVM As MyBeamMachiningsWindowVM
Sub New(Owner As Window, BeamMachiningsWindowVM As MyBeamMachiningsWindowVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = BeamMachiningsWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_BeamMachiningsWindowVM = BeamMachiningsWindowVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BeamMachiningsWindowVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,36 @@
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core
Imports EgtWPFLib5
Public Class MyBeamMachiningsWindowVM
Inherits BeamMachiningsWindowVM
#Region "FIELDS & PROPERTIES"
Private m_BeamMachiningsColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property BeamMachiningsColumns As ObservableCollection(Of EgtDataGridColumn)
Get
Return m_BeamMachiningsColumns
End Get
Set(value As ObservableCollection(Of EgtDataGridColumn))
m_BeamMachiningsColumns = value
End Set
End Property
#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)
MyBase.New(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, bIsBeam)
' carico le colonne della datagrid
GetPrivateProfileColumns(S_BEAMMACHININGS, BeamMachiningsColumns)
' aggiorno la visibilità delle colonne
For Each col In BeamMachiningsColumns
col.ColumnVisibility = If(col.Visible, Windows.Visibility.Visible, Windows.Visibility.Collapsed)
Next
End Sub
#End Region ' CONSTRUCTOR
End Class
@@ -593,13 +593,4 @@ Public Class ProcessResult
m_nTIME = TIME
End Sub
Public Sub ResetTypeFeature()
m_Type = ProcessResultTypes.PART
m_nTASKID = 0
End Sub
Public Sub ResetTypePart()
m_Type = ProcessResultTypes.BAR
m_nCUTID = 0
End Sub
End Class
@@ -0,0 +1,80 @@
<DockPanel x:Class="ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="6*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
SelectedIndex="{Binding SelConfigSubPage}">
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding General_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding General_Visibility}"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:General_ConfigurationPageV/>
</TabItem.Content>
</TabItem>
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding ParameterQ_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding ParameterQ_Visibility}"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:QParameter_ConfigurationPageV/>
</TabItem.Content>
</TabItem>
<TabItem >
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Machine_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding Machine_Visibility}"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:Machine_ConfigurationPageV/>
</TabItem.Content>
</TabItem>
</TabControl>
<!--<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>-->
</Grid>
</DockPanel>
@@ -0,0 +1,3 @@
Public Class ConfigurationPageV
End Class
@@ -0,0 +1,118 @@
<Grid x:Class="General_ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
<GroupBox Header="{Binding CurrentLanguage_Msg}"
Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
SelectedIndex="{Binding SelMeasureUnit}" Height="25"
Margin="0,5,0,0"/>
</UniformGrid>
<GroupBox Header="{Binding Nesting_Msg}"
Margin="0,0,0,5">
<StackPanel>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding SectionTime_Msg}"
Grid.Row="0" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}"
Grid.Row="0" Grid.Column="1"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PartTime_Msg}"
Grid.Row="1" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}"
Grid.Row="1" Grid.Column="1"/>
</UniformGrid>
</StackPanel>
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PrintLabel_Msg}" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding bPrintLabel_IsChecked}"
Margin="0,5,0,0"/>
</UniformGrid>
<GroupBox Header="Backup And Restore">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0"
Margin="0,2,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<CheckBox x:Name="ExternalBackup_CheckBox"
IsChecked="{Binding bExternalBackupActive}"
VerticalAlignment="Center"/>
<TextBlock Grid.Column="1"
Text="External file path:"
VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Row="1"
Margin="0,2,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding ExternalBackupFolderPath}"
IsEnabled="{Binding IsChecked, ElementName=ExternalBackup_CheckBox}"
Margin="0,0,2.5,0"/>
<Button Grid.Column="1"
Content="..."
Width="18"
Command="{Binding ChooseExternalBackupFolderPath_Command}"
IsEnabled="{Binding IsChecked, ElementName=ExternalBackup_CheckBox}"
Margin="2.5,0,0,0"/>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Reminder Frequency"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ReminderList}"
SelectedItem="{Binding SelReminder}"/>
</Grid>
<StackPanel Grid.Row="3"
Orientation="Horizontal">
<Button Content="Backup"
Command="{Binding Backup_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Restore"
Command="{Binding Restore_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
</StackPanel>
</Grid>
</GroupBox>
</StackPanel>
</Grid>
@@ -0,0 +1,3 @@
Public Class General_ConfigurationPageV
End Class
@@ -0,0 +1,79 @@
<Grid x:Class="Machine_ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
</GroupBox>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" Visibility="{Binding MachineParameter_Visibility}">
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
ToolTip="{Binding sName}"
TextWrapping="WrapWithOverflow"
Width="190"
Style="{StaticResource MachParamTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Width="60"/>
<TextBlock Text="{Binding sDescription}"
ToolTip="{Binding sDescription}"
TextWrapping="WrapWithOverflow"
Width="185"
Style="{StaticResource MachParamTextBlock}"
Grid.Column="2"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<Button Command="{Binding SaveCommand}"
Grid.Column="0"
Grid.Row="1"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding Machine_Visibility}"
Style="{StaticResource MachinePanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</Grid>
@@ -0,0 +1,3 @@
Public Class Machine_ConfigurationPageV
End Class
@@ -0,0 +1,118 @@
<Grid x:Class="OnlyProdGeneral_ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
<GroupBox Header="{Binding CurrentLanguage_Msg}"
Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
SelectedIndex="{Binding SelMeasureUnit}" Height="25"
Margin="0,5,0,0"/>
</UniformGrid>
<GroupBox Header="{Binding Nesting_Msg}"
Margin="0,0,0,5">
<StackPanel>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding SectionTime_Msg}"
Grid.Row="0" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}"
Grid.Row="0" Grid.Column="1"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PartTime_Msg}"
Grid.Row="1" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}"
Grid.Row="1" Grid.Column="1"/>
</UniformGrid>
</StackPanel>
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PrintLabel_Msg}" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding bPrintLabel_IsChecked}"
Margin="0,5,0,0"/>
</UniformGrid>
<GroupBox Header="Backup And Restore">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0"
Margin="0,2,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<CheckBox x:Name="ExternalBackup_CheckBox"
IsChecked="{Binding bExternalBackupActive}"
VerticalAlignment="Center"/>
<TextBlock Grid.Column="1"
Text="External file path:"
VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Row="1"
Margin="0,2,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding ExternalBackupFolderPath}"
IsEnabled="{Binding IsChecked, ElementName=ExternalBackup_CheckBox}"
Margin="0,0,2.5,0"/>
<Button Grid.Column="1"
Content="..."
Width="18"
Command="{Binding ChooseExternalBackupFolderPath_Command}"
IsEnabled="{Binding IsChecked, ElementName=ExternalBackup_CheckBox}"
Margin="2.5,0,0,0"/>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Reminder Frequency"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ReminderList}"
SelectedItem="{Binding SelReminder}"/>
</Grid>
<StackPanel Grid.Row="3"
Orientation="Horizontal">
<Button Content="Backup"
Command="{Binding Backup_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Restore"
Command="{Binding Restore_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
</StackPanel>
</Grid>
</GroupBox>
</StackPanel>
</Grid>
@@ -0,0 +1,3 @@
Public Class OnlyProdGeneral_ConfigurationPageV
End Class
@@ -0,0 +1,79 @@
<Grid x:Class="OnlyProdMachine_ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
</GroupBox>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" Visibility="{Binding MachineParameter_Visibility}">
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
ToolTip="{Binding sName}"
TextWrapping="WrapWithOverflow"
Width="190"
Style="{StaticResource MachParamTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Width="60"/>
<TextBlock Text="{Binding sDescription}"
ToolTip="{Binding sDescription}"
TextWrapping="WrapWithOverflow"
Width="185"
Style="{StaticResource MachParamTextBlock}"
Grid.Column="2"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<Button Command="{Binding SaveCommand}"
Grid.Column="0"
Grid.Row="1"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding Machine_Visibility}"
Style="{StaticResource MachinePanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</Grid>
@@ -0,0 +1,3 @@
Public Class OnlyProdMachine_ConfigurationPageV
End Class
@@ -0,0 +1,80 @@
<Grid x:Class="OnlyProdQParameter_ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
ItemsSource="{Binding QBTLParamVMList}"
SelectedItem="{Binding SelQParam}"
Grid.Column="0"
Margin="5">
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV>
</Grid>
@@ -0,0 +1,3 @@
Public Class OnlyProdQParameter_ConfigurationPageV
End Class
@@ -0,0 +1,80 @@
<Grid x:Class="QParameter_ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
ItemsSource="{Binding QBTLParamVMList}"
SelectedItem="{Binding SelQParam}"
Grid.Column="0"
Margin="5">
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV>
</Grid>
@@ -0,0 +1,3 @@
Public Class QParameter_ConfigurationPageV
End Class
+2 -2
View File
@@ -144,6 +144,8 @@
Public Const BTL_PRT_INVERTED As String = "INVERTED"
Public Const BTL_PRT_MATERIAL As String = "MATERIAL"
Public Const BTL_PRT_VOLUME As String = "VOLUME"
Public Const BTL_PRT_ROT As String = "ROT"
Public Const BTL_PRT_FLIP As String = "FLIP"
' parametri pezzo
Public Const BTL_PRT_SINGLEMEMBERNUM = "SINGLEMEMBERNUMBER"
Public Const BTL_PRT_ASSEMBLYNUM = "ASSEMBLYNUMBER"
@@ -201,14 +203,12 @@
Public Const BTL_GEN_USERATTRIBUTE = "USERATTRIBUTE"
Public Const PROCESSINGS As String = "Processings"
Public Const [VARIANT] As String = "Variant"
Public Const OUTLINE As String = "Outline"
Public Const BTL_FTR_GRP As String = "GRP"
Public Const BTL_FTR_PRC As String = "PRC"
Public Const BTL_FTR_DO As String = "DO"
Public Const BTL_FTR_SIDE As String = "SIDE"
Public Const BTL_FTR_PRIORITY As String = "PRIORITY"
Public Const BTL_FTR_VARIANT As String = "VARIANT"
Public Const BTL_FTR_NAME As String = "NAME"
Public Const BTL_FTR_DES As String = "DES"
Public Const BTL_FTR_PRID As String = "PRID"
+18 -5
View File
@@ -1,11 +1,27 @@
Public Module ConstColumns
Public Const COL_ID As String = "colID"
Public Const COL_DO As String = "colDO"
Public Const COL_VALUE As String = "colVALUE"
Public Const COL_CUSTOM As String = "colCUSTOM"
Public Const COL_NAME As String = "colNAME"
Public Const COL_CALC As String = "colCALC"
Public Const COL_PDN As String = "colPDN"
Public Const COL_STARTCUT As String = "colSTARTCUT"
Public Const COL_W As String = "colW"
Public Const COL_H As String = "colH"
Public Const COL_L As String = "colL"
Public Const COL_CNT As String = "colCNT"
Public Const COL_ADDED As String = "colADDED"
Public Const COL_INPROD As String = "colINPROD"
Public Const COL_DONE As String = "colDONE"
Public Const COL_MATERIAL As String = "colMATERIAL"
Public Const COL_UNITVOLUME As String = "colUNITVOLUME"
Public Const COL_TOTVOLUME As String = "colTOTVOLUME"
Public Const COL_UNITTIME As String = "colUNITTIME"
Public Const COL_TOTTIME As String = "colTOTTIME"
Public Const COL_USAGE As String = "colUSAGE"
Public Const COL_WASTE As String = "colWASTE"
Public Const COL_POSZ As String = "colPOSZ"
Public Const COL_ROT As String = "colROT"
Public Const COL_FLIP As String = "colFLIP"
@@ -15,13 +31,10 @@
Public Const COL_REDO As String = "colREDO"
Public Const COL_TYPE As String = "colTYPE"
Public Const COL_DESCRIPTION As String = "colDESCRIPTION"
Public Const COL_DESC As String = "colDESC"
Public Const COL_SUPERVISORID As String = "colSUPERVISORID"
Public Const COL_PRIORITY As String = "colPRIORITY"
Public Const COL_NAME As String = "colNAME"
Public Const COL_H As String = "colH"
Public Const COL_MATERIAL As String = "colMATERIAL"
Public Const COL_USAGE As String = "colUSAGE"
Public Const COL_WASTE As String = "colWASTE"
Public Const COL_QTY As String = "colQTY"
Public Const COL_ARCHIVED As String = "colARCHIVED"
End Module
@@ -19,6 +19,7 @@
Public Const S_PARTLIST As String = "DG_PartList"
Public Const S_FEATUREINPARTINRAWPARTLIST As String = "DG_FeatureInPartInRawPartList"
Public Const S_STATISTICS As String = "DG_Statistics"
Public Const S_STATISTICS_PART As String = "DG_Statistics_PART"
Public Const S_OPTIMIZERSTATISTICS As String = "DG_OptimizerStatistics"
Public Const S_RAWPARTSTATISTICS As String = "DG_RawPartStatistics"
Public Const S_BEAMMACHININGS As String = "DG_BeamMachinings"
+1
View File
@@ -9,5 +9,6 @@
Public Const TOPPANEL_OPTIMIZER As String = "TopPanel_Optimizer"
Public Const LEFTPANEL_SUPERVISOR As String = "LeftPanel_Supervisor"
Public Const PROJECT_SUPERVISOR As String = "Project_Supervisor"
Public Const PROJECT_ONLYPROD As String = "Project_OnlyProd"
End Class
+16 -7
View File
@@ -14,9 +14,9 @@
Public Module ConstGen
' File con direttorio radice dei dati
'Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
'Public Const S_DATA As String = "Data"
'Public Const K_DATAROOT As String = "DataRoot"
Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
Public Const S_DATA As String = "Data"
Public Const K_DATAROOT As String = "DataRoot"
' File con dati di licenza
Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
@@ -24,7 +24,6 @@ Public Module ConstGen
Public Const K_LOCKID As String = "LockId"
Public Const K_KEY As String = "Key"
Public Const K_NESTKEY As String = "NestKey"
Public Const K_MAXINDEX As String = "MaxIndex"
' Pagine del programma
Public Enum Pages As Integer
@@ -34,6 +33,7 @@ Public Module ConstGen
CONFIG = 3
INPUTS = 4
OUTPUTS = 5
ONLYPRODPAGE = 6
End Enum
' Abilitazioni licenza
@@ -46,12 +46,19 @@ Public Module ConstGen
ANY_DB = 32
End Enum
' Selezione Tab Prod / Proj
Public Enum ProdProj As Integer
NULL = 0
PROJ = 1
PROD = 2
End Enum
' File di log generale
Public Const VWOPTGENLOG_FILE_NAME As String = "EgtBEAMWALL.ViewerOptimizerLog#.txt"
Public Const SUPGENLOG_FILE_NAME As String = "EgtBEAMWALL.SupervisorLog#.txt"
' Sottodirettorio di configurazione
'Public Const CONF_DIR As String = "Config"
Public Const CONF_DIR As String = "Config"
' Sottodirettorio delle risorse
Public Const RES_DIR As String = "Resources"
' Sottodirettorio temporaneo
@@ -61,7 +68,9 @@ Public Module ConstGen
' Sottodirettorio per Csv automatico
Public Const PRODS_DIR As String = "Prods"
' Sottodirettorio per Macro
Public Const MACRO_DIR As String = "Macro"
Public Const MACRODEFAULT_DIR As String = "MacroDefault"
' Sottodirettorio per MacroCustom
Public Const MACROCUSTOM_DIR As String = "MacroCustom"
' Sottodirettorio per Magazzino
Public Const WAREHOUSE_DIR As String = "Warehouse"
' Sottodirettorio per lavorazioni travi
@@ -71,7 +80,7 @@ Public Module ConstGen
' Sottodirettorio di default per il salvataggio con nome
Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
' Sottodirettorio di default per le macchine
'Public Const MACHINES_DFL_DIR As String = "Machines"
Public Const MACHINES_DFL_DIR As String = "Machines"
' Sottodirettorio di default per toolmakers
Public Const TOOLMAKERS_DFL_DIR As String = "ToolMakers"
' Nome file Lua con le funzioni di attrezzaggio
+9 -1
View File
@@ -97,8 +97,8 @@ Public Module ConstIni
Public Const S_IMPORT As String = "Import"
Public Const K_BTLFLAG As String = "BtlFlag"
Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
Public Const K_WALLOPPOSITESIDENESTING As String = "WallOppositeSideNesting"
Public Const K_BTLAUXDIR As String = "BtlAuxDir"
Public Const K_WALLOPPOSITESIDENESTING As String = "WallOppositeSideNesting"
'Public Const S_MACH As String = "Mach"
'Public Const K_MACHINESDIR As String = "MachinesDir"
@@ -164,11 +164,19 @@ Public Module ConstIni
Public Const K_TYPE As String = "Type"
Public Const K_DEFAULTQUANTITY As String = "DefaultQuantity"
Public Const S_SECTION As String = "Section_Checked"
Public Const S_IMAGE As String = "Image_Checked"
Public Const S_PDFEDITOR As String = "PDFEditor"
Public Const S_BACKUPANDRESTORE As String = "Backup&Restore"
Public Const K_EXTERNALBACKUPACTIVE As String = "ExternalBackupActive"
Public Const K_EXTERNALFILEPATH As String = "ExternalFilePath"
Public Const K_REMINDERFREQUENCY As String = "ReminderFrequency"
Public Const K_ONLYPROD As String = "OnlyProd"
Public Const K_MODIFYSETUP As String = "ModifySetup"
Public Const S_SPECIAL As String = "Special"
Public Const K_SPECIALENABLE As String = "SpecialEnable"
@@ -7,9 +7,6 @@
Public Const K_NCTYPE As String = "NCType"
Public Const K_CONNECTIONSTRING As String = "ConnectionString"
Public Const K_SUPERVISOR As String = "Supervisor"
Public Const K_SAVECNCPATH As String = "SaveCncPath"
Public Const K_SAVEEXT As String = "SaveExt"
Public Const S_CHANNELS As String = "Channels"
+86
View File
@@ -77,8 +77,30 @@
<Import Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="BeamMachiningsWindow\BeamMachiningsWindowV.xaml.vb">
<DependentUpon>BeamMachiningsWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="BeamMachiningsWindow\MyBeamMachiningsWindowVM.vb" />
<Compile Include="BTLViewModel\BTLFeatureVM.vb" />
<Compile Include="CALCPanel\CalcEditEndEventArgs.vb" />
<Compile Include="ConfigurationPage\OnlyProdMachine_ConfigurationPageV.xaml.vb">
<DependentUpon>OnlyProdMachine_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\OnlyProdGeneral_ConfigurationPageV.xaml.vb">
<DependentUpon>OnlyProdGeneral_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\General_ConfigurationPageV.xaml.vb">
<DependentUpon>General_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\Machine_ConfigurationPageV.xaml.vb">
<DependentUpon>Machine_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\OnlyProdQParameter_ConfigurationPageV.xaml.vb">
<DependentUpon>OnlyProdQParameter_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\QParameter_ConfigurationPageV.xaml.vb">
<DependentUpon>QParameter_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="Constants\ConstColumns.vb" />
<Compile Include="Constants\ConstDataGridColumnsIni.vb" />
<Compile Include="Constants\ConstDims.vb" />
@@ -97,6 +119,9 @@
<Compile Include="CALCPanel\CalcIntegration.vb" />
<Compile Include="DataAccess\PartAddedEventArgs.vb" />
<Compile Include="DataAccess\BTLParamAddedEventArgs.vb" />
<Compile Include="ItemParamList\QParamListV.xaml.vb">
<DependentUpon>QParamListV.xaml</DependentUpon>
</Compile>
<Compile Include="Lib\MachGroupAddedEventArgs.vb" />
<Compile Include="Lib\MachGroupVM.vb" />
<Compile Include="Lib\NewMachGroupPanelVM.vb" />
@@ -112,10 +137,21 @@
<DependentUpon>LoadingWndV.xaml</DependentUpon>
</Compile>
<Compile Include="LoadingWnd\LoadingWndVM.vb" />
<Compile Include="MachinePanel\MachinePanelV.xaml.vb">
<DependentUpon>MachinePanelV.xaml</DependentUpon>
</Compile>
<Compile Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogV.xaml.vb">
<DependentUpon>NewOpenProjectFileDialogV.xaml</DependentUpon>
</Compile>
<Compile Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogVM.vb" />
<Compile Include="NewOpenProjectFileDialog\OnlyProdNewOpenProjectFileDialogV.xaml.vb">
<DependentUpon>OnlyProdNewOpenProjectFileDialogV.xaml</DependentUpon>
</Compile>
<Compile Include="OpenProjectFileDialog\OnlyProdOpenProjectFileDialogV.xaml.vb">
<DependentUpon>OnlyProdOpenProjectFileDialogV.xaml</DependentUpon>
</Compile>
<Compile Include="Utility\Configuration.vb" />
<Compile Include="ProjectFileVM\ProdItem.vb" />
<Compile Include="Utility\DimensionsIniFile.vb" />
<Compile Include="Utility\Enum.vb" />
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
@@ -186,18 +222,62 @@
</None>
</ItemGroup>
<ItemGroup>
<Page Include="BeamMachiningsWindow\BeamMachiningsWindowV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConfigurationPage\OnlyProdMachine_ConfigurationPageV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConfigurationPage\OnlyProdGeneral_ConfigurationPageV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConfigurationPage\General_ConfigurationPageV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="ConfigurationPage\Machine_ConfigurationPageV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="ConfigurationPage\OnlyProdQParameter_ConfigurationPageV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConfigurationPage\QParameter_ConfigurationPageV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="EgtDataGrid\EgtDataGrid.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ItemParamList\QParamListV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="LoadingWnd\LoadingWndV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="MachinePanel\MachinePanelV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="NewOpenProjectFileDialog\OnlyProdNewOpenProjectFileDialogV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OpenProjectFileDialog\OnlyProdOpenProjectFileDialogV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -207,6 +287,12 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\ProjectManager\Save.png" />
</ItemGroup>
<ItemGroup>
<Service Include="{94E38DFF-614B-4CBD-B67C-F211BB35CE8B}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.Core.dll</PostBuildEvent>
@@ -4,9 +4,6 @@ Imports System.ComponentModel
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Controls.Primitives
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
@@ -370,9 +367,23 @@ Public Class EgtDataGrid
End Class
Public Class EgtDataGridColumn
Inherits VMBase
Private m_dgColumn As DataGridColumn
'Check Box per le singole colonne
Private m_bIsCheched As Boolean
Public Property bIsChecked As Boolean
Get
Return m_bIsCheched
End Get
Set(value As Boolean)
m_bIsCheched = value
NotifyPropertyChanged(NameOf(bIsChecked))
WriteMainPrivateProfileString(S_PDFEDITOR, m_Name, If(m_bIsCheched, 1, 0))
End Set
End Property
Private Property m_ParentDataGridName As String
Public Property ParentDataGridName As String
Get
@@ -574,6 +585,7 @@ Public Class EgtDataGridColumn
m_Visible = bVisible
m_CanUserEditVisible = bCanUserEditVisible
m_SortDirection = nSortDirection
m_bIsCheched = GetMainPrivateProfileInt(S_PDFEDITOR, m_Name, 0) <> 0
End Sub
Friend Sub InitColumn(dgColumn As DataGridColumn)
@@ -0,0 +1,78 @@
<DataGrid x:Class="QParamListV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
AutoGenerateColumns="False"
CanUserSortColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
Margin="0,0,0,5">
<DataGrid.Columns>
<!--BWType-->
<DataGridTextColumn Binding="{Binding sBWType}"
Width="40"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Type_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Nome-->
<DataGridTextColumn Binding="{Binding sName}"
Width="50"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Descrizione-->
<DataGridTextColumn Binding="{Binding sDescription}"
Width="1*"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Default-->
<DataGridTextColumn Binding="{Binding sDefault}"
Width="65">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Default_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Minimo-->
<DataGridTextColumn Binding="{Binding sMin}"
Width="65"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Min_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Massimo-->
<DataGridTextColumn Binding="{Binding sMax}"
Width="65"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Max_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
@@ -0,0 +1,3 @@
Public Class QParamListV
End Class
@@ -22,7 +22,7 @@ Public Class MyMachGroupPanelM
' Assegno macchina di default
NewMyMachGroupPanelM.m_DefaultMachine = ""
' aggiorno copie
UpdateDuplo()
UpdateAllDuplo()
' recupero i MachGroup
NewMyMachGroupPanelM.m_MachGroupMList = LoadMyMachGroups(MachineList)
Return NewMyMachGroupPanelM
@@ -167,7 +167,7 @@ Public Class MyMachGroupPanelM
End Function
' funzione che fa l'update di tutte le copie dei pezzi modificati
Public Shared Sub UpdateDuplo()
Public Shared Sub UpdateAllDuplo()
' verifico tipo di progetto
Dim nBtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
Dim nBWType As Integer = 0
@@ -178,161 +178,7 @@ Public Class MyMachGroupPanelM
While nPartId <> GDB_ID.NULL
Dim bIsModified As Boolean = False
If EgtDuploGetModified(nPartId, bIsModified) AndAlso bIsModified Then
' verifico se c'é PRID sugli outline
Dim nPRId As Integer = 1
Dim nOutlineLayer As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
If nOutlineLayer <> GDB_ID.NULL Then
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
While nOutlineId <> GDB_ID.NULL
' verifico che sia feature
If EgtExistsInfo(nOutlineId, MGR_FTR_PRC) Then
Dim nCurrPrId As Integer = GDB_ID.NULL
If EgtGetInfo(nOutlineId, MGR_FTR_PRID, nCurrPrId) AndAlso nCurrPrId <> GDB_ID.NULL Then
If nCurrPrId < nPRId Then
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
nPRId += 1
End If
nPRId = Math.Max(nPRId - 1, nCurrPrId) + 1
nOutlineId = EgtGetNext(nOutlineId)
Continue While
Else
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
nPRId += 1
End If
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
End If
bTotIsModified = True
Dim DuploList As New List(Of Integer)
EgtDuploList(nPartId, DuploList)
Dim DuploArray() As Integer
Dim RotArray(DuploList.Count) As Integer
Dim FlipArray(DuploList.Count) As Integer
Dim QArray(DuploList.Count) As Dictionary(Of String, Dictionary(Of String, String))
DuploArray = DuploList.ToArray()
' recupero ROT (gradi) e FLIP (0/1) per non perderli
For Duploindex = 0 To DuploArray.Length - 1
RotArray(Duploindex) = 0
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
FlipArray(Duploindex) = 0
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
If FlipArray(Duploindex) <> 0 Then FlipArray(Duploindex) = 180
If nBWType = BWType.WALL Then
' salvo parametri Q
QArray(Duploindex) = New Dictionary(Of String, Dictionary(Of String, String))
' ciclo sugli outline
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
If nOutlineLayer <> GDB_ID.NULL Then
Dim nGlobPRId As Integer = 1
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
While nOutlineId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
If EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId) Then
If nPRId < nGlobPRId Then
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
nPRId = nGlobPRId
nGlobPRId += 1
End If
nGlobPRId = Math.Max(nGlobPRId - 1, nPRId) + 1
Else
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
nPRId = nGlobPRId
nGlobPRId += 1
End If
Dim sKey As String = nPRId & "." & nPRC
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
For QIndex = 1 To 10
Dim QKey As String = "Q" & QIndex.ToString("D2")
Dim QValue As Integer = 0
If EgtGetInfo(nOutlineId, QKey, QValue) Then
QArray(Duploindex)(sKey).Add(QKey, QValue)
End If
Next
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
End If
' ciclo sulle feature
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
If nFeatureLayer <> GDB_ID.NULL Then
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
While nFeatureId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
Dim sKey As String = nPRId & "." & nPRC
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
For QIndex = 1 To 10
Dim QKey As String = "Q" & QIndex.ToString("D2")
Dim QValue As Integer = 0
If EgtGetInfo(nFeatureId, QKey, QValue) Then
QArray(Duploindex)(sKey).Add(QKey, QValue)
End If
Next
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
End If
End If
Next
' aggiornamento dei Duplo
EgtDuploUpdate(nPartId)
' ripristino i valori di ROT e FLIP
For Duploindex = 0 To DuploArray.Length - 1
' ripristino info rot e flip
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
If nBWType = BWType.WALL Then
' ciclo sugli outline
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
If nOutlineLayer <> GDB_ID.NULL Then
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
While nOutlineId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
Dim sKey As String = nPRId & "." & nPRC
' ripristino parametri Q
If QArray(Duploindex).ContainsKey(sKey) Then
For Each QPar In QArray(Duploindex)(sKey)
EgtSetInfo(nOutlineId, QPar.Key, QPar.Value)
Next
End If
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
End If
' ciclo sulle feature
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
If nFeatureLayer <> GDB_ID.NULL Then
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
While nFeatureId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
Dim sKey As String = nPRId & "." & nPRC
' ripristino parametri Q
If QArray(Duploindex).ContainsKey(sKey) Then
For Each QPar In QArray(Duploindex)(sKey)
EgtSetInfo(nFeatureId, QPar.Key, QPar.Value)
Next
End If
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
End If
End If
Next
UpdateDuplo(nPartId)
End If
nPartId = EgtGetNextPart(nPartId)
End While
@@ -343,6 +189,180 @@ Public Class MyMachGroupPanelM
End If
End Sub
Public Shared Sub UpdateDuplo(nPartId As Integer)
' verifico tipo di progetto
Dim nBtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
Dim nBWType As Integer = 0
EgtGetInfo(nBtlInfoId, BTL_GEN_PROJTYPE, nBWType)
' ciclo sui pezzi
Dim bTotIsModified As Boolean = False
Dim bIsModified As Boolean = False
' verifico se c'é PRID sugli outline
Dim nPRId As Integer = 1
Dim nOutlineLayer As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
If nOutlineLayer <> GDB_ID.NULL Then
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
While nOutlineId <> GDB_ID.NULL
' verifico che sia feature
If EgtExistsInfo(nOutlineId, MGR_FTR_PRC) Then
If EgtExistsInfo(nOutlineId, MGR_FTR_PRID) Then
nOutlineId = EgtGetNext(nOutlineId)
Continue While
Else
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
nPRId += 1
End If
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
End If
bTotIsModified = True
Dim DuploList As New List(Of Integer)
EgtDuploList(nPartId, DuploList)
Dim DuploArray() As Integer
Dim RotArray(DuploList.Count) As Integer
Dim FlipArray(DuploList.Count) As Integer
Dim QArray(DuploList.Count) As Dictionary(Of String, Dictionary(Of String, String))
DuploArray = DuploList.ToArray()
' recupero ROT (gradi) e FLIP (0/1) per non perderli
For Duploindex = 0 To DuploArray.Length - 1
RotArray(Duploindex) = 0
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
FlipArray(Duploindex) = 0
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
If FlipArray(Duploindex) <> 0 Then FlipArray(Duploindex) = 180
If nBWType = BWType.WALL Then
' salvo parametri Q
QArray(Duploindex) = New Dictionary(Of String, Dictionary(Of String, String))
' ciclo sugli outline
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
If nOutlineLayer <> GDB_ID.NULL Then
Dim nGlobPRId As Integer = 1
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
While nOutlineId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
If Not EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId) Then
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
nPRId = nGlobPRId
nGlobPRId += 1
End If
Dim sKey As String = nPRId & "." & nPRC
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
For QIndex = 1 To 10
Dim QKey As String = "Q" & QIndex.ToString("D2")
Dim QValue As Integer = 0
If EgtGetInfo(nOutlineId, QKey, QValue) Then
QArray(Duploindex)(sKey).Add(QKey, QValue)
End If
Next
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
End If
' ciclo sulle feature
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
If nFeatureLayer <> GDB_ID.NULL Then
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
While nFeatureId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
Dim sKey As String = nPRId & "." & nPRC
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
For QIndex = 1 To 10
Dim QKey As String = "Q" & QIndex.ToString("D2")
Dim QValue As Integer = 0
If EgtGetInfo(nFeatureId, QKey, QValue) Then
QArray(Duploindex)(sKey).Add(QKey, QValue)
End If
Next
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
End If
End If
Next
' aggiornamento dei Duplo
EgtDuploUpdate(nPartId)
' ripristino i valori di ROT e FLIP
For Duploindex = 0 To DuploArray.Length - 1
' ripristino info rot e flip
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
If nBWType = BWType.WALL Then
' ciclo sugli outline
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
If nOutlineLayer <> GDB_ID.NULL Then
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
While nOutlineId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
Dim sKey As String = nPRId & "." & nPRC
' ripristino parametri Q
If QArray(Duploindex).ContainsKey(sKey) Then
For Each QPar In QArray(Duploindex)(sKey)
EgtSetInfo(nOutlineId, QPar.Key, QPar.Value)
Next
End If
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
End If
' ciclo sulle feature
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
If nFeatureLayer <> GDB_ID.NULL Then
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
While nFeatureId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
Dim sKey As String = nPRId & "." & nPRC
' ripristino parametri Q
If QArray(Duploindex).ContainsKey(sKey) Then
For Each QPar In QArray(Duploindex)(sKey)
EgtSetInfo(nFeatureId, QPar.Key, QPar.Value)
Next
End If
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
End If
End If
Next
End Sub
Public Shared Sub SetDuploModified(nPartId As Integer)
If Configuration.bOnlyProd Then
' segno modificato e aggiorno duplo
EgtDuploSetModified(nPartId)
UpdateDuplo(nPartId)
' aggiorno grafica duplo
Dim DuploIdList As New List(Of Integer)
EgtDuploList(nPartId, DuploIdList)
Dim DuploList As List(Of MachGroupVM) = CoreMap.refMachGroupPanelVM.MachGroupVMList.Where(Function(x) tt(x, DuploIdList)).ToList()
For Each CurrMachGroup As MyMachGroupVM In DuploList
CurrMachGroup.RefreshMachGroup()
Next
Else
EgtDuploSetModified(nPartId)
End If
End Sub
Private Shared Function tt(x As MachGroupVM, DuploIdList As List(Of Integer)) As Boolean
Dim TempMyMachGroupVM As MyMachGroupVM = DirectCast(x, MyMachGroupVM)
Return TempMyMachGroupVM.PartVMList.Any(Function(y) DuploIdList.Contains(y.nPartId))
End Function
Class DuploFeature
' Id geometrico della feature
Friend nFeatureId As Integer
+6 -2
View File
@@ -482,6 +482,8 @@ Public Class PartM
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP)
EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY)
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL)
EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT)
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP)
Dim nTemp As Integer = 0
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
nTemp = 0
@@ -514,8 +516,6 @@ Public Class PartM
' leggo PosX, PosY, Rot e Flip
EgtGetInfo(nPartId, MGR_PRT_POSX, NewPartM.m_dPOSX)
EgtGetInfo(nPartId, MGR_PRT_POSY, NewPartM.m_dPOSY)
EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT)
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP)
End If
' leggo volume
If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewPartM.dVolume) Then
@@ -639,6 +639,10 @@ Public Class PartM
Return New List(Of BTLFeatureM)(m_FeatureMList)
End Function
Public Sub RefreshBTLFeatures()
m_FeatureMList = LoadBTLFeatures(Me, nPartId)
End Sub
#End Region ' Features
#End Region ' METHODS
@@ -91,7 +91,7 @@ Public MustInherit Class MyMachGroupPanelVM
' Svuoto precedente lista di MachGroup
MachGroupVMList.Clear()
' aggiorno copie
MyMachGroupPanelM.UpdateDuplo()
MyMachGroupPanelM.UpdateAllDuplo()
' verifico se esistono già gruppi di lavorazione o se devo creare il primo
Dim bOk As Boolean = False
Dim nId = EgtGetFirstMachGroup()
@@ -620,6 +620,10 @@ Public MustInherit Class MyMachGroupVM
Public MustOverride Sub RefreshPartList()
Public Overridable Sub RefreshMachGroup()
End Sub
#End Region ' Parts
#End Region ' METHODS
+7 -9
View File
@@ -1,13 +1,13 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Imports System.Windows.Threading
Public MustInherit Class PartVM
Inherits VMBase
@@ -509,6 +509,10 @@ Public MustInherit Class PartVM
#Region "METHODS"
Public Overridable Sub RefreshPart()
End Sub
#Region "Feature"
Protected MustOverride Sub CreateBTLFeatureVMList()
@@ -571,13 +575,7 @@ Public MustInherit Class PartVM
Public Sub CalcGlobalUpdate()
m_PartM.nCALC_GlobalState = nCALC_State
For Each Feature In FeatureVMList
If Not Feature.bDO Then
If Feature.nState = CalcStates.COLLISION AndAlso Feature.nState > m_PartM.nCALC_GlobalState Then
m_PartM.nCALC_GlobalState = Feature.nState
m_PartM.nCALC_GlobalERR = Feature.nCALC_ERR
End If
Continue For
End If
If Not Feature.bDO Then Continue For
If Feature.nState > m_PartM.nCALC_GlobalState Then
m_PartM.nCALC_GlobalState = Feature.nState
m_PartM.nCALC_GlobalERR = Feature.nCALC_ERR
@@ -0,0 +1,49 @@
<Grid x:Class="MachinePanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
IsEnabled="{Binding MachPanel_IsEnabled}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Margin="0,0,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Macchina corrente" VerticalAlignment="Center" Margin="0,0,5,0"/>
<!--Combobox per selezionare la macchina corrente-->
<ComboBox ItemsSource="{Binding Path=MachineList}" DisplayMemberPath="Name"
SelectedItem="{Binding Path=SelectedMachine}" SelectedValuePath="Name"
Height="22" Width="150"
Grid.Row="0" Grid.Column="1"/>
</Grid>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Command="{Binding ToolDbCommand}" ToolTip="{Binding ToolDBToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding ToolDBMsg}"/>
<Button Command="{Binding MachDbCommand}" ToolTip="{Binding MachiningDbToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding MachiningDbMsg}"/>
<Button Command="{Binding SetUpCommand}" ToolTip="{Binding SetUpToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding SetUpMsg}"
Visibility="{Binding SetUp_Visibility}"/>
<Button ToolTip="{Binding BeamTable_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding BeamTable_Command}"
Visibility="{Binding BeamTable_Visibility}">
<Image Source="/Resources/Configuration/MachiningsTable.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding WallTable_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding WallTable_Command}"
Visibility="{Binding WallTable_Visibility}">
<Image Source="/Resources/Configuration/MachiningsTable.png" Stretch="Uniform"/>
</Button>
<Button Content="{Binding ParameterMachineMsg}"
ToolTip="{Binding ParameterMachineMsg}"
Command="{Binding ParameterMachine_Command}"
Style="{StaticResource ToolBar_ParameterMachineButton}"/>
</StackPanel>
</Grid>
@@ -0,0 +1,3 @@
Public Class MachinePanelV
End Class
@@ -0,0 +1,357 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachinePanelVM
Inherits EgtWPFLib5.MachinePanelVM
#Region "FIELDS & PROPERTIES"
' Radice del direttorio delle macchine
Private m_sMachinesRoot As String
' Macchina correntemente selezionata e quindi attiva
Private m_SelectedMachine As Machine = Nothing
Public Overrides Property SelectedMachine As Machine
Get
Return m_SelectedMachine
End Get
Set(value As Machine)
If value IsNot m_SelectedMachine Then
' imposto macchina in DbGeometrico
If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) Then
m_SelectedMachine = value
End If
' Salvo impostazione macchina corrente
SaveCurrentMachine()
NotifyPropertyChanged(NameOf(SelectedMachine))
' inizializzo la macchina selezionata come macchina corrente
Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType
SectionXMaterial.SetType(nMachType)
If Not IsNothing(value) Then
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
Else
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, m_SelectedMachine.Name, nMachType)
End If
' mostro bottone tabella beam o wall a seconda del tipo
m_BeamTable_Visibility = If(nMachType = MachineType.BEAM OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
m_WallTable_Visibility = If(nMachType = MachineType.WALL OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(BeamTable_Visibility))
NotifyPropertyChanged(NameOf(WallTable_Visibility))
' carico i Parametri Q da mostrare (Beam, Wall o entrambi) in base al tipo di macchina selezionata
If Not IsNothing(Map.refConfigurationPageVM) Then
' carico i parametri Q dei Process letti dall'ini
Map.refConfigurationPageVM.GetQParamsList()
' carico la lista di tutti i parametri Q ciclando su ogni Process di PRCList
If Not IsNothing(Map.refConfigurationPageVM.QBTLParamVMList) Then
Map.refConfigurationPageVM.QBTLParamVMList.Clear()
End If
For Each PRCItem In Map.refConfigurationPageVM.PRCList
For Each QBTLParam In PRCItem.QBTLParamVMList
Map.refConfigurationPageVM.QBTLParamVMList.Add(QBTLParam)
Next
Next
NotifyPropertyChanged(NameOf(Map.refConfigurationPageVM.QBTLParamVMList))
End If
' aggiorno nome macchina in statusbar
Map.refMyStatusBarVM.RefreshMachName()
End If
End Set
End Property
Private m_MachPanel_IsEnabled As Boolean = True
Public Property MachPanel_IsEnabled As Boolean
Get
Return m_MachPanel_IsEnabled
End Get
Set(value As Boolean)
m_MachPanel_IsEnabled = value
NotifyPropertyChanged("MachPanel_IsEnabled")
End Set
End Property
Private m_BeamTable_Visibility As Visibility
Public ReadOnly Property BeamTable_Visibility As Visibility
Get
Return m_BeamTable_Visibility
End Get
End Property
Private m_WallTable_Visibility As Visibility
Public ReadOnly Property WallTable_Visibility As Visibility
Get
Return m_WallTable_Visibility
End Get
End Property
Public ReadOnly Property SetUp_Visibility As Visibility
Get
Return If(Map.refMainWindowVM.MainWindowM.bModifySetup, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
#Region "Messages"
Public ReadOnly Property ToolDBMsg As String
Get
Return EgtMsg(MSG_MACHINEPAGEUC + 6)
End Get
End Property
Public ReadOnly Property MachiningDbMsg As String
Get
Return EgtMsg(MSG_MACHINEPAGEUC + 7)
End Get
End Property
Public ReadOnly Property SetUpMsg As String
Get
Return EgtMsg(MSG_ALARMSPAGEUC + 33)
End Get
End Property
#End Region ' Messages
#Region "ToolTip"
Public ReadOnly Property ToolDBToolTip As String
Get
Return EgtMsg(5003)
End Get
End Property
Public ReadOnly Property MachiningDbToolTip As String
Get
Return EgtMsg(5004)
End Get
End Property
Public ReadOnly Property SetUpToolTip As String
Get
Return EgtMsg(31501)
End Get
End Property
#End Region ' ToolTip
' Definizione comandi
Private m_cmdBeamTable As ICommand
Private m_cmdWallTable As ICommand
#End Region 'FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefMachinePanelVM(Me)
' recupero cartella radice delle macchine
m_sMachinesRoot = Map.refMainWindowVM.MainWindowM.sMachinesRoot
' Carica macchine da cartella delle macchine
MyMachine.MachineListInit(m_sMachinesRoot, MachineList)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Friend Sub LoadCurrentMachine()
If MachineList.Count = 0 Then Return
Dim CurrMachine As Machine = Nothing
Dim CurrMachineName As String = String.Empty
GetMainPrivateProfileString(S_MACH, K_CURRMACH, String.Empty, CurrMachineName)
Dim bFound As Boolean = False
If Not String.IsNullOrEmpty(CurrMachineName) Then
For Each Mach In MachineList
If Mach.Name = CurrMachineName Then
bFound = True
CurrMachine = Mach
Exit For
End If
Next
End If
If Not bFound And MachineList.Count > 0 Then
CurrMachine = MachineList(0)
End If
If Not IsNothing(CurrMachine) Then
If EgtSetCurrMachine(CurrMachine.Name) Then
SelectedMachine = CurrMachine
End If
End If
End Sub
Friend Sub SaveCurrentMachine()
If IsNothing(m_SelectedMachine) Then Return
WriteMainPrivateProfileString(S_MACH, K_CURRMACH, SelectedMachine.Name)
End Sub
Friend Sub UpdateCurrentMachine()
'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
Dim sMachName As String = String.Empty
If EgtGetCurrMachineName(sMachName) Then
For Each Mach In MachineList
If Mach.Name = sMachName Then
SelectedMachine = Mach
Exit For
End If
Next
End If
End Sub
Friend Function BeamMachDb() As Boolean
' Assegno le path
Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "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
' apro finestra di gestione lavorazioni travi
Dim sTitle = EgtMsg(9000) 'Tabelle delle lavorazioni delle travi
Dim BeamMchsWinVM As New MyBeamMachiningsWindowVM(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)
End If
Return True
End Function
Friend Function WallMachDb() As Boolean
' Assegno le path
Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "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
' apro finestra di gestione lavorazioni pareti
Dim sTitle = EgtMsg(9010) 'Tabelle delle lavorazioni delle pareti
Dim WallMchsWinVM As New MyBeamMachiningsWindowVM(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)
End If
Return True
End Function
Public Overrides Sub ToolDb(ByVal param As Object)
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtTdbReload() Then
EgtOutLog("Impossible reloading tool Db")
MessageBox.Show(EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
Dim ToolDbWindowVM As New MyToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
Dim ToolDbWindowV As New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
If ToolDbWindowVM.MatType <> 0 Then
ToolDbWindowV.Height = 640
ToolDbWindowV.Width = 1024
ToolDbWindowV.ShowDialog()
Else
Exit Sub
End If
End Sub
Public Overrides Sub MachDb(ByVal param As Object)
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtMdbReload() Then
EgtOutLog("Impossible reloading machining Db")
MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Stone")
Dim MachDbWindowV As New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM)
If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then
MachDbWindowV.Height = 768
MachDbWindowV.Width = 1024
MachDbWindowV.ShowDialog()
Else
Exit Sub
End If
End Sub
Public Overrides Sub SetUp(ByVal param As Object)
' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then
EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato,
' e testa e uscita dell'utensile attrezzato
EgtLuaExecFile(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA)
' verifico che le teste riportate in configurazione esistano
Dim Index As Integer = 1
Dim nErr As Integer = 0
While nErr = 0
Dim sHead As String = String.Empty
nErr = 999
EgtLuaSetGlobIntVar("STU.INDEX", Index)
EgtLuaCallFunction("STU.GetTcPosHeadGroupFromPos")
' Leggo variabili
EgtLuaGetGlobStringVar("STU.HEAD", sHead)
EgtLuaGetGlobIntVar("STU.ERR", nErr)
If nErr = 0 Then
If EgtGetHeadExitCount(sHead) = 0 Then
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
End If
Index += 1
End While
' Reset lua
EgtLuaResetGlobVar("STU")
Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName))
SetUpWindow.Height = 614
SetUpWindow.Width = 1024
SetUpWindow.ShowDialog()
End Sub
#End Region
#Region "COMMANDS"
#Region "BeamTable"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property BeamTable_Command As ICommand
Get
If m_cmdBeamTable Is Nothing Then
m_cmdBeamTable = New Command(AddressOf BeamMachDb)
End If
Return m_cmdBeamTable
End Get
End Property
#End Region ' BeamTable
#Region "WallTable"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property WallTable_Command As ICommand
Get
If m_cmdWallTable Is Nothing Then
m_cmdWallTable = New Command(AddressOf WallMachDb)
End If
Return m_cmdWallTable
End Get
End Property
#End Region ' WallTable
#End Region ' COMMANDS
End Class
+3 -3
View File
@@ -16,7 +16,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgtBEAMWALL.Core")>
<Assembly: AssemblyCopyright("Copyright © 2020-2025 by Egalware s.r.l.")>
<Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.7.1.1")>
<Assembly: AssemblyFileVersion("2.7.1.1")>
<Assembly: AssemblyVersion("2.5.12.2")>
<Assembly: AssemblyFileVersion("2.5.12.2")>
@@ -779,94 +779,3 @@ Public MustInherit Class NewOpenProjectFileDialogVM
End Class
Public Class ProdItem
Inherits VMBase
Public Shared m_delIsModifiedSetUp As Action(Of Boolean)
Protected m_ProdFileVM As ProdFileVM
Public ReadOnly Property ProdFileVM As ProdFileVM
Get
Return m_ProdFileVM
End Get
End Property
Private m_ProjFileList As New List(Of ProjectFileVM)
Public ReadOnly Property ProjFileList As List(Of ProjectFileVM)
Get
Return m_ProjFileList
End Get
End Property
Public ReadOnly Property sProdId As String
Get
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sProdId, "")
End Get
End Property
Public Overridable Property sName As String
Get
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "")
End Get
Set(value As String)
If Not IsNothing(m_ProdFileVM) Then
m_ProdFileVM.sName = value
End If
End Set
End Property
Public ReadOnly Property dtCreateDate As Date
Get
Return If(Not IsNothing(m_ProdFileVM), {m_ProdFileVM.dtCreateDate, m_ProjFileList.Min(Function(x) x.dtCreateDate)}.Min(), m_ProjFileList.Min(Function(x) x.dtCreateDate))
End Get
End Property
Public ReadOnly Property sCreateDate As String
Get
Return dtCreateDate.ToString()
End Get
End Property
Public ReadOnly Property sMachine As String
Get
If Not IsNothing(m_ProdFileVM) Then
Return m_ProdFileVM.sMachine
ElseIf Not IsNothing(m_ProjFileList(0)) Then
Return m_ProjFileList(0).sMachine
Else Return ""
End If
End Get
End Property
Public ReadOnly Property bIsArchived As Boolean
Get
If Not IsNothing(m_ProdFileVM) Then
Return m_ProdFileVM.bIsArchived
ElseIf Not IsNothing(m_ProjFileList(0)) Then
Return m_ProjFileList(0).bIsArchived
Else
Return True
End If
End Get
End Property
Public ReadOnly Property Archived_Visibility As Visibility
Get
Return If(bIsArchived, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM)
m_ProdFileVM = ProdFileVM
m_ProjFileList.Add(ProjFileVM)
End Sub
Sub New(ProjFileVM As ProjFileVM)
m_ProjFileList = New List(Of ProjectFileVM)({ProjFileVM})
End Sub
Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM))
m_ProdFileVM = ProdFileVM
m_ProjFileList = ProjFileVMList
End Sub
End Class
@@ -0,0 +1,249 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OnlyProdNewOpenProjectFileDialogV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
IsClosable="False"
MinHeight="500" MinWidth="500"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<EgtWPFLib5:EgtCustomWindow.Resources>
<EgtWPFLib5:FileNameConverter x:Key="FileNameConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<GroupBox Header="{Binding Filters_Msg}"
Margin="5"
Visibility="{Binding Filters_Visibility}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding BTLDateTypeList}"
SelectedIndex="{Binding SelBTLDateType}"
Width="105"
Margin="5"
Style="{StaticResource FeatureComboBox}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<ComboBox ItemsSource="{Binding DayTypeList}"
SelectedIndex="{Binding SelDayType}"
Width="105"
Margin="0,0,2.5,0"
Style="{StaticResource PartParam_ComboBox}"/>
<StackPanel Orientation="Horizontal" Visibility="{Binding Date_Visibility}">
<TextBlock Text="{Binding From_Msg}"
Style="{StaticResource Filter_TextBlock}"/>
<DatePicker SelectedDate="{Binding dtStartDate}"
Style="{StaticResource Filter_DatePicker}"/>
<TextBlock Text="{Binding To_Msg}"
Style="{StaticResource Filter_TextBlock}"/>
<DatePicker SelectedDate="{Binding dtEndDate}"
Style="{StaticResource Filter_DatePicker}"/>
</StackPanel>
</StackPanel>
<CheckBox Grid.Column="2"
IsChecked="{Binding bViewArchived}"
Content="{Binding ViewArchived_Msg}"
VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding FilterTypeList}"
SelectedItem="{Binding SelFilterType}"
Width="105"
Margin="5"
Style="{StaticResource FeatureComboBox}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding SearchText}"
Margin="5"
Visibility="{Binding SearchText_Visibility}"/>
<StackPanel Grid.Column="2"
Orientation="Horizontal">
<TextBlock Text="{Binding Rows_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox ItemsSource="{Binding RowQuantityList}"
SelectedIndex="{Binding SelRowQuantity}"
Style="{StaticResource FeatureComboBox}"/>
</StackPanel>
</Grid>
</Grid>
</GroupBox>
<EgtBEAMWALL:EgtDataGrid x:Name="MainDataGrid"
Grid.Row="1"
ItemsSource="{Binding ProjectList}"
SelectedItem="{Binding SelProject}"
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
RowDetailsVisibilityMode="Visible"
CellEditEnding="MainDataGrid_CellEditEnding"
BindingColumns="{Binding ProdColumns}">
<DataGrid.Resources>
<!-- ProdId -->
<DataGridTextColumn x:Key="colPRODID" Binding="{Binding sProdId}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdNewOpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Name-->
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
<DataGridTextColumn.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdNewOpenProjectFileDialogV}}}"/>
<ToggleButton Grid.Column="1"
Margin="5,0,0,0"
IsChecked="{Binding Path=DataContext.bIsEditNameActive,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdNewOpenProjectFileDialogV}}}"
Style="{StaticResource ToolBar_SmallToggleButton}">
<Image Source="\Resources\CalcPanel\Edit.png"
Style="{StaticResource LockImage}"/>
</ToggleButton>
</Grid>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Creation date -->
<DataGridTextColumn x:Key="colCRTDATE" Binding="{Binding dtCreateDate}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.CreateDate_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdNewOpenProjectFileDialogV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Machine -->
<DataGridTextColumn x:Key="colMACHINE" Binding="{Binding sMachine}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Machine_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdNewOpenProjectFileDialogV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Archived -->
<DataGridTemplateColumn x:Key="colARCHIVED">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="\Resources\OpenProjectFileDialog\Archived.png"
Visibility="{Binding Archived_Visibility}"
Height="15"
Width="15"
Stretch="UniformToFill"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Archived_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdNewOpenProjectFileDialogV}}}"/>
</DataGridTemplateColumn.Header>
</DataGridTemplateColumn>
</DataGrid.Resources>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="FontWeight" Value="DemiBold"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<EventSetter Event="MouseDoubleClick" Handler="ProjectList_MouseDoubleClick"/>
</Style>
</DataGrid.RowStyle>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<ItemsControl ItemsSource="{Binding ProjFileList}"
BorderThickness="0"
Margin="0,-1,0,0"
Padding="0">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid TextBlock.FontSize="12"
TextBlock.FontWeight="Normal">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Path=DataContext.ProdColumns[0].ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdNewOpenProjectFileDialogV}}}"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0"
Grid.ColumnSpan="2"
Background="Gray"
Margin="40,0,40,0"/>
<Grid Grid.Column="1"
Grid.Row="1"
Margin="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdNewOpenProjectFileDialogV}}}"
Style="{StaticResource OpenWnd_TextBlock}"/>
<TextBlock Grid.Column="1"
Text="{Binding sBTLFileName}"/>
<TextBlock Grid.Row="1"
Text="{Binding Path=DataContext.ListName_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdNewOpenProjectFileDialogV}}}"
Style="{StaticResource OpenWnd_TextBlock}"/>
<TextBlock Grid.Column="1"
Grid.Row="1"
Text="{Binding sListName}"/>
<TextBlock Grid.Column="2"
Text="{Binding Path=DataContext.ExportDate_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdNewOpenProjectFileDialogV}}}"
Style="{StaticResource OpenWnd_TextBlock}"/>
<TextBlock Grid.Column="3"
Text="{Binding dtExportDate}"/>
</Grid>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</DataGrid.RowDetailsTemplate>
</EgtBEAMWALL:EgtDataGrid>
<UniformGrid Columns="4" Grid.Row="2" Margin="0,0,0,5">
<Button IsDefault="True" Name="OpenBtn"
Content="{Binding Open_Msg}"
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding Archive_Msg}"
Command="{Binding Archive_Command}"
IsEnabled="{Binding bArchived_IsEnabled}"
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding Delete_Msg}"
Command="{Binding Delete_Command}"
IsEnabled="{Binding bDelete_IsEnabled}"
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
<Button Command="{Binding Cancel_Command}"
Content="{Binding Cancel_Msg}"
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,80 @@
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Input
Imports EgtWPFLib5
Public Class OnlyProdNewOpenProjectFileDialogV
Private WithEvents m_OpenProjFileDialogVM As NewOpenProjectFileDialogVM
#Region "CONSTRUCTOR"
Sub New(Owner As Window, OpenProjFileDialogVM As NewOpenProjectFileDialogVM)
' Funzione che interpreta l'xaml
InitializeComponent()
Me.Owner = Owner
Me.DataContext = OpenProjFileDialogVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_OpenProjFileDialogVM = OpenProjFileDialogVM
AddHandler Me.Loaded, AddressOf OpenProjectFileDialog_Loaded
AddHandler Me.Closing, AddressOf OpenProjectFileDialog_Closing
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Public Function EgtShowDialog(ProjectType As ProjectType) As Boolean?
m_OpenProjFileDialogVM.Init(ProjectType)
' mostro la finestra di dialogo
Return Me.ShowDialog()
End Function
Public Function EgtShowDialog(ProjectType As ProjectType, ProjectList As List(Of ProjectFileVM)) As Boolean?
m_OpenProjFileDialogVM.Init(ProjectType, ProjectList)
' mostro la finestra di dialogo
Return Me.ShowDialog()
End Function
Public Function EgtShowDialog(ProjectType As ProjectType, GoToProd As Boolean) As Boolean?
m_OpenProjFileDialogVM.Init(ProjectType, Nothing, GoToProd)
' mostro la finestra di dialogo
Return Me.ShowDialog()
End Function
Private Sub OpenProjectFileDialog_Loaded(sender As Object, e As RoutedEventArgs)
' Carico e imposto posizione finestra
WinPosFromIniToWindow(S_OPENFILEDIALOG, K_VIEWOPTIMWINPLACE, Me)
End Sub
Private Sub OpenProjectFileDialog_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
e.Cancel = True
Return
End If
' Salvo posizione finestra (se non minimizzata)
WinPosFromWindowToIni(Me, S_OPENFILEDIALOG, K_VIEWOPTIMWINPLACE)
End Sub
#End Region ' METHODS
#Region "EVENTS"
Private Sub ProjectList_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
m_OpenProjFileDialogVM.ProjDoubleClick()
End Sub
#End Region ' EVENTS
Private Sub OpenBtn_Click(sender As Object, e As RoutedEventArgs) Handles OpenBtn.Click
DialogResult = m_OpenProjFileDialogVM.VerifySelected()
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_OpenProjFileDialogVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
Private Sub MainDataGrid_CellEditEnding(sender As Object, e As DataGridCellEditEndingEventArgs)
'm_OpenProjFileDialogVM.SetIsEditNameActive(False)
End Sub
End Class
@@ -0,0 +1,189 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OnlyProdOpenProjectFileDialogV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
MinHeight="500" MinWidth="500"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<EgtWPFLib5:EgtCustomWindow.Resources>
<EgtWPFLib5:FileNameConverter x:Key="FileNameConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<GroupBox Header="Filters"
Margin="5"
Visibility="{Binding Filters_Visibility}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding BTLDateTypeList}"
SelectedIndex="{Binding SelBTLDateType}"
Width="105"
Margin="5"
Style="{StaticResource FeatureComboBox}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<ComboBox ItemsSource="{Binding DayTypeList}"
SelectedIndex="{Binding SelDayType}"
Width="105"
Margin="0,0,2.5,0"
Style="{StaticResource PartParam_ComboBox}"/>
<StackPanel Orientation="Horizontal" Visibility="{Binding Date_Visibility}">
<TextBlock Text="{Binding From_Msg}"
Style="{StaticResource Filter_TextBlock}"/>
<DatePicker SelectedDate="{Binding dtStartDate}"
Style="{StaticResource Filter_DatePicker}"/>
<TextBlock Text="{Binding To_Msg}"
Style="{StaticResource Filter_TextBlock}"/>
<DatePicker SelectedDate="{Binding dtEndDate}"
Style="{StaticResource Filter_DatePicker}"/>
</StackPanel>
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding FilterTypeList}"
SelectedItem="{Binding SelFilterType}"
Width="105"
Margin="5"
Style="{StaticResource FeatureComboBox}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding SearchText}"
Margin="5"
Visibility="{Binding SearchText_Visibility}"/>
<StackPanel Grid.Column="2"
Orientation="Horizontal">
<TextBlock Text="Rows"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox ItemsSource="{Binding RowQuantityList}"
SelectedIndex="{Binding SelRowQuantity}"
Style="{StaticResource FeatureComboBox}"/>
</StackPanel>
</Grid>
</Grid>
</GroupBox>
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
ItemsSource="{Binding ProjectList}"
SelectedItem="{Binding SelProject}"
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
BindingColumns="{Binding ProjectColumns}">
<DataGrid.Resources>
<!-- ProjId -->
<DataGridTextColumn x:Key="colPROJID" Binding="{Binding sProjId}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- ProdId -->
<DataGridTextColumn x:Key="colPRODID" Binding="{Binding sProdId}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- Project Name -->
<DataGridTextColumn x:Key="colPROJNAME" Binding="{Binding sDescription}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- BTL FileName -->
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- ListName -->
<DataGridTextColumn x:Key="colLISTNAME" Binding="{Binding sListName}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.ListName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- Exported date -->
<DataGridTextColumn x:Key="colEXPDATE" Binding="{Binding dtExportDate}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.ExportDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- Creation date -->
<DataGridTextColumn x:Key="colCRTDATE" Binding="{Binding dtCreateDate}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.CreateDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Machine -->
<DataGridTextColumn x:Key="colMACHINE" Binding="{Binding sMachine}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Machine_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Name (per Prod) -->
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Resources>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="IsEnabled" Value="{Binding bIsEnabled}"/>
<EventSetter Event="MouseDoubleClick" Handler="ProjectList_MouseDoubleClick"/>
</Style>
</DataGrid.RowStyle>
</EgtBEAMWALL:EgtDataGrid>
<UniformGrid Columns="3" Grid.Row="2" Margin="0,0,0,5">
<Button IsDefault="True" Name="OpenBtn"
Content="{Binding Open_Msg}" Style="{DynamicResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding Delete_Msg}"
Command="{Binding Delete_Command}"
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
<Button IsCancel="True"
Content="{Binding Cancel_Msg}"
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,75 @@
Imports System.Windows
Imports System.Windows.Input
Imports EgtWPFLib5
Public Class OnlyProdOpenProjectFileDialogV
Private WithEvents m_OpenProjFileDialogVM As OpenProjectFileDialogVM
#Region "CONSTRUCTOR"
Sub New(Owner As Window, OpenProjFileDialogVM As OpenProjectFileDialogVM)
' Funzione che interpreta l'xaml
InitializeComponent()
Me.Owner = Owner
Me.DataContext = OpenProjFileDialogVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_OpenProjFileDialogVM = OpenProjFileDialogVM
AddHandler Me.Loaded, AddressOf OpenProjectFileDialog_Loaded
AddHandler Me.Closing, AddressOf OpenProjectFileDialog_Closing
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Public Function EgtShowDialog(ProjectType As ProjectType) As Boolean?
m_OpenProjFileDialogVM.Init(ProjectType)
' mostro la finestra di dialogo
Return Me.ShowDialog()
End Function
Public Function EgtShowDialog(ProjectType As ProjectType, ProjectList As List(Of ProjectFileVM)) As Boolean?
m_OpenProjFileDialogVM.Init(ProjectType, ProjectList)
' mostro la finestra di dialogo
Return Me.ShowDialog()
End Function
Public Function EgtShowDialog(ProjectType As ProjectType, GoToProd As Boolean) As Boolean?
m_OpenProjFileDialogVM.Init(ProjectType, Nothing, GoToProd)
' mostro la finestra di dialogo
Return Me.ShowDialog()
End Function
Private Sub OpenProjectFileDialog_Loaded(sender As Object, e As RoutedEventArgs)
' Carico e imposto posizione finestra
WinPosFromIniToWindow(S_OPENFILEDIALOG, K_VIEWOPTIMWINPLACE, Me)
End Sub
Private Sub OpenProjectFileDialog_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
e.Cancel = True
Return
End If
' Salvo posizione finestra (se non minimizzata)
WinPosFromWindowToIni(Me, S_OPENFILEDIALOG, K_VIEWOPTIMWINPLACE)
End Sub
#End Region ' METHODS
#Region "EVENTS"
Private Sub ProjectList_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
m_OpenProjFileDialogVM.ProjDoubleClick()
End Sub
#End Region ' EVENTS
Private Sub OpenBtn_Click(sender As Object, e As RoutedEventArgs) Handles OpenBtn.Click
DialogResult = m_OpenProjFileDialogVM.VerifySelected()
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_OpenProjFileDialogVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -121,17 +121,17 @@
</StackPanel>-->
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
ItemsSource="{Binding ProjectList}"
SelectedItem="{Binding SelProject}"
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
BindingColumns="{Binding ProjectColumns}">
ItemsSource="{Binding ProjectList}"
SelectedItem="{Binding SelProject}"
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
BindingColumns="{Binding ProjectColumns}">
<DataGrid.Resources>
<!-- ProjId -->
<DataGridTextColumn x:Key="colPROJID" Binding="{Binding sProjId}">
@@ -42,6 +42,8 @@ Public MustInherit Class OpenProjectFileDialogVM
Friend Event m_CloseWindow(bDialogResult As Boolean)
Protected m_GoToProd As Boolean = False
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property ProjectColumns As ObservableCollection(Of EgtDataGridColumn)
Get
@@ -438,7 +440,7 @@ Public MustInherit Class OpenProjectFileDialogVM
#Region "METHODS"
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
Public Overridable Sub RefreshProjectList(Optional GoToProd As Boolean = False)
Public Overridable Sub RefreshProjectList()
End Sub
Protected Sub LoadColumns(ProjectType As ProjectType)
@@ -14,6 +14,13 @@ Public Class ProdFileM
m_nProjIdList = value
End Sub
Protected m_ProjMList As List(Of ProjFileM)
Public ReadOnly Property ProjMList As List(Of ProjFileM)
Get
Return m_ProjMList
End Get
End Property
Protected m_sName As String
Public Property sName As String
Get
@@ -60,6 +67,24 @@ Public Class ProdFileM
Return NewProjectFileM
End Function
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, ProjMList As List(Of ProjFileM)) As ProdFileM
Dim NewProjectFileM As New ProdFileM
NewProjectFileM.m_nProdId = nProdId
NewProjectFileM.m_nProjIdList = nProjIdList
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
NewProjectFileM.m_sName = sName
NewProjectFileM.m_nType = nType
NewProjectFileM.m_sMachine = sMachine
NewProjectFileM.m_sLockedBy = sLockedBy
NewProjectFileM.m_dtLock = dtLock
NewProjectFileM.m_bIsActive = bIsActive
NewProjectFileM.m_bIsProduced = bIsProduced
NewProjectFileM.m_bIsArchived = bIsArchived
NewProjectFileM.m_ProjMList = ProjMList
Return NewProjectFileM
End Function
#End Region ' CONSTRUCTORS
End Class
+119
View File
@@ -0,0 +1,119 @@
Imports EgtWPFLib5
Imports System.Windows
Public Class ProdItem
Inherits VMBase
Public Shared m_delUpdateNameInDb As Action(Of Integer, String)
Public Shared m_delIsModifiedSetUp As Action(Of Boolean)
Protected m_ProdFileVM As ProdFileVM
Public ReadOnly Property ProdFileVM As ProdFileVM
Get
Return m_ProdFileVM
End Get
End Property
Private m_ProjFileList As New List(Of ProjectFileVM)
Public ReadOnly Property ProjFileList As List(Of ProjectFileVM)
Get
Return m_ProjFileList
End Get
End Property
Public ReadOnly Property sProdId As String
Get
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sProdId, "")
End Get
End Property
Public Overridable Property sName As String
Get
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "")
End Get
Set(value As String)
If Not IsNothing(m_ProdFileVM) Then
m_delUpdateNameInDb(m_ProdFileVM.nProdId, value)
m_ProdFileVM.sName = value
m_delIsModifiedSetUp(False)
End If
End Set
End Property
Public ReadOnly Property dtCreateDate As Date
Get
Return If(Not IsNothing(m_ProdFileVM), {m_ProdFileVM.dtCreateDate, m_ProjFileList.Min(Function(x) x.dtCreateDate)}.Min(), m_ProjFileList.Min(Function(x) x.dtCreateDate))
End Get
End Property
Public ReadOnly Property sCreateDate As String
Get
Return dtCreateDate.ToString()
End Get
End Property
Public ReadOnly Property sMachine As String
Get
If Not IsNothing(m_ProdFileVM) Then
Return m_ProdFileVM.sMachine
ElseIf Not IsNothing(m_ProjFileList(0)) Then
Return m_ProjFileList(0).sMachine
Else Return ""
End If
End Get
End Property
Public ReadOnly Property bIsArchived As Boolean
Get
If Not IsNothing(m_ProdFileVM) Then
Return m_ProdFileVM.bIsArchived
ElseIf Not IsNothing(m_ProjFileList(0)) Then
Return m_ProjFileList(0).bIsArchived
Else
Return True
End If
End Get
End Property
Public ReadOnly Property Archived_Visibility As Visibility
Get
Return If(bIsArchived, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM)
m_ProdFileVM = ProdFileVM
m_ProjFileList.Add(ProjFileVM)
End Sub
Sub New(ProjFileVM As ProjFileVM)
m_ProjFileList = New List(Of ProjectFileVM)({ProjFileVM})
End Sub
Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM))
m_ProdFileVM = ProdFileVM
m_ProjFileList = ProjFileVMList
End Sub
Public Shared Function CreateProdItem(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, ProjMList As List(Of ProjFileM)) As ProdItem
Dim NewProdFileM = ProdFileM.CreateProdFileM(nProdId, nProjIdList, dtCreateProjDate, sName, nType, sMachine, sLockedBy, dtLock, bIsActive, bIsProduced, bIsArchived)
Dim NewProdFileVM = New ProdFileVM(NewProdFileM)
Dim NewProjFileVM As IEnumerable(Of ProjectFileVM)
NewProjFileVM = ProjMList.Select(Of ProjFileVM)(Function(j) New ProjFileVM(j)).ToList
Dim NewProdItem = New ProdItem(NewProdFileVM, NewProjFileVM.ToList)
Return NewProdItem
End Function
Public Shared Function CreateProdItem(ProjFileM As ProjFileM) As ProdItem
Dim NewProdItem = New ProdItem(New ProjFileVM(ProjFileM))
Return NewProdItem
End Function
End Class
+18 -18
View File
@@ -19,28 +19,28 @@ Public Class ProjFileM
End Property
Protected m_sBTLFileName As String = String.Empty
Public Property sBTLFileName As String
Get
Return m_sBTLFileName
End Get
Set(value As String)
m_sBTLFileName = value
End Set
End Property
Public Property sBTLFileName As String
Get
Return m_sBTLFileName
End Get
Set(value As String)
m_sBTLFileName = value
End Set
End Property
Protected m_sDescription As String = String.Empty
Public Property sDescription As String
Get
Return m_sDescription
End Get
Set(value As String)
m_sDescription = value
End Set
End Property
Protected m_sDescription As String = String.Empty
Public Property sDescription As String
Get
Return m_sDescription
End Get
Set(value As String)
m_sDescription = value
End Set
End Property
#Region "CONSTRUCTORS"
Protected Sub New()
Protected Sub New()
End Sub
Public Shared Function CreateNewProjFileM() As ProjFileM
Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

+2 -2
View File
@@ -126,7 +126,7 @@ Public Module BTLIniFile
End Function
' funzione che ottiene il parametro P/Q usando m_nBTLBWType del modulo
Public Function GetBeamPrivateProfileParam(IpGRP As Integer, IpPRC As Integer, IpVariant As Integer, IsP As Boolean, IpFeatureParamIndex As String, IpParentFeature As BTLFeatureM, ByRef IpBTLParam As BTLParamM) As Boolean
Public Function GetBeamPrivateProfileParam(IpGRP As Integer, IpPRC As Integer, IsP As Boolean, IpFeatureParamIndex As String, IpParentFeature As BTLFeatureM, ByRef IpBTLParam As BTLParamM) As Boolean
Dim sBTLParam As String = String.Empty
Dim sBWQParam As String = String.Empty
If m_nBTLBWType = BWType.BEAM Then
@@ -134,7 +134,7 @@ Public Module BTLIniFile
ElseIf m_nBTLBWType = BWType.WALL Then
sBWQParam = "W"
End If
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & If(IpPRC = 900 AndAlso IpVariant > 0, IpPRC & "." & IpVariant, IpPRC), If(IsP, "P", "Q" & sBWQParam) & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, If(IsP, "P", "Q" & sBWQParam) & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
Dim sBTLParamParams() As String = sBTLParam.Split(","c)
' verifico numero minimo di parametri
If sBTLParamParams.Count >= 6 Then
+24
View File
@@ -0,0 +1,24 @@
Public Module Configuration
Private m_bOnlyProd As Boolean
Public ReadOnly Property bOnlyProd As Boolean
Get
Return m_bOnlyProd
End Get
End Property
Public Sub SetOnlyProd(value As Boolean)
m_bOnlyProd = value
End Sub
Private m_bModifySetup As Boolean
Public ReadOnly Property bModifySetup As Boolean
Get
Return m_bModifySetup
End Get
End Property
Public Sub SetModifySetup(value As Boolean)
m_bModifySetup = value
End Sub
End Module
+1
View File
@@ -63,6 +63,7 @@ Public Enum StatusMapOpType
ChangeProdInProdRequest = 16
OpenPageInViewOptimRequest = 17
MachGroupValidationUpdate = 18
ChangeProdInOnlyProdRequest = 19
End Enum
Public Enum DimensionType
@@ -2,6 +2,7 @@
using NLog;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using static EgtBEAMWALL.Core.ConstBeam;
@@ -208,11 +209,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <summary>
/// Elenco prod
/// </summary>
/// <param name="numRecord">Num max record da recuperare</param>
/// <param name="NumRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
/// <returns></returns>
public List<Core.ProdFileM> GetLastDesc(int numRecord, bool OnlyActive, bool ShowArchived = false)
public List<Core.ProdFileM> GetLastDesc(int NumRecord, bool OnlyActive, bool ShowArchived = false)
{
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
@@ -220,9 +221,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (numRecord == 0)
if (NumRecord == 0)
{
numRecord = localDbCtx.ProdList.Count();
NumRecord = localDbCtx.ProdList.Count();
}
// retrieve
dbResult = localDbCtx
@@ -235,7 +236,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
(p, e) => p)
.Distinct()
.OrderByDescending(x => x.ProdId)
.Take(numRecord)
.Take(NumRecord)
.ToList();
}
@@ -247,13 +248,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <summary>
/// Elenco prod
/// </summary>
/// <param name="dtStart">Inizio periodo estrazione</param>
/// <param name="dtEnd">Fine periodo estrazione</param>
/// <param name="numRecord">Num max record da recuperare</param>
/// <param name="DtStart">Inizio periodo estrazione</param>
/// <param name="DtEnd">Fine periodo estrazione</param>
/// <param name="NumRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
/// <returns></returns>
public List<Core.ProdFileM> GetLastDesc(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive, bool ShowArchived = false)
public List<Core.ProdFileM> GetLastDesc(DateTime DtStart, DateTime DtEnd, int NumRecord, bool OnlyActive, bool ShowArchived = false)
{
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
@@ -261,14 +262,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (numRecord == 0)
if (NumRecord == 0)
{
numRecord = localDbCtx.ProdList.Count();
NumRecord = localDbCtx.ProdList.Count();
}
// retrieve
dbResult = localDbCtx
.ProdList
.Where(x => x.DtCreated >= dtStart && x.DtCreated <= dtEnd && (!x.IsArchived || ShowArchived))
.Where(x => x.DtCreated >= DtStart && x.DtCreated <= DtEnd && (!x.IsArchived || ShowArchived))
// condizione join sui PROJ
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
p => p.ProdDbId,
@@ -276,7 +277,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
(p, e) => p)
.Distinct()
.OrderByDescending(x => x.ProdId)
.Take(numRecord)
.Take(NumRecord)
.ToList();
}
@@ -285,6 +286,183 @@ namespace EgtBEAMWALL.DataLayer.Controllers
return result;
}
/// <summary>
/// Elenco prod
/// </summary>
/// <param name="NumRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
/// <returns></returns>
public List<Core.ProdItem> GetLastDescFull(int NumRecord, bool OnlyActive, bool ShowArchived = false)
{
List<Core.ProdItem> result = new List<Core.ProdItem>();
// elenco prod completi
List<ProdModel> dbResultProd = new List<ProdModel>();
// elenco proj "orfani"
List<ProjModel> dbResultProj = new List<ProjModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (NumRecord == 0)
{
NumRecord = localDbCtx.ProdList.Count();
}
// recupero PROD + proj relativi
dbResultProd = localDbCtx
.ProdList
.Where(x => (!x.IsArchived || ShowArchived))
//.Include(j => j.)
// condizione join sui PROJ
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
p => p.ProdDbId,
e => e.ProdDbId,
(p, e) => p)
.Distinct()
.Include(j => j.ProjListNav)
.OrderByDescending(x => x.ProdId)
.Take(NumRecord)
.ToList();
// recupero i proj "orfani"
dbResultProj = localDbCtx
.ProjList
.Where(x => (x.IsActive || !OnlyActive) && x.Prod == null)
.OrderByDescending(x => x.ProjId)
.Take(NumRecord)
.ToList();
}
// conversione
result = dbResultProd.Select(x => coreItemConv(x)).ToList();
var resProj = dbResultProj.Select(x => coreItemConv(x)).ToList();
// sommo i risultati
result.AddRange(resProj);
return result;
}
/// <summary>
/// Elenco prod
/// </summary>
/// <param name="DtStart">Inizio periodo estrazione</param>
/// <param name="DtEnd">Fine periodo estrazione</param>
/// <param name="NumRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
/// <returns></returns>
public List<Core.ProdItem> GetLastDescFull(DateTime DtStart, DateTime DtEnd, int NumRecord, bool OnlyActive, bool ShowArchived = false)
{
List<Core.ProdItem> result = new List<Core.ProdItem>();
// elenco prod completi
List<ProdModel> dbResultProd = new List<ProdModel>();
// elenco proj "orfani"
List<ProjModel> dbResultProj = new List<ProjModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (NumRecord == 0)
{
NumRecord = localDbCtx.ProdList.Count();
}
// retrieve
dbResultProd = localDbCtx
.ProdList
.Where(x => x.DtCreated >= DtStart && x.DtCreated <= DtEnd && (!x.IsArchived || ShowArchived))
// condizione join sui PROJ
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
p => p.ProdDbId,
e => e.ProdDbId,
(p, e) => p)
.Distinct()
.Include(j => j.ProjListNav)
.OrderByDescending(x => x.ProdId)
.Take(NumRecord)
.ToList();
// recupero i proj "orfani"
dbResultProj = localDbCtx
.ProjList
.Where(x => (x.IsActive || !OnlyActive) && x.Prod == null && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd))
.OrderByDescending(x => x.ProjId)
.Take(NumRecord)
.ToList();
}
// conversione
result = dbResultProd.Select(x => coreItemConv(x)).ToList();
var resProj = dbResultProj.Select(x => coreItemConv(x)).ToList();
// sommo i risultati
result.AddRange(resProj);
return result;
}
/// <summary>
/// Elenco prod
/// </summary>
/// <param name="DtStart">Inizio periodo estrazione</param>
/// <param name="DtEnd">Fine periodo estrazione</param>
/// <param name="DtIsCreation">Ture: usa data creazione / False: usa data export</param>
/// <param name="NumRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <param name="Machine">Nome Macchina (default vuoto = non usato)</param>
/// <param name="BtlFileName">Nome file BTL (default vuoto = non usato)</param>
/// <param name="ListName">Nome List (default vuoto = non usato)</param>
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
/// <returns></returns>
public List<Core.ProdItem> GetLastDescFull(DateTime DtStart, DateTime DtEnd, bool DtIsCreation, int NumRecord, bool OnlyActive, string Machine = "", string BtlFileName = "", string ListName = "", bool ShowArchived = false)
{
List<Core.ProdItem> result = new List<Core.ProdItem>();
List<ProdModel> dbResultProd = new List<ProdModel>();
// elenco proj "orfani"
List<ProjModel> dbResultProj = new List<ProjModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (NumRecord == 0)
{
NumRecord = localDbCtx.ProdList.Count();
}
// retrieve
dbResultProd = localDbCtx
.ProdList
.Where(x => (!x.IsArchived || ShowArchived))
// condizione join sui PROJ
.Join(localDbCtx.ProjList.Where(x =>
(x.IsActive || !OnlyActive)
&& (string.IsNullOrEmpty(Machine) || x.Machine.ToLower().Contains(Machine.ToLower()))
&& (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName.ToLower().Contains( BtlFileName.ToLower()))
&& (string.IsNullOrEmpty(ListName) || x.ListName.ToLower().Contains(ListName.ToLower()))
&& ((DtIsCreation && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) || (!DtIsCreation && (x.DtExported >= DtStart && x.DtExported <= DtEnd)))
),
p => p.ProdDbId,
e => e.ProdDbId,
(p, e) => p)
.Distinct()
.Include(j => j.ProjListNav)
.OrderByDescending(x => x.ProdId)
.Take(NumRecord)
.ToList();
// recupero i proj "orfani"
dbResultProj = localDbCtx
.ProjList
.Where(x =>
(x.IsActive || !OnlyActive)
&& x.Prod == null
&& (string.IsNullOrEmpty(Machine) || x.Machine.ToLower().Contains(Machine.ToLower()))
&& (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName.ToLower().Contains(BtlFileName.ToLower()))
&& (string.IsNullOrEmpty(ListName) || x.ListName.ToLower().Contains(ListName.ToLower()))
&& ((DtIsCreation && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) || (!DtIsCreation && (x.DtExported >= DtStart && x.DtExported <= DtEnd))))
.OrderByDescending(x => x.ProjId)
.Take(NumRecord)
.ToList();
}
// conversione
result = dbResultProd.Select(x => coreItemConv(x)).ToList();
var resProj = dbResultProj.Select(x => coreItemConv(x)).ToList();
// sommo i risultati
result.AddRange(resProj);
return result;
}
/// <summary>
/// Fornisce nuovo indice VUOTO da usare (allocando sul DB)
/// </summary>
@@ -910,6 +1088,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
protected Core.ProdFileM coreConv(ProdModel currProd)
{
Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived);
//Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, currProd.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList());
return answ;
}
/// <summary>
/// Helper conversione modelli verso prodItem
/// </summary>
/// <param name="currProd"></param>
/// <returns></returns>
protected Core.ProdItem coreItemConv(ProdModel currProd)
{
Core.ProdItem answ = Core.ProdItem.CreateProdItem(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, currProd.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList());
return answ;
}
/// <summary>
/// Helper conversione modelli verso prodItem da singolo proj
/// </summary>
/// <param name="currProd"></param>
/// <returns></returns>
protected Core.ProdItem coreItemConv(ProjModel currProj)
{
Core.ProdItem answ = Core.ProdItem.CreateProdItem(Core.ProjFileM.CreateProjFileM(currProj.ProjId, 0, currProj.DtCreated, currProj.DtExported, currProj.ListName, currProj.BTLFileName, currProj.ProjDescription, currProj.IsNew, currProj.Locked, currProj.PType, currProj.Machine, currProj.IsActive, currProj.IsActive));
return answ;
}
@@ -33,6 +33,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
var dbResult = localDbCtx
.ProjList
.Where(x => x.BTLFileName == BTLFileName)
//valutare se usare solo attivi...
//.Where(x => x.BTLFileName == BTLFileName && x.IsActive == true)
.FirstOrDefault();
//se avesse trovato-- > riporto id...
@@ -581,7 +583,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// Update record su DB x elenco BTLParts
/// </summary>
/// <param name="ProjId"></param>
/// <param name="newBTLFileName"></param>
/// <param name="BtlPartList"></param>
/// <returns></returns>
public ProjModel UpdateBtlParts(int ProjId, List<Core.BTLPartM> BtlPartList)
{
@@ -19,6 +19,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
{
#region Public Properties
public ProdModel()
{
ProjListNav = new HashSet<ProjModel>();
}
/// <summary>
/// Chiave univoca DB
/// </summary>
@@ -98,6 +103,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
[Column("IsArchived")]
public bool IsArchived { get; set; } = false;
/// <summary>
/// Collezione oggetti Proj associati (almeno 1 by design)
/// </summary>
public virtual ICollection<ProjModel> ProjListNav { get; set; }
#endregion Public Properties
}
}
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Egalware s.r.l.")]
[assembly: AssemblyProduct("EgtBEAMWALL.DataLayer")]
[assembly: AssemblyCopyright("Copyright © 2020-2025 by Egalware s.r.l.")]
[assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.7.1.1")]
[assembly: AssemblyFileVersion("2.7.1.1")]
[assembly: AssemblyVersion("2.5.12.2")]
[assembly: AssemblyFileVersion("2.5.12.2")]
@@ -0,0 +1,155 @@
<EgtWPFLib5:EgtCustomWindow x:Class="BeamMachiningsWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize"
Width="500" Height="450"
IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TabControl ItemsSource="{Binding MachiningList}"
SelectedItem="{Binding SelMachining}"
IsSynchronizedWithCurrentItem="True"
Margin="5,0,5,0"
Style="{StaticResource TabControl_OnlyHeaders}"/>
<EgtBEAMWALLCORE:EgtDataGrid Grid.Row="1"
ItemsSource="{Binding TableRowList}"
SelectedIndex="{Binding SelRowIndex}"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5"
BindingColumns="{Binding BeamMachiningsColumns}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Height" Value="25"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<Style x:Key="DataGridCheckBoxColumn_Style"
TargetType="{x:Type DataGridCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Colonna On-->
<DataGridCheckBoxColumn x:Key="colON" Binding="{Binding OnPar, UpdateSourceTrigger=PropertyChanged}"
CellStyle="{StaticResource DataGridCheckBoxColumn_Style}">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.OnHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<!--Colonna Name-->
<DataGridTemplateColumn x:Key="colNAME">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.NameHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=NamesList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Margin="5,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Style-->
<DataGridTemplateColumn x:Key="colTYPE">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.TypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=TypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Margin="5,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Resources>
</EgtBEAMWALLCORE:EgtDataGrid>
<Grid Grid.Row="2"
Margin="0,0,0,5"
HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="/\"
Command="{Binding MoveRowUp_Command}"
Grid.Column="0"
Margin="0,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="\/"
Command="{Binding MoveRowDown_Command}"
Grid.Column="1"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding AddRowMsg}"
Command="{Binding AddRow_Command}"
Grid.Column="2"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding DeleteRowMsg}"
Command="{Binding DeleteRow_Command}"
Grid.Column="3"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding SaveMsg}"
Command="{Binding Save_Command}"
Grid.Column="4"
Margin="2.5,0,0,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,20 @@
Imports EgtBEAMWALL.Core
Public Class BeamMachiningsWindowV
Private WithEvents m_BeamMachiningsWindowVM As MyBeamMachiningsWindowVM
Sub New(Owner As Window, BeamMachiningsWindowVM As MyBeamMachiningsWindowVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = BeamMachiningsWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_BeamMachiningsWindowVM = BeamMachiningsWindowVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BeamMachiningsWindowVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,36 @@
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core
Imports EgtWPFLib5
Public Class MyBeamMachiningsWindowVM
Inherits BeamMachiningsWindowVM
#Region "FIELDS & PROPERTIES"
Private m_BeamMachiningsColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property BeamMachiningsColumns As ObservableCollection(Of EgtDataGridColumn)
Get
Return m_BeamMachiningsColumns
End Get
Set(value As ObservableCollection(Of EgtDataGridColumn))
m_BeamMachiningsColumns = value
End Set
End Property
#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)
MyBase.New(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, bIsBeam)
' carico le colonne della datagrid
GetPrivateProfileColumns(S_BEAMMACHININGS, BeamMachiningsColumns)
' aggiorno la visibilità delle colonne
For Each col In BeamMachiningsColumns
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
Next
End Sub
#End Region ' CONSTRUCTOR
End Class
@@ -1,501 +0,0 @@
Imports System.Buffers.Binary
Imports EgtUILib
Imports EgtWPFLib5
Imports Sharp7
Public Class SIEMENSSharp7Comm
Private m_DBVariableList As New List(Of DBBuffer) ' Buffer list
Private IntBuffer() As Byte = {0, 0}
Private BoolBuffer() As Byte = {0}
Private DIntBuffer() As Byte = {0, 0, 0, 0}
Private RealBuffer() As Byte = {0, 0, 0, 0}
Private StringBuffer(65536) As Byte ' Buffer
Private Client As New S7Client ' Client Object
' lista variabili in lettura
Private Shared m_ReadingVars(100) As CommVar
' lista dei messaggi di errore attivi
Private m_ActiveMessages As New List(Of SiemensReadMessages)
Private m_MachManaging As MachManaging
Friend ReadOnly Property MachManaging As MachManaging
Get
Return m_MachManaging
End Get
End Property
Private m_RefreshTime As Integer = 10
Private m_WaitingRefreshTime As Integer = 20
Private m_RefreshCounter As Integer = 0
Private m_IsRefreshing As Boolean = False
Public Sub New(MachManaging As MachManaging)
m_MachManaging = MachManaging
End Sub
Public Shared Function InitVar(Variable As CommVar) As CommVar
Dim Index As Integer = Array.IndexOf(m_ReadingVars, Nothing)
m_ReadingVars(Index) = Variable
Return m_ReadingVars(Index)
End Function
' Avvio la connessione Hardware-Client
Friend Function InitConnection() As Boolean
' Ip del PLC
Dim sIp As String = ""
GetPrivateProfileString(S_GENERAL, K_IP, "", sIp, CurrentMachine.sMachIniFile)
' unità usate dal PLC (Rack e Slot)
Dim nRack As Integer = GetPrivateProfileInt(S_GENERAL, K_RACK, 0, CurrentMachine.sMachIniFile)
Dim nSlot As Integer = GetPrivateProfileInt(S_GENERAL, K_SLOT, 0, CurrentMachine.sMachIniFile)
Map.refMachManaging.DebugMessage(1, "Tentativo di connessione a CN Siemens con Sharp7")
Map.refMachManaging.DebugMessage(1, "IP: " & sIp)
Map.refMachManaging.DebugMessage(1, "Rack: " & nRack)
Map.refMachManaging.DebugMessage(1, "Slot: " & nSlot)
Dim nResult As Integer = Client.ConnectTo(sIp, nRack, nSlot)
If nResult = 0 Then
Map.refMachManaging.DebugMessage(1, "Connessione effettuata")
Else
Map.refMachManaging.DebugMessage(1, "Connessione fallita con codice di errore: " & nResult)
End If
' se la connessione è restituisce 0
Return nResult = 0
End Function
' chiudo la connessione
Friend Sub CloseConnection()
Dim nResult As Integer = Client.Disconnect()
If Map.refMachManaging.Debug > 0 Then
If nResult = 0 Then
EgtOutLog("Disconnessione effettuata")
Else
EgtOutLog("Disconnessione fallita con codice di errore: " & nResult)
End If
End If
End Sub
Friend Sub RefreshConnection()
If m_RefreshCounter < m_RefreshTime Then
m_RefreshCounter += 1
Else
' riavvio connessione
m_IsRefreshing = True
CloseConnection()
InitConnection()
m_IsRefreshing = False
m_RefreshCounter = 0
End If
End Sub
Private Function WaitingRefresh() As Boolean
If Not m_IsRefreshing Then Return True
Dim WaitingCounter As Integer = 0
While m_IsRefreshing < m_WaitingRefreshTime
If Not m_IsRefreshing Then Return True
Threading.Thread.Sleep(100)
End While
EgtOutLog("Waiting reconnection timeout!")
Return False
End Function
#Region "Read Variables"
Public Sub RefreshAllVars()
WaitingRefresh()
m_DBVariableList.Clear()
For Each Var In m_ReadingVars
' rileggo solo variabili continue
If Not IsNothing(Var) AndAlso Var.nReadType = CommVar.ReadTypes.CONTINUOUS Then
Dim CompleteAddressSplit() As String = Var.sAddress.Split(":"c)
Dim nDBAddress As Integer = 0
Integer.TryParse(CompleteAddressSplit(0), nDBAddress)
If nDBAddress = 0 Then Return
Dim DBBuffer As DBBuffer = m_DBVariableList.FirstOrDefault(Function(x) x.DBAddress = nDBAddress)
If IsNothing(DBBuffer) Then
Dim Buffer(65536) As Byte
Dim nAddressByte As Integer = 0
Select Case nDBAddress
Case 301
nAddressByte = 8
Case 302
nAddressByte = 34
End Select
Map.refMachManaging.DebugMessage(1, "Lettura di " & nAddressByte & " byte dalla variabile " & nDBAddress)
Dim nResult As Integer = 1234567890
Try
nResult = Client.DBRead(nDBAddress, 0, nAddressByte, Buffer)
Catch ex As Exception
nResult = 1234567890
Map.refMachManaging.DebugMessage(1, "Lettura di " & nDBAddress & " ha generato un'eccezione")
Map.refMachManaging.DebugMessage(1, ex.ToString())
End Try
If nResult = 0 Then
Map.refMachManaging.DebugMessage(1, "Lettura di " & nDBAddress & " effettuata")
If Map.refMachManaging.Debug > 1 Then
'For Index = 0 To Buffer.Count - 1
' Map.refMachManaging.DebugMessage(2, Index & ": " & Buffer(Index))
'Next
End If
Else
Map.refMachManaging.DebugMessage(2, "Lettura fallita con codice di errore: " & nResult)
End If
If nResult = 0 Then
DBBuffer = New DBBuffer(nDBAddress, Buffer)
m_DBVariableList.Add(DBBuffer)
End If
End If
If Not IsNothing(DBBuffer) Then
Dim PositionAddressSplit() As String = CompleteAddressSplit(1).Split("."c)
Dim nStartIndex As Integer = 0
Integer.TryParse(PositionAddressSplit(0), nStartIndex)
Select Case CompleteAddressSplit(2)
Case 1
Dim nBytePositionIndex As Integer = 0
Integer.TryParse(PositionAddressSplit(1), nBytePositionIndex)
Dim nPower As Integer = Math.Pow(2, nBytePositionIndex)
' Dim bValue As Boolean = (TestBuffer(nStartIndex) And nPower) = nPower
Map.refMachManaging.DebugMessage(2, "Lettura variabile " & nDBAddress & ":" & nStartIndex & "." & nBytePositionIndex)
Var.SetValue(If((DBBuffer.DBValue(nStartIndex) And nPower) = nPower, 1, 0))
Map.refMachManaging.DebugMessage(2, "Variabile " & nDBAddress & ":" & nStartIndex & "." & nBytePositionIndex & " (Tipo 1) = " & Var.sValue)
Case 2
'Dim x = BitConverter.ToInt16(TestBuffer, nStartIndex)
Dim nValue As Int16 = BitConverter.ToInt16(DBBuffer.DBValue, nStartIndex)
Map.refMachManaging.DebugMessage(2, "Lettura variabile " & nDBAddress & ":" & nStartIndex)
Var.SetValue(BinaryPrimitives.ReverseEndianness(nValue))
Map.refMachManaging.DebugMessage(2, "Variabile " & nDBAddress & ":" & nStartIndex & " (Tipo 2) = " & Var.sValue)
Case 3
' Dim x = BitConverter.ToInt32(TestBuffer, nStartIndex)
Dim nValue As Integer = BitConverter.ToInt32(DBBuffer.DBValue, nStartIndex)
Map.refMachManaging.DebugMessage(2, "Lettura variabile " & nDBAddress & ":" & nStartIndex)
Var.SetValue(BinaryPrimitives.ReverseEndianness(nValue))
Map.refMachManaging.DebugMessage(2, "Variabile " & nDBAddress & ":" & nStartIndex & " (Tipo 3) = " & Var.sValue)
End Select
End If
End If
Next
End Sub
Friend Function WriteVariable(Address As String, Value As String) As Boolean
WaitingRefresh()
Dim CompleteAddressSplit() As String = Address.Split(":"c)
Dim nDBAddress As Integer = 0
Integer.TryParse(CompleteAddressSplit(0), nDBAddress)
If nDBAddress = 0 Then Return False
Dim PositionAddressSplit() As String = CompleteAddressSplit(1).Split("."c)
Dim nStartIndex As Integer = 0
Integer.TryParse(PositionAddressSplit(0), nStartIndex)
Select Case CompleteAddressSplit(2)
Case 1
' rileggo int16
Dim Buffer(1) As Byte
Client.DBRead(nDBAddress, nStartIndex, 1, Buffer)
Dim nBytePositionIndex As Integer = 0
Integer.TryParse(PositionAddressSplit(1), nBytePositionIndex)
Dim nPower As Integer = Math.Pow(2, nBytePositionIndex)
Dim nNewValue As Integer = 0
If Not Integer.TryParse(Value, nNewValue) Then Return False
Dim nOldValue As Integer = If((Buffer(0) And nPower) = nPower, 1, 0)
If nOldValue = nNewValue Then
Return True
ElseIf nOldValue = 0 Then
Buffer(0) = Buffer(0) Or nPower
ElseIf nOldValue = 1 Then
Buffer(0) = Buffer(0) Xor nPower
Else
Return False
End If
' Buffer(0) = Buffer(0) And nPower
If Map.refMachManaging.Debug > 1 Then
EgtOutLog("Scrittura variabile " & Address & " (Tipo 1) con valore " & Value)
'For Index = 0 To Buffer.Count - 1
' EgtOutLog(Index & ": " & Buffer(Index))
'Next
End If
Dim nResult As Integer = Client.DBWrite(nDBAddress, nStartIndex, 1, Buffer) ' DbNumber, Start, Amount, Buffer
' Return WriteBool(nDBAddress, nStartIndex, bValue)
If Map.refMachManaging.Debug > 1 Then
If nResult <> 0 Then
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " effettuata")
Else
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " fallita")
End If
End If
Return nResult = 0
Case 2
Dim nValue As Int16 = 0
If Not Int16.TryParse(Value, nValue) Then Return False
If Map.refMachManaging.Debug > 1 Then
EgtOutLog("Scrittura variabile " & Address & " (Tipo 2) con valore " & Value)
End If
Dim bResult As Boolean = WriteInt(nDBAddress, nStartIndex, nValue)
If Map.refMachManaging.Debug > 1 Then
If bResult Then
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " effettuata")
Else
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " fallita")
End If
End If
Return bResult
Case 3
Dim nValue As Integer = 0
If Not Integer.TryParse(Value, nValue) Then Return False
If Map.refMachManaging.Debug > 1 Then
EgtOutLog("Scrittura variabile " & Address & " (Tipo 3) con valore " & Value)
End If
Dim bResult As Boolean = WriteDInt(nDBAddress, nStartIndex, nValue)
If Map.refMachManaging.Debug > 1 Then
If bResult Then
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " effettuata")
Else
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " fallita")
End If
End If
Return bResult
End Select
End Function
#End Region ' Read Variables
Friend Function ReadInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean
WaitingRefresh()
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
Dim Result As Integer = Client.DBRead(DBNumber, Start, 2, IntBuffer) ' DbNumber, Start, Amount, Buffer
If Result = 0 Then
Value = S7.GetIntAt(IntBuffer, 0)
Return True
End If
Return False
End Function
Friend Function WriteInt(DBNumber As Integer, Start As Integer, Value As Int16) As Boolean
WaitingRefresh()
S7.SetIntAt(IntBuffer, 0, Value)
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 2, IntBuffer) ' DbNumber, Start, Amount, Buffer
Return Result = 0
End Function
Friend Function ReadBool(DBNumber As Integer, Start As Integer, ByRef Value As Boolean) As Boolean
WaitingRefresh()
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
Dim Result As Integer = Client.DBRead(DBNumber, Start, 1, BoolBuffer) ' DbNumber, Start, Amount, Buffer
If Result = 0 Then
Value = BitConverter.ToBoolean(BoolBuffer, 0)
Return True
End If
Return False
End Function
Friend Function WriteBool(DBNumber As Integer, Start As Integer, Value As Boolean) As Boolean
WaitingRefresh()
If Value Then
BoolBuffer(0) = &H1
Else
BoolBuffer(0) = &H0
End If
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 1, BoolBuffer) ' DbNumber, Start, Amount, Buffer
Return Result = 0
End Function
Friend Function ReadDInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean
WaitingRefresh()
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
Dim Result As Integer = Client.DBRead(DBNumber, Start, 4, DIntBuffer) ' DbNumber, Start, Amount, Buffer
If Result = 0 Then
Value = S7.GetDIntAt(DIntBuffer, 0)
Return True
End If
Return False
End Function
Friend Function WriteDInt(DBNumber As Integer, Start As Integer, Value As Integer) As Boolean
WaitingRefresh()
S7.SetDIntAt(DIntBuffer, 0, Value)
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 4, DIntBuffer) ' DbNumber, Start, Amount, Buffer
Return Result = 0
End Function
Friend Function ReadReal(DBNumber As Integer, Start As Integer, ByRef Value As Double) As Boolean
WaitingRefresh()
' Read 4 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
Dim Result As Integer = Client.DBRead(DBNumber, Start, 4, RealBuffer) ' DbNumber, Start, Amount, Buffer
If Result = 0 Then
Value = S7.GetRealAt(RealBuffer, 0)
Return True
End If
Return False
End Function
Friend Function WriteReal(DBNumber As Integer, Start As Integer, Value As Single) As Boolean
WaitingRefresh()
S7.SetRealAt(RealBuffer, 0, Value)
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 4, RealBuffer) ' DbNumber, Start, Amount, Buffer
Return Result = 0
End Function
Friend Function ReadString(DBNumber As Integer, Start As Integer, Length As Integer, ByRef Value As String) As Boolean
WaitingRefresh()
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
Dim Result As Integer = Client.DBRead(DBNumber, Start, Length, StringBuffer) ' DbNumber, Start, Amount, Buffer
If Result = 0 Then
Value = S7.GetStringAt(StringBuffer, 0)
Return True
End If
Return False
End Function
Friend Function WriteString(DBNumber As Integer, Start As Integer, Value As String) As Boolean
WaitingRefresh()
If Value.Length > 65535 Then
Return False
End If
S7.SetStringAt(StringBuffer, 0, 65535, Value)
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
Dim Result As Integer = Client.DBWrite(DBNumber, Start, Value.Length + 2, StringBuffer) ' DbNumber, Start, Amount, Buffer
Return Result = 0
End Function
Friend Sub ResetStep(bReset As Boolean)
WaitingRefresh()
Dim ResetStep As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList(19) ' Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESET_STEP)
If bReset Then
Map.refMachManaging.DebugMessage(1, "Imposto variabile ResetStep a 1")
ResetStep.sValue = 1
Threading.Thread.Sleep(100)
Dim nResetStepOk As Integer = 0
Dim ResetStepOk As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESET_STEP_OK)
While nResetStepOk <> 1
Map.refMachManaging.DebugMessage(1, "Rileggo variabili")
RefreshAllVars()
Map.refMachManaging.DebugMessage(1, "Leggo valore ResetStepOk")
Integer.TryParse(ResetStepOk.sValue, nResetStepOk)
Threading.Thread.Sleep(1000)
End While
End If
ResetStep.sValue = 0
Map.refMachManaging.DebugMessage(1, "Imposto variabile ResetStep a 0")
End Sub
Friend Sub ReadPLCMessages()
WaitingRefresh()
Dim nPlc_Msg As New List(Of Byte)
For Index As Integer = 1 To 6
Dim nIndex As Integer = Index
Dim PLCMessagesVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = PLC_MESSAGES & nIndex)
If IsNothing(PLCMessagesVariable) OrElse IsNothing(PLCMessagesVariable.sValue) Then Return
Dim nTemp As Int16 = 0
Int16.TryParse(PLCMessagesVariable.sValue, nTemp)
nTemp = BinaryPrimitives.ReverseEndianness(nTemp)
Dim Bytes As Byte() = BitConverter.GetBytes(nTemp)
nPlc_Msg.AddRange(Bytes)
Next
Dim BitArray As New BitArray(nPlc_Msg.ToArray())
Dim ErrorList As New List(Of Integer)
For BitIndex = 0 To BitArray.Count - 1
If BitIndex <= 169 AndAlso BitArray(BitIndex) Then
ErrorList.Add(BitIndex)
End If
Next
ShowPLCError(ErrorList)
End Sub
Friend Sub ShowPLCError(ErrorNumber As List(Of Integer))
' resetto stati bFound
For Each Message In m_ActiveMessages
Message.bFound = False
Next
For index As Integer = 0 To ErrorNumber.Count - 1
Dim nIndex As Integer = index
Dim NewMessageInList As SiemensReadMessages = m_ActiveMessages.FirstOrDefault(Function(x) x.nIndex = 0.ToString())
' se il messaggio e' gia' in lista
If Not IsNothing(NewMessageInList) Then
' lo segno come trovato
NewMessageInList.bFound = True
Else
' lo aggiungo
Dim NewMessage As SiemensReadMessages = New SiemensReadMessages(0.ToString())
NewMessage.bFound = True
m_ActiveMessages.Add(NewMessage)
m_SiemensAlarmCallbackDlg(0, 0)
End If
Next
' cancello messaggi non trovati
For Index = m_ActiveMessages.Count - 1 To 0 Step -1
Dim Message As SiemensReadMessages = m_ActiveMessages(Index)
If Not Message.bFound Then
m_SiemensAlarmCallbackDlg(Message.nIndex, 1)
m_ActiveMessages.RemoveAt(Index)
End If
Next
End Sub
End Class
Friend Class DBBuffer
Private m_DBAddress As Integer
Public ReadOnly Property DBAddress As Integer
Get
Return m_DBAddress
End Get
End Property
Private m_DBValue(65536) As Byte
Public ReadOnly Property DBValue As Byte()
Get
Return m_DBValue
End Get
End Property
Sub New(DBAddress As Integer, DBValue As Byte())
m_DBAddress = DBAddress
m_DBValue = DBValue
End Sub
End Class
Public Class SiemensReadMessages
Private m_nIndex As Integer
Public ReadOnly Property nIndex As Integer
Get
Return m_nIndex
End Get
End Property
Private m_sMessage As String
Public ReadOnly Property sMessage As String
Get
Return m_sMessage
End Get
End Property
Friend Sub SetMessage(sValue As String)
m_sMessage = sValue
End Sub
Private m_bFound As Boolean = False
Friend Property bFound As Boolean
Get
Return m_bFound
End Get
Set(value As Boolean)
m_bFound = value
End Set
End Property
Public Sub New(nIndex As Integer)
m_nIndex = nIndex
m_sMessage = sMessage
End Sub
End Class
@@ -1,24 +1,36 @@
<DockPanel x:Class="ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2">
<TabItem Header="General">
<TabItem.Content>
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
SelectedIndex="{Binding SelConfigSubPage}">
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding General_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding General_Visibility}"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALLCORE:General_ConfigurationPageV/>
<!--<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
@@ -47,91 +59,25 @@
Margin="0,5,0,0"/>
</UniformGrid>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
<!--<TabItem Header="Parametri Q">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
ItemsSource="{Binding QBTLParamVMList}"
SelectedItem="{Binding SelQParam}"
Grid.Column="0"
Margin="5">
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV>
</Grid>
</TabItem.Content>
</TabItem>-->
<!--<TabItem Header="Macchina">
<TabItem.Content>
<Grid>
</Grid>-->
</TabItem.Content>
</TabItem>
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Machine_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding Machine_Visibility}"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALLCORE:Machine_ConfigurationPageV/>
<!--<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
@@ -194,47 +140,47 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>-->
<TabItem Header="Variabili">
<TabItem.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="+"
</Grid>-->
</TabItem.Content>
</TabItem>
<!--<TabItem Header="Variabili">
<TabItem.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="+"
Grid.Column="2"
Command="{Binding AddVariable_Command}"
Style="{StaticResource ToolBar_SmallButton}"/>
<Button Content="-"
<Button Content="-"
Grid.Column="3"
Command="{Binding RemoveVariable_Command}"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALLCORE:EgtDataGrid
</Grid>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALLCORE:EgtDataGrid
ItemsSource="{Binding VariablesList}"
SelectedItem="{Binding SelVariable}"
CanUserAddRows="False"
@@ -246,58 +192,58 @@
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
BindingColumns="{Binding VariablesColumns}">
<DataGrid.Resources>
<!-- Name -->
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- VariablePath -->
<DataGridTextColumn x:Key="colVARPATH" Binding="{Binding sVarPath}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.VarPath_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- Type -->
<DataGridComboBoxColumn x:Key="colTYPE">
<DataGridComboBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Type_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridComboBoxColumn.HeaderTemplate>
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding TypeList}"/>
<Setter Property="SelectedItem" Value="{Binding SelType, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.ElementStyle>
<DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding TypeList}"/>
<Setter Property="SelectedItem" Value="{Binding SelType, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.EditingElementStyle>
</DataGridComboBoxColumn>
</DataGrid.Resources>
</EgtBEAMWALLCORE:EgtDataGrid>
</Grid>
</Grid>
</TabItem.Content>
</TabItem>
</TabControl>
<Button Command="{Binding SaveCommand}"
<DataGrid.Resources>
--><!-- Name --><!--
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
--><!-- VariablePath --><!--
<DataGridTextColumn x:Key="colVARPATH" Binding="{Binding sVarPath}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.VarPath_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
--><!-- Type --><!--
<DataGridComboBoxColumn x:Key="colTYPE">
<DataGridComboBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Type_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridComboBoxColumn.HeaderTemplate>
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding TypeList}"/>
<Setter Property="SelectedItem" Value="{Binding SelType, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.ElementStyle>
<DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding TypeList}"/>
<Setter Property="SelectedItem" Value="{Binding SelType, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.EditingElementStyle>
</DataGridComboBoxColumn>
</DataGrid.Resources>
</EgtBEAMWALLCORE:EgtDataGrid>
</Grid>
</Grid>
</TabItem.Content>
</TabItem>-->
</TabControl>
<!--<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</Grid>
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>-->
</Grid>
</DockPanel>
@@ -1,5 +1,4 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
@@ -7,10 +6,34 @@ Imports EgtBEAMWALL.Core
Public Class ConfigurationPageVM
Inherits VMBase
' Definizione comandi
Private m_cmdSave As ICommand
Private m_cmdAddVariable As ICommand
Private m_cmdRemoveVariable As ICommand
Public Enum ConfigSubPages As Integer
GENERAL = 0
MACHINE = 1
VARIABLE = 2
End Enum
Private m_SelConfigSubPage As ConfigSubPages = ConfigSubPages.GENERAL
Public Property SelConfigSubPage As Integer
Get
Return m_SelConfigSubPage
End Get
Set(value As Integer)
m_SelConfigSubPage = value
If m_SelConfigSubPage = ConfigSubPages.GENERAL Then
m_bGeneral_Visibility = Visibility.Visible
ElseIf m_SelConfigSubPage = ConfigSubPages.MACHINE Then
m_bGeneral_Visibility = Visibility.Collapsed
End If
NotifyPropertyChanged(NameOf(General_Visibility))
End Set
End Property
Public ReadOnly Property MachinePanelVM As MachinePanelVM
Get
Return Map.refMachinePanelVM
End Get
End Property
' Contatore delle variabili rimosse per successiva rimozione dal file INI
Friend m_RemovedVarsCount As Integer = 0
@@ -85,6 +108,98 @@ Public Class ConfigurationPageVM
End Set
End Property
Private m_bGeneral_Visibility As Visibility = Visibility.Visible
Public Property General_Visibility As Visibility
Get
Return m_bGeneral_Visibility
End Get
Set(value As Visibility)
m_bGeneral_Visibility = value
NotifyPropertyChanged(NameOf(General_Visibility))
End Set
End Property
Private m_bMachine_Visibility As Visibility = Visibility.Collapsed
Public Property Machine_Visibility As Visibility
Get
Return m_bMachine_Visibility
End Get
Set(value As Visibility)
m_bMachine_Visibility = value
NotifyPropertyChanged(NameOf(Machine_Visibility))
End Set
End Property
Private m_SectionTime As Double
Public Property SectionTime As String
Get
Return DoubleToString(m_SectionTime, 5)
End Get
Set(value As String)
Dim dVal As Double = 0
If StringToDoubleAdv(value, dVal, True) AndAlso dVal > 0 Then
m_SectionTime = dVal
End If
End Set
End Property
Private m_PartTime As Double
Public Property PartTime As String
Get
Return DoubleToString(m_PartTime, 5)
End Get
Set(value As String)
Dim dVal As Double = 0
If StringToDoubleAdv(value, dVal, True) AndAlso dVal > 0 Then
m_PartTime = dVal
End If
End Set
End Property
Private m_ReminderList As New List(Of IdNameStruct)({New IdNameStruct(0, EgtMsg(61988)), New IdNameStruct(1, EgtMsg(61989)), New IdNameStruct(2, EgtMsg(61990)), New IdNameStruct(7, EgtMsg(61991)), New IdNameStruct(14, EgtMsg(61992)), New IdNameStruct(30, EgtMsg(61993))})
Public ReadOnly Property ReminderList As List(Of IdNameStruct)
Get
Return m_ReminderList
End Get
End Property
Private m_SelReminder As IdNameStruct
Public Property SelReminder As IdNameStruct
Get
Return m_SelReminder
End Get
Set(value As IdNameStruct)
m_SelReminder = value
WriteMainPrivateProfileString(S_BACKUPANDRESTORE, K_REMINDERFREQUENCY, m_SelReminder.Id)
End Set
End Property
Private m_ConfigMachTableList As New ObservableCollection(Of MachTable)
Public Property ConfigMachTableList As ObservableCollection(Of MachTable)
Get
Return m_ConfigMachTableList
End Get
Set(value As ObservableCollection(Of MachTable))
m_ConfigMachTableList = value
End Set
End Property
Private m_MachineParameter_Visibility As Visibility = Visibility.Collapsed
Public Property MachineParameter_Visibility As Visibility
Get
Return m_MachineParameter_Visibility
End Get
Set(value As Visibility)
m_MachineParameter_Visibility = value
NotifyPropertyChanged(NameOf(MachineParameter_Visibility))
End Set
End Property
' Definizione comandi
Private m_cmdSave As ICommand
Private m_cmdAddVariable As ICommand
Private m_cmdRemoveVariable As ICommand
#Region "Messages"
Public ReadOnly Property L_Msg As String
@@ -209,6 +324,41 @@ Public Class ConfigurationPageVM
End Get
End Property
Public ReadOnly Property General_Msg As String
Get
Return EgtMsg(62535)
End Get
End Property
Public ReadOnly Property Machine_Msg As String
Get
Return EgtMsg(62537)
End Get
End Property
Public ReadOnly Property SectionTime_Msg As String
Get
Return EgtMsg(61806)
End Get
End Property
Public ReadOnly Property PartTime_Msg As String
Get
Return EgtMsg(61807)
End Get
End Property
Public ReadOnly Property Nesting_Msg As String
Get
Return EgtMsg(61829)
End Get
End Property
Public ReadOnly Property PrintLabel_Msg As String
Get
Return EgtMsg(61894)
End Get
End Property
#End Region ' Messages
#Region "Constructor"
@@ -244,6 +394,18 @@ Public Class ConfigurationPageVM
GetPrivateProfileColumns(S_VARIABLESLIST, VariablesColumns)
' carico le Variables della macchina
LoadVariables()
' leggo SectionTime e PartTime
GetMainPrivateProfileString(S_NEST, K_SECTIONTIME, "", SectionTime)
GetMainPrivateProfileString(S_NEST, K_PARTTIME, "", PartTime)
' assegno le liste dei parametri della macchina corrente alla ConfigMachTableList alla pagina di Configurazione
ConfigMachTableList = CurrentMachine.MachTableList
Dim nDefaultReminderFrequency As Integer = GetMainPrivateProfileInt(S_BACKUPANDRESTORE, K_REMINDERFREQUENCY, 1)
SelReminder = m_ReminderList.FirstOrDefault(Function(x) x.Id = nDefaultReminderFrequency)
' rendo invisibile la sezione Offset presente nel tab Macchine
m_MachineParameter_Visibility = Visibility.Collapsed
m_bMachine_Visibility = Visibility.Collapsed
NotifyPropertyChanged(NameOf(MachineParameter_Visibility))
NotifyPropertyChanged(NameOf(Machine_Visibility))
End Sub
#End Region ' Constructor
@@ -407,11 +569,196 @@ Public Class ConfigVariable
End Class
'' Tipo parametro nel file di configurazione Macchina
'Public Enum MachParamType As Integer
' DOUBLE_ = 1
' STRING_ = 2
' COMBO = 3
' LENGTH = 4
' CHECKBOX = 5
'End Enum
Public Class MachParam
Inherits VMBase
' table a cui appartiene il parametro
Private m_nParentTable As Integer
Friend ReadOnly Property nParentTable As Integer
Get
Return m_nParentTable
End Get
End Property
' indice del parametro
Private m_nParamIndex As Integer
Friend ReadOnly Property nParamIndex As Integer
Get
Return m_nParamIndex
End Get
End Property
' tipo della variabile
Private m_nType As MachParamType
Friend ReadOnly Property nType As MachParamType
Get
Return m_nType
End Get
End Property
' parametri da struttura
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
' parametri da geometria
Private m_IsModifiedValue As Boolean = False
Private m_dValue As Double
Private m_sValue As String
Public Property sValue As String
Get
Select Case nType
Case MachParamType.DOUBLE_
Return DoubleToString(m_dValue, 3)
Case MachParamType.LENGTH
Return LenToString(m_dValue, 3)
Case Else ' stringhe
Return m_sValue
End Select
Return If(nType = MachParamType.LENGTH, LenToString(m_dValue, 3), DoubleToString(m_dValue, 3))
End Get
Set(value As String)
Dim dNewValue As Double
' verifico se valore immesso è diverso dall'originale
If nParentTable > 0 Then
' trasformo valori
Select Case nType
Case MachParamType.DOUBLE_
StringToDoubleAdv(value, dNewValue, True)
m_IsModifiedValue = Math.Abs(dNewValue - m_dValue) > EPS_SMALL
Case MachParamType.LENGTH
StringToLenAdv(value, dNewValue, True)
m_IsModifiedValue = Math.Abs(dNewValue - m_dValue) > EPS_SMALL
Case Else
m_IsModifiedValue = String.Compare(value, m_sValue) <> 0
End Select
End If
' se valore immesso è diverso e password non inserita
'If m_IsModifiedValue AndAlso Not Map.refConfigurationPageVM.bModifyMachParam Then
' Map.refConfigurationPageVM.bModifyMachParam = Map.refConfigurationPageVM.VerifyConfigPagePassword()
' If Not Map.refConfigurationPageVM.bModifyMachParam Then
' NotifyPropertyChanged("sValue")
' m_IsModifiedValue = False
' Return
' End If
'End If
Select Case nType
Case MachParamType.DOUBLE_, MachParamType.LENGTH
UpdateParamValue(dNewValue, "")
Case Else
UpdateParamValue(0, value)
End Select
End Set
End Property
Public Property dValue As Double
Get
Return m_dValue
End Get
Set(value As Double)
m_dValue = value
NotifyPropertyChanged(NameOf(sValue))
End Set
End Property
' descrizione del parametro
Private m_sDescription As String
Public Property sDescription As String
Get
Return m_sDescription
End Get
Set(value As String)
m_sDescription = value
End Set
End Property
Private Sub StdInit(nParentTable As Integer, nParamIndex As Integer, Type As MachParamType, sName As String, sDescription As String)
m_nParentTable = nParentTable
m_nParamIndex = nParamIndex
m_nType = Type
m_sName = sName
m_sDescription = MsgToString(sDescription)
End Sub
' new per double e length
Sub New(nParentTable As Integer, nParamIndex As Integer, nType As MachParamType, sParamName As String, dValue As Double, sDescription As String)
StdInit(nParentTable, nParamIndex, nType, sParamName, sDescription)
m_dValue = dValue 'sValue = DoubleToString(dValue, 3)
End Sub
' new per stringhe
Sub New(nParentTable As Integer, nParamIndex As Integer, nType As MachParamType, sParamName As String, sDescription As String)
StdInit(nParentTable, nParamIndex, nType, sParamName, sDescription)
End Sub
' new per parametro vuoto
Sub New(nType As MachParamType, nParamIndex As Integer, sParamName As String)
StdInit(Nothing, nParamIndex, nType, sParamName, "")
End Sub
Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
Select Case nType
Case MachParamType.DOUBLE_, MachParamType.LENGTH
m_dValue = dNewValue
Case MachParamType.STRING_
m_sValue = sNewValue
End Select
End Sub
Public ReadOnly Property IsModified() As Boolean
Get
Return m_IsModifiedValue
End Get
End Property
Public Sub IsModifiedReset()
m_IsModifiedValue = False
End Sub
End Class
Public Class MachTable
Inherits VMBase
' nome della table
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Private m_MachParamList As New ObservableCollection(Of MachParam)
Public Property MachParamList As ObservableCollection(Of MachParam)
Get
Return m_MachParamList
End Get
Set(value As ObservableCollection(Of MachParam))
m_MachParamList = value
End Set
End Property
Sub New(Name As String, ParamList As ObservableCollection(Of MachParam))
sName = Name
MachParamList = ParamList
End Sub
End Class
' Tipo parametro nel file di configurazione Macchina
Public Enum MachParamType As Integer
DOUBLE_ = 1
STRING_ = 2
COMBO = 3
LENGTH = 4
CHECKBOX = 5
End Enum
@@ -19,7 +19,6 @@ Module ConstCommVar
NUM_FLEXIUM = 2
NUM_AXIUM_APSERVER = 3
NUM_AXIUM_PCTOOLKIT = 4
SIEMENS_SHARP7 = 5
End Enum
' Assi
@@ -55,24 +54,6 @@ Module ConstCommVar
Public Const PLC_MESSAGES As String = "PLC_Messages"
' variabile per leggere e scrivere permesso invio cn a macchina
Public Const SENDPERMISSION As String = "SendPermission"
' variabile per confermare lettura dati di stato pezzo
Public Const DATAREADED As String = "Data_Readed"
' variabile per confermare lettura stato reset
Public Const RESETREADED As String = "Reset_Readed"
' variabile per confermare lettura stato reset
Public Const DATATOREAD As String = "Data_ToRead"
' variabile per confermare lettura stato reset
Public Const RESET_STEP As String = "Reset_Step"
' variabile per confermare lettura stato reset
Public Const RESET_STEP_OK As String = "Reset_Step_Ok"
' variabile per stato CN
Public Const NC_STATUS As String = "NC_Status"
' variabile per modo CN
Public Const NC_MODE As String = "NC_Mode"
' variabile per apertura pinze manuale
Public Const OPEN_CLAMP As String = "Open_Clamp"
' variabile per larghezza barra al carico
Public Const W_CARICO As String = "W_Carico"
Public Enum OPStates
Start = 1
@@ -91,11 +72,4 @@ Module ConstCommVar
Home = 8
End Enum
' Variabili Siemens
Public Const K_IP As String = "Ip"
Public Const K_RACK As String = "Rack"
Public Const K_SLOT As String = "Slot"
Public Const K_TIMERINTERVAL As String = "TimerInterval"
Public Const K_ISOFILEDIR As String = "IsoFileDir"
End Module
@@ -16,6 +16,31 @@
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<IncrementalBuild>true</IncrementalBuild>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugSymbols>false</DebugSymbols>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<IncrementalBuild>false</IncrementalBuild>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
@@ -28,6 +53,29 @@
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x64\Debug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x64\Release\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
<Optimize>true</Optimize>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
@@ -54,6 +102,27 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\RemoteDebug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x64'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x64\RemoteDebug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
@@ -154,9 +223,6 @@
<Reference Include="SdkApi.Desktop.Usb, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\SdkApi.Desktop.Usb.dll</HintPath>
</Reference>
<Reference Include="Sharp7.net">
<HintPath>..\ExtLibs\Sharp7.net.dll</HintPath>
</Reference>
<Reference Include="SharpSnmpLib, Version=10.0.9.0, Culture=neutral, PublicKeyToken=4c00852d3788e005, processorArchitecture=MSIL">
<HintPath>..\packages\Lextm.SharpSnmpLib.10.0.9\lib\net452\SharpSnmpLib.dll</HintPath>
</Reference>
@@ -260,13 +326,13 @@
<Compile Include="Comms\NUMAxiumComm.vb" />
<Compile Include="Comms\NUMAxiumPcToolkitComm.vb" />
<Compile Include="Comms\NUMFlexiumComm.vb" />
<Compile Include="Comms\SIEMENSSharp7Comm.vb" />
<Compile Include="Comms\TPAComm.vb" />
<Compile Include="Constants\ConstMachMsg.vb" />
<Compile Include="MachineLogPage\MachineLogPageV.xaml.vb">
<DependentUpon>MachineLogPageV.xaml</DependentUpon>
</Compile>
<Compile Include="MachineLogPage\MachineLogPageVM.vb" />
<Compile Include="MachinePanel\MachinePanelVM.vb" />
<Compile Include="MDIPage\MDIPageV.xaml.vb">
<DependentUpon>MDIPageV.xaml</DependentUpon>
</Compile>
@@ -308,10 +374,6 @@
<Compile Include="MachGroupPanel\PartVM.vb" />
<Compile Include="MachGroupPanel\SupervisorMachGroupPanelVM.vb" />
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
<Compile Include="MachinePanel\MachinePanelV.xaml.vb">
<DependentUpon>MachinePanelV.xaml</DependentUpon>
</Compile>
<Compile Include="MachinePanel\MachinePanelVM.vb" />
<Compile Include="MachManagingThread\MachCommConst.vb" />
<Compile Include="MachManagingThread\MachManaging.vb" />
<Compile Include="MachManagingThread\MachManagingThread.vb" />
@@ -351,6 +413,7 @@
<Compile Include="Utility\DisableModifiedMgr.vb" />
<Compile Include="Utility\LogEvent.vb" />
<Compile Include="Utility\LuaExec.vb" />
<Compile Include="Utility\MachParamIniFile.vb" />
<Compile Include="Utility\ManageBTLParts.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="VariablesList\VariablesListV.xaml.vb">
@@ -419,10 +482,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MachinePanel\MachinePanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MainMenu\MainMenuV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -605,6 +664,10 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="Resources\Configuration\MachiningsTable.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
@@ -49,8 +49,7 @@
Visibility="{Binding E80002_Visibility}"/>
</UniformGrid>
<Expander Grid.Row="4"
Header="Axis"
Visibility="{Binding Axis_Visibility}">
Header="Axis">
<EgtBEAMWALL:AxesPanelV DataContext="{StaticResource AxesPanelVM}"/>
</Expander>
@@ -148,17 +148,6 @@ Public Class LeftPanelVM
End Get
End Property
Public Property m_Axis_Visibility As Visibility
Public ReadOnly Property Axis_Visibility As Visibility
Get
Return m_Axis_Visibility
End Get
End Property
Friend Sub SetAxisVisibility()
m_Axis_Visibility = If(CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7, Visibility.Collapsed, Visibility.Visible)
NotifyPropertyChanged(NameOf(Axis_Visibility))
End Sub
Private m_bRestart As Boolean = False
Public Property bRestart As Boolean
Get
@@ -280,7 +269,7 @@ Public Class LeftPanelVM
Public ReadOnly Property OPMode_Visibility As Visibility
Get
Return If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT Or CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7, Visibility.Visible, Visibility.Collapsed)
Return If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
@@ -441,7 +430,7 @@ Public Class LeftPanelVM
New OPState("Pending", OPStates.Pending),
New OPState("Unspecified", OPStates.Unspecified)
}
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
m_OPStateList = New List(Of OPState) From {
New OPState("Start", OPStates.Start),
New OPState("Stop", OPStates.Stop),
@@ -473,19 +462,12 @@ Public Class LeftPanelVM
New OPState("Manual", OPModes.Manual),
New OPState("Home", OPModes.Home)
}
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
m_OPModeList = New List(Of OPState) From {
New OPState("Auto", OPModes.Auto),
New OPState("Mdi", OPModes.Mdi),
New OPState("Manual", OPModes.Manual),
New OPState("Reference Point", OPModes.Home)
}
End Select
End Sub
Friend Sub SetE80000Visibility()
' imposto visibilità variabili E80000 e seconda del tipo di controllo
If CurrentMachine.NCType = NCTypes.TPA OrElse CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
If CurrentMachine.NCType = NCTypes.TPA Then
m_E80000_Visibility = Visibility.Collapsed
m_E80002_Visibility = Visibility.Collapsed
Else
@@ -324,7 +324,7 @@ Public Class MachCommandMessagePanelVM
m_MachManagingThread = New Thread(Sub()
MachineCommThread.MachManagingThreadFunction(AddressOf ResultCallbackDlg, AddressOf CloseCallbackDlg,
AddressOf UpdateCallbackDlg, AddressOf TPAAlarmCallbackDlg, AddressOf NUMAlarmCallbackDlg,
AddressOf SiemensAlarmCallbackDlg, AddressOf AxisCoordinatesCallbackDlg, AddressOf OpStateCallbackDlg,
AddressOf AxisCoordinatesCallbackDlg, AddressOf OpStateCallbackDlg,
AddressOf OpModeCallbackDlg, AddressOf ChannelCallbackDlg, AddressOf ReadVarCallbackDlg)
End Sub)
' avvio thread di gestione della macchina che avvia la connessione
@@ -804,42 +804,6 @@ Public Class MachCommandMessagePanelVM
DbControllers.m_LogMachineController.Create(LogEvent.CreateAlarmLog(DateTime.Now(), AlarmOperation & LogEvent.cSeparator & ErrorTyp & LogEvent.cSeparator & AlarmMessage & LogEvent.cSeparator & AlarmCode & LogEvent.cSeparator, DbControllers.m_SupervisorId))
End Sub
Friend Sub SiemensAlarmCallbackDlg(nIndex As Integer, AlarmOperation As Integer)
' se aggiungo allarme e non ce ne erano
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) AndAlso m_ErrCycle.Count = 0 AndAlso m_Iso.Count = 0 AndAlso m_Message.Count = 0 AndAlso m_ErrSystem.Count = 0 Then
' avvio il timer degli allarmi
m_AlarmTimer.Start()
End If
Dim AlarmMessage As String = nIndex
' costruisco messaggio errore in base al tipo
Dim sErrorMessage As String = AlarmMessage
If bMsgTranslationActive Then
Dim sTranslatedMsg = MachMsg(MsgParagraphs.PLC, nIndex)
If Not String.IsNullOrWhiteSpace(sTranslatedMsg) Then
sErrorMessage = sTranslatedMsg
End If
End If
AlarmMessage = If(Not String.IsNullOrWhiteSpace(sErrorMessage), sErrorMessage, "")
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
m_ErrCycle.Add(Alarm.CreateAlarm(nIndex, AlarmMessage))
Else
m_ErrCycle.RemoveAll(Function(x) x.sCode = nIndex)
End If
' forzo aggiornamento allarmi
AlarmTimer_Tick()
' se non ci sono errori
If m_ErrCycle.Count = 0 AndAlso m_Iso.Count = 0 AndAlso m_Message.Count = 0 AndAlso m_ErrSystem.Count = 0 Then
' fermo timer degli allarmi
m_AlarmTimer.Stop()
End If
'DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, ErrorTyp, AlarmMessage, AlarmCode, DateTime.Now))
DbControllers.m_LogMachineController.Create(LogEvent.CreateAlarmLog(DateTime.Now(), AlarmOperation & LogEvent.cSeparator & nIndex & LogEvent.cSeparator & sErrorMessage, DbControllers.m_SupervisorId))
End Sub
Friend Sub AxisCoordinatesCallbackDlg(AxisValue As Double, AxisIndex As Integer)
Map.refAxesPanelVM.AxisCoordinatesCallbackDlg(AxisValue, AxisIndex)
End Sub
@@ -857,7 +821,7 @@ Public Class MachCommandMessagePanelVM
Next
End If
End If
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
Map.refLeftPanelVM.SetOPState(NewState)
End Select
'DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
@@ -871,7 +835,7 @@ Public Class MachCommandMessagePanelVM
Return
End If
Select Case CurrentMachine.NCType
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
Map.refLeftPanelVM.SetOPMode(NewState)
End Select
'DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
@@ -22,14 +22,13 @@ Public Class MyMachGroupVM
ElseIf m_bToBeProduced OrElse m_bSentToMachine Then
Return False
' se la macchina e' ferma
ElseIf CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 AndAlso
(IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified)) Then
ElseIf IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified) Then
' verifico se c'e' un pezzo non finito
Dim ToBeRestartedPart As MyMachGroupVM = Map.refSupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x As MyMachGroupVM) x.nProduction_State = Global.EgtBEAMWALL.Core.ItemState.WIP And Not x.m_bToBeProduced)
Dim ToBeRestartedPart As MyMachGroupVM = Map.refSupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x As MyMachGroupVM) x.nProduction_State = Global.EgtBEAMWALL.Core.ItemState.WIP And Not m_bToBeProduced)
' se c'e', attivo solo il pezzo non finito
Return Not (Not IsNothing(ToBeRestartedPart) AndAlso Not ToBeRestartedPart Is Me)
Else
@@ -49,12 +48,11 @@ Public Class MyMachGroupVM
Case ItemState.WIP
If Not m_bToBeProduced AndAlso Not m_bSentToMachine Then
Return True
ElseIf CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 AndAlso
(IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified)) Then
ElseIf IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified) Then
Return True
Else
Return False
@@ -227,45 +225,27 @@ Public Class MyMachGroupVM
End If
' se progetto travi e lavorazione interrotta da reset
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM AndAlso (bResetWhileCutting OrElse dtStartTime <> DateTime.MinValue) And Not Map.refLeftPanelVM.bRestart Then
Dim bRedo As MessageBoxResult = MessageBoxResult.No
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso Not IsNothing(Map.refMachManaging) Then
' leggo pinze aperte
Dim Open_ClampVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = OPEN_CLAMP)
Map.refMachManaging.Siemens_Sharp7.RefreshAllVars()
Map.refMachManaging.DebugMessage(1, "Leggo variabile pinze aperte " & Open_ClampVariable.sValue)
If Open_ClampVariable.sValue = 1 Then
Map.refMachManaging.DebugMessage(1, "Pinze aperte, ripartenza impossibile")
bRedo = MessageBoxResult.No
MessageBox.Show("Pinze aperte, ripartenza impossibile!!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
Else
' chiedo se riprendere o rifare la barra da zero
bRedo = MessageBox.Show(EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
End If
Else
' chiedo se riprendere o rifare la barra da zero
bRedo = MessageBox.Show(EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
End If
' chiedo se riprendere o rifare la barra da zero
Dim bRedo As MessageBoxResult = MessageBox.Show(EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
Select Case bRedo
Case MessageBoxResult.Yes
If CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 Then
' segno da rifare pezzi non completamente lavorati
For Each Part As PartVM In PartVMList
If Part.dtEndTime <> DateTime.MinValue Then
Part.bDO = False
Else
Part.SetDo(True)
End If
'Part.bDO = (Part.dtEndTime = DateTime.MinValue)
'Part.NotifyPropertyChanged(NameOf(Part.bRedo))
Next
' se ripresa, mostro lista feature e colonne Redo
Map.refLeftPanelVM.bRestart = True
' blocco produzione di tutti gli altri
MyMachGroupVM.UpdateProduceIsEnabledForAll()
' riabilito bottoni di comunicazione a fine invio programma
Map.refMachCommandMessagePanelVM.SetCommBtnIsEnabled(True)
Return
End If
' segno da rifare pezzi non completamente lavorati
For Each Part As PartVM In PartVMList
If Part.dtEndTime <> DateTime.MinValue Then
Part.bDO = False
Else
Part.SetDo(True)
End If
'Part.bDO = (Part.dtEndTime = DateTime.MinValue)
'Part.NotifyPropertyChanged(NameOf(Part.bRedo))
Next
' se ripresa, mostro lista feature e colonne Redo
Map.refLeftPanelVM.bRestart = True
' blocco produzione di tutti gli altri
MyMachGroupVM.UpdateProduceIsEnabledForAll()
' riabilito bottoni di comunicazione a fine invio programma
Map.refMachCommandMessagePanelVM.SetCommBtnIsEnabled(True)
Return
Case MessageBoxResult.No
' annullo stati dei pezzi gia' fatti
For Each Part In PartVMList
@@ -21,7 +21,6 @@ Module MachCommConst
Public Delegate Sub UpdateCallbackDlg(Param As String, Params As String)
Public Delegate Sub TPAAlarmCallbackDlg(ByVal AlarmOperation As Integer, ByVal AlarmType As Integer, ByVal AlarmMessage As String, ByVal AlarmCode As String, ByVal AlarmDateTime As String)
Public Delegate Sub NUMAlarmCallbackDlg(ByVal CncNumber As Integer, ByVal numberOfError As Integer, ByVal ErrorTyp As String, ByVal ErrorIndex As String, ByVal ErrorNumber As String, ByVal ErrorLine As String, ByVal ErrorMessage As String, ByVal ErrorAdditional As String)
Public Delegate Sub SiemensAlarmCallbackDlg(nIndex As Integer, AlarmOperation As Integer)
Public Delegate Sub AxisCoordinatesCallbackDlg(ByVal AxisValue As Double, ByVal AxisIndex As Integer)
Public Delegate Sub OpStateCallbackDlg(ByVal newOpState As Integer)
Public Delegate Sub OpModeCallbackDlg(ByVal newOpState As Integer)
@@ -33,7 +32,6 @@ Module MachCommConst
Friend m_UpdateCallbackDlg As UpdateCallbackDlg
Friend m_TPAAlarmCallbackDlg As TPAAlarmCallbackDlg
Friend m_NUMAlarmCallbackDlg As NUMAlarmCallbackDlg
Friend m_SiemensAlarmCallbackDlg As SiemensAlarmCallbackDlg
Friend m_AxisCoordinatesCallbackDlg As AxisCoordinatesCallbackDlg
Friend m_OpStateCallbackDlg As OpStateCallbackDlg
Friend m_OpModeCallbackDlg As OpModeCallbackDlg
@@ -7,7 +7,6 @@ Imports EgtWPFLib5
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Supervisor.CommVar
Imports System.Windows.Forms.VisualStyles
Public Class MachManaging
@@ -50,11 +49,6 @@ Public Class MachManaging
Return m_CN
End Get
End Property
Public ReadOnly Property Siemens_Sharp7 As SIEMENSSharp7Comm
Get
Return m_CN
End Get
End Property
Private Shared WithEvents m_CommandList As New ObservableCollection(Of ThreadCommand)
Public Shared ReadOnly Property CommandList As ObservableCollection(Of ThreadCommand)
@@ -103,20 +97,7 @@ Public Class MachManaging
End Get
End Property
' variabile che indica prima barra dopo start (Siemens)
Private m_bFirstRaw As Boolean = True
' variabile che indica se emettere ii messaggi di debug
Private m_Debug As Integer = 0
Public ReadOnly Property Debug As Integer
Get
Return m_Debug
End Get
End Property
Sub New()
' leggo variabile debug da ini
m_Debug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, CurrentMachine.sMachIniFile)
' imposto in Map
Map.SetRefMachManaging(Me)
AddHandler m_CommandList.CollectionChanged, AddressOf CommandList_CollectionChanged
@@ -260,7 +241,7 @@ Public Class MachManaging
' Threading.Thread.Sleep(300)
' End If
' End If
Case NCTypes.NUM_FLEXIUM, NCTypes.TPA, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
Case NCTypes.NUM_FLEXIUM, NCTypes.TPA, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
' eseguo ciclo principale
Dim nReset_State As Integer
Dim nStart_State As Boolean
@@ -273,9 +254,6 @@ Public Class MachManaging
Dim nISO_Sent As Integer
Dim nRunning As Integer
Dim nCurrMachIndex As Integer
Dim nDataWrite As Integer
Dim nNCStatus As Integer
Dim nNCMode As Integer
Dim ResetVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESET_STATE)
Dim StartVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = START_STATE)
Dim StopVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = STOP_STATE)
@@ -287,11 +265,6 @@ Public Class MachManaging
Dim ISOSentVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_SENT)
Dim RunningVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RUNNING)
Dim MachIndexVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = MACHINDEX)
Dim DataReadedVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = DATAREADED)
Dim ResetReadedVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESETREADED)
Dim DataToReadVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = DATATOREAD)
Dim NCStatusVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NC_STATUS)
Dim NCModeVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NC_MODE)
Select Case CurrentMachine.NCType
Case NCTypes.TPA
' leggo tutte le variabili
@@ -468,73 +441,7 @@ Public Class MachManaging
'EgtOutLog("Pre lettura posizioni")
Num_Axium_PCToolkit.ReadPosition()
'EgtOutLog("Post lettura messaggi")
Case NCTypes.SIEMENS_SHARP7
' leggo tutte le variabili
Map.refMachManaging.DebugMessage(1, "Leggo tutte le variabili")
Siemens_Sharp7.RefreshAllVars()
If Not IsNothing(ResetVariable.sValue) Then
Integer.TryParse(ResetVariable.sValue, nReset_State)
Else
nReset_State = 1
End If
If Not IsNothing(ProdVariable.sValue) Then
Integer.TryParse(ProdVariable.sValue, nP_Prod)
Else
nP_Prod = -1
End If
If Not IsNothing(MachGroupVariable.sValue) Then
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
Else
nP_Machgroup = -1
End If
If Not IsNothing(PartVariable.sValue) Then
Integer.TryParse(PartVariable.sValue, nP_Part)
Else
nP_Part = -1
End If
If Not IsNothing(StateVariable.sValue) Then
Integer.TryParse(StateVariable.sValue, nP_State)
Else
nP_State = -1
End If
If Not IsNothing(ISONumVariable.sValue) Then
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
Else
nISO_Num = -1
End If
If Not IsNothing(RunningVariable.sValue) Then
Integer.TryParse(RunningVariable.sValue, nRunning)
Else
nRunning = -1
End If
If Not IsNothing(DataReadedVariable.sValue) Then
Integer.TryParse(DataReadedVariable.sValue, nDataWrite)
Else
nDataWrite = -1
End If
If Not IsNothing(NCStatusVariable.sValue) Then
Integer.TryParse(NCStatusVariable.sValue, nNCStatus)
Else
nNCStatus = -1
End If
If Not IsNothing(NCModeVariable.sValue) Then
Integer.TryParse(NCModeVariable.sValue, nNCMode)
Else
nNCMode = -1
End If
' leggo messaggi plc
Siemens_Sharp7.ReadPLCMessages()
End Select
' se SiemensSharp7 e reset a 0, verifico che conferma lettura reset sia a zero
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 And ResetReadedVariable.sValue = "1" And ResetVariable.sValue = "0" Then
Map.refMachManaging.DebugMessage(1, "Azzero lettura reset")
ResetReadedVariable.sValue = "0"
End If
' se SiemensSharp7 e dati letti a 1 e dati scritti a 0, verifico che dati letti sia a zero
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 And DataReadedVariable.sValue = "1" And DataToReadVariable.sValue = "0" Then
Map.refMachManaging.DebugMessage(1, "Azzero lettura dati")
DataReadedVariable.sValue = "0"
End If
' se NUM aggiorno stato della macchina
If CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Then
Dim OpState As OPStates
@@ -562,41 +469,6 @@ Public Class MachManaging
If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
m_OpStateCallbackDlg(OpState)
End If
ElseIf CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
Dim OpState As OPStates
If nNCStatus > 0 Then
Select Case nNCStatus
Case 1
OpState = OPStates.End
Case 2
OpState = OPStates.Stop
Case 3
OpState = OPStates.Start
Case Else
OpState = OPStates.Unspecified
End Select
End If
If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
Map.refMachManaging.DebugMessage(1, "Imposto stato CN: " & OpState)
m_OpStateCallbackDlg(OpState)
End If
Dim OpMode As OPModes
If nNCMode > 0 Then
Select Case nNCMode
Case 1
OpMode = OPModes.Manual
Case 2
OpMode = OPModes.Auto
Case 3
OpMode = OPModes.Mdi
Case 4 ' Reference Point
OpMode = OPModes.Home
End Select
End If
If IsNothing(Map.refLeftPanelVM.SelOPMode) OrElse OpMode <> Map.refLeftPanelVM.SelOPMode.Id Then
Map.refMachManaging.DebugMessage(1, "Imposto modo CN: " & OpMode)
m_OpModeCallbackDlg(OpMode)
End If
End If
' se TPA e non ancora fatto, preparo variabili barra successiva
If CurrentMachine.NCType = NCTypes.TPA AndAlso CurrentMachine.Flow = FlowTypes.CONTINUOUS AndAlso m_NextBarId = 0 Then
@@ -610,31 +482,19 @@ Public Class MachManaging
nISO_Sent = 1) OrElse
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso
Not Num_Axium_PCToolkit.bIsTransferActive AndAlso
nISO_Sent = 1) OrElse
(CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso
(nISO_Num = 0 OrElse
nISO_Num = nRunning)) Then
nISO_Sent = 1) Then
' verifico se c'e' un programma da lanciare
Map.refMachManaging.DebugMessage(1, "Entro in SendNextProgram")
SendNextProgram()
End If
' verifico se scattato stato reset
If nReset_State <> 0 Then
Map.refMachManaging.DebugMessage(1, "Scattato Reset")
' resetto tutti i programmi
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then Map.refProjectVM.SupervisorMachGroupPanelVM.ResetAllMachGroups()
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
'resetto programma corrente
Map.refMachManaging.DebugMessage(1, "Resetto programma corrente")
ISONumVariable.sValue = "0"
m_bFirstRaw = True
Else
' resetto variabili P
ProdVariable.sValue = "0"
MachGroupVariable.sValue = "0"
PartVariable.sValue = "0"
StateVariable.sValue = "0"
End If
' resetto variabili P
ProdVariable.sValue = "0"
MachGroupVariable.sValue = "0"
PartVariable.sValue = "0"
StateVariable.sValue = "0"
'Tpa.RWVariableManager.WriteVar(P_PROD, 0)
'Tpa.RWVariableManager.WriteVar(P_MACHGROUP, 0)
'Tpa.RWVariableManager.WriteVar(P_PART, 0)
@@ -644,12 +504,7 @@ Public Class MachManaging
RemoveAllProgram() ' rimuovo programma default per pending
End If
' azzero variabile reset
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
Map.refMachManaging.DebugMessage(1, "Confermo lettura reset")
ResetReadedVariable.sValue = "1"
Else
ResetVariable.sValue = "0"
End If
ResetVariable.sValue = "0"
'Tpa.remObject.SetVariableCommand(CInt(ISOCNC.Remoting.VariableCommands.WriteVar),
' RWVariableManager.GetReadVarFromName(RESET_STATE).sAddress, "0")
' resetto prossima barra e variabili V
@@ -673,17 +528,10 @@ Public Class MachManaging
' attesa per essere sicuro che abbia scritto e riletto variabili
Threading.Thread.Sleep(300)
' verifico stati inizio e fine pezzi
ElseIf (CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 AndAlso
nP_Prod <> 0 AndAlso
nP_Machgroup <> 0 AndAlso
nP_Part <> 0) OrElse
(CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso
DataToReadVariable.sValue = "1" AndAlso
nP_Prod <> 0 AndAlso
nP_Machgroup <> 0 AndAlso
nP_Part <> 0) Then
ElseIf nP_Prod <> 0 AndAlso
nP_Machgroup <> 0 AndAlso
nP_Part <> 0 Then
If nP_State = PartState.START Then
Map.refMachManaging.DebugMessage(1, "Leggo dati start")
Dim dtStart As DateTime = DateTime.Now()
' recupero gruppo di lavorazione del pezzo
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
@@ -725,9 +573,6 @@ Public Class MachManaging
Tpa.RWVariableManager.WriteVarByName(P_STATE, 0)
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
StateVariable.sValue = "0"
Case NCTypes.SIEMENS_SHARP7
Map.refMachManaging.DebugMessage(1, "Confermo lettura dati start")
DataReadedVariable.sValue = "1"
End Select
' se nessun pezzo della barra diverso da quello corrente e' in start
If Not MachGroup.PartVMList.Any(Function(x) x.nPartId <> nP_Part AndAlso x.nProduction_State = 1) Then
@@ -745,11 +590,9 @@ Public Class MachManaging
End If
' flag di aggiornamento log macchina
Map.refMachineLogPageVM.UpdateMachineLogList(False)
DebugMessage(1, "Fine lettura dati start")
' attesa per essere sicuro che abbia scritto e riletto variabili
Threading.Thread.Sleep(300)
ElseIf nP_State = PartState.END_ Then
DebugMessage(1, "Leggo dati end")
Dim dtEnd As DateTime = DateTime.Now()
' recupero gruppo di lavorazione del pezzo
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
@@ -809,16 +652,10 @@ Public Class MachManaging
' scrivo evento fine MachGroup su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(dtEnd, nP_Prod, nP_Machgroup, nP_State, DbControllers.SupervisorId))
' azzero tutte le variabilli per iniziare barra successiva
' azzero variabile per far ripartire macchina
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
DebugMessage(1, "Confermo lettura dati end")
DataReadedVariable.sValue = "1"
Else
ProdVariable.sValue = "0"
MachGroupVariable.sValue = "0"
PartVariable.sValue = "0"
StateVariable.sValue = "0"
End If
ProdVariable.sValue = "0"
MachGroupVariable.sValue = "0"
PartVariable.sValue = "0"
StateVariable.sValue = "0"
' se non impostata data start
If MachGroup.dtStartTime = DateTime.MinValue Then
@@ -846,11 +683,7 @@ Public Class MachManaging
End If
Else
' azzero variabile per far ripartire macchina
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
DataReadedVariable.sValue = "1"
Else
StateVariable.sValue = "0"
End If
StateVariable.sValue = "0"
End If
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
If nP_Part = -1 Then
@@ -868,17 +701,13 @@ Public Class MachManaging
End If
' flag di aggiornamento log macchina
Map.refMachineLogPageVM.UpdateMachineLogList(False)
DebugMessage(1, "Fine lettura dati end")
' attesa per essere sicuro che abbia scritto e riletto variabili
Threading.Thread.Sleep(300)
End If
End If
End Select
' funzione che riavvia comunicazione Siemens se necessario
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
Siemens_Sharp7.RefreshConnection()
End If
End Sub
Private m_Lock_SendProgram As New Object
@@ -921,28 +750,25 @@ Public Class MachManaging
If (CurrentMachine.NCType = NCTypes.TPA AndAlso Not m_bStartPending AndAlso Tpa.opState = MachineOperatingState.Pending) OrElse
(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM AndAlso Not Num_Flexium.bIsTransferActive) OrElse
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER AndAlso Not Num_Axium_APServer.bIsTransferActive) OrElse
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso Not Num_Axium_PCToolkit.bIsTransferActive) OrElse
CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then ' Or Tpa.opState = MachineOperatingState.Start) Then
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso Not Num_Axium_PCToolkit.bIsTransferActive) Then ' Or Tpa.opState = MachineOperatingState.Start) Then
' verifico se c'e' un programma da lanciare
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
' EgtOutLog("Start " & DateTime.Now())
Dim bMachGroupNotReady As Boolean = False
SyncLock m_Lock_SendProgram
For Each MyMachGroup As MyMachGroupVM In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList
DebugMessage(1, "Ciclo alla ricerca di un programma da mandare")
' EgtOutLog("Ciclo su name: " & MyMachGroup.Name & " id: " & MyMachGroup.Id)
If Not MyMachGroup.bSentToMachine AndAlso (If(CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7, MyMachGroup.dtStartTime = DateTime.MinValue, MyMachGroup.dtEndTime = DateTime.MinValue) OrElse
If Not MyMachGroup.bSentToMachine AndAlso (MyMachGroup.dtStartTime = DateTime.MinValue OrElse
(Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL AndAlso MyMachGroup.bResetWhileCutting)) Then
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " è da fare")
' verifico se ricalcolo finito
If MyMachGroup.bReadyForMachining AndAlso If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER OrElse CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT, Not MyMachGroup.bSendingToMachine, True) Then
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " pronto per essere lavorato")
' lo lancio
DebugMessage(1, "Eseguo SendProgram")
bSent = SendProgram(MyMachGroup.CnFilePath(), MyMachGroup.Name, MyMachGroup)
bSent = SendProgram(MyMachGroup.CnFilePath(), MyMachGroup.Name)
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " mandato " & DateTime.Now() & " " & MyMachGroup.Name & " " & bSent.ToString())
Select Case CurrentMachine.NCType
Case NCTypes.TPA, NCTypes.SIEMENS_SHARP7
Case NCTypes.TPA
MyMachGroup.SetSentToMachine(bSent)
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
MyMachGroup.SetSendingToMachine(bSent)
@@ -959,14 +785,6 @@ Public Class MachManaging
End If
Next
End SyncLock
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso Not Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State < ItemState.WIP And x.bReadyForMachining) Then
Dim ISONumVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_NUM)
Dim nISONum As Integer = 0
If Not Integer.TryParse(ISONumVariable.sValue, nISONum) Or nISONum <> 0 Then
DebugMessage(1, "Resetto programma da inviare")
ISONumVariable.sValue = 0
End If
End If
If bMachGroupNotReady Then Return False
' EgtOutLog("End " & DateTime.Now())
End If
@@ -1084,24 +902,6 @@ Public Class MachManaging
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
Return
End Try
Case NCTypes.SIEMENS_SHARP7
Try
m_CN = New SIEMENSSharp7Comm(Me)
If Siemens_Sharp7.InitConnection() Then
m_bConnected = True
' imposto stato manuale
Dim ManualMode As OPState = Map.refLeftPanelVM.OPModeList.FirstOrDefault(Function(x) x.Id = OPModes.Manual)
Map.refLeftPanelVM.SetOPMode(ManualMode)
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
Else
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
Return
End If
' creo classe di gestione variabili
Catch ex As Exception
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
Return
End Try
End Select
End Sub
@@ -1134,13 +934,6 @@ Public Class MachManaging
' chiudo classe Num_Flexium
Me.OnDispose()
'Num_Flexium.OnDispose()
Case NCTypes.SIEMENS_SHARP7
m_bConnected = False
Siemens_Sharp7.CloseConnection()
m_ResultCallbackDlg(CommandTypes.DISCONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
' chiudo classe Num_Flexium
Me.OnDispose()
'Num_Flexium.OnDispose()
End Select
' termino thread di comunicazione
MachineCommThread.StopThread()
@@ -1256,7 +1049,7 @@ Public Class MachManaging
End Select
End Sub
Public Function SendProgram(ProgramPath As String, ProgramId As String, Optional MyMachGroup As MyMachGroupVM = Nothing) As Boolean
Public Function SendProgram(ProgramPath As String, ProgramId As String) As Boolean
Select Case CurrentMachine.NCType
Case NCTypes.TPA
If Tpa.opState = MachineOperatingState.Pending Then
@@ -1287,31 +1080,6 @@ Public Class MachManaging
Num_Axium_PCToolkit.FileDownload(nFileType * 10, ProgramPath)
End If
Return True
Case NCTypes.SIEMENS_SHARP7
' EgtOutLog("Pre Download")
Dim nFileType As Integer = 0
If Integer.TryParse(ProgramId, nFileType) AndAlso nFileType > 0 Then
Dim sDestDir As String = ""
GetPrivateProfileString(S_GENERAL, K_ISOFILEDIR, "c:/Saomad/ISO", sDestDir, CurrentMachine.sMachIniFile)
DebugMessage(1, "Copio programma")
File.Copy(ProgramPath, sDestDir & "\" & nFileType & ".mpf", True)
' se primo dopo start
If m_bFirstRaw Then
m_bFirstRaw = False
DebugMessage(1, "Primo grezzo")
' annullo step di ripartenza
Map.refMachManaging.Siemens_Sharp7.ResetStep(Not (MyMachGroup.dtStartTime <> DateTime.MinValue OrElse MyMachGroup.nProduction_State = ItemState.WIP))
End If
' imposto larghezza barra
Dim WCarico As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = W_CARICO)
WCarico.sValue = DoubleToString(MyMachGroup.dW, 1)
DebugMessage(1, "Imposto larghezza: " & MyMachGroup.dW)
' imposto numero programma scritto
Dim ISONumVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_NUM)
DebugMessage(1, "Imposto programma inviato: " & nFileType)
ISONumVariable.sValue = nFileType
End If
Return True
End Select
Return False
End Function
@@ -1404,13 +1172,6 @@ Public Class MachManaging
Case CommVar.Types.CN
Num_Axium_PCToolkit.WriteNCVariables(Address, Value)
End Select
Case NCTypes.SIEMENS_SHARP7
Select Case Type
Case CommVar.Types.PLC
Siemens_Sharp7.WriteVariable(Address, Value)
'Case CommVar.Types.CN
' Num_Axium_PCToolkit.WriteNCVariables(Address, Value)
End Select
End Select
End Sub
@@ -1426,8 +1187,6 @@ Public Class MachManaging
Return NUMAxiumComm.InitVar(NewVar)
Case NCTypes.NUM_AXIUM_PCTOOLKIT
Return NUMAxiumPcToolkitComm.InitVar(NewVar)
Case NCTypes.SIEMENS_SHARP7
Return SIEMENSSharp7Comm.InitVar(NewVar)
End Select
Return Nothing
End Function
@@ -1520,14 +1279,4 @@ Public Class MachManaging
End Select
End Sub
#Region "Debug"
Friend Sub DebugMessage(nLevel As Integer, sMessage As String)
If m_Debug >= nLevel Then
EgtOutLog(sMessage)
End If
End Sub
#End Region ' Debug
End Class
@@ -21,7 +21,7 @@ Class MachineCommThread
Private Shared sResetVarName As String = "0.FUNM.E80048"
Public Shared Sub MachManagingThreadFunction(ResultCallbackDlg As ResultCallbackDlg, CloseCallbackDlg As CloseCallbackDlg, UpdateCallbackDlg As UpdateCallbackDlg,
TPAAlarmCallbackDlg As TPAAlarmCallbackDlg, NUMAlarmCallbackDlg As NUMAlarmCallbackDlg, SiemensAlarmCallbackDlg As SiemensAlarmCallbackDlg, AxisCoordinatesCallbackDlg As AxisCoordinatesCallbackDlg,
TPAAlarmCallbackDlg As TPAAlarmCallbackDlg, NUMAlarmCallbackDlg As NUMAlarmCallbackDlg, AxisCoordinatesCallbackDlg As AxisCoordinatesCallbackDlg,
OpStateCallbackDlg As OpStateCallbackDlg, OpModeCallbackDlg As OpModeCallbackDlg, ChannelCallbackDlg As ChannelCallbackDlg,
ReadVarCallbackDlg As ReadVarCallbackDlg)
' inizializzo callback
@@ -30,7 +30,6 @@ Class MachineCommThread
m_UpdateCallbackDlg = UpdateCallbackDlg
m_TPAAlarmCallbackDlg = TPAAlarmCallbackDlg
m_NUMAlarmCallbackDlg = NUMAlarmCallbackDlg
m_SiemensAlarmCallbackDlg = SiemensAlarmCallbackDlg
m_AxisCoordinatesCallbackDlg = AxisCoordinatesCallbackDlg
m_OpStateCallbackDlg = OpStateCallbackDlg
m_OpModeCallbackDlg = OpModeCallbackDlg
@@ -16,8 +16,7 @@
<Button Command="{Binding MachDbCommand}" ToolTip="{Binding MachiningDbToolTip}"
Style="{StaticResource ToolBar_TextButton}" Width="55" Content="{Binding MachiningDbMsg}"/>
<Button Command="{Binding SetUpCommand}" ToolTip="{Binding SetUpToolTip}"
Style="{StaticResource ToolBar_TextButton}" Width="55" Content="{Binding SetUpMsg}"
Background="{Binding SetUp_Background}"/>
Style="{StaticResource ToolBar_TextButton}" Width="55" Content="{Binding SetUpMsg}"/>
<!--<Button Command="{Binding MachOptionsCommand}" ToolTip="{Binding OptionsToolTip}">
<Image Source="/Resources/ProjectManager/Options.png" Height="22" />
</Button>-->
@@ -1,58 +1,50 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachinePanelVM
Inherits VMBase
Inherits EgtWPFLib5.MachinePanelVM
#Region "FIELDS & PROPERTIES"
' Radice del direttorio delle macchine
Private m_sMachinesRoot As String
' Lista delle macchine disponibili
Private m_MachineList As New ObservableCollection(Of Machine)
Public Property MachineList As ObservableCollection(Of Machine)
Get
Return m_MachineList
End Get
Set(value As ObservableCollection(Of Machine))
m_MachineList = value
End Set
End Property
' Macchina correntemente selezionata e quindi attiva
Private m_SelectedMachine As Machine = Nothing
Public Property SelectedMachine As MyMachine
Public Overrides Property SelectedMachine As Machine
Get
Return m_SelectedMachine
End Get
Set(value As MyMachine)
Set(value As Machine)
If value IsNot m_SelectedMachine Then
'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
'EgtResetCurrMachGroup()
' se sono in modalità disegno
m_SelectedMachine = value
' imposto macchina in DbGeometrico
If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) Then
m_SelectedMachine = value
End If
' Salvo impostazione macchina corrente
SaveCurrentMachine()
NotifyPropertyChanged(NameOf(SelectedMachine))
' inizializzo la macchina selezionata come macchina corrente
Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType
SectionXMaterial.SetType(nMachType)
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
If Not IsNothing(value) Then
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
Else
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, m_SelectedMachine.Name, nMachType)
End If
' mostro bottone tabella beam o wall a seconda del tipo
m_BeamTable_Visibility = If(nMachType = MachineType.BEAM OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
m_WallTable_Visibility = If(nMachType = MachineType.WALL OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(BeamTable_Visibility))
NotifyPropertyChanged(NameOf(WallTable_Visibility))
' aggiorno nome macchina in statusbar
Map.refMyStatusBarVM.RefreshMachName()
End If
End Set
End Property
Private m_SetUp_Background As Brush = New BrushConverter().ConvertFrom("#FFDDDDDD")
Public Property SetUp_Background As Brush
Get
Return m_SetUp_Background
End Get
Set(value As Brush)
m_SetUp_Background = value
NotifyPropertyChanged("SetUp_Background")
End Set
End Property
Private m_MachPanel_IsEnabled As Boolean = True
Public Property MachPanel_IsEnabled As Boolean
Get
@@ -60,10 +52,30 @@ Public Class MachinePanelVM
End Get
Set(value As Boolean)
m_MachPanel_IsEnabled = value
NotifyPropertyChanged("MachPanel_IsEnabled")
NotifyPropertyChanged(NameOf(MachPanel_IsEnabled))
End Set
End Property
Private m_BeamTable_Visibility As Visibility
Public ReadOnly Property BeamTable_Visibility As Visibility
Get
Return m_BeamTable_Visibility
End Get
End Property
Private m_WallTable_Visibility As Visibility
Public ReadOnly Property WallTable_Visibility As Visibility
Get
Return m_WallTable_Visibility
End Get
End Property
Public ReadOnly Property SetUp_Visibility As Visibility
Get
Return If(Map.refMainWindowVM.MainWindowM.bModifySetup, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
#Region "Messages"
Public ReadOnly Property ToolDBMsg As String
@@ -81,6 +93,11 @@ Public Class MachinePanelVM
Return EgtMsg(MSG_ALARMSPAGEUC + 33)
End Get
End Property
Public ReadOnly Property ParameterMachineMsg As String
Get
Return EgtMsg(61778)
End Get
End Property
#End Region ' Messages
@@ -88,27 +105,26 @@ Public Class MachinePanelVM
Public ReadOnly Property ToolDBToolTip As String
Get
Return "Tool DB"
Return EgtMsg(5003)
End Get
End Property
Public ReadOnly Property MachiningDbToolTip As String
Get
Return "Machining DB"
Return EgtMsg(5004)
End Get
End Property
Public ReadOnly Property SetUpToolTip As String
Get
Return "SetUp"
Return EgtMsg(31501)
End Get
End Property
#End Region ' ToolTip
' Definizione comandi
Private m_cmdToolDb As ICommand
Private m_cmdMachDb As ICommand
Private m_cmdSetUp As ICommand
Private m_cmdMachOptions As ICommand
Private m_cmdBeamTable As ICommand
Private m_cmdWallTable As ICommand
Private m_cmdParameterMachine As ICommand
#End Region 'FIELDS & PROPERTIES
@@ -131,7 +147,7 @@ Public Class MachinePanelVM
If MachineList.Count = 0 Then Return
Dim CurrMachine As Machine = Nothing
Dim CurrMachineName As String = String.Empty
GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, String.Empty, CurrMachineName)
GetMainPrivateProfileString(S_MACH, K_CURRMACH, String.Empty, CurrMachineName)
Dim bFound As Boolean = False
If Not String.IsNullOrEmpty(CurrMachineName) Then
For Each Mach In MachineList
@@ -170,28 +186,45 @@ Public Class MachinePanelVM
End If
End Sub
#End Region
Friend Function BeamMachDb() As Boolean
' Assegno le path
Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "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
' apro finestra di gestione lavorazioni travi
Dim sTitle = EgtMsg(9000) 'Tabelle delle lavorazioni delle travi
Dim BeamMchsWinVM As New MyBeamMachiningsWindowVM(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)
End If
Return True
End Function
#Region "COMMANDS"
Friend Function WallMachDb() As Boolean
' Assegno le path
Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "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
' apro finestra di gestione lavorazioni pareti
Dim sTitle = EgtMsg(9010) 'Tabelle delle lavorazioni delle pareti
Dim WallMchsWinVM As New MyBeamMachiningsWindowVM(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)
End If
Return True
End Function
#Region "ToolDbCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property ToolDbCommand As ICommand
Get
If m_cmdToolDb Is Nothing Then
m_cmdToolDb = New Command(AddressOf ToolDb)
End If
Return m_cmdToolDb
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub ToolDb(ByVal param As Object)
Public Overrides Sub ToolDb(ByVal param As Object)
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtTdbReload() Then
@@ -200,7 +233,7 @@ Public Class MachinePanelVM
Return
End If
Dim ToolDbWindowVM As New ToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
Dim ToolDbWindowVM As New EgtWPFLib5.ToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
Dim ToolDbWindowV As New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
If ToolDbWindowVM.MatType <> 0 Then
ToolDbWindowV.Height = 640
@@ -217,26 +250,7 @@ Public Class MachinePanelVM
End If
End Sub
#End Region ' ToolDbCommand
#Region "MachDbCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property MachDbCommand As ICommand
Get
If m_cmdMachDb Is Nothing Then
m_cmdMachDb = New Command(AddressOf MachDb)
End If
Return m_cmdMachDb
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub MachDb(ByVal param As Object)
Public Overrides Sub MachDb(ByVal param As Object)
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtMdbReload() Then
@@ -257,26 +271,7 @@ Public Class MachinePanelVM
End Sub
#End Region ' MachDbCommand
#Region "SetUpCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property SetUpCommand As ICommand
Get
If m_cmdSetUp Is Nothing Then
m_cmdSetUp = New Command(AddressOf SetUp)
End If
Return m_cmdSetUp
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub SetUp(ByVal param As Object)
Public Overrides Sub SetUp(ByVal param As Object)
' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then
EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
@@ -315,31 +310,410 @@ Public Class MachinePanelVM
End Sub
#End Region ' SetUpCommand
#End Region
#Region "MachOptionsCommand"
#Region "COMMANDS"
#Region "BeamTable"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property MachOptionsCommand As ICommand
Public ReadOnly Property BeamTable_Command As ICommand
Get
If m_cmdMachOptions Is Nothing Then
m_cmdMachOptions = New Command(AddressOf MachOptions)
If m_cmdBeamTable Is Nothing Then
m_cmdBeamTable = New Command(AddressOf BeamMachDb)
End If
Return m_cmdMachOptions
Return m_cmdBeamTable
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub MachOptions(ByVal param As Object)
#End Region ' BeamTable
#Region "WallTable"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property WallTable_Command As ICommand
Get
If m_cmdWallTable Is Nothing Then
m_cmdWallTable = New Command(AddressOf WallMachDb)
End If
Return m_cmdWallTable
End Get
End Property
#End Region ' WallTable
#Region "ParameterMachine"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property ParameterMachine_Command As ICommand
Get
If m_cmdParameterMachine Is Nothing Then
m_cmdParameterMachine = New Command(AddressOf ParameterMachineVisibility)
End If
Return m_cmdParameterMachine
End Get
End Property
Public Sub ParameterMachineVisibility()
Map.refConfigurationPageVM.MachineParameter_Visibility = Visibility.Visible
Map.refConfigurationPageVM.Machine_Visibility = Visibility.Visible
End Sub
#End Region ' MachOptionsCommand
#End Region ' ParameterMachine
#End Region ' COMMANDS
End Class
'Imports System.Collections.ObjectModel
'Imports System.IO
'Imports EgtBEAMWALL.Core
'Imports EgtUILib
'Imports EgtWPFLib5
'Public Class MachinePanelVM
' Inherits VMBase
'#Region "FIELDS & PROPERTIES"
' ' Radice del direttorio delle macchine
' Private m_sMachinesRoot As String
' ' Lista delle macchine disponibili
' Private m_MachineList As New ObservableCollection(Of Machine)
' Public Property MachineList As ObservableCollection(Of Machine)
' Get
' Return m_MachineList
' End Get
' Set(value As ObservableCollection(Of Machine))
' m_MachineList = value
' End Set
' End Property
' ' Macchina correntemente selezionata e quindi attiva
' Private m_SelectedMachine As Machine = Nothing
' Public Property SelectedMachine As MyMachine
' Get
' Return m_SelectedMachine
' End Get
' Set(value As MyMachine)
' If value IsNot m_SelectedMachine Then
' 'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
' 'EgtResetCurrMachGroup()
' ' se sono in modalità disegno
' m_SelectedMachine = value
' ' inizializzo la macchina selezionata come macchina corrente
' Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType
' SectionXMaterial.SetType(nMachType)
' InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
' End If
' End Set
' End Property
' Private m_SetUp_Background As Brush = New BrushConverter().ConvertFrom("#FFDDDDDD")
' Public Property SetUp_Background As Brush
' Get
' Return m_SetUp_Background
' End Get
' Set(value As Brush)
' m_SetUp_Background = value
' NotifyPropertyChanged("SetUp_Background")
' End Set
' End Property
' Private m_MachPanel_IsEnabled As Boolean = True
' Public Property MachPanel_IsEnabled As Boolean
' Get
' Return m_MachPanel_IsEnabled
' End Get
' Set(value As Boolean)
' m_MachPanel_IsEnabled = value
' NotifyPropertyChanged("MachPanel_IsEnabled")
' End Set
' End Property
'#Region "Messages"
' Public ReadOnly Property ToolDBMsg As String
' Get
' Return EgtMsg(MSG_MACHINEPAGEUC + 6)
' End Get
' End Property
' Public ReadOnly Property MachiningDbMsg As String
' Get
' Return EgtMsg(MSG_MACHINEPAGEUC + 7)
' End Get
' End Property
' Public ReadOnly Property SetUpMsg As String
' Get
' Return EgtMsg(MSG_ALARMSPAGEUC + 33)
' End Get
' End Property
'#End Region ' Messages
'#Region "ToolTip"
' Public ReadOnly Property ToolDBToolTip As String
' Get
' Return "Tool DB"
' End Get
' End Property
' Public ReadOnly Property MachiningDbToolTip As String
' Get
' Return "Machining DB"
' End Get
' End Property
' Public ReadOnly Property SetUpToolTip As String
' Get
' Return "SetUp"
' End Get
' End Property
'#End Region ' ToolTip
' ' Definizione comandi
' Private m_cmdToolDb As ICommand
' Private m_cmdMachDb As ICommand
' Private m_cmdSetUp As ICommand
' Private m_cmdMachOptions As ICommand
'#End Region 'FIELDS & PROPERTIES
'#Region "CONSTRUCTOR"
' Sub New()
' ' Creo riferimento a questa classe in Map
' Map.SetRefMachinePanelVM(Me)
' ' recupero cartella radice delle macchine
' m_sMachinesRoot = Map.refMainWindowVM.MainWindowM.sMachinesRoot
' ' Carica macchine da cartella delle macchine
' MyMachine.MachineListInit(m_sMachinesRoot, MachineList)
' End Sub
'#End Region ' CONSTRUCTOR
'#Region "METHODS"
' Friend Sub LoadCurrentMachine()
' If MachineList.Count = 0 Then Return
' Dim CurrMachine As Machine = Nothing
' Dim CurrMachineName As String = String.Empty
' GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, String.Empty, CurrMachineName)
' Dim bFound As Boolean = False
' If Not String.IsNullOrEmpty(CurrMachineName) Then
' For Each Mach In MachineList
' If Mach.Name = CurrMachineName Then
' bFound = True
' CurrMachine = Mach
' Exit For
' End If
' Next
' End If
' If Not bFound And MachineList.Count > 0 Then
' CurrMachine = MachineList(0)
' End If
' If Not IsNothing(CurrMachine) Then
' If EgtSetCurrMachine(CurrMachine.Name) Then
' SelectedMachine = CurrMachine
' End If
' End If
' End Sub
' Friend Sub SaveCurrentMachine()
' If IsNothing(m_SelectedMachine) Then Return
' WriteMainPrivateProfileString(S_MACH, K_CURRMACH, SelectedMachine.Name)
' End Sub
' Friend Sub UpdateCurrentMachine()
' 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
' Dim sMachName As String = String.Empty
' If EgtGetCurrMachineName(sMachName) Then
' For Each Mach In MachineList
' If Mach.Name = sMachName Then
' SelectedMachine = Mach
' Exit For
' End If
' Next
' End If
' End Sub
'#End Region
'#Region "COMMANDS"
'#Region "ToolDbCommand"
' ''' <summary>
' ''' Returns a command that do Exec.
' ''' </summary>
' Public ReadOnly Property ToolDbCommand As ICommand
' Get
' If m_cmdToolDb Is Nothing Then
' m_cmdToolDb = New Command(AddressOf ToolDb)
' End If
' Return m_cmdToolDb
' End Get
' End Property
' ''' <summary>
' ''' Execute the Exec. This method is invoked by the ExecCommand.
' ''' </summary>
' Public Sub ToolDb(ByVal param As Object)
' If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
' If Not EgtTdbReload() Then
' EgtOutLog("Impossible reloading tool Db")
' MessageBox.Show(EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
' Return
' End If
' Dim ToolDbWindowVM As New ToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
' Dim ToolDbWindowV As New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
' If ToolDbWindowVM.MatType <> 0 Then
' ToolDbWindowV.Height = 640
' ToolDbWindowV.Width = 1024
' ToolDbWindowV.ShowDialog()
' Else
' Exit Sub
' End If
' If Not SetUpUtility.IsValidToolHeadExitInSetUp() Then
' SetUp_Background = Brushes.Red
' Else
' SetUp_Background = OmagOFFICEDictionary.Button_Static_Background
' End If
' End Sub
'#End Region ' ToolDbCommand
'#Region "MachDbCommand"
' ''' <summary>
' ''' Returns a command that do Exec.
' ''' </summary>
' Public ReadOnly Property MachDbCommand As ICommand
' Get
' If m_cmdMachDb Is Nothing Then
' m_cmdMachDb = New Command(AddressOf MachDb)
' End If
' Return m_cmdMachDb
' End Get
' End Property
' ''' <summary>
' ''' Execute the Exec. This method is invoked by the ExecCommand.
' ''' </summary>
' Public Sub MachDb(ByVal param As Object)
' If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
' If Not EgtMdbReload() Then
' EgtOutLog("Impossible reloading machining Db")
' MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
' Return
' End If
' Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Stone")
' Dim MachDbWindowV As New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM)
' If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then
' MachDbWindowV.Height = 768
' MachDbWindowV.Width = 1024
' MachDbWindowV.ShowDialog()
' Else
' Exit Sub
' End If
' End Sub
'#End Region ' MachDbCommand
'#Region "SetUpCommand"
' ''' <summary>
' ''' Returns a command that do Exec.
' ''' </summary>
' Public ReadOnly Property SetUpCommand As ICommand
' Get
' If m_cmdSetUp Is Nothing Then
' m_cmdSetUp = New Command(AddressOf SetUp)
' End If
' Return m_cmdSetUp
' End Get
' End Property
' ''' <summary>
' ''' Execute the Exec. This method is invoked by the ExecCommand.
' ''' </summary>
' Public Sub SetUp(ByVal param As Object)
' ' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
' If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then
' EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
' MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
' Return
' End If
' ' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato,
' ' e testa e uscita dell'utensile attrezzato
' EgtLuaExecFile(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA)
' ' verifico che le teste riportate in configurazione esistano
' Dim Index As Integer = 1
' Dim nErr As Integer = 0
' While nErr = 0
' Dim sHead As String = String.Empty
' nErr = 999
' EgtLuaSetGlobIntVar("STU.INDEX", Index)
' EgtLuaCallFunction("STU.GetTcPosHeadGroupFromPos")
' ' Leggo variabili
' EgtLuaGetGlobStringVar("STU.HEAD", sHead)
' EgtLuaGetGlobIntVar("STU.ERR", nErr)
' If nErr = 0 Then
' If EgtGetHeadExitCount(sHead) = 0 Then
' MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
' Return
' End If
' End If
' Index += 1
' End While
' ' Reset lua
' EgtLuaResetGlobVar("STU")
' Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName))
' SetUpWindow.Height = 614
' SetUpWindow.Width = 1024
' SetUpWindow.ShowDialog()
' End Sub
'#End Region ' SetUpCommand
'#Region "MachOptionsCommand"
' ''' <summary>
' ''' Returns a command that do Exec.
' ''' </summary>
' Public ReadOnly Property MachOptionsCommand As ICommand
' Get
' If m_cmdMachOptions Is Nothing Then
' m_cmdMachOptions = New Command(AddressOf MachOptions)
' End If
' Return m_cmdMachOptions
' End Get
' End Property
' ''' <summary>
' ''' Execute the Exec. This method is invoked by the ExecCommand.
' ''' </summary>
' Public Sub MachOptions(ByVal param As Object)
' End Sub
'#End Region ' MachOptionsCommand
'#End Region ' COMMANDS
'End Class
+10 -4
View File
@@ -6,12 +6,18 @@
<!--Barra superiore dei comandi-->
<UniformGrid Rows="1">
<Button Content="{Binding OnlyProdPage_Msg}"
Command="{Binding OnlyProdPage_Command}"
Visibility="{Binding OnlyProdPage_Visibility}"
Style="{StaticResource MainMenu_Button}"/>
<Button Content="{Binding Viewer_Msg}"
Command="{Binding Viewer_Command}"
Style="{StaticResource MainMenu_Button}"/>
Command="{Binding Viewer_Command}"
Visibility="{Binding ViewerOptimizer_Visibility}"
Style="{StaticResource MainMenu_Button}"/>
<Button Content="{Binding Optimizer_Msg}"
Command="{Binding Optimizer_Command}"
Style="{StaticResource MainMenu_Button}"/>
Command="{Binding Optimizer_Command}"
Visibility="{Binding ViewerOptimizer_Visibility}"
Style="{StaticResource MainMenu_Button}"/>
<RadioButton Content="{Binding Supervisor_Msg}"
IsChecked="{Binding Supervisor_IsChecked}"
Style="{StaticResource MainMenu_ToggleButton}"/>
+56 -4
View File
@@ -1,5 +1,4 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtUILib
@@ -67,6 +66,18 @@ Public Class MainMenuVM
End Get
End Property
Public ReadOnly Property OnlyProdPage_Visibility As Visibility
Get
Return If(bOnlyProd, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property ViewerOptimizer_Visibility As Visibility
Get
Return If(bOnlyProd, Visibility.Collapsed, Visibility.Visible)
End Get
End Property
Private m_SelPage As Integer = -1
Public Property SelPage As Integer
Get
@@ -156,11 +167,18 @@ Public Class MainMenuVM
End Get
End Property
Public ReadOnly Property OnlyProdPage_Msg As String
Get
Return EgtMsg(61896)
End Get
End Property
#End Region ' Messages
' Definizione comandi
Private m_cmdViewer As ICommand
Private m_cmdOptimizer As ICommand
Private m_cmdOnlyProdPage As ICommand
#End Region ' Fields & Properties
@@ -176,7 +194,7 @@ Public Class MainMenuVM
#Region "METHODS"
Friend Sub SetInputOutputVisibility()
If CurrentMachine.NCType = NCTypes.TPA OrElse CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
If CurrentMachine.NCType = NCTypes.TPA Then
m_Inputs_Visibility = Visibility.Collapsed
m_Outputs_Visibility = Visibility.Collapsed
End If
@@ -375,7 +393,41 @@ Public Class MainMenuVM
End If
End Sub
#End Region ' Optimizer
#End Region ' OnlyProdPage
#Region "OnlyProdPage"
Public ReadOnly Property OnlyProdPage_Command As ICommand
Get
If m_cmdOnlyProdPage Is Nothing Then
m_cmdOnlyProdPage = New Command(AddressOf OnlyProdPage)
End If
Return m_cmdOnlyProdPage
End Get
End Property
Public Sub OnlyProdPage()
Dim sViewerOptimizerName As String = "EgtBEAMWALL.ViewerOptimizerR32"
' recupero processo del supervisore
Dim localProc As Process() = Process.GetProcessesByName(sViewerOptimizerName)
If localProc.Length > 0 Then
For Each p As Process In localProc
' porto in primo piano il ViewerOptimizer
BringWindowToFront(p.MainWindowHandle)
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, -Pages.ONLYPRODPAGE, StatusMapItemType.Comm, StatusMapOpType.OpenPageInViewOptimRequest, "")
Exit For
Next
Else
Dim sViewerOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sViewerOptimizerName & ".exe"
Try
Process.Start(sViewerOptimizerPath, "2 " & Pages.ONLYPRODPAGE)
Catch ex As Exception
EgtOutLog("Error: impossible starting vieweroptimizer from path " & sViewerOptimizerPath)
End Try
End If
End Sub
#End Region ' OnlyProdPage
#End Region ' COMMANDS
@@ -170,6 +170,20 @@ Public Class MainWindowM
End Get
End Property
Private m_bOnlyProd As Boolean = False
Friend ReadOnly Property bOnlyProd As Boolean
Get
Return m_bOnlyProd
End Get
End Property
Private m_bModifySetup As Boolean = False
Friend ReadOnly Property bModifySetup As Boolean
Get
Return m_bModifySetup
End Get
End Property
#End Region ' FIELDS
#Region "CONSTRUCTOR"
@@ -248,8 +262,8 @@ Public Class MainWindowM
EgtSetLockId( sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2701, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2701, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2512, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2512, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -301,9 +315,17 @@ Public Class MainWindowM
Dim sLuaLibsDir As String = String.Empty
GetMainPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
EgtSetLuaLibs(sLuaLibsDir)
' Recupero flag OnlyProd
m_bOnlyProd = GetMainPrivateProfileInt(S_GENERAL, K_ONLYPROD, 0) = 1
' e lo imposto nel core
Core.Configuration.SetOnlyProd(m_bOnlyProd)
Dim sLuaBaseLib As String = String.Empty
GetMainPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
EgtLuaRequire(sLuaBaseLib)
' Recupero flag ModifySetup
m_bModifySetup = GetMainPrivateProfileInt(S_GENERAL, K_MODIFYSETUP, 0) = 1
' e lo imposto nel core
Core.Configuration.SetModifySetup(m_bModifySetup)
' verifico se stampante attiva
Dim sPrinterLink As String = ""
Dim nPrinterLink As Integer = 0
@@ -107,8 +107,14 @@ Public Class MainWindowVM
' leggo riga di comando
Dim nCommandType As Integer = 0
Dim nPage As Pages = Pages.VIEW
Dim nPage As Pages = Nothing
Dim nProdId As Integer = 0
If Map.refMainWindowVM.MainWindowM.bOnlyProd Then
nPage = Pages.ONLYPRODPAGE
Else
nPage = Pages.VIEW
End If
If ProcessCommandLine(nCommandType, nProdId) AndAlso nCommandType = 1 Then
Map.refSupervisorManagerVM.SetCurrProd(nProdId)
Else
@@ -229,7 +235,7 @@ Public Class MainWindowVM
Public Sub CloseApplication()
' se macchina sta funzionando
If Not IsNothing(Map.refMachManaging) AndAlso Map.refMachManaging.bConnected AndAlso
(If(Not IsNothing(Map.refLeftPanelVM.SelOPState), Map.refLeftPanelVM.SelOPState.Id <> OPStates.End AndAlso Map.refLeftPanelVM.SelOPState.Id <> OPStates.Unspecified, True)) Then
(Map.refLeftPanelVM.SelOPState.Id <> OPStates.End AndAlso Map.refLeftPanelVM.SelOPState.Id <> OPStates.Unspecified) Then
MessageBox.Show("Impossible closing software while machine is working. If you want to close, first press reset and stop the machine!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
@@ -30,7 +30,7 @@ Imports System.Windows
#End if
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgtBEAMWALL.Supervisor")>
<Assembly: AssemblyCopyright("Copyright © 2020-2025 by Egalware s.r.l.")>
<Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.7.1.2")>
<Assembly: AssemblyFileVersion("2.7.1.2")>
<Assembly: AssemblyVersion("2.5.12.2")>
<Assembly: AssemblyFileVersion("2.5.12.2")>
@@ -11,13 +11,14 @@ Public Class OpenProjectFileDialogVM
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
m_ProjectType = ProjectType
m_GoToProd = GoToProd
' carico colonne
LoadColumns(m_ProjectType)
NotifyPropertyChanged(NameOf(FilterTypeList))
m_SelFilterType = m_FilterTypeList(0)
' carico lista progetti
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
RefreshProjectList(GoToProd)
RefreshProjectList()
Else
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
NotifyPropertyChanged(NameOf(ProjectList))
@@ -26,7 +27,7 @@ Public Class OpenProjectFileDialogVM
m_ProjectList_View.Filter = AddressOf ProjectFilter
End Function
Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False)
Public Overrides Sub RefreshProjectList()
m_ProjectList.Clear()
' calcolo periodo e righe
Dim dtStart As DateTime
+3 -3
View File
@@ -2,13 +2,13 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor">
<EgtFloating:EgtFloatingTray x:Name="PROJECTTOPTRAY" DockPanel.Dock="Top">
<EgtBEAMWALL:SupervisorManagerV DataContext="{StaticResource SupervisorManagerVM}"/>
<EgtBEAMWALL:MachinePanelV DataContext="{StaticResource MachinePanelVM}"
Visibility="Collapsed"/>
<EgtBEAMWALLCORE:MachinePanelV DataContext="{StaticResource MachinePanelVM}"
Visibility="Collapsed"/>
</EgtFloating:EgtFloatingTray>
<Grid>
+8 -8
View File
@@ -174,14 +174,14 @@ Public Class ProjectVM
End Sub
Friend Sub NotifyAllPanelVisibility()
NotifyPropertyChanged("LeftPanel_Visibility")
NotifyPropertyChanged("TopPanel_Visibility")
NotifyPropertyChanged("BottomPanel_Visibility")
NotifyPropertyChanged("PartManager_Visibility")
NotifyPropertyChanged("FeatureManager_Visibility")
NotifyPropertyChanged("ShowBeamPanel_Visibility")
NotifyPropertyChanged("ProjManager_Visibility")
NotifyPropertyChanged("ProdManager_Visibility")
NotifyPropertyChanged(NameOf(LeftPanel_Visibility))
NotifyPropertyChanged(NameOf(TopPanel_Visibility))
NotifyPropertyChanged(NameOf(BottomPanel_Visibility))
NotifyPropertyChanged(NameOf(PartManager_Visibility))
NotifyPropertyChanged(NameOf(FeatureManager_Visibility))
NotifyPropertyChanged(NameOf(ShowBeamPanel_Visibility))
NotifyPropertyChanged(NameOf(ProjManager_Visibility))
NotifyPropertyChanged(NameOf(ProdManager_Visibility))
End Sub
#End Region ' FIELDS & PROPERTIES
Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

@@ -58,12 +58,6 @@ Public Class MySceneHostVM
Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
EgtSetMainWindowHandle(hMainWnd)
EgtSetCurrentContext(MainScene.GetCtx())
' Imposto direttorio ausiliario per import/gestione BTL
Dim sBtlAuxDir As String = String.Empty
GetMainPrivateProfileString(S_IMPORT, K_BTLAUXDIR, "", sBtlAuxDir)
If Not EgtSetBtlAuxDir(sBtlAuxDir) Then
EgtOutLog("Missing BtlAuxDir path! Will be impossible to load Variant!")
End If
' inizializzo gestore travi e pareti
EgtInitBeamMgr(EIB_FL.TS3_POS + EIB_FL.USEUATTR)
' inizializzo gestore lavorazioni
@@ -87,15 +87,14 @@ Public Class SupervisorManagerVM
End Property
Public ReadOnly Property GoToProd_ToolTip As String
Get
Return EgtMsg(61835)
Return If(refMainWindowVM.MainWindowM.bOnlyProd, EgtMsg(61800), EgtMsg(61835))
End Get
End Property
#End Region ' ToolTip
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
@@ -372,13 +371,22 @@ Public Class SupervisorManagerVM
Else
Dim sOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sOptimizerName & ".exe"
Try
Process.Start(sOptimizerPath, "1 " & CurrProd.nProdId)
If bOnlyProd Then
Process.Start(sOptimizerPath, "2 " & Pages.ONLYPRODPAGE)
Else
Process.Start(sOptimizerPath, "1 " & CurrProd.nProdId)
End If
Catch ex As Exception
EgtOutLog("Error: impossible starting optimizer from path " & sOptimizerPath)
End Try
End If
' mando richiesta di apertura progetto in ottimizzatore
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refSupervisorManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInProdRequest, "")
If bOnlyProd Then
' mando richiesta di apertura progetto in progettazione
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refSupervisorManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInOnlyProdRequest, "")
Else
' mando richiesta di apertura progetto in ottimizzatore
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refSupervisorManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInProdRequest, "")
End If
End Sub
#End Region ' GoToProd
@@ -28,9 +28,15 @@ Public Module CurrentMachine
Private m_sMachIniFile As String = String.Empty
' File ini dei parametri macchina
Private m_sMachParamIniFile As String = String.Empty
' File lettura Ts3Data
Private m_sGetTs3DataFile As String = String.Empty
' File Ts3Data
Private m_sTs3DataFile As String = String.Empty
' Cartella degli script
Private m_sMachScriptDir As String = String.Empty
' Ffile dei messaggi macchina
' Cartella dei setup
Private m_sMachSetupDir As String = String.Empty
' File dei messaggi macchina
Private m_sMachMessagesFile As String = String.Empty
' Tipo macchina
@@ -45,12 +51,6 @@ Public Module CurrentMachine
End Get
End Property
Friend ReadOnly Property nType As MachineType
Get
Return m_nType
End Get
End Property
' tipo di CN della macchina
Private m_NCType As NCTypes = NCTypes.NULL
Public ReadOnly Property NCType As Integer
@@ -92,17 +92,41 @@ Public Module CurrentMachine
End Get
End Property
Friend ReadOnly Property sTs3DataFile As String
Get
Return m_sTs3DataFile
End Get
End Property
Friend ReadOnly Property sMachScriptDir As String
Get
Return m_sMachScriptDir
End Get
End Property
Friend ReadOnly Property sMachSetupDir As String
Get
Return m_sMachSetupDir
End Get
End Property
#End Region
'Private m_MachTableList As New ObservableCollection(Of MachTable)
'Public Property MachTableList As ObservableCollection(Of MachTable)
' Get
' Return m_MachTableList
' End Get
' Set(value As ObservableCollection(Of MachTable))
' m_MachTableList = value
' End Set
'End Property
Friend ReadOnly Property nType As MachineType
Get
Return m_nType
End Get
End Property
Private m_MachTableList As New ObservableCollection(Of MachTable)
Public Property MachTableList As ObservableCollection(Of MachTable)
Get
Return m_MachTableList
End Get
Set(value As ObservableCollection(Of MachTable))
m_MachTableList = value
End Set
End Property
#Region "Init"
@@ -138,21 +162,30 @@ Public Module CurrentMachine
' Impostazione path MachParamIni file
If nType = MachineType.BEAM Then
m_sMachParamIniFile = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & MACH_INI_FILE_NAME
m_sGetTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & GETTS3DATA_FILE_NAME
m_sTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & TS3DATA_FILE
ElseIf nType = MachineType.WALL Then
m_sMachParamIniFile = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & MACH_INI_FILE_NAME
m_sGetTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & GETTS3DATA_FILE_NAME
m_sTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & TS3DATA_FILE
Else
' Se macchina di tipo BOTH prendo quello presente in Beam, se esiste, altrimenti prendo quello in Wall
Dim sBeamMachParamIniFile = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & MACH_INI_FILE_NAME
Dim sWallMachParamIniFile = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & MACH_INI_FILE_NAME
Dim sBeamGetTs3File = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & GETTS3DATA_FILE_NAME
Dim sWallGetTs3File = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & GETTS3DATA_FILE_NAME
Dim sBeamTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & TS3DATA_FILE
Dim sWallTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & TS3DATA_FILE
If nType = MachineType.BOTH Then
m_sMachParamIniFile = If(File.Exists(sBeamMachParamIniFile), sBeamMachParamIniFile, sWallMachParamIniFile)
m_sGetTs3DataFile = If(File.Exists(sBeamGetTs3File), sBeamGetTs3File, sWallGetTs3File)
m_sTs3DataFile = If(File.Exists(sBeamTs3DataFile), sBeamTs3DataFile, sWallTs3DataFile)
End If
End If
' leggo tipo di avanzamento pezzi
m_Flow = GetPrivateProfileInt(S_GENERAL, K_FLOW, 1, m_sMachIniFile)
' Impostazione path Script dir
m_sMachScriptDir = sMachinesRootDir & "\" & sMachineName & "\" & K_SCRIPT
' Impostazione path Setup dir
m_sMachSetupDir = sMachinesRootDir & "\" & sMachineName & "\" & K_SETUP
' crea l'elenco dei parametri della macchina corrente
CreateMachParams()
@@ -165,8 +198,9 @@ Public Module CurrentMachine
' imposto visibilita' input output
Map.refMainMenuVM.SetInputOutputVisibility()
' leggo parametri macchina da WallData
If nType = MachineType.BEAM Then
' leggo parametri macchina da BeamData
If nType = MachineType.BEAM OrElse nType = MachineType.BOTH Then
' Assegno i dati
EgtLuaCreateGlobTable("GWD")
EgtLuaSetGlobStringVar("GWD.BASEDIR", Map.refMainWindowVM.MainWindowM.sBeamRoot)
@@ -185,7 +219,7 @@ Public Module CurrentMachine
EgtOutLog("Error executing GetBeamData script " & sExecPath)
End If
If bOk Then
Dim nTemp As Integer
Dim nTemp As Integer = 0
EgtLuaGetGlobIntVar("GWD.SIMUL_VIEW_DIR", nTemp)
Select Case nTemp
Case 0
@@ -207,7 +241,7 @@ Public Module CurrentMachine
' aggiorno parametro in gestore viste
Core.ViewPanelVM.UpdateMachParam(m_nViewDir)
End If
If nType = MachineType.WALL Then
If nType = MachineType.WALL OrElse nType = MachineType.BOTH Then
' Assegno i dati
EgtLuaCreateGlobTable("GWD")
EgtLuaSetGlobStringVar("GWD.BASEDIR", Map.refMainWindowVM.MainWindowM.sWallRoot)
@@ -226,9 +260,11 @@ Public Module CurrentMachine
EgtOutLog("Error executing GetWallData script " & sExecPath)
End If
If bOk Then
Dim nTemp As Integer
Dim nTemp As Integer = 0
EgtLuaGetGlobIntVar("GWD.SIMUL_VIEW_DIR", nTemp)
Select Case nTemp
Case 0
m_nViewDir = VT.ISO_SW
Case 1
m_nViewDir = VT.ISO_NW
Case 2
@@ -268,8 +304,6 @@ Public Module CurrentMachine
Map.refLeftPanelVM.LoadOPModes()
' Imposto visibilità variabili E80000
Map.refLeftPanelVM.SetE80000Visibility()
' Imposto visibilita' assi
Map.refLeftPanelVM.SetAxisVisibility()
End Sub
#End Region 'Init
@@ -278,25 +312,41 @@ Public Module CurrentMachine
' funzione che crea l'elenco dei parametri Macchina
Friend Sub CreateMachParams()
'MachTableList.Clear()
'Dim NewMachParam As MachParam = Nothing
'Dim MachParamList As New ObservableCollection(Of MachParam)
'Dim TableIndex = 1
'Dim ParamIndex As Integer = 1
'Dim TableName As String = String.Empty
'' verifico che ci sia una table con l'indice designato e ne leggo il nome
'While GetMachPrivateProfileString(TableIndex, K_NAME, "", TableName)
' ' leggo tutti i parametri della table
' While MachParamIniFile.GetMachPrivateProfileParam(TableIndex, ParamIndex, NewMachParam)
' MachParamList.Add(NewMachParam)
' ParamIndex += 1
' End While
' MachTableList.Add(New MachTable(TableName, MachParamList))
' ' aggiorno indici e resetto lista per lettura dell'eventuale table successiva
' TableIndex += 1
' ParamIndex = 1
' MachParamList = New ObservableCollection(Of MachParam)
'End While
MachTableList.Clear()
If String.IsNullOrWhiteSpace(m_sMachParamIniFile) OrElse Not File.Exists(m_sMachParamIniFile) Then
EgtOutLog("Impossible loading Mach parameters: MachData.ini file not found or not readable")
Return
End If
Dim NewMachParam As MachParam = Nothing
Dim MachParamList As New ObservableCollection(Of MachParam)
Dim TableIndex = 1
Dim ParamIndex As Integer = 1
Dim TableName As String = String.Empty
' carico lua ts3data
Dim bTs3DataLoaded As Boolean = False
EgtLuaCreateGlobTable("GTSD")
EgtLuaSetGlobStringVar("GTSD.TS3PATH", m_sTs3DataFile)
Dim sExecPath As String = m_sGetTs3DataFile
bTs3DataLoaded = File.Exists(m_sTs3DataFile) AndAlso EgtLuaExecFile(sExecPath)
If Not bTs3DataLoaded Then
EgtOutLog("Error executing Ts3Data file " & m_sTs3DataFile)
End If
' verifico che ci sia una table con l'indice designato e ne leggo il nome
While GetMachPrivateProfileString(TableIndex, K_NAME, "", TableName)
' leggo tutti i parametri della table
While MachParamIniFile.GetMachPrivateProfileParam(TableIndex, ParamIndex, NewMachParam, TableName, bTs3DataLoaded)
MachParamList.Add(NewMachParam)
ParamIndex += 1
End While
MachTableList.Add(New MachTable(TableName, MachParamList))
' aggiorno indici e resetto lista per lettura dell'eventuale table successiva
TableIndex += 1
ParamIndex = 1
MachParamList = New ObservableCollection(Of MachParam)
End While
' Cancello tavola globale
EgtLuaResetGlobVar("GTSD")
End Sub
Public Function MachMsg(Paragraph As MsgParagraphs, nId As Integer) As String
+58 -4
View File
@@ -159,8 +159,18 @@
<Setter Property="Width" Value="80"/>
</Style>
<Style x:Key="OptionPanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
<Setter Property="Height" Value="25"/>
<Setter Property="Width" Value="25"/>
<Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style x:Key="MachinePanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="50"/>
<Setter Property="Width" Value="50"/>
<Setter Property="Margin" Value="50"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
</Style>
<Style x:Key="OptionPanel_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
@@ -268,8 +278,8 @@
<Setter Property="Background" Value="{StaticResource Omag_White}"/>
<Setter Property="Foreground" Value="{StaticResource Omag_DarkGray}"/>
<Setter Property="TextBlock.FontWeight" Value="Normal"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="90"/>
<!--<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="90"/>-->
<Style.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter Property="TextBlock.FontWeight" Value="ExtraBold"/>
@@ -353,6 +363,12 @@
<Setter Property="Margin" Value="2.5,0,2.5,0"/>
</Style>
<Style x:Key="MachParamTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5,0,5,0"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- TextBox -->
@@ -748,4 +764,42 @@
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- TabControl that have only Headers and no Pages -->
<Style x:Key="TabControl_OnlyHeaders" TargetType="{x:Type TabControl}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TabPanel Name="HeaderPanel"
Grid.Row="0"
Panel.ZIndex="1"
Margin="0,0,4,-1"
IsItemsHost="True"
KeyboardNavigation.TabIndex="1"
Background="Transparent" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<Style x:Key="ToolBar_ParameterMachineButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="120"/>
</Style>
</ResourceDictionary>
@@ -0,0 +1,70 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Friend Module MachParamIniFile
Public Function GetMachPrivateProfileParam(IpParentTable As Integer, IpMachParamIndex As String, ByRef IpMachParam As MachParam, TableName As String, bTs3dataLoaded As Boolean) As Boolean
Dim sMachParam As String = String.Empty
If EgtUILib.GetPrivateProfileString(IpParentTable, IpMachParamIndex, String.Empty, sMachParam, sMachParamIniFile) > 0 Then
Dim sMachParamParams() As String = sMachParam.Split(","c)
' verifico numero minimo di parametri
If sMachParamParams.Count >= 4 Then
' cancello spazi
For Index = 0 To sMachParamParams.Count - 1
sMachParamParams(Index) = sMachParamParams(Index).Trim()
Next
' creo parametro
If sMachParamParams(0) = "d" OrElse sMachParamParams(0) = "l" Then
Dim dDefault As Double
StringToDoubleAdv(sMachParamParams(2), dDefault)
Dim ParamType As MachParamType
If sMachParamParams(0) = "d" Then
ParamType = MachParamType.DOUBLE_
Else
ParamType = MachParamType.LENGTH
End If
If bTs3dataLoaded Then
Dim dTs3DataValue As Double
If EgtLuaGetGlobNumVar(TableName & "." & sMachParamParams(1), dTs3DataValue) Then
dDefault = dTs3DataValue
End If
End If
IpMachParam = New MachParam(IpParentTable, IpMachParamIndex, ParamType, sMachParamParams(1), dDefault, sMachParamParams(3))
Return Not IsNothing(IpMachParam)
ElseIf sMachParamParams(0) = "s" Then
IpMachParam = New MachParam(IpParentTable, IpMachParamIndex, MachParamType.STRING_, sMachParamParams(1), sMachParamParams(3))
Return Not IsNothing(IpMachParam)
End If
End If
End If
Return False
End Function
Public Function GetMachPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
Return EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, sMachParamIniFile)
End Function
Public Function GetMachPrivateProfileParamValue(IpParentTable As Integer, IpMachParamIndex As String, ByRef IpMachParamValue As String) As Boolean
Dim sMachParam As String = String.Empty
If EgtUILib.GetPrivateProfileString(IpParentTable, IpMachParamIndex, String.Empty, sMachParam, sMachParamIniFile) > 0 Then
Dim sMachParamParams() As String = sMachParam.Split(","c)
' verifico numero minimo di parametri
If sMachParamParams.Count >= 4 Then
' cancello spazi
For Index = 0 To sMachParamParams.Count - 1
sMachParamParams(Index) = sMachParamParams(Index).Trim()
Next
'restituisco il valore del parametro
IpMachParamValue = sMachParamParams(2)
Return Not IsNothing(IpMachParamValue)
End If
End If
Return False
End Function
Public Function WriteMachPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, IpString, sMachParamIniFile)
End Function
End Module
+6 -6
View File
@@ -6,12 +6,12 @@
</configSections>
<entityFramework>
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</provider>
</providers>
</entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</provider>
</providers>
</entityFramework>
<connectionStrings>
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=root;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
@@ -1,8 +1,8 @@
<Window x:Class="AboutBoxV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="AboutBox" Height="400" Width="360" WindowStyle="None" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="AboutBox" Height="400" Width="360" WindowStyle="None" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
<Border BorderThickness="2" BorderBrush="LightBlue">
<Grid >
@@ -35,15 +35,15 @@
</Border>
</Grid>
<TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18" />
VerticalAlignment="Center" FontSize="18" />
<TextBlock Name="VersionLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="12" />
VerticalAlignment="Center" FontSize="12" />
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="8" IsCancel="True"
Margin="100,0"/>
Margin="100,0"/>
</Grid>
@@ -27,7 +27,6 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid HorizontalAlignment="Center"
Grid.Row="0"
Margin="0,0,0,5">
@@ -46,13 +45,14 @@
Grid.Column="1"
DisplayMemberPath="ghDesc"
Width="200"
HorizontalAlignment="Left"
Style="{StaticResource FeatureComboBox}"/>
<TextBlock Text="Macro"
Grid.Row="1"
Margin="0,5,0,0"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox ItemsSource="{Binding MacroList}"
SelectedIndex="{Binding nSelMacro}"
<ComboBox ItemsSource="{Binding MacroCustomList}"
SelectedIndex="{Binding nSelMacroCustom}"
Grid.Row="1"
Grid.Column="1"
DisplayMemberPath="Name"
@@ -66,7 +66,6 @@
Height="300"
Width="300"
Margin="5,0,5,5"/>
<!--<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
Grid.Row="2"
@@ -84,7 +83,6 @@
<TextBlock Text="{Binding sName}"
Style="{StaticResource OptionTextBlock}"/>
</StackPanel>-->
<Grid Grid.Row="2" Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
@@ -94,18 +92,16 @@
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsDefault="True"
Grid.Column="1"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
Command="{Binding Ok_Command}"
IsDefault="True"
Grid.Column="1"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="Cancel"
IsCancel="True"
Grid.Column="3"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
IsCancel="True"
Grid.Column="3"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</Grid>
</Border>
</StackPanel>
</EgtWPFLib5:EgtCustomWindow>
@@ -11,6 +11,7 @@ Public Class AddFeatureWndVM
Friend Event m_CloseWindow(bDialogResult As Boolean)
Friend m_MacroFilePathList As List(Of String)
Friend m_MacroCustomFilePathList As List(Of String)
Private m_PrevSelPRCIndex_L As Integer = 0
Private m_PrevSelPRCIndex_T As Integer = 0
@@ -37,8 +38,8 @@ Public Class AddFeatureWndVM
ElseIf m_SelGRPType = GRPType.T Then
nSelPRC = PRCList(m_PrevSelPRCIndex_T)
End If
NotifyPropertyChanged("PRCList")
NotifyPropertyChanged("nSelPRC")
NotifyPropertyChanged(NameOf(PRCList))
NotifyPropertyChanged(NameOf(nSelPRC))
End Set
End Property
@@ -49,6 +50,36 @@ Public Class AddFeatureWndVM
End Get
End Property
Private m_PRCListView As New List(Of PRC)
Public ReadOnly Property PRCListView As List(Of PRC)
Get
Return m_PRCListView
End Get
End Property
#Region "New Macro OnlyProdPage"
Private m_MacroDefaultList As New ObservableCollection(Of Object)
Public ReadOnly Property MacroDefaultList As ObservableCollection(Of Object)
Get
Return m_MacroDefaultList
End Get
End Property
Private m_nSelMacroDefault As Integer = -1
Public Property nSelMacroDefault As Integer
Get
Return m_nSelMacroDefault
End Get
Set(value As Integer)
If value <> m_nSelMacroDefault Then
m_nSelMacroDefault = value
End If
End Set
End Property
#End Region ' New Macro OnlyProdPage
Private m_nSelPRC As PRC = Nothing
Public Property nSelPRC As PRC
Get
@@ -64,47 +95,31 @@ Public Class AddFeatureWndVM
m_PrevSelPRCIndex_T = PRCList.IndexOf(m_nSelPRC)
End If
End If
NotifyPropertyChanged("sDrawPath")
NotifyPropertyChanged(NameOf(sDrawPath))
' carico eventuali file Macro
MacroList.Clear()
MacroCustomList.Clear()
If Core.Configuration.bOnlyProd Then
MacroDefaultList.Clear()
End If
m_MacroFilePathList = New List(Of String)
m_MacroCustomFilePathList = New List(Of String)
If Not IsNothing(nSelPRC) Then
Dim nGRPFromFileName As Integer = 0
Dim nPRCFromFileName As Integer = 0
Dim sMacroNameFromFileName As String = String.Empty
Dim nIdMacroName As Integer = 0
' ricavo lista file Macro
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroDir)
For Each File In AllFilesInDir
If Path.GetExtension(File).ToLower() = ".lua" Then
If File.Contains(FILENAMESEPARATOR) Then
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
If DataFromFileName.Count = 2 Then
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
End If
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
sMacroNameFromFileName = DataFromFileName(1)
End If
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
MacroList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
m_MacroFilePathList.Add(File)
nIdMacroName = nIdMacroName + 1
End If
End If
End If
End If
Next
If MacroList.Count > 0 Then
' ricavo lista file Macro Default
GetMacroListDefault(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
' ricavo lista file Macro Custom
If Core.Configuration.bOnlyProd Then GetMacroListCustom(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
If MacroCustomList.Count > 0 Then
MacroList_IsEnabled = True
Else
MacroList_IsEnabled = False
End If
End If
End If
NotifyPropertyChanged(NameOf(nSelPRC))
End Set
End Property
@@ -116,26 +131,26 @@ Public Class AddFeatureWndVM
Set(value As Boolean)
If value <> m_MacroList_IsEnabled Then
m_MacroList_IsEnabled = value
NotifyPropertyChanged("MacroList_IsEnabled")
NotifyPropertyChanged(NameOf(MacroList_IsEnabled))
End If
End Set
End Property
Private m_MacroList As New ObservableCollection(Of Object)
Public ReadOnly Property MacroList As ObservableCollection(Of Object)
Private m_MacroCustomList As New ObservableCollection(Of Object)
Public ReadOnly Property MacroCustomList As ObservableCollection(Of Object)
Get
Return m_MacroList
Return m_MacroCustomList
End Get
End Property
Private m_nSelMacro As Integer = -1
Public Property nSelMacro As Integer
Private m_nSelMacroCustom As Integer = -1
Public Property nSelMacroCustom As Integer
Get
Return m_nSelMacro
Return m_nSelMacroCustom
End Get
Set(value As Integer)
If value <> m_nSelMacro Then
m_nSelMacro = value
If value <> m_nSelMacroCustom Then
m_nSelMacroCustom = value
End If
End Set
End Property
@@ -157,17 +172,133 @@ Public Class AddFeatureWndVM
' Definizione comandi
Private m_cmdOk As ICommand
#Region "Messages"
Public ReadOnly Property Process_Msg As String
Get
Return EgtMsg(61805).ToUpper()
End Get
End Property
Public ReadOnly Property Default_Msg As String
Get
Return EgtMsg(61899).ToUpper()
End Get
End Property
Public ReadOnly Property Custom_Msg As String
Get
Return EgtMsg(61801).ToUpper()
End Get
End Property
#End Region
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
SelGRPType = 0
nSelPRC = PRCList(0)
If Core.Configuration.bOnlyProd Then
' carico lista process
Dim TempPRCList As New ObservableCollection(Of Integer)
Dim TempPRCLList As New ObservableCollection(Of Integer)
Dim TempPRCLTist As New ObservableCollection(Of Integer)
GetBeamPrivateProfileProcessList(0, TempPRCLList)
GetBeamPrivateProfileProcessList(1, TempPRCLTist)
' riporto le liste process in un unica lista
For Each PRCL In TempPRCLList
TempPRCList.Add(PRCL)
Next
For Each PRCT In TempPRCLTist
TempPRCList.Add(PRCT)
Next
m_PRCList.Clear()
' ciclo sulla lista process eliminado i doppi
For Each PRC In TempPRCList.Distinct()
' leggo gruppi
Dim GRPLList As New ObservableCollection(Of Integer)
Dim GRPTList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileGRPList(0, PRC, GRPLList)
GetBeamPrivateProfileGRPList(1, PRC, GRPTList)
If GRPLList.Count > 0 Then m_PRCList.Add(New PRC(GRPLList(0), PRC, GetBeamPrivateProfileName(0, PRC)))
If GRPTList.Count > 0 Then m_PRCList.Add(New PRC(GRPTList(0), PRC, GetBeamPrivateProfileName(1, PRC)))
Next
m_PRCListView = m_PRCList.OrderBy(Function(x) x.nPRC).ToList()
nSelPRC = m_PRCList(0)
NotifyPropertyChanged(NameOf(PRCListView))
NotifyPropertyChanged(NameOf(PRCList))
Else
SelGRPType = 0
nSelPRC = PRCList(0)
End If
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Private Sub GetMacroListDefault(ByRef nGRPFromFileName As Integer, ByRef nPRCFromFileName As Integer, ByRef sMacroNameFromFileName As String, ByRef nIdMacroName As Integer)
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroCustomDir)
For Each File In AllFilesInDir
If Path.GetExtension(File).ToLower() = ".lua" Then
If File.Contains(FILENAMESEPARATOR) Then
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
If DataFromFileName.Count = 2 Then
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
End If
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
sMacroNameFromFileName = DataFromFileName(1)
End If
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
If Core.Configuration.bOnlyProd Then
MacroCustomList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png"))
Else
MacroCustomList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
End If
m_MacroFilePathList.Add(File)
nIdMacroName += 1
End If
End If
End If
End If
Next
End Sub
Private Sub GetMacroListCustom(ByRef nGRPFromFileName As Integer, ByRef nPRCFromFileName As Integer, ByRef sMacroNameFromFileName As String, ByRef nIdMacroName As Integer)
nIdMacroName = 0
Dim AllFilesInDirCustom As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir)
For Each File In AllFilesInDirCustom
If Path.GetExtension(File).ToLower() = ".lua" Then
If File.Contains(FILENAMESEPARATOR) Then
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
If DataFromFileName.Count = 2 Then
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
End If
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
sMacroNameFromFileName = DataFromFileName(1)
End If
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
MacroDefaultList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName))
m_MacroCustomFilePathList.Add(File)
nIdMacroName += 1
End If
End If
End If
End If
Next
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "Ok"
@@ -221,13 +352,6 @@ Public Class PRC
End Get
End Property
Private m_nVARIANT As Integer = 0
Public ReadOnly Property nVARIANT As Integer
Get
Return m_nVARIANT
End Get
End Property
' Nome
Private m_sName As String
Public ReadOnly Property sName As String
@@ -266,4 +390,43 @@ Public Class PRC
m_QBTLParamVMList = QBTLParamList
End Sub
End Class
Public Class NewMacro
' Indice Macro
Private m_nIndexMacro As Integer
Public ReadOnly Property nIndexMacro As Integer
Get
Return m_nIndexMacro
End Get
End Property
' Nome Macro
Private m_sMacroName As String
Public ReadOnly Property sMacroName As String
Get
Return m_sMacroName.ToUpper()
End Get
End Property
' Cartella dove sono contenuti i templete delle macro
Private m_sMacroDrawPath As String
Public ReadOnly Property sMacroDrawPath As String
Get
Return m_sMacroDrawPath
End Get
End Property
Sub New(IndexMacro As Integer, MacroName As String)
m_nIndexMacro = IndexMacro
m_sMacroName = MacroName
End Sub
Sub New(IndexMacro As Integer, MacroName As String, MacroDrawPath As String)
m_nIndexMacro = IndexMacro
m_sMacroName = MacroName
m_sMacroDrawPath = MacroDrawPath
End Sub
End Class
@@ -0,0 +1,159 @@
<EgtWPFLib5:EgtCustomWindow x:Class="NewAddFeatureWndV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="AddProcess">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Process_Msg}"
Style="{StaticResource ListTextBlock}"/>
<ListBox ItemsSource="{Binding PRCListView}"
SelectedItem="{Binding nSelPRC}"
Grid.Row="1"
BorderThickness="0"
Height="585"
Width="260"
HorizontalAlignment="Left"
Margin="5">
<ListBox.Resources>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Name="Border" Padding="2" SnapsToDevicePixels="True">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="15"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ghDesc}"
ToolTip="{Binding ghDesc}"
HorizontalAlignment="Left"
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"
Style="{StaticResource OptionTextBlock}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Text="{Binding Custom_Msg}"
Grid.Column="1"
Style="{StaticResource ListTextBlock}"/>
<ListBox ItemsSource="{Binding MacroCustomList}"
SelectedIndex="{Binding nSelMacroCustom}"
Grid.Row="1"
Grid.Column="1"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
BorderThickness="0"
Width="980"
Height="610"
Margin="5">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding sMacroName}"
Margin="5"
FontSize="14"
Style="{StaticResource OptionTextBlock}"/>
<Image Source="{Binding sMacroDrawPath}"
Grid.Row="1"
Width="300"
Margin="5,0,5,5"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Text="{Binding Default_Msg}"
Grid.Column="2"
Style="{StaticResource ListTextBlock}"/>
<ListBox ItemsSource="{Binding MacroDefaultList}"
SelectedIndex="{Binding nSelMacroDefault}"
Grid.Row="1"
Grid.Column="2"
BorderThickness="0"
Height="585"
Width="250"
HorizontalAlignment="Left"
Margin="5">
<ListBox.Resources>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Name="Border" Padding="2" SnapsToDevicePixels="True">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding sMacroName}"
Margin="2.5"
HorizontalAlignment="Left"
Width="239"
Style="{StaticResource OptionTextBlock}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<UniformGrid Columns="2"
Grid.Row="2"
Grid.ColumnSpan="3"
Margin="5">
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsDefault="True"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="Cancel"
IsCancel="True"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,17 @@
Public Class NewAddFeatureWndV
Private WithEvents m_AddFeatureWndVM As AddFeatureWndVM
Sub New(Owner As Window, AddFeatureWndVM As AddFeatureWndVM)
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
Me.DataContext = AddFeatureWndVM
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
m_AddFeatureWndVM = AddFeatureWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddFeatureWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -43,7 +43,7 @@ Public Class AddPartWndVM
If StringToLenAdv(value, dTempL, True) AndAlso dTempL > 0 Then
m_dL = dTempL
Else
NotifyPropertyChanged("sL")
NotifyPropertyChanged(NameOf(sL))
End If
End Set
End Property
@@ -64,7 +64,7 @@ Public Class AddPartWndVM
EgtDraw()
m_dW = dTempW
Else
NotifyPropertyChanged("sW")
NotifyPropertyChanged(NameOf(sW))
End If
End Set
End Property
@@ -85,7 +85,7 @@ Public Class AddPartWndVM
EgtDraw()
m_dH = dTempH
Else
NotifyPropertyChanged("sH")
NotifyPropertyChanged(NameOf(sH))
End If
End Set
End Property
@@ -115,7 +115,7 @@ Public Class AddPartWndVM
If Integer.TryParse(value, nTempCNT) AndAlso nTempCNT > 0 Then
m_nCNT = nTempCNT
Else
NotifyPropertyChanged("sCNT")
NotifyPropertyChanged(NameOf(sCNT))
End If
End Set
End Property
@@ -0,0 +1,104 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OnlyProdAddPartWndV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="AddPartWndV">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<!--<RowDefinition Height="Auto"/>-->
</Grid.RowDefinitions>
<Grid HorizontalAlignment="Center"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Name"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sNAM}"
Grid.Column="1"
Width="200"/>
</Grid>
<Grid Grid.Row="1"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Prod Number"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding nPDN}"
Grid.Column="1"
Width="45"/>
<TextBlock Text="Count"
Grid.Column="2"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sCNT}"
Grid.Column="3"
Width="45"/>
</Grid>
<Grid Grid.Row="2"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="W"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sW}"
Grid.Column="1"
Width="45"/>
<TextBlock Text="H"
Grid.Column="2"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sH}"
Grid.Column="3"
Width="45"/>
<TextBlock Text="L"
Grid.Column="4"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sL}"
Grid.Column="5"
Width="45"/>
</Grid>
<Grid Grid.Row="3"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsDefault="True"
Grid.Column="1"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="Cancel"
IsCancel="True"
Grid.Column="3"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class OnlyProdAddPartWndV
Private WithEvents m_AddPartWndVM As AddPartWndVM
Sub New(Owner As Window, AddPartWndVM As AddPartWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = AddPartWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_AddPartWndVM = AddPartWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddPartWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -235,14 +235,14 @@ Public Class Variable
If StringToLenAdv(value, dTempValue, True) Then
m_dValue = dTempValue
Else
NotifyPropertyChanged("sValue")
NotifyPropertyChanged(NameOf(sValue))
End If
Case Else ' VariableType.DOUBLE_
Dim dTempValue As Double
If StringToDoubleAdv(value, dTempValue, True) Then
m_dValue = dTempValue
Else
NotifyPropertyChanged("sValue")
NotifyPropertyChanged(NameOf(sValue))
End If
End Select
End Set

Some files were not shown because too many files have changed in this diff Show More