-aggiunto controllo in configurationpage scelta tra ts3data e ebwdata

This commit is contained in:
Demetrio Cassarino
2024-06-25 09:26:04 +02:00
parent 49ed63e2d4
commit 6d13c9478b
10 changed files with 44 additions and 8 deletions
+2 -1
View File
@@ -111,7 +111,8 @@ Public Module ConstIni
Public Const K_ONLYPROD As String = "OnlyProd"
Public Const K_MODIFYSETUP As String = "ModifySetup"
Public Const K_MACHCONFIG As String = "MachConfig"
Public Const S_SPECIAL As String = "Special"
Public Const K_SPECIALENABLE As String = "SpecialEnable"
@@ -24,5 +24,6 @@
Public Const K_FLOW As String = "Flow"
Public Const TS3DATA_FILE As String = "Ts3Data.lua"
Public Const EBWDATA_FILE As String = "EbwData.lua"
End Module
@@ -20,5 +20,14 @@
m_bModifySetup = value
End Sub
Private m_bMachConfig As Boolean
Public ReadOnly Property bMachConfig As Boolean
Get
Return m_bMachConfig
End Get
End Property
Public Sub SetMachConfig(value As Boolean)
m_bMachConfig = value
End Sub
End Module
@@ -934,14 +934,24 @@ Public Class ConfigurationPageVM
Next
NewTs3DataFileContent.Add("local Machine = {" & sMachineStr.TrimEnd(",") & "}")
NewTs3DataFileContent.Add("return Machine")
Dim FilePath As String = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & TS3DATA_FILE
Dim FilePath As String
If Map.refMainWindowVM.MainWindowM.bMachConfig Then
FilePath = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & EBWDATA_FILE
Else
FilePath = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & TS3DATA_FILE
End If
Dim sBakFilePath As String = Path.ChangeExtension(FilePath, ".bak")
If File.Exists(sBakFilePath) Then File.Delete(sBakFilePath)
If File.Exists(FilePath) Then File.Move(FilePath, sBakFilePath)
File.WriteAllLines(FilePath, NewTs3DataFileContent, Text.Encoding.UTF8)
' se macchina di tipo BOTH copio il file appena scritto nella cartella Wall nella cartella Beam
If CurrentMachine.nType = MachineType.BOTH Then
Dim DestinationFilePath As String = CurrentMachine.sMachDir & "\" & BEAM_DIR & "\" & TS3DATA_FILE
Dim DestinationFilePath As String
If Map.refMainWindowVM.MainWindowM.bMachConfig Then
DestinationFilePath = CurrentMachine.sMachDir & "\" & BEAM_DIR & "\" & EBWDATA_FILE
Else
DestinationFilePath = CurrentMachine.sMachDir & "\" & BEAM_DIR & "\" & TS3DATA_FILE
End If
sBakFilePath = Path.ChangeExtension(DestinationFilePath, ".bak")
If File.Exists(sBakFilePath) Then File.Delete(sBakFilePath)
File.Move(DestinationFilePath, Path.ChangeExtension(DestinationFilePath, ".bak"))
@@ -1019,10 +1029,10 @@ Public Class ConfigurationPageVM
' funzione che verifica l'inserimento della password quando si edita un parametro Macchina
Friend Function VerifyConfigPagePassword() As Boolean
Dim InputPwdWnd As Object = Nothing
Dim InputPwdWnd As Object
' Display message, title, and default value.
Dim InputPwdWndVM As New InputPwdWndVM()
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
If bOnlyProd Then
InputPwdWnd = New OnlyProdInputPwdWndV(Application.Current.MainWindow, InputPwdWndVM)
Else
InputPwdWnd = New InputPwdWndV(Application.Current.MainWindow, InputPwdWndVM)
@@ -1213,6 +1223,8 @@ Public Class MachParam
Case Else
UpdateParamValue(0, value)
End Select
If Map.refConfigurationPageVM.bModifyMachParam Then Map.refConfigurationPageVM.VerifyConfigPageModification()
End Set
End Property
Public Property dValue As Double
@@ -22,6 +22,7 @@
Text="{Binding PasswordMsg}"
Style="{StaticResource PasswordMsg_TextBlock}"/>
<PasswordBox Grid.Row="1"
x:Name="PwdBox"
PasswordChanged="PasswordBox_PasswordChanged"/>
<Grid Grid.Row="2"
@@ -6,6 +6,7 @@
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
PwdBox.Focus()
Me.DataContext = InputPwdWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_InputPwdWndVM = InputPwdWndVM
@@ -184,6 +184,13 @@ Public Class MainWindowM
End Get
End Property
Private m_bMachConfig As Boolean = False
Friend ReadOnly Property bMachConfig As Boolean
Get
Return m_bMachConfig
End Get
End Property
#End Region ' FIELDS
#Region "CONSTRUCTOR"
@@ -328,6 +335,10 @@ Public Class MainWindowM
m_bModifySetup = GetMainPrivateProfileInt(S_GENERAL, K_MODIFYSETUP, 0) = 1
' e lo imposto nel core
Core.Configuration.SetModifySetup(m_bModifySetup)
' Recupero flag MachConfig
m_bMachConfig = GetMainPrivateProfileInt(S_MACH, K_MACHCONFIG, 0) = 1
' e lo imposto nel core
Core.Configuration.SetModifySetup(m_bMachConfig)
' Info su opzioni chiave
EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString())
@@ -143,7 +143,7 @@
<TextBlock Text="PDF" Margin="5,2,0,0"/>
</StackPanel>
</GroupBox.Header>
<EgtBEAMWALL:PdfViewer PdfPath="{Binding WebAddress, Mode=TwoWay}" Visibility="{Binding PdfViewer_Visibility}"/>
<EgtBEAMWALL:PdfViewer PdfPath="{Binding WebAddress}" Visibility="{Binding PdfViewer_Visibility}"/>
</GroupBox>
</Grid>
@@ -131,7 +131,7 @@
Grid.Column="1"
Grid.RowSpan="2"
Style="{StaticResource GroupBox_PDFPreview}">
<EgtBEAMWALL:PdfViewer PdfPath="{Binding WebAddress, Mode=TwoWay}" Visibility="{Binding PdfViewer_Visibility}"/>
<EgtBEAMWALL:PdfViewer PdfPath="{Binding WebAddress}" Visibility="{Binding PdfViewer_Visibility}"/>
</GroupBox>
</Grid>
</Grid>
@@ -2447,7 +2447,7 @@
<Style x:Key="GeneralConfigurationToolBar_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource OnlyProd_Button}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="80"/>
<Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="Margin" Value="5,0,5,0"/>
</Style>
<Style x:Key="MachineToolBar_ParameterMachineButton" TargetType="{x:Type Button}" BasedOn="{StaticResource OnlyProd_Button}">