Просмотр исходного кода

Redirected PRS.Avalonia.Desktop and PRSDigitalKey.Desktop binaries to PRSDesktop output folder
Added launch buttons to Issues grid for Mobile Apps
Fixed some broken Bluetooth Guids

frankvandenbos 10 месяцев назад
Родитель
Сommit
72e9149718

+ 3 - 3
PRS.Avalonia/PRS.Avalonia.Desktop/PRS.Avalonia.Desktop.csproj

@@ -4,8 +4,8 @@
         <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
         <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
         <Nullable>enable</Nullable>
         <Nullable>enable</Nullable>
         <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
         <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
-        <Platforms>x86;x64;arm64</Platforms>
-        <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
+        <Platforms>x64</Platforms>
+        <RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
         <UseWinUI>true</UseWinUI>
         <UseWinUI>true</UseWinUI>
         <WindowsPackaging>None</WindowsPackaging>
         <WindowsPackaging>None</WindowsPackaging>
         <EnableMsixTooling>true</EnableMsixTooling>
         <EnableMsixTooling>true</EnableMsixTooling>
@@ -16,7 +16,7 @@
     </PropertyGroup>
     </PropertyGroup>
 
 
     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-      <OutputPath>bin\Debug\</OutputPath>
+      <OutputPath>..\..\prs.desktop\bin\Debug\net8.0-windows\PRSAvalonia\</OutputPath>
     </PropertyGroup>
     </PropertyGroup>
 
 
     <ItemGroup>
     <ItemGroup>

+ 2 - 7
PRS.Avalonia/PRS.Avalonia/Modules/EquipmentModule/EquipmentList/EquipmentListViewModel.cs

@@ -58,7 +58,7 @@ public partial class EquipmentListViewModel : ModuleViewModel
     protected override async Task OnActivated()
     protected override async Task OnActivated()
     {
     {
         PlatformTools.Bluetooth.Changed += BTChanged;
         PlatformTools.Bluetooth.Changed += BTChanged;
-        await PlatformTools.Bluetooth.StartScanningAsync(DigitalKey.ConfigServiceId);
+        await PlatformTools.Bluetooth.StartScanningAsync(PlatformTools.DigitalKeyServiceId);
         await base.OnActivated();
         await base.OnActivated();
     }
     }
 
 
@@ -115,11 +115,6 @@ public partial class EquipmentListViewModel : ModuleViewModel
         if (device == null)
         if (device == null)
             return;
             return;
         
         
-        var _time = DateTimeOffset.Now.ToUnixTimeSeconds();
-        var code = Authenticator.GenerateGoogleAuthenticatorCode(shell.ID.ToByteArray());
-
-        return;
-        
         bActive = true;
         bActive = true;
         _connectedDevice = await PlatformTools.Bluetooth.Connect(device);
         _connectedDevice = await PlatformTools.Bluetooth.Connect(device);
 
 
@@ -127,7 +122,7 @@ public partial class EquipmentListViewModel : ModuleViewModel
         {
         {
             var cmd = new Dictionary<string, long>() { { "Relay00", 15000 },  { "Relay01", 0 } , { "Relay02", 0 } , { "Relay03", 0 } , { "Relay4", 0 },  { "Relay05", 0 }  };
             var cmd = new Dictionary<string, long>() { { "Relay00", 15000 },  { "Relay01", 0 } , { "Relay02", 0 } , { "Relay03", 0 } , { "Relay4", 0 },  { "Relay05", 0 }  };
             var json = Serialization.Serialize(cmd);
             var json = Serialization.Serialize(cmd);
-            await _connectedDevice.WriteStringAsync(shell.ID, DigitalKey.ControlCharacteristicId, json);
+            await _connectedDevice.WriteStringAsync(shell.ID, PlatformTools.DigitalKeyControlId, json);
         }
         }
         
         
     }
     }

+ 3 - 3
PRS.DigitalKey/Prs.DigitalKey.Desktop/Prs.DigitalKey.Desktop.csproj

@@ -4,8 +4,8 @@
         <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
         <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
         <Nullable>enable</Nullable>
         <Nullable>enable</Nullable>
         <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
         <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
-        <Platforms>x86;x64;arm64</Platforms>
-        <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
+        <Platforms>x64</Platforms>
+        <RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
         <UseWinUI>true</UseWinUI>
         <UseWinUI>true</UseWinUI>
         <WindowsPackaging>None</WindowsPackaging>
         <WindowsPackaging>None</WindowsPackaging>
         <EnableMsixTooling>true</EnableMsixTooling>
         <EnableMsixTooling>true</EnableMsixTooling>
@@ -16,7 +16,7 @@
     </PropertyGroup>
     </PropertyGroup>
 
 
     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-        <OutputPath>bin\Debug\</OutputPath>
+        <OutputPath>..\..\prs.desktop\bin\Debug\net8.0-windows\PRSDigitalKey</OutputPath>
     </PropertyGroup>
     </PropertyGroup>
 
 
     <ItemGroup>
     <ItemGroup>

+ 37 - 1
prs.desktop/Forms/Issues/IssuesGrid.cs

@@ -50,9 +50,15 @@ public class IssuesGrid : DynamicGrid<Kanban>, ISpecificGrid
     //     PropertyType = typeof(string),
     //     PropertyType = typeof(string),
     //     ClassType = typeof(Kanban)
     //     ClassType = typeof(Kanban)
     // };
     // };
+    
+    private String _baseDirectory;
 
 
     public IssuesGrid() : base()
     public IssuesGrid() : base()
     {
     {
+        
+    
+        
+        
         var cols = LookupFactory.DefineColumns<Kanban>();
         var cols = LookupFactory.DefineColumns<Kanban>();
 
 
         // Minimum Columns for Lookup values
         // Minimum Columns for Lookup values
@@ -68,6 +74,8 @@ public class IssuesGrid : DynamicGrid<Kanban>, ISpecificGrid
     {
     {
         private IssuesGrid Grid;
         private IssuesGrid Grid;
 
 
+        
+
         public UIComponent(IssuesGrid grid)
         public UIComponent(IssuesGrid grid)
         {
         {
             Grid = grid;
             Grid = grid;
@@ -100,8 +108,36 @@ public class IssuesGrid : DynamicGrid<Kanban>, ISpecificGrid
 
 
         AddButton("Check for Updates", PRSDesktop.Resources.autoupdate.AsBitmapImage(), CheckForUpdates);
         AddButton("Check for Updates", PRSDesktop.Resources.autoupdate.AsBitmapImage(), CheckForUpdates);
         AddButton("Open Support Session", PRSDesktop.Resources.appicon.AsBitmapImage(), OpenSupportSession);
         AddButton("Open Support Session", PRSDesktop.Resources.appicon.AsBitmapImage(), OpenSupportSession);
-    }
+        
+        _baseDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) ?? "";
+        if (File.Exists(Path.Combine(_baseDirectory, "PRSAvalonia", "net8.0-windows10.0.19041.0",
+                "PRS.Avalonia.Desktop.exe")))
+        {
+            var btn = AddButton("PRS Mobile App", PRSDesktop.Resources.map.AsBitmapImage(), LaunchPRSMobile);
+            btn.Margin = new Thickness(20, btn.Margin.Top, btn.Margin.Right, btn.Margin.Bottom);
+        }
 
 
+        if (File.Exists(Path.Combine(_baseDirectory, "PRSDigitalKey", "net8.0-windows10.0.19041.0", "PRS.DigitalKey.Desktop.exe")))
+            AddButton("PRS Digital Key App", PRSDesktop.Resources.key.AsBitmapImage(), LaunchPRSDigitalKey);
+    }
+    
+    private bool LaunchPRSMobile(Button button, CoreRow[] rows)
+    {
+        var _mobileApp = System.IO.Path.Combine(_baseDirectory, "PRSAvalonia", "net8.0-windows10.0.19041.0", "PRS.Avalonia.Desktop.exe");
+        var _info = new ProcessStartInfo(_mobileApp);
+        Process.Start(_info);
+        return false;
+    }
+    
+    private bool LaunchPRSDigitalKey(Button button, CoreRow[] rows)
+    {
+        
+        var _mobileApp = Path.Combine(_baseDirectory, "PRSDigitalKey", "net8.0-windows10.0.19041.0", "PRS.DigitalKey.Desktop.exe");
+        var _info = new ProcessStartInfo(_mobileApp);
+        Process.Start(_info);
+        return false;
+    }
+    
     private bool OpenSupportSession(Button button, CoreRow[] rows)
     private bool OpenSupportSession(Button button, CoreRow[] rows)
     {
     {
         SupportUtils.OpenSupportSession();
         SupportUtils.OpenSupportSession();