Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a125b87cef | |||
| d9f472892a | |||
| f67bddeed6 | |||
| 7bfa134828 | |||
| 5005fd3e73 | |||
| d08eabc163 | |||
| 94c4c1f6a4 | |||
| dc51159ca1 | |||
| c6a77355a4 | |||
| e657e53f7a | |||
| 8e36167ef4 | |||
| e2df14e44d | |||
| b2f4f87c54 | |||
| d099ffe17e | |||
| 2c4d43387d | |||
| d36077c04f | |||
| 71a280e41d | |||
| cdafc7c8d6 | |||
| f47809379d |
@@ -0,0 +1,15 @@
|
||||
<Application x:Class="Application"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Effector.Main">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Effector.Plugin.Lib;component/Themes/Generic.xaml"/>
|
||||
<ResourceDictionary Source="Utility/Dictionary.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
</Application>
|
||||
@@ -5,10 +5,16 @@
|
||||
Protected Overrides Sub OnStartup(e As StartupEventArgs)
|
||||
MyBase.OnStartup(e)
|
||||
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
|
||||
|
||||
If e.Args.Count = 0 Then
|
||||
' creo finestra SplashScreen
|
||||
Dim SplashScreen As New SplashScreen
|
||||
Me.MainWindow = SplashScreen
|
||||
Me.MainWindow.Show()
|
||||
Map.SetRefSplashScreen(SplashScreen)
|
||||
End If
|
||||
' Creo la View principale
|
||||
Dim MainWindowVM As New MainWindowVM
|
||||
Me.MainWindow = New MainWindowV
|
||||
Me.MainWindow.DataContext = MainWindowVM
|
||||
' Mostro la View principale
|
||||
Me.MainWindow.Show()
|
||||
End Sub
|
||||
@@ -0,0 +1,69 @@
|
||||
Imports Effector.Plugin.Lib
|
||||
Imports NGP_COMM_DLL
|
||||
|
||||
Public Class MachineManager
|
||||
|
||||
Private m_MachineList(20) As NC.NC_generic
|
||||
Friend ReadOnly Property MachineList As NC.NC_generic()
|
||||
Get
|
||||
Return m_MachineList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
End Sub
|
||||
|
||||
Sub Init()
|
||||
If GetMainPrivateProfileInt(S_NC, K_NC_SIMULATE, 0) = 1 Then
|
||||
Dim nMachineIndex As Integer = 1
|
||||
Dim sMachine As String = ""
|
||||
While GetMainPrivateProfileString(S_NC, K_MACHINE & nMachineIndex.ToString(), "", sMachine) > 0
|
||||
If Map.refMainWindowVM.MainWindowM.GetKeyOption1(nMachineIndex) Then
|
||||
Dim NewSimulatedMachine As New NC.Simulated
|
||||
NewSimulatedMachine.Connect("")
|
||||
m_MachineList(nMachineIndex - 1) = NewSimulatedMachine
|
||||
Else
|
||||
EgtOutLog("Attempt to load machines beyond the limit imposed by the key!")
|
||||
End If
|
||||
nMachineIndex += 1
|
||||
End While
|
||||
Else
|
||||
Dim nMachineIndex As Integer = 1
|
||||
Dim sMachine As String = ""
|
||||
While GetMainPrivateProfileString(S_NC, K_MACHINE & nMachineIndex.ToString(), "", sMachine) > 0
|
||||
If Map.refMainWindowVM.MainWindowM.GetKeyOption1(nMachineIndex) Then
|
||||
Dim sMachineSplit() As String = sMachine.Split(","c)
|
||||
Dim nType As Integer = 0
|
||||
If sMachineSplit.Count >= 1 AndAlso Not String.IsNullOrWhiteSpace(sMachineSplit(0)) AndAlso Integer.TryParse(sMachineSplit(0), nType) Then
|
||||
Select Case nType
|
||||
Case 1 ' OsaiOpen
|
||||
If sMachineSplit.Count >= 2 AndAlso Not String.IsNullOrWhiteSpace(sMachineSplit(1)) Then
|
||||
Dim NewOsaiOpen As New NC.OsaiOpen
|
||||
NewOsaiOpen.Connect(sMachineSplit(1))
|
||||
m_MachineList(nMachineIndex - 1) = NewOsaiOpen
|
||||
End If
|
||||
Case 2 ' Fanuc
|
||||
If sMachineSplit.Count >= 2 AndAlso Not String.IsNullOrWhiteSpace(sMachineSplit(1)) Then
|
||||
Dim NewFanuc As New NC.Fanuc
|
||||
NewFanuc.Connect(sMachineSplit(1))
|
||||
m_MachineList(nMachineIndex - 1) = NewFanuc
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
Else
|
||||
EgtOutLog("Attempt to load machines beyond the limit imposed by the key!")
|
||||
End If
|
||||
nMachineIndex += 1
|
||||
End While
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub Close()
|
||||
For Each Machine In m_MachineList
|
||||
If Not IsNothing(Machine) Then
|
||||
Machine.Disconnect()
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -19,7 +19,7 @@ Public Module ConstGen
|
||||
Public Const K_DATAROOT As String = "DataRoot"
|
||||
|
||||
' File con dati di licenza
|
||||
Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
|
||||
Public Const LIC_FILE_NAME As String = "Effector.lic"
|
||||
Public Const S_LICENCE As String = "Licence"
|
||||
Public Const K_LOCKID As String = "LockId"
|
||||
Public Const K_KEY As String = "Key"
|
||||
@@ -36,7 +36,7 @@ Public Module ConstGen
|
||||
End Enum
|
||||
|
||||
' File di log generale
|
||||
Public Const GENLOG_FILE_NAME As String = "Supervisor#.txt"
|
||||
Public Const GENLOG_FILE_NAME As String = "Effector#.txt"
|
||||
|
||||
' Sottodirettorio di configurazione
|
||||
Public Const CONF_DIR As String = "Config"
|
||||
@@ -46,6 +46,8 @@ Public Module ConstGen
|
||||
Public Const SCRIPT_DIR As String = "Script"
|
||||
' Sottodirettorio temporaneo
|
||||
Public Const TEMP_DIR As String = "Temp"
|
||||
' Sottodirettorio dei messaggi
|
||||
Public Const MSG_DIR As String = "Messages"
|
||||
'' Sottodirettorio per Cam automatico
|
||||
'Public Const PROJS_DIR As String = "Projs"
|
||||
'' Sottodirettorio per Csv automatico
|
||||
@@ -12,11 +12,12 @@
|
||||
'----------------------------------------------------------------------------
|
||||
Module ConstIni
|
||||
|
||||
Public Const INI_FILE_NAME As String = "Supervisor.ini"
|
||||
Public Const INI_FILE_NAME As String = "Effector.ini"
|
||||
|
||||
Public Const S_GENERAL As String = "General"
|
||||
'Public Const K_DEBUG As String = "Debug"
|
||||
'Public Const K_LICENCE As String = "Licence"
|
||||
Public Const K_LICENCE As String = "Licence"
|
||||
Public Const K_MESSAGES As String = "Messages"
|
||||
'Public Const K_USERLEVEL As String = "UserLevel"
|
||||
'Public Const K_MAXINST As String = "MaxInstances"
|
||||
Public Const K_INSTANCES As String = "Instances"
|
||||
@@ -27,6 +28,8 @@ Module ConstIni
|
||||
Public Const K_PLUGINNAME As String = "PluginName"
|
||||
Public Const K_WINPLACE = "WinPlace"
|
||||
|
||||
Public Const S_LANGUAGES As String = "Languages"
|
||||
|
||||
Public Const S_REDIS As String = "Redis"
|
||||
Public Const K_ENABLED As String = "Enabled"
|
||||
Public Const K_DBINDEX As String = "DbIndex"
|
||||
@@ -6,8 +6,8 @@
|
||||
<ProjectGuid>{38BEE4BF-9238-459F-AF89-4DD94C4FD0DA}</ProjectGuid>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>Supervisor</RootNamespace>
|
||||
<AssemblyName>Supervisor</AssemblyName>
|
||||
<RootNamespace>Effector.Main</RootNamespace>
|
||||
<AssemblyName>Effector.Main</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<MyType>Custom</MyType>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
@@ -47,7 +47,7 @@
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DocumentationFile>Supervisor.xml</DocumentationFile>
|
||||
<DocumentationFile>Effector.Main.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -56,7 +56,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DocumentationFile>Supervisor.xml</DocumentationFile>
|
||||
<DocumentationFile>Effector.Main.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -68,7 +68,7 @@
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DocumentationFile>Supervisor.xml</DocumentationFile>
|
||||
<DocumentationFile>Effector.Main.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
@@ -77,7 +77,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DocumentationFile>Supervisor.xml</DocumentationFile>
|
||||
<DocumentationFile>Effector.Main.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -87,12 +87,19 @@
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\Effector.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup />
|
||||
<ItemGroup>
|
||||
<Reference Include="Effector.Plugin.Lib">
|
||||
<HintPath>..\..\Effector.Plugin.Lib\Effector.Plugin.Lib\bin\Debug\Effector.Plugin.Lib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgwWPFBaseLib">
|
||||
<HintPath>..\..\..\EgwWPFBaseLib\EgwWPFBaseLib\bin\Debug\EgwWPFBaseLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="KeraLua, Version=1.4.1.0, Culture=neutral, PublicKeyToken=6a194c04b9c89217, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\KeraLua.1.4.1\lib\net46\KeraLua.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\Plugin.Fivelakes\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
@@ -118,7 +125,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Pipelines, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\Plugin.Fivelakes\packages\System.IO.Pipelines.6.0.0\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||
<HintPath>..\packages\System.IO.Pipelines.6.0.0\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
@@ -131,7 +138,7 @@
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Channels, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\Plugin.Fivelakes\packages\System.Threading.Channels.6.0.0\lib\net461\System.Threading.Channels.dll</HintPath>
|
||||
<HintPath>..\packages\System.Threading.Channels.6.0.0\lib\net461\System.Threading.Channels.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
@@ -164,16 +171,18 @@
|
||||
<Compile Include="LUA\LuaManager.vb" />
|
||||
<Compile Include="MEFPlugin\MefPlugin.vb" />
|
||||
<Compile Include="MEFPlugin\SupervisorFunctions.vb" />
|
||||
<Compile Include="SplashScreen\SplashScreen.xaml.vb">
|
||||
<DependentUpon>SplashScreen.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\Dictionary.xaml.vb">
|
||||
<DependentUpon>Dictionary.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\EgtInterface.vb" />
|
||||
<Compile Include="Utility\ExecProcessManager.vb" />
|
||||
<Compile Include="Utility\GenInterface.vb" />
|
||||
<Compile Include="Utility\IniFile.vb" />
|
||||
<Compile Include="LUA\Lua_General.vb" />
|
||||
<Compile Include="Utility\FiniteStateMachine.vb" />
|
||||
<Compile Include="Utility\Map.vb" />
|
||||
<Compile Include="Utility\RedisManager.vb" />
|
||||
<Compile Include="Utility\WinPos.vb" />
|
||||
<Page Include="MainWindow\MainWindowV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -182,11 +191,14 @@
|
||||
<DependentUpon>Application.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FiniteStateMachine.vb" />
|
||||
<Compile Include="MainWindow\MainWindowV.xaml.vb">
|
||||
<DependentUpon>MainWindowV.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="SplashScreen\SplashScreen.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Utility\Dictionary.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -235,19 +247,24 @@
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.manifest" />
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
<Resource Include="Resources\Fonts\AdventPro-Light.ttf" />
|
||||
<Resource Include="Resources\Fonts\AdventPro-Regular.ttf" />
|
||||
<Resource Include="Resources\Fonts\Roboto-Light.ttf" />
|
||||
<Resource Include="Resources\Fonts\Roboto-Regular.ttf" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Supervisor.Plugin.Interface\Supervisor.Plugin.Interface.vbproj">
|
||||
<ProjectReference Include="..\Effector.Plugin.Interface\Effector.Plugin.Interface.vbproj">
|
||||
<Project>{7D14D864-2BDC-4785-80F4-320164C2D5E4}</Project>
|
||||
<Name>Supervisor.Plugin.Interface</Name>
|
||||
<Name>Effector.Plugin.Interface</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -268,6 +285,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Effector.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\SplashScreen.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<Import Project="..\packages\KeraLua.1.4.1\build\net46\KeraLua.targets" Condition="Exists('..\packages\KeraLua.1.4.1\build\net46\KeraLua.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
@@ -278,10 +298,10 @@
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets'))" />
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Supervisor\SupervisorR32.exe
|
||||
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Supervisor\SupervisorD32.exe
|
||||
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Supervisor\SupervisorR64.exe
|
||||
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Supervisor\SupervisorD64.exe</PostBuildEvent>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Effector\EffectorR32.exe
|
||||
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Effector\EffectorD32.exe
|
||||
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Effector\EffectorR64.exe
|
||||
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Effector\EffectorD64.exe</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets" Condition="Exists('..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets')" />
|
||||
</Project>
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
Imports System.IO
|
||||
Imports System.Windows.Threading
|
||||
Imports Effector.Plugin.Lib
|
||||
|
||||
Public Class FiniteStateMachineManager
|
||||
|
||||
@@ -16,6 +17,7 @@ Public Class FiniteStateMachineManager
|
||||
Private m_PostProcPath As String = ""
|
||||
|
||||
Sub New()
|
||||
LuaManager.SetGlobVar("EFFECTOR.DATADIR", Map.refMainWindowVM.MainWindowM.sDataRoot)
|
||||
' leggo file inizializzazione variabili lua
|
||||
Dim sLuaInitPath As String = ""
|
||||
If GetMainPrivateProfileString(S_GENERAL, K_INITLUA, "", sLuaInitPath) > 0 Then
|
||||
@@ -2,7 +2,7 @@
|
||||
Imports System.Diagnostics
|
||||
Imports System.IO
|
||||
Imports KeraLua
|
||||
Imports Supervisor.Plugin.Interface
|
||||
Imports Effector.Plugin.Interface
|
||||
|
||||
|
||||
Public Module LuaManager
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
Imports System.ComponentModel.Composition
|
||||
Imports System.ComponentModel.Composition.Hosting
|
||||
Imports Supervisor.Plugin.Interface
|
||||
Imports Effector.Plugin.Interface
|
||||
|
||||
Public Class MEFLoader
|
||||
|
||||
+6
-1
@@ -1,5 +1,6 @@
|
||||
Imports System.ComponentModel.Composition
|
||||
Imports Supervisor.Plugin.Interface
|
||||
Imports Effector.Plugin.Lib
|
||||
Imports Effector.Plugin.Interface
|
||||
|
||||
Public Class SupervisorFunctions
|
||||
Implements IHost
|
||||
@@ -9,6 +10,7 @@ Public Class SupervisorFunctions
|
||||
Return Map.refMainWindowVM.m_PluginTestInfo
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Function PlgOutLog(sLogMsg As String) As Boolean Implements IHost.PlgOutLog
|
||||
Return EgtOutLog(sLogMsg)
|
||||
End Function
|
||||
@@ -45,6 +47,7 @@ Public Class SupervisorFunctions
|
||||
If Map.refMainWindowVM.MachineManager.MachineList.Count >= nMachine AndAlso Not IsNothing(Map.refMainWindowVM.MachineManager.MachineList(nMachine - 1)) Then
|
||||
Return Map.refMainWindowVM.MachineManager.MachineList(nMachine - 1).ReadShortVar(nVarAddr, nResult)
|
||||
Else
|
||||
EgtOutLog("Error reading variable " & nVarAddr & " on machine " & nMachine & ": " & Map.refMainWindowVM.MachineManager.MachineList(nMachine - 1).ErrMsg)
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
@@ -53,6 +56,7 @@ Public Class SupervisorFunctions
|
||||
If Map.refMainWindowVM.MachineManager.MachineList.Count >= nMachine AndAlso Not IsNothing(Map.refMainWindowVM.MachineManager.MachineList(nMachine - 1)) Then
|
||||
Return Map.refMainWindowVM.MachineManager.MachineList(nMachine - 1).ReadBitVar(nVarAddr, nBit, bResult)
|
||||
Else
|
||||
EgtOutLog("Error reading variable " & nVarAddr & " on machine " & nMachine & ": " & Map.refMainWindowVM.MachineManager.MachineList(nMachine - 1).ErrMsg)
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
@@ -61,6 +65,7 @@ Public Class SupervisorFunctions
|
||||
If Map.refMainWindowVM.MachineManager.MachineList.Count >= nMachine AndAlso Not IsNothing(Map.refMainWindowVM.MachineManager.MachineList(nMachine - 1)) Then
|
||||
Return Map.refMainWindowVM.MachineManager.MachineList(nMachine - 1).ReadDoubleVar(nVarAddr, dResult)
|
||||
Else
|
||||
EgtOutLog("Error reading variable " & nVarAddr & " on machine " & nMachine & ": " & Map.refMainWindowVM.MachineManager.MachineList(nMachine - 1).ErrMsg)
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
@@ -1,6 +1,7 @@
|
||||
Imports System.Threading
|
||||
Imports System.Math
|
||||
Imports System.IO
|
||||
Imports Effector.Plugin.Lib
|
||||
|
||||
Public Class MainWindowM
|
||||
|
||||
@@ -74,10 +75,17 @@ Public Class MainWindowM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nKeyOptions As UInteger = 0
|
||||
Friend ReadOnly Property nKeyOptions As Integer
|
||||
Private m_nKeyOpt1 As UInteger = 0
|
||||
Friend ReadOnly Property nKeyOpt1 As Integer
|
||||
Get
|
||||
Return m_nKeyOptions
|
||||
Return m_nKeyOpt1
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nKeyOpt2 As UInteger = 0
|
||||
Friend ReadOnly Property nKeyOpt2 As Integer
|
||||
Get
|
||||
Return m_nKeyOpt2
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -141,20 +149,6 @@ Public Class MainWindowM
|
||||
m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
|
||||
' Verifico indice di istanza
|
||||
ManageInstance()
|
||||
'' Imposto tipo di chiave
|
||||
'EgtSetLockType(KEY_TYPE.HW)
|
||||
'' Leggo e imposto chiave di protezione
|
||||
'Dim sLicFileName As String = String.Empty
|
||||
'GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
|
||||
'Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName
|
||||
'Dim sKey As String = String.Empty
|
||||
'EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||
'EgtSetKey(sKey)
|
||||
'' Recupero livello e opzioni della chiave
|
||||
'Dim bKey As Boolean = EgtGetKeyLevel(5583, 2605, 1, m_nKeyLevel) And
|
||||
' EgtGetKeyOptions(5583, 2605, 1, m_nKeyOptions)
|
||||
'' Inizializzazione generale di EgtInterface
|
||||
'm_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
' inizializzo log
|
||||
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||
Lua_General.SetLogPath(m_sLogFile)
|
||||
@@ -173,6 +167,73 @@ Public Class MainWindowM
|
||||
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
|
||||
My.Application.Info.Version.Revision.ToString()
|
||||
EgtOutLog(sLogMsg)
|
||||
' Leggo lingua corrente
|
||||
Dim sLanguage As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sLanguage)
|
||||
' Recupero nome file dei messaggi della lingua corrente
|
||||
Dim sMsgName As String = "Eng.txt"
|
||||
Dim nIndex As Integer = 1
|
||||
Dim ReadLanguage As Language = GetMainPrivateProfileLanguage(S_LANGUAGES, nIndex)
|
||||
While Not IsNothing(ReadLanguage)
|
||||
If String.Compare(ReadLanguage.Name, sLanguage, True) = 0 Then
|
||||
sMsgName = ReadLanguage.FilePath
|
||||
Exit While
|
||||
End If
|
||||
nIndex += 1
|
||||
ReadLanguage = GetMainPrivateProfileLanguage(S_LANGUAGES, nIndex)
|
||||
End While
|
||||
' recupero file messaggi
|
||||
Dim sMsgFilePath As String = m_sDataRoot & "\" & MSG_DIR & "\" & sMsgName
|
||||
' verifico se c'e' un plugin
|
||||
Dim sPluginName As String = ""
|
||||
If GetMainPrivateProfileString(S_GENERAL, K_PLUGINNAME, "", sPluginName) > 0 AndAlso Not String.IsNullOrWhiteSpace(sPluginName) Then
|
||||
' recupero nome del file messaggi del plugin
|
||||
Dim sPlugInMsgFilePath As String = m_sDataRoot & "\Plugin\" & sPluginName & "\Messages\" & sMsgName
|
||||
If File.Exists(sPlugInMsgFilePath) Then
|
||||
Dim OrigMsgFile As List(Of String) = File.ReadAllLines(sMsgFilePath).ToList()
|
||||
' elimino eventuali righe vuote o commento di fine
|
||||
While String.IsNullOrWhiteSpace(OrigMsgFile.Last()) OrElse OrigMsgFile.Last().StartsWith("//")
|
||||
OrigMsgFile.RemoveAt(OrigMsgFile.Count - 1)
|
||||
End While
|
||||
Dim PluginMsgFile As List(Of String) = File.ReadAllLines(sPlugInMsgFilePath).ToList()
|
||||
' elimino eventuale riga di inizio file
|
||||
If PluginMsgFile.Count > 1 AndAlso PluginMsgFile(1).StartsWith("//") AndAlso PluginMsgFile(0).StartsWith("//") Then
|
||||
PluginMsgFile.RemoveAt(0)
|
||||
End If
|
||||
OrigMsgFile.AddRange(PluginMsgFile)
|
||||
Dim sNewMsgFilePath As String = m_sDataRoot & "\Plugin\" & sPluginName & "\Messages\Complete" & sMsgName
|
||||
Dim bNewMsgFile As Boolean = False
|
||||
Try
|
||||
File.WriteAllLines(sNewMsgFilePath, OrigMsgFile)
|
||||
bNewMsgFile = True
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
If bNewMsgFile Then
|
||||
sMsgFilePath = sNewMsgFilePath
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' Leggo file messaggi
|
||||
If Not EgtLoadMessages(sMsgFilePath) Then
|
||||
EgtOutLog("Error in EgtLoadMessages")
|
||||
End If
|
||||
' Gestione della chiave di protezione
|
||||
Dim sLicFileName As String = ""
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
|
||||
Dim sLicFile As String = sConfigDir & "\" & sLicFileName
|
||||
Dim sKey As String = ""
|
||||
GenInterface.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||
EgtSetKey(sKey)
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(7375, 2706, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(7375, 2706, 1, m_nKeyOpt1, m_nKeyOpt2)
|
||||
|
||||
If Not bKey Then
|
||||
EgtOutLog("Key or Licence Problem (" & (-nKeyLevel).ToString() & ")")
|
||||
MessageBox.Show(String.Format(EgtMsg(201), (-nKeyLevel).ToString()), "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
EgtOutLog("Exit")
|
||||
End
|
||||
End If
|
||||
'EgtInit(m_nDebug, m_sLogFile, sLogMsg)
|
||||
'EgtSetTempDir(m_sTempDir)
|
||||
'EgtSetIniFile(IniFile.m_sIniFile)
|
||||
@@ -181,28 +242,8 @@ Public Class MainWindowM
|
||||
'If GetMainPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
|
||||
' sMsgDir = m_sConfigDir
|
||||
'End If
|
||||
''' Inizializzo OptionModule
|
||||
'' Inizializzo OptionModule
|
||||
''OptionModule.InitOptionModule()
|
||||
'' Leggo lingua corrente
|
||||
'Dim sLanguage As String = String.Empty
|
||||
'GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sLanguage)
|
||||
'' Recupero nome file dei messaggi della lingua corrente
|
||||
'Dim sMsgName As String = "EgalTechIta.txt"
|
||||
'Dim nIndex As Integer = 1
|
||||
'While True
|
||||
' Dim ReadLanguage As Language = GetMainPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
|
||||
' If IsNothing(ReadLanguage) Then Exit While
|
||||
' If String.Compare(ReadLanguage.Name, sLanguage, True) = 0 Then
|
||||
' sMsgName = ReadLanguage.FilePath
|
||||
' Exit While
|
||||
' End If
|
||||
' nIndex += 1
|
||||
'End While
|
||||
'' Leggo file messaggi
|
||||
'Dim sMsgFilePath As String = sMsgDir & "\" & sMsgName
|
||||
'If Not EgtLoadMessages(sMsgFilePath) Then
|
||||
' EgtOutLog("Error in EgtLoadMessages")
|
||||
'End If
|
||||
' Leggo e imposto livello utilizzatore
|
||||
' m_nUserLevel = Math.Min(m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
|
||||
' Info su opzioni chiave
|
||||
@@ -214,7 +255,7 @@ Public Class MainWindowM
|
||||
Private Sub ManageInstance()
|
||||
Dim bCreated As Boolean
|
||||
Try
|
||||
m_objMutex = New Mutex(False, "Global\Supervisor", bCreated)
|
||||
m_objMutex = New Mutex(False, "Global\Effector", bCreated)
|
||||
Catch
|
||||
bCreated = False
|
||||
End Try
|
||||
@@ -240,7 +281,7 @@ Public Class MainWindowM
|
||||
' porto in primo piano la prima istanza
|
||||
Dim bFound As Boolean = False
|
||||
' processi del programma a 32 bit
|
||||
Dim localProc As Process() = Process.GetProcessesByName("SupervisorR32")
|
||||
Dim localProc As Process() = Process.GetProcessesByName("EffectorR32")
|
||||
For Each p As Process In localProc
|
||||
If p.Id <> Process.GetCurrentProcess().Id Then
|
||||
bFound = True
|
||||
@@ -250,7 +291,7 @@ Public Class MainWindowM
|
||||
Next
|
||||
' se non trovati processi a 32 bit provo a 64 bit
|
||||
If Not bFound Then
|
||||
localProc = Process.GetProcessesByName("SupervisorR64")
|
||||
localProc = Process.GetProcessesByName("EffectorR64")
|
||||
For Each p As Process In localProc
|
||||
If p.Id <> Process.GetCurrentProcess().Id Then
|
||||
bFound = True
|
||||
@@ -268,8 +309,12 @@ Public Class MainWindowM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Function GetKeyOption(nKeyOpt As KEY_OPT) As Boolean
|
||||
Return ((m_nKeyOptions And nKeyOpt) <> 0)
|
||||
Friend Function GetKeyOption1(nKeyOpt1 As Integer) As Boolean
|
||||
Return (m_nKeyOpt1 >= nKeyOpt1)
|
||||
End Function
|
||||
|
||||
Friend Function GetKeyOption2(nKeyOpt2 As Integer) As Boolean
|
||||
Return (m_nKeyOpt2 = nKeyOpt2)
|
||||
End Function
|
||||
|
||||
Friend Function GetMaxInstances() As Integer
|
||||
@@ -0,0 +1,18 @@
|
||||
<Lib:EffectorWindow x:Class="MainWindowV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Effector.Main"
|
||||
xmlns:Lib="clr-namespace:Effector.Plugin.Lib;assembly=Effector.Plugin.Lib"
|
||||
xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"
|
||||
TitleBarHeight="40"
|
||||
Title="{Binding sTitle}"
|
||||
TitlePanel="{Binding ContentMenu}">
|
||||
<Window.OpacityMask>
|
||||
<SolidColorBrush Color="White" Opacity="{Binding Window_Opacity}"/>
|
||||
</Window.OpacityMask>
|
||||
|
||||
<ContentControl Grid.Row="1"
|
||||
Content="{Binding ContentPanel}"
|
||||
BorderThickness="0"/>
|
||||
|
||||
</Lib:EffectorWindow>
|
||||
@@ -0,0 +1,54 @@
|
||||
Imports System.IO
|
||||
Imports System.Runtime.CompilerServices
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Text
|
||||
Imports System.Windows.Interop
|
||||
Imports System.Xml
|
||||
Imports System.Xml.Serialization
|
||||
Imports Effector.Plugin.Lib
|
||||
|
||||
Class MainWindowV
|
||||
|
||||
Private m_MainWindowVM As MainWindowVM
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
m_MainWindowVM = New MainWindowVM
|
||||
' Funzione che interpreta l'xaml
|
||||
InitializeComponent()
|
||||
' Assegno al DataContext il VM appena creato
|
||||
Me.DataContext = m_MainWindowVM
|
||||
'AddHandler Me.ContentRendered, AddressOf MainWindowV_ContentRendered
|
||||
' imposto posizione finestra
|
||||
Me.SetPlacementAppName(S_GENERAL)
|
||||
Me.SetPlacementKeyName(K_WINPLACE)
|
||||
Me.SetPlacementFileName(IniFile.sPath)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Protected Overrides Sub OnContentRendered(e As EventArgs)
|
||||
MyBase.OnContentRendered(e)
|
||||
m_MainWindowVM.ContentRendered()
|
||||
End Sub
|
||||
Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs)
|
||||
m_MainWindowVM.ContentRendered()
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub OnCloseButtonClick(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
If m_MainWindowVM.OnClose() Then
|
||||
EgtOutLog("Exit")
|
||||
Me.Close()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
@@ -1,8 +1,9 @@
|
||||
Imports System.IO
|
||||
Imports System.Windows.Threading
|
||||
Imports Supervisor.Plugin.Interface
|
||||
Imports Effector.Plugin.Lib
|
||||
Imports Effector.Plugin.Interface
|
||||
|
||||
Public Class MainWindowVM
|
||||
Inherits VMBase
|
||||
|
||||
Friend m_PluginTestInfo As Integer = 764
|
||||
|
||||
@@ -22,7 +23,6 @@ Public Class MainWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
' Riferimento al gestore del della comunicazione macchine
|
||||
Private m_MachineManager As MachineManager
|
||||
Friend ReadOnly Property MachineManager As MachineManager
|
||||
@@ -53,9 +53,34 @@ Public Class MainWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SplashScreen_Timer As New DispatcherTimer
|
||||
Private m_WaitAfterRender As Integer = 0
|
||||
|
||||
Private m_Window_Opacity As Double = 0.2
|
||||
Public ReadOnly Property Window_Opacity As Double
|
||||
Get
|
||||
Return m_Window_Opacity
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Titolo
|
||||
Public ReadOnly Property sTitle As String
|
||||
Get
|
||||
Return EgtMsg(1)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
' Avvio l'inizializzazione della mappa passandogli il riferimento al MainWindowVM
|
||||
Map.BeginInit(Me)
|
||||
|
||||
' imposto e avvio contatore SplashScreen
|
||||
m_SplashScreen_Timer.Interval = New TimeSpan(0, 0, 0, 0, 500)
|
||||
AddHandler m_SplashScreen_Timer.Tick, AddressOf SplashScreenTimer_Tick
|
||||
If Not IsNothing(Map.refSplashScreen) Then
|
||||
m_SplashScreen_Timer.Start()
|
||||
End If
|
||||
|
||||
' Creo Model della MainWindow
|
||||
m_MainWindowM = New MainWindowM
|
||||
|
||||
@@ -80,6 +105,10 @@ Public Class MainWindowVM
|
||||
m_ContentPanel = ProjectPlugin
|
||||
End If
|
||||
|
||||
' creo variabile globale Effector per dati programma
|
||||
LuaManager.CreateGlobTable("EFFECTOR")
|
||||
LuaManager.SetGlobVar("EFFECTOR.INIPATH", Map.refMainWindowVM.MainWindowM.sConfigDir & "\" & INI_FILE_NAME)
|
||||
|
||||
' creo gestore delle macchine a stati
|
||||
m_FiniteStateMachineManager = New FiniteStateMachineManager
|
||||
If GetMainPrivateProfileInt(S_REDIS, K_ENABLED, 0) = 1 Then
|
||||
@@ -88,6 +117,34 @@ Public Class MainWindowVM
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub ContentRendered()
|
||||
' segno su contatore splashscreen render finito
|
||||
m_WaitAfterRender = 1
|
||||
End Sub
|
||||
|
||||
Friend Function OnClose() As Boolean
|
||||
If Not IsNothing(FiniteStateMachineManager) Then FiniteStateMachineManager.ResetFiniteStateMachineTimer()
|
||||
LuaManager.Close()
|
||||
' chiudo comunicazione macchine
|
||||
m_MachineManager.Close()
|
||||
' Termino il Model
|
||||
m_MainWindowM.Close()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub SplashScreenTimer_Tick()
|
||||
If m_WaitAfterRender > 1 Then
|
||||
m_Window_Opacity = 1
|
||||
NotifyPropertyChanged(NameOf(Window_Opacity))
|
||||
' chiudo SplashScreen
|
||||
Map.refSplashScreen.Close()
|
||||
Map.SetRefSplashScreen(Nothing)
|
||||
m_SplashScreen_Timer.Stop()
|
||||
ElseIf m_WaitAfterRender > 0 Then
|
||||
m_WaitAfterRender += 1
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "Plugin"
|
||||
|
||||
Private m_Loader As MEFLoader = New MEFLoader()
|
||||
@@ -11,11 +11,11 @@ Imports System.Windows
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("Supervisor")>
|
||||
<Assembly: AssemblyTitle("Effector")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("Supervisor")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2024 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("Effector")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2024-2025 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
|
||||
@@ -55,5 +55,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.6.5.1")>
|
||||
<Assembly: AssemblyFileVersion("2.6.5.1")>
|
||||
<Assembly: AssemblyVersion("3.1.5.3")>
|
||||
<Assembly: AssemblyFileVersion("3.1.5.3")>
|
||||
Generated
Generated
+3
-3
@@ -63,10 +63,10 @@ Namespace My
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.Supervisor.My.MySettings
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")>
|
||||
Friend ReadOnly Property Settings() As Global.Effector.Main.My.MySettings
|
||||
Get
|
||||
Return Global.Supervisor.My.MySettings.Default
|
||||
Return Global.Effector.Main.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 178 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 813 KiB |
@@ -0,0 +1,40 @@
|
||||
<Window x:Class="SplashScreen"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="White"
|
||||
Topmost="False"
|
||||
ShowInTaskbar="False"
|
||||
Height="600"
|
||||
Width="1000">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="7.20*"/>
|
||||
<ColumnDefinition Width="1.68*"/>
|
||||
<ColumnDefinition Width="0.91*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1.4*"/>
|
||||
<RowDefinition Height="0.2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Grid.ColumnSpan="3"
|
||||
Grid.RowSpan="3"
|
||||
Source="/Resources/SplashScreen.png"
|
||||
Stretch="UniformToFill"/>
|
||||
<TextBlock x:Name="VersionTxBl"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
FontSize="14"
|
||||
FontFamily="./Resources/Fonts/#Advent Pro"
|
||||
HorizontalAlignment="Center"/>
|
||||
<!--<TextBlock Text="2022-2023"
|
||||
FontSize="6"
|
||||
FontFamily="/Resources/Fonts/#Roboto"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Margin="0,0,254,60"/>-->
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
Public Class SplashScreen
|
||||
|
||||
Private Sub SplashScreen_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
VersionTxBl.Text = "Version " & My.Application.Info.Version.Major.ToString() &
|
||||
"." & My.Application.Info.Version.Minor.ToString() &
|
||||
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
|
||||
My.Application.Info.Version.Revision.ToString()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,129 @@
|
||||
<ResourceDictionary x:Class="Dictionary"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:local="clr-namespace:Effector.Main"
|
||||
xmlns:Lib="clr-namespace:Effector.Plugin.Lib;assembly=Effector.Plugin.Lib">
|
||||
|
||||
<!--
|
||||
Assign a Key to every Panel ViewModel to use
|
||||
it in xaml file(ProjectView.xaml).
|
||||
-->
|
||||
<!--<local:FiveLakesUIVM x:Key="FiveLakesUIVM"/>
|
||||
<local:DoorListPageVM x:Key="DoorListVM"/>
|
||||
<local:MachinePageVM x:Key="MachinePageVM"/>-->
|
||||
|
||||
<!--Colori predefiniti-->
|
||||
|
||||
<!--#e8eef5--><!--
|
||||
<Color x:Key="Effector_LightBlue_Color" R="232" G="238" B="245" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_LightBlue" Color="{StaticResource Effector_LightBlue_Color}" />
|
||||
--><!--#afc5d6--><!--
|
||||
<Color x:Key="Effector_Blue_Color" R="175" G="197" B="214" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Blue" Color="{StaticResource Effector_Blue_Color}" />
|
||||
--><!--#749fc4--><!--
|
||||
<Color x:Key="Effector_DarkBlue_Color" R="116" G="159" B="196" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_DarkBlue" Color="{StaticResource Effector_DarkBlue_Color}" />
|
||||
|
||||
|
||||
--><!--#92bde3--><!--
|
||||
<Color x:Key="Effector_LightBlue_Status_Color" R="146" G="189" B="227" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_LightBlue_Status" Color="{StaticResource Effector_LightBlue_Status_Color}" />
|
||||
--><!--#5682a6--><!--
|
||||
<Color x:Key="Effector_Blue_Status_Color" R="86" G="130" B="166" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Blue_Status" Color="{StaticResource Effector_Blue_Status_Color}" />
|
||||
--><!--#cd5c5c--><!--
|
||||
<Color x:Key="Effector_Red_Status_Color" R="205" G="92" B="92" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Red_Status" Color="{StaticResource Effector_Red_Status_Color}" />
|
||||
--><!--#b1cbaa--><!--
|
||||
<Color x:Key="Effector_Green_Status_Color" R="177" G="203" B="170" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Green_Status" Color="{StaticResource Effector_Green_Status_Color}" />
|
||||
--><!--#9c9c9c--><!--
|
||||
<Color x:Key="Effector_Gray_Status_Color" R="156" G="156" B="156" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Gray_Status" Color="{StaticResource Effector_Gray_Status_Color}" />
|
||||
--><!--#ffd932--><!--
|
||||
<Color x:Key="Effector_Yellow_Status_Color" R="255" G="217" B="50" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Yellow_Status" Color="{StaticResource Effector_Yellow_Status_Color}" />
|
||||
|
||||
--><!--#6398c7--><!--
|
||||
<Color x:Key="Effector_LightBlue_SelStatus_Color" R="99" G="152" B="199" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_LightBlue_SelStatus" Color="{StaticResource Effector_LightBlue_SelStatus_Color}" />
|
||||
--><!--#4b677e--><!--
|
||||
<Color x:Key="Effector_Blue_SelStatus_Color" R="75" G="103" B="126" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Blue_SelStatus" Color="{StaticResource Effector_Blue_SelStatus_Color}" />
|
||||
--><!--#a94444--><!--
|
||||
<Color x:Key="Effector_Red_SelStatus_Color" R="169" G="68" B="68" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Red_SelStatus" Color="{StaticResource Effector_Red_SelStatus_Color}" />
|
||||
--><!--#89aa81--><!--
|
||||
<Color x:Key="Effector_Green_SelStatus_Color" R="137" G="170" B="129" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Green_SelStatus" Color="{StaticResource Effector_Green_SelStatus_Color}" />
|
||||
--><!--#7d7d7d--><!--
|
||||
<Color x:Key="Effector_Gray_SelStatus_Color" R="125" G="125" B="125" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Gray_SelStatus" Color="{StaticResource Effector_Gray_SelStatus_Color}" />
|
||||
--><!--#dcb718--><!--
|
||||
<Color x:Key="Effector_Yellow_SelStatus_Color" R="220" G="183" B="24" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Yellow_SelStatus" Color="{StaticResource Effector_Yellow_SelStatus_Color}" />
|
||||
--><!--#e5ebf1--><!--
|
||||
<Color x:Key="Effector_White_SelStatus_Color" R="229" G="235" B="241" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_White_SelStatus" Color="{StaticResource Effector_Yellow_SelStatus_Color}" />-->
|
||||
|
||||
<!--#BC373E-->
|
||||
<!--
|
||||
<Color x:Key="Effector_Orange_Color" R="188" G="55" B="62" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Orange" Color="{StaticResource Effector_Orange_Color}" />
|
||||
-->
|
||||
<!--#A74C77-->
|
||||
<!--
|
||||
<Color x:Key="Effector_Purple_Color" R="167" G="76" B="119" A="255"/>
|
||||
<SolidColorBrush x:Key="Effector_Purple" Color="{StaticResource Effector_Purple_Color}" />-->
|
||||
|
||||
<!--Colori per EgtWPFLib5-->
|
||||
<!--<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>-->
|
||||
|
||||
<!--Risorsa che toglie le animazioni dai menù popup per evitare che i menù mru di scelta dei file rimangano aperti se il file è grosso -->
|
||||
<!--o viene eseguito un lua che non aggiorna l'interfaccia-->
|
||||
<PopupAnimation x:Key="{x:Static SystemParameters.MenuPopupAnimationKey}">None</PopupAnimation>
|
||||
|
||||
<!--convertert per visibilita' stringa di testo con misure in StatusBar-->
|
||||
<!--
|
||||
<PrintApp:StringToVisibilityConverter x:Key="StringToVisibilityConverter"/>-->
|
||||
|
||||
<!--<GridLength x:Key="TitleBar_Height">45</GridLength>
|
||||
<sys:Double x:Key="Icon_Width">45</sys:Double>
|
||||
<sys:Double x:Key="Icon_Height">45</sys:Double>
|
||||
<Thickness x:Key="WindowBorder_Thickness">2</Thickness>
|
||||
<sys:Double x:Key="WindowBorder_Height">2</sys:Double>-->
|
||||
|
||||
<!--<Style x:Key="TitleBar_Button" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="border"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="contentPresenter"
|
||||
Margin="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="{DynamicResource MouseOverOverlayBackgroundBrush}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="{DynamicResource PressedOverlayBackgroundBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>-->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,6 +1,6 @@
|
||||
Imports System.ComponentModel.Composition
|
||||
Imports System.Globalization
|
||||
Imports Supervisor.Plugin.Interface
|
||||
Imports Effector.Plugin.Interface
|
||||
|
||||
<Export(GetType(IPluginControl))>
|
||||
<ExportMetadata("Name", "Dictionary")>
|
||||
@@ -12,6 +12,48 @@ Public Class Dictionary
|
||||
|
||||
#Region "Colors"
|
||||
|
||||
'Private Shared m_Effector_LightBlue As SolidColorBrush = Application.Current.FindResource("Effector_LightBlue")
|
||||
'Public Shared ReadOnly Property Effector_LightBlue As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Effector_LightBlue
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Effector_Blue As SolidColorBrush = Application.Current.FindResource("Effector_Blue")
|
||||
'Public Shared ReadOnly Property Effector_Blue As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Effector_Blue
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Effector_Red As SolidColorBrush = Application.Current.FindResource("Effector_Red")
|
||||
'Public Shared ReadOnly Property Effector_Red As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Effector_Red
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Effector_Green As SolidColorBrush = Application.Current.FindResource("Effector_Green")
|
||||
'Public Shared ReadOnly Property Effector_Green As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Effector_Green
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Effector_Gray As SolidColorBrush = Application.Current.FindResource("Effector_Gray")
|
||||
'Public Shared ReadOnly Property Effector_Gray As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Effector_Gray
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Effector_Yellow As SolidColorBrush = Application.Current.FindResource("Effector_Yellow")
|
||||
'Public Shared ReadOnly Property Effector_Yellow As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Effector_Yellow
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private m_Omag_Red As SolidColorBrush = Brushes.Red
|
||||
'Public ReadOnly Property Omag_Red As SolidColorBrush
|
||||
' Get
|
||||
@@ -0,0 +1,80 @@
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Security
|
||||
|
||||
Public Module EgtInterface
|
||||
|
||||
#If DEBUG Then
|
||||
Const EgtIntDll32 As String = "EgtBasisD32.dll"
|
||||
#Else
|
||||
Const EgtIntDll32 As String = "EgtBasisR32.dll"
|
||||
#End If
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtSetKey"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtSetKey(sKey As String) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyLevel"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtGetKeyLevel(nProd As Integer, nVer As Integer, nLev As Integer, ByRef nKLev As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyOptions"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtGetKeyOptions(nProd As Integer, nVer As Integer, nLev As Integer,
|
||||
ByRef nOpt1 As UInteger, ByRef nOpt2 As UInteger) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyLeftDays"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtGetKeyLeftDays(ByRef nLeftDays As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyAssLeftDays"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtGetKeyAssLeftDays(ByRef nAssLeftDays As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyOptLeftDays"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtGetKeyOptLeftDays(ByRef nOptLeftDays As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtFreeMemory"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtFreeMemory(sB As IntPtr) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtLoadMessages"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtLoadMessages(sMsgFilePath As String) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetMsg"), SuppressUnmanagedCodeSecurity()>
|
||||
Private Function EgtGetMsg_32(nId As Integer) As IntPtr
|
||||
End Function
|
||||
Public Function EgtMsg(nId As Integer) As String
|
||||
Return Marshal.PtrToStringUni(EgtGetMsg_32(nId))
|
||||
' Non è necessario liberare la memoria nativa perchè usa un buffer statico
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtInitLogger"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtInitLogger(nDebug As Integer, sLogFilePath As String) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtOutLog"), SuppressUnmanagedCodeSecurity()>
|
||||
Private Function EgtOutLog(sMsg As String, nDebugLevel As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetStringUtf8FromIni"), SuppressUnmanagedCodeSecurity()>
|
||||
Private Function EgtGetStringUtf8FromIni_32(sSec As String, sKey As String, sDef As String, ByRef sVal As IntPtr, sIniFile As String) As Boolean
|
||||
End Function
|
||||
Public Function EgtGetStringUtf8FromIni(sSec As String, sKey As String, sDef As String, ByRef sVal As String, sIniFile As String) As Boolean
|
||||
Dim psVal As IntPtr
|
||||
Dim bOk As Boolean = EgtGetStringUtf8FromIni_32(sSec, sKey, sDef, psVal, sIniFile)
|
||||
If bOk Then
|
||||
sVal = Marshal.PtrToStringUni(psVal)
|
||||
EgtFreeMemory(psVal)
|
||||
Else
|
||||
sVal = String.Empty
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtWriteStringUtf8ToIni"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtWriteStringUtf8toIni(sSec As String, sKey As String, sVal As String, sIniFile As String) As Boolean
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -2,6 +2,8 @@
|
||||
Module Map
|
||||
|
||||
Private m_refMainWindowVM As MainWindowVM
|
||||
Private m_refSplashScreen As SplashScreen
|
||||
|
||||
'Private m_refProjectVM As ProjectVM
|
||||
'Private m_refSecondaryWindowVM As SecondaryWindowVM
|
||||
'Private m_refSecondaryWindowV As SecondaryWindowV
|
||||
@@ -14,6 +16,12 @@ Module Map
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSplashScreen As SplashScreen
|
||||
Get
|
||||
Return m_refSplashScreen
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Public ReadOnly Property refMyStatusBarVM As MyStatusBarVM
|
||||
' Get
|
||||
' Return LibMap.refStatusBarVM
|
||||
@@ -47,6 +55,11 @@ Module Map
|
||||
|
||||
#Region "Set"
|
||||
|
||||
Friend Function SetRefSplashScreen(SplashScreen As SplashScreen) As Boolean
|
||||
m_refSplashScreen = SplashScreen
|
||||
Return Not IsNothing(m_refSplashScreen)
|
||||
End Function
|
||||
|
||||
'Friend Function SetRefMyStatusBarVM(MyStatusBarVM As MyStatusBarVM) As Boolean
|
||||
' LibMap.SetRefStatusBarVM(MyStatusBarVM)
|
||||
' Return Not IsNothing(LibMap.refStatusBarVM)
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports StackExchange
|
||||
Imports StackExchange.Redis
|
||||
Imports Effector.Plugin.Lib
|
||||
|
||||
Class RedisManager
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<!-- UAC Manifest Options
|
||||
If you want to change the Windows User Account Control level replace the
|
||||
requestedExecutionLevel node with one of the following.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
Specifying requestedExecutionLevel element will disable file and registry virtualization.
|
||||
Remove this element if your application requires this virtualization for backwards
|
||||
compatibility.
|
||||
-->
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- A list of the Windows versions that this application has been tested on
|
||||
and is designed to work with. Uncomment the appropriate elements
|
||||
and Windows will automatically select the most compatible environment. -->
|
||||
|
||||
<!-- Windows Vista -->
|
||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
|
||||
|
||||
<!-- Windows 7 -->
|
||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
|
||||
|
||||
<!-- Windows 8 -->
|
||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
|
||||
|
||||
<!-- Windows 8.1 -->
|
||||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
|
||||
|
||||
<!-- Windows 10 -->
|
||||
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
|
||||
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
|
||||
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
|
||||
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
|
||||
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config.
|
||||
|
||||
Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
|
||||
|
||||
<!--<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
--><!--<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>--><!--
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||
</windowsSettings>
|
||||
</application>-->
|
||||
|
||||
|
||||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
||||
<!--
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
-->
|
||||
|
||||
</assembly>
|
||||
+7
-10
@@ -4,8 +4,8 @@
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
|
||||
<RootNamespace>Supervisor.Plugin.Interface</RootNamespace>
|
||||
<AssemblyName>Supervisor.Plugin.Interface</AssemblyName>
|
||||
<RootNamespace>Effector.Plugin.Interface</RootNamespace>
|
||||
<AssemblyName>Effector.Plugin.Interface</AssemblyName>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<MyType>Custom</MyType>
|
||||
@@ -19,7 +19,7 @@
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>true</IncrementalBuild>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>Supervisor.Plugin.Interface.xml</DocumentationFile>
|
||||
<DocumentationFile>Effector.Plugin.Interface.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
@@ -30,7 +30,7 @@
|
||||
<IncrementalBuild>false</IncrementalBuild>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>Supervisor.Plugin.Interface.xml</DocumentationFile>
|
||||
<DocumentationFile>Effector.Plugin.Interface.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
@@ -109,11 +109,8 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Supervisor\Supervisor.Plugin.InterfaceR32.dll
|
||||
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Supervisor\Supervisor.Plugin.InterfaceD32.dll
|
||||
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Supervisor\Supervisor.Plugin.InterfaceR64.dll
|
||||
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Supervisor\Supervisor.Plugin.InterfaceD64.dll
|
||||
copy $(TargetPath) c:\EgtData\Supervisor\Plugin\Supervisor.Plugin.FiveLakes\Supervisor.Plugin.FiveLakes.dll
|
||||
copy $(TargetPath) c:\EgtProg\Supervisor\Supervisor.Plugin.Interface.dll</PostBuildEvent>
|
||||
<PostBuildEvent>copy $(TargetPath) c:\EgtData\Effector\Plugin\Effector.Plugin.DoorArreda\Effector.Plugin.Interface.dll
|
||||
copy $(TargetPath) c:\EgtData\Effector\Plugin\Effector.Plugin.FiveLakes\Effector.Plugin.Interface.dll
|
||||
copy $(TargetPath) c:\EgtProg\Effector\Effector.Plugin.Interface.dll</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
+7
-7
@@ -11,11 +11,11 @@ Imports System.Windows
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("Supervisor.Plugin.Interface")>
|
||||
<Assembly: AssemblyTitle("Effector.Plugin.Interface")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Windows User")>
|
||||
<Assembly: AssemblyProduct("Supervisor.Plugin.Interface")>
|
||||
<Assembly: AssemblyCopyright("Copyright @ Windows User 2024")>
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("Effector.Plugin.Interface")>
|
||||
<Assembly: AssemblyCopyright("Copyright @ 2024-2025 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
|
||||
@@ -42,7 +42,7 @@ Imports System.Windows
|
||||
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("c2324e1b-e8d0-4e39-adb6-273a15914498")>
|
||||
<Assembly: Guid("c2324e1b-e8d0-4e39-adb6-273a15914498")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
@@ -55,5 +55,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyVersion("2.7.8.1")>
|
||||
<Assembly: AssemblyFileVersion("2.7.8.1")>
|
||||
+2
-2
@@ -64,9 +64,9 @@ Namespace My
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.Supervisor.Plugin.Interface.My.MySettings
|
||||
Friend ReadOnly Property Settings() As Global.Effector.Plugin.Interface.My.MySettings
|
||||
Get
|
||||
Return Global.Supervisor.Plugin.Interface.My.MySettings.Default
|
||||
Return Global.Effector.Plugin.Interface.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
@@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34309.116
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Supervisor", "Supervisor\Supervisor.vbproj", "{38BEE4BF-9238-459F-AF89-4DD94C4FD0DA}"
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Effector.Main", "Effector.Main\Effector.Main.vbproj", "{38BEE4BF-9238-459F-AF89-4DD94C4FD0DA}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Supervisor.Plugin.Interface", "Supervisor.Plugin.Interface\Supervisor.Plugin.Interface.vbproj", "{7D14D864-2BDC-4785-80F4-320164C2D5E4}"
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Effector.Plugin.Interface", "Effector.Plugin.Interface\Effector.Plugin.Interface.vbproj", "{7D14D864-2BDC-4785-80F4-320164C2D5E4}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Supervisor.Plugin.FiveLakes", "..\Plugin.FiveLakes\Supervisor.Plugin.FiveLakes\Supervisor.Plugin.FiveLakes.vbproj", "{7C77F537-8235-40AB-B24A-4E71CFB96D2C}"
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Effector.Plugin.FiveLakes", "..\Effector.Plugin.FiveLakes\Effector.Plugin.FiveLakes\Effector.Plugin.FiveLakes.vbproj", "{7C77F537-8235-40AB-B24A-4E71CFB96D2C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,10 +0,0 @@
|
||||
<Application x:Class="Application"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Supervisor">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary Source="Utility/Dictionary.xaml"/>
|
||||
</Application.Resources>
|
||||
|
||||
</Application>
|
||||
@@ -1,56 +0,0 @@
|
||||
Imports NGP_COMM_DLL
|
||||
|
||||
Public Class MachineManager
|
||||
'
|
||||
'
|
||||
' !!!! TO DO : use a list of n machines, not just 2 !!!!
|
||||
Private m_MachineList(20) As NC.NC_generic
|
||||
Friend ReadOnly Property MachineList As NC.NC_generic()
|
||||
Get
|
||||
Return m_MachineList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
End Sub
|
||||
|
||||
Sub Init()
|
||||
If GetMainPrivateProfileInt(S_NC, K_NC_SIMULATE, 0) = 1 Then
|
||||
Dim nMachineIndex As Integer = 0
|
||||
Dim sMachine As String = ""
|
||||
While GetMainPrivateProfileString(S_NC, K_MACHINE & (nMachineIndex + 1).ToString(), "", sMachine) > 0
|
||||
Dim NewSimulatedMachine As New NC.Simulated
|
||||
NewSimulatedMachine.Connect("")
|
||||
m_MachineList(nMachineIndex) = NewSimulatedMachine
|
||||
nMachineIndex += 1
|
||||
End While
|
||||
Else
|
||||
Dim nMachineIndex As Integer = 1
|
||||
Dim sMachine As String = ""
|
||||
While GetMainPrivateProfileString(S_NC, K_MACHINE & nMachineIndex.ToString(), "", sMachine) > 0
|
||||
Dim sMachineSplit() As String = sMachine.Split(","c)
|
||||
Dim nType As Integer = 0
|
||||
If sMachineSplit.Count >= 1 AndAlso Not String.IsNullOrWhiteSpace(sMachineSplit(0)) AndAlso Integer.TryParse(sMachineSplit(0), nType) Then
|
||||
Select Case nType
|
||||
Case 1 ' OsaiOpen
|
||||
If sMachineSplit.Count >= 2 AndAlso Not String.IsNullOrWhiteSpace(sMachineSplit(1)) Then
|
||||
Dim NewOsaiOpen As New NC.OsaiOpen
|
||||
NewOsaiOpen.Connect(sMachineSplit(1))
|
||||
m_MachineList(nMachineIndex - 1) = NewOsaiOpen
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
nMachineIndex += 1
|
||||
End While
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub Close()
|
||||
For Each Machine In m_MachineList
|
||||
If Not IsNothing(Machine) Then
|
||||
Machine.Disconnect()
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,93 +0,0 @@
|
||||
<Window x:Class="MainWindowV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Supervisor"
|
||||
Title="MainWindow"
|
||||
Style="{StaticResource MainWindow}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0"
|
||||
Width="32"
|
||||
Height="32"
|
||||
Source="/Resources/Effector.ico" />
|
||||
<ContentControl Grid.Column="1"
|
||||
Content="{Binding ContentMenu}"/>
|
||||
<TextBlock Grid.Column="2"
|
||||
Margin="4 0 0 0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{Binding WindowTitle}">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType=Window}}" Value="False">
|
||||
<Setter Property="Foreground" Value="{DynamicResource WindowTitleBarInactiveText}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
|
||||
<Button Grid.Column="3"
|
||||
Click="OnMinimizeButtonClick"
|
||||
RenderOptions.EdgeMode="Aliased"
|
||||
Style="{StaticResource TitleBarButtonStyle}">
|
||||
<Path Width="46"
|
||||
Height="32"
|
||||
Data="M 18,15 H 28"
|
||||
Stroke="{Binding Path=Foreground,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
|
||||
StrokeThickness="1" />
|
||||
</Button>
|
||||
<Button Name="maximizeButton"
|
||||
Grid.Column="4"
|
||||
Click="OnMaximizeRestoreButtonClick"
|
||||
Style="{StaticResource TitleBarButtonStyle}">
|
||||
<Path Width="46"
|
||||
Height="32"
|
||||
Data="M 18.5,10.5 H 27.5 V 19.5 H 18.5 Z"
|
||||
Stroke="{Binding Path=Foreground,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
|
||||
StrokeThickness="1" />
|
||||
</Button>
|
||||
<Button Name="restoreButton"
|
||||
Grid.Column="4"
|
||||
Click="OnMaximizeRestoreButtonClick"
|
||||
Style="{StaticResource TitleBarButtonStyle}">
|
||||
<Path Width="46"
|
||||
Height="32"
|
||||
Data="M 18.5,12.5 H 25.5 V 19.5 H 18.5 Z M 20.5,12.5 V 10.5 H 27.5 V 17.5 H 25.5"
|
||||
Stroke="{Binding Path=Foreground,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
|
||||
StrokeThickness="1" />
|
||||
</Button>
|
||||
<Button Grid.Column="5"
|
||||
Click="OnCloseButtonClick"
|
||||
Style="{StaticResource TitleBarCloseButtonStyle}">
|
||||
<Path Width="46"
|
||||
Height="32"
|
||||
Data="M 18,11 27,20 M 18,20 27,11"
|
||||
Stroke="{Binding Path=Foreground,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
|
||||
StrokeThickness="1" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<ContentControl Grid.Row="2"
|
||||
Content="{Binding ContentMenu}"/>
|
||||
<ContentControl Grid.Row="1"
|
||||
Content="{Binding ContentPanel}"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,79 +0,0 @@
|
||||
Imports System.Windows.Interop
|
||||
|
||||
Class MainWindowV
|
||||
|
||||
Private m_MainWindowVM As MainWindowVM
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Funzione che interpreta l'xaml
|
||||
InitializeComponent()
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_MainWindowVM = DirectCast(Me.DataContext, MainWindowVM)
|
||||
AddHandler Me.Loaded, AddressOf MainWindowV_Loaded
|
||||
AddHandler Me.StateChanged, AddressOf Window_StateChanged
|
||||
AddHandler Me.Closing, AddressOf MainWindowV_Closing
|
||||
AddHandler Me.Closed, AddressOf MainWindowV_Closed
|
||||
Me.RefreshMaximizeRestoreButton()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Private Sub RefreshMaximizeRestoreButton()
|
||||
If Me.WindowState = WindowState.Maximized Then
|
||||
Me.maximizeButton.Visibility = Visibility.Collapsed
|
||||
Me.restoreButton.Visibility = Visibility.Visible
|
||||
Else
|
||||
Me.maximizeButton.Visibility = Visibility.Visible
|
||||
Me.restoreButton.Visibility = Visibility.Collapsed
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnMinimizeButtonClick(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
Me.WindowState = WindowState.Minimized
|
||||
End Sub
|
||||
|
||||
Private Sub OnMaximizeRestoreButtonClick(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
If Me.WindowState = WindowState.Maximized Then
|
||||
Me.WindowState = WindowState.Normal
|
||||
Else
|
||||
Me.WindowState = WindowState.Maximized
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Window_StateChanged(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Me.RefreshMaximizeRestoreButton()
|
||||
End Sub
|
||||
|
||||
Private Sub OnCloseButtonClick(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
' Carico e imposto posizione finestra
|
||||
WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
|
||||
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
|
||||
e.Cancel = True
|
||||
Return
|
||||
End If
|
||||
' Salvo posizione finestra (se non minimizzata)
|
||||
If WindowState <> WindowState.Minimized Then
|
||||
WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_Closed(sender As Object, e As EventArgs)
|
||||
If Not IsNothing(m_MainWindowVM) AndAlso Not IsNothing(m_MainWindowVM.FiniteStateMachineManager) Then m_MainWindowVM.FiniteStateMachineManager.ResetFiniteStateMachineTimer()
|
||||
LuaManager.Close()
|
||||
EgtOutLog("Exit")
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
@@ -1,185 +0,0 @@
|
||||
<ResourceDictionary x:Class="Dictionary"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
>
|
||||
|
||||
<!--
|
||||
Assign a Key to every Panel ViewModel to use
|
||||
it in xaml file(ProjectView.xaml).
|
||||
-->
|
||||
<!--<local:FiveLakesUIVM x:Key="FiveLakesUIVM"/>
|
||||
<local:DoorListPageVM x:Key="DoorListVM"/>
|
||||
<local:MachinePageVM x:Key="MachinePageVM"/>-->
|
||||
|
||||
<!--Colori predefiniti-->
|
||||
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF4D84C4" />
|
||||
<SolidColorBrush x:Key="EgaltechBlue2" Color="#FF7096CE" />
|
||||
<SolidColorBrush x:Key="EgaltechBlue3" Color="#FF90ABD9" />
|
||||
<SolidColorBrush x:Key="EgaltechBlue4" Color="#FFB2C3E4" />
|
||||
<SolidColorBrush x:Key="EgaltechWhite" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="EgaltechGray" Color="#FF585858" />
|
||||
<SolidColorBrush x:Key="EgaltechLightGray" Color="LightGray" />
|
||||
<SolidColorBrush x:Key="EgaltechUltralightGray" Color="#FFF2F2F2" />
|
||||
<SolidColorBrush x:Key="EgaltechGreen" Color="#FF00FF00" />
|
||||
|
||||
<!--#92908d-->
|
||||
<Color x:Key="Icarus_Gray_Color" R="146" G="144" B="141" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_Gray" Color="{StaticResource Icarus_Gray_Color}" />
|
||||
<!--#3c89c9-->
|
||||
<Color x:Key="Icarus_LightBlue_Color" R="60" G="137" B="201" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_LightBlue" Color="{StaticResource Icarus_LightBlue_Color}" />
|
||||
<!--#2e5a81-->
|
||||
<Color x:Key="Icarus_Blue_Color" R="46" G="90" B="129" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_Blue" Color="{StaticResource Icarus_Blue_Color}" />
|
||||
<!--#50A388-->
|
||||
<Color x:Key="Icarus_Green_Color" R="80" G="163" B="136" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_Green" Color="{StaticResource Icarus_Green_Color}" />
|
||||
<!--#BC373E-->
|
||||
<Color x:Key="Icarus_Orange_Color" R="188" G="55" B="62" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_Orange" Color="{StaticResource Icarus_Orange_Color}" />
|
||||
<!--#A74C77-->
|
||||
<Color x:Key="Icarus_Purple_Color" R="167" G="76" B="119" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_Purple" Color="{StaticResource Icarus_Purple_Color}" />
|
||||
|
||||
<!--Colori per EgtWPFLib5-->
|
||||
<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
|
||||
|
||||
<!--Risorsa che toglie le animazioni dai menù popup per evitare che i menù mru di scelta dei file rimangano aperti se il file è grosso -->
|
||||
<!--o viene eseguito un lua che non aggiorna l'interfaccia-->
|
||||
<PopupAnimation x:Key="{x:Static SystemParameters.MenuPopupAnimationKey}">None</PopupAnimation>
|
||||
|
||||
<!--convertert per visibilita' stringa di testo con misure in StatusBar-->
|
||||
<!--
|
||||
<PrintApp:StringToVisibilityConverter x:Key="StringToVisibilityConverter"/>-->
|
||||
|
||||
<GridLength x:Key="TitleBarHeight">30</GridLength>
|
||||
<Thickness x:Key="WindowBorder_Thickness">2</Thickness>
|
||||
<sys:Double x:Key="WindowBorder_Height">2</sys:Double>
|
||||
|
||||
<Style x:Key="MainWindow" TargetType="{x:Type Window}">
|
||||
<Setter Property="WindowChrome.WindowChrome">
|
||||
<Setter.Value>
|
||||
<WindowChrome CaptionHeight="32"
|
||||
GlassFrameThickness="0"
|
||||
CornerRadius="0"
|
||||
ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Window}">
|
||||
<Border BorderThickness="0"
|
||||
BorderBrush="LightGray"
|
||||
Background="{TemplateBinding Background}">
|
||||
<!--<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ContentPresenter Grid.Row="1"
|
||||
Content="{TemplateBinding Content}"/>
|
||||
</Grid>-->
|
||||
<ContentPresenter Grid.Row="1"
|
||||
Content="{TemplateBinding Content}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="WindowState" Value="Maximized">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Window}">
|
||||
<Border BorderThickness="7"
|
||||
BorderBrush="LightGray"
|
||||
Background="{TemplateBinding Background}">
|
||||
<!--<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ContentPresenter Grid.Row="1"
|
||||
Content="{TemplateBinding Content}"/>
|
||||
</Grid>-->
|
||||
<ContentPresenter Grid.Row="1"
|
||||
Content="{TemplateBinding Content}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TitleBarButtonStyle" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource WindowTextBrush}" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border
|
||||
x:Name="border"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
SnapsToDevicePixels="true">
|
||||
<ContentPresenter
|
||||
x:Name="contentPresenter"
|
||||
Margin="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="{DynamicResource MouseOverOverlayBackgroundBrush}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="{DynamicResource PressedOverlayBackgroundBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TitleBarCloseButtonStyle" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border
|
||||
x:Name="border"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
SnapsToDevicePixels="true">
|
||||
<ContentPresenter
|
||||
x:Name="contentPresenter"
|
||||
Margin="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="{DynamicResource MouseOverWindowCloseButtonBackgroundBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource MouseOverWindowCloseButtonForegroundBrush}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="{DynamicResource PressedWindowCloseButtonBackgroundBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource MouseOverWindowCloseButtonForegroundBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,129 +0,0 @@
|
||||
Imports System.Globalization
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Text
|
||||
|
||||
Public Module GenInterface
|
||||
|
||||
'-------------------------------- IniFile : Get --------------------------------------------------
|
||||
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
|
||||
Public Function GetPrivateProfileInt(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
nDefault As Integer,
|
||||
lpFileName As String) As Integer
|
||||
End Function
|
||||
|
||||
Public Function GetPrivateProfileDouble(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
dDefault As Double,
|
||||
lpFileName As String) As Double
|
||||
Dim sValue As String = String.Empty
|
||||
GetPrivateProfileString(lpAppName, lpKeyName, dDefault.ToString(), sValue, lpFileName)
|
||||
Dim nPos As Integer = sValue.IndexOf(";")
|
||||
If nPos >= 0 Then
|
||||
sValue = sValue.Remove(nPos)
|
||||
End If
|
||||
Dim dValue As Double
|
||||
If Not Double.TryParse(sValue, NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, dValue) Then
|
||||
dValue = dDefault
|
||||
End If
|
||||
Return dValue
|
||||
End Function
|
||||
|
||||
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
|
||||
Private Function GetPrivateProfileString(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
lpDefault As String,
|
||||
lpReturnedString As StringBuilder,
|
||||
nSize As Integer,
|
||||
lpFileName As String) As Integer
|
||||
End Function
|
||||
Public Function GetPrivateProfileString(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
lpDefault As String,
|
||||
ByRef lpString As String,
|
||||
lpFileName As String) As Integer
|
||||
Dim sb As New StringBuilder(1024)
|
||||
Dim nRet As Integer = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, sb, sb.Capacity, lpFileName)
|
||||
lpString = sb.ToString
|
||||
Return nRet
|
||||
End Function
|
||||
|
||||
Public Function GetPrivateProfileWinPos(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
ByRef nFlag As Integer,
|
||||
ByRef nLeft As Integer,
|
||||
ByRef nTop As Integer,
|
||||
ByRef nWidth As Integer,
|
||||
ByRef nHeight As Integer,
|
||||
lpFileName As String) As Boolean
|
||||
Dim sVal As String = String.Empty
|
||||
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
||||
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
If sItems.Count() >= 5 Then
|
||||
Dim bOk As Boolean = True
|
||||
If Not Integer.TryParse(sItems(0), nFlag) Then
|
||||
nFlag = 0
|
||||
bOk = False
|
||||
End If
|
||||
If Not Integer.TryParse(sItems(1), nLeft) Then
|
||||
nLeft = 0
|
||||
bOk = False
|
||||
End If
|
||||
If Not Integer.TryParse(sItems(2), nTop) Then
|
||||
nTop = 0
|
||||
bOk = False
|
||||
End If
|
||||
If Not Integer.TryParse(sItems(3), nWidth) Then
|
||||
nWidth = 1024
|
||||
bOk = False
|
||||
End If
|
||||
If Not Integer.TryParse(sItems(4), nHeight) Then
|
||||
nHeight = 768
|
||||
bOk = False
|
||||
End If
|
||||
Return bOk
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
'-------------------------------- IniFile : Write ------------------------------------------------
|
||||
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
|
||||
Public Function WritePrivateProfileString(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
lpString As String,
|
||||
lpFileName As String) As Boolean
|
||||
End Function
|
||||
|
||||
Public Function WritePrivateProfileWinPos(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
nFlag As Integer,
|
||||
nLeft As Integer,
|
||||
nTop As Integer,
|
||||
nWidth As Integer,
|
||||
nHeight As Integer,
|
||||
lpFileName As String) As Boolean
|
||||
Dim sVal As String
|
||||
sVal = nFlag.ToString & "," & nLeft.ToString & "," & nTop.ToString & "," & nWidth.ToString & "," & nHeight.ToString
|
||||
Return WritePrivateProfileString(lpAppName, lpKeyName, sVal, lpFileName)
|
||||
End Function
|
||||
|
||||
'-------------------------------- Windows --------------------------------------------------------
|
||||
Public Enum SW As Integer
|
||||
HIDE = 0
|
||||
SHOWMAXIMIZED = 3
|
||||
RESTORE = 9
|
||||
End Enum
|
||||
|
||||
<DllImport("user32.dll")>
|
||||
Public Function ShowWindow(hWnd As IntPtr, nCmdShow As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
|
||||
End Module
|
||||
@@ -1,74 +0,0 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' EgalTech 2017-2017
|
||||
'----------------------------------------------------------------------------
|
||||
' File : IniFile.vb Data : 08.05.24 Versione : 2.6e1
|
||||
' Contenuto : Modulo IniFile per gestione lettura/scrittura da file INI.
|
||||
'
|
||||
'
|
||||
'
|
||||
' Modifiche : 08.05.24 ES Creazione modulo.
|
||||
'
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
|
||||
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Module IniFile
|
||||
|
||||
Private m_sPath As String
|
||||
Public ReadOnly Property sPath As String
|
||||
Get
|
||||
Return m_sPath
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetIniFile(sPath)
|
||||
m_sPath = sPath
|
||||
End Sub
|
||||
|
||||
Public Function GetMainPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer
|
||||
Return GetPrivateProfileInt(IpAppName, IpKeyName, nDefault, m_sPath)
|
||||
End Function
|
||||
|
||||
Public Function GetMainPrivateProfileDouble(IpAppName As String, IpKeyName As String, dDefault As Double) As Double
|
||||
Return GetPrivateProfileDouble(IpAppName, IpKeyName, dDefault, m_sPath)
|
||||
End Function
|
||||
|
||||
Public Function GetMainPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
|
||||
Return GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sPath)
|
||||
End Function
|
||||
|
||||
Public Function GetMainPrivateProfileWinPos(IpAppName As String, IpKeyName As String, ByRef nFlag As Integer, ByRef nLeft As Integer, ByRef nTop As Integer, ByRef nWidth As Integer, ByRef nHeight As Integer) As Boolean
|
||||
Return GetPrivateProfileWinPos(IpAppName, IpKeyName, nFlag, nLeft, nTop, nWidth, nHeight, m_sPath)
|
||||
End Function
|
||||
|
||||
'Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
|
||||
' Dim sVal As String = String.Empty
|
||||
' GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
||||
' Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
' If sItems.Count() = 2 Then
|
||||
' Return New Language(sItems(0), sItems(1))
|
||||
' End If
|
||||
' Return Nothing
|
||||
'End Function
|
||||
|
||||
'Public Function GetMainPrivateProfileLanguage(lpAppName As String, lpKeyName As String) As Language
|
||||
' Dim sVal As String = String.Empty
|
||||
' GetMainPrivateProfileString(lpAppName, lpKeyName, "", sVal)
|
||||
' Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
' If sItems.Count() = 2 Then
|
||||
' Return New Language(sItems(0), sItems(1))
|
||||
' End If
|
||||
' Return Nothing
|
||||
'End Function
|
||||
|
||||
Public Function WriteMainPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
|
||||
Return WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sPath)
|
||||
End Function
|
||||
|
||||
Public Function WriteMainPrivateProfileWinPos(IpAppName As String, IpKeyName As String, ByRef nFlag As Integer, ByRef nLeft As Integer, ByRef nTop As Integer, ByRef nWidth As Integer, ByRef nHeight As Integer) As Boolean
|
||||
Return WritePrivateProfileWinPos(IpAppName, IpKeyName, nFlag, nLeft, nTop, nWidth, nHeight, m_sPath)
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -1,94 +0,0 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' EgalTech 2017-2017
|
||||
'----------------------------------------------------------------------------
|
||||
' File : WinPos.vb Data : 08.04.17 Versione : 1.8d1
|
||||
' Contenuto : Classe WinPos per gestione posizione e dimensioni finestra.
|
||||
'
|
||||
'
|
||||
'
|
||||
' Modifiche : 08.04.17 ES Creazione modulo.
|
||||
'
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
|
||||
Public Module WinPosition
|
||||
|
||||
Public Class WinPos
|
||||
' Membri
|
||||
Public nFlag As Integer
|
||||
Public nLeft As Integer
|
||||
Public nTop As Integer
|
||||
Public nWidth As Integer
|
||||
Public nHeight As Integer
|
||||
|
||||
Public Sub ToWindow(Window As Window)
|
||||
' Verifico che il punto in alto a sinistra stia nello schermo
|
||||
Dim PtTL = New System.Drawing.Point(nLeft, nTop)
|
||||
Dim s As System.Windows.Forms.Screen = System.Windows.Forms.Screen.FromPoint(PtTL)
|
||||
If Not s.Bounds.Contains(PtTL) Then Return
|
||||
' Imposto posizione e dimensioni
|
||||
Window.WindowStartupLocation = WindowStartupLocation.Manual
|
||||
Window.Top = nTop
|
||||
Window.Left = nLeft
|
||||
Window.Height = nHeight
|
||||
Window.Width = nWidth
|
||||
Window.WindowState = If(nFlag = 1, WindowState.Maximized, WindowState.Normal)
|
||||
End Sub
|
||||
|
||||
Public Sub FromWindow(Window As Window)
|
||||
nTop = CInt(Window.Top)
|
||||
nLeft = CInt(Window.Left)
|
||||
nHeight = CInt(Window.Height)
|
||||
nWidth = CInt(Window.Width)
|
||||
nFlag = If(Window.WindowState = WindowState.Maximized, 1, 0)
|
||||
If Window.WindowState = WindowState.Maximized Then
|
||||
nHeight = CInt(Window.RestoreBounds.Height)
|
||||
nWidth = CInt(Window.RestoreBounds.Width)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Overloads Function FromIni(sSection As String, sKey As String) As Boolean
|
||||
Return GetMainPrivateProfileWinPos(sSection, sKey, nFlag, nLeft, nTop, nWidth, nHeight)
|
||||
End Function
|
||||
|
||||
Public Overloads Function FromIni(sSection As String, sKey As String, IpFileName As String) As Boolean
|
||||
Return GetMainPrivateProfileWinPos(sSection, sKey, nFlag, nLeft, nTop, nWidth, nHeight)
|
||||
End Function
|
||||
|
||||
Public Overloads Function ToIni(sSection As String, sKey As String) As Boolean
|
||||
Return WriteMainPrivateProfileWinPos(sSection, sKey, nFlag, nLeft, nTop, nWidth, nHeight)
|
||||
End Function
|
||||
|
||||
Public Overloads Function ToIni(sSection As String, sKey As String, IpFileName As String) As Boolean
|
||||
Return WriteMainPrivateProfileWinPos(sSection, sKey, nFlag, nLeft, nTop, nWidth, nHeight)
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Function WinPosFromIniToWindow(sSection As String, sKey As String, Window As Window) As Boolean
|
||||
Dim WinPos As New WinPos
|
||||
If Not WinPos.FromIni(sSection, sKey) Then Return False
|
||||
WinPos.ToWindow(Window)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function WinPosFromIniToWindow(sSection As String, sKey As String, Window As Window, IpFileName As String) As Boolean
|
||||
Dim WinPos As New WinPos
|
||||
If Not WinPos.FromIni(sSection, sKey, IpFileName) Then Return False
|
||||
WinPos.ToWindow(Window)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function WinPosFromWindowToIni(Window As Window, sSection As String, sKey As String) As Boolean
|
||||
Dim WinPos As New WinPos
|
||||
WinPos.FromWindow(Window)
|
||||
Return WinPos.ToIni(sSection, sKey)
|
||||
End Function
|
||||
|
||||
Public Function WinPosFromWindowToIni(Window As Window, sSection As String, sKey As String, IpFileName As String) As Boolean
|
||||
Dim WinPos As New WinPos
|
||||
WinPos.FromWindow(Window)
|
||||
Return WinPos.ToIni(sSection, sKey, IpFileName)
|
||||
End Function
|
||||
|
||||
End Module
|
||||
Reference in New Issue
Block a user