- aggiunto ExecProcessManager

- aggiornata finestra BtlDataWnd per gestione multiprogetto
- fix aggiunta progetto
This commit is contained in:
Emmanuele Sassi
2025-09-04 11:05:20 +02:00
parent e6601930c4
commit 5527a7e316
16 changed files with 730 additions and 312 deletions
@@ -325,7 +325,7 @@ Public Module CalcIntegration
RaiseEvent Calc_Ended(Nothing, New CalcEndEventArgs(If(bIsSimulation And Not bIsSimulationVerifyed, CmdTypes.SIMULATE, CmdTypes.CHECKGEN), If(bAllKO, CalcEndEventArgs.Results.ERROR_, CalcEndEventArgs.Results.OK)))
End Sub
Private Function CreateNewProjectFromPart(nPartId As Integer, sProjDirPath As String) As String
Public Function CreateNewProjectFromPart(nPartId As Integer, sProjDirPath As String) As String
' Aggiorno identificativi per segnalazione errori
UpdateCutIdAndTaskId(nPartId)
@@ -354,7 +354,7 @@ Public Module CalcIntegration
Return If(bOk, sPartFilePath, String.Empty)
End Function
Private Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String, nGlobState As Integer) As String
Public Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String, nGlobState As Integer) As String
' aggiorno cutid e taskid solo fuori dal supervisore o se pezzo ricalcolato
If Not m_bIsSupervisor OrElse nGlobState = CalcStates.NOTCALCULATED Then
Dim DisableMgr As DisableModifiedMgr = Nothing
+8
View File
@@ -35,6 +35,8 @@ Public Module ConstIni
Public Const K_FASTPRODUCE As String = "FastProduce"
Public Const K_ADDPROJ As String = "AddProj"
Public Const K_PROJECTMODE As String = "ProjectMode"
Public Const K_CAMEXEPATH As String = "CAMExePath"
Public Const K_PIPELUADIR As String = "PipeLuaDir"
Public Const K_SHOWBUILDING As String = "ShowBuilding"
@@ -60,6 +62,11 @@ Public Module ConstIni
Public Const K_WALLBASEDIR As String = "BaseDir"
Public Const K_WALLBWEEXEC As String = "BweExec"
Public Const S_EXECGROUP As String = "ExecGroup"
Public Const K_ENVIRONMENT As String = "Environment"
Public Const K_PIPELUAFILE As String = "PipeLuaFile"
Public Const K_MAXCAMINSTANCES As String = "MaxCAMInstances"
Public Const S_MACHINELOGFILTER As String = "MachineLogFilters"
Public Const K_PARTEVENTTYPE As String = "PartEventType"
Public Const K_ENTITYTYPE As String = "EntityType"
@@ -121,4 +128,5 @@ Public Module ConstIni
' Server Address
Public Const K_SERVERADDRESS As String = "ServerAddressRelease"
Public Const K_BEAMWALL As String = "EgtBeamWall"
End Module
@@ -27,140 +27,116 @@
<TextBlock Text="{Binding PROJNUM_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJNUM, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sPROJNUM, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sPROJNAME, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJPART_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJPART, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sPROJPART, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJGUID_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJGUID, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sPROJGUID, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding LISTNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sLISTNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sLISTNAME, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding CUSTOMER_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sCUSTOMER, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sCUSTOMER, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding ARCHITECT_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sARCHITECT, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sARCHITECT, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EDITOR_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEDITOR, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sEDITOR, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding DELIVDATE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sDELIVDATE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sDELIVDATE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPDATE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPDATE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sEXPDATE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPTIME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPTIME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sEXPTIME, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPRELEASE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPRELEASE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sEXPRELEASE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding LANGUAGE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sLANGUAGE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sLANGUAGE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding RANGE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocRANGE,
ItemsSource="{Binding ocRANGE,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.SelRANGE,
SelectedIndex="{Binding SelRANGE,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding PROCESSINGQUALITY_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocPROCESSINGQUALITY,
ItemsSource="{Binding ocPROCESSINGQUALITY,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.SelPROCESSINGQUALITY,
SelectedIndex="{Binding SelPROCESSINGQUALITY,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding COMPUTERNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sCOMPUTERNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sCOMPUTERNAME, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding USER_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sUSER, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sUSER, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding SRCFILE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sSRCFILE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sSRCFILE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPFILE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPFILE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sEXPFILE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding RECESS_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocRECESS,
ItemsSource="{Binding ocRECESS,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.SelRECESS,
SelectedIndex="{Binding SelRECESS,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding USERATTRIBUTE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sUSERATTRIBUTE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Text="{Binding sUSERATTRIBUTE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
</UniformGrid>
@@ -7,7 +7,6 @@
' This call is required by the designer.
InitializeComponent()
Me.DataContext = BTLDataWndVM
Me.Tag = Map.refProjectVM.BTLStructureVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_BTLDataWndVM = BTLDataWndVM
End Sub
@@ -32,6 +32,353 @@ Public Class BTLDataWndVM
End Property
Private m_nBTLInfoLayerId As Integer = -1
Public ReadOnly Property nBTLInfoId As Integer
Get
Return m_nBTLInfoLayerId
End Get
End Property
#Region "Parametri generici"
Public m_sPROJNUM As String
Public Property sPROJNUM As String
Get
Return m_sPROJNUM
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJNUM, value) Then
m_sPROJNUM = value
Else
NotifyPropertyChanged(NameOf(sPROJNUM))
End If
End Set
End Property
Public m_sPROJNAME As String
Public Property sPROJNAME As String
Get
Return m_sPROJNAME
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJNAME, value) Then
m_sPROJNAME = value
Else
NotifyPropertyChanged(NameOf(sPROJNAME))
End If
End Set
End Property
Public m_sPROJPART As String
Public Property sPROJPART As String
Get
Return m_sPROJPART
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJPART, value) Then
m_sPROJPART = value
Else
NotifyPropertyChanged(NameOf(sPROJPART))
End If
End Set
End Property
Public m_sPROJGUID As String
Public Property sPROJGUID As String
Get
Return m_sPROJGUID
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJGUID, value) Then
m_sPROJGUID = value
Else
NotifyPropertyChanged(NameOf(sPROJGUID))
End If
End Set
End Property
Public m_nPROJTYPE As Integer
Public ReadOnly Property nPROJTYPE As BWType
Get
Select Case Map.refMainMenuVM.SelPage
Case Pages.ONLYPRODPAGE
Return Map.refOnlyProdManagerVM.nProdType
Case Else
Return BWType.NULL
End Select
End Get
End Property
Public m_sLISTNAME As String
Public Property sLISTNAME As String
Get
Return m_sLISTNAME
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_LISTNAME, value) Then
DbControllers.m_ProjController.UpdateListName(ProjectManagerVM.CurrProj.nProjId, value)
m_sLISTNAME = value
Else
NotifyPropertyChanged(NameOf(sLISTNAME))
End If
End Set
End Property
Public m_sCUSTOMER As String
Public Property sCUSTOMER As String
Get
Return m_sCUSTOMER
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_CUSTOMER, value) Then
m_sCUSTOMER = value
Else
NotifyPropertyChanged(NameOf(sCUSTOMER))
End If
End Set
End Property
Public m_sARCHITECT As String
Public Property sARCHITECT As String
Get
Return m_sARCHITECT
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_ARCHITECT, value) Then
m_sARCHITECT = value
Else
NotifyPropertyChanged(NameOf(sARCHITECT))
End If
End Set
End Property
Public m_sEDITOR As String
Public Property sEDITOR As String
Get
Return m_sEDITOR
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_EDITOR, value) Then
m_sEDITOR = value
Else
NotifyPropertyChanged(NameOf(sEDITOR))
End If
End Set
End Property
Public m_sDELIVDATE As String
Public Property sDELIVDATE As String
Get
Return m_sDELIVDATE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_DELIVDATE, value) Then
m_sDELIVDATE = value
Else
NotifyPropertyChanged(NameOf(sDELIVDATE))
End If
End Set
End Property
Public m_sEXPDATE As String
Public Property sEXPDATE As String
Get
Return m_sEXPDATE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPDATE, value) Then
m_sEXPDATE = value
Else
NotifyPropertyChanged(NameOf(sEXPDATE))
End If
End Set
End Property
Public m_sEXPTIME As String
Public Property sEXPTIME As String
Get
Return m_sEXPTIME
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPTIME, value) Then
m_sEXPTIME = value
Else
NotifyPropertyChanged(NameOf(sEXPTIME))
End If
End Set
End Property
Public m_sEXPRELEASE As String
Public Property sEXPRELEASE As String
Get
Return m_sEXPRELEASE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPRELEASE, value) Then
m_sEXPRELEASE = value
Else
NotifyPropertyChanged(NameOf(sEXPRELEASE))
End If
End Set
End Property
Public m_sLANGUAGE As String
Public Property sLANGUAGE As String
Get
Return m_sLANGUAGE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_LANGUAGE, value) Then
m_sLANGUAGE = value
Else
NotifyPropertyChanged(NameOf(sLANGUAGE))
End If
End Set
End Property
Public m_ocRANGE As New List(Of Object)({New IdNameStruct(Range.STANDARD, EgtMsg(61710)),
New IdNameStruct(Range.EXTENDED, EgtMsg(61711))})
Public ReadOnly Property ocRANGE As List(Of Object)
Get
Return m_ocRANGE
End Get
End Property
Public m_SelRANGE As Integer
Public Property SelRANGE As Integer
Get
Return m_SelRANGE
End Get
Set(value As Integer)
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocRANGE)
Dim sValue As String = [Enum].GetName(GetType(Range), nValue)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_RANGE, sValue) Then
m_SelRANGE = value
Else
NotifyPropertyChanged(NameOf(SelRANGE))
End If
End Set
End Property
Public m_ocPROCESSINGQUALITY As New List(Of Object)({New IdNameStruct(ProcessingQuality.AUTOMATIC, EgtMsg(61658)),
New IdNameStruct(ProcessingQuality.VISIBLE, EgtMsg(61659)),
New IdNameStruct(ProcessingQuality.FAST, EgtMsg(61660))})
Public ReadOnly Property ocPROCESSINGQUALITY As List(Of Object)
Get
Return m_ocPROCESSINGQUALITY
End Get
End Property
Public m_SelPROCESSINGQUALITY As Integer
Public Property SelPROCESSINGQUALITY As Integer
Get
Return m_SelPROCESSINGQUALITY
End Get
Set(value As Integer)
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocPROCESSINGQUALITY)
Dim sValue As String = [Enum].GetName(GetType(ProcessingQuality), nValue)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_PRT_PROCESSINGQUALITY, sValue) Then
m_SelPROCESSINGQUALITY = value
Else
NotifyPropertyChanged(NameOf(SelPROCESSINGQUALITY))
End If
End Set
End Property
Public m_sCOMPUTERNAME As String
Public Property sCOMPUTERNAME As String
Get
Return m_sCOMPUTERNAME
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_COMPUTERNAME, value) Then
m_sCOMPUTERNAME = value
Else
NotifyPropertyChanged(NameOf(sCOMPUTERNAME))
End If
End Set
End Property
Public m_sUSER As String
Public Property sUSER As String
Get
Return m_sUSER
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_USER, value) Then
m_sUSER = value
Else
NotifyPropertyChanged(NameOf(sUSER))
End If
End Set
End Property
Public m_sSRCFILE As String
Public Property sSRCFILE As String
Get
Return m_sSRCFILE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_SRCFILE, value) Then
m_sSRCFILE = value
Else
NotifyPropertyChanged(NameOf(sSRCFILE))
End If
End Set
End Property
Public m_sEXPFILE As String
Public Property sEXPFILE As String
Get
Return m_sEXPFILE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPFILE, value) Then
m_sEXPFILE = value
Else
NotifyPropertyChanged(NameOf(sEXPFILE))
End If
End Set
End Property
Public m_ocRECESS As New List(Of Object)({New IdNameStruct(Recess.AUTOMATIC, EgtMsg(61658)),
New IdNameStruct(Recess.MANUAL, EgtMsg(61661))})
Public ReadOnly Property ocRECESS As List(Of Object)
Get
Return m_ocRECESS
End Get
End Property
Public m_SelRECESS As Integer
Public Property SelRECESS As Integer
Get
Return m_SelRECESS
End Get
Set(value As Integer)
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocRECESS)
Dim sValue As String = [Enum].GetName(GetType(Recess), nValue)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_PRT_RECESS, sValue) Then
m_SelRECESS = value
Else
NotifyPropertyChanged(NameOf(SelRECESS))
End If
End Set
End Property
Public m_sUSERATTRIBUTE As String
Public Property sUSERATTRIBUTE As String
Get
Return m_sUSERATTRIBUTE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_USERATTRIBUTE, value) Then
m_sUSERATTRIBUTE = value
Else
NotifyPropertyChanged(NameOf(sUSERATTRIBUTE))
End If
End Set
End Property
#End Region ' Parametri generici
#Region "Messages"
@@ -181,23 +528,53 @@ Public Class BTLDataWndVM
'Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId
' cerco tra i layer BTLInfo
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nBTLInfoLayerId <> GDB_ID.NULL
Dim nCurrBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nCurrBTLInfoLayerId <> GDB_ID.NULL
' verifico se il layer appartiene al ProjId
Dim nBTLInfoLayerProjId As Integer
EgtGetInfo(nBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoLayerProjId)
EgtGetInfo(nCurrBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoLayerProjId)
If nBTLInfoLayerProjId = nProjId Then
m_nBTLInfoLayerId = nBTLInfoLayerId
m_nBTLInfoLayerId = nCurrBTLInfoLayerId
Exit While
End If
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
nCurrBTLInfoLayerId = EgtGetNextName(nCurrBTLInfoLayerId, BTLINFO)
End While
' leggo parametri Btl
ReadBtlParams()
' leggo strategia
EgtGetInfo(m_nBTLInfoLayerId, "AISETUP", m_SelStrategySetup)
End Sub
#End Region ' CONSTRUCTOR
Private Sub ReadBtlParams()
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJNUM, m_sPROJNUM)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJNAME, m_sPROJNAME)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJPART, m_sPROJPART)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJGUID, m_sPROJGUID)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJTYPE, m_nPROJTYPE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_LISTNAME, m_sLISTNAME)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_CUSTOMER, m_sCUSTOMER)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_ARCHITECT, m_sARCHITECT)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_EDITOR, m_sEDITOR)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_DELIVDATE, m_sDELIVDATE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPDATE, m_sEXPDATE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPTIME, m_sEXPTIME)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPRELEASE, m_sEXPRELEASE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_LANGUAGE, m_sLANGUAGE)
Dim sValue As String = String.Empty
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_RANGE, sValue)
m_SelRANGE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocRANGE), ocRANGE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_PRT_PROCESSINGQUALITY, sValue)
m_SelPROCESSINGQUALITY = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocPROCESSINGQUALITY), ocPROCESSINGQUALITY)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_COMPUTERNAME, m_sCOMPUTERNAME)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_USER, m_sUSER)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_SRCFILE, m_sSRCFILE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPFILE, m_sEXPFILE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_PRT_RECESS, sValue)
m_SelRECESS = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocRECESS), ocRECESS)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_USERATTRIBUTE, m_sUSERATTRIBUTE)
End Sub
#Region "COMMANDS"
#Region "Ok"
@@ -1,10 +1,9 @@
Imports System.Collections.ObjectModel
Imports EgtWPFLib5
Imports EgtUILib
Imports EgtBEAMWALL.Core
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLPartVM
Inherits VMBase
@@ -2337,62 +2336,8 @@ Public Class BTLPartVM
''' </summary>
Friend Sub Verify()
If ((IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
Dim ProjType As BWType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
ProjType = ProjectManagerVM.CurrProd.nType
If Not CreateBarToVerify(ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000"), AddressOf ManageCalc)
End Sub
Private Function CreateBarToVerify(ProjType As BWType, ByRef BarList As Bar()) As Boolean
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return False
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = ProjectManagerVM.CurrProd.sMachine,
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
Select Case Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKNOSIM
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
Return True
End Function
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
If dProgress = 0 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
ElseIf dProgress = 1 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
Map.refMyStatusBarVM.SetOutputMessage(sProgress, 3)
End If
bCancel = Map.refMyStatusBarVM.bStopProgress
Map.refMyStatusBarVM.SetLoadingProgress(dProgress * 100)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
Map.refCALCPanelVM.Verify(ProjectType.PROJ)
Return
End Sub
#End Region ' Verify
+156 -30
View File
@@ -1,9 +1,12 @@
Imports System.IO
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Threading
Imports System.Windows.Threading
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Imports System.Collections.ObjectModel
Imports System.Windows.Threading
Imports EgwMultiEngineManager.Data
Imports EgwMultiEngineManager.Data.Constants
Public Class CALCPanelVM
Inherits VMBase
@@ -209,7 +212,7 @@ Public Class CALCPanelVM
ProcessResults(Bar.sBarPath, Bar.nProgramPage, Bar.nBarId)
End Sub
Private Shared Sub ProcessResults(BtlPath As String, nProgramPage As ProjectType, nBarId As Integer)
Friend Shared Sub ProcessResults(BtlPath As String, nProgramPage As ProjectType, nBarId As Integer)
Dim ResPath As String = Path.ChangeExtension(BtlPath, ".txt")
Dim bErrors As Boolean = False
@@ -539,18 +542,123 @@ Public Class CALCPanelVM
'NotifyPropertyChanged(NameOf(Edit_IsEnabled))
End Sub
Friend Sub Verify()
Friend Sub Verify(ProgramPage As ProjectType)
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
Dim ProjType As BWType = ProjectManagerVM.CurrProd.nType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000"), AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
If GetMainPrivateProfileInt(S_GENERAL, "UseCam5", 0) = 1 Then
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000"), AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
Else
Dim ExecThread As New Thread(Sub()
VerifyWithEngine(ProgramPage)
End Sub)
ExecThread.Start()
End If
End Sub
Private Sub VerifyProjWithEngine(CurrPart As BTLPartVM)
If Not CurrPart.bDO Then Return
Dim Args As New Dictionary(Of String, String)
Args.Add("BarId", CurrPart.nPartId)
Args.Add("ProgramPage", ProjectType.PROJ)
Dim BarPath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & CurrPart.nPROJ.ToString("0000")
Args.Add("BarPath", BarPath)
Args.Add("ProjType", ProjectManagerVM.CurrProd.nType)
Args.Add("MachineName", ProjectManagerVM.CurrProd.sMachine)
Args.Add("GlobState", CurrPart.nGlobalState)
Dim nCmdType As CalcIntegration.CmdTypes = CmdTypes.GENERATE
Select Case CurrPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = BarPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
nCmdType = CalcIntegration.CmdTypes.CHECKNOSIM
End Select
Args.Add("CmdType", nCmdType)
Dim ExecEnvironment As EXECENVIRONMENTS = EXECENVIRONMENTS.NULL
Select Case ProjectManagerVM.CurrProd.nType
Case BWType.BEAM
ExecEnvironment = EXECENVIRONMENTS.BEAM
Case BWType.WALL
ExecEnvironment = EXECENVIRONMENTS.WALL
End Select
Dim Request As New QuestionDTO(1, ExecEnvironment, Args)
Request.Args("BarPath") = CreateNewProjectFromPart(CurrPart.nPartId, BarPath)
EgtOutLog("Creato progetto " & CurrPart.nPartId)
If Request.ExecEnvironment <> EXECENVIRONMENTS.NULL Then
MyExecProcessManager.ExecProcessManagerList(Request.ExecEnvironment).ArgumentsEnqueue(Request)
End If
End Sub
Private Sub VerifyProdWithEngine(CurrMachGroup As MyMachGroupVM)
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
If CurrMachGroup.nProduction_State >= ItemState.Assigned Then Return
Dim Args As New Dictionary(Of String, String)
Args.Add("BarId", CurrMachGroup.Id)
Args.Add("ProgramPage", ProjectType.PROD)
Dim BarPath As String = ProjectManagerVM.CurrProd.sProdDirPath
Args.Add("BarPath", BarPath)
Args.Add("ProjType", ProjectManagerVM.CurrProd.nType)
Dim MachineName As String = ""
EgtGetMachGroupMachineName(CurrMachGroup.Id, MachineName)
Args.Add("MachineName", MachineName)
Args.Add("GlobState", CurrMachGroup.nGlobalState)
Dim nCmdType As CalcIntegration.CmdTypes = CmdTypes.GENERATE
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = BarPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
Args.Add("CmdType", nCmdType)
Dim ExecEnvironment As EXECENVIRONMENTS = EXECENVIRONMENTS.NULL
Select Case ProjectManagerVM.CurrProd.nType
Case BWType.BEAM
ExecEnvironment = EXECENVIRONMENTS.BEAM
Case BWType.WALL
ExecEnvironment = EXECENVIRONMENTS.WALL
End Select
Dim Request As New QuestionDTO(1, ExecEnvironment, Args)
Request.Args("BarPath") = CreateNewProjectFromMachGroup(CurrMachGroup.Id, BarPath, CurrMachGroup.nGlobalState)
EgtOutLog("Creato progetto " & CurrMachGroup.Id)
If Request.ExecEnvironment <> EXECENVIRONMENTS.NULL Then
MyExecProcessManager.ExecProcessManagerList(Request.ExecEnvironment).ArgumentsEnqueue(Request)
End If
End Sub
Private Sub VerifyWithEngine(ProgramPage As ProjectType)
Dim ProjType As BWType = ProjectManagerVM.CurrProd.nType
' lancio calcolo
Dim ExecEnvironment As EXECENVIRONMENTS = EXECENVIRONMENTS.NULL
Select Case ProjType
Case BWType.BEAM
ExecEnvironment = EXECENVIRONMENTS.BEAM
Case BWType.WALL
ExecEnvironment = EXECENVIRONMENTS.WALL
End Select
If ProgramPage = ProjectType.PROJ Then
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return
VerifyProjWithEngine(Map.refProjectVM.BTLStructureVM.SelBTLPart)
ElseIf ProgramPage = ProjectType.PROD Then
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
If Map.refMachGroupPanelVM.SelectedMachGroup.nProduction_State >= ItemState.Assigned Then Return
VerifyProdWithEngine(Map.refMachGroupPanelVM.SelectedMachGroup)
End If
End Sub
@@ -637,23 +745,41 @@ Public Class CALCPanelVM
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
End Sub
Friend Sub VerifyAll()
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
' se modalita' assemblato
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
Friend Sub VerifyAll(ProgramPage As ProjectType)
Dim ProjType As BWType = ProjectManagerVM.CurrProd.nType
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST Then
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000"), AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
If GetMainPrivateProfileInt(S_GENERAL, "UseCam5", 0) = 1 Then
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST Then
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000"), AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
Else
Dim ExecThread As New Thread(Sub()
VerifyAllWithEngine(ProgramPage)
End Sub)
ExecThread.Start()
End If
End Sub
Private Sub VerifyAllWithEngine(ProgramPage As ProjectType)
Dim QuestionList As New List(Of QuestionDTO)
If ProgramPage = ProjectType.PROJ Then
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex).bDO Then Continue For
VerifyProjWithEngine(Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex))
Next
ElseIf ProgramPage = ProjectType.PROD Then
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
If DirectCast(Map.refMachGroupPanelVM.MachGroupVMList(PartIndex), MyMachGroupVM).nProduction_State >= ItemState.Assigned Then Return
VerifyProdWithEngine(Map.refMachGroupPanelVM.MachGroupVMList(PartIndex))
Next
End If
End Sub
@@ -79,6 +79,9 @@
<Reference Include="EgtWPFLib5">
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
</Reference>
<Reference Include="EgwMultiEngineManager.Core">
<HintPath>..\ExtLibs\EgwMultiEngineManager.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="PresentationFramework.Aero2" />
<Reference Include="System.ComponentModel" />
@@ -140,6 +143,7 @@
<Compile Include="ConfigurationPage\OnlyProdMachine_ConfigurationPageV.xaml.vb">
<DependentUpon>OnlyProdMachine_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ExecProcessManager\MyExecProcessManager.vb" />
<Compile Include="ForcedStrategyBTL\ForcedStrategyBTLV.xaml.vb">
<DependentUpon>ForcedStrategyBTLV.xaml</DependentUpon>
</Compile>
@@ -969,6 +973,9 @@
<PackageReference Include="DotNetZip">
<Version>1.16.0</Version>
</PackageReference>
<PackageReference Include="EgwMultiEngineManager.Data">
<Version>2.7.9-beta.1</Version>
</PackageReference>
<PackageReference Include="EntityFramework">
<Version>6.4.4</Version>
</PackageReference>
@@ -0,0 +1,88 @@
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Core.ConstIni
Imports EgtUILib
Imports EgtWPFLib5
Imports EgwMultiEngineManager
Imports EgwMultiEngineManager.Data
Imports EgwMultiEngineManager.Data.Constants
Imports EgwMultiEngineManager.ExecProcessManager
Module MyExecProcessManager
Private m_ExecProcessManagerList As New Dictionary(Of EXECENVIRONMENTS, ExecProcessManager)
Public ReadOnly Property ExecProcessManagerList As Dictionary(Of EXECENVIRONMENTS, ExecProcessManager)
Get
Return m_ExecProcessManagerList
End Get
End Property
Friend Function Init() As Boolean
' creazione manager dei processi
Dim sCamExePath As String = ""
GetMainPrivateProfileString(S_GENERAL, K_CAMEXEPATH, "", sCamExePath)
EgtOutLog("CAMExePath = " & sCamExePath)
If Not File.Exists(sCamExePath) Then
Dim sMsg As String = "CAMExePath not found!"
EgtOutLog(sMsg)
Return False
End If
Dim sPipeLuaDir As String = ""
GetMainPrivateProfileString(S_GENERAL, K_PIPELUADIR, "", sPipeLuaDir)
EgtOutLog("PipeLuaDir = " & sPipeLuaDir)
If Not File.Exists(sCamExePath) Then
Dim sMsg As String = "PipeLuaDir not found!"
EgtOutLog(sMsg)
Return False
End If
Dim nGroupIndex As Integer = 1
Dim sEnvironment As String = ""
Dim sPipeLuaFile As String = ""
Dim nMaxCamInstances As Integer = 0
While GetMainPrivateProfileString(S_EXECGROUP & nGroupIndex.ToString(), K_ENVIRONMENT, "", sEnvironment) > 0 AndAlso
GetMainPrivateProfileString(S_EXECGROUP & nGroupIndex.ToString(), K_PIPELUAFILE, "", sPipeLuaFile) AndAlso
GetMainPrivateProfileString(S_EXECGROUP & nGroupIndex.ToString(), K_MAXCAMINSTANCES, "", nMaxCamInstances)
System.Console.WriteLine("Group" & nGroupIndex.ToString())
System.Console.WriteLine("Environment = " & sEnvironment)
System.Console.WriteLine("PipeLuaFile = " & sPipeLuaFile)
System.Console.WriteLine("MaxCAMInstances = " & nMaxCamInstances)
Dim Environment As EXECENVIRONMENTS = EXECENVIRONMENTS.NULL
Select Case sEnvironment
Case "BEAM"
Environment = EXECENVIRONMENTS.BEAM
Case "WALL"
Environment = EXECENVIRONMENTS.WALL
End Select
Dim PipeLuaPath As String = sPipeLuaDir & "\" & sPipeLuaFile
If nMaxCamInstances <= 0 OrElse Environment = EXECENVIRONMENTS.NULL OrElse Not File.Exists(PipeLuaPath) Then
System.Console.WriteLine(String.Format("Group{0} not created!", nGroupIndex.ToString()))
nGroupIndex += 1
Continue While
End If
Dim NewExecProcessManager As New ExecProcessManager(nGroupIndex, Environment, sCamExePath, PipeLuaPath, nMaxCamInstances, ReturnModes.EVENT_)
AddHandler NewExecProcessManager.m_AnswerReceived, AddressOf ExecProcessManager_AnswerReceived
NewExecProcessManager.StartExecutionThread()
m_ExecProcessManagerList.Add(Environment, NewExecProcessManager)
nGroupIndex += 1
End While
Return True
End Function
Private Sub ExecProcessManager_AnswerReceived(Answer As AnswerDTO)
Dim sBarPath As String = Answer.Args("BarPath")
Dim nProgramPage As Integer = -1
Integer.TryParse(Answer.Args("ProgramPage"), nProgramPage)
Dim nBarId As Integer = -1
Integer.TryParse(Answer.Args("BarId"), nBarId)
EgtOutLog("Risultato progetto " & nBarId)
Map.refCALCPanelVM.ProcessResults(sBarPath, nProgramPage, nBarId)
End Sub
Friend Function Close()
For Each Key In m_ExecProcessManagerList.Keys
m_ExecProcessManagerList(Key).Dispose()
Next
Return True
End Function
End Module
+2 -40
View File
@@ -2,7 +2,6 @@
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Imports System.IO
Public Class LeftPanelVM
Inherits VMBase
@@ -198,47 +197,10 @@ Public Class LeftPanelVM
''' </summary>
Friend Sub VerifyAll()
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
' se modalita' assemblato
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
Dim ProjType As BWType = ProjectManagerVM.CurrProd.nType
If Not CreateBarListToVerify(ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000"), AddressOf ManageCalc)
Map.refCALCPanelVM.VerifyAll(ProjectType.PROJ)
Return
End Sub
Private Function CreateBarListToVerify(ProjType As BWType, ByRef BarList As Bar()) As Boolean
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
If Not CurrPart.bDO Then Continue For
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = ProjectManagerVM.CurrProd.sMachine,
.nGlobState = CurrPart.nGlobalState}
Select Case CurrPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKNOSIM
End Select
TempBarList.Add(Bar)
Next
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
Return True
End Function
#End Region ' VerifyAll
#Region "ShowPopUpFilterBtnCommand"
@@ -1041,66 +1041,8 @@ Public Class MyMachGroupVM
''' </summary>
Friend Sub Verify()
If ((IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
Dim ProjType As BWType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
ProjType = ProjectManagerVM.CurrProd.nType
If Not CreateBarToVerify(ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End Sub
Private Function CreateBarToVerify(ProjType As BWType, ByRef BarList As Bar()) As Boolean
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 False
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nGlobState = SelMachGroup.nGlobalState}
Select Case SelMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (SelMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
Return True
End Function
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
If dProgress = 0 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
ElseIf dProgress = 1 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
Map.refMyStatusBarVM.SetOutputMessage(sProgress, 3)
End If
bCancel = Map.refMyStatusBarVM.bStopProgress
Map.refMyStatusBarVM.SetLoadingProgress(dProgress * 100)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
Map.refCALCPanelVM.Verify(ProjectType.PROD)
Return
End Sub
#End Region ' VerifyCommand
@@ -1160,6 +1102,26 @@ Public Class MyMachGroupVM
Return True
End Function
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
If dProgress = 0 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
ElseIf dProgress = 1 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
Map.refMyStatusBarVM.SetOutputMessage(sProgress, 3)
End If
bCancel = Map.refMyStatusBarVM.bStopProgress
Map.refMyStatusBarVM.SetLoadingProgress(dProgress * 100)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
End Sub
#End Region ' SimulateCommand
#Region "ProduceRawPart"
@@ -1185,7 +1147,7 @@ Public Class MyMachGroupVM
' se attiva opzione e non ancora calcolato
If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.SelectedMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
Map.refCALCPanelVM.SetFromProduce(CALCPanelVM.ProduceType.PRODUCE)
Map.refCALCPanelVM.Verify()
Map.refCALCPanelVM.Verify(ProjectType.PROD)
Return
End If
' verifico se modalita' supervisore attiva
@@ -1,12 +1,12 @@
Imports EgtBEAMWALL.Core
Imports System.IO
Imports System.Threading
Imports System.Windows.Forms
Imports System.Windows.Threading
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Core.ConstGen
Imports EgtBEAMWALL.Core.ConstIni
Imports EgtUILib
Imports EgtWPFLib5
Imports System.IO
Imports System.Threading
Imports System.Windows.Forms
Imports System.Windows.Threading
Public Class MainWindowVM
Inherits VMBase
@@ -128,6 +128,9 @@ Public Class MainWindowVM
End If
' imposto MainWindow per finestra di Loading
LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
' creazione manager dei processi
MyExecProcessManager.Init()
' seleziono pagina da aprire
Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE
' leggo riga di comando
@@ -383,6 +386,8 @@ Public Class MainWindowVM
If EgtGetCurrFilePath(sFilePath) Then WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFilePath)
' tolgo lock da file aperto
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
' chiudo esecutore Engine
MyExecProcessManager.Close()
' Termino il Model
m_MainWindowM.Close()
' Termino il programma
@@ -729,8 +729,20 @@ Public Class OnlyProdManagerVM
Private Function AddNewBTLProj(sImportFilePath As String, ProdFileVM As ProdFileVM, ByRef nProjId As Integer, ByRef sProjDir As String) As Boolean
'If ProdFileVM.VerifyProjectModification(CurrProd) = MessageBoxResult.Cancel Then Return False
'LoadingWndHelper.OpenLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63008), EgtMsg(63009), 50) ' BTL file importing ' Reading BTL file
' inizializzo nuovo progetto
If Not InitNewProj(nProjId, sProjDir, ProdFileVM.nType, ProdFileVM.sMachine) Then
EgtOutLog("Errore! Impossibile creare indice nuovo progetto!")
Return False
End If
' creo cartella per Proj
Dim sProjDirPath As String = ProdFileVM.sProdDirPath & "\Projs\" & nProjId.ToString("0000")
Try
Directory.CreateDirectory(sProjDirPath)
Catch ex As Exception
EgtOutLog("Errore! Impossibile creare cartella del Proj!")
End Try
' copio file BTL
Dim sBtlCopyPath As String = ProdFileVM.sProdDirPath & "\" & Path.GetFileName(sImportFilePath)
Dim sBtlCopyPath As String = sProjDirPath & "\" & Path.GetFileName(sImportFilePath)
Dim bOk = False
Try
File.Copy(sImportFilePath, sBtlCopyPath, True)
@@ -738,17 +750,6 @@ Public Class OnlyProdManagerVM
EgtOutLog("Errore! Impossibile copiare il file BTL!")
Return False
End Try
' inizializzo nuovo progetto
If Not InitNewProj(nProjId, sProjDir, ProdFileVM.nType, ProdFileVM.sMachine) Then
EgtOutLog("Errore! Impossibile creare indice nuovo progetto!")
' elimino file Btl copiato
Try
File.Delete(sBtlCopyPath)
Catch ex As Exception
EgtOutLog("Errore! Eliminazione file BTL copiato fallita!")
End Try
Return False
End If
' verifico tipo di file e recupero flag di importazione
Dim nFileType As Integer = EgtGetFileType(sBtlCopyPath)
If nFileType <> FT.BTL AndAlso nFileType <> FT.BTLX Then
@@ -2402,7 +2403,7 @@ Public Class OnlyProdManagerVM
Next
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) = 1 Then
' lancio verifica perche' importato
Map.refCALCPanelVM.VerifyAll()
Map.refCALCPanelVM.VerifyAll(ProjectType.PROJ)
End If
' salvo il progetto PROD
EgtSaveFile(sProjFromPath(0), NGE.CMPTEXT)
@@ -158,7 +158,7 @@ Public Class RawPartManagerVM
' se attiva opzione e non ancora calcolato
If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.SelectedMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
Map.refCALCPanelVM.SetFromProduce(CALCPanelVM.ProduceType.PRODUCE)
Map.refCALCPanelVM.Verify()
Map.refCALCPanelVM.Verify(ProjectType.PROD)
Return
End If
' verifico se modalita' supervisore attiva
@@ -271,7 +271,7 @@ Public Class RawPartManagerVM
' se attiva opzione e non ancora calcolato
If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State = ItemState.ND AndAlso x.nGlobalState = CalcStates.NOTCALCULATED) Then
Map.refCALCPanelVM.SetFromProduce(CALCPanelVM.ProduceType.PRODUCEALL)
Map.refCALCPanelVM.VerifyAll()
Map.refCALCPanelVM.VerifyAll(ProjectType.PROD)
Return
End If
If Map.refMachGroupPanelVM.MachGroupVMList.Count > 0 Then
@@ -786,52 +786,10 @@ Public Class RawPartManagerVM
''' </summary>
Friend Sub VerifyAll()
If ((IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
' se modalita' assemblato
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
Dim ProjType As BWType
ProjType = ProjectManagerVM.CurrProd.nType
If Not CreateBarListToVerify(ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
Map.refCALCPanelVM.VerifyAll(ProjectType.PROD)
Return
End Sub
Private Function CreateBarListToVerify(ProjType As BWType, ByRef BarList As Bar()) As Boolean
Dim TempBarList As New List(Of 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,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nGlobState = CurrMachGroup.nGlobalState}
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList.Add(Bar)
Next
If TempBarList.Count = 0 Then Return False
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
Return True
End Function
#End Region ' VerifyAll
#Region "ResetCalc"
@@ -415,6 +415,10 @@ Public Class JsonDefaultStrategyParameter
DirectCast(StrategyParameter, ComboStrategyParameter).ComboList.Add(Choice.Deserialize())
Next
DirectCast(StrategyParameter, ComboStrategyParameter).SetSelValue(m_sValue)
Case "tool"
' Da sistemare!!!
StrategyParameter = New DoubleStrategyParameter()
DirectCast(StrategyParameter, DoubleStrategyParameter).SetValue(m_sValue)
End Select
StrategyParameter.sName = m_sName
StrategyParameter.sNameNge = m_sNameNge
Binary file not shown.