Correzioni e migliorie comunicazione tra ottimizzatore e supervisore
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
+10
-10
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -277,10 +277,6 @@
|
||||
<DependentUpon>ProjectV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Project\ProjectVM.vb" />
|
||||
<Compile Include="RestartWnd\RestartWndV.xaml.vb">
|
||||
<DependentUpon>RestartWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RestartWnd\RestartWndVM.vb" />
|
||||
<Compile Include="SceneHost\MySceneHostVM.vb" />
|
||||
<Compile Include="SceneHost\SceneHostV.xaml.vb">
|
||||
<DependentUpon>SceneHostV.xaml</DependentUpon>
|
||||
@@ -302,6 +298,7 @@
|
||||
<Compile Include="Utility\Dictionary.xaml.vb">
|
||||
<DependentUpon>Dictionary.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\LuaExec.vb" />
|
||||
<Compile Include="Utility\Map.vb" />
|
||||
<Compile Include="Utility\VMBase.vb" />
|
||||
<Compile Include="ViewerOptimizerCommThread\ViewerOptimizerComm.vb" />
|
||||
@@ -370,10 +367,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
||||
</Page>
|
||||
<Page Include="RestartWnd\RestartWndV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SceneHost\SceneHostV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<UserControl x:Class="FeatureInPartInRawPartListV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor"
|
||||
Visibility="{Binding FeatureList_Visibility}">
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor">
|
||||
<!--<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
|
||||
@@ -53,18 +53,19 @@
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button Content="D"
|
||||
Command="{Binding DoneRawPart_Command}"
|
||||
Style="{StaticResource LeftPanel_SmallButton}"/>
|
||||
Command="{Binding DonePart_Command}"
|
||||
Style="{StaticResource LeftPanel_SmallButton}"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:PartInRawPartListV DataContext="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"/>
|
||||
<EgtBEAMWALL:FeatureInPartInRawPartListV Grid.Column="1"
|
||||
DataContext="{Binding Tag.SelectedMachGroup, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"/>
|
||||
<EgtBEAMWALL:FeatureInPartInRawPartListV Grid.Row="1"
|
||||
DataContext="{Binding Tag.SelectedMachGroup, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
|
||||
Visibility="{Binding FeatureList_Visibility}"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -21,11 +21,29 @@ Public Class LeftPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_bRestart As Boolean = False
|
||||
Public Property bRestart As Boolean
|
||||
Get
|
||||
Return m_bRestart
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bRestart = value
|
||||
NotifyPropertyChanged(NameOf(FeatureList_Visibility))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property FeatureList_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_bRestart, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdDeleteRawPart As ICommand
|
||||
Private m_cmdMoveUpRawPart As ICommand
|
||||
Private m_cmdMoveDownRawPart As ICommand
|
||||
Private m_cmdDoneRawPart As ICommand
|
||||
Private m_cmdDonePart As ICommand
|
||||
|
||||
#End Region 'FIELDS & PROPERTIES
|
||||
|
||||
@@ -45,7 +63,7 @@ Public Class LeftPanelVM
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "CompletedRawPart"
|
||||
#Region "DoneRawPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
@@ -68,36 +86,11 @@ Public Class LeftPanelVM
|
||||
' scrivo tutti pezzi completati
|
||||
For PartIndex = 0 To SelMachGroup.PartVMList.Count - 1
|
||||
Dim Part As PartVM = SelMachGroup.PartVMList(PartIndex)
|
||||
If Part.dtStartTime = DateTime.MinValue Then
|
||||
Dim Time As DateTime = DateTime.Now()
|
||||
If PartIndex = 0 Then
|
||||
' aggiorno anche start MachGroup
|
||||
DbControllers.m_MachGroupController.UpdateStart(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Time)
|
||||
SelMachGroup.dtStartTime = Time
|
||||
SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Calc_Background))
|
||||
End If
|
||||
DbControllers.m_PartController.UpdateStart(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, Time)
|
||||
Part.dtStartTime = Time
|
||||
End If
|
||||
If Part.dtEndTime = DateTime.MinValue Then
|
||||
Dim Time As DateTime = DateTime.Now()
|
||||
DbControllers.m_PartController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, Time)
|
||||
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, ItemState.Produced)
|
||||
Part.dtEndTime = Time
|
||||
If PartIndex = SelMachGroup.PartVMList.Count - 1 Then
|
||||
'aggiorno anche fine MachGroup
|
||||
DbControllers.m_MachGroupController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Time)
|
||||
SelMachGroup.dtEndTime = Time
|
||||
SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Calc_Background))
|
||||
End If
|
||||
End If
|
||||
' aggiorno status MachGroup
|
||||
DbControllers.m_MachGroupController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup.Id, ItemState.Produced)
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Production_Background))
|
||||
SetDonePart(SelMachGroup, Part)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' CompletedRawPart
|
||||
#End Region ' DoneRawPart
|
||||
|
||||
#Region "DeleteRawPart"
|
||||
|
||||
@@ -124,7 +117,7 @@ Public Class LeftPanelVM
|
||||
MessageBox.Show("Impossibile cancellare il grezzo")
|
||||
Return
|
||||
End If
|
||||
If DbControllers.m_MachGroupController.RemoveFromSupervisor(Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup.Id) Then
|
||||
If DbControllers.m_MachGroupController.RemoveFromSupervisor(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id) Then
|
||||
' se rimozione da Db ok, lo rimuovo da lista
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Remove(SelMachGroup)
|
||||
End If
|
||||
@@ -132,6 +125,77 @@ Public Class LeftPanelVM
|
||||
|
||||
#End Region ' DeleteRawPart
|
||||
|
||||
#Region "DonePart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property DonePart_Command As ICommand
|
||||
Get
|
||||
If m_cmdDonePart Is Nothing Then
|
||||
m_cmdDonePart = New Command(AddressOf DonePart)
|
||||
End If
|
||||
Return m_cmdDonePart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub DonePart()
|
||||
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup
|
||||
If IsNothing(SelMachGroup.SelPart) Then Return
|
||||
SetDonePart(SelMachGroup, SelMachGroup.SelPart)
|
||||
End Sub
|
||||
|
||||
Public Sub SetDonePart(MachGroup As MyMachGroupVM, Part As PartVM)
|
||||
If IsNothing(MachGroup) OrElse IsNothing(Part) Then Return
|
||||
' se ora d'inizio non e' gia' fissata
|
||||
Dim Time As DateTime = DateTime.Now()
|
||||
If Part.dtStartTime = DateTime.MinValue Then
|
||||
DbControllers.m_PartController.UpdateStart(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, Time)
|
||||
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.WIP)
|
||||
Part.dtStartTime = Time
|
||||
Part.nProduction_State = ItemState.WIP
|
||||
' se e' il primo ad essere lavorato
|
||||
If Not MachGroup.PartVMList.Any(Function(x) x IsNot Part AndAlso x.dtStartTime > DateTime.MinValue) Then
|
||||
' riposiziono il gruppo come primo dei non lavorati assegnandogli indice corretto
|
||||
' cerco primo indice di pezzo non in produzione
|
||||
Dim NewIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) DirectCast(x, MyMachGroupVM).dtStartTime = DateTime.MinValue AndAlso DirectCast(x, MyMachGroupVM).bToBeProduced = False))
|
||||
' sposto MachGroup in lista come ultimo dei pronti da produrre
|
||||
Dim OldIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(MachGroup)
|
||||
DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, NewIndex + 1)
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(OldIndex, NewIndex)
|
||||
|
||||
' aggiorno anche start MachGroup
|
||||
DbControllers.m_MachGroupController.UpdateStart(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Time)
|
||||
DbControllers.m_MachGroupController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, ItemState.WIP)
|
||||
MachGroup.dtStartTime = Time
|
||||
MachGroup.nProduction_State = ItemState.WIP
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Production_Background))
|
||||
End If
|
||||
End If
|
||||
If Part.dtEndTime = DateTime.MinValue Then
|
||||
DbControllers.m_PartController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, Time)
|
||||
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.Produced)
|
||||
Part.dtEndTime = Time
|
||||
Part.nProduction_State = ItemState.Produced
|
||||
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= ItemState.Produced) Then
|
||||
'aggiorno anche fine MachGroup
|
||||
DbControllers.m_MachGroupController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Time)
|
||||
DbControllers.m_MachGroupController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, ItemState.Produced)
|
||||
MachGroup.dtEndTime = Time
|
||||
MachGroup.nProduction_State = ItemState.Produced
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Production_Background))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Produce_IsEnabled))
|
||||
End If
|
||||
End If
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Production_Background))
|
||||
End Sub
|
||||
|
||||
#End Region ' DonePart
|
||||
|
||||
#Region "MoveUpRawPart"
|
||||
|
||||
''' <summary>
|
||||
|
||||
@@ -9,9 +9,21 @@ Imports EgtWPFLib5
|
||||
Public Class BeamMachGroupVM
|
||||
Inherits Core.BeamMachGroupVM
|
||||
|
||||
Public ReadOnly Property FeatureList_Visibility As Visibility
|
||||
Public Overrides ReadOnly Property Produce_IsEnabled As Boolean
|
||||
Get
|
||||
Return If(bResetWhileCutting, Visibility.Visible, Visibility.Collapsed)
|
||||
Select Case nProduction_State
|
||||
Case ItemState.Assigned, ItemState.Confirmed
|
||||
Return Not m_bToBeProduced
|
||||
Case ItemState.WIP
|
||||
If Map.refMachCommandMessagePanelVM.OPState = 0 OrElse
|
||||
Map.refMachCommandMessagePanelVM.OPState = MachCommandMessagePanelVM.MachineOperatingState.End OrElse
|
||||
Map.refMachCommandMessagePanelVM.OPState = MachCommandMessagePanelVM.MachineOperatingState.Stop OrElse
|
||||
Map.refMachCommandMessagePanelVM.OPState = MachCommandMessagePanelVM.MachineOperatingState.Unspecified Then
|
||||
Return True
|
||||
End If
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -64,15 +76,16 @@ Public Class BeamMachGroupVM
|
||||
|
||||
' se gia' in produzione, non devo fare nulla
|
||||
If m_bToBeProduced Then Return
|
||||
SetResetWhileCutting(True)
|
||||
' se lavorazione interrotta da reset
|
||||
If bResetWhileCutting Then
|
||||
'' chiedo se riprendere o rimandare i pezzi non fatti all'ottimizzatore
|
||||
'If MessageBox.Show("Riprendere lavorazione barra corrente?", "", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
|
||||
' ' se ripresa, lancio finestra per definire da dove
|
||||
|
||||
'
|
||||
|
||||
'End If
|
||||
' chiedo se riprendere o rimandare i pezzi non fatti all'ottimizzatore
|
||||
If MessageBox.Show("Riprendere lavorazione barra corrente?", "", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
|
||||
' se ripresa, mostro lista feature e colonne Redo
|
||||
Map.refLeftPanelVM.bRestart = True
|
||||
' creo nuova barra
|
||||
RedoRawPart()
|
||||
End If
|
||||
End If
|
||||
' cerco primo indice di pezzo non in produzione
|
||||
Dim NewIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) DirectCast(x, MyMachGroupVM).dtStartTime = DateTime.MinValue AndAlso DirectCast(x, MyMachGroupVM).bToBeProduced = False))
|
||||
@@ -86,6 +99,154 @@ Public Class BeamMachGroupVM
|
||||
Dim OldIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Me)
|
||||
DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, Id, NewIndex)
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(OldIndex, NewIndex)
|
||||
NotifyPropertyChanged(NameOf(Produce_IsEnabled))
|
||||
' resetto eventuali stati di ripartenza
|
||||
SetResetWhileCutting(False)
|
||||
Map.refLeftPanelVM.bRestart = False
|
||||
End Sub
|
||||
|
||||
Public Sub RedoRawPart()
|
||||
If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
|
||||
'Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
'If IsNothing(SelPart) Then Return
|
||||
'' verifico se sono gia' stati messi tutti i pezzi richiesti
|
||||
'If Not VerifyPartCount(SelPart) Then Return
|
||||
'' chiedo lunghezza grezzo
|
||||
'Dim dRawL As Double = SelPart.dL
|
||||
'Dim dRawW As Double = SelPart.dW
|
||||
'Dim dStartOffset As Double = 0
|
||||
'Dim dKerf As Double = 0
|
||||
'Dim sWarehouseIniPath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_BASIC_INI_FILE_NAME
|
||||
'If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
|
||||
' dStartOffset = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_BEAM, WRH_STARTOFFSET, 0, sWarehouseIniPath)
|
||||
' dRawL += dStartOffset
|
||||
'Else
|
||||
' dKerf = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_WALL, WRH_KERF, 0, sWarehouseIniPath)
|
||||
' dRawL += 2 * dKerf
|
||||
' dRawW += 2 * dKerf
|
||||
'End If
|
||||
'Dim AddRawPartWndVM As New AddRawPartWndVM(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dRawL, dRawW, dStartOffset)
|
||||
'Dim AddRawPartWnd As New AddRawPartWndV(Application.Current.MainWindow, AddRawPartWndVM)
|
||||
'If Not AddRawPartWnd.ShowDialog() Then Return
|
||||
' creo nuovo gruppo di lavorazione
|
||||
Map.refProjectVM.ProdMachGroupPanelVM.AddMachGroup()
|
||||
Dim nCurrMachGroup As Integer = EgtGetCurrMachGroup()
|
||||
Dim sCurrMachGroupName As String = ""
|
||||
Dim MachGroup As MyMachGroupVM
|
||||
EgtGetMachGroupName(nCurrMachGroup, sCurrMachGroupName)
|
||||
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
|
||||
' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refSupervisorManagerVM.CurrProd.nProdId)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, sMATERIAL)
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
' recupero lista dei pezzi BTL originali
|
||||
Dim PartList As New List(Of Integer)
|
||||
For Each Part In m_PartVMList
|
||||
PartList.Add(EgtDuploGetOriginal(Part.nPartId))
|
||||
Next
|
||||
' analizzo barra di origine
|
||||
Dim dInitialCutOut As Double = 0
|
||||
Dim nFirstPartIndex As Integer = 0
|
||||
For Index = 0 To PartVMList.Count - 1
|
||||
Dim CurrPart As BeamVM = PartVMList(Index)
|
||||
If CurrPart.bRedo Then
|
||||
nFirstPartIndex = Index
|
||||
Else
|
||||
dInitialCutOut += CurrPart.dOffset + CurrPart.dL
|
||||
End If
|
||||
Next
|
||||
' scrivo dati costruzione grezzo in gruppo di lavorazione
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_BARLEN, dL - dInitialCutOut)
|
||||
For Index = nFirstPartIndex To m_PartVMList.Count - 1
|
||||
' creo copia del pezzo
|
||||
Dim nPartDuploId As Integer = EgtDuploNew(PartList(Index))
|
||||
' elimino valori calcolo dell'originale
|
||||
MyMachGroupPanelVM.DuploRemoveProjCalc(nPartDuploId)
|
||||
' lo rendo std
|
||||
EgtSetMode(nPartDuploId, GDB_MD.STD)
|
||||
' scrivo dati costruzione grezzo in gruppo di lavorazione
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & 1, nPartDuploId & "," & m_PartVMList(Index).sPOSX)
|
||||
Next
|
||||
Dim BeamMachGroup As BeamMachGroupVM = Map.refMachGroupPanelVM.GetLastMachGroup()
|
||||
' eseguo script creazione grezzo
|
||||
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdType.RAWPART, False) Then
|
||||
BeamMachGroup.DeleteMachGroup()
|
||||
Dim LogFile As String() = File.ReadAllLines(sLogPath)
|
||||
If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
|
||||
MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
'aggiorno lista pezzi
|
||||
BeamMachGroup.m_BeamMachGroupM.RefreshPartList()
|
||||
BeamMachGroup.m_BeamMachGroupM.RefreshGroupData()
|
||||
''' aggiorno dati utilizzo barra
|
||||
''BeamMachGroup.UpdateUsage()
|
||||
EgtSetView(VT.ISO_SW, False)
|
||||
' segno pezzi non completati come scrap
|
||||
For Index = nFirstPartIndex To m_PartVMList.Count - 1
|
||||
Dim Part As PartVM = m_PartVMList(Index)
|
||||
Dim nP_Prod As Integer = Map.refSupervisorManagerVM.CurrProd.nProdId
|
||||
Dim nP_Machgroup As Integer = Id
|
||||
Dim nP_Part As Integer = m_PartVMList(Index).nPartId
|
||||
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, DateTime.MinValue)
|
||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Scrapped)
|
||||
' scrivo stato end
|
||||
Part.nProduction_State = 2
|
||||
Part.dtEndTime = DateTime.MinValue
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nCALC_State))
|
||||
' resetto stato redo
|
||||
Part.bRedo = False
|
||||
' scrivo data end su Db barra
|
||||
DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, DateTime.MinValue)
|
||||
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced)
|
||||
' scrivo stato end
|
||||
MyMachGroupM.SetProductionState(2)
|
||||
dtEndTime = DateTime.MinValue
|
||||
NotifyPropertyChanged(NameOf(nCALC_State))
|
||||
Next
|
||||
MachGroup = BeamMachGroup
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
'' scrivo dati in gruppo di lavorazione
|
||||
'Dim dPosX As Double = dKerf
|
||||
'Dim dPosY As Double = dKerf
|
||||
'EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELLEN, dL)
|
||||
'EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELWIDTH, dW)
|
||||
'EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & 1, nPartDuploId & "," & dPosX & "," & dPosY & "," & 0 & "," & 0)
|
||||
'Dim WallMachGroup As WallMachGroupVM = DirectCast(Map.refMachGroupPanelVM.MachGroupVMList(Map.refMachGroupPanelVM.MachGroupVMList.Count - 1), WallMachGroupVM)
|
||||
'' eseguo script creazione grezzo
|
||||
'If Not ExecWall(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdType.RAWPART, False) Then
|
||||
' WallMachGroup.DeleteMachGroup()
|
||||
' If File.Exists(sLogPath) Then
|
||||
' Dim LogFile As String() = File.ReadAllLines(sLogPath)
|
||||
' If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
|
||||
' MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' End If
|
||||
' Else
|
||||
' MessageBox.Show("Impossible creating rawpart", EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' End If
|
||||
' Return
|
||||
'End If
|
||||
'' scrivo dati pezzo
|
||||
'EgtSetInfo(nPartDuploId, MGR_PRT_POSX, dPosX)
|
||||
'EgtSetInfo(nPartDuploId, MGR_PRT_POSY, dPosY)
|
||||
'EgtSetInfo(nPartDuploId, MGR_PRT_ROT, 0)
|
||||
'EgtSetInfo(nPartDuploId, MGR_PRT_FLIP, False)
|
||||
'' aggiorno contatore pezzi usati in Prod
|
||||
'SelPart.RefreshPartInProd()
|
||||
'' aggiorno lista pezzi
|
||||
'WallMachGroup.m_WallMachGroupM.RefreshPartList()
|
||||
'WallMachGroup.m_WallMachGroupM.RefreshGroupData()
|
||||
'' aggiorno dati ultilizzo barra
|
||||
'WallMachGroup.UpdateUsage()
|
||||
'EgtSetView(VT.TOP, False)
|
||||
End If
|
||||
' aggiungo Machgroup a lista supervisor
|
||||
If Not IsNothing(MachGroup) Then Map.refProjectVM.SupervisorMachGroupPanelVM.AddMachGroupToSupervisor(MachGroup)
|
||||
' lo posiziono subito dopo il gruppo di ripartenza (devo cambiare indice anche su DB??)
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count - 1, Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Me))
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
#End Region ' ProduceMachGroup
|
||||
|
||||
@@ -3,6 +3,7 @@ Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
@@ -37,7 +38,7 @@ Public Class SupervisorMachGroupPanelVM
|
||||
BindingOperations.EnableCollectionSynchronization(m_MachGroupVMList, m_Lock_AddMachGroup)
|
||||
m_ReloadProj_Timer.Interval = TimeSpan.FromMilliseconds(500)
|
||||
m_ReloadProj_Timer.Start()
|
||||
AddHandler m_ReloadProj_Timer.Tick, AddressOf ReloadProject_Tick
|
||||
AddHandler m_ReloadProj_Timer.Tick, AddressOf ReloadProject_Tick
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -72,11 +73,11 @@ Public Class SupervisorMachGroupPanelVM
|
||||
#Region "METHODS"
|
||||
|
||||
Public Shared Sub RefreshSupervisorMachGroups(MachineList As List(Of Machine))
|
||||
' Carico i gruppi di lavorazione nella lista
|
||||
' Carico tutti i gruppi di lavorazione aggiunti al progetto
|
||||
Dim nId = EgtGetFirstMachGroup()
|
||||
While nId <> GDB_ID.NULL
|
||||
' se gia' presente, vado al prossimo
|
||||
If Map.refSupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x) x.Id = nId) Then
|
||||
If Map.refProjectVM.ProdMachGroupPanelVM.MachGroupVMList.Any(Function(x) x.Id = nId) Then
|
||||
nId = EgtGetNextMachGroup(nId)
|
||||
Continue While
|
||||
End If
|
||||
@@ -92,13 +93,62 @@ Public Class SupervisorMachGroupPanelVM
|
||||
If Not bOk OrElse UsedMachine.nType = MachineType.NULL Then
|
||||
EgtOutLog("Machine incompatible with beam & wall machining!!")
|
||||
ElseIf UsedMachine.nType = MachineType.BEAM Then
|
||||
Map.refSupervisorMachGroupPanelVM.m_MyMachGroupPanelM.AddMachGroup(BeamMachGroupM.CreateBeamMachGroup(nId, sName, sMachine))
|
||||
Map.refProjectVM.ProdMachGroupPanelVM.m_MyMachGroupPanelM.AddMachGroup(BeamMachGroupM.CreateBeamMachGroup(nId, sName, sMachine))
|
||||
ElseIf UsedMachine.nType = MachineType.WALL Then
|
||||
Map.refSupervisorMachGroupPanelVM.m_MyMachGroupPanelM.AddMachGroup(WallMachGroupM.CreateWallMachGroup(nId, sName, sMachine))
|
||||
Map.refProjectVM.ProdMachGroupPanelVM.m_MyMachGroupPanelM.AddMachGroup(WallMachGroupM.CreateWallMachGroup(nId, sName, sMachine))
|
||||
End If
|
||||
nId = EgtGetNextMachGroup(nId)
|
||||
End While
|
||||
EgtResetCurrMachGroup()
|
||||
' carico solo elementi passati al supervisore
|
||||
Dim TempList As List(Of MachGroupModel) = DbControllers.m_MachGroupController.GetByProdSupervisor(Map.refSupervisorManagerVM.CurrProd.nProdId, m_SupervisorId)
|
||||
For Each DBMachGroup In TempList
|
||||
If Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x) x.Id = DBMachGroup.MachGroupId) Then Continue For
|
||||
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.ProdMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = DBMachGroup.MachGroupId)
|
||||
' leggo dati da Db
|
||||
MachGroup.dtStartTime = DBMachGroup.DtStart
|
||||
MachGroup.dtEndTime = DBMachGroup.DtEnd
|
||||
MachGroup.MyMachGroupM.SetProductionState(DBMachGroup.State)
|
||||
For Each Part In MachGroup.PartVMList
|
||||
Dim DBPart As PartModel = DbControllers.m_PartController.FindByPartId(Part.nPartId)
|
||||
Part.dtStartTime = DBPart.DtStart
|
||||
Part.dtEndTime = DBPart.DtEnd
|
||||
Part.nProduction_State = DBPart.State
|
||||
Next
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.AddMachGroupToSupervisor(MachGroup)
|
||||
Next
|
||||
|
||||
|
||||
|
||||
|
||||
'' Carico i gruppi di lavorazione nella lista
|
||||
'Dim nId = EgtGetFirstMachGroup()
|
||||
'While nId <> GDB_ID.NULL
|
||||
' ' se gia' presente, vado al prossimo
|
||||
' If Map.refSupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x) x.Id = nId) Then
|
||||
' nId = EgtGetNextMachGroup(nId)
|
||||
' Continue While
|
||||
' End If
|
||||
' ' altrimenti lo carico
|
||||
' EgtSetCurrMachGroup(nId)
|
||||
' Dim sName As String = String.Empty
|
||||
' Dim sMachine As String = String.Empty
|
||||
' EgtGetMachGroupName(nId, sName)
|
||||
' EgtGetMachGroupMachineName(nId, sMachine)
|
||||
' ' cerco la macchina tra quelle presenti
|
||||
' Dim UsedMachine As MyMachine = Nothing
|
||||
' Dim bOk As Boolean = Machine.SearchMachine(sMachine, MachineList, UsedMachine)
|
||||
' If Not bOk OrElse UsedMachine.nType = MachineType.NULL Then
|
||||
' EgtOutLog("Machine incompatible with beam & wall machining!!")
|
||||
' ElseIf UsedMachine.nType = MachineType.BEAM Then
|
||||
' Map.refSupervisorMachGroupPanelVM.m_MyMachGroupPanelM.AddMachGroup(BeamMachGroupM.CreateBeamMachGroup(nId, sName, sMachine))
|
||||
' ElseIf UsedMachine.nType = MachineType.WALL Then
|
||||
' Map.refSupervisorMachGroupPanelVM.m_MyMachGroupPanelM.AddMachGroup(WallMachGroupM.CreateWallMachGroup(nId, sName, sMachine))
|
||||
' End If
|
||||
' nId = EgtGetNextMachGroup(nId)
|
||||
'End While
|
||||
'EgtResetCurrMachGroup()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
@@ -123,7 +123,7 @@ Class MachManaging
|
||||
' recupero pezzo
|
||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||
' scrivo stato start
|
||||
Part.nCALC_State = 1
|
||||
Part.nProduction_State = 1
|
||||
Part.dtStartTime = dtStart
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nCALC_State))
|
||||
' azzero variabile per far ripartire macchina
|
||||
@@ -150,9 +150,11 @@ Class MachManaging
|
||||
' recupero pezzo
|
||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||
' scrivo stato end
|
||||
Part.nCALC_State = 2
|
||||
Part.nProduction_State = 2
|
||||
Part.dtEndTime = dtEnd
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nCALC_State))
|
||||
' resetto stato redo
|
||||
Part.bRedo = False
|
||||
' azzero variabile per far ripartire macchina
|
||||
Tpa.RWVariableManager.WriteVar(P_STATE, 0)
|
||||
' se tutti i pezzi della barra sono in end
|
||||
|
||||
@@ -70,52 +70,4 @@ Module LuaExec
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function ExecNesting(sFile As String, sMachine As String, PartList As List(Of BTLPartM), dLength As Double, dWidth As Double, dStartOffset As Double, dOffset As Double, dKerf As Double) As Boolean
|
||||
EgtOutLog("-- Start ExecNest --")
|
||||
' Recupero lo script da eseguire
|
||||
Dim sExecPath As String = ""
|
||||
Dim sExecName As String = ""
|
||||
GetMainPrivateProfileString(S_NEST, K_NESTEXEC, "", sExecName)
|
||||
Dim sRoot As String = ""
|
||||
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM Then
|
||||
sRoot = Map.refMainWindowVM.MainWindowM.sBeamRoot
|
||||
ElseIf Map.refMachinePanelVM.SelectedMachine.nType = MachineType.WALL Then
|
||||
sRoot = Map.refMainWindowVM.MainWindowM.sWallRoot
|
||||
End If
|
||||
sExecPath = (sRoot & "\" & sExecName).TrimEnd({"\"c})
|
||||
If Not My.Computer.FileSystem.FileExists(sExecPath) Then
|
||||
EgtOutLog("Not found NestExec script " & sExecPath)
|
||||
Return False
|
||||
End If
|
||||
' Assegno i dati
|
||||
EgtLuaCreateGlobTable("NEST")
|
||||
EgtLuaSetGlobStringVar("NEST.FILE", sFile)
|
||||
EgtLuaSetGlobStringVar("NEST.MACHINE", sMachine)
|
||||
EgtLuaSetGlobNumVar("NEST.LEN", dLength)
|
||||
EgtLuaSetGlobNumVar("NEST.WIDTH", dWidth)
|
||||
EgtLuaSetGlobNumVar("NEST.STARTOFFSET", dStartOffset)
|
||||
EgtLuaSetGlobNumVar("NEST.OFFSET", dOffset)
|
||||
EgtLuaSetGlobNumVar("NEST.KERF", dKerf)
|
||||
EgtLuaCreateGlobTable("PART")
|
||||
For PartIndex = 0 To PartList.Count - 1
|
||||
EgtLuaSetGlobIntVar("PART." & PartList(PartIndex).nPartId.ToString(), PartList(PartIndex).nCNT - PartList(PartIndex).nINPROD)
|
||||
Next
|
||||
' Eseguo lo script
|
||||
Dim bOk As Boolean = False
|
||||
If EgtLuaExecFile(sExecPath) Then
|
||||
' Recupero i risultati
|
||||
Dim nErr As Integer = 999
|
||||
EgtLuaGetGlobIntVar("NEST.ERR", nErr)
|
||||
bOk = (nErr <= 0)
|
||||
If Not bOk Then EgtOutLog("NestExec Err=" & nErr.ToString())
|
||||
Else
|
||||
bOk = False
|
||||
EgtOutLog("Error executing Nest Exec script " & sExecPath)
|
||||
End If
|
||||
' Cancello tavola globale
|
||||
EgtLuaResetGlobVar("NEST")
|
||||
EgtLuaResetGlobVar("PART")
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -24,25 +24,28 @@ Public Class ViewerOptimizerComm
|
||||
Dim MachGroupList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetFrom(Map.refSupervisorManagerVM.CurrProd.nModificationIndex + 1)
|
||||
Dim bReloadFile As Boolean = False
|
||||
For Each MachGroupModification In MachGroupList
|
||||
Select Case MachGroupModification.Operation
|
||||
Case Core.StatusMapOpType.MachGroupAdd
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.Add(MachGroupModification.ItemId, {MachGroupModification.Index, MachGroupModification.Index})
|
||||
Case Core.StatusMapOpType.MachGroupMod
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList(MachGroupModification.ItemId)(0) = MachGroupModification.Index
|
||||
Case Core.StatusMapOpType.MachGroupRem
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.Remove(MachGroupModification.ItemId)
|
||||
Case Core.StatusMapOpType.MachGroupAssignedToSupervisor
|
||||
Dim MachgroupIndexes As Integer() = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList(MachGroupModification.ItemId)
|
||||
' se indice di aggiornamento file diverso da indice ultima modifica
|
||||
If MachgroupIndexes(0) <> MachgroupIndexes(1) Then
|
||||
' devo ricaricare il file
|
||||
bReloadFile = True
|
||||
' ricarico il progetto
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.ReloadProjectFile()
|
||||
End If
|
||||
' lo aggiungo alla lista di MachGroup
|
||||
' Map.refProjectVM.SupervisorMachGroupPanelVM.AddMachGroupToSupervisor(Map.refProjectVM.ProdMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroupModification.ItemId))
|
||||
End Select
|
||||
If MachGroupModification.ItemType = Core.StatusMapItemType.MachGroup Then
|
||||
Select Case MachGroupModification.Operation
|
||||
Case Core.StatusMapOpType.MachGroupAdd
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.Add(MachGroupModification.ItemId, {MachGroupModification.Index, MachGroupModification.Index})
|
||||
Case Core.StatusMapOpType.MachGroupMod
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList(MachGroupModification.ItemId)(0) = MachGroupModification.Index
|
||||
Case Core.StatusMapOpType.MachGroupRem
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.Remove(MachGroupModification.ItemId)
|
||||
Case Core.StatusMapOpType.MachGroupAssignedToSupervisor
|
||||
Dim MachgroupIndexes As Integer() = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList(MachGroupModification.ItemId)
|
||||
' se indice di aggiornamento file diverso da indice ultima modifica
|
||||
If MachgroupIndexes(0) <> MachgroupIndexes(1) Then
|
||||
' devo ricaricare il file
|
||||
bReloadFile = True
|
||||
' ricarico il progetto
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.ReloadProjectFile()
|
||||
Else
|
||||
' lo aggiungo alla lista di MachGroup
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.AddMachGroupToSupervisor(Map.refProjectVM.ProdMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroupModification.ItemId))
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
Next
|
||||
' se devo ricaricare il file
|
||||
If bReloadFile Then
|
||||
|
||||
@@ -363,15 +363,17 @@ Public Class CALCPanelVM
|
||||
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
' se barra gia' assegnata a supervisore, esco
|
||||
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
|
||||
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
|
||||
Dim MachineName As String = ""
|
||||
EgtGetMachGroupMachineName(Map.refMachGroupPanelVM.SelectedMachGroup.Id, MachineName)
|
||||
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refMachGroupPanelVM.SelectedMachGroup.Id,
|
||||
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
|
||||
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
|
||||
.nProgramPage = ProjectType.PROD,
|
||||
.nProjType = ProjType,
|
||||
.bBarOk = True,
|
||||
.nMachineName = MachineName}
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
Select Case SelMachGroup.nGlobalState
|
||||
Case Core.CalcStates.OK, CalcStates.INFO
|
||||
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
|
||||
@@ -471,6 +473,8 @@ Public Class CALCPanelVM
|
||||
Dim TempBarList(Map.refMachGroupPanelVM.MachGroupVMList.Count - 1) As EgtBEAMWALL.Core.Bar
|
||||
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
|
||||
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(PartIndex)
|
||||
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
|
||||
If CurrMachGroup.nProduction_State >= ItemState.Assigned Then Continue For
|
||||
Dim MachineName As String = ""
|
||||
EgtGetMachGroupMachineName(CurrMachGroup.Id, MachineName)
|
||||
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrMachGroup.Id,
|
||||
|
||||
@@ -5,32 +5,29 @@
|
||||
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
|
||||
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||
|
||||
<Button Content="V"
|
||||
FontSize="20"
|
||||
<Button FontSize="20"
|
||||
FontWeight="Light"
|
||||
ToolTip="{Binding Verify_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding Verify_Command}"
|
||||
IsEnabled="{Binding CALCPanel_IsEnabled}">
|
||||
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
|
||||
<Image Source="/Resources/CALCPanel/09_verifica.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Content="Vall"
|
||||
FontSize="20"
|
||||
<Button FontSize="20"
|
||||
FontWeight="Light"
|
||||
ToolTip="{Binding Verify_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding VerifyAll_Command}"
|
||||
IsEnabled="{Binding CALCPanel_IsEnabled}">
|
||||
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
|
||||
<Image Source="/Resources/CALCPanel/12_verifica tutto.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Content="S"
|
||||
FontSize="20"
|
||||
<Button FontSize="20"
|
||||
FontWeight="Light"
|
||||
ToolTip="{Binding Simulate_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding Simulate_Command}"
|
||||
IsEnabled="{Binding CALCPanel_IsEnabled}">
|
||||
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
|
||||
<Image Source="/Resources/CALCPanel/15_simula.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -225,6 +225,7 @@
|
||||
<DependentUpon>EgtDataGrid.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\DisableModifiedMgr.vb" />
|
||||
<Compile Include="Utility\LuaExec.vb" />
|
||||
<Compile Include="Utility\MachineModel.vb" />
|
||||
<Compile Include="Utility\DataGridColumnsIniFile.vb" />
|
||||
<Compile Include="Utility\TreeViewItemBase.vb" />
|
||||
@@ -316,7 +317,6 @@
|
||||
<Compile Include="Utility\Dictionary.xaml.vb">
|
||||
<DependentUpon>Dictionary.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\LuaExec.vb" />
|
||||
<Compile Include="Utility\MachParamIniFile.vb" />
|
||||
<Compile Include="Utility\Map.vb" />
|
||||
<Compile Include="Utility\RawPartConfiguration.vb" />
|
||||
@@ -744,6 +744,11 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ProjectManager\ExportProject.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\CALCPanel\09_verifica.png" />
|
||||
<Resource Include="Resources\CALCPanel\12_verifica tutto.png" />
|
||||
<Resource Include="Resources\CALCPanel\15_simula.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 720 B |
Binary file not shown.
|
After Width: | Height: | Size: 781 B |
Binary file not shown.
|
After Width: | Height: | Size: 694 B |
@@ -3,6 +3,7 @@ Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
|
||||
Public Class MySceneHostVM
|
||||
Inherits EgtWPFLib5.SceneHostVM
|
||||
@@ -489,10 +490,23 @@ Public Class MySceneHostVM
|
||||
' leggo struttura BTL
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjId))
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
' 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 gruppi di lavorazione
|
||||
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
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user