EgtCAm5 :

- aggiunta gestione processing file btl da linea di comando.
This commit is contained in:
Dario Sassi
2019-01-08 10:54:32 +00:00
parent 72790bf13b
commit 127492cb8b
30 changed files with 198 additions and 73 deletions
+6
View File
@@ -100,6 +100,12 @@ Module ConstIni
Public Const K_SPECIALENABLE As String = "SpecialEnable"
Public Const K_BUTTON As String = "Button"
Public Const S_BEAM As String = "Beam"
Public Const K_BTLENABLE As String = "BtlEnable"
Public Const K_BEAMBASEDIR As String = "BaseDir"
Public Const K_BTLEXEC As String = "BtlExec"
Public Const K_BEAMBUTTON As String = "Button"
Public Const S_DOORS As String = "Doors"
Public Const K_DDFENABLE As String = "DdfEnable"
Public Const K_BASEDIR As String = "BaseDir"
+34 -25
View File
@@ -144,6 +144,7 @@
<Compile Include="Base\TabViewModel.vb" />
<Compile Include="Base\TreeView\TreeViewItemBase.vb" />
<Compile Include="Base\ViewModelBase.vb" />
<Compile Include="Special-Beam\Beam.vb" />
<Compile Include="Command\Command.vb" />
<Compile Include="Command\RelayCommand.vb" />
<Compile Include="Constants\ConstDoors.vb" />
@@ -159,6 +160,14 @@
<DependentUpon>SelMachGroupWndV.xaml</DependentUpon>
</Compile>
<Compile Include="SelMachGroupWnd\SelMachGroupWndVM.vb" />
<Compile Include="Special-Beam\BeamPanelV.xaml.vb">
<DependentUpon>BeamPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="Special-Beam\BeamPanelVM.vb" />
<Compile Include="SpecialPanel\SpecialPanelV.xaml.vb">
<DependentUpon>SpecialPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="SpecialPanel\SpecialPanelVM.vb" />
<Compile Include="Utility\BindingProxy.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="Internals\MruList.vb" />
@@ -169,12 +178,12 @@
<DependentUpon>MachOptionV.xaml</DependentUpon>
</Compile>
<Compile Include="MachOptionsWindow\MachOptionVM.vb" />
<Compile Include="MTableDb\MTableDbV.xaml.vb">
<Compile Include="Special-Doors\MTableDbV.xaml.vb">
<DependentUpon>MTableDbV.xaml</DependentUpon>
</Compile>
<Compile Include="MTableDb\MTableDbVM.vb" />
<Compile Include="MTableDb\MTableListBox.vb" />
<Compile Include="MTableDb\TableUtility.vb" />
<Compile Include="Special-Doors\MTableDbVM.vb" />
<Compile Include="Special-Doors\MTableListBox.vb" />
<Compile Include="Special-Doors\TableUtility.vb" />
<Compile Include="OptionsWindow\OptionModule.vb" />
<Compile Include="OptionsWindow\OptionWindowV.xaml.vb">
<DependentUpon>OptionWindowV.xaml</DependentUpon>
@@ -184,10 +193,10 @@
<DependentUpon>MachinePanelV.xaml</DependentUpon>
</Compile>
<Compile Include="MachinePanel\MachinePanelVM.vb" />
<Compile Include="DoorsPanel\DoorPanelV.xaml.vb">
<Compile Include="Special-Doors\DoorPanelV.xaml.vb">
<DependentUpon>DoorPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="DoorsPanel\DoorPanelVM.vb" />
<Compile Include="Special-Doors\DoorPanelVM.vb" />
<Compile Include="MachiningDbWindow\MachiningDbV.xaml.vb">
<DependentUpon>MachiningDbV.xaml</DependentUpon>
</Compile>
@@ -206,11 +215,11 @@
<DependentUpon>GridPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="GridPanel\GridPanelVM.vb" />
<Compile Include="GunStockPanel\GunStockPanelV.xaml.vb">
<Compile Include="Special-GunStock\GunStockPanelV.xaml.vb">
<DependentUpon>GunStockPanelV.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="GunStockPanel\GunStockPanelVM.vb" />
<Compile Include="Special-GunStock\GunStockPanelVM.vb" />
<Compile Include="MachGroupPanel\MachGroupPanelV.xaml.vb">
<DependentUpon>MachGroupPanelV.xaml</DependentUpon>
</Compile>
@@ -246,10 +255,6 @@
<DependentUpon>PopUpViewPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="PopUpViewPanel\PopUpViewPanelVM.vb" />
<Compile Include="SpecialPanel\SpecialPanelV.xaml.vb">
<DependentUpon>SpecialPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="SpecialPanel\SpecialPanelVM.vb" />
<Compile Include="Utility\SelData.vb" />
<Compile Include="ViewPanel\ViewPanelV.xaml.vb">
<DependentUpon>ViewPanelV.xaml</DependentUpon>
@@ -299,13 +304,13 @@
<DependentUpon>SetUpV.xaml</DependentUpon>
</Compile>
<Compile Include="SetUpWindow\SetUpVM.vb" />
<Compile Include="Special\Doors.vb" />
<Compile Include="Special\GunStock.vb" />
<Compile Include="Special\GunStockWindow\GunStockParamListItem.vb" />
<Compile Include="Special\GunStockWindow\GunStockWndV.xaml.vb">
<Compile Include="Special-Doors\Doors.vb" />
<Compile Include="Special-GunStock\GunStock.vb" />
<Compile Include="Special-GunStock\GunStockParamListItem.vb" />
<Compile Include="Special-GunStock\GunStockWndV.xaml.vb">
<DependentUpon>GunStockWndV.xaml</DependentUpon>
</Compile>
<Compile Include="Special\GunStockWindow\GunStockWndVM.vb" />
<Compile Include="Special-GunStock\GunStockWndVM.vb" />
<Compile Include="StatusBar\StatusBarV.xaml.vb">
<DependentUpon>StatusBarV.xaml</DependentUpon>
</Compile>
@@ -339,7 +344,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MTableDb\MTableDbV.xaml">
<Page Include="Special-Beam\BeamPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Special-Doors\MTableDbV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -351,7 +360,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DoorsPanel\DoorPanelV.xaml">
<Page Include="Special-Doors\DoorPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -375,6 +384,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SpecialPanel\SpecialPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Utility\Dictionary.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -391,7 +404,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="GunStockPanel\GunStockPanelV.xaml">
<Page Include="Special-GunStock\GunStockPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -423,10 +436,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SpecialPanel\SpecialPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ViewPanel\ViewPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -475,7 +484,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Special\GunStockWindow\GunStockWndV.xaml">
<Page Include="Special-GunStock\GunStockWndV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+4
View File
@@ -44,6 +44,10 @@
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:SpecialPanelV DataContext="{StaticResource SpecialPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="BeamPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:BeamPanelV DataContext="{StaticResource BeamPanelViewModel}"/>
</EgtFloating:EgtFloatingPanel>
<EgtFloating:EgtFloatingPanel Name="DoorsPanel"
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
<local:DoorPanelV DataContext="{StaticResource DoorsPanelViewModel}"/>
+9 -28
View File
@@ -2,14 +2,16 @@
Public Class ProjectV
Private m_bSpecial As Boolean = False
Private m_bBeam As Boolean = False
Private m_bDoors As Boolean = False
Private m_bGunStock As Boolean = False
Private m_bSpecial As Boolean = False
Private Sub UserControl_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
DoorsPanel.Visibility = Visibility.Collapsed
SpecialPanel.Visibility = Visibility.Collapsed
MachGroupPanel.Visibility = Visibility.Collapsed
BeamPanel.Visibility = Visibility.Collapsed
DoorsPanel.Visibility = Visibility.Collapsed
GunStockPanel.Visibility = Visibility.Collapsed
MachGroupPanel.Visibility = Visibility.Collapsed
End Sub
Private Sub UserControl_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -25,37 +27,15 @@ Public Class ProjectV
DbPanel.IsFloating = False
ExecutePanel.IsFloating = False
SpecialPanel.IsFloating = False
BeamPanel.IsFloating = False
DoorsPanel.IsFloating = False
GunStockPanel.IsFloating = False
DrawPanel.IsFloating = False
OptionPanel.IsFloating = False
MachGroupPanel.IsFloating = False
GunStockPanel.IsFloating = False
If GetPrivateProfileFloatingWinPos(S_GENERAL, "ShowPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(ShowPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "ViewPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(ViewPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "InstrumentPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
'PanelPositioning(InstrumentPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "GridPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(GridPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "DoorsPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(DoorsPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "GunStockPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(DoorsPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "DrawPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(DrawPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "OptionPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(OptionPanel, sState, nIndex, nLeft, nTop)
End If
' carico Special Panel
m_bSpecial = IniFile.IsActiveSpecialPanel()
m_bBeam = IniFile.IsActiveBeam()
m_bDoors = IniFile.IsActiveDoors()
m_bGunStock = IniFile.IsActiveGunStock()
Application.Msn.Register(Application.DRAWMODE_ISCHECKED, Sub()
@@ -66,6 +46,7 @@ Public Class ProjectV
DbPanel.Visibility = If(IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW, Visibility.Collapsed, Visibility.Visible)
ExecutePanel.Visibility = Visibility.Visible
SpecialPanel.Visibility = If(m_bSpecial, Visibility.Visible, Visibility.Collapsed)
BeamPanel.Visibility = If(m_bBeam, Visibility.Visible, Visibility.Collapsed)
DoorsPanel.Visibility = If(m_bDoors, Visibility.Visible, Visibility.Collapsed)
GunStockPanel.Visibility = If(m_bGunStock, Visibility.Visible, Visibility.Collapsed)
DrawPanel.Visibility = Visibility.Visible
+21 -1
View File
@@ -313,12 +313,29 @@ Public Class ProjectVM
End Sub
Private Sub ProcessCommandLine()
' Se non ci sono parametri su linea di comando, esco
' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
If Environment.GetCommandLineArgs.Count() <= 1 Then Return
' Recupero il primo vero parametro che dovrebbe essere il nome con estensione di un file
Dim sFile As String = Environment.GetCommandLineArgs(1)
Dim sExt As String = Path.GetExtension(sFile).ToLower()
If String.IsNullOrWhiteSpace(sFile) OrElse String.IsNullOrWhiteSpace(sExt) Then Return
' Se file btl con opzioni, gestione lavorazione travi
If sExt = ".btl" And Environment.GetCommandLineArgs.Count() > 2 Then
' Nome macchina
Dim sMachine As String = ""
If Environment.GetCommandLineArgs.Count() > 2 Then sMachine = Environment.GetCommandLineArgs(2)
' Flag
Dim nFlag As Integer = 1
If Environment.GetCommandLineArgs.Count() > 3 Then Integer.TryParse(Environment.GetCommandLineArgs(3), nFlag)
' File CN
Dim sNcFile As String = ""
If Environment.GetCommandLineArgs.Count() > 4 Then sNcFile = Environment.GetCommandLineArgs(4)
' Esecuzione
ExecBeam(sFile, sMachine, nFlag, sNcFile)
' Se richiesta uscita immediata
If nFlag = 0 Or nFlag = 3 Then Application.Msn.NotifyColleagues(Application.CLOSEAPPLICATIONCOMMAND)
Return
End If
' Se file ddf, gestione creazione porta con Doors
If sExt = ".ddf" Then
' Se manca direttorio uso quello di default
@@ -701,6 +718,9 @@ Public Class ProjectVM
End Sub
Friend Sub UpdateProjectUI(bReloadUI As Boolean)
OnUpdateUI(Nothing, bReloadUI)
End Sub
#End Region
+50
View File
@@ -0,0 +1,50 @@
Imports System.IO
Imports System.Globalization
Imports EgtUILib
Module Beam
Friend Function ExecBeam(sFile As String, sMachine As String, nFlag As Integer, sNcFile As String) As Boolean
EgtOutLog("-- Start ExecBeam --")
' Recupero lo script da eseguire
Dim sExecPath As String = ""
Dim sExecName As String = ""
GetPrivateProfileString(S_BEAM, K_BTLEXEC, "", sExecName)
sExecPath = (IniFile.m_sBeamDirPath & "\" & sExecName).TrimEnd({"\"c})
If Not My.Computer.FileSystem.FileExists(sExecPath) Then
EgtOutLog("Not found BeamExec script " & sExecPath)
Return False
End If
' Preparo interfaccia per aggiornamento
Application.Msn.NotifyColleagues(Application.CLEAROBJTREE)
' Assegno i dati
EgtLuaCreateGlobTable("BEAM")
EgtLuaSetGlobStringVar("BEAM.FILE", sFile)
EgtLuaSetGlobStringVar("BEAM.MACHINE", sMachine)
EgtLuaSetGlobIntVar("BEAM.FLAG", nFlag)
EgtLuaSetGlobStringVar("BEAM.NCFILE", sNcFile)
' Eseguo lo script
If Not EgtLuaExecFile(sExecPath) Then
EgtOutLog("Error executing Beam Exec script " & sExecPath)
Return False
End If
' Recupero i risultati
Dim nErr As Integer = 999
EgtLuaGetGlobIntVar("BEAM.ERR", nErr)
Dim bOk As Boolean = (nErr = 0)
If Not bOk Then EgtOutLog("BeamExec Err=" & nErr.ToString())
' Cancello tavola globale
EgtLuaResetGlobVar("BEAM")
' Aggiorno interfaccia
Map.refProjectVM.UpdateProjectUI(True)
Application.Msn.NotifyColleagues(Application.SELECTIDINOBJTREENOMARK, EgtGetCurrLayer())
If EgtGetCurrMachGroup() <> GDB_ID.NULL Then
Application.Msn.NotifyColleagues(Application.SETMACHININGMODE)
If bOk And nFlag = 2 Then
Map.refSimulationExpanderVM.IsExpanded = True
End If
End If
Return bOk
End Function
End Module
+20
View File
@@ -0,0 +1,20 @@
<UserControl x:Class="BeamPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ItemsControl ItemsSource="{Binding ButtonList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}">
<Image Source="{Binding ImagePath}"/>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</UserControl>
+3
View File
@@ -0,0 +1,3 @@
Public Class BeamPanelV
End Class
+26
View File
@@ -0,0 +1,26 @@
Imports System.IO
Imports EgtUILib
Public Class BeamPanelVM
Private m_ButtonList As New List(Of ButtonItem)
Public ReadOnly Property ButtonList As List(Of ButtonItem)
Get
Return m_ButtonList
End Get
End Property
Sub New()
' Se attivo, inizializzo i bottoni leggendoli da file ini
If IniFile.IsActiveBeam() Then
' Inizializzo i bottoni leggendoli da file ini
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonItem = Nothing
While GetPrivateProfileButton(S_BEAM, K_BEAMBUTTON & BtnIndex, IniFile.m_sBeamDirPath, CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
End While
End If
End Sub
End Class
+1 -1
View File
@@ -15,7 +15,7 @@ Public Class SpecialPanelVM
If IniFile.IsActiveSpecialPanel Then
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonItem = Nothing
While GetPrivateProfileButton(S_SPECIAL, K_BUTTON & BtnIndex, CurrBtn)
While GetPrivateProfileButton(S_SPECIAL, K_BUTTON & BtnIndex, "", CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
End While
+1 -1
View File
@@ -202,7 +202,7 @@ Public Class TopCommandBarVM
' Recupero il nome dello script e verifico esista
Dim sInitMachScriptPath As String = ""
If EgtUILib.GetPrivateProfileString(S_MACHINING, K_MACH_INITSCRIPT, "", sInitMachScriptPath, IniFile.m_sCurrMachIniFilePath) = 0 Then Return True
sInitMachScriptPath = IniFile.m_sCurrMachScriptsDirPath & "\" & sInitMachScriptPath
sInitMachScriptPath = (IniFile.m_sCurrMachScriptsDirPath & "\" & sInitMachScriptPath).TrimEnd({"\"c})
If Not My.Computer.FileSystem.FileExists(sInitMachScriptPath) Then Return True
' Eseguo lo script
EgtLuaCreateGlobTable("MACH")
+3 -2
View File
@@ -25,8 +25,6 @@
<EgtCAM5:DrawPanelVM x:Key="DrawPanelViewModel"/>
<EgtCAM5:OptionPanelVM x:Key="OptionPanelViewModel"/>
<EgtCAM5:TopCommandBarVM x:Key="TopCommandBarViewModel"/>
<EgtCAM5:DoorPanelVM x:Key="DoorsPanelViewModel"/>
<EgtCAM5:GunStockPanelVM x:Key="GunStockPanelViewModel"/>
<EgtCAM5:GridPanelVM x:Key="GridPanelViewModel"/>
<EgtCAM5:PopUpGridPanelVM x:Key="PopUpGridPanelViewModel"/>
<EgtCAM5:ShowPanelVM x:Key="ShowPanelViewModel"/>
@@ -34,6 +32,9 @@
<EgtCAM5:MachinePanelVM x:Key="DbPanelViewModel"/>
<EgtCAM5:ExecutePanelVM x:Key="ExecutePanelViewModel"/>
<EgtCAM5:SpecialPanelVM x:Key="SpecialPanelViewModel"/>
<EgtCAM5:BeamPanelVM x:Key="BeamPanelViewModel"/>
<EgtCAM5:DoorPanelVM x:Key="DoorsPanelViewModel"/>
<EgtCAM5:GunStockPanelVM x:Key="GunStockPanelViewModel"/>
<EgtCAM5:MachGroupPanelVM x:Key="MachGroupPanelViewModel"/>
<EgtCAM5:OperationExpanderVM x:Key="OperationExpanderViewModel"/>
+20 -15
View File
@@ -44,6 +44,8 @@ Public Module IniFile
GUNSTOCK = 4
DOORCREATOR = 8 ' Prodotto DOORCreator
VIRTUALMILLING = 16
JAMBS = 32
BEAM = 64
End Enum
Friend m_sDataRoot As String
Friend m_sConfigDir As String
@@ -53,6 +55,8 @@ Public Module IniFile
Friend m_sResourcesRoot As String
Friend m_sTablesRoot As String
Friend m_sLogFile As String
' path della cartella BEAM
Friend m_sBeamDirPath As String
' path della cartella DOORS
Friend m_sDoorsDirPath As String
@@ -189,24 +193,21 @@ Public Module IniFile
Return False
End Function
Public Function GetPrivateProfileButton(
ByVal lpAppName As String,
ByVal lpKeyName As String, ByRef ReadedButtonItem As ButtonItem) As Boolean
Public Function GetPrivateProfileButton(sSection As String, sKey As String, sBaseDir As String, ByRef ReadedButtonItem As ButtonItem) As Boolean
ReadedButtonItem = Nothing
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
GetPrivateProfileString(sSection, sKey, "", sVal)
If String.IsNullOrWhiteSpace(sVal) Then Return False
Dim sItems() As String = sVal.Split(",".ToCharArray)
If sItems.Count() >= 1 Then
Dim sImagePath As String = String.Empty
Dim sToolTip As String = String.Empty
If sItems.Count() >= 2 Then
sImagePath = sItems(1)
If sItems.Count() >= 3 Then
sToolTip = sItems(2)
End If
Dim sLuaPath As String = sItems(0)
Dim sImagePath As String = If(sItems.Count() >= 2, sItems(1), "")
Dim sToolTip As String = If(sItems.Count() >= 3, sItems(2), "")
If Not String.IsNullOrWhiteSpace(sBaseDir) Then
If Not String.IsNullOrWhiteSpace(sLuaPath) Then sLuaPath = IniFile.m_sBeamDirPath & "\" & sLuaPath
If Not String.IsNullOrWhiteSpace(sImagePath) Then sImagePath = IniFile.m_sBeamDirPath & "\" & sImagePath
End If
ReadedButtonItem = New ButtonItem(sItems(0), sImagePath, sToolTip)
ReadedButtonItem = New ButtonItem(sLuaPath, sImagePath, sToolTip)
Return True
End If
Return False
@@ -225,11 +226,15 @@ Public Module IniFile
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
End Function
Friend Function IsActiveBeam() As Boolean
Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.BEAM) <> 0 And (GetPrivateProfileInt(S_BEAM, K_BTLENABLE, 0) <> 0)
If bIsActive Then GetPrivateProfileString(S_BEAM, K_BEAMBASEDIR, "", m_sBeamDirPath)
Return bIsActive
End Function
Friend Function IsActiveDoors() As Boolean
Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.DOORS) <> 0 And (GetPrivateProfileInt(S_DOORS, K_DDFENABLE, 0) <> 0)
If bIsActive Then
GetPrivateProfileString(S_DOORS, K_BASEDIR, "", m_sDoorsDirPath)
End If
If bIsActive Then GetPrivateProfileString(S_DOORS, K_BASEDIR, "", m_sDoorsDirPath)
Return bIsActive
End Function