From d6b3ebf0ae0644d45ebe9f71818cffc8a5f261a1 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Tue, 31 Aug 2021 09:22:21 +0200 Subject: [PATCH] Correzioni e migliorie comunicazione tra ottimizzatore e supervisore --- .../BTL ViewModel/BTLFeatureVM.vb | 11 ++ EgtBEAMWALL.Core/Constants/ConstBeam.vb | 4 + EgtBEAMWALL.Core/Enum.vb | 20 +- .../MachGroupPanel/MyMachGroupPanelVM.vb | 8 + .../MachGroupPanel/MyMachGroupVM.vb | 12 +- EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb | 18 +- .../Controllers/MachGroupController.cs | 5 +- .../Controllers/PartController .cs | 8 +- .../EgtBEAMWALL.Supervisor.vbproj | 9 +- .../FeatureInPartInRawPartListV.xaml | 3 +- .../LeftPanel/LeftPanelV.xaml | 17 +- .../LeftPanel/LeftPanelVM.vb | 122 +++++++++--- .../MachGroupPanel/BeamMachGroupVM.vb | 179 +++++++++++++++++- .../SupervisorMachGroupPanelVM.vb | 60 +++++- .../MachManagingThread/MachManaging.vb | 6 +- .../Utility/LuaExec.vb | 48 ----- .../ViewerOptimizerComm.vb | 41 ++-- .../CALCPanel/CALCPanelVM.vb | 10 +- .../CALCPanel/CalcPanelV.xaml | 15 +- .../EgtBEAMWALL.ViewerOptimizer.vbproj | 7 +- .../LeftPanel/LeftPanelVM.vb | 2 +- .../MachGroupPanel/BeamMachGroupVM.vb | 1 + .../MachGroupPanel/MyMachGroupPanelVM.vb | 8 - .../MainMenu/MainMenuVM.vb | 13 ++ .../Resources/CALCPanel/09_verifica.png | Bin 0 -> 720 bytes .../Resources/CALCPanel/12_verifica tutto.png | Bin 0 -> 781 bytes .../Resources/CALCPanel/15_simula.png | Bin 0 -> 694 bytes .../SceneHost/MySceneHostVM.vb | 20 +- .../SupervisorCommThread/SupervisorComm.vb | 34 ++-- .../TopPanel/TopPanelVM.vb | 14 ++ 30 files changed, 506 insertions(+), 189 deletions(-) rename {EgtBEAMWALL.Core => EgtBEAMWALL.Supervisor}/Utility/LuaExec.vb (55%) create mode 100644 EgtBEAMWALL.ViewerOptimizer/Resources/CALCPanel/09_verifica.png create mode 100644 EgtBEAMWALL.ViewerOptimizer/Resources/CALCPanel/12_verifica tutto.png create mode 100644 EgtBEAMWALL.ViewerOptimizer/Resources/CALCPanel/15_simula.png diff --git a/EgtBEAMWALL.Core/BTL ViewModel/BTLFeatureVM.vb b/EgtBEAMWALL.Core/BTL ViewModel/BTLFeatureVM.vb index 5f6b6a3c..5b521e39 100644 --- a/EgtBEAMWALL.Core/BTL ViewModel/BTLFeatureVM.vb +++ b/EgtBEAMWALL.Core/BTL ViewModel/BTLFeatureVM.vb @@ -195,6 +195,17 @@ Public Class BTLFeatureVM End Get End Property + ' variabile che indica se rifare il pezzo + Private m_bRedo As Boolean = True + Public Property bRedo As Boolean + Get + Return m_bRedo + End Get + Set(value As Boolean) + m_bRedo = value + End Set + End Property + #Region "CONSTRUCTOR" 'Sub New(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM) diff --git a/EgtBEAMWALL.Core/Constants/ConstBeam.vb b/EgtBEAMWALL.Core/Constants/ConstBeam.vb index 3de27051..ff502ac2 100644 --- a/EgtBEAMWALL.Core/Constants/ConstBeam.vb +++ b/EgtBEAMWALL.Core/Constants/ConstBeam.vb @@ -245,6 +245,10 @@ Friend Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT" Friend Const MGR_RPT_PART As String = "PART" + ' parametri P per comunicazione con la macchina + Public Const MGR_RPT_PRODID As String = "PRODID" + Public Const MGR_RPT_PATTID As String = "PATTID" + ' parametri errori integration Friend Const ITG_CUTID As String = "CUTID" Friend Const ITG_TASKID As String = "TASKID" diff --git a/EgtBEAMWALL.Core/Enum.vb b/EgtBEAMWALL.Core/Enum.vb index f52db19a..8a1ff3cc 100644 --- a/EgtBEAMWALL.Core/Enum.vb +++ b/EgtBEAMWALL.Core/Enum.vb @@ -13,13 +13,12 @@ Public Enum EventType End Enum Public Enum ItemState As Integer - - ND = -1 - Assigned = 0 - Confirmed = 1 - WIP = 2 - Produced = 3 - Scrapped = 4 + ND = -1 + Assigned = 0 + Confirmed = 1 + WIP = 2 + Produced = 3 + Scrapped = 4 End Enum Public Enum LogSupportLevel @@ -35,9 +34,10 @@ Public Enum LogSupportTarget End Enum Public Enum StatusMapItemType - ND = -1 - Prod = 0 - MachGroup = 1 + ND = -1 + Prod = 0 + MachGroup = 1 + Part = 2 End Enum Public Enum StatusMapOpType diff --git a/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupPanelVM.vb b/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupPanelVM.vb index 01a9af13..91a857e9 100644 --- a/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupPanelVM.vb +++ b/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupPanelVM.vb @@ -143,6 +143,14 @@ Public MustInherit Class MyMachGroupPanelVM NotifyPropertyChanged(NameOf(sTotTime)) End Sub + Public Shared Sub DuploRemoveProjCalc(nPartDuploId As Integer) + EgtSetInfo(nPartDuploId, ITG_PROJ_ERR, "") + EgtSetInfo(nPartDuploId, ITG_PROJ_MSG, "") + EgtSetInfo(nPartDuploId, ITG_PROJ_ROT, "") + EgtSetInfo(nPartDuploId, ITG_PROJ_FALL, "") + EgtSetInfo(nPartDuploId, ITG_PROJ_TIME, "") + End Sub + #End Region ' METHODS #Region "EVENTS" diff --git a/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupVM.vb index 466b75a9..c52a471b 100644 --- a/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupVM.vb +++ b/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupVM.vb @@ -279,8 +279,10 @@ Public MustInherit Class MyMachGroupVM m_SupervisorId = SupervisorId End Sub Public Sub ResetSupervisorId() + nProduction_State = ItemState.ND m_SupervisorId = "" NotifyPropertyChanged(NameOf(IsReadOnly)) + NotifyPropertyChanged(NameOf(Background)) End Sub Private m_cc As StateChangeEventArgs @@ -293,10 +295,13 @@ Public MustInherit Class MyMachGroupVM #Region "Supervisor" - Public ReadOnly Property nProduction_State As ItemState + Public Property nProduction_State As ItemState Get Return MyMachGroupM.nProductionState End Get + Set(value As ItemState) + MyMachGroupM.SetProductionState(value) + End Set End Property Public ReadOnly Property Production_Background As SolidColorBrush @@ -374,11 +379,11 @@ Public MustInherit Class MyMachGroupVM End Get End Property - Public ReadOnly Property Produce_IsEnabled As Boolean + Public Overridable ReadOnly Property Produce_IsEnabled As Boolean Get Select Case nProduction_State Case ItemState.Assigned, ItemState.Confirmed - Return True + Return Not m_bToBeProduced Case Else Return False End Select @@ -507,6 +512,7 @@ Public MustInherit Class MyMachGroupVM Public Sub SentToSupervisor() MyMachGroupM.SetProductionState(ItemState.Assigned) + NotifyPropertyChanged(NameOf(Background)) End Sub Public Overridable Function CnFilePath() As String diff --git a/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb index d685fdf9..7d1dbf63 100644 --- a/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb @@ -190,11 +190,11 @@ Public MustInherit Class PartVM End Get End Property - Public Property nProduction_State As CalcStates + Public Property nProduction_State As ItemState Get Return m_PartM.nProductionState End Get - Set(value As CalcStates) + Set(value As ItemState) m_PartM.SetProductionState(value) End Set End Property @@ -342,6 +342,20 @@ Public MustInherit Class PartVM End Set End Property + ' variabile che indica se rifare il pezzo + Private m_bRedo As Boolean = True + Public Property bRedo As Boolean + Get + Return m_bRedo + End Get + Set(value As Boolean) + For Each Feature In FeatureVMList + Feature.bRedo = value + Next + m_bRedo = value + End Set + End Property + ' definizione comandi Private m_cmdDeletePart As ICommand diff --git a/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs b/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs index 4c6eeeb9..fcdaedbd 100644 --- a/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs +++ b/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs @@ -423,7 +423,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers ResetController(); done = true; // aggiorno info sullo status - StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, ""); + StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.PartEnd, ""); } catch (Exception exc) { @@ -494,7 +494,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers ResetController(); done = true; // aggiorno info sullo status - StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, ""); + StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.PartStart, ""); } catch (Exception exc) { @@ -594,6 +594,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers { currRecord.State = Core.ItemState.ND; currRecord.SupervisorId = ""; + currRecord.ProdIndex = 0; } // Commit changes dbCtx.SaveChanges(); diff --git a/EgtBEAMWALL.DataLayer/Controllers/PartController .cs b/EgtBEAMWALL.DataLayer/Controllers/PartController .cs index d8d0f5ac..8e2aa37d 100644 --- a/EgtBEAMWALL.DataLayer/Controllers/PartController .cs +++ b/EgtBEAMWALL.DataLayer/Controllers/PartController .cs @@ -295,7 +295,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers ResetController(); done = true; // aggiorno info sullo status - StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.MachGroup.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, ""); + StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, ""); } catch { } @@ -324,7 +324,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers ResetController(); done = true; // aggiorno info sullo status - StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.PartEnd, ""); + StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.PartEnd, ""); } catch (Exception exc) { @@ -356,7 +356,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers ResetController(); done = true; // aggiorno info sullo status - StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.PartStart, ""); + StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.PartStart, ""); } catch (Exception exc) { @@ -388,7 +388,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers ResetController(); done = true; // aggiorno info sullo status - StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, ""); + StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, ""); } catch (Exception exc) { diff --git a/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj b/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj index 7256804e..8efb34b2 100644 --- a/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj +++ b/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj @@ -277,10 +277,6 @@ ProjectV.xaml - - RestartWndV.xaml - - SceneHostV.xaml @@ -302,6 +298,7 @@ Dictionary.xaml + @@ -370,10 +367,6 @@ Designer XamlIntelliSenseFileGenerator - - Designer - MSBuild:Compile - MSBuild:Compile Designer diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListV.xaml index 16f84b8b..ae1f7389 100644 --- a/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListV.xaml +++ b/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListV.xaml @@ -1,8 +1,7 @@  + xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor"> + - - diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index f9eb6455..3eceb3e9 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -225,6 +225,7 @@ EgtDataGrid.xaml + @@ -316,7 +317,6 @@ Dictionary.xaml - @@ -744,6 +744,11 @@ + + + + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index 803eb32b..af20c6eb 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -194,7 +194,7 @@ Public Class LeftPanelVM 'aggiorno lista pezzi BeamMachGroup.m_BeamMachGroupM.RefreshPartList() BeamMachGroup.m_BeamMachGroupM.RefreshGroupData() - ' aggiorno dati ultilizzo barra + ' aggiorno dati utilizzo barra BeamMachGroup.UpdateUsage() EgtSetView(VT.ISO_SW, False) ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/BeamMachGroupVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/BeamMachGroupVM.vb index 46a379a5..74831e85 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/BeamMachGroupVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/BeamMachGroupVM.vb @@ -211,6 +211,7 @@ Public Class BeamMachGroupVM EgtGetMachGroupName(nCurrMachGroup, sCurrMachGroupName) ' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId) + EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, sMATERIAL) EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup) ' scrivo dati costruzione grezzo in gruppo di lavorazione EgtSetInfo(nCurrMachGroup, MGR_RPT_BARLEN, dL) diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb index 9f8bbfbc..2f78b351 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb @@ -176,14 +176,6 @@ Public Class MyMachGroupPanelVM Return EgtSetInfo(nSouId, DUPLO_TODELETE, "") End Function - Friend Shared Sub DuploRemoveProjCalc(nPartDuploId As Integer) - EgtSetInfo(nPartDuploId, ITG_PROJ_ERR, "") - EgtSetInfo(nPartDuploId, ITG_PROJ_MSG, "") - EgtSetInfo(nPartDuploId, ITG_PROJ_ROT, "") - EgtSetInfo(nPartDuploId, ITG_PROJ_FALL, "") - EgtSetInfo(nPartDuploId, ITG_PROJ_TIME, "") - End Sub - Public Overrides Sub AddMachGroup() Dim MyMachGroupM As MyMachGroupM = m_MyMachGroupPanelM.NewMyMachGroup(CurrentMachine.sMachineName, Map.refProjectVM.BTLStructureVM.nPROJTYPE) ' e lo seleziono diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb index 4f3b87e8..74803be9 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb @@ -2,6 +2,7 @@ Imports System.IO Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.Core.ConstBeam +Imports EgtBEAMWALL.DataLayer.DatabaseModels Imports EgtUILib Imports EgtWPFLib5 @@ -244,8 +245,20 @@ Public Class MainMenuVM ' se si rigenero BTLStructure Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0)) End If + ' recupero indice di modifica progetto + Dim CommIndex As Integer = -1 + Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd() + For Each ActiveSession In ActiveSessionList + If ActiveSession.ItemId = Map.refProdManagerVM.CurrProd.nProdId Then + CommIndex = ActiveSession.Index + End If + Next ' carico lista dei MachGroup Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList())) + ' fisso indice sessione di comunicazione + If CommIndex > -1 Then + Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex) + End If Map.refProjManagerVM.CurrProj.SetReloadProject(True) End If 'DbControllers.m_ProdController.ResetController() diff --git a/EgtBEAMWALL.ViewerOptimizer/Resources/CALCPanel/09_verifica.png b/EgtBEAMWALL.ViewerOptimizer/Resources/CALCPanel/09_verifica.png new file mode 100644 index 0000000000000000000000000000000000000000..d87aff3ee5421b4afd97da5c06d359cb5beba6a1 GIT binary patch literal 720 zcmV;>0x$iEP)nQURob_$nYB zkUaSjt^#rugc9ryZgglFMb>)P#{9V%z8NNt$x6S~uB5f`twjA8BT$*E=Ki`Vi^sRx z>kXB;DhIFxumC_Xx$(0a0Kx45Y@4#E-vx?c)(m8UbZGdFMk;gF9UJwcS+AP1cup8Q0dS+oH)V0vHLepXbJaaB z7ikaRA_XP@N4BOZU_mGqq3G-q;gW2cdy3b7R3N;Riz{A!(q(9mwIan?cHj-YZ_0u; z@2JXL^~6g_*?6k6(u&ktWZ1zDh@GDXv!|0m*VOGwkQeZwqR{pWC-a$p9k#_7`m5_sNC)(N8tVH`YIf z6Q3!YSi1-S(YRX!axVP-la7>ZA==5B{~q)nNCdLViuYshDS7uCtAC(w}} z>EA4#O<;aaDw&&~9%Ic$E@{AsPnvq66|7j)whEIR)6UH4Im(}}`&qMTC(}w3>mUI1? zsm@UIWXhPok9e2h>rnE$g#Y`kO9XV(_fy|W5`e$5RzeD*?Nf{Z0000WdP)0M62agI#uLF75#Wiy z5W#Tc2phqW!IHt^47Qqja*1}g@y}4hVN^v?w!5XT)sk8^zNDpm8{()S+l>K?9gj|B zo}BvX?FfdM!G*pzv4xC<0veiNpv7^r1ixSLQxwi^K`0Q^$7jTg26 z{uqO0o}8`m27Jaj+M8h} z9lN&jyGK#s09p{V3lKPdZ{~B`Q{E5hy_(cKMQ`kRxi0f0wN^MpWPyd+%Gl0I7u25F zW86OFiuOZkl*HV+cY4ueZ>$GgZ6CcPb!f@`{s<3gDX4eJdlBurp;)QGV?yGnYYf?P zre{RPD!wH9p7b0WN{F}oe;&qjfti$fGPS@&uh_ZrR25UKOMiJeXA%525GZC{8>tu) z`AL{JUQeWMX;0}1hZ}{lE0C*{gtSw$@2pb{MEl@9(}OQPfLsdM2K`|ZW!HhxJ25j30i27#&q}v#K`((?c%Y1E6T!D22(t5?tRjAld8~(eF z0v}k`5y*9fZS;W0?-D3-dYcI=_BwX@_m!0TR?16DTUQN=ljNXWI6B55K(cMp;H_P+ zUA}fWRhf4QXoAHpimWXsmW;KdM|U1sO=sU+Ro#LutV!jG1?`g~y)$8Yxr6{9{{80&KYw*YcA zT?42ZS3GyMn?%Z3pEa(i)wd9tlh7&b0W2F=Y^%XC>4Hcp7n#9Mgy)O}iDFK?dE*5tg>$k@G-x2bl zYwx+4 z!5k|IEhGUP_pZ5inQ~sLQd=FsQVbhcNCBOxf_THf6^rW=_w5w>?xwI@^ROBEkBL zfg7vlhZyABsiezXY+Wy<6tM+++KMr@=C>q3!?+sLm9>5b8S8(1bVJs}gv3{7)i?DH zYauU!pW!q3k~e$jHbZhr*>ow6NKt`KB)jen5mRc{(blNP-Z#*sp82@%gFgE^|4tk* c;Qs@FKk7m2Pe;AmS^xk507*qoM6N<$f)Khk8vp -1 Then + Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex) + End If Else - ' mostro tutti i pezzi - Map.refShowBeamPanelVM.ShowAll() + ' mostro tutti i pezzi + Map.refShowBeamPanelVM.ShowAll() End If WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile) ' in base al tipo progetto aggiungo il file in apertura alla lista degli MRU @@ -801,7 +815,7 @@ Public Class MySceneHostVM EgtGetName(nLayerId, sLayerName) If sLayerName = ASSEBASE Then Dim nSou As Integer - if EgtGetInfo( nPartId, GDB_SI_COPY, nSou) Then nPartId = nSou + If EgtGetInfo(nPartId, GDB_SI_COPY, nSou) Then nPartId = nSou bFound = True End If Else diff --git a/EgtBEAMWALL.ViewerOptimizer/SupervisorCommThread/SupervisorComm.vb b/EgtBEAMWALL.ViewerOptimizer/SupervisorCommThread/SupervisorComm.vb index a34f7ecd..8ec9ffa4 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SupervisorCommThread/SupervisorComm.vb +++ b/EgtBEAMWALL.ViewerOptimizer/SupervisorCommThread/SupervisorComm.vb @@ -44,7 +44,8 @@ Public Class SupervisorComm End Select Next - + ' aggiorno indice del proj + Map.refProjManagerVM.CurrProj.SetModificationIndex(nModificationIndex) End If ' se arriva richiesta da supervisore di blocco e salvataggio @@ -75,17 +76,23 @@ Public Class SupervisorComm Dim MachGroupList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetFrom(Map.refProdManagerVM.CurrProd.nModificationIndex + 1) Dim bReloadFile As Boolean = False For Each MachGroupModification In MachGroupList - Select Case MachGroupModification.Operation - Case Core.StatusMapOpType.PartStart - - - Case Core.StatusMapOpType.PartEnd - - - Case Core.StatusMapOpType.MachGroupRemovedFromSupervisor - Dim Machgroup As MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroupModification.ItemId) - Machgroup.ResetSupervisorId() - End Select + If MachGroupModification.ItemType = StatusMapItemType.MachGroup Then + Select Case MachGroupModification.Operation + Case Core.StatusMapOpType.PartStart + Dim Machgroup As MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroupModification.ItemId) + Machgroup.dtStartTime = MachGroupModification.DtEvent + Machgroup.nProduction_State = ItemState.WIP + Machgroup.NotifyPropertyChanged(NameOf(Machgroup.Background)) + Case Core.StatusMapOpType.PartEnd + Dim Machgroup As MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroupModification.ItemId) + Machgroup.dtEndTime = MachGroupModification.DtEvent + Machgroup.nProduction_State = ItemState.Produced + Machgroup.NotifyPropertyChanged(NameOf(Machgroup.Background)) + Case Core.StatusMapOpType.MachGroupRemovedFromSupervisor + Dim Machgroup As MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroupModification.ItemId) + Machgroup.ResetSupervisorId() + End Select + End If Next ' se arriva richiesta da supervisore di blocco e salvataggio @@ -95,7 +102,8 @@ Public Class SupervisorComm ' blocco interfaccia fino a notifica di sblocco - + ' aggiorno indice del prod + Map.refProdManagerVM.CurrProd.SetModificationIndex(nModificationIndex) End If End If ' se c'e' un progetto aperto o in caricamento diff --git a/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelVM.vb index 661f0c17..f452c952 100644 --- a/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelVM.vb @@ -155,6 +155,8 @@ Public Class TopPanelVM Private Sub Produce(MachGroup As MyMachGroupVM) If IsNothing(MachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If MachGroup.nProduction_State >= ItemState.Assigned Then Return If MachGroup.nGlobalState = CalcStates.OK Or MachGroup.nGlobalState = CalcStates.INFO Then ' se ci sono modifiche, salvo il pogetto If EgtGetModified() Then @@ -220,6 +222,8 @@ Public Class TopPanelVM If IsNothing(Map.refProdManagerVM.CurrProd) Then Return Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return If SelMachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then SelMachGroup.ResetCalcMachGroup() End If @@ -279,6 +283,8 @@ Public Class TopPanelVM If IsNothing(Map.refProdManagerVM.CurrProd) Then Return Dim SelMachGroup As MyMachGroupVM = refMachGroupPanelVM.SelectedMachGroup If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return SelMachGroup.DeleteMachGroup() End Sub @@ -305,6 +311,8 @@ Public Class TopPanelVM If IsNothing(Map.refProdManagerVM.CurrProd) Then Return Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return Dim SelPart As PartVM = SelMachGroup.SelPart If IsNothing(SelPart) Then Return SelPart.DeletePart() @@ -334,6 +342,8 @@ Public Class TopPanelVM If IsNothing(Map.refProdManagerVM.CurrProd) Then Return Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return Dim SelPart As PartVM = SelMachGroup.SelPart If IsNothing(SelPart) Then Return If SelMachGroup.nMachineType = MachineType.BEAM Then @@ -369,6 +379,8 @@ Public Class TopPanelVM If IsNothing(Map.refProdManagerVM.CurrProd) Then Return Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return Dim SelPart As PartVM = SelMachGroup.SelPart If IsNothing(SelPart) Then Return If SelMachGroup.nMachineType = MachineType.BEAM Then @@ -404,6 +416,8 @@ Public Class TopPanelVM If IsNothing(Map.refProdManagerVM.CurrProd) Then Return Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup If IsNothing(SelMachGroup) Then Return + ' se barra gia' assegnata a supervisore, esco + If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return Dim SelPart As PartVM = SelMachGroup.SelPart If IsNothing(SelPart) Then Return If SelMachGroup.nMachineType = MachineType.BEAM Then